From f65e1b0ffbd3b33c22c0b88d4e831ada886e3c04 Mon Sep 17 00:00:00 2001 From: JP Cen Date: Sun, 5 May 2024 18:22:33 -0400 Subject: [PATCH] 0.9.18 --- main.js | 5006 ++++++++++++++++++++++++++----------------------- manifest.json | 2 +- styles.css | 69 +- 3 files changed, 2745 insertions(+), 2332 deletions(-) diff --git a/main.js b/main.js index 5fea67e..8a2814c 100644 --- a/main.js +++ b/main.js @@ -15492,7 +15492,7 @@ var require_lodash = __commonJS({ result2.placeholder = curryRight.placeholder; return result2; } - function debounce6(func, wait, options) { + function debounce7(func, wait, options) { var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); @@ -15672,7 +15672,7 @@ var require_lodash = __commonJS({ leading = "leading" in options ? !!options.leading : leading; trailing = "trailing" in options ? !!options.trailing : trailing; } - return debounce6(func, wait, { + return debounce7(func, wait, { "leading": leading, "maxWait": wait, "trailing": trailing @@ -16686,7 +16686,7 @@ var require_lodash = __commonJS({ lodash.create = create2; lodash.curry = curry; lodash.curryRight = curryRight; - lodash.debounce = debounce6; + lodash.debounce = debounce7; lodash.defaults = defaults; lodash.defaultsDeep = defaultsDeep; lodash.defer = defer; @@ -20519,7 +20519,7 @@ var require_classnames = __commonJS({ (function() { "use strict"; var hasOwn3 = {}.hasOwnProperty; - function classNames10() { + function classNames11() { var classes = ""; for (var i3 = 0; i3 < arguments.length; i3++) { var arg = arguments[i3]; @@ -20537,7 +20537,7 @@ var require_classnames = __commonJS({ return ""; } if (Array.isArray(arg)) { - return classNames10.apply(null, arg); + return classNames11.apply(null, arg); } if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) { return arg.toString(); @@ -20560,14 +20560,14 @@ var require_classnames = __commonJS({ return value + newClass; } if (typeof module2 !== "undefined" && module2.exports) { - classNames10.default = classNames10; - module2.exports = classNames10; + classNames11.default = classNames11; + module2.exports = classNames11; } else if (typeof define === "function" && typeof define.amd === "object" && define.amd) { define("classnames", [], function() { - return classNames10; + return classNames11; }); } else { - window.classNames = classNames10; + window.classNames = classNames11; } })(); } @@ -29485,6 +29485,22 @@ var T = class { }; var i18n_default = new T().texts; +// src/core/utils/spaces/space.ts +var pathIsSpace = (superstate, path) => { + if (!path) + return false; + return superstate.spacesIndex.has(path); +}; +var spaceFolderPathFromSpace = (path, manager) => { + if (manager.superstate.settings.spacesMDBInHidden) { + if (path == "/") + return ".space/"; + return path + ".space/"; + } + return path; +}; +var folderForTagSpace = (space2, settings) => settings.spacesFolder + "/" + space2; + // src/core/types/context.ts var PathPropertyName = "File"; @@ -31649,13 +31665,13 @@ var propertyIsObjectType = (property) => { // src/utils/serializers.ts var serializeMultiDisplayString = (value) => value.map((f2) => f2.replace(",", "\\,")).join(", "); -var serializeMultiString = (value) => value.map((f2) => f2.replace(",", "\\,")).join(", "); +var serializeMultiString = (value) => value?.map((f2) => f2.replace(",", "\\,")).join(", ") ?? ""; var serializeSQLValues = (value) => value.join(", "); var serializeSQLStatements = (value) => value.join("; "); var serializeSQLFieldNames = (value) => value.join(","); // src/utils/parsers.ts -var parseMultiString = (str) => (str?.replace("\\,", ",").match(/(\\.|[^,])+/g) ?? []).map((f2) => f2.trim()); +var parseMultiString = (str) => (str?.replace("\\,", ",")?.match(/(\\.|[^,])+/g) ?? []).map((f2) => f2.trim()); var parseProperty = (field, value) => { const YAMLtype = detectPropertyType(value, field); switch (YAMLtype) { @@ -31988,6 +32004,651 @@ var renamePathWithExtension = (path, newName) => { return dir.length > 0 ? `${dir}/${newName}${ext}` : `${newName}${ext}`; }; +// src/core/superstate/utils/path.ts +var renamePathByName = async (superstate, oldPath, newName) => { + if (superstate.spacesIndex.has(oldPath)) { + const spaceState = superstate.spacesIndex.get(oldPath); + if (spaceState.type == "tag") { + return renameTag(superstate, spaceState.name, newName); + } + return superstate.spaceManager.renameSpace(oldPath, renamePathWithoutExtension(oldPath, newName)); + } else { + return superstate.spaceManager.renamePath(oldPath, renamePathWithExtension(oldPath, newName)); + } +}; +var hidePath = async (superstate, path) => { + superstate.settings.hiddenFiles = uniq([ + ...superstate.settings.hiddenFiles, + path + ]); + superstate.saveSettings(); + superstate.reloadPath(path, true).then((f2) => superstate.dispatchEvent("superstateUpdated", null)); +}; +var hidePaths = async (superstate, paths) => { + superstate.settings.hiddenFiles = uniq([ + ...superstate.settings.hiddenFiles, + ...paths + ]); + superstate.saveSettings(); + Promise.all(paths.map((path) => { + superstate.reloadPath(path, true); + })).then((f2) => superstate.dispatchEvent("superstateUpdated", null)); +}; +var deletePath = async (superstate, path) => { + superstate.spaceManager.deletePath(path); + superstate.onPathDeleted(path); +}; +var movePathToSpace = async (superstate, oldPath, newParent) => { + return superstate.spaceManager.renamePath(oldPath, movePath(oldPath, newParent)); +}; +var convertPathToSpace = async (superstate, path, open) => { + const pathState = superstate.pathsIndex.get(path); + if (!pathState) { + return; + } + const newPath = pathState.parent + "/" + pathState.name; + await superstate.spaceManager.createSpace(pathState.name, pathState.parent, {}); + await superstate.spaceManager.renamePath(path, newPath + "/" + pathState.metadata?.file?.name + ".md"); + if (open) { + superstate.ui.openPath(newPath, false); + } +}; + +// src/core/schemas/parseFieldValue.ts +var allActions = (superstate, path) => { + const stringForType = (type) => { + if (type == "builtin") { + return "Builtin"; + } + if (type == "api") { + return "Spaces"; + } + return "Action"; + }; + return [...(superstate.actionsIndex.get(path) ?? []).map((g) => ({ name: g.schema.name, description: "Action", value: `${path}/#;${g.schema.id}`, section: "Action" })) ?? [], ...[...superstate.cli.allCommands()].map((g) => ({ name: g.schema.name, description: stringForType(g.schema.type), value: g.path, section: stringForType(g.schema.type) }))]; +}; +var convertFileProp = ({ field, value }) => { + if (value == "ctime") + return { value: `parseDate(prop('${field}')['metadata']['file']['${value}'])`, type: "date" }; + return { value: `prop('${field}')['metadata']['file']['${value}']`, type: "string" }; +}; +var parseFieldValue = (value, type, superstate, path) => { + let valueProp = safelyParseJSON(value); + if (valueProp) { + if (type == "fileprop") { + if (valueProp.field) + return convertFileProp(valueProp); + } + if (type == "option" && valueProp.source?.length > 0) { + if (valueProp.source == "$commands") { + valueProp.options = superstate.cli.allCommands(); + } else if (valueProp.source == "$links") { + valueProp.options = superstate.spaceManager.allPaths().map((f2) => ({ name: f2, value: f2 })); + } else if (valueProp.source == "$super") { + valueProp.options = allActions(superstate, path); + } + } + return [...fieldTypeForType(type).configKeys ?? [], "alias", "default"].reduce((p, c3) => ({ ...p, [c3]: valueProp[c3] }), {}); + } + if (!type) + return {}; + if (!valueProp) { + if (type == "context") { + if (value?.length > 0) { + valueProp = { + space: value + }; + } else { + valueProp = {}; + } + } else if (type.startsWith("date")) { + if (value?.length > 0) { + valueProp = { + format: value + }; + } else { + valueProp = {}; + } + } else if (type.startsWith("fileprop")) { + if (value?.length > 0) { + const [field, val] = value.split("."); + valueProp = convertFileProp({ field, value: val }); + } else { + valueProp = {}; + } + } else if (type.startsWith("option")) { + if (value?.length > 0) { + const options = parseMultiString(value).map((f2) => ({ name: f2, value: f2 })); + valueProp = { + options + }; + } else { + valueProp = {}; + } + } + } + return valueProp ?? {}; +}; + +// src/schemas/mdb.ts +var fieldTypeForField = (f2) => { + if (!f2) + return null; + return f2.type == "fileprop" ? parseFieldValue(f2.value, "fileprop")?.type ?? "text" : f2.type; +}; +var stickerForField = (f2) => f2.attrs?.length > 0 ? safelyParseJSON(f2.attrs)?.icon ?? fieldTypeForType(f2.type, f2.name)?.icon : fieldTypeForType(f2.type, f2.name)?.icon; +var stickerForSchema = (f2) => f2.def?.icon?.length > 0 ? f2.def?.icon : "ui//layout-list"; +var fieldTypeForType = (type, name317) => name317 == PathPropertyName ? fieldTypes.find((t5) => t5.type == "file") : name317 == "tags" ? fieldTypes.find((t5) => t5.type == "tags") : name317 == "aliases" ? fieldTypes.find((t5) => t5.type == "option-multi") : name317 == "sticker" ? fieldTypes.find((t5) => type == "icon") : fieldTypes.find((t5) => type == t5.type) || fieldTypes.find((t5) => type == t5.multiType); +var fieldTypes = [ + { + type: "unknown", + label: "", + restricted: true, + icon: "ui//file-question" + }, + { + type: "text", + label: i18n_default.properties.text.label, + metadata: true, + icon: "ui//text", + primative: true, + description: i18n_default.properties.text.description + }, + { + type: "number", + label: i18n_default.properties.number.label, + metadata: true, + icon: "ui//binary", + configKeys: ["unit"], + primative: true, + description: i18n_default.properties.number.description + }, + { + type: "boolean", + label: i18n_default.properties.boolean.label, + metadata: true, + icon: "ui//check-square", + primative: true, + description: i18n_default.properties.boolean.description + }, + { + type: "date", + label: i18n_default.properties.date.label, + metadata: true, + icon: "ui//calendar", + configKeys: ["format"], + primative: true, + description: i18n_default.properties.date.description + }, + { + type: "option", + label: i18n_default.properties.option.label, + multi: true, + multiType: "option-multi", + icon: "ui//list", + configKeys: ["options", "source"], + description: i18n_default.properties.option.description + }, + { + type: "tags", + label: i18n_default.properties.tags.label, + icon: "ui//tags", + description: i18n_default.properties.tags.description + }, + { + type: "file", + label: i18n_default.properties.file.label, + restricted: true, + icon: "ui//mk-make-h3" + }, + { + type: "fileprop", + label: i18n_default.properties.fileProperty.label, + icon: "ui//formula", + configKeys: ["field", "value", "type"], + description: i18n_default.properties.fileProperty.description + }, + { + type: "link", + label: i18n_default.properties.link.label, + multi: true, + multiType: "link-multi", + metadata: true, + icon: "ui//file-text", + primative: true, + description: i18n_default.properties.link.description + }, + { + type: "context", + label: i18n_default.properties.context.label, + icon: "ui//mk-make-note", + multi: true, + multiType: "context-multi", + configKeys: ["space"], + description: i18n_default.properties.context.description + }, + { + type: "object", + label: i18n_default.properties.object.label, + multi: true, + multiType: "object-multi", + metadata: true, + icon: "ui//list-tree", + configKeys: ["type"], + description: i18n_default.properties.object.description + }, + { + type: "icon", + label: i18n_default.properties.icon.label, + multi: true, + multiType: "icon-multi", + icon: "ui//gem", + restricted: true, + primative: true, + description: i18n_default.properties.icon.description + }, + { + type: "image", + label: i18n_default.properties.image.label, + multi: true, + multiType: "image-multi", + metadata: true, + icon: "ui//mk-make-image", + primative: true, + description: i18n_default.properties.image.description + }, + { + type: "color", + label: i18n_default.properties.color.label, + icon: "ui//mk-make-image", + restricted: true, + description: i18n_default.properties.color.description + }, + { + type: "space", + label: i18n_default.properties.space.label, + icon: "ui//layout-grid", + restricted: true, + description: i18n_default.properties.space.description + }, + { + type: "table", + label: i18n_default.properties.space.label, + icon: "ui//layout-grid", + restricted: true, + description: i18n_default.properties.space.description + }, + { + type: "super", + label: i18n_default.properties.super.label, + icon: "ui//zap", + restricted: true, + configKeys: ["dynamic", "field"] + }, + { + type: "input", + label: i18n_default.properties.super.label, + icon: "ui//input", + restricted: true + } +]; +var defaultContextSchemaID = "files"; +var defaultContextDBSchema = { + id: defaultContextSchemaID, + name: "Files", + type: "db", + primary: "true" +}; +var defaultFrameListViewID = "filesView"; +var defaultFrameListViewSchema = { + id: defaultFrameListViewID, + name: "All", + type: "view", + def: JSON.stringify({ db: defaultContextSchemaID, icon: "ui//file-stack" }) +}; +var mainFrameID = "main"; +var defaultMainFrameSchema = (id3) => ({ id: id3, name: id3, type: "frame", def: "", predicate: "", primary: "true" }); +var defaultFramesTable = { + uniques: [], + cols: ["id", "name", "type", "def", "predicate", "primary"], + rows: [defaultMainFrameSchema(mainFrameID), defaultFrameListViewSchema] +}; +var defaultContextTable = { + uniques: [], + cols: ["id", "name", "type", "def", "predicate", "primary"], + rows: [defaultContextDBSchema] +}; +var fieldSchema = { + uniques: ["name,schemaId"], + cols: [ + "name", + "schemaId", + "type", + "value", + "attrs", + "hidden", + "unique", + "primary" + ] +}; +var defaultContextFields = { + ...fieldSchema, + rows: [ + { + name: PathPropertyName, + schemaId: defaultContextSchemaID, + type: "file", + primary: "true", + hidden: "", + unique: "", + attrs: "", + value: "" + }, + { + name: i18n_default.properties.fileProperty.createdTime, + schemaId: defaultContextSchemaID, + type: "fileprop", + value: PathPropertyName + ".ctime", + hidden: "", + unique: "", + attrs: "", + primary: "true" + } + ] +}; +var defaultFieldsForContext = (space2) => { + return defaultContextFields; +}; +var defaultTableFields = [ + { + name: i18n_default.properties.defaultField, + schemaId: "", + type: "text", + primary: "true" + } +]; +var defaultTagFields = { + ...fieldSchema, + rows: [ + { + name: PathPropertyName, + schemaId: defaultContextSchemaID, + type: "file", + primary: "true", + hidden: "", + unique: "", + attrs: "", + value: "" + } + ] +}; +var defaultMDBTableForContext = (space2) => { + return defaultFolderMDBTable; +}; +var defaultFolderMDBTable = { + schema: defaultContextDBSchema, + cols: defaultContextFields.rows, + rows: [] +}; +var defaultQueryMDBTable = { + schema: defaultContextDBSchema, + cols: defaultContextFields.rows, + rows: [] +}; +var defaultTagMDBTable = { + schema: defaultContextDBSchema, + cols: defaultTagFields.rows, + rows: [] +}; +var fieldsToTable = (fields, schemas) => { + return fields.filter((s4) => schemas.find((g) => g.id == s4.schemaId && g.type == "db")).reduce((p, c3) => { + return { + ...p, + ...p[c3.schemaId] ? { + [c3.schemaId]: { + uniques: c3.unique == "true" ? [...p[c3.schemaId].uniques, c3.name] : p[c3.schemaId].uniques, + cols: [...p[c3.schemaId].cols, c3.name], + rows: [] + } + } : { + [c3.schemaId]: { + uniques: c3.unique == "true" ? [c3.name] : [], + cols: [c3.name], + rows: [] + } + } + }; + }, {}); +}; +var defaultTablesForContext = (space2) => { + return defaultFolderTables; +}; +var defaultFolderTables = { + m_schema: defaultContextTable, + m_fields: defaultContextFields, + ...fieldsToTable( + defaultContextFields.rows, + defaultContextTable.rows + ) +}; +var defaultTagTables = { + m_schema: defaultContextTable, + m_fields: defaultTagFields, + ...fieldsToTable( + defaultTagFields.rows, + defaultContextTable.rows + ) +}; + +// src/core/utils/contexts/optionValuesForColumn.ts +var optionValuesForColumn = (column, table) => { + return uniq( + table?.rows.reduce((p, c3) => { + return [...p, ...parseMultiString(c3[column])]; + }, []) ?? [] + ); +}; +var defaultTableDataForContext = (superstate, space2) => { + const paths = [...superstate.getSpaceItems(space2.path, true)]; + return { + ...defaultMDBTableForContext(space2), + rows: paths.map((f2) => ({ [PathPropertyName]: f2.path })) + }; +}; +var createNewRow = (mdb, row, index) => { + if (index) { + return { + ...mdb, + rows: insert(mdb.rows, index, row) + }; + } + return { + ...mdb, + rows: [...mdb.rows, row] + }; +}; +var renameTagSpacePath = async (superstate, tag2, newTag) => { + const spacePath = folderForTagSpace(tag2, superstate.settings); + if (await superstate.spaceManager.pathExists(spacePath)) { + superstate.spaceManager.renamePath(spacePath, pathToParentPath(spacePath) + "/" + newTag); + } else { + deletePath(superstate, spacePath); + } + superstate.onTagRenamed(tag2, newTag); +}; + +// src/utils/tags.ts +var renameTag = async (superstate, tag2, toTag) => { + const tags3 = getAllSubtags(superstate, tag2); + const newTag = ensureTag(validateName(toTag)); + const paths = superstate.spaceManager.pathsForTag(tag2); + for (const path of paths) { + superstate.spaceManager.renameTag(path, tag2, newTag); + } + await renameTagSpacePath(superstate, tag2, newTag); + for (const subtag of tags3) { + await renameTag(superstate, subtag, subtag.replace(tag2, newTag)); + } +}; +var getAllParentTags = (str) => { + if (str.startsWith("#")) { + str = str.slice(1); + } + const parts = str.split("/"); + const result = []; + for (let i3 = 0; i3 < parts.length - 1; i3++) { + if (i3 === 0) { + result.push(parts[i3]); + } else { + result.push(result[i3 - 1] + "/" + parts[i3]); + } + } + return result; +}; +var validateName = (tag2) => { + return tag2.trim(); +}; +var getAllSubtags = (superstate, tag2) => { + const tags3 = superstate.spaceManager.readTags(); + return tags3.filter((f2) => f2.startsWith(tag2) && f2 != tag2); +}; +var tagToTagPath = (tag2) => { + return encodeSpaceName(ensureTag(tag2)); +}; +var tagPathToTag = (string3) => { + return pathToString(string3).replace(/\+/g, "/"); +}; +var ensureTag = (tag2) => { + if (!tag2) + return null; + let string3 = tag2; + if (string3.charAt(0) != "#") + string3 = "#" + string3; + return string3; +}; +var stringFromTag = (string3) => { + if (string3.charAt(0) == "#") { + if (string3.charAt(1) == "#") { + return string3.substring(2, string3.length); + } + return string3.substring(1, string3.length); + } + return string3; +}; + +// src/core/spaceManager/filesystemAdapter/spaceInfo.ts +var fileSystemSpaceInfoFromTag = (manager, tag2, readOnly) => { + const path = tagSpacePathFromTag(tag2); + const folderPath = manager.superstate.settings.spacesFolder + "/" + tagToTagPath(tag2); + return { + name: tag2, + path, + isRemote: false, + readOnly, + folderPath, + defPath: `${folderPath}/${encodeSpaceName(tag2)}.md`, + framePath: spaceFolderPathFromSpace(folderPath + "/", manager) + "frames.mdb", + dbPath: spaceFolderPathFromSpace(folderPath + "/", manager) + manager.superstate.settings.folderContextFile + ".mdb", + commandsPath: spaceFolderPathFromSpace(folderPath + "/", manager) + "commands.mdb" + }; +}; +var fileSystemSpaceInfoByPath = (manager, contextPath) => { + if (!contextPath) + return; + if (contextPath == tagsSpacePath) { + const folderPath = manager.superstate.settings.spacesFolder + "/$tags"; + return { + name: "Tags", + path: "spaces://$tags", + isRemote: false, + readOnly: false, + folderPath, + defPath: `${folderPath}/$tags.md`, + framePath: spaceFolderPathFromSpace(folderPath + "/", manager) + "frames.mdb", + dbPath: spaceFolderPathFromSpace(folderPath + "/", manager) + manager.superstate.settings.folderContextFile + ".mdb", + commandsPath: spaceFolderPathFromSpace(folderPath + "/", manager) + "commands.mdb" + }; + } + const uri = manager.uriByString(contextPath); + const pathType = manager.spaceTypeByString(uri); + if (pathType == "folder") { + return fileSystemSpaceInfoFromFolder(manager, removeTrailingSlashFromFolder(uri.path)); + } else if (pathType == "tag") { + return fileSystemSpaceInfoFromTag(manager, uri.authority); + } else if (pathType == "vault") { + return fileSystemSpaceInfoFromFolder(manager, "/"); + } + return null; +}; +var fileSystemSpaceInfoFromFolder = (manager, folder, readOnly) => { + if (folder == "/") { + const vaultName = "Vault"; + return { + name: vaultName, + path: folder, + isRemote: false, + readOnly, + folderPath: folder, + defPath: vaultName + ".md", + dbPath: spaceFolderPathFromSpace(folder, manager) + manager.superstate.settings.folderContextFile + ".mdb", + framePath: spaceFolderPathFromSpace(folder, manager) + "views.mdb", + commandsPath: spaceFolderPathFromSpace(folder, manager) + "commands.mdb" + }; + } + const folderName = folderPathToString(folder); + return { + name: folderName, + path: folder, + isRemote: false, + readOnly, + folderPath: folder, + defPath: folder + "/" + folderName + ".md", + dbPath: spaceFolderPathFromSpace(folder + "/", manager) + manager.superstate.settings.folderContextFile + ".mdb", + framePath: spaceFolderPathFromSpace(folder + "/", manager) + "views.mdb", + commandsPath: spaceFolderPathFromSpace(folder + "/", manager) + "commands.mdb" + }; +}; + +// src/core/types/space.ts +var FMMetadataKeys = (settings) => [settings.fmKeyBanner, settings.fmKeySticker, settings.fmKeyColor]; +var tagsSpacePath = "spaces://$tags"; +var waypointsPath = { + name: i18n_default.menu.waypoints, + displayName: i18n_default.menu.waypoints, + path: "spaces://$waypoints", + label: { + name: i18n_default.menu.waypoints, + thumbnail: "", + sticker: "ui//tags", + color: "" + }, + type: "default" +}; +var tagsPath = { + name: i18n_default.menu.tags, + displayName: i18n_default.menu.tags, + path: "spaces://$tags", + label: { + thumbnail: "", + name: i18n_default.menu.tags, + sticker: "ui//tags", + color: "" + }, + type: "default" +}; +var vaultPath = { + name: i18n_default.menu.vault, + displayName: i18n_default.menu.vault, + path: "/", + label: { + thumbnail: "", + name: i18n_default.menu.vault, + sticker: "ui//vault", + color: "" + }, + type: "default" +}; + // src/core/spaceManager/spaceManager.ts var SpaceManager = class { constructor() { @@ -32008,6 +32669,10 @@ var SpaceManager = class { this.superstate.onPathRename(oldPath, path); }; this.onSpaceCreated = async (path) => { + if (path.startsWith(this.superstate.settings.spacesFolder)) { + this.onSpaceCreated(path.replace(this.superstate.settings.spacesFolder, "spaces:/")); + return; + } await this.superstate.reloadSpace(this.spaceInfoForPath(path), null, true); this.superstate.onPathCreated(path); }; @@ -32023,6 +32688,9 @@ var SpaceManager = class { this.superstate.onMetadataChange(path); }; this.spaceTypeByString = (uri) => { + if (uri.fullPath == tagsSpacePath) { + return "default"; + } if (uri.scheme == "space") { return "folder"; } @@ -36471,755 +37139,236 @@ function useSortable(_ref) { const shouldDisplaceDragSource = !useDragOverlay && isDragging; const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null; const strategy = localStrategy != null ? localStrategy : globalStrategy; - const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({ - rects: sortedRects, - activeNodeRect, - activeIndex, - overIndex, - index - }) : null; - const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({ - id: id3, - items, - activeIndex, - overIndex - }) : index; - const activeId = active == null ? void 0 : active.id; - const previous = (0, import_react6.useRef)({ - activeId, - items, - newIndex, - containerId - }); - const itemsHaveChanged = items !== previous.current.items; - const shouldAnimateLayoutChanges = animateLayoutChanges({ - active, - containerId, - isDragging, - isSorting, - id: id3, - index, - items, - newIndex: previous.current.newIndex, - previousItems: previous.current.items, - previousContainerId: previous.current.containerId, - transition, - wasDragging: previous.current.activeId != null - }); - const derivedTransform = useDerivedTransform({ - disabled: !shouldAnimateLayoutChanges, - index, - node, - rect - }); - (0, import_react6.useEffect)(() => { - if (isSorting && previous.current.newIndex !== newIndex) { - previous.current.newIndex = newIndex; - } - if (containerId !== previous.current.containerId) { - previous.current.containerId = containerId; - } - if (items !== previous.current.items) { - previous.current.items = items; - } - }, [isSorting, newIndex, containerId, items]); - (0, import_react6.useEffect)(() => { - if (activeId === previous.current.activeId) { - return; - } - if (activeId && !previous.current.activeId) { - previous.current.activeId = activeId; - return; - } - const timeoutId = setTimeout(() => { - previous.current.activeId = activeId; - }, 50); - return () => clearTimeout(timeoutId); - }, [activeId]); - return { - active, - activeIndex, - attributes, - data: data2, - rect, - index, - newIndex, - items, - isOver, - isSorting, - isDragging, - listeners, - node, - overIndex, - over, - setNodeRef, - setActivatorNodeRef, - setDroppableNodeRef, - setDraggableNodeRef, - transform: derivedTransform != null ? derivedTransform : finalTransform, - transition: getTransition() - }; - function getTransition() { - if (derivedTransform || itemsHaveChanged && previous.current.newIndex === index) { - return disabledTransition; - } - if (shouldDisplaceDragSource && !isKeyboardEvent(activatorEvent) || !transition) { - return void 0; - } - if (isSorting || shouldAnimateLayoutChanges) { - return CSS.Transition.toString({ - ...transition, - property: transitionProperty - }); - } - return void 0; - } -} -function normalizeLocalDisabled(localDisabled, globalDisabled) { - var _localDisabled$dragga, _localDisabled$droppa; - if (typeof localDisabled === "boolean") { - return { - draggable: localDisabled, - droppable: false - }; - } - return { - draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable, - droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable - }; -} -function hasSortableData(entry) { - if (!entry) { - return false; - } - const data2 = entry.data.current; - if (data2 && "sortable" in data2 && typeof data2.sortable === "object" && "containerId" in data2.sortable && "items" in data2.sortable && "index" in data2.sortable) { - return true; - } - return false; -} -var directions = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left]; -var sortableKeyboardCoordinates = (event, _ref) => { - let { - context: { - active, - collisionRect, - droppableRects, - droppableContainers, - over, - scrollableAncestors - } - } = _ref; - if (directions.includes(event.code)) { - event.preventDefault(); - if (!active || !collisionRect) { - return; - } - const filteredContainers = []; - droppableContainers.getEnabled().forEach((entry) => { - if (!entry || entry != null && entry.disabled) { - return; - } - const rect = droppableRects.get(entry.id); - if (!rect) { - return; - } - switch (event.code) { - case KeyboardCode.Down: - if (collisionRect.top < rect.top) { - filteredContainers.push(entry); - } - break; - case KeyboardCode.Up: - if (collisionRect.top > rect.top) { - filteredContainers.push(entry); - } - break; - case KeyboardCode.Left: - if (collisionRect.left > rect.left) { - filteredContainers.push(entry); - } - break; - case KeyboardCode.Right: - if (collisionRect.left < rect.left) { - filteredContainers.push(entry); - } - break; - } - }); - const collisions = closestCorners({ - active, - collisionRect, - droppableRects, - droppableContainers: filteredContainers, - pointerCoordinates: null - }); - let closestId = getFirstCollision(collisions, "id"); - if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) { - closestId = collisions[1].id; - } - if (closestId != null) { - const activeDroppable = droppableContainers.get(active.id); - const newDroppable = droppableContainers.get(closestId); - const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null; - const newNode2 = newDroppable == null ? void 0 : newDroppable.node.current; - if (newNode2 && newRect && activeDroppable && newDroppable) { - const newScrollAncestors = getScrollableAncestors(newNode2); - const hasDifferentScrollAncestors = newScrollAncestors.some((element, index) => scrollableAncestors[index] !== element); - const hasSameContainer = isSameContainer(activeDroppable, newDroppable); - const isAfterActive = isAfter2(activeDroppable, newDroppable); - const offset2 = hasDifferentScrollAncestors || !hasSameContainer ? { - x: 0, - y: 0 - } : { - x: isAfterActive ? collisionRect.width - newRect.width : 0, - y: isAfterActive ? collisionRect.height - newRect.height : 0 - }; - const rectCoordinates = { - x: newRect.left, - y: newRect.top - }; - const newCoordinates = offset2.x && offset2.y ? rectCoordinates : subtract(rectCoordinates, offset2); - return newCoordinates; - } - } - } - return void 0; -}; -function isSameContainer(a4, b2) { - if (!hasSortableData(a4) || !hasSortableData(b2)) { - return false; - } - return a4.data.current.sortable.containerId === b2.data.current.sortable.containerId; -} -function isAfter2(a4, b2) { - if (!hasSortableData(a4) || !hasSortableData(b2)) { - return false; - } - if (!isSameContainer(a4, b2)) { - return false; - } - return a4.data.current.sortable.index < b2.data.current.sortable.index; -} - -// src/core/utils/spaces/space.ts -var pathIsSpace = (superstate, path) => { - if (!path) - return false; - return superstate.spacesIndex.has(path); -}; -var spaceFolderPathFromSpace = (path, manager) => { - if (manager.superstate.settings.spacesMDBInHidden) { - if (path == "/") - return ".space/"; - return path + ".space/"; - } - return path; -}; -var folderForTagSpace = (space2, settings) => settings.spacesFolder + "/" + space2; - -// src/core/superstate/utils/path.ts -var renamePathByName = async (superstate, oldPath, newName) => { - if (superstate.spacesIndex.has(oldPath)) { - const spaceState = superstate.spacesIndex.get(oldPath); - if (spaceState.type == "tag") { - return renameTag(superstate, spaceState.name, newName); - } - return superstate.spaceManager.renameSpace(oldPath, renamePathWithoutExtension(oldPath, newName)); - } else { - return superstate.spaceManager.renamePath(oldPath, renamePathWithExtension(oldPath, newName)); - } -}; -var hidePath = async (superstate, path) => { - superstate.settings.hiddenFiles = uniq([ - ...superstate.settings.hiddenFiles, - path - ]); - superstate.saveSettings(); - superstate.reloadPath(path, true).then((f2) => superstate.dispatchEvent("superstateUpdated", null)); -}; -var hidePaths = async (superstate, paths) => { - superstate.settings.hiddenFiles = uniq([ - ...superstate.settings.hiddenFiles, - ...paths - ]); - superstate.saveSettings(); - Promise.all(paths.map((path) => { - superstate.reloadPath(path, true); - })).then((f2) => superstate.dispatchEvent("superstateUpdated", null)); -}; -var deletePath = async (superstate, path) => { - superstate.spaceManager.deletePath(path); - superstate.onPathDeleted(path); -}; -var movePathToSpace = async (superstate, oldPath, newParent) => { - return superstate.spaceManager.renamePath(oldPath, movePath(oldPath, newParent)); -}; -var convertPathToSpace = async (superstate, path, open) => { - const pathState = superstate.pathsIndex.get(path); - if (!pathState) { - return; - } - const newPath = pathState.parent + "/" + pathState.name; - await superstate.spaceManager.createSpace(pathState.name, pathState.parent, {}); - await superstate.spaceManager.renamePath(path, newPath + "/" + pathState.metadata?.file?.name + ".md"); - if (open) { - superstate.ui.openPath(newPath, false); - } -}; - -// src/schemas/mdb.ts -var stickerForField = (f2) => f2.attrs?.length > 0 ? safelyParseJSON(f2.attrs)?.icon ?? fieldTypeForType(f2.type, f2.name)?.icon : fieldTypeForType(f2.type, f2.name)?.icon; -var stickerForSchema = (f2) => f2.def?.icon?.length > 0 ? f2.def?.icon : "ui//layout-list"; -var fieldTypeForType = (type, name317) => name317 == PathPropertyName ? fieldTypes.find((t5) => t5.type == "file") : name317 == "tags" ? fieldTypes.find((t5) => t5.type == "tags") : name317 == "aliases" ? fieldTypes.find((t5) => t5.type == "option-multi") : name317 == "sticker" ? fieldTypes.find((t5) => type == "icon") : fieldTypes.find((t5) => type == t5.type) || fieldTypes.find((t5) => type == t5.multiType); -var fieldTypes = [ - { - type: "unknown", - label: "", - restricted: true, - icon: "ui//file-question" - }, - { - type: "text", - label: i18n_default.properties.text.label, - metadata: true, - icon: "ui//text", - description: i18n_default.properties.text.description - }, - { - type: "number", - label: i18n_default.properties.number.label, - metadata: true, - icon: "ui//binary", - configKeys: ["unit"], - description: i18n_default.properties.number.description - }, - { - type: "boolean", - label: i18n_default.properties.boolean.label, - metadata: true, - icon: "ui//check-square", - description: i18n_default.properties.boolean.description - }, - { - type: "date", - label: i18n_default.properties.date.label, - metadata: true, - icon: "ui//calendar", - configKeys: ["format"], - description: i18n_default.properties.date.description - }, - { - type: "option", - label: i18n_default.properties.option.label, - multi: true, - multiType: "option-multi", - icon: "ui//list", - configKeys: ["options", "source"], - description: i18n_default.properties.option.description - }, - { - type: "tags", - label: i18n_default.properties.tags.label, - icon: "ui//tags", - description: i18n_default.properties.tags.description - }, - { - type: "file", - label: i18n_default.properties.file.label, - restricted: true, - icon: "ui//mk-make-h3" - }, - { - type: "fileprop", - label: i18n_default.properties.fileProperty.label, - icon: "ui//formula", - configKeys: ["field", "value"], - description: i18n_default.properties.fileProperty.description - }, - { - type: "link", - label: i18n_default.properties.link.label, - multi: true, - multiType: "link-multi", - metadata: true, - icon: "ui//file-text", - description: i18n_default.properties.link.description - }, - { - type: "context", - label: i18n_default.properties.context.label, - icon: "ui//mk-make-note", - multi: true, - multiType: "context-multi", - configKeys: ["space"], - description: i18n_default.properties.context.description - }, - { - type: "object", - label: i18n_default.properties.object.label, - multi: true, - multiType: "object-multi", - metadata: true, - icon: "ui//list-tree", - configKeys: ["type"], - description: i18n_default.properties.object.description - }, - { - type: "icon", - label: i18n_default.properties.icon.label, - multi: true, - multiType: "icon-multi", - icon: "ui//gem", - restricted: true, - description: i18n_default.properties.icon.description - }, - { - type: "image", - label: i18n_default.properties.image.label, - multi: true, - multiType: "image-multi", - metadata: true, - icon: "ui//mk-make-image", - description: i18n_default.properties.image.description - }, - { - type: "color", - label: i18n_default.properties.color.label, - icon: "ui//mk-make-image", - restricted: true, - description: i18n_default.properties.color.description - }, - { - type: "space", - label: i18n_default.properties.space.label, - icon: "ui//layout-grid", - restricted: true, - description: i18n_default.properties.space.description - }, - { - type: "table", - label: i18n_default.properties.space.label, - icon: "ui//layout-grid", - restricted: true, - description: i18n_default.properties.space.description - }, - { - type: "super", - label: i18n_default.properties.super.label, - icon: "ui//zap", - restricted: true, - configKeys: ["dynamic", "field"] - }, - { - type: "input", - label: i18n_default.properties.super.label, - icon: "ui//input", - restricted: true - } -]; -var defaultContextSchemaID = "files"; -var defaultContextDBSchema = { - id: defaultContextSchemaID, - name: "Files", - type: "db", - primary: "true" -}; -var defaultFrameListViewID = "filesView"; -var defaultFrameListViewSchema = { - id: defaultFrameListViewID, - name: "All", - type: "view", - def: JSON.stringify({ db: defaultContextSchemaID, icon: "ui//file-stack" }) -}; -var mainFrameID = "main"; -var defaultMainFrameSchema = (id3) => ({ id: id3, name: id3, type: "frame", def: "", predicate: "", primary: "true" }); -var defaultFramesTable = { - uniques: [], - cols: ["id", "name", "type", "def", "predicate", "primary"], - rows: [defaultMainFrameSchema(mainFrameID), defaultFrameListViewSchema] -}; -var defaultContextTable = { - uniques: [], - cols: ["id", "name", "type", "def", "predicate", "primary"], - rows: [defaultContextDBSchema] -}; -var fieldSchema = { - uniques: ["name,schemaId"], - cols: [ - "name", - "schemaId", - "type", - "value", - "attrs", - "hidden", - "unique", - "primary" - ] -}; -var defaultContextFields = { - ...fieldSchema, - rows: [ - { - name: PathPropertyName, - schemaId: defaultContextSchemaID, - type: "file", - primary: "true", - hidden: "", - unique: "", - attrs: "", - value: "" - }, - { - name: i18n_default.properties.fileProperty.createdTime, - schemaId: defaultContextSchemaID, - type: "fileprop", - value: PathPropertyName + ".ctime", - hidden: "", - unique: "", - attrs: "", - primary: "true" + const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({ + rects: sortedRects, + activeNodeRect, + activeIndex, + overIndex, + index + }) : null; + const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({ + id: id3, + items, + activeIndex, + overIndex + }) : index; + const activeId = active == null ? void 0 : active.id; + const previous = (0, import_react6.useRef)({ + activeId, + items, + newIndex, + containerId + }); + const itemsHaveChanged = items !== previous.current.items; + const shouldAnimateLayoutChanges = animateLayoutChanges({ + active, + containerId, + isDragging, + isSorting, + id: id3, + index, + items, + newIndex: previous.current.newIndex, + previousItems: previous.current.items, + previousContainerId: previous.current.containerId, + transition, + wasDragging: previous.current.activeId != null + }); + const derivedTransform = useDerivedTransform({ + disabled: !shouldAnimateLayoutChanges, + index, + node, + rect + }); + (0, import_react6.useEffect)(() => { + if (isSorting && previous.current.newIndex !== newIndex) { + previous.current.newIndex = newIndex; } - ] -}; -var defaultFieldsForContext = (space2) => { - return defaultContextFields; -}; -var defaultTableFields = [ - { - name: i18n_default.properties.defaultField, - schemaId: "", - type: "text", - primary: "true" - } -]; -var defaultTagFields = { - ...fieldSchema, - rows: [ - { - name: PathPropertyName, - schemaId: defaultContextSchemaID, - type: "file", - primary: "true", - hidden: "", - unique: "", - attrs: "", - value: "" + if (containerId !== previous.current.containerId) { + previous.current.containerId = containerId; } - ] -}; -var defaultMDBTableForContext = (space2) => { - return defaultFolderMDBTable; -}; -var defaultFolderMDBTable = { - schema: defaultContextDBSchema, - cols: defaultContextFields.rows, - rows: [] -}; -var defaultQueryMDBTable = { - schema: defaultContextDBSchema, - cols: defaultContextFields.rows, - rows: [] -}; -var defaultTagMDBTable = { - schema: defaultContextDBSchema, - cols: defaultTagFields.rows, - rows: [] -}; -var fieldsToTable = (fields, schemas) => { - return fields.filter((s4) => schemas.find((g) => g.id == s4.schemaId && g.type == "db")).reduce((p, c3) => { - return { - ...p, - ...p[c3.schemaId] ? { - [c3.schemaId]: { - uniques: c3.unique == "true" ? [...p[c3.schemaId].uniques, c3.name] : p[c3.schemaId].uniques, - cols: [...p[c3.schemaId].cols, c3.name], - rows: [] - } - } : { - [c3.schemaId]: { - uniques: c3.unique == "true" ? [c3.name] : [], - cols: [c3.name], - rows: [] - } - } - }; - }, {}); -}; -var defaultTablesForContext = (space2) => { - return defaultFolderTables; -}; -var defaultFolderTables = { - m_schema: defaultContextTable, - m_fields: defaultContextFields, - ...fieldsToTable( - defaultContextFields.rows, - defaultContextTable.rows - ) -}; -var defaultTagTables = { - m_schema: defaultContextTable, - m_fields: defaultTagFields, - ...fieldsToTable( - defaultTagFields.rows, - defaultContextTable.rows - ) -}; - -// src/core/utils/contexts/optionValuesForColumn.ts -var optionValuesForColumn = (column, table) => { - return uniq( - table?.rows.reduce((p, c3) => { - return [...p, ...parseMultiString(c3[column])]; - }, []) ?? [] - ); -}; -var defaultTableDataForContext = (superstate, space2) => { - const paths = [...superstate.getSpaceItems(space2.path, true)]; + if (items !== previous.current.items) { + previous.current.items = items; + } + }, [isSorting, newIndex, containerId, items]); + (0, import_react6.useEffect)(() => { + if (activeId === previous.current.activeId) { + return; + } + if (activeId && !previous.current.activeId) { + previous.current.activeId = activeId; + return; + } + const timeoutId = setTimeout(() => { + previous.current.activeId = activeId; + }, 50); + return () => clearTimeout(timeoutId); + }, [activeId]); return { - ...defaultMDBTableForContext(space2), - rows: paths.map((f2) => ({ [PathPropertyName]: f2.path })) + active, + activeIndex, + attributes, + data: data2, + rect, + index, + newIndex, + items, + isOver, + isSorting, + isDragging, + listeners, + node, + overIndex, + over, + setNodeRef, + setActivatorNodeRef, + setDroppableNodeRef, + setDraggableNodeRef, + transform: derivedTransform != null ? derivedTransform : finalTransform, + transition: getTransition() }; -}; -var createNewRow = (mdb, row, index) => { - if (index) { + function getTransition() { + if (derivedTransform || itemsHaveChanged && previous.current.newIndex === index) { + return disabledTransition; + } + if (shouldDisplaceDragSource && !isKeyboardEvent(activatorEvent) || !transition) { + return void 0; + } + if (isSorting || shouldAnimateLayoutChanges) { + return CSS.Transition.toString({ + ...transition, + property: transitionProperty + }); + } + return void 0; + } +} +function normalizeLocalDisabled(localDisabled, globalDisabled) { + var _localDisabled$dragga, _localDisabled$droppa; + if (typeof localDisabled === "boolean") { return { - ...mdb, - rows: insert(mdb.rows, index, row) + draggable: localDisabled, + droppable: false }; } return { - ...mdb, - rows: [...mdb.rows, row] + draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable, + droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable }; -}; -var renameTagSpacePath = async (superstate, tag2, newTag) => { - const spacePath = folderForTagSpace(tag2, superstate.settings); - if (await superstate.spaceManager.pathExists(spacePath)) { - superstate.spaceManager.renamePath(spacePath, pathToParentPath(spacePath) + "/" + newTag); - } else { - deletePath(superstate, spacePath); - } - superstate.onTagRenamed(tag2, newTag); -}; - -// src/utils/tags.ts -var renameTag = async (superstate, tag2, toTag) => { - const tags3 = getAllSubtags(superstate, tag2); - const newTag = ensureTag(validateName(toTag)); - const paths = superstate.spaceManager.pathsForTag(tag2); - for (const path of paths) { - superstate.spaceManager.renameTag(path, tag2, newTag); - } - await renameTagSpacePath(superstate, tag2, newTag); - for (const subtag of tags3) { - await renameTag(superstate, subtag, subtag.replace(tag2, newTag)); +} +function hasSortableData(entry) { + if (!entry) { + return false; } -}; -var getAllParentTags = (str) => { - if (str.startsWith("#")) { - str = str.slice(1); + const data2 = entry.data.current; + if (data2 && "sortable" in data2 && typeof data2.sortable === "object" && "containerId" in data2.sortable && "items" in data2.sortable && "index" in data2.sortable) { + return true; } - const parts = str.split("/"); - const result = []; - for (let i3 = 0; i3 < parts.length - 1; i3++) { - if (i3 === 0) { - result.push(parts[i3]); - } else { - result.push(result[i3 - 1] + "/" + parts[i3]); + return false; +} +var directions = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left]; +var sortableKeyboardCoordinates = (event, _ref) => { + let { + context: { + active, + collisionRect, + droppableRects, + droppableContainers, + over, + scrollableAncestors } - } - return result; -}; -var validateName = (tag2) => { - return tag2.trim(); -}; -var getAllSubtags = (superstate, tag2) => { - const tags3 = superstate.spaceManager.readTags(); - return tags3.filter((f2) => f2.startsWith(tag2) && f2 != tag2); -}; -var tagToTagPath = (tag2) => { - return encodeSpaceName(ensureTag(tag2)); -}; -var tagPathToTag = (string3) => { - return pathToString(string3).replace(/\+/g, "/"); -}; -var ensureTag = (tag2) => { - if (!tag2) - return null; - let string3 = tag2; - if (string3.charAt(0) != "#") - string3 = "#" + string3; - return string3; -}; -var stringFromTag = (string3) => { - if (string3.charAt(0) == "#") { - if (string3.charAt(1) == "#") { - return string3.substring(2, string3.length); + } = _ref; + if (directions.includes(event.code)) { + event.preventDefault(); + if (!active || !collisionRect) { + return; + } + const filteredContainers = []; + droppableContainers.getEnabled().forEach((entry) => { + if (!entry || entry != null && entry.disabled) { + return; + } + const rect = droppableRects.get(entry.id); + if (!rect) { + return; + } + switch (event.code) { + case KeyboardCode.Down: + if (collisionRect.top < rect.top) { + filteredContainers.push(entry); + } + break; + case KeyboardCode.Up: + if (collisionRect.top > rect.top) { + filteredContainers.push(entry); + } + break; + case KeyboardCode.Left: + if (collisionRect.left > rect.left) { + filteredContainers.push(entry); + } + break; + case KeyboardCode.Right: + if (collisionRect.left < rect.left) { + filteredContainers.push(entry); + } + break; + } + }); + const collisions = closestCorners({ + active, + collisionRect, + droppableRects, + droppableContainers: filteredContainers, + pointerCoordinates: null + }); + let closestId = getFirstCollision(collisions, "id"); + if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) { + closestId = collisions[1].id; + } + if (closestId != null) { + const activeDroppable = droppableContainers.get(active.id); + const newDroppable = droppableContainers.get(closestId); + const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null; + const newNode2 = newDroppable == null ? void 0 : newDroppable.node.current; + if (newNode2 && newRect && activeDroppable && newDroppable) { + const newScrollAncestors = getScrollableAncestors(newNode2); + const hasDifferentScrollAncestors = newScrollAncestors.some((element, index) => scrollableAncestors[index] !== element); + const hasSameContainer = isSameContainer(activeDroppable, newDroppable); + const isAfterActive = isAfter2(activeDroppable, newDroppable); + const offset2 = hasDifferentScrollAncestors || !hasSameContainer ? { + x: 0, + y: 0 + } : { + x: isAfterActive ? collisionRect.width - newRect.width : 0, + y: isAfterActive ? collisionRect.height - newRect.height : 0 + }; + const rectCoordinates = { + x: newRect.left, + y: newRect.top + }; + const newCoordinates = offset2.x && offset2.y ? rectCoordinates : subtract(rectCoordinates, offset2); + return newCoordinates; + } } - return string3.substring(1, string3.length); } - return string3; -}; - -// src/core/spaceManager/filesystemAdapter/spaceInfo.ts -var fileSystemSpaceInfoFromTag = (manager, tag2, readOnly) => { - const path = tagSpacePathFromTag(tag2); - const folderPath = manager.superstate.settings.spacesFolder + "/" + tagToTagPath(tag2); - return { - name: tag2, - path, - isRemote: false, - readOnly, - folderPath, - defPath: `${folderPath}/${encodeSpaceName(tag2)}.md`, - framePath: spaceFolderPathFromSpace(folderPath + "/", manager) + "frames.mdb", - dbPath: spaceFolderPathFromSpace(folderPath + "/", manager) + manager.superstate.settings.folderContextFile + ".mdb", - commandsPath: spaceFolderPathFromSpace(folderPath + "/", manager) + "commands.mdb" - }; + return void 0; }; -var fileSystemSpaceInfoByPath = (manager, contextPath) => { - if (!contextPath) - return; - const uri = manager.uriByString(contextPath); - const pathType = manager.spaceTypeByString(uri); - if (pathType == "folder") { - return fileSystemSpaceInfoFromFolder(manager, removeTrailingSlashFromFolder(uri.path)); - } else if (pathType == "tag") { - return fileSystemSpaceInfoFromTag(manager, uri.authority); - } else if (pathType == "vault") { - return fileSystemSpaceInfoFromFolder(manager, "/"); +function isSameContainer(a4, b2) { + if (!hasSortableData(a4) || !hasSortableData(b2)) { + return false; } - return null; -}; -var fileSystemSpaceInfoFromFolder = (manager, folder, readOnly) => { - if (folder == "/") { - const vaultName = "Vault"; - return { - name: vaultName, - path: folder, - isRemote: false, - readOnly, - folderPath: folder, - defPath: vaultName + ".md", - dbPath: spaceFolderPathFromSpace(folder, manager) + manager.superstate.settings.folderContextFile + ".mdb", - framePath: spaceFolderPathFromSpace(folder, manager) + "views.mdb", - commandsPath: spaceFolderPathFromSpace(folder, manager) + "commands.mdb" - }; + return a4.data.current.sortable.containerId === b2.data.current.sortable.containerId; +} +function isAfter2(a4, b2) { + if (!hasSortableData(a4) || !hasSortableData(b2)) { + return false; } - const folderName = folderPathToString(folder); - return { - name: folderName, - path: folder, - isRemote: false, - readOnly, - folderPath: folder, - defPath: folder + "/" + folderName + ".md", - dbPath: spaceFolderPathFromSpace(folder + "/", manager) + manager.superstate.settings.folderContextFile + ".mdb", - framePath: spaceFolderPathFromSpace(folder + "/", manager) + "views.mdb", - commandsPath: spaceFolderPathFromSpace(folder + "/", manager) + "commands.mdb" - }; -}; + if (!isSameContainer(a4, b2)) { + return false; + } + return a4.data.current.sortable.index < b2.data.current.sortable.index; +} // src/core/utils/contexts/links.ts var valueContainsLink = (link, value) => { @@ -42796,82 +42945,6 @@ function applyFunctionToObject(object, func) { return newObject; } -// src/core/schemas/parseFieldValue.ts -var allActions = (superstate, path) => { - const stringForType = (type) => { - if (type == "builtin") { - return "Builtin"; - } - if (type == "api") { - return "Spaces"; - } - return "Action"; - }; - return [...(superstate.actionsIndex.get(path) ?? []).map((g) => ({ name: g.schema.name, description: "Action", value: `${path}/#;${g.schema.id}`, section: "Action" })) ?? [], ...[...superstate.cli.allCommands()].map((g) => ({ name: g.schema.name, description: stringForType(g.schema.type), value: g.path, section: stringForType(g.schema.type) }))]; -}; -var convertFileProp = ({ field, value }) => { - if (value == "ctime") - return { value: `parseDate(prop('${field}')['metadata']['file']['${value}'])` }; - return { value: `prop('${field}')['metadata']['file']['${value}']` }; -}; -var parseFieldValue = (value, type, superstate, path) => { - let valueProp = safelyParseJSON(value); - if (valueProp) { - if (type == "fileprop") { - if (valueProp.field) - return convertFileProp(valueProp); - } - if (type == "option" && valueProp.source?.length > 0) { - if (valueProp.source == "$commands") { - valueProp.options = superstate.cli.allCommands(); - } else if (valueProp.source == "$links") { - valueProp.options = superstate.spaceManager.allPaths().map((f2) => ({ name: f2, value: f2 })); - } else if (valueProp.source == "$super") { - valueProp.options = allActions(superstate, path); - } - } - return [...fieldTypeForType(type).configKeys ?? [], "alias", "default"].reduce((p, c3) => ({ ...p, [c3]: valueProp[c3] }), {}); - } - if (!type) - return {}; - if (!valueProp) { - if (type == "context") { - if (value?.length > 0) { - valueProp = { - space: value - }; - } else { - valueProp = {}; - } - } else if (type.startsWith("date")) { - if (value?.length > 0) { - valueProp = { - format: value - }; - } else { - valueProp = {}; - } - } else if (type.startsWith("fileprop")) { - if (value?.length > 0) { - const [field, val] = value.split("."); - valueProp = convertFileProp({ field, value: val }); - } else { - valueProp = {}; - } - } else if (type.startsWith("option")) { - if (value?.length > 0) { - const options = parseMultiString(value).map((f2) => ({ name: f2, value: f2 })); - valueProp = { - options - }; - } else { - valueProp = {}; - } - } - } - return valueProp ?? {}; -}; - // src/core/utils/frames/frames.ts var nameForField = (field, superstate) => { if (!field) @@ -45788,8 +45861,6 @@ var updatePathRankInSpace = async (superstate, path, rank, space2) => { const spaceState = superstate.spacesIndex.get(space2); if (!spaceState) return; - if (spaceState.type == "default") - return; const fixedRank = rank; superstate.addToContextStateQueue(() => reorderPathsInContext(superstate.spaceManager, [path], fixedRank, spaceState.space).then((f2) => { const promises = [...superstate.spacesMap.getInverse(spaceState.path)].map((f3) => superstate.reloadPath(f3)); @@ -85137,7 +85208,6 @@ var runFormula = (paths, formula, properties3, values2) => { value = runContext.evaluate(formula, scope); value = parseProperty("", value); } catch (e4) { - console.log(formula, e4); } return value; }; @@ -85450,59 +85520,6 @@ var _IndexMap = class { var IndexMap = _IndexMap; IndexMap.EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set()); -// src/core/types/space.ts -var FMMetadataKeys = (settings) => [settings.fmKeyBanner, settings.fmKeySticker, settings.fmKeyColor]; -var waypointsSpace = { - name: i18n_default.menu.waypoints, - path: "spaces://$waypoints", - space: null, - type: "default", - templates: [] -}; -var tagsSpace = { - name: i18n_default.menu.tags, - path: "spaces://$tags", - space: null, - type: "default", - templates: [] -}; -var waypointsPath = { - name: i18n_default.menu.waypoints, - displayName: i18n_default.menu.waypoints, - path: "spaces://$waypoints", - label: { - name: i18n_default.menu.waypoints, - thumbnail: "", - sticker: "ui//tags", - color: "" - }, - type: "default" -}; -var tagsPath = { - name: i18n_default.menu.tags, - displayName: i18n_default.menu.tags, - path: "spaces://$tags", - label: { - thumbnail: "", - name: i18n_default.menu.tags, - sticker: "ui//tags", - color: "" - }, - type: "default" -}; -var vaultPath = { - name: i18n_default.menu.vault, - displayName: i18n_default.menu.vault, - path: "/", - label: { - thumbnail: "", - name: i18n_default.menu.vault, - sticker: "ui//vault", - color: "" - }, - type: "default" -}; - // src/core/utils/superstate/parser.ts var parsePathState = (cache2) => { return safelyParseJSON(cache2); @@ -85518,6 +85535,11 @@ var stringifyJob = (job) => `${job.type}:${job.path}`; var import_lodash8 = __toESM(require_lodash()); // src/core/utils/contexts/predicate/filter.ts +var listEquals = (value, filterValue) => { + const valueList = value ? parseMultiString(value) : []; + const strings = filterValue ? parseMultiString(filterValue) : []; + return strings.every((f2) => valueList.some((g) => g == f2)) && valueList.every((f2) => strings.some((g) => g == f2)); +}; var stringEqual = (value, filterValue) => { return value == filterValue; }; @@ -85531,7 +85553,7 @@ var greaterThan = (value, filterValue) => { return parseFloat(value) > parseFloat(filterValue); }; var lessThan = (value, filterValue) => { - return parseInt(value) > parseInt(filterValue); + return parseInt(value) < parseInt(filterValue); }; var dateAfter = (value, filterValue) => { const dateValue = isNaN(Date.parse(value)) ? new Date(parseInt(value)) : new Date(value); @@ -85576,32 +85598,32 @@ var filterReturnForCol = (col, filter2, row) => { // src/core/utils/contexts/predicate/filterFns/filterFnTypes.ts var filterFnTypes = { isNotEmpty: { - type: ["text", "file", "link", "link-multi", "fileprop", "image"], + type: ["text", "file", "number", "option", "option-multi", "link", "link-multi", "image"], fn: (v2, f2) => !empty2(v2, ""), valueType: "none" }, isEmpty: { - type: ["text", "file", "link", "link-multi", "fileprop", "image"], + type: ["text", "file", "number", "option", "option-multi", "link", "link-multi", "image"], fn: (v2, f2) => empty2(v2, ""), valueType: "none" }, include: { fn: (v2, f2) => stringCompare(v2, f2), - type: ["text", "file", "link", "link-multi", "fileprop", "image"], + type: ["text", "file", "link", "image"], valueType: "text" }, notInclude: { - type: ["text", "file", "link", "link-multi", "fileprop", "image"], + type: ["text", "file", "link", "image"], fn: (v2, f2) => !stringCompare(v2, f2), valueType: "text" }, is: { - type: ["text", "file", "link", "context", "fileprop"], + type: ["text"], fn: (v2, f2) => stringEqual(v2, f2), valueType: "text" }, isNot: { - type: ["text", "file", "link", "context", "fileprop"], + type: ["text"], fn: (v2, f2) => !stringEqual(v2, f2), valueType: "text" }, @@ -85610,6 +85632,16 @@ var filterFnTypes = { fn: (v2, f2) => stringEqual(v2, f2), valueType: "number" }, + isLink: { + type: ["link", "context"], + fn: (v2, f2) => stringEqual(v2, f2), + valueType: "link" + }, + isNotLink: { + type: ["link", "context"], + fn: (v2, f2) => !stringEqual(v2, f2), + valueType: "link" + }, isGreatThan: { type: ["number"], fn: (v2, f2) => greaterThan(v2, f2), @@ -85631,12 +85663,12 @@ var filterFnTypes = { valueType: "number" }, dateBefore: { - type: ["date", "fileprop"], + type: ["date"], fn: (v2, f2) => dateBefore(v2, f2), valueType: "date" }, dateAfter: { - type: ["date", "fileprop"], + type: ["date"], fn: (v2, f2) => dateAfter(v2, f2), valueType: "date" }, @@ -85650,13 +85682,18 @@ var filterFnTypes = { fn: (v2, f2) => isSameDayAsToday(v2, f2), valueType: "none" }, + isExactList: { + type: ["option", "option-multi", "link-multi", "context-multi", "tags-multi", "tags"], + fn: (v2, f2) => listEquals(v2, f2), + valueType: "list" + }, isAnyInList: { - type: ["option", "context", "option-multi", "context-multi", "tags-multi", "tags"], + type: ["option", "context", "link", "option-multi", "link-multi", "context-multi", "tags-multi", "tags"], fn: (v2, f2) => listIncludes(v2, f2), valueType: "list" }, isNoneInList: { - type: ["option", "context", "option-multi", "context-multi", "tags-multi", "tags"], + type: ["option", "context", "link", "option-multi", "link-multi", "context-multi", "tags-multi", "tags"], fn: (v2, f2) => !listIncludes(v2, f2), valueType: "list" }, @@ -86160,7 +86197,8 @@ var previewNode = { styles: { background: `'var(--background-secondary)'`, height: `$root.props.height`, - borderRadius: `$root.props.radius` + borderRadius: `$root.props.radius`, + overflow: `'hidden'` } }, children: [ @@ -86187,7 +86225,8 @@ var previewNode = { hidden: `$api.path.label(preview.props.path)?.thumbnail?.length > 0`, borderRadius: `$root.props.radius`, background: `$api.path.label(preview.props.path)?.color`, - padding: `$root.props.padding` + padding: `$root.props.padding`, + overflow: `'hidden'` } ) ] @@ -86513,7 +86552,7 @@ var circularProgressNode = { {}, { background: "`conic-gradient(${$root.props.color} ${$root.props.value/$root.props.max*100}%, ${$root.props.backgroundColor} 0)`", - "-webkit-mask-image": "`radial-gradient(circle calc(calc(${$root.styles.width} - ${$root.props.ringWidth}px) / 2) at calc(50%) calc(50%),transparent 100%,black 0%)`", + "mask-image": "`radial-gradient(circle calc(calc(${$root.styles.width} - ${$root.props.ringWidth}px) / 2) at calc(50%) calc(50%),transparent 100%,black 0%)`", height: `'100%'`, width: `'100%'`, borderRadius: `'50%'` @@ -87067,6 +87106,7 @@ var cardsListItem = { padding: `'4px'`, "--icon-size": `'24px'`, borderRadius: `'4px'`, + overflow: `'hidden'`, background: `$api.path.label($contexts.$context['_keyValue'])?.color` } ) @@ -87288,6 +87328,7 @@ var listItem = { radius: `'4px'` }, { + borderRadius: `'4px'`, background: `'var(--background-secondary)'` } ), @@ -87299,7 +87340,8 @@ var listItem = { gap: `'8px'`, flex: `'1'`, padding: `'2px'`, - layout: `'column'` + layout: `'column'`, + layoutAlign: `'w'` } }, children: [ @@ -88241,38 +88283,269 @@ function inlineWorker(scriptText, name317) { return worker; } -// src/core/superstate/workers/indexer.worker.ts +// src/core/superstate/workers/indexer/indexer.worker.ts function Worker2() { - return inlineWorker(`"use strict";var nx=Object.create;var Ch=Object.defineProperty;var ix=Object.getOwnPropertyDescriptor;var ax=Object.getOwnPropertyNames;var sx=Object.getPrototypeOf,ox=Object.prototype.hasOwnProperty;var Th=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var ux=(e,r,a,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of ax(r))!ox.call(e,l)&&l!==a&&Ch(e,l,{get:()=>r[l],enumerable:!(u=ix(r,l))||u.enumerable});return e};var Ao=(e,r,a)=>(a=e!=null?nx(sx(e)):{},ux(r||!e||!e.__esModule?Ch(a,"default",{value:e,enumerable:!0}):a,e));var Fo=Th((ra,es)=>{(function(){var e,r="4.17.21",a=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",p="Invalid \`variable\` option passed into \`_.template\`",v="__lodash_hash_undefined__",C=500,T="__lodash_placeholder__",A=1,R=2,V=4,K=1,re=2,N=1,_e=2,Le=4,ye=8,de=16,We=32,ze=64,$e=128,Pe=256,tt=512,je=30,pr="...",jt=800,me=16,at=1,mt=2,Rt=3,Oe=1/0,Qe=9007199254740991,Wt=17976931348623157e292,xt=0/0,Pt=4294967295,mi=Pt-1,fa=Pt>>>1,hn=[["ary",$e],["bind",N],["bindKey",_e],["curry",ye],["curryRight",de],["flip",tt],["partial",We],["partialRight",ze],["rearg",Pe]],H="[object Arguments]",gi="[object Array]",Xo="[object AsyncFunction]",Er="[object Boolean]",pn="[object Date]",Jo="[object DOMException]",yi="[object Error]",xi="[object Function]",hs="[object GeneratorFunction]",Yt="[object Map]",Yn="[object Number]",eu="[object Null]",dr="[object Object]",ps="[object Promise]",tu="[object Proxy]",mr="[object RegExp]",De="[object Set]",st="[object String]",dn="[object Symbol]",ds="[object Undefined]",Ue="[object WeakMap]",ru="[object WeakSet]",Dr="[object ArrayBuffer]",nt="[object DataView]",te="[object Float32Array]",Ir="[object Float64Array]",mn="[object Int8Array]",vi="[object Int16Array]",ca="[object Int32Array]",ha="[object Uint8Array]",wi="[object Uint8ClampedArray]",ct="[object Uint16Array]",Si="[object Uint32Array]",pa=/\\b__p \\+= '';/g,_i=/\\b(__p \\+=) '' \\+/g,Ae=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g,da=/&(?:amp|lt|gt|quot|#39);/g,ma=/[&<>"']/g,bi=RegExp(da.source),ga=RegExp(ma.source),ki=/<%-([\\s\\S]+?)%>/g,gn=/<%([\\s\\S]+?)%>/g,Bn=/<%=([\\s\\S]+?)%>/g,nu=/\\.|\\[(?:[^[\\]]*|(["'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,Ci=/^\\w*$/,iu=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,qr=/[\\\\^$.*+?()[\\]{}|]/g,Ti=RegExp(qr.source),Y=/^\\s+/,au=/\\s/,su=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,vt=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,ya=/,? & /,Ce=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,Vn=/[()=,{}\\[\\]\\/\\s]/,ou=/\\\\(\\\\)?/g,ot=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,Qt=/\\w*$/,Kt=/^[-+]0x[0-9a-f]+$/i,Ke=/^0b[01]+$/i,Bt=/^\\[object .+?Constructor\\]$/,gr=/^0o[0-7]+$/i,Gr=/^(?:0|[1-9]\\d*)$/,uu=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,Pi=/($^)/,lu=/['\\n\\r\\u2028\\u2029\\\\]/g,Re="\\\\ud800-\\\\udfff",Ei="\\\\u0300-\\\\u036f",fu="\\\\ufe20-\\\\ufe2f",ms="\\\\u20d0-\\\\u20ff",xa=Ei+fu+ms,gs="\\\\u2700-\\\\u27bf",ys="a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff",cu="\\\\xac\\\\xb1\\\\xd7\\\\xf7",hu="\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf",pu="\\\\u2000-\\\\u206f",du=" \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000",va="A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde",wa="\\\\ufe0e\\\\ufe0f",xs=cu+hu+pu+du,Sa="['\\u2019]",mu="["+Re+"]",_a="["+xs+"]",Mr="["+xa+"]",ba="\\\\d+",gu="["+gs+"]",vs="["+ys+"]",yn="[^"+Re+xs+ba+gs+ys+va+"]",xn="\\\\ud83c[\\\\udffb-\\\\udfff]",ws="(?:"+Mr+"|"+xn+")",vn="[^"+Re+"]",Vt="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",ka="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",wn="["+va+"]",Ss="\\\\u200d",_s="(?:"+vs+"|"+yn+")",yu="(?:"+wn+"|"+yn+")",bs="(?:"+Sa+"(?:d|ll|m|re|s|t|ve))?",ks="(?:"+Sa+"(?:D|LL|M|RE|S|T|VE))?",Cs=ws+"?",Di="["+wa+"]?",xu="(?:"+Ss+"(?:"+[vn,Vt,ka].join("|")+")"+Di+Cs+")*",Ts="\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])",vu="\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])",Ps=Di+Cs+xu,wu="(?:"+[gu,Vt,ka].join("|")+")"+Ps,Su="(?:"+[vn+Mr+"?",Mr,Vt,ka,mu].join("|")+")",_u=RegExp(Sa,"g"),bu=RegExp(Mr,"g"),Ca=RegExp(xn+"(?="+xn+")|"+Su+Ps,"g"),ku=RegExp([wn+"?"+vs+"+"+bs+"(?="+[_a,wn,"$"].join("|")+")",yu+"+"+ks+"(?="+[_a,wn+_s,"$"].join("|")+")",wn+"?"+_s+"+"+bs,wn+"+"+ks,vu,Ts,ba,wu].join("|"),"g"),Cu=RegExp("["+Ss+Re+xa+wa+"]"),Tu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Pu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Eu=-1,Fe={};Fe[te]=Fe[Ir]=Fe[mn]=Fe[vi]=Fe[ca]=Fe[ha]=Fe[wi]=Fe[ct]=Fe[Si]=!0,Fe[H]=Fe[gi]=Fe[Dr]=Fe[Er]=Fe[nt]=Fe[pn]=Fe[yi]=Fe[xi]=Fe[Yt]=Fe[Yn]=Fe[dr]=Fe[mr]=Fe[De]=Fe[st]=Fe[Ue]=!1;var Ie={};Ie[H]=Ie[gi]=Ie[Dr]=Ie[nt]=Ie[Er]=Ie[pn]=Ie[te]=Ie[Ir]=Ie[mn]=Ie[vi]=Ie[ca]=Ie[Yt]=Ie[Yn]=Ie[dr]=Ie[mr]=Ie[De]=Ie[st]=Ie[dn]=Ie[ha]=Ie[wi]=Ie[ct]=Ie[Si]=!0,Ie[yi]=Ie[xi]=Ie[Ue]=!1;var Du={\\u00C0:"A",\\u00C1:"A",\\u00C2:"A",\\u00C3:"A",\\u00C4:"A",\\u00C5:"A",\\u00E0:"a",\\u00E1:"a",\\u00E2:"a",\\u00E3:"a",\\u00E4:"a",\\u00E5:"a",\\u00C7:"C",\\u00E7:"c",\\u00D0:"D",\\u00F0:"d",\\u00C8:"E",\\u00C9:"E",\\u00CA:"E",\\u00CB:"E",\\u00E8:"e",\\u00E9:"e",\\u00EA:"e",\\u00EB:"e",\\u00CC:"I",\\u00CD:"I",\\u00CE:"I",\\u00CF:"I",\\u00EC:"i",\\u00ED:"i",\\u00EE:"i",\\u00EF:"i",\\u00D1:"N",\\u00F1:"n",\\u00D2:"O",\\u00D3:"O",\\u00D4:"O",\\u00D5:"O",\\u00D6:"O",\\u00D8:"O",\\u00F2:"o",\\u00F3:"o",\\u00F4:"o",\\u00F5:"o",\\u00F6:"o",\\u00F8:"o",\\u00D9:"U",\\u00DA:"U",\\u00DB:"U",\\u00DC:"U",\\u00F9:"u",\\u00FA:"u",\\u00FB:"u",\\u00FC:"u",\\u00DD:"Y",\\u00FD:"y",\\u00FF:"y",\\u00C6:"Ae",\\u00E6:"ae",\\u00DE:"Th",\\u00FE:"th",\\u00DF:"ss",\\u0100:"A",\\u0102:"A",\\u0104:"A",\\u0101:"a",\\u0103:"a",\\u0105:"a",\\u0106:"C",\\u0108:"C",\\u010A:"C",\\u010C:"C",\\u0107:"c",\\u0109:"c",\\u010B:"c",\\u010D:"c",\\u010E:"D",\\u0110:"D",\\u010F:"d",\\u0111:"d",\\u0112:"E",\\u0114:"E",\\u0116:"E",\\u0118:"E",\\u011A:"E",\\u0113:"e",\\u0115:"e",\\u0117:"e",\\u0119:"e",\\u011B:"e",\\u011C:"G",\\u011E:"G",\\u0120:"G",\\u0122:"G",\\u011D:"g",\\u011F:"g",\\u0121:"g",\\u0123:"g",\\u0124:"H",\\u0126:"H",\\u0125:"h",\\u0127:"h",\\u0128:"I",\\u012A:"I",\\u012C:"I",\\u012E:"I",\\u0130:"I",\\u0129:"i",\\u012B:"i",\\u012D:"i",\\u012F:"i",\\u0131:"i",\\u0134:"J",\\u0135:"j",\\u0136:"K",\\u0137:"k",\\u0138:"k",\\u0139:"L",\\u013B:"L",\\u013D:"L",\\u013F:"L",\\u0141:"L",\\u013A:"l",\\u013C:"l",\\u013E:"l",\\u0140:"l",\\u0142:"l",\\u0143:"N",\\u0145:"N",\\u0147:"N",\\u014A:"N",\\u0144:"n",\\u0146:"n",\\u0148:"n",\\u014B:"n",\\u014C:"O",\\u014E:"O",\\u0150:"O",\\u014D:"o",\\u014F:"o",\\u0151:"o",\\u0154:"R",\\u0156:"R",\\u0158:"R",\\u0155:"r",\\u0157:"r",\\u0159:"r",\\u015A:"S",\\u015C:"S",\\u015E:"S",\\u0160:"S",\\u015B:"s",\\u015D:"s",\\u015F:"s",\\u0161:"s",\\u0162:"T",\\u0164:"T",\\u0166:"T",\\u0163:"t",\\u0165:"t",\\u0167:"t",\\u0168:"U",\\u016A:"U",\\u016C:"U",\\u016E:"U",\\u0170:"U",\\u0172:"U",\\u0169:"u",\\u016B:"u",\\u016D:"u",\\u016F:"u",\\u0171:"u",\\u0173:"u",\\u0174:"W",\\u0175:"w",\\u0176:"Y",\\u0177:"y",\\u0178:"Y",\\u0179:"Z",\\u017B:"Z",\\u017D:"Z",\\u017A:"z",\\u017C:"z",\\u017E:"z",\\u0132:"IJ",\\u0133:"ij",\\u0152:"Oe",\\u0153:"oe",\\u0149:"'n",\\u017F:"s"},Ta={"&":"&","<":"<",">":">",'"':""","'":"'"},Pa={"&":"&","<":"<",">":">",""":'"',"'":"'"},Iu={"\\\\":"\\\\","'":"'","\\n":"n","\\r":"r","\\u2028":"u2028","\\u2029":"u2029"},Es=parseFloat,Ds=parseInt,Is=typeof global=="object"&&global&&global.Object===Object&&global,Mu=typeof self=="object"&&self&&self.Object===Object&&self,rt=Is||Mu||Function("return this")(),Ea=typeof ra=="object"&&ra&&!ra.nodeType&&ra,Or=Ea&&typeof es=="object"&&es&&!es.nodeType&&es,Ne=Or&&Or.exports===Ea,zr=Ne&&Is.process,ut=function(){try{var b=Or&&Or.require&&Or.require("util").types;return b||zr&&zr.binding&&zr.binding("util")}catch{}}(),Ms=ut&&ut.isArrayBuffer,Da=ut&&ut.isDate,Os=ut&&ut.isMap,As=ut&&ut.isRegExp,Un=ut&&ut.isSet,yr=ut&&ut.isTypedArray;function ht(b,D,P){switch(P.length){case 0:return b.call(D);case 1:return b.call(D,P[0]);case 2:return b.call(D,P[0],P[1]);case 3:return b.call(D,P[0],P[1],P[2])}return b.apply(D,P)}function Ou(b,D,P,B){for(var Z=-1,xe=b==null?0:b.length;++Z-1}function Ia(b,D,P){for(var B=-1,Z=b==null?0:b.length;++B-1;);return P}function Bs(b,D){for(var P=b.length;P--&&Sn(D,b[P],0)>-1;);return P}function Wu(b,D){for(var P=b.length,B=0;P--;)b[P]===D&&++B;return B}var Vs=Hn(Du),Yu=Hn(Ta);function Bu(b){return"\\\\"+Iu[b]}function Vu(b,D){return b==null?e:b[D]}function Xt(b){return Cu.test(b)}function Uu(b){return Tu.test(b)}function Hu(b){for(var D,P=[];!(D=b.next()).done;)P.push(D.value);return P}function Wa(b){var D=-1,P=Array(b.size);return b.forEach(function(B,Z){P[++D]=[Z,B]}),P}function qn(b,D){return function(P){return b(D(P))}}function Ut(b,D){for(var P=-1,B=b.length,Z=0,xe=[];++P-1}function ro(t,n){var s=this.__data__,f=It(s,t);return f<0?(++this.size,s.push([t,n])):s[f][1]=n,this}wr.prototype.clear=yl,wr.prototype.delete=to,wr.prototype.get=xl,wr.prototype.has=vl,wr.prototype.set=ro;function Sr(t){var n=-1,s=t==null?0:t.length;for(this.clear();++n=n?t:n)),t}function St(t,n,s,f,d,x){var w,_=n&A,k=n&R,I=n&V;if(s&&(w=d?s(t,f,d,x):s(t)),w!==e)return w;if(!Ve(t))return t;var M=ee(t);if(M){if(w=Od(t),!_)return Mt(t,w)}else{var O=yt(t),W=O==xi||O==hs;if(On(t))return gc(t,_);if(O==dr||O==H||W&&!d){if(w=k||W?{}:Nc(t),!_)return k?Sd(t,El(w,t)):wd(t,Ua(w,t))}else{if(!Ie[O])return d?t:{};w=Ad(t,O,_)}}x||(x=new Ht);var q=x.get(t);if(q)return q;x.set(t,w),fh(t)?t.forEach(function(Q){w.add(St(Q,n,s,Q,t,x))}):uh(t)&&t.forEach(function(Q,ue){w.set(ue,St(Q,n,s,ue,t,x))});var j=I?k?Ql:jl:k?At:lt,ae=M?e:j(t);return He(ae||t,function(Q,ue){ae&&(ue=Q,Q=t[ue]),ei(w,ue,St(Q,n,s,ue,t,x))}),w}function Ha(t){var n=lt(t);return function(s){return oo(s,t,n)}}function oo(t,n,s){var f=s.length;if(t==null)return!f;for(t=se(t);f--;){var d=s[f],x=n[d],w=t[d];if(w===e&&!(d in t)||!x(w))return!1}return!0}function uo(t,n,s){if(typeof t!="function")throw new Et(l);return Xa(function(){t.apply(e,s)},n)}function _t(t,n,s,f){var d=-1,x=Mi,w=!0,_=t.length,k=[],I=n.length;if(!_)return k;s&&(n=Ee(n,gt(s))),f?(x=Ia,w=!1):n.length>=a&&(x=_n,w=!1,n=new Kr(n));e:for(;++d<_;){var M=t[d],O=s==null?M:s(M);if(M=f||M!==0?M:0,w&&O===O){for(var W=I;W--;)if(n[W]===O)continue e;k.push(M)}else x(n,O,f)||k.push(M)}return k}var Wr=Sc(Jt),lo=Sc(Ga,!0);function Dl(t,n){var s=!0;return Wr(t,function(f,d,x){return s=!!n(f,d,x),s}),s}function Ki(t,n,s){for(var f=-1,d=t.length;++fd?0:d+s),f=f===e||f>d?d:ne(f),f<0&&(f+=d),f=s>f?0:hh(f);s0&&s(_)?n>1?it(_,n-1,s,f,d):Zt(d,_):f||(d[d.length]=_)}return d}var qa=_c(),co=_c(!0);function Jt(t,n){return t&&qa(t,n,lt)}function Ga(t,n){return t&&co(t,n,lt)}function er(t,n){return Ar(n,function(s){return rn(t[s])})}function Xr(t,n){n=In(n,t);for(var s=0,f=n.length;t!=null&&sn}function Ml(t,n){return t!=null&&be.call(t,n)}function Ol(t,n){return t!=null&&n in se(t)}function Al(t,n,s){return t>=Be(n,s)&&t=120&&M.length>=120)?new Kr(w&&M):e}M=t[0];var O=-1,W=_[0];e:for(;++O-1;)_!==t&&jr.call(_,k,1),jr.call(t,k,1);return t}function uc(t,n){for(var s=t?n.length:0,f=s-1;s--;){var d=n[s];if(s==f||d!==x){var x=d;tn(d)?jr.call(t,d,1):Vl(t,d)}}return t}function Wl(t,n){return t+jn(Js()*(n-t+1))}function ld(t,n,s,f){for(var d=-1,x=qe(Bi((n-t)/(s||1)),0),w=P(x);x--;)w[f?x:++d]=t,t+=s;return w}function Yl(t,n){var s="";if(!t||n<1||n>Qe)return s;do n%2&&(s+=t),n=jn(n/2),n&&(t+=t);while(n);return s}function oe(t,n){return rf(Wc(t,n,Ft),t+"")}function fd(t){return so(ta(t))}function cd(t,n){var s=ta(t);return ko(s,Zr(n,0,s.length))}function Qa(t,n,s,f){if(!Ve(t))return t;n=In(n,t);for(var d=-1,x=n.length,w=x-1,_=t;_!=null&&++dd?0:d+n),s=s>d?d:s,s<0&&(s+=d),d=n>s?0:s-n>>>0,n>>>=0;for(var x=P(d);++f>>1,w=t[x];w!==null&&!Gt(w)&&(s?w<=n:w=a){var I=n?null:Cd(t);if(I)return bn(I);w=!1,d=_n,k=new Kr}else k=n?[]:_;e:for(;++f=f?t:nr(t,n,s)}var mc=tl||function(t){return rt.clearTimeout(t)};function gc(t,n){if(n)return t.slice();var s=t.length,f=zs?zs(s):new t.constructor(s);return t.copy(f),f}function Gl(t){var n=new t.constructor(t.byteLength);return new Ri(n).set(new Ri(t)),n}function gd(t,n){var s=n?Gl(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.byteLength)}function yd(t){var n=new t.constructor(t.source,Qt.exec(t));return n.lastIndex=t.lastIndex,n}function xd(t){return Jn?se(Jn.call(t)):{}}function yc(t,n){var s=n?Gl(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.length)}function xc(t,n){if(t!==n){var s=t!==e,f=t===null,d=t===t,x=Gt(t),w=n!==e,_=n===null,k=n===n,I=Gt(n);if(!_&&!I&&!x&&t>n||x&&w&&k&&!_&&!I||f&&w&&k||!s&&k||!d)return 1;if(!f&&!x&&!I&&t=_)return k;var I=s[f];return k*(I=="desc"?-1:1)}}return t.index-n.index}function vc(t,n,s,f){for(var d=-1,x=t.length,w=s.length,_=-1,k=n.length,I=qe(x-w,0),M=P(k+I),O=!f;++_1?s[d-1]:e,w=d>2?s[2]:e;for(x=t.length>3&&typeof x=="function"?(d--,x):e,w&&bt(s[0],s[1],w)&&(x=d<3?e:x,d=1),n=se(n);++f-1?d[x?n[w]:w]:e}}function Cc(t){return en(function(n){var s=n.length,f=s,d=Dt.prototype.thru;for(t&&n.reverse();f--;){var x=n[f];if(typeof x!="function")throw new Et(l);if(d&&!w&&_o(x)=="wrapper")var w=new Dt([],!0)}for(f=w?f:s;++f1&&he.reverse(),M&&k_))return!1;var I=x.get(t),M=x.get(n);if(I&&M)return I==n&&M==t;var O=-1,W=!0,q=s&re?new Kr:e;for(x.set(t,n),x.set(n,t);++O<_;){var j=t[O],ae=n[O];if(f)var Q=w?f(ae,j,O,n,t,x):f(j,ae,O,t,n,x);if(Q!==e){if(Q)continue;W=!1;break}if(q){if(!Oa(n,function(ue,he){if(!_n(q,he)&&(j===ue||d(j,ue,s,f,x)))return q.push(he)})){W=!1;break}}else if(!(j===ae||d(j,ae,s,f,x))){W=!1;break}}return x.delete(t),x.delete(n),W}function Pd(t,n,s,f,d,x,w){switch(s){case nt:if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)return!1;t=t.buffer,n=n.buffer;case Dr:return!(t.byteLength!=n.byteLength||!x(new Ri(t),new Ri(n)));case Er:case pn:case Yn:return Cr(+t,+n);case yi:return t.name==n.name&&t.message==n.message;case mr:case st:return t==n+"";case Yt:var _=Wa;case De:var k=f&K;if(_||(_=bn),t.size!=n.size&&!k)return!1;var I=w.get(t);if(I)return I==n;f|=re,w.set(t,n);var M=Oc(_(t),_(n),f,d,x,w);return w.delete(t),M;case dn:if(Jn)return Jn.call(t)==Jn.call(n)}return!1}function Ed(t,n,s,f,d,x){var w=s&K,_=jl(t),k=_.length,I=jl(n),M=I.length;if(k!=M&&!w)return!1;for(var O=k;O--;){var W=_[O];if(!(w?W in n:be.call(n,W)))return!1}var q=x.get(t),j=x.get(n);if(q&&j)return q==n&&j==t;var ae=!0;x.set(t,n),x.set(n,t);for(var Q=w;++O1?"& ":"")+n[f],n=n.join(s>2?", ":" "),t.replace(su,\`{ -/* [wrapped with \`+n+\`] */ -\`)}function Nd(t){return ee(t)||ai(t)||!!(Qs&&t&&t[Qs])}function tn(t,n){var s=typeof t;return n=n??Qe,!!n&&(s=="number"||s!="symbol"&&Gr.test(t))&&t>-1&&t%1==0&&t0){if(++n>=jt)return arguments[0]}else n=0;return t.apply(e,arguments)}}function ko(t,n){var s=-1,f=t.length,d=f-1;for(n=n===e?f:n;++s1?t[n-1]:e;return s=typeof s=="function"?(t.pop(),s):e,Kc(t,s)});function Zc(t){var n=g(t);return n.__chain__=!0,n}function zm(t,n){return n(t),t}function Co(t,n){return n(t)}var $m=en(function(t){var n=t.length,s=n?t[0]:0,f=this.__wrapped__,d=function(x){return Qi(x,t)};return n>1||this.__actions__.length||!(f instanceof ie)||!tn(s)?this.thru(d):(f=f.slice(s,+s+(n?1:0)),f.__actions__.push({func:Co,args:[d],thisArg:e}),new Dt(f,this.__chain__).thru(function(x){return n&&!x.length&&x.push(e),x}))});function jm(){return Zc(this)}function Qm(){return new Dt(this.value(),this.__chain__)}function Km(){this.__values__===e&&(this.__values__=ch(this.value()));var t=this.__index__>=this.__values__.length,n=t?e:this.__values__[this.__index__++];return{done:t,value:n}}function Zm(){return this}function Xm(t){for(var n,s=this;s instanceof Gi;){var f=qc(s);f.__index__=0,f.__values__=e,n?d.__wrapped__=f:n=f;var d=f;s=s.__wrapped__}return d.__wrapped__=t,n}function Jm(){var t=this.__wrapped__;if(t instanceof ie){var n=t;return this.__actions__.length&&(n=new ie(this)),n=n.reverse(),n.__actions__.push({func:Co,args:[nf],thisArg:e}),new Dt(n,this.__chain__)}return this.thru(nf)}function eg(){return pc(this.__wrapped__,this.__actions__)}var tg=yo(function(t,n,s){be.call(t,s)?++t[s]:_r(t,s,1)});function rg(t,n,s){var f=ee(t)?Ii:Dl;return s&&bt(t,n,s)&&(n=e),f(t,$(n,3))}function ng(t,n){var s=ee(t)?Ar:fo;return s(t,$(n,3))}var ig=kc(Gc),ag=kc(zc);function sg(t,n){return it(To(t,n),1)}function og(t,n){return it(To(t,n),Oe)}function ug(t,n,s){return s=s===e?1:ne(s),it(To(t,n),s)}function Xc(t,n){var s=ee(t)?He:Wr;return s(t,$(n,3))}function Jc(t,n){var s=ee(t)?Au:lo;return s(t,$(n,3))}var lg=yo(function(t,n,s){be.call(t,s)?t[s].push(n):_r(t,s,[n])});function fg(t,n,s,f){t=Ot(t)?t:ta(t),s=s&&!f?ne(s):0;var d=t.length;return s<0&&(s=qe(d+s,0)),Mo(t)?s<=d&&t.indexOf(n,s)>-1:!!d&&Sn(t,n,s)>-1}var cg=oe(function(t,n,s){var f=-1,d=typeof n=="function",x=Ot(t)?P(t.length):[];return Wr(t,function(w){x[++f]=d?ht(n,w,s):tr(w,n,s)}),x}),hg=yo(function(t,n,s){_r(t,s,n)});function To(t,n){var s=ee(t)?Ee:E;return s(t,$(n,3))}function pg(t,n,s,f){return t==null?[]:(ee(n)||(n=n==null?[]:[n]),s=f?e:s,ee(s)||(s=s==null?[]:[s]),kr(t,n,s))}var dg=yo(function(t,n,s){t[s?0:1].push(n)},function(){return[[],[]]});function mg(t,n,s){var f=ee(t)?Ma:Ws,d=arguments.length<3;return f(t,$(n,4),s,d,Wr)}function gg(t,n,s){var f=ee(t)?Fu:Ws,d=arguments.length<3;return f(t,$(n,4),s,d,lo)}function yg(t,n){var s=ee(t)?Ar:fo;return s(t,Do($(n,3)))}function xg(t){var n=ee(t)?so:fd;return n(t)}function vg(t,n,s){(s?bt(t,n,s):n===e)?n=1:n=ne(n);var f=ee(t)?Cl:cd;return f(t,n)}function wg(t){var n=ee(t)?Tl:pd;return n(t)}function Sg(t){if(t==null)return 0;if(Ot(t))return Mo(t)?Fr(t):t.length;var n=yt(t);return n==Yt||n==De?t.size:h(t).length}function _g(t,n,s){var f=ee(t)?Oa:dd;return s&&bt(t,n,s)&&(n=e),f(t,$(n,3))}var bg=oe(function(t,n){if(t==null)return[];var s=n.length;return s>1&&bt(t,n[0],n[1])?n=[]:s>2&&bt(n[0],n[1],n[2])&&(n=[n[0]]),kr(t,it(n,1),[])}),Po=rl||function(){return rt.Date.now()};function kg(t,n){if(typeof n!="function")throw new Et(l);return t=ne(t),function(){if(--t<1)return n.apply(this,arguments)}}function eh(t,n,s){return n=s?e:n,n=t&&n==null?t.length:n,Jr(t,$e,e,e,e,e,n)}function th(t,n){var s;if(typeof n!="function")throw new Et(l);return t=ne(t),function(){return--t>0&&(s=n.apply(this,arguments)),t<=1&&(n=e),s}}var sf=oe(function(t,n,s){var f=N;if(s.length){var d=Ut(s,Ji(sf));f|=We}return Jr(t,f,n,s,d)}),rh=oe(function(t,n,s){var f=N|_e;if(s.length){var d=Ut(s,Ji(rh));f|=We}return Jr(n,f,t,s,d)});function nh(t,n,s){n=s?e:n;var f=Jr(t,ye,e,e,e,e,e,n);return f.placeholder=nh.placeholder,f}function ih(t,n,s){n=s?e:n;var f=Jr(t,de,e,e,e,e,e,n);return f.placeholder=ih.placeholder,f}function ah(t,n,s){var f,d,x,w,_,k,I=0,M=!1,O=!1,W=!0;if(typeof t!="function")throw new Et(l);n=ar(n)||0,Ve(s)&&(M=!!s.leading,O="maxWait"in s,x=O?qe(ar(s.maxWait)||0,n):x,W="trailing"in s?!!s.trailing:W);function q(Je){var Tr=f,an=d;return f=d=e,I=Je,w=t.apply(an,Tr),w}function j(Je){return I=Je,_=Xa(ue,n),M?q(Je):w}function ae(Je){var Tr=Je-k,an=Je-I,kh=n-Tr;return O?Be(kh,x-an):kh}function Q(Je){var Tr=Je-k,an=Je-I;return k===e||Tr>=n||Tr<0||O&&an>=x}function ue(){var Je=Po();if(Q(Je))return he(Je);_=Xa(ue,ae(Je))}function he(Je){return _=e,W&&f?q(Je):(f=d=e,w)}function zt(){_!==e&&mc(_),I=0,f=k=d=_=e}function kt(){return _===e?w:he(Po())}function $t(){var Je=Po(),Tr=Q(Je);if(f=arguments,d=this,k=Je,Tr){if(_===e)return j(k);if(O)return mc(_),_=Xa(ue,n),q(k)}return _===e&&(_=Xa(ue,n)),w}return $t.cancel=zt,$t.flush=kt,$t}var Cg=oe(function(t,n){return uo(t,1,n)}),Tg=oe(function(t,n,s){return uo(t,ar(n)||0,s)});function Pg(t){return Jr(t,tt)}function Eo(t,n){if(typeof t!="function"||n!=null&&typeof n!="function")throw new Et(l);var s=function(){var f=arguments,d=n?n.apply(this,f):f[0],x=s.cache;if(x.has(d))return x.get(d);var w=t.apply(this,f);return s.cache=x.set(d,w)||x,w};return s.cache=new(Eo.Cache||Sr),s}Eo.Cache=Sr;function Do(t){if(typeof t!="function")throw new Et(l);return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2])}return!t.apply(this,n)}}function Eg(t){return th(2,t)}var Dg=md(function(t,n){n=n.length==1&&ee(n[0])?Ee(n[0],gt($())):Ee(it(n,1),gt($()));var s=n.length;return oe(function(f){for(var d=-1,x=Be(f.length,s);++d=n}),ai=po(function(){return arguments}())?po:function(t){return Ge(t)&&be.call(t,"callee")&&!js.call(t,"callee")},ee=P.isArray,qg=Ms?gt(Ms):Fl;function Ot(t){return t!=null&&Io(t.length)&&!rn(t)}function Xe(t){return Ge(t)&&Ot(t)}function Gg(t){return t===!0||t===!1||Ge(t)&&pt(t)==Er}var On=Ks||xf,zg=Da?gt(Da):Nl;function $g(t){return Ge(t)&&t.nodeType===1&&!Ja(t)}function jg(t){if(t==null)return!0;if(Ot(t)&&(ee(t)||typeof t=="string"||typeof t.splice=="function"||On(t)||ea(t)||ai(t)))return!t.length;var n=yt(t);if(n==Yt||n==De)return!t.size;if(Za(t))return!h(t).length;for(var s in t)if(be.call(t,s))return!1;return!0}function Qg(t,n){return ti(t,n)}function Kg(t,n,s){s=typeof s=="function"?s:e;var f=s?s(t,n):e;return f===e?ti(t,n,e,s):!!f}function uf(t){if(!Ge(t))return!1;var n=pt(t);return n==yi||n==Jo||typeof t.message=="string"&&typeof t.name=="string"&&!Ja(t)}function Zg(t){return typeof t=="number"&&Qn(t)}function rn(t){if(!Ve(t))return!1;var n=pt(t);return n==xi||n==hs||n==Xo||n==tu}function oh(t){return typeof t=="number"&&t==ne(t)}function Io(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Qe}function Ve(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}function Ge(t){return t!=null&&typeof t=="object"}var uh=Os?gt(Os):ja;function Xg(t,n){return t===n||Yr(t,n,Zl(n))}function Jg(t,n,s){return s=typeof s=="function"?s:e,Yr(t,n,Zl(n),s)}function e0(t){return lh(t)&&t!=+t}function t0(t){if(Wd(t))throw new Z(u);return ri(t)}function r0(t){return t===null}function n0(t){return t==null}function lh(t){return typeof t=="number"||Ge(t)&&pt(t)==Yn}function Ja(t){if(!Ge(t)||pt(t)!=dr)return!1;var n=Wi(t);if(n===null)return!0;var s=be.call(n,"constructor")&&n.constructor;return typeof s=="function"&&s instanceof s&&zn.call(s)==Xu}var lf=As?gt(As):le;function i0(t){return oh(t)&&t>=-Qe&&t<=Qe}var fh=Un?gt(Un):i;function Mo(t){return typeof t=="string"||!ee(t)&&Ge(t)&&pt(t)==st}function Gt(t){return typeof t=="symbol"||Ge(t)&&pt(t)==dn}var ea=yr?gt(yr):o;function a0(t){return t===e}function s0(t){return Ge(t)&&yt(t)==Ue}function o0(t){return Ge(t)&&pt(t)==ru}var u0=So(S),l0=So(function(t,n){return t<=n});function ch(t){if(!t)return[];if(Ot(t))return Mo(t)?wt(t):Mt(t);if($n&&t[$n])return Hu(t[$n]());var n=yt(t),s=n==Yt?Wa:n==De?bn:ta;return s(t)}function nn(t){if(!t)return t===0?t:0;if(t=ar(t),t===Oe||t===-Oe){var n=t<0?-1:1;return n*Wt}return t===t?t:0}function ne(t){var n=nn(t),s=n%1;return n===n?s?n-s:n:0}function hh(t){return t?Zr(ne(t),0,Pt):0}function ar(t){if(typeof t=="number")return t;if(Gt(t))return xt;if(Ve(t)){var n=typeof t.valueOf=="function"?t.valueOf():t;t=Ve(n)?n+"":n}if(typeof t!="string")return t===0?t:+t;t=Ys(t);var s=Ke.test(t);return s||gr.test(t)?Ds(t.slice(2),s?2:8):Kt.test(t)?xt:+t}function ph(t){return Br(t,At(t))}function f0(t){return t?Zr(ne(t),-Qe,Qe):t===0?t:0}function Te(t){return t==null?"":qt(t)}var c0=Zi(function(t,n){if(Za(n)||Ot(n)){Br(n,lt(n),t);return}for(var s in n)be.call(n,s)&&ei(t,s,n[s])}),dh=Zi(function(t,n){Br(n,At(n),t)}),Oo=Zi(function(t,n,s,f){Br(n,At(n),t,f)}),h0=Zi(function(t,n,s,f){Br(n,lt(n),t,f)}),p0=en(Qi);function d0(t,n){var s=En(t);return n==null?s:Ua(s,n)}var m0=oe(function(t,n){t=se(t);var s=-1,f=n.length,d=f>2?n[2]:e;for(d&&bt(n[0],n[1],d)&&(f=1);++s1),x}),Br(t,Ql(t),s),f&&(s=St(s,A|R|V,Td));for(var d=n.length;d--;)Vl(s,n[d]);return s});function A0(t,n){return gh(t,Do($(n)))}var F0=en(function(t,n){return t==null?{}:od(t,n)});function gh(t,n){if(t==null)return{};var s=Ee(Ql(t),function(f){return[f]});return n=$(n),oc(t,s,function(f,d){return n(f,d[0])})}function N0(t,n,s){n=In(n,t);var f=-1,d=n.length;for(d||(d=1,t=e);++fn){var f=t;t=n,n=f}if(s||t%1||n%1){var d=Js();return Be(t+d*(n-t+Es("1e-"+((d+"").length-1))),n)}return Wl(t,n)}var z0=Xi(function(t,n,s){return n=n.toLowerCase(),t+(s?vh(n):n)});function vh(t){return hf(Te(t).toLowerCase())}function wh(t){return t=Te(t),t&&t.replace(uu,Vs).replace(bu,"")}function $0(t,n,s){t=Te(t),n=qt(n);var f=t.length;s=s===e?f:Zr(ne(s),0,f);var d=s;return s-=n.length,s>=0&&t.slice(s,d)==n}function j0(t){return t=Te(t),t&&ga.test(t)?t.replace(ma,Yu):t}function Q0(t){return t=Te(t),t&&Ti.test(t)?t.replace(qr,"\\\\$&"):t}var K0=Xi(function(t,n,s){return t+(s?"-":"")+n.toLowerCase()}),Z0=Xi(function(t,n,s){return t+(s?" ":"")+n.toLowerCase()}),X0=bc("toLowerCase");function J0(t,n,s){t=Te(t),n=ne(n);var f=n?Fr(t):0;if(!n||f>=n)return t;var d=(n-f)/2;return wo(jn(d),s)+t+wo(Bi(d),s)}function ey(t,n,s){t=Te(t),n=ne(n);var f=n?Fr(t):0;return n&&f>>0,s?(t=Te(t),t&&(typeof n=="string"||n!=null&&!lf(n))&&(n=qt(n),!n&&Xt(t))?Mn(wt(t),0,s):t.split(n,s)):[]}var oy=Xi(function(t,n,s){return t+(s?" ":"")+hf(n)});function uy(t,n,s){return t=Te(t),s=s==null?0:Zr(ne(s),0,t.length),n=qt(n),t.slice(s,s+n.length)==n}function ly(t,n,s){var f=g.templateSettings;s&&bt(t,n,s)&&(n=e),t=Te(t),n=Oo({},n,f,Ic);var d=Oo({},n.imports,f.imports,Ic),x=lt(d),w=Ra(d,x),_,k,I=0,M=n.interpolate||Pi,O="__p += '",W=xr((n.escape||Pi).source+"|"+M.source+"|"+(M===Bn?ot:Pi).source+"|"+(n.evaluate||Pi).source+"|$","g"),q="//# sourceURL="+(be.call(n,"sourceURL")?(n.sourceURL+"").replace(/\\s/g," "):"lodash.templateSources["+ ++Eu+"]")+\` -\`;t.replace(W,function(Q,ue,he,zt,kt,$t){return he||(he=zt),O+=t.slice(I,$t).replace(lu,Bu),ue&&(_=!0,O+=\`' + -__e(\`+ue+\`) + -'\`),kt&&(k=!0,O+=\`'; -\`+kt+\`; -__p += '\`),he&&(O+=\`' + -((__t = (\`+he+\`)) == null ? '' : __t) + -'\`),I=$t+Q.length,Q}),O+=\`'; -\`;var j=be.call(n,"variable")&&n.variable;if(!j)O=\`with (obj) { -\`+O+\` -} -\`;else if(Vn.test(j))throw new Z(p);O=(k?O.replace(pa,""):O).replace(_i,"$1").replace(Ae,"$1;"),O="function("+(j||"obj")+\`) { -\`+(j?"":\`obj || (obj = {}); -\`)+"var __t, __p = ''"+(_?", __e = _.escape":"")+(k?\`, __j = Array.prototype.join; + return inlineWorker('"use strict";var Kg=Object.create;var oc=Object.defineProperty;var Jg=Object.getOwnPropertyDescriptor;var Xg=Object.getOwnPropertyNames;var jg=Object.getPrototypeOf,ey=Object.prototype.hasOwnProperty;var lc=(i,l)=>()=>(l||i((l={exports:{}}).exports,l),l.exports);var ty=(i,l,h,m)=>{if(l&&typeof l=="object"||typeof l=="function")for(let y of Xg(l))!ey.call(i,y)&&y!==h&&oc(i,y,{get:()=>l[y],enumerable:!(m=Jg(l,y))||m.enumerable});return i};var uc=(i,l,h)=>(h=i!=null?Kg(jg(i)):{},ty(l||!i||!i.__esModule?oc(h,"default",{value:i,enumerable:!0}):h,i));var fc=lc((Ta,_i)=>{(function(){var i,l="4.17.21",h=200,m="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",y="Expected a function",S="Invalid `variable` option passed into `_.template`",P="__lodash_hash_undefined__",Y=500,E="__lodash_placeholder__",G=1,ge=2,V=4,te=1,ce=2,I=1,Me=2,ze=4,ke=8,ie=16,Pe=32,Re=64,Ne=128,ye=256,Le=512,Ee=30,Zt="...",Yt=800,se=16,Ke=1,it=2,Tt=3,we=1/0,Ue=9007199254740991,Dt=17976931348623157e292,lt=0/0,mt=4294967295,Nn=mt-1,Pa=mt>>>1,Ur=[["ary",Ne],["bind",I],["bindKey",Me],["curry",ke],["curryRight",ie],["flip",Le],["partial",Pe],["partialRight",Re],["rearg",ye]],R="[object Arguments]",Ln="[object Array]",Xs="[object AsyncFunction]",lr="[object Boolean]",Br="[object Date]",js="[object DOMException]",En="[object Error]",Un="[object Function]",ki="[object GeneratorFunction]",Mt="[object Map]",cn="[object Number]",eo="[object Null]",Qt="[object Object]",Oi="[object Promise]",to="[object Proxy]",Kt="[object RegExp]",_e="[object Set]",Je="[object String]",Hr="[object Symbol]",Pi="[object Undefined]",Ie="[object WeakMap]",ro="[object WeakSet]",ur="[object ArrayBuffer]",Ze="[object DataView]",Q="[object Float32Array]",fr="[object Float64Array]",Gr="[object Int8Array]",Bn="[object Int16Array]",Fa="[object Int32Array]",Ca="[object Uint8Array]",Hn="[object Uint8ClampedArray]",tt="[object Uint16Array]",Gn="[object Uint32Array]",Ia=/\\b__p \\+= \'\';/g,$n=/\\b(__p \\+=) \'\' \\+/g,be=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n\'\';/g,Aa=/&(?:amp|lt|gt|quot|#39);/g,Wa=/[&<>"\']/g,qn=RegExp(Aa.source),Ya=RegExp(Wa.source),Vn=/<%-([\\s\\S]+?)%>/g,$r=/<%([\\s\\S]+?)%>/g,dn=/<%=([\\s\\S]+?)%>/g,no=/\\.|\\[(?:[^[\\]]*|(["\'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,zn=/^\\w*$/,ao=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,br=/[\\\\^$.*+?()[\\]{}|]/g,Zn=RegExp(br.source),A=/^\\s+/,io=/\\s/,so=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,ut=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,Ra=/,? & /,pe=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,hn=/[()=,{}\\[\\]\\/\\s]/,oo=/\\\\(\\\\)?/g,Xe=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,Rt=/\\w*$/,Nt=/^[-+]0x[0-9a-f]+$/i,Be=/^0b[01]+$/i,kt=/^\\[object .+?Constructor\\]$/,Jt=/^0o[0-7]+$/i,Tr=/^(?:0|[1-9]\\d*)$/,lo=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,Qn=/($^)/,uo=/[\'\\n\\r\\u2028\\u2029\\\\]/g,Oe="\\\\ud800-\\\\udfff",Kn="\\\\u0300-\\\\u036f",fo="\\\\ufe20-\\\\ufe2f",Fi="\\\\u20d0-\\\\u20ff",Na=Kn+fo+Fi,Ci="\\\\u2700-\\\\u27bf",Ii="a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff",co="\\\\xac\\\\xb1\\\\xd7\\\\xf7",ho="\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf",po="\\\\u2000-\\\\u206f",mo=" \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000",La="A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde",Ea="\\\\ufe0e\\\\ufe0f",Ai=co+ho+po+mo,Ua="[\'\\u2019]",go="["+Oe+"]",Ba="["+Ai+"]",cr="["+Na+"]",Ha="\\\\d+",yo="["+Ci+"]",Wi="["+Ii+"]",qr="[^"+Oe+Ai+Ha+Ci+Ii+La+"]",Vr="\\\\ud83c[\\\\udffb-\\\\udfff]",Yi="(?:"+cr+"|"+Vr+")",zr="[^"+Oe+"]",Ot="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",Ga="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",Zr="["+La+"]",Ri="\\\\u200d",Ni="(?:"+Wi+"|"+qr+")",vo="(?:"+Zr+"|"+qr+")",Li="(?:"+Ua+"(?:d|ll|m|re|s|t|ve))?",Ei="(?:"+Ua+"(?:D|LL|M|RE|S|T|VE))?",Ui=Yi+"?",Jn="["+Ea+"]?",_o="(?:"+Ri+"(?:"+[zr,Ot,Ga].join("|")+")"+Jn+Ui+")*",Bi="\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])",xo="\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])",Hi=Jn+Ui+_o,So="(?:"+[yo,Ot,Ga].join("|")+")"+Hi,wo="(?:"+[zr+cr+"?",cr,Ot,Ga,go].join("|")+")",bo=RegExp(Ua,"g"),To=RegExp(cr,"g"),$a=RegExp(Vr+"(?="+Vr+")|"+wo+Hi,"g"),Do=RegExp([Zr+"?"+Wi+"+"+Li+"(?="+[Ba,Zr,"$"].join("|")+")",vo+"+"+Ei+"(?="+[Ba,Zr+Ni,"$"].join("|")+")",Zr+"?"+Ni+"+"+Li,Zr+"+"+Ei,xo,Bi,Ha,So].join("|"),"g"),Mo=RegExp("["+Ri+Oe+Na+Ea+"]"),ko=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Oo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Po=-1,Te={};Te[Q]=Te[fr]=Te[Gr]=Te[Bn]=Te[Fa]=Te[Ca]=Te[Hn]=Te[tt]=Te[Gn]=!0,Te[R]=Te[Ln]=Te[ur]=Te[lr]=Te[Ze]=Te[Br]=Te[En]=Te[Un]=Te[Mt]=Te[cn]=Te[Qt]=Te[Kt]=Te[_e]=Te[Je]=Te[Ie]=!1;var xe={};xe[R]=xe[Ln]=xe[ur]=xe[Ze]=xe[lr]=xe[Br]=xe[Q]=xe[fr]=xe[Gr]=xe[Bn]=xe[Fa]=xe[Mt]=xe[cn]=xe[Qt]=xe[Kt]=xe[_e]=xe[Je]=xe[Hr]=xe[Ca]=xe[Hn]=xe[tt]=xe[Gn]=!0,xe[En]=xe[Un]=xe[Ie]=!1;var Fo={\\u00C0:"A",\\u00C1:"A",\\u00C2:"A",\\u00C3:"A",\\u00C4:"A",\\u00C5:"A",\\u00E0:"a",\\u00E1:"a",\\u00E2:"a",\\u00E3:"a",\\u00E4:"a",\\u00E5:"a",\\u00C7:"C",\\u00E7:"c",\\u00D0:"D",\\u00F0:"d",\\u00C8:"E",\\u00C9:"E",\\u00CA:"E",\\u00CB:"E",\\u00E8:"e",\\u00E9:"e",\\u00EA:"e",\\u00EB:"e",\\u00CC:"I",\\u00CD:"I",\\u00CE:"I",\\u00CF:"I",\\u00EC:"i",\\u00ED:"i",\\u00EE:"i",\\u00EF:"i",\\u00D1:"N",\\u00F1:"n",\\u00D2:"O",\\u00D3:"O",\\u00D4:"O",\\u00D5:"O",\\u00D6:"O",\\u00D8:"O",\\u00F2:"o",\\u00F3:"o",\\u00F4:"o",\\u00F5:"o",\\u00F6:"o",\\u00F8:"o",\\u00D9:"U",\\u00DA:"U",\\u00DB:"U",\\u00DC:"U",\\u00F9:"u",\\u00FA:"u",\\u00FB:"u",\\u00FC:"u",\\u00DD:"Y",\\u00FD:"y",\\u00FF:"y",\\u00C6:"Ae",\\u00E6:"ae",\\u00DE:"Th",\\u00FE:"th",\\u00DF:"ss",\\u0100:"A",\\u0102:"A",\\u0104:"A",\\u0101:"a",\\u0103:"a",\\u0105:"a",\\u0106:"C",\\u0108:"C",\\u010A:"C",\\u010C:"C",\\u0107:"c",\\u0109:"c",\\u010B:"c",\\u010D:"c",\\u010E:"D",\\u0110:"D",\\u010F:"d",\\u0111:"d",\\u0112:"E",\\u0114:"E",\\u0116:"E",\\u0118:"E",\\u011A:"E",\\u0113:"e",\\u0115:"e",\\u0117:"e",\\u0119:"e",\\u011B:"e",\\u011C:"G",\\u011E:"G",\\u0120:"G",\\u0122:"G",\\u011D:"g",\\u011F:"g",\\u0121:"g",\\u0123:"g",\\u0124:"H",\\u0126:"H",\\u0125:"h",\\u0127:"h",\\u0128:"I",\\u012A:"I",\\u012C:"I",\\u012E:"I",\\u0130:"I",\\u0129:"i",\\u012B:"i",\\u012D:"i",\\u012F:"i",\\u0131:"i",\\u0134:"J",\\u0135:"j",\\u0136:"K",\\u0137:"k",\\u0138:"k",\\u0139:"L",\\u013B:"L",\\u013D:"L",\\u013F:"L",\\u0141:"L",\\u013A:"l",\\u013C:"l",\\u013E:"l",\\u0140:"l",\\u0142:"l",\\u0143:"N",\\u0145:"N",\\u0147:"N",\\u014A:"N",\\u0144:"n",\\u0146:"n",\\u0148:"n",\\u014B:"n",\\u014C:"O",\\u014E:"O",\\u0150:"O",\\u014D:"o",\\u014F:"o",\\u0151:"o",\\u0154:"R",\\u0156:"R",\\u0158:"R",\\u0155:"r",\\u0157:"r",\\u0159:"r",\\u015A:"S",\\u015C:"S",\\u015E:"S",\\u0160:"S",\\u015B:"s",\\u015D:"s",\\u015F:"s",\\u0161:"s",\\u0162:"T",\\u0164:"T",\\u0166:"T",\\u0163:"t",\\u0165:"t",\\u0167:"t",\\u0168:"U",\\u016A:"U",\\u016C:"U",\\u016E:"U",\\u0170:"U",\\u0172:"U",\\u0169:"u",\\u016B:"u",\\u016D:"u",\\u016F:"u",\\u0171:"u",\\u0173:"u",\\u0174:"W",\\u0175:"w",\\u0176:"Y",\\u0177:"y",\\u0178:"Y",\\u0179:"Z",\\u017B:"Z",\\u017D:"Z",\\u017A:"z",\\u017C:"z",\\u017E:"z",\\u0132:"IJ",\\u0133:"ij",\\u0152:"Oe",\\u0153:"oe",\\u0149:"\'n",\\u017F:"s"},qa={"&":"&","<":"<",">":">",\'"\':""","\'":"'"},Va={"&":"&","<":"<",">":">",""":\'"\',"'":"\'"},Co={"\\\\":"\\\\","\'":"\'","\\n":"n","\\r":"r","\\u2028":"u2028","\\u2029":"u2029"},Gi=parseFloat,$i=parseInt,qi=typeof global=="object"&&global&&global.Object===Object&&global,Io=typeof self=="object"&&self&&self.Object===Object&&self,Ve=qi||Io||Function("return this")(),za=typeof Ta=="object"&&Ta&&!Ta.nodeType&&Ta,dr=za&&typeof _i=="object"&&_i&&!_i.nodeType&&_i,De=dr&&dr.exports===za,Dr=De&&qi.process,je=function(){try{var x=dr&&dr.require&&dr.require("util").types;return x||Dr&&Dr.binding&&Dr.binding("util")}catch{}}(),Vi=je&&je.isArrayBuffer,Za=je&&je.isDate,zi=je&&je.isMap,Zi=je&&je.isRegExp,pn=je&&je.isSet,Xt=je&&je.isTypedArray;function rt(x,D,b){switch(b.length){case 0:return x.call(D);case 1:return x.call(D,b[0]);case 2:return x.call(D,b[0],b[1]);case 3:return x.call(D,b[0],b[1],b[2])}return x.apply(D,b)}function Ao(x,D,b,W){for(var $=-1,le=x==null?0:x.length;++$-1}function Qa(x,D,b){for(var W=-1,$=x==null?0:x.length;++W<$;)if(b(D,x[W]))return!0;return!1}function ve(x,D){for(var b=-1,W=x==null?0:x.length,$=Array(W);++b-1;);return b}function ts(x,D){for(var b=x.length;b--&&Qr(D,x[b],0)>-1;);return b}function Eo(x,D){for(var b=x.length,W=0;b--;)x[b]===D&&++W;return W}var rs=mn(Fo),Uo=mn(qa);function Bo(x){return"\\\\"+Co[x]}function Ho(x,D){return x==null?i:x[D]}function Et(x){return Mo.test(x)}function Go(x){return ko.test(x)}function $o(x){for(var D,b=[];!(D=x.next()).done;)b.push(D.value);return b}function ni(x){var D=-1,b=Array(x.size);return x.forEach(function(W,$){b[++D]=[$,W]}),b}function gn(x,D){return function(b){return x(D(b))}}function Pt(x,D){for(var b=-1,W=x.length,$=0,le=[];++b-1}function ys(e,t){var n=this.__data__,s=vt(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this}tr.prototype.clear=vl,tr.prototype.delete=gs,tr.prototype.get=_l,tr.prototype.has=xl,tr.prototype.set=ys;function rr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t=t?e:t)),e}function ct(e,t,n,s,f,p){var g,_=t&G,w=t&ge,M=t&V;if(n&&(g=f?n(e,s,f,p):n(e)),g!==i)return g;if(!Ce(e))return e;var k=Z(e);if(k){if(g=Dd(e),!_)return _t(e,g)}else{var O=ot(e),C=O==Un||O==ki;if(on(e))return Ju(e,_);if(O==Qt||O==R||C&&!f){if(g=w||C?{}:yf(e),!_)return w?pd(e,Pl(g,e)):hd(e,oi(g,e))}else{if(!xe[O])return f?e:{};g=Md(e,O,_)}}p||(p=new Ft);var N=p.get(e);if(N)return N;p.set(e,g),Vf(e)?e.forEach(function(H){g.add(ct(H,t,n,H,e,p))}):$f(e)&&e.forEach(function(H,re){g.set(re,ct(H,t,n,re,e,p))});var B=M?w?Kl:Ql:w?St:et,X=k?i:B(e);return Ae(X||e,function(H,re){X&&(re=H,H=e[re]),Mn(g,re,ct(H,t,n,re,e,p))}),g}function li(e){var t=et(e);return function(n){return ws(n,e,t)}}function ws(e,t,n){var s=n.length;if(e==null)return!s;for(e=j(e);s--;){var f=n[s],p=t[f],g=e[f];if(g===i&&!(f in e)||!p(g))return!1}return!0}function bs(e,t,n){if(typeof e!="function")throw new gt(y);return yi(function(){e.apply(i,n)},t)}function dt(e,t,n,s){var f=-1,p=jn,g=!0,_=e.length,w=[],M=t.length;if(!_)return w;n&&(t=ve(t,st(n))),s?(p=Qa,g=!1):t.length>=h&&(p=Kr,g=!1,t=new Pr(t));e:for(;++f<_;){var k=e[f],O=n==null?k:n(k);if(k=s||k!==0?k:0,g&&O===O){for(var C=M;C--;)if(t[C]===O)continue e;w.push(k)}else p(t,O,s)||w.push(k)}return w}var vr=rf(Ut),Ts=rf(fi,!0);function Fl(e,t){var n=!0;return vr(e,function(s,f,p){return n=!!t(s,f,p),n}),n}function va(e,t,n){for(var s=-1,f=e.length;++sf?0:f+n),s=s===i||s>f?f:K(s),s<0&&(s+=f),s=n>s?0:Zf(s);n0&&n(_)?t>1?Qe(_,t-1,n,s,f):Lt(f,_):s||(f[f.length]=_)}return f}var ui=nf(),Ms=nf(!0);function Ut(e,t){return e&&ui(e,t,et)}function fi(e,t){return e&&Ms(e,t,et)}function Bt(e,t){return hr(t,function(n){return Yr(e[n])})}function Cr(e,t){t=an(t,e);for(var n=0,s=t.length;e!=null&&nt}function Il(e,t){return e!=null&&de.call(e,t)}function Al(e,t){return e!=null&&t in j(e)}function Wl(e,t,n){return e>=Fe(t,n)&&e=120&&k.length>=120)?new Pr(g&&k):i}k=e[0];var O=-1,C=_[0];e:for(;++O-1;)_!==e&&kr.call(_,w,1),kr.call(e,w,1);return e}function Gu(e,t){for(var n=e?t.length:0,s=n-1;n--;){var f=t[n];if(n==s||f!==p){var p=f;Wr(f)?kr.call(e,f,1):Hl(e,f)}}return e}function El(e,t){return e+xn(ps()*(t-e+1))}function rd(e,t,n,s){for(var f=-1,p=We(la((t-e)/(n||1)),0),g=b(p);p--;)g[s?p:++f]=e,e+=n;return g}function Ul(e,t){var n="";if(!e||t<1||t>Ue)return n;do t%2&&(n+=e),t=xn(t/2),t&&(e+=e);while(t);return n}function ee(e,t){return nu(xf(e,t,wt),e+"")}function nd(e){return Ss(ba(e))}function ad(e,t){var n=ba(e);return Ls(n,Fr(t,0,n.length))}function pi(e,t,n,s){if(!Ce(e))return e;t=an(t,e);for(var f=-1,p=t.length,g=p-1,_=e;_!=null&&++ff?0:f+t),n=n>f?f:n,n<0&&(n+=f),f=t>n?0:n-t>>>0,t>>>=0;for(var p=b(f);++s>>1,g=e[p];g!==null&&!It(g)&&(n?g<=t:g=h){var M=t?null:vd(e);if(M)return Jr(M);g=!1,f=Kr,w=new Pr}else w=t?[]:_;e:for(;++s=s?e:$t(e,t,n)}var Ku=rl||function(e){return Ve.clearTimeout(e)};function Ju(e,t){if(t)return e.slice();var n=e.length,s=os?os(n):new e.constructor(n);return e.copy(s),s}function Vl(e){var t=new e.constructor(e.byteLength);return new ia(t).set(new ia(e)),t}function ud(e,t){var n=t?Vl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function fd(e){var t=new e.constructor(e.source,Rt.exec(e));return t.lastIndex=e.lastIndex,t}function cd(e){return Dn?j(Dn.call(e)):{}}function Xu(e,t){var n=t?Vl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ju(e,t){if(e!==t){var n=e!==i,s=e===null,f=e===e,p=It(e),g=t!==i,_=t===null,w=t===t,M=It(t);if(!_&&!M&&!p&&e>t||p&&g&&w&&!_&&!M||s&&g&&w||!n&&w||!f)return 1;if(!s&&!p&&!M&&e=_)return w;var M=n[s];return w*(M=="desc"?-1:1)}}return e.index-t.index}function ef(e,t,n,s){for(var f=-1,p=e.length,g=n.length,_=-1,w=t.length,M=We(p-g,0),k=b(w+M),O=!s;++_1?n[f-1]:i,g=f>2?n[2]:i;for(p=e.length>3&&typeof p=="function"?(f--,p):i,g&&ht(n[0],n[1],g)&&(p=f<3?i:p,f=1),t=j(t);++s-1?f[p?t[g]:g]:i}}function of(e){return Ar(function(t){var n=t.length,s=n,f=yt.prototype.thru;for(e&&t.reverse();s--;){var p=t[s];if(typeof p!="function")throw new gt(y);if(f&&!g&&Rs(p)=="wrapper")var g=new yt([],!0)}for(s=g?s:n;++s1&&ae.reverse(),k&&w_))return!1;var M=p.get(e),k=p.get(t);if(M&&k)return M==t&&k==e;var O=-1,C=!0,N=n&ce?new Pr:i;for(p.set(e,t),p.set(t,e);++O<_;){var B=e[O],X=t[O];if(s)var H=g?s(X,B,O,t,e,p):s(B,X,O,e,t,p);if(H!==i){if(H)continue;C=!1;break}if(N){if(!Ja(t,function(re,ae){if(!Kr(N,ae)&&(B===re||f(B,re,n,s,p)))return N.push(ae)})){C=!1;break}}else if(!(B===X||f(B,X,n,s,p))){C=!1;break}}return p.delete(e),p.delete(t),C}function xd(e,t,n,s,f,p,g){switch(n){case Ze:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ur:return!(e.byteLength!=t.byteLength||!p(new ia(e),new ia(t)));case lr:case Br:case cn:return sr(+e,+t);case En:return e.name==t.name&&e.message==t.message;case Kt:case Je:return e==t+"";case Mt:var _=ni;case _e:var w=s&te;if(_||(_=Jr),e.size!=t.size&&!w)return!1;var M=g.get(e);if(M)return M==t;s|=ce,g.set(e,t);var k=pf(_(e),_(t),s,f,p,g);return g.delete(e),k;case Hr:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}function Sd(e,t,n,s,f,p){var g=n&te,_=Ql(e),w=_.length,M=Ql(t),k=M.length;if(w!=k&&!g)return!1;for(var O=w;O--;){var C=_[O];if(!(g?C in t:de.call(t,C)))return!1}var N=p.get(e),B=p.get(t);if(N&&B)return N==t&&B==e;var X=!0;p.set(e,t),p.set(t,e);for(var H=g;++O1?"& ":"")+t[s],t=t.join(n>2?", ":" "),e.replace(so,`{\n/* [wrapped with `+t+`] */\n`)}function Od(e){return Z(e)||Cn(e)||!!(fs&&e&&e[fs])}function Wr(e,t){var n=typeof e;return t=t??Ue,!!t&&(n=="number"||n!="symbol"&&Tr.test(e))&&e>-1&&e%1==0&&e0){if(++t>=Yt)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Ls(e,t){var n=-1,s=e.length,f=s-1;for(t=t===i?s:t;++n1?e[t-1]:i;return n=typeof n=="function"?(e.pop(),n):i,If(e,n)});function Af(e){var t=d(e);return t.__chain__=!0,t}function Eh(e,t){return t(e),e}function Es(e,t){return t(e)}var Uh=Ar(function(e){var t=e.length,n=t?e[0]:0,s=this.__wrapped__,f=function(p){return ya(p,e)};return t>1||this.__actions__.length||!(s instanceof J)||!Wr(n)?this.thru(f):(s=s.slice(n,+n+(t?1:0)),s.__actions__.push({func:Es,args:[f],thisArg:i}),new yt(s,this.__chain__).thru(function(p){return t&&!p.length&&p.push(i),p}))});function Bh(){return Af(this)}function Hh(){return new yt(this.value(),this.__chain__)}function Gh(){this.__values__===i&&(this.__values__=zf(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function $h(){return this}function qh(e){for(var t,n=this;n instanceof ha;){var s=Mf(n);s.__index__=0,s.__values__=i,t?f.__wrapped__=s:t=s;var f=s;n=n.__wrapped__}return f.__wrapped__=e,t}function Vh(){var e=this.__wrapped__;if(e instanceof J){var t=e;return this.__actions__.length&&(t=new J(this)),t=t.reverse(),t.__actions__.push({func:Es,args:[au],thisArg:i}),new yt(t,this.__chain__)}return this.thru(au)}function zh(){return Zu(this.__wrapped__,this.__actions__)}var Zh=Cs(function(e,t,n){de.call(e,n)?++e[n]:nr(e,n,1)});function Qh(e,t,n){var s=Z(e)?Xn:Fl;return n&&ht(e,t,n)&&(t=i),s(e,U(t,3))}function Kh(e,t){var n=Z(e)?hr:Ds;return n(e,U(t,3))}var Jh=sf(kf),Xh=sf(Of);function jh(e,t){return Qe(Us(e,t),1)}function ep(e,t){return Qe(Us(e,t),we)}function tp(e,t,n){return n=n===i?1:K(n),Qe(Us(e,t),n)}function Wf(e,t){var n=Z(e)?Ae:vr;return n(e,U(t,3))}function Yf(e,t){var n=Z(e)?Wo:Ts;return n(e,U(t,3))}var rp=Cs(function(e,t,n){de.call(e,n)?e[n].push(t):nr(e,n,[t])});function np(e,t,n,s){e=xt(e)?e:ba(e),n=n&&!s?K(n):0;var f=e.length;return n<0&&(n=We(f+n,0)),qs(e)?n<=f&&e.indexOf(t,n)>-1:!!f&&Qr(e,t,n)>-1}var ap=ee(function(e,t,n){var s=-1,f=typeof t=="function",p=xt(e)?b(e.length):[];return vr(e,function(g){p[++s]=f?rt(t,g,n):Ht(g,t,n)}),p}),ip=Cs(function(e,t,n){nr(e,n,t)});function Us(e,t){var n=Z(e)?ve:T;return n(e,U(t,3))}function sp(e,t,n,s){return e==null?[]:(Z(t)||(t=t==null?[]:[t]),n=s?i:n,Z(n)||(n=n==null?[]:[n]),ir(e,t,n))}var op=Cs(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});function lp(e,t,n){var s=Z(e)?Ka:ji,f=arguments.length<3;return s(e,U(t,4),n,f,vr)}function up(e,t,n){var s=Z(e)?Yo:ji,f=arguments.length<3;return s(e,U(t,4),n,f,Ts)}function fp(e,t){var n=Z(e)?hr:Ds;return n(e,Gs(U(t,3)))}function cp(e){var t=Z(e)?Ss:nd;return t(e)}function dp(e,t,n){(n?ht(e,t,n):t===i)?t=1:t=K(t);var s=Z(e)?Ml:ad;return s(e,t)}function hp(e){var t=Z(e)?kl:sd;return t(e)}function pp(e){if(e==null)return 0;if(xt(e))return qs(e)?pr(e):e.length;var t=ot(e);return t==Mt||t==_e?e.size:u(e).length}function mp(e,t,n){var s=Z(e)?Ja:od;return n&&ht(e,t,n)&&(t=i),s(e,U(t,3))}var gp=ee(function(e,t){if(e==null)return[];var n=t.length;return n>1&&ht(e,t[0],t[1])?t=[]:n>2&&ht(t[0],t[1],t[2])&&(t=[t[0]]),ir(e,Qe(t,1),[])}),Bs=nl||function(){return Ve.Date.now()};function yp(e,t){if(typeof t!="function")throw new gt(y);return e=K(e),function(){if(--e<1)return t.apply(this,arguments)}}function Rf(e,t,n){return t=n?i:t,t=e&&t==null?e.length:t,Ir(e,Ne,i,i,i,i,t)}function Nf(e,t){var n;if(typeof t!="function")throw new gt(y);return e=K(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var su=ee(function(e,t,n){var s=I;if(n.length){var f=Pt(n,Sa(su));s|=Pe}return Ir(e,s,t,n,f)}),Lf=ee(function(e,t,n){var s=I|Me;if(n.length){var f=Pt(n,Sa(Lf));s|=Pe}return Ir(t,s,e,n,f)});function Ef(e,t,n){t=n?i:t;var s=Ir(e,ke,i,i,i,i,i,t);return s.placeholder=Ef.placeholder,s}function Uf(e,t,n){t=n?i:t;var s=Ir(e,ie,i,i,i,i,i,t);return s.placeholder=Uf.placeholder,s}function Bf(e,t,n){var s,f,p,g,_,w,M=0,k=!1,O=!1,C=!0;if(typeof e!="function")throw new gt(y);t=Vt(t)||0,Ce(n)&&(k=!!n.leading,O="maxWait"in n,p=O?We(Vt(n.maxWait)||0,t):p,C="trailing"in n?!!n.trailing:C);function N($e){var or=s,Nr=f;return s=f=i,M=$e,g=e.apply(Nr,or),g}function B($e){return M=$e,_=yi(re,t),k?N($e):g}function X($e){var or=$e-w,Nr=$e-M,sc=t-or;return O?Fe(sc,p-Nr):sc}function H($e){var or=$e-w,Nr=$e-M;return w===i||or>=t||or<0||O&&Nr>=p}function re(){var $e=Bs();if(H($e))return ae($e);_=yi(re,X($e))}function ae($e){return _=i,C&&s?N($e):(s=f=i,g)}function At(){_!==i&&Ku(_),M=0,s=w=f=_=i}function pt(){return _===i?g:ae(Bs())}function Wt(){var $e=Bs(),or=H($e);if(s=arguments,f=this,w=$e,or){if(_===i)return B(w);if(O)return Ku(_),_=yi(re,t),N(w)}return _===i&&(_=yi(re,t)),g}return Wt.cancel=At,Wt.flush=pt,Wt}var vp=ee(function(e,t){return bs(e,1,t)}),_p=ee(function(e,t,n){return bs(e,Vt(t)||0,n)});function xp(e){return Ir(e,Le)}function Hs(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new gt(y);var n=function(){var s=arguments,f=t?t.apply(this,s):s[0],p=n.cache;if(p.has(f))return p.get(f);var g=e.apply(this,s);return n.cache=p.set(f,g)||p,g};return n.cache=new(Hs.Cache||rr),n}Hs.Cache=rr;function Gs(e){if(typeof e!="function")throw new gt(y);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Sp(e){return Nf(2,e)}var wp=ld(function(e,t){t=t.length==1&&Z(t[0])?ve(t[0],st(U())):ve(Qe(t,1),st(U()));var n=t.length;return ee(function(s){for(var f=-1,p=Fe(s.length,n);++f=t}),Cn=Os(function(){return arguments}())?Os:function(e){return Ye(e)&&de.call(e,"callee")&&!us.call(e,"callee")},Z=b.isArray,Np=Vi?st(Vi):Yl;function xt(e){return e!=null&&$s(e.length)&&!Yr(e)}function Ge(e){return Ye(e)&&xt(e)}function Lp(e){return e===!0||e===!1||Ye(e)&&nt(e)==lr}var on=cs||vu,Ep=Za?st(Za):Rl;function Up(e){return Ye(e)&&e.nodeType===1&&!vi(e)}function Bp(e){if(e==null)return!0;if(xt(e)&&(Z(e)||typeof e=="string"||typeof e.splice=="function"||on(e)||wa(e)||Cn(e)))return!e.length;var t=ot(e);if(t==Mt||t==_e)return!e.size;if(gi(e))return!u(e).length;for(var n in e)if(de.call(e,n))return!1;return!0}function Hp(e,t){return kn(e,t)}function Gp(e,t,n){n=typeof n=="function"?n:i;var s=n?n(e,t):i;return s===i?kn(e,t,i,n):!!s}function lu(e){if(!Ye(e))return!1;var t=nt(e);return t==En||t==js||typeof e.message=="string"&&typeof e.name=="string"&&!vi(e)}function $p(e){return typeof e=="number"&&Sn(e)}function Yr(e){if(!Ce(e))return!1;var t=nt(e);return t==Un||t==ki||t==Xs||t==to}function Gf(e){return typeof e=="number"&&e==K(e)}function $s(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ue}function Ce(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ye(e){return e!=null&&typeof e=="object"}var $f=zi?st(zi):hi;function qp(e,t){return e===t||_r(e,t,Xl(t))}function Vp(e,t,n){return n=typeof n=="function"?n:i,_r(e,t,Xl(t),n)}function zp(e){return qf(e)&&e!=+e}function Zp(e){if(Cd(e))throw new $(m);return On(e)}function Qp(e){return e===null}function Kp(e){return e==null}function qf(e){return typeof e=="number"||Ye(e)&&nt(e)==cn}function vi(e){if(!Ye(e)||nt(e)!=Qt)return!1;var t=sa(e);if(t===null)return!0;var n=de.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&vn.call(n)==jo}var uu=Zi?st(Zi):ne;function Jp(e){return Gf(e)&&e>=-Ue&&e<=Ue}var Vf=pn?st(pn):r;function qs(e){return typeof e=="string"||!Z(e)&&Ye(e)&&nt(e)==Je}function It(e){return typeof e=="symbol"||Ye(e)&&nt(e)==Hr}var wa=Xt?st(Xt):a;function Xp(e){return e===i}function jp(e){return Ye(e)&&ot(e)==Ie}function em(e){return Ye(e)&&nt(e)==ro}var tm=Ys(v),rm=Ys(function(e,t){return e<=t});function zf(e){if(!e)return[];if(xt(e))return qs(e)?ft(e):_t(e);if(_n&&e[_n])return $o(e[_n]());var t=ot(e),n=t==Mt?ni:t==_e?Jr:ba;return n(e)}function Rr(e){if(!e)return e===0?e:0;if(e=Vt(e),e===we||e===-we){var t=e<0?-1:1;return t*Dt}return e===e?e:0}function K(e){var t=Rr(e),n=t%1;return t===t?n?t-n:t:0}function Zf(e){return e?Fr(K(e),0,mt):0}function Vt(e){if(typeof e=="number")return e;if(It(e))return lt;if(Ce(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ce(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=es(e);var n=Be.test(e);return n||Jt.test(e)?$i(e.slice(2),n?2:8):Nt.test(e)?lt:+e}function Qf(e){return xr(e,St(e))}function nm(e){return e?Fr(K(e),-Ue,Ue):e===0?e:0}function me(e){return e==null?"":Ct(e)}var am=_a(function(e,t){if(gi(t)||xt(t)){xr(t,et(t),e);return}for(var n in t)de.call(t,n)&&Mn(e,n,t[n])}),Kf=_a(function(e,t){xr(t,St(t),e)}),Vs=_a(function(e,t,n,s){xr(t,St(t),e,s)}),im=_a(function(e,t,n,s){xr(t,et(t),e,s)}),sm=Ar(ya);function om(e,t){var n=rn(e);return t==null?n:oi(n,t)}var lm=ee(function(e,t){e=j(e);var n=-1,s=t.length,f=s>2?t[2]:i;for(f&&ht(t[0],t[1],f)&&(s=1);++n1),p}),xr(e,Kl(e),n),s&&(n=ct(n,G|ge|V,_d));for(var f=t.length;f--;)Hl(n,t[f]);return n});function Mm(e,t){return Xf(e,Gs(U(t)))}var km=Ar(function(e,t){return e==null?{}:ed(e,t)});function Xf(e,t){if(e==null)return{};var n=ve(Kl(e),function(s){return[s]});return t=U(t),Hu(e,n,function(s,f){return t(s,f[0])})}function Om(e,t,n){t=an(t,e);var s=-1,f=t.length;for(f||(f=1,e=i);++st){var s=e;e=t,t=s}if(n||e%1||t%1){var f=ps();return Fe(e+f*(t-e+Gi("1e-"+((f+"").length-1))),t)}return El(e,t)}var Em=xa(function(e,t,n){return t=t.toLowerCase(),e+(n?tc(t):t)});function tc(e){return du(me(e).toLowerCase())}function rc(e){return e=me(e),e&&e.replace(lo,rs).replace(To,"")}function Um(e,t,n){e=me(e),t=Ct(t);var s=e.length;n=n===i?s:Fr(K(n),0,s);var f=n;return n-=t.length,n>=0&&e.slice(n,f)==t}function Bm(e){return e=me(e),e&&Ya.test(e)?e.replace(Wa,Uo):e}function Hm(e){return e=me(e),e&&Zn.test(e)?e.replace(br,"\\\\$&"):e}var Gm=xa(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),$m=xa(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),qm=af("toLowerCase");function Vm(e,t,n){e=me(e),t=K(t);var s=t?pr(e):0;if(!t||s>=t)return e;var f=(t-s)/2;return Ws(xn(f),n)+e+Ws(la(f),n)}function zm(e,t,n){e=me(e),t=K(t);var s=t?pr(e):0;return t&&s>>0,n?(e=me(e),e&&(typeof t=="string"||t!=null&&!uu(t))&&(t=Ct(t),!t&&Et(e))?sn(ft(e),0,n):e.split(t,n)):[]}var eg=xa(function(e,t,n){return e+(n?" ":"")+du(t)});function tg(e,t,n){return e=me(e),n=n==null?0:Fr(K(n),0,e.length),t=Ct(t),e.slice(n,n+t.length)==t}function rg(e,t,n){var s=d.templateSettings;n&&ht(e,t,n)&&(t=i),e=me(e),t=Vs({},t,s,df);var f=Vs({},t.imports,s.imports,df),p=et(f),g=ri(f,p),_,w,M=0,k=t.interpolate||Qn,O="__p += \'",C=jt((t.escape||Qn).source+"|"+k.source+"|"+(k===dn?Xe:Qn).source+"|"+(t.evaluate||Qn).source+"|$","g"),N="//# sourceURL="+(de.call(t,"sourceURL")?(t.sourceURL+"").replace(/\\s/g," "):"lodash.templateSources["+ ++Po+"]")+`\n`;e.replace(C,function(H,re,ae,At,pt,Wt){return ae||(ae=At),O+=e.slice(M,Wt).replace(uo,Bo),re&&(_=!0,O+=`\' +\n__e(`+re+`) +\n\'`),pt&&(w=!0,O+=`\';\n`+pt+`;\n__p += \'`),ae&&(O+=`\' +\n((__t = (`+ae+`)) == null ? \'\' : __t) +\n\'`),M=Wt+H.length,H}),O+=`\';\n`;var B=de.call(t,"variable")&&t.variable;if(!B)O=`with (obj) {\n`+O+`\n}\n`;else if(hn.test(B))throw new $(S);O=(w?O.replace(Ia,""):O).replace($n,"$1").replace(be,"$1;"),O="function("+(B||"obj")+`) {\n`+(B?"":`obj || (obj = {});\n`)+"var __t, __p = \'\'"+(_?", __e = _.escape":"")+(w?`, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, \'\') }\n`:`;\n`)+O+`return __p\n}`;var X=ac(function(){return le(p,N+"return "+O).apply(i,g)});if(X.source=O,lu(X))throw X;return X}function ng(e){return me(e).toLowerCase()}function ag(e){return me(e).toUpperCase()}function ig(e,t,n){if(e=me(e),e&&(n||t===i))return es(e);if(!e||!(t=Ct(t)))return e;var s=ft(e),f=ft(t),p=Se(s,f),g=ts(s,f)+1;return sn(s,p,g).join("")}function sg(e,t,n){if(e=me(e),e&&(n||t===i))return e.slice(0,ta(e)+1);if(!e||!(t=Ct(t)))return e;var s=ft(e),f=ts(s,ft(t))+1;return sn(s,0,f).join("")}function og(e,t,n){if(e=me(e),e&&(n||t===i))return e.replace(A,"");if(!e||!(t=Ct(t)))return e;var s=ft(e),f=Se(s,ft(t));return sn(s,f).join("")}function lg(e,t){var n=Ee,s=Zt;if(Ce(t)){var f="separator"in t?t.separator:f;n="length"in t?K(t.length):n,s="omission"in t?Ct(t.omission):s}e=me(e);var p=e.length;if(Et(e)){var g=ft(e);p=g.length}if(n>=p)return e;var _=n-pr(s);if(_<1)return s;var w=g?sn(g,0,_).join(""):e.slice(0,_);if(f===i)return w+s;if(g&&(_+=w.length-_),uu(f)){if(e.slice(_).search(f)){var M,k=w;for(f.global||(f=jt(f.source,me(Rt.exec(f))+"g")),f.lastIndex=0;M=f.exec(k);)var O=M.index;w=w.slice(0,O===i?_:O)}}else if(e.indexOf(Ct(f),_)!=_){var C=w.lastIndexOf(f);C>-1&&(w=w.slice(0,C))}return w+s}function ug(e){return e=me(e),e&&qn.test(e)?e.replace(Aa,zo):e}var fg=xa(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),du=af("toUpperCase");function nc(e,t,n){return e=me(e),t=n?i:t,t===i?Go(e)?Ko(e):No(e):e.match(t)||[]}var ac=ee(function(e,t){try{return rt(e,i,t)}catch(n){return lu(n)?n:new $(n)}}),cg=Ar(function(e,t){return Ae(t,function(n){n=Sr(n),nr(e,n,su(e[n],e))}),e});function dg(e){var t=e==null?0:e.length,n=U();return e=t?ve(e,function(s){if(typeof s[1]!="function")throw new gt(y);return[n(s[0]),s[1]]}):[],ee(function(s){for(var f=-1;++fUe)return[];var n=mt,s=Fe(e,mt);t=U(t),e-=mt;for(var f=ti(s,t);++n0||t<0)?new J(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(t=K(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},J.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},J.prototype.toArray=function(){return this.take(mt)},Ut(J.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),s=/^(?:head|last)$/.test(t),f=d[s?"take"+(t=="last"?"Right":""):t],p=s||/^find/.test(t);!f||(d.prototype[t]=function(){var g=this.__wrapped__,_=s?[1]:arguments,w=g instanceof J,M=_[0],k=w||Z(g),O=function(re){var ae=f.apply(d,Lt([re],_));return s&&C?ae[0]:ae};k&&n&&typeof M=="function"&&M.length!=1&&(w=k=!1);var C=this.__chain__,N=!!this.__actions__.length,B=p&&!C,X=w&&!N;if(!p&&k){g=X?g:new J(this);var H=e.apply(g,_);return H.__actions__.push({func:Es,args:[O],thisArg:i}),new yt(H,C)}return B&&X?e.apply(this,_):(H=this.thru(O),B?s?H.value()[0]:H.value():H)})}),Ae(["pop","push","shift","sort","splice","unshift"],function(e){var t=yn[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",s=/^(?:pop|shift)$/.test(e);d.prototype[e]=function(){var f=arguments;if(s&&!this.__chain__){var p=this.value();return t.apply(Z(p)?p:[],f)}return this[n](function(g){return t.apply(Z(g)?g:[],f)})}}),Ut(J.prototype,function(e,t){var n=d[t];if(n){var s=n.name+"";de.call(tn,s)||(tn[s]=[]),tn[s].push({name:t,func:n})}}),tn[Is(i,Me).name]=[{name:"wrapper",func:i}],J.prototype.clone=cl,J.prototype.reverse=dl,J.prototype.value=hl,d.prototype.at=Uh,d.prototype.chain=Bh,d.prototype.commit=Hh,d.prototype.next=Gh,d.prototype.plant=qh,d.prototype.reverse=Vh,d.prototype.toJSON=d.prototype.valueOf=d.prototype.value=zh,d.prototype.first=d.prototype.head,_n&&(d.prototype[_n]=$h),d},mr=Jo();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ve._=mr,define(function(){return mr})):dr?((dr.exports=mr)._=mr,za._=mr):Ve._=mr}).call(Ta)});var dc=lc((_u,Da)=>{(function(i,l){typeof _u=="object"&&typeof Da<"u"?Da.exports=l():typeof define=="function"&&define.amd?define(l):i.moment=l()})(_u,function(){"use strict";var i;function l(){return i.apply(null,arguments)}function h(r){i=r}function m(r){return r instanceof Array||Object.prototype.toString.call(r)==="[object Array]"}function y(r){return r!=null&&Object.prototype.toString.call(r)==="[object Object]"}function S(r,a){return Object.prototype.hasOwnProperty.call(r,a)}function P(r){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(r).length===0;var a;for(a in r)if(S(r,a))return!1;return!0}function Y(r){return r===void 0}function E(r){return typeof r=="number"||Object.prototype.toString.call(r)==="[object Number]"}function G(r){return r instanceof Date||Object.prototype.toString.call(r)==="[object Date]"}function ge(r,a){var o=[],u,c=r.length;for(u=0;u>>0,u;for(u=0;u0)for(o=0;o=0;return(v?o?"+":"":"-")+Math.pow(10,Math.max(0,c)).toString().substr(1)+u}var mt=/(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Nn=/(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Pa={},Ur={};function R(r,a,o,u){var c=u;typeof u=="string"&&(c=function(){return this[u]()}),r&&(Ur[r]=c),a&&(Ur[a[0]]=function(){return lt(c.apply(this,arguments),a[1],a[2])}),o&&(Ur[o]=function(){return this.localeData().ordinal(c.apply(this,arguments),r)})}function Ln(r){return r.match(/\\[[\\s\\S]/)?r.replace(/^\\[|\\]$/g,""):r.replace(/\\\\/g,"")}function Xs(r){var a=r.match(mt),o,u;for(o=0,u=a.length;o=0&&Nn.test(r);)r=r.replace(Nn,u),Nn.lastIndex=0,o-=1;return r}var js={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function En(r){var a=this._longDateFormat[r],o=this._longDateFormat[r.toUpperCase()];return a||!o?a:(this._longDateFormat[r]=o.match(mt).map(function(u){return u==="MMMM"||u==="MM"||u==="DD"||u==="dddd"?u.slice(1):u}).join(""),this._longDateFormat[r])}var Un="Invalid date";function ki(){return this._invalidDate}var Mt="%d",cn=/\\d{1,2}/;function eo(r){return this._ordinal.replace("%d",r)}var Qt={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Oi(r,a,o,u){var c=this._relativeTime[o];return se(c)?c(r,a,o,u):c.replace(/%d/i,r)}function to(r,a){var o=this._relativeTime[r>0?"future":"past"];return se(o)?o(a):o.replace(/%s/i,a)}var Kt={};function _e(r,a){var o=r.toLowerCase();Kt[o]=Kt[o+"s"]=Kt[a]=r}function Je(r){return typeof r=="string"?Kt[r]||Kt[r.toLowerCase()]:void 0}function Hr(r){var a={},o,u;for(u in r)S(r,u)&&(o=Je(u),o&&(a[o]=r[u]));return a}var Pi={};function Ie(r,a){Pi[r]=a}function ro(r){var a=[],o;for(o in r)S(r,o)&&a.push({unit:o,priority:Pi[o]});return a.sort(function(u,c){return u.priority-c.priority}),a}function ur(r){return r%4===0&&r%100!==0||r%400===0}function Ze(r){return r<0?Math.ceil(r)||0:Math.floor(r)}function Q(r){var a=+r,o=0;return a!==0&&isFinite(a)&&(o=Ze(a)),o}function fr(r,a){return function(o){return o!=null?(Bn(this,r,o),l.updateOffset(this,a),this):Gr(this,r)}}function Gr(r,a){return r.isValid()?r._d["get"+(r._isUTC?"UTC":"")+a]():NaN}function Bn(r,a,o){r.isValid()&&!isNaN(o)&&(a==="FullYear"&&ur(r.year())&&r.month()===1&&r.date()===29?(o=Q(o),r._d["set"+(r._isUTC?"UTC":"")+a](o,r.month(),Kn(o,r.month()))):r._d["set"+(r._isUTC?"UTC":"")+a](o))}function Fa(r){return r=Je(r),se(this[r])?this[r]():this}function Ca(r,a){if(typeof r=="object"){r=Hr(r);var o=ro(r),u,c=o.length;for(u=0;u68?1900:2e3)};var Ha=fr("FullYear",!0);function yo(){return ur(this.year())}function Wi(r,a,o,u,c,v,T){var L;return r<100&&r>=0?(L=new Date(r+400,a,o,u,c,v,T),isFinite(L.getFullYear())&&L.setFullYear(r)):L=new Date(r,a,o,u,c,v,T),L}function qr(r){var a,o;return r<100&&r>=0?(o=Array.prototype.slice.call(arguments),o[0]=r+400,a=new Date(Date.UTC.apply(null,o)),isFinite(a.getUTCFullYear())&&a.setUTCFullYear(r)):a=new Date(Date.UTC.apply(null,arguments)),a}function Vr(r,a,o){var u=7+a-o,c=(7+qr(r,0,u).getUTCDay()-a)%7;return-c+u-1}function Yi(r,a,o,u,c){var v=(7+o-u)%7,T=Vr(r,u,c),L=1+7*(a-1)+v+T,z,ue;return L<=0?(z=r-1,ue=cr(z)+L):L>cr(r)?(z=r+1,ue=L-cr(r)):(z=r,ue=L),{year:z,dayOfYear:ue}}function zr(r,a,o){var u=Vr(r.year(),a,o),c=Math.floor((r.dayOfYear()-u-1)/7)+1,v,T;return c<1?(T=r.year()-1,v=c+Ot(T,a,o)):c>Ot(r.year(),a,o)?(v=c-Ot(r.year(),a,o),T=r.year()+1):(T=r.year(),v=c),{week:v,year:T}}function Ot(r,a,o){var u=Vr(r,a,o),c=Vr(r+1,a,o);return(cr(r)-u+c)/7}R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),_e("week","w"),_e("isoWeek","W"),Ie("week",5),Ie("isoWeek",5),A("w",be),A("ww",be,tt),A("W",be),A("WW",be,tt),hn(["w","ww","W","WW"],function(r,a,o,u){a[u.substr(0,1)]=Q(r)});function Ga(r){return zr(r,this._week.dow,this._week.doy).week}var Zr={dow:0,doy:6};function Ri(){return this._week.dow}function Ni(){return this._week.doy}function vo(r){var a=this.localeData().week(this);return r==null?a:this.add((r-a)*7,"d")}function Li(r){var a=zr(this,1,4).week;return r==null?a:this.add((r-a)*7,"d")}R("d",0,"do","day"),R("dd",0,0,function(r){return this.localeData().weekdaysMin(this,r)}),R("ddd",0,0,function(r){return this.localeData().weekdaysShort(this,r)}),R("dddd",0,0,function(r){return this.localeData().weekdays(this,r)}),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),_e("day","d"),_e("weekday","e"),_e("isoWeekday","E"),Ie("day",11),Ie("weekday",11),Ie("isoWeekday",11),A("d",be),A("e",be),A("E",be),A("dd",function(r,a){return a.weekdaysMinRegex(r)}),A("ddd",function(r,a){return a.weekdaysShortRegex(r)}),A("dddd",function(r,a){return a.weekdaysRegex(r)}),hn(["dd","ddd","dddd"],function(r,a,o,u){var c=o._locale.weekdaysParse(r,u,o._strict);c!=null?a.d=c:I(o).invalidWeekday=r}),hn(["d","e","E"],function(r,a,o,u){a[u]=Q(r)});function Ei(r,a){return typeof r!="string"?r:isNaN(r)?(r=a.weekdaysParse(r),typeof r=="number"?r:null):parseInt(r,10)}function Ui(r,a){return typeof r=="string"?a.weekdaysParse(r)%7||7:isNaN(r)?null:r}function Jn(r,a){return r.slice(a,7).concat(r.slice(0,a))}var _o="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Bi="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),xo="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Hi=br,So=br,wo=br;function bo(r,a){var o=m(this._weekdays)?this._weekdays:this._weekdays[r&&r!==!0&&this._weekdays.isFormat.test(a)?"format":"standalone"];return r===!0?Jn(o,this._week.dow):r?o[r.day()]:o}function To(r){return r===!0?Jn(this._weekdaysShort,this._week.dow):r?this._weekdaysShort[r.day()]:this._weekdaysShort}function $a(r){return r===!0?Jn(this._weekdaysMin,this._week.dow):r?this._weekdaysMin[r.day()]:this._weekdaysMin}function Do(r,a,o){var u,c,v,T=r.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],u=0;u<7;++u)v=te([2e3,1]).day(u),this._minWeekdaysParse[u]=this.weekdaysMin(v,"").toLocaleLowerCase(),this._shortWeekdaysParse[u]=this.weekdaysShort(v,"").toLocaleLowerCase(),this._weekdaysParse[u]=this.weekdays(v,"").toLocaleLowerCase();return o?a==="dddd"?(c=Oe.call(this._weekdaysParse,T),c!==-1?c:null):a==="ddd"?(c=Oe.call(this._shortWeekdaysParse,T),c!==-1?c:null):(c=Oe.call(this._minWeekdaysParse,T),c!==-1?c:null):a==="dddd"?(c=Oe.call(this._weekdaysParse,T),c!==-1||(c=Oe.call(this._shortWeekdaysParse,T),c!==-1)?c:(c=Oe.call(this._minWeekdaysParse,T),c!==-1?c:null)):a==="ddd"?(c=Oe.call(this._shortWeekdaysParse,T),c!==-1||(c=Oe.call(this._weekdaysParse,T),c!==-1)?c:(c=Oe.call(this._minWeekdaysParse,T),c!==-1?c:null)):(c=Oe.call(this._minWeekdaysParse,T),c!==-1||(c=Oe.call(this._weekdaysParse,T),c!==-1)?c:(c=Oe.call(this._shortWeekdaysParse,T),c!==-1?c:null))}function Mo(r,a,o){var u,c,v;if(this._weekdaysParseExact)return Do.call(this,r,a,o);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),u=0;u<7;u++){if(c=te([2e3,1]).day(u),o&&!this._fullWeekdaysParse[u]&&(this._fullWeekdaysParse[u]=new RegExp("^"+this.weekdays(c,"").replace(".","\\\\.?")+"$","i"),this._shortWeekdaysParse[u]=new RegExp("^"+this.weekdaysShort(c,"").replace(".","\\\\.?")+"$","i"),this._minWeekdaysParse[u]=new RegExp("^"+this.weekdaysMin(c,"").replace(".","\\\\.?")+"$","i")),this._weekdaysParse[u]||(v="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[u]=new RegExp(v.replace(".",""),"i")),o&&a==="dddd"&&this._fullWeekdaysParse[u].test(r))return u;if(o&&a==="ddd"&&this._shortWeekdaysParse[u].test(r))return u;if(o&&a==="dd"&&this._minWeekdaysParse[u].test(r))return u;if(!o&&this._weekdaysParse[u].test(r))return u}}function ko(r){if(!this.isValid())return r!=null?this:NaN;var a=this._isUTC?this._d.getUTCDay():this._d.getDay();return r!=null?(r=Ei(r,this.localeData()),this.add(r-a,"d")):a}function Oo(r){if(!this.isValid())return r!=null?this:NaN;var a=(this.day()+7-this.localeData()._week.dow)%7;return r==null?a:this.add(r-a,"d")}function Po(r){if(!this.isValid())return r!=null?this:NaN;if(r!=null){var a=Ui(r,this.localeData());return this.day(this.day()%7?a:a-7)}else return this.day()||7}function Te(r){return this._weekdaysParseExact?(S(this,"_weekdaysRegex")||qa.call(this),r?this._weekdaysStrictRegex:this._weekdaysRegex):(S(this,"_weekdaysRegex")||(this._weekdaysRegex=Hi),this._weekdaysStrictRegex&&r?this._weekdaysStrictRegex:this._weekdaysRegex)}function xe(r){return this._weekdaysParseExact?(S(this,"_weekdaysRegex")||qa.call(this),r?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(S(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=So),this._weekdaysShortStrictRegex&&r?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Fo(r){return this._weekdaysParseExact?(S(this,"_weekdaysRegex")||qa.call(this),r?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(S(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=wo),this._weekdaysMinStrictRegex&&r?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function qa(){function r(at,Gt){return Gt.length-at.length}var a=[],o=[],u=[],c=[],v,T,L,z,ue;for(v=0;v<7;v++)T=te([2e3,1]).day(v),L=ut(this.weekdaysMin(T,"")),z=ut(this.weekdaysShort(T,"")),ue=ut(this.weekdays(T,"")),a.push(L),o.push(z),u.push(ue),c.push(L),c.push(z),c.push(ue);a.sort(r),o.sort(r),u.sort(r),c.sort(r),this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Va(){return this.hours()%12||12}function Co(){return this.hours()||24}R("H",["HH",2],0,"hour"),R("h",["hh",2],0,Va),R("k",["kk",2],0,Co),R("hmm",0,0,function(){return""+Va.apply(this)+lt(this.minutes(),2)}),R("hmmss",0,0,function(){return""+Va.apply(this)+lt(this.minutes(),2)+lt(this.seconds(),2)}),R("Hmm",0,0,function(){return""+this.hours()+lt(this.minutes(),2)}),R("Hmmss",0,0,function(){return""+this.hours()+lt(this.minutes(),2)+lt(this.seconds(),2)});function Gi(r,a){R(r,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),a)})}Gi("a",!0),Gi("A",!1),_e("hour","h"),Ie("hour",13);function $i(r,a){return a._meridiemParse}A("a",$i),A("A",$i),A("H",be),A("h",be),A("k",be),A("HH",be,tt),A("hh",be,tt),A("kk",be,tt),A("hmm",Aa),A("hmmss",Wa),A("Hmm",Aa),A("Hmmss",Wa),pe(["H","HH"],Be),pe(["k","kk"],function(r,a,o){var u=Q(r);a[Be]=u===24?0:u}),pe(["a","A"],function(r,a,o){o._isPm=o._locale.isPM(r),o._meridiem=r}),pe(["h","hh"],function(r,a,o){a[Be]=Q(r),I(o).bigHour=!0}),pe("hmm",function(r,a,o){var u=r.length-2;a[Be]=Q(r.substr(0,u)),a[kt]=Q(r.substr(u)),I(o).bigHour=!0}),pe("hmmss",function(r,a,o){var u=r.length-4,c=r.length-2;a[Be]=Q(r.substr(0,u)),a[kt]=Q(r.substr(u,2)),a[Jt]=Q(r.substr(c)),I(o).bigHour=!0}),pe("Hmm",function(r,a,o){var u=r.length-2;a[Be]=Q(r.substr(0,u)),a[kt]=Q(r.substr(u))}),pe("Hmmss",function(r,a,o){var u=r.length-4,c=r.length-2;a[Be]=Q(r.substr(0,u)),a[kt]=Q(r.substr(u,2)),a[Jt]=Q(r.substr(c))});function qi(r){return(r+"").toLowerCase().charAt(0)==="p"}var Io=/[ap]\\.?m?\\.?/i,Ve=fr("Hours",!0);function za(r,a,o){return r>11?o?"pm":"PM":o?"am":"AM"}var dr={calendar:Ue,longDateFormat:js,invalidDate:Un,ordinal:Mt,dayOfMonthOrdinalParse:cn,relativeTime:Qt,months:fo,monthsShort:Fi,week:Zr,weekdays:_o,weekdaysMin:xo,weekdaysShort:Bi,meridiemParse:Io},De={},Dr={},je;function Vi(r,a){var o,u=Math.min(r.length,a.length);for(o=0;o0;){if(c=pn(v.slice(0,o).join("-")),c)return c;if(u&&u.length>=o&&Vi(v,u)>=o-1)break;o--}a++}return je}function Zi(r){return r.match("^[^/\\\\\\\\]*$")!=null}function pn(r){var a=null,o;if(De[r]===void 0&&typeof Da<"u"&&Da&&Da.exports&&Zi(r))try{a=je._abbr,o=require,o("./locale/"+r),Xt(a)}catch{De[r]=null}return De[r]}function Xt(r,a){var o;return r&&(Y(a)?o=Ae(r):o=rt(r,a),o?je=o:typeof console<"u"&&console.warn&&console.warn("Locale "+r+" not found. Did you forget to load it?")),je._abbr}function rt(r,a){if(a!==null){var o,u=dr;if(a.abbr=r,De[r]!=null)Yt("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),u=De[r]._config;else if(a.parentLocale!=null)if(De[a.parentLocale]!=null)u=De[a.parentLocale]._config;else if(o=pn(a.parentLocale),o!=null)u=o._config;else return Dr[a.parentLocale]||(Dr[a.parentLocale]=[]),Dr[a.parentLocale].push({name:r,config:a}),null;return De[r]=new Tt(it(u,a)),Dr[r]&&Dr[r].forEach(function(c){rt(c.name,c.config)}),Xt(r),De[r]}else return delete De[r],null}function Ao(r,a){if(a!=null){var o,u,c=dr;De[r]!=null&&De[r].parentLocale!=null?De[r].set(it(De[r]._config,a)):(u=pn(r),u!=null&&(c=u._config),a=it(c,a),u==null&&(a.abbr=r),o=new Tt(a),o.parentLocale=De[r],De[r]=o),Xt(r)}else De[r]!=null&&(De[r].parentLocale!=null?(De[r]=De[r].parentLocale,r===Xt()&&Xt(r)):De[r]!=null&&delete De[r]);return De[r]}function Ae(r){var a;if(r&&r._locale&&r._locale._abbr&&(r=r._locale._abbr),!r)return je;if(!m(r)){if(a=pn(r),a)return a;r=[r]}return zi(r)}function Wo(){return we(De)}function Xn(r){var a,o=r._a;return o&&I(r).overflow===-2&&(a=o[Rt]<0||o[Rt]>11?Rt:o[Nt]<1||o[Nt]>Kn(o[Xe],o[Rt])?Nt:o[Be]<0||o[Be]>24||o[Be]===24&&(o[kt]!==0||o[Jt]!==0||o[Tr]!==0)?Be:o[kt]<0||o[kt]>59?kt:o[Jt]<0||o[Jt]>59?Jt:o[Tr]<0||o[Tr]>999?Tr:-1,I(r)._overflowDayOfYear&&(aNt)&&(a=Nt),I(r)._overflowWeeks&&a===-1&&(a=lo),I(r)._overflowWeekday&&a===-1&&(a=Qn),I(r).overflow=a),r}var hr=/^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,jn=/^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,Qa=/Z|[+-]\\d\\d(?::?\\d\\d)?/,ve=[["YYYYYY-MM-DD",/[+-]\\d{6}-\\d\\d-\\d\\d/],["YYYY-MM-DD",/\\d{4}-\\d\\d-\\d\\d/],["GGGG-[W]WW-E",/\\d{4}-W\\d\\d-\\d/],["GGGG-[W]WW",/\\d{4}-W\\d\\d/,!1],["YYYY-DDD",/\\d{4}-\\d{3}/],["YYYY-MM",/\\d{4}-\\d\\d/,!1],["YYYYYYMMDD",/[+-]\\d{10}/],["YYYYMMDD",/\\d{8}/],["GGGG[W]WWE",/\\d{4}W\\d{3}/],["GGGG[W]WW",/\\d{4}W\\d{2}/,!1],["YYYYDDD",/\\d{7}/],["YYYYMM",/\\d{6}/,!1],["YYYY",/\\d{4}/,!1]],Lt=[["HH:mm:ss.SSSS",/\\d\\d:\\d\\d:\\d\\d\\.\\d+/],["HH:mm:ss,SSSS",/\\d\\d:\\d\\d:\\d\\d,\\d+/],["HH:mm:ss",/\\d\\d:\\d\\d:\\d\\d/],["HH:mm",/\\d\\d:\\d\\d/],["HHmmss.SSSS",/\\d\\d\\d\\d\\d\\d\\.\\d+/],["HHmmss,SSSS",/\\d\\d\\d\\d\\d\\d,\\d+/],["HHmmss",/\\d\\d\\d\\d\\d\\d/],["HHmm",/\\d\\d\\d\\d/],["HH",/\\d\\d/]],Ka=/^\\/?Date\\((-?\\d+)/i,Yo=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,Ja={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Qi(r){var a,o,u=r._i,c=hr.exec(u)||jn.exec(u),v,T,L,z,ue=ve.length,at=Lt.length;if(c){for(I(r).iso=!0,a=0,o=ue;acr(T)||r._dayOfYear===0)&&(I(r)._overflowDayOfYear=!0),o=qr(T,0,r._dayOfYear),r._a[Rt]=o.getUTCMonth(),r._a[Nt]=o.getUTCDate()),a=0;a<3&&r._a[a]==null;++a)r._a[a]=u[a]=c[a];for(;a<7;a++)r._a[a]=u[a]=r._a[a]==null?a===2?1:0:r._a[a];r._a[Be]===24&&r._a[kt]===0&&r._a[Jt]===0&&r._a[Tr]===0&&(r._nextDay=!0,r._a[Be]=0),r._d=(r._useUTC?qr:Wi).apply(null,u),v=r._useUTC?r._d.getUTCDay():r._d.getDay(),r._tzm!=null&&r._d.setUTCMinutes(r._d.getUTCMinutes()-r._tzm),r._nextDay&&(r._a[Be]=24),r._w&&typeof r._w.d<"u"&&r._w.d!==v&&(I(r).weekdayMismatch=!0)}}function ji(r){var a,o,u,c,v,T,L,z,ue;a=r._w,a.GG!=null||a.W!=null||a.E!=null?(v=1,T=4,o=Mr(a.GG,r._a[Xe],zr(Se(),1,4).year),u=Mr(a.W,1),c=Mr(a.E,1),(c<1||c>7)&&(z=!0)):(v=r._locale._week.dow,T=r._locale._week.doy,ue=zr(Se(),v,T),o=Mr(a.gg,r._a[Xe],ue.year),u=Mr(a.w,ue.week),a.d!=null?(c=a.d,(c<0||c>6)&&(z=!0)):a.e!=null?(c=a.e+v,(a.e<0||a.e>6)&&(z=!0)):c=v),u<1||u>Ot(o,v,T)?I(r)._overflowWeeks=!0:z!=null?I(r)._overflowWeekday=!0:(L=Yi(o,u,c,v,T),r._a[Xe]=L.year,r._dayOfYear=L.dayOfYear)}l.ISO_8601=function(){},l.RFC_2822=function(){};function ja(r){if(r._f===l.ISO_8601){Qi(r);return}if(r._f===l.RFC_2822){Ji(r);return}r._a=[],I(r).empty=!0;var a=""+r._i,o,u,c,v,T,L=a.length,z=0,ue,at;for(c=Br(r._f,r._locale).match(mt)||[],at=c.length,o=0;o0&&I(r).unusedInput.push(T),a=a.slice(a.indexOf(u)+u.length),z+=u.length),Ur[v]?(u?I(r).empty=!1:I(r).unusedTokens.push(v),oo(v,u,r)):r._strict&&!u&&I(r).unusedTokens.push(v);I(r).charsLeftOver=L-z,a.length>0&&I(r).unusedInput.push(a),r._a[Be]<=12&&I(r).bigHour===!0&&r._a[Be]>0&&(I(r).bigHour=void 0),I(r).parsedDateParts=r._a.slice(0),I(r).meridiem=r._meridiem,r._a[Be]=ei(r._locale,r._a[Be],r._meridiem),ue=I(r).era,ue!==null&&(r._a[Xe]=r._locale.erasConvertYear(ue,r._a[Xe])),mn(r),Xn(r)}function ei(r,a,o){var u;return o==null?a:r.meridiemHour!=null?r.meridiemHour(a,o):(r.isPM!=null&&(u=r.isPM(o),u&&a<12&&(a+=12),!u&&a===12&&(a=0)),a)}function ti(r){var a,o,u,c,v,T,L=!1,z=r._f.length;if(z===0){I(r).invalidFormat=!0,r._d=new Date(NaN);return}for(c=0;cthis?this:r:ke()});function rs(r,a){var o,u;if(a.length===1&&m(a[0])&&(a=a[0]),!a.length)return Se();for(o=a[0],u=1;uthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function D(){if(!Y(this._isDSTShifted))return this._isDSTShifted;var r={},a;return Re(r,this),r=st(r),r._a?(a=r._isUTC?te(r._a):Se(r._a),this._isDSTShifted=this.isValid()&&qo(r._a,a.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function b(){return this.isValid()?!this._isUTC:!1}function W(){return this.isValid()?this._isUTC:!1}function $(){return this.isValid()?this._isUTC&&this._offset===0:!1}var le=/^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,He=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function j(r,a){var o=r,u=null,c,v,T;return Pt(r)?o={ms:r._milliseconds,d:r._days,M:r._months}:E(r)||!isNaN(+r)?(o={},a?o[a]=+r:o.milliseconds=+r):(u=le.exec(r))?(c=u[1]==="-"?-1:1,o={y:0,d:Q(u[Nt])*c,h:Q(u[Be])*c,m:Q(u[kt])*c,s:Q(u[Jt])*c,ms:Q(Jr(u[Tr]*1e3))*c}):(u=He.exec(r))?(c=u[1]==="-"?-1:1,o={y:jt(u[2],c),M:jt(u[3],c),w:jt(u[4],c),d:jt(u[5],c),h:jt(u[6],c),m:jt(u[7],c),s:jt(u[8],c)}):o==null?o={}:typeof o=="object"&&("from"in o||"to"in o)&&(T=gt(Se(o.from),Se(o.to)),o={},o.ms=T.milliseconds,o.M=T.months),v=new gn(o),Pt(r)&&S(r,"_locale")&&(v._locale=r._locale),Pt(r)&&S(r,"_isValid")&&(v._isValid=r._isValid),v}j.fn=gn.prototype,j.invalid=ni;function jt(r,a){var o=r&&parseFloat(r.replace(",","."));return(isNaN(o)?0:o)*a}function as(r,a){var o={};return o.months=a.month()-r.month()+(a.year()-r.year())*12,r.clone().add(o.months,"M").isAfter(a)&&--o.months,o.milliseconds=+a-+r.clone().add(o.months,"M"),o}function gt(r,a){var o;return r.isValid()&&a.isValid()?(a=ft(a,r),r.isBefore(a)?o=as(r,a):(o=as(a,r),o.milliseconds=-o.milliseconds,o.months=-o.months),o):{milliseconds:0,months:0}}function yn(r,a){return function(o,u){var c,v;return u!==null&&!isNaN(+u)&&(Yt(a,"moment()."+a+"(period, number) is deprecated. Please use moment()."+a+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),v=o,o=u,u=v),c=j(o,u),is(this,c,r),this}}function is(r,a,o,u){var c=a._milliseconds,v=Jr(a._days),T=Jr(a._months);!r.isValid()||(u=u??!0,T&&La(r,Gr(r,"Month")+T*o),v&&Bn(r,"Date",Gr(r,"Date")+v*o),c&&r._d.setTime(r._d.valueOf()+c*o),u&&l.updateOffset(r,v||T))}var Xr=yn(1,"add"),ra=yn(-1,"subtract");function vn(r){return typeof r=="string"||r instanceof String}function de(r){return ye(r)||G(r)||vn(r)||E(r)||ss(r)||Xo(r)||r===null||r===void 0}function Xo(r){var a=y(r)&&!P(r),o=!1,u=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],c,v,T=u.length;for(c=0;co.valueOf():o.valueOf()9999?lr(o,a?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):se(Date.prototype.toISOString)?a?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",lr(o,"Z")):lr(o,a?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Or(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var r="moment",a="",o,u,c,v;return this.isLocal()||(r=this.utcOffset()===0?"moment.utc":"moment.parseZone",a="Z"),o="["+r+\'("]\',u=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",c="-MM-DD[T]HH:mm:ss.SSS",v=a+\'[")]\',this.format(o+u+c+v)}function oa(r){r||(r=this.isUtc()?l.defaultFormatUtc:l.defaultFormat);var a=lr(this,r);return this.localeData().postformat(a)}function rl(r,a){return this.isValid()&&(ye(r)&&r.isValid()||Se(r).isValid())?j({to:this,from:r}).locale(this.locale()).humanize(!a):this.localeData().invalidDate()}function nl(r){return this.from(Se(),r)}function al(r,a){return this.isValid()&&(ye(r)&&r.isValid()||Se(r).isValid())?j({from:this,to:r}).locale(this.locale()).humanize(!a):this.localeData().invalidDate()}function la(r){return this.to(Se(),r)}function xn(r){var a;return r===void 0?this._locale._abbr:(a=Ae(r),a!=null&&(this._locale=a),this)}var ua=Ee("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(r){return r===void 0?this.localeData():this.locale(r)});function cs(){return this._locale}var Sn=1e3,jr=60*Sn,fa=60*jr,We=(365*400+97)*24*fa;function Fe(r,a){return(r%a+a)%a}function ds(r,a,o){return r<100&&r>=0?new Date(r+400,a,o)-We:new Date(r,a,o).valueOf()}function hs(r,a,o){return r<100&&r>=0?Date.UTC(r+400,a,o)-We:Date.UTC(r,a,o)}function ps(r){var a,o;if(r=Je(r),r===void 0||r==="millisecond"||!this.isValid())return this;switch(o=this._isUTC?hs:ds,r){case"year":a=o(this.year(),0,1);break;case"quarter":a=o(this.year(),this.month()-this.month()%3,1);break;case"month":a=o(this.year(),this.month(),1);break;case"week":a=o(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":a=o(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":a=o(this.year(),this.month(),this.date());break;case"hour":a=this._d.valueOf(),a-=Fe(a+(this._isUTC?0:this.utcOffset()*jr),fa);break;case"minute":a=this._d.valueOf(),a-=Fe(a,jr);break;case"second":a=this._d.valueOf(),a-=Fe(a,Sn);break}return this._d.setTime(a),l.updateOffset(this,!0),this}function il(r){var a,o;if(r=Je(r),r===void 0||r==="millisecond"||!this.isValid())return this;switch(o=this._isUTC?hs:ds,r){case"year":a=o(this.year()+1,0,1)-1;break;case"quarter":a=o(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":a=o(this.year(),this.month()+1,1)-1;break;case"week":a=o(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":a=o(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":a=o(this.year(),this.month(),this.date()+1)-1;break;case"hour":a=this._d.valueOf(),a+=fa-Fe(a+(this._isUTC?0:this.utcOffset()*jr),fa)-1;break;case"minute":a=this._d.valueOf(),a+=jr-Fe(a,jr)-1;break;case"second":a=this._d.valueOf(),a+=Sn-Fe(a,Sn)-1;break}return this._d.setTime(a),l.updateOffset(this,!0),this}function ai(){return this._d.valueOf()-(this._offset||0)*6e4}function wn(){return Math.floor(this.valueOf()/1e3)}function ii(){return new Date(this.valueOf())}function en(){var r=this;return[r.year(),r.month(),r.date(),r.hour(),r.minute(),r.second(),r.millisecond()]}function bn(){var r=this;return{years:r.year(),months:r.month(),date:r.date(),hours:r.hours(),minutes:r.minutes(),seconds:r.seconds(),milliseconds:r.milliseconds()}}function Tn(){return this.isValid()?this.toISOString():null}function ca(){return ze(this)}function tn(){return V({},I(this))}function sl(){return I(this).overflow}function ol(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}R("N",0,0,"eraAbbr"),R("NN",0,0,"eraAbbr"),R("NNN",0,0,"eraAbbr"),R("NNNN",0,0,"eraName"),R("NNNNN",0,0,"eraNarrow"),R("y",["y",1],"yo","eraYear"),R("y",["yy",2],0,"eraYear"),R("y",["yyy",3],0,"eraYear"),R("y",["yyyy",4],0,"eraYear"),A("N",J),A("NN",J),A("NNN",J),A("NNNN",cl),A("NNNNN",dl),pe(["N","NN","NNN","NNNN","NNNNN"],function(r,a,o,u){var c=o._locale.erasParse(r,u,o._strict);c?I(o).era=c:I(o).invalidEra=r}),A("y",$r),A("yy",$r),A("yyy",$r),A("yyyy",$r),A("yo",hl),pe(["y","yy","yyy","yyyy"],Xe),pe(["yo"],function(r,a,o,u){var c;o._locale._eraYearOrdinalRegex&&(c=r.match(o._locale._eraYearOrdinalRegex)),o._locale.eraYearOrdinalParse?a[Xe]=o._locale.eraYearOrdinalParse(r,c):a[Xe]=parseInt(r,10)});function ll(r,a){var o,u,c,v=this._eras||Ae("en")._eras;for(o=0,u=v.length;o=0)return v[u]}function fl(r,a){var o=r.since<=r.until?1:-1;return a===void 0?l(r.since).year():l(r.since).year()+(a-r.offset)*o}function da(){var r,a,o,u=this.localeData().eras();for(r=0,a=u.length;rv&&(a=v),_l.call(this,r,a,o,u,c))}function _l(r,a,o,u,c){var v=Yi(r,a,o,u,c),T=qr(v.year,0,v.dayOfYear);return this.year(T.getUTCFullYear()),this.month(T.getUTCMonth()),this.date(T.getUTCDate()),this}R("Q",0,"Qo","quarter"),_e("quarter","Q"),Ie("quarter",7),A("Q",Hn),pe("Q",function(r,a){a[Rt]=(Q(r)-1)*3});function xl(r){return r==null?Math.ceil((this.month()+1)/3):this.month((r-1)*3+this.month()%3)}R("D",["DD",2],"Do","date"),_e("date","D"),Ie("date",9),A("D",be),A("DD",be,tt),A("Do",function(r,a){return r?a._dayOfMonthOrdinalParse||a._ordinalParse:a._dayOfMonthOrdinalParseLenient}),pe(["D","DD"],Nt),pe("Do",function(r,a){a[Nt]=Q(r.match(be)[0])});var ys=fr("Date",!0);R("DDD",["DDDD",3],"DDDo","dayOfYear"),_e("dayOfYear","DDD"),Ie("dayOfYear",4),A("DDD",qn),A("DDDD",Gn),pe(["DDD","DDDD"],function(r,a,o){o._dayOfYear=Q(r)});function rr(r){var a=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return r==null?a:this.add(r-a,"d")}R("m",["mm",2],0,"minute"),_e("minute","m"),Ie("minute",14),A("m",be),A("mm",be,tt),pe(["m","mm"],kt);var Sl=fr("Minutes",!1);R("s",["ss",2],0,"second"),_e("second","s"),Ie("second",15),A("s",be),A("ss",be,tt),pe(["s","ss"],Jt);var wl=fr("Seconds",!1);R("S",0,0,function(){return~~(this.millisecond()/100)}),R(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,function(){return this.millisecond()*10}),R(0,["SSSSS",5],0,function(){return this.millisecond()*100}),R(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),R(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),R(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),R(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),_e("millisecond","ms"),Ie("millisecond",16),A("S",qn,Hn),A("SS",qn,tt),A("SSS",qn,Gn);var yr,vs;for(yr="SSSS";yr.length<=9;yr+="S")A(yr,$r);function bl(r,a){a[Tr]=Q(("0."+r)*1e3)}for(yr="S";yr.length<=9;yr+="S")pe(yr,bl);vs=fr("Milliseconds",!1),R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");function Pr(){return this._isUTC?"UTC":""}function Tl(){return this._isUTC?"Coordinated Universal Time":""}var F=Ne.prototype;F.add=Xr,F.calendar=el,F.clone=tl,F.diff=us,F.endOf=il,F.format=oa,F.from=rl,F.fromNow=nl,F.to=al,F.toNow=la,F.get=Fa,F.invalidAt=sl,F.isAfter=aa,F.isBefore=gr,F.isBetween=ia,F.isSame=os,F.isSameOrAfter=sa,F.isSameOrBefore=ls,F.isValid=ca,F.lang=ua,F.locale=xn,F.localeData=cs,F.max=Eo,F.min=ts,F.parsingFlags=tn,F.set=Ca,F.startOf=ps,F.subtract=ra,F.toArray=en,F.toObject=bn,F.toDate=ii,F.toISOString=_n,F.inspect=Or,typeof Symbol<"u"&&Symbol.for!=null&&(F[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),F.toJSON=Tn,F.toString=fs,F.unix=wn,F.valueOf=ai,F.creationData=ol,F.eraName=da,F.eraNarrow=Dn,F.eraAbbr=ms,F.eraYear=d,F.year=Ha,F.isLeapYear=yo,F.weekYear=pl,F.isoWeekYear=ml,F.quarter=F.quarters=xl,F.month=Ea,F.daysInMonth=Ai,F.week=F.weeks=vo,F.isoWeek=F.isoWeeks=Li,F.weeksInYear=tr,F.weeksInWeekYear=vl,F.isoWeeksInYear=gl,F.isoWeeksInISOWeekYear=yl,F.date=ys,F.day=F.days=ko,F.weekday=Oo,F.isoWeekday=Po,F.dayOfYear=rr,F.hour=F.hours=Ve,F.minute=F.minutes=Sl,F.second=F.seconds=wl,F.millisecond=F.milliseconds=vs,F.utcOffset=zo,F.utc=Qo,F.local=Ko,F.parseZone=Jo,F.hasAlignedHourOffset=mr,F.isDST=x,F.isLocal=b,F.isUtcOffset=W,F.isUtc=$,F.isUTC=$,F.zoneAbbr=Pr,F.zoneName=Tl,F.dates=Ee("dates accessor is deprecated. Use date instead.",ys),F.months=Ee("months accessor is deprecated. Use month instead",Ea),F.years=Ee("years accessor is deprecated. Use year instead",Ha),F.zone=Ee("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Zo),F.isDSTShifted=Ee("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",D);function Ft(r){return Se(r*1e3)}function Dl(){return Se.apply(null,arguments).parseZone()}function _s(r){return r}var oe=Tt.prototype;oe.calendar=Dt,oe.longDateFormat=En,oe.invalidDate=ki,oe.ordinal=eo,oe.preparse=_s,oe.postformat=_s,oe.relativeTime=Oi,oe.pastFuture=to,oe.set=Ke,oe.eras=ll,oe.erasParse=ul,oe.erasConvertYear=fl,oe.erasAbbrRegex=ha,oe.erasNameRegex=rn,oe.erasNarrowRegex=yt,oe.months=co,oe.monthsShort=ho,oe.monthsParse=mo,oe.monthsRegex=go,oe.monthsShortRegex=Ua,oe.week=Ga,oe.firstDayOfYear=Ni,oe.firstDayOfWeek=Ri,oe.weekdays=bo,oe.weekdaysMin=$a,oe.weekdaysShort=To,oe.weekdaysParse=Mo,oe.weekdaysRegex=Te,oe.weekdaysShortRegex=xe,oe.weekdaysMinRegex=Fo,oe.isPM=qi,oe.meridiem=za;function ma(r,a,o,u){var c=Ae(),v=te().set(u,a);return c[o](v,r)}function xs(r,a,o){if(E(r)&&(a=r,r=void 0),r=r||"",a!=null)return ma(r,a,o,"month");var u,c=[];for(u=0;u<12;u++)c[u]=ma(r,u,o,"month");return c}function ga(r,a,o,u){typeof r=="boolean"?(E(a)&&(o=a,a=void 0),a=a||""):(a=r,o=a,r=!1,E(a)&&(o=a,a=void 0),a=a||"");var c=Ae(),v=r?c._week.dow:0,T,L=[];if(o!=null)return ma(a,(o+v)%7,u,"day");for(T=0;T<7;T++)L[T]=ma(a,(T+v)%7,u,"day");return L}function Ss(r,a){return xs(r,a,"months")}function Ml(r,a){return xs(r,a,"monthsShort")}function kl(r,a,o){return ga(r,a,o,"weekdays")}function si(r,a,o){return ga(r,a,o,"weekdaysShort")}function Mn(r,a,o){return ga(r,a,o,"weekdaysMin")}Xt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\\d{1,2}(th|st|nd|rd)/,ordinal:function(r){var a=r%10,o=Q(r%100/10)===1?"th":a===1?"st":a===2?"nd":a===3?"rd":"th";return r+o}}),l.lang=Ee("moment.lang is deprecated. Use moment.locale instead.",Xt),l.langData=Ee("moment.langData is deprecated. Use moment.localeData instead.",Ae);var vt=Math.abs;function Ol(){var r=this._data;return this._milliseconds=vt(this._milliseconds),this._days=vt(this._days),this._months=vt(this._months),r.milliseconds=vt(r.milliseconds),r.seconds=vt(r.seconds),r.minutes=vt(r.minutes),r.hours=vt(r.hours),r.months=vt(r.months),r.years=vt(r.years),this}function oi(r,a,o,u){var c=j(a,o);return r._milliseconds+=u*c._milliseconds,r._days+=u*c._days,r._months+=u*c._months,r._bubble()}function Pl(r,a){return oi(this,r,a,1)}function nr(r,a){return oi(this,r,a,-1)}function ya(r){return r<0?Math.floor(r):Math.ceil(r)}function Fr(){var r=this._milliseconds,a=this._days,o=this._months,u=this._data,c,v,T,L,z;return r>=0&&a>=0&&o>=0||r<=0&&a<=0&&o<=0||(r+=ya(li(o)+a)*864e5,a=0,o=0),u.milliseconds=r%1e3,c=Ze(r/1e3),u.seconds=c%60,v=Ze(c/60),u.minutes=v%60,T=Ze(v/60),u.hours=T%24,a+=Ze(T/24),z=Ze(ct(a)),o+=z,a-=ya(li(z)),L=Ze(o/12),o%=12,u.days=a,u.months=o,u.years=L,this}function ct(r){return r*4800/146097}function li(r){return r*146097/4800}function ws(r){if(!this.isValid())return NaN;var a,o,u=this._milliseconds;if(r=Je(r),r==="month"||r==="quarter"||r==="year")switch(a=this._days+u/864e5,o=this._months+ct(a),r){case"month":return o;case"quarter":return o/3;case"year":return o/12}else switch(a=this._days+Math.round(li(this._months)),r){case"week":return a/7+u/6048e5;case"day":return a+u/864e5;case"hour":return a*24+u/36e5;case"minute":return a*1440+u/6e4;case"second":return a*86400+u/1e3;case"millisecond":return Math.floor(a*864e5)+u;default:throw new Error("Unknown unit "+r)}}function bs(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+Q(this._months/12)*31536e6:NaN}function dt(r){return function(){return this.as(r)}}var vr=dt("ms"),Ts=dt("s"),Fl=dt("m"),va=dt("h"),Cl=dt("d"),Ds=dt("w"),Qe=dt("M"),ui=dt("Q"),Ms=dt("y");function Ut(){return j(this)}function fi(r){return r=Je(r),this.isValid()?this[r+"s"]():NaN}function Bt(r){return function(){return this.isValid()?this._data[r]:NaN}}var Cr=Bt("milliseconds"),ks=Bt("seconds"),nt=Bt("minutes"),ci=Bt("hours"),Il=Bt("days"),Al=Bt("months"),Wl=Bt("years");function di(){return Ze(this.days()/7)}var ar=Math.round,Ht={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Os(r,a,o,u,c){return c.relativeTime(a||1,!!o,r,u)}function Yl(r,a,o,u){var c=j(r).abs(),v=ar(c.as("s")),T=ar(c.as("m")),L=ar(c.as("h")),z=ar(c.as("d")),ue=ar(c.as("M")),at=ar(c.as("w")),Gt=ar(c.as("y")),ir=v<=o.ss&&["s",v]||v0,ir[4]=u,Os.apply(null,ir)}function Rl(r){return r===void 0?ar:typeof r=="function"?(ar=r,!0):!1}function kn(r,a){return Ht[r]===void 0?!1:a===void 0?Ht[r]:(Ht[r]=a,r==="s"&&(Ht.ss=a-1),!0)}function Nl(r,a){if(!this.isValid())return this.localeData().invalidDate();var o=!1,u=Ht,c,v;return typeof r=="object"&&(a=r,r=!1),typeof r=="boolean"&&(o=r),typeof a=="object"&&(u=Object.assign({},Ht,a),a.s!=null&&a.ss==null&&(u.ss=a.s-1)),c=this.localeData(),v=Yl(this,!o,u,c),o&&(v=c.pastFuture(+this,v)),c.postformat(v)}var hi=Math.abs;function _r(r){return(r>0)-(r<0)||+r}function On(){if(!this.isValid())return this.localeData().invalidDate();var r=hi(this._milliseconds)/1e3,a=hi(this._days),o=hi(this._months),u,c,v,T,L=this.asSeconds(),z,ue,at,Gt;return L?(u=Ze(r/60),c=Ze(u/60),r%=60,u%=60,v=Ze(o/12),o%=12,T=r?r.toFixed(3).replace(/\\.?0+$/,""):"",z=L<0?"-":"",ue=_r(this._months)!==_r(L)?"-":"",at=_r(this._days)!==_r(L)?"-":"",Gt=_r(this._milliseconds)!==_r(L)?"-":"",z+"P"+(v?ue+v+"Y":"")+(o?ue+o+"M":"")+(a?at+a+"D":"")+(c||u||r?"T":"")+(c?Gt+c+"H":"")+(u?Gt+u+"M":"")+(r?Gt+T+"S":"")):"P0D"}var ne=gn.prototype;ne.isValid=$o,ne.abs=Ol,ne.add=Pl,ne.subtract=nr,ne.as=ws,ne.asMilliseconds=vr,ne.asSeconds=Ts,ne.asMinutes=Fl,ne.asHours=va,ne.asDays=Cl,ne.asWeeks=Ds,ne.asMonths=Qe,ne.asQuarters=ui,ne.asYears=Ms,ne.valueOf=bs,ne._bubble=Fr,ne.clone=Ut,ne.get=fi,ne.milliseconds=Cr,ne.seconds=ks,ne.minutes=nt,ne.hours=ci,ne.days=Il,ne.weeks=di,ne.months=Al,ne.years=Wl,ne.humanize=Nl,ne.toISOString=On,ne.toString=On,ne.toJSON=On,ne.locale=xn,ne.localeData=cs,ne.toIsoString=Ee("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",On),ne.lang=ua,R("X",0,0,"unix"),R("x",0,0,"valueOf"),A("x",dn),A("X",ao),pe("X",function(r,a,o){o._d=new Date(parseFloat(r)*1e3)}),pe("x",function(r,a,o){o._d=new Date(Q(r))});return l.version="2.29.4",h(Se),l.fn=F,l.min=Uo,l.max=Bo,l.now=Ho,l.utc=te,l.unix=Ft,l.months=Ss,l.isDate=G,l.locale=Xt,l.invalid=ke,l.duration=j,l.isMoment=ye,l.weekdays=kl,l.parseZone=Dl,l.localeData=Ae,l.isDuration=Pt,l.monthsShort=Ml,l.weekdaysMin=Mn,l.defineLocale=rt,l.updateLocale=Ao,l.locales=Wo,l.weekdaysShort=si,l.normalizeUnits=Je,l.relativeTimeRounding=Rl,l.relativeTimeThreshold=kn,l.calendarFormat=jo,l.prototype=F,l.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},l})});var Js=uc(fc());var wr=i=>[...new Set(i)];var cc=(i,l)=>i.sort(function(h,m){let y=l.indexOf(h),S=l.indexOf(m);return y>S?y!=-1&&S==-1?-1:1:S!=-1&&y==-1?1:-1});var Lr="File";var hc=uc(dc()),xu=class{constructor(){this.lang="en";this.all={en:{hintText:{dragDropModifierKeys:"Hold ${1} to Pin and ${2} to Copy",createListItem:"Select/Create List Item Frame",dragDropProperties:"Drag and drop properties to link them into the list",newItem:"+ New",selectNote:"Select Note...",newFrame:"New"},defaults:{spaceNote:"Current Note",spaceContext:"Current Space"},commands:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",columns:"Columns",button:"Button",label:"Label",column:"Column",idea:"New",group:"Group",paragraph:"Text",card:"Card",progress:"Progress",rating:"Rating",circularProgress:"Circular Progress",list:"Bullet List","ordered-list":"Numbered List",todo:"To-do List",quote:"Quote",divider:"Divider",note:"Link to Note",link:"Link",callout:"Callout",bookmark:"Bookmark",table:"Table",codeblock:"Code Block",toggle:"Toggle",emoji:"Emoji",image:"Image",flow:"Linked Note",newNote:"New Note",tag:"Tag",makeMenu:"Flow Menu",selectStyle:"Style",toggleKeyboard:"Toggle Keyboard",rows:"Rows",masonry:"Gallery"},styles:{bold:"Bold",italics:"Italics",strikethrough:"Strikethrough",code:"Code",link:"Web Link",blocklink:"Link to Note",textColor:"Text Color",highlight:"Highlight"},commandsSuggest:{noResult:"No result"},commandPalette:{enable:"Enable",disabled:"Disable",openFlow:"Open Flow Blocks in Selection",closeFlow:"Close Flow Blocks in Selection",toggleBold:"Toggle Bold",toggleItalics:"Toggle Italics",openSpaces:"Open Spaces",migrateData:"Migrate Spaces From 0.7",blink:"Blink",openFileContext:"Open Explorer",convertPathToSpace:"Convert to Space",revealFile:"Reveal File in Spaces",releaseNotes:"Release Notes",toggleBacklinks:"Toggle Backlinks",collapseAllFolders:"Collapse All Folders",addFileSpace:"Add File to Space",removeFileSpace:"Remove File from Space"},frames:{sections:{kit:"Kit",paths:"Paths"},label:{label:"Label",description:"Label"},note:{label:"Note",description:"Link to a note"},table:{label:"Table",description:"Table"},context:{label:"Context",description:"Display a context view from another space"},calendar:{label:"Calendar View"},field:{label:"Field",description:"Dynamic node that displays a value based on property type"},event:{label:"Event"},divider:{label:"Divider",description:"Divider to separate your content"},button:{label:"Button",description:"Buttons can perform actions and open links"},callout:{label:"Callout",description:"Callout to highlight important information"},toggle:{label:"Toggle",description:"Toggle to show/hide content"}},menu:{newView:"New View",closeSpace:"Close Space",customView:"Custom View",detailsView:"Details View",catalogView:"Catalog View",galleryView:"Gallery View",deleteContext:"Delete Context",openSpace:"Open Space",revealInDefault:"Reveal in Finder",setNone:"None",fileMetadataDescription:"This note only",openFilePane:"Open in a new pane",rename:"Rename",changeToFolderNote:"New Space from Note",moveFile:"Move file to...",moveFolder:"Move folder to...",duplicate:"Make a copy",edit:"Edit",delete:"Delete",getHelp:"Make.md Community",vault:"Vault",openVault:"Open Another Vault",openVaultInFolder:"Open Vault Folder",obSettings:"Obsidian Settings",commandPalette:"Command Palette",backToSpace:"Back to Spaces",collapseAllSections:"Collapse All Spaces",expandAllSections:"Expand All Spaces",collapseAllFolders:"Collapse All Folders",expandAllFolders:"Expand All Folders",spaceTitle:"Add/Remove in Space",home:"Home",waypoints:"Waypoints",none:"None",tableView:"Table View",cardView:"Card View",boardView:"Board View",listView:"List View",flowView:"Flow View",groupBy:"Group By",sortBy:"Sort By",newFilter:"New Filter",clearFilters:"Clear Filters",hide:"Hide",unhideFields:"Unhide All Properties",importDataview:"Import All Dataview Properties",saveAllProperties:"Save All Properties to Files",mergeProperties:"Merge Properties",removeFromSpace:"Unpin from Space",removeFromWaypoints:"Unpin from Waypoints",editCode:"Edit Code",deleteProperty:"Delete Property",hideProperty:"Hide Property",unhideProperty:"Unhide Property",saveProperty:"Save Property",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",deleteRow:"Delete Item",collapseAll:"Collapse All",customSort:"Custom Sort",groupSpaces:"Group Spaces",fileNameSortAlphaAsc:"File Name (A to Z)",fileNameSortAlphaDesc:"File Name (Z to A)",createdTimeSortAsc:"Created Time (new to old)",createdTimeSortDesc:"Created Time (old to new)",modifiedTimeSortAsc:"Modified Time (new to old)",modifiedTimeSortDesc:"Modified Time (old to new)",sizeSortAsc:"Size (smallest to largest)",sizeSortDesc:"Size (largest to smallest)",spaces:"Spaces",tags:"Tags",manageHiddenFiles:"Manage Hidden Files",manageActions:"Manage Actions",deleteSpace:"Delete",changeColor:"Change Color",changePropertyType:"Change Type",deleteFiles:"Delete Files",createFolderSpace:"Create Space from Folder",folder:"Folder",syncToContext:"Add Property to Context",setIcon:"Set Icon",copyEmbedLink:"Copy Embed Link",moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",groupNodes:"Group Nodes",moveFrame:"Move Frame",renameFrame:"Rename Frame",deleteFrame:"Delete Frame"},editor:{rows:"Rows",columns:"Columns",catalog:"Catalog",gallery:"Gallery",grid:"Grid",scaleToFit:"Change to Fit",scaleToFill:"Change to Fill",fit:"Fit",strokeNone:"None",strokeSolid:"Solid",strokeDotted:"Dotted",strokeDashed:"Dashed",size:"Size",gap:"Gap",marginLeft:"Left",marginTop:"Top",marginRight:"Right",marginBottom:"Bottom",minimize:"Minimize",paddingLeft:"Left",paddingTop:"Top",paddingRight:"Right",paddingBottom:"Bottom",unlinkProperty:"Unlink Property",linkedProperty:"Linked Property",linkProperty:"Link Property",currentSpace:"Current Space",linkName:"${1} Link",linkThumbnail:"${1} Thumbnail",linkSticker:"${1} Sticker",opacity:"Opacity",shadowSpread:"Spread",shadowBlur:"Blur",width:"Width",height:"Height",margin:"Margin",padding:"Padding",bold:"Bold",italic:"Italic",underline:"Underline",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",numberOfLines:"Lines",createVerticalSection:"Create Vertical Section",createHorizontalSection:"Create Horizontal Section",themeColors:"Theme Colors",uiColors:"UI Colors",hex:"Hex"},buttons:{add:"Add",addFilter:"Add Filter",customize:"Customize",moreOptions:"More Options",saveProperty:"Save Property",newNote:"New Note",changeIcon:"Change Sticker",removeIcon:"Remove Sticker",addIcon:"Add Sticker",addCover:"Add Cover",changeBanner:"Change Cover",changeBannerShort:"Cover",saveChanges:"Save Changes",removeBanner:"Remove Cover",rename:"Change Name",editFrame:"Edit Frame",saveSpace:"Save Space",createSpace:"New Space",createFolder:"New Folder",createNote:"New Note",createCanvas:"New Canvas",addIntoSpace:"New Pin",addSmartSearch:"Add Smart Search",addItem:"Add Item",addProperty:"Add Property",addContext:"Add Context",cancel:"Cancel",search:"Search",delete:"Delete",toggleFlow:"Toggle Flow",openFlow:"Open Flow",hideFlow:"Hide Flow",openLink:"Open Link",addToSpace:"Add to Space",addToSpaceShort:"Pin",addTag:"Add Tag",tag:"Tag",syncFields:"Sync Properties",convertTable:"Convert to Markdown",cutTable:"Cut Table",deleteTable:"Delete Table",blink:"Blink",addFile:"Add Item",merge:"Merge",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",deleteView:"Delete View",renameTable:"Rename Table",renameTag:"Rename Tag",createTag:"Create Tag",currentFolder:"Current Folder",sync:"Sync",pasteCSS:"Paste CSS",save:"Save",run:"Run"},metadataTypes:{fileName:"File Name",path:"Path",folder:"Folder",sticker:"Sticker",color:"Color",created:"Created",lastModified:"Last Modified",extension:"Extension",size:"Size",tags:"Tags",inlinks:"Linked Mentions",outlinks:"Links",label:"Label",fileMetadata:"File Metadata",frontmatter:"Frontmatter"},filterTypes:{contains:"contains",notContains:"does not contain",is:"is",isNot:"is not",before:"before",after:"after",anyOf:"is any of",noneOf:"is none of",checked:"is checked",unchecked:"is unchecked",isEmpty:"is empty",isNotEmpty:"is not empty",isSameDate:"is same date",isSameDateAsToday:"today"},sortTypes:{alphaAsc:"A to Z",alphaDesc:"Z to A",earliest:"Earliest",latest:"Latest",checkAsc:"Checked \\u2192 Unchecked",checkDesc:"Unchecked \\u2192 Checked",itemsAsc:"Least Items",itemsDesc:"Most Items"},properties:{defaultField:"Name",audio:{label:"Audio",description:"Audio"},text:{label:"Text",description:"Text field"},number:{label:"Number",description:"Number field with optional unit"},boolean:{label:"Yes/No",description:"Yes or No toggle to indicate the status"},date:{label:"Date",description:"Select a date from a calendar"},option:{label:"Option",description:"Select one or multiple option from a list"},file:{label:"File"},link:{label:"Link",description:"Link to another note or a website"},tags:{label:"Tags",description:"Use tags to quickly organize your items"},object:{label:"Object",description:"Store any complex objects"},context:{label:"Relation",description:"Connect to another context property and create a relation"},image:{label:"Image",description:"Select any image from your system or from the internet"},color:{label:"Color",description:"Use colors to label your items or status"},space:{label:"Context",description:"Link to a context"},icon:{label:"Sticker",description:"Use stickers to uniquely label your items or status"},super:{label:"Super Property",links:"Open Link",properties:"Update Property",api:"API",obsidianCommands:"Run Command",runCommand:"Run Command",performAction:"Perform Action",whenClicked:"When Clicked"},fileProperty:{name:"Name",label:"Formula",createdTime:"Created",modifiedTime:"Last Edited",sticker:"Sticker",links:"Links",tags:"Tags",spaces:"Spaces",extension:"Extension",size:"Size",preview:"Note Preview",parentFolder:"Folder",description:"Use a formula to dynamically display a property"}},views:{navigator:"Navigator",explorer:"Explorer",space:"Space"},subViews:{spaceItems:"Items",spaceContext:"Context",spaceLists:"Lists",spaceActions:"Actions",spaceTemplates:"Templates",smartSearch:"Smart Search",filesAndFolders:"Files and Folders"},labels:{properties:"Properties",newAction:"New Action",newTable:"New Table",createFolder:"New Folder Name",rename:"Rename",createNew:"New",default:"Default",done:"Done",tables:"Tables",selectDateFormat:"Select/Type Date Format",renameSectionSmart:"Edit Smart Space",renameSection:"Edit Space",createSectionSmart:"New Smart Space",createSection:"New Folder",createNote:"New Note",contextMaker:"Context Maker",select:"Select",pinnedItems:"Pinned Items",collapse:"Collapse",expand:"Expand",all:"All",none:"None",view:"View",findStickers:"Find Sticker",mergeProperties:"Merge Properties",placeholder:"Type \'${1}\' for commands",itemsSelected:"${1} Selected",selectNote:"Select Note",selectIcon:"Select Icon",selectImage:"Select Image",selectSpace:"Select Space",styleSmall:"Small",styleMedium:"Medium",styleLarge:"Large",hiddenFilePattern:"Name, Suffixes and Extension",hiddenFileSpecific:"Exclude specific files and folders",textPlaceholder:"Enter Text",noFile:"is not created yet. Click to create.",navigatorSearchPlaceholder:"Search by Text or Filters",blinkPlaceholder:"Quickly Search a File, Folder, Tag... Press Tab to Edit",searchPlaceholder:"Type to search...",contextItemSelectPlaceholder:"Find Item",linkItemSelectPlaceholder:"Find or Create Note",pinNotePlaceholder:"Select a Note or Space to Pin",optionItemSelectPlaceholder:"Select Option",viewItemSelectPlaceholder:"Select View",tagItemSelectPlaceholder:"Find Tag",spaceSelectPlaceholder:"Select any Folder or Tag",propertyItemSelectPlaceholder:"Select Property",sortItemSelectPlaceholder:"Select Sort",filterItemSelectPlaceholder:"Select Filter",imageSelectPlaceholder:"Select an image or paste a URL",imageNotFoundPlaceholder:"No Images Found",syncFrontmatterProperty:"Sync Frontmatter Property",newProperty:"New Property",newPropertyShort:"New Property",propertyType:"Type",propertyDynamic:"Dyanmic",propertyValueSpace:"Space",propertyValueProperty:"Property",propertyLookup:"Edit Formula",dateFormat:"Date Format",propertyFileProp:"Property",multiple:"Multiple",filesCount:"{$1} Files",hiddenFiles:"Hidden Files",addExtension:"Add Rule",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",renameTable:"Rename Table",syncMetadata:"Sync Metadata",syncProperties:"Sync Properties",selectContext:"Select Context",metadata:"Metadata",backlinks:"Backlinks",spaces:"Spaces",context:"Context",content:"Content",deleteSpace:"Delete Space",deleteFiles:"Delete Files",outgoingLinks:"Outgoing Links",moveTo:"Move to",addTo:"Pin to",copyTo:"Copy to",reorderIn:"Reorder in",border:"Border",corners:"Corners",color:"Color",backgroundColor:"Background",cornerRadius:"Radius",onClick:"On Click",layout:"Layout",element:"Element",name:"Name",display:"Display",alignment:"Alignment",margin:"Margin",padding:"Padding",gap:"Gap",width:"Width",height:"Height",opacity:"Opacity",shadow:"Shadow",shadowBlur:"Blur",shadowSpread:"Spread",typography:"Typography",layers:"Layers",fontSize:"Size",props:"Props",styles:"Styles",events:"Events",code:"Code",selectedLayers:"${1} Layers"},descriptions:{spaceActions:"Create actions that runs when you press a button",spaceLists:"Create lists to track data and organize them in your space",spaceItems:"Add new items to the space or pin items to the space",smartSearch:"Automatically pin notes to this space based on a set of searches",hiddenFileOptions:"Exclude any files and folders by name, suffix or extension.",deleteSpace:"Deleting the space will also delete the folder and its contents.",deleteFiles:"Delete ${1} files/folders and their contents?",addContext:"Contexts lets you connect properties from your tags",spaceProperties:"Define Properties for your Space Items",syncMetadata:"Select which fields from your notes to start syncing with the context.",syncProperties:"Contexts defines and syncs the same fields across your notes depending on their folder or tag.",selectContext:"Select which folder or tag context you want to sync the fields."},flowView:{emptyDoc:"Empty Document",itemsCount:" Items",emptyFolder:"This Folder is Empty"},notice:{duplicateFile:"Folder already contains note with same name",addedToSection:"Added to Space",fileExists:"File Already Exists",folderExists:"Folder Already Exists",noPropertyName:"Property Name is Required",duplicatePropertyName:"Duplicate Property Name",newSpaceName:"Enter a name for your space",duplicateSpaceName:"Space name already exists",cantConvertNoteToSpace:"The view is not a note",templateSaved:"Template saved to space: "},settings:{layoutVertical:"Vertical",layoutHorizontal:"Horizontal",sectionSidebar:"Spaces",sectionEditor:"Maker Mode",sectionFlow:"Flow",sectionAdvanced:"Advanced",sectionDataview:"Dataview",sectionContext:"Context",sectionStickers:"Stickers",sectionNavigator:"Navigator",sectionDefault:"Default Spaces",sectionSpaceView:"Space View",sectionBlink:"Blink",sectionInlineContext:"Inline Context",sectionFlowBlock:"Flow Block",sectionFlowMenu:"Flow Menu",sectionFlowStyler:"Flow Styler",experimental:{name:"Experimental",desc:"Experimental features that are subject to change and may not be optimized for performance"},generateThumbnails:{name:"Generate Thumbnails",desc:"Create thumbnails for images to speed up performance"},minimalThemeFix:{name:"Minimal Theme Fix",description:"Apply fixes for the popular theme Minimal"},inlineStickerMenu:{name:"Inline Stickers",desc:"Add inline stickers by typing :"},openSpacesOnLaunch:{name:"Open Spaces as Default Tab",desc:"Open the Spaces tab when Obsidian launches"},defaultSpaceTemplate:{name:"Default Space Template",desc:"Select the default template for new spaces"},defaultDateFormat:{name:"Default Date Format",desc:"Set the default date format, example: yyyy-MM-dd (see https://date-fns.org/v2.30.0/docs/format)"},newNotePlaceholder:{name:"New Note Placeholder",desc:"Default name for new notes"},folderIndentationLines:{name:"Show Folder Indentation Lines",desc:"Turn on to show a line on the left of folders to indicate indentation"},folderNoteLocation:{name:"Folder Note Location Inside Folder",desc:"Turn on to have folder notes inside the folder, turn off to have it outside"},folderViewDefault:{name:"Show Folder Note by Default",desc:"Show the folder note by default when opening a folder"},internalLinkFlowEditor:{name:"Open Flow Blocks on Internal Link Click",desc:"Turn on to toggle Flow Blocks directly by clicking on internal links, otherwise a tooltip will be shown"},syncContextToFrontmatter:{name:"Sync Context Fields to Frontmatter",desc:"Turn on to automatically save all context fields to frontmatter fields, not just existing frontmatter fields."},inlineBacklinks:{name:"Show Inline Backlinks (Inline Context required)",desc:"Show editable backlinks at the bottom of your notes"},dataviewInlineContext:{name:"Show Dataview in Inline Context",desc:"Show dataview when inline context is enabled"},inlineContextExplorer:{name:"Inline Context",desc:"Display the context and a banner at the top of your notes"},inlineContextExpanded:{name:"Auto Expand Inline Context",desc:"Expand the inline context sections when opening a note"},inlineContextHorizontal:{name:"Inline Title and Sticker Layout",desc:"Layout for inline title and sticker in Inline Context"},hideFrontmatter:{name:"Hide Frontmatter Properties",desc:"Hide the frontmatter properties in inline context"},openFileContext:{name:"Auto Open Explorer",desc:"Automatically open explorer panel in the right panel"},folderNote:{name:"Enable Folder Note",desc:"Access the folder note in the folder page and hide the folder note from spaces"},expandFolder:{name:"Auto Expand Folder",desc:"Auto expand folders on click"},hoverPreview:{name:"Preview on Hover",desc:"Preview on Hover while holding Control/Command key"},activeFile:{name:"Reveal Active File",desc:"Automatically reveal the active file in Spaces"},contexts:{name:"Contexts",desc:"Contexts allows you to have full control over the metadata of your files"},spaces:{name:"Navigator",desc:"The navigator lets you create and organize your spaces"},spacesStickers:{name:"Stickers",desc:"Use Emojis to make it easier to find your notes"},spacesAlias:{name:"Alias",desc:"Use the alias metadata to show in Spaces"},spacesFileExplorerDual:{name:"Compatibility Mode",desc:"This will improve the compatibility of plugins while using Spaces"},spacesDeleteOption:{name:"Delete File Option",desc:"Select how you want files to be deleted"},spacesDeleteOptions:{permanant:"Delete Permanently",trash:"Move to Obsidian Trash","system-trash":"Move to System Trash"},hideRibbon:{name:"App Ribbon",desc:"Show/hide the left menu aka. ribbon"},spaceView:{name:"Space View",desc:"Open the space view when you click on a space"},defaultSpaces:{name:"Default Spaces",desc:"Recommended spaces for quickly organizing your vault"},homeSpace:{name:"Home Space",desc:"An easy-to-access space where you can add/organize your other spaces"},tagSpaces:{name:"Tag Spaces",desc:"Automatically create spaces for each of your tags"},readableLineWidth:{name:"Readable Line Width",desc:"Use Readable Line Width"},sidebarTabs:{name:"Sidebar Tabs",desc:"Show/hide other sidebar tabs"},spacesPerformance:{name:"Performance Mode",desc:"Turn on performance mode for Spaces, may affect scrolling appearance. Requires Restart"},indexSVG:{name:"Use SVGs as Stickers",desc:"Use any svg file in your vault as a sticker"},inlineStyler:{name:"Flow Styler",desc:"Select text to add styling"},inlineStylerColor:{name:"Text and Highlight Colors \\u{1F9EA}",desc:"Select text color and highlight color, (this may change in the future because of the limitations with HTML and Obsidian)"},spaceRowHeight:{name:"Row Height",desc:"The height for each row in spaces (in pixels), default is 28"},makeChar:{name:"Flow Menu Trigger",desc:"Character to open the Flow Menu"},mobileMakeBar:{name:"Flow Styler (Mobile)",desc:"Replaces the mobile toolbar"},editorMarkSans:{name:"Mark Sans \\u{1F9EA}",desc:"Use the editor without Markdown."},editorMakerMode:{name:"Flow (Beta)",desc:"An integrated and intuitive editor experience"},editorMakePlacholder:{name:"Flow Menu Hint Text",desc:"Show a hint text on how to open the Flow Menu Shortcut"},blink:{name:"Blink",desc:"A faster way to search and edit your notes"},editorMakeMenu:{name:"Flow Menu",desc:"Open the Flow menu to quickly add content"},editorMakeMenuTrigger:{name:"Flow Menu Shortcut",desc:"Trigger key to use flow menu"},editorFlowReplace:{name:"Flow Block",desc:"Open your internal links or toggle your embeds in the flow block."},editorFlowStyle:{name:"Flow Block Style",desc:"Select a theme for your flow block",seamless:"Seamless",classic:"Classic",minimal:"Minimal"}}}};this.lang="en";let l=hc.default.locale();["en"].includes(l)&&(this.lang=l)}get texts(){return this.all.en}},q=new xu().texts;function In(i){return In=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},In(i)}function bt(i){if(i===null||i===!0||i===!1)return NaN;var l=Number(i);return isNaN(l)?l:l<0?Math.ceil(l):Math.floor(l)}function he(i,l){if(l.length1?"s":"")+" required, but only "+l.length+" present")}function qe(i){he(1,arguments);var l=Object.prototype.toString.call(i);return i instanceof Date||In(i)==="object"&&l==="[object Date]"?new Date(i.getTime()):typeof i=="number"||l==="[object Number]"?new Date(i):((typeof i=="string"||l==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn\'t accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Su(i,l){he(2,arguments);var h=qe(i).getTime(),m=bt(l);return new Date(h+m)}var ry={};function ln(){return ry}function wu(i){var l=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return l.setUTCFullYear(i.getFullYear()),i.getTime()-l.getTime()}function bu(i){return he(1,arguments),i instanceof Date||In(i)==="object"&&Object.prototype.toString.call(i)==="[object Date]"}function Tu(i){if(he(1,arguments),!bu(i)&&typeof i!="number")return!1;var l=qe(i);return!isNaN(Number(l))}function Du(i,l){he(2,arguments);var h=bt(l);return Su(i,-h)}var ny=864e5;function Mu(i){he(1,arguments);var l=qe(i),h=l.getTime();l.setUTCMonth(0,1),l.setUTCHours(0,0,0,0);var m=l.getTime(),y=h-m;return Math.floor(y/ny)+1}function un(i){he(1,arguments);var l=1,h=qe(i),m=h.getUTCDay(),y=(m=y.getTime()?h+1:l.getTime()>=P.getTime()?h:h-1}function ku(i){he(1,arguments);var l=xi(i),h=new Date(0);h.setUTCFullYear(l,0,4),h.setUTCHours(0,0,0,0);var m=un(h);return m}var ay=6048e5;function Ou(i){he(1,arguments);var l=qe(i),h=un(l).getTime()-ku(l).getTime();return Math.round(h/ay)+1}function fn(i,l){var h,m,y,S,P,Y,E,G;he(1,arguments);var ge=ln(),V=bt((h=(m=(y=(S=l?.weekStartsOn)!==null&&S!==void 0?S:l==null||(P=l.locale)===null||P===void 0||(Y=P.options)===null||Y===void 0?void 0:Y.weekStartsOn)!==null&&y!==void 0?y:ge.weekStartsOn)!==null&&m!==void 0?m:(E=ge.locale)===null||E===void 0||(G=E.options)===null||G===void 0?void 0:G.weekStartsOn)!==null&&h!==void 0?h:0);if(!(V>=0&&V<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var te=qe(i),ce=te.getUTCDay(),I=(ce=1&&ce<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var I=new Date(0);I.setUTCFullYear(V+1,0,ce),I.setUTCHours(0,0,0,0);var Me=fn(I,l),ze=new Date(0);ze.setUTCFullYear(V,0,ce),ze.setUTCHours(0,0,0,0);var ke=fn(ze,l);return ge.getTime()>=Me.getTime()?V+1:ge.getTime()>=ke.getTime()?V:V-1}function Pu(i,l){var h,m,y,S,P,Y,E,G;he(1,arguments);var ge=ln(),V=bt((h=(m=(y=(S=l?.firstWeekContainsDate)!==null&&S!==void 0?S:l==null||(P=l.locale)===null||P===void 0||(Y=P.options)===null||Y===void 0?void 0:Y.firstWeekContainsDate)!==null&&y!==void 0?y:ge.firstWeekContainsDate)!==null&&m!==void 0?m:(E=ge.locale)===null||E===void 0||(G=E.options)===null||G===void 0?void 0:G.firstWeekContainsDate)!==null&&h!==void 0?h:1),te=Si(i,l),ce=new Date(0);ce.setUTCFullYear(te,0,V),ce.setUTCHours(0,0,0,0);var I=fn(ce,l);return I}var iy=6048e5;function Fu(i,l){he(1,arguments);var h=qe(i),m=fn(h,l).getTime()-Pu(h,l).getTime();return Math.round(m/iy)+1}function fe(i,l){for(var h=i<0?"-":"",m=Math.abs(i).toString();m.length0?m:1-m;return fe(h==="yy"?y%100:y,h.length)},M:function(l,h){var m=l.getUTCMonth();return h==="M"?String(m+1):fe(m+1,2)},d:function(l,h){return fe(l.getUTCDate(),h.length)},a:function(l,h){var m=l.getUTCHours()/12>=1?"pm":"am";switch(h){case"a":case"aa":return m.toUpperCase();case"aaa":return m;case"aaaaa":return m[0];case"aaaa":default:return m==="am"?"a.m.":"p.m."}},h:function(l,h){return fe(l.getUTCHours()%12||12,h.length)},H:function(l,h){return fe(l.getUTCHours(),h.length)},m:function(l,h){return fe(l.getUTCMinutes(),h.length)},s:function(l,h){return fe(l.getUTCSeconds(),h.length)},S:function(l,h){var m=h.length,y=l.getUTCMilliseconds(),S=Math.floor(y*Math.pow(10,m-3));return fe(S,h.length)}},Er=sy;var Ma={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},oy={G:function(l,h,m){var y=l.getUTCFullYear()>0?1:0;switch(h){case"G":case"GG":case"GGG":return m.era(y,{width:"abbreviated"});case"GGGGG":return m.era(y,{width:"narrow"});case"GGGG":default:return m.era(y,{width:"wide"})}},y:function(l,h,m){if(h==="yo"){var y=l.getUTCFullYear(),S=y>0?y:1-y;return m.ordinalNumber(S,{unit:"year"})}return Er.y(l,h)},Y:function(l,h,m,y){var S=Si(l,y),P=S>0?S:1-S;if(h==="YY"){var Y=P%100;return fe(Y,2)}return h==="Yo"?m.ordinalNumber(P,{unit:"year"}):fe(P,h.length)},R:function(l,h){var m=xi(l);return fe(m,h.length)},u:function(l,h){var m=l.getUTCFullYear();return fe(m,h.length)},Q:function(l,h,m){var y=Math.ceil((l.getUTCMonth()+1)/3);switch(h){case"Q":return String(y);case"QQ":return fe(y,2);case"Qo":return m.ordinalNumber(y,{unit:"quarter"});case"QQQ":return m.quarter(y,{width:"abbreviated",context:"formatting"});case"QQQQQ":return m.quarter(y,{width:"narrow",context:"formatting"});case"QQQQ":default:return m.quarter(y,{width:"wide",context:"formatting"})}},q:function(l,h,m){var y=Math.ceil((l.getUTCMonth()+1)/3);switch(h){case"q":return String(y);case"qq":return fe(y,2);case"qo":return m.ordinalNumber(y,{unit:"quarter"});case"qqq":return m.quarter(y,{width:"abbreviated",context:"standalone"});case"qqqqq":return m.quarter(y,{width:"narrow",context:"standalone"});case"qqqq":default:return m.quarter(y,{width:"wide",context:"standalone"})}},M:function(l,h,m){var y=l.getUTCMonth();switch(h){case"M":case"MM":return Er.M(l,h);case"Mo":return m.ordinalNumber(y+1,{unit:"month"});case"MMM":return m.month(y,{width:"abbreviated",context:"formatting"});case"MMMMM":return m.month(y,{width:"narrow",context:"formatting"});case"MMMM":default:return m.month(y,{width:"wide",context:"formatting"})}},L:function(l,h,m){var y=l.getUTCMonth();switch(h){case"L":return String(y+1);case"LL":return fe(y+1,2);case"Lo":return m.ordinalNumber(y+1,{unit:"month"});case"LLL":return m.month(y,{width:"abbreviated",context:"standalone"});case"LLLLL":return m.month(y,{width:"narrow",context:"standalone"});case"LLLL":default:return m.month(y,{width:"wide",context:"standalone"})}},w:function(l,h,m,y){var S=Fu(l,y);return h==="wo"?m.ordinalNumber(S,{unit:"week"}):fe(S,h.length)},I:function(l,h,m){var y=Ou(l);return h==="Io"?m.ordinalNumber(y,{unit:"week"}):fe(y,h.length)},d:function(l,h,m){return h==="do"?m.ordinalNumber(l.getUTCDate(),{unit:"date"}):Er.d(l,h)},D:function(l,h,m){var y=Mu(l);return h==="Do"?m.ordinalNumber(y,{unit:"dayOfYear"}):fe(y,h.length)},E:function(l,h,m){var y=l.getUTCDay();switch(h){case"E":case"EE":case"EEE":return m.day(y,{width:"abbreviated",context:"formatting"});case"EEEEE":return m.day(y,{width:"narrow",context:"formatting"});case"EEEEEE":return m.day(y,{width:"short",context:"formatting"});case"EEEE":default:return m.day(y,{width:"wide",context:"formatting"})}},e:function(l,h,m,y){var S=l.getUTCDay(),P=(S-y.weekStartsOn+8)%7||7;switch(h){case"e":return String(P);case"ee":return fe(P,2);case"eo":return m.ordinalNumber(P,{unit:"day"});case"eee":return m.day(S,{width:"abbreviated",context:"formatting"});case"eeeee":return m.day(S,{width:"narrow",context:"formatting"});case"eeeeee":return m.day(S,{width:"short",context:"formatting"});case"eeee":default:return m.day(S,{width:"wide",context:"formatting"})}},c:function(l,h,m,y){var S=l.getUTCDay(),P=(S-y.weekStartsOn+8)%7||7;switch(h){case"c":return String(P);case"cc":return fe(P,h.length);case"co":return m.ordinalNumber(P,{unit:"day"});case"ccc":return m.day(S,{width:"abbreviated",context:"standalone"});case"ccccc":return m.day(S,{width:"narrow",context:"standalone"});case"cccccc":return m.day(S,{width:"short",context:"standalone"});case"cccc":default:return m.day(S,{width:"wide",context:"standalone"})}},i:function(l,h,m){var y=l.getUTCDay(),S=y===0?7:y;switch(h){case"i":return String(S);case"ii":return fe(S,h.length);case"io":return m.ordinalNumber(S,{unit:"day"});case"iii":return m.day(y,{width:"abbreviated",context:"formatting"});case"iiiii":return m.day(y,{width:"narrow",context:"formatting"});case"iiiiii":return m.day(y,{width:"short",context:"formatting"});case"iiii":default:return m.day(y,{width:"wide",context:"formatting"})}},a:function(l,h,m){var y=l.getUTCHours(),S=y/12>=1?"pm":"am";switch(h){case"a":case"aa":return m.dayPeriod(S,{width:"abbreviated",context:"formatting"});case"aaa":return m.dayPeriod(S,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return m.dayPeriod(S,{width:"narrow",context:"formatting"});case"aaaa":default:return m.dayPeriod(S,{width:"wide",context:"formatting"})}},b:function(l,h,m){var y=l.getUTCHours(),S;switch(y===12?S=Ma.noon:y===0?S=Ma.midnight:S=y/12>=1?"pm":"am",h){case"b":case"bb":return m.dayPeriod(S,{width:"abbreviated",context:"formatting"});case"bbb":return m.dayPeriod(S,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return m.dayPeriod(S,{width:"narrow",context:"formatting"});case"bbbb":default:return m.dayPeriod(S,{width:"wide",context:"formatting"})}},B:function(l,h,m){var y=l.getUTCHours(),S;switch(y>=17?S=Ma.evening:y>=12?S=Ma.afternoon:y>=4?S=Ma.morning:S=Ma.night,h){case"B":case"BB":case"BBB":return m.dayPeriod(S,{width:"abbreviated",context:"formatting"});case"BBBBB":return m.dayPeriod(S,{width:"narrow",context:"formatting"});case"BBBB":default:return m.dayPeriod(S,{width:"wide",context:"formatting"})}},h:function(l,h,m){if(h==="ho"){var y=l.getUTCHours()%12;return y===0&&(y=12),m.ordinalNumber(y,{unit:"hour"})}return Er.h(l,h)},H:function(l,h,m){return h==="Ho"?m.ordinalNumber(l.getUTCHours(),{unit:"hour"}):Er.H(l,h)},K:function(l,h,m){var y=l.getUTCHours()%12;return h==="Ko"?m.ordinalNumber(y,{unit:"hour"}):fe(y,h.length)},k:function(l,h,m){var y=l.getUTCHours();return y===0&&(y=24),h==="ko"?m.ordinalNumber(y,{unit:"hour"}):fe(y,h.length)},m:function(l,h,m){return h==="mo"?m.ordinalNumber(l.getUTCMinutes(),{unit:"minute"}):Er.m(l,h)},s:function(l,h,m){return h==="so"?m.ordinalNumber(l.getUTCSeconds(),{unit:"second"}):Er.s(l,h)},S:function(l,h){return Er.S(l,h)},X:function(l,h,m,y){var S=y._originalDate||l,P=S.getTimezoneOffset();if(P===0)return"Z";switch(h){case"X":return mc(P);case"XXXX":case"XX":return An(P);case"XXXXX":case"XXX":default:return An(P,":")}},x:function(l,h,m,y){var S=y._originalDate||l,P=S.getTimezoneOffset();switch(h){case"x":return mc(P);case"xxxx":case"xx":return An(P);case"xxxxx":case"xxx":default:return An(P,":")}},O:function(l,h,m,y){var S=y._originalDate||l,P=S.getTimezoneOffset();switch(h){case"O":case"OO":case"OOO":return"GMT"+pc(P,":");case"OOOO":default:return"GMT"+An(P,":")}},z:function(l,h,m,y){var S=y._originalDate||l,P=S.getTimezoneOffset();switch(h){case"z":case"zz":case"zzz":return"GMT"+pc(P,":");case"zzzz":default:return"GMT"+An(P,":")}},t:function(l,h,m,y){var S=y._originalDate||l,P=Math.floor(S.getTime()/1e3);return fe(P,h.length)},T:function(l,h,m,y){var S=y._originalDate||l,P=S.getTime();return fe(P,h.length)}};function pc(i,l){var h=i>0?"-":"+",m=Math.abs(i),y=Math.floor(m/60),S=m%60;if(S===0)return h+String(y);var P=l||"";return h+String(y)+P+fe(S,2)}function mc(i,l){if(i%60===0){var h=i>0?"-":"+";return h+fe(Math.abs(i)/60,2)}return An(i,l)}function An(i,l){var h=l||"",m=i>0?"-":"+",y=Math.abs(i),S=fe(Math.floor(y/60),2),P=fe(y%60,2);return m+S+h+P}var gc=oy;var yc=function(l,h){switch(l){case"P":return h.date({width:"short"});case"PP":return h.date({width:"medium"});case"PPP":return h.date({width:"long"});case"PPPP":default:return h.date({width:"full"})}},vc=function(l,h){switch(l){case"p":return h.time({width:"short"});case"pp":return h.time({width:"medium"});case"ppp":return h.time({width:"long"});case"pppp":default:return h.time({width:"full"})}},ly=function(l,h){var m=l.match(/(P+)(p+)?/)||[],y=m[1],S=m[2];if(!S)return yc(l,h);var P;switch(y){case"P":P=h.dateTime({width:"short"});break;case"PP":P=h.dateTime({width:"medium"});break;case"PPP":P=h.dateTime({width:"long"});break;case"PPPP":default:P=h.dateTime({width:"full"});break}return P.replace("{{date}}",yc(y,h)).replace("{{time}}",vc(S,h))},uy={p:vc,P:ly},_c=uy;var fy=["D","DD"],cy=["YY","YYYY"];function xc(i){return fy.indexOf(i)!==-1}function Sc(i){return cy.indexOf(i)!==-1}function Cu(i,l,h){if(i==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(l,"`) for formatting years to the input `").concat(h,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(i==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(l,"`) for formatting years to the input `").concat(h,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(i==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(l,"`) for formatting days of the month to the input `").concat(h,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(i==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(l,"`) for formatting days of the month to the input `").concat(h,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var dy={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},hy=function(l,h,m){var y,S=dy[l];return typeof S=="string"?y=S:h===1?y=S.one:y=S.other.replace("{{count}}",h.toString()),m!=null&&m.addSuffix?m.comparison&&m.comparison>0?"in "+y:y+" ago":y},wc=hy;function wi(i){return function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=l.width?String(l.width):i.defaultWidth,m=i.formats[h]||i.formats[i.defaultWidth];return m}}var py={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},my={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gy={full:"{{date}} \'at\' {{time}}",long:"{{date}} \'at\' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},yy={date:wi({formats:py,defaultWidth:"full"}),time:wi({formats:my,defaultWidth:"full"}),dateTime:wi({formats:gy,defaultWidth:"full"})},bc=yy;var vy={lastWeek:"\'last\' eeee \'at\' p",yesterday:"\'yesterday at\' p",today:"\'today at\' p",tomorrow:"\'tomorrow at\' p",nextWeek:"eeee \'at\' p",other:"P"},_y=function(l,h,m,y){return vy[l]},Tc=_y;function Wn(i){return function(l,h){var m=h!=null&&h.context?String(h.context):"standalone",y;if(m==="formatting"&&i.formattingValues){var S=i.defaultFormattingWidth||i.defaultWidth,P=h!=null&&h.width?String(h.width):S;y=i.formattingValues[P]||i.formattingValues[S]}else{var Y=i.defaultWidth,E=h!=null&&h.width?String(h.width):i.defaultWidth;y=i.values[E]||i.values[Y]}var G=i.argumentCallback?i.argumentCallback(l):l;return y[G]}}var xy={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Sy={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},wy={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},by={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ty={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Dy={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},My=function(l,h){var m=Number(l),y=m%100;if(y>20||y<10)switch(y%10){case 1:return m+"st";case 2:return m+"nd";case 3:return m+"rd"}return m+"th"},ky={ordinalNumber:My,era:Wn({values:xy,defaultWidth:"wide"}),quarter:Wn({values:Sy,defaultWidth:"wide",argumentCallback:function(l){return l-1}}),month:Wn({values:wy,defaultWidth:"wide"}),day:Wn({values:by,defaultWidth:"wide"}),dayPeriod:Wn({values:Ty,defaultWidth:"wide",formattingValues:Dy,defaultFormattingWidth:"wide"})},Dc=ky;function Yn(i){return function(l){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=h.width,y=m&&i.matchPatterns[m]||i.matchPatterns[i.defaultMatchWidth],S=l.match(y);if(!S)return null;var P=S[0],Y=m&&i.parsePatterns[m]||i.parsePatterns[i.defaultParseWidth],E=Array.isArray(Y)?Py(Y,function(V){return V.test(P)}):Oy(Y,function(V){return V.test(P)}),G;G=i.valueCallback?i.valueCallback(E):E,G=h.valueCallback?h.valueCallback(G):G;var ge=l.slice(P.length);return{value:G,rest:ge}}}function Oy(i,l){for(var h in i)if(i.hasOwnProperty(h)&&l(i[h]))return h}function Py(i,l){for(var h=0;h1&&arguments[1]!==void 0?arguments[1]:{},m=l.match(i.matchPattern);if(!m)return null;var y=m[0],S=l.match(i.parsePattern);if(!S)return null;var P=i.valueCallback?i.valueCallback(S[0]):S[0];P=h.valueCallback?h.valueCallback(P):P;var Y=l.slice(y.length);return{value:P,rest:Y}}}var Fy=/^(\\d+)(th|st|nd|rd)?/i,Cy=/\\d+/i,Iy={narrow:/^(b|a)/i,abbreviated:/^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ay={any:[/^b/i,/^(a|c)/i]},Wy={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Yy={any:[/1/i,/2/i,/3/i,/4/i]},Ry={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ny={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ly={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ey={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Uy={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},By={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Hy={ordinalNumber:Iu({matchPattern:Fy,parsePattern:Cy,valueCallback:function(l){return parseInt(l,10)}}),era:Yn({matchPatterns:Iy,defaultMatchWidth:"wide",parsePatterns:Ay,defaultParseWidth:"any"}),quarter:Yn({matchPatterns:Wy,defaultMatchWidth:"wide",parsePatterns:Yy,defaultParseWidth:"any",valueCallback:function(l){return l+1}}),month:Yn({matchPatterns:Ry,defaultMatchWidth:"wide",parsePatterns:Ny,defaultParseWidth:"any"}),day:Yn({matchPatterns:Ly,defaultMatchWidth:"wide",parsePatterns:Ey,defaultParseWidth:"any"}),dayPeriod:Yn({matchPatterns:Uy,defaultMatchWidth:"any",parsePatterns:By,defaultParseWidth:"any"})},Mc=Hy;var Gy={code:"en-US",formatDistance:wc,formatLong:bc,formatRelative:Tc,localize:Dc,match:Mc,options:{weekStartsOn:0,firstWeekContainsDate:1}},kc=Gy;var Oc=kc;var $y=/[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|\'\'|\'(\'\'|[^\'])+(\'|$)|./g,qy=/P+p+|P+|p+|\'\'|\'(\'\'|[^\'])+(\'|$)|./g,Vy=/^\'([^]*?)\'?$/,zy=/\'\'/g,Zy=/[a-zA-Z]/;function zs(i,l,h){var m,y,S,P,Y,E,G,ge,V,te,ce,I,Me,ze,ke,ie,Pe,Re;he(2,arguments);var Ne=String(l),ye=ln(),Le=(m=(y=h?.locale)!==null&&y!==void 0?y:ye.locale)!==null&&m!==void 0?m:Oc,Ee=bt((S=(P=(Y=(E=h?.firstWeekContainsDate)!==null&&E!==void 0?E:h==null||(G=h.locale)===null||G===void 0||(ge=G.options)===null||ge===void 0?void 0:ge.firstWeekContainsDate)!==null&&Y!==void 0?Y:ye.firstWeekContainsDate)!==null&&P!==void 0?P:(V=ye.locale)===null||V===void 0||(te=V.options)===null||te===void 0?void 0:te.firstWeekContainsDate)!==null&&S!==void 0?S:1);if(!(Ee>=1&&Ee<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var Zt=bt((ce=(I=(Me=(ze=h?.weekStartsOn)!==null&&ze!==void 0?ze:h==null||(ke=h.locale)===null||ke===void 0||(ie=ke.options)===null||ie===void 0?void 0:ie.weekStartsOn)!==null&&Me!==void 0?Me:ye.weekStartsOn)!==null&&I!==void 0?I:(Pe=ye.locale)===null||Pe===void 0||(Re=Pe.options)===null||Re===void 0?void 0:Re.weekStartsOn)!==null&&ce!==void 0?ce:0);if(!(Zt>=0&&Zt<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!Le.localize)throw new RangeError("locale must contain localize property");if(!Le.formatLong)throw new RangeError("locale must contain formatLong property");var Yt=qe(i);if(!Tu(Yt))throw new RangeError("Invalid time value");var se=wu(Yt),Ke=Du(Yt,se),it={firstWeekContainsDate:Ee,weekStartsOn:Zt,locale:Le,_originalDate:Yt},Tt=Ne.match(qy).map(function(we){var Ue=we[0];if(Ue==="p"||Ue==="P"){var Dt=_c[Ue];return Dt(we,Le.formatLong)}return we}).join("").match($y).map(function(we){if(we==="\'\'")return"\'";var Ue=we[0];if(Ue==="\'")return Qy(we);var Dt=gc[Ue];if(Dt)return!(h!=null&&h.useAdditionalWeekYearTokens)&&Sc(we)&&Cu(we,l,String(i)),!(h!=null&&h.useAdditionalDayOfYearTokens)&&xc(we)&&Cu(we,l,String(i)),Dt(Ke,we,Le.localize,it);if(Ue.match(Zy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Ue+"`");return we}).join("");return Tt}function Qy(i){var l=i.match(Vy);return l?l[1].replace(zy,"\'"):i}var Au=(i,l)=>{if(i instanceof Date)return"date";if(typeof i=="string"){if(/\\/\\/(\\S+?(?:jpe?g|png|gif|svg))/gi.test(i)||i.includes("unsplash"))return"image";if(/^\\d{4}-\\d{2}-\\d{2}$/.test(i))return"date";if(l=="tag"||l=="tags")return"tag";if(/\\[\\[.*?\\]\\]/.test(i))return"link"}else{if(typeof i=="number")return"number";if(typeof i=="boolean")return"boolean";if(i)if(Array.isArray(i)||typeof i=="string"&&i.indexOf(",")>-1){let h=Array.isArray(i)?i:[];if(typeof i=="string"&&i.indexOf(",")>-1&&(h=zt(i)),l=="tag"||l=="tags")return"tag-multi";if(h.length==1&&Array.isArray(h[0])&&h[0].length==1&&typeof h[0][0]=="string")return"link";let m=wr(h.map(y=>Au(y,l)));return m.length==1&&m[0]=="link"?"link-multi":m.some(y=>y=="object")?"object-multi":"option-multi"}else{if(i.isLuxonDateTime)return"date";if(i.isLuxonDuration)return"duration";if(i.type=="file")return"link";if(typeof i=="object"&&!Array.isArray(i)&&i!==null)return"object"}else return"unknown"}return"text"};var Pc=i=>i.map(l=>l.replace(",","\\\\,")).join(", "),ka=i=>i?.map(l=>l.replace(",","\\\\,")).join(", ")??"";var zt=i=>(i?.replace("\\\\,",",")?.match(/(\\\\.|[^,])+/g)??[]).map(l=>l.trim()),Fc=(i,l)=>{switch(Au(l,i)){case"object":return JSON.stringify(l);case"number":return l.toString();case"boolean":return l?"true":"false";case"date":{if(l instanceof Date){let m=zs(l,"yyyy-MM-dd");if(typeof m=="string")return m}return typeof l!="string"?"":l}break;case"duration":return Pc(Object.keys(l.values).reduce((m,y)=>[...m,...l.values[y]>0?[l.values[y]+" "+y]:[]],[]));case"option-multi":case"link-multi":return typeof l=="string"?bi(l):ka(l.map(m=>m?typeof m=="string"?bi(m):m.path?m.path:Array.isArray(l)&&m.length==1&&Array.isArray(m[0])&&m[0].length==1&&typeof m[0][0]=="string"?m[0][0]:JSON.stringify(m):""));case"link":return Array.isArray(l)&&l.length==1&&Array.isArray(l[0])&&l[0].length==1&&typeof l[0][0]=="string"?l[0][0]:typeof l=="string"?bi(l):l.path;case"text":case"tag":case"image":return l}return""};var bi=i=>{if(!i)return"";let l=/\\[\\[(.*?)\\]\\]/g.exec(i),h=l?.length>1?l[1].substring(0,Cc("|",l[1])):i;return h||i};function Ac(i){return Array.isArray(i)?i:typeof i=="string"?[i]:[]}var Cc=(i,l)=>l.indexOf(i)>0?l.indexOf(i):l.length;var Ti=i=>"spaces://"+i;var Wc=i=>i.charAt(0)=="/"?i.substring(1):i;var Di=i=>i.lastIndexOf("/")!=-1?i.lastIndexOf(".")!=-1?Wc(i.substring(i.lastIndexOf("/")+1,i.lastIndexOf("."))):i.substring(i.lastIndexOf("/")+1):i.lastIndexOf(".")!=-1?i.substring(0,i.lastIndexOf(".")):i;var J_=[{type:"unknown",label:"",restricted:!0,icon:"ui//file-question"},{type:"text",label:q.properties.text.label,metadata:!0,icon:"ui//text",primative:!0,description:q.properties.text.description},{type:"number",label:q.properties.number.label,metadata:!0,icon:"ui//binary",configKeys:["unit"],primative:!0,description:q.properties.number.description},{type:"boolean",label:q.properties.boolean.label,metadata:!0,icon:"ui//check-square",primative:!0,description:q.properties.boolean.description},{type:"date",label:q.properties.date.label,metadata:!0,icon:"ui//calendar",configKeys:["format"],primative:!0,description:q.properties.date.description},{type:"option",label:q.properties.option.label,multi:!0,multiType:"option-multi",icon:"ui//list",configKeys:["options","source"],description:q.properties.option.description},{type:"tags",label:q.properties.tags.label,icon:"ui//tags",description:q.properties.tags.description},{type:"file",label:q.properties.file.label,restricted:!0,icon:"ui//mk-make-h3"},{type:"fileprop",label:q.properties.fileProperty.label,icon:"ui//formula",configKeys:["field","value","type"],description:q.properties.fileProperty.description},{type:"link",label:q.properties.link.label,multi:!0,multiType:"link-multi",metadata:!0,icon:"ui//file-text",primative:!0,description:q.properties.link.description},{type:"context",label:q.properties.context.label,icon:"ui//mk-make-note",multi:!0,multiType:"context-multi",configKeys:["space"],description:q.properties.context.description},{type:"object",label:q.properties.object.label,multi:!0,multiType:"object-multi",metadata:!0,icon:"ui//list-tree",configKeys:["type"],description:q.properties.object.description},{type:"icon",label:q.properties.icon.label,multi:!0,multiType:"icon-multi",icon:"ui//gem",restricted:!0,primative:!0,description:q.properties.icon.description},{type:"image",label:q.properties.image.label,multi:!0,multiType:"image-multi",metadata:!0,icon:"ui//mk-make-image",primative:!0,description:q.properties.image.description},{type:"color",label:q.properties.color.label,icon:"ui//mk-make-image",restricted:!0,description:q.properties.color.description},{type:"space",label:q.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:q.properties.space.description},{type:"table",label:q.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:q.properties.space.description},{type:"super",label:q.properties.super.label,icon:"ui//zap",restricted:!0,configKeys:["dynamic","field"]},{type:"input",label:q.properties.super.label,icon:"ui//input",restricted:!0}];var Rn="files",Ks={id:Rn,name:"Files",type:"db",primary:"true"},Jy="filesView",Xy={id:Jy,name:"All",type:"view",def:JSON.stringify({db:Rn,icon:"ui//file-stack"})},jy="main",e0=i=>({id:i,name:i,type:"frame",def:"",predicate:"",primary:"true"}),X_={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[e0(jy),Xy]},Zs={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[Ks]},Yc={uniques:["name,schemaId"],cols:["name","schemaId","type","value","attrs","hidden","unique","primary"]},Qs={...Yc,rows:[{name:Lr,schemaId:Rn,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""},{name:q.properties.fileProperty.createdTime,schemaId:Rn,type:"fileprop",value:Lr+".ctime",hidden:"",unique:"",attrs:"",primary:"true"}]};var j_=[{name:q.properties.defaultField,schemaId:"",type:"text",primary:"true"}],Wu={...Yc,rows:[{name:Lr,schemaId:Rn,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""}]};var ex={schema:Ks,cols:Qs.rows,rows:[]},tx={schema:Ks,cols:Qs.rows,rows:[]},rx={schema:Ks,cols:Wu.rows,rows:[]},Rc=(i,l)=>i.filter(h=>l.find(m=>m.id==h.schemaId&&m.type=="db")).reduce((h,m)=>({...h,...h[m.schemaId]?{[m.schemaId]:{uniques:m.unique=="true"?[...h[m.schemaId].uniques,m.name]:h[m.schemaId].uniques,cols:[...h[m.schemaId].cols,m.name],rows:[]}}:{[m.schemaId]:{uniques:m.unique=="true"?[m.name]:[],cols:[m.name],rows:[]}}}),{});var nx={m_schema:Zs,m_fields:Qs,...Rc(Qs.rows,Zs.rows)},ax={m_schema:Zs,m_fields:Wu,...Rc(Wu.rows,Zs.rows)};var Yu="spaces://$tags";var Nx={name:q.menu.waypoints,displayName:q.menu.waypoints,path:"spaces://$waypoints",label:{name:q.menu.waypoints,thumbnail:"",sticker:"ui//tags",color:""},type:"default"},Lx={name:q.menu.tags,displayName:q.menu.tags,path:"spaces://$tags",label:{thumbnail:"",name:q.menu.tags,sticker:"ui//tags",color:""},type:"default"},Ex={name:q.menu.vault,displayName:q.menu.vault,path:"/",label:{thumbnail:"",name:q.menu.vault,sticker:"ui//vault",color:""},type:"default"};var Nc=(i,l)=>{let h=i?zt(i):[],m=l?zt(l):[];return m.every(y=>h.some(S=>S==y))&&h.every(y=>m.some(S=>S==y))},Oa=(i,l)=>i==l,Ru=(i,l)=>(i??"").length==0,Nu=(i,l)=>(i??"").toLowerCase().includes((l??"").toLowerCase()),Lu=(i,l)=>parseFloat(i)>parseFloat(l),Eu=(i,l)=>parseInt(i){let h=isNaN(Date.parse(i))?new Date(parseInt(i)):new Date(i),m=isNaN(Date.parse(l))?new Date(parseInt(l)):new Date(l);return h.valueOf()>m.valueOf()},Ec=(i,l)=>{let h=isNaN(Date.parse(i))?new Date(parseInt(i)):new Date(i),m=isNaN(Date.parse(l))?new Date(parseInt(l)):new Date(l);return h.valueOf(){let h=i?zt(i):[];return(l?zt(l):[]).some(y=>h.some(S=>S==y))},Uc=(i,l)=>{if(!i)return!1;let h=new Date(`${i.toString().replace(".",":")}`),m=new Date(`${l}`);return h.getMonth()===m.getMonth()&&h.getDate()===m.getDate()},Bc=i=>{if(!i)return!1;let l=new Date(`${i.toString()}T00:00`),h=new Date;return l.getMonth()===h.getMonth()&&l.getDate()===h.getDate()};var Mi={isNotEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(i,l)=>!Ru(i,""),valueType:"none"},isEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(i,l)=>Ru(i,""),valueType:"none"},include:{fn:(i,l)=>Nu(i,l),type:["text","file","link","image"],valueType:"text"},notInclude:{type:["text","file","link","image"],fn:(i,l)=>!Nu(i,l),valueType:"text"},is:{type:["text"],fn:(i,l)=>Oa(i,l),valueType:"text"},isNot:{type:["text"],fn:(i,l)=>!Oa(i,l),valueType:"text"},equal:{type:["number"],fn:(i,l)=>Oa(i,l),valueType:"number"},isLink:{type:["link","context"],fn:(i,l)=>Oa(i,l),valueType:"link"},isNotLink:{type:["link","context"],fn:(i,l)=>!Oa(i,l),valueType:"link"},isGreatThan:{type:["number"],fn:(i,l)=>Lu(i,l),valueType:"number"},isLessThan:{type:["number"],fn:(i,l)=>Eu(i,l),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(i,l)=>!Lu(i,l),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(i,l)=>!Eu(i,l),valueType:"number"},dateBefore:{type:["date"],fn:(i,l)=>Ec(i,l),valueType:"date"},dateAfter:{type:["date"],fn:(i,l)=>Lc(i,l),valueType:"date"},isSameDate:{type:["date"],fn:(i,l)=>Uc(i,l),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(i,l)=>Bc(i,l),valueType:"none"},isExactList:{type:["option","option-multi","link-multi","context-multi","tags-multi","tags"],fn:(i,l)=>Nc(i,l),valueType:"list"},isAnyInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi","tags"],fn:(i,l)=>Uu(i,l),valueType:"list"},isNoneInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi","tags"],fn:(i,l)=>!Uu(i,l),valueType:"list"},isTrue:{type:["boolean"],fn:(i,l)=>i=="true",valueType:"none"},isFalse:{type:["boolean"],fn:(i,l)=>i!="true",valueType:"none"}};var r0=(i,l)=>l.reduce((m,y)=>{let[S,P]=m,Y=y.type=="path"?Gc(P,y):y.type=="frontmatter"?Hc(P,y):$c(P,y),E=P.filter(G=>!Y.includes(G));return[[...S,...Y],E]},[[],i])[0],n0=(i,l)=>l.reduce((h,m)=>m.type=="path"?Gc(h,m):m.type=="frontmatter"?Hc(h,m):$c(h,m),i),Hc=(i,l)=>i.filter(h=>{let m=h.metadata?.property;if(!m||!m[l.field])return!1;let y=Mi[l.fn],S=!0;return y&&(S=y.fn(Fc(l.field,m[l.field]),l.value)),S}),Gc=(i,l)=>i.filter(h=>{let m="";l.field=="outlinks"?m=ka(h.outlinks??[]):l.field=="inlinks"?m=ka(h.inlinks??[]):l.field=="tags"&&(m=ka(h.tags??[]));let y=Mi[l.fn],S=!0;return y&&(S=y.fn(m,l.value)),S}),$c=(i,l)=>i.filter(h=>{let m=Mi[l.fn],y=!0;return m&&(y=m.fn(h.metadata?.[l.type]?.[l.field],l.value)),y}),qc=(i,l)=>i.reduce((m,y)=>!m||y.filters.length==0?!1:y.type=="any"?r0([l],y.filters).length>0:n0([l],y.filters).length>0,!0);var Vc=(i,l)=>i.hiddenExtensions.some(h=>l.endsWith(h))||l.startsWith(i.spacesFolder+"/#")||i.hiddenFiles.some(h=>h==l);var zc=(i,l,h)=>{if(!i)return{changed:!1,cache:null};if(!l)return{changed:!1,cache:{path:i.path,frames:{},schemas:[]}};let m=Object.values(l).map(Y=>Y.schema),y=m.filter(Y=>Y.type=="frame").reduce((Y,E)=>({...Y,[E.id]:l[E.id]}),{}),S={path:i.path,frames:y,schemas:m},P=!0;return h&&Js.default.isEqual(S,h)&&(P=!1),{changed:P,cache:S}},Zc=(i,l,h,m,y)=>{let S={};if(!i)return{changed:!1,cache:null};if(!l)return{changed:!1,cache:{cols:[],path:i.path,schemas:[],outlinks:[],contexts:[],paths:[],tables:{},space:i,spaceMap:S,dbExists:!1}};let P=Object.values(l).map(ie=>ie.schema),Y=P.find(ie=>ie.primary=="true"),E=l[Y.id],G=l,ge=E.cols?.filter(ie=>ie.type.startsWith("context"))??[],V=E.cols?.filter(ie=>ie.type.startsWith("link"))??[],te=wr(ge.map(ie=>ie.value));ge.forEach(ie=>{S[ie.name]={},E.rows.forEach(Pe=>{zt(Pe[ie.name]).forEach(Re=>S[ie.name][Re]=[...S[ie.name][Re]??[],Pe[Lr]])})});let ce=G[Rn]?.rows?.map(ie=>ie[Lr])??[],I=cc(h??[],ce),Me=wr(E.rows.reduce((ie,Pe)=>wr([...ie,...[...ge,...V].flatMap(Re=>zt(Pe[Re.name]).map(Ne=>bi(Ne)))]),[])),ze={cols:E.cols,path:i.path,contexts:te,outlinks:Me,paths:I,tables:G,schemas:P,space:i,spaceMap:S,dbExists:y},ke=!0;return m&&Js.default.isEqual(ze,m)&&(ke=!0),{changed:ke,cache:ze}},Qc=(i,l,h,m)=>{let y={};for(let[S,P]of i){let Y=h.get(S)?.defPath??S,E=i.get(Y)??P,G=P?.parent??"",ge=P?.type??"",V=P?.subtype??"",te=E?.label,ce=m?.get(S),{changed:I,cache:Me}=Bu(S,l,h,E,te,ge,V,G,ce);y[S]={changed:I,cache:Me}}return y},Bu=(i,l,h,m,y,S,P,Y,E)=>{let G=(se,Ke,it)=>se?.length>0||se?.length>0?se:Ke=="space"?it=="Spaces/Home"?"ui//home":it=="/"?"ui//vault":it.startsWith("spaces://")?"ui//tags":"ui//folder":"ui//file",ge={label:m?.label,path:i,name:Di(i),displayName:Di(i)},V=[],te=m?.tags?.map(se=>se)??[],ce=Vc(l,i),I=(se,Ke,it=new Set)=>{let Tt=[];for(let we of Ke){let Ue=se.get(we)?.contexts??[];for(let Dt of Ue)it.has(Dt)||(Tt.push(Dt),it.add(Dt),Tt.push(...I(se,[Ti(Dt)],it)))}return Tt};if(h.has(Y))for(let se of h.get(Y).contexts??[])V.push(se);V.push(...te);let Me=y?.name,ze=m?.properties?Ac(m.properties[l.fmKeyAlias]):[],ke=G(y?.sticker,S,i),ie=y?.color??"",Pe=m?.inlinks??[],Re=m?.links??[],Ne=l.spacesUseAlias?ze[0]??Me:Me,ye={...ge,name:Me,tags:wr(V),type:S,subtype:P,displayName:Ne,parent:Y,label:{name:Me,sticker:ke,color:ie,thumbnail:y?.thumbnail??"",preview:y?.preview??""},metadata:{...m},inlinks:Pe,outlinks:Re},Le=[];P=="tag"&&Le.push(Yu);for(let se of V)Le.push(Ti(se));for(let[se,Ke]of h){if(Ke.defPath==i&&(ce=!0),P!="tag"&&P!="default"&&Ke.space&&Ke.space.path==Y){Le.push(se);continue}if(Ke.metadata?.filters?.length>0&&qc(Ke.metadata.filters,ye)){Le.push(se);continue}if(Ke.metadata?.links?.length>0&&(Ke.metadata?.links??[]).find(Tt=>Tt==ye.path)){Le.push(se);continue}}let Ee=I(h,Le);Le.push(...Ee.map(se=>Ti(se))),ye.tags.push(...Ee);let Zt=ce?{...ye,spaces:[],hidden:ce}:{...ye,spaces:wr(Le),hidden:ce},Yt=!0;return E&&Js.default.isEqual(Zt,E)&&(Yt=!1),{changed:Yt,cache:Zt}};function Kc(i){let{path:l,settings:h,spacesCache:m,pathMetadata:y,label:S,type:P,subtype:Y,parent:E,oldMetadata:G}=i;return Bu(l,h,m,y,S,P,Y,E,G)}function Jc(i){let{space:l,mdb:h,paths:m,oldCache:y,dbExists:S}=i;return Zc(l,h,m,y,S)}function Xc(i){let{pathCache:l,settings:h,spacesCache:m,oldMetadata:y}=i;return Qc(l,h,m,y)}function jc(i){let{space:l,mdb:h,oldCache:m}=i;return zc(l,h,m)}var a0=self;a0.onmessage=async i=>{let{payload:l,job:h}=i.data,m;h.type=="path"?m=Kc(l):h.type=="context"?m=Jc(l):h.type=="frames"?m=jc(l):h.type=="paths"&&(m=Xc(l));try{postMessage({job:h,result:m})}catch(y){console.log(y),postMessage({job:h,result:{$error:`Failed to index ${h.type} ${h.path}: ${y}`}})}};\n/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! moment.js\n//! momentjs.com\n//! version : 2.29.4\n', { "name": "Superstate Indexer" }); +} + +// src/core/superstate/workers/indexer/indexer.ts +var Indexer = class { + constructor(numWorkers, cache2) { + this.numWorkers = numWorkers; + this.cache = cache2; + this.workers = []; + this.busy = []; + this.reloadQueue = []; + this.reloadSet = /* @__PURE__ */ new Set(); + this.callbacks = /* @__PURE__ */ new Map(); + for (let index = 0; index < numWorkers; index++) { + const worker = new Worker2({ name: "Make.md Superstate Indexer " + (index + 1) }); + worker.onmessage = (evt) => this.finish(evt.data.job, evt.data.result, index); + this.workers.push(worker); + this.busy.push(false); + } + } + reload(jerb) { + const jobKey = stringifyJob(jerb); + const promise = new Promise((resolve, reject) => { + if (this.callbacks.has(jobKey)) + this.callbacks.get(jobKey)?.push([resolve, reject]); + else + this.callbacks.set(jobKey, [[resolve, reject]]); + }); + if (this.reloadSet.has(jobKey)) + return promise; + this.reloadSet.add(jobKey); + const workerId = this.nextAvailableWorker(); + if (workerId !== void 0) { + this.send(jerb, workerId); + } else { + this.reloadQueue.push(jerb); + } + return promise; + } + finish(jerb, data2, index) { + const jobKey = stringifyJob(jerb); + const calls = [].concat(this.callbacks.get(jobKey) ?? []); + this.reloadSet.delete(jobKey); + this.callbacks.delete(jobKey); + this.busy[index] = false; + const job = this.reloadQueue.shift(); + if (job !== void 0) + this.send(job, index); + if ("$error" in data2) { + for (const [_18, reject] of calls) + reject(data2["$error"]); + } else { + for (const [callback, _18] of calls) + callback(data2); + } + } + async send(job, workerId) { + if (job.type == "paths") { + const payload = { + settings: this.cache.settings, + spacesCache: this.cache.spacesIndex, + pathCache: this.cache.spaceManager.allCaches(), + oldMetadata: this.cache.pathsIndex + }; + this.message(workerId, { + job, + payload + }); + this.busy[workerId] = true; + return; + } + if (job.type == "path") { + const spaceState = this.cache.spacesIndex.get(job.path); + const cachePath = spaceState?.defPath && spaceState.type == "folder" ? spaceState?.defPath : job.path; + const pathMetadata = await this.cache.spaceManager.readPathCache(cachePath) ?? await this.cache.spaceManager.readPathCache(job.path); + const label = pathMetadata?.label; + const parent = await this.cache.spaceManager.parentPathForPath(job.path); + const type = spaceState ? "space" : "file"; + const subtype = spaceState ? spaceState.type : pathMetadata.subtype; + const payload = { + path: job.path, + settings: this.cache.settings, + spacesCache: this.cache.spacesIndex, + pathMetadata, + label, + parent, + type, + subtype, + oldMetadata: this.cache.pathsIndex.get(job.path) + }; + this.message(workerId, { + job, + payload + }); + this.busy[workerId] = true; + return; + } + if (job.type == "context") { + const space2 = this.cache.spacesIndex.get(job.path)?.space; + if (!space2 || !space2.path) { + this.message(workerId, { + job, + payload: { + space: space2, + mdb: null, + paths: [...this.cache.spacesMap.getInverse(job.path)], + oldCache: this.cache.contextsIndex.get(job.path) + } + }); + this.busy[workerId] = true; + return; + } + const dbExists = await this.cache.spaceManager.spaceInitiated(space2.path); + this.cache.spaceManager.readAllTables(space2.path).then((mdb) => { + this.message(workerId, { + job, + payload: { + space: space2, + mdb, + paths: [...this.cache.spacesMap.getInverse(job.path)], + oldCache: this.cache.contextsIndex.get(job.path), + dbExists + } + }); + this.busy[workerId] = true; + }); + return; + } + if (job.type == "frames") { + const space2 = this.cache.spacesIndex.get(job.path)?.space; + if (!space2) { + this.message(workerId, { + job, + payload: { + space: space2, + mdb: null, + oldCache: this.cache.framesIndex.get(job.path) + } + }); + this.busy[workerId] = true; + return; + } + this.cache.spaceManager.readAllFrames(space2.path).then((mdb) => { + this.message(workerId, { + job, + payload: { + space: space2, + mdb, + oldCache: this.cache.framesIndex.get(job.path) + } + }); + this.busy[workerId] = true; + }); + return; + } + } + message(workerId, message) { + this.workers[workerId].postMessage( + message + ); + } + nextAvailableWorker() { + const index = this.busy.indexOf(false); + return index == -1 ? void 0 : index; + } +}; + +// src/core/superstate/workers/runner/runner.worker.ts +function Worker3() { + return inlineWorker(`"use strict";var z6=Object.create;var nh=Object.defineProperty;var W6=Object.getOwnPropertyDescriptor;var V6=Object.getOwnPropertyNames;var Y6=Object.getPrototypeOf,H6=Object.prototype.hasOwnProperty;var un=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),G6=(e,r)=>{for(var t in r)nh(e,t,{get:r[t],enumerable:!0})},$6=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of V6(r))!H6.call(e,i)&&i!==t&&nh(e,i,{get:()=>r[i],enumerable:!(n=W6(r,i))||n.enumerable});return e};var ci=(e,r,t)=>(t=e!=null?z6(Y6(e)):{},$6(r||!e||!e.__esModule?nh(t,"default",{value:e,enumerable:!0}):t,e));var _x=un((Dh,Us)=>{(function(e,r){typeof Dh=="object"&&typeof Us<"u"?Us.exports=r():typeof define=="function"&&define.amd?define(r):e.moment=r()})(Dh,function(){"use strict";var e;function r(){return e.apply(null,arguments)}function t(g){e=g}function n(g){return g instanceof Array||Object.prototype.toString.call(g)==="[object Array]"}function i(g){return g!=null&&Object.prototype.toString.call(g)==="[object Object]"}function a(g,N){return Object.prototype.hasOwnProperty.call(g,N)}function s(g){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(g).length===0;var N;for(N in g)if(a(g,N))return!1;return!0}function c(g){return g===void 0}function f(g){return typeof g=="number"||Object.prototype.toString.call(g)==="[object Number]"}function o(g){return g instanceof Date||Object.prototype.toString.call(g)==="[object Date]"}function u(g,N){var P=[],z,G=g.length;for(z=0;z>>0,z;for(z=0;z0)for(P=0;P=0;return(se?P?"+":"":"-")+Math.pow(10,Math.max(0,G)).toString().substr(1)+z}var U=/(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,oe=/(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,me={},ie={};function H(g,N,P,z){var G=z;typeof z=="string"&&(G=function(){return this[z]()}),g&&(ie[g]=G),N&&(ie[N[0]]=function(){return j(G.apply(this,arguments),N[1],N[2])}),P&&(ie[P]=function(){return this.localeData().ordinal(G.apply(this,arguments),g)})}function ce(g){return g.match(/\\[[\\s\\S]/)?g.replace(/^\\[|\\]$/g,""):g.replace(/\\\\/g,"")}function Me(g){var N=g.match(U),P,z;for(P=0,z=N.length;P=0&&oe.test(g);)g=g.replace(oe,z),oe.lastIndex=0,P-=1;return g}var Se={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function xe(g){var N=this._longDateFormat[g],P=this._longDateFormat[g.toUpperCase()];return N||!P?N:(this._longDateFormat[g]=P.match(U).map(function(z){return z==="MMMM"||z==="MM"||z==="DD"||z==="dddd"?z.slice(1):z}).join(""),this._longDateFormat[g])}var be="Invalid date";function De(){return this._invalidDate}var Ae="%d",ze=/\\d{1,2}/;function Ze(g){return this._ordinal.replace("%d",g)}var K={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function te(g,N,P,z){var G=this._relativeTime[P];return k(G)?G(g,N,P,z):G.replace(/%d/i,g)}function ye(g,N){var P=this._relativeTime[g>0?"future":"past"];return k(P)?P(N):P.replace(/%s/i,N)}var ee={};function ne(g,N){var P=g.toLowerCase();ee[P]=ee[P+"s"]=ee[N]=g}function ue(g){return typeof g=="string"?ee[g]||ee[g.toLowerCase()]:void 0}function Ee(g){var N={},P,z;for(z in g)a(g,z)&&(P=ue(z),P&&(N[P]=g[z]));return N}var Ce={};function Le(g,N){Ce[g]=N}function Ie(g){var N=[],P;for(P in g)a(g,P)&&N.push({unit:P,priority:Ce[P]});return N.sort(function(z,G){return z.priority-G.priority}),N}function sr(g){return g%4===0&&g%100!==0||g%400===0}function ir(g){return g<0?Math.ceil(g)||0:Math.floor(g)}function Xe(g){var N=+g,P=0;return N!==0&&isFinite(N)&&(P=ir(N)),P}function Or(g,N){return function(P){return P!=null?(le(this,g,P),r.updateOffset(this,N),this):re(this,g)}}function re(g,N){return g.isValid()?g._d["get"+(g._isUTC?"UTC":"")+N]():NaN}function le(g,N,P){g.isValid()&&!isNaN(P)&&(N==="FullYear"&&sr(g.year())&&g.month()===1&&g.date()===29?(P=Xe(P),g._d["set"+(g._isUTC?"UTC":"")+N](P,g.month(),Ha(P,g.month()))):g._d["set"+(g._isUTC?"UTC":"")+N](P))}function we(g){return g=ue(g),k(this[g])?this[g]():this}function Oe(g,N){if(typeof g=="object"){g=Ee(g);var P=Ie(g),z,G=P.length;for(z=0;z68?1900:2e3)};var Fu=Or("FullYear",!0);function rm(){return sr(this.year())}function Pf(g,N,P,z,G,se,Te){var mr;return g<100&&g>=0?(mr=new Date(g+400,N,P,z,G,se,Te),isFinite(mr.getFullYear())&&mr.setFullYear(g)):mr=new Date(g,N,P,z,G,se,Te),mr}function Ga(g){var N,P;return g<100&&g>=0?(P=Array.prototype.slice.call(arguments),P[0]=g+400,N=new Date(Date.UTC.apply(null,P)),isFinite(N.getUTCFullYear())&&N.setUTCFullYear(g)):N=new Date(Date.UTC.apply(null,arguments)),N}function $a(g,N,P){var z=7+N-P,G=(7+Ga(g,0,z).getUTCDay()-N)%7;return-G+z-1}function kf(g,N,P,z,G){var se=(7+P-z)%7,Te=$a(g,z,G),mr=1+7*(N-1)+se+Te,Tr,et;return mr<=0?(Tr=g-1,et=Xi(Tr)+mr):mr>Xi(g)?(Tr=g+1,et=mr-Xi(g)):(Tr=g,et=mr),{year:Tr,dayOfYear:et}}function Za(g,N,P){var z=$a(g.year(),N,P),G=Math.floor((g.dayOfYear()-z-1)/7)+1,se,Te;return G<1?(Te=g.year()-1,se=G+Vn(Te,N,P)):G>Vn(g.year(),N,P)?(se=G-Vn(g.year(),N,P),Te=g.year()+1):(Te=g.year(),se=G),{week:se,year:Te}}function Vn(g,N,P){var z=$a(g,N,P),G=$a(g+1,N,P);return(Xi(g)-z+G)/7}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),ne("week","w"),ne("isoWeek","W"),Le("week",5),Le("isoWeek",5),rr("w",Q),rr("ww",Q,_e),rr("W",Q),rr("WW",Q,_e),va(["w","ww","W","WW"],function(g,N,P,z){N[z.substr(0,1)]=Xe(g)});function Ou(g){return Za(g,this._week.dow,this._week.doy).week}var Qa={dow:0,doy:6};function Rf(){return this._week.dow}function Lf(){return this._week.doy}function tm(g){var N=this.localeData().week(this);return g==null?N:this.add((g-N)*7,"d")}function qf(g){var N=Za(this,1,4).week;return g==null?N:this.add((g-N)*7,"d")}H("d",0,"do","day"),H("dd",0,0,function(g){return this.localeData().weekdaysMin(this,g)}),H("ddd",0,0,function(g){return this.localeData().weekdaysShort(this,g)}),H("dddd",0,0,function(g){return this.localeData().weekdays(this,g)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),ne("day","d"),ne("weekday","e"),ne("isoWeekday","E"),Le("day",11),Le("weekday",11),Le("isoWeekday",11),rr("d",Q),rr("e",Q),rr("E",Q),rr("dd",function(g,N){return N.weekdaysMinRegex(g)}),rr("ddd",function(g,N){return N.weekdaysShortRegex(g)}),rr("dddd",function(g,N){return N.weekdaysRegex(g)}),va(["dd","ddd","dddd"],function(g,N,P,z){var G=P._locale.weekdaysParse(g,z,P._strict);G!=null?N.d=G:x(P).invalidWeekday=g}),va(["d","e","E"],function(g,N,P,z){N[z]=Xe(g)});function Uf(g,N){return typeof g!="string"?g:isNaN(g)?(g=N.weekdaysParse(g),typeof g=="number"?g:null):parseInt(g,10)}function zf(g,N){return typeof g=="string"?N.weekdaysParse(g)%7||7:isNaN(g)?null:g}function ps(g,N){return g.slice(N,7).concat(g.slice(0,N))}var nm="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Wf="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),im="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Vf=Ci,am=Ci,om=Ci;function sm(g,N){var P=n(this._weekdays)?this._weekdays:this._weekdays[g&&g!==!0&&this._weekdays.isFormat.test(N)?"format":"standalone"];return g===!0?ps(P,this._week.dow):g?P[g.day()]:P}function um(g){return g===!0?ps(this._weekdaysShort,this._week.dow):g?this._weekdaysShort[g.day()]:this._weekdaysShort}function Bu(g){return g===!0?ps(this._weekdaysMin,this._week.dow):g?this._weekdaysMin[g.day()]:this._weekdaysMin}function fm(g,N,P){var z,G,se,Te=g.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],z=0;z<7;++z)se=d([2e3,1]).day(z),this._minWeekdaysParse[z]=this.weekdaysMin(se,"").toLocaleLowerCase(),this._shortWeekdaysParse[z]=this.weekdaysShort(se,"").toLocaleLowerCase(),this._weekdaysParse[z]=this.weekdays(se,"").toLocaleLowerCase();return P?N==="dddd"?(G=pt.call(this._weekdaysParse,Te),G!==-1?G:null):N==="ddd"?(G=pt.call(this._shortWeekdaysParse,Te),G!==-1?G:null):(G=pt.call(this._minWeekdaysParse,Te),G!==-1?G:null):N==="dddd"?(G=pt.call(this._weekdaysParse,Te),G!==-1||(G=pt.call(this._shortWeekdaysParse,Te),G!==-1)?G:(G=pt.call(this._minWeekdaysParse,Te),G!==-1?G:null)):N==="ddd"?(G=pt.call(this._shortWeekdaysParse,Te),G!==-1||(G=pt.call(this._weekdaysParse,Te),G!==-1)?G:(G=pt.call(this._minWeekdaysParse,Te),G!==-1?G:null)):(G=pt.call(this._minWeekdaysParse,Te),G!==-1||(G=pt.call(this._weekdaysParse,Te),G!==-1)?G:(G=pt.call(this._shortWeekdaysParse,Te),G!==-1?G:null))}function lm(g,N,P){var z,G,se;if(this._weekdaysParseExact)return fm.call(this,g,N,P);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),z=0;z<7;z++){if(G=d([2e3,1]).day(z),P&&!this._fullWeekdaysParse[z]&&(this._fullWeekdaysParse[z]=new RegExp("^"+this.weekdays(G,"").replace(".","\\\\.?")+"$","i"),this._shortWeekdaysParse[z]=new RegExp("^"+this.weekdaysShort(G,"").replace(".","\\\\.?")+"$","i"),this._minWeekdaysParse[z]=new RegExp("^"+this.weekdaysMin(G,"").replace(".","\\\\.?")+"$","i")),this._weekdaysParse[z]||(se="^"+this.weekdays(G,"")+"|^"+this.weekdaysShort(G,"")+"|^"+this.weekdaysMin(G,""),this._weekdaysParse[z]=new RegExp(se.replace(".",""),"i")),P&&N==="dddd"&&this._fullWeekdaysParse[z].test(g))return z;if(P&&N==="ddd"&&this._shortWeekdaysParse[z].test(g))return z;if(P&&N==="dd"&&this._minWeekdaysParse[z].test(g))return z;if(!P&&this._weekdaysParse[z].test(g))return z}}function cm(g){if(!this.isValid())return g!=null?this:NaN;var N=this._isUTC?this._d.getUTCDay():this._d.getDay();return g!=null?(g=Uf(g,this.localeData()),this.add(g-N,"d")):N}function pm(g){if(!this.isValid())return g!=null?this:NaN;var N=(this.day()+7-this.localeData()._week.dow)%7;return g==null?N:this.add(g-N,"d")}function mm(g){if(!this.isValid())return g!=null?this:NaN;if(g!=null){var N=zf(g,this.localeData());return this.day(this.day()%7?N:N-7)}else return this.day()||7}function ht(g){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Iu.call(this),g?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Vf),this._weekdaysStrictRegex&&g?this._weekdaysStrictRegex:this._weekdaysRegex)}function mt(g){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Iu.call(this),g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=am),this._weekdaysShortStrictRegex&&g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function dm(g){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Iu.call(this),g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=om),this._weekdaysMinStrictRegex&&g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Iu(){function g(sn,si){return si.length-sn.length}var N=[],P=[],z=[],G=[],se,Te,mr,Tr,et;for(se=0;se<7;se++)Te=d([2e3,1]).day(se),mr=nn(this.weekdaysMin(Te,"")),Tr=nn(this.weekdaysShort(Te,"")),et=nn(this.weekdays(Te,"")),N.push(mr),P.push(Tr),z.push(et),G.push(mr),G.push(Tr),G.push(et);N.sort(g),P.sort(g),z.sort(g),G.sort(g),this._weekdaysRegex=new RegExp("^("+G.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+z.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+P.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+N.join("|")+")","i")}function Pu(){return this.hours()%12||12}function hm(){return this.hours()||24}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Pu),H("k",["kk",2],0,hm),H("hmm",0,0,function(){return""+Pu.apply(this)+j(this.minutes(),2)}),H("hmmss",0,0,function(){return""+Pu.apply(this)+j(this.minutes(),2)+j(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+j(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+j(this.minutes(),2)+j(this.seconds(),2)});function Yf(g,N){H(g,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),N)})}Yf("a",!0),Yf("A",!1),ne("hour","h"),Le("hour",13);function Hf(g,N){return N._meridiemParse}rr("a",Hf),rr("A",Hf),rr("H",Q),rr("h",Q),rr("k",Q),rr("HH",Q,_e),rr("hh",Q,_e),rr("kk",Q,_e),rr("hmm",ve),rr("hmmss",Be),rr("Hmm",ve),rr("Hmmss",Be),nt(["H","HH"],At),nt(["k","kk"],function(g,N,P){var z=Xe(g);N[At]=z===24?0:z}),nt(["a","A"],function(g,N,P){P._isPm=P._locale.isPM(g),P._meridiem=g}),nt(["h","hh"],function(g,N,P){N[At]=Xe(g),x(P).bigHour=!0}),nt("hmm",function(g,N,P){var z=g.length-2;N[At]=Xe(g.substr(0,z)),N[gn]=Xe(g.substr(z)),x(P).bigHour=!0}),nt("hmmss",function(g,N,P){var z=g.length-4,G=g.length-2;N[At]=Xe(g.substr(0,z)),N[gn]=Xe(g.substr(z,2)),N[Wn]=Xe(g.substr(G)),x(P).bigHour=!0}),nt("Hmm",function(g,N,P){var z=g.length-2;N[At]=Xe(g.substr(0,z)),N[gn]=Xe(g.substr(z))}),nt("Hmmss",function(g,N,P){var z=g.length-4,G=g.length-2;N[At]=Xe(g.substr(0,z)),N[gn]=Xe(g.substr(z,2)),N[Wn]=Xe(g.substr(G))});function Gf(g){return(g+"").toLowerCase().charAt(0)==="p"}var vm=/[ap]\\.?m?\\.?/i,Wt=Or("Hours",!0);function ku(g,N,P){return g>11?P?"pm":"PM":P?"am":"AM"}var Ji={calendar:q,longDateFormat:Se,invalidDate:be,ordinal:Ae,dayOfMonthOrdinalParse:ze,relativeTime:K,months:Cu,monthsShort:us,week:Qa,weekdays:nm,weekdaysMin:im,weekdaysShort:Wf,meridiemParse:vm},vt={},xa={},en;function $f(g,N){var P,z=Math.min(g.length,N.length);for(P=0;P0;){if(G=Mo(se.slice(0,P).join("-")),G)return G;if(z&&z.length>=P&&$f(se,z)>=P-1)break;P--}N++}return en}function Qf(g){return g.match("^[^/\\\\\\\\]*$")!=null}function Mo(g){var N=null,P;if(vt[g]===void 0&&typeof Us<"u"&&Us&&Us.exports&&Qf(g))try{N=en._abbr,P=require,P("./locale/"+g),Ti(N)}catch{vt[g]=null}return vt[g]}function Ti(g,N){var P;return g&&(c(N)?P=Tt(g):P=an(g,N),P?en=P:typeof console<"u"&&console.warn&&console.warn("Locale "+g+" not found. Did you forget to load it?")),en._abbr}function an(g,N){if(N!==null){var P,z=Ji;if(N.abbr=g,vt[g]!=null)_("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),z=vt[g]._config;else if(N.parentLocale!=null)if(vt[N.parentLocale]!=null)z=vt[N.parentLocale]._config;else if(P=Mo(N.parentLocale),P!=null)z=P._config;else return xa[N.parentLocale]||(xa[N.parentLocale]=[]),xa[N.parentLocale].push({name:g,config:N}),null;return vt[g]=new $(Y(z,N)),xa[g]&&xa[g].forEach(function(G){an(G.name,G.config)}),Ti(g),vt[g]}else return delete vt[g],null}function gm(g,N){if(N!=null){var P,z,G=Ji;vt[g]!=null&&vt[g].parentLocale!=null?vt[g].set(Y(vt[g]._config,N)):(z=Mo(g),z!=null&&(G=z._config),N=Y(G,N),z==null&&(N.abbr=g),P=new $(N),P.parentLocale=vt[g],vt[g]=P),Ti(g)}else vt[g]!=null&&(vt[g].parentLocale!=null?(vt[g]=vt[g].parentLocale,g===Ti()&&Ti(g)):vt[g]!=null&&delete vt[g]);return vt[g]}function Tt(g){var N;if(g&&g._locale&&g._locale._abbr&&(g=g._locale._abbr),!g)return en;if(!n(g)){if(N=Mo(g),N)return N;g=[g]}return Zf(g)}function xm(){return V(vt)}function ms(g){var N,P=g._a;return P&&x(g).overflow===-2&&(N=P[En]<0||P[En]>11?En:P[Cn]<1||P[Cn]>Ha(P[zt],P[En])?Cn:P[At]<0||P[At]>24||P[At]===24&&(P[gn]!==0||P[Wn]!==0||P[Mi]!==0)?At:P[gn]<0||P[gn]>59?gn:P[Wn]<0||P[Wn]>59?Wn:P[Mi]<0||P[Mi]>999?Mi:-1,x(g)._overflowDayOfYear&&(NCn)&&(N=Cn),x(g)._overflowWeeks&&N===-1&&(N=Au),x(g)._overflowWeekday&&N===-1&&(N=Ya),x(g).overflow=N),g}var Ki=/^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,ds=/^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,Lu=/Z|[+-]\\d\\d(?::?\\d\\d)?/,ct=[["YYYYYY-MM-DD",/[+-]\\d{6}-\\d\\d-\\d\\d/],["YYYY-MM-DD",/\\d{4}-\\d\\d-\\d\\d/],["GGGG-[W]WW-E",/\\d{4}-W\\d\\d-\\d/],["GGGG-[W]WW",/\\d{4}-W\\d\\d/,!1],["YYYY-DDD",/\\d{4}-\\d{3}/],["YYYY-MM",/\\d{4}-\\d\\d/,!1],["YYYYYYMMDD",/[+-]\\d{10}/],["YYYYMMDD",/\\d{8}/],["GGGG[W]WWE",/\\d{4}W\\d{3}/],["GGGG[W]WW",/\\d{4}W\\d{2}/,!1],["YYYYDDD",/\\d{7}/],["YYYYMM",/\\d{6}/,!1],["YYYY",/\\d{4}/,!1]],ti=[["HH:mm:ss.SSSS",/\\d\\d:\\d\\d:\\d\\d\\.\\d+/],["HH:mm:ss,SSSS",/\\d\\d:\\d\\d:\\d\\d,\\d+/],["HH:mm:ss",/\\d\\d:\\d\\d:\\d\\d/],["HH:mm",/\\d\\d:\\d\\d/],["HHmmss.SSSS",/\\d\\d\\d\\d\\d\\d\\.\\d+/],["HHmmss,SSSS",/\\d\\d\\d\\d\\d\\d,\\d+/],["HHmmss",/\\d\\d\\d\\d\\d\\d/],["HHmm",/\\d\\d\\d\\d/],["HH",/\\d\\d/]],qu=/^\\/?Date\\((-?\\d+)/i,ym=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,Uu={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Xf(g){var N,P,z=g._i,G=Ki.exec(z)||ds.exec(z),se,Te,mr,Tr,et=ct.length,sn=ti.length;if(G){for(x(g).iso=!0,N=0,P=et;NXi(Te)||g._dayOfYear===0)&&(x(g)._overflowDayOfYear=!0),P=Ga(Te,0,g._dayOfYear),g._a[En]=P.getUTCMonth(),g._a[Cn]=P.getUTCDate()),N=0;N<3&&g._a[N]==null;++N)g._a[N]=z[N]=G[N];for(;N<7;N++)g._a[N]=z[N]=g._a[N]==null?N===2?1:0:g._a[N];g._a[At]===24&&g._a[gn]===0&&g._a[Wn]===0&&g._a[Mi]===0&&(g._nextDay=!0,g._a[At]=0),g._d=(g._useUTC?Ga:Pf).apply(null,z),se=g._useUTC?g._d.getUTCDay():g._d.getDay(),g._tzm!=null&&g._d.setUTCMinutes(g._d.getUTCMinutes()-g._tzm),g._nextDay&&(g._a[At]=24),g._w&&typeof g._w.d<"u"&&g._w.d!==se&&(x(g).weekdayMismatch=!0)}}function el(g){var N,P,z,G,se,Te,mr,Tr,et;N=g._w,N.GG!=null||N.W!=null||N.E!=null?(se=1,Te=4,P=ya(N.GG,g._a[zt],Za(dt(),1,4).year),z=ya(N.W,1),G=ya(N.E,1),(G<1||G>7)&&(Tr=!0)):(se=g._locale._week.dow,Te=g._locale._week.doy,et=Za(dt(),se,Te),P=ya(N.gg,g._a[zt],et.year),z=ya(N.w,et.week),N.d!=null?(G=N.d,(G<0||G>6)&&(Tr=!0)):N.e!=null?(G=N.e+se,(N.e<0||N.e>6)&&(Tr=!0)):G=se),z<1||z>Vn(P,se,Te)?x(g)._overflowWeeks=!0:Tr!=null?x(g)._overflowWeekday=!0:(mr=kf(P,z,G,se,Te),g._a[zt]=mr.year,g._dayOfYear=mr.dayOfYear)}r.ISO_8601=function(){},r.RFC_2822=function(){};function Wu(g){if(g._f===r.ISO_8601){Xf(g);return}if(g._f===r.RFC_2822){Kf(g);return}g._a=[],x(g).empty=!0;var N=""+g._i,P,z,G,se,Te,mr=N.length,Tr=0,et,sn;for(G=ge(g._f,g._locale).match(U)||[],sn=G.length,P=0;P0&&x(g).unusedInput.push(Te),N=N.slice(N.indexOf(z)+z.length),Tr+=z.length),ie[se]?(z?x(g).empty=!1:x(g).unusedTokens.push(se),Nu(se,z,g)):g._strict&&!z&&x(g).unusedTokens.push(se);x(g).charsLeftOver=mr-Tr,N.length>0&&x(g).unusedInput.push(N),g._a[At]<=12&&x(g).bigHour===!0&&g._a[At]>0&&(x(g).bigHour=void 0),x(g).parsedDateParts=g._a.slice(0),x(g).meridiem=g._meridiem,g._a[At]=Vu(g._locale,g._a[At],g._meridiem),et=x(g).era,et!==null&&(g._a[zt]=g._locale.erasConvertYear(et,g._a[zt])),_o(g),ms(g)}function Vu(g,N,P){var z;return P==null?N:g.meridiemHour!=null?g.meridiemHour(N,P):(g.isPM!=null&&(z=g.isPM(P),z&&N<12&&(N+=12),!z&&N===12&&(N=0)),N)}function Yu(g){var N,P,z,G,se,Te,mr=!1,Tr=g._f.length;if(Tr===0){x(g).invalidFormat=!0,g._d=new Date(NaN);return}for(G=0;Gthis?this:g:w()});function nl(g,N){var P,z;if(N.length===1&&n(N[0])&&(N=N[0]),!N.length)return dt();for(P=N[0],z=1;zthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Fe(){if(!c(this._isDSTShifted))return this._isDSTShifted;var g={},N;return A(g,this),g=cn(g),g._a?(N=g._isUTC?d(g._a):dt(g._a),this._isDSTShifted=this.isValid()&&_m(g._a,N.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Ne(){return this.isValid()?!this._isUTC:!1}function nr(){return this.isValid()?this._isUTC:!1}function Nr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var jr=/^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,Pt=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function kr(g,N){var P=g,z=null,G,se,Te;return Yn(g)?P={ms:g._milliseconds,d:g._days,M:g._months}:f(g)||!isNaN(+g)?(P={},N?P[N]=+g:P.milliseconds=+g):(z=jr.exec(g))?(G=z[1]==="-"?-1:1,P={y:0,d:Xe(z[Cn])*G,h:Xe(z[At])*G,m:Xe(z[gn])*G,s:Xe(z[Wn])*G,ms:Xe(Ka(z[Mi]*1e3))*G}):(z=Pt.exec(g))?(G=z[1]==="-"?-1:1,P={y:Fi(z[2],G),M:Fi(z[3],G),w:Fi(z[4],G),d:Fi(z[5],G),h:Fi(z[6],G),m:Fi(z[7],G),s:Fi(z[8],G)}):P==null?P={}:typeof P=="object"&&("from"in P||"to"in P)&&(Te=Mn(dt(P.from),dt(P.to)),P={},P.ms=Te.milliseconds,P.M=Te.months),se=new To(P),Yn(g)&&a(g,"_locale")&&(se._locale=g._locale),Yn(g)&&a(g,"_isValid")&&(se._isValid=g._isValid),se}kr.fn=To.prototype,kr.invalid=Gu;function Fi(g,N){var P=g&&parseFloat(g.replace(",","."));return(isNaN(P)?0:P)*N}function al(g,N){var P={};return P.months=N.month()-g.month()+(N.year()-g.year())*12,g.clone().add(P.months,"M").isAfter(N)&&--P.months,P.milliseconds=+N-+g.clone().add(P.months,"M"),P}function Mn(g,N){var P;return g.isValid()&&N.isValid()?(N=xn(N,g),g.isBefore(N)?P=al(g,N):(P=al(N,g),P.milliseconds=-P.milliseconds,P.months=-P.months),P):{milliseconds:0,months:0}}function Fo(g,N){return function(P,z){var G,se;return z!==null&&!isNaN(+z)&&(_(N,"moment()."+N+"(period, number) is deprecated. Please use moment()."+N+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),se=P,P=z,z=se),G=kr(P,z),ol(this,G,g),this}}function ol(g,N,P,z){var G=N._milliseconds,se=Ka(N._days),Te=Ka(N._months);!g.isValid()||(z=z??!0,Te&&Qi(g,re(g,"Month")+Te*P),se&&le(g,"Date",re(g,"Date")+se*P),G&&g._d.setTime(g._d.valueOf()+G*P),z&&r.updateOffset(g,se||Te))}var ja=Fo(1,"add"),gs=Fo(-1,"subtract");function Oo(g){return typeof g=="string"||g instanceof String}function at(g){return S(g)||o(g)||Oo(g)||f(g)||sl(g)||km(g)||g===null||g===void 0}function km(g){var N=i(g)&&!s(g),P=!1,z=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],G,se,Te=z.length;for(G=0;GP.valueOf():P.valueOf()9999?pe(P,N?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):k(Date.prototype.toISOString)?N?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",pe(P,"Z")):pe(P,N?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function wa(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var g="moment",N="",P,z,G,se;return this.isLocal()||(g=this.utcOffset()===0?"moment.utc":"moment.parseZone",N="Z"),P="["+g+'("]',z=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",G="-MM-DD[T]HH:mm:ss.SSS",se=N+'[")]',this.format(P+z+G+se)}function Ds(g){g||(g=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var N=pe(this,g);return this.localeData().postformat(N)}function Um(g,N){return this.isValid()&&(S(g)&&g.isValid()||dt(g).isValid())?kr({to:this,from:g}).locale(this.locale()).humanize(!N):this.localeData().invalidDate()}function zm(g){return this.from(dt(),g)}function Wm(g,N){return this.isValid()&&(S(g)&&g.isValid()||dt(g).isValid())?kr({from:this,to:g}).locale(this.locale()).humanize(!N):this.localeData().invalidDate()}function Ss(g){return this.to(dt(),g)}function Io(g){var N;return g===void 0?this._locale._abbr:(N=Tt(g),N!=null&&(this._locale=N),this)}var Ns=F("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(g){return g===void 0?this.localeData():this.locale(g)});function pl(){return this._locale}var Po=1e3,eo=60*Po,As=60*eo,Ft=(365*400+97)*24*As;function Et(g,N){return(g%N+N)%N}function ml(g,N,P){return g<100&&g>=0?new Date(g+400,N,P)-Ft:new Date(g,N,P).valueOf()}function dl(g,N,P){return g<100&&g>=0?Date.UTC(g+400,N,P)-Ft:Date.UTC(g,N,P)}function hl(g){var N,P;if(g=ue(g),g===void 0||g==="millisecond"||!this.isValid())return this;switch(P=this._isUTC?dl:ml,g){case"year":N=P(this.year(),0,1);break;case"quarter":N=P(this.year(),this.month()-this.month()%3,1);break;case"month":N=P(this.year(),this.month(),1);break;case"week":N=P(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":N=P(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":N=P(this.year(),this.month(),this.date());break;case"hour":N=this._d.valueOf(),N-=Et(N+(this._isUTC?0:this.utcOffset()*eo),As);break;case"minute":N=this._d.valueOf(),N-=Et(N,eo);break;case"second":N=this._d.valueOf(),N-=Et(N,Po);break}return this._d.setTime(N),r.updateOffset(this,!0),this}function Vm(g){var N,P;if(g=ue(g),g===void 0||g==="millisecond"||!this.isValid())return this;switch(P=this._isUTC?dl:ml,g){case"year":N=P(this.year()+1,0,1)-1;break;case"quarter":N=P(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":N=P(this.year(),this.month()+1,1)-1;break;case"week":N=P(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":N=P(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":N=P(this.year(),this.month(),this.date()+1)-1;break;case"hour":N=this._d.valueOf(),N+=As-Et(N+(this._isUTC?0:this.utcOffset()*eo),As)-1;break;case"minute":N=this._d.valueOf(),N+=eo-Et(N,eo)-1;break;case"second":N=this._d.valueOf(),N+=Po-Et(N,Po)-1;break}return this._d.setTime(N),r.updateOffset(this,!0),this}function $u(){return this._d.valueOf()-(this._offset||0)*6e4}function ko(){return Math.floor(this.valueOf()/1e3)}function Zu(){return new Date(this.valueOf())}function ro(){var g=this;return[g.year(),g.month(),g.date(),g.hour(),g.minute(),g.second(),g.millisecond()]}function Ro(){var g=this;return{years:g.year(),months:g.month(),date:g.date(),hours:g.hours(),minutes:g.minutes(),seconds:g.seconds(),milliseconds:g.milliseconds()}}function Lo(){return this.isValid()?this.toISOString():null}function Es(){return y(this)}function to(){return p({},x(this))}function Ym(){return x(this).overflow}function Hm(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),rr("N",Ir),rr("NN",Ir),rr("NNN",Ir),rr("NNNN",Qm),rr("NNNNN",Xm),nt(["N","NN","NNN","NNNN","NNNNN"],function(g,N,P,z){var G=P._locale.erasParse(g,z,P._strict);G?x(P).era=G:x(P).invalidEra=g}),rr("y",_t),rr("yy",_t),rr("yyy",_t),rr("yyyy",_t),rr("yo",Jm),nt(["y","yy","yyy","yyyy"],zt),nt(["yo"],function(g,N,P,z){var G;P._locale._eraYearOrdinalRegex&&(G=g.match(P._locale._eraYearOrdinalRegex)),P._locale.eraYearOrdinalParse?N[zt]=P._locale.eraYearOrdinalParse(g,G):N[zt]=parseInt(g,10)});function Gm(g,N){var P,z,G,se=this._eras||Tt("en")._eras;for(P=0,z=se.length;P=0)return se[z]}function Zm(g,N){var P=g.since<=g.until?1:-1;return N===void 0?r(g.since).year():r(g.since).year()+(N-g.offset)*P}function Cs(){var g,N,P,z=this.localeData().eras();for(g=0,N=z.length;gse&&(N=se),nd.call(this,g,N,P,z,G))}function nd(g,N,P,z,G){var se=kf(g,N,P,z,G),Te=Ga(se.year,0,se.dayOfYear);return this.year(Te.getUTCFullYear()),this.month(Te.getUTCMonth()),this.date(Te.getUTCDate()),this}H("Q",0,"Qo","quarter"),ne("quarter","Q"),Le("quarter",7),rr("Q",ke),nt("Q",function(g,N){N[En]=(Xe(g)-1)*3});function id(g){return g==null?Math.ceil((this.month()+1)/3):this.month((g-1)*3+this.month()%3)}H("D",["DD",2],"Do","date"),ne("date","D"),Le("date",9),rr("D",Q),rr("DD",Q,_e),rr("Do",function(g,N){return g?N._dayOfMonthOrdinalParse||N._ordinalParse:N._dayOfMonthOrdinalParseLenient}),nt(["D","DD"],Cn),nt("Do",function(g,N){N[Cn]=Xe(g.match(Q)[0])});var xl=Or("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),ne("dayOfYear","DDD"),Le("dayOfYear",4),rr("DDD",er),rr("DDDD",Pe),nt(["DDD","DDDD"],function(g,N,P){P._dayOfYear=Xe(g)});function Ii(g){var N=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return g==null?N:this.add(g-N,"d")}H("m",["mm",2],0,"minute"),ne("minute","m"),Le("minute",14),rr("m",Q),rr("mm",Q,_e),nt(["m","mm"],gn);var ad=Or("Minutes",!1);H("s",["ss",2],0,"second"),ne("second","s"),Le("second",15),rr("s",Q),rr("ss",Q,_e),nt(["s","ss"],Wn);var od=Or("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return this.millisecond()*10}),H(0,["SSSSS",5],0,function(){return this.millisecond()*100}),H(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),H(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),H(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),H(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),ne("millisecond","ms"),Le("millisecond",16),rr("S",er,ke),rr("SS",er,_e),rr("SSS",er,Pe);var ta,yl;for(ta="SSSS";ta.length<=9;ta+="S")rr(ta,_t);function sd(g,N){N[Mi]=Xe(("0."+g)*1e3)}for(ta="S";ta.length<=9;ta+="S")nt(ta,sd);yl=Or("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");function Da(){return this._isUTC?"UTC":""}function ud(){return this._isUTC?"Coordinated Universal Time":""}var Ye=E.prototype;Ye.add=ja,Ye.calendar=Lm,Ye.clone=qm,Ye.diff=ll,Ye.endOf=Vm,Ye.format=Ds,Ye.from=Um,Ye.fromNow=zm,Ye.to=Wm,Ye.toNow=Ss,Ye.get=we,Ye.invalidAt=Ym,Ye.isAfter=ys,Ye.isBefore=ra,Ye.isBetween=bs,Ye.isSame=ul,Ye.isSameOrAfter=ws,Ye.isSameOrBefore=fl,Ye.isValid=Es,Ye.lang=Ns,Ye.locale=Io,Ye.localeData=pl,Ye.max=Sm,Ye.min=tl,Ye.parsingFlags=to,Ye.set=Oe,Ye.startOf=hl,Ye.subtract=gs,Ye.toArray=ro,Ye.toObject=Ro,Ye.toDate=Zu,Ye.toISOString=Bo,Ye.inspect=wa,typeof Symbol<"u"&&Symbol.for!=null&&(Ye[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Ye.toJSON=Lo,Ye.toString=cl,Ye.unix=ko,Ye.valueOf=$u,Ye.creationData=Hm,Ye.eraName=Cs,Ye.eraNarrow=qo,Ye.eraAbbr=vl,Ye.eraYear=Z,Ye.year=Fu,Ye.isLeapYear=rm,Ye.weekYear=Km,Ye.isoWeekYear=jm,Ye.quarter=Ye.quarters=id,Ye.month=_i,Ye.daysInMonth=cs,Ye.week=Ye.weeks=tm,Ye.isoWeek=Ye.isoWeeks=qf,Ye.weeksInYear=Bi,Ye.weeksInWeekYear=td,Ye.isoWeeksInYear=ed,Ye.isoWeeksInISOWeekYear=rd,Ye.date=xl,Ye.day=Ye.days=cm,Ye.weekday=pm,Ye.isoWeekday=mm,Ye.dayOfYear=Ii,Ye.hour=Ye.hours=Wt,Ye.minute=Ye.minutes=ad,Ye.second=Ye.seconds=od,Ye.millisecond=Ye.milliseconds=yl,Ye.utcOffset=Fm,Ye.utc=Bm,Ye.local=Im,Ye.parseZone=Pm,Ye.hasAlignedHourOffset=ea,Ye.isDST=de,Ye.isLocal=Ne,Ye.isUtcOffset=nr,Ye.isUtc=Nr,Ye.isUTC=Nr,Ye.zoneAbbr=Da,Ye.zoneName=ud,Ye.dates=F("dates accessor is deprecated. Use date instead.",xl),Ye.months=F("months accessor is deprecated. Use month instead",_i),Ye.years=F("years accessor is deprecated. Use year instead",Fu),Ye.zone=F("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Om),Ye.isDSTShifted=F("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Fe);function Hn(g){return dt(g*1e3)}function fd(){return dt.apply(null,arguments).parseZone()}function bl(g){return g}var Qr=$.prototype;Qr.calendar=R,Qr.longDateFormat=xe,Qr.invalidDate=De,Qr.ordinal=Ze,Qr.preparse=bl,Qr.postformat=bl,Qr.relativeTime=te,Qr.pastFuture=ye,Qr.set=L,Qr.eras=Gm,Qr.erasParse=$m,Qr.erasConvertYear=Zm,Qr.erasAbbrRegex=Ms,Qr.erasNameRegex=no,Qr.erasNarrowRegex=_n,Qr.months=ga,Qr.monthsShort=Kr,Qr.monthsParse=Mu,Qr.monthsRegex=em,Qr.monthsShortRegex=_u,Qr.week=Ou,Qr.firstDayOfYear=Lf,Qr.firstDayOfWeek=Rf,Qr.weekdays=sm,Qr.weekdaysMin=Bu,Qr.weekdaysShort=um,Qr.weekdaysParse=lm,Qr.weekdaysRegex=ht,Qr.weekdaysShortRegex=mt,Qr.weekdaysMinRegex=dm,Qr.isPM=Gf,Qr.meridiem=ku;function Ts(g,N,P,z){var G=Tt(),se=d().set(z,N);return G[P](se,g)}function wl(g,N,P){if(f(g)&&(N=g,g=void 0),g=g||"",N!=null)return Ts(g,N,P,"month");var z,G=[];for(z=0;z<12;z++)G[z]=Ts(g,z,P,"month");return G}function Fs(g,N,P,z){typeof g=="boolean"?(f(N)&&(P=N,N=void 0),N=N||""):(N=g,P=N,g=!1,f(N)&&(P=N,N=void 0),N=N||"");var G=Tt(),se=g?G._week.dow:0,Te,mr=[];if(P!=null)return Ts(N,(P+se)%7,z,"day");for(Te=0;Te<7;Te++)mr[Te]=Ts(N,(Te+se)%7,z,"day");return mr}function Dl(g,N){return wl(g,N,"months")}function ld(g,N){return wl(g,N,"monthsShort")}function cd(g,N,P){return Fs(g,N,P,"weekdays")}function Qu(g,N,P){return Fs(g,N,P,"weekdaysShort")}function Uo(g,N,P){return Fs(g,N,P,"weekdaysMin")}Ti("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\\d{1,2}(th|st|nd|rd)/,ordinal:function(g){var N=g%10,P=Xe(g%100/10)===1?"th":N===1?"st":N===2?"nd":N===3?"rd":"th";return g+P}}),r.lang=F("moment.lang is deprecated. Use moment.locale instead.",Ti),r.langData=F("moment.langData is deprecated. Use moment.localeData instead.",Tt);var Tn=Math.abs;function pd(){var g=this._data;return this._milliseconds=Tn(this._milliseconds),this._days=Tn(this._days),this._months=Tn(this._months),g.milliseconds=Tn(g.milliseconds),g.seconds=Tn(g.seconds),g.minutes=Tn(g.minutes),g.hours=Tn(g.hours),g.months=Tn(g.months),g.years=Tn(g.years),this}function Xu(g,N,P,z){var G=kr(N,P);return g._milliseconds+=z*G._milliseconds,g._days+=z*G._days,g._months+=z*G._months,g._bubble()}function md(g,N){return Xu(this,g,N,1)}function Pi(g,N){return Xu(this,g,N,-1)}function Os(g){return g<0?Math.floor(g):Math.ceil(g)}function Sa(){var g=this._milliseconds,N=this._days,P=this._months,z=this._data,G,se,Te,mr,Tr;return g>=0&&N>=0&&P>=0||g<=0&&N<=0&&P<=0||(g+=Os(Ju(P)+N)*864e5,N=0,P=0),z.milliseconds=g%1e3,G=ir(g/1e3),z.seconds=G%60,se=ir(G/60),z.minutes=se%60,Te=ir(se/60),z.hours=Te%24,N+=ir(Te/24),Tr=ir(yn(N)),P+=Tr,N-=Os(Ju(Tr)),mr=ir(P/12),P%=12,z.days=N,z.months=P,z.years=mr,this}function yn(g){return g*4800/146097}function Ju(g){return g*146097/4800}function Sl(g){if(!this.isValid())return NaN;var N,P,z=this._milliseconds;if(g=ue(g),g==="month"||g==="quarter"||g==="year")switch(N=this._days+z/864e5,P=this._months+yn(N),g){case"month":return P;case"quarter":return P/3;case"year":return P/12}else switch(N=this._days+Math.round(Ju(this._months)),g){case"week":return N/7+z/6048e5;case"day":return N+z/864e5;case"hour":return N*24+z/36e5;case"minute":return N*1440+z/6e4;case"second":return N*86400+z/1e3;case"millisecond":return Math.floor(N*864e5)+z;default:throw new Error("Unknown unit "+g)}}function Nl(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+Xe(this._months/12)*31536e6:NaN}function bn(g){return function(){return this.as(g)}}var na=bn("ms"),Al=bn("s"),dd=bn("m"),Bs=bn("h"),hd=bn("d"),El=bn("w"),Ht=bn("M"),Ku=bn("Q"),Cl=bn("y");function ii(){return kr(this)}function ju(g){return g=ue(g),this.isValid()?this[g+"s"]():NaN}function ai(g){return function(){return this.isValid()?this._data[g]:NaN}}var Na=ai("milliseconds"),Ml=ai("seconds"),on=ai("minutes"),ef=ai("hours"),vd=ai("days"),gd=ai("months"),xd=ai("years");function rf(){return ir(this.days()/7)}var ki=Math.round,oi={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function _l(g,N,P,z,G){return G.relativeTime(N||1,!!P,g,z)}function yd(g,N,P,z){var G=kr(g).abs(),se=ki(G.as("s")),Te=ki(G.as("m")),mr=ki(G.as("h")),Tr=ki(G.as("d")),et=ki(G.as("M")),sn=ki(G.as("w")),si=ki(G.as("y")),Ri=se<=P.ss&&["s",se]||se0,Ri[4]=z,_l.apply(null,Ri)}function bd(g){return g===void 0?ki:typeof g=="function"?(ki=g,!0):!1}function zo(g,N){return oi[g]===void 0?!1:N===void 0?oi[g]:(oi[g]=N,g==="s"&&(oi.ss=N-1),!0)}function wd(g,N){if(!this.isValid())return this.localeData().invalidDate();var P=!1,z=oi,G,se;return typeof g=="object"&&(N=g,g=!1),typeof g=="boolean"&&(P=g),typeof N=="object"&&(z=Object.assign({},oi,N),N.s!=null&&N.ss==null&&(z.ss=N.s-1)),G=this.localeData(),se=yd(this,!P,z,G),P&&(se=G.pastFuture(+this,se)),G.postformat(se)}var tf=Math.abs;function ia(g){return(g>0)-(g<0)||+g}function Wo(){if(!this.isValid())return this.localeData().invalidDate();var g=tf(this._milliseconds)/1e3,N=tf(this._days),P=tf(this._months),z,G,se,Te,mr=this.asSeconds(),Tr,et,sn,si;return mr?(z=ir(g/60),G=ir(z/60),g%=60,z%=60,se=ir(P/12),P%=12,Te=g?g.toFixed(3).replace(/\\.?0+$/,""):"",Tr=mr<0?"-":"",et=ia(this._months)!==ia(mr)?"-":"",sn=ia(this._days)!==ia(mr)?"-":"",si=ia(this._milliseconds)!==ia(mr)?"-":"",Tr+"P"+(se?et+se+"Y":"")+(P?et+P+"M":"")+(N?sn+N+"D":"")+(G||z||g?"T":"")+(G?si+G+"H":"")+(z?si+z+"M":"")+(g?si+Te+"S":"")):"P0D"}var Wr=To.prototype;Wr.isValid=Mm,Wr.abs=pd,Wr.add=md,Wr.subtract=Pi,Wr.as=Sl,Wr.asMilliseconds=na,Wr.asSeconds=Al,Wr.asMinutes=dd,Wr.asHours=Bs,Wr.asDays=hd,Wr.asWeeks=El,Wr.asMonths=Ht,Wr.asQuarters=Ku,Wr.asYears=Cl,Wr.valueOf=Nl,Wr._bubble=Sa,Wr.clone=ii,Wr.get=ju,Wr.milliseconds=Na,Wr.seconds=Ml,Wr.minutes=on,Wr.hours=ef,Wr.days=vd,Wr.weeks=rf,Wr.months=gd,Wr.years=xd,Wr.humanize=wd,Wr.toISOString=Wo,Wr.toString=Wo,Wr.toJSON=Wo,Wr.locale=Io,Wr.localeData=pl,Wr.toIsoString=F("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Wo),Wr.lang=Ns,H("X",0,0,"unix"),H("x",0,0,"valueOf"),rr("x",Yt),rr("X",wu),nt("X",function(g,N,P){P._d=new Date(parseFloat(g)*1e3)}),nt("x",function(g,N,P){P._d=new Date(Xe(g))});return r.version="2.29.4",t(dt),r.fn=Ye,r.min=Nm,r.max=Am,r.now=Em,r.utc=d,r.unix=Hn,r.months=Dl,r.isDate=o,r.locale=Ti,r.invalid=w,r.duration=kr,r.isMoment=S,r.weekdays=cd,r.parseZone=fd,r.localeData=Tt,r.isDuration=Yn,r.monthsShort=ld,r.weekdaysMin=Uo,r.defineLocale=an,r.updateLocale=gm,r.locales=xm,r.weekdaysShort=Qu,r.normalizeUnits=ue,r.relativeTimeRounding=bd,r.relativeTimeThreshold=zo,r.calendarFormat=Rm,r.prototype=Ye,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r})});var mc=un((Ch,Mh)=>{(function(e,r){typeof Ch=="object"&&typeof Mh<"u"?Mh.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e["'typed'"]=r())})(Ch,function(){"use strict";function e(){return!0}function r(){return!1}function t(){}let n="Argument is not a typed-function.";function i(){function s(re){return typeof re=="object"&&re!==null&&re.constructor===Object}let c=[{name:"number",test:function(re){return typeof re=="number"}},{name:"string",test:function(re){return typeof re=="string"}},{name:"boolean",test:function(re){return typeof re=="boolean"}},{name:"Function",test:function(re){return typeof re=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(re){return re instanceof Date}},{name:"RegExp",test:function(re){return re instanceof RegExp}},{name:"Object",test:s},{name:"null",test:function(re){return re===null}},{name:"undefined",test:function(re){return re===void 0}}],f={name:"any",test:e,isAny:!0},o,u,p=0,d={createCount:0};function h(re){let le=o.get(re);if(le)return le;let we='Unknown type "'+re+'"',Oe=re.toLowerCase(),ke;for(ke of u)if(ke.toLowerCase()===Oe){we+='. Did you mean "'+ke+'" ?';break}throw new TypeError(we)}function x(re){let le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any",we=le?h(le).index:u.length,Oe=[];for(let _e=0;_e{let Oe=o.get(we);return!Oe.isAny&&Oe.test(re)});return le.length?le:["any"]}function C(re){return re&&typeof re=="function"&&"_typedFunctionData"in re}function b(re,le,we){if(!C(re))throw new TypeError(n);let Oe=we&&we.exact,ke=Array.isArray(le)?le.join(","):le,_e=_(ke),Pe=S(_e);if(!Oe||Pe in re.signatures){let ve=re._typedFunctionData.signatureMap.get(Pe);if(ve)return ve}let We=_e.length,B;if(Oe){B=[];let ve;for(ve in re.signatures)B.push(re._typedFunctionData.signatureMap.get(ve))}else B=re._typedFunctionData.signatures;for(let ve=0;ve!_t.has(Yt.name)))continue}er.push(fr)}}if(B=er,B.length===0)break}let Q;for(Q of B)if(Q.params.length<=We)return Q;throw new TypeError("Signature not found (signature: "+(re.name||"unnamed")+"("+S(_e,", ")+"))")}function A(re,le,we){return b(re,le,we).implementation}function E(re,le){let we=h(le);if(we.test(re))return re;let Oe=we.conversionsTo;if(Oe.length===0)throw new Error("There are no conversions to "+le+" defined.");for(let ke=0;ke1&&arguments[1]!==void 0?arguments[1]:",";return re.map(we=>we.name).join(le)}function O(re){let le=re.indexOf("...")===0,Oe=(le?re.length>3?re.slice(3):"any":re).split("|").map(We=>h(We.trim())),ke=!1,_e=le?"...":"";return{types:Oe.map(function(We){return ke=We.isAny||ke,_e+=We.name+"|",{name:We.name,typeIndex:We.index,test:We.test,isAny:We.isAny,conversion:null,conversionIndex:-1}}),name:_e.slice(0,-1),hasAny:ke,hasConversion:!1,restParam:le}}function F(re){let le=re.types.map(Pe=>Pe.name),we=H(le),Oe=re.hasAny,ke=re.name,_e=we.map(function(Pe){let We=h(Pe.from);return Oe=We.isAny||Oe,ke+="|"+Pe.from,{name:Pe.from,typeIndex:We.index,test:We.test,isAny:We.isAny,conversion:Pe,conversionIndex:Pe.index}});return{types:re.types.concat(_e),name:ke,hasAny:Oe,hasConversion:_e.length>0,restParam:re.restParam}}function M(re){return re.typeSet||(re.typeSet=new Set,re.types.forEach(le=>re.typeSet.add(le.name))),re.typeSet}function _(re){let le=[];if(typeof re!="string")throw new TypeError("Signatures must be strings");let we=re.trim();if(we==="")return le;let Oe=we.split(",");for(let ke=0;ke=ke+1}}else return re.length===0?function(_e){return _e.length===0}:re.length===1?(we=L(re[0]),function(_e){return we(_e[0])&&_e.length===1}):re.length===2?(we=L(re[0]),Oe=L(re[1]),function(_e){return we(_e[0])&&Oe(_e[1])&&_e.length===2}):(le=re.map(L),function(_e){for(let Pe=0;Pe{let ke=V(Oe.params,le),_e;for(_e of ke)we.add(_e)}),we.has("any")?["any"]:Array.from(we)}function j(re,le,we){let Oe,ke,_e=re||"unnamed",Pe=we,We;for(We=0;We{let fr=$(er.params,We),Zr=L(fr);(We0){let er=w(le[We]);return Oe=new TypeError("Unexpected type of argument in function "+_e+" (expected: "+ke.join(" or ")+", actual: "+er.join(" | ")+", index: "+We+")"),Oe.data={category:"wrongType",fn:_e,index:We,actual:er,expected:ke},Oe}}else Pe=Be}let B=Pe.map(function(Be){return k(Be.params)?1/0:Be.params.length});if(le.lengthQ)return Oe=new TypeError("Too many arguments in function "+_e+" (expected: "+Q+", actual: "+le.length+")"),Oe.data={category:"tooManyArgs",fn:_e,index:le.length,expectedLength:Q},Oe;let ve=[];for(let Be=0;Be0)return 1;let Oe=oe(re)-oe(le);return Oe<0?-1:Oe>0?1:0}function ie(re,le){let we=re.params,Oe=le.params,ke=K(we),_e=K(Oe),Pe=k(we),We=k(Oe);if(Pe&&ke.hasAny){if(!We||!_e.hasAny)return 1}else if(We&&_e.hasAny)return-1;let B=0,Q=0,ve;for(ve of we)ve.hasAny&&++B,ve.hasConversion&&++Q;let Be=0,er=0;for(ve of Oe)ve.hasAny&&++Be,ve.hasConversion&&++er;if(B!==Be)return B-Be;if(Pe&&ke.hasConversion){if(!We||!_e.hasConversion)return 1}else if(We&&_e.hasConversion)return-1;if(Q!==er)return Q-er;if(Pe){if(!We)return 1}else if(We)return-1;let fr=(we.length-Oe.length)*(Pe?-1:1);if(fr!==0)return fr;let Zr=[],_t=0;for(let Zi=0;Zi1&&le.sort((ke,_e)=>ke.index-_e.index);let we=le[0].conversionsTo;if(re.length===1)return we;we=we.concat([]);let Oe=new Set(re);for(let ke=1;keke.hasConversion)){let ke=k(re),_e=re.map(Me);we=function(){let We=[],B=ke?arguments.length-1:arguments.length;for(let Q=0;QB.name).join("|"),hasAny:We.some(B=>B.isAny),hasConversion:!1,restParam:!0}),Pe.push(_e)}else Pe=_e.types.map(function(We){return{types:[We],name:We.name,hasAny:We.isAny,hasConversion:We.conversion,restParam:!1}});return ee(Pe,function(We){return le(we,Oe+1,ke.concat([We]))})}else return[ke]}return le(re,0,[])}function ge(re,le){let we=Math.max(re.length,le.length);for(let We=0;We=Oe:Pe?Oe>=ke:Oe===ke}function Se(re){return re.map(le=>Le(le)?Ee(le.referToSelf.callback):Ce(le)?ue(le.referTo.references,le.referTo.callback):le)}function xe(re,le,we){let Oe=[],ke;for(ke of re){let _e=we[ke];if(typeof _e!="number")throw new TypeError('No definition for referenced signature "'+ke+'"');if(_e=le[_e],typeof _e!="function")return!1;Oe.push(_e)}return Oe}function be(re,le,we){let Oe=Se(re),ke=new Array(Oe.length).fill(!1),_e=!0;for(;_e;){_e=!1;let Pe=!0;for(let We=0;We{let Oe=re[we];if(le.test(Oe.toString()))throw new SyntaxError("Using \`this\` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function Ae(re,le){if(d.createCount++,Object.keys(le).length===0)throw new SyntaxError("No signatures provided");d.warnAgainstDeprecatedThis&&De(le);let we=[],Oe=[],ke={},_e=[],Pe;for(Pe in le){if(!Object.prototype.hasOwnProperty.call(le,Pe))continue;let Kr=_(Pe);if(!Kr)continue;we.forEach(function(_i){if(ge(_i,Kr))throw new TypeError('Conflicting signatures "'+S(_i)+'" and "'+S(Kr)+'".')}),we.push(Kr);let jt=Oe.length;Oe.push(le[Pe]);let Mu=Kr.map(F),Qi;for(Qi of pe(Mu)){let _i=S(Qi);_e.push({params:Qi,name:_i,fn:jt}),Qi.every(cs=>!cs.hasConversion)&&(ke[_i]=jt)}}_e.sort(ie);let We=be(Oe,ke,ga),B;for(B in ke)Object.prototype.hasOwnProperty.call(ke,B)&&(ke[B]=We[ke[B]]);let Q=[],ve=new Map;for(B of _e)ve.has(B.name)||(B.fn=We[B.fn],Q.push(B),ve.set(B.name,B));let Be=Q[0]&&Q[0].params.length<=2&&!k(Q[0].params),er=Q[1]&&Q[1].params.length<=2&&!k(Q[1].params),fr=Q[2]&&Q[2].params.length<=2&&!k(Q[2].params),Zr=Q[3]&&Q[3].params.length<=2&&!k(Q[3].params),_t=Q[4]&&Q[4].params.length<=2&&!k(Q[4].params),Yt=Q[5]&&Q[5].params.length<=2&&!k(Q[5].params),Zi=Be&&er&&fr&&Zr&&_t&&Yt;for(let Kr=0;KrKr.test),fs=Q.map(Kr=>Kr.implementation),ls=function(){for(let jt=Cu;jtS(_(we))),le=K(arguments);if(typeof le!="function")throw new TypeError("Callback function expected as last argument");return ue(re,le)}function ue(re,le){return{referTo:{references:re,callback:le}}}function Ee(re){if(typeof re!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:re}}}function Ce(re){return re&&typeof re.referTo=="object"&&Array.isArray(re.referTo.references)&&typeof re.referTo.callback=="function"}function Le(re){return re&&typeof re.referToSelf=="object"&&typeof re.referToSelf.callback=="function"}function Ie(re,le){if(!re)return le;if(le&&le!==re){let we=new Error("Function names do not match (expected: "+re+", actual: "+le+")");throw we.data={actual:le,expected:re},we}return re}function sr(re){let le;for(let we in re)Object.prototype.hasOwnProperty.call(re,we)&&(C(re[we])||typeof re[we].signature=="string")&&(le=Ie(le,re[we].name));return le}function ir(re,le){let we;for(we in le)if(Object.prototype.hasOwnProperty.call(le,we)){if(we in re&&le[we]!==re[we]){let Oe=new Error('Signature "'+we+'" is defined twice');throw Oe.data={signature:we,sourceFunction:le[we],destFunction:re[we]},Oe}re[we]=le[we]}}let Xe=d;d=function(re){let le=typeof re=="string",we=le?1:0,Oe=le?re:"",ke={};for(let _e=we;_eke.from===re.from);if(!we)throw new Error("Attempt to remove nonexistent conversion from "+re.from+" to "+re.to);if(we.convert!==re.convert)throw new Error("Conversion to remove does not match existing conversion");let Oe=le.conversionsTo.indexOf(we);le.conversionsTo.splice(Oe,1)},d.resolve=function(re,le){if(!C(re))throw new TypeError(n);let we=re._typedFunctionData.signatures;for(let Oe=0;Oe{(function(e){"use strict";var r=Math.cosh||function(o){return Math.abs(o)<1e-9?1-o:(Math.exp(o)+Math.exp(-o))*.5},t=Math.sinh||function(o){return Math.abs(o)<1e-9?o:(Math.exp(o)-Math.exp(-o))*.5},n=function(o){var u=Math.PI/4;if(-u>o||o>u)return Math.cos(o)-1;var p=o*o;return p*(p*(p*(p*(p*(p*(p*(p/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},i=function(o,u){var p=Math.abs(o),d=Math.abs(u);return p<3e3&&d<3e3?Math.sqrt(p*p+d*d):(p0&&a();break;case"number":p.im=0,p.re=o;break;default:a()}return isNaN(p.re)||isNaN(p.im),p};function f(o,u){if(!(this instanceof f))return new f(o,u);var p=c(o,u);this.re=p.re,this.im=p.im}f.prototype={re:0,im:0,sign:function(){var o=this.abs();return new f(this.re/o,this.im/o)},add:function(o,u){var p=new f(o,u);return this.isInfinite()&&p.isInfinite()?f.NAN:this.isInfinite()||p.isInfinite()?f.INFINITY:new f(this.re+p.re,this.im+p.im)},sub:function(o,u){var p=new f(o,u);return this.isInfinite()&&p.isInfinite()?f.NAN:this.isInfinite()||p.isInfinite()?f.INFINITY:new f(this.re-p.re,this.im-p.im)},mul:function(o,u){var p=new f(o,u);return this.isInfinite()&&p.isZero()||this.isZero()&&p.isInfinite()?f.NAN:this.isInfinite()||p.isInfinite()?f.INFINITY:p.im===0&&this.im===0?new f(this.re*p.re,0):new f(this.re*p.re-this.im*p.im,this.re*p.im+this.im*p.re)},div:function(o,u){var p=new f(o,u);if(this.isZero()&&p.isZero()||this.isInfinite()&&p.isInfinite())return f.NAN;if(this.isInfinite()||p.isZero())return f.INFINITY;if(this.isZero()||p.isInfinite())return f.ZERO;o=this.re,u=this.im;var d=p.re,h=p.im,x,v;return h===0?new f(o/d,u/d):Math.abs(d)0)return new f(Math.pow(o,p.re),0);if(o===0)switch((p.re%4+4)%4){case 0:return new f(Math.pow(u,p.re),0);case 1:return new f(0,Math.pow(u,p.re));case 2:return new f(-Math.pow(u,p.re),0);case 3:return new f(0,-Math.pow(u,p.re))}}if(o===0&&u===0&&p.re>0&&p.im>=0)return f.ZERO;var d=Math.atan2(u,o),h=s(o,u);return o=Math.exp(p.re*h-p.im*d),u=p.im*h+p.re*d,new f(o*Math.cos(u),o*Math.sin(u))},sqrt:function(){var o=this.re,u=this.im,p=this.abs(),d,h;if(o>=0){if(u===0)return new f(Math.sqrt(o),0);d=.5*Math.sqrt(2*(p+o))}else d=Math.abs(u)/Math.sqrt(2*(p-o));return o<=0?h=.5*Math.sqrt(2*(p-o)):h=Math.abs(u)/Math.sqrt(2*(p+o)),new f(d,u<0?-h:h)},exp:function(){var o=Math.exp(this.re);return this.im,new f(o*Math.cos(this.im),o*Math.sin(this.im))},expm1:function(){var o=this.re,u=this.im;return new f(Math.expm1(o)*Math.cos(u)+n(u),Math.exp(o)*Math.sin(u))},log:function(){var o=this.re,u=this.im;return u===0&&o>0,new f(s(o,u),Math.atan2(u,o))},abs:function(){return i(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var o=this.re,u=this.im;return new f(Math.sin(o)*r(u),Math.cos(o)*t(u))},cos:function(){var o=this.re,u=this.im;return new f(Math.cos(o)*r(u),-Math.sin(o)*t(u))},tan:function(){var o=2*this.re,u=2*this.im,p=Math.cos(o)+r(u);return new f(Math.sin(o)/p,t(u)/p)},cot:function(){var o=2*this.re,u=2*this.im,p=Math.cos(o)-r(u);return new f(-Math.sin(o)/p,t(u)/p)},sec:function(){var o=this.re,u=this.im,p=.5*r(2*u)+.5*Math.cos(2*o);return new f(Math.cos(o)*r(u)/p,Math.sin(o)*t(u)/p)},csc:function(){var o=this.re,u=this.im,p=.5*r(2*u)-.5*Math.cos(2*o);return new f(Math.sin(o)*r(u)/p,-Math.cos(o)*t(u)/p)},asin:function(){var o=this.re,u=this.im,p=new f(u*u-o*o+1,-2*o*u).sqrt(),d=new f(p.re-u,p.im+o).log();return new f(d.im,-d.re)},acos:function(){var o=this.re,u=this.im,p=new f(u*u-o*o+1,-2*o*u).sqrt(),d=new f(p.re-u,p.im+o).log();return new f(Math.PI/2-d.im,d.re)},atan:function(){var o=this.re,u=this.im;if(o===0){if(u===1)return new f(0,1/0);if(u===-1)return new f(0,-1/0)}var p=o*o+(1-u)*(1-u),d=new f((1-u*u-o*o)/p,-2*o/p).log();return new f(-.5*d.im,.5*d.re)},acot:function(){var o=this.re,u=this.im;if(u===0)return new f(Math.atan2(1,o),0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).atan():new f(o!==0?o/0:0,u!==0?-u/0:0).atan()},asec:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new f(0,1/0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).acos():new f(o!==0?o/0:0,u!==0?-u/0:0).acos()},acsc:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new f(Math.PI/2,1/0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).asin():new f(o!==0?o/0:0,u!==0?-u/0:0).asin()},sinh:function(){var o=this.re,u=this.im;return new f(t(o)*Math.cos(u),r(o)*Math.sin(u))},cosh:function(){var o=this.re,u=this.im;return new f(r(o)*Math.cos(u),t(o)*Math.sin(u))},tanh:function(){var o=2*this.re,u=2*this.im,p=r(o)+Math.cos(u);return new f(t(o)/p,Math.sin(u)/p)},coth:function(){var o=2*this.re,u=2*this.im,p=r(o)-Math.cos(u);return new f(t(o)/p,-Math.sin(u)/p)},csch:function(){var o=this.re,u=this.im,p=Math.cos(2*u)-r(2*o);return new f(-2*t(o)*Math.cos(u)/p,2*r(o)*Math.sin(u)/p)},sech:function(){var o=this.re,u=this.im,p=Math.cos(2*u)+r(2*o);return new f(2*r(o)*Math.cos(u)/p,-2*t(o)*Math.sin(u)/p)},asinh:function(){var o=this.im;this.im=-this.re,this.re=o;var u=this.asin();return this.re=-this.im,this.im=o,o=u.re,u.re=-u.im,u.im=o,u},acosh:function(){var o=this.acos();if(o.im<=0){var u=o.re;o.re=-o.im,o.im=u}else{var u=o.im;o.im=-o.re,o.re=u}return o},atanh:function(){var o=this.re,u=this.im,p=o>1&&u===0,d=1-o,h=1+o,x=d*d+u*u,v=x!==0?new f((h*d-u*u)/x,(u*d+h*u)/x):new f(o!==-1?o/0:0,u!==0?u/0:0),y=v.re;return v.re=s(v.re,v.im)/2,v.im=Math.atan2(v.im,y)/2,p&&(v.im=-v.im),v},acoth:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new f(0,Math.PI/2);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).atanh():new f(o!==0?o/0:0,u!==0?-u/0:0).atanh()},acsch:function(){var o=this.re,u=this.im;if(u===0)return new f(o!==0?Math.log(o+Math.sqrt(o*o+1)):1/0,0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).asinh():new f(o!==0?o/0:0,u!==0?-u/0:0).asinh()},asech:function(){var o=this.re,u=this.im;if(this.isZero())return f.INFINITY;var p=o*o+u*u;return p!==0?new f(o/p,-u/p).acosh():new f(o!==0?o/0:0,u!==0?-u/0:0).acosh()},inverse:function(){if(this.isZero())return f.INFINITY;if(this.isInfinite())return f.ZERO;var o=this.re,u=this.im,p=o*o+u*u;return new f(o/p,-u/p)},conjugate:function(){return new f(this.re,-this.im)},neg:function(){return new f(-this.re,-this.im)},ceil:function(o){return o=Math.pow(10,o||0),new f(Math.ceil(this.re*o)/o,Math.ceil(this.im*o)/o)},floor:function(o){return o=Math.pow(10,o||0),new f(Math.floor(this.re*o)/o,Math.floor(this.im*o)/o)},round:function(o){return o=Math.pow(10,o||0),new f(Math.round(this.re*o)/o,Math.round(this.im*o)/o)},equals:function(o,u){var p=new f(o,u);return Math.abs(p.re-this.re)<=f.EPSILON&&Math.abs(p.im-this.im)<=f.EPSILON},clone:function(){return new f(this.re,this.im)},toString:function(){var o=this.re,u=this.im,p="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(o){(function(e){"use strict";var r=2e3,t={s:1,n:0,d:1};function n(v,y){if(isNaN(v=parseInt(v,10)))throw h();return v*y}function i(v,y){if(y===0)throw d();var w=Object.create(p.prototype);w.s=v<0?-1:1,v=v<0?-v:v;var C=u(v,y);return w.n=v/C,w.d=y/C,w}function a(v){for(var y={},w=v,C=2,b=4;b<=w;){for(;w%C===0;)w/=C,y[C]=(y[C]||0)+1;b+=1+2*C++}return w!==v?w>1&&(y[w]=(y[w]||0)+1):y[v]=(y[v]||0)+1,y}var s=function(v,y){var w=0,C=1,b=1,A=0,E=0,S=0,O=1,F=1,M=0,_=1,k=1,L=1,Y=1e7,$;if(v!=null)if(y!==void 0){if(w=v,C=y,b=w*C,w%1!==0||C%1!==0)throw x()}else switch(typeof v){case"object":{if("d"in v&&"n"in v)w=v.n,C=v.d,"s"in v&&(w*=v.s);else if(0 in v)w=v[0],1 in v&&(C=v[1]);else throw h();b=w*C;break}case"number":{if(v<0&&(b=v,v=-v),v%1===0)w=v;else if(v>0){for(v>=1&&(F=Math.pow(10,Math.floor(1+Math.log(v)/Math.LN10)),v/=F);_<=Y&&L<=Y;)if($=(M+k)/(_+L),v===$){_+L<=Y?(w=M+k,C=_+L):L>_?(w=k,C=L):(w=M,C=_);break}else v>$?(M+=k,_+=L):(k+=M,L+=_),_>Y?(w=k,C=L):(w=M,C=_);w*=F}else(isNaN(v)||isNaN(y))&&(C=w=NaN);break}case"string":{if(_=v.match(/\\d+|./g),_===null)throw h();if(_[M]==="-"?(b=-1,M++):_[M]==="+"&&M++,_.length===M+1?E=n(_[M++],b):_[M+1]==="."||_[M]==="."?(_[M]!=="."&&(A=n(_[M++],b)),M++,(M+1===_.length||_[M+1]==="("&&_[M+3]===")"||_[M+1]==="'"&&_[M+3]==="'")&&(E=n(_[M],b),O=Math.pow(10,_[M].length),M++),(_[M]==="("&&_[M+2]===")"||_[M]==="'"&&_[M+2]==="'")&&(S=n(_[M+1],b),F=Math.pow(10,_[M+1].length)-1,M+=3)):_[M+1]==="/"||_[M+1]===":"?(E=n(_[M],b),O=n(_[M+2],1),M+=3):_[M+3]==="/"&&_[M+1]===" "&&(A=n(_[M],b),E=n(_[M+2],b),O=n(_[M+4],1),M+=5),_.length<=M){C=O*F,b=w=S+C*A+F*E;break}}default:throw h()}if(C===0)throw d();t.s=b<0?-1:1,t.n=Math.abs(w),t.d=Math.abs(C)};function c(v,y,w){for(var C=1;y>0;v=v*v%w,y>>=1)y&1&&(C=C*v%w);return C}function f(v,y){for(;y%2===0;y/=2);for(;y%5===0;y/=5);if(y===1)return 0;for(var w=10%y,C=1;w!==1;C++)if(w=w*10%y,C>r)return 0;return C}function o(v,y,w){for(var C=1,b=c(10,w,y),A=0;A<300;A++){if(C===b)return A;C=C*10%y,b=b*10%y}return 0}function u(v,y){if(!v)return y;if(!y)return v;for(;;){if(v%=y,!v)return y;if(y%=v,!y)return v}}function p(v,y){if(s(v,y),this instanceof p)v=u(t.d,t.n),this.s=t.s,this.n=t.n/v,this.d=t.d/v;else return i(t.s*t.n,t.d)}var d=function(){return new Error("Division by Zero")},h=function(){return new Error("Invalid argument")},x=function(){return new Error("Parameters must be integer")};p.prototype={s:1,n:0,d:1,abs:function(){return i(this.n,this.d)},neg:function(){return i(-this.s*this.n,this.d)},add:function(v,y){return s(v,y),i(this.s*this.n*t.d+t.s*this.d*t.n,this.d*t.d)},sub:function(v,y){return s(v,y),i(this.s*this.n*t.d-t.s*this.d*t.n,this.d*t.d)},mul:function(v,y){return s(v,y),i(this.s*t.s*this.n*t.n,this.d*t.d)},div:function(v,y){return s(v,y),i(this.s*t.s*this.n*t.d,this.d*t.n)},clone:function(){return i(this.s*this.n,this.d)},mod:function(v,y){if(isNaN(this.n)||isNaN(this.d))return new p(NaN);if(v===void 0)return i(this.s*this.n%this.d,1);if(s(v,y),t.n===0&&this.d===0)throw d();return i(this.s*(t.d*this.n)%(t.n*this.d),t.d*this.d)},gcd:function(v,y){return s(v,y),i(u(t.n,this.n)*u(t.d,this.d),t.d*this.d)},lcm:function(v,y){return s(v,y),t.n===0&&this.n===0?i(0,1):i(t.n*this.n,u(t.n,this.n)*u(t.d,this.d))},ceil:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.ceil(v*this.s*this.n/this.d),v)},floor:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.floor(v*this.s*this.n/this.d),v)},round:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.round(v*this.s*this.n/this.d),v)},inverse:function(){return i(this.s*this.d,this.n)},pow:function(v,y){if(s(v,y),t.d===1)return t.s<0?i(Math.pow(this.s*this.d,t.n),Math.pow(this.n,t.n)):i(Math.pow(this.s*this.n,t.n),Math.pow(this.d,t.n));if(this.s<0)return null;var w=a(this.n),C=a(this.d),b=1,A=1;for(var E in w)if(E!=="1"){if(E==="0"){b=0;break}if(w[E]*=t.n,w[E]%t.d===0)w[E]/=t.d;else return null;b*=Math.pow(E,w[E])}for(var E in C)if(E!=="1"){if(C[E]*=t.n,C[E]%t.d===0)C[E]/=t.d;else return null;A*=Math.pow(E,C[E])}return t.s<0?i(A,b):i(b,A)},equals:function(v,y){return s(v,y),this.s*this.n*t.d===t.s*t.n*this.d},compare:function(v,y){s(v,y);var w=this.s*this.n*t.d-t.s*t.n*this.d;return(0=0;A--)b=b.inverse().add(w[A]);if(Math.abs(b.sub(y).valueOf())0&&(w+=y,w+=" ",C%=b),w+=C,w+="/",w+=b),w},toLatex:function(v){var y,w="",C=this.n,b=this.d;return this.s<0&&(w+="-"),b===1?w+=C:(v&&(y=Math.floor(C/b))>0&&(w+=y,C%=b),w+="\\\\frac{",w+=C,w+="}{",w+=b,w+="}"),w},toContinued:function(){var v,y=this.n,w=this.d,C=[];if(isNaN(y)||isNaN(w))return C;do C.push(Math.floor(y/w)),v=y%w,y=w,w=v;while(y!==1);return C},toString:function(v){var y=this.n,w=this.d;if(isNaN(y)||isNaN(w))return"NaN";v=v||15;var C=f(y,w),b=o(y,w,C),A=this.s<0?"-":"";if(A+=y/w|0,y%=w,y*=10,y&&(A+="."),C){for(var E=b;E--;)A+=y/w|0,y%=w,y*=10;A+="(";for(var E=C;E--;)A+=y/w|0,y%=w,y*=10;A+=")"}else for(var E=v;y&&E--;)A+=y/w|0,y%=w,y*=10;return A}},typeof Jh=="object"?(Object.defineProperty(p,"__esModule",{value:!0}),p.default=p,p.Fraction=p,Uy.exports=p):e.Fraction=p})(Jh)});var nS=un((noe,tS)=>{tS.exports=function e(r,t){"use strict";var n=/(^([+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)?$|^0x[0-9a-f]+$|\\d+)/gi,i=/(^[ ]*|[ ]*$)/g,a=/(^([\\w ]+,?[\\w ]+)?[\\w ]+,?[\\w ]+\\d+:\\d+(:\\d+)?[\\w ]?|^\\d{1,4}[\\/\\-]\\d{1,4}[\\/\\-]\\d{1,4}|^\\w+, \\w+ \\d+, \\d{4})/,s=/^0x[0-9a-f]+$/i,c=/^0/,f=function(b){return e.insensitive&&(""+b).toLowerCase()||""+b},o=f(r).replace(i,"")||"",u=f(t).replace(i,"")||"",p=o.replace(n,"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0"),d=u.replace(n,"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0"),h=parseInt(o.match(s),16)||p.length!==1&&o.match(a)&&Date.parse(o),x=parseInt(u.match(s),16)||h&&u.match(a)&&Date.parse(u)||null,v,y;if(x){if(hx)return 1}for(var w=0,C=Math.max(p.length,d.length);wy)return 1}return 0}});var y2=un((bce,x2)=>{"use strict";var t0=Object.assign||function(e){for(var r=1;r1&&arguments[1]!==void 0?arguments[1]:{},t=r.preserveFormatting,n=t===void 0?!1:t,i=r.escapeMapFn,a=i===void 0?LU:i,s=String(e),c="",f=a(t0({},kU),n?t0({},RU):{}),o=Object.keys(f),u=function(){var d=!1;o.forEach(function(h,x){d||s.length>=h.length&&s.slice(0,h.length)===h&&(c+=f[o[x]],s=s.slice(h.length,s.length),d=!0)}),d||(c+=s.slice(0,1),s=s.slice(1,s.length))};s;)u();return c}});var WT=un((zT,l0)=>{(function(e,r,t){function n(c){var f=this,o=s();f.next=function(){var u=2091639*f.s0+f.c*23283064365386963e-26;return f.s0=f.s1,f.s1=f.s2,f.s2=u-(f.c=u|0)},f.c=1,f.s0=o(" "),f.s1=o(" "),f.s2=o(" "),f.s0-=o(c),f.s0<0&&(f.s0+=1),f.s1-=o(c),f.s1<0&&(f.s1+=1),f.s2-=o(c),f.s2<0&&(f.s2+=1),o=null}function i(c,f){return f.c=c.c,f.s0=c.s0,f.s1=c.s1,f.s2=c.s2,f}function a(c,f){var o=new n(c),u=f&&f.state,p=o.next;return p.int32=function(){return o.next()*4294967296|0},p.double=function(){return p()+(p()*2097152|0)*11102230246251565e-32},p.quick=p,u&&(typeof u=="object"&&i(u,o),p.state=function(){return i(o,{})}),p}function s(){var c=4022871197,f=function(o){o=String(o);for(var u=0;u>>0,p-=c,p*=c,c=p>>>0,p-=c,c+=p*4294967296}return(c>>>0)*23283064365386963e-26};return f}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.alea=a})(zT,typeof l0=="object"&&l0,typeof define=="function"&&define)});var YT=un((VT,c0)=>{(function(e,r,t){function n(s){var c=this,f="";c.x=0,c.y=0,c.z=0,c.w=0,c.next=function(){var u=c.x^c.x<<11;return c.x=c.y,c.y=c.z,c.z=c.w,c.w^=c.w>>>19^u^u>>>8},s===(s|0)?c.x=s:f+=s;for(var o=0;o>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,d=(f.next()>>>0)/4294967296,h=(p+d)/(1<<21);while(h===0);return h},u.int32=f.next,u.quick=u,o&&(typeof o=="object"&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xor128=a})(VT,typeof c0=="object"&&c0,typeof define=="function"&&define)});var GT=un((HT,p0)=>{(function(e,r,t){function n(s){var c=this,f="";c.next=function(){var u=c.x^c.x>>>2;return c.x=c.y,c.y=c.z,c.z=c.w,c.w=c.v,(c.d=c.d+362437|0)+(c.v=c.v^c.v<<4^(u^u<<1))|0},c.x=0,c.y=0,c.z=0,c.w=0,c.v=0,s===(s|0)?c.x=s:f+=s;for(var o=0;o>>4),c.next()}function i(s,c){return c.x=s.x,c.y=s.y,c.z=s.z,c.w=s.w,c.v=s.v,c.d=s.d,c}function a(s,c){var f=new n(s),o=c&&c.state,u=function(){return(f.next()>>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,d=(f.next()>>>0)/4294967296,h=(p+d)/(1<<21);while(h===0);return h},u.int32=f.next,u.quick=u,o&&(typeof o=="object"&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xorwow=a})(HT,typeof p0=="object"&&p0,typeof define=="function"&&define)});var ZT=un(($T,m0)=>{(function(e,r,t){function n(s){var c=this;c.next=function(){var o=c.x,u=c.i,p,d,h;return p=o[u],p^=p>>>7,d=p^p<<24,p=o[u+1&7],d^=p^p>>>10,p=o[u+3&7],d^=p^p>>>3,p=o[u+4&7],d^=p^p<<7,p=o[u+7&7],p=p^p<<13,d^=p^p<<9,o[u]=d,c.i=u+1&7,d};function f(o,u){var p,d,h=[];if(u===(u|0))d=h[0]=u;else for(u=""+u,p=0;p0;--p)o.next()}f(c,s)}function i(s,c){return c.x=s.x.slice(),c.i=s.i,c}function a(s,c){s==null&&(s=+new Date);var f=new n(s),o=c&&c.state,u=function(){return(f.next()>>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,d=(f.next()>>>0)/4294967296,h=(p+d)/(1<<21);while(h===0);return h},u.int32=f.next,u.quick=u,o&&(o.x&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xorshift7=a})($T,typeof m0=="object"&&m0,typeof define=="function"&&define)});var XT=un((QT,d0)=>{(function(e,r,t){function n(s){var c=this;c.next=function(){var o=c.w,u=c.X,p=c.i,d,h;return c.w=o=o+1640531527|0,h=u[p+34&127],d=u[p=p+1&127],h^=h<<13,d^=d<<17,h^=h>>>15,d^=d>>>12,h=u[p]=h^d,c.i=p,h+(o^o>>>16)|0};function f(o,u){var p,d,h,x,v,y=[],w=128;for(u===(u|0)?(d=u,u=null):(u=u+"\\0",d=0,w=Math.max(w,u.length)),h=0,x=-32;x>>15,d^=d<<4,d^=d>>>13,x>=0&&(v=v+1640531527|0,p=y[x&127]^=d+v,h=p==0?h+1:0);for(h>=128&&(y[(u&&u.length||0)&127]=-1),h=127,x=4*128;x>0;--x)d=y[h+34&127],p=y[h=h+1&127],d^=d<<13,p^=p<<17,d^=d>>>15,p^=p>>>12,y[h]=d^p;o.w=v,o.X=y,o.i=h}f(c,s)}function i(s,c){return c.i=s.i,c.w=s.w,c.X=s.X.slice(),c}function a(s,c){s==null&&(s=+new Date);var f=new n(s),o=c&&c.state,u=function(){return(f.next()>>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,d=(f.next()>>>0)/4294967296,h=(p+d)/(1<<21);while(h===0);return h},u.int32=f.next,u.quick=u,o&&(o.X&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xor4096=a})(QT,typeof d0=="object"&&d0,typeof define=="function"&&define)});var KT=un((JT,h0)=>{(function(e,r,t){function n(s){var c=this,f="";c.next=function(){var u=c.b,p=c.c,d=c.d,h=c.a;return u=u<<25^u>>>7^p,p=p-d|0,d=d<<24^d>>>8^h,h=h-u|0,c.b=u=u<<20^u>>>12^p,c.c=p=p-d|0,c.d=d<<16^p>>>16^h,c.a=h-u|0},c.a=0,c.b=0,c.c=-1640531527,c.d=1367130551,s===Math.floor(s)?(c.a=s/4294967296|0,c.b=s|0):f+=s;for(var o=0;o>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,d=(f.next()>>>0)/4294967296,h=(p+d)/(1<<21);while(h===0);return h},u.int32=f.next,u.quick=u,o&&(typeof o=="object"&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.tychei=a})(JT,typeof h0=="object"&&h0,typeof define=="function"&&define)});var jT=un(()=>{});var rF=un((eF,qp)=>{(function(e,r,t){var n=256,i=6,a=52,s="random",c=t.pow(n,i),f=t.pow(2,a),o=f*2,u=n-1,p;function d(b,A,E){var S=[];A=A==!0?{entropy:!0}:A||{};var O=y(v(A.entropy?[b,C(r)]:b??w(),3),S),F=new h(S),M=function(){for(var _=F.g(i),k=c,L=0;_=o;)_/=2,k/=2,L>>>=1;return(_+L)/k};return M.int32=function(){return F.g(4)|0},M.quick=function(){return F.g(4)/4294967296},M.double=M,y(C(F.S),r),(A.pass||E||function(_,k,L,Y){return Y&&(Y.S&&x(Y,F),_.state=function(){return x(F,{})}),L?(t[s]=_,k):_})(M,O,"global"in A?A.global:this==t,A.state)}function h(b){var A,E=b.length,S=this,O=0,F=S.i=S.j=0,M=S.S=[];for(E||(b=[E++]);O{var rW=WT(),tW=YT(),nW=GT(),iW=ZT(),aW=XT(),oW=KT(),os=rF();os.alea=rW;os.xor128=tW;os.xorwow=nW;os.xorshift7=iW;os.xor4096=aW;os.tychei=oW;tF.exports=os});var FO=un((KFe,D0)=>{function w0(){}w0.prototype={on:function(e,r,t){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:r,ctx:t}),this},once:function(e,r,t){var n=this;function i(){n.off(e,i),r.apply(t,arguments)}return i._=r,this.on(e,i,t)},emit:function(e){var r=[].slice.call(arguments,1),t=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=t.length;for(n;n{(function(){var e,r="4.17.21",t=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid \`variable\` option passed into \`_.template\`",s="__lodash_hash_undefined__",c=500,f="__lodash_placeholder__",o=1,u=2,p=4,d=1,h=2,x=1,v=2,y=4,w=8,C=16,b=32,A=64,E=128,S=256,O=512,F=30,M="...",_=800,k=16,L=1,Y=2,$=3,V=1/0,q=9007199254740991,R=17976931348623157e292,j=0/0,U=4294967295,oe=U-1,me=U>>>1,ie=[["ary",E],["bind",x],["bindKey",v],["curry",w],["curryRight",C],["flip",O],["partial",b],["partialRight",A],["rearg",S]],H="[object Arguments]",ce="[object Array]",Me="[object AsyncFunction]",pe="[object Boolean]",ge="[object Date]",Se="[object DOMException]",xe="[object Error]",be="[object Function]",De="[object GeneratorFunction]",Ae="[object Map]",ze="[object Number]",Ze="[object Null]",K="[object Object]",te="[object Promise]",ye="[object Proxy]",ee="[object RegExp]",ne="[object Set]",ue="[object String]",Ee="[object Symbol]",Ce="[object Undefined]",Le="[object WeakMap]",Ie="[object WeakSet]",sr="[object ArrayBuffer]",ir="[object DataView]",Xe="[object Float32Array]",Or="[object Float64Array]",re="[object Int8Array]",le="[object Int16Array]",we="[object Int32Array]",Oe="[object Uint8Array]",ke="[object Uint8ClampedArray]",_e="[object Uint16Array]",Pe="[object Uint32Array]",We=/\\b__p \\+= '';/g,B=/\\b(__p \\+=) '' \\+/g,Q=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g,ve=/&(?:amp|lt|gt|quot|#39);/g,Be=/[&<>"']/g,er=RegExp(ve.source),fr=RegExp(Be.source),Zr=/<%-([\\s\\S]+?)%>/g,_t=/<%([\\s\\S]+?)%>/g,Yt=/<%=([\\s\\S]+?)%>/g,Zi=/\\.|\\[(?:[^[\\]]*|(["'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,Ei=/^\\w*$/,wu=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,Ci=/[\\\\^$.*+?()[\\]{}|]/g,Va=RegExp(Ci.source),rr=/^\\s+/,Du=/\\s/,Su=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,nn=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,Eo=/,? & /,nt=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,va=/[()=,{}\\[\\]\\/\\s]/,Nu=/\\\\(\\\\)?/g,zt=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,En=/\\w*$/,Cn=/^[-+]0x[0-9a-f]+$/i,At=/^0b[01]+$/i,gn=/^\\[object .+?Constructor\\]$/,Wn=/^0o[0-7]+$/i,Mi=/^(?:0|[1-9]\\d*)$/,Au=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,Ya=/($^)/,Eu=/['\\n\\r\\u2028\\u2029\\\\]/g,pt="\\\\ud800-\\\\udfff",Ha="\\\\u0300-\\\\u036f",Cu="\\\\ufe20-\\\\ufe2f",us="\\\\u20d0-\\\\u20ff",Co=Ha+Cu+us,fs="\\\\u2700-\\\\u27bf",ls="a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff",ga="\\\\xac\\\\xb1\\\\xd7\\\\xf7",Kr="\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf",jt="\\\\u2000-\\\\u206f",Mu=" \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000",Qi="A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde",_i="\\\\ufe0e\\\\ufe0f",cs=ga+Kr+jt+Mu,_u="['\\u2019]",em="["+pt+"]",Tu="["+cs+"]",Xi="["+Co+"]",Fu="\\\\d+",rm="["+fs+"]",Pf="["+ls+"]",Ga="[^"+pt+cs+Fu+fs+ls+Qi+"]",$a="\\\\ud83c[\\\\udffb-\\\\udfff]",kf="(?:"+Xi+"|"+$a+")",Za="[^"+pt+"]",Vn="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",Ou="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",Qa="["+Qi+"]",Rf="\\\\u200d",Lf="(?:"+Pf+"|"+Ga+")",tm="(?:"+Qa+"|"+Ga+")",qf="(?:"+_u+"(?:d|ll|m|re|s|t|ve))?",Uf="(?:"+_u+"(?:D|LL|M|RE|S|T|VE))?",zf=kf+"?",ps="["+_i+"]?",nm="(?:"+Rf+"(?:"+[Za,Vn,Ou].join("|")+")"+ps+zf+")*",Wf="\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])",im="\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])",Vf=ps+zf+nm,am="(?:"+[rm,Vn,Ou].join("|")+")"+Vf,om="(?:"+[Za+Xi+"?",Xi,Vn,Ou,em].join("|")+")",sm=RegExp(_u,"g"),um=RegExp(Xi,"g"),Bu=RegExp($a+"(?="+$a+")|"+om+Vf,"g"),fm=RegExp([Qa+"?"+Pf+"+"+qf+"(?="+[Tu,Qa,"$"].join("|")+")",tm+"+"+Uf+"(?="+[Tu,Qa+Lf,"$"].join("|")+")",Qa+"?"+Lf+"+"+qf,Qa+"+"+Uf,im,Wf,Fu,am].join("|"),"g"),lm=RegExp("["+Rf+pt+Co+_i+"]"),cm=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,pm=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],mm=-1,ht={};ht[Xe]=ht[Or]=ht[re]=ht[le]=ht[we]=ht[Oe]=ht[ke]=ht[_e]=ht[Pe]=!0,ht[H]=ht[ce]=ht[sr]=ht[pe]=ht[ir]=ht[ge]=ht[xe]=ht[be]=ht[Ae]=ht[ze]=ht[K]=ht[ee]=ht[ne]=ht[ue]=ht[Le]=!1;var mt={};mt[H]=mt[ce]=mt[sr]=mt[ir]=mt[pe]=mt[ge]=mt[Xe]=mt[Or]=mt[re]=mt[le]=mt[we]=mt[Ae]=mt[ze]=mt[K]=mt[ee]=mt[ne]=mt[ue]=mt[Ee]=mt[Oe]=mt[ke]=mt[_e]=mt[Pe]=!0,mt[xe]=mt[be]=mt[Le]=!1;var dm={\\u00C0:"A",\\u00C1:"A",\\u00C2:"A",\\u00C3:"A",\\u00C4:"A",\\u00C5:"A",\\u00E0:"a",\\u00E1:"a",\\u00E2:"a",\\u00E3:"a",\\u00E4:"a",\\u00E5:"a",\\u00C7:"C",\\u00E7:"c",\\u00D0:"D",\\u00F0:"d",\\u00C8:"E",\\u00C9:"E",\\u00CA:"E",\\u00CB:"E",\\u00E8:"e",\\u00E9:"e",\\u00EA:"e",\\u00EB:"e",\\u00CC:"I",\\u00CD:"I",\\u00CE:"I",\\u00CF:"I",\\u00EC:"i",\\u00ED:"i",\\u00EE:"i",\\u00EF:"i",\\u00D1:"N",\\u00F1:"n",\\u00D2:"O",\\u00D3:"O",\\u00D4:"O",\\u00D5:"O",\\u00D6:"O",\\u00D8:"O",\\u00F2:"o",\\u00F3:"o",\\u00F4:"o",\\u00F5:"o",\\u00F6:"o",\\u00F8:"o",\\u00D9:"U",\\u00DA:"U",\\u00DB:"U",\\u00DC:"U",\\u00F9:"u",\\u00FA:"u",\\u00FB:"u",\\u00FC:"u",\\u00DD:"Y",\\u00FD:"y",\\u00FF:"y",\\u00C6:"Ae",\\u00E6:"ae",\\u00DE:"Th",\\u00FE:"th",\\u00DF:"ss",\\u0100:"A",\\u0102:"A",\\u0104:"A",\\u0101:"a",\\u0103:"a",\\u0105:"a",\\u0106:"C",\\u0108:"C",\\u010A:"C",\\u010C:"C",\\u0107:"c",\\u0109:"c",\\u010B:"c",\\u010D:"c",\\u010E:"D",\\u0110:"D",\\u010F:"d",\\u0111:"d",\\u0112:"E",\\u0114:"E",\\u0116:"E",\\u0118:"E",\\u011A:"E",\\u0113:"e",\\u0115:"e",\\u0117:"e",\\u0119:"e",\\u011B:"e",\\u011C:"G",\\u011E:"G",\\u0120:"G",\\u0122:"G",\\u011D:"g",\\u011F:"g",\\u0121:"g",\\u0123:"g",\\u0124:"H",\\u0126:"H",\\u0125:"h",\\u0127:"h",\\u0128:"I",\\u012A:"I",\\u012C:"I",\\u012E:"I",\\u0130:"I",\\u0129:"i",\\u012B:"i",\\u012D:"i",\\u012F:"i",\\u0131:"i",\\u0134:"J",\\u0135:"j",\\u0136:"K",\\u0137:"k",\\u0138:"k",\\u0139:"L",\\u013B:"L",\\u013D:"L",\\u013F:"L",\\u0141:"L",\\u013A:"l",\\u013C:"l",\\u013E:"l",\\u0140:"l",\\u0142:"l",\\u0143:"N",\\u0145:"N",\\u0147:"N",\\u014A:"N",\\u0144:"n",\\u0146:"n",\\u0148:"n",\\u014B:"n",\\u014C:"O",\\u014E:"O",\\u0150:"O",\\u014D:"o",\\u014F:"o",\\u0151:"o",\\u0154:"R",\\u0156:"R",\\u0158:"R",\\u0155:"r",\\u0157:"r",\\u0159:"r",\\u015A:"S",\\u015C:"S",\\u015E:"S",\\u0160:"S",\\u015B:"s",\\u015D:"s",\\u015F:"s",\\u0161:"s",\\u0162:"T",\\u0164:"T",\\u0166:"T",\\u0163:"t",\\u0165:"t",\\u0167:"t",\\u0168:"U",\\u016A:"U",\\u016C:"U",\\u016E:"U",\\u0170:"U",\\u0172:"U",\\u0169:"u",\\u016B:"u",\\u016D:"u",\\u016F:"u",\\u0171:"u",\\u0173:"u",\\u0174:"W",\\u0175:"w",\\u0176:"Y",\\u0177:"y",\\u0178:"Y",\\u0179:"Z",\\u017B:"Z",\\u017D:"Z",\\u017A:"z",\\u017C:"z",\\u017E:"z",\\u0132:"IJ",\\u0133:"ij",\\u0152:"Oe",\\u0153:"oe",\\u0149:"'n",\\u017F:"s"},Iu={"&":"&","<":"<",">":">",'"':""","'":"'"},Pu={"&":"&","<":"<",">":">",""":'"',"'":"'"},hm={"\\\\":"\\\\","'":"'","\\n":"n","\\r":"r","\\u2028":"u2028","\\u2029":"u2029"},Yf=parseFloat,Hf=parseInt,Gf=typeof global=="object"&&global&&global.Object===Object&&global,vm=typeof self=="object"&&self&&self.Object===Object&&self,Wt=Gf||vm||Function("return this")(),ku=typeof du=="object"&&du&&!du.nodeType&&du,Ji=ku&&typeof Mf=="object"&&Mf&&!Mf.nodeType&&Mf,vt=Ji&&Ji.exports===ku,xa=vt&&Gf.process,en=function(){try{var de=Ji&&Ji.require&&Ji.require("util").types;return de||xa&&xa.binding&&xa.binding("util")}catch{}}(),$f=en&&en.isArrayBuffer,Ru=en&&en.isDate,Zf=en&&en.isMap,Qf=en&&en.isRegExp,Mo=en&&en.isSet,Ti=en&&en.isTypedArray;function an(de,Fe,Ne){switch(Ne.length){case 0:return de.call(Fe);case 1:return de.call(Fe,Ne[0]);case 2:return de.call(Fe,Ne[0],Ne[1]);case 3:return de.call(Fe,Ne[0],Ne[1],Ne[2])}return de.apply(Fe,Ne)}function gm(de,Fe,Ne,nr){for(var Nr=-1,jr=de==null?0:de.length;++Nr-1}function Lu(de,Fe,Ne){for(var nr=-1,Nr=de==null?0:de.length;++nr-1;);return Ne}function tl(de,Fe){for(var Ne=de.length;Ne--&&Xa(Fe,de[Ne],0)>-1;);return Ne}function Sm(de,Fe){for(var Ne=de.length,nr=0;Ne--;)de[Ne]===Fe&&++nr;return nr}var nl=_o(dm),Nm=_o(Iu);function Am(de){return"\\\\"+hm[de]}function Em(de,Fe){return de==null?e:de[Fe]}function ni(de){return lm.test(de)}function Cm(de){return cm.test(de)}function Mm(de){for(var Fe,Ne=[];!(Fe=de.next()).done;)Ne.push(Fe.value);return Ne}function Gu(de){var Fe=-1,Ne=Array(de.size);return de.forEach(function(nr,Nr){Ne[++Fe]=[Nr,nr]}),Ne}function To(de,Fe){return function(Ne){return de(Fe(Ne))}}function Yn(de,Fe){for(var Ne=-1,nr=de.length,Nr=0,jr=[];++Ne-1}function xl(l,m){var D=this.__data__,I=Tn(D,l);return I<0?(++this.size,D.push([l,m])):D[I][1]=m,this}Bi.prototype.clear=td,Bi.prototype.delete=gl,Bi.prototype.get=nd,Bi.prototype.has=id,Bi.prototype.set=xl;function Ii(l){var m=-1,D=l==null?0:l.length;for(this.clear();++m=m?l:m)),l}function yn(l,m,D,I,W,J){var ae,fe=m&o,he=m&u,Re=m&p;if(D&&(ae=W?D(l,I,W,J):D(l)),ae!==e)return ae;if(!Ct(l))return l;var qe=Fr(l);if(qe){if(ae=v4(l),!fe)return Fn(l,ae)}else{var Ve=pn(l),Ke=Ve==be||Ve==De;if(so(l))return eg(l,fe);if(Ve==K||Ve==H||Ke&&!W){if(ae=he||Ke?{}:yg(l),!fe)return he?a4(l,md(ae,l)):i4(l,Xu(ae,l))}else{if(!mt[Ve])return W?l:{};ae=g4(l,Ve,fe)}}J||(J=new Hn);var cr=J.get(l);if(cr)return cr;J.set(l,ae),Zg(l)?l.forEach(function(Dr){ae.add(yn(Dr,m,D,Dr,l,J))}):Gg(l)&&l.forEach(function(Dr,qr){ae.set(qr,yn(Dr,m,D,qr,l,J))});var wr=Re?he?Id:Bd:he?Bn:rn,Pr=qe?e:wr(l);return Tt(Pr||l,function(Dr,qr){Pr&&(qr=Dr,Dr=l[qr]),Uo(ae,qr,yn(Dr,m,D,qr,l,J))}),ae}function Ju(l){var m=rn(l);return function(D){return Sl(D,l,m)}}function Sl(l,m,D){var I=D.length;if(l==null)return!I;for(l=kr(l);I--;){var W=D[I],J=m[W],ae=l[W];if(ae===e&&!(W in l)||!J(ae))return!1}return!0}function Nl(l,m,D){if(typeof l!="function")throw new Mn(i);return sf(function(){l.apply(e,D)},m)}function bn(l,m,D,I){var W=-1,J=ds,ae=!0,fe=l.length,he=[],Re=m.length;if(!fe)return he;D&&(m=ct(m,cn(D))),I?(J=Lu,ae=!1):m.length>=t&&(J=Ja,ae=!1,m=new Da(m));e:for(;++WW?0:W+D),I=I===e||I>W?W:Br(I),I<0&&(I+=W),I=D>I?0:Xg(I);D0&&D(fe)?m>1?Ht(fe,m-1,D,I,W):ti(W,fe):I||(W[W.length]=fe)}return W}var Ku=og(),Cl=og(!0);function ii(l,m){return l&&Ku(l,m,rn)}function ju(l,m){return l&&Cl(l,m,rn)}function ai(l,m){return Ki(m,function(D){return Ma(l[D])})}function Na(l,m){m=ao(m,l);for(var D=0,I=m.length;l!=null&&Dm}function vd(l,m){return l!=null&&at.call(l,m)}function gd(l,m){return l!=null&&m in kr(l)}function xd(l,m,D){return l>=Et(m,D)&&l=120&&qe.length>=120)?new Da(ae&&qe):e}qe=l[0];var Ve=-1,Ke=fe[0];e:for(;++Ve-1;)fe!==l&&ba.call(fe,he,1),ba.call(l,he,1);return l}function G0(l,m){for(var D=l?m.length:0,I=D-1;D--;){var W=m[D];if(D==I||W!==J){var J=W;Ca(W)?ba.call(l,W,1):Ed(l,W)}}return l}function Sd(l,m){return l+Io(hl()*(m-l+1))}function $B(l,m,D,I){for(var W=-1,J=Ft(Ss((m-l)/(D||1)),0),ae=Ne(J);J--;)ae[I?J:++W]=l,l+=D;return ae}function Nd(l,m){var D="";if(!l||m<1||m>q)return D;do m%2&&(D+=l),m=Io(m/2),m&&(l+=l);while(m);return D}function Rr(l,m){return zd(Dg(l,m,In),l+"")}function ZB(l){return Dl(Ls(l))}function QB(l,m){var D=Ls(l);return ql(D,Sa(m,0,D.length))}function nf(l,m,D,I){if(!Ct(l))return l;m=ao(m,l);for(var W=-1,J=m.length,ae=J-1,fe=l;fe!=null&&++WW?0:W+m),D=D>W?W:D,D<0&&(D+=W),W=m>D?0:D-m>>>0,m>>>=0;for(var J=Ne(W);++I>>1,ae=l[J];ae!==null&&!$n(ae)&&(D?ae<=m:ae=t){var Re=m?null:f4(l);if(Re)return Ka(Re);ae=!1,W=Ja,he=new Da}else he=m?[]:fe;e:for(;++I=I?l:ui(l,m,D)}var j0=Um||function(l){return Wt.clearTimeout(l)};function eg(l,m){if(m)return l.slice();var D=l.length,I=ul?ul(D):new l.constructor(D);return l.copy(I),I}function Td(l){var m=new l.constructor(l.byteLength);return new bs(m).set(new bs(l)),m}function e4(l,m){var D=m?Td(l.buffer):l.buffer;return new l.constructor(D,l.byteOffset,l.byteLength)}function r4(l){var m=new l.constructor(l.source,En.exec(l));return m.lastIndex=l.lastIndex,m}function t4(l){return qo?kr(qo.call(l)):{}}function rg(l,m){var D=m?Td(l.buffer):l.buffer;return new l.constructor(D,l.byteOffset,l.length)}function tg(l,m){if(l!==m){var D=l!==e,I=l===null,W=l===l,J=$n(l),ae=m!==e,fe=m===null,he=m===m,Re=$n(m);if(!fe&&!Re&&!J&&l>m||J&&ae&&he&&!fe&&!Re||I&&ae&&he||!D&&he||!W)return 1;if(!I&&!J&&!Re&&l=fe)return he;var Re=D[I];return he*(Re=="desc"?-1:1)}}return l.index-m.index}function ng(l,m,D,I){for(var W=-1,J=l.length,ae=D.length,fe=-1,he=m.length,Re=Ft(J-ae,0),qe=Ne(he+Re),Ve=!I;++fe1?D[W-1]:e,ae=W>2?D[2]:e;for(J=l.length>3&&typeof J=="function"?(W--,J):e,ae&&wn(D[0],D[1],ae)&&(J=W<3?e:J,W=1),m=kr(m);++I-1?W[J?m[ae]:ae]:e}}function fg(l){return Ea(function(m){var D=m.length,I=D,W=_n.prototype.thru;for(l&&m.reverse();I--;){var J=m[I];if(typeof J!="function")throw new Mn(i);if(W&&!ae&&Rl(J)=="wrapper")var ae=new _n([],!0)}for(I=ae?I:D;++I1&&Hr.reverse(),qe&&hefe))return!1;var Re=J.get(l),qe=J.get(m);if(Re&&qe)return Re==m&&qe==l;var Ve=-1,Ke=!0,cr=D&h?new Da:e;for(J.set(l,m),J.set(m,l);++Ve1?"& ":"")+m[I],m=m.join(D>2?", ":" "),l.replace(Su,\`{ +/* [wrapped with \`+m+\`] */ +\`)}function y4(l){return Fr(l)||Ho(l)||!!(cl&&l&&l[cl])}function Ca(l,m){var D=typeof l;return m=m??q,!!m&&(D=="number"||D!="symbol"&&Mi.test(l))&&l>-1&&l%1==0&&l0){if(++m>=_)return arguments[0]}else m=0;return l.apply(e,arguments)}}function ql(l,m){var D=-1,I=l.length,W=I-1;for(m=m===e?I:m;++D1?l[m-1]:e;return D=typeof D=="function"?(l.pop(),D):e,Ig(l,D)});function Pg(l){var m=Z(l);return m.__chain__=!0,m}function TI(l,m){return m(l),l}function Ul(l,m){return m(l)}var FI=Ea(function(l){var m=l.length,D=m?l[0]:0,I=this.__wrapped__,W=function(J){return Os(J,l)};return m>1||this.__actions__.length||!(I instanceof Ir)||!Ca(D)?this.thru(W):(I=I.slice(D,+D+(m?1:0)),I.__actions__.push({func:Ul,args:[W],thisArg:e}),new _n(I,this.__chain__).thru(function(J){return m&&!J.length&&J.push(e),J}))});function OI(){return Pg(this)}function BI(){return new _n(this.value(),this.__chain__)}function II(){this.__values__===e&&(this.__values__=Qg(this.value()));var l=this.__index__>=this.__values__.length,m=l?e:this.__values__[this.__index__++];return{done:l,value:m}}function PI(){return this}function kI(l){for(var m,D=this;D instanceof Ms;){var I=Mg(D);I.__index__=0,I.__values__=e,m?W.__wrapped__=I:m=I;var W=I;D=D.__wrapped__}return W.__wrapped__=l,m}function RI(){var l=this.__wrapped__;if(l instanceof Ir){var m=l;return this.__actions__.length&&(m=new Ir(this)),m=m.reverse(),m.__actions__.push({func:Ul,args:[Wd],thisArg:e}),new _n(m,this.__chain__)}return this.thru(Wd)}function LI(){return J0(this.__wrapped__,this.__actions__)}var qI=Ol(function(l,m,D){at.call(l,D)?++l[D]:Pi(l,D,1)});function UI(l,m,D){var I=Fr(l)?ms:dd;return D&&wn(l,m,D)&&(m=e),I(l,xr(m,3))}function zI(l,m){var D=Fr(l)?Ki:El;return D(l,xr(m,3))}var WI=ug(_g),VI=ug(Tg);function YI(l,m){return Ht(zl(l,m),1)}function HI(l,m){return Ht(zl(l,m),V)}function GI(l,m,D){return D=D===e?1:Br(D),Ht(zl(l,m),D)}function kg(l,m){var D=Fr(l)?Tt:na;return D(l,xr(m,3))}function Rg(l,m){var D=Fr(l)?xm:Al;return D(l,xr(m,3))}var $I=Ol(function(l,m,D){at.call(l,D)?l[D].push(m):Pi(l,D,[m])});function ZI(l,m,D,I){l=On(l)?l:Ls(l),D=D&&!I?Br(D):0;var W=l.length;return D<0&&(D=Ft(W+D,0)),Gl(l)?D<=W&&l.indexOf(m,D)>-1:!!W&&Xa(l,m,D)>-1}var QI=Rr(function(l,m,D){var I=-1,W=typeof m=="function",J=On(l)?Ne(l.length):[];return na(l,function(ae){J[++I]=W?an(m,ae,D):oi(ae,m,D)}),J}),XI=Ol(function(l,m,D){Pi(l,D,m)});function zl(l,m){var D=Fr(l)?ct:Te;return D(l,xr(m,3))}function JI(l,m,D,I){return l==null?[]:(Fr(m)||(m=m==null?[]:[m]),D=I?e:D,Fr(D)||(D=D==null?[]:[D]),Ri(l,m,D))}var KI=Ol(function(l,m,D){l[D?0:1].push(m)},function(){return[[],[]]});function jI(l,m,D){var I=Fr(l)?qu:el,W=arguments.length<3;return I(l,xr(m,4),D,W,na)}function eP(l,m,D){var I=Fr(l)?ym:el,W=arguments.length<3;return I(l,xr(m,4),D,W,Al)}function rP(l,m){var D=Fr(l)?Ki:El;return D(l,Yl(xr(m,3)))}function tP(l){var m=Fr(l)?Dl:ZB;return m(l)}function nP(l,m,D){(D?wn(l,m,D):m===e)?m=1:m=Br(m);var I=Fr(l)?ld:QB;return I(l,m)}function iP(l){var m=Fr(l)?cd:JB;return m(l)}function aP(l){if(l==null)return 0;if(On(l))return Gl(l)?ji(l):l.length;var m=pn(l);return m==Ae||m==ne?l.size:z(l).length}function oP(l,m,D){var I=Fr(l)?Uu:KB;return D&&wn(l,m,D)&&(m=e),I(l,xr(m,3))}var sP=Rr(function(l,m){if(l==null)return[];var D=m.length;return D>1&&wn(l,m[0],m[1])?m=[]:D>2&&wn(m[0],m[1],m[2])&&(m=[m[0]]),Ri(l,Ht(m,1),[])}),Wl=zm||function(){return Wt.Date.now()};function uP(l,m){if(typeof m!="function")throw new Mn(i);return l=Br(l),function(){if(--l<1)return m.apply(this,arguments)}}function Lg(l,m,D){return m=D?e:m,m=l&&m==null?l.length:m,Aa(l,E,e,e,e,e,m)}function qg(l,m){var D;if(typeof m!="function")throw new Mn(i);return l=Br(l),function(){return--l>0&&(D=m.apply(this,arguments)),l<=1&&(m=e),D}}var Yd=Rr(function(l,m,D){var I=x;if(D.length){var W=Yn(D,ks(Yd));I|=b}return Aa(l,I,m,D,W)}),Ug=Rr(function(l,m,D){var I=x|v;if(D.length){var W=Yn(D,ks(Ug));I|=b}return Aa(m,I,l,D,W)});function zg(l,m,D){m=D?e:m;var I=Aa(l,w,e,e,e,e,e,m);return I.placeholder=zg.placeholder,I}function Wg(l,m,D){m=D?e:m;var I=Aa(l,C,e,e,e,e,e,m);return I.placeholder=Wg.placeholder,I}function Vg(l,m,D){var I,W,J,ae,fe,he,Re=0,qe=!1,Ve=!1,Ke=!0;if(typeof l!="function")throw new Mn(i);m=li(m)||0,Ct(D)&&(qe=!!D.leading,Ve="maxWait"in D,J=Ve?Ft(li(D.maxWait)||0,m):J,Ke="trailing"in D?!!D.trailing:Ke);function cr(Rt){var qi=I,Ta=W;return I=W=e,Re=Rt,ae=l.apply(Ta,qi),ae}function wr(Rt){return Re=Rt,fe=sf(qr,m),qe?cr(Rt):ae}function Pr(Rt){var qi=Rt-he,Ta=Rt-Re,ux=m-qi;return Ve?Et(ux,J-Ta):ux}function Dr(Rt){var qi=Rt-he,Ta=Rt-Re;return he===e||qi>=m||qi<0||Ve&&Ta>=J}function qr(){var Rt=Wl();if(Dr(Rt))return Hr(Rt);fe=sf(qr,Pr(Rt))}function Hr(Rt){return fe=e,Ke&&I?cr(Rt):(I=W=e,ae)}function Zn(){fe!==e&&j0(fe),Re=0,I=he=W=fe=e}function Dn(){return fe===e?ae:Hr(Wl())}function Qn(){var Rt=Wl(),qi=Dr(Rt);if(I=arguments,W=this,he=Rt,qi){if(fe===e)return wr(he);if(Ve)return j0(fe),fe=sf(qr,m),cr(he)}return fe===e&&(fe=sf(qr,m)),ae}return Qn.cancel=Zn,Qn.flush=Dn,Qn}var fP=Rr(function(l,m){return Nl(l,1,m)}),lP=Rr(function(l,m,D){return Nl(l,li(m)||0,D)});function cP(l){return Aa(l,O)}function Vl(l,m){if(typeof l!="function"||m!=null&&typeof m!="function")throw new Mn(i);var D=function(){var I=arguments,W=m?m.apply(this,I):I[0],J=D.cache;if(J.has(W))return J.get(W);var ae=l.apply(this,I);return D.cache=J.set(W,ae)||J,ae};return D.cache=new(Vl.Cache||Ii),D}Vl.Cache=Ii;function Yl(l){if(typeof l!="function")throw new Mn(i);return function(){var m=arguments;switch(m.length){case 0:return!l.call(this);case 1:return!l.call(this,m[0]);case 2:return!l.call(this,m[0],m[1]);case 3:return!l.call(this,m[0],m[1],m[2])}return!l.apply(this,m)}}function pP(l){return qg(2,l)}var mP=jB(function(l,m){m=m.length==1&&Fr(m[0])?ct(m[0],cn(xr())):ct(Ht(m,1),cn(xr()));var D=m.length;return Rr(function(I){for(var W=-1,J=Et(I.length,D);++W=m}),Ho=_l(function(){return arguments}())?_l:function(l){return Ot(l)&&at.call(l,"callee")&&!ll.call(l,"callee")},Fr=Ne.isArray,MP=$f?cn($f):yd;function On(l){return l!=null&&Hl(l.length)&&!Ma(l)}function kt(l){return Ot(l)&&On(l)}function _P(l){return l===!0||l===!1||Ot(l)&&on(l)==pe}var so=pl||th,TP=Ru?cn(Ru):bd;function FP(l){return Ot(l)&&l.nodeType===1&&!uf(l)}function OP(l){if(l==null)return!0;if(On(l)&&(Fr(l)||typeof l=="string"||typeof l.splice=="function"||so(l)||Rs(l)||Ho(l)))return!l.length;var m=pn(l);if(m==Ae||m==ne)return!l.size;if(of(l))return!z(l).length;for(var D in l)if(at.call(l,D))return!1;return!0}function BP(l,m){return zo(l,m)}function IP(l,m,D){D=typeof D=="function"?D:e;var I=D?D(l,m):e;return I===e?zo(l,m,e,D):!!I}function Gd(l){if(!Ot(l))return!1;var m=on(l);return m==xe||m==Se||typeof l.message=="string"&&typeof l.name=="string"&&!uf(l)}function PP(l){return typeof l=="number"&&Po(l)}function Ma(l){if(!Ct(l))return!1;var m=on(l);return m==be||m==De||m==Me||m==ye}function Hg(l){return typeof l=="number"&&l==Br(l)}function Hl(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=q}function Ct(l){var m=typeof l;return l!=null&&(m=="object"||m=="function")}function Ot(l){return l!=null&&typeof l=="object"}var Gg=Zf?cn(Zf):tf;function kP(l,m){return l===m||ia(l,m,kd(m))}function RP(l,m,D){return D=typeof D=="function"?D:e,ia(l,m,kd(m),D)}function LP(l){return $g(l)&&l!=+l}function qP(l){if(D4(l))throw new Nr(n);return Wo(l)}function UP(l){return l===null}function zP(l){return l==null}function $g(l){return typeof l=="number"||Ot(l)&&on(l)==ze}function uf(l){if(!Ot(l)||on(l)!=K)return!1;var m=ws(l);if(m===null)return!0;var D=at.call(m,"constructor")&&m.constructor;return typeof D=="function"&&D instanceof D&&Oo.call(D)==Rm}var $d=Qf?cn(Qf):Wr;function WP(l){return Hg(l)&&l>=-q&&l<=q}var Zg=Mo?cn(Mo):g;function Gl(l){return typeof l=="string"||!Fr(l)&&Ot(l)&&on(l)==ue}function $n(l){return typeof l=="symbol"||Ot(l)&&on(l)==Ee}var Rs=Ti?cn(Ti):N;function VP(l){return l===e}function YP(l){return Ot(l)&&pn(l)==Le}function HP(l){return Ot(l)&&on(l)==Ie}var GP=kl(se),$P=kl(function(l,m){return l<=m});function Qg(l){if(!l)return[];if(On(l))return Gl(l)?xn(l):Fn(l);if(Bo&&l[Bo])return Mm(l[Bo]());var m=pn(l),D=m==Ae?Gu:m==ne?Ka:Ls;return D(l)}function _a(l){if(!l)return l===0?l:0;if(l=li(l),l===V||l===-V){var m=l<0?-1:1;return m*R}return l===l?l:0}function Br(l){var m=_a(l),D=m%1;return m===m?D?m-D:m:0}function Xg(l){return l?Sa(Br(l),0,U):0}function li(l){if(typeof l=="number")return l;if($n(l))return j;if(Ct(l)){var m=typeof l.valueOf=="function"?l.valueOf():l;l=Ct(m)?m+"":m}if(typeof l!="string")return l===0?l:+l;l=rl(l);var D=At.test(l);return D||Wn.test(l)?Hf(l.slice(2),D?2:8):Cn.test(l)?j:+l}function Jg(l){return aa(l,Bn(l))}function ZP(l){return l?Sa(Br(l),-q,q):l===0?l:0}function st(l){return l==null?"":Gn(l)}var QP=Is(function(l,m){if(of(m)||On(m)){aa(m,rn(m),l);return}for(var D in m)at.call(m,D)&&Uo(l,D,m[D])}),Kg=Is(function(l,m){aa(m,Bn(m),l)}),$l=Is(function(l,m,D,I){aa(m,Bn(m),l,I)}),XP=Is(function(l,m,D,I){aa(m,rn(m),l,I)}),JP=Ea(Os);function KP(l,m){var D=no(l);return m==null?D:Xu(D,m)}var jP=Rr(function(l,m){l=kr(l);var D=-1,I=m.length,W=I>2?m[2]:e;for(W&&wn(m[0],m[1],W)&&(I=1);++D1),J}),aa(l,Id(l),D),I&&(D=yn(D,o|u|p,l4));for(var W=m.length;W--;)Ed(D,m[W]);return D});function g5(l,m){return ex(l,Yl(xr(m)))}var x5=Ea(function(l,m){return l==null?{}:HB(l,m)});function ex(l,m){if(l==null)return{};var D=ct(Id(l),function(I){return[I]});return m=xr(m),H0(l,D,function(I,W){return m(I,W[0])})}function y5(l,m,D){m=ao(m,l);var I=-1,W=m.length;for(W||(W=1,l=e);++Im){var I=l;l=m,m=I}if(D||l%1||m%1){var W=hl();return Et(l+W*(m-l+Yf("1e-"+((W+"").length-1))),m)}return Sd(l,m)}var T5=Ps(function(l,m,D){return m=m.toLowerCase(),l+(D?nx(m):m)});function nx(l){return Xd(st(l).toLowerCase())}function ix(l){return l=st(l),l&&l.replace(Au,nl).replace(um,"")}function F5(l,m,D){l=st(l),m=Gn(m);var I=l.length;D=D===e?I:Sa(Br(D),0,I);var W=D;return D-=m.length,D>=0&&l.slice(D,W)==m}function O5(l){return l=st(l),l&&fr.test(l)?l.replace(Be,Nm):l}function B5(l){return l=st(l),l&&Va.test(l)?l.replace(Ci,"\\\\$&"):l}var I5=Ps(function(l,m,D){return l+(D?"-":"")+m.toLowerCase()}),P5=Ps(function(l,m,D){return l+(D?" ":"")+m.toLowerCase()}),k5=sg("toLowerCase");function R5(l,m,D){l=st(l),m=Br(m);var I=m?ji(l):0;if(!m||I>=m)return l;var W=(m-I)/2;return Pl(Io(W),D)+l+Pl(Ss(W),D)}function L5(l,m,D){l=st(l),m=Br(m);var I=m?ji(l):0;return m&&I>>0,D?(l=st(l),l&&(typeof m=="string"||m!=null&&!$d(m))&&(m=Gn(m),!m&&ni(l))?oo(xn(l),0,D):l.split(m,D)):[]}var H5=Ps(function(l,m,D){return l+(D?" ":"")+Xd(m)});function G5(l,m,D){return l=st(l),D=D==null?0:Sa(Br(D),0,l.length),m=Gn(m),l.slice(D,D+m.length)==m}function $5(l,m,D){var I=Z.templateSettings;D&&wn(l,m,D)&&(m=e),l=st(l),m=$l({},m,I,dg);var W=$l({},m.imports,I.imports,dg),J=rn(W),ae=Hu(W,J),fe,he,Re=0,qe=m.interpolate||Ya,Ve="__p += '",Ke=Fi((m.escape||Ya).source+"|"+qe.source+"|"+(qe===Yt?zt:Ya).source+"|"+(m.evaluate||Ya).source+"|$","g"),cr="//# sourceURL="+(at.call(m,"sourceURL")?(m.sourceURL+"").replace(/\\s/g," "):"lodash.templateSources["+ ++mm+"]")+\` +\`;l.replace(Ke,function(Dr,qr,Hr,Zn,Dn,Qn){return Hr||(Hr=Zn),Ve+=l.slice(Re,Qn).replace(Eu,Am),qr&&(fe=!0,Ve+=\`' + +__e(\`+qr+\`) + +'\`),Dn&&(he=!0,Ve+=\`'; +\`+Dn+\`; +__p += '\`),Hr&&(Ve+=\`' + +((__t = (\`+Hr+\`)) == null ? '' : __t) + +'\`),Re=Qn+Dr.length,Dr}),Ve+=\`'; +\`;var wr=at.call(m,"variable")&&m.variable;if(!wr)Ve=\`with (obj) { +\`+Ve+\` +} +\`;else if(va.test(wr))throw new Nr(a);Ve=(he?Ve.replace(We,""):Ve).replace(B,"$1").replace(Q,"$1;"),Ve="function("+(wr||"obj")+\`) { +\`+(wr?"":\`obj || (obj = {}); +\`)+"var __t, __p = ''"+(fe?", __e = _.escape":"")+(he?\`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } \`:\`; -\`)+O+\`return __p -}\`;var ae=_h(function(){return xe(x,q+"return "+O).apply(e,w)});if(ae.source=O,uf(ae))throw ae;return ae}function fy(t){return Te(t).toLowerCase()}function cy(t){return Te(t).toUpperCase()}function hy(t,n,s){if(t=Te(t),t&&(s||n===e))return Ys(t);if(!t||!(n=qt(n)))return t;var f=wt(t),d=wt(n),x=Me(f,d),w=Bs(f,d)+1;return Mn(f,x,w).join("")}function py(t,n,s){if(t=Te(t),t&&(s||n===e))return t.slice(0,Ai(t)+1);if(!t||!(n=qt(n)))return t;var f=wt(t),d=Bs(f,wt(n))+1;return Mn(f,0,d).join("")}function dy(t,n,s){if(t=Te(t),t&&(s||n===e))return t.replace(Y,"");if(!t||!(n=qt(n)))return t;var f=wt(t),d=Me(f,wt(n));return Mn(f,d).join("")}function my(t,n){var s=je,f=pr;if(Ve(n)){var d="separator"in n?n.separator:d;s="length"in n?ne(n.length):s,f="omission"in n?qt(n.omission):f}t=Te(t);var x=t.length;if(Xt(t)){var w=wt(t);x=w.length}if(s>=x)return t;var _=s-Fr(f);if(_<1)return f;var k=w?Mn(w,0,_).join(""):t.slice(0,_);if(d===e)return k+f;if(w&&(_+=k.length-_),lf(d)){if(t.slice(_).search(d)){var I,M=k;for(d.global||(d=xr(d.source,Te(Qt.exec(d))+"g")),d.lastIndex=0;I=d.exec(M);)var O=I.index;k=k.slice(0,O===e?_:O)}}else if(t.indexOf(qt(d),_)!=_){var W=k.lastIndexOf(d);W>-1&&(k=k.slice(0,W))}return k+f}function gy(t){return t=Te(t),t&&bi.test(t)?t.replace(da,zu):t}var yy=Xi(function(t,n,s){return t+(s?" ":"")+n.toUpperCase()}),hf=bc("toUpperCase");function Sh(t,n,s){return t=Te(t),n=s?e:n,n===e?Uu(t)?Qu(t):Lu(t):t.match(n)||[]}var _h=oe(function(t,n){try{return ht(t,e,n)}catch(s){return uf(s)?s:new Z(s)}}),xy=en(function(t,n){return He(n,function(s){s=Vr(s),_r(t,s,sf(t[s],t))}),t});function vy(t){var n=t==null?0:t.length,s=$();return t=n?Ee(t,function(f){if(typeof f[1]!="function")throw new Et(l);return[s(f[0]),f[1]]}):[],oe(function(f){for(var d=-1;++dQe)return[];var s=Pt,f=Be(t,Pt);n=$(n),t-=Pt;for(var d=La(f,n);++s0||n<0)?new ie(s):(t<0?s=s.takeRight(-t):t&&(s=s.drop(t)),n!==e&&(n=ne(n),s=n<0?s.dropRight(-n):s.take(n-t)),s)},ie.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},ie.prototype.toArray=function(){return this.take(Pt)},Jt(ie.prototype,function(t,n){var s=/^(?:filter|find|map|reject)|While$/.test(n),f=/^(?:head|last)$/.test(n),d=g[f?"take"+(n=="last"?"Right":""):n],x=f||/^find/.test(n);!d||(g.prototype[n]=function(){var w=this.__wrapped__,_=f?[1]:arguments,k=w instanceof ie,I=_[0],M=k||ee(w),O=function(ue){var he=d.apply(g,Zt([ue],_));return f&&W?he[0]:he};M&&s&&typeof I=="function"&&I.length!=1&&(k=M=!1);var W=this.__chain__,q=!!this.__actions__.length,j=x&&!W,ae=k&&!q;if(!x&&M){w=ae?w:new ie(this);var Q=t.apply(w,_);return Q.__actions__.push({func:Co,args:[O],thisArg:e}),new Dt(Q,W)}return j&&ae?t.apply(this,_):(Q=this.thru(O),j?f?Q.value()[0]:Q.value():Q)})}),He(["pop","push","shift","sort","splice","unshift"],function(t){var n=Gn[t],s=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",f=/^(?:pop|shift)$/.test(t);g.prototype[t]=function(){var d=arguments;if(f&&!this.__chain__){var x=this.value();return n.apply(ee(x)?x:[],d)}return this[s](function(w){return n.apply(ee(w)?w:[],d)})}}),Jt(ie.prototype,function(t,n){var s=g[n];if(s){var f=s.name+"";be.call(Pn,f)||(Pn[f]=[]),Pn[f].push({name:n,func:s})}}),Pn[xo(e,_e).name]=[{name:"wrapper",func:e}],ie.prototype.clone=fl,ie.prototype.reverse=cl,ie.prototype.value=hl,g.prototype.at=$m,g.prototype.chain=jm,g.prototype.commit=Qm,g.prototype.next=Km,g.prototype.plant=Xm,g.prototype.reverse=Jm,g.prototype.toJSON=g.prototype.valueOf=g.prototype.value=eg,g.prototype.first=g.prototype.head,$n&&(g.prototype[$n]=Zm),g},Nr=Ku();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(rt._=Nr,define(function(){return Nr})):Or?((Or.exports=Nr)._=Nr,Ea._=Nr):rt._=Nr}).call(ra)});var ep=Th((Bf,ia)=>{(function(e,r){typeof Bf=="object"&&typeof ia<"u"?ia.exports=r():typeof define=="function"&&define.amd?define(r):e.moment=r()})(Bf,function(){"use strict";var e;function r(){return e.apply(null,arguments)}function a(i){e=i}function u(i){return i instanceof Array||Object.prototype.toString.call(i)==="[object Array]"}function l(i){return i!=null&&Object.prototype.toString.call(i)==="[object Object]"}function p(i,o){return Object.prototype.hasOwnProperty.call(i,o)}function v(i){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(i).length===0;var o;for(o in i)if(p(i,o))return!1;return!0}function C(i){return i===void 0}function T(i){return typeof i=="number"||Object.prototype.toString.call(i)==="[object Number]"}function A(i){return i instanceof Date||Object.prototype.toString.call(i)==="[object Date]"}function R(i,o){var c=[],h,m=i.length;for(h=0;h>>0,h;for(h=0;h0)for(c=0;c=0;return(S?c?"+":"":"-")+Math.pow(10,Math.max(0,m)).toString().substr(1)+h}var Pt=/(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,mi=/(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,fa={},hn={};function H(i,o,c,h){var m=h;typeof h=="string"&&(m=function(){return this[h]()}),i&&(hn[i]=m),o&&(hn[o[0]]=function(){return xt(m.apply(this,arguments),o[1],o[2])}),c&&(hn[c]=function(){return this.localeData().ordinal(m.apply(this,arguments),i)})}function gi(i){return i.match(/\\[[\\s\\S]/)?i.replace(/^\\[|\\]$/g,""):i.replace(/\\\\/g,"")}function Xo(i){var o=i.match(Pt),c,h;for(c=0,h=o.length;c=0&&mi.test(i);)i=i.replace(mi,h),mi.lastIndex=0,c-=1;return i}var Jo={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function yi(i){var o=this._longDateFormat[i],c=this._longDateFormat[i.toUpperCase()];return o||!c?o:(this._longDateFormat[i]=c.match(Pt).map(function(h){return h==="MMMM"||h==="MM"||h==="DD"||h==="dddd"?h.slice(1):h}).join(""),this._longDateFormat[i])}var xi="Invalid date";function hs(){return this._invalidDate}var Yt="%d",Yn=/\\d{1,2}/;function eu(i){return this._ordinal.replace("%d",i)}var dr={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ps(i,o,c,h){var m=this._relativeTime[c];return me(m)?m(i,o,c,h):m.replace(/%d/i,i)}function tu(i,o){var c=this._relativeTime[i>0?"future":"past"];return me(c)?c(o):c.replace(/%s/i,o)}var mr={};function De(i,o){var c=i.toLowerCase();mr[c]=mr[c+"s"]=mr[o]=i}function st(i){return typeof i=="string"?mr[i]||mr[i.toLowerCase()]:void 0}function dn(i){var o={},c,h;for(h in i)p(i,h)&&(c=st(h),c&&(o[c]=i[h]));return o}var ds={};function Ue(i,o){ds[i]=o}function ru(i){var o=[],c;for(c in i)p(i,c)&&o.push({unit:c,priority:ds[c]});return o.sort(function(h,m){return h.priority-m.priority}),o}function Dr(i){return i%4===0&&i%100!==0||i%400===0}function nt(i){return i<0?Math.ceil(i)||0:Math.floor(i)}function te(i){var o=+i,c=0;return o!==0&&isFinite(o)&&(c=nt(o)),c}function Ir(i,o){return function(c){return c!=null?(vi(this,i,c),r.updateOffset(this,o),this):mn(this,i)}}function mn(i,o){return i.isValid()?i._d["get"+(i._isUTC?"UTC":"")+o]():NaN}function vi(i,o,c){i.isValid()&&!isNaN(c)&&(o==="FullYear"&&Dr(i.year())&&i.month()===1&&i.date()===29?(c=te(c),i._d["set"+(i._isUTC?"UTC":"")+o](c,i.month(),Ei(c,i.month()))):i._d["set"+(i._isUTC?"UTC":"")+o](c))}function ca(i){return i=st(i),me(this[i])?this[i]():this}function ha(i,o){if(typeof i=="object"){i=dn(i);var c=ru(i),h,m=c.length;for(h=0;h68?1900:2e3)};var ba=Ir("FullYear",!0);function gu(){return Dr(this.year())}function vs(i,o,c,h,m,S,E){var G;return i<100&&i>=0?(G=new Date(i+400,o,c,h,m,S,E),isFinite(G.getFullYear())&&G.setFullYear(i)):G=new Date(i,o,c,h,m,S,E),G}function yn(i){var o,c;return i<100&&i>=0?(c=Array.prototype.slice.call(arguments),c[0]=i+400,o=new Date(Date.UTC.apply(null,c)),isFinite(o.getUTCFullYear())&&o.setUTCFullYear(i)):o=new Date(Date.UTC.apply(null,arguments)),o}function xn(i,o,c){var h=7+o-c,m=(7+yn(i,0,h).getUTCDay()-o)%7;return-m+h-1}function ws(i,o,c,h,m){var S=(7+c-h)%7,E=xn(i,h,m),G=1+7*(o-1)+S+E,J,ve;return G<=0?(J=i-1,ve=Mr(J)+G):G>Mr(i)?(J=i+1,ve=G-Mr(i)):(J=i,ve=G),{year:J,dayOfYear:ve}}function vn(i,o,c){var h=xn(i.year(),o,c),m=Math.floor((i.dayOfYear()-h-1)/7)+1,S,E;return m<1?(E=i.year()-1,S=m+Vt(E,o,c)):m>Vt(i.year(),o,c)?(S=m-Vt(i.year(),o,c),E=i.year()+1):(E=i.year(),S=m),{week:S,year:E}}function Vt(i,o,c){var h=xn(i,o,c),m=xn(i+1,o,c);return(Mr(i)-h+m)/7}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),De("week","w"),De("isoWeek","W"),Ue("week",5),Ue("isoWeek",5),Y("w",Ae),Y("ww",Ae,ct),Y("W",Ae),Y("WW",Ae,ct),Vn(["w","ww","W","WW"],function(i,o,c,h){o[h.substr(0,1)]=te(i)});function ka(i){return vn(i,this._week.dow,this._week.doy).week}var wn={dow:0,doy:6};function Ss(){return this._week.dow}function _s(){return this._week.doy}function yu(i){var o=this.localeData().week(this);return i==null?o:this.add((i-o)*7,"d")}function bs(i){var o=vn(this,1,4).week;return i==null?o:this.add((i-o)*7,"d")}H("d",0,"do","day"),H("dd",0,0,function(i){return this.localeData().weekdaysMin(this,i)}),H("ddd",0,0,function(i){return this.localeData().weekdaysShort(this,i)}),H("dddd",0,0,function(i){return this.localeData().weekdays(this,i)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),De("day","d"),De("weekday","e"),De("isoWeekday","E"),Ue("day",11),Ue("weekday",11),Ue("isoWeekday",11),Y("d",Ae),Y("e",Ae),Y("E",Ae),Y("dd",function(i,o){return o.weekdaysMinRegex(i)}),Y("ddd",function(i,o){return o.weekdaysShortRegex(i)}),Y("dddd",function(i,o){return o.weekdaysRegex(i)}),Vn(["dd","ddd","dddd"],function(i,o,c,h){var m=c._locale.weekdaysParse(i,h,c._strict);m!=null?o.d=m:N(c).invalidWeekday=i}),Vn(["d","e","E"],function(i,o,c,h){o[h]=te(i)});function ks(i,o){return typeof i!="string"?i:isNaN(i)?(i=o.weekdaysParse(i),typeof i=="number"?i:null):parseInt(i,10)}function Cs(i,o){return typeof i=="string"?o.weekdaysParse(i)%7||7:isNaN(i)?null:i}function Di(i,o){return i.slice(o,7).concat(i.slice(0,o))}var xu="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ts="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),vu="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ps=qr,wu=qr,Su=qr;function _u(i,o){var c=u(this._weekdays)?this._weekdays:this._weekdays[i&&i!==!0&&this._weekdays.isFormat.test(o)?"format":"standalone"];return i===!0?Di(c,this._week.dow):i?c[i.day()]:c}function bu(i){return i===!0?Di(this._weekdaysShort,this._week.dow):i?this._weekdaysShort[i.day()]:this._weekdaysShort}function Ca(i){return i===!0?Di(this._weekdaysMin,this._week.dow):i?this._weekdaysMin[i.day()]:this._weekdaysMin}function ku(i,o,c){var h,m,S,E=i.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],h=0;h<7;++h)S=K([2e3,1]).day(h),this._minWeekdaysParse[h]=this.weekdaysMin(S,"").toLocaleLowerCase(),this._shortWeekdaysParse[h]=this.weekdaysShort(S,"").toLocaleLowerCase(),this._weekdaysParse[h]=this.weekdays(S,"").toLocaleLowerCase();return c?o==="dddd"?(m=Re.call(this._weekdaysParse,E),m!==-1?m:null):o==="ddd"?(m=Re.call(this._shortWeekdaysParse,E),m!==-1?m:null):(m=Re.call(this._minWeekdaysParse,E),m!==-1?m:null):o==="dddd"?(m=Re.call(this._weekdaysParse,E),m!==-1||(m=Re.call(this._shortWeekdaysParse,E),m!==-1)?m:(m=Re.call(this._minWeekdaysParse,E),m!==-1?m:null)):o==="ddd"?(m=Re.call(this._shortWeekdaysParse,E),m!==-1||(m=Re.call(this._weekdaysParse,E),m!==-1)?m:(m=Re.call(this._minWeekdaysParse,E),m!==-1?m:null)):(m=Re.call(this._minWeekdaysParse,E),m!==-1||(m=Re.call(this._weekdaysParse,E),m!==-1)?m:(m=Re.call(this._shortWeekdaysParse,E),m!==-1?m:null))}function Cu(i,o,c){var h,m,S;if(this._weekdaysParseExact)return ku.call(this,i,o,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),h=0;h<7;h++){if(m=K([2e3,1]).day(h),c&&!this._fullWeekdaysParse[h]&&(this._fullWeekdaysParse[h]=new RegExp("^"+this.weekdays(m,"").replace(".","\\\\.?")+"$","i"),this._shortWeekdaysParse[h]=new RegExp("^"+this.weekdaysShort(m,"").replace(".","\\\\.?")+"$","i"),this._minWeekdaysParse[h]=new RegExp("^"+this.weekdaysMin(m,"").replace(".","\\\\.?")+"$","i")),this._weekdaysParse[h]||(S="^"+this.weekdays(m,"")+"|^"+this.weekdaysShort(m,"")+"|^"+this.weekdaysMin(m,""),this._weekdaysParse[h]=new RegExp(S.replace(".",""),"i")),c&&o==="dddd"&&this._fullWeekdaysParse[h].test(i))return h;if(c&&o==="ddd"&&this._shortWeekdaysParse[h].test(i))return h;if(c&&o==="dd"&&this._minWeekdaysParse[h].test(i))return h;if(!c&&this._weekdaysParse[h].test(i))return h}}function Tu(i){if(!this.isValid())return i!=null?this:NaN;var o=this._isUTC?this._d.getUTCDay():this._d.getDay();return i!=null?(i=ks(i,this.localeData()),this.add(i-o,"d")):o}function Pu(i){if(!this.isValid())return i!=null?this:NaN;var o=(this.day()+7-this.localeData()._week.dow)%7;return i==null?o:this.add(i-o,"d")}function Eu(i){if(!this.isValid())return i!=null?this:NaN;if(i!=null){var o=Cs(i,this.localeData());return this.day(this.day()%7?o:o-7)}else return this.day()||7}function Fe(i){return this._weekdaysParseExact?(p(this,"_weekdaysRegex")||Ta.call(this),i?this._weekdaysStrictRegex:this._weekdaysRegex):(p(this,"_weekdaysRegex")||(this._weekdaysRegex=Ps),this._weekdaysStrictRegex&&i?this._weekdaysStrictRegex:this._weekdaysRegex)}function Ie(i){return this._weekdaysParseExact?(p(this,"_weekdaysRegex")||Ta.call(this),i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(p(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=wu),this._weekdaysShortStrictRegex&&i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Du(i){return this._weekdaysParseExact?(p(this,"_weekdaysRegex")||Ta.call(this),i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(p(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Su),this._weekdaysMinStrictRegex&&i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ta(){function i(dt,rr){return rr.length-dt.length}var o=[],c=[],h=[],m=[],S,E,G,J,ve;for(S=0;S<7;S++)E=K([2e3,1]).day(S),G=vt(this.weekdaysMin(E,"")),J=vt(this.weekdaysShort(E,"")),ve=vt(this.weekdays(E,"")),o.push(G),c.push(J),h.push(ve),m.push(G),m.push(J),m.push(ve);o.sort(i),c.sort(i),h.sort(i),m.sort(i),this._weekdaysRegex=new RegExp("^("+m.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Pa(){return this.hours()%12||12}function Iu(){return this.hours()||24}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Pa),H("k",["kk",2],0,Iu),H("hmm",0,0,function(){return""+Pa.apply(this)+xt(this.minutes(),2)}),H("hmmss",0,0,function(){return""+Pa.apply(this)+xt(this.minutes(),2)+xt(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+xt(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+xt(this.minutes(),2)+xt(this.seconds(),2)});function Es(i,o){H(i,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),o)})}Es("a",!0),Es("A",!1),De("hour","h"),Ue("hour",13);function Ds(i,o){return o._meridiemParse}Y("a",Ds),Y("A",Ds),Y("H",Ae),Y("h",Ae),Y("k",Ae),Y("HH",Ae,ct),Y("hh",Ae,ct),Y("kk",Ae,ct),Y("hmm",da),Y("hmmss",ma),Y("Hmm",da),Y("Hmmss",ma),Ce(["H","HH"],Ke),Ce(["k","kk"],function(i,o,c){var h=te(i);o[Ke]=h===24?0:h}),Ce(["a","A"],function(i,o,c){c._isPm=c._locale.isPM(i),c._meridiem=i}),Ce(["h","hh"],function(i,o,c){o[Ke]=te(i),N(c).bigHour=!0}),Ce("hmm",function(i,o,c){var h=i.length-2;o[Ke]=te(i.substr(0,h)),o[Bt]=te(i.substr(h)),N(c).bigHour=!0}),Ce("hmmss",function(i,o,c){var h=i.length-4,m=i.length-2;o[Ke]=te(i.substr(0,h)),o[Bt]=te(i.substr(h,2)),o[gr]=te(i.substr(m)),N(c).bigHour=!0}),Ce("Hmm",function(i,o,c){var h=i.length-2;o[Ke]=te(i.substr(0,h)),o[Bt]=te(i.substr(h))}),Ce("Hmmss",function(i,o,c){var h=i.length-4,m=i.length-2;o[Ke]=te(i.substr(0,h)),o[Bt]=te(i.substr(h,2)),o[gr]=te(i.substr(m))});function Is(i){return(i+"").toLowerCase().charAt(0)==="p"}var Mu=/[ap]\\.?m?\\.?/i,rt=Ir("Hours",!0);function Ea(i,o,c){return i>11?c?"pm":"PM":c?"am":"AM"}var Or={calendar:Qe,longDateFormat:Jo,invalidDate:xi,ordinal:Yt,dayOfMonthOrdinalParse:Yn,relativeTime:dr,months:fu,monthsShort:ms,week:wn,weekdays:xu,weekdaysMin:vu,weekdaysShort:Ts,meridiemParse:Mu},Ne={},zr={},ut;function Ms(i,o){var c,h=Math.min(i.length,o.length);for(c=0;c0;){if(m=Un(S.slice(0,c).join("-")),m)return m;if(h&&h.length>=c&&Ms(S,h)>=c-1)break;c--}o++}return ut}function As(i){return i.match("^[^/\\\\\\\\]*$")!=null}function Un(i){var o=null,c;if(Ne[i]===void 0&&typeof ia<"u"&&ia&&ia.exports&&As(i))try{o=ut._abbr,c=require,c("./locale/"+i),yr(o)}catch{Ne[i]=null}return Ne[i]}function yr(i,o){var c;return i&&(C(o)?c=He(i):c=ht(i,o),c?ut=c:typeof console<"u"&&console.warn&&console.warn("Locale "+i+" not found. Did you forget to load it?")),ut._abbr}function ht(i,o){if(o!==null){var c,h=Or;if(o.abbr=i,Ne[i]!=null)jt("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),h=Ne[i]._config;else if(o.parentLocale!=null)if(Ne[o.parentLocale]!=null)h=Ne[o.parentLocale]._config;else if(c=Un(o.parentLocale),c!=null)h=c._config;else return zr[o.parentLocale]||(zr[o.parentLocale]=[]),zr[o.parentLocale].push({name:i,config:o}),null;return Ne[i]=new Rt(mt(h,o)),zr[i]&&zr[i].forEach(function(m){ht(m.name,m.config)}),yr(i),Ne[i]}else return delete Ne[i],null}function Ou(i,o){if(o!=null){var c,h,m=Or;Ne[i]!=null&&Ne[i].parentLocale!=null?Ne[i].set(mt(Ne[i]._config,o)):(h=Un(i),h!=null&&(m=h._config),o=mt(m,o),h==null&&(o.abbr=i),c=new Rt(o),c.parentLocale=Ne[i],Ne[i]=c),yr(i)}else Ne[i]!=null&&(Ne[i].parentLocale!=null?(Ne[i]=Ne[i].parentLocale,i===yr()&&yr(i)):Ne[i]!=null&&delete Ne[i]);return Ne[i]}function He(i){var o;if(i&&i._locale&&i._locale._abbr&&(i=i._locale._abbr),!i)return ut;if(!u(i)){if(o=Un(i),o)return o;i=[i]}return Os(i)}function Au(){return Oe(Ne)}function Ii(i){var o,c=i._a;return c&&N(i).overflow===-2&&(o=c[Qt]<0||c[Qt]>11?Qt:c[Kt]<1||c[Kt]>Ei(c[ot],c[Qt])?Kt:c[Ke]<0||c[Ke]>24||c[Ke]===24&&(c[Bt]!==0||c[gr]!==0||c[Gr]!==0)?Ke:c[Bt]<0||c[Bt]>59?Bt:c[gr]<0||c[gr]>59?gr:c[Gr]<0||c[Gr]>999?Gr:-1,N(i)._overflowDayOfYear&&(oKt)&&(o=Kt),N(i)._overflowWeeks&&o===-1&&(o=uu),N(i)._overflowWeekday&&o===-1&&(o=Pi),N(i).overflow=o),i}var Ar=/^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,Mi=/^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,Ia=/Z|[+-]\\d\\d(?::?\\d\\d)?/,Ee=[["YYYYYY-MM-DD",/[+-]\\d{6}-\\d\\d-\\d\\d/],["YYYY-MM-DD",/\\d{4}-\\d\\d-\\d\\d/],["GGGG-[W]WW-E",/\\d{4}-W\\d\\d-\\d/],["GGGG-[W]WW",/\\d{4}-W\\d\\d/,!1],["YYYY-DDD",/\\d{4}-\\d{3}/],["YYYY-MM",/\\d{4}-\\d\\d/,!1],["YYYYYYMMDD",/[+-]\\d{10}/],["YYYYMMDD",/\\d{8}/],["GGGG[W]WWE",/\\d{4}W\\d{3}/],["GGGG[W]WW",/\\d{4}W\\d{2}/,!1],["YYYYDDD",/\\d{7}/],["YYYYMM",/\\d{6}/,!1],["YYYY",/\\d{4}/,!1]],Zt=[["HH:mm:ss.SSSS",/\\d\\d:\\d\\d:\\d\\d\\.\\d+/],["HH:mm:ss,SSSS",/\\d\\d:\\d\\d:\\d\\d,\\d+/],["HH:mm:ss",/\\d\\d:\\d\\d:\\d\\d/],["HH:mm",/\\d\\d:\\d\\d/],["HHmmss.SSSS",/\\d\\d\\d\\d\\d\\d\\.\\d+/],["HHmmss,SSSS",/\\d\\d\\d\\d\\d\\d,\\d+/],["HHmmss",/\\d\\d\\d\\d\\d\\d/],["HHmm",/\\d\\d\\d\\d/],["HH",/\\d\\d/]],Ma=/^\\/?Date\\((-?\\d+)/i,Fu=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,Oa={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Fs(i){var o,c,h=i._i,m=Ar.exec(h)||Mi.exec(h),S,E,G,J,ve=Ee.length,dt=Zt.length;if(m){for(N(i).iso=!0,o=0,c=ve;oMr(E)||i._dayOfYear===0)&&(N(i)._overflowDayOfYear=!0),c=yn(E,0,i._dayOfYear),i._a[Qt]=c.getUTCMonth(),i._a[Kt]=c.getUTCDate()),o=0;o<3&&i._a[o]==null;++o)i._a[o]=h[o]=m[o];for(;o<7;o++)i._a[o]=h[o]=i._a[o]==null?o===2?1:0:i._a[o];i._a[Ke]===24&&i._a[Bt]===0&&i._a[gr]===0&&i._a[Gr]===0&&(i._nextDay=!0,i._a[Ke]=0),i._d=(i._useUTC?yn:vs).apply(null,h),S=i._useUTC?i._d.getUTCDay():i._d.getDay(),i._tzm!=null&&i._d.setUTCMinutes(i._d.getUTCMinutes()-i._tzm),i._nextDay&&(i._a[Ke]=24),i._w&&typeof i._w.d<"u"&&i._w.d!==S&&(N(i).weekdayMismatch=!0)}}function Ws(i){var o,c,h,m,S,E,G,J,ve;o=i._w,o.GG!=null||o.W!=null||o.E!=null?(S=1,E=4,c=$r(o.GG,i._a[ot],vn(Me(),1,4).year),h=$r(o.W,1),m=$r(o.E,1),(m<1||m>7)&&(J=!0)):(S=i._locale._week.dow,E=i._locale._week.doy,ve=vn(Me(),S,E),c=$r(o.gg,i._a[ot],ve.year),h=$r(o.w,ve.week),o.d!=null?(m=o.d,(m<0||m>6)&&(J=!0)):o.e!=null?(m=o.e+S,(o.e<0||o.e>6)&&(J=!0)):m=S),h<1||h>Vt(c,S,E)?N(i)._overflowWeeks=!0:J!=null?N(i)._overflowWeekday=!0:(G=ws(c,h,m,S,E),i._a[ot]=G.year,i._dayOfYear=G.dayOfYear)}r.ISO_8601=function(){},r.RFC_2822=function(){};function Fa(i){if(i._f===r.ISO_8601){Fs(i);return}if(i._f===r.RFC_2822){Ls(i);return}i._a=[],N(i).empty=!0;var o=""+i._i,c,h,m,S,E,G=o.length,J=0,ve,dt;for(m=pn(i._f,i._locale).match(Pt)||[],dt=m.length,c=0;c0&&N(i).unusedInput.push(E),o=o.slice(o.indexOf(h)+h.length),J+=h.length),hn[S]?(h?N(i).empty=!1:N(i).unusedTokens.push(S),ou(S,h,i)):i._strict&&!h&&N(i).unusedTokens.push(S);N(i).charsLeftOver=G-J,o.length>0&&N(i).unusedInput.push(o),i._a[Ke]<=12&&N(i).bigHour===!0&&i._a[Ke]>0&&(N(i).bigHour=void 0),N(i).parsedDateParts=i._a.slice(0),N(i).meridiem=i._meridiem,i._a[Ke]=Na(i._locale,i._a[Ke],i._meridiem),ve=N(i).era,ve!==null&&(i._a[ot]=i._locale.erasConvertYear(ve,i._a[ot])),Hn(i),Ii(i)}function Na(i,o,c){var h;return c==null?o:i.meridiemHour!=null?i.meridiemHour(o,c):(i.isPM!=null&&(h=i.isPM(c),h&&o<12&&(o+=12),!h&&o===12&&(o=0)),o)}function La(i){var o,c,h,m,S,E,G=!1,J=i._f.length;if(J===0){N(i).invalidFormat=!0,i._d=new Date(NaN);return}for(m=0;mthis?this:i:ye()});function Vs(i,o){var c,h;if(o.length===1&&u(o[0])&&(o=o[0]),!o.length)return Me();for(c=o[0],h=1;hthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function D(){if(!C(this._isDSTShifted))return this._isDSTShifted;var i={},o;return ze(i,this),i=gt(i),i._a?(o=i._isUTC?K(i._a):Me(i._a),this._isDSTShifted=this.isValid()&&qu(i._a,o.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function P(){return this.isValid()?!this._isUTC:!1}function B(){return this.isValid()?this._isUTC:!1}function Z(){return this.isValid()?this._isUTC&&this._offset===0:!1}var xe=/^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,Ze=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function se(i,o){var c=i,h=null,m,S,E;return Ut(i)?c={ms:i._milliseconds,d:i._days,M:i._months}:T(i)||!isNaN(+i)?(c={},o?c[o]=+i:c.milliseconds=+i):(h=xe.exec(i))?(m=h[1]==="-"?-1:1,c={y:0,d:te(h[Kt])*m,h:te(h[Ke])*m,m:te(h[Bt])*m,s:te(h[gr])*m,ms:te(bn(h[Gr]*1e3))*m}):(h=Ze.exec(i))?(m=h[1]==="-"?-1:1,c={y:xr(h[2],m),M:xr(h[3],m),w:xr(h[4],m),d:xr(h[5],m),h:xr(h[6],m),m:xr(h[7],m),s:xr(h[8],m)}):c==null?c={}:typeof c=="object"&&("from"in c||"to"in c)&&(E=Et(Me(c.from),Me(c.to)),c={},c.ms=E.milliseconds,c.M=E.months),S=new qn(c),Ut(i)&&p(i,"_locale")&&(S._locale=i._locale),Ut(i)&&p(i,"_isValid")&&(S._isValid=i._isValid),S}se.fn=qn.prototype,se.invalid=Wa;function xr(i,o){var c=i&&parseFloat(i.replace(",","."));return(isNaN(c)?0:c)*o}function Hs(i,o){var c={};return c.months=o.month()-i.month()+(o.year()-i.year())*12,i.clone().add(c.months,"M").isAfter(o)&&--c.months,c.milliseconds=+o-+i.clone().add(c.months,"M"),c}function Et(i,o){var c;return i.isValid()&&o.isValid()?(o=wt(o,i),i.isBefore(o)?c=Hs(i,o):(c=Hs(o,i),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function Gn(i,o){return function(c,h){var m,S;return h!==null&&!isNaN(+h)&&(jt(o,"moment()."+o+"(period, number) is deprecated. Please use moment()."+o+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),S=c,c=h,h=S),m=se(c,h),qs(this,m,i),this}}function qs(i,o,c,h){var m=o._milliseconds,S=bn(o._days),E=bn(o._months);!i.isValid()||(h=h??!0,E&&va(i,mn(i,"Month")+E*c),S&&vi(i,"Date",mn(i,"Date")+S*c),m&&i._d.setTime(i._d.valueOf()+m*c),h&&r.updateOffset(i,S||E))}var kn=Gn(1,"add"),Fi=Gn(-1,"subtract");function zn(i){return typeof i=="string"||i instanceof String}function be(i){return Pe(i)||A(i)||zn(i)||T(i)||Gs(i)||Zu(i)||i===null||i===void 0}function Zu(i){var o=l(i)&&!v(i),c=!1,h=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],m,S,E=h.length;for(m=0;mc.valueOf():c.valueOf()9999?Er(c,o?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):me(Date.prototype.toISOString)?o?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Er(c,"Z")):Er(c,o?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Qr(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var i="moment",o="",c,h,m,S;return this.isLocal()||(i=this.utcOffset()===0?"moment.utc":"moment.parseZone",o="Z"),c="["+i+'("]',h=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",m="-MM-DD[T]HH:mm:ss.SSS",S=o+'[")]',this.format(c+h+m+S)}function Yi(i){i||(i=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var o=Er(this,i);return this.localeData().postformat(o)}function tl(i,o){return this.isValid()&&(Pe(i)&&i.isValid()||Me(i).isValid())?se({to:this,from:i}).locale(this.locale()).humanize(!o):this.localeData().invalidDate()}function rl(i){return this.from(Me(),i)}function nl(i,o){return this.isValid()&&(Pe(i)&&i.isValid()||Me(i).isValid())?se({from:this,to:i}).locale(this.locale()).humanize(!o):this.localeData().invalidDate()}function Bi(i){return this.to(Me(),i)}function jn(i){var o;return i===void 0?this._locale._abbr:(o=He(i),o!=null&&(this._locale=o),this)}var Vi=je("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(i){return i===void 0?this.localeData():this.locale(i)});function Ks(){return this._locale}var Qn=1e3,Cn=60*Qn,Ui=60*Cn,qe=(365*400+97)*24*Ui;function Be(i,o){return(i%o+o)%o}function Zs(i,o,c){return i<100&&i>=0?new Date(i+400,o,c)-qe:new Date(i,o,c).valueOf()}function Xs(i,o,c){return i<100&&i>=0?Date.UTC(i+400,o,c)-qe:Date.UTC(i,o,c)}function Js(i){var o,c;if(i=st(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(c=this._isUTC?Xs:Zs,i){case"year":o=c(this.year(),0,1);break;case"quarter":o=c(this.year(),this.month()-this.month()%3,1);break;case"month":o=c(this.year(),this.month(),1);break;case"week":o=c(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":o=c(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":o=c(this.year(),this.month(),this.date());break;case"hour":o=this._d.valueOf(),o-=Be(o+(this._isUTC?0:this.utcOffset()*Cn),Ui);break;case"minute":o=this._d.valueOf(),o-=Be(o,Cn);break;case"second":o=this._d.valueOf(),o-=Be(o,Qn);break}return this._d.setTime(o),r.updateOffset(this,!0),this}function il(i){var o,c;if(i=st(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(c=this._isUTC?Xs:Zs,i){case"year":o=c(this.year()+1,0,1)-1;break;case"quarter":o=c(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":o=c(this.year(),this.month()+1,1)-1;break;case"week":o=c(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":o=c(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":o=c(this.year(),this.month(),this.date()+1)-1;break;case"hour":o=this._d.valueOf(),o+=Ui-Be(o+(this._isUTC?0:this.utcOffset()*Cn),Ui)-1;break;case"minute":o=this._d.valueOf(),o+=Cn-Be(o,Cn)-1;break;case"second":o=this._d.valueOf(),o+=Qn-Be(o,Qn)-1;break}return this._d.setTime(o),r.updateOffset(this,!0),this}function Ya(){return this._d.valueOf()-(this._offset||0)*6e4}function Kn(){return Math.floor(this.valueOf()/1e3)}function Ba(){return new Date(this.valueOf())}function Tn(){var i=this;return[i.year(),i.month(),i.date(),i.hour(),i.minute(),i.second(),i.millisecond()]}function Zn(){var i=this;return{years:i.year(),months:i.month(),date:i.date(),hours:i.hours(),minutes:i.minutes(),seconds:i.seconds(),milliseconds:i.milliseconds()}}function Xn(){return this.isValid()?this.toISOString():null}function Hi(){return Le(this)}function Pn(){return V({},N(this))}function al(){return N(this).overflow}function sl(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),Y("N",ie),Y("NN",ie),Y("NNN",ie),Y("NNNN",fl),Y("NNNNN",cl),Ce(["N","NN","NNN","NNNN","NNNNN"],function(i,o,c,h){var m=c._locale.erasParse(i,h,c._strict);m?N(c).era=m:N(c).invalidEra=i}),Y("y",gn),Y("yy",gn),Y("yyy",gn),Y("yyyy",gn),Y("yo",hl),Ce(["y","yy","yyy","yyyy"],ot),Ce(["yo"],function(i,o,c,h){var m;c._locale._eraYearOrdinalRegex&&(m=i.match(c._locale._eraYearOrdinalRegex)),c._locale.eraYearOrdinalParse?o[ot]=c._locale.eraYearOrdinalParse(i,m):o[ot]=parseInt(i,10)});function ol(i,o){var c,h,m,S=this._eras||He("en")._eras;for(c=0,h=S.length;c=0)return S[h]}function ll(i,o){var c=i.since<=i.until?1:-1;return o===void 0?r(i.since).year():r(i.since).year()+(o-i.offset)*c}function qi(){var i,o,c,h=this.localeData().eras();for(i=0,o=h.length;iS&&(o=S),xl.call(this,i,o,c,h,m))}function xl(i,o,c,h,m){var S=ws(i,o,c,h,m),E=yn(S.year,0,S.dayOfYear);return this.year(E.getUTCFullYear()),this.month(E.getUTCMonth()),this.date(E.getUTCDate()),this}H("Q",0,"Qo","quarter"),De("quarter","Q"),Ue("quarter",7),Y("Q",wi),Ce("Q",function(i,o){o[Qt]=(te(i)-1)*3});function vl(i){return i==null?Math.ceil((this.month()+1)/3):this.month((i-1)*3+this.month()%3)}H("D",["DD",2],"Do","date"),De("date","D"),Ue("date",9),Y("D",Ae),Y("DD",Ae,ct),Y("Do",function(i,o){return i?o._dayOfMonthOrdinalParse||o._ordinalParse:o._dayOfMonthOrdinalParseLenient}),Ce(["D","DD"],Kt),Ce("Do",function(i,o){o[Kt]=te(i.match(Ae)[0])});var ro=Ir("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),De("dayOfYear","DDD"),Ue("dayOfYear",4),Y("DDD",bi),Y("DDDD",Si),Ce(["DDD","DDDD"],function(i,o,c){c._dayOfYear=te(i)});function Sr(i){var o=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return i==null?o:this.add(i-o,"d")}H("m",["mm",2],0,"minute"),De("minute","m"),Ue("minute",14),Y("m",Ae),Y("mm",Ae,ct),Ce(["m","mm"],Bt);var wl=Ir("Minutes",!1);H("s",["ss",2],0,"second"),De("second","s"),Ue("second",15),Y("s",Ae),Y("ss",Ae,ct),Ce(["s","ss"],gr);var Sl=Ir("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return this.millisecond()*10}),H(0,["SSSSS",5],0,function(){return this.millisecond()*100}),H(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),H(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),H(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),H(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),De("millisecond","ms"),Ue("millisecond",16),Y("S",bi,wi),Y("SS",bi,ct),Y("SSS",bi,Si);var Rr,no;for(Rr="SSSS";Rr.length<=9;Rr+="S")Y(Rr,gn);function _l(i,o){o[Gr]=te(("0."+i)*1e3)}for(Rr="S";Rr.length<=9;Rr+="S")Ce(Rr,_l);no=Ir("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");function Kr(){return this._isUTC?"UTC":""}function bl(){return this._isUTC?"Coordinated Universal Time":""}var F=$e.prototype;F.add=kn,F.calendar=Ju,F.clone=el,F.diff=js,F.endOf=il,F.format=Yi,F.from=tl,F.fromNow=rl,F.to=nl,F.toNow=Bi,F.get=ca,F.invalidAt=al,F.isAfter=Li,F.isBefore=Lr,F.isBetween=Ri,F.isSame=zs,F.isSameOrAfter=Wi,F.isSameOrBefore=$s,F.isValid=Hi,F.lang=Vi,F.locale=jn,F.localeData=Ks,F.max=Wu,F.min=Bs,F.parsingFlags=Pn,F.set=ha,F.startOf=Js,F.subtract=Fi,F.toArray=Tn,F.toObject=Zn,F.toDate=Ba,F.toISOString=$n,F.inspect=Qr,typeof Symbol<"u"&&Symbol.for!=null&&(F[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),F.toJSON=Xn,F.toString=Qs,F.unix=Kn,F.valueOf=Ya,F.creationData=sl,F.eraName=qi,F.eraNarrow=Jn,F.eraAbbr=eo,F.eraYear=g,F.year=ba,F.isLeapYear=gu,F.weekYear=pl,F.isoWeekYear=dl,F.quarter=F.quarters=vl,F.month=wa,F.daysInMonth=xs,F.week=F.weeks=yu,F.isoWeek=F.isoWeeks=bs,F.weeksInYear=wr,F.weeksInWeekYear=yl,F.isoWeeksInYear=ml,F.isoWeeksInISOWeekYear=gl,F.date=ro,F.day=F.days=Tu,F.weekday=Pu,F.isoWeekday=Eu,F.dayOfYear=Sr,F.hour=F.hours=rt,F.minute=F.minutes=wl,F.second=F.seconds=Sl,F.millisecond=F.milliseconds=no,F.utcOffset=zu,F.utc=ju,F.local=Qu,F.parseZone=Ku,F.hasAlignedHourOffset=Nr,F.isDST=b,F.isLocal=P,F.isUtcOffset=B,F.isUtc=Z,F.isUTC=Z,F.zoneAbbr=Kr,F.zoneName=bl,F.dates=je("dates accessor is deprecated. Use date instead.",ro),F.months=je("months accessor is deprecated. Use month instead",wa),F.years=je("years accessor is deprecated. Use year instead",ba),F.zone=je("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",$u),F.isDSTShifted=je("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",D);function Ht(i){return Me(i*1e3)}function kl(){return Me.apply(null,arguments).parseZone()}function io(i){return i}var ge=Rt.prototype;ge.calendar=Wt,ge.longDateFormat=yi,ge.invalidDate=hs,ge.ordinal=eu,ge.preparse=io,ge.postformat=io,ge.relativeTime=ps,ge.pastFuture=tu,ge.set=at,ge.eras=ol,ge.erasParse=ul,ge.erasConvertYear=ll,ge.erasAbbrRegex=Gi,ge.erasNameRegex=En,ge.erasNarrowRegex=Dt,ge.months=cu,ge.monthsShort=hu,ge.monthsParse=du,ge.monthsRegex=mu,ge.monthsShortRegex=Sa,ge.week=ka,ge.firstDayOfYear=_s,ge.firstDayOfWeek=Ss,ge.weekdays=_u,ge.weekdaysMin=Ca,ge.weekdaysShort=bu,ge.weekdaysParse=Cu,ge.weekdaysRegex=Fe,ge.weekdaysShortRegex=Ie,ge.weekdaysMinRegex=Du,ge.isPM=Is,ge.meridiem=Ea;function $i(i,o,c,h){var m=He(),S=K().set(h,o);return m[c](S,i)}function ao(i,o,c){if(T(i)&&(o=i,i=void 0),i=i||"",o!=null)return $i(i,o,c,"month");var h,m=[];for(h=0;h<12;h++)m[h]=$i(i,h,c,"month");return m}function ji(i,o,c,h){typeof i=="boolean"?(T(o)&&(c=o,o=void 0),o=o||""):(o=i,c=o,i=!1,T(o)&&(c=o,o=void 0),o=o||"");var m=He(),S=i?m._week.dow:0,E,G=[];if(c!=null)return $i(o,(c+S)%7,h,"day");for(E=0;E<7;E++)G[E]=$i(o,(E+S)%7,h,"day");return G}function so(i,o){return ao(i,o,"months")}function Cl(i,o){return ao(i,o,"monthsShort")}function Tl(i,o,c){return ji(i,o,c,"weekdays")}function Va(i,o,c){return ji(i,o,c,"weekdaysShort")}function ei(i,o,c){return ji(i,o,c,"weekdaysMin")}yr("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\\d{1,2}(th|st|nd|rd)/,ordinal:function(i){var o=i%10,c=te(i%100/10)===1?"th":o===1?"st":o===2?"nd":o===3?"rd":"th";return i+c}}),r.lang=je("moment.lang is deprecated. Use moment.locale instead.",yr),r.langData=je("moment.langData is deprecated. Use moment.localeData instead.",He);var It=Math.abs;function Pl(){var i=this._data;return this._milliseconds=It(this._milliseconds),this._days=It(this._days),this._months=It(this._months),i.milliseconds=It(i.milliseconds),i.seconds=It(i.seconds),i.minutes=It(i.minutes),i.hours=It(i.hours),i.months=It(i.months),i.years=It(i.years),this}function Ua(i,o,c,h){var m=se(o,c);return i._milliseconds+=h*m._milliseconds,i._days+=h*m._days,i._months+=h*m._months,i._bubble()}function El(i,o){return Ua(this,i,o,1)}function _r(i,o){return Ua(this,i,o,-1)}function Qi(i){return i<0?Math.floor(i):Math.ceil(i)}function Zr(){var i=this._milliseconds,o=this._days,c=this._months,h=this._data,m,S,E,G,J;return i>=0&&o>=0&&c>=0||i<=0&&o<=0&&c<=0||(i+=Qi(Ha(c)+o)*864e5,o=0,c=0),h.milliseconds=i%1e3,m=nt(i/1e3),h.seconds=m%60,S=nt(m/60),h.minutes=S%60,E=nt(S/60),h.hours=E%24,o+=nt(E/24),J=nt(St(o)),c+=J,o-=Qi(Ha(J)),G=nt(c/12),c%=12,h.days=o,h.months=c,h.years=G,this}function St(i){return i*4800/146097}function Ha(i){return i*146097/4800}function oo(i){if(!this.isValid())return NaN;var o,c,h=this._milliseconds;if(i=st(i),i==="month"||i==="quarter"||i==="year")switch(o=this._days+h/864e5,c=this._months+St(o),i){case"month":return c;case"quarter":return c/3;case"year":return c/12}else switch(o=this._days+Math.round(Ha(this._months)),i){case"week":return o/7+h/6048e5;case"day":return o+h/864e5;case"hour":return o*24+h/36e5;case"minute":return o*1440+h/6e4;case"second":return o*86400+h/1e3;case"millisecond":return Math.floor(o*864e5)+h;default:throw new Error("Unknown unit "+i)}}function uo(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+te(this._months/12)*31536e6:NaN}function _t(i){return function(){return this.as(i)}}var Wr=_t("ms"),lo=_t("s"),Dl=_t("m"),Ki=_t("h"),Il=_t("d"),fo=_t("w"),it=_t("M"),qa=_t("Q"),co=_t("y");function Jt(){return se(this)}function Ga(i){return i=st(i),this.isValid()?this[i+"s"]():NaN}function er(i){return function(){return this.isValid()?this._data[i]:NaN}}var Xr=er("milliseconds"),ho=er("seconds"),pt=er("minutes"),za=er("hours"),Ml=er("days"),Ol=er("months"),Al=er("years");function $a(){return nt(this.days()/7)}var br=Math.round,tr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function po(i,o,c,h,m){return m.relativeTime(o||1,!!c,i,h)}function Fl(i,o,c,h){var m=se(i).abs(),S=br(m.as("s")),E=br(m.as("m")),G=br(m.as("h")),J=br(m.as("d")),ve=br(m.as("M")),dt=br(m.as("w")),rr=br(m.as("y")),kr=S<=c.ss&&["s",S]||S0,kr[4]=h,po.apply(null,kr)}function Nl(i){return i===void 0?br:typeof i=="function"?(br=i,!0):!1}function ti(i,o){return tr[i]===void 0?!1:o===void 0?tr[i]:(tr[i]=o,i==="s"&&(tr.ss=o-1),!0)}function Ll(i,o){if(!this.isValid())return this.localeData().invalidDate();var c=!1,h=tr,m,S;return typeof i=="object"&&(o=i,i=!1),typeof i=="boolean"&&(c=i),typeof o=="object"&&(h=Object.assign({},tr,o),o.s!=null&&o.ss==null&&(h.ss=o.s-1)),m=this.localeData(),S=Fl(this,!c,h,m),c&&(S=m.pastFuture(+this,S)),m.postformat(S)}var ja=Math.abs;function Yr(i){return(i>0)-(i<0)||+i}function ri(){if(!this.isValid())return this.localeData().invalidDate();var i=ja(this._milliseconds)/1e3,o=ja(this._days),c=ja(this._months),h,m,S,E,G=this.asSeconds(),J,ve,dt,rr;return G?(h=nt(i/60),m=nt(h/60),i%=60,h%=60,S=nt(c/12),c%=12,E=i?i.toFixed(3).replace(/\\.?0+$/,""):"",J=G<0?"-":"",ve=Yr(this._months)!==Yr(G)?"-":"",dt=Yr(this._days)!==Yr(G)?"-":"",rr=Yr(this._milliseconds)!==Yr(G)?"-":"",J+"P"+(S?ve+S+"Y":"")+(c?ve+c+"M":"")+(o?dt+o+"D":"")+(m||h||i?"T":"")+(m?rr+m+"H":"")+(h?rr+h+"M":"")+(i?rr+E+"S":"")):"P0D"}var le=qn.prototype;le.isValid=Hu,le.abs=Pl,le.add=El,le.subtract=_r,le.as=oo,le.asMilliseconds=Wr,le.asSeconds=lo,le.asMinutes=Dl,le.asHours=Ki,le.asDays=Il,le.asWeeks=fo,le.asMonths=it,le.asQuarters=qa,le.asYears=co,le.valueOf=uo,le._bubble=Zr,le.clone=Jt,le.get=Ga,le.milliseconds=Xr,le.seconds=ho,le.minutes=pt,le.hours=za,le.days=Ml,le.weeks=$a,le.months=Ol,le.years=Al,le.humanize=Ll,le.toISOString=ri,le.toString=ri,le.toJSON=ri,le.locale=jn,le.localeData=Ks,le.toIsoString=je("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ri),le.lang=Vi,H("X",0,0,"unix"),H("x",0,0,"valueOf"),Y("x",Bn),Y("X",iu),Ce("X",function(i,o,c){c._d=new Date(parseFloat(i)*1e3)}),Ce("x",function(i,o,c){c._d=new Date(te(i))});return r.version="2.29.4",a(Me),r.fn=F,r.min=Yu,r.max=Bu,r.now=Vu,r.utc=K,r.unix=Ht,r.months=so,r.isDate=A,r.locale=yr,r.invalid=ye,r.duration=se,r.isMoment=Pe,r.weekdays=Tl,r.parseZone=kl,r.localeData=He,r.isDuration=Ut,r.monthsShort=Cl,r.weekdaysMin=ei,r.defineLocale=ht,r.updateLocale=Ou,r.locales=Au,r.weekdaysShort=Va,r.normalizeUnits=st,r.relativeTimeRounding=Nl,r.relativeTimeThreshold=ti,r.calendarFormat=Xu,r.prototype=F,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r})});var Vo=Ao(Fo());var sn=e=>[...new Set(e)];var Ph=(e,r)=>e.sort(function(a,u){let l=r.indexOf(a),p=r.indexOf(u);return l>p?l!=-1&&p==-1?-1:1:p!=-1&&l==-1?1:-1});var on="File";var No=e=>e.lastIndexOf("/")!=-1?e.lastIndexOf(".")!=-1?Eh(e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("."))):e.substring(e.lastIndexOf("/")+1):e.lastIndexOf(".")!=-1?e.substring(0,e.lastIndexOf(".")):e;function vf(e){return Array.isArray(e)?e:typeof e=="string"?[e]:[]}var Dh=(e,r)=>r.indexOf(e)>0?r.indexOf(e):r.length;var Lo=e=>"spaces://"+e;var Eh=e=>e.charAt(0)=="/"?e.substring(1):e;function si(e){return si=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},si(e)}function Nt(e){if(e===null||e===!0||e===!1)return NaN;var r=Number(e);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}function ke(e,r){if(r.length1?"s":"")+" required, but only "+r.length+" present")}function et(e){ke(1,arguments);var r=Object.prototype.toString.call(e);return e instanceof Date||si(e)==="object"&&r==="[object Date]"?new Date(e.getTime()):typeof e=="number"||r==="[object Number]"?new Date(e):((typeof e=="string"||r==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use \`parseISO\` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function wf(e,r){ke(2,arguments);var a=et(e).getTime(),u=Nt(r);return new Date(a+u)}var lx={};function An(){return lx}function Sf(e){var r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),e.getTime()-r.getTime()}function _f(e){return ke(1,arguments),e instanceof Date||si(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function bf(e){if(ke(1,arguments),!_f(e)&&typeof e!="number")return!1;var r=et(e);return!isNaN(Number(r))}function kf(e,r){ke(2,arguments);var a=Nt(r);return wf(e,-a)}var fx=864e5;function Cf(e){ke(1,arguments);var r=et(e),a=r.getTime();r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0);var u=r.getTime(),l=a-u;return Math.floor(l/fx)+1}function Fn(e){ke(1,arguments);var r=1,a=et(e),u=a.getUTCDay(),l=(u=l.getTime()?a+1:r.getTime()>=v.getTime()?a:a-1}function Tf(e){ke(1,arguments);var r=ts(e),a=new Date(0);a.setUTCFullYear(r,0,4),a.setUTCHours(0,0,0,0);var u=Fn(a);return u}var cx=6048e5;function Pf(e){ke(1,arguments);var r=et(e),a=Fn(r).getTime()-Tf(r).getTime();return Math.round(a/cx)+1}function Nn(e,r){var a,u,l,p,v,C,T,A;ke(1,arguments);var R=An(),V=Nt((a=(u=(l=(p=r?.weekStartsOn)!==null&&p!==void 0?p:r==null||(v=r.locale)===null||v===void 0||(C=v.options)===null||C===void 0?void 0:C.weekStartsOn)!==null&&l!==void 0?l:R.weekStartsOn)!==null&&u!==void 0?u:(T=R.locale)===null||T===void 0||(A=T.options)===null||A===void 0?void 0:A.weekStartsOn)!==null&&a!==void 0?a:0);if(!(V>=0&&V<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var K=et(e),re=K.getUTCDay(),N=(re=1&&re<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var N=new Date(0);N.setUTCFullYear(V+1,0,re),N.setUTCHours(0,0,0,0);var _e=Nn(N,r),Le=new Date(0);Le.setUTCFullYear(V,0,re),Le.setUTCHours(0,0,0,0);var ye=Nn(Le,r);return R.getTime()>=_e.getTime()?V+1:R.getTime()>=ye.getTime()?V:V-1}function Ef(e,r){var a,u,l,p,v,C,T,A;ke(1,arguments);var R=An(),V=Nt((a=(u=(l=(p=r?.firstWeekContainsDate)!==null&&p!==void 0?p:r==null||(v=r.locale)===null||v===void 0||(C=v.options)===null||C===void 0?void 0:C.firstWeekContainsDate)!==null&&l!==void 0?l:R.firstWeekContainsDate)!==null&&u!==void 0?u:(T=R.locale)===null||T===void 0||(A=T.options)===null||A===void 0?void 0:A.firstWeekContainsDate)!==null&&a!==void 0?a:1),K=rs(e,r),re=new Date(0);re.setUTCFullYear(K,0,V),re.setUTCHours(0,0,0,0);var N=Nn(re,r);return N}var hx=6048e5;function Df(e,r){ke(1,arguments);var a=et(e),u=Nn(a,r).getTime()-Ef(a,r).getTime();return Math.round(u/hx)+1}function Se(e,r){for(var a=e<0?"-":"",u=Math.abs(e).toString();u.length0?u:1-u;return Se(a==="yy"?l%100:l,a.length)},M:function(r,a){var u=r.getUTCMonth();return a==="M"?String(u+1):Se(u+1,2)},d:function(r,a){return Se(r.getUTCDate(),a.length)},a:function(r,a){var u=r.getUTCHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return u.toUpperCase();case"aaa":return u;case"aaaaa":return u[0];case"aaaa":default:return u==="am"?"a.m.":"p.m."}},h:function(r,a){return Se(r.getUTCHours()%12||12,a.length)},H:function(r,a){return Se(r.getUTCHours(),a.length)},m:function(r,a){return Se(r.getUTCMinutes(),a.length)},s:function(r,a){return Se(r.getUTCSeconds(),a.length)},S:function(r,a){var u=a.length,l=r.getUTCMilliseconds(),p=Math.floor(l*Math.pow(10,u-3));return Se(p,a.length)}},un=px;var na={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},dx={G:function(r,a,u){var l=r.getUTCFullYear()>0?1:0;switch(a){case"G":case"GG":case"GGG":return u.era(l,{width:"abbreviated"});case"GGGGG":return u.era(l,{width:"narrow"});case"GGGG":default:return u.era(l,{width:"wide"})}},y:function(r,a,u){if(a==="yo"){var l=r.getUTCFullYear(),p=l>0?l:1-l;return u.ordinalNumber(p,{unit:"year"})}return un.y(r,a)},Y:function(r,a,u,l){var p=rs(r,l),v=p>0?p:1-p;if(a==="YY"){var C=v%100;return Se(C,2)}return a==="Yo"?u.ordinalNumber(v,{unit:"year"}):Se(v,a.length)},R:function(r,a){var u=ts(r);return Se(u,a.length)},u:function(r,a){var u=r.getUTCFullYear();return Se(u,a.length)},Q:function(r,a,u){var l=Math.ceil((r.getUTCMonth()+1)/3);switch(a){case"Q":return String(l);case"QQ":return Se(l,2);case"Qo":return u.ordinalNumber(l,{unit:"quarter"});case"QQQ":return u.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return u.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return u.quarter(l,{width:"wide",context:"formatting"})}},q:function(r,a,u){var l=Math.ceil((r.getUTCMonth()+1)/3);switch(a){case"q":return String(l);case"qq":return Se(l,2);case"qo":return u.ordinalNumber(l,{unit:"quarter"});case"qqq":return u.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return u.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return u.quarter(l,{width:"wide",context:"standalone"})}},M:function(r,a,u){var l=r.getUTCMonth();switch(a){case"M":case"MM":return un.M(r,a);case"Mo":return u.ordinalNumber(l+1,{unit:"month"});case"MMM":return u.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return u.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return u.month(l,{width:"wide",context:"formatting"})}},L:function(r,a,u){var l=r.getUTCMonth();switch(a){case"L":return String(l+1);case"LL":return Se(l+1,2);case"Lo":return u.ordinalNumber(l+1,{unit:"month"});case"LLL":return u.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return u.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return u.month(l,{width:"wide",context:"standalone"})}},w:function(r,a,u,l){var p=Df(r,l);return a==="wo"?u.ordinalNumber(p,{unit:"week"}):Se(p,a.length)},I:function(r,a,u){var l=Pf(r);return a==="Io"?u.ordinalNumber(l,{unit:"week"}):Se(l,a.length)},d:function(r,a,u){return a==="do"?u.ordinalNumber(r.getUTCDate(),{unit:"date"}):un.d(r,a)},D:function(r,a,u){var l=Cf(r);return a==="Do"?u.ordinalNumber(l,{unit:"dayOfYear"}):Se(l,a.length)},E:function(r,a,u){var l=r.getUTCDay();switch(a){case"E":case"EE":case"EEE":return u.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return u.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return u.day(l,{width:"short",context:"formatting"});case"EEEE":default:return u.day(l,{width:"wide",context:"formatting"})}},e:function(r,a,u,l){var p=r.getUTCDay(),v=(p-l.weekStartsOn+8)%7||7;switch(a){case"e":return String(v);case"ee":return Se(v,2);case"eo":return u.ordinalNumber(v,{unit:"day"});case"eee":return u.day(p,{width:"abbreviated",context:"formatting"});case"eeeee":return u.day(p,{width:"narrow",context:"formatting"});case"eeeeee":return u.day(p,{width:"short",context:"formatting"});case"eeee":default:return u.day(p,{width:"wide",context:"formatting"})}},c:function(r,a,u,l){var p=r.getUTCDay(),v=(p-l.weekStartsOn+8)%7||7;switch(a){case"c":return String(v);case"cc":return Se(v,a.length);case"co":return u.ordinalNumber(v,{unit:"day"});case"ccc":return u.day(p,{width:"abbreviated",context:"standalone"});case"ccccc":return u.day(p,{width:"narrow",context:"standalone"});case"cccccc":return u.day(p,{width:"short",context:"standalone"});case"cccc":default:return u.day(p,{width:"wide",context:"standalone"})}},i:function(r,a,u){var l=r.getUTCDay(),p=l===0?7:l;switch(a){case"i":return String(p);case"ii":return Se(p,a.length);case"io":return u.ordinalNumber(p,{unit:"day"});case"iii":return u.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return u.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return u.day(l,{width:"short",context:"formatting"});case"iiii":default:return u.day(l,{width:"wide",context:"formatting"})}},a:function(r,a,u){var l=r.getUTCHours(),p=l/12>=1?"pm":"am";switch(a){case"a":case"aa":return u.dayPeriod(p,{width:"abbreviated",context:"formatting"});case"aaa":return u.dayPeriod(p,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return u.dayPeriod(p,{width:"narrow",context:"formatting"});case"aaaa":default:return u.dayPeriod(p,{width:"wide",context:"formatting"})}},b:function(r,a,u){var l=r.getUTCHours(),p;switch(l===12?p=na.noon:l===0?p=na.midnight:p=l/12>=1?"pm":"am",a){case"b":case"bb":return u.dayPeriod(p,{width:"abbreviated",context:"formatting"});case"bbb":return u.dayPeriod(p,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return u.dayPeriod(p,{width:"narrow",context:"formatting"});case"bbbb":default:return u.dayPeriod(p,{width:"wide",context:"formatting"})}},B:function(r,a,u){var l=r.getUTCHours(),p;switch(l>=17?p=na.evening:l>=12?p=na.afternoon:l>=4?p=na.morning:p=na.night,a){case"B":case"BB":case"BBB":return u.dayPeriod(p,{width:"abbreviated",context:"formatting"});case"BBBBB":return u.dayPeriod(p,{width:"narrow",context:"formatting"});case"BBBB":default:return u.dayPeriod(p,{width:"wide",context:"formatting"})}},h:function(r,a,u){if(a==="ho"){var l=r.getUTCHours()%12;return l===0&&(l=12),u.ordinalNumber(l,{unit:"hour"})}return un.h(r,a)},H:function(r,a,u){return a==="Ho"?u.ordinalNumber(r.getUTCHours(),{unit:"hour"}):un.H(r,a)},K:function(r,a,u){var l=r.getUTCHours()%12;return a==="Ko"?u.ordinalNumber(l,{unit:"hour"}):Se(l,a.length)},k:function(r,a,u){var l=r.getUTCHours();return l===0&&(l=24),a==="ko"?u.ordinalNumber(l,{unit:"hour"}):Se(l,a.length)},m:function(r,a,u){return a==="mo"?u.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):un.m(r,a)},s:function(r,a,u){return a==="so"?u.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):un.s(r,a)},S:function(r,a){return un.S(r,a)},X:function(r,a,u,l){var p=l._originalDate||r,v=p.getTimezoneOffset();if(v===0)return"Z";switch(a){case"X":return Oh(v);case"XXXX":case"XX":return oi(v);case"XXXXX":case"XXX":default:return oi(v,":")}},x:function(r,a,u,l){var p=l._originalDate||r,v=p.getTimezoneOffset();switch(a){case"x":return Oh(v);case"xxxx":case"xx":return oi(v);case"xxxxx":case"xxx":default:return oi(v,":")}},O:function(r,a,u,l){var p=l._originalDate||r,v=p.getTimezoneOffset();switch(a){case"O":case"OO":case"OOO":return"GMT"+Mh(v,":");case"OOOO":default:return"GMT"+oi(v,":")}},z:function(r,a,u,l){var p=l._originalDate||r,v=p.getTimezoneOffset();switch(a){case"z":case"zz":case"zzz":return"GMT"+Mh(v,":");case"zzzz":default:return"GMT"+oi(v,":")}},t:function(r,a,u,l){var p=l._originalDate||r,v=Math.floor(p.getTime()/1e3);return Se(v,a.length)},T:function(r,a,u,l){var p=l._originalDate||r,v=p.getTime();return Se(v,a.length)}};function Mh(e,r){var a=e>0?"-":"+",u=Math.abs(e),l=Math.floor(u/60),p=u%60;if(p===0)return a+String(l);var v=r||"";return a+String(l)+v+Se(p,2)}function Oh(e,r){if(e%60===0){var a=e>0?"-":"+";return a+Se(Math.abs(e)/60,2)}return oi(e,r)}function oi(e,r){var a=r||"",u=e>0?"-":"+",l=Math.abs(e),p=Se(Math.floor(l/60),2),v=Se(l%60,2);return u+p+a+v}var Ah=dx;var Fh=function(r,a){switch(r){case"P":return a.date({width:"short"});case"PP":return a.date({width:"medium"});case"PPP":return a.date({width:"long"});case"PPPP":default:return a.date({width:"full"})}},Nh=function(r,a){switch(r){case"p":return a.time({width:"short"});case"pp":return a.time({width:"medium"});case"ppp":return a.time({width:"long"});case"pppp":default:return a.time({width:"full"})}},mx=function(r,a){var u=r.match(/(P+)(p+)?/)||[],l=u[1],p=u[2];if(!p)return Fh(r,a);var v;switch(l){case"P":v=a.dateTime({width:"short"});break;case"PP":v=a.dateTime({width:"medium"});break;case"PPP":v=a.dateTime({width:"long"});break;case"PPPP":default:v=a.dateTime({width:"full"});break}return v.replace("{{date}}",Fh(l,a)).replace("{{time}}",Nh(p,a))},gx={p:Nh,P:mx},Lh=gx;var yx=["D","DD"],xx=["YY","YYYY"];function Rh(e){return yx.indexOf(e)!==-1}function Wh(e){return xx.indexOf(e)!==-1}function If(e,r,a){if(e==="YYYY")throw new RangeError("Use \`yyyy\` instead of \`YYYY\` (in \`".concat(r,"\`) for formatting years to the input \`").concat(a,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use \`yy\` instead of \`YY\` (in \`".concat(r,"\`) for formatting years to the input \`").concat(a,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use \`d\` instead of \`D\` (in \`".concat(r,"\`) for formatting days of the month to the input \`").concat(a,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use \`dd\` instead of \`DD\` (in \`".concat(r,"\`) for formatting days of the month to the input \`").concat(a,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var vx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},wx=function(r,a,u){var l,p=vx[r];return typeof p=="string"?l=p:a===1?l=p.one:l=p.other.replace("{{count}}",a.toString()),u!=null&&u.addSuffix?u.comparison&&u.comparison>0?"in "+l:l+" ago":l},Yh=wx;function ns(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=r.width?String(r.width):e.defaultWidth,u=e.formats[a]||e.formats[e.defaultWidth];return u}}var Sx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},_x={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},bx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},kx={date:ns({formats:Sx,defaultWidth:"full"}),time:ns({formats:_x,defaultWidth:"full"}),dateTime:ns({formats:bx,defaultWidth:"full"})},Bh=kx;var Cx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Tx=function(r,a,u,l){return Cx[r]},Vh=Tx;function ui(e){return function(r,a){var u=a!=null&&a.context?String(a.context):"standalone",l;if(u==="formatting"&&e.formattingValues){var p=e.defaultFormattingWidth||e.defaultWidth,v=a!=null&&a.width?String(a.width):p;l=e.formattingValues[v]||e.formattingValues[p]}else{var C=e.defaultWidth,T=a!=null&&a.width?String(a.width):e.defaultWidth;l=e.values[T]||e.values[C]}var A=e.argumentCallback?e.argumentCallback(r):r;return l[A]}}var Px={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ex={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Dx={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ix={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Mx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ox={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ax=function(r,a){var u=Number(r),l=u%100;if(l>20||l<10)switch(l%10){case 1:return u+"st";case 2:return u+"nd";case 3:return u+"rd"}return u+"th"},Fx={ordinalNumber:Ax,era:ui({values:Px,defaultWidth:"wide"}),quarter:ui({values:Ex,defaultWidth:"wide",argumentCallback:function(r){return r-1}}),month:ui({values:Dx,defaultWidth:"wide"}),day:ui({values:Ix,defaultWidth:"wide"}),dayPeriod:ui({values:Mx,defaultWidth:"wide",formattingValues:Ox,defaultFormattingWidth:"wide"})},Uh=Fx;function li(e){return function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=a.width,l=u&&e.matchPatterns[u]||e.matchPatterns[e.defaultMatchWidth],p=r.match(l);if(!p)return null;var v=p[0],C=u&&e.parsePatterns[u]||e.parsePatterns[e.defaultParseWidth],T=Array.isArray(C)?Lx(C,function(V){return V.test(v)}):Nx(C,function(V){return V.test(v)}),A;A=e.valueCallback?e.valueCallback(T):T,A=a.valueCallback?a.valueCallback(A):A;var R=r.slice(v.length);return{value:A,rest:R}}}function Nx(e,r){for(var a in e)if(e.hasOwnProperty(a)&&r(e[a]))return a}function Lx(e,r){for(var a=0;a1&&arguments[1]!==void 0?arguments[1]:{},u=r.match(e.matchPattern);if(!u)return null;var l=u[0],p=r.match(e.parsePattern);if(!p)return null;var v=e.valueCallback?e.valueCallback(p[0]):p[0];v=a.valueCallback?a.valueCallback(v):v;var C=r.slice(l.length);return{value:v,rest:C}}}var Rx=/^(\\d+)(th|st|nd|rd)?/i,Wx=/\\d+/i,Yx={narrow:/^(b|a)/i,abbreviated:/^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Bx={any:[/^b/i,/^(a|c)/i]},Vx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ux={any:[/1/i,/2/i,/3/i,/4/i]},Hx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},qx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Gx={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},zx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},$x={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},jx={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Qx={ordinalNumber:Mf({matchPattern:Rx,parsePattern:Wx,valueCallback:function(r){return parseInt(r,10)}}),era:li({matchPatterns:Yx,defaultMatchWidth:"wide",parsePatterns:Bx,defaultParseWidth:"any"}),quarter:li({matchPatterns:Vx,defaultMatchWidth:"wide",parsePatterns:Ux,defaultParseWidth:"any",valueCallback:function(r){return r+1}}),month:li({matchPatterns:Hx,defaultMatchWidth:"wide",parsePatterns:qx,defaultParseWidth:"any"}),day:li({matchPatterns:Gx,defaultMatchWidth:"wide",parsePatterns:zx,defaultParseWidth:"any"}),dayPeriod:li({matchPatterns:$x,defaultMatchWidth:"any",parsePatterns:jx,defaultParseWidth:"any"})},Hh=Qx;var Kx={code:"en-US",formatDistance:Yh,formatLong:Bh,formatRelative:Vh,localize:Uh,match:Hh,options:{weekStartsOn:0,firstWeekContainsDate:1}},qh=Kx;var Gh=qh;var Zx=/[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g,Xx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Jx=/^'([^]*?)'?$/,ev=/''/g,tv=/[a-zA-Z]/;function fi(e,r,a){var u,l,p,v,C,T,A,R,V,K,re,N,_e,Le,ye,de,We,ze;ke(2,arguments);var $e=String(r),Pe=An(),tt=(u=(l=a?.locale)!==null&&l!==void 0?l:Pe.locale)!==null&&u!==void 0?u:Gh,je=Nt((p=(v=(C=(T=a?.firstWeekContainsDate)!==null&&T!==void 0?T:a==null||(A=a.locale)===null||A===void 0||(R=A.options)===null||R===void 0?void 0:R.firstWeekContainsDate)!==null&&C!==void 0?C:Pe.firstWeekContainsDate)!==null&&v!==void 0?v:(V=Pe.locale)===null||V===void 0||(K=V.options)===null||K===void 0?void 0:K.firstWeekContainsDate)!==null&&p!==void 0?p:1);if(!(je>=1&&je<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var pr=Nt((re=(N=(_e=(Le=a?.weekStartsOn)!==null&&Le!==void 0?Le:a==null||(ye=a.locale)===null||ye===void 0||(de=ye.options)===null||de===void 0?void 0:de.weekStartsOn)!==null&&_e!==void 0?_e:Pe.weekStartsOn)!==null&&N!==void 0?N:(We=Pe.locale)===null||We===void 0||(ze=We.options)===null||ze===void 0?void 0:ze.weekStartsOn)!==null&&re!==void 0?re:0);if(!(pr>=0&&pr<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!tt.localize)throw new RangeError("locale must contain localize property");if(!tt.formatLong)throw new RangeError("locale must contain formatLong property");var jt=et(e);if(!bf(jt))throw new RangeError("Invalid time value");var me=Sf(jt),at=kf(jt,me),mt={firstWeekContainsDate:je,weekStartsOn:pr,locale:tt,_originalDate:jt},Rt=$e.match(Xx).map(function(Oe){var Qe=Oe[0];if(Qe==="p"||Qe==="P"){var Wt=Lh[Qe];return Wt(Oe,tt.formatLong)}return Oe}).join("").match(Zx).map(function(Oe){if(Oe==="''")return"'";var Qe=Oe[0];if(Qe==="'")return rv(Oe);var Wt=Ah[Qe];if(Wt)return!(a!=null&&a.useAdditionalWeekYearTokens)&&Wh(Oe)&&If(Oe,r,String(e)),!(a!=null&&a.useAdditionalDayOfYearTokens)&&Rh(Oe)&&If(Oe,r,String(e)),Wt(at,Oe,tt.localize,mt);if(Qe.match(tv))throw new RangeError("Format string contains an unescaped latin alphabet character \`"+Qe+"\`");return Oe}).join("");return Rt}function rv(e){var r=e.match(Jx);return r?r[1].replace(ev,"'"):e}var Of=(e,r)=>{if(e instanceof Date)return"date";if(typeof e=="string"){if(/\\/\\/(\\S+?(?:jpe?g|png|gif|svg))/gi.test(e)||e.includes("unsplash"))return"image";if(/^\\d{4}-\\d{2}-\\d{2}$/.test(e))return"date";if(r=="tag"||r=="tags")return"tag";if(/\\[\\[.*?\\]\\]/.test(e))return"link"}else{if(typeof e=="number")return"number";if(typeof e=="boolean")return"boolean";if(e)if(Array.isArray(e)||typeof e=="string"&&e.indexOf(",")>-1){let a=Array.isArray(e)?e:[];if(typeof e=="string"&&e.indexOf(",")>-1&&(a=sr(e)),r=="tag"||r=="tags")return"tag-multi";if(a.length==1&&Array.isArray(a[0])&&a[0].length==1&&typeof a[0][0]=="string")return"link";let u=sn(a.map(l=>Of(l,r)));return u.length==1&&u[0]=="link"?"link-multi":u.some(l=>l=="object")?"object-multi":"option-multi"}else{if(e.isLuxonDateTime)return"date";if(e.isLuxonDuration)return"duration";if(e.type=="file")return"link";if(typeof e=="object"&&!Array.isArray(e)&&e!==null)return"object"}else return"unknown"}return"text"};var zh=e=>e.map(r=>r.replace(",","\\\\,")).join(", "),ci=e=>e.map(r=>r.replace(",","\\\\,")).join(", ");var sr=e=>(e?.replace("\\\\,",",").match(/(\\\\.|[^,])+/g)??[]).map(r=>r.trim()),Af=(e,r)=>{switch(Of(r,e)){case"object":return JSON.stringify(r);case"number":return r.toString();case"boolean":return r?"true":"false";case"date":{if(r instanceof Date){let u=fi(r,"yyyy-MM-dd");if(typeof u=="string")return u}return typeof r!="string"?"":r}break;case"duration":return zh(Object.keys(r.values).reduce((u,l)=>[...u,...r.values[l]>0?[r.values[l]+" "+l]:[]],[]));case"option-multi":case"link-multi":return typeof r=="string"?is(r):ci(r.map(u=>u?typeof u=="string"?is(u):u.path?u.path:Array.isArray(r)&&u.length==1&&Array.isArray(u[0])&&u[0].length==1&&typeof u[0][0]=="string"?u[0][0]:JSON.stringify(u):""));case"link":return Array.isArray(r)&&r.length==1&&Array.isArray(r[0])&&r[0].length==1&&typeof r[0][0]=="string"?r[0][0]:typeof r=="string"?is(r):r.path;case"text":case"tag":case"image":return r}return""};var is=e=>{if(!e)return"";let r=/\\[\\[(.*?)\\]\\]/g.exec(e),a=r?.length>1?r[1].substring(0,Dh("|",r[1])):e;return a||e};var Ro=(e,r)=>e==r,Ff=(e,r)=>(e??"").length==0,Nf=(e,r)=>(e??"").toLowerCase().includes((r??"").toLowerCase()),Lf=(e,r)=>parseFloat(e)>parseFloat(r),Rf=(e,r)=>parseInt(e)>parseInt(r),$h=(e,r)=>{let a=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),u=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return a.valueOf()>u.valueOf()},jh=(e,r)=>{let a=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),u=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return a.valueOf(){let a=e?sr(e):[];return(r?sr(r):[]).some(l=>a.some(p=>p==l))},Qh=(e,r)=>{if(!e)return!1;let a=new Date(\`\${e.toString().replace(".",":")}\`),u=new Date(\`\${r}\`);return a.getMonth()===u.getMonth()&&a.getDate()===u.getDate()},Kh=e=>{if(!e)return!1;let r=new Date(\`\${e.toString()}T00:00\`),a=new Date;return r.getMonth()===a.getMonth()&&r.getDate()===a.getDate()};var as={isNotEmpty:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>!Ff(e,""),valueType:"none"},isEmpty:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>Ff(e,""),valueType:"none"},include:{fn:(e,r)=>Nf(e,r),type:["text","file","link","link-multi","fileprop","image"],valueType:"text"},notInclude:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>!Nf(e,r),valueType:"text"},is:{type:["text","file","link","context","fileprop"],fn:(e,r)=>Ro(e,r),valueType:"text"},isNot:{type:["text","file","link","context","fileprop"],fn:(e,r)=>!Ro(e,r),valueType:"text"},equal:{type:["number"],fn:(e,r)=>Ro(e,r),valueType:"number"},isGreatThan:{type:["number"],fn:(e,r)=>Lf(e,r),valueType:"number"},isLessThan:{type:["number"],fn:(e,r)=>Rf(e,r),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(e,r)=>!Lf(e,r),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(e,r)=>!Rf(e,r),valueType:"number"},dateBefore:{type:["date","fileprop"],fn:(e,r)=>jh(e,r),valueType:"date"},dateAfter:{type:["date","fileprop"],fn:(e,r)=>$h(e,r),valueType:"date"},isSameDate:{type:["date"],fn:(e,r)=>Qh(e,r),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(e,r)=>Kh(e,r),valueType:"none"},isAnyInList:{type:["option","context","option-multi","context-multi","tags-multi","tags"],fn:(e,r)=>Wf(e,r),valueType:"list"},isNoneInList:{type:["option","context","option-multi","context-multi","tags-multi","tags"],fn:(e,r)=>!Wf(e,r),valueType:"list"},isTrue:{type:["boolean"],fn:(e,r)=>e=="true",valueType:"none"},isFalse:{type:["boolean"],fn:(e,r)=>e!="true",valueType:"none"}};var nv=(e,r)=>r.reduce((u,l)=>{let[p,v]=u,C=l.type=="path"?Xh(v,l):l.type=="frontmatter"?Zh(v,l):Jh(v,l),T=v.filter(A=>!C.includes(A));return[[...p,...C],T]},[[],e])[0],iv=(e,r)=>r.reduce((a,u)=>u.type=="path"?Xh(a,u):u.type=="frontmatter"?Zh(a,u):Jh(a,u),e),Zh=(e,r)=>e.filter(a=>{let u=a.metadata?.property;if(!u||!u[r.field])return!1;let l=as[r.fn],p=!0;return l&&(p=l.fn(Af(r.field,u[r.field]),r.value)),p}),Xh=(e,r)=>e.filter(a=>{let u="";r.field=="outlinks"?u=ci(a.outlinks??[]):r.field=="inlinks"?u=ci(a.inlinks??[]):r.field=="tags"&&(u=ci(a.tags??[]));let l=as[r.fn],p=!0;return l&&(p=l.fn(u,r.value)),p}),Jh=(e,r)=>e.filter(a=>{let u=as[r.fn],l=!0;return u&&(l=u.fn(a.metadata?.[r.type]?.[r.field],r.value)),l}),Yf=(e,r)=>e.reduce((u,l)=>!u||l.filters.length==0?!1:l.type=="any"?nv([r],l.filters).length>0:iv([r],l.filters).length>0,!0);var tp=Ao(ep()),Vf=class{constructor(){this.lang="en";this.all={en:{hintText:{dragDropModifierKeys:"Hold \${1} to Pin and \${2} to Copy",createListItem:"Select/Create List Item Frame",dragDropProperties:"Drag and drop properties to link them into the list",newItem:"+ New",selectNote:"Select Note...",newFrame:"New"},defaults:{spaceNote:"Current Note",spaceContext:"Current Space"},commands:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",columns:"Columns",button:"Button",label:"Label",column:"Column",idea:"New",group:"Group",paragraph:"Text",card:"Card",progress:"Progress",rating:"Rating",circularProgress:"Circular Progress",list:"Bullet List","ordered-list":"Numbered List",todo:"To-do List",quote:"Quote",divider:"Divider",note:"Link to Note",link:"Link",callout:"Callout",bookmark:"Bookmark",table:"Table",codeblock:"Code Block",toggle:"Toggle",emoji:"Emoji",image:"Image",flow:"Linked Note",newNote:"New Note",tag:"Tag",makeMenu:"Flow Menu",selectStyle:"Style",toggleKeyboard:"Toggle Keyboard",rows:"Rows",masonry:"Gallery"},styles:{bold:"Bold",italics:"Italics",strikethrough:"Strikethrough",code:"Code",link:"Web Link",blocklink:"Link to Note",textColor:"Text Color",highlight:"Highlight"},commandsSuggest:{noResult:"No result"},commandPalette:{enable:"Enable",disabled:"Disable",openFlow:"Open Flow Blocks in Selection",closeFlow:"Close Flow Blocks in Selection",toggleBold:"Toggle Bold",toggleItalics:"Toggle Italics",openSpaces:"Open Spaces",migrateData:"Migrate Spaces From 0.7",blink:"Blink",openFileContext:"Open Explorer",convertPathToSpace:"Convert to Space",revealFile:"Reveal File in Spaces",releaseNotes:"Release Notes",toggleBacklinks:"Toggle Backlinks",collapseAllFolders:"Collapse All Folders",addFileSpace:"Add File to Space",removeFileSpace:"Remove File from Space"},frames:{sections:{kit:"Kit",paths:"Paths"},label:{label:"Label",description:"Label"},note:{label:"Note",description:"Link to a note"},table:{label:"Table",description:"Table"},context:{label:"Context",description:"Display a context view from another space"},calendar:{label:"Calendar View"},field:{label:"Field",description:"Dynamic node that displays a value based on property type"},event:{label:"Event"},divider:{label:"Divider",description:"Divider to separate your content"},button:{label:"Button",description:"Buttons can perform actions and open links"},callout:{label:"Callout",description:"Callout to highlight important information"},toggle:{label:"Toggle",description:"Toggle to show/hide content"}},menu:{newView:"New View",closeSpace:"Close Space",customView:"Custom View",detailsView:"Details View",catalogView:"Catalog View",galleryView:"Gallery View",deleteContext:"Delete Context",openSpace:"Open Space",revealInDefault:"Reveal in Finder",setNone:"None",fileMetadataDescription:"This note only",openFilePane:"Open in a new pane",rename:"Rename",changeToFolderNote:"New Space from Note",moveFile:"Move file to...",moveFolder:"Move folder to...",duplicate:"Make a copy",edit:"Edit",delete:"Delete",getHelp:"Make.md Community",vault:"Vault",openVault:"Open Another Vault",openVaultInFolder:"Open Vault Folder",obSettings:"Obsidian Settings",commandPalette:"Command Palette",backToSpace:"Back to Spaces",collapseAllSections:"Collapse All Spaces",expandAllSections:"Expand All Spaces",collapseAllFolders:"Collapse All Folders",expandAllFolders:"Expand All Folders",spaceTitle:"Add/Remove in Space",home:"Home",waypoints:"Waypoints",none:"None",tableView:"Table View",cardView:"Card View",boardView:"Board View",listView:"List View",flowView:"Flow View",groupBy:"Group By",sortBy:"Sort By",newFilter:"New Filter",clearFilters:"Clear Filters",hide:"Hide",unhideFields:"Unhide All Properties",importDataview:"Import All Dataview Properties",saveAllProperties:"Save All Properties to Files",mergeProperties:"Merge Properties",removeFromSpace:"Unpin from Space",removeFromWaypoints:"Unpin from Waypoints",editCode:"Edit Code",deleteProperty:"Delete Property",hideProperty:"Hide Property",unhideProperty:"Unhide Property",saveProperty:"Save Property",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",deleteRow:"Delete Item",collapseAll:"Collapse All",customSort:"Custom Sort",groupSpaces:"Group Spaces",fileNameSortAlphaAsc:"File Name (A to Z)",fileNameSortAlphaDesc:"File Name (Z to A)",createdTimeSortAsc:"Created Time (new to old)",createdTimeSortDesc:"Created Time (old to new)",modifiedTimeSortAsc:"Modified Time (new to old)",modifiedTimeSortDesc:"Modified Time (old to new)",sizeSortAsc:"Size (smallest to largest)",sizeSortDesc:"Size (largest to smallest)",spaces:"Spaces",tags:"Tags",manageHiddenFiles:"Manage Hidden Files",manageActions:"Manage Actions",deleteSpace:"Delete",changeColor:"Change Color",changePropertyType:"Change Type",deleteFiles:"Delete Files",createFolderSpace:"Create Space from Folder",folder:"Folder",syncToContext:"Add Property to Context",setIcon:"Set Icon",copyEmbedLink:"Copy Embed Link",moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",groupNodes:"Group Nodes",moveFrame:"Move Frame",renameFrame:"Rename Frame",deleteFrame:"Delete Frame"},editor:{rows:"Rows",columns:"Columns",catalog:"Catalog",gallery:"Gallery",grid:"Grid",scaleToFit:"Change to Fit",scaleToFill:"Change to Fill",fit:"Fit",strokeNone:"None",strokeSolid:"Solid",strokeDotted:"Dotted",strokeDashed:"Dashed",size:"Size",gap:"Gap",marginLeft:"Left",marginTop:"Top",marginRight:"Right",marginBottom:"Bottom",minimize:"Minimize",paddingLeft:"Left",paddingTop:"Top",paddingRight:"Right",paddingBottom:"Bottom",unlinkProperty:"Unlink Property",linkedProperty:"Linked Property",linkProperty:"Link Property",currentSpace:"Current Space",linkName:"\${1} Link",linkThumbnail:"\${1} Thumbnail",linkSticker:"\${1} Sticker",opacity:"Opacity",shadowSpread:"Spread",shadowBlur:"Blur",width:"Width",height:"Height",margin:"Margin",padding:"Padding",bold:"Bold",italic:"Italic",underline:"Underline",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",numberOfLines:"Lines",createVerticalSection:"Create Vertical Section",createHorizontalSection:"Create Horizontal Section",themeColors:"Theme Colors",uiColors:"UI Colors",hex:"Hex"},buttons:{add:"Add",addFilter:"Add Filter",customize:"Customize",moreOptions:"More Options",saveProperty:"Save Property",newNote:"New Note",changeIcon:"Change Sticker",removeIcon:"Remove Sticker",addIcon:"Add Sticker",addCover:"Add Cover",changeBanner:"Change Cover",changeBannerShort:"Cover",saveChanges:"Save Changes",removeBanner:"Remove Cover",rename:"Change Name",editFrame:"Edit Frame",saveSpace:"Save Space",createSpace:"New Space",createFolder:"New Folder",createNote:"New Note",createCanvas:"New Canvas",addIntoSpace:"New Pin",addSmartSearch:"Add Smart Search",addItem:"Add Item",addProperty:"Add Property",addContext:"Add Context",cancel:"Cancel",search:"Search",delete:"Delete",toggleFlow:"Toggle Flow",openFlow:"Open Flow",hideFlow:"Hide Flow",openLink:"Open Link",addToSpace:"Add to Space",addToSpaceShort:"Pin",addTag:"Add Tag",tag:"Tag",syncFields:"Sync Properties",convertTable:"Convert to Markdown",cutTable:"Cut Table",deleteTable:"Delete Table",blink:"Blink",addFile:"Add Item",merge:"Merge",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",deleteView:"Delete View",renameTable:"Rename Table",renameTag:"Rename Tag",createTag:"Create Tag",currentFolder:"Current Folder",sync:"Sync",pasteCSS:"Paste CSS",save:"Save",run:"Run"},metadataTypes:{fileName:"File Name",path:"Path",folder:"Folder",sticker:"Sticker",color:"Color",created:"Created",lastModified:"Last Modified",extension:"Extension",size:"Size",tags:"Tags",inlinks:"Linked Mentions",outlinks:"Links",label:"Label",fileMetadata:"File Metadata",frontmatter:"Frontmatter"},filterTypes:{contains:"contains",notContains:"does not contain",is:"is",isNot:"is not",before:"before",after:"after",anyOf:"is any of",noneOf:"is none of",checked:"is checked",unchecked:"is unchecked",isEmpty:"is empty",isNotEmpty:"is not empty",isSameDate:"is same date",isSameDateAsToday:"today"},sortTypes:{alphaAsc:"A to Z",alphaDesc:"Z to A",earliest:"Earliest",latest:"Latest",checkAsc:"Checked \\u2192 Unchecked",checkDesc:"Unchecked \\u2192 Checked",itemsAsc:"Least Items",itemsDesc:"Most Items"},properties:{defaultField:"Name",audio:{label:"Audio",description:"Audio"},text:{label:"Text",description:"Text field"},number:{label:"Number",description:"Number field with optional unit"},boolean:{label:"Yes/No",description:"Yes or No toggle to indicate the status"},date:{label:"Date",description:"Select a date from a calendar"},option:{label:"Option",description:"Select one or multiple option from a list"},file:{label:"File"},link:{label:"Link",description:"Link to another note or a website"},tags:{label:"Tags",description:"Use tags to quickly organize your items"},object:{label:"Object",description:"Store any complex objects"},context:{label:"Relation",description:"Connect to another context property and create a relation"},image:{label:"Image",description:"Select any image from your system or from the internet"},color:{label:"Color",description:"Use colors to label your items or status"},space:{label:"Context",description:"Link to a context"},icon:{label:"Sticker",description:"Use stickers to uniquely label your items or status"},super:{label:"Super Property",links:"Open Link",properties:"Update Property",api:"API",obsidianCommands:"Run Command",runCommand:"Run Command",performAction:"Perform Action",whenClicked:"When Clicked"},fileProperty:{name:"Name",label:"Formula",createdTime:"Created",modifiedTime:"Last Edited",sticker:"Sticker",links:"Links",tags:"Tags",spaces:"Spaces",extension:"Extension",size:"Size",preview:"Note Preview",parentFolder:"Folder",description:"Use a formula to dynamically display a property"}},views:{navigator:"Navigator",explorer:"Explorer",space:"Space"},subViews:{spaceItems:"Items",spaceContext:"Context",spaceLists:"Lists",spaceActions:"Actions",spaceTemplates:"Templates",smartSearch:"Smart Search",filesAndFolders:"Files and Folders"},labels:{properties:"Properties",newAction:"New Action",newTable:"New Table",createFolder:"New Folder Name",rename:"Rename",createNew:"New",default:"Default",done:"Done",tables:"Tables",selectDateFormat:"Select/Type Date Format",renameSectionSmart:"Edit Smart Space",renameSection:"Edit Space",createSectionSmart:"New Smart Space",createSection:"New Folder",createNote:"New Note",contextMaker:"Context Maker",select:"Select",pinnedItems:"Pinned Items",collapse:"Collapse",expand:"Expand",all:"All",none:"None",view:"View",findStickers:"Find Sticker",mergeProperties:"Merge Properties",placeholder:"Type '\${1}' for commands",itemsSelected:"\${1} Selected",selectNote:"Select Note",selectIcon:"Select Icon",selectImage:"Select Image",selectSpace:"Select Space",styleSmall:"Small",styleMedium:"Medium",styleLarge:"Large",hiddenFilePattern:"Name, Suffixes and Extension",hiddenFileSpecific:"Exclude specific files and folders",textPlaceholder:"Enter Text",noFile:"is not created yet. Click to create.",navigatorSearchPlaceholder:"Search by Text or Filters",blinkPlaceholder:"Quickly Search a File, Folder, Tag... Press Tab to Edit",searchPlaceholder:"Type to search...",contextItemSelectPlaceholder:"Find Item",linkItemSelectPlaceholder:"Find or Create Note",pinNotePlaceholder:"Select a Note or Space to Pin",optionItemSelectPlaceholder:"Select Option",viewItemSelectPlaceholder:"Select View",tagItemSelectPlaceholder:"Find Tag",spaceSelectPlaceholder:"Select any Folder or Tag",propertyItemSelectPlaceholder:"Select Property",sortItemSelectPlaceholder:"Select Sort",filterItemSelectPlaceholder:"Select Filter",imageSelectPlaceholder:"Select an image or paste a URL",imageNotFoundPlaceholder:"No Images Found",syncFrontmatterProperty:"Sync Frontmatter Property",newProperty:"New Property",newPropertyShort:"New Property",propertyType:"Type",propertyDynamic:"Dyanmic",propertyValueSpace:"Space",propertyValueProperty:"Property",propertyLookup:"Edit Formula",dateFormat:"Date Format",propertyFileProp:"Property",multiple:"Multiple",filesCount:"{$1} Files",hiddenFiles:"Hidden Files",addExtension:"Add Rule",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",renameTable:"Rename Table",syncMetadata:"Sync Metadata",syncProperties:"Sync Properties",selectContext:"Select Context",metadata:"Metadata",backlinks:"Backlinks",spaces:"Spaces",context:"Context",content:"Content",deleteSpace:"Delete Space",deleteFiles:"Delete Files",outgoingLinks:"Outgoing Links",moveTo:"Move to",addTo:"Pin to",copyTo:"Copy to",reorderIn:"Reorder in",border:"Border",corners:"Corners",color:"Color",backgroundColor:"Background",cornerRadius:"Radius",onClick:"On Click",layout:"Layout",element:"Element",name:"Name",display:"Display",alignment:"Alignment",margin:"Margin",padding:"Padding",gap:"Gap",width:"Width",height:"Height",opacity:"Opacity",shadow:"Shadow",shadowBlur:"Blur",shadowSpread:"Spread",typography:"Typography",layers:"Layers",fontSize:"Size",props:"Props",styles:"Styles",events:"Events",code:"Code",selectedLayers:"\${1} Layers"},descriptions:{spaceActions:"Create actions that runs when you press a button",spaceLists:"Create lists to track data and organize them in your space",spaceItems:"Add new items to the space or pin items to the space",smartSearch:"Automatically pin notes to this space based on a set of searches",hiddenFileOptions:"Exclude any files and folders by name, suffix or extension.",deleteSpace:"Deleting the space will also delete the folder and its contents.",deleteFiles:"Delete \${1} files/folders and their contents?",addContext:"Contexts lets you connect properties from your tags",spaceProperties:"Define Properties for your Space Items",syncMetadata:"Select which fields from your notes to start syncing with the context.",syncProperties:"Contexts defines and syncs the same fields across your notes depending on their folder or tag.",selectContext:"Select which folder or tag context you want to sync the fields."},flowView:{emptyDoc:"Empty Document",itemsCount:" Items",emptyFolder:"This Folder is Empty"},notice:{duplicateFile:"Folder already contains note with same name",addedToSection:"Added to Space",fileExists:"File Already Exists",folderExists:"Folder Already Exists",noPropertyName:"Property Name is Required",duplicatePropertyName:"Duplicate Property Name",newSpaceName:"Enter a name for your space",duplicateSpaceName:"Space name already exists",cantConvertNoteToSpace:"The view is not a note",templateSaved:"Template saved to space: "},settings:{layoutVertical:"Vertical",layoutHorizontal:"Horizontal",sectionSidebar:"Spaces",sectionEditor:"Maker Mode",sectionFlow:"Flow",sectionAdvanced:"Advanced",sectionDataview:"Dataview",sectionContext:"Context",sectionStickers:"Stickers",sectionNavigator:"Navigator",sectionDefault:"Default Spaces",sectionSpaceView:"Space View",sectionBlink:"Blink",sectionInlineContext:"Inline Context",sectionFlowBlock:"Flow Block",sectionFlowMenu:"Flow Menu",sectionFlowStyler:"Flow Styler",experimental:{name:"Experimental",desc:"Experimental features that are subject to change and may not be optimized for performance"},generateThumbnails:{name:"Generate Thumbnails",desc:"Create thumbnails for images to speed up performance"},minimalThemeFix:{name:"Minimal Theme Fix",description:"Apply fixes for the popular theme Minimal"},inlineStickerMenu:{name:"Inline Stickers",desc:"Add inline stickers by typing :"},openSpacesOnLaunch:{name:"Open Spaces as Default Tab",desc:"Open the Spaces tab when Obsidian launches"},defaultSpaceTemplate:{name:"Default Space Template",desc:"Select the default template for new spaces"},defaultDateFormat:{name:"Default Date Format",desc:"Set the default date format, example: yyyy-MM-dd (see https://date-fns.org/v2.30.0/docs/format)"},newNotePlaceholder:{name:"New Note Placeholder",desc:"Default name for new notes"},folderIndentationLines:{name:"Show Folder Indentation Lines",desc:"Turn on to show a line on the left of folders to indicate indentation"},folderNoteLocation:{name:"Folder Note Location Inside Folder",desc:"Turn on to have folder notes inside the folder, turn off to have it outside"},folderViewDefault:{name:"Show Folder Note by Default",desc:"Show the folder note by default when opening a folder"},internalLinkFlowEditor:{name:"Open Flow Blocks on Internal Link Click",desc:"Turn on to toggle Flow Blocks directly by clicking on internal links, otherwise a tooltip will be shown"},syncContextToFrontmatter:{name:"Sync Context Fields to Frontmatter",desc:"Turn on to automatically save all context fields to frontmatter fields, not just existing frontmatter fields."},inlineBacklinks:{name:"Show Inline Backlinks (Inline Context required)",desc:"Show editable backlinks at the bottom of your notes"},dataviewInlineContext:{name:"Show Dataview in Inline Context",desc:"Show dataview when inline context is enabled"},inlineContextExplorer:{name:"Inline Context",desc:"Display the context and a banner at the top of your notes"},inlineContextExpanded:{name:"Auto Expand Inline Context",desc:"Expand the inline context sections when opening a note"},inlineContextHorizontal:{name:"Inline Title and Sticker Layout",desc:"Layout for inline title and sticker in Inline Context"},hideFrontmatter:{name:"Hide Frontmatter Properties",desc:"Hide the frontmatter properties in inline context"},openFileContext:{name:"Auto Open Explorer",desc:"Automatically open explorer panel in the right panel"},folderNote:{name:"Enable Folder Note",desc:"Access the folder note in the folder page and hide the folder note from spaces"},expandFolder:{name:"Auto Expand Folder",desc:"Auto expand folders on click"},hoverPreview:{name:"Preview on Hover",desc:"Preview on Hover while holding Control/Command key"},activeFile:{name:"Reveal Active File",desc:"Automatically reveal the active file in Spaces"},contexts:{name:"Contexts",desc:"Contexts allows you to have full control over the metadata of your files"},spaces:{name:"Navigator",desc:"The navigator lets you create and organize your spaces"},spacesStickers:{name:"Stickers",desc:"Use Emojis to make it easier to find your notes"},spacesAlias:{name:"Alias",desc:"Use the alias metadata to show in Spaces"},spacesFileExplorerDual:{name:"Compatibility Mode",desc:"This will improve the compatibility of plugins while using Spaces"},spacesDeleteOption:{name:"Delete File Option",desc:"Select how you want files to be deleted"},spacesDeleteOptions:{permanant:"Delete Permanently",trash:"Move to Obsidian Trash","system-trash":"Move to System Trash"},hideRibbon:{name:"App Ribbon",desc:"Show/hide the left menu aka. ribbon"},spaceView:{name:"Space View",desc:"Open the space view when you click on a space"},defaultSpaces:{name:"Default Spaces",desc:"Recommended spaces for quickly organizing your vault"},homeSpace:{name:"Home Space",desc:"An easy-to-access space where you can add/organize your other spaces"},tagSpaces:{name:"Tag Spaces",desc:"Automatically create spaces for each of your tags"},readableLineWidth:{name:"Readable Line Width",desc:"Use Readable Line Width"},sidebarTabs:{name:"Sidebar Tabs",desc:"Show/hide other sidebar tabs"},spacesPerformance:{name:"Performance Mode",desc:"Turn on performance mode for Spaces, may affect scrolling appearance. Requires Restart"},indexSVG:{name:"Use SVGs as Stickers",desc:"Use any svg file in your vault as a sticker"},inlineStyler:{name:"Flow Styler",desc:"Select text to add styling"},inlineStylerColor:{name:"Text and Highlight Colors \\u{1F9EA}",desc:"Select text color and highlight color, (this may change in the future because of the limitations with HTML and Obsidian)"},spaceRowHeight:{name:"Row Height",desc:"The height for each row in spaces (in pixels), default is 28"},makeChar:{name:"Flow Menu Trigger",desc:"Character to open the Flow Menu"},mobileMakeBar:{name:"Flow Styler (Mobile)",desc:"Replaces the mobile toolbar"},editorMarkSans:{name:"Mark Sans \\u{1F9EA}",desc:"Use the editor without Markdown."},editorMakerMode:{name:"Flow (Beta)",desc:"An integrated and intuitive editor experience"},editorMakePlacholder:{name:"Flow Menu Hint Text",desc:"Show a hint text on how to open the Flow Menu Shortcut"},blink:{name:"Blink",desc:"A faster way to search and edit your notes"},editorMakeMenu:{name:"Flow Menu",desc:"Open the Flow menu to quickly add content"},editorMakeMenuTrigger:{name:"Flow Menu Shortcut",desc:"Trigger key to use flow menu"},editorFlowReplace:{name:"Flow Block",desc:"Open your internal links or toggle your embeds in the flow block."},editorFlowStyle:{name:"Flow Block Style",desc:"Select a theme for your flow block",seamless:"Seamless",classic:"Classic",minimal:"Minimal"}}}};this.lang="en";let r=tp.default.locale();["en"].includes(r)&&(this.lang=r)}get texts(){return this.all.en}},fe=new Vf().texts;var YS=[{type:"unknown",label:"",restricted:!0,icon:"ui//file-question"},{type:"text",label:fe.properties.text.label,metadata:!0,icon:"ui//text",description:fe.properties.text.description},{type:"number",label:fe.properties.number.label,metadata:!0,icon:"ui//binary",configKeys:["unit"],description:fe.properties.number.description},{type:"boolean",label:fe.properties.boolean.label,metadata:!0,icon:"ui//check-square",description:fe.properties.boolean.description},{type:"date",label:fe.properties.date.label,metadata:!0,icon:"ui//calendar",configKeys:["format"],description:fe.properties.date.description},{type:"option",label:fe.properties.option.label,multi:!0,multiType:"option-multi",icon:"ui//list",configKeys:["options","source"],description:fe.properties.option.description},{type:"tags",label:fe.properties.tags.label,icon:"ui//tags",description:fe.properties.tags.description},{type:"file",label:fe.properties.file.label,restricted:!0,icon:"ui//mk-make-h3"},{type:"fileprop",label:fe.properties.fileProperty.label,icon:"ui//formula",configKeys:["field","value"],description:fe.properties.fileProperty.description},{type:"link",label:fe.properties.link.label,multi:!0,multiType:"link-multi",metadata:!0,icon:"ui//file-text",description:fe.properties.link.description},{type:"context",label:fe.properties.context.label,icon:"ui//mk-make-note",multi:!0,multiType:"context-multi",configKeys:["space"],description:fe.properties.context.description},{type:"object",label:fe.properties.object.label,multi:!0,multiType:"object-multi",metadata:!0,icon:"ui//list-tree",configKeys:["type"],description:fe.properties.object.description},{type:"icon",label:fe.properties.icon.label,multi:!0,multiType:"icon-multi",icon:"ui//gem",restricted:!0,description:fe.properties.icon.description},{type:"image",label:fe.properties.image.label,multi:!0,multiType:"image-multi",metadata:!0,icon:"ui//mk-make-image",description:fe.properties.image.description},{type:"color",label:fe.properties.color.label,icon:"ui//mk-make-image",restricted:!0,description:fe.properties.color.description},{type:"space",label:fe.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:fe.properties.space.description},{type:"table",label:fe.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:fe.properties.space.description},{type:"super",label:fe.properties.super.label,icon:"ui//zap",restricted:!0,configKeys:["dynamic","field"]},{type:"input",label:fe.properties.super.label,icon:"ui//input",restricted:!0}];var hi="files",Bo={id:hi,name:"Files",type:"db",primary:"true"},av="filesView",sv={id:av,name:"All",type:"view",def:JSON.stringify({db:hi,icon:"ui//file-stack"})},ov="main",uv=e=>({id:e,name:e,type:"frame",def:"",predicate:"",primary:"true"}),BS={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[uv(ov),sv]},Wo={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[Bo]},rp={uniques:["name,schemaId"],cols:["name","schemaId","type","value","attrs","hidden","unique","primary"]},Yo={...rp,rows:[{name:on,schemaId:hi,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""},{name:fe.properties.fileProperty.createdTime,schemaId:hi,type:"fileprop",value:on+".ctime",hidden:"",unique:"",attrs:"",primary:"true"}]};var VS=[{name:fe.properties.defaultField,schemaId:"",type:"text",primary:"true"}],Uf={...rp,rows:[{name:on,schemaId:hi,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""}]};var US={schema:Bo,cols:Yo.rows,rows:[]},HS={schema:Bo,cols:Yo.rows,rows:[]},qS={schema:Bo,cols:Uf.rows,rows:[]},np=(e,r)=>e.filter(a=>r.find(u=>u.id==a.schemaId&&u.type=="db")).reduce((a,u)=>({...a,...a[u.schemaId]?{[u.schemaId]:{uniques:u.unique=="true"?[...a[u.schemaId].uniques,u.name]:a[u.schemaId].uniques,cols:[...a[u.schemaId].cols,u.name],rows:[]}}:{[u.schemaId]:{uniques:u.unique=="true"?[u.name]:[],cols:[u.name],rows:[]}}}),{});var GS={m_schema:Wo,m_fields:Yo,...np(Yo.rows,Wo.rows)},zS={m_schema:Wo,m_fields:Uf,...np(Uf.rows,Wo.rows)};var ip=(e,r)=>e.hiddenExtensions.some(a=>r.endsWith(a))||r.startsWith(e.spacesFolder+"/#")||e.hiddenFiles.some(a=>a==r);var ap=(e,r,a)=>{if(!e)return{changed:!1,cache:null};if(!r)return{changed:!1,cache:{path:e.path,frames:{},schemas:[]}};let u=Object.values(r).map(C=>C.schema),l=u.filter(C=>C.type=="frame").reduce((C,T)=>({...C,[T.id]:r[T.id]}),{}),p={path:e.path,frames:l,schemas:u},v=!0;return a&&Vo.default.isEqual(p,a)&&(v=!1),{changed:v,cache:p}},sp=(e,r,a,u,l)=>{let p={};if(!e)return{changed:!1,cache:null};if(!r)return{changed:!1,cache:{cols:[],path:e.path,schemas:[],outlinks:[],contexts:[],paths:[],tables:{},space:e,spaceMap:p,dbExists:!1}};let v=Object.values(r).map(de=>de.schema),C=v.find(de=>de.primary=="true"),T=r[C.id],A=r,R=T.cols?.filter(de=>de.type.startsWith("context"))??[],V=T.cols?.filter(de=>de.type.startsWith("link"))??[],K=sn(R.map(de=>de.value));R.forEach(de=>{p[de.name]={},T.rows.forEach(We=>{sr(We[de.name]).forEach(ze=>p[de.name][ze]=[...p[de.name][ze]??[],We[on]])})});let re=A[hi]?.rows?.map(de=>de[on])??[],N=Ph(a??[],re),_e=sn(T.rows.reduce((de,We)=>sn([...de,...[...R,...V].flatMap(ze=>sr(We[ze.name]).map($e=>is($e)))]),[])),Le={cols:T.cols,path:e.path,contexts:K,outlinks:_e,paths:N,tables:A,schemas:v,space:e,spaceMap:p,dbExists:l},ye=!0;return u&&Vo.default.isEqual(Le,u)&&(ye=!0),{changed:ye,cache:Le}},op=(e,r,a,u)=>{let l={};for(let[p,v]of e){let C=a.get(p)?.defPath??p,T=e.get(C)??v,A=v?.parent??"",R=v?.type??"",V=v?.subtype??"",K=T?.label,re=u?.get(p),{changed:N,cache:_e}=Hf(p,r,a,T,K,R,V,A,re);l[p]={changed:N,cache:_e}}return l},Hf=(e,r,a,u,l,p,v,C,T)=>{let A=(me,at,mt)=>me?.length>0||me?.length>0?me:at=="space"?mt=="Spaces/Home"?"ui//home":mt=="/"?"ui//vault":mt.startsWith("spaces://#")?"ui//tags":"ui//folder":"ui//file",R={label:u?.label,path:e,name:No(e),displayName:No(e)},V=[],K=u?.tags?.map(me=>me)??[],re=ip(r,e),N=(me,at,mt=new Set)=>{let Rt=[];for(let Oe of at){let Qe=me.get(Oe)?.contexts??[];for(let Wt of Qe)mt.has(Wt)||(Rt.push(Wt),mt.add(Wt),Rt.push(...N(me,[Lo(Wt)],mt)))}return Rt};if(a.has(C))for(let me of a.get(C).contexts??[])V.push(me);V.push(...K);let _e=l?.name,Le=u?.properties?vf(u.properties[r.fmKeyAlias]):[],ye=A(l?.sticker,p,e),de=l?.color??"",We=u?.inlinks??[],ze=u?.links??[],$e=r.spacesUseAlias?Le[0]??_e:_e,Pe={...R,name:_e,tags:sn(V),type:p,subtype:v,displayName:$e,parent:C,label:{name:_e,sticker:ye,color:de,thumbnail:l?.thumbnail??"",preview:l?.preview??""},metadata:{...u},inlinks:We,outlinks:ze},tt=[];for(let me of V)tt.push(Lo(me));for(let[me,at]of a){if(at.defPath==e&&(re=!0),at.space&&at.space.path==C){tt.push(me);continue}if(at.metadata?.filters?.length>0&&Yf(at.metadata.filters,Pe)){tt.push(me);continue}if(at.metadata?.links?.length>0&&(at.metadata?.links??[]).find(Rt=>Rt==Pe.path)){tt.push(me);continue}}let je=N(a,tt);tt.push(...je.map(me=>Lo(me))),Pe.tags.push(...je);let pr=re?{...Pe,spaces:[],hidden:re}:{...Pe,spaces:sn(tt),hidden:re},jt=!0;return T&&Vo.default.isEqual(pr,T)&&(jt=!1),{changed:jt,cache:pr}};var qf=Ao(Fo());var lv=(e,r,a)=>{if(e.length!==1)return"";let u=e.map(function(v){return v.compile().evaluate(a)}),l=a.get(u[0]),p=a.get("$properties")?.[u[0]]?.type;return(p=="file"||p=="link"||p=="context")&&(p.includes("multi")?l=sr(l).map(v=>a.get("$paths").get(v)??v):l=a.get("$paths").get(l)??l),l??""};lv.rawArgs=!0;var fv=(e,r,a)=>{if((e.length-1)%2!==0)return"";for(let u=0;u{if(e.length<1||e.length>2)return"";let u=e[0].compile().evaluate(a);u instanceof Date||(u=new Date(u));let l=e[1]?.compile().evaluate(a);return l?.length>0?fi(u,l):fi(u,a.get("$settings")?.dateFormat??"yyyy-MM-dd")};cv.rawArgs=!0;var pv=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],pp=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],dv="\\u200C\\u200D\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0898-\\u089F\\u08CA-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EBC\\u0EC8-\\u0ECE\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u180F-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1ABF-\\u1ACE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\u30FB\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F\\uFF65",dp="\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309B-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC",Gf={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},zf="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",mv={5:zf,"5module":zf+" export import",6:zf+" const class extends export import super"},gv=/^in(stanceof)?$/,yv=new RegExp("["+dp+"]"),xv=new RegExp("["+dp+dv+"]");function jf(e,r){for(var a=65536,u=0;ue)return!1;if(a+=r[u+1],a>=e)return!0}return!1}function ln(e,r){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&yv.test(String.fromCharCode(e)):r===!1?!1:jf(e,pp)}function aa(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&xv.test(String.fromCharCode(e)):r===!1?!1:jf(e,pp)||jf(e,pv)}var we=function(r,a){a===void 0&&(a={}),this.label=r,this.keyword=a.keyword,this.beforeExpr=!!a.beforeExpr,this.startsExpr=!!a.startsExpr,this.isLoop=!!a.isLoop,this.isAssign=!!a.isAssign,this.prefix=!!a.prefix,this.postfix=!!a.postfix,this.binop=a.binop||null,this.updateContext=null};function or(e,r){return new we(e,{beforeExpr:!0,binop:r})}var ur={beforeExpr:!0},Lt={startsExpr:!0},Zf={};function pe(e,r){return r===void 0&&(r={}),r.keyword=e,Zf[e]=new we(e,r)}var y={num:new we("num",Lt),regexp:new we("regexp",Lt),string:new we("string",Lt),name:new we("name",Lt),privateId:new we("privateId",Lt),eof:new we("eof"),bracketL:new we("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new we("]"),braceL:new we("{",{beforeExpr:!0,startsExpr:!0}),braceR:new we("}"),parenL:new we("(",{beforeExpr:!0,startsExpr:!0}),parenR:new we(")"),comma:new we(",",ur),semi:new we(";",ur),colon:new we(":",ur),dot:new we("."),question:new we("?",ur),questionDot:new we("?."),arrow:new we("=>",ur),template:new we("template"),invalidTemplate:new we("invalidTemplate"),ellipsis:new we("...",ur),backQuote:new we("\`",Lt),dollarBraceL:new we("\${",{beforeExpr:!0,startsExpr:!0}),eq:new we("=",{beforeExpr:!0,isAssign:!0}),assign:new we("_=",{beforeExpr:!0,isAssign:!0}),incDec:new we("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new we("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:or("||",1),logicalAND:or("&&",2),bitwiseOR:or("|",3),bitwiseXOR:or("^",4),bitwiseAND:or("&",5),equality:or("==/!=/===/!==",6),relational:or("/<=/>=",7),bitShift:or("<>/>>>",8),plusMin:new we("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:or("%",10),star:or("*",10),slash:or("/",10),starstar:new we("**",{beforeExpr:!0}),coalesce:or("??",1),_break:pe("break"),_case:pe("case",ur),_catch:pe("catch"),_continue:pe("continue"),_debugger:pe("debugger"),_default:pe("default",ur),_do:pe("do",{isLoop:!0,beforeExpr:!0}),_else:pe("else",ur),_finally:pe("finally"),_for:pe("for",{isLoop:!0}),_function:pe("function",Lt),_if:pe("if"),_return:pe("return",ur),_switch:pe("switch"),_throw:pe("throw",ur),_try:pe("try"),_var:pe("var"),_const:pe("const"),_while:pe("while",{isLoop:!0}),_with:pe("with"),_new:pe("new",{beforeExpr:!0,startsExpr:!0}),_this:pe("this",Lt),_super:pe("super",Lt),_class:pe("class",Lt),_extends:pe("extends",ur),_export:pe("export"),_import:pe("import",Lt),_null:pe("null",Lt),_true:pe("true",Lt),_false:pe("false",Lt),_in:pe("in",{beforeExpr:!0,binop:7}),_instanceof:pe("instanceof",{beforeExpr:!0,binop:7}),_typeof:pe("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:pe("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:pe("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},cr=/\\r\\n?|\\n|\\u2028|\\u2029/,vv=new RegExp(cr.source,"g");function sa(e){return e===10||e===13||e===8232||e===8233}function mp(e,r,a){a===void 0&&(a=e.length);for(var u=r;u>10)+55296,(e&1023)+56320))}var _v=/(?:[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/,os=function(r,a){this.line=r,this.column=a};os.prototype.offset=function(r){return new os(this.line,this.column+r)};var zo=function(r,a,u){this.start=a,this.end=u,r.sourceFile!==null&&(this.source=r.sourceFile)};function xp(e,r){for(var a=1,u=0;;){var l=mp(e,u,r);if(l<0)return new os(a,r-u);++a,u=l}}var Qf={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},fp=!1;function bv(e){var r={};for(var a in Qf)r[a]=e&&ls(e,a)?e[a]:Qf[a];if(r.ecmaVersion==="latest"?r.ecmaVersion=1e8:r.ecmaVersion==null?(!fp&&typeof console=="object"&&console.warn&&(fp=!0,console.warn(\`Since Acorn 8.0.0, options.ecmaVersion is required. -Defaulting to 2020, but this will stop working in the future.\`)),r.ecmaVersion=11):r.ecmaVersion>=2015&&(r.ecmaVersion-=2009),r.allowReserved==null&&(r.allowReserved=r.ecmaVersion<5),(!e||e.allowHashBang==null)&&(r.allowHashBang=r.ecmaVersion>=14),up(r.onToken)){var u=r.onToken;r.onToken=function(l){return u.push(l)}}return up(r.onComment)&&(r.onComment=kv(r,r.onComment)),r}function kv(e,r){return function(a,u,l,p,v,C){var T={type:a?"Block":"Line",value:u,start:l,end:p};e.locations&&(T.loc=new zo(this,v,C)),e.ranges&&(T.range=[l,p]),r.push(T)}}var us=1,oa=2,Xf=4,vp=8,wp=16,Sp=32,Jf=64,_p=128,fs=256,ec=us|oa|fs;function tc(e,r){return oa|(e?Xf:0)|(r?vp:0)}var Ho=0,rc=1,cn=2,bp=3,kp=4,Cp=5,ft=function(r,a,u){this.options=r=bv(r),this.sourceFile=r.sourceFile,this.keywords=Ln(mv[r.ecmaVersion>=6?6:r.sourceType==="module"?"5module":5]);var l="";r.allowReserved!==!0&&(l=Gf[r.ecmaVersion>=6?6:r.ecmaVersion===5?5:3],r.sourceType==="module"&&(l+=" await")),this.reservedWords=Ln(l);var p=(l?l+" ":"")+Gf.strict;this.reservedWordsStrict=Ln(p),this.reservedWordsStrictBind=Ln(p+" "+Gf.strictBind),this.input=String(a),this.containsEsc=!1,u?(this.pos=u,this.lineStart=this.input.lastIndexOf(\` -\`,u-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(cr).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=y.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=r.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&r.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(us),this.regexpState=null,this.privateNameStack=[]},Ur={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};ft.prototype.parse=function(){var r=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(r)};Ur.inFunction.get=function(){return(this.currentVarScope().flags&oa)>0};Ur.inGenerator.get=function(){return(this.currentVarScope().flags&vp)>0&&!this.currentVarScope().inClassFieldInit};Ur.inAsync.get=function(){return(this.currentVarScope().flags&Xf)>0&&!this.currentVarScope().inClassFieldInit};Ur.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var r=this.scopeStack[e];if(r.inClassFieldInit||r.flags&fs)return!1;if(r.flags&oa)return(r.flags&Xf)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Ur.allowSuper.get=function(){var e=this.currentThisScope(),r=e.flags,a=e.inClassFieldInit;return(r&Jf)>0||a||this.options.allowSuperOutsideMethod};Ur.allowDirectSuper.get=function(){return(this.currentThisScope().flags&_p)>0};Ur.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Ur.allowNewDotTarget.get=function(){var e=this.currentThisScope(),r=e.flags,a=e.inClassFieldInit;return(r&(oa|fs))>0||a};Ur.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&fs)>0};ft.extend=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];for(var u=this,l=0;l=,?^&]/.test(l)||l==="!"&&this.input.charAt(u+1)==="=")}e+=r[0].length,lr.lastIndex=e,e+=lr.exec(this.input)[0].length,this.input[e]===";"&&e++}};Ct.eat=function(e){return this.type===e?(this.next(),!0):!1};Ct.isContextual=function(e){return this.type===y.name&&this.value===e&&!this.containsEsc};Ct.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};Ct.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};Ct.canInsertSemicolon=function(){return this.type===y.eof||this.type===y.braceR||cr.test(this.input.slice(this.lastTokEnd,this.start))};Ct.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};Ct.semicolon=function(){!this.eat(y.semi)&&!this.insertSemicolon()&&this.unexpected()};Ct.afterTrailingComma=function(e,r){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),r||this.next(),!0};Ct.expect=function(e){this.eat(e)||this.unexpected()};Ct.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var $o=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Ct.checkPatternErrors=function(e,r){if(!!e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var a=r?e.parenthesizedAssign:e.parenthesizedBind;a>-1&&this.raiseRecoverable(a,r?"Assigning to rvalue":"Parenthesized pattern")}};Ct.checkExpressionErrors=function(e,r){if(!e)return!1;var a=e.shorthandAssign,u=e.doubleProto;if(!r)return a>=0||u>=0;a>=0&&this.raise(a,"Shorthand property assignments are valid only in destructuring patterns"),u>=0&&this.raiseRecoverable(u,"Redefinition of __proto__ property")};Ct.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&u<56320)return!0;if(ln(u,!0)){for(var l=a+1;aa(u=this.input.charCodeAt(l),!0);)++l;if(u===92||u>55295&&u<56320)return!0;var p=this.input.slice(a,l);if(!gv.test(p))return!0}return!1};z.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;lr.lastIndex=this.pos;var e=lr.exec(this.input),r=this.pos+e[0].length,a;return!cr.test(this.input.slice(this.pos,r))&&this.input.slice(r,r+8)==="function"&&(r+8===this.input.length||!(aa(a=this.input.charCodeAt(r+8))||a>55295&&a<56320))};z.parseStatement=function(e,r,a){var u=this.type,l=this.startNode(),p;switch(this.isLet(e)&&(u=y._var,p="let"),u){case y._break:case y._continue:return this.parseBreakContinueStatement(l,u.keyword);case y._debugger:return this.parseDebuggerStatement(l);case y._do:return this.parseDoStatement(l);case y._for:return this.parseForStatement(l);case y._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(l,!1,!e);case y._class:return e&&this.unexpected(),this.parseClass(l,!0);case y._if:return this.parseIfStatement(l);case y._return:return this.parseReturnStatement(l);case y._switch:return this.parseSwitchStatement(l);case y._throw:return this.parseThrowStatement(l);case y._try:return this.parseTryStatement(l);case y._const:case y._var:return p=p||this.value,e&&p!=="var"&&this.unexpected(),this.parseVarStatement(l,p);case y._while:return this.parseWhileStatement(l);case y._with:return this.parseWithStatement(l);case y.braceL:return this.parseBlock(!0,l);case y.semi:return this.parseEmptyStatement(l);case y._export:case y._import:if(this.options.ecmaVersion>10&&u===y._import){lr.lastIndex=this.pos;var v=lr.exec(this.input),C=this.pos+v[0].length,T=this.input.charCodeAt(C);if(T===40||T===46)return this.parseExpressionStatement(l,this.parseExpression())}return this.options.allowImportExportEverywhere||(r||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),u===y._import?this.parseImport(l):this.parseExport(l,a);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(l,!0,!e);var A=this.value,R=this.parseExpression();return u===y.name&&R.type==="Identifier"&&this.eat(y.colon)?this.parseLabeledStatement(l,A,R,e):this.parseExpressionStatement(l,R)}};z.parseBreakContinueStatement=function(e,r){var a=r==="break";this.next(),this.eat(y.semi)||this.insertSemicolon()?e.label=null:this.type!==y.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var u=0;u=6?this.eat(y.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};z.parseForStatement=function(e){this.next();var r=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(nc),this.enterScope(0),this.expect(y.parenL),this.type===y.semi)return r>-1&&this.unexpected(r),this.parseFor(e,null);var a=this.isLet();if(this.type===y._var||this.type===y._const||a){var u=this.startNode(),l=a?"let":this.value;return this.next(),this.parseVar(u,!0,l),this.finishNode(u,"VariableDeclaration"),(this.type===y._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&u.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===y._in?r>-1&&this.unexpected(r):e.await=r>-1),this.parseForIn(e,u)):(r>-1&&this.unexpected(r),this.parseFor(e,u))}var p=this.isContextual("let"),v=!1,C=new $o,T=this.parseExpression(r>-1?"await":!0,C);return this.type===y._in||(v=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===y._in?r>-1&&this.unexpected(r):e.await=r>-1),p&&v&&this.raise(T.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(T,!1,C),this.checkLValPattern(T),this.parseForIn(e,T)):(this.checkExpressionErrors(C,!0),r>-1&&this.unexpected(r),this.parseFor(e,T))};z.parseFunctionStatement=function(e,r,a){return this.next(),this.parseFunction(e,ss|(a?0:Kf),!1,r)};z.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(y._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};z.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(y.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};z.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(y.braceL),this.labels.push(Tv),this.enterScope(0);for(var r,a=!1;this.type!==y.braceR;)if(this.type===y._case||this.type===y._default){var u=this.type===y._case;r&&this.finishNode(r,"SwitchCase"),e.cases.push(r=this.startNode()),r.consequent=[],this.next(),u?r.test=this.parseExpression():(a&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),a=!0,r.test=null),this.expect(y.colon)}else r||this.unexpected(),r.consequent.push(this.parseStatement(null));return this.exitScope(),r&&this.finishNode(r,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};z.parseThrowStatement=function(e){return this.next(),cr.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Pv=[];z.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),r=e.type==="Identifier";return this.enterScope(r?Sp:0),this.checkLValPattern(e,r?kp:cn),this.expect(y.parenR),e};z.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===y._catch){var r=this.startNode();this.next(),this.eat(y.parenL)?r.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),r.param=null,this.enterScope(0)),r.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(r,"CatchClause")}return e.finalizer=this.eat(y._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};z.parseVarStatement=function(e,r,a){return this.next(),this.parseVar(e,!1,r,a),this.semicolon(),this.finishNode(e,"VariableDeclaration")};z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(nc),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};z.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};z.parseLabeledStatement=function(e,r,a,u){for(var l=0,p=this.labels;l=0;T--){var A=this.labels[T];if(A.statementStart===e.start)A.statementStart=this.start,A.kind=C;else break}return this.labels.push({name:r,kind:C,statementStart:this.start}),e.body=this.parseStatement(u?u.indexOf("label")===-1?u+"label":u:"label"),this.labels.pop(),e.label=a,this.finishNode(e,"LabeledStatement")};z.parseExpressionStatement=function(e,r){return e.expression=r,this.semicolon(),this.finishNode(e,"ExpressionStatement")};z.parseBlock=function(e,r,a){for(e===void 0&&(e=!0),r===void 0&&(r=this.startNode()),r.body=[],this.expect(y.braceL),e&&this.enterScope(0);this.type!==y.braceR;){var u=this.parseStatement(null);r.body.push(u)}return a&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(r,"BlockStatement")};z.parseFor=function(e,r){return e.init=r,this.expect(y.semi),e.test=this.type===y.semi?null:this.parseExpression(),this.expect(y.semi),e.update=this.type===y.parenR?null:this.parseExpression(),this.expect(y.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};z.parseForIn=function(e,r){var a=this.type===y._in;return this.next(),r.type==="VariableDeclaration"&&r.declarations[0].init!=null&&(!a||this.options.ecmaVersion<8||this.strict||r.kind!=="var"||r.declarations[0].id.type!=="Identifier")&&this.raise(r.start,(a?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=r,e.right=a?this.parseExpression():this.parseMaybeAssign(),this.expect(y.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,a?"ForInStatement":"ForOfStatement")};z.parseVar=function(e,r,a,u){for(e.declarations=[],e.kind=a;;){var l=this.startNode();if(this.parseVarId(l,a),this.eat(y.eq)?l.init=this.parseMaybeAssign(r):!u&&a==="const"&&!(this.type===y._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!u&&l.id.type!=="Identifier"&&!(r&&(this.type===y._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):l.init=null,e.declarations.push(this.finishNode(l,"VariableDeclarator")),!this.eat(y.comma))break}return e};z.parseVarId=function(e,r){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,r==="var"?rc:cn,!1)};var ss=1,Kf=2,Tp=4;z.parseFunction=function(e,r,a,u,l){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!u)&&(this.type===y.star&&r&Kf&&this.unexpected(),e.generator=this.eat(y.star)),this.options.ecmaVersion>=8&&(e.async=!!u),r&ss&&(e.id=r&Tp&&this.type!==y.name?null:this.parseIdent(),e.id&&!(r&Kf)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?rc:cn:bp));var p=this.yieldPos,v=this.awaitPos,C=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(tc(e.async,e.generator)),r&ss||(e.id=this.type===y.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,a,!1,l),this.yieldPos=p,this.awaitPos=v,this.awaitIdentPos=C,this.finishNode(e,r&ss?"FunctionDeclaration":"FunctionExpression")};z.parseFunctionParams=function(e){this.expect(y.parenL),e.params=this.parseBindingList(y.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};z.parseClass=function(e,r){this.next();var a=this.strict;this.strict=!0,this.parseClassId(e,r),this.parseClassSuper(e);var u=this.enterClassBody(),l=this.startNode(),p=!1;for(l.body=[],this.expect(y.braceL);this.type!==y.braceR;){var v=this.parseClassElement(e.superClass!==null);v&&(l.body.push(v),v.type==="MethodDefinition"&&v.kind==="constructor"?(p&&this.raiseRecoverable(v.start,"Duplicate constructor in the same class"),p=!0):v.key&&v.key.type==="PrivateIdentifier"&&Ev(u,v)&&this.raiseRecoverable(v.key.start,"Identifier '#"+v.key.name+"' has already been declared"))}return this.strict=a,this.next(),e.body=this.finishNode(l,"ClassBody"),this.exitClassBody(),this.finishNode(e,r?"ClassDeclaration":"ClassExpression")};z.parseClassElement=function(e){if(this.eat(y.semi))return null;var r=this.options.ecmaVersion,a=this.startNode(),u="",l=!1,p=!1,v="method",C=!1;if(this.eatContextual("static")){if(r>=13&&this.eat(y.braceL))return this.parseClassStaticBlock(a),a;this.isClassElementNameStart()||this.type===y.star?C=!0:u="static"}if(a.static=C,!u&&r>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===y.star)&&!this.canInsertSemicolon()?p=!0:u="async"),!u&&(r>=9||!p)&&this.eat(y.star)&&(l=!0),!u&&!p&&!l){var T=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?v=T:u=T)}if(u?(a.computed=!1,a.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),a.key.name=u,this.finishNode(a.key,"Identifier")):this.parseClassElementName(a),r<13||this.type===y.parenL||v!=="method"||l||p){var A=!a.static&&qo(a,"constructor"),R=A&&e;A&&v!=="method"&&this.raise(a.key.start,"Constructor can't have get/set modifier"),a.kind=A?"constructor":v,this.parseClassMethod(a,l,p,R)}else this.parseClassField(a);return a};z.isClassElementNameStart=function(){return this.type===y.name||this.type===y.privateId||this.type===y.num||this.type===y.string||this.type===y.bracketL||this.type.keyword};z.parseClassElementName=function(e){this.type===y.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};z.parseClassMethod=function(e,r,a,u){var l=e.key;e.kind==="constructor"?(r&&this.raise(l.start,"Constructor can't be a generator"),a&&this.raise(l.start,"Constructor can't be an async method")):e.static&&qo(e,"prototype")&&this.raise(l.start,"Classes may not have a static property named prototype");var p=e.value=this.parseMethod(r,a,u);return e.kind==="get"&&p.params.length!==0&&this.raiseRecoverable(p.start,"getter should have no params"),e.kind==="set"&&p.params.length!==1&&this.raiseRecoverable(p.start,"setter should have exactly one param"),e.kind==="set"&&p.params[0].type==="RestElement"&&this.raiseRecoverable(p.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};z.parseClassField=function(e){if(qo(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&qo(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(y.eq)){var r=this.currentThisScope(),a=r.inClassFieldInit;r.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),r.inClassFieldInit=a}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};z.parseClassStaticBlock=function(e){e.body=[];var r=this.labels;for(this.labels=[],this.enterScope(fs|Jf);this.type!==y.braceR;){var a=this.parseStatement(null);e.body.push(a)}return this.next(),this.exitScope(),this.labels=r,this.finishNode(e,"StaticBlock")};z.parseClassId=function(e,r){this.type===y.name?(e.id=this.parseIdent(),r&&this.checkLValSimple(e.id,cn,!1)):(r===!0&&this.unexpected(),e.id=null)};z.parseClassSuper=function(e){e.superClass=this.eat(y._extends)?this.parseExprSubscripts(null,!1):null};z.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};z.exitClassBody=function(){var e=this.privateNameStack.pop(),r=e.declared,a=e.used;if(!!this.options.checkPrivateFields)for(var u=this.privateNameStack.length,l=u===0?null:this.privateNameStack[u-1],p=0;p=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(r,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==y.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};z.parseExport=function(e,r){if(this.next(),this.eat(y.star))return this.parseExportAllDeclaration(e,r);if(this.eat(y._default))return this.checkExport(r,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(r,e.declaration.declarations):this.checkExport(r,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(r),this.eatContextual("from"))this.type!==y.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var a=0,u=e.specifiers;a=13&&this.type===y.string){var e=this.parseLiteral(this.value);return _v.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};z.adaptDirectivePrologue=function(e){for(var r=0;r=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var hr=ft.prototype;hr.toAssignable=function(e,r,a){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",a&&this.checkPatternErrors(a,!0);for(var u=0,l=e.properties;u=8&&!C&&T.name==="async"&&!this.canInsertSemicolon()&&this.eat(y._function))return this.overrideContext(Ye.f_expr),this.parseFunction(this.startNodeAt(p,v),0,!1,!0,r);if(l&&!this.canInsertSemicolon()){if(this.eat(y.arrow))return this.parseArrowExpression(this.startNodeAt(p,v),[T],!1,r);if(this.options.ecmaVersion>=8&&T.name==="async"&&this.type===y.name&&!C&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return T=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(y.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(p,v),[T],!0,r)}return T;case y.regexp:var A=this.value;return u=this.parseLiteral(A.value),u.regex={pattern:A.pattern,flags:A.flags},u;case y.num:case y.string:return this.parseLiteral(this.value);case y._null:case y._true:case y._false:return u=this.startNode(),u.value=this.type===y._null?null:this.type===y._true,u.raw=this.type.keyword,this.next(),this.finishNode(u,"Literal");case y.parenL:var R=this.start,V=this.parseParenAndDistinguishExpression(l,r);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(V)&&(e.parenthesizedAssign=R),e.parenthesizedBind<0&&(e.parenthesizedBind=R)),V;case y.bracketL:return u=this.startNode(),this.next(),u.elements=this.parseExprList(y.bracketR,!0,!0,e),this.finishNode(u,"ArrayExpression");case y.braceL:return this.overrideContext(Ye.b_expr),this.parseObj(!1,e);case y._function:return u=this.startNode(),this.next(),this.parseFunction(u,0);case y._class:return this.parseClass(this.startNode(),!1);case y._new:return this.parseNew();case y.backQuote:return this.parseTemplate();case y._import:return this.options.ecmaVersion>=11?this.parseExprImport(a):this.unexpected();default:return this.parseExprAtomDefault()}};X.parseExprAtomDefault=function(){this.unexpected()};X.parseExprImport=function(e){var r=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===y.parenL&&!e)return this.parseDynamicImport(r);if(this.type===y.dot){var a=this.startNodeAt(r.start,r.loc&&r.loc.start);return a.name="import",r.meta=this.finishNode(a,"Identifier"),this.parseImportMeta(r)}else this.unexpected()};X.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(y.parenR)){var r=this.start;this.eat(y.comma)&&this.eat(y.parenR)?this.raiseRecoverable(r,"Trailing comma is not allowed in import()"):this.unexpected(r)}return this.finishNode(e,"ImportExpression")};X.parseImportMeta=function(e){this.next();var r=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),r&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};X.parseLiteral=function(e){var r=this.startNode();return r.value=e,r.raw=this.input.slice(this.start,this.end),r.raw.charCodeAt(r.raw.length-1)===110&&(r.bigint=r.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(r,"Literal")};X.parseParenExpression=function(){this.expect(y.parenL);var e=this.parseExpression();return this.expect(y.parenR),e};X.shouldParseArrow=function(e){return!this.canInsertSemicolon()};X.parseParenAndDistinguishExpression=function(e,r){var a=this.start,u=this.startLoc,l,p=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var v=this.start,C=this.startLoc,T=[],A=!0,R=!1,V=new $o,K=this.yieldPos,re=this.awaitPos,N;for(this.yieldPos=0,this.awaitPos=0;this.type!==y.parenR;)if(A?A=!1:this.expect(y.comma),p&&this.afterTrailingComma(y.parenR,!0)){R=!0;break}else if(this.type===y.ellipsis){N=this.start,T.push(this.parseParenItem(this.parseRestBinding())),this.type===y.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else T.push(this.parseMaybeAssign(!1,V,this.parseParenItem));var _e=this.lastTokEnd,Le=this.lastTokEndLoc;if(this.expect(y.parenR),e&&this.shouldParseArrow(T)&&this.eat(y.arrow))return this.checkPatternErrors(V,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=K,this.awaitPos=re,this.parseParenArrowList(a,u,T,r);(!T.length||R)&&this.unexpected(this.lastTokStart),N&&this.unexpected(N),this.checkExpressionErrors(V,!0),this.yieldPos=K||this.yieldPos,this.awaitPos=re||this.awaitPos,T.length>1?(l=this.startNodeAt(v,C),l.expressions=T,this.finishNodeAt(l,"SequenceExpression",_e,Le)):l=T[0]}else l=this.parseParenExpression();if(this.options.preserveParens){var ye=this.startNodeAt(a,u);return ye.expression=l,this.finishNode(ye,"ParenthesizedExpression")}else return l};X.parseParenItem=function(e){return e};X.parseParenArrowList=function(e,r,a,u){return this.parseArrowExpression(this.startNodeAt(e,r),a,!1,u)};var Dv=[];X.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===y.dot){var r=this.startNodeAt(e.start,e.loc&&e.loc.start);r.name="new",e.meta=this.finishNode(r,"Identifier"),this.next();var a=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),a&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var u=this.start,l=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),u,l,!0,!1),this.eat(y.parenL)?e.arguments=this.parseExprList(y.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Dv,this.finishNode(e,"NewExpression")};X.parseTemplateElement=function(e){var r=e.isTagged,a=this.startNode();return this.type===y.invalidTemplate?(r||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),a.value={raw:this.value,cooked:null}):a.value={raw:this.input.slice(this.start,this.end).replace(/\\r\\n?/g,\` -\`),cooked:this.value},this.next(),a.tail=this.type===y.backQuote,this.finishNode(a,"TemplateElement")};X.parseTemplate=function(e){e===void 0&&(e={});var r=e.isTagged;r===void 0&&(r=!1);var a=this.startNode();this.next(),a.expressions=[];var u=this.parseTemplateElement({isTagged:r});for(a.quasis=[u];!u.tail;)this.type===y.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(y.dollarBraceL),a.expressions.push(this.parseExpression()),this.expect(y.braceR),a.quasis.push(u=this.parseTemplateElement({isTagged:r}));return this.next(),this.finishNode(a,"TemplateLiteral")};X.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===y.name||this.type===y.num||this.type===y.string||this.type===y.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===y.star)&&!cr.test(this.input.slice(this.lastTokEnd,this.start))};X.parseObj=function(e,r){var a=this.startNode(),u=!0,l={};for(a.properties=[],this.next();!this.eat(y.braceR);){if(u)u=!1;else if(this.expect(y.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(y.braceR))break;var p=this.parseProperty(e,r);e||this.checkPropClash(p,l,r),a.properties.push(p)}return this.finishNode(a,e?"ObjectPattern":"ObjectExpression")};X.parseProperty=function(e,r){var a=this.startNode(),u,l,p,v;if(this.options.ecmaVersion>=9&&this.eat(y.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===y.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(a.argument=this.parseMaybeAssign(!1,r),this.type===y.comma&&r&&r.trailingComma<0&&(r.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(e||r)&&(p=this.start,v=this.startLoc),e||(u=this.eat(y.star)));var C=this.containsEsc;return this.parsePropertyName(a),!e&&!C&&this.options.ecmaVersion>=8&&!u&&this.isAsyncProp(a)?(l=!0,u=this.options.ecmaVersion>=9&&this.eat(y.star),this.parsePropertyName(a)):l=!1,this.parsePropertyValue(a,e,u,l,p,v,r,C),this.finishNode(a,"Property")};X.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var r=e.kind==="get"?0:1;if(e.value.params.length!==r){var a=e.value.start;e.kind==="get"?this.raiseRecoverable(a,"getter should have no params"):this.raiseRecoverable(a,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};X.parsePropertyValue=function(e,r,a,u,l,p,v,C){(a||u)&&this.type===y.colon&&this.unexpected(),this.eat(y.colon)?(e.value=r?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,v),e.kind="init"):this.options.ecmaVersion>=6&&this.type===y.parenL?(r&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(a,u)):!r&&!C&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==y.comma&&this.type!==y.braceR&&this.type!==y.eq?((a||u)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((a||u)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=l),e.kind="init",r?e.value=this.parseMaybeDefault(l,p,this.copyNode(e.key)):this.type===y.eq&&v?(v.shorthandAssign<0&&(v.shorthandAssign=this.start),e.value=this.parseMaybeDefault(l,p,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};X.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(y.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(y.bracketR),e.key;e.computed=!1}return e.key=this.type===y.num||this.type===y.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};X.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};X.parseMethod=function(e,r,a){var u=this.startNode(),l=this.yieldPos,p=this.awaitPos,v=this.awaitIdentPos;return this.initFunction(u),this.options.ecmaVersion>=6&&(u.generator=e),this.options.ecmaVersion>=8&&(u.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(tc(r,u.generator)|Jf|(a?_p:0)),this.expect(y.parenL),u.params=this.parseBindingList(y.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(u,!1,!0,!1),this.yieldPos=l,this.awaitPos=p,this.awaitIdentPos=v,this.finishNode(u,"FunctionExpression")};X.parseArrowExpression=function(e,r,a,u){var l=this.yieldPos,p=this.awaitPos,v=this.awaitIdentPos;return this.enterScope(tc(a,!1)|wp),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!a),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(r,!0),this.parseFunctionBody(e,!0,!1,u),this.yieldPos=l,this.awaitPos=p,this.awaitIdentPos=v,this.finishNode(e,"ArrowFunctionExpression")};X.parseFunctionBody=function(e,r,a,u){var l=r&&this.type!==y.braceL,p=this.strict,v=!1;if(l)e.body=this.parseMaybeAssign(u),e.expression=!0,this.checkParams(e,!1);else{var C=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!p||C)&&(v=this.strictDirective(this.end),v&&C&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var T=this.labels;this.labels=[],v&&(this.strict=!0),this.checkParams(e,!p&&!v&&!r&&!a&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Cp),e.body=this.parseBlock(!1,void 0,v&&!p),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=T}this.exitScope()};X.isSimpleParamList=function(e){for(var r=0,a=e;r-1||l.functions.indexOf(e)>-1||l.var.indexOf(e)>-1,l.lexical.push(e),this.inModule&&l.flags&us&&delete this.undefinedExports[e]}else if(r===kp){var p=this.currentScope();p.lexical.push(e)}else if(r===bp){var v=this.currentScope();this.treatFunctionsAsVar?u=v.lexical.indexOf(e)>-1:u=v.lexical.indexOf(e)>-1||v.var.indexOf(e)>-1,v.functions.push(e)}else for(var C=this.scopeStack.length-1;C>=0;--C){var T=this.scopeStack[C];if(T.lexical.indexOf(e)>-1&&!(T.flags&Sp&&T.lexical[0]===e)||!this.treatFunctionsAsVarInScope(T)&&T.functions.indexOf(e)>-1){u=!0;break}if(T.var.push(e),this.inModule&&T.flags&us&&delete this.undefinedExports[e],T.flags&ec)break}u&&this.raiseRecoverable(a,"Identifier '"+e+"' has already been declared")};Wn.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};Wn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Wn.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&ec)return r}};Wn.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&ec&&!(r.flags&wp))return r}};var jo=function(r,a,u){this.type="",this.start=a,this.end=0,r.options.locations&&(this.loc=new zo(r,u)),r.options.directSourceFile&&(this.sourceFile=r.options.directSourceFile),r.options.ranges&&(this.range=[a,0])},cs=ft.prototype;cs.startNode=function(){return new jo(this,this.start,this.startLoc)};cs.startNodeAt=function(e,r){return new jo(this,e,r)};function Ep(e,r,a,u){return e.type=r,e.end=a,this.options.locations&&(e.loc.end=u),this.options.ranges&&(e.range[1]=a),e}cs.finishNode=function(e,r){return Ep.call(this,e,r,this.lastTokEnd,this.lastTokEndLoc)};cs.finishNodeAt=function(e,r,a,u){return Ep.call(this,e,r,a,u)};cs.copyNode=function(e){var r=new jo(this,e.start,this.startLoc);for(var a in e)r[a]=e[a];return r};var Dp="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Ip=Dp+" Extended_Pictographic",Mp=Ip,Op=Mp+" EBase EComp EMod EPres ExtPict",Ap=Op,Mv=Ap,Ov={9:Dp,10:Ip,11:Mp,12:Op,13:Ap,14:Mv},Av="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Fv={9:"",10:"",11:"",12:"",13:"",14:Av},cp="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Fp="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Np=Fp+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Lp=Np+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Rp=Lp+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Wp=Rp+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Nv=Wp+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",Lv={9:Fp,10:Np,11:Lp,12:Rp,13:Wp,14:Nv},Yp={};function Rv(e){var r=Yp[e]={binary:Ln(Ov[e]+" "+cp),binaryOfStrings:Ln(Fv[e]),nonBinary:{General_Category:Ln(cp),Script:Ln(Lv[e])}};r.nonBinary.Script_Extensions=r.nonBinary.Script,r.nonBinary.gc=r.nonBinary.General_Category,r.nonBinary.sc=r.nonBinary.Script,r.nonBinary.scx=r.nonBinary.Script_Extensions}for(Uo=0,$f=[9,10,11,12,13,14];Uo<$f.length;Uo+=1)hp=$f[Uo],Rv(hp);var hp,Uo,$f,U=ft.prototype,Hr=function(r){this.parser=r,this.validFlags="gim"+(r.options.ecmaVersion>=6?"uy":"")+(r.options.ecmaVersion>=9?"s":"")+(r.options.ecmaVersion>=13?"d":"")+(r.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Yp[r.options.ecmaVersion>=14?14:r.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};Hr.prototype.reset=function(r,a,u){var l=u.indexOf("v")!==-1,p=u.indexOf("u")!==-1;this.start=r|0,this.source=a+"",this.flags=u,l&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=p&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=p&&this.parser.options.ecmaVersion>=9)};Hr.prototype.raise=function(r){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+r)};Hr.prototype.at=function(r,a){a===void 0&&(a=!1);var u=this.source,l=u.length;if(r>=l)return-1;var p=u.charCodeAt(r);if(!(a||this.switchU)||p<=55295||p>=57344||r+1>=l)return p;var v=u.charCodeAt(r+1);return v>=56320&&v<=57343?(p<<10)+v-56613888:p};Hr.prototype.nextIndex=function(r,a){a===void 0&&(a=!1);var u=this.source,l=u.length;if(r>=l)return l;var p=u.charCodeAt(r),v;return!(a||this.switchU)||p<=55295||p>=57344||r+1>=l||(v=u.charCodeAt(r+1))<56320||v>57343?r+1:r+2};Hr.prototype.current=function(r){return r===void 0&&(r=!1),this.at(this.pos,r)};Hr.prototype.lookahead=function(r){return r===void 0&&(r=!1),this.at(this.nextIndex(this.pos,r),r)};Hr.prototype.advance=function(r){r===void 0&&(r=!1),this.pos=this.nextIndex(this.pos,r)};Hr.prototype.eat=function(r,a){return a===void 0&&(a=!1),this.current(a)===r?(this.advance(a),!0):!1};Hr.prototype.eatChars=function(r,a){a===void 0&&(a=!1);for(var u=this.pos,l=0,p=r;l-1&&this.raise(e.start,"Duplicate regular expression flag"),v==="u"&&(u=!0),v==="v"&&(l=!0)}this.options.ecmaVersion>=15&&u&&l&&this.raise(e.start,"Invalid regular expression flag")};U.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};U.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var r=0,a=e.backReferenceNames;r=9&&(a=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!a,!0}return e.pos=r,!1};U.regexp_eatQuantifier=function(e,r){return r===void 0&&(r=!1),this.regexp_eatQuantifierPrefix(e,r)?(e.eat(63),!0):!1};U.regexp_eatQuantifierPrefix=function(e,r){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,r)};U.regexp_eatBracedQuantifier=function(e,r){var a=e.pos;if(e.eat(123)){var u=0,l=-1;if(this.regexp_eatDecimalDigits(e)&&(u=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(l=e.lastIntValue),e.eat(125)))return l!==-1&&l=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};U.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};U.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};U.regexp_eatSyntaxCharacter=function(e){var r=e.current();return Bp(r)?(e.lastIntValue=r,e.advance(),!0):!1};function Bp(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}U.regexp_eatPatternCharacters=function(e){for(var r=e.pos,a=0;(a=e.current())!==-1&&!Bp(a);)e.advance();return e.pos!==r};U.regexp_eatExtendedPatternCharacter=function(e){var r=e.current();return r!==-1&&r!==36&&!(r>=40&&r<=43)&&r!==46&&r!==63&&r!==91&&r!==94&&r!==124?(e.advance(),!0):!1};U.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};U.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};U.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Rn(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Rn(e.lastIntValue);return!0}return!1};U.regexp_eatRegExpIdentifierStart=function(e){var r=e.pos,a=this.options.ecmaVersion>=11,u=e.current(a);return e.advance(a),u===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,a)&&(u=e.lastIntValue),Wv(u)?(e.lastIntValue=u,!0):(e.pos=r,!1)};function Wv(e){return ln(e,!0)||e===36||e===95}U.regexp_eatRegExpIdentifierPart=function(e){var r=e.pos,a=this.options.ecmaVersion>=11,u=e.current(a);return e.advance(a),u===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,a)&&(u=e.lastIntValue),Yv(u)?(e.lastIntValue=u,!0):(e.pos=r,!1)};function Yv(e){return aa(e,!0)||e===36||e===95||e===8204||e===8205}U.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};U.regexp_eatBackReference=function(e){var r=e.pos;if(this.regexp_eatDecimalEscape(e)){var a=e.lastIntValue;if(e.switchU)return a>e.maxBackReference&&(e.maxBackReference=a),!0;if(a<=e.numCapturingParens)return!0;e.pos=r}return!1};U.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};U.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};U.regexp_eatCControlLetter=function(e){var r=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=r}return!1};U.regexp_eatZero=function(e){return e.current()===48&&!Qo(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};U.regexp_eatControlEscape=function(e){var r=e.current();return r===116?(e.lastIntValue=9,e.advance(),!0):r===110?(e.lastIntValue=10,e.advance(),!0):r===118?(e.lastIntValue=11,e.advance(),!0):r===102?(e.lastIntValue=12,e.advance(),!0):r===114?(e.lastIntValue=13,e.advance(),!0):!1};U.regexp_eatControlLetter=function(e){var r=e.current();return Vp(r)?(e.lastIntValue=r%32,e.advance(),!0):!1};function Vp(e){return e>=65&&e<=90||e>=97&&e<=122}U.regexp_eatRegExpUnicodeEscapeSequence=function(e,r){r===void 0&&(r=!1);var a=e.pos,u=r||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var l=e.lastIntValue;if(u&&l>=55296&&l<=56319){var p=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var v=e.lastIntValue;if(v>=56320&&v<=57343)return e.lastIntValue=(l-55296)*1024+(v-56320)+65536,!0}e.pos=p,e.lastIntValue=l}return!0}if(u&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Bv(e.lastIntValue))return!0;u&&e.raise("Invalid unicode escape"),e.pos=a}return!1};function Bv(e){return e>=0&&e<=1114111}U.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var r=e.current();return r!==99&&(!e.switchN||r!==107)?(e.lastIntValue=r,e.advance(),!0):!1};U.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var r=e.current();if(r>=49&&r<=57){do e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();while((r=e.current())>=48&&r<=57);return!0}return!1};var Up=0,fn=1,fr=2;U.regexp_eatCharacterClassEscape=function(e){var r=e.current();if(Vv(r))return e.lastIntValue=-1,e.advance(),fn;var a=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((a=r===80)||r===112)){e.lastIntValue=-1,e.advance();var u;if(e.eat(123)&&(u=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return a&&u===fr&&e.raise("Invalid property name"),u;e.raise("Invalid property name")}return Up};function Vv(e){return e===100||e===68||e===115||e===83||e===119||e===87}U.regexp_eatUnicodePropertyValueExpression=function(e){var r=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var a=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var u=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,a,u),fn}}if(e.pos=r,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var l=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,l)}return Up};U.regexp_validateUnicodePropertyNameAndValue=function(e,r,a){ls(e.unicodeProperties.nonBinary,r)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[r].test(a)||e.raise("Invalid property value")};U.regexp_validateUnicodePropertyNameOrValue=function(e,r){if(e.unicodeProperties.binary.test(r))return fn;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(r))return fr;e.raise("Invalid property name")};U.regexp_eatUnicodePropertyName=function(e){var r=0;for(e.lastStringValue="";Hp(r=e.current());)e.lastStringValue+=Rn(r),e.advance();return e.lastStringValue!==""};function Hp(e){return Vp(e)||e===95}U.regexp_eatUnicodePropertyValue=function(e){var r=0;for(e.lastStringValue="";Uv(r=e.current());)e.lastStringValue+=Rn(r),e.advance();return e.lastStringValue!==""};function Uv(e){return Hp(e)||Qo(e)}U.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};U.regexp_eatCharacterClass=function(e){if(e.eat(91)){var r=e.eat(94),a=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),r&&a===fr&&e.raise("Negated character class may contain strings"),!0}return!1};U.regexp_classContents=function(e){return e.current()===93?fn:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),fn)};U.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var r=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var a=e.lastIntValue;e.switchU&&(r===-1||a===-1)&&e.raise("Invalid character class"),r!==-1&&a!==-1&&r>a&&e.raise("Range out of order in character class")}}};U.regexp_eatClassAtom=function(e){var r=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var a=e.current();(a===99||zp(a))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=r}var u=e.current();return u!==93?(e.lastIntValue=u,e.advance(),!0):!1};U.regexp_eatClassEscape=function(e){var r=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=r}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};U.regexp_classSetExpression=function(e){var r=fn,a;if(!this.regexp_eatClassSetRange(e))if(a=this.regexp_eatClassSetOperand(e)){a===fr&&(r=fr);for(var u=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(a=this.regexp_eatClassSetOperand(e))){a!==fr&&(r=fn);continue}e.raise("Invalid character in character class")}if(u!==e.pos)return r;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(u!==e.pos)return r}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(a=this.regexp_eatClassSetOperand(e),!a)return r;a===fr&&(r=fr)}};U.regexp_eatClassSetRange=function(e){var r=e.pos;if(this.regexp_eatClassSetCharacter(e)){var a=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var u=e.lastIntValue;return a!==-1&&u!==-1&&a>u&&e.raise("Range out of order in character class"),!0}e.pos=r}return!1};U.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?fn:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};U.regexp_eatNestedClass=function(e){var r=e.pos;if(e.eat(91)){var a=e.eat(94),u=this.regexp_classContents(e);if(e.eat(93))return a&&u===fr&&e.raise("Negated character class may contain strings"),u;e.pos=r}if(e.eat(92)){var l=this.regexp_eatCharacterClassEscape(e);if(l)return l;e.pos=r}return null};U.regexp_eatClassStringDisjunction=function(e){var r=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var a=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return a}else e.raise("Invalid escape");e.pos=r}return null};U.regexp_classStringDisjunctionContents=function(e){for(var r=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===fr&&(r=fr);return r};U.regexp_classString=function(e){for(var r=0;this.regexp_eatClassSetCharacter(e);)r++;return r===1?fn:fr};U.regexp_eatClassSetCharacter=function(e){var r=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=r,!1);var a=e.current();return a<0||a===e.lookahead()&&Hv(a)||qv(a)?!1:(e.advance(),e.lastIntValue=a,!0)};function Hv(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function qv(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}U.regexp_eatClassSetReservedPunctuator=function(e){var r=e.current();return Gv(r)?(e.lastIntValue=r,e.advance(),!0):!1};function Gv(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}U.regexp_eatClassControlLetter=function(e){var r=e.current();return Qo(r)||r===95?(e.lastIntValue=r%32,e.advance(),!0):!1};U.regexp_eatHexEscapeSequence=function(e){var r=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=r}return!1};U.regexp_eatDecimalDigits=function(e){var r=e.pos,a=0;for(e.lastIntValue=0;Qo(a=e.current());)e.lastIntValue=10*e.lastIntValue+(a-48),e.advance();return e.pos!==r};function Qo(e){return e>=48&&e<=57}U.regexp_eatHexDigits=function(e){var r=e.pos,a=0;for(e.lastIntValue=0;qp(a=e.current());)e.lastIntValue=16*e.lastIntValue+Gp(a),e.advance();return e.pos!==r};function qp(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Gp(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}U.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var a=e.lastIntValue;r<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=r*64+a*8+e.lastIntValue:e.lastIntValue=r*8+a}else e.lastIntValue=r;return!0}return!1};U.regexp_eatOctalDigit=function(e){var r=e.current();return zp(r)?(e.lastIntValue=r-48,e.advance(),!0):(e.lastIntValue=0,!1)};function zp(e){return e>=48&&e<=55}U.regexp_eatFixedHexDigits=function(e,r){var a=e.pos;e.lastIntValue=0;for(var u=0;u=this.input.length)return this.finishToken(y.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};ce.readToken=function(e){return ln(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};ce.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var r=this.input.charCodeAt(this.pos+1);return r<=56319||r>=57344?e:(e<<10)+r-56613888};ce.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),r=this.pos,a=this.input.indexOf("*/",this.pos+=2);if(a===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=a+2,this.options.locations)for(var u=void 0,l=r;(u=mp(this.input,l,this.pos))>-1;)++this.curLine,l=this.lineStart=u;this.options.onComment&&this.options.onComment(!0,this.input.slice(r+2,a),r,this.pos,e,this.curPosition())};ce.skipLineComment=function(e){for(var r=this.pos,a=this.options.onComment&&this.curPosition(),u=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&gp.test(String.fromCharCode(e)))++this.pos;else break e}}};ce.finishToken=function(e,r){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var a=this.type;this.type=e,this.value=r,this.updateContext(a)};ce.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var r=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&r===46?(this.pos+=3,this.finishToken(y.ellipsis)):(++this.pos,this.finishToken(y.dot))};ce.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(y.assign,2):this.finishOp(y.slash,1)};ce.readToken_mult_modulo_exp=function(e){var r=this.input.charCodeAt(this.pos+1),a=1,u=e===42?y.star:y.modulo;return this.options.ecmaVersion>=7&&e===42&&r===42&&(++a,u=y.starstar,r=this.input.charCodeAt(this.pos+2)),r===61?this.finishOp(y.assign,a+1):this.finishOp(u,a)};ce.readToken_pipe_amp=function(e){var r=this.input.charCodeAt(this.pos+1);if(r===e){if(this.options.ecmaVersion>=12){var a=this.input.charCodeAt(this.pos+2);if(a===61)return this.finishOp(y.assign,3)}return this.finishOp(e===124?y.logicalOR:y.logicalAND,2)}return r===61?this.finishOp(y.assign,2):this.finishOp(e===124?y.bitwiseOR:y.bitwiseAND,1)};ce.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(y.assign,2):this.finishOp(y.bitwiseXOR,1)};ce.readToken_plus_min=function(e){var r=this.input.charCodeAt(this.pos+1);return r===e?r===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||cr.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(y.incDec,2):r===61?this.finishOp(y.assign,2):this.finishOp(y.plusMin,1)};ce.readToken_lt_gt=function(e){var r=this.input.charCodeAt(this.pos+1),a=1;return r===e?(a=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+a)===61?this.finishOp(y.assign,a+1):this.finishOp(y.bitShift,a)):r===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(r===61&&(a=2),this.finishOp(y.relational,a))};ce.readToken_eq_excl=function(e){var r=this.input.charCodeAt(this.pos+1);return r===61?this.finishOp(y.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&r===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(y.arrow)):this.finishOp(e===61?y.eq:y.prefix,1)};ce.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var r=this.input.charCodeAt(this.pos+1);if(r===46){var a=this.input.charCodeAt(this.pos+2);if(a<48||a>57)return this.finishOp(y.questionDot,2)}if(r===63){if(e>=12){var u=this.input.charCodeAt(this.pos+2);if(u===61)return this.finishOp(y.assign,3)}return this.finishOp(y.coalesce,2)}}return this.finishOp(y.question,1)};ce.readToken_numberSign=function(){var e=this.options.ecmaVersion,r=35;if(e>=13&&(++this.pos,r=this.fullCharCodeAtPos(),ln(r,!0)||r===92))return this.finishToken(y.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Rn(r)+"'")};ce.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(y.parenL);case 41:return++this.pos,this.finishToken(y.parenR);case 59:return++this.pos,this.finishToken(y.semi);case 44:return++this.pos,this.finishToken(y.comma);case 91:return++this.pos,this.finishToken(y.bracketL);case 93:return++this.pos,this.finishToken(y.bracketR);case 123:return++this.pos,this.finishToken(y.braceL);case 125:return++this.pos,this.finishToken(y.braceR);case 58:return++this.pos,this.finishToken(y.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(y.backQuote);case 48:var r=this.input.charCodeAt(this.pos+1);if(r===120||r===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(r===111||r===79)return this.readRadixNumber(8);if(r===98||r===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(y.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Rn(e)+"'")};ce.finishOp=function(e,r){var a=this.input.slice(this.pos,this.pos+r);return this.pos+=r,this.finishToken(e,a)};ce.readRegexp=function(){for(var e,r,a=this.pos;;){this.pos>=this.input.length&&this.raise(a,"Unterminated regular expression");var u=this.input.charAt(this.pos);if(cr.test(u)&&this.raise(a,"Unterminated regular expression"),e)e=!1;else{if(u==="[")r=!0;else if(u==="]"&&r)r=!1;else if(u==="/"&&!r)break;e=u==="\\\\"}++this.pos}var l=this.input.slice(a,this.pos);++this.pos;var p=this.pos,v=this.readWord1();this.containsEsc&&this.unexpected(p);var C=this.regexpState||(this.regexpState=new Hr(this));C.reset(a,l,v),this.validateRegExpFlags(C),this.validateRegExpPattern(C);var T=null;try{T=new RegExp(l,v)}catch{}return this.finishToken(y.regexp,{pattern:l,flags:v,value:T})};ce.readInt=function(e,r,a){for(var u=this.options.ecmaVersion>=12&&r===void 0,l=a&&this.input.charCodeAt(this.pos)===48,p=this.pos,v=0,C=0,T=0,A=r??1/0;T=97?V=R-97+10:R>=65?V=R-65+10:R>=48&&R<=57?V=R-48:V=1/0,V>=e)break;C=R,v=v*e+V}return u&&C===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===p||r!=null&&this.pos-p!==r?null:v};function zv(e,r){return r?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function $p(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}ce.readRadixNumber=function(e){var r=this.pos;this.pos+=2;var a=this.readInt(e);return a==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(a=$p(this.input.slice(r,this.pos)),++this.pos):ln(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(y.num,a)};ce.readNumber=function(e){var r=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(r,"Invalid number");var a=this.pos-r>=2&&this.input.charCodeAt(r)===48;a&&this.strict&&this.raise(r,"Invalid number");var u=this.input.charCodeAt(this.pos);if(!a&&!e&&this.options.ecmaVersion>=11&&u===110){var l=$p(this.input.slice(r,this.pos));return++this.pos,ln(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(y.num,l)}a&&/[89]/.test(this.input.slice(r,this.pos))&&(a=!1),u===46&&!a&&(++this.pos,this.readInt(10),u=this.input.charCodeAt(this.pos)),(u===69||u===101)&&!a&&(u=this.input.charCodeAt(++this.pos),(u===43||u===45)&&++this.pos,this.readInt(10)===null&&this.raise(r,"Invalid number")),ln(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var p=zv(this.input.slice(r,this.pos),a);return this.finishToken(y.num,p)};ce.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),r;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var a=++this.pos;r=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,r>1114111&&this.invalidStringToken(a,"Code point out of bounds")}else r=this.readHexChar(4);return r};ce.readString=function(e){for(var r="",a=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var u=this.input.charCodeAt(this.pos);if(u===e)break;u===92?(r+=this.input.slice(a,this.pos),r+=this.readEscapedChar(!1),a=this.pos):u===8232||u===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(sa(u)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return r+=this.input.slice(a,this.pos++),this.finishToken(y.string,r)};var jp={};ce.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===jp)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};ce.invalidStringToken=function(e,r){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw jp;this.raise(e,r)};ce.readTmplToken=function(){for(var e="",r=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var a=this.input.charCodeAt(this.pos);if(a===96||a===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===y.template||this.type===y.invalidTemplate)?a===36?(this.pos+=2,this.finishToken(y.dollarBraceL)):(++this.pos,this.finishToken(y.backQuote)):(e+=this.input.slice(r,this.pos),this.finishToken(y.template,e));if(a===92)e+=this.input.slice(r,this.pos),e+=this.readEscapedChar(!0),r=this.pos;else if(sa(a)){switch(e+=this.input.slice(r,this.pos),++this.pos,a){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=\` -\`;break;default:e+=String.fromCharCode(a);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),r=this.pos}else++this.pos}};ce.readInvalidTemplateToken=function(){for(;this.pos=48&&r<=55){var u=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],l=parseInt(u,8);return l>255&&(u=u.slice(0,-1),l=parseInt(u,8)),this.pos+=u.length-1,r=this.input.charCodeAt(this.pos),(u!=="0"||r===56||r===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-u.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(l)}return sa(r)?"":String.fromCharCode(r)}};ce.readHexChar=function(e){var r=this.pos,a=this.readInt(16,e);return a===null&&this.invalidStringToken(r,"Bad character escape sequence"),a};ce.readWord1=function(){this.containsEsc=!1;for(var e="",r=!0,a=this.pos,u=this.options.ecmaVersion>=6;this.pos":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},di=17;function la(e,r){let{generator:a}=e;if(e.write("("),r!=null&&r.length>0){a[r[0].type](r[0],e);let{length:u}=r;for(let l=1;l0){e.write(u);for(let v=1;v0){a.VariableDeclarator(u[0],e);for(let p=1;p0){r.write(u),l&&e.comments!=null&&Tt(r,e.comments,p,u);let{length:C}=v;for(let T=0;T0){for(;l0&&r.write(", ");let p=a[l],v=p.type[6];if(v==="D")r.write(p.local.name,p),l++;else if(v==="N")r.write("* as "+p.local.name,p),l++;else break}if(l0)for(let l=0;;){let p=a[l],{name:v}=p.local;if(r.write(v,p),v!==p.exported.name&&r.write(" as "+p.exported.name),++l "),e.body.type[0]==="O"?(r.write("("),this.ObjectExpression(e.body,r),r.write(")")):this[e.body.type](e.body,r)},ThisExpression(e,r){r.write("this",e)},Super(e,r){r.write("super",e)},RestElement:Xp=function(e,r){r.write("..."),this[e.argument.type](e.argument,r)},SpreadElement:Xp,YieldExpression(e,r){r.write(e.delegate?"yield*":"yield"),e.argument&&(r.write(" "),this[e.argument.type](e.argument,r))},AwaitExpression(e,r){r.write("await ",e),Zo(r,e.argument,e)},TemplateLiteral(e,r){let{quasis:a,expressions:u}=e;r.write("\`");let{length:l}=u;for(let v=0;v0){let{elements:a}=e,{length:u}=a;for(let l=0;;){let p=a[l];if(p!=null&&this[p.type](p,r),++l0){r.write(u),l&&e.comments!=null&&Tt(r,e.comments,p,u);let v=","+u,{properties:C}=e,{length:T}=C;for(let A=0;;){let R=C[A];if(l&&R.comments!=null&&Tt(r,R.comments,p,u),r.write(p),this[R.type](R,r),++A0){let{properties:a}=e,{length:u}=a;for(let l=0;this[a[l].type](a[l],r),++l1||l[0]==="U"&&(l[1]==="n"||l[1]==="p")&&u.prefix&&u.operator[0]===a&&(a==="+"||a==="-"))&&r.write(" "),p?(r.write(a.length>1?" (":"("),this[l](u,r),r.write(")")):this[l](u,r)}else this[e.argument.type](e.argument,r),r.write(e.operator)},UpdateExpression(e,r){e.prefix?(r.write(e.operator),this[e.argument.type](e.argument,r)):(this[e.argument.type](e.argument,r),r.write(e.operator))},AssignmentExpression(e,r){this[e.left.type](e.left,r),r.write(" "+e.operator+" "),this[e.right.type](e.right,r)},AssignmentPattern(e,r){this[e.left.type](e.left,r),r.write(" = "),this[e.right.type](e.right,r)},BinaryExpression:Jp=function(e,r){let a=e.operator==="in";a&&r.write("("),Zo(r,e.left,e,!1),r.write(" "+e.operator+" "),Zo(r,e.right,e,!0),a&&r.write(")")},LogicalExpression:Jp,ConditionalExpression(e,r){let{test:a}=e,u=r.expressionsPrecedence[a.type];u===di||u<=r.expressionsPrecedence.ConditionalExpression?(r.write("("),this[a.type](a,r),r.write(")")):this[a.type](a,r),r.write(" ? "),this[e.consequent.type](e.consequent,r),r.write(" : "),this[e.alternate.type](e.alternate,r)},NewExpression(e,r){r.write("new ");let a=r.expressionsPrecedence[e.callee.type];a===di||a{let{payload:r,job:a}=e.data,u;a.type=="path"?u=nd(r):a.type=="context"?u=id(r):a.type=="frames"?u=sd(r):a.type=="paths"&&(u=ad(r));try{postMessage({job:a,result:u})}catch(l){console.log(l),postMessage({job:a,result:{$error:\`Failed to index \${a.type} \${a.path}: \${l}\`}})}}; +\`)+Ve+\`return __p +}\`;var Pr=ox(function(){return jr(J,cr+"return "+Ve).apply(e,ae)});if(Pr.source=Ve,Gd(Pr))throw Pr;return Pr}function Z5(l){return st(l).toLowerCase()}function Q5(l){return st(l).toUpperCase()}function X5(l,m,D){if(l=st(l),l&&(D||m===e))return rl(l);if(!l||!(m=Gn(m)))return l;var I=xn(l),W=xn(m),J=dt(I,W),ae=tl(I,W)+1;return oo(I,J,ae).join("")}function J5(l,m,D){if(l=st(l),l&&(D||m===e))return l.slice(0,vs(l)+1);if(!l||!(m=Gn(m)))return l;var I=xn(l),W=tl(I,xn(m))+1;return oo(I,0,W).join("")}function K5(l,m,D){if(l=st(l),l&&(D||m===e))return l.replace(rr,"");if(!l||!(m=Gn(m)))return l;var I=xn(l),W=dt(I,xn(m));return oo(I,W).join("")}function j5(l,m){var D=F,I=M;if(Ct(m)){var W="separator"in m?m.separator:W;D="length"in m?Br(m.length):D,I="omission"in m?Gn(m.omission):I}l=st(l);var J=l.length;if(ni(l)){var ae=xn(l);J=ae.length}if(D>=J)return l;var fe=D-ji(I);if(fe<1)return I;var he=ae?oo(ae,0,fe).join(""):l.slice(0,fe);if(W===e)return he+I;if(ae&&(fe+=he.length-fe),$d(W)){if(l.slice(fe).search(W)){var Re,qe=he;for(W.global||(W=Fi(W.source,st(En.exec(W))+"g")),W.lastIndex=0;Re=W.exec(qe);)var Ve=Re.index;he=he.slice(0,Ve===e?fe:Ve)}}else if(l.indexOf(Gn(W),fe)!=fe){var Ke=he.lastIndexOf(W);Ke>-1&&(he=he.slice(0,Ke))}return he+I}function e6(l){return l=st(l),l&&er.test(l)?l.replace(ve,Fm):l}var r6=Ps(function(l,m,D){return l+(D?" ":"")+m.toUpperCase()}),Xd=sg("toUpperCase");function ax(l,m,D){return l=st(l),m=D?e:m,m===e?Cm(l)?Im(l):wm(l):l.match(m)||[]}var ox=Rr(function(l,m){try{return an(l,e,m)}catch(D){return Gd(D)?D:new Nr(D)}}),t6=Ea(function(l,m){return Tt(m,function(D){D=oa(D),Pi(l,D,Yd(l[D],l))}),l});function n6(l){var m=l==null?0:l.length,D=xr();return l=m?ct(l,function(I){if(typeof I[1]!="function")throw new Mn(i);return[D(I[0]),I[1]]}):[],Rr(function(I){for(var W=-1;++Wq)return[];var D=U,I=Et(l,U);m=xr(m),l-=U;for(var W=Yu(I,m);++D0||m<0)?new Ir(D):(l<0?D=D.takeRight(-l):l&&(D=D.drop(l)),m!==e&&(m=Br(m),D=m<0?D.dropRight(-m):D.take(m-l)),D)},Ir.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Ir.prototype.toArray=function(){return this.take(U)},ii(Ir.prototype,function(l,m){var D=/^(?:filter|find|map|reject)|While$/.test(m),I=/^(?:head|last)$/.test(m),W=Z[I?"take"+(m=="last"?"Right":""):m],J=I||/^find/.test(m);!W||(Z.prototype[m]=function(){var ae=this.__wrapped__,fe=I?[1]:arguments,he=ae instanceof Ir,Re=fe[0],qe=he||Fr(ae),Ve=function(qr){var Hr=W.apply(Z,ti([qr],fe));return I&&Ke?Hr[0]:Hr};qe&&D&&typeof Re=="function"&&Re.length!=1&&(he=qe=!1);var Ke=this.__chain__,cr=!!this.__actions__.length,wr=J&&!Ke,Pr=he&&!cr;if(!J&&qe){ae=Pr?ae:new Ir(this);var Dr=l.apply(ae,fe);return Dr.__actions__.push({func:Ul,args:[Ve],thisArg:e}),new _n(Dr,Ke)}return wr&&Pr?l.apply(this,fe):(Dr=this.thru(Ve),wr?I?Dr.value()[0]:Dr.value():Dr)})}),Tt(["pop","push","shift","sort","splice","unshift"],function(l){var m=Fo[l],D=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",I=/^(?:pop|shift)$/.test(l);Z.prototype[l]=function(){var W=arguments;if(I&&!this.__chain__){var J=this.value();return m.apply(Fr(J)?J:[],W)}return this[D](function(ae){return m.apply(Fr(ae)?ae:[],W)})}}),ii(Ir.prototype,function(l,m){var D=Z[m];if(D){var I=D.name+"";at.call(to,I)||(to[I]=[]),to[I].push({name:m,func:D})}}),to[Bl(e,v).name]=[{name:"wrapper",func:e}],Ir.prototype.clone=Qm,Ir.prototype.reverse=Xm,Ir.prototype.value=Jm,Z.prototype.at=FI,Z.prototype.chain=OI,Z.prototype.commit=BI,Z.prototype.next=II,Z.prototype.plant=kI,Z.prototype.reverse=RI,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=LI,Z.prototype.first=Z.prototype.head,Bo&&(Z.prototype[Bo]=PI),Z},ea=Pm();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Wt._=ea,define(function(){return ea})):Ji?((Ji.exports=ea)._=ea,ku._=ea):Wt._=ea}).call(du)});var Go="File";function fx(e){return Array.isArray(e)?e:typeof e=="string"?[e]:[]}function lx(e){return e?typeof e!="string"?e.toString():e:""}var cx=(e,r)=>r.indexOf(e)>0?r.indexOf(e):r.length;function pi(e){return pi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},pi(e)}function Pn(e){if(e===null||e===!0||e===!1)return NaN;var r=Number(e);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}function ot(e,r){if(r.length1?"s":"")+" required, but only "+r.length+" present")}function Lt(e){ot(1,arguments);var r=Object.prototype.toString.call(e);return e instanceof Date||pi(e)==="object"&&r==="[object Date]"?new Date(e.getTime()):typeof e=="number"||r==="[object Number]"?new Date(e):((typeof e=="string"||r==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use \`parseISO\` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function ih(e,r){ot(2,arguments);var t=Lt(e).getTime(),n=Pn(r);return new Date(t+n)}var Z6={};function uo(){return Z6}function ah(e){var r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),e.getTime()-r.getTime()}function oh(e){return ot(1,arguments),e instanceof Date||pi(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function sh(e){if(ot(1,arguments),!oh(e)&&typeof e!="number")return!1;var r=Lt(e);return!isNaN(Number(r))}function uh(e,r){ot(2,arguments);var t=Pn(r);return ih(e,-t)}var Q6=864e5;function fh(e){ot(1,arguments);var r=Lt(e),t=r.getTime();r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0);var n=r.getTime(),i=t-n;return Math.floor(i/Q6)+1}function fo(e){ot(1,arguments);var r=1,t=Lt(e),n=t.getUTCDay(),i=(n=i.getTime()?t+1:r.getTime()>=s.getTime()?t:t-1}function lh(e){ot(1,arguments);var r=ff(e),t=new Date(0);t.setUTCFullYear(r,0,4),t.setUTCHours(0,0,0,0);var n=fo(t);return n}var X6=6048e5;function ch(e){ot(1,arguments);var r=Lt(e),t=fo(r).getTime()-lh(r).getTime();return Math.round(t/X6)+1}function lo(e,r){var t,n,i,a,s,c,f,o;ot(1,arguments);var u=uo(),p=Pn((t=(n=(i=(a=r?.weekStartsOn)!==null&&a!==void 0?a:r==null||(s=r.locale)===null||s===void 0||(c=s.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&n!==void 0?n:(f=u.locale)===null||f===void 0||(o=f.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&t!==void 0?t:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Lt(e),h=d.getUTCDay(),x=(h=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(p+1,0,h),x.setUTCHours(0,0,0,0);var v=lo(x,r),y=new Date(0);y.setUTCFullYear(p,0,h),y.setUTCHours(0,0,0,0);var w=lo(y,r);return u.getTime()>=v.getTime()?p+1:u.getTime()>=w.getTime()?p:p-1}function ph(e,r){var t,n,i,a,s,c,f,o;ot(1,arguments);var u=uo(),p=Pn((t=(n=(i=(a=r?.firstWeekContainsDate)!==null&&a!==void 0?a:r==null||(s=r.locale)===null||s===void 0||(c=s.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&n!==void 0?n:(f=u.locale)===null||f===void 0||(o=f.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&t!==void 0?t:1),d=lf(e,r),h=new Date(0);h.setUTCFullYear(d,0,p),h.setUTCHours(0,0,0,0);var x=lo(h,r);return x}var J6=6048e5;function mh(e,r){ot(1,arguments);var t=Lt(e),n=lo(t,r).getTime()-ph(t,r).getTime();return Math.round(n/J6)+1}function it(e,r){for(var t=e<0?"-":"",n=Math.abs(e).toString();n.length0?n:1-n;return it(t==="yy"?i%100:i,t.length)},M:function(r,t){var n=r.getUTCMonth();return t==="M"?String(n+1):it(n+1,2)},d:function(r,t){return it(r.getUTCDate(),t.length)},a:function(r,t){var n=r.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(r,t){return it(r.getUTCHours()%12||12,t.length)},H:function(r,t){return it(r.getUTCHours(),t.length)},m:function(r,t){return it(r.getUTCMinutes(),t.length)},s:function(r,t){return it(r.getUTCSeconds(),t.length)},S:function(r,t){var n=t.length,i=r.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,n-3));return it(a,t.length)}},Fa=K6;var qs={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},j6={G:function(r,t,n){var i=r.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(r,t,n){if(t==="yo"){var i=r.getUTCFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return Fa.y(r,t)},Y:function(r,t,n,i){var a=lf(r,i),s=a>0?a:1-a;if(t==="YY"){var c=s%100;return it(c,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):it(s,t.length)},R:function(r,t){var n=ff(r);return it(n,t.length)},u:function(r,t){var n=r.getUTCFullYear();return it(n,t.length)},Q:function(r,t,n){var i=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return it(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(r,t,n){var i=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return it(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(r,t,n){var i=r.getUTCMonth();switch(t){case"M":case"MM":return Fa.M(r,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(r,t,n){var i=r.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return it(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(r,t,n,i){var a=mh(r,i);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):it(a,t.length)},I:function(r,t,n){var i=ch(r);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):it(i,t.length)},d:function(r,t,n){return t==="do"?n.ordinalNumber(r.getUTCDate(),{unit:"date"}):Fa.d(r,t)},D:function(r,t,n){var i=fh(r);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):it(i,t.length)},E:function(r,t,n){var i=r.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(r,t,n,i){var a=r.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return it(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(r,t,n,i){var a=r.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return it(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(r,t,n){var i=r.getUTCDay(),a=i===0?7:i;switch(t){case"i":return String(a);case"ii":return it(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(r,t,n){var i=r.getUTCHours(),a=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(r,t,n){var i=r.getUTCHours(),a;switch(i===12?a=qs.noon:i===0?a=qs.midnight:a=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(r,t,n){var i=r.getUTCHours(),a;switch(i>=17?a=qs.evening:i>=12?a=qs.afternoon:i>=4?a=qs.morning:a=qs.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(r,t,n){if(t==="ho"){var i=r.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Fa.h(r,t)},H:function(r,t,n){return t==="Ho"?n.ordinalNumber(r.getUTCHours(),{unit:"hour"}):Fa.H(r,t)},K:function(r,t,n){var i=r.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):it(i,t.length)},k:function(r,t,n){var i=r.getUTCHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):it(i,t.length)},m:function(r,t,n){return t==="mo"?n.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):Fa.m(r,t)},s:function(r,t,n){return t==="so"?n.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):Fa.s(r,t)},S:function(r,t){return Fa.S(r,t)},X:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return mx(s);case"XXXX":case"XX":return $o(s);case"XXXXX":case"XXX":default:return $o(s,":")}},x:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();switch(t){case"x":return mx(s);case"xxxx":case"xx":return $o(s);case"xxxxx":case"xxx":default:return $o(s,":")}},O:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+px(s,":");case"OOOO":default:return"GMT"+$o(s,":")}},z:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+px(s,":");case"zzzz":default:return"GMT"+$o(s,":")}},t:function(r,t,n,i){var a=i._originalDate||r,s=Math.floor(a.getTime()/1e3);return it(s,t.length)},T:function(r,t,n,i){var a=i._originalDate||r,s=a.getTime();return it(s,t.length)}};function px(e,r){var t=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),a=n%60;if(a===0)return t+String(i);var s=r||"";return t+String(i)+s+it(a,2)}function mx(e,r){if(e%60===0){var t=e>0?"-":"+";return t+it(Math.abs(e)/60,2)}return $o(e,r)}function $o(e,r){var t=r||"",n=e>0?"-":"+",i=Math.abs(e),a=it(Math.floor(i/60),2),s=it(i%60,2);return n+a+t+s}var dx=j6;var hx=function(r,t){switch(r){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},vx=function(r,t){switch(r){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},e8=function(r,t){var n=r.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return hx(r,t);var s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",hx(i,t)).replace("{{time}}",vx(a,t))},r8={p:vx,P:e8},gx=r8;var t8=["D","DD"],n8=["YY","YYYY"];function xx(e){return t8.indexOf(e)!==-1}function yx(e){return n8.indexOf(e)!==-1}function dh(e,r,t){if(e==="YYYY")throw new RangeError("Use \`yyyy\` instead of \`YYYY\` (in \`".concat(r,"\`) for formatting years to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use \`yy\` instead of \`YY\` (in \`".concat(r,"\`) for formatting years to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use \`d\` instead of \`D\` (in \`".concat(r,"\`) for formatting days of the month to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use \`dd\` instead of \`DD\` (in \`".concat(r,"\`) for formatting days of the month to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var i8={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},a8=function(r,t,n){var i,a=i8[r];return typeof a=="string"?i=a:t===1?i=a.one:i=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},bx=a8;function cf(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.width?String(r.width):e.defaultWidth,n=e.formats[t]||e.formats[e.defaultWidth];return n}}var o8={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},s8={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},u8={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},f8={date:cf({formats:o8,defaultWidth:"full"}),time:cf({formats:s8,defaultWidth:"full"}),dateTime:cf({formats:u8,defaultWidth:"full"})},wx=f8;var l8={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},c8=function(r,t,n,i){return l8[r]},Dx=c8;function Zo(e){return function(r,t){var n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,s=t!=null&&t.width?String(t.width):a;i=e.formattingValues[s]||e.formattingValues[a]}else{var c=e.defaultWidth,f=t!=null&&t.width?String(t.width):e.defaultWidth;i=e.values[f]||e.values[c]}var o=e.argumentCallback?e.argumentCallback(r):r;return i[o]}}var p8={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},m8={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},d8={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},h8={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},v8={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},g8={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},x8=function(r,t){var n=Number(r),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},y8={ordinalNumber:x8,era:Zo({values:p8,defaultWidth:"wide"}),quarter:Zo({values:m8,defaultWidth:"wide",argumentCallback:function(r){return r-1}}),month:Zo({values:d8,defaultWidth:"wide"}),day:Zo({values:h8,defaultWidth:"wide"}),dayPeriod:Zo({values:v8,defaultWidth:"wide",formattingValues:g8,defaultFormattingWidth:"wide"})},Sx=y8;function Qo(e){return function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=r.match(i);if(!a)return null;var s=a[0],c=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],f=Array.isArray(c)?w8(c,function(p){return p.test(s)}):b8(c,function(p){return p.test(s)}),o;o=e.valueCallback?e.valueCallback(f):f,o=t.valueCallback?t.valueCallback(o):o;var u=r.slice(s.length);return{value:o,rest:u}}}function b8(e,r){for(var t in e)if(e.hasOwnProperty(t)&&r(e[t]))return t}function w8(e,r){for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:{},n=r.match(e.matchPattern);if(!n)return null;var i=n[0],a=r.match(e.parsePattern);if(!a)return null;var s=e.valueCallback?e.valueCallback(a[0]):a[0];s=t.valueCallback?t.valueCallback(s):s;var c=r.slice(i.length);return{value:s,rest:c}}}var D8=/^(\\d+)(th|st|nd|rd)?/i,S8=/\\d+/i,N8={narrow:/^(b|a)/i,abbreviated:/^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},A8={any:[/^b/i,/^(a|c)/i]},E8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},C8={any:[/1/i,/2/i,/3/i,/4/i]},M8={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},_8={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},T8={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},F8={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},O8={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},B8={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},I8={ordinalNumber:hh({matchPattern:D8,parsePattern:S8,valueCallback:function(r){return parseInt(r,10)}}),era:Qo({matchPatterns:N8,defaultMatchWidth:"wide",parsePatterns:A8,defaultParseWidth:"any"}),quarter:Qo({matchPatterns:E8,defaultMatchWidth:"wide",parsePatterns:C8,defaultParseWidth:"any",valueCallback:function(r){return r+1}}),month:Qo({matchPatterns:M8,defaultMatchWidth:"wide",parsePatterns:_8,defaultParseWidth:"any"}),day:Qo({matchPatterns:T8,defaultMatchWidth:"wide",parsePatterns:F8,defaultParseWidth:"any"}),dayPeriod:Qo({matchPatterns:O8,defaultMatchWidth:"any",parsePatterns:B8,defaultParseWidth:"any"})},Nx=I8;var P8={code:"en-US",formatDistance:bx,formatLong:wx,formatRelative:Dx,localize:Sx,match:Nx,options:{weekStartsOn:0,firstWeekContainsDate:1}},Ax=P8;var Ex=Ax;var k8=/[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g,R8=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,L8=/^'([^]*?)'?$/,q8=/''/g,U8=/[a-zA-Z]/;function Oa(e,r,t){var n,i,a,s,c,f,o,u,p,d,h,x,v,y,w,C,b,A;ot(2,arguments);var E=String(r),S=uo(),O=(n=(i=t?.locale)!==null&&i!==void 0?i:S.locale)!==null&&n!==void 0?n:Ex,F=Pn((a=(s=(c=(f=t?.firstWeekContainsDate)!==null&&f!==void 0?f:t==null||(o=t.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&c!==void 0?c:S.firstWeekContainsDate)!==null&&s!==void 0?s:(p=S.locale)===null||p===void 0||(d=p.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(F>=1&&F<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=Pn((h=(x=(v=(y=t?.weekStartsOn)!==null&&y!==void 0?y:t==null||(w=t.locale)===null||w===void 0||(C=w.options)===null||C===void 0?void 0:C.weekStartsOn)!==null&&v!==void 0?v:S.weekStartsOn)!==null&&x!==void 0?x:(b=S.locale)===null||b===void 0||(A=b.options)===null||A===void 0?void 0:A.weekStartsOn)!==null&&h!==void 0?h:0);if(!(M>=0&&M<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!O.localize)throw new RangeError("locale must contain localize property");if(!O.formatLong)throw new RangeError("locale must contain formatLong property");var _=Lt(e);if(!sh(_))throw new RangeError("Invalid time value");var k=ah(_),L=uh(_,k),Y={firstWeekContainsDate:F,weekStartsOn:M,locale:O,_originalDate:_},$=E.match(R8).map(function(V){var q=V[0];if(q==="p"||q==="P"){var R=gx[q];return R(V,O.formatLong)}return V}).join("").match(k8).map(function(V){if(V==="''")return"'";var q=V[0];if(q==="'")return z8(V);var R=dx[q];if(R)return!(t!=null&&t.useAdditionalWeekYearTokens)&&yx(V)&&dh(V,r,String(e)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&xx(V)&&dh(V,r,String(e)),R(L,V,O.localize,Y);if(q.match(U8))throw new RangeError("Format string contains an unescaped latin alphabet character \`"+q+"\`");return V}).join("");return $}function z8(e){var r=e.match(L8);return r?r[1].replace(q8,"'"):e}function vh(e,r){if(pi(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(pi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function gh(e){var r=vh(e,"string");return pi(r)=="symbol"?r:r+""}function Ur(e,r,t){return r=gh(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var xh=e=>[...new Set(e)];var yh=(e,r)=>{if(e instanceof Date)return"date";if(typeof e=="string"){if(/\\/\\/(\\S+?(?:jpe?g|png|gif|svg))/gi.test(e)||e.includes("unsplash"))return"image";if(/^\\d{4}-\\d{2}-\\d{2}$/.test(e))return"date";if(r=="tag"||r=="tags")return"tag";if(/\\[\\[.*?\\]\\]/.test(e))return"link"}else{if(typeof e=="number")return"number";if(typeof e=="boolean")return"boolean";if(e)if(Array.isArray(e)||typeof e=="string"&&e.indexOf(",")>-1){let t=Array.isArray(e)?e:[];if(typeof e=="string"&&e.indexOf(",")>-1&&(t=Xo(e)),r=="tag"||r=="tags")return"tag-multi";if(t.length==1&&Array.isArray(t[0])&&t[0].length==1&&typeof t[0][0]=="string")return"link";let n=xh(t.map(i=>yh(i,r)));return n.length==1&&n[0]=="link"?"link-multi":n.some(i=>i=="object")?"object-multi":"option-multi"}else{if(e.isLuxonDateTime)return"date";if(e.isLuxonDuration)return"duration";if(e.type=="file")return"link";if(typeof e=="object"&&!Array.isArray(e)&&e!==null)return"object"}else return"unknown"}return"text"};var Cx=e=>e.map(r=>r.replace(",","\\\\,")).join(", "),bh=e=>e?.map(r=>r.replace(",","\\\\,")).join(", ")??"";var Xo=e=>(e?.replace("\\\\,",",")?.match(/(\\\\.|[^,])+/g)??[]).map(r=>r.trim()),Mx=(e,r)=>{switch(yh(r,e)){case"object":return JSON.stringify(r);case"number":return r.toString();case"boolean":return r?"true":"false";case"date":{if(r instanceof Date){let n=Oa(r,"yyyy-MM-dd");if(typeof n=="string")return n}return typeof r!="string"?"":r}break;case"duration":return Cx(Object.keys(r.values).reduce((n,i)=>[...n,...r.values[i]>0?[r.values[i]+" "+i]:[]],[]));case"option-multi":case"link-multi":return typeof r=="string"?wh(r):bh(r.map(n=>n?typeof n=="string"?wh(n):n.path?n.path:Array.isArray(r)&&n.length==1&&Array.isArray(n[0])&&n[0].length==1&&typeof n[0][0]=="string"?n[0][0]:JSON.stringify(n):""));case"link":return Array.isArray(r)&&r.length==1&&Array.isArray(r[0])&&r[0].length==1&&typeof r[0][0]=="string"?r[0][0]:typeof r=="string"?wh(r):r.path;case"text":case"tag":case"image":return r}return""},Zl=e=>{let r;try{r=JSON.parse(e)}catch{}return r};var wh=e=>{if(!e)return"";let r=/\\[\\[(.*?)\\]\\]/g.exec(e),t=r?.length>1?r[1].substring(0,cx("|",r[1])):e;return t||e};var Tx=ci(_x()),Sh=class{constructor(){this.lang="en";this.all={en:{hintText:{dragDropModifierKeys:"Hold \${1} to Pin and \${2} to Copy",createListItem:"Select/Create List Item Frame",dragDropProperties:"Drag and drop properties to link them into the list",newItem:"+ New",selectNote:"Select Note...",newFrame:"New"},defaults:{spaceNote:"Current Note",spaceContext:"Current Space"},commands:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",columns:"Columns",button:"Button",label:"Label",column:"Column",idea:"New",group:"Group",paragraph:"Text",card:"Card",progress:"Progress",rating:"Rating",circularProgress:"Circular Progress",list:"Bullet List","ordered-list":"Numbered List",todo:"To-do List",quote:"Quote",divider:"Divider",note:"Link to Note",link:"Link",callout:"Callout",bookmark:"Bookmark",table:"Table",codeblock:"Code Block",toggle:"Toggle",emoji:"Emoji",image:"Image",flow:"Linked Note",newNote:"New Note",tag:"Tag",makeMenu:"Flow Menu",selectStyle:"Style",toggleKeyboard:"Toggle Keyboard",rows:"Rows",masonry:"Gallery"},styles:{bold:"Bold",italics:"Italics",strikethrough:"Strikethrough",code:"Code",link:"Web Link",blocklink:"Link to Note",textColor:"Text Color",highlight:"Highlight"},commandsSuggest:{noResult:"No result"},commandPalette:{enable:"Enable",disabled:"Disable",openFlow:"Open Flow Blocks in Selection",closeFlow:"Close Flow Blocks in Selection",toggleBold:"Toggle Bold",toggleItalics:"Toggle Italics",openSpaces:"Open Spaces",migrateData:"Migrate Spaces From 0.7",blink:"Blink",openFileContext:"Open Explorer",convertPathToSpace:"Convert to Space",revealFile:"Reveal File in Spaces",releaseNotes:"Release Notes",toggleBacklinks:"Toggle Backlinks",collapseAllFolders:"Collapse All Folders",addFileSpace:"Add File to Space",removeFileSpace:"Remove File from Space"},frames:{sections:{kit:"Kit",paths:"Paths"},label:{label:"Label",description:"Label"},note:{label:"Note",description:"Link to a note"},table:{label:"Table",description:"Table"},context:{label:"Context",description:"Display a context view from another space"},calendar:{label:"Calendar View"},field:{label:"Field",description:"Dynamic node that displays a value based on property type"},event:{label:"Event"},divider:{label:"Divider",description:"Divider to separate your content"},button:{label:"Button",description:"Buttons can perform actions and open links"},callout:{label:"Callout",description:"Callout to highlight important information"},toggle:{label:"Toggle",description:"Toggle to show/hide content"}},menu:{newView:"New View",closeSpace:"Close Space",customView:"Custom View",detailsView:"Details View",catalogView:"Catalog View",galleryView:"Gallery View",deleteContext:"Delete Context",openSpace:"Open Space",revealInDefault:"Reveal in Finder",setNone:"None",fileMetadataDescription:"This note only",openFilePane:"Open in a new pane",rename:"Rename",changeToFolderNote:"New Space from Note",moveFile:"Move file to...",moveFolder:"Move folder to...",duplicate:"Make a copy",edit:"Edit",delete:"Delete",getHelp:"Make.md Community",vault:"Vault",openVault:"Open Another Vault",openVaultInFolder:"Open Vault Folder",obSettings:"Obsidian Settings",commandPalette:"Command Palette",backToSpace:"Back to Spaces",collapseAllSections:"Collapse All Spaces",expandAllSections:"Expand All Spaces",collapseAllFolders:"Collapse All Folders",expandAllFolders:"Expand All Folders",spaceTitle:"Add/Remove in Space",home:"Home",waypoints:"Waypoints",none:"None",tableView:"Table View",cardView:"Card View",boardView:"Board View",listView:"List View",flowView:"Flow View",groupBy:"Group By",sortBy:"Sort By",newFilter:"New Filter",clearFilters:"Clear Filters",hide:"Hide",unhideFields:"Unhide All Properties",importDataview:"Import All Dataview Properties",saveAllProperties:"Save All Properties to Files",mergeProperties:"Merge Properties",removeFromSpace:"Unpin from Space",removeFromWaypoints:"Unpin from Waypoints",editCode:"Edit Code",deleteProperty:"Delete Property",hideProperty:"Hide Property",unhideProperty:"Unhide Property",saveProperty:"Save Property",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",deleteRow:"Delete Item",collapseAll:"Collapse All",customSort:"Custom Sort",groupSpaces:"Group Spaces",fileNameSortAlphaAsc:"File Name (A to Z)",fileNameSortAlphaDesc:"File Name (Z to A)",createdTimeSortAsc:"Created Time (new to old)",createdTimeSortDesc:"Created Time (old to new)",modifiedTimeSortAsc:"Modified Time (new to old)",modifiedTimeSortDesc:"Modified Time (old to new)",sizeSortAsc:"Size (smallest to largest)",sizeSortDesc:"Size (largest to smallest)",spaces:"Spaces",tags:"Tags",manageHiddenFiles:"Manage Hidden Files",manageActions:"Manage Actions",deleteSpace:"Delete",changeColor:"Change Color",changePropertyType:"Change Type",deleteFiles:"Delete Files",createFolderSpace:"Create Space from Folder",folder:"Folder",syncToContext:"Add Property to Context",setIcon:"Set Icon",copyEmbedLink:"Copy Embed Link",moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",groupNodes:"Group Nodes",moveFrame:"Move Frame",renameFrame:"Rename Frame",deleteFrame:"Delete Frame"},editor:{rows:"Rows",columns:"Columns",catalog:"Catalog",gallery:"Gallery",grid:"Grid",scaleToFit:"Change to Fit",scaleToFill:"Change to Fill",fit:"Fit",strokeNone:"None",strokeSolid:"Solid",strokeDotted:"Dotted",strokeDashed:"Dashed",size:"Size",gap:"Gap",marginLeft:"Left",marginTop:"Top",marginRight:"Right",marginBottom:"Bottom",minimize:"Minimize",paddingLeft:"Left",paddingTop:"Top",paddingRight:"Right",paddingBottom:"Bottom",unlinkProperty:"Unlink Property",linkedProperty:"Linked Property",linkProperty:"Link Property",currentSpace:"Current Space",linkName:"\${1} Link",linkThumbnail:"\${1} Thumbnail",linkSticker:"\${1} Sticker",opacity:"Opacity",shadowSpread:"Spread",shadowBlur:"Blur",width:"Width",height:"Height",margin:"Margin",padding:"Padding",bold:"Bold",italic:"Italic",underline:"Underline",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",numberOfLines:"Lines",createVerticalSection:"Create Vertical Section",createHorizontalSection:"Create Horizontal Section",themeColors:"Theme Colors",uiColors:"UI Colors",hex:"Hex"},buttons:{add:"Add",addFilter:"Add Filter",customize:"Customize",moreOptions:"More Options",saveProperty:"Save Property",newNote:"New Note",changeIcon:"Change Sticker",removeIcon:"Remove Sticker",addIcon:"Add Sticker",addCover:"Add Cover",changeBanner:"Change Cover",changeBannerShort:"Cover",saveChanges:"Save Changes",removeBanner:"Remove Cover",rename:"Change Name",editFrame:"Edit Frame",saveSpace:"Save Space",createSpace:"New Space",createFolder:"New Folder",createNote:"New Note",createCanvas:"New Canvas",addIntoSpace:"New Pin",addSmartSearch:"Add Smart Search",addItem:"Add Item",addProperty:"Add Property",addContext:"Add Context",cancel:"Cancel",search:"Search",delete:"Delete",toggleFlow:"Toggle Flow",openFlow:"Open Flow",hideFlow:"Hide Flow",openLink:"Open Link",addToSpace:"Add to Space",addToSpaceShort:"Pin",addTag:"Add Tag",tag:"Tag",syncFields:"Sync Properties",convertTable:"Convert to Markdown",cutTable:"Cut Table",deleteTable:"Delete Table",blink:"Blink",addFile:"Add Item",merge:"Merge",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",deleteView:"Delete View",renameTable:"Rename Table",renameTag:"Rename Tag",createTag:"Create Tag",currentFolder:"Current Folder",sync:"Sync",pasteCSS:"Paste CSS",save:"Save",run:"Run"},metadataTypes:{fileName:"File Name",path:"Path",folder:"Folder",sticker:"Sticker",color:"Color",created:"Created",lastModified:"Last Modified",extension:"Extension",size:"Size",tags:"Tags",inlinks:"Linked Mentions",outlinks:"Links",label:"Label",fileMetadata:"File Metadata",frontmatter:"Frontmatter"},filterTypes:{contains:"contains",notContains:"does not contain",is:"is",isNot:"is not",before:"before",after:"after",anyOf:"is any of",noneOf:"is none of",checked:"is checked",unchecked:"is unchecked",isEmpty:"is empty",isNotEmpty:"is not empty",isSameDate:"is same date",isSameDateAsToday:"today"},sortTypes:{alphaAsc:"A to Z",alphaDesc:"Z to A",earliest:"Earliest",latest:"Latest",checkAsc:"Checked \\u2192 Unchecked",checkDesc:"Unchecked \\u2192 Checked",itemsAsc:"Least Items",itemsDesc:"Most Items"},properties:{defaultField:"Name",audio:{label:"Audio",description:"Audio"},text:{label:"Text",description:"Text field"},number:{label:"Number",description:"Number field with optional unit"},boolean:{label:"Yes/No",description:"Yes or No toggle to indicate the status"},date:{label:"Date",description:"Select a date from a calendar"},option:{label:"Option",description:"Select one or multiple option from a list"},file:{label:"File"},link:{label:"Link",description:"Link to another note or a website"},tags:{label:"Tags",description:"Use tags to quickly organize your items"},object:{label:"Object",description:"Store any complex objects"},context:{label:"Relation",description:"Connect to another context property and create a relation"},image:{label:"Image",description:"Select any image from your system or from the internet"},color:{label:"Color",description:"Use colors to label your items or status"},space:{label:"Context",description:"Link to a context"},icon:{label:"Sticker",description:"Use stickers to uniquely label your items or status"},super:{label:"Super Property",links:"Open Link",properties:"Update Property",api:"API",obsidianCommands:"Run Command",runCommand:"Run Command",performAction:"Perform Action",whenClicked:"When Clicked"},fileProperty:{name:"Name",label:"Formula",createdTime:"Created",modifiedTime:"Last Edited",sticker:"Sticker",links:"Links",tags:"Tags",spaces:"Spaces",extension:"Extension",size:"Size",preview:"Note Preview",parentFolder:"Folder",description:"Use a formula to dynamically display a property"}},views:{navigator:"Navigator",explorer:"Explorer",space:"Space"},subViews:{spaceItems:"Items",spaceContext:"Context",spaceLists:"Lists",spaceActions:"Actions",spaceTemplates:"Templates",smartSearch:"Smart Search",filesAndFolders:"Files and Folders"},labels:{properties:"Properties",newAction:"New Action",newTable:"New Table",createFolder:"New Folder Name",rename:"Rename",createNew:"New",default:"Default",done:"Done",tables:"Tables",selectDateFormat:"Select/Type Date Format",renameSectionSmart:"Edit Smart Space",renameSection:"Edit Space",createSectionSmart:"New Smart Space",createSection:"New Folder",createNote:"New Note",contextMaker:"Context Maker",select:"Select",pinnedItems:"Pinned Items",collapse:"Collapse",expand:"Expand",all:"All",none:"None",view:"View",findStickers:"Find Sticker",mergeProperties:"Merge Properties",placeholder:"Type '\${1}' for commands",itemsSelected:"\${1} Selected",selectNote:"Select Note",selectIcon:"Select Icon",selectImage:"Select Image",selectSpace:"Select Space",styleSmall:"Small",styleMedium:"Medium",styleLarge:"Large",hiddenFilePattern:"Name, Suffixes and Extension",hiddenFileSpecific:"Exclude specific files and folders",textPlaceholder:"Enter Text",noFile:"is not created yet. Click to create.",navigatorSearchPlaceholder:"Search by Text or Filters",blinkPlaceholder:"Quickly Search a File, Folder, Tag... Press Tab to Edit",searchPlaceholder:"Type to search...",contextItemSelectPlaceholder:"Find Item",linkItemSelectPlaceholder:"Find or Create Note",pinNotePlaceholder:"Select a Note or Space to Pin",optionItemSelectPlaceholder:"Select Option",viewItemSelectPlaceholder:"Select View",tagItemSelectPlaceholder:"Find Tag",spaceSelectPlaceholder:"Select any Folder or Tag",propertyItemSelectPlaceholder:"Select Property",sortItemSelectPlaceholder:"Select Sort",filterItemSelectPlaceholder:"Select Filter",imageSelectPlaceholder:"Select an image or paste a URL",imageNotFoundPlaceholder:"No Images Found",syncFrontmatterProperty:"Sync Frontmatter Property",newProperty:"New Property",newPropertyShort:"New Property",propertyType:"Type",propertyDynamic:"Dyanmic",propertyValueSpace:"Space",propertyValueProperty:"Property",propertyLookup:"Edit Formula",dateFormat:"Date Format",propertyFileProp:"Property",multiple:"Multiple",filesCount:"{$1} Files",hiddenFiles:"Hidden Files",addExtension:"Add Rule",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",renameTable:"Rename Table",syncMetadata:"Sync Metadata",syncProperties:"Sync Properties",selectContext:"Select Context",metadata:"Metadata",backlinks:"Backlinks",spaces:"Spaces",context:"Context",content:"Content",deleteSpace:"Delete Space",deleteFiles:"Delete Files",outgoingLinks:"Outgoing Links",moveTo:"Move to",addTo:"Pin to",copyTo:"Copy to",reorderIn:"Reorder in",border:"Border",corners:"Corners",color:"Color",backgroundColor:"Background",cornerRadius:"Radius",onClick:"On Click",layout:"Layout",element:"Element",name:"Name",display:"Display",alignment:"Alignment",margin:"Margin",padding:"Padding",gap:"Gap",width:"Width",height:"Height",opacity:"Opacity",shadow:"Shadow",shadowBlur:"Blur",shadowSpread:"Spread",typography:"Typography",layers:"Layers",fontSize:"Size",props:"Props",styles:"Styles",events:"Events",code:"Code",selectedLayers:"\${1} Layers"},descriptions:{spaceActions:"Create actions that runs when you press a button",spaceLists:"Create lists to track data and organize them in your space",spaceItems:"Add new items to the space or pin items to the space",smartSearch:"Automatically pin notes to this space based on a set of searches",hiddenFileOptions:"Exclude any files and folders by name, suffix or extension.",deleteSpace:"Deleting the space will also delete the folder and its contents.",deleteFiles:"Delete \${1} files/folders and their contents?",addContext:"Contexts lets you connect properties from your tags",spaceProperties:"Define Properties for your Space Items",syncMetadata:"Select which fields from your notes to start syncing with the context.",syncProperties:"Contexts defines and syncs the same fields across your notes depending on their folder or tag.",selectContext:"Select which folder or tag context you want to sync the fields."},flowView:{emptyDoc:"Empty Document",itemsCount:" Items",emptyFolder:"This Folder is Empty"},notice:{duplicateFile:"Folder already contains note with same name",addedToSection:"Added to Space",fileExists:"File Already Exists",folderExists:"Folder Already Exists",noPropertyName:"Property Name is Required",duplicatePropertyName:"Duplicate Property Name",newSpaceName:"Enter a name for your space",duplicateSpaceName:"Space name already exists",cantConvertNoteToSpace:"The view is not a note",templateSaved:"Template saved to space: "},settings:{layoutVertical:"Vertical",layoutHorizontal:"Horizontal",sectionSidebar:"Spaces",sectionEditor:"Maker Mode",sectionFlow:"Flow",sectionAdvanced:"Advanced",sectionDataview:"Dataview",sectionContext:"Context",sectionStickers:"Stickers",sectionNavigator:"Navigator",sectionDefault:"Default Spaces",sectionSpaceView:"Space View",sectionBlink:"Blink",sectionInlineContext:"Inline Context",sectionFlowBlock:"Flow Block",sectionFlowMenu:"Flow Menu",sectionFlowStyler:"Flow Styler",experimental:{name:"Experimental",desc:"Experimental features that are subject to change and may not be optimized for performance"},generateThumbnails:{name:"Generate Thumbnails",desc:"Create thumbnails for images to speed up performance"},minimalThemeFix:{name:"Minimal Theme Fix",description:"Apply fixes for the popular theme Minimal"},inlineStickerMenu:{name:"Inline Stickers",desc:"Add inline stickers by typing :"},openSpacesOnLaunch:{name:"Open Spaces as Default Tab",desc:"Open the Spaces tab when Obsidian launches"},defaultSpaceTemplate:{name:"Default Space Template",desc:"Select the default template for new spaces"},defaultDateFormat:{name:"Default Date Format",desc:"Set the default date format, example: yyyy-MM-dd (see https://date-fns.org/v2.30.0/docs/format)"},newNotePlaceholder:{name:"New Note Placeholder",desc:"Default name for new notes"},folderIndentationLines:{name:"Show Folder Indentation Lines",desc:"Turn on to show a line on the left of folders to indicate indentation"},folderNoteLocation:{name:"Folder Note Location Inside Folder",desc:"Turn on to have folder notes inside the folder, turn off to have it outside"},folderViewDefault:{name:"Show Folder Note by Default",desc:"Show the folder note by default when opening a folder"},internalLinkFlowEditor:{name:"Open Flow Blocks on Internal Link Click",desc:"Turn on to toggle Flow Blocks directly by clicking on internal links, otherwise a tooltip will be shown"},syncContextToFrontmatter:{name:"Sync Context Fields to Frontmatter",desc:"Turn on to automatically save all context fields to frontmatter fields, not just existing frontmatter fields."},inlineBacklinks:{name:"Show Inline Backlinks (Inline Context required)",desc:"Show editable backlinks at the bottom of your notes"},dataviewInlineContext:{name:"Show Dataview in Inline Context",desc:"Show dataview when inline context is enabled"},inlineContextExplorer:{name:"Inline Context",desc:"Display the context and a banner at the top of your notes"},inlineContextExpanded:{name:"Auto Expand Inline Context",desc:"Expand the inline context sections when opening a note"},inlineContextHorizontal:{name:"Inline Title and Sticker Layout",desc:"Layout for inline title and sticker in Inline Context"},hideFrontmatter:{name:"Hide Frontmatter Properties",desc:"Hide the frontmatter properties in inline context"},openFileContext:{name:"Auto Open Explorer",desc:"Automatically open explorer panel in the right panel"},folderNote:{name:"Enable Folder Note",desc:"Access the folder note in the folder page and hide the folder note from spaces"},expandFolder:{name:"Auto Expand Folder",desc:"Auto expand folders on click"},hoverPreview:{name:"Preview on Hover",desc:"Preview on Hover while holding Control/Command key"},activeFile:{name:"Reveal Active File",desc:"Automatically reveal the active file in Spaces"},contexts:{name:"Contexts",desc:"Contexts allows you to have full control over the metadata of your files"},spaces:{name:"Navigator",desc:"The navigator lets you create and organize your spaces"},spacesStickers:{name:"Stickers",desc:"Use Emojis to make it easier to find your notes"},spacesAlias:{name:"Alias",desc:"Use the alias metadata to show in Spaces"},spacesFileExplorerDual:{name:"Compatibility Mode",desc:"This will improve the compatibility of plugins while using Spaces"},spacesDeleteOption:{name:"Delete File Option",desc:"Select how you want files to be deleted"},spacesDeleteOptions:{permanant:"Delete Permanently",trash:"Move to Obsidian Trash","system-trash":"Move to System Trash"},hideRibbon:{name:"App Ribbon",desc:"Show/hide the left menu aka. ribbon"},spaceView:{name:"Space View",desc:"Open the space view when you click on a space"},defaultSpaces:{name:"Default Spaces",desc:"Recommended spaces for quickly organizing your vault"},homeSpace:{name:"Home Space",desc:"An easy-to-access space where you can add/organize your other spaces"},tagSpaces:{name:"Tag Spaces",desc:"Automatically create spaces for each of your tags"},readableLineWidth:{name:"Readable Line Width",desc:"Use Readable Line Width"},sidebarTabs:{name:"Sidebar Tabs",desc:"Show/hide other sidebar tabs"},spacesPerformance:{name:"Performance Mode",desc:"Turn on performance mode for Spaces, may affect scrolling appearance. Requires Restart"},indexSVG:{name:"Use SVGs as Stickers",desc:"Use any svg file in your vault as a sticker"},inlineStyler:{name:"Flow Styler",desc:"Select text to add styling"},inlineStylerColor:{name:"Text and Highlight Colors \\u{1F9EA}",desc:"Select text color and highlight color, (this may change in the future because of the limitations with HTML and Obsidian)"},spaceRowHeight:{name:"Row Height",desc:"The height for each row in spaces (in pixels), default is 28"},makeChar:{name:"Flow Menu Trigger",desc:"Character to open the Flow Menu"},mobileMakeBar:{name:"Flow Styler (Mobile)",desc:"Replaces the mobile toolbar"},editorMarkSans:{name:"Mark Sans \\u{1F9EA}",desc:"Use the editor without Markdown."},editorMakerMode:{name:"Flow (Beta)",desc:"An integrated and intuitive editor experience"},editorMakePlacholder:{name:"Flow Menu Hint Text",desc:"Show a hint text on how to open the Flow Menu Shortcut"},blink:{name:"Blink",desc:"A faster way to search and edit your notes"},editorMakeMenu:{name:"Flow Menu",desc:"Open the Flow menu to quickly add content"},editorMakeMenuTrigger:{name:"Flow Menu Shortcut",desc:"Trigger key to use flow menu"},editorFlowReplace:{name:"Flow Block",desc:"Open your internal links or toggle your embeds in the flow block."},editorFlowStyle:{name:"Flow Block Style",desc:"Select a theme for your flow block",seamless:"Seamless",classic:"Classic",minimal:"Minimal"}}}};this.lang="en";let r=Tx.default.locale();["en"].includes(r)&&(this.lang=r)}get texts(){return this.all.en}},Vr=new Sh().texts;var Fx=(e,r)=>r==Go?zs.find(t=>t.type=="file"):r=="tags"?zs.find(t=>t.type=="tags"):r=="aliases"?zs.find(t=>t.type=="option-multi"):r=="sticker"?zs.find(t=>e=="icon"):zs.find(t=>e==t.type)||zs.find(t=>e==t.multiType),zs=[{type:"unknown",label:"",restricted:!0,icon:"ui//file-question"},{type:"text",label:Vr.properties.text.label,metadata:!0,icon:"ui//text",primative:!0,description:Vr.properties.text.description},{type:"number",label:Vr.properties.number.label,metadata:!0,icon:"ui//binary",configKeys:["unit"],primative:!0,description:Vr.properties.number.description},{type:"boolean",label:Vr.properties.boolean.label,metadata:!0,icon:"ui//check-square",primative:!0,description:Vr.properties.boolean.description},{type:"date",label:Vr.properties.date.label,metadata:!0,icon:"ui//calendar",configKeys:["format"],primative:!0,description:Vr.properties.date.description},{type:"option",label:Vr.properties.option.label,multi:!0,multiType:"option-multi",icon:"ui//list",configKeys:["options","source"],description:Vr.properties.option.description},{type:"tags",label:Vr.properties.tags.label,icon:"ui//tags",description:Vr.properties.tags.description},{type:"file",label:Vr.properties.file.label,restricted:!0,icon:"ui//mk-make-h3"},{type:"fileprop",label:Vr.properties.fileProperty.label,icon:"ui//formula",configKeys:["field","value","type"],description:Vr.properties.fileProperty.description},{type:"link",label:Vr.properties.link.label,multi:!0,multiType:"link-multi",metadata:!0,icon:"ui//file-text",primative:!0,description:Vr.properties.link.description},{type:"context",label:Vr.properties.context.label,icon:"ui//mk-make-note",multi:!0,multiType:"context-multi",configKeys:["space"],description:Vr.properties.context.description},{type:"object",label:Vr.properties.object.label,multi:!0,multiType:"object-multi",metadata:!0,icon:"ui//list-tree",configKeys:["type"],description:Vr.properties.object.description},{type:"icon",label:Vr.properties.icon.label,multi:!0,multiType:"icon-multi",icon:"ui//gem",restricted:!0,primative:!0,description:Vr.properties.icon.description},{type:"image",label:Vr.properties.image.label,multi:!0,multiType:"image-multi",metadata:!0,icon:"ui//mk-make-image",primative:!0,description:Vr.properties.image.description},{type:"color",label:Vr.properties.color.label,icon:"ui//mk-make-image",restricted:!0,description:Vr.properties.color.description},{type:"space",label:Vr.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Vr.properties.space.description},{type:"table",label:Vr.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Vr.properties.space.description},{type:"super",label:Vr.properties.super.label,icon:"ui//zap",restricted:!0,configKeys:["dynamic","field"]},{type:"input",label:Vr.properties.super.label,icon:"ui//input",restricted:!0}];var pf="files",Jl={id:pf,name:"Files",type:"db",primary:"true"},W8="filesView",V8={id:W8,name:"All",type:"view",def:JSON.stringify({db:pf,icon:"ui//file-stack"})},Y8="main",H8=e=>({id:e,name:e,type:"frame",def:"",predicate:"",primary:"true"}),r$={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[H8(Y8),V8]},Ql={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[Jl]},Ox={uniques:["name,schemaId"],cols:["name","schemaId","type","value","attrs","hidden","unique","primary"]},Xl={...Ox,rows:[{name:Go,schemaId:pf,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""},{name:Vr.properties.fileProperty.createdTime,schemaId:pf,type:"fileprop",value:Go+".ctime",hidden:"",unique:"",attrs:"",primary:"true"}]};var t$=[{name:Vr.properties.defaultField,schemaId:"",type:"text",primary:"true"}],Nh={...Ox,rows:[{name:Go,schemaId:pf,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""}]};var n$={schema:Jl,cols:Xl.rows,rows:[]},i$={schema:Jl,cols:Xl.rows,rows:[]},a$={schema:Jl,cols:Nh.rows,rows:[]},Bx=(e,r)=>e.filter(t=>r.find(n=>n.id==t.schemaId&&n.type=="db")).reduce((t,n)=>({...t,...t[n.schemaId]?{[n.schemaId]:{uniques:n.unique=="true"?[...t[n.schemaId].uniques,n.name]:t[n.schemaId].uniques,cols:[...t[n.schemaId].cols,n.name],rows:[]}}:{[n.schemaId]:{uniques:n.unique=="true"?[n.name]:[],cols:[n.name],rows:[]}}}),{});var o$={m_schema:Ql,m_fields:Xl,...Bx(Xl.rows,Ql.rows)},s$={m_schema:Ql,m_fields:Nh,...Bx(Nh.rows,Ql.rows)};var G8=(e,r)=>{let t=n=>n=="builtin"?"Builtin":n=="api"?"Spaces":"Action";return[...(e.actionsIndex.get(r)??[]).map(n=>({name:n.schema.name,description:"Action",value:\`\${r}/#;\${n.schema.id}\`,section:"Action"}))??[],...[...e.cli.allCommands()].map(n=>({name:n.schema.name,description:t(n.schema.type),value:n.path,section:t(n.schema.type)}))]};var Ix=({field:e,value:r})=>r=="ctime"?{value:\`parseDate(prop('\${e}')['metadata']['file']['\${r}'])\`,type:"date"}:{value:\`prop('\${e}')['metadata']['file']['\${r}']\`,type:"string"},Kl=(e,r,t,n)=>{let i=Zl(e);if(i)return r=="fileprop"&&i.field?Ix(i):(r=="option"&&i.source?.length>0&&(i.source=="$commands"?i.options=t.cli.allCommands():i.source=="$links"?i.options=t.spaceManager.allPaths().map(a=>({name:a,value:a})):i.source=="$super"&&(i.options=G8(t,n))),[...Fx(r).configKeys??[],"alias","default"].reduce((a,s)=>({...a,[s]:i[s]}),{}));if(!r)return{};if(!i)if(r=="context")e?.length>0?i={space:e}:i={};else if(r.startsWith("date"))e?.length>0?i={format:e}:i={};else if(r.startsWith("fileprop"))if(e?.length>0){let[a,s]=e.split(".");i=Ix({field:a,value:s})}else i={};else r.startsWith("option")&&(e?.length>0?i={options:Xo(e).map(s=>({name:s,value:s}))}:i={});return i??{}};function Mt(){return Mt=Object.assign?Object.assign.bind():function(e){for(var r=1;re[r])}var qx=["Matrix","Array"],Ux=["number","BigNumber","Fraction"];function Wx(e,r){function t(n){if(n){var i=Ys(e,tr);zx(n,"matrix",qx),zx(n,"number",Ux),Ah(e,n);var a=Ys(e,tr),s=Ys(n,tr);return r("config",a,i,s),a}else return Ys(e,tr)}return t.MATRIX_OPTIONS=qx,t.NUMBER_OPTIONS=Ux,Object.keys(jl).forEach(n=>{Object.defineProperty(t,n,{get:()=>e[n],enumerable:!0,configurable:!0})}),t}function $8(e,r){return e.indexOf(r)!==-1}function zx(e,r,t){e[r]!==void 0&&!$8(t,e[r])&&console.warn('Warning: Unknown value "'+e[r]+'" for configuration option "'+r+'". Available options: '+t.map(n=>JSON.stringify(n)).join(", ")+".")}var y0={};G6(y0,{createAbs:()=>V1,createAccessorNode:()=>c2,createAcos:()=>zS,createAcosh:()=>VS,createAcot:()=>HS,createAcoth:()=>$S,createAcsc:()=>QS,createAcsch:()=>JS,createAdd:()=>e2,createAddScalar:()=>G1,createAnd:()=>jc,createAndTransform:()=>CO,createApply:()=>nu,createApplyTransform:()=>eO,createArg:()=>$b,createArrayNode:()=>p2,createAsec:()=>jS,createAsech:()=>rN,createAsin:()=>nN,createAsinh:()=>iN,createAssignmentNode:()=>h2,createAtan:()=>aN,createAtan2:()=>sN,createAtanh:()=>fN,createAtomicMass:()=>B3,createAvogadro:()=>I3,createBellNumbers:()=>mF,createBigNumberClass:()=>ky,createBignumber:()=>A1,createBin:()=>pD,createBitAnd:()=>Uc,createBitAndTransform:()=>_O,createBitNot:()=>Wb,createBitOr:()=>zc,createBitOrTransform:()=>TO,createBitXor:()=>Hb,createBlockNode:()=>v2,createBohrMagneton:()=>m3,createBohrRadius:()=>y3,createBoltzmann:()=>P3,createBoolean:()=>N1,createCatalan:()=>hF,createCbrt:()=>X1,createCeil:()=>J1,createChain:()=>z_,createChainClass:()=>cA,createClassicalElectronRadius:()=>b3,createClone:()=>Zy,createColumn:()=>Yc,createColumnTransform:()=>rO,createCombinations:()=>NT,createCombinationsWithRep:()=>CT,createCompare:()=>rS,createCompareNatural:()=>aS,createCompareText:()=>sS,createCompile:()=>k2,createComplex:()=>E1,createComplexClass:()=>qy,createComposition:()=>gF,createConcat:()=>Vc,createConcatTransform:()=>dO,createConditionalNode:()=>g2,createConductanceQuantum:()=>d3,createConj:()=>Qb,createConstantNode:()=>S2,createCorr:()=>wT,createCos:()=>cN,createCosh:()=>mN,createCot:()=>hN,createCoth:()=>gN,createCoulomb:()=>c3,createCount:()=>uw,createCreateUnit:()=>qS,createCross:()=>lw,createCsc:()=>yN,createCsch:()=>wN,createCtranspose:()=>$w,createCube:()=>j1,createCumSum:()=>Ip,createCumSumTransform:()=>DO,createDeepEqual:()=>vS,createDenseMatrixClass:()=>Gy,createDerivative:()=>_F,createDet:()=>V_,createDeuteronMass:()=>E3,createDiag:()=>pw,createDiff:()=>Hc,createDiffTransform:()=>vO,createDistance:()=>fT,createDivide:()=>sT,createDivideScalar:()=>AD,createDot:()=>o2,createDotDivide:()=>qD,createDotMultiply:()=>Ib,createDotPow:()=>RD,createE:()=>GF,createEfimovFactor:()=>O3,createEigs:()=>X_,createElectricConstant:()=>f3,createElectronMass:()=>w3,createElementaryCharge:()=>p3,createEqual:()=>uS,createEqualScalar:()=>x1,createEqualText:()=>lS,createErf:()=>tD,createEvaluate:()=>L2,createExp:()=>rb,createExpm:()=>K_,createExpm1:()=>nb,createFactorial:()=>BT,createFalse:()=>UF,createFaraday:()=>k3,createFermiCoupling:()=>D3,createFft:()=>Jw,createFibonacciHeapClass:()=>CS,createFilter:()=>dw,createFilterTransform:()=>nO,createFineStructure:()=>S3,createFirstRadiation:()=>R3,createFix:()=>ib,createFlatten:()=>vw,createFloor:()=>kc,createForEach:()=>xw,createForEachTransform:()=>iO,createFormat:()=>lD,createFraction:()=>C1,createFractionClass:()=>Wy,createFreqz:()=>PF,createFunctionAssignmentNode:()=>N2,createFunctionNode:()=>O2,createGamma:()=>_T,createGasConstant:()=>q3,createGcd:()=>lb,createGetMatrixDataType:()=>bw,createGravitationConstant:()=>a3,createGravity:()=>Z3,createHartreeEnergy:()=>N3,createHasNumericValue:()=>u1,createHelp:()=>q_,createHelpClass:()=>lA,createHex:()=>vD,createHypot:()=>t2,createI:()=>e3,createIdentity:()=>Dw,createIfft:()=>jw,createIm:()=>Jb,createImmutableDenseMatrixClass:()=>NS,createIndex:()=>f2,createIndexClass:()=>ES,createIndexNode:()=>A2,createIndexTransform:()=>aO,createInfinity:()=>WF,createIntersect:()=>lT,createInv:()=>H_,createInverseConductanceQuantum:()=>h3,createInvmod:()=>Ob,createIsInteger:()=>Xy,createIsNaN:()=>d1,createIsNegative:()=>i1,createIsNumeric:()=>o1,createIsPositive:()=>l1,createIsPrime:()=>DD,createIsZero:()=>p1,createKldivergence:()=>PT,createKlitzing:()=>x3,createKron:()=>Nw,createLN10:()=>QF,createLN2:()=>ZF,createLOG10E:()=>JF,createLOG2E:()=>XF,createLarger:()=>mS,createLargerEq:()=>dS,createLcm:()=>pb,createLeafCount:()=>yF,createLeftShift:()=>QD,createLgamma:()=>FT,createLog:()=>FD,createLog10:()=>db,createLog1p:()=>BD,createLog2:()=>vb,createLoschmidt:()=>L3,createLsolve:()=>zD,createLsolveAll:()=>HD,createLup:()=>V2,createLusolve:()=>sA,createLyap:()=>oT,createMad:()=>vT,createMagneticConstant:()=>u3,createMagneticFluxQuantum:()=>v3,createMap:()=>Ew,createMapTransform:()=>sO,createMatrix:()=>_1,createMatrixClass:()=>Yy,createMatrixFromColumns:()=>P1,createMatrixFromFunction:()=>F1,createMatrixFromRows:()=>B1,createMax:()=>sp,createMaxTransform:()=>uO,createMean:()=>Pp,createMeanTransform:()=>fO,createMedian:()=>dT,createMin:()=>up,createMinTransform:()=>lO,createMod:()=>Rc,createMode:()=>oD,createMolarMass:()=>G3,createMolarMassC12:()=>$3,createMolarPlanckConstant:()=>U3,createMolarVolume:()=>z3,createMultinomial:()=>RT,createMultiply:()=>yb,createMultiplyScalar:()=>gb,createNaN:()=>VF,createNeutronMass:()=>C3,createNode:()=>l2,createNorm:()=>i2,createNot:()=>rw,createNthRoot:()=>wb,createNthRoots:()=>PD,createNuclearMagneton:()=>g3,createNull:()=>zF,createNumber:()=>b1,createNumeric:()=>SD,createObjectNode:()=>E2,createOct:()=>dD,createOnes:()=>Mw,createOperatorNode:()=>C2,createOr:()=>Wc,createOrTransform:()=>MO,createParenthesisNode:()=>M2,createParse:()=>I2,createParser:()=>z2,createParserClass:()=>q2,createPartitionSelect:()=>yS,createPermutations:()=>UT,createPhi:()=>$F,createPi:()=>YF,createPickRandom:()=>aF,createPinv:()=>$_,createPlanckCharge:()=>K3,createPlanckConstant:()=>o3,createPlanckLength:()=>Q3,createPlanckMass:()=>X3,createPlanckTemperature:()=>j3,createPlanckTime:()=>J3,createPolynomialRoot:()=>fA,createPow:()=>CD,createPrint:()=>Kc,createPrintTransform:()=>EO,createProd:()=>uD,createProtonMass:()=>A3,createQr:()=>H2,createQuantileSeq:()=>Rp,createQuantileSeqTransform:()=>bO,createQuantumOfCirculation:()=>M3,createRandom:()=>sF,createRandomInt:()=>fF,createRange:()=>Zc,createRangeClass:()=>Vy,createRangeNode:()=>_2,createRangeTransform:()=>cO,createRationalize:()=>FF,createRe:()=>jb,createReducedPlanckConstant:()=>s3,createRelationalNode:()=>T2,createReplacer:()=>RF,createReshape:()=>Fw,createResize:()=>Ow,createResolve:()=>AF,createResultSet:()=>wy,createReviver:()=>kF,createRightArithShift:()=>JD,createRightLogShift:()=>jD,createRotate:()=>Iw,createRotationMatrix:()=>kw,createRound:()=>_D,createRow:()=>Qc,createRowTransform:()=>pO,createRydberg:()=>_3,createSQRT1_2:()=>KF,createSQRT2:()=>jF,createSackurTetrode:()=>W3,createSchur:()=>iT,createSec:()=>SN,createSech:()=>AN,createSecondRadiation:()=>V3,createSetCartesian:()=>IN,createSetDifference:()=>kN,createSetDistinct:()=>LN,createSetIntersect:()=>UN,createSetIsSubset:()=>WN,createSetMultiplicity:()=>YN,createSetPowerset:()=>GN,createSetSize:()=>ZN,createSetSymDifference:()=>XN,createSetUnion:()=>KN,createSign:()=>Sb,createSimplify:()=>wF,createSimplifyConstant:()=>DF,createSimplifyCore:()=>NF,createSin:()=>CN,createSinh:()=>_N,createSize:()=>qw,createSlu:()=>aA,createSmaller:()=>cS,createSmallerEq:()=>pS,createSolveODE:()=>rD,createSort:()=>wS,createSpaClass:()=>MS,createSparse:()=>RS,createSparseMatrixClass:()=>y1,createSpeedOfLight:()=>i3,createSplitUnit:()=>R1,createSqrt:()=>Nb,createSqrtm:()=>eT,createSquare:()=>Eb,createSqueeze:()=>zw,createStd:()=>Lp,createStdTransform:()=>gO,createStefanBoltzmann:()=>Y3,createStirlingS2:()=>cF,createString:()=>D1,createSubset:()=>Xc,createSubsetTransform:()=>mO,createSubtract:()=>Mb,createSubtractScalar:()=>Z1,createSum:()=>Op,createSumTransform:()=>yO,createSylvester:()=>tT,createSymbolNode:()=>F2,createSymbolicEqual:()=>CF,createTan:()=>FN,createTanh:()=>ON,createTau:()=>HF,createThomsonCrossSection:()=>T3,createTo:()=>bD,createTrace:()=>s2,createTranspose:()=>Hw,createTrue:()=>qF,createTypeOf:()=>v1,createTyped:()=>by,createUnaryMinus:()=>q1,createUnaryPlus:()=>z1,createUnequal:()=>gS,createUnitClass:()=>BS,createUnitFunction:()=>PS,createUppercaseE:()=>t3,createUppercasePi:()=>r3,createUsolve:()=>VD,createUsolveAll:()=>$D,createVacuumImpedance:()=>l3,createVariance:()=>kp,createVarianceTransform:()=>NO,createVersion:()=>n3,createWeakMixingAngle:()=>F3,createWienDisplacement:()=>H3,createXgcd:()=>Tb,createXor:()=>iw,createZeros:()=>Qw,createZeta:()=>iD,createZpk2tf:()=>BF});var Vh=ci(mc(),1);function He(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}var di=Math.sign||function(e){return e>0?1:e<0?-1:0},Hx=Math.log2||function(r){return Math.log(r)/Math.LN2},Gx=Math.log10||function(r){return Math.log(r)/Math.LN10},dc=Math.log1p||function(e){return Math.log(e+1)},$x=Math.cbrt||function(r){if(r===0)return r;var t=r<0,n;return t&&(r=-r),isFinite(r)?(n=Math.exp(Math.log(r)/3),n=(r/(n*n)+2*n)/3):n=r,t?-n:n},Zx=Math.expm1||function(r){return r>=2e-4||r<=-2e-4?Math.exp(r)-1:r+r*r/2+r*r*r/6};function _h(e,r,t){var n={2:"0b",8:"0o",16:"0x"},i=n[r],a="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!He(t))throw new Error("size must be an integer");if(e>2**(t-1)-1||e<-(2**(t-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!He(e))throw new Error("Value must be an integer");e<0&&(e=e+2**t),a="i".concat(t)}var s="";return e<0&&(e=-e,s="-"),"".concat(s).concat(i).concat(e.toString(r)).concat(a)}function zi(e,r){if(typeof r=="function")return r(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:t,precision:n,wordSize:i}=Th(r);switch(t){case"fixed":return Fh(e,n);case"exponential":return Qx(e,n);case"engineering":return Z8(e,n);case"bin":return _h(e,2,i);case"oct":return _h(e,8,i);case"hex":return _h(e,16,i);case"auto":return Q8(e,n,r).replace(/((\\.\\d*?)(0+))($|e)/,function(){var a=arguments[2],s=arguments[4];return a!=="."?a+s:s});default:throw new Error('Unknown notation "'+t+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Th(e){var r="auto",t,n;if(e!==void 0)if(ar(e))t=e;else if(je(e))t=e.toNumber();else if(ua(e))e.precision!==void 0&&(t=Vx(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=Vx(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(r=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:r,precision:t,wordSize:n}}function $s(e){var r=String(e).toLowerCase().match(/^(-?)(\\d+\\.?\\d*)(e([+-]?\\d+))?$/);if(!r)throw new SyntaxError("Invalid number "+e);var t=r[1],n=r[2],i=parseFloat(r[4]||"0"),a=n.indexOf(".");i+=a!==-1?a-1:n.length-1;var s=n.replace(".","").replace(/^0*/,function(c){return i-=c.length,""}).replace(/0*$/,"").split("").map(function(c){return parseInt(c)});return s.length===0&&(s.push(0),i++),{sign:t,coefficients:s,exponent:i}}function Z8(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=$s(e),n=hc(t,r),i=n.exponent,a=n.coefficients,s=i%3===0?i:i<0?i-3-i%3:i-i%3;if(ar(r))for(;r>a.length||i-s+1>a.length;)a.push(0);else for(var c=Math.abs(i-s)-(a.length-1),f=0;f0;)u++,o--;var p=a.slice(u).join(""),d=ar(r)&&p.length||p.match(/[1-9]/)?"."+p:"",h=a.slice(0,u).join("")+d+"e"+(i>=0?"+":"")+s.toString();return n.sign+h}function Fh(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=$s(e),n=typeof r=="number"?hc(t,t.exponent+1+r):t,i=n.coefficients,a=n.exponent+1,s=a+(r||0);return i.length0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function Q8(e,r,t){if(isNaN(e)||!isFinite(e))return String(e);var n=Yx(t?.lowerExp,-3),i=Yx(t?.upperExp,5),a=$s(e),s=r?hc(a,r):a;if(s.exponent=i)return Qx(e,r);var c=s.coefficients,f=s.exponent;c.length0?f:0;return or){var i=n.splice(r,n.length-r);if(i[0]>=5){var a=r-1;for(n[a]++;n[a]===10;)n.pop(),a===0&&(n.unshift(0),t.exponent++,a++),a--,n[a]++}}return t}function Gs(e){for(var r=[],t=0;t0?!0:e<0?!1:1/e===1/0,n=r>0?!0:r<0?!1:1/r===1/0;return t^n?-e:e}function Vx(e,r){if(ar(e))return e;if(je(e))return e.toNumber();r()}function Yx(e,r){return ar(e)?e:je(e)?e.toNumber():r}function Oh(e,r,t){var n=e.constructor,i=new n(2),a="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!He(t))throw new Error("size must be an integer");if(e.greaterThan(i.pow(t-1).sub(1))||e.lessThan(i.pow(t-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(t))),a="i".concat(t)}switch(r){case 2:return"".concat(e.toBinary()).concat(a);case 8:return"".concat(e.toOctal()).concat(a);case 16:return"".concat(e.toHexadecimal()).concat(a);default:throw new Error("Base ".concat(r," not supported "))}}function iy(e,r){if(typeof r=="function")return r(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:t,precision:n,wordSize:i}=Th(r);switch(t){case"fixed":return K8(e,n);case"exponential":return ty(e,n);case"engineering":return J8(e,n);case"bin":return Oh(e,2,i);case"oct":return Oh(e,8,i);case"hex":return Oh(e,16,i);case"auto":{var a=ny(r?.lowerExp,-3),s=ny(r?.upperExp,5);if(e.isZero())return"0";var c,f=e.toSignificantDigits(n),o=f.e;return o>=a&&o=0?"+":"")+n.toString()}function ty(e,r){return r!==void 0?e.toExponential(r-1):e.toExponential()}function K8(e,r){return e.toFixed(r)}function ny(e,r){return ar(e)?e:je(e)?e.toNumber():r}function oy(e,r){var t=e.length-r.length,n=e.length;return e.substring(t,n)===r}function lr(e,r){var t=j8(e,r);return r&&typeof r=="object"&&"truncate"in r&&t.length>r.truncate?t.substring(0,r.truncate-3)+"...":t}function j8(e,r){if(typeof e=="number")return zi(e,r);if(je(e))return iy(e,r);if(ek(e))return!r||r.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return sy(e,r);if(yt(e))return Jo(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(r);if(e&&e.toString(r)!=={}.toString())return e.toString(r);var t=Object.keys(e).map(n=>Jo(n)+": "+lr(e[n],r));return"{"+t.join(", ")+"}"}return String(e)}function Jo(e){for(var r=String(e),t="",n=0;n/g,">"),r}function sy(e,r){if(Array.isArray(e)){for(var t="[",n=e.length,i=0;ir?1:-1}function pr(e,r,t){if(!(this instanceof pr))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=r,this.relation=t,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(r)?"["+r.join(", ")+"]":r)+")",this.stack=new Error().stack}pr.prototype=new RangeError;pr.prototype.constructor=RangeError;pr.prototype.name="DimensionError";pr.prototype.isDimensionError=!0;function Xt(e,r,t){if(!(this instanceof Xt))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=r):(this.min=r,this.max=t),this.min!==void 0&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}Xt.prototype=new RangeError;Xt.prototype.constructor=RangeError;Xt.prototype.name="IndexError";Xt.prototype.isIndexError=!0;function or(e){for(var r=[];Array.isArray(e);)r.push(e.length),e=e[0];return r}function uy(e,r,t){var n,i=e.length;if(i!==r[t])throw new pr(i,r[t]);if(t")}function Ih(e,r){var t=r.length===0;if(t){if(Array.isArray(e))throw new pr(e.length,0)}else uy(e,r,0)}function df(e,r){var t=e.isMatrix?e._size:or(e),n=r._sourceSize;n.forEach((i,a)=>{if(i!==null&&i!==t[a])throw new pr(i,t[a])})}function Xr(e,r){if(e!==void 0){if(!ar(e)||!He(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof r=="number"&&e>=r)throw new Xt(e,r)}}function Ko(e){for(var r=0;r=0,f=r%t===0;if(c)if(f)n[a]=-r/t;else throw new Error("Could not replace wildcard, since "+r+" is no multiple of "+-t);return n}function fy(e){return e.reduce((r,t)=>r*t,1)}function rk(e,r){for(var t=e,n,i=r.length-1;i>0;i--){var a=r[i];n=[];for(var s=t.length/a,c=0;cr.test(t))}function Ph(e,r){return Array.prototype.join.call(e,r)}function Ia(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;var r=[],t=0;r[0]={value:e[0],identifier:0};for(var n=1;n1)return e.slice(1).reduce(function(t,n){return py(t,n,r,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function tk(){for(var e=arguments.length,r=new Array(e),t=0;td.length),i=Math.max(...n),a=new Array(i).fill(null),s=0;sa[u]&&(a[u]=c[o])}for(var p=0;p1||e[i]>r[a])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(r[a]))}}function Lh(e,r){var t=or(e);if(Ui(t,r))return e;gf(t,r);var n=tk(t,r),i=n.length,a=[...Array(i-t.length).fill(1),...t],s=ik(e);t.length!ok(a)).every(a=>t[a]!==void 0);if(!n){var i=r.filter(a=>t[a]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(a=>'"'.concat(a,'"')).join(", "),"."))}}function ok(e){return e&&e[0]==="?"}function qh(e){return e&&e[0]==="?"?e.slice(1):e}function gt(e,r){if(vy(e)&&dy(e,r))return e[r];throw typeof e[r]=="function"&&wc(e,r)?new Error('Cannot access method "'+r+'" as a property'):new Error('No access to property "'+r+'"')}function la(e,r,t){if(vy(e)&&dy(e,r))return e[r]=t,t;throw new Error('No access to property "'+r+'"')}function my(e,r){return r in e}function dy(e,r){return!e||typeof e!="object"?!1:$e(sk,r)?!0:!(r in Object.prototype||r in Function.prototype)}function hy(e,r){if(!wc(e,r))throw new Error('No access to method "'+r+'"');return e[r]}function wc(e,r){return e==null||typeof e[r]!="function"||$e(e,r)&&Object.getPrototypeOf&&r in Object.getPrototypeOf(e)?!1:$e(uk,r)?!0:!(r in Object.prototype||r in Function.prototype)}function vy(e){return typeof e=="object"&&e&&e.constructor===Object}var sk={length:!0,name:!0},uk={toString:!0,valueOf:!0,toLocaleString:!0};var es=class{constructor(r){this.wrappedObject=r,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(r){return gt(this.wrappedObject,r)}set(r,t){return la(this.wrappedObject,r,t),this}has(r){return my(this.wrappedObject,r)}entries(){return gy(this.keys(),r=>[r,this.get(r)])}forEach(r){for(var t of this.keys())r(this.get(t),t,this)}delete(r){delete this.wrappedObject[r]}clear(){for(var r of this.keys())this.delete(r)}get size(){return Object.keys(this.wrappedObject).length}},Js=class{constructor(r,t,n){this.a=r,this.b=t,this.bKeys=n,this[Symbol.iterator]=this.entries}get(r){return this.bKeys.has(r)?this.b.get(r):this.a.get(r)}set(r,t){return this.bKeys.has(r)?this.b.set(r,t):this.a.set(r,t),this}has(r){return this.b.has(r)||this.a.has(r)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return gy(this.keys(),r=>[r,this.get(r)])}forEach(r){for(var t of this.keys())r(this.get(t),t,this)}delete(r){return this.bKeys.has(r)?this.b.delete(r):this.a.delete(r)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}};function gy(e,r){return{next:()=>{var t=e.next();return t.done?t:{value:r(t.value),done:!1}}}}function ho(){return new Map}function Pa(e){if(!e)return ho();if(Uh(e))return e;if(ua(e))return new es(e);throw new Error("createMap can create maps from objects or Maps")}function xy(e){if(e instanceof es)return e.wrappedObject;var r={};for(var t of e.keys()){var n=e.get(t);la(r,t,n)}return r}function Uh(e){return e?e instanceof Map||e instanceof es||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var yy=function(){return yy=Vh.default.create,Vh.default},fk=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],by=T("typed",fk,function(r){var{BigNumber:t,Complex:n,DenseMatrix:i,Fraction:a}=r,s=yy();return s.clear(),s.addTypes([{name:"number",test:ar},{name:"Complex",test:Gt},{name:"BigNumber",test:je},{name:"Fraction",test:Xn},{name:"Unit",test:qt},{name:"identifier",test:c=>yt&&/^(?:[A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF40\\uDF42-\\uDF49\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDD70-\\uDD7A\\uDD7C-\\uDD8A\\uDD8C-\\uDD92\\uDD94\\uDD95\\uDD97-\\uDDA1\\uDDA3-\\uDDB1\\uDDB3-\\uDDB9\\uDDBB\\uDDBC\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67\\uDF80-\\uDF85\\uDF87-\\uDFB0\\uDFB2-\\uDFBA]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD23\\uDE80-\\uDEA9\\uDEB0\\uDEB1\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF45\\uDF70-\\uDF81\\uDFB0-\\uDFC4\\uDFE0-\\uDFF6]|\\uD804[\\uDC03-\\uDC37\\uDC71\\uDC72\\uDC75\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD44\\uDD47\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE3F\\uDE40\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC5F-\\uDC61\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-\\uDD52\\uDD55\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD837[\\uDF00-\\uDF1E\\uDF25-\\uDF2A]|\\uD838[\\uDC30-\\uDC6D\\uDD00-\\uDD2C\\uDD37-\\uDD3D\\uDD4E\\uDE90-\\uDEAD\\uDEC0-\\uDEEB]|\\uD839[\\uDCD0-\\uDCEB\\uDFE0-\\uDFE6\\uDFE8-\\uDFEB\\uDFED\\uDFEE\\uDFF0-\\uDFFE]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43\\uDD4B]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])(?:[0-9A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF40\\uDF42-\\uDF49\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDD70-\\uDD7A\\uDD7C-\\uDD8A\\uDD8C-\\uDD92\\uDD94\\uDD95\\uDD97-\\uDDA1\\uDDA3-\\uDDB1\\uDDB3-\\uDDB9\\uDDBB\\uDDBC\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67\\uDF80-\\uDF85\\uDF87-\\uDFB0\\uDFB2-\\uDFBA]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD23\\uDE80-\\uDEA9\\uDEB0\\uDEB1\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF45\\uDF70-\\uDF81\\uDFB0-\\uDFC4\\uDFE0-\\uDFF6]|\\uD804[\\uDC03-\\uDC37\\uDC71\\uDC72\\uDC75\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD44\\uDD47\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE3F\\uDE40\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC5F-\\uDC61\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-\\uDD52\\uDD55\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD837[\\uDF00-\\uDF1E\\uDF25-\\uDF2A]|\\uD838[\\uDC30-\\uDC6D\\uDD00-\\uDD2C\\uDD37-\\uDD3D\\uDD4E\\uDE90-\\uDEAD\\uDEC0-\\uDEEB]|\\uD839[\\uDCD0-\\uDCEB\\uDFE0-\\uDFE6\\uDFE8-\\uDFEB\\uDFED\\uDFEE\\uDFF0-\\uDFFE]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43\\uDD4B]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])*$/.test(c)},{name:"string",test:yt},{name:"Chain",test:Vs},{name:"Array",test:Ar},{name:"Matrix",test:Ge},{name:"DenseMatrix",test:Ba},{name:"SparseMatrix",test:Jn},{name:"Range",test:co},{name:"Index",test:sa},{name:"boolean",test:ec},{name:"ResultSet",test:rc},{name:"Help",test:Ws},{name:"function",test:tc},{name:"Date",test:nc},{name:"RegExp",test:ic},{name:"null",test:ac},{name:"undefined",test:oc},{name:"AccessorNode",test:Sn},{name:"ArrayNode",test:$t},{name:"AssignmentNode",test:sc},{name:"BlockNode",test:uc},{name:"ConditionalNode",test:fc},{name:"ConstantNode",test:yr},{name:"FunctionNode",test:fn},{name:"FunctionAssignmentNode",test:mi},{name:"IndexNode",test:kn},{name:"Node",test:Sr},{name:"ObjectNode",test:fa},{name:"OperatorNode",test:ut},{name:"ParenthesisNode",test:Zt},{name:"RangeNode",test:lc},{name:"RelationalNode",test:cc},{name:"SymbolNode",test:rt},{name:"Map",test:Uh},{name:"Object",test:ua}]),s.addConversions([{from:"number",to:"BigNumber",convert:function(f){if(t||zh(f),Xx(f)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+f+"). Use function bignumber(x) to convert to BigNumber.");return new t(f)}},{from:"number",to:"Complex",convert:function(f){return n||Dc(f),new n(f,0)}},{from:"BigNumber",to:"Complex",convert:function(f){return n||Dc(f),new n(f.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(f){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(f){return n||Dc(f),new n(f.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(f){a||Wh(f);var o=new a(f);if(o.valueOf()!==f)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+f+"). Use function fraction(x) to convert to Fraction.");return o}},{from:"string",to:"number",convert:function(f){var o=Number(f);if(isNaN(o))throw new Error('Cannot convert "'+f+'" to a number');return o}},{from:"string",to:"BigNumber",convert:function(f){t||zh(f);try{return new t(f)}catch{throw new Error('Cannot convert "'+f+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(f){a||Wh(f);try{return new a(f)}catch{throw new Error('Cannot convert "'+f+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(f){n||Dc(f);try{return new n(f)}catch{throw new Error('Cannot convert "'+f+'" to Complex')}}},{from:"boolean",to:"number",convert:function(f){return+f}},{from:"boolean",to:"BigNumber",convert:function(f){return t||zh(f),new t(+f)}},{from:"boolean",to:"Fraction",convert:function(f){return a||Wh(f),new a(+f)}},{from:"boolean",to:"string",convert:function(f){return String(f)}},{from:"Array",to:"Matrix",convert:function(f){return i||lk(),new i(f)}},{from:"Matrix",to:"Array",convert:function(f){return f.valueOf()}}]),s.onMismatch=(c,f,o)=>{var u=s.createError(c,f,o);if(["wrongType","mismatch"].includes(u.data.category)&&f.length===1&&bt(f[0])&&o.some(d=>!d.params.includes(","))){var p=new TypeError("Function '".concat(c,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(c,")'."));throw p.data=u.data,p}throw u},s.onMismatch=(c,f,o)=>{var u=s.createError(c,f,o);if(["wrongType","mismatch"].includes(u.data.category)&&f.length===1&&bt(f[0])&&o.some(d=>!d.params.includes(","))){var p=new TypeError("Function '".concat(c,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(c,")'."));throw p.data=u.data,p}throw u},s});function zh(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Dc(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function lk(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Wh(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var ck="ResultSet",pk=[],wy=T(ck,pk,()=>{function e(r){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=r||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(r){return new e(r.entries)},e},{isClass:!0});var Ks=9e15,yo=1e9,Yh="0123456789abcdef",Nc="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ac="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Hh={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Ks,maxE:Ks,crypto:!1},Ay,ka,Er=!0,Cc="[DecimalError] ",xo=Cc+"Invalid argument: ",Ey=Cc+"Precision limit exceeded",Cy=Cc+"crypto unavailable",My="[object Decimal]",mn=Math.floor,Jt=Math.pow,mk=/^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,dk=/^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,hk=/^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,_y=/^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,Yi=1e7,br=7,vk=9007199254740991,gk=Nc.length-1,Gh=Ac.length-1,Ue={toStringTag:My};Ue.absoluteValue=Ue.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),hr(e)};Ue.ceil=function(){return hr(new this.constructor(this),this.e+1,2)};Ue.clampedTo=Ue.clamp=function(e,r){var t,n=this,i=n.constructor;if(e=new i(e),r=new i(r),!e.s||!r.s)return new i(NaN);if(e.gt(r))throw Error(xo+r);return t=n.cmp(e),t<0?e:n.cmp(r)>0?r:new i(n)};Ue.comparedTo=Ue.cmp=function(e){var r,t,n,i,a=this,s=a.d,c=(e=new a.constructor(e)).d,f=a.s,o=e.s;if(!s||!c)return!f||!o?NaN:f!==o?f:s===c?0:!s^f<0?1:-1;if(!s[0]||!c[0])return s[0]?f:c[0]?-o:0;if(f!==o)return f;if(a.e!==e.e)return a.e>e.e^f<0?1:-1;for(n=s.length,i=c.length,r=0,t=nc[r]^f<0?1:-1;return n===i?0:n>i^f<0?1:-1};Ue.cosine=Ue.cos=function(){var e,r,t=this,n=t.constructor;return t.d?t.d[0]?(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+br,n.rounding=1,t=xk(n,Iy(n,t)),n.precision=e,n.rounding=r,hr(ka==2||ka==3?t.neg():t,e,r,!0)):new n(1):new n(NaN)};Ue.cubeRoot=Ue.cbrt=function(){var e,r,t,n,i,a,s,c,f,o,u=this,p=u.constructor;if(!u.isFinite()||u.isZero())return new p(u);for(Er=!1,a=u.s*Jt(u.s*u,1/3),!a||Math.abs(a)==1/0?(t=ln(u.d),e=u.e,(a=(e-t.length+1)%3)&&(t+=a==1||a==-2?"0":"00"),a=Jt(t,1/3),e=mn((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new p(t),n.s=u.s):n=new p(a.toString()),s=(e=p.precision)+3;;)if(c=n,f=c.times(c).times(c),o=f.plus(u),n=xt(o.plus(u).times(c),o.plus(f),s+2,1),ln(c.d).slice(0,s)===(t=ln(n.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!i&&t=="4999"){if(!i&&(hr(c,e+1,0),c.times(c).times(c).eq(u))){n=c;break}s+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(hr(n,e+1,1),r=!n.times(n).times(n).eq(u));break}return Er=!0,hr(n,e,p.rounding,r)};Ue.decimalPlaces=Ue.dp=function(){var e,r=this.d,t=NaN;if(r){if(e=r.length-1,t=(e-mn(this.e/br))*br,e=r[e],e)for(;e%10==0;e/=10)t--;t<0&&(t=0)}return t};Ue.dividedBy=Ue.div=function(e){return xt(this,new this.constructor(e))};Ue.dividedToIntegerBy=Ue.divToInt=function(e){var r=this,t=r.constructor;return hr(xt(r,new t(e),0,1,1),t.precision,t.rounding)};Ue.equals=Ue.eq=function(e){return this.cmp(e)===0};Ue.floor=function(){return hr(new this.constructor(this),this.e+1,3)};Ue.greaterThan=Ue.gt=function(e){return this.cmp(e)>0};Ue.greaterThanOrEqualTo=Ue.gte=function(e){var r=this.cmp(e);return r==1||r===0};Ue.hyperbolicCosine=Ue.cosh=function(){var e,r,t,n,i,a=this,s=a.constructor,c=new s(1);if(!a.isFinite())return new s(a.s?1/0:NaN);if(a.isZero())return c;t=s.precision,n=s.rounding,s.precision=t+Math.max(a.e,a.sd())+4,s.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),r=(1/_c(4,e)).toString()):(e=16,r="2.3283064365386962890625e-10"),a=js(s,1,a.times(r),new s(1),!0);for(var f,o=e,u=new s(8);o--;)f=a.times(a),a=c.minus(f.times(u.minus(f.times(u))));return hr(a,s.precision=t,s.rounding=n,!0)};Ue.hyperbolicSine=Ue.sinh=function(){var e,r,t,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(r=a.precision,t=a.rounding,a.precision=r+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<3)i=js(a,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/_c(5,e)),i=js(a,2,i,i,!0);for(var s,c=new a(5),f=new a(16),o=new a(20);e--;)s=i.times(i),i=i.times(c.plus(s.times(f.times(s).plus(o))))}return a.precision=r,a.rounding=t,hr(i,r,t,!0)};Ue.hyperbolicTangent=Ue.tanh=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+7,n.rounding=1,xt(t.sinh(),t.cosh(),n.precision=e,n.rounding=r)):new n(t.s)};Ue.inverseCosine=Ue.acos=function(){var e,r=this,t=r.constructor,n=r.abs().cmp(1),i=t.precision,a=t.rounding;return n!==-1?n===0?r.isNeg()?Vi(t,i,a):new t(0):new t(NaN):r.isZero()?Vi(t,i+4,a).times(.5):(t.precision=i+6,t.rounding=1,r=r.asin(),e=Vi(t,i+4,a).times(.5),t.precision=i,t.rounding=a,e.minus(r))};Ue.inverseHyperbolicCosine=Ue.acosh=function(){var e,r,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(e=n.precision,r=n.rounding,n.precision=e+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,Er=!1,t=t.times(t).minus(1).sqrt().plus(t),Er=!0,n.precision=e,n.rounding=r,t.ln()):new n(t)};Ue.inverseHyperbolicSine=Ue.asinh=function(){var e,r,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,Er=!1,t=t.times(t).plus(1).sqrt().plus(t),Er=!0,n.precision=e,n.rounding=r,t.ln())};Ue.inverseHyperbolicTangent=Ue.atanh=function(){var e,r,t,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,r=a.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?hr(new a(i),e,r,!0):(a.precision=t=n-i.e,i=xt(i.plus(1),new a(1).minus(i),t+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=r,i.times(.5))):new a(NaN)};Ue.inverseSine=Ue.asin=function(){var e,r,t,n,i=this,a=i.constructor;return i.isZero()?new a(i):(r=i.abs().cmp(1),t=a.precision,n=a.rounding,r!==-1?r===0?(e=Vi(a,t+4,n).times(.5),e.s=i.s,e):new a(NaN):(a.precision=t+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=t,a.rounding=n,i.times(2)))};Ue.inverseTangent=Ue.atan=function(){var e,r,t,n,i,a,s,c,f,o=this,u=o.constructor,p=u.precision,d=u.rounding;if(o.isFinite()){if(o.isZero())return new u(o);if(o.abs().eq(1)&&p+4<=Gh)return s=Vi(u,p+4,d).times(.25),s.s=o.s,s}else{if(!o.s)return new u(NaN);if(p+4<=Gh)return s=Vi(u,p+4,d).times(.5),s.s=o.s,s}for(u.precision=c=p+10,u.rounding=1,t=Math.min(28,c/br+2|0),e=t;e;--e)o=o.div(o.times(o).plus(1).sqrt().plus(1));for(Er=!1,r=Math.ceil(c/br),n=1,f=o.times(o),s=new u(o),i=o;e!==-1;)if(i=i.times(f),a=s.minus(i.div(n+=2)),i=i.times(f),s=a.plus(i.div(n+=2)),s.d[r]!==void 0)for(e=r;s.d[e]===a.d[e]&&e--;);return t&&(s=s.times(2<this.d.length-2};Ue.isNaN=function(){return!this.s};Ue.isNegative=Ue.isNeg=function(){return this.s<0};Ue.isPositive=Ue.isPos=function(){return this.s>0};Ue.isZero=function(){return!!this.d&&this.d[0]===0};Ue.lessThan=Ue.lt=function(e){return this.cmp(e)<0};Ue.lessThanOrEqualTo=Ue.lte=function(e){return this.cmp(e)<1};Ue.logarithm=Ue.log=function(e){var r,t,n,i,a,s,c,f,o=this,u=o.constructor,p=u.precision,d=u.rounding,h=5;if(e==null)e=new u(10),r=!0;else{if(e=new u(e),t=e.d,e.s<0||!t||!t[0]||e.eq(1))return new u(NaN);r=e.eq(10)}if(t=o.d,o.s<0||!t||!t[0]||o.eq(1))return new u(t&&!t[0]?-1/0:o.s!=1?NaN:t?0:1/0);if(r)if(t.length>1)a=!0;else{for(i=t[0];i%10===0;)i/=10;a=i!==1}if(Er=!1,c=p+h,s=go(o,c),n=r?Ec(u,c+10):go(e,c),f=xt(s,n,c,1),xf(f.d,i=p,d))do if(c+=10,s=go(o,c),n=r?Ec(u,c+10):go(e,c),f=xt(s,n,c,1),!a){+ln(f.d).slice(i+1,i+15)+1==1e14&&(f=hr(f,p+1,0));break}while(xf(f.d,i+=10,d));return Er=!0,hr(f,p,d)};Ue.minus=Ue.sub=function(e){var r,t,n,i,a,s,c,f,o,u,p,d,h=this,x=h.constructor;if(e=new x(e),!h.d||!e.d)return!h.s||!e.s?e=new x(NaN):h.d?e.s=-e.s:e=new x(e.d||h.s!==e.s?h:NaN),e;if(h.s!=e.s)return e.s=-e.s,h.plus(e);if(o=h.d,d=e.d,c=x.precision,f=x.rounding,!o[0]||!d[0]){if(d[0])e.s=-e.s;else if(o[0])e=new x(h);else return new x(f===3?-0:0);return Er?hr(e,c,f):e}if(t=mn(e.e/br),u=mn(h.e/br),o=o.slice(),a=u-t,a){for(p=a<0,p?(r=o,a=-a,s=d.length):(r=d,t=u,s=o.length),n=Math.max(Math.ceil(c/br),s)+2,a>n&&(a=n,r.length=1),r.reverse(),n=a;n--;)r.push(0);r.reverse()}else{for(n=o.length,s=d.length,p=n0;--n)o[s++]=0;for(n=d.length;n>a;){if(o[--n]s?a+1:s+1,i>s&&(i=s,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for(s=o.length,i=u.length,s-i<0&&(i=s,t=u,u=o,o=t),r=0;i;)r=(o[--i]=o[i]+u[i]+r)/Yi|0,o[i]%=Yi;for(r&&(o.unshift(r),++n),s=o.length;o[--s]==0;)o.pop();return e.d=o,e.e=Mc(o,n),Er?hr(e,c,f):e};Ue.precision=Ue.sd=function(e){var r,t=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(xo+e);return t.d?(r=Ty(t.d),e&&t.e+1>r&&(r=t.e+1)):r=NaN,r};Ue.round=function(){var e=this,r=e.constructor;return hr(new r(e),e.e+1,r.rounding)};Ue.sine=Ue.sin=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+br,n.rounding=1,t=bk(n,Iy(n,t)),n.precision=e,n.rounding=r,hr(ka>2?t.neg():t,e,r,!0)):new n(NaN)};Ue.squareRoot=Ue.sqrt=function(){var e,r,t,n,i,a,s=this,c=s.d,f=s.e,o=s.s,u=s.constructor;if(o!==1||!c||!c[0])return new u(!o||o<0&&(!c||c[0])?NaN:c?s:1/0);for(Er=!1,o=Math.sqrt(+s),o==0||o==1/0?(r=ln(c),(r.length+f)%2==0&&(r+="0"),o=Math.sqrt(r),f=mn((f+1)/2)-(f<0||f%2),o==1/0?r="5e"+f:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+f),n=new u(r)):n=new u(o.toString()),t=(f=u.precision)+3;;)if(a=n,n=a.plus(xt(s,a,t+2,1)).times(.5),ln(a.d).slice(0,t)===(r=ln(n.d)).slice(0,t))if(r=r.slice(t-3,t+1),r=="9999"||!i&&r=="4999"){if(!i&&(hr(a,f+1,0),a.times(a).eq(s))){n=a;break}t+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(hr(n,f+1,1),e=!n.times(n).eq(s));break}return Er=!0,hr(n,f,u.rounding,e)};Ue.tangent=Ue.tan=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+10,n.rounding=1,t=t.sin(),t.s=1,t=xt(t,new n(1).minus(t.times(t)).sqrt(),e+10,0),n.precision=e,n.rounding=r,hr(ka==2||ka==4?t.neg():t,e,r,!0)):new n(NaN)};Ue.times=Ue.mul=function(e){var r,t,n,i,a,s,c,f,o,u=this,p=u.constructor,d=u.d,h=(e=new p(e)).d;if(e.s*=u.s,!d||!d[0]||!h||!h[0])return new p(!e.s||d&&!d[0]&&!h||h&&!h[0]&&!d?NaN:!d||!h?e.s/0:e.s*0);for(t=mn(u.e/br)+mn(e.e/br),f=d.length,o=h.length,f=0;){for(r=0,i=f+n;i>n;)c=a[i]+h[n]*d[i-n-1]+r,a[i--]=c%Yi|0,r=c/Yi|0;a[i]=(a[i]+r)%Yi|0}for(;!a[--s];)a.pop();return r?++t:a.shift(),e.d=a,e.e=Mc(a,t),Er?hr(e,p.precision,p.rounding):e};Ue.toBinary=function(e,r){return Qh(this,2,e,r)};Ue.toDecimalPlaces=Ue.toDP=function(e,r){var t=this,n=t.constructor;return t=new n(t),e===void 0?t:(Ln(e,0,yo),r===void 0?r=n.rounding:Ln(r,0,8),hr(t,e+t.e+1,r))};Ue.toExponential=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=ca(n,!0):(Ln(e,0,yo),r===void 0?r=i.rounding:Ln(r,0,8),n=hr(new i(n),e+1,r),t=ca(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+t:t};Ue.toFixed=function(e,r){var t,n,i=this,a=i.constructor;return e===void 0?t=ca(i):(Ln(e,0,yo),r===void 0?r=a.rounding:Ln(r,0,8),n=hr(new a(i),e+i.e+1,r),t=ca(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t};Ue.toFraction=function(e){var r,t,n,i,a,s,c,f,o,u,p,d,h=this,x=h.d,v=h.constructor;if(!x)return new v(h);if(o=t=new v(1),n=f=new v(0),r=new v(n),a=r.e=Ty(x)-h.e-1,s=a%br,r.d[0]=Jt(10,s<0?br+s:s),e==null)e=a>0?r:o;else{if(c=new v(e),!c.isInt()||c.lt(o))throw Error(xo+c);e=c.gt(r)?a>0?r:o:c}for(Er=!1,c=new v(ln(x)),u=v.precision,v.precision=a=x.length*br*2;p=xt(c,r,0,1,1),i=t.plus(p.times(n)),i.cmp(e)!=1;)t=n,n=i,i=o,o=f.plus(p.times(i)),f=i,i=r,r=c.minus(p.times(i)),c=i;return i=xt(e.minus(t),n,0,1,1),f=f.plus(i.times(o)),t=t.plus(i.times(n)),f.s=o.s=h.s,d=xt(o,n,a,1).minus(h).abs().cmp(xt(f,t,a,1).minus(h).abs())<1?[o,n]:[f,t],v.precision=u,Er=!0,d};Ue.toHexadecimal=Ue.toHex=function(e,r){return Qh(this,16,e,r)};Ue.toNearest=function(e,r){var t=this,n=t.constructor;if(t=new n(t),e==null){if(!t.d)return t;e=new n(1),r=n.rounding}else{if(e=new n(e),r===void 0?r=n.rounding:Ln(r,0,8),!t.d)return e.s?t:e;if(!e.d)return e.s&&(e.s=t.s),e}return e.d[0]?(Er=!1,t=xt(t,e,0,r,1).times(e),Er=!0,hr(t)):(e.s=t.s,t=e),t};Ue.toNumber=function(){return+this};Ue.toOctal=function(e,r){return Qh(this,8,e,r)};Ue.toPower=Ue.pow=function(e){var r,t,n,i,a,s,c=this,f=c.constructor,o=+(e=new f(e));if(!c.d||!e.d||!c.d[0]||!e.d[0])return new f(Jt(+c,o));if(c=new f(c),c.eq(1))return c;if(n=f.precision,a=f.rounding,e.eq(1))return hr(c,n,a);if(r=mn(e.e/br),r>=e.d.length-1&&(t=o<0?-o:o)<=vk)return i=Fy(f,c,t,n),e.s<0?new f(1).div(i):hr(i,n,a);if(s=c.s,s<0){if(rf.maxE+1||r0?s/0:0):(Er=!1,f.rounding=c.s=1,t=Math.min(12,(r+"").length),i=$h(e.times(go(c,n+t)),n),i.d&&(i=hr(i,n+5,1),xf(i.d,n,a)&&(r=n+10,i=hr($h(e.times(go(c,r+t)),r),r+5,1),+ln(i.d).slice(n+1,n+15)+1==1e14&&(i=hr(i,n+1,0)))),i.s=s,Er=!0,f.rounding=a,hr(i,n,a))};Ue.toPrecision=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=ca(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Ln(e,1,yo),r===void 0?r=i.rounding:Ln(r,0,8),n=hr(new i(n),e,r),t=ca(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+t:t};Ue.toSignificantDigits=Ue.toSD=function(e,r){var t=this,n=t.constructor;return e===void 0?(e=n.precision,r=n.rounding):(Ln(e,1,yo),r===void 0?r=n.rounding:Ln(r,0,8)),hr(new n(t),e,r)};Ue.toString=function(){var e=this,r=e.constructor,t=ca(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()&&!e.isZero()?"-"+t:t};Ue.truncated=Ue.trunc=function(){return hr(new this.constructor(this),this.e+1,1)};Ue.valueOf=Ue.toJSON=function(){var e=this,r=e.constructor,t=ca(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()?"-"+t:t};function ln(e){var r,t,n,i=e.length-1,a="",s=e[0];if(i>0){for(a+=s,r=1;rt)throw Error(xo+e)}function xf(e,r,t,n){var i,a,s,c;for(a=e[0];a>=10;a/=10)--r;return--r<0?(r+=br,i=0):(i=Math.ceil((r+1)/br),r%=br),a=Jt(10,br-r),c=e[i]%a|0,n==null?r<3?(r==0?c=c/100|0:r==1&&(c=c/10|0),s=t<4&&c==99999||t>3&&c==49999||c==5e4||c==0):s=(t<4&&c+1==a||t>3&&c+1==a/2)&&(e[i+1]/a/100|0)==Jt(10,r-2)-1||(c==a/2||c==0)&&(e[i+1]/a/100|0)==0:r<4?(r==0?c=c/1e3|0:r==1?c=c/100|0:r==2&&(c=c/10|0),s=(n||t<4)&&c==9999||!n&&t>3&&c==4999):s=((n||t<4)&&c+1==a||!n&&t>3&&c+1==a/2)&&(e[i+1]/a/1e3|0)==Jt(10,r-3)-1,s}function Sc(e,r,t){for(var n,i=[0],a,s=0,c=e.length;st-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/t|0,i[n]%=t)}return i.reverse()}function xk(e,r){var t,n,i;if(r.isZero())return r;n=r.d.length,n<32?(t=Math.ceil(n/3),i=(1/_c(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),e.precision+=t,r=js(e,1,r.times(i),new e(1));for(var a=t;a--;){var s=r.times(r);r=s.times(s).minus(s).times(8).plus(1)}return e.precision-=t,r}var xt=function(){function e(n,i,a){var s,c=0,f=n.length;for(n=n.slice();f--;)s=n[f]*i+c,n[f]=s%a|0,c=s/a|0;return c&&n.unshift(c),n}function r(n,i,a,s){var c,f;if(a!=s)f=a>s?1:-1;else for(c=f=0;ci[c]?1:-1;break}return f}function t(n,i,a,s){for(var c=0;a--;)n[a]-=c,c=n[a]1;)n.shift()}return function(n,i,a,s,c,f){var o,u,p,d,h,x,v,y,w,C,b,A,E,S,O,F,M,_,k,L,Y=n.constructor,$=n.s==i.s?1:-1,V=n.d,q=i.d;if(!V||!V[0]||!q||!q[0])return new Y(!n.s||!i.s||(V?q&&V[0]==q[0]:!q)?NaN:V&&V[0]==0||!q?$*0:$/0);for(f?(h=1,u=n.e-i.e):(f=Yi,h=br,u=mn(n.e/h)-mn(i.e/h)),k=q.length,M=V.length,w=new Y($),C=w.d=[],p=0;q[p]==(V[p]||0);p++);if(q[p]>(V[p]||0)&&u--,a==null?(S=a=Y.precision,s=Y.rounding):c?S=a+(n.e-i.e)+1:S=a,S<0)C.push(1),x=!0;else{if(S=S/h+2|0,p=0,k==1){for(d=0,q=q[0],S++;(p1&&(q=e(q,d,f),V=e(V,d,f),k=q.length,M=V.length),F=k,b=V.slice(0,k),A=b.length;A=f/2&&++_;do d=0,o=r(q,b,k,A),o<0?(E=b[0],k!=A&&(E=E*f+(b[1]||0)),d=E/_|0,d>1?(d>=f&&(d=f-1),v=e(q,d,f),y=v.length,A=b.length,o=r(v,b,y,A),o==1&&(d--,t(v,k=10;d/=10)p++;w.e=p+u*h-1,hr(w,c?a+w.e+1:a,s,x)}return w}}();function hr(e,r,t,n){var i,a,s,c,f,o,u,p,d,h=e.constructor;e:if(r!=null){if(p=e.d,!p)return e;for(i=1,c=p[0];c>=10;c/=10)i++;if(a=r-i,a<0)a+=br,s=r,u=p[d=0],f=u/Jt(10,i-s-1)%10|0;else if(d=Math.ceil((a+1)/br),c=p.length,d>=c)if(n){for(;c++<=d;)p.push(0);u=f=0,i=1,a%=br,s=a-br+1}else break e;else{for(u=c=p[d],i=1;c>=10;c/=10)i++;a%=br,s=a-br+i,f=s<0?0:u/Jt(10,i-s-1)%10|0}if(n=n||r<0||p[d+1]!==void 0||(s<0?u:u%Jt(10,i-s-1)),o=t<4?(f||n)&&(t==0||t==(e.s<0?3:2)):f>5||f==5&&(t==4||n||t==6&&(a>0?s>0?u/Jt(10,i-s):0:p[d-1])%10&1||t==(e.s<0?8:7)),r<1||!p[0])return p.length=0,o?(r-=e.e+1,p[0]=Jt(10,(br-r%br)%br),e.e=-r||0):p[0]=e.e=0,e;if(a==0?(p.length=d,c=1,d--):(p.length=d+1,c=Jt(10,br-a),p[d]=s>0?(u/Jt(10,i-s)%Jt(10,s)|0)*c:0),o)for(;;)if(d==0){for(a=1,s=p[0];s>=10;s/=10)a++;for(s=p[0]+=c,c=1;s>=10;s/=10)c++;a!=c&&(e.e++,p[0]==Yi&&(p[0]=1));break}else{if(p[d]+=c,p[d]!=Yi)break;p[d--]=0,c=1}for(a=p.length;p[--a]===0;)p.pop()}return Er&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e0?a=a.charAt(0)+"."+a.slice(1)+vo(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+vo(-i-1)+a,t&&(n=t-s)>0&&(a+=vo(n))):i>=s?(a+=vo(i+1-s),t&&(n=t-i-1)>0&&(a=a+"."+vo(n))):((n=i+1)0&&(i+1===s&&(a+="."),a+=vo(n))),a}function Mc(e,r){var t=e[0];for(r*=br;t>=10;t/=10)r++;return r}function Ec(e,r,t){if(r>gk)throw Er=!0,t&&(e.precision=t),Error(Ey);return hr(new e(Nc),r,1,!0)}function Vi(e,r,t){if(r>Gh)throw Error(Ey);return hr(new e(Ac),r,t,!0)}function Ty(e){var r=e.length-1,t=r*br+1;if(r=e[r],r){for(;r%10==0;r/=10)t--;for(r=e[0];r>=10;r/=10)t++}return t}function vo(e){for(var r="";e--;)r+="0";return r}function Fy(e,r,t,n){var i,a=new e(1),s=Math.ceil(n/br+4);for(Er=!1;;){if(t%2&&(a=a.times(r),Sy(a.d,s)&&(i=!0)),t=mn(t/2),t===0){t=a.d.length-1,i&&a.d[t]===0&&++a.d[t];break}r=r.times(r),Sy(r.d,s)}return Er=!0,a}function Dy(e){return e.d[e.d.length-1]&1}function Oy(e,r,t){for(var n,i=new e(r[0]),a=0;++a17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(r==null?(Er=!1,f=x):f=r,c=new d(.03125);e.e>-2;)e=e.times(c),p+=5;for(n=Math.log(Jt(2,p))/Math.LN10*2+5|0,f+=n,t=a=s=new d(1),d.precision=f;;){if(a=hr(a.times(e),f,1),t=t.times(++u),c=s.plus(xt(a,t,f,1)),ln(c.d).slice(0,f)===ln(s.d).slice(0,f)){for(i=p;i--;)s=hr(s.times(s),f,1);if(r==null)if(o<3&&xf(s.d,f-n,h,o))d.precision=f+=10,t=a=c=new d(1),u=0,o++;else return hr(s,d.precision=x,h,Er=!0);else return d.precision=x,s}s=c}}function go(e,r){var t,n,i,a,s,c,f,o,u,p,d,h=1,x=10,v=e,y=v.d,w=v.constructor,C=w.rounding,b=w.precision;if(v.s<0||!y||!y[0]||!v.e&&y[0]==1&&y.length==1)return new w(y&&!y[0]?-1/0:v.s!=1?NaN:y?0:v);if(r==null?(Er=!1,u=b):u=r,w.precision=u+=x,t=ln(y),n=t.charAt(0),Math.abs(a=v.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)v=v.times(e),t=ln(v.d),n=t.charAt(0),h++;a=v.e,n>1?(v=new w("0."+t),a++):v=new w(n+"."+t.slice(1))}else return o=Ec(w,u+2,b).times(a+""),v=go(new w(n+"."+t.slice(1)),u-x).plus(o),w.precision=b,r==null?hr(v,b,C,Er=!0):v;for(p=v,f=s=v=xt(v.minus(1),v.plus(1),u,1),d=hr(v.times(v),u,1),i=3;;){if(s=hr(s.times(d),u,1),o=f.plus(xt(s,new w(i),u,1)),ln(o.d).slice(0,u)===ln(f.d).slice(0,u))if(f=f.times(2),a!==0&&(f=f.plus(Ec(w,u+2,b).times(a+""))),f=xt(f,new w(h),u,1),r==null)if(xf(f.d,u-x,C,c))w.precision=u+=x,o=s=v=xt(p.minus(1),p.plus(1),u,1),d=hr(v.times(v),u,1),i=c=1;else return hr(f,w.precision=b,C,Er=!0);else return w.precision=b,f;f=o,i+=2}}function By(e){return String(e.s*e.s/0)}function Zh(e,r){var t,n,i;for((t=r.indexOf("."))>-1&&(r=r.replace(".","")),(n=r.search(/e/i))>0?(t<0&&(t=n),t+=+r.slice(n+1),r=r.substring(0,n)):t<0&&(t=r.length),n=0;r.charCodeAt(n)===48;n++);for(i=r.length;r.charCodeAt(i-1)===48;--i);if(r=r.slice(n,i),r){if(i-=n,e.e=t=t-n-1,e.d=[],n=(t+1)%br,t<0&&(n+=br),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(r=r.replace(/(\\d)_(?=\\d)/g,"$1"),_y.test(r))return Zh(e,r)}else if(r==="Infinity"||r==="NaN")return+r||(e.s=NaN),e.e=NaN,e.d=null,e;if(dk.test(r))t=16,r=r.toLowerCase();else if(mk.test(r))t=2;else if(hk.test(r))t=8;else throw Error(xo+r);for(a=r.search(/p/i),a>0?(f=+r.slice(a+1),r=r.substring(2,a)):r=r.slice(2),a=r.indexOf("."),s=a>=0,n=e.constructor,s&&(r=r.replace(".",""),c=r.length,a=c-a,i=Fy(n,new n(t),a,a*2)),o=Sc(r,t,Yi),u=o.length-1,a=u;o[a]===0;--a)o.pop();return a<0?new n(e.s*0):(e.e=Mc(o,u),e.d=o,Er=!1,s&&(e=xt(e,i,c*4)),f&&(e=e.times(Math.abs(f)<54?Jt(2,f):yf.pow(2,f))),Er=!0,e)}function bk(e,r){var t,n=r.d.length;if(n<3)return r.isZero()?r:js(e,2,r,r);t=1.4*Math.sqrt(n),t=t>16?16:t|0,r=r.times(1/_c(5,t)),r=js(e,2,r,r);for(var i,a=new e(5),s=new e(16),c=new e(20);t--;)i=r.times(r),r=r.times(a.plus(i.times(s.times(i).minus(c))));return r}function js(e,r,t,n,i){var a,s,c,f,o=1,u=e.precision,p=Math.ceil(u/br);for(Er=!1,f=t.times(t),c=new e(n);;){if(s=xt(c.times(f),new e(r++*r++),u,1),c=i?n.plus(s):n.minus(s),n=xt(s.times(f),new e(r++*r++),u,1),s=c.plus(n),s.d[p]!==void 0){for(a=p;s.d[a]===c.d[a]&&a--;);if(a==-1)break}a=c,c=n,n=s,s=a,o++}return Er=!0,s.d.length=p+1,s}function _c(e,r){for(var t=e;--r;)t*=e;return t}function Iy(e,r){var t,n=r.s<0,i=Vi(e,e.precision,1),a=i.times(.5);if(r=r.abs(),r.lte(a))return ka=n?4:1,r;if(t=r.divToInt(i),t.isZero())ka=n?3:2;else{if(r=r.minus(t.times(i)),r.lte(a))return ka=Dy(t)?n?2:3:n?4:1,r;ka=Dy(t)?n?1:4:n?3:2}return r.minus(i).abs()}function Qh(e,r,t,n){var i,a,s,c,f,o,u,p,d,h=e.constructor,x=t!==void 0;if(x?(Ln(t,1,yo),n===void 0?n=h.rounding:Ln(n,0,8)):(t=h.precision,n=h.rounding),!e.isFinite())u=By(e);else{for(u=ca(e),s=u.indexOf("."),x?(i=2,r==16?t=t*4-3:r==8&&(t=t*3-2)):i=r,s>=0&&(u=u.replace(".",""),d=new h(1),d.e=u.length-s,d.d=Sc(ca(d),10,i),d.e=d.d.length),p=Sc(u,10,i),a=f=p.length;p[--f]==0;)p.pop();if(!p[0])u=x?"0p+0":"0";else{if(s<0?a--:(e=new h(e),e.d=p,e.e=a,e=xt(e,d,t,n,0,i),p=e.d,a=e.e,o=Ay),s=p[t],c=i/2,o=o||p[t+1]!==void 0,o=n<4?(s!==void 0||o)&&(n===0||n===(e.s<0?3:2)):s>c||s===c&&(n===4||o||n===6&&p[t-1]&1||n===(e.s<0?8:7)),p.length=t,o)for(;++p[--t]>i-1;)p[t]=0,t||(++a,p.unshift(1));for(f=p.length;!p[f-1];--f);for(s=0,u="";s1)if(r==16||r==8){for(s=r==16?4:3,--f;f%s;f++)u+="0";for(p=Sc(u,i,r),f=p.length;!p[f-1];--f);for(s=1,u="1.";sf)for(a-=f;a--;)u+="0";else ar)return e.length=r,!0}function wk(e){return new this(e).abs()}function Dk(e){return new this(e).acos()}function Sk(e){return new this(e).acosh()}function Nk(e,r){return new this(e).plus(r)}function Ak(e){return new this(e).asin()}function Ek(e){return new this(e).asinh()}function Ck(e){return new this(e).atan()}function Mk(e){return new this(e).atanh()}function _k(e,r){e=new this(e),r=new this(r);var t,n=this.precision,i=this.rounding,a=n+4;return!e.s||!r.s?t=new this(NaN):!e.d&&!r.d?(t=Vi(this,a,1).times(r.s>0?.25:.75),t.s=e.s):!r.d||e.isZero()?(t=r.s<0?Vi(this,n,i):new this(0),t.s=e.s):!e.d||r.isZero()?(t=Vi(this,a,1).times(.5),t.s=e.s):r.s<0?(this.precision=a,this.rounding=1,t=this.atan(xt(e,r,a,1)),r=Vi(this,a,1),this.precision=n,this.rounding=i,t=e.s<0?t.minus(r):t.plus(r)):t=this.atan(xt(e,r,a,1)),t}function Tk(e){return new this(e).cbrt()}function Fk(e){return hr(e=new this(e),e.e+1,2)}function Ok(e,r,t){return new this(e).clamp(r,t)}function Bk(e){if(!e||typeof e!="object")throw Error(Cc+"Object expected");var r,t,n,i=e.defaults===!0,a=["precision",1,yo,"rounding",0,8,"toExpNeg",-Ks,0,"toExpPos",0,Ks,"maxE",0,Ks,"minE",-Ks,0,"modulo",0,9];for(r=0;r=a[r+1]&&n<=a[r+2])this[t]=n;else throw Error(xo+t+": "+n);if(t="crypto",i&&(this[t]=Hh[t]),(n=e[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(Cy);else this[t]=!1;else throw Error(xo+t+": "+n);return this}function Ik(e){return new this(e).cos()}function Pk(e){return new this(e).cosh()}function Py(e){var r,t,n;function i(a){var s,c,f,o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,Ny(a)){o.s=a.s,Er?!a.d||a.e>i.maxE?(o.e=NaN,o.d=null):a.e=10;c/=10)s++;Er?s>i.maxE?(o.e=NaN,o.d=null):s=429e7?r[a]=crypto.getRandomValues(new Uint32Array(1))[0]:c[a++]=i%1e7;else if(crypto.randomBytes){for(r=crypto.randomBytes(n*=4);a=214e7?crypto.randomBytes(4).copy(r,a):(c.push(i%1e7),a+=4);a=n/4}else throw Error(Cy);else for(;a=10;i/=10)n++;n{var{on:r,config:t}=e,n=rs.clone({precision:t.precision,modulo:rs.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(i){return new n(i.value)},r&&r("config",function(i,a){i.precision!==a.precision&&n.config({precision:i.precision})}),n},{isClass:!0});var tn=ci(Ly(),1);var uR="Complex",fR=[],qy=T(uR,fR,()=>(Object.defineProperty(tn.default,"name",{value:"Complex"}),tn.default.prototype.constructor=tn.default,tn.default.prototype.type="Complex",tn.default.prototype.isComplex=!0,tn.default.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},tn.default.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},tn.default.prototype.format=function(e){var r="",t=this.im,n=this.re,i=zi(this.re,e),a=zi(this.im,e),s=ar(e)?e:e?e.precision:null;if(s!==null){var c=Math.pow(10,-s);Math.abs(n/t)r.re?1:e.rer.im?1:e.im(Object.defineProperty(pa.default,"name",{value:"Fraction"}),pa.default.prototype.constructor=pa.default,pa.default.prototype.type="Fraction",pa.default.prototype.isFraction=!0,pa.default.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},pa.default.fromJSON=function(e){return new pa.default(e)},pa.default),{isClass:!0});var pR="Range",mR=[],Vy=T(pR,mR,()=>{function e(r,t,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=r!=null,a=t!=null,s=n!=null;if(i){if(je(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter start must be a number")}if(a){if(je(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter end must be a number")}if(s){if(je(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=i?parseFloat(r):0,this.end=a?parseFloat(t):0,this.step=s?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(r){if(typeof r!="string")return null;var t=r.split(":"),n=t.map(function(a){return parseFloat(a)}),i=n.some(function(a){return isNaN(a)});if(i)return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var r=0,t=this.start,n=this.step,i=this.end,a=i-t;return di(n)===di(a)?r=Math.ceil(a/n):a===0&&(r=0),isNaN(r)&&(r=0),[r]},e.prototype.min=function(){var r=this.size()[0];if(r>0)return this.step>0?this.start:this.start+(r-1)*this.step},e.prototype.max=function(){var r=this.size()[0];if(r>0)return this.step>0?this.start+(r-1)*this.step:this.start},e.prototype.forEach=function(r){var t=this.start,n=this.step,i=this.end,a=0;if(n>0)for(;ti;)r(t,[a],this),t+=n,a++},e.prototype.map=function(r){var t=[];return this.forEach(function(n,i,a){t[i[0]]=r(n,i,a)}),t},e.prototype.toArray=function(){var r=[];return this.forEach(function(t,n){r[n[0]]=t}),r},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(r){var t=zi(this.start,r);return this.step!==1&&(t+=":"+zi(this.step,r)),t+=":"+zi(this.end,r),t},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(r){return new e(r.start,r.end,r.step)},e},{isClass:!0});var dR="Matrix",hR=[],Yy=T(dR,hR,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(r,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(r,t,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(r){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(r,t,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(r,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(r,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(r,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(r){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(r){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function Hy(e){var r=0,t=1,n=Object.create(null),i=Object.create(null),a=0,s=function(f){var o=i[f];if(!!o&&(delete n[o],delete i[f],--r,t===o)){if(!r){a=0,t=1;return}for(;!Object.prototype.hasOwnProperty.call(n,++t););}};return e=Math.abs(e),{hit:function(f){var o=i[f],u=++a;if(n[u]=f,i[f]=u,!o)return++r,r<=e?void 0:(f=n[t],s(f),f);if(delete n[o],t===o)for(;!Object.prototype.hasOwnProperty.call(n,++t););},delete:s,clear:function(){r=a=0,t=1,n=Object.create(null),i=Object.create(null)}}}function ts(e){var{hasher:r,limit:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t=t??Number.POSITIVE_INFINITY,r=r??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:Hy(t||Number.POSITIVE_INFINITY)});for(var i=[],a=0;a{var{Matrix:r}=e;function t(u,p){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(p&&!yt(p))throw new Error("Invalid datatype: "+p);if(Ge(u))u.type==="DenseMatrix"?(this._data=tr(u._data),this._size=tr(u._size),this._datatype=p||u._datatype):(this._data=u.toArray(),this._size=u.size(),this._datatype=p||u._datatype);else if(u&&Ar(u.data)&&Ar(u.size))this._data=u.data,this._size=u.size,Ih(this._data,this._size),this._datatype=p||u.datatype;else if(Ar(u))this._data=o(u),this._size=or(this._data),Ih(this._data,this._size),this._datatype=p;else{if(u)throw new TypeError("Unsupported type of data ("+_r(u)+")");this._data=[],this._size=[0],this._datatype=p}}t.prototype=new r,t.prototype.createDenseMatrix=function(u,p){return new t(u,p)},Object.defineProperty(t,"name",{value:"DenseMatrix"}),t.prototype.constructor=t,t.prototype.type="DenseMatrix",t.prototype.isDenseMatrix=!0,t.prototype.getDataType=function(){return mo(this._data,_r)},t.prototype.storage=function(){return"dense"},t.prototype.datatype=function(){return this._datatype},t.prototype.create=function(u,p){return new t(u,p)},t.prototype.subset=function(u,p,d){switch(arguments.length){case 1:return n(this,u);case 2:case 3:return a(this,u,p,d);default:throw new SyntaxError("Wrong number of arguments")}},t.prototype.get=function(u){if(!Ar(u))throw new TypeError("Array expected");if(u.length!==this._size.length)throw new pr(u.length,this._size.length);for(var p=0;p");var b=p.max().map(function(S){return S+1});f(u,b,h);var A=x.length,E=0;s(u._data,p,d,A,E)}return u}function s(u,p,d,h,x){var v=x===h-1,y=p.dimension(x);v?y.forEach(function(w,C){Xr(w),u[w]=d[C[0]]}):y.forEach(function(w,C){Xr(w),s(u[w],p,d[C[0]],h,x+1)})}t.prototype.resize=function(u,p,d){if(!bt(u))throw new TypeError("Array or Matrix expected");var h=u.valueOf().map(v=>Array.isArray(v)&&v.length===1?v[0]:v),x=d?this.clone():this;return c(x,h,p)};function c(u,p,d){if(p.length===0){for(var h=u._data;Ar(h);)h=h[0];return h}return u._size=p.slice(0),u._data=Wi(u._data,u._size,d),u}t.prototype.reshape=function(u,p){var d=p?this.clone():this;d._data=hf(d._data,u);var h=d._size.reduce((x,v)=>x*v);return d._size=vf(u,h),d};function f(u,p,d){for(var h=u._size.slice(0),x=!1;h.lengthh[v]&&(h[v]=p[v],x=!0);x&&c(u,h,d)}t.prototype.clone=function(){var u=new t({data:tr(this._data),size:tr(this._size),datatype:this._datatype});return u},t.prototype.size=function(){return this._size.slice(0)},t.prototype.map=function(u){var p=this,d=Tc(u),h=function y(w,C){return Ar(w)?w.map(function(b,A){return y(b,C.concat(A))}):d===1?u(w):d===2?u(w,C):u(w,C,p)},x=h(this._data,[]),v=this._datatype!==void 0?mo(x,_r):void 0;return new t(x,v)},t.prototype.forEach=function(u){var p=this,d=function h(x,v){Ar(x)?x.forEach(function(y,w){h(y,v.concat(w))}):u(x,v,p)};d(this._data,[])},t.prototype[Symbol.iterator]=function*(){var u=function*p(d,h){if(Ar(d))for(var x=0;x[b[w]]);p.push(new t(C,u._datatype))},v=0;v0?u:0,d=u<0?-u:0,h=this._size[0],x=this._size[1],v=Math.min(h-d,x-p),y=[],w=0;w0?d:0,v=d<0?-d:0,y=u[0],w=u[1],C=Math.min(y-v,w-x),b;if(Ar(p)){if(p.length!==C)throw new Error("Invalid value array length");b=function(F){return p[F]}}else if(Ge(p)){var A=p.size();if(A.length!==1||A[0]!==C)throw new Error("Invalid matrix length");b=function(F){return p.get([F])}}else b=function(){return p};h||(h=je(b(0))?b(0).mul(0):0);var E=[];if(u.length>0){E=Wi(E,u,h);for(var S=0;S{var{typed:r}=e;return r($y,{any:tr})});function Fc(e){var r=e.length,t=e[0].length,n,i,a=[];for(i=0;i=n.length)throw new Xt(r,n.length);return Ge(e)?e.create(Oc(e.valueOf(),r,t)):Oc(e,r,t)}function Oc(e,r,t){var n,i,a,s;if(r<=0)if(Array.isArray(e[0])){for(s=Fc(e),i=[],n=0;n{var{typed:r}=e;return r(Qy,{number:He,BigNumber:function(n){return n.isInt()},Fraction:function(n){return n.d===1&&isFinite(n.n)},"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var qn="number",Ra="number, number";function jh(e){return Math.abs(e)}jh.signature=qn;function ev(e,r){return e+r}ev.signature=Ra;function rv(e,r){return e-r}rv.signature=Ra;function tv(e,r){return e*r}tv.signature=Ra;function bR(e,r){return e/r}bR.signature=Ra;function nv(e){return-e}nv.signature=qn;function iv(e){return e}iv.signature=qn;function eu(e){return $x(e)}eu.signature=qn;function av(e){return e*e*e}av.signature=qn;function ov(e){return Math.exp(e)}ov.signature=qn;function sv(e){return Zx(e)}sv.signature=qn;function wR(e,r){if(!He(e)||!He(r))throw new Error("Parameters in function gcd must be integer numbers");for(var t;r!==0;)t=e%r,e=r,r=t;return e<0?-e:e}wR.signature=Ra;function uv(e,r){if(!He(e)||!He(r))throw new Error("Parameters in function lcm must be integer numbers");if(e===0||r===0)return 0;for(var t,n=e*r;r!==0;)t=r,r=e%t,e=t;return Math.abs(n/e)}uv.signature=Ra;function Jy(e,r){return r?Math.log(e)/Math.log(r):Math.log(e)}function fv(e){return Gx(e)}fv.signature=qn;function lv(e){return Hx(e)}lv.signature=qn;function DR(e){return dc(e)}DR.signature=qn;function SR(e,r){return r===0?e:e-r*Math.floor(e/r)}SR.signature=Ra;function cv(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,t=r<0;if(t&&(r=-r),r===0)throw new Error("Root must be non-zero");if(e<0&&Math.abs(r)%2!==1)throw new Error("Root must be odd when a is negative.");if(e===0)return t?1/0:0;if(!isFinite(e))return t?0:e;var n=Math.pow(Math.abs(e),1/r);return n=e<0?-n:n,t?1/n:n}function Bc(e){return di(e)}Bc.signature=qn;function NR(e){return Math.sqrt(e)}NR.signature=qn;function pv(e){return e*e}pv.signature=qn;function mv(e,r){var t,n,i,a=0,s=1,c=1,f=0;if(!He(e)||!He(r))throw new Error("Parameters in function xgcd must be integer numbers");for(;r;)n=Math.floor(e/r),i=e-n*r,t=a,a=s-n*a,s=t,t=c,c=f-n*c,f=t,e=r,r=i;var o;return e<0?o=[-e,-s,-f]:o=[e,e?s:0,f],o}mv.signature=Ra;function dv(e,r){return e*e<1&&r===1/0||e*e>1&&r===-1/0?0:Math.pow(e,r)}dv.signature=Ra;function ru(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!He(r)||r<0||r>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(Fh(e,r))}function AR(e){return Math.abs(e)}AR.signature=qn;var ER="number",tu="number, number";function hv(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function bitAnd");return e&r}hv.signature=tu;function vv(e){if(!He(e))throw new Error("Integer expected in function bitNot");return~e}vv.signature=ER;function gv(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function bitOr");return e|r}gv.signature=tu;function xv(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function bitXor");return e^r}xv.signature=tu;function yv(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function leftShift");return e<>r}bv.signature=tu;function wv(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function rightLogShift");return e>>>r}wv.signature=tu;function Kn(e,r){if(r>1;return Kn(e,t)*Kn(t+1,r)}function Dv(e,r){if(!He(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!He(r)||r<0)throw new TypeError("Positive integer value expected in function combinations");if(r>e)throw new TypeError("k must be less than or equal to n");for(var t=e-r,n=1,i=r171?1/0:Kn(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*bf(1-e));if(e>=171.35)return 1/0;if(e>85){var t=e*e,n=t*e,i=n*e,a=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*t)-139/(51840*n)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,r=ns[0];for(var s=1;s=1;n--)t+=t1[n]/(e+n);return _v+(e+.5)*Math.log(r)-r+Math.log(t)}wf.signature="number";var Dt="number",TR="number, number";function FR(e){return Math.acos(e)}FR.signature=Dt;function Tv(e){return Jx(e)}Tv.signature=Dt;function Fv(e){return Math.atan(1/e)}Fv.signature=Dt;function Ov(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}Ov.signature=Dt;function Bv(e){return Math.asin(1/e)}Bv.signature=Dt;function Iv(e){var r=1/e;return Math.log(r+Math.sqrt(r*r+1))}Iv.signature=Dt;function Pv(e){return Math.acos(1/e)}Pv.signature=Dt;function kv(e){var r=1/e,t=Math.sqrt(r*r-1);return Math.log(t+r)}kv.signature=Dt;function OR(e){return Math.asin(e)}OR.signature=Dt;function Rv(e){return Kx(e)}Rv.signature=Dt;function BR(e){return Math.atan(e)}BR.signature=Dt;function IR(e,r){return Math.atan2(e,r)}IR.signature=TR;function Lv(e){return jx(e)}Lv.signature=Dt;function PR(e){return Math.cos(e)}PR.signature=Dt;function kR(e){return vc(e)}kR.signature=Dt;function qv(e){return 1/Math.tan(e)}qv.signature=Dt;function Uv(e){var r=Math.exp(2*e);return(r+1)/(r-1)}Uv.signature=Dt;function zv(e){return 1/Math.sin(e)}zv.signature=Dt;function Wv(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*di(e)}Wv.signature=Dt;function Vv(e){return 1/Math.cos(e)}Vv.signature=Dt;function Yv(e){return 2/(Math.exp(e)+Math.exp(-e))}Yv.signature=Dt;function RR(e){return Math.sin(e)}RR.signature=Dt;function Hv(e){return ey(e)}Hv.signature=Dt;function LR(e){return Math.tan(e)}LR.signature=Dt;function qR(e){return gc(e)}qR.signature=Dt;var Df="number";function UR(e){return He(e)}UR.signature=Df;function Gv(e){return e<0}Gv.signature=Df;function $v(e){return e>0}$v.signature=Df;function Zv(e){return e===0}Zv.signature=Df;function Qv(e){return Number.isNaN(e)}Qv.signature=Df;var n1="isNegative",zR=["typed"],i1=T(n1,zR,e=>{var{typed:r}=e;return r(n1,{number:Gv,BigNumber:function(n){return n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s<0},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var a1="isNumeric",WR=["typed"],o1=T(a1,WR,e=>{var{typed:r}=e;return r(a1,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var s1="hasNumericValue",VR=["typed","isNumeric"],u1=T(s1,VR,e=>{var{typed:r,isNumeric:t}=e;return r(s1,{boolean:()=>!0,string:function(i){return i.trim().length>0&&!isNaN(Number(i))},any:function(i){return t(i)}})});var f1="isPositive",YR=["typed"],l1=T(f1,YR,e=>{var{typed:r}=e;return r(f1,{number:$v,BigNumber:function(n){return!n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s>0&&n.n>0},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var c1="isZero",HR=["typed"],p1=T(c1,HR,e=>{var{typed:r}=e;return r(c1,{number:Zv,BigNumber:function(n){return n.isZero()},Complex:function(n){return n.re===0&&n.im===0},Fraction:function(n){return n.d===1&&n.n===0},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var m1="isNaN",GR=["typed"],d1=T(m1,GR,e=>{var{typed:r}=e;return r(m1,{number:Qv,BigNumber:function(n){return n.isNaN()},Fraction:function(n){return!1},Complex:function(n){return n.isNaN()},Unit:function(n){return Number.isNaN(n.value)},"Array | Matrix":function(n){return Je(n,Number.isNaN)}})});var h1="typeOf",$R=["typed"],v1=T(h1,$R,e=>{var{typed:r}=e;return r(h1,{any:_r})});function Ut(e,r,t){if(t==null)return e.eq(r);if(e.eq(r))return!0;if(e.isNaN()||r.isNaN())return!1;if(e.isFinite()&&r.isFinite()){var n=e.minus(r).abs();if(n.isZero())return!0;var i=e.constructor.max(e.abs(),r.abs());return n.lte(i.times(t))}return!1}function g1(e,r,t){return wt(e.re,r.re,t)&&wt(e.im,r.im,t)}var vi=T("compareUnits",["typed"],e=>{var{typed:r}=e;return{"Unit, Unit":r.referToSelf(t=>(n,i)=>{if(!n.equalBase(i))throw new Error("Cannot compare units with different base");return r.find(t,[n.valueType(),i.valueType()])(n.value,i.value)})}});var Ic="equalScalar",ZR=["typed","config"],x1=T(Ic,ZR,e=>{var{typed:r,config:t}=e,n=vi({typed:r});return r(Ic,{"boolean, boolean":function(a,s){return a===s},"number, number":function(a,s){return wt(a,s,t.epsilon)},"BigNumber, BigNumber":function(a,s){return a.eq(s)||Ut(a,s,t.epsilon)},"Fraction, Fraction":function(a,s){return a.equals(s)},"Complex, Complex":function(a,s){return g1(a,s,t.epsilon)}},n)}),RQ=T(Ic,["typed","config"],e=>{var{typed:r,config:t}=e;return r(Ic,{"number, number":function(i,a){return wt(i,a,t.epsilon)}})});var QR="SparseMatrix",XR=["typed","equalScalar","Matrix"],y1=T(QR,XR,e=>{var{typed:r,equalScalar:t,Matrix:n}=e;function i(v,y){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(y&&!yt(y))throw new Error("Invalid datatype: "+y);if(Ge(v))a(this,v,y);else if(v&&Ar(v.index)&&Ar(v.ptr)&&Ar(v.size))this._values=v.values,this._index=v.index,this._ptr=v.ptr,this._size=v.size,this._datatype=y||v.datatype;else if(Ar(v))s(this,v,y);else{if(v)throw new TypeError("Unsupported type of data ("+_r(v)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=y}}function a(v,y,w){y.type==="SparseMatrix"?(v._values=y._values?tr(y._values):void 0,v._index=tr(y._index),v._ptr=tr(y._ptr),v._size=tr(y._size),v._datatype=w||y._datatype):s(v,y.valueOf(),w||y._datatype)}function s(v,y,w){v._values=[],v._index=[],v._ptr=[],v._datatype=w;var C=y.length,b=0,A=t,E=0;if(yt(w)&&(A=r.find(t,[w,w])||t,E=r.convert(0,w)),C>0){var S=0;do{v._ptr.push(v._index.length);for(var O=0;O");if(b.length===1){var F=y.dimension(0);F.forEach(function(k,L){Xr(k),v.set([k,0],w[L[0]],C)})}else{var M=y.dimension(0),_=y.dimension(1);M.forEach(function(k,L){Xr(k),_.forEach(function(Y,$){Xr(Y),v.set([k,Y],w[L[0]][$[0]],C)})})}}return v}i.prototype.get=function(v){if(!Ar(v))throw new TypeError("Array expected");if(v.length!==this._size.length)throw new pr(v.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var y=v[0],w=v[1];Xr(y,this._size[0]),Xr(w,this._size[1]);var C=o(y,this._ptr[w],this._ptr[w+1],this._index);return CA-1||b>E-1)&&(d(this,Math.max(C+1,A),Math.max(b+1,E),w),A=this._size[0],E=this._size[1]),Xr(C,A),Xr(b,E);var F=o(C,this._ptr[b],this._ptr[b+1],this._index);return FArray.isArray(A)&&A.length===1?A[0]:A);if(C.length!==2)throw new Error("Only two dimensions matrix are supported");C.forEach(function(A){if(!ar(A)||!He(A)||A<0)throw new TypeError("Invalid size, must contain positive integers (size: "+lr(C)+")")});var b=w?this.clone():this;return d(b,C[0],C[1],y)};function d(v,y,w,C){var b=C||0,A=t,E=0;yt(v._datatype)&&(A=r.find(t,[v._datatype,v._datatype])||t,E=r.convert(0,v._datatype),b=r.convert(b,v._datatype));var S=!A(b,E),O=v._size[0],F=v._size[1],M,_,k;if(w>F){for(_=F;_O){if(S){var L=0;for(_=0;_y-1&&(v._values.splice(k,1),v._index.splice(k,1),$++)}v._ptr[_]=v._values.length}return v._size[0]=y,v._size[1]=w,v}i.prototype.reshape=function(v,y){if(!Ar(v))throw new TypeError("Array expected");if(v.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");v.forEach(function(U){if(!ar(U)||!He(U)||U<=-2||U===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+lr(v)+")")});var w=this._size[0]*this._size[1];v=vf(v,w);var C=v[0]*v[1];if(w!==C)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var b=y?this.clone():this;if(this._size[0]===v[0]&&this._size[1]===v[1])return b;for(var A=[],E=0;E=y&&q<=w&&k(v._values[V],q-y,L-C)}else{for(var R={},j=Y;j<$;j++){var U=v._index[j];R[U]=v._values[j]}for(var oe=y;oe<=w;oe++){var me=oe in R?R[oe]:0;k(me,oe-y,L-C)}}}return F.push(S.length),new i({values:S,index:O,ptr:F,size:[w-y+1,b-C+1]})}i.prototype.forEach=function(v,y){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var w=this,C=this._size[0],b=this._size[1],A=0;A "+(this._values?lr(this._values[O],v):"X")}return b},i.prototype.toString=function(){return lr(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(v){if(v){if(je(v)&&(v=v.toNumber()),!ar(v)||!He(v))throw new TypeError("The parameter k must be an integer number")}else v=0;var y=v>0?v:0,w=v<0?-v:0,C=this._size[0],b=this._size[1],A=Math.min(C-w,b-y),E=[],S=[],O=[];O[0]=0;for(var F=y;F0?w:0,O=w<0?-w:0,F=v[0],M=v[1],_=Math.min(F-O,M-S),k;if(Ar(y)){if(y.length!==_)throw new Error("Invalid value array length");k=function(oe){return y[oe]}}else if(Ge(y)){var L=y.size();if(L.length!==1||L[0]!==_)throw new Error("Invalid matrix length");k=function(oe){return y.get([oe])}}else k=function(){return y};for(var Y=[],$=[],V=[],q=0;q=0&&R<_){var j=k(R);A(j,E)||($.push(R+O),Y.push(j))}}return V.push(Y.length),new i({values:Y,index:$,ptr:V,size:[F,M]})},i.prototype.swapRows=function(v,y){if(!ar(v)||!He(v)||!ar(y)||!He(y))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Xr(v,this._size[0]),Xr(y,this._size[0]),i._swapRows(v,y,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(v,y,w,C,b){for(var A=C[v],E=C[v+1],S=A;S=O||b[M]!==y)){var k=C?C[F]:void 0;b.splice(M,0,y),C&&C.splice(M,0,k),b.splice(M<=F?F+1:F,1),C&&C.splice(M<=F?F+1:F,1);continue}if(M=O||b[F]!==v)){var L=C?C[M]:void 0;b.splice(F,0,v),C&&C.splice(F,0,L),b.splice(F<=M?M+1:M,1),C&&C.splice(F<=M?M+1:M,1)}}},i},{isClass:!0});var JR="number",KR=["typed"];function jR(e){var r=e.match(/(0[box])([0-9a-fA-F]*)\\.([0-9a-fA-F]*)/);if(r){var t={"0b":2,"0o":8,"0x":16}[r[1]],n=r[2],i=r[3];return{input:e,radix:t,integerPart:n,fractionalPart:i}}else return null}function e9(e){for(var r=parseInt(e.integerPart,e.radix),t=0,n=0;n{var{typed:r}=e,t=r("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var a=jR(i);if(a)return e9(a);var s=0,c=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);c&&(s=Number(c[2]),i=c[1]);var f=Number(i);if(isNaN(f))throw new SyntaxError('String "'+i+'" is not a valid number');if(c){if(f>2**s-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));f>=2**(s-1)&&(f=f-2**s)}return f},BigNumber:function(i){return i.toNumber()},Fraction:function(i){return i.valueOf()},Unit:r.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),null:function(i){return 0},"Unit, string | Unit":function(i,a){return i.toNumber(a)},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))});return t.fromJSON=function(n){return parseFloat(n.value)},t});var w1="string",r9=["typed"],D1=T(w1,r9,e=>{var{typed:r}=e;return r(w1,{"":function(){return""},number:zi,null:function(n){return"null"},boolean:function(n){return n+""},string:function(n){return n},"Array | Matrix":r.referToSelf(t=>n=>Je(n,t)),any:function(n){return String(n)}})});var S1="boolean",t9=["typed"],N1=T(S1,t9,e=>{var{typed:r}=e;return r(S1,{"":function(){return!1},boolean:function(n){return n},number:function(n){return!!n},null:function(n){return!1},BigNumber:function(n){return!n.isZero()},string:function(n){var i=n.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;var a=Number(n);if(n!==""&&!isNaN(a))return!!a;throw new Error('Cannot convert "'+n+'" to a boolean')},"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var n9="bignumber",i9=["typed","BigNumber"],A1=T(n9,i9,e=>{var{typed:r,BigNumber:t}=e;return r("bignumber",{"":function(){return new t(0)},number:function(i){return new t(i+"")},string:function(i){var a=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(a){var s=a[2],c=t(a[1]),f=new t(2).pow(Number(s));if(c.gt(f.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var o=new t(2).pow(Number(s)-1);return c.gte(o)?c.sub(f):c}return new t(i)},BigNumber:function(i){return i},Unit:r.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Fraction:function(i){return new t(i.n).div(i.d).times(i.s)},null:function(i){return new t(0)},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var a9="complex",o9=["typed","Complex"],E1=T(a9,o9,e=>{var{typed:r,Complex:t}=e;return r("complex",{"":function(){return t.ZERO},number:function(i){return new t(i,0)},"number, number":function(i,a){return new t(i,a)},"BigNumber, BigNumber":function(i,a){return new t(i.toNumber(),a.toNumber())},Fraction:function(i){return new t(i.valueOf(),0)},Complex:function(i){return i.clone()},string:function(i){return t(i)},null:function(i){return t(0)},Object:function(i){if("re"in i&&"im"in i)return new t(i.re,i.im);if("r"in i&&"phi"in i||"abs"in i&&"arg"in i)return new t(i);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var s9="fraction",u9=["typed","Fraction"],C1=T(s9,u9,e=>{var{typed:r,Fraction:t}=e;return r("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new t(i)},string:function(i){return new t(i)},"number, number":function(i,a){return new t(i,a)},null:function(i){return new t(0)},BigNumber:function(i){return new t(i.toString())},Fraction:function(i){return i},Unit:r.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Object:function(i){return new t(i)},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var M1="matrix",f9=["typed","Matrix","DenseMatrix","SparseMatrix"],_1=T(M1,f9,e=>{var{typed:r,Matrix:t,DenseMatrix:n,SparseMatrix:i}=e;return r(M1,{"":function(){return a([])},string:function(c){return a([],c)},"string, string":function(c,f){return a([],c,f)},Array:function(c){return a(c)},Matrix:function(c){return a(c,c.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(s,c,f){if(c==="dense"||c==="default"||c===void 0)return new n(s,f);if(c==="sparse")return new i(s,f);throw new TypeError("Unknown matrix type "+JSON.stringify(c)+".")}});var T1="matrixFromFunction",l9=["typed","matrix","isZero"],F1=T(T1,l9,e=>{var{typed:r,matrix:t,isZero:n}=e;return r(T1,{"Array | Matrix, function, string, string":function(s,c,f,o){return i(s,c,f,o)},"Array | Matrix, function, string":function(s,c,f){return i(s,c,f)},"Matrix, function":function(s,c){return i(s,c,"dense")},"Array, function":function(s,c){return i(s,c,"dense").toArray()},"Array | Matrix, string, function":function(s,c,f){return i(s,f,c)},"Array | Matrix, string, string, function":function(s,c,f,o){return i(s,o,c,f)}});function i(a,s,c,f){var o;return f!==void 0?o=t(c,f):o=t(c),o.resize(a),o.forEach(function(u,p){var d=s(p);n(d)||o.set(p,d)}),o}});var O1="matrixFromRows",c9=["typed","matrix","flatten","size"],B1=T(O1,c9,e=>{var{typed:r,matrix:t,flatten:n,size:i}=e;return r(O1,{"...Array":function(f){return a(f)},"...Matrix":function(f){return t(a(f.map(o=>o.toArray())))}});function a(c){if(c.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var f=s(c[0]),o=[];for(var u of c){var p=s(u);if(p!==f)throw new TypeError("The vectors had different length: "+(f|0)+" \\u2260 "+(p|0));o.push(n(u))}return o}function s(c){var f=i(c);if(f.length===1)return f[0];if(f.length===2){if(f[0]===1)return f[1];if(f[1]===1)return f[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}});var I1="matrixFromColumns",p9=["typed","matrix","flatten","size"],P1=T(I1,p9,e=>{var{typed:r,matrix:t,flatten:n,size:i}=e;return r(I1,{"...Array":function(f){return a(f)},"...Matrix":function(f){return t(a(f.map(o=>o.toArray())))}});function a(c){if(c.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var f=s(c[0]),o=[],u=0;u{var{typed:r}=e;return r(k1,{"Unit, Array":function(n,i){return n.splitUnit(i)}})});var L1="unaryMinus",d9=["typed"],q1=T(L1,d9,e=>{var{typed:r}=e;return r(L1,{number:nv,"Complex | BigNumber | Fraction":t=>t.neg(),Unit:r.referToSelf(t=>n=>{var i=n.clone();return i.value=r.find(t,i.valueType())(n.value),i}),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t,!0))})});var U1="unaryPlus",h9=["typed","config","BigNumber"],z1=T(U1,h9,e=>{var{typed:r,config:t,BigNumber:n}=e;return r(U1,{number:iv,Complex:function(a){return a},BigNumber:function(a){return a},Fraction:function(a){return a},Unit:function(a){return a.clone()},"Array | Matrix":r.referToSelf(i=>a=>Je(a,i,!0)),"boolean | string":function(a){return t.number==="BigNumber"?new n(+a):+a}})});var W1="abs",v9=["typed"],V1=T(W1,v9,e=>{var{typed:r}=e;return r(W1,{number:jh,"Complex | BigNumber | Fraction | Unit":t=>t.abs(),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t,!0))})});var Y1="apply",g9=["typed","isInteger"],nu=T(Y1,g9,e=>{var{typed:r,isInteger:t}=e;return r(Y1,{"Array | Matrix, number | BigNumber, function":function(i,a,s){if(!t(a))throw new TypeError("Integer number expected for dimension");var c=Array.isArray(i)?or(i):i.size();if(a<0||a>=c.length)throw new Xt(a,c.length);return Ge(i)?i.create(Pc(i.valueOf(),a,s)):Pc(i,a,s)}})});function Pc(e,r,t){var n,i,a;if(r<=0)if(Array.isArray(e[0])){for(a=x9(e),i=[],n=0;n{var{typed:r}=e;return r(H1,{"number, number":ev,"Complex, Complex":function(n,i){return n.add(i)},"BigNumber, BigNumber":function(n,i){return n.plus(i)},"Fraction, Fraction":function(n,i){return n.add(i)},"Unit, Unit":r.referToSelf(t=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=r.find(t,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})});var $1="subtractScalar",b9=["typed"],Z1=T($1,b9,e=>{var{typed:r}=e;return r($1,{"number, number":rv,"Complex, Complex":function(n,i){return n.sub(i)},"BigNumber, BigNumber":function(n,i){return n.minus(i)},"Fraction, Fraction":function(n,i){return n.sub(i)},"Unit, Unit":r.referToSelf(t=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=r.find(t,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})});var Q1="cbrt",w9=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],X1=T(Q1,w9,e=>{var{config:r,typed:t,isNegative:n,unaryMinus:i,matrix:a,Complex:s,BigNumber:c,Fraction:f}=e;return t(Q1,{number:eu,Complex:o,"Complex, boolean":o,BigNumber:function(d){return d.cbrt()},Unit:u});function o(p,d){var h=p.arg()/3,x=p.abs(),v=new s(eu(x),0).mul(new s(0,h).exp());if(d){var y=[v,new s(eu(x),0).mul(new s(0,h+Math.PI*2/3).exp()),new s(eu(x),0).mul(new s(0,h-Math.PI*2/3).exp())];return r.matrix==="Array"?y:a(y)}else return v}function u(p){if(p.value&&Gt(p.value)){var d=p.clone();return d.value=1,d=d.pow(1/3),d.value=o(p.value),d}else{var h=n(p.value);h&&(p.value=i(p.value));var x;je(p.value)?x=new c(1).div(3):Xn(p.value)?x=new f(1,3):x=1/3;var v=p.pow(x);return h&&(v.value=i(v.value)),v}}});var D9="matAlgo11xS0s",S9=["typed","equalScalar"],Jr=T(D9,S9,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s,c){var f=i._values,o=i._index,u=i._ptr,p=i._size,d=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=p[0],x=p[1],v,y=t,w=0,C=s;typeof d=="string"&&(v=d,y=r.find(t,[v,v]),w=r.convert(0,v),a=r.convert(a,v),C=r.find(s,[v,v]));for(var b=[],A=[],E=[],S=0;S{var{typed:r,DenseMatrix:t}=e;return function(i,a,s,c){var f=i._values,o=i._index,u=i._ptr,p=i._size,d=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=p[0],x=p[1],v,y=s;typeof d=="string"&&(v=d,a=r.convert(a,v),y=r.find(s,[v,v]));for(var w=[],C=[],b=[],A=0;A{var{typed:r}=e;return function(i,a,s,c){var f=i._data,o=i._size,u=i._datatype,p,d=s;typeof u=="string"&&(p=u,a=r.convert(a,p),d=r.find(s,[p,p]));var h=o.length>0?t(d,0,o,o[0],f,a,c):[];return i.createDenseMatrix({data:h,size:tr(o),datatype:p})};function t(n,i,a,s,c,f,o){var u=[];if(i===a.length-1)for(var p=0;p{var{typed:r,config:t,round:n}=e;return r(Xv,{number:function(a){return wt(a,n(a),t.epsilon)?n(a):Math.ceil(a)},"number, number":function(a,s){if(wt(a,n(a,s),t.epsilon))return n(a,s);var[c,f]="".concat(a,"e").split("e"),o=Math.ceil(Number("".concat(c,"e").concat(Number(f)+s)));return[c,f]="".concat(o,"e").split("e"),Number("".concat(c,"e").concat(Number(f)-s))}})}),J1=T(Xv,M9,e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:c}=e,f=Jr({typed:r,equalScalar:a}),o=Lr({typed:r,DenseMatrix:c}),u=Bt({typed:r}),p=_9({typed:r,config:t,round:n});return r("ceil",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(h){return h.ceil()},"Complex, number":function(h,x){return h.ceil(x)},"Complex, BigNumber":function(h,x){return h.ceil(x.toNumber())},BigNumber:function(h){return Ut(h,n(h),t.epsilon)?n(h):h.ceil()},"BigNumber, BigNumber":function(h,x){return Ut(h,n(h,x),t.epsilon)?n(h,x):h.toDecimalPlaces(x.toNumber(),rs.ROUND_CEIL)},Fraction:function(h){return h.ceil()},"Fraction, number":function(h,x){return h.ceil(x)},"Fraction, BigNumber":function(h,x){return h.ceil(x.toNumber())},"Array | Matrix":r.referToSelf(d=>h=>Je(h,d,!0)),"Array, number | BigNumber":r.referToSelf(d=>(h,x)=>Je(h,v=>d(v,x),!0)),"SparseMatrix, number | BigNumber":r.referToSelf(d=>(h,x)=>f(h,x,d,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(d=>(h,x)=>u(h,x,d,!1)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(d=>(h,x)=>u(i(x),h,d,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(d=>(h,x)=>a(h,0)?s(x.size(),x.storage()):x.storage()==="dense"?u(x,h,d,!0):o(x,h,d,!0))})});var K1="cube",T9=["typed"],j1=T(K1,T9,e=>{var{typed:r}=e;return r(K1,{number:av,Complex:function(n){return n.mul(n).mul(n)},BigNumber:function(n){return n.times(n).times(n)},Fraction:function(n){return n.pow(3)},Unit:function(n){return n.pow(3)}})});var eb="exp",F9=["typed"],rb=T(eb,F9,e=>{var{typed:r}=e;return r(eb,{number:ov,Complex:function(n){return n.exp()},BigNumber:function(n){return n.exp()}})});var tb="expm1",O9=["typed","Complex"],nb=T(tb,O9,e=>{var{typed:r,Complex:t}=e;return r(tb,{number:sv,Complex:function(i){var a=Math.exp(i.re);return new t(a*Math.cos(i.im)-1,a*Math.sin(i.im))},BigNumber:function(i){return i.exp().minus(1)}})});var Jv="fix",B9=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],I9=T(Jv,["typed","ceil","floor"],e=>{var{typed:r,ceil:t,floor:n}=e;return r(Jv,{number:function(a){return a>0?n(a):t(a)},"number, number":function(a,s){return a>0?n(a,s):t(a,s)}})}),ib=T(Jv,B9,e=>{var{typed:r,Complex:t,matrix:n,ceil:i,floor:a,equalScalar:s,zeros:c,DenseMatrix:f}=e,o=Lr({typed:r,DenseMatrix:f}),u=Bt({typed:r}),p=I9({typed:r,ceil:i,floor:a});return r("fix",{number:p.signatures.number,"number, number | BigNumber":p.signatures["number,number"],Complex:function(h){return new t(h.re>0?Math.floor(h.re):Math.ceil(h.re),h.im>0?Math.floor(h.im):Math.ceil(h.im))},"Complex, number":function(h,x){return new t(h.re>0?a(h.re,x):i(h.re,x),h.im>0?a(h.im,x):i(h.im,x))},"Complex, BigNumber":function(h,x){var v=x.toNumber();return new t(h.re>0?a(h.re,v):i(h.re,v),h.im>0?a(h.im,v):i(h.im,v))},BigNumber:function(h){return h.isNegative()?i(h):a(h)},"BigNumber, number | BigNumber":function(h,x){return h.isNegative()?i(h,x):a(h,x)},Fraction:function(h){return h.s<0?h.ceil():h.floor()},"Fraction, number | BigNumber":function(h,x){return h.s<0?i(h,x):a(h,x)},"Array | Matrix":r.referToSelf(d=>h=>Je(h,d,!0)),"Array | Matrix, number | BigNumber":r.referToSelf(d=>(h,x)=>Je(h,v=>d(v,x),!0)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(d=>(h,x)=>u(n(x),h,d,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(d=>(h,x)=>s(h,0)?c(x.size(),x.storage()):x.storage()==="dense"?u(x,h,d,!0):o(x,h,d,!0))})});var Kv="floor",P9=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],k9=T(Kv,["typed","config","round"],e=>{var{typed:r,config:t,round:n}=e;return r(Kv,{number:function(a){return wt(a,n(a),t.epsilon)?n(a):Math.floor(a)},"number, number":function(a,s){if(wt(a,n(a,s),t.epsilon))return n(a,s);var[c,f]="".concat(a,"e").split("e"),o=Math.floor(Number("".concat(c,"e").concat(Number(f)+s)));return[c,f]="".concat(o,"e").split("e"),Number("".concat(c,"e").concat(Number(f)-s))}})}),kc=T(Kv,P9,e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:c}=e,f=Jr({typed:r,equalScalar:a}),o=Lr({typed:r,DenseMatrix:c}),u=Bt({typed:r}),p=k9({typed:r,config:t,round:n});return r("floor",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(h){return h.floor()},"Complex, number":function(h,x){return h.floor(x)},"Complex, BigNumber":function(h,x){return h.floor(x.toNumber())},BigNumber:function(h){return Ut(h,n(h),t.epsilon)?n(h):h.floor()},"BigNumber, BigNumber":function(h,x){return Ut(h,n(h,x),t.epsilon)?n(h,x):h.toDecimalPlaces(x.toNumber(),rs.ROUND_FLOOR)},Fraction:function(h){return h.floor()},"Fraction, number":function(h,x){return h.floor(x)},"Fraction, BigNumber":function(h,x){return h.floor(x.toNumber())},"Array | Matrix":r.referToSelf(d=>h=>Je(h,d,!0)),"Array, number | BigNumber":r.referToSelf(d=>(h,x)=>Je(h,v=>d(v,x),!0)),"SparseMatrix, number | BigNumber":r.referToSelf(d=>(h,x)=>f(h,x,d,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(d=>(h,x)=>u(h,x,d,!1)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(d=>(h,x)=>u(i(x),h,d,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(d=>(h,x)=>a(h,0)?s(x.size(),x.storage()):x.storage()==="dense"?u(x,h,d,!0):o(x,h,d,!0))})});var R9="matAlgo02xDS0",L9=["typed","equalScalar"],It=T(R9,L9,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s,c){var f=i._data,o=i._size,u=i._datatype||i.getDataType(),p=a._values,d=a._index,h=a._ptr,x=a._size,v=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(o.length!==x.length)throw new pr(o.length,x.length);if(o[0]!==x[0]||o[1]!==x[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+x+")");if(!p)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var y=o[0],w=o[1],C,b=t,A=0,E=s;typeof u=="string"&&u===v&&u!=="mixed"&&(C=u,b=r.find(t,[C,C]),A=r.convert(0,C),E=r.find(s,[C,C]));for(var S=[],O=[],F=[],M=0;M{var{typed:r}=e;return function(n,i,a,s){var c=n._data,f=n._size,o=n._datatype||n.getDataType(),u=i._values,p=i._index,d=i._ptr,h=i._size,x=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(f.length!==h.length)throw new pr(f.length,h.length);if(f[0]!==h[0]||f[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+h+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var v=f[0],y=f[1],w,C=0,b=a;typeof o=="string"&&o===x&&o!=="mixed"&&(w=o,C=r.convert(0,w),b=r.find(a,[w,w]));for(var A=[],E=0;E{var{typed:r,equalScalar:t}=e;return function(i,a,s){var c=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),d=a._values,h=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new pr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");var w=u[0],C=u[1],b,A=t,E=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),E=r.convert(0,b),S=r.find(s,[b,b]));var O=c&&d?[]:void 0,F=[],M=[],_=O?[]:void 0,k=O?[]:void 0,L=[],Y=[],$,V,q,R;for(V=0;V{var{typed:r}=e;return function(i,a,s){var c=i._data,f=i._size,o=i._datatype,u=a._data,p=a._size,d=a._datatype,h=[];if(f.length!==p.length)throw new pr(f.length,p.length);for(var x=0;x0?t(y,0,h,h[0],c,u):[];return i.createDenseMatrix({data:w,size:h,datatype:v})};function t(n,i,a,s,c,f){var o=[];if(i===a.length-1)for(var u=0;u{var{concat:r}=e;return function(i,a){var s=Math.max(i._size.length,a._size.length);if(i._size.length===a._size.length&&i._size.every((x,v)=>x===a._size[v]))return[i,a];for(var c=t(i._size,s,0),f=t(a._size,s,0),o=[],u=0;u{var{typed:r,matrix:t,concat:n}=e,i=ab({typed:r}),a=Bt({typed:r}),s=ob({concat:n});return function(f){var o=f.elop,u=f.SD||f.DS,p;o?(p={"DenseMatrix, DenseMatrix":(v,y)=>i(...s(v,y),o),"Array, Array":(v,y)=>i(...s(t(v),t(y)),o).valueOf(),"Array, DenseMatrix":(v,y)=>i(...s(t(v),y),o),"DenseMatrix, Array":(v,y)=>i(...s(v,t(y)),o)},f.SS&&(p["SparseMatrix, SparseMatrix"]=(v,y)=>f.SS(...s(v,y),o,!1)),f.DS&&(p["DenseMatrix, SparseMatrix"]=(v,y)=>f.DS(...s(v,y),o,!1),p["Array, SparseMatrix"]=(v,y)=>f.DS(...s(t(v),y),o,!1)),u&&(p["SparseMatrix, DenseMatrix"]=(v,y)=>u(...s(y,v),o,!0),p["SparseMatrix, Array"]=(v,y)=>u(...s(t(y),v),o,!0))):(p={"DenseMatrix, DenseMatrix":r.referToSelf(v=>(y,w)=>i(...s(y,w),v)),"Array, Array":r.referToSelf(v=>(y,w)=>i(...s(t(y),t(w)),v).valueOf()),"Array, DenseMatrix":r.referToSelf(v=>(y,w)=>i(...s(t(y),w),v)),"DenseMatrix, Array":r.referToSelf(v=>(y,w)=>i(...s(y,t(w)),v))},f.SS&&(p["SparseMatrix, SparseMatrix"]=r.referToSelf(v=>(y,w)=>f.SS(...s(y,w),v,!1))),f.DS&&(p["DenseMatrix, SparseMatrix"]=r.referToSelf(v=>(y,w)=>f.DS(...s(y,w),v,!1)),p["Array, SparseMatrix"]=r.referToSelf(v=>(y,w)=>f.DS(...s(t(y),w),v,!1))),u&&(p["SparseMatrix, DenseMatrix"]=r.referToSelf(v=>(y,w)=>u(...s(w,y),v,!0)),p["SparseMatrix, Array"]=r.referToSelf(v=>(y,w)=>u(...s(t(w),y),v,!0))));var d=f.scalar||"any",h=f.Ds||f.Ss;h&&(o?(p["DenseMatrix,"+d]=(v,y)=>a(v,y,o,!1),p[d+", DenseMatrix"]=(v,y)=>a(y,v,o,!0),p["Array,"+d]=(v,y)=>a(t(v),y,o,!1).valueOf(),p[d+", Array"]=(v,y)=>a(t(y),v,o,!0).valueOf()):(p["DenseMatrix,"+d]=r.referToSelf(v=>(y,w)=>a(y,w,v,!1)),p[d+", DenseMatrix"]=r.referToSelf(v=>(y,w)=>a(w,y,v,!0)),p["Array,"+d]=r.referToSelf(v=>(y,w)=>a(t(y),w,v,!1).valueOf()),p[d+", Array"]=r.referToSelf(v=>(y,w)=>a(t(w),y,v,!0).valueOf())));var x=f.sS!==void 0?f.sS:f.Ss;return o?(f.Ss&&(p["SparseMatrix,"+d]=(v,y)=>f.Ss(v,y,o,!1)),x&&(p[d+", SparseMatrix"]=(v,y)=>x(y,v,o,!0))):(f.Ss&&(p["SparseMatrix,"+d]=r.referToSelf(v=>(y,w)=>f.Ss(y,w,v,!1))),x&&(p[d+", SparseMatrix"]=r.referToSelf(v=>(y,w)=>x(w,y,v,!0)))),o&&o.signatures&&pc(p,o.signatures),p}});var sb="mod",Q9=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],Rc=T(sb,Q9,e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:c,concat:f}=e,o=kc({typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:c}),u=It({typed:r,equalScalar:a}),p=ft({typed:r}),d=wo({typed:r,equalScalar:a}),h=Jr({typed:r,equalScalar:a}),x=Lr({typed:r,DenseMatrix:c}),v=vr({typed:r,matrix:i,concat:f});return r(sb,{"number, number":y,"BigNumber, BigNumber":function(C,b){return b.isZero()?C:C.sub(b.mul(o(C.div(b))))},"Fraction, Fraction":function(C,b){return b.equals(0)?C:C.sub(b.mul(o(C.div(b))))}},v({SS:d,DS:p,SD:u,Ss:h,sS:x}));function y(w,C){return C===0?w:w-C*o(w/C)}});var X9="matAlgo01xDSid",J9=["typed"],hn=T(X9,J9,e=>{var{typed:r}=e;return function(n,i,a,s){var c=n._data,f=n._size,o=n._datatype||n.getDataType(),u=i._values,p=i._index,d=i._ptr,h=i._size,x=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(f.length!==h.length)throw new pr(f.length,h.length);if(f[0]!==h[0]||f[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+h+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var v=f[0],y=f[1],w=typeof o=="string"&&o!=="mixed"&&o===x?o:void 0,C=w?r.find(a,[w,w]):a,b,A,E=[];for(b=0;b{var{typed:r,equalScalar:t}=e;return function(i,a,s){var c=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),d=a._values,h=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new pr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");var w=u[0],C=u[1],b,A=t,E=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),E=r.convert(0,b),S=r.find(s,[b,b]));var O=c&&d?[]:void 0,F=[],M=[],_=c&&d?[]:void 0,k=c&&d?[]:void 0,L=[],Y=[],$,V,q,R,j;for(V=0;V{var{typed:r,DenseMatrix:t}=e;return function(i,a,s,c){var f=i._values,o=i._index,u=i._ptr,p=i._size,d=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=p[0],x=p[1],v,y=s;typeof d=="string"&&(v=d,a=r.convert(a,v),y=r.find(s,[v,v]));for(var w=[],C=[],b=[],A=0;AArray.isArray(r))}var lb=T(ub,t7,e=>{var{typed:r,matrix:t,config:n,round:i,equalScalar:a,zeros:s,BigNumber:c,DenseMatrix:f,concat:o}=e,u=Rc({typed:r,config:n,round:i,matrix:t,equalScalar:a,zeros:s,DenseMatrix:f,concat:o}),p=hn({typed:r}),d=iu({typed:r,equalScalar:a}),h=Un({typed:r,DenseMatrix:f}),x=vr({typed:r,matrix:t,concat:o});return r(ub,{"number, number":v,"BigNumber, BigNumber":y,"Fraction, Fraction":(w,C)=>w.gcd(C)},x({SS:d,DS:p,Ss:h}),{[n7]:r.referToSelf(w=>(C,b,A)=>{for(var E=w(C,b),S=0;SC=>{if(C.length===1&&Array.isArray(C[0])&&fb(C[0]))return w(...C[0]);if(fb(C))return w(...C);throw new jn("gcd() supports only 1d matrices!")}),Matrix:r.referToSelf(w=>C=>w(C.toArray()))});function v(w,C){if(!He(w)||!He(C))throw new Error("Parameters in function gcd must be integer numbers");for(var b;C!==0;)b=u(w,C),w=C,C=b;return w<0?-w:w}function y(w,C){if(!w.isInt()||!C.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var b=new c(0);!C.isZero();){var A=u(w,C);w=C,C=A}return w.lt(b)?w.neg():w}});var i7="matAlgo06xS0S0",a7=["typed","equalScalar"],Do=T(i7,a7,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s){var c=i._values,f=i._size,o=i._datatype||i._data===void 0?i._datatype:i.getDataType(),u=a._values,p=a._size,d=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(f.length!==p.length)throw new pr(f.length,p.length);if(f[0]!==p[0]||f[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+p+")");var h=f[0],x=f[1],v,y=t,w=0,C=s;typeof o=="string"&&o===d&&o!=="mixed"&&(v=o,y=r.find(t,[v,v]),w=r.convert(0,v),C=r.find(s,[v,v]));for(var b=c&&u?[]:void 0,A=[],E=[],S=b?[]:void 0,O=[],F=[],M=0;M{var{typed:r,matrix:t,equalScalar:n,concat:i}=e,a=It({typed:r,equalScalar:n}),s=Do({typed:r,equalScalar:n}),c=Jr({typed:r,equalScalar:n}),f=vr({typed:r,matrix:t,concat:i}),o="number | BigNumber | Fraction | Matrix | Array",u={};return u["".concat(o,", ").concat(o,", ...").concat(o)]=r.referToSelf(d=>(h,x,v)=>{for(var y=d(h,x),w=0;wd.lcm(h)},f({SS:s,DS:a,Ss:c}),u);function p(d,h){if(!d.isInt()||!h.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(d.isZero())return d;if(h.isZero())return h;for(var x=d.times(h);!h.isZero();){var v=h;h=d.mod(v),d=v}return x.div(d).abs()}});var mb="log10",s7=["typed","config","Complex"],db=T(mb,s7,e=>{var{typed:r,config:t,Complex:n}=e;return r(mb,{number:function(a){return a>=0||t.predictable?fv(a):new n(a,0).log().div(Math.LN10)},Complex:function(a){return new n(a).log().div(Math.LN10)},BigNumber:function(a){return!a.isNegative()||t.predictable?a.log():new n(a.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":r.referToSelf(i=>a=>Je(a,i))})});var hb="log2",u7=["typed","config","Complex"],vb=T(hb,u7,e=>{var{typed:r,config:t,Complex:n}=e;return r(hb,{number:function(s){return s>=0||t.predictable?lv(s):i(new n(s,0))},Complex:i,BigNumber:function(s){return!s.isNegative()||t.predictable?s.log(2):i(new n(s.toNumber(),0))},"Array | Matrix":r.referToSelf(a=>s=>Je(s,a))});function i(a){var s=Math.sqrt(a.re*a.re+a.im*a.im);return new n(Math.log2?Math.log2(s):Math.log(s)/Math.LN2,Math.atan2(a.im,a.re)/Math.LN2)}});var f7="multiplyScalar",l7=["typed"],gb=T(f7,l7,e=>{var{typed:r}=e;return r("multiplyScalar",{"number, number":tv,"Complex, Complex":function(n,i){return n.mul(i)},"BigNumber, BigNumber":function(n,i){return n.times(i)},"Fraction, Fraction":function(n,i){return n.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(t,n)=>n.multiply(t),"Unit, number | Fraction | BigNumber | Complex | Unit":(t,n)=>t.multiply(n)})});var xb="multiply",c7=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],yb=T(xb,c7,e=>{var{typed:r,matrix:t,addScalar:n,multiplyScalar:i,equalScalar:a,dot:s}=e,c=Jr({typed:r,equalScalar:a}),f=Bt({typed:r});function o(E,S){switch(E.length){case 1:switch(S.length){case 1:if(E[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(E[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+E[0]+") must match Matrix rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;case 2:switch(S.length){case 1:if(E[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+E[1]+") must match Vector length ("+S[0]+")");break;case 2:if(E[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+E[1]+") must match Matrix B rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+E.length+" dimensions)")}}function u(E,S,O){if(O===0)throw new Error("Cannot multiply two empty vectors");return s(E,S)}function p(E,S){if(S.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return d(E,S)}function d(E,S){var O=E._data,F=E._size,M=E._datatype||E.getDataType(),_=S._data,k=S._size,L=S._datatype||S.getDataType(),Y=F[0],$=k[1],V,q=n,R=i;M&&L&&M===L&&typeof M=="string"&&M!=="mixed"&&(V=M,q=r.find(n,[V,V]),R=r.find(i,[V,V]));for(var j=[],U=0;U<$;U++){for(var oe=R(O[0],_[0][U]),me=1;mege)for(var xe=0,be=0;be(S,O)=>{o(or(S),or(O));var F=E(t(S),t(O));return Ge(F)?F.valueOf():F}),"Matrix, Matrix":function(S,O){var F=S.size(),M=O.size();return o(F,M),F.length===1?M.length===1?u(S,O,F[0]):p(S,O):M.length===1?h(S,O):x(S,O)},"Matrix, Array":r.referTo("Matrix,Matrix",E=>(S,O)=>E(S,t(O))),"Array, Matrix":r.referToSelf(E=>(S,O)=>E(t(S,O.storage()),O)),"SparseMatrix, any":function(S,O){return c(S,O,i,!1)},"DenseMatrix, any":function(S,O){return f(S,O,i,!1)},"any, SparseMatrix":function(S,O){return c(O,S,i,!0)},"any, DenseMatrix":function(S,O){return f(O,S,i,!0)},"Array, any":function(S,O){return f(t(S),O,i,!1).valueOf()},"any, Array":function(S,O){return f(t(O),S,i,!0).valueOf()},"any, any":i,"any, any, ...any":r.referToSelf(E=>(S,O,F)=>{for(var M=E(S,O),_=0;_{var{typed:r,matrix:t,equalScalar:n,BigNumber:i,concat:a}=e,s=hn({typed:r}),c=It({typed:r,equalScalar:n}),f=Do({typed:r,equalScalar:n}),o=Jr({typed:r,equalScalar:n}),u=vr({typed:r,matrix:t,concat:a});function p(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return r(bb,{number:cv,"number, number":cv,BigNumber:h=>d(h,new i(2)),"BigNumber, BigNumber":d,Complex:p,"Complex, number":p,Array:r.referTo("DenseMatrix,number",h=>x=>h(t(x),2).valueOf()),DenseMatrix:r.referTo("DenseMatrix,number",h=>x=>h(x,2)),SparseMatrix:r.referTo("SparseMatrix,number",h=>x=>h(x,2)),"SparseMatrix, SparseMatrix":r.referToSelf(h=>(x,v)=>{if(v.density()===1)return f(x,v,h);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":r.referToSelf(h=>(x,v)=>{if(v.density()===1)return s(x,v,h,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":r.referTo("DenseMatrix,SparseMatrix",h=>(x,v)=>h(t(x),v)),"number | BigNumber, SparseMatrix":r.referToSelf(h=>(x,v)=>{if(v.density()===1)return o(v,x,h,!0);throw new Error("Root must be non-zero")})},u({scalar:"number | BigNumber",SD:c,Ss:o,sS:!1}));function d(h,x){var v=i.precision,y=i.clone({precision:v+2}),w=new i(0),C=new y(1),b=x.isNegative();if(b&&(x=x.neg()),x.isZero())throw new Error("Root must be non-zero");if(h.isNegative()&&!x.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(h.isZero())return b?new y(1/0):0;if(!h.isFinite())return b?w:h;var A=h.abs().pow(C.div(x));return A=h.isNeg()?A.neg():A,new i((b?C.div(A):A).toPrecision(v))}});var Db="sign",m7=["typed","BigNumber","Fraction","complex"],Sb=T(Db,m7,e=>{var{typed:r,BigNumber:t,complex:n,Fraction:i}=e;return r(Db,{number:Bc,Complex:function(s){return s.im===0?n(Bc(s.re)):s.sign()},BigNumber:function(s){return new t(s.cmp(0))},Fraction:function(s){return new i(s.s,1)},"Array | Matrix":r.referToSelf(a=>s=>Je(s,a,!0)),Unit:r.referToSelf(a=>s=>{if(!s._isDerived()&&s.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return r.find(a,s.valueType())(s.value)})})});var d7="sqrt",h7=["config","typed","Complex"],Nb=T(d7,h7,e=>{var{config:r,typed:t,Complex:n}=e;return t("sqrt",{number:i,Complex:function(s){return s.sqrt()},BigNumber:function(s){return!s.isNegative()||r.predictable?s.sqrt():i(s.toNumber())},Unit:function(s){return s.pow(.5)}});function i(a){return isNaN(a)?NaN:a>=0||r.predictable?Math.sqrt(a):new n(a,0).sqrt()}});var Ab="square",v7=["typed"],Eb=T(Ab,v7,e=>{var{typed:r}=e;return r(Ab,{number:pv,Complex:function(n){return n.mul(n)},BigNumber:function(n){return n.times(n)},Fraction:function(n){return n.mul(n)},Unit:function(n){return n.pow(2)}})});var Cb="subtract",g7=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],Mb=T(Cb,g7,e=>{var{typed:r,matrix:t,equalScalar:n,subtractScalar:i,unaryMinus:a,DenseMatrix:s,concat:c}=e,f=hn({typed:r}),o=ft({typed:r}),u=wo({typed:r,equalScalar:n}),p=Un({typed:r,DenseMatrix:s}),d=Lr({typed:r,DenseMatrix:s}),h=vr({typed:r,matrix:t,concat:c});return r(Cb,{"any, any":i},h({elop:i,SS:u,DS:f,SD:o,Ss:d,sS:p}))});var _b="xgcd",x7=["typed","config","matrix","BigNumber"],Tb=T(_b,x7,e=>{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r(_b,{"number, number":function(c,f){var o=mv(c,f);return t.matrix==="Array"?o:n(o)},"BigNumber, BigNumber":a});function a(s,c){var f,o,u,p=new i(0),d=new i(1),h=p,x=d,v=d,y=p;if(!s.isInt()||!c.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!c.isZero();)o=s.div(c).floor(),u=s.mod(c),f=h,h=x.minus(o.times(h)),x=f,f=v,v=y.minus(o.times(v)),y=f,s=c,c=u;var w;return s.lt(p)?w=[s.neg(),x.neg(),y.neg()]:w=[s,s.isZero()?0:x,y],t.matrix==="Array"?w:n(w)}});var Fb="invmod",y7=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],Ob=T(Fb,y7,e=>{var{typed:r,config:t,BigNumber:n,xgcd:i,equal:a,smaller:s,mod:c,add:f,isInteger:o}=e;return r(Fb,{"number, number":u,"BigNumber, BigNumber":u});function u(p,d){if(!o(p)||!o(d))throw new Error("Parameters in function invmod must be integer numbers");if(p=c(p,d),a(d,0))throw new Error("Divisor must be non zero");var h=i(p,d);h=h.valueOf();var[x,v]=h;return a(x,n(1))?(v=c(v,d),s(v,n(0))&&(v=f(v,d)),v):NaN}});var b7="matAlgo09xS0Sf",w7=["typed","equalScalar"],Lc=T(b7,w7,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s){var c=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),d=a._values,h=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new pr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");var w=u[0],C=u[1],b,A=t,E=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),E=r.convert(0,b),S=r.find(s,[b,b]));var O=c&&d?[]:void 0,F=[],M=[],_=O?[]:void 0,k=[],L,Y,$,V,q;for(Y=0;Y{var{typed:r,matrix:t,equalScalar:n,multiplyScalar:i,concat:a}=e,s=It({typed:r,equalScalar:n}),c=Lc({typed:r,equalScalar:n}),f=Jr({typed:r,equalScalar:n}),o=vr({typed:r,matrix:t,concat:a});return r(Bb,o({elop:i,SS:c,DS:s,Ss:f}))});function Pb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitAnd");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);if(e.isZero()||r.eq(-1)||e.eq(r))return e;if(r.isZero()||e.eq(-1))return r;if(!e.isFinite()||!r.isFinite()){if(!e.isFinite()&&!r.isFinite())return e.isNegative()===r.isNegative()?e:new t(0);if(!e.isFinite())return r.isNegative()?e:e.isNegative()?new t(0):r;if(!r.isFinite())return e.isNegative()?r:r.isNegative()?new t(0):e}return e0(e,r,function(n,i){return n&i})}function au(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var r=e.constructor,t=r.precision;r.config({precision:1e9});var n=e.plus(new r(1));return n.s=-n.s||null,r.config({precision:t}),n}function kb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitOr");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);var n=new t(-1);return e.isZero()||r.eq(n)||e.eq(r)?r:r.isZero()||e.eq(n)?e:!e.isFinite()||!r.isFinite()?!e.isFinite()&&!e.isNegative()&&r.isNegative()||e.isNegative()&&!r.isNegative()&&!r.isFinite()?n:e.isNegative()&&r.isNegative()?e.isFinite()?e:r:e.isFinite()?r:e:e0(e,r,function(i,a){return i|a})}function e0(e,r,t){var n=e.constructor,i,a,s=+(e.s<0),c=+(r.s<0);if(s){i=qc(au(e));for(var f=0;f0;)t(u[--h],p[--x])===v&&(y=y.plus(w)),w=w.times(C);for(;x>0;)t(d,p[--x])===v&&(y=y.plus(w)),w=w.times(C);return n.config({precision:b}),v===0&&(y.s=-y.s),y}function qc(e){for(var r=e.d,t=r[0]+"",n=1;n0)if(++c>o)for(c-=o;c--;)f+="0";else c1&&((u[h+1]===null||u[h+1]===void 0)&&(u[h+1]=0),u[h+1]+=u[h]>>1,u[h]&=1)}return u.reverse()}function Rb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitXor");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);if(e.isZero())return r;if(r.isZero())return e;if(e.eq(r))return new t(0);var n=new t(-1);return e.eq(n)?au(r):r.eq(n)?au(e):!e.isFinite()||!r.isFinite()?!e.isFinite()&&!r.isFinite()?n:new t(e.isNegative()===r.isNegative()?1/0:-1/0):e0(e,r,function(i,a){return i^a})}function Lb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function leftShift");var t=e.constructor;return e.isNaN()||r.isNaN()||r.isNegative()&&!r.isZero()?new t(NaN):e.isZero()||r.isZero()?e:!e.isFinite()&&!r.isFinite()?new t(NaN):r.lt(55)?e.times(Math.pow(2,r.toNumber())+""):e.times(new t(2).pow(r))}function qb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function rightArithShift");var t=e.constructor;return e.isNaN()||r.isNaN()||r.isNegative()&&!r.isZero()?new t(NaN):e.isZero()||r.isZero()?e:r.isFinite()?r.lt(55)?e.div(Math.pow(2,r.toNumber())+"").floor():e.div(new t(2).pow(r)).floor():e.isNegative()?new t(-1):e.isFinite()?new t(0):new t(NaN)}var Ub="bitAnd",S7=["typed","matrix","equalScalar","concat"],Uc=T(Ub,S7,e=>{var{typed:r,matrix:t,equalScalar:n,concat:i}=e,a=It({typed:r,equalScalar:n}),s=Do({typed:r,equalScalar:n}),c=Jr({typed:r,equalScalar:n}),f=vr({typed:r,matrix:t,concat:i});return r(Ub,{"number, number":hv,"BigNumber, BigNumber":Pb},f({SS:s,DS:a,Ss:c}))});var zb="bitNot",N7=["typed"],Wb=T(zb,N7,e=>{var{typed:r}=e;return r(zb,{number:vv,BigNumber:au,"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var Vb="bitOr",A7=["typed","matrix","equalScalar","DenseMatrix","concat"],zc=T(Vb,A7,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=hn({typed:r}),c=iu({typed:r,equalScalar:n}),f=Un({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:t,concat:a});return r(Vb,{"number, number":gv,"BigNumber, BigNumber":kb},o({SS:c,DS:s,Ss:f}))});var E7="matAlgo07xSSf",C7=["typed","DenseMatrix"],Vt=T(E7,C7,e=>{var{typed:r,DenseMatrix:t}=e;return function(a,s,c){var f=a._size,o=a._datatype||a._data===void 0?a._datatype:a.getDataType(),u=s._size,p=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(f.length!==u.length)throw new pr(f.length,u.length);if(f[0]!==u[0]||f[1]!==u[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+u+")");var d=f[0],h=f[1],x,v=0,y=c;typeof o=="string"&&o===p&&o!=="mixed"&&(x=o,v=r.convert(0,x),y=r.find(c,[x,x]));var w,C,b=[];for(w=0;w{var{typed:r,matrix:t,DenseMatrix:n,concat:i}=e,a=ft({typed:r}),s=Vt({typed:r,DenseMatrix:n}),c=Lr({typed:r,DenseMatrix:n}),f=vr({typed:r,matrix:t,concat:i});return r(Yb,{"number, number":xv,"BigNumber, BigNumber":Rb},f({SS:s,DS:a,Ss:c}))});var Gb="arg",_7=["typed"],$b=T(Gb,_7,e=>{var{typed:r}=e;return r(Gb,{number:function(n){return Math.atan2(0,n)},BigNumber:function(n){return n.constructor.atan2(0,n)},Complex:function(n){return n.arg()},"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var Zb="conj",T7=["typed"],Qb=T(Zb,T7,e=>{var{typed:r}=e;return r(Zb,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.conjugate(),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var Xb="im",F7=["typed"],Jb=T(Xb,F7,e=>{var{typed:r}=e;return r(Xb,{number:()=>0,"BigNumber | Fraction":t=>t.mul(0),Complex:t=>t.im,"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var Kb="re",O7=["typed"],jb=T(Kb,O7,e=>{var{typed:r}=e;return r(Kb,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.re,"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var ew="not",B7=["typed"],rw=T(ew,B7,e=>{var{typed:r}=e;return r(ew,{"null | undefined":()=>!0,number:Nv,Complex:function(n){return n.re===0&&n.im===0},BigNumber:function(n){return n.isZero()||n.isNaN()},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var tw="or",I7=["typed","matrix","equalScalar","DenseMatrix","concat"],Wc=T(tw,I7,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),c=wo({typed:r,equalScalar:n}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:t,concat:a});return r(tw,{"number, number":Av,"Complex, Complex":function(p,d){return p.re!==0||p.im!==0||d.re!==0||d.im!==0},"BigNumber, BigNumber":function(p,d){return!p.isZero()&&!p.isNaN()||!d.isZero()&&!d.isNaN()},"Unit, Unit":r.referToSelf(u=>(p,d)=>u(p.value||0,d.value||0))},o({SS:c,DS:s,Ss:f}))});var nw="xor",P7=["typed","matrix","DenseMatrix","concat"],iw=T(nw,P7,e=>{var{typed:r,matrix:t,DenseMatrix:n,concat:i}=e,a=ft({typed:r}),s=Vt({typed:r,DenseMatrix:n}),c=Lr({typed:r,DenseMatrix:n}),f=vr({typed:r,matrix:t,concat:i});return r(nw,{"number, number":Ev,"Complex, Complex":function(u,p){return(u.re!==0||u.im!==0)!=(p.re!==0||p.im!==0)},"BigNumber, BigNumber":function(u,p){return(!u.isZero()&&!u.isNaN())!=(!p.isZero()&&!p.isNaN())},"Unit, Unit":r.referToSelf(o=>(u,p)=>o(u.value||0,p.value||0))},f({SS:s,DS:a,Ss:c}))});var aw="concat",k7=["typed","matrix","isInteger"],Vc=T(aw,k7,e=>{var{typed:r,matrix:t,isInteger:n}=e;return r(aw,{"...Array | Matrix | number | BigNumber":function(a){var s,c=a.length,f=-1,o,u=!1,p=[];for(s=0;s0&&f>o)throw new Xt(f,o+1)}else{var h=tr(d).valueOf(),x=or(h);if(p[s]=h,o=f,f=x.length-1,s>0&&f!==o)throw new pr(o+1,f+1)}}if(p.length===0)throw new SyntaxError("At least one matrix expected");for(var v=p.shift();p.length;)v=Rh(v,p.shift(),f);return u?t(v):v},"...string":function(a){return a.join("")}})});var ow="column",R7=["typed","Index","matrix","range"],Yc=T(ow,R7,e=>{var{typed:r,Index:t,matrix:n,range:i}=e;return r(ow,{"Matrix, number":a,"Array, number":function(c,f){return a(n(tr(c)),f).valueOf()}});function a(s,c){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");Xr(c,s.size()[1]);var f=i(0,s.size()[0]),o=new t(f,c),u=s.subset(o);return Ge(u)?u:n([[u]])}});var sw="count",L7=["typed","size","prod"],uw=T(sw,L7,e=>{var{typed:r,size:t,prod:n}=e;return r(sw,{string:function(a){return a.length},"Matrix | Array":function(a){return n(t(a))}})});var fw="cross",q7=["typed","matrix","subtract","multiply"],lw=T(fw,q7,e=>{var{typed:r,matrix:t,subtract:n,multiply:i}=e;return r(fw,{"Matrix, Matrix":function(c,f){return t(a(c.toArray(),f.toArray()))},"Matrix, Array":function(c,f){return t(a(c.toArray(),f))},"Array, Matrix":function(c,f){return t(a(c,f.toArray()))},"Array, Array":a});function a(s,c){var f=Math.max(or(s).length,or(c).length);s=Zs(s),c=Zs(c);var o=or(s),u=or(c);if(o.length!==1||u.length!==1||o[0]!==3||u[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+o.join(", ")+"], B = ["+u.join(", ")+"])");var p=[n(i(s[1],c[2]),i(s[2],c[1])),n(i(s[2],c[0]),i(s[0],c[2])),n(i(s[0],c[1]),i(s[1],c[0]))];return f>1?[p]:p}});var cw="diag",U7=["typed","matrix","DenseMatrix","SparseMatrix"],pw=T(cw,U7,e=>{var{typed:r,matrix:t,DenseMatrix:n,SparseMatrix:i}=e;return r(cw,{Array:function(o){return a(o,0,or(o),null)},"Array, number":function(o,u){return a(o,u,or(o),null)},"Array, BigNumber":function(o,u){return a(o,u.toNumber(),or(o),null)},"Array, string":function(o,u){return a(o,0,or(o),u)},"Array, number, string":function(o,u,p){return a(o,u,or(o),p)},"Array, BigNumber, string":function(o,u,p){return a(o,u.toNumber(),or(o),p)},Matrix:function(o){return a(o,0,o.size(),o.storage())},"Matrix, number":function(o,u){return a(o,u,o.size(),o.storage())},"Matrix, BigNumber":function(o,u){return a(o,u.toNumber(),o.size(),o.storage())},"Matrix, string":function(o,u){return a(o,0,o.size(),u)},"Matrix, number, string":function(o,u,p){return a(o,u,o.size(),p)},"Matrix, BigNumber, string":function(o,u,p){return a(o,u.toNumber(),o.size(),p)}});function a(f,o,u,p){if(!He(o))throw new TypeError("Second parameter in function diag must be an integer");var d=o>0?o:0,h=o<0?-o:0;switch(u.length){case 1:return s(f,o,p,u[0],h,d);case 2:return c(f,o,p,u,h,d)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function s(f,o,u,p,d,h){var x=[p+d,p+h];if(u&&u!=="sparse"&&u!=="dense")throw new TypeError("Unknown matrix type ".concat(u,'"'));var v=u==="sparse"?i.diagonal(x,f,o):n.diagonal(x,f,o);return u!==null?v:v.valueOf()}function c(f,o,u,p,d,h){if(Ge(f)){var x=f.diagonal(o);return u!==null?u!==x.storage()?t(x,u):x:x.valueOf()}for(var v=Math.min(p[0]-d,p[1]-h),y=[],w=0;w=2&&v.push("index: ".concat(_r(t))),h.length>=3&&v.push("array: ".concat(_r(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(e.name,"(").concat(v.join(", "),") at index ").concat(JSON.stringify(t)))}else throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(y.message))}}}var z7="filter",W7=["typed"],dw=T(z7,W7,e=>{var{typed:r}=e;return r("filter",{"Array, function":mw,"Matrix, function":function(n,i){return n.create(mw(n.toArray(),i))},"Array, RegExp":Qs,"Matrix, RegExp":function(n,i){return n.create(Qs(n.toArray(),i))}})});function mw(e,r){return bc(e,function(t,n,i){return gi(r,t,[n],i,"filter")})}var hw="flatten",V7=["typed","matrix"],vw=T(hw,V7,e=>{var{typed:r,matrix:t}=e;return r(hw,{Array:function(i){return gr(i)},Matrix:function(i){var a=gr(i.toArray());return t(a)}})});var gw="forEach",Y7=["typed"],xw=T(gw,Y7,e=>{var{typed:r}=e;return r(gw,{"Array, function":H7,"Matrix, function":function(n,i){n.forEach(i)}})});function H7(e,r){var t=function n(i,a){if(Array.isArray(i))po(i,function(s,c){n(s,a.concat(c))});else return gi(r,i,a,e,"forEach")};t(e,[])}var yw="getMatrixDataType",G7=["typed"],bw=T(yw,G7,e=>{var{typed:r}=e;return r(yw,{Array:function(n){return mo(n,_r)},Matrix:function(n){return n.getDataType()}})});var ww="identity",$7=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],Dw=T(ww,$7,e=>{var{typed:r,config:t,matrix:n,BigNumber:i,DenseMatrix:a,SparseMatrix:s}=e;return r(ww,{"":function(){return t.matrix==="Matrix"?n([]):[]},string:function(u){return n(u)},"number | BigNumber":function(u){return f(u,u,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(u,p){return f(u,u,p)},"number | BigNumber, number | BigNumber":function(u,p){return f(u,p,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(u,p,d){return f(u,p,d)},Array:function(u){return c(u)},"Array, string":function(u,p){return c(u,p)},Matrix:function(u){return c(u.valueOf(),u.storage())},"Matrix, string":function(u,p){return c(u.valueOf(),p)}});function c(o,u){switch(o.length){case 0:return u?n(u):[];case 1:return f(o[0],o[0],u);case 2:return f(o[0],o[1],u);default:throw new Error("Vector containing two values expected")}}function f(o,u,p){var d=je(o)||je(u)?i:null;if(je(o)&&(o=o.toNumber()),je(u)&&(u=u.toNumber()),!He(o)||o<1)throw new Error("Parameters in function identity must be positive integers");if(!He(u)||u<1)throw new Error("Parameters in function identity must be positive integers");var h=d?new i(1):1,x=d?new d(0):0,v=[o,u];if(p){if(p==="sparse")return s.diagonal(v,h,0,x);if(p==="dense")return a.diagonal(v,h,0,x);throw new TypeError('Unknown matrix type "'.concat(p,'"'))}for(var y=Wi([],v,x),w=o{var{typed:r,matrix:t,multiplyScalar:n}=e;return r(Sw,{"Matrix, Matrix":function(s,c){return t(i(s.toArray(),c.toArray()))},"Matrix, Array":function(s,c){return t(i(s.toArray(),c))},"Array, Matrix":function(s,c){return t(i(s,c.toArray()))},"Array, Array":i});function i(a,s){if(or(a).length===1&&(a=[a]),or(s).length===1&&(s=[s]),or(a).length>2||or(s).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(a.length)+", y = "+JSON.stringify(s.length)+")");var c=[],f=[];return a.map(function(o){return s.map(function(u){return f=[],c.push(f),o.map(function(p){return u.map(function(d){return f.push(n(p,d))})})})})&&c}});var Aw="map",Q7=["typed"],Ew=T(Aw,Q7,e=>{var{typed:r}=e;return r(Aw,{"Array, function":X7,"Matrix, function":function(n,i){return n.map(i)}})});function X7(e,r){var t=function n(i,a){return Array.isArray(i)?i.map(function(s,c){return n(s,a.concat(c))}):gi(r,i,a,e,"map")};return t(e,[])}var Cw="diff",J7=["typed","matrix","subtract","number"],Hc=T(Cw,J7,e=>{var{typed:r,matrix:t,subtract:n,number:i}=e;return r(Cw,{"Array | Matrix":function(u){return Ge(u)?t(s(u.toArray())):s(u)},"Array | Matrix, number":function(u,p){if(!He(p))throw new RangeError("Dimension must be a whole number");return Ge(u)?t(a(u.toArray(),p)):a(u,p)},"Array, BigNumber":r.referTo("Array,number",o=>(u,p)=>o(u,i(p))),"Matrix, BigNumber":r.referTo("Matrix,number",o=>(u,p)=>o(u,i(p)))});function a(o,u){if(Ge(o)&&(o=o.toArray()),!Array.isArray(o))throw RangeError("Array/Matrix does not have that many dimensions");if(u>0){var p=[];return o.forEach(d=>{p.push(a(d,u-1))}),p}else{if(u===0)return s(o);throw RangeError("Cannot have negative dimension")}}function s(o){for(var u=[],p=o.length,d=1;d{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r("ones",{"":function(){return t.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(o){var u=o[o.length-1];if(typeof u=="string"){var p=o.pop();return a(o,p)}else return t.matrix==="Array"?a(o):a(o,"default")},Array:a,Matrix:function(o){var u=o.storage();return a(o.valueOf(),u)},"Array | Matrix, string":function(o,u){return a(o.valueOf(),u)}});function a(f,o){var u=s(f),p=u?new i(1):1;if(c(f),o){var d=n(o);return f.length>0?d.resize(f,p):d}else{var h=[];return f.length>0?Wi(h,f,p):h}}function s(f){var o=!1;return f.forEach(function(u,p,d){je(u)&&(o=!0,d[p]=u.toNumber())}),o}function c(f){f.forEach(function(o){if(typeof o!="number"||!He(o)||o<0)throw new Error("Parameters in function ones must be positive integers")})}});function ou(){throw new Error('No "bignumber" implementation available')}function Gc(){throw new Error('No "fraction" implementation available')}function $c(){throw new Error('No "matrix" implementation available')}var _w="range",eL=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Zc=T(_w,eL,e=>{var{typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:c,largerEq:f,add:o,isPositive:u}=e;return r(_w,{string:d,"string, boolean":d,"number, number":function(y,w){return p(h(y,w,1,!1))},"number, number, number":function(y,w,C){return p(h(y,w,C,!1))},"number, number, boolean":function(y,w,C){return p(h(y,w,1,C))},"number, number, number, boolean":function(y,w,C,b){return p(h(y,w,C,b))},"BigNumber, BigNumber":function(y,w){var C=y.constructor;return p(h(y,w,new C(1),!1))},"BigNumber, BigNumber, BigNumber":function(y,w,C){return p(h(y,w,C,!1))},"BigNumber, BigNumber, boolean":function(y,w,C){var b=y.constructor;return p(h(y,w,new b(1),C))},"BigNumber, BigNumber, BigNumber, boolean":function(y,w,C,b){return p(h(y,w,C,b))},"Unit, Unit, Unit":function(y,w,C){return p(h(y,w,C,!1))},"Unit, Unit, Unit, boolean":function(y,w,C,b){return p(h(y,w,C,b))}});function p(v){return t.matrix==="Matrix"?n?n(v):$c():v}function d(v,y){var w=x(v);if(!w)throw new SyntaxError('String "'+v+'" is no valid range');return t.number==="BigNumber"?(i===void 0&&ou(),p(h(i(w.start),i(w.end),i(w.step)),y)):p(h(w.start,w.end,w.step,y))}function h(v,y,w,C){for(var b=[],A=u(w)?C?s:a:C?f:c,E=v;A(E,y);)b.push(E),E=o(E,w);return b}function x(v){var y=v.split(":"),w=y.map(function(b){return Number(b)}),C=w.some(function(b){return isNaN(b)});if(C)return null;switch(w.length){case 2:return{start:w[0],end:w[1],step:1};case 3:return{start:w[0],end:w[2],step:w[1]};default:return null}}});var Tw="reshape",rL=["typed","isInteger","matrix"],Fw=T(Tw,rL,e=>{var{typed:r,isInteger:t}=e;return r(Tw,{"Matrix, Array":function(i,a){return i.reshape(a,!0)},"Array, Array":function(i,a){return a.forEach(function(s){if(!t(s))throw new TypeError("Invalid size for dimension: "+s)}),hf(i,a)}})});var tL="resize",nL=["config","matrix"],Ow=T(tL,nL,e=>{var{config:r,matrix:t}=e;return function(a,s,c){if(arguments.length!==2&&arguments.length!==3)throw new jn("resize",arguments.length,2,3);if(Ge(s)&&(s=s.valueOf()),je(s[0])&&(s=s.map(function(u){return je(u)?u.toNumber():u})),Ge(a))return a.resize(s,c,!0);if(typeof a=="string")return n(a,s,c);var f=Array.isArray(a)?!1:r.matrix!=="Array";if(s.length===0){for(;Array.isArray(a);)a=a[0];return tr(a)}else{Array.isArray(a)||(a=[a]),a=tr(a);var o=Wi(a,s,c);return f?t(o):o}};function n(i,a,s){if(s!==void 0){if(typeof s!="string"||s.length!==1)throw new TypeError("Single character expected as defaultValue")}else s=" ";if(a.length!==1)throw new pr(a.length,1);var c=a[0];if(typeof c!="number"||!He(c))throw new TypeError("Invalid size, must contain positive integers (size: "+lr(a)+")");if(i.length>c)return i.substring(0,c);if(i.length{var{typed:r,multiply:t,rotationMatrix:n}=e;return r(Bw,{"Array , number | BigNumber | Complex | Unit":function(s,c){i(s,2);var f=t(n(c),s);return f.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(s,c){return i(s,2),t(n(c),s)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(s,c,f){i(s,3);var o=t(n(c,f),s);return o},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(s,c,f){return i(s,3),t(n(c,f),s)}});function i(a,s){var c=Array.isArray(a)?or(a):a.size();if(c.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(s));if(c.length===2&&c[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(s));if(c[0]!==s)throw new RangeError("Vector must be of dimensions 1x".concat(s))}});var Pw="rotationMatrix",aL=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],kw=T(Pw,aL,e=>{var{typed:r,config:t,multiplyScalar:n,addScalar:i,unaryMinus:a,norm:s,BigNumber:c,matrix:f,DenseMatrix:o,SparseMatrix:u,cos:p,sin:d}=e;return r(Pw,{"":function(){return t.matrix==="Matrix"?f([]):[]},string:function(b){return f(b)},"number | BigNumber | Complex | Unit":function(b){return h(b,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(b,A){return h(b,A)},"number | BigNumber | Complex | Unit, Array":function(b,A){var E=f(A);return x(E),w(b,E,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(b,A){x(A);var E=A.storage()||(t.matrix==="Matrix"?"dense":void 0);return w(b,A,E)},"number | BigNumber | Complex | Unit, Array, string":function(b,A,E){var S=f(A);return x(S),w(b,S,E)},"number | BigNumber | Complex | Unit, Matrix, string":function(b,A,E){return x(A),w(b,A,E)}});function h(C,b){var A=je(C),E=A?new c(-1):-1,S=p(C),O=d(C),F=[[S,n(E,O)],[O,S]];return y(F,b)}function x(C){var b=C.size();if(b.length<1||b[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function v(C){return C.reduce((b,A)=>n(b,A))}function y(C,b){if(b){if(b==="sparse")return new u(C);if(b==="dense")return new o(C);throw new TypeError('Unknown matrix type "'.concat(b,'"'))}return C}function w(C,b,A){var E=s(b);if(E===0)throw new RangeError("Rotation around zero vector");var S=je(C)?c:null,O=S?new S(1):1,F=S?new S(-1):-1,M=S?new S(b.get([0])/E):b.get([0])/E,_=S?new S(b.get([1])/E):b.get([1])/E,k=S?new S(b.get([2])/E):b.get([2])/E,L=p(C),Y=i(O,a(L)),$=d(C),V=i(L,v([M,M,Y])),q=i(v([M,_,Y]),v([F,k,$])),R=i(v([M,k,Y]),v([_,$])),j=i(v([M,_,Y]),v([k,$])),U=i(L,v([_,_,Y])),oe=i(v([_,k,Y]),v([F,M,$])),me=i(v([M,k,Y]),v([F,_,$])),ie=i(v([_,k,Y]),v([M,$])),H=i(L,v([k,k,Y])),ce=[[V,q,R],[j,U,oe],[me,ie,H]];return y(ce,A)}});var Rw="row",oL=["typed","Index","matrix","range"],Qc=T(Rw,oL,e=>{var{typed:r,Index:t,matrix:n,range:i}=e;return r(Rw,{"Matrix, number":a,"Array, number":function(c,f){return a(n(tr(c)),f).valueOf()}});function a(s,c){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");Xr(c,s.size()[0]);var f=i(0,s.size()[1]),o=new t(c,f),u=s.subset(o);return Ge(u)?u:n([[u]])}});var Lw="size",sL=["typed","config","?matrix"],qw=T(Lw,sL,e=>{var{typed:r,config:t,matrix:n}=e;return r(Lw,{Matrix:function(a){return a.create(a.size())},Array:or,string:function(a){return t.matrix==="Array"?[a.length]:n([a.length])},"number | Complex | BigNumber | Unit | boolean | null":function(a){return t.matrix==="Array"?[]:n?n([]):$c()}})});var Uw="squeeze",uL=["typed","matrix"],zw=T(Uw,uL,e=>{var{typed:r,matrix:t}=e;return r(Uw,{Array:function(i){return Zs(tr(i))},Matrix:function(i){var a=Zs(i.toArray());return Array.isArray(a)?t(a):a},any:function(i){return tr(i)}})});var Ww="subset",fL=["typed","matrix","zeros","add"],Xc=T(Ww,fL,e=>{var{typed:r,matrix:t,zeros:n,add:i}=e;return r(Ww,{"Matrix, Index":function(c,f){return Ko(f)?t():(df(c,f),c.subset(f))},"Array, Index":r.referTo("Matrix, Index",function(s){return function(c,f){var o=s(t(c),f);return f.isScalar()?o:o.valueOf()}}),"Object, Index":cL,"string, Index":lL,"Matrix, Index, any, any":function(c,f,o,u){return Ko(f)?c:(df(c,f),c.clone().subset(f,a(o,f),u))},"Array, Index, any, any":r.referTo("Matrix, Index, any, any",function(s){return function(c,f,o,u){var p=s(t(c),f,o,u);return p.isMatrix?p.valueOf():p}}),"Array, Index, any":r.referTo("Matrix, Index, any, any",function(s){return function(c,f,o){return s(t(c),f,o,void 0).valueOf()}}),"Matrix, Index, any":r.referTo("Matrix, Index, any, any",function(s){return function(c,f,o){return s(c,f,o,void 0)}}),"string, Index, string":Vw,"string, Index, string, string":Vw,"Object, Index, any":pL});function a(s,c){if(typeof s=="string")throw new Error("can't boradcast a string");if(c._isScalar)return s;var f=c.size();if(f.every(o=>o>0))try{return i(s,n(f))}catch{return s}else return s}});function lL(e,r){if(!sa(r))throw new TypeError("Index expected");if(Ko(r))return"";if(df(Array.from(e),r),r.size().length!==1)throw new pr(r.size().length,1);var t=e.length;Xr(r.min()[0],t),Xr(r.max()[0],t);var n=r.dimension(0),i="";return n.forEach(function(a){i+=e.charAt(a)}),i}function Vw(e,r,t,n){if(!r||r.isIndex!==!0)throw new TypeError("Index expected");if(Ko(r))return e;if(df(Array.from(e),r),r.size().length!==1)throw new pr(r.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=r.dimension(0),a=i.size()[0];if(a!==t.length)throw new pr(i.size()[0],t.length);var s=e.length;Xr(r.min()[0]),Xr(r.max()[0]);for(var c=[],f=0;fs)for(var o=s-1,u=c.length;o{var{typed:r,matrix:t}=e;return r(Yw,{Array:s=>n(t(s)).valueOf(),Matrix:n,any:tr});function n(s){var c=s.size(),f;switch(c.length){case 1:f=s.clone();break;case 2:{var o=c[0],u=c[1];if(u===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+lr(c)+")");switch(s.storage()){case"dense":f=i(s,o,u);break;case"sparse":f=a(s,o,u);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+lr(c)+")")}return f}function i(s,c,f){for(var o=s._data,u=[],p,d=0;d{var{typed:r,transpose:t,conj:n}=e;return r(Gw,{any:function(a){return n(t(a))}})});var Zw="zeros",hL=["typed","config","matrix","BigNumber"],Qw=T(Zw,hL,e=>{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r(Zw,{"":function(){return t.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(o){var u=o[o.length-1];if(typeof u=="string"){var p=o.pop();return a(o,p)}else return t.matrix==="Array"?a(o):a(o,"default")},Array:a,Matrix:function(o){var u=o.storage();return a(o.valueOf(),u)},"Array | Matrix, string":function(o,u){return a(o.valueOf(),u)}});function a(f,o){var u=s(f),p=u?new i(0):0;if(c(f),o){var d=n(o);return f.length>0?d.resize(f,p):d}else{var h=[];return f.length>0?Wi(h,f,p):h}}function s(f){var o=!1;return f.forEach(function(u,p,d){je(u)&&(o=!0,d[p]=u.toNumber())}),o}function c(f){f.forEach(function(o){if(typeof o!="number"||!He(o)||o<0)throw new Error("Parameters in function zeros must be positive integers")})}});var Xw="fft",vL=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],Jw=T(Xw,vL,e=>{var{typed:r,matrix:t,addScalar:n,multiplyScalar:i,divideScalar:a,exp:s,tau:c,i:f,dotDivide:o,conj:u,pow:p,ceil:d,log2:h}=e;return r(Xw,{Array:x,Matrix:function(b){return b.create(x(b.toArray()))}});function x(C){var b=or(C);return b.length===1?w(C,b[0]):v(C.map(A=>x(A,b.slice(1))),0)}function v(C,b){var A=or(C);if(b!==0)return new Array(A[0]).fill(0).map((S,O)=>v(C[O],b-1));if(A.length===1)return w(C);function E(S){var O=or(S);return new Array(O[1]).fill(0).map((F,M)=>new Array(O[0]).fill(0).map((_,k)=>S[k][M]))}return E(v(E(C),1))}function y(C){for(var b=C.length,A=s(a(i(-1,i(f,c)),b)),E=[],S=1-b;Si(C[R],E[b-1+R])),...new Array(O-b).fill(0)],M=[...new Array(b+b-1).fill(0).map((q,R)=>a(1,E[R])),...new Array(O-(b+b-1)).fill(0)],_=w(F),k=w(M),L=new Array(O).fill(0).map((q,R)=>i(_[R],k[R])),Y=o(u(x(u(L))),O),$=[],V=b-1;VM%2===0),b/2),...w(C.filter((F,M)=>M%2===1),b/2)],E=0;E{var{typed:r,fft:t,dotDivide:n,conj:i}=e;return r(Kw,{"Array | Matrix":function(s){var c=Ge(s)?s.size():or(s);return n(i(t(i(s))),c.reduce((f,o)=>f*o,1))}})});function eD(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function xL(e){for(var r=1;r{var{typed:r,add:t,subtract:n,multiply:i,divide:a,max:s,map:c,abs:f,isPositive:o,isNegative:u,larger:p,smaller:d,matrix:h,bignumber:x,unaryMinus:v}=e;function y(F){return function(M,_,k,L){var Y=!(_.length===2&&(_.every(S)||_.every(qt)));if(Y)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var $=_[0],V=_[1],q=p(V,$),R=L.firstStep;if(R!==void 0&&!o(R))throw new Error('"firstStep" must be positive');var j=L.maxStep;if(j!==void 0&&!o(j))throw new Error('"maxStep" must be positive');var U=L.minStep;if(U&&u(U))throw new Error('"minStep" must be positive or zero');var oe=[$,V,R,U,j].filter(Le=>Le!==void 0);if(!(oe.every(S)||oe.every(qt)))throw new Error('Inconsistent type of "t" dependant variables');for(var me=1,ie=L.tol?L.tol:1e-4,H=L.minDelta?L.minDelta:.2,ce=L.maxDelta?L.maxDelta:5,Me=L.maxIter?L.maxIter:1e4,pe=[$,V,...k,j,U].some(je),[ge,Se,xe,be]=pe?[x(F.a),x(F.c),x(F.b),x(F.bp)]:[F.a,F.c,F.b,F.bp],De=R?q?R:v(R):a(n(V,$),me),Ae=[$],ze=[k],Ze=n(xe,be),K=0,te=0,ye=A(q),ee=E(q);ye(Ae[K],V);){var ne=[];De=ee(Ae[K],V,De),ne.push(M(Ae[K],ze[K]));for(var ue=1;ueqt(Le)?Le.value:Le)));Ee1/4&&(Ae.push(t(Ae[K],De)),ze.push(t(ze[K],i(De,xe,ne))),K++);var Ce=.84*(ie/Ee)**(1/5);if(d(Ce,H)?Ce=H:p(Ce,ce)&&(Ce=ce),Ce=pe?x(Ce):Ce,De=i(De,Ce),j&&p(f(De),j)?De=q?j:v(j):U&&d(f(De),U)&&(De=q?U:v(U)),te++,te>Me)throw new Error("Maximum number of iterations reached, try changing options")}return{t:Ae,y:ze}}}function w(F,M,_,k){var L=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],Y=[null,1/2,3/4,1],$=[2/9,1/3,4/9,0],V=[7/24,1/4,1/3,1/8],q={a:L,c:Y,b:$,bp:V};return y(q)(F,M,_,k)}function C(F,M,_,k){var L=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],Y=[null,1/5,3/10,4/5,8/9,1,1],$=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],V=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],q={a:L,c:Y,b:$,bp:V};return y(q)(F,M,_,k)}function b(F,M,_,k){var L=k.method?k.method:"RK45",Y={RK23:w,RK45:C};if(L.toUpperCase()in Y){var $=xL({},k);return delete $.method,Y[L.toUpperCase()](F,M,_,$)}else{var V=Object.keys(Y).map(R=>'"'.concat(R,'"')),q="".concat(V.slice(0,-1).join(", ")," and ").concat(V.slice(-1));throw new Error('Unavailable method "'.concat(L,'". Available methods are ').concat(q))}}function A(F){return F?d:p}function E(F){var M=F?p:d;return function(_,k,L){var Y=t(_,L);return M(Y,k)?n(k,_):L}}function S(F){return je(F)||ar(F)}function O(F,M,_,k){var L=b(F,M.toArray(),_.toArray(),k);return{t:h(L.t),y:h(L.y)}}return r("solveODE",{"function, Array, Array, Object":b,"function, Matrix, Matrix, Object":O,"function, Array, Array":(F,M,_)=>b(F,M,_,{}),"function, Matrix, Matrix":(F,M,_)=>O(F,M,_,{}),"function, Array, number | BigNumber | Unit":(F,M,_)=>{var k=b(F,M,[_],{});return{t:k.t,y:k.y.map(L=>L[0])}},"function, Matrix, number | BigNumber | Unit":(F,M,_)=>{var k=b(F,M.toArray(),[_],{});return{t:h(k.t),y:h(k.y.map(L=>L[0]))}},"function, Array, number | BigNumber | Unit, Object":(F,M,_,k)=>{var L=b(F,M,[_],k);return{t:L.t,y:L.y.map(Y=>Y[0])}},"function, Matrix, number | BigNumber | Unit, Object":(F,M,_,k)=>{var L=b(F,M.toArray(),[_],k);return{t:h(L.t),y:h(L.y.map(Y=>Y[0]))}}})});var wL="erf",DL=["typed"],tD=T(wL,DL,e=>{var{typed:r}=e;return r("name",{number:function(s){var c=Math.abs(s);return c>=AL?di(s):c<=SL?di(s)*t(c):c<=4?di(s)*(1-n(c)):di(s)*(1-i(c))},"Array | Matrix":r.referToSelf(a=>s=>Je(s,a))});function t(a){var s=a*a,c=La[0][4]*s,f=s,o;for(o=0;o<3;o+=1)c=(c+La[0][o])*s,f=(f+su[0][o])*s;return a*(c+La[0][3])/(f+su[0][3])}function n(a){var s=La[1][8]*a,c=a,f;for(f=0;f<7;f+=1)s=(s+La[1][f])*a,c=(c+su[1][f])*a;var o=(s+La[1][7])/(c+su[1][7]),u=parseInt(a*16)/16,p=(a-u)*(a+u);return Math.exp(-u*u)*Math.exp(-p)*o}function i(a){var s=1/(a*a),c=La[2][5]*s,f=s,o;for(o=0;o<4;o+=1)c=(c+La[2][o])*s,f=(f+su[2][o])*s;var u=s*(c+La[2][4])/(f+su[2][4]);u=(NL-u)/a,s=parseInt(a*16)/16;var p=(a-s)*(a+s);return Math.exp(-s*s)*Math.exp(-p)*u}}),SL=.46875,NL=.5641895835477563,La=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],su=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],AL=Math.pow(2,53);var nD="zeta",EL=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],iD=T(nD,EL,e=>{var{typed:r,config:t,multiply:n,pow:i,divide:a,factorial:s,equal:c,smallerEq:f,isNegative:o,gamma:u,sin:p,subtract:d,add:h,Complex:x,BigNumber:v,pi:y}=e;return r(nD,{number:S=>w(S,O=>O,()=>20),BigNumber:S=>w(S,O=>new v(O),()=>Math.abs(Math.log10(t.epsilon))),Complex:C});function w(S,O,F){return c(S,0)?O(-.5):c(S,1)?O(NaN):isFinite(S)?b(S,O,F,M=>M):o(S)?O(NaN):O(1)}function C(S){return S.re===0&&S.im===0?new x(-.5):S.re===1?new x(NaN,NaN):S.re===1/0&&S.im===0?new x(1):S.im===1/0||S.re===-1/0?new x(NaN,NaN):b(S,O=>O,O=>Math.round(1.3*15+.9*Math.abs(O.im)),O=>O.re)}function b(S,O,F,M){var _=F(S);if(M(S)>-(_-1)/2)return E(S,O(_),O);var k=n(i(2,S),i(O(y),d(S,1)));return k=n(k,p(n(a(O(y),2),S))),k=n(k,u(d(1,S))),n(k,b(d(1,S),O,F,M))}function A(S,O){for(var F=S,M=S;f(M,O);M=h(M,1)){var _=a(n(s(h(O,d(M,1))),i(4,M)),n(s(d(O,M)),s(n(2,M))));F=h(F,_)}return n(O,F)}function E(S,O,F){for(var M=a(1,n(A(F(0),O),d(1,i(2,d(1,S))))),_=F(0),k=F(1);f(k,O);k=h(k,1))_=h(_,a(n((-1)**(k-1),A(k,O)),i(k,S)));return n(M,_)}});var aD="mode",CL=["typed","isNaN","isNumeric"],oD=T(aD,CL,e=>{var{typed:r,isNaN:t,isNumeric:n}=e;return r(aD,{"Array | Matrix":i,"...":function(s){return i(s)}});function i(a){a=gr(a.valueOf());var s=a.length;if(s===0)throw new Error("Cannot calculate mode of an empty array");for(var c={},f=[],o=0,u=0;uo&&(o=c[p],f=[p])}return f}});function St(e,r,t){var n;return String(e).indexOf("Unexpected type")!==-1?(n=arguments.length>2?" (type: "+_r(t)+", value: "+JSON.stringify(t)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+r+", unexpected type of argument"+n)):String(e).indexOf("complex numbers")!==-1?(n=arguments.length>2?" (type: "+_r(t)+", value: "+JSON.stringify(t)+")":"",new TypeError("Cannot calculate "+r+", no ordering relation is defined for complex numbers"+n)):e}var sD="prod",ML=["typed","config","multiplyScalar","numeric"],uD=T(sD,ML,e=>{var{typed:r,config:t,multiplyScalar:n,numeric:i}=e;return r(sD,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(c,f){throw new Error("prod(A, dim) is not yet supported")},"...":function(c){return a(c)}});function a(s){var c;if(dn(s,function(f){try{c=c===void 0?f:n(c,f)}catch(o){throw St(o,"prod",f)}}),typeof c=="string"&&(c=i(c,t.number)),c===void 0)throw new Error("Cannot calculate prod of an empty array");return c}});var fD="format",_L=["typed"],lD=T(fD,_L,e=>{var{typed:r}=e;return r(fD,{any:lr,"any, Object | function | number | BigNumber":lr})});var cD="bin",TL=["typed","format"],pD=T(cD,TL,e=>{var{typed:r,format:t}=e;return r(cD,{"number | BigNumber":function(i){return t(i,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(i,a){return t(i,{notation:"bin",wordSize:a})}})});var mD="oct",FL=["typed","format"],dD=T(mD,FL,e=>{var{typed:r,format:t}=e;return r(mD,{"number | BigNumber":function(i){return t(i,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(i,a){return t(i,{notation:"oct",wordSize:a})}})});var hD="hex",OL=["typed","format"],vD=T(hD,OL,e=>{var{typed:r,format:t}=e;return r(hD,{"number | BigNumber":function(i){return t(i,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(i,a){return t(i,{notation:"hex",wordSize:a})}})});var Jc=/\\$([\\w.]+)/g;var gD="print",BL=["typed"],Kc=T(gD,BL,e=>{var{typed:r}=e;return r(gD,{"string, Object | Array":xD,"string, Object | Array, number | Object":xD})});function xD(e,r,t){return e.replace(Jc,function(n,i){var a=i.split("."),s=r[a.shift()];for(s!==void 0&&s.isMatrix&&(s=s.toArray());a.length&&s!==void 0;){var c=a.shift();s=c?s[c]:s+"."}return s!==void 0?yt(s)?s:lr(s,t):n})}var yD="to",IL=["typed","matrix","concat"],bD=T(yD,IL,e=>{var{typed:r,matrix:t,concat:n}=e,i=vr({typed:r,matrix:t,concat:n});return r(yD,{"Unit, Unit | string":(a,s)=>a.to(s)},i({Ds:!0}))});var wD="isPrime",PL=["typed"],DD=T(wD,PL,e=>{var{typed:r}=e;return r(wD,{number:function(n){if(n*0!==0)return!1;if(n<=3)return n>1;if(n%2===0||n%3===0)return!1;for(var i=5;i*i<=n;i+=6)if(n%i===0||n%(i+2)===0)return!1;return!0},BigNumber:function(n){if(n.toNumber()*0!==0)return!1;if(n.lte(3))return n.gt(1);if(n.mod(2).eq(0)||n.mod(3).eq(0))return!1;if(n.lt(Math.pow(2,32))){for(var i=n.toNumber(),a=5;a*a<=i;a+=6)if(i%a===0||i%(a+2)===0)return!1;return!0}function s(C,b,A){for(var E=1;!b.eq(0);)b.mod(2).eq(0)?(b=b.div(2),C=C.mul(C).mod(A)):(b=b.sub(1),E=C.mul(E).mod(A));return E}var c=n.constructor.clone({precision:n.toFixed(0).length*2});n=new c(n);for(var f=0,o=n.sub(1);o.mod(2).eq(0);)o=o.div(2),f+=1;var u=null;if(n.lt("3317044064679887385961981"))u=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(C=>Cn=>Je(n,t))})});var kL="numeric",RL=["number","?bignumber","?fraction"],SD=T(kL,RL,e=>{var{number:r,bignumber:t,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:s=>r(s),BigNumber:t?s=>t(s):ou,Fraction:n?s=>n(s):Gc};return function(c){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",o=arguments.length>2?arguments[2]:void 0;if(o!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var u=_r(c);if(!(u in i))throw new TypeError("Cannot convert "+c+' of type "'+u+'"; valid input types are '+Object.keys(i).join(", "));if(!(f in a))throw new TypeError("Cannot convert "+c+' to type "'+f+'"; valid output types are '+Object.keys(a).join(", "));return f===u?c:a[f](c)}});var ND="divideScalar",LL=["typed","numeric"],AD=T(ND,LL,e=>{var{typed:r,numeric:t}=e;return r(ND,{"number, number":function(i,a){return i/a},"Complex, Complex":function(i,a){return i.div(a)},"BigNumber, BigNumber":function(i,a){return i.div(a)},"Fraction, Fraction":function(i,a){return i.div(a)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,i)=>n.divide(i),"number | Fraction | Complex | BigNumber, Unit":(n,i)=>i.divideInto(n)})});var ED="pow",qL=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],CD=T(ED,qL,e=>{var{typed:r,config:t,identity:n,multiply:i,matrix:a,inv:s,number:c,fraction:f,Complex:o}=e;return r(ED,{"number, number":u,"Complex, Complex":function(x,v){return x.pow(v)},"BigNumber, BigNumber":function(x,v){return v.isInteger()||x>=0||t.predictable?x.pow(v):new o(x.toNumber(),0).pow(v.toNumber(),0)},"Fraction, Fraction":function(x,v){var y=x.pow(v);if(y!=null)return y;if(t.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return u(x.valueOf(),v.valueOf())},"Array, number":p,"Array, BigNumber":function(x,v){return p(x,v.toNumber())},"Matrix, number":d,"Matrix, BigNumber":function(x,v){return d(x,v.toNumber())},"Unit, number | BigNumber":function(x,v){return x.pow(v)}});function u(h,x){if(t.predictable&&!He(x)&&h<0)try{var v=f(x),y=c(v);if((x===y||Math.abs((x-y)/x)<1e-14)&&v.d%2===1)return(v.n%2===0?1:-1)*Math.pow(-h,x)}catch{}return t.predictable&&(h<-1&&x===1/0||h>-1&&h<0&&x===-1/0)?NaN:He(x)||h>=0||t.predictable?dv(h,x):h*h<1&&x===1/0||h*h>1&&x===-1/0?0:new o(h,0).pow(x,0)}function p(h,x){if(!He(x))throw new TypeError("For A^b, b must be an integer (value is "+x+")");var v=or(h);if(v.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+v.length+" dimensions)");if(v[0]!==v[1])throw new Error("For A^b, A must be square (size is "+v[0]+"x"+v[1]+")");if(x<0)try{return p(s(h),-x)}catch(C){throw C.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+x+")"):C}for(var y=n(v[0]).valueOf(),w=h;x>=1;)(x&1)===1&&(y=i(w,y)),x>>=1,w=i(w,w);return y}function d(h,x){return a(p(h.valueOf(),x))}});var uu="Number of decimals in function round must be an integer",MD="round",UL=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],_D=T(MD,UL,e=>{var{typed:r,config:t,matrix:n,equalScalar:i,zeros:a,BigNumber:s,DenseMatrix:c}=e,f=Jr({typed:r,equalScalar:i}),o=Lr({typed:r,DenseMatrix:c}),u=Bt({typed:r});function p(d){return Math.abs($s(d).exponent)}return r(MD,{number:function(h){var x=ru(h,p(t.epsilon)),v=wt(h,x,t.epsilon)?x:h;return ru(v)},"number, number":function(h,x){var v=p(t.epsilon);if(x>=v)return ru(h,x);var y=ru(h,v),w=wt(h,y,t.epsilon)?y:h;return ru(w,x)},"number, BigNumber":function(h,x){if(!x.isInteger())throw new TypeError(uu);return new s(h).toDecimalPlaces(x.toNumber())},Complex:function(h){return h.round()},"Complex, number":function(h,x){if(x%1)throw new TypeError(uu);return h.round(x)},"Complex, BigNumber":function(h,x){if(!x.isInteger())throw new TypeError(uu);var v=x.toNumber();return h.round(v)},BigNumber:function(h){var x=new s(h).toDecimalPlaces(p(t.epsilon)),v=Ut(h,x,t.epsilon)?x:h;return v.toDecimalPlaces(0)},"BigNumber, BigNumber":function(h,x){if(!x.isInteger())throw new TypeError(uu);var v=p(t.epsilon);if(x>=v)return h.toDecimalPlaces(x.toNumber());var y=h.toDecimalPlaces(v),w=Ut(h,y,t.epsilon)?y:h;return w.toDecimalPlaces(x.toNumber())},Fraction:function(h){return h.round()},"Fraction, number":function(h,x){if(x%1)throw new TypeError(uu);return h.round(x)},"Fraction, BigNumber":function(h,x){if(!x.isInteger())throw new TypeError(uu);return h.round(x.toNumber())},"Unit, number, Unit":r.referToSelf(d=>function(h,x,v){var y=h.toNumeric(v);return v.multiply(d(y,x))}),"Unit, BigNumber, Unit":r.referToSelf(d=>(h,x,v)=>d(h,x.toNumber(),v)),"Unit, Unit":r.referToSelf(d=>(h,x)=>d(h,0,x)),"Array | Matrix, number, Unit":r.referToSelf(d=>(h,x,v)=>Je(h,y=>d(y,x,v),!0)),"Array | Matrix, BigNumber, Unit":r.referToSelf(d=>(h,x,v)=>d(h,x.toNumber(),v)),"Array | Matrix, Unit":r.referToSelf(d=>(h,x)=>d(h,0,x)),"Array | Matrix":r.referToSelf(d=>h=>Je(h,d,!0)),"SparseMatrix, number | BigNumber":r.referToSelf(d=>(h,x)=>f(h,x,d,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(d=>(h,x)=>u(h,x,d,!1)),"Array, number | BigNumber":r.referToSelf(d=>(h,x)=>u(n(h),x,d,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":r.referToSelf(d=>(h,x)=>i(h,0)?a(x.size(),x.storage()):o(x,h,d,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":r.referToSelf(d=>(h,x)=>i(h,0)?a(x.size(),x.storage()):u(x,h,d,!0)),"number | Complex | BigNumber | Fraction, Array":r.referToSelf(d=>(h,x)=>u(n(x),h,d,!0).valueOf())})});var TD="log",zL=["config","typed","divideScalar","Complex"],FD=T(TD,zL,e=>{var{typed:r,config:t,divideScalar:n,Complex:i}=e;return r(TD,{number:function(s){return s>=0||t.predictable?Jy(s):new i(s,0).log()},Complex:function(s){return s.log()},BigNumber:function(s){return!s.isNegative()||t.predictable?s.ln():new i(s.toNumber(),0).log()},"any, any":r.referToSelf(a=>(s,c)=>n(a(s),a(c)))})});var OD="log1p",WL=["typed","config","divideScalar","log","Complex"],BD=T(OD,WL,e=>{var{typed:r,config:t,divideScalar:n,log:i,Complex:a}=e;return r(OD,{number:function(f){return f>=-1||t.predictable?dc(f):s(new a(f,0))},Complex:s,BigNumber:function(f){var o=f.plus(1);return!o.isNegative()||t.predictable?o.ln():s(new a(f.toNumber(),0))},"Array | Matrix":r.referToSelf(c=>f=>Je(f,c)),"any, any":r.referToSelf(c=>(f,o)=>n(c(f),i(o)))});function s(c){var f=c.re+1;return new a(Math.log(Math.sqrt(f*f+c.im*c.im)),Math.atan2(c.im,f))}});var ID="nthRoots",VL=["config","typed","divideScalar","Complex"],PD=T(ID,VL,e=>{var{typed:r,config:t,divideScalar:n,Complex:i}=e,a=[function(f){return new i(f,0)},function(f){return new i(0,f)},function(f){return new i(-f,0)},function(f){return new i(0,-f)}];function s(c,f){if(f<0)throw new Error("Root must be greater than zero");if(f===0)throw new Error("Root must be non-zero");if(f%1!==0)throw new Error("Root must be an integer");if(c===0||c.abs()===0)return[new i(0,0)];var o=typeof c=="number",u;(o||c.re===0||c.im===0)&&(o?u=2*+(c<0):c.im===0?u=2*+(c.re<0):u=2*+(c.im<0)+1);for(var p=c.arg(),d=c.abs(),h=[],x=Math.pow(d,1/f),v=0;v{var{typed:r,equalScalar:t,matrix:n,pow:i,DenseMatrix:a,concat:s}=e,c=ft({typed:r}),f=Vt({typed:r,DenseMatrix:a}),o=Jr({typed:r,equalScalar:t}),u=Lr({typed:r,DenseMatrix:a}),p=vr({typed:r,matrix:n,concat:s}),d={};for(var h in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,h)&&!h.includes("Matrix")&&!h.includes("Array")&&(d[h]=i.signatures[h]);var x=r(d);return r(kD,p({elop:x,SS:f,DS:c,Ss:o,sS:u}))});var LD="dotDivide",HL=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],qD=T(LD,HL,e=>{var{typed:r,matrix:t,equalScalar:n,divideScalar:i,DenseMatrix:a,concat:s}=e,c=It({typed:r,equalScalar:n}),f=ft({typed:r}),o=Vt({typed:r,DenseMatrix:a}),u=Jr({typed:r,equalScalar:n}),p=Lr({typed:r,DenseMatrix:a}),d=vr({typed:r,matrix:t,concat:s});return r(LD,d({elop:i,SS:o,DS:f,SD:c,Ss:u,sS:p}))});function ma(e){var{DenseMatrix:r}=e;return function(n,i,a){var s=n.size();if(s.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+lr(s)+")");var c=s[0],f=s[1];if(c!==f)throw new RangeError("Matrix must be square (size: "+lr(s)+")");var o=[];if(Ge(i)){var u=i.size(),p=i._data;if(u.length===1){if(u[0]!==c)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var d=0;d{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:c}=e,f=ma({DenseMatrix:c});return r(UD,{"SparseMatrix, Array | Matrix":function(d,h){return u(d,h)},"DenseMatrix, Array | Matrix":function(d,h){return o(d,h)},"Array, Array | Matrix":function(d,h){var x=t(d),v=o(x,h);return v.valueOf()}});function o(p,d){d=f(p,d,!0);for(var h=d._data,x=p._size[0],v=p._size[1],y=[],w=p._data,C=0;CA&&(O.push(y[k]),F.push(L))}if(s(S,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var Y=n(E,S),$=0,V=F.length;${var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:c}=e,f=ma({DenseMatrix:c});return r(WD,{"SparseMatrix, Array | Matrix":function(d,h){return u(d,h)},"DenseMatrix, Array | Matrix":function(d,h){return o(d,h)},"Array, Array | Matrix":function(d,h){var x=t(d),v=o(x,h);return v.valueOf()}});function o(p,d){d=f(p,d,!0);for(var h=d._data,x=p._size[0],v=p._size[1],y=[],w=p._data,C=v-1;C>=0;C--){var b=h[C][0]||0,A=void 0;if(s(b,0))A=0;else{var E=w[C][C];if(s(E,0))throw new Error("Linear system cannot be solved since matrix is singular");A=n(b,E);for(var S=C-1;S>=0;S--)h[S]=[a(h[S][0]||0,i(A,w[S][C]))]}y[C]=[A]}return new c({data:y,size:[x,1]})}function u(p,d){d=f(p,d,!0);for(var h=d._data,x=p._size[0],v=p._size[1],y=p._values,w=p._index,C=p._ptr,b=[],A=v-1;A>=0;A--){var E=h[A][0]||0;if(s(E,0))b[A]=[0];else{for(var S=0,O=[],F=[],M=C[A],_=C[A+1],k=_-1;k>=M;k--){var L=w[k];L===A?S=y[k]:L{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:c}=e,f=ma({DenseMatrix:c});return r(YD,{"SparseMatrix, Array | Matrix":function(d,h){return u(d,h)},"DenseMatrix, Array | Matrix":function(d,h){return o(d,h)},"Array, Array | Matrix":function(d,h){var x=t(d),v=o(x,h);return v.map(y=>y.valueOf())}});function o(p,d){for(var h=[f(p,d,!0)._data.map(F=>F[0])],x=p._data,v=p._size[0],y=p._size[1],w=0;wnew c({data:F.map(M=>[M]),size:[v,1]}))}function u(p,d){for(var h=[f(p,d,!0)._data.map(me=>me[0])],x=p._size[0],v=p._size[1],y=p._values,w=p._index,C=p._ptr,b=0;bb&&(O.push(y[L]),F.push(Y))}if(s(k,0))if(s(S[b],0)){if(E===0){var R=[...S];R[b]=1;for(var j=0,U=F.length;jnew c({data:me.map(ie=>[ie]),size:[x,1]}))}});var GD="usolveAll",QL=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],$D=T(GD,QL,e=>{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:c}=e,f=ma({DenseMatrix:c});return r(GD,{"SparseMatrix, Array | Matrix":function(d,h){return u(d,h)},"DenseMatrix, Array | Matrix":function(d,h){return o(d,h)},"Array, Array | Matrix":function(d,h){var x=t(d),v=o(x,h);return v.map(y=>y.valueOf())}});function o(p,d){for(var h=[f(p,d,!0)._data.map(F=>F[0])],x=p._data,v=p._size[0],y=p._size[1],w=y-1;w>=0;w--)for(var C=h.length,b=0;b=0;O--)S[O]=a(S[O],x[O][w]);h.push(S)}}else{if(b===0)return[];h.splice(b,1),b-=1,C-=1}else{A[w]=n(A[w],x[w][w]);for(var E=w-1;E>=0;E--)A[E]=a(A[E],i(A[w],x[E][w]))}}return h.map(F=>new c({data:F.map(M=>[M]),size:[v,1]}))}function u(p,d){for(var h=[f(p,d,!0)._data.map(me=>me[0])],x=p._size[0],v=p._size[1],y=p._values,w=p._index,C=p._ptr,b=v-1;b>=0;b--)for(var A=h.length,E=0;E=M;L--){var Y=w[L];Y===b?k=y[L]:Ynew c({data:me.map(ie=>[ie]),size:[x,1]}))}});var XL="matAlgo08xS0Sid",JL=["typed","equalScalar"],fu=T(XL,JL,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s){var c=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),d=a._values,h=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new pr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");if(!c||!d)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var w=u[0],C=u[1],b,A=t,E=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),E=r.convert(0,b),S=r.find(s,[b,b]));for(var O=[],F=[],M=[],_=[],k=[],L,Y,$,V,q=0;q{var{typed:r,matrix:t}=e;return{"Array, number":r.referTo("DenseMatrix, number",n=>(i,a)=>n(t(i),a).valueOf()),"Array, BigNumber":r.referTo("DenseMatrix, BigNumber",n=>(i,a)=>n(t(i),a).valueOf()),"number, Array":r.referTo("number, DenseMatrix",n=>(i,a)=>n(i,t(a)).valueOf()),"BigNumber, Array":r.referTo("BigNumber, DenseMatrix",n=>(i,a)=>n(i,t(a)).valueOf())}});var ZD="leftShift",KL=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],QD=T(ZD,KL,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=e,c=hn({typed:r}),f=It({typed:r,equalScalar:n}),o=fu({typed:r,equalScalar:n}),u=Un({typed:r,DenseMatrix:a}),p=Jr({typed:r,equalScalar:n}),d=Bt({typed:r}),h=vr({typed:r,matrix:t,concat:s}),x=lu({typed:r,matrix:t});return r(ZD,{"number, number":yv,"BigNumber, BigNumber":Lb,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():p(y,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():d(y,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):u(w,y,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):d(w,y,v,!0))},x,h({SS:o,DS:c,SD:f}))});var XD="rightArithShift",jL=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],JD=T(XD,jL,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=e,c=hn({typed:r}),f=It({typed:r,equalScalar:n}),o=fu({typed:r,equalScalar:n}),u=Un({typed:r,DenseMatrix:a}),p=Jr({typed:r,equalScalar:n}),d=Bt({typed:r}),h=vr({typed:r,matrix:t,concat:s}),x=lu({typed:r,matrix:t});return r(XD,{"number, number":bv,"BigNumber, BigNumber":qb,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():p(y,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():d(y,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):u(w,y,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):d(w,y,v,!0))},x,h({SS:o,DS:c,SD:f}))});var KD="rightLogShift",eq=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],jD=T(KD,eq,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=e,c=hn({typed:r}),f=It({typed:r,equalScalar:n}),o=fu({typed:r,equalScalar:n}),u=Un({typed:r,DenseMatrix:a}),p=Jr({typed:r,equalScalar:n}),d=Bt({typed:r}),h=vr({typed:r,matrix:t,concat:s}),x=lu({typed:r,matrix:t});return r(KD,{"number, number":wv,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():p(y,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():d(y,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):u(w,y,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):d(w,y,v,!0))},x,h({SS:o,DS:c,SD:f}))});var eS="and",rq=["typed","matrix","equalScalar","zeros","not","concat"],jc=T(eS,rq,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s}=e,c=It({typed:r,equalScalar:n}),f=Do({typed:r,equalScalar:n}),o=Jr({typed:r,equalScalar:n}),u=Bt({typed:r}),p=vr({typed:r,matrix:t,concat:s});return r(eS,{"number, number":Cv,"Complex, Complex":function(h,x){return(h.re!==0||h.im!==0)&&(x.re!==0||x.im!==0)},"BigNumber, BigNumber":function(h,x){return!h.isZero()&&!x.isZero()&&!h.isNaN()&&!x.isNaN()},"Unit, Unit":r.referToSelf(d=>(h,x)=>d(h.value||0,x.value||0)),"SparseMatrix, any":r.referToSelf(d=>(h,x)=>a(x)?i(h.size(),h.storage()):o(h,x,d,!1)),"DenseMatrix, any":r.referToSelf(d=>(h,x)=>a(x)?i(h.size(),h.storage()):u(h,x,d,!1)),"any, SparseMatrix":r.referToSelf(d=>(h,x)=>a(h)?i(h.size(),h.storage()):o(x,h,d,!0)),"any, DenseMatrix":r.referToSelf(d=>(h,x)=>a(h)?i(h.size(),h.storage()):u(x,h,d,!0)),"Array, any":r.referToSelf(d=>(h,x)=>d(t(h),x).valueOf()),"any, Array":r.referToSelf(d=>(h,x)=>d(h,t(x)).valueOf())},p({SS:f,DS:c}))});var ep="compare",tq=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],rS=T(ep,tq,e=>{var{typed:r,config:t,equalScalar:n,matrix:i,BigNumber:a,Fraction:s,DenseMatrix:c,concat:f}=e,o=ft({typed:r}),u=wo({typed:r,equalScalar:n}),p=Lr({typed:r,DenseMatrix:c}),d=vr({typed:r,matrix:i,concat:f}),h=vi({typed:r});return r(ep,nq({typed:r,config:t}),{"boolean, boolean":function(v,y){return v===y?0:v>y?1:-1},"BigNumber, BigNumber":function(v,y){return Ut(v,y,t.epsilon)?new a(0):new a(v.cmp(y))},"Fraction, Fraction":function(v,y){return new s(v.compare(y))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},h,d({SS:u,DS:o,Ss:p}))}),nq=T(ep,["typed","config"],e=>{var{typed:r,config:t}=e;return r(ep,{"number, number":function(i,a){return wt(i,a,t.epsilon)?0:i>a?1:-1}})});var is=ci(nS(),1);var iS="compareNatural",iq=["typed","compare"],aS=T(iS,iq,e=>{var{typed:r,compare:t}=e,n=t.signatures["boolean,boolean"];return r(iS,{"any, any":i});function i(f,o){var u=_r(f),p=_r(o),d;if((u==="number"||u==="BigNumber"||u==="Fraction")&&(p==="number"||p==="BigNumber"||p==="Fraction"))return d=t(f,o),d.toString()!=="0"?d>0?1:-1:(0,is.default)(u,p);var h=["Array","DenseMatrix","SparseMatrix"];if(h.includes(u)||h.includes(p))return d=a(i,f,o),d!==0?d:(0,is.default)(u,p);if(u!==p)return(0,is.default)(u,p);if(u==="Complex")return aq(f,o);if(u==="Unit")return f.equalBase(o)?i(f.value,o.value):s(i,f.formatUnits(),o.formatUnits());if(u==="boolean")return n(f,o);if(u==="string")return(0,is.default)(f,o);if(u==="Object")return c(i,f,o);if(u==="null"||u==="undefined")return 0;throw new TypeError('Unsupported type of value "'+u+'"')}function a(f,o,u){return Jn(o)&&Jn(u)?s(f,o.toJSON().values,u.toJSON().values):Jn(o)?a(f,o.toArray(),u):Jn(u)?a(f,o,u.toArray()):Ba(o)?a(f,o.toJSON().data,u):Ba(u)?a(f,o,u.toJSON().data):Array.isArray(o)?Array.isArray(u)?s(f,o,u):a(f,o,[u]):a(f,[o],u)}function s(f,o,u){for(var p=0,d=Math.min(o.length,u.length);pu.length?1:o.lengthr.re?1:e.rer.im?1:e.im{var{typed:r,matrix:t,concat:n}=e,i=vr({typed:r,matrix:t,concat:n});return r(oS,xc,i({elop:xc,Ds:!0}))});var rp="equal",sq=["typed","matrix","equalScalar","DenseMatrix","concat"],uS=T(rp,sq,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),c=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:t,concat:a});return r(rp,uq({typed:r,equalScalar:n}),o({elop:n,SS:c,DS:s,Ss:f}))}),uq=T(rp,["typed","equalScalar"],e=>{var{typed:r,equalScalar:t}=e;return r(rp,{"any, any":function(i,a){return i===null?a===null:a===null?i===null:i===void 0?a===void 0:a===void 0?i===void 0:t(i,a)}})});var fS="equalText",fq=["typed","compareText","isZero"],lS=T(fS,fq,e=>{var{typed:r,compareText:t,isZero:n}=e;return r(fS,{"any, any":function(a,s){return n(t(a,s))}})});var tp="smaller",lq=["typed","config","matrix","DenseMatrix","concat"],cS=T(tp,lq,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),c=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:n,concat:a}),u=vi({typed:r});return r(tp,cq({typed:r,config:t}),{"boolean, boolean":(p,d)=>pp.compare(d)===-1,"Complex, Complex":function(d,h){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:c,DS:s,Ss:f}))}),cq=T(tp,["typed","config"],e=>{var{typed:r,config:t}=e;return r(tp,{"number, number":function(i,a){return i{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),c=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:n,concat:a}),u=vi({typed:r});return r(np,mq({typed:r,config:t}),{"boolean, boolean":(p,d)=>p<=d,"BigNumber, BigNumber":function(d,h){return d.lte(h)||Ut(d,h,t.epsilon)},"Fraction, Fraction":(p,d)=>p.compare(d)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:c,DS:s,Ss:f}))}),mq=T(np,["typed","config"],e=>{var{typed:r,config:t}=e;return r(np,{"number, number":function(i,a){return i<=a||wt(i,a,t.epsilon)}})});var ip="larger",dq=["typed","config","matrix","DenseMatrix","concat"],mS=T(ip,dq,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),c=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:n,concat:a}),u=vi({typed:r});return r(ip,hq({typed:r,config:t}),{"boolean, boolean":(p,d)=>p>d,"BigNumber, BigNumber":function(d,h){return d.gt(h)&&!Ut(d,h,t.epsilon)},"Fraction, Fraction":(p,d)=>p.compare(d)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:c,DS:s,Ss:f}))}),hq=T(ip,["typed","config"],e=>{var{typed:r,config:t}=e;return r(ip,{"number, number":function(i,a){return i>a&&!wt(i,a,t.epsilon)}})});var ap="largerEq",vq=["typed","config","matrix","DenseMatrix","concat"],dS=T(ap,vq,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),c=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:n,concat:a}),u=vi({typed:r});return r(ap,gq({typed:r,config:t}),{"boolean, boolean":(p,d)=>p>=d,"BigNumber, BigNumber":function(d,h){return d.gte(h)||Ut(d,h,t.epsilon)},"Fraction, Fraction":(p,d)=>p.compare(d)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:c,DS:s,Ss:f}))}),gq=T(ap,["typed","config"],e=>{var{typed:r,config:t}=e;return r(ap,{"number, number":function(i,a){return i>=a||wt(i,a,t.epsilon)}})});var hS="deepEqual",xq=["typed","equal"],vS=T(hS,xq,e=>{var{typed:r,equal:t}=e;return r(hS,{"any, any":function(a,s){return n(a.valueOf(),s.valueOf())}});function n(i,a){if(Array.isArray(i))if(Array.isArray(a)){var s=i.length;if(s!==a.length)return!1;for(var c=0;c{var{typed:r,config:t,equalScalar:n,matrix:i,DenseMatrix:a,concat:s}=e,c=ft({typed:r}),f=Vt({typed:r,DenseMatrix:a}),o=Lr({typed:r,DenseMatrix:a}),u=vr({typed:r,matrix:i,concat:s});return r(op,bq({typed:r,equalScalar:n}),u({elop:p,SS:f,DS:c,Ss:o}));function p(d,h){return!n(d,h)}}),bq=T(op,["typed","equalScalar"],e=>{var{typed:r,equalScalar:t}=e;return r(op,{"any, any":function(i,a){return i===null?a!==null:a===null?i!==null:i===void 0?a!==void 0:a===void 0?i!==void 0:!t(i,a)}})});var xS="partitionSelect",wq=["typed","isNumeric","isNaN","compare"],yS=T(xS,wq,e=>{var{typed:r,isNumeric:t,isNaN:n,compare:i}=e,a=i,s=(o,u)=>-i(o,u);return r(xS,{"Array | Matrix, number":function(u,p){return c(u,p,a)},"Array | Matrix, number, string":function(u,p,d){if(d==="asc")return c(u,p,a);if(d==="desc")return c(u,p,s);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":c});function c(o,u,p){if(!He(u)||u<0)throw new Error("k must be a non-negative integer");if(Ge(o)){var d=o.size();if(d.length>1)throw new Error("Only one dimensional matrices supported");return f(o.valueOf(),u,p)}if(Array.isArray(o))return f(o,u,p)}function f(o,u,p){if(u>=o.length)throw new Error("k out of bounds");for(var d=0;d=0){var C=o[y];o[y]=o[v],o[v]=C,--y}else++v;p(o[v],w)>0&&--v,u<=v?x=v:h=v+1}return o[u]}});var bS="sort",Dq=["typed","matrix","compare","compareNatural"],wS=T(bS,Dq,e=>{var{typed:r,matrix:t,compare:n,compareNatural:i}=e,a=n,s=(u,p)=>-n(u,p);return r(bS,{Array:function(p){return f(p),p.sort(a)},Matrix:function(p){return o(p),t(p.toArray().sort(a),p.storage())},"Array, function":function(p,d){return f(p),p.sort(d)},"Matrix, function":function(p,d){return o(p),t(p.toArray().sort(d),p.storage())},"Array, string":function(p,d){return f(p),p.sort(c(d))},"Matrix, string":function(p,d){return o(p),t(p.toArray().sort(c(d)),p.storage())}});function c(u){if(u==="asc")return a;if(u==="desc")return s;if(u==="natural")return i;throw new Error('String "asc", "desc", or "natural" expected')}function f(u){if(or(u).length!==1)throw new Error("One dimensional array expected")}function o(u){if(u.size().length!==1)throw new Error("One dimensional matrix expected")}});var DS="max",Sq=["typed","config","numeric","larger"],sp=T(DS,Sq,e=>{var{typed:r,config:t,numeric:n,larger:i}=e;return r(DS,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(f,o){return bo(f,o.valueOf(),a)},"...":function(f){if(hi(f))throw new TypeError("Scalar values expected in function max");return s(f)}});function a(c,f){try{return i(c,f)?c:f}catch(o){throw St(o,"max",f)}}function s(c){var f;if(dn(c,function(o){try{isNaN(o)&&typeof o=="number"?f=NaN:(f===void 0||i(o,f))&&(f=o)}catch(u){throw St(u,"max",o)}}),f===void 0)throw new Error("Cannot calculate max of an empty array");return typeof f=="string"&&(f=n(f,t.number)),f}});var SS="min",Nq=["typed","config","numeric","smaller"],up=T(SS,Nq,e=>{var{typed:r,config:t,numeric:n,smaller:i}=e;return r(SS,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(f,o){return bo(f,o.valueOf(),a)},"...":function(f){if(hi(f))throw new TypeError("Scalar values expected in function min");return s(f)}});function a(c,f){try{return i(c,f)?c:f}catch(o){throw St(o,"min",f)}}function s(c){var f;if(dn(c,function(o){try{isNaN(o)&&typeof o=="number"?f=NaN:(f===void 0||i(o,f))&&(f=o)}catch(u){throw St(u,"min",o)}}),f===void 0)throw new Error("Cannot calculate min of an empty array");return typeof f=="string"&&(f=n(f,t.number)),f}});var Aq="ImmutableDenseMatrix",Eq=["smaller","DenseMatrix"],NS=T(Aq,Eq,e=>{var{smaller:r,DenseMatrix:t}=e;function n(i,a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!yt(a))throw new Error("Invalid datatype: "+a);if(Ge(i)||Ar(i)){var s=new t(i,a);this._data=s._data,this._size=s._size,this._datatype=s._datatype,this._min=null,this._max=null}else if(i&&Ar(i.data)&&Ar(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+_r(i)+")");this._data=[],this._size=[0],this._datatype=a,this._min=null,this._max=null}}return n.prototype=new t,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(i){switch(arguments.length){case 1:{var a=t.prototype.subset.call(this,i);return Ge(a)?new n({data:a._data,size:a._size,datatype:a._datatype}):a}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:tr(this._data),size:tr(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(i){return new n(i)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(a){(i===null||r(a,i))&&(i=a)}),this._min=i!==null?i:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(a){(i===null||r(i,a))&&(i=a)}),this._max=i!==null?i:void 0}return this._max},n},{isClass:!0});var Cq="Index",Mq=["ImmutableDenseMatrix","getMatrixDataType"],ES=T(Cq,Mq,e=>{var{ImmutableDenseMatrix:r,getMatrixDataType:t}=e;function n(a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var s=0,c=arguments.length;s{t&&r.push(n)}),r}var _q="FibonacciHeap",Tq=["smaller","larger"],CS=T(_q,Tq,e=>{var{smaller:r,larger:t}=e,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(u,p){var d={key:u,value:p,degree:0};if(this._minimum){var h=this._minimum;d.left=h,d.right=h.right,h.right=d,d.right.left=d,r(u,h.key)&&(this._minimum=d)}else d.left=d,d.right=d,this._minimum=d;return this._size++,d},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return this._size===0},i.prototype.extractMinimum=function(){var u=this._minimum;if(u===null)return u;for(var p=this._minimum,d=u.degree,h=u.child;d>0;){var x=h.right;h.left.right=h.right,h.right.left=h.left,h.left=p,h.right=p.right,p.right=h,h.right.left=h,h.parent=null,h=x,d--}return u.left.right=u.right,u.right.left=u.left,u===u.right?p=null:(p=u.right,p=o(p,this._size)),this._size--,this._minimum=p,u},i.prototype.remove=function(u){this._minimum=a(this._minimum,u,-1),this.extractMinimum()};function a(u,p,d){p.key=d;var h=p.parent;return h&&r(p.key,h.key)&&(s(u,p,h),c(u,h)),r(p.key,u.key)&&(u=p),u}function s(u,p,d){p.left.right=p.right,p.right.left=p.left,d.degree--,d.child===p&&(d.child=p.right),d.degree===0&&(d.child=null),p.left=u,p.right=u.right,u.right=p,p.right.left=p,p.parent=null,p.mark=!1}function c(u,p){var d=p.parent;!d||(p.mark?(s(u,p,d),c(d)):p.mark=!0)}var f=function(p,d){p.left.right=p.right,p.right.left=p.left,p.parent=d,d.child?(p.left=d.child,p.right=d.child.right,d.child.right=p,p.right.left=p):(d.child=p,p.right=p,p.left=p),d.degree++,p.mark=!1};function o(u,p){var d=Math.floor(Math.log(p)*n)+1,h=new Array(d),x=0,v=u;if(v)for(x++,v=v.right;v!==u;)x++,v=v.right;for(var y;x>0;){for(var w=v.degree,C=v.right;y=h[w],!!y;){if(t(v.key,y.key)){var b=y;y=v,v=b}f(y,v),h[w]=null,w++}h[w]=v,v=C,x--}u=null;for(var A=0;A{var{addScalar:r,equalScalar:t,FibonacciHeap:n}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(a,s){if(this._values[a])this._values[a].value=s;else{var c=this._heap.insert(a,s);this._values[a]=c}},i.prototype.get=function(a){var s=this._values[a];return s?s.value:0},i.prototype.accumulate=function(a,s){var c=this._values[a];c?c.value=r(c.value,s):(c=this._heap.insert(a,s),this._values[a]=c)},i.prototype.forEach=function(a,s,c){var f=this._heap,o=this._values,u=[],p=f.extractMinimum();for(p&&u.push(p);p&&p.key<=s;)p.key>=a&&(t(p.value,0)||c(p.key,p.value,this)),p=f.extractMinimum(),p&&u.push(p);for(var d=0;d{var{on:r,config:t,addScalar:n,subtractScalar:i,multiplyScalar:a,divideScalar:s,pow:c,abs:f,fix:o,round:u,equal:p,isNumeric:d,format:h,number:x,Complex:v,BigNumber:y,Fraction:w}=e,C=x;function b(K,te){if(!(this instanceof b))throw new Error("Constructor must be called with the new operator");if(!(K==null||d(K)||Gt(K)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,te===void 0)this.units=[],this.dimensions=j.map(ee=>0);else if(typeof te=="string"){var ye=b.parse(te);this.units=ye.units,this.dimensions=ye.dimensions}else if(qt(te)&&te.value===null)this.fixPrefix=te.fixPrefix,this.skipAutomaticSimplification=te.skipAutomaticSimplification,this.dimensions=te.dimensions.slice(0),this.units=te.units.map(ee=>Mt({},ee));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(K)}Object.defineProperty(b,"name",{value:"Unit"}),b.prototype.constructor=b,b.prototype.type="Unit",b.prototype.isUnit=!0;var A,E,S;function O(){for(;S===" "||S===" ";)_()}function F(K){return K>="0"&&K<="9"||K==="."}function M(K){return K>="0"&&K<="9"}function _(){E++,S=A.charAt(E)}function k(K){E=K,S=A.charAt(E)}function L(){var K="",te=E;if(S==="+"?_():S==="-"&&(K+=S,_()),!F(S))return k(te),null;if(S==="."){if(K+=S,_(),!M(S))return k(te),null}else{for(;M(S);)K+=S,_();S==="."&&(K+=S,_())}for(;M(S);)K+=S,_();if(S==="E"||S==="e"){var ye="",ee=E;if(ye+=S,_(),(S==="+"||S==="-")&&(ye+=S,_()),!M(S))return k(ee),K;for(K=K+ye;M(S);)K+=S,_()}return K}function Y(){for(var K="";M(S)||b.isValidAlpha(S);)K+=S,_();var te=K.charAt(0);return b.isValidAlpha(te)?K:null}function $(K){return S===K?(_(),K):null}b.parse=function(K,te){if(te=te||{},A=K,E=-1,S="",typeof A!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var ye=new b;ye.units=[];var ee=1,ne=!1;_(),O();var ue=L(),Ee=null;if(ue){if(t.number==="BigNumber")Ee=new y(ue);else if(t.number==="Fraction")try{Ee=new w(ue)}catch{Ee=parseFloat(ue)}else Ee=parseFloat(ue);O(),$("*")?(ee=1,ne=!0):$("/")&&(ee=-1,ne=!0)}for(var Ce=[],Le=1;;){for(O();S==="(";)Ce.push(ee),Le*=ee,ee=1,_(),O();var Ie=void 0;if(S){var sr=S;if(Ie=Y(),Ie===null)throw new SyntaxError('Unexpected "'+sr+'" in "'+A+'" at index '+E.toString())}else break;var ir=V(Ie);if(ir===null)throw new SyntaxError('Unit "'+Ie+'" not found.');var Xe=ee*Le;if(O(),$("^")){O();var Or=L();if(Or===null)throw new SyntaxError('In "'+K+'", "^" must be followed by a floating-point number');Xe*=Or}ye.units.push({unit:ir.unit,prefix:ir.prefix,power:Xe});for(var re=0;re1||Math.abs(this.units[0].power-1)>1e-15},b.prototype._normalize=function(K){if(K==null||this.units.length===0)return K;for(var te=K,ye=b._getNumberConverter(_r(K)),ee=0;ee{if($e(H,K)){var te=H[K],ye=te.prefixes[""];return{unit:te,prefix:ye}}for(var ee in H)if($e(H,ee)&&oy(K,ee)){var ne=H[ee],ue=K.length-ee.length,Ee=K.substring(0,ue),Ce=$e(ne.prefixes,Ee)?ne.prefixes[Ee]:void 0;if(Ce!==void 0)return{unit:ne,prefix:Ce}}return null},{hasher:K=>K[0],limit:100});b.isValuelessUnit=function(K){return V(K)!==null},b.prototype.hasBase=function(K){if(typeof K=="string"&&(K=U[K]),!K)return!1;for(var te=0;te1e-12)return!1;return!0},b.prototype.equalBase=function(K){for(var te=0;te1e-12)return!1;return!0},b.prototype.equals=function(K){return this.equalBase(K)&&p(this.value,K.value)},b.prototype.multiply=function(K){for(var te=this.clone(),ye=qt(K)?K:new b(K),ee=0;ee1e-12&&($e(ge,Ce)?te.push({unit:ge[Ce].unit,prefix:ge[Ce].prefix,power:K.dimensions[Ee]||0}):ue=!0)}te.length1e-12)if($e(pe.si,ee))te.push({unit:pe.si[ee].unit,prefix:pe.si[ee].prefix,power:K.dimensions[ye]||0});else throw new Error("Cannot express custom unit "+ee+" in SI units")}return K.units=te,K.fixPrefix=!0,K.skipAutomaticSimplification=!0,this.value!==null?(K.value=null,this.to(K)):K},b.prototype.formatUnits=function(){for(var K="",te="",ye=0,ee=0,ne=0;ne0?(ye++,K+=" "+this.units[ne].prefix.name+this.units[ne].unit.name,Math.abs(this.units[ne].power-1)>1e-15&&(K+="^"+this.units[ne].power)):this.units[ne].power<0&&ee++;if(ee>0)for(var ue=0;ue0?(te+=" "+this.units[ue].prefix.name+this.units[ue].unit.name,Math.abs(this.units[ue].power+1)>1e-15&&(te+="^"+-this.units[ue].power)):(te+=" "+this.units[ue].prefix.name+this.units[ue].unit.name,te+="^"+this.units[ue].power));K=K.substr(1),te=te.substr(1),ye>1&&ee>0&&(K="("+K+")"),ee>1&&ye>0&&(te="("+te+")");var Ee=K;return ye>0&&ee>0&&(Ee+=" / "),Ee+=te,Ee},b.prototype.format=function(K){var te=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),ye=!1;typeof te.value<"u"&&te.value!==null&&Gt(te.value)&&(ye=Math.abs(te.value.re)<1e-14);for(var ee in te.units)$e(te.units,ee)&&te.units[ee].unit&&(te.units[ee].unit.name==="VA"&&ye?te.units[ee].unit=H.VAR:te.units[ee].unit.name==="VAR"&&!ye&&(te.units[ee].unit=H.VA));te.units.length===1&&!te.fixPrefix&&Math.abs(te.units[0].power-Math.round(te.units[0].power))<1e-14&&(te.units[0].prefix=te._bestPrefix());var ne=te._denormalize(te.value),ue=te.value!==null?h(ne,K||{}):"",Ee=te.formatUnits();return te.value&&Gt(te.value)&&(ue="("+ue+")"),Ee.length>0&&ue.length>0&&(ue+=" "),ue+=Ee,ue},b.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var K=this.value!==null?f(this.value):0,te=f(this.units[0].unit.value),ye=this.units[0].prefix;if(K===0)return ye;var ee=this.units[0].power,ne=Math.log(K/Math.pow(ye.value*te,ee))/Math.LN10-1.2;if(ne>-2.200001&&ne<1.800001)return ye;ne=Math.abs(ne);var ue=this.units[0].unit.prefixes;for(var Ee in ue)if($e(ue,Ee)){var Ce=ue[Ee];if(Ce.scientific){var Le=Math.abs(Math.log(K/Math.pow(Ce.value*te,ee))/Math.LN10-1.2);(Le0)},H={meter:{name:"meter",base:U.LENGTH,prefixes:R.LONG,value:1,offset:0},inch:{name:"inch",base:U.LENGTH,prefixes:R.NONE,value:.0254,offset:0},foot:{name:"foot",base:U.LENGTH,prefixes:R.NONE,value:.3048,offset:0},yard:{name:"yard",base:U.LENGTH,prefixes:R.NONE,value:.9144,offset:0},mile:{name:"mile",base:U.LENGTH,prefixes:R.NONE,value:1609.344,offset:0},link:{name:"link",base:U.LENGTH,prefixes:R.NONE,value:.201168,offset:0},rod:{name:"rod",base:U.LENGTH,prefixes:R.NONE,value:5.0292,offset:0},chain:{name:"chain",base:U.LENGTH,prefixes:R.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:U.LENGTH,prefixes:R.NONE,value:1e-10,offset:0},m:{name:"m",base:U.LENGTH,prefixes:R.SHORT,value:1,offset:0},in:{name:"in",base:U.LENGTH,prefixes:R.NONE,value:.0254,offset:0},ft:{name:"ft",base:U.LENGTH,prefixes:R.NONE,value:.3048,offset:0},yd:{name:"yd",base:U.LENGTH,prefixes:R.NONE,value:.9144,offset:0},mi:{name:"mi",base:U.LENGTH,prefixes:R.NONE,value:1609.344,offset:0},li:{name:"li",base:U.LENGTH,prefixes:R.NONE,value:.201168,offset:0},rd:{name:"rd",base:U.LENGTH,prefixes:R.NONE,value:5.02921,offset:0},ch:{name:"ch",base:U.LENGTH,prefixes:R.NONE,value:20.1168,offset:0},mil:{name:"mil",base:U.LENGTH,prefixes:R.NONE,value:254e-7,offset:0},m2:{name:"m2",base:U.SURFACE,prefixes:R.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:U.SURFACE,prefixes:R.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:U.SURFACE,prefixes:R.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:U.SURFACE,prefixes:R.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:U.SURFACE,prefixes:R.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:U.SURFACE,prefixes:R.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:U.SURFACE,prefixes:R.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:U.SURFACE,prefixes:R.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:U.SURFACE,prefixes:R.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:U.SURFACE,prefixes:R.NONE,value:1e4,offset:0},m3:{name:"m3",base:U.VOLUME,prefixes:R.CUBIC,value:1,offset:0},L:{name:"L",base:U.VOLUME,prefixes:R.SHORT,value:.001,offset:0},l:{name:"l",base:U.VOLUME,prefixes:R.SHORT,value:.001,offset:0},litre:{name:"litre",base:U.VOLUME,prefixes:R.LONG,value:.001,offset:0},cuin:{name:"cuin",base:U.VOLUME,prefixes:R.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:U.VOLUME,prefixes:R.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:U.VOLUME,prefixes:R.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:U.VOLUME,prefixes:R.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:U.VOLUME,prefixes:R.NONE,value:15e-6,offset:0},drop:{name:"drop",base:U.VOLUME,prefixes:R.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:U.VOLUME,prefixes:R.NONE,value:5e-8,offset:0},minim:{name:"minim",base:U.VOLUME,prefixes:R.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:U.VOLUME,prefixes:R.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:U.VOLUME,prefixes:R.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:U.VOLUME,prefixes:R.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:U.VOLUME,prefixes:R.NONE,value:1e-6,offset:0},cup:{name:"cup",base:U.VOLUME,prefixes:R.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:U.VOLUME,prefixes:R.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:U.VOLUME,prefixes:R.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:U.VOLUME,prefixes:R.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:U.VOLUME,prefixes:R.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:U.VOLUME,prefixes:R.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:U.VOLUME,prefixes:R.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:U.VOLUME,prefixes:R.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:U.VOLUME,prefixes:R.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:U.VOLUME,prefixes:R.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:U.VOLUME,prefixes:R.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:U.VOLUME,prefixes:R.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:U.VOLUME,prefixes:R.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:U.VOLUME,prefixes:R.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:U.VOLUME,prefixes:R.NONE,value:.1173478,offset:0},obl:{name:"obl",base:U.VOLUME,prefixes:R.NONE,value:.1589873,offset:0},g:{name:"g",base:U.MASS,prefixes:R.SHORT,value:.001,offset:0},gram:{name:"gram",base:U.MASS,prefixes:R.LONG,value:.001,offset:0},ton:{name:"ton",base:U.MASS,prefixes:R.SHORT,value:907.18474,offset:0},t:{name:"t",base:U.MASS,prefixes:R.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:U.MASS,prefixes:R.LONG,value:1e3,offset:0},grain:{name:"grain",base:U.MASS,prefixes:R.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:U.MASS,prefixes:R.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:U.MASS,prefixes:R.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:U.MASS,prefixes:R.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:U.MASS,prefixes:R.NONE,value:45.359237,offset:0},stick:{name:"stick",base:U.MASS,prefixes:R.NONE,value:.115,offset:0},stone:{name:"stone",base:U.MASS,prefixes:R.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:U.MASS,prefixes:R.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:U.MASS,prefixes:R.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:U.MASS,prefixes:R.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:U.MASS,prefixes:R.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:U.MASS,prefixes:R.NONE,value:45.359237,offset:0},s:{name:"s",base:U.TIME,prefixes:R.SHORT,value:1,offset:0},min:{name:"min",base:U.TIME,prefixes:R.NONE,value:60,offset:0},h:{name:"h",base:U.TIME,prefixes:R.NONE,value:3600,offset:0},second:{name:"second",base:U.TIME,prefixes:R.LONG,value:1,offset:0},sec:{name:"sec",base:U.TIME,prefixes:R.LONG,value:1,offset:0},minute:{name:"minute",base:U.TIME,prefixes:R.NONE,value:60,offset:0},hour:{name:"hour",base:U.TIME,prefixes:R.NONE,value:3600,offset:0},day:{name:"day",base:U.TIME,prefixes:R.NONE,value:86400,offset:0},week:{name:"week",base:U.TIME,prefixes:R.NONE,value:7*86400,offset:0},month:{name:"month",base:U.TIME,prefixes:R.NONE,value:2629800,offset:0},year:{name:"year",base:U.TIME,prefixes:R.NONE,value:31557600,offset:0},decade:{name:"decade",base:U.TIME,prefixes:R.NONE,value:315576e3,offset:0},century:{name:"century",base:U.TIME,prefixes:R.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:U.TIME,prefixes:R.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:U.FREQUENCY,prefixes:R.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:U.FREQUENCY,prefixes:R.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:U.ANGLE,prefixes:R.SHORT,value:1,offset:0},radian:{name:"radian",base:U.ANGLE,prefixes:R.LONG,value:1,offset:0},deg:{name:"deg",base:U.ANGLE,prefixes:R.SHORT,value:null,offset:0},degree:{name:"degree",base:U.ANGLE,prefixes:R.LONG,value:null,offset:0},grad:{name:"grad",base:U.ANGLE,prefixes:R.SHORT,value:null,offset:0},gradian:{name:"gradian",base:U.ANGLE,prefixes:R.LONG,value:null,offset:0},cycle:{name:"cycle",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},A:{name:"A",base:U.CURRENT,prefixes:R.SHORT,value:1,offset:0},ampere:{name:"ampere",base:U.CURRENT,prefixes:R.LONG,value:1,offset:0},K:{name:"K",base:U.TEMPERATURE,prefixes:R.SHORT,value:1,offset:0},degC:{name:"degC",base:U.TEMPERATURE,prefixes:R.SHORT,value:1,offset:273.15},degF:{name:"degF",base:U.TEMPERATURE,prefixes:R.SHORT,value:new w(5,9),offset:459.67},degR:{name:"degR",base:U.TEMPERATURE,prefixes:R.SHORT,value:new w(5,9),offset:0},kelvin:{name:"kelvin",base:U.TEMPERATURE,prefixes:R.LONG,value:1,offset:0},celsius:{name:"celsius",base:U.TEMPERATURE,prefixes:R.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:U.TEMPERATURE,prefixes:R.LONG,value:new w(5,9),offset:459.67},rankine:{name:"rankine",base:U.TEMPERATURE,prefixes:R.LONG,value:new w(5,9),offset:0},mol:{name:"mol",base:U.AMOUNT_OF_SUBSTANCE,prefixes:R.SHORT,value:1,offset:0},mole:{name:"mole",base:U.AMOUNT_OF_SUBSTANCE,prefixes:R.LONG,value:1,offset:0},cd:{name:"cd",base:U.LUMINOUS_INTENSITY,prefixes:R.SHORT,value:1,offset:0},candela:{name:"candela",base:U.LUMINOUS_INTENSITY,prefixes:R.LONG,value:1,offset:0},N:{name:"N",base:U.FORCE,prefixes:R.SHORT,value:1,offset:0},newton:{name:"newton",base:U.FORCE,prefixes:R.LONG,value:1,offset:0},dyn:{name:"dyn",base:U.FORCE,prefixes:R.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:U.FORCE,prefixes:R.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:U.FORCE,prefixes:R.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:U.FORCE,prefixes:R.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:U.FORCE,prefixes:R.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:U.FORCE,prefixes:R.NONE,value:9.80665,offset:0},J:{name:"J",base:U.ENERGY,prefixes:R.SHORT,value:1,offset:0},joule:{name:"joule",base:U.ENERGY,prefixes:R.LONG,value:1,offset:0},erg:{name:"erg",base:U.ENERGY,prefixes:R.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:U.ENERGY,prefixes:R.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:U.ENERGY,prefixes:R.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:U.ENERGY,prefixes:R.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:U.ENERGY,prefixes:R.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:U.POWER,prefixes:R.SHORT,value:1,offset:0},watt:{name:"watt",base:U.POWER,prefixes:R.LONG,value:1,offset:0},hp:{name:"hp",base:U.POWER,prefixes:R.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:U.POWER,prefixes:R.SHORT,value:v.I,offset:0},VA:{name:"VA",base:U.POWER,prefixes:R.SHORT,value:1,offset:0},Pa:{name:"Pa",base:U.PRESSURE,prefixes:R.SHORT,value:1,offset:0},psi:{name:"psi",base:U.PRESSURE,prefixes:R.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:U.PRESSURE,prefixes:R.NONE,value:101325,offset:0},bar:{name:"bar",base:U.PRESSURE,prefixes:R.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:U.PRESSURE,prefixes:R.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:U.PRESSURE,prefixes:R.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:U.PRESSURE,prefixes:R.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:U.PRESSURE,prefixes:R.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:U.ELECTRIC_CHARGE,prefixes:R.LONG,value:1,offset:0},C:{name:"C",base:U.ELECTRIC_CHARGE,prefixes:R.SHORT,value:1,offset:0},farad:{name:"farad",base:U.ELECTRIC_CAPACITANCE,prefixes:R.LONG,value:1,offset:0},F:{name:"F",base:U.ELECTRIC_CAPACITANCE,prefixes:R.SHORT,value:1,offset:0},volt:{name:"volt",base:U.ELECTRIC_POTENTIAL,prefixes:R.LONG,value:1,offset:0},V:{name:"V",base:U.ELECTRIC_POTENTIAL,prefixes:R.SHORT,value:1,offset:0},ohm:{name:"ohm",base:U.ELECTRIC_RESISTANCE,prefixes:R.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:U.ELECTRIC_INDUCTANCE,prefixes:R.LONG,value:1,offset:0},H:{name:"H",base:U.ELECTRIC_INDUCTANCE,prefixes:R.SHORT,value:1,offset:0},siemens:{name:"siemens",base:U.ELECTRIC_CONDUCTANCE,prefixes:R.LONG,value:1,offset:0},S:{name:"S",base:U.ELECTRIC_CONDUCTANCE,prefixes:R.SHORT,value:1,offset:0},weber:{name:"weber",base:U.MAGNETIC_FLUX,prefixes:R.LONG,value:1,offset:0},Wb:{name:"Wb",base:U.MAGNETIC_FLUX,prefixes:R.SHORT,value:1,offset:0},tesla:{name:"tesla",base:U.MAGNETIC_FLUX_DENSITY,prefixes:R.LONG,value:1,offset:0},T:{name:"T",base:U.MAGNETIC_FLUX_DENSITY,prefixes:R.SHORT,value:1,offset:0},b:{name:"b",base:U.BIT,prefixes:R.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:U.BIT,prefixes:R.BINARY_LONG,value:1,offset:0},B:{name:"B",base:U.BIT,prefixes:R.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:U.BIT,prefixes:R.BINARY_LONG,value:8,offset:0}},ce={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function Me(K){if(K.number==="BigNumber"){var te=Nf(y);H.rad.value=new y(1),H.deg.value=te.div(180),H.grad.value=te.div(200),H.cycle.value=te.times(2),H.arcsec.value=te.div(648e3),H.arcmin.value=te.div(10800)}else H.rad.value=1,H.deg.value=Math.PI/180,H.grad.value=Math.PI/200,H.cycle.value=Math.PI*2,H.arcsec.value=Math.PI/648e3,H.arcmin.value=Math.PI/10800;H.radian.value=H.rad.value,H.degree.value=H.deg.value,H.gradian.value=H.grad.value}Me(t),r&&r("config",function(K,te){K.number!==te.number&&Me(K)});var pe={si:{NONE:{unit:ie,prefix:R.NONE[""]},LENGTH:{unit:H.m,prefix:R.SHORT[""]},MASS:{unit:H.g,prefix:R.SHORT.k},TIME:{unit:H.s,prefix:R.SHORT[""]},CURRENT:{unit:H.A,prefix:R.SHORT[""]},TEMPERATURE:{unit:H.K,prefix:R.SHORT[""]},LUMINOUS_INTENSITY:{unit:H.cd,prefix:R.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:H.mol,prefix:R.SHORT[""]},ANGLE:{unit:H.rad,prefix:R.SHORT[""]},BIT:{unit:H.bits,prefix:R.SHORT[""]},FORCE:{unit:H.N,prefix:R.SHORT[""]},ENERGY:{unit:H.J,prefix:R.SHORT[""]},POWER:{unit:H.W,prefix:R.SHORT[""]},PRESSURE:{unit:H.Pa,prefix:R.SHORT[""]},ELECTRIC_CHARGE:{unit:H.C,prefix:R.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:H.F,prefix:R.SHORT[""]},ELECTRIC_POTENTIAL:{unit:H.V,prefix:R.SHORT[""]},ELECTRIC_RESISTANCE:{unit:H.ohm,prefix:R.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:H.H,prefix:R.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:H.S,prefix:R.SHORT[""]},MAGNETIC_FLUX:{unit:H.Wb,prefix:R.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:H.T,prefix:R.SHORT[""]},FREQUENCY:{unit:H.Hz,prefix:R.SHORT[""]}}};pe.cgs=JSON.parse(JSON.stringify(pe.si)),pe.cgs.LENGTH={unit:H.m,prefix:R.SHORT.c},pe.cgs.MASS={unit:H.g,prefix:R.SHORT[""]},pe.cgs.FORCE={unit:H.dyn,prefix:R.SHORT[""]},pe.cgs.ENERGY={unit:H.erg,prefix:R.NONE[""]},pe.us=JSON.parse(JSON.stringify(pe.si)),pe.us.LENGTH={unit:H.ft,prefix:R.NONE[""]},pe.us.MASS={unit:H.lbm,prefix:R.NONE[""]},pe.us.TEMPERATURE={unit:H.degF,prefix:R.NONE[""]},pe.us.FORCE={unit:H.lbf,prefix:R.NONE[""]},pe.us.ENERGY={unit:H.BTU,prefix:R.BTU[""]},pe.us.POWER={unit:H.hp,prefix:R.NONE[""]},pe.us.PRESSURE={unit:H.psi,prefix:R.NONE[""]},pe.auto=JSON.parse(JSON.stringify(pe.si));var ge=pe.auto;b.setUnitSystem=function(K){if($e(pe,K))ge=pe[K];else throw new Error("Unit system "+K+" does not exist. Choices are: "+Object.keys(pe).join(", "))},b.getUnitSystem=function(){for(var K in pe)if($e(pe,K)&&pe[K]===ge)return K},b.typeConverters={BigNumber:function(te){return te!=null&&te.isFraction?new y(te.n).div(te.d).times(te.s):new y(te+"")},Fraction:function(te){return new w(te)},Complex:function(te){return te},number:function(te){return te!=null&&te.isFraction?x(te):te}},b.prototype._numberConverter=function(){var K=b.typeConverters[this.valueType()];if(K)return K;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},b._getNumberConverter=function(K){if(!b.typeConverters[K])throw new TypeError('Unsupported type "'+K+'"');return b.typeConverters[K]};for(var Se in H)if($e(H,Se)){var xe=H[Se];xe.dimensions=xe.base.dimensions}for(var be in ce)if($e(ce,be)){var De=H[ce[be]],Ae={};for(var ze in De)$e(De,ze)&&(Ae[ze]=De[ze]);Ae.name=be,H[be]=Ae}b.isValidAlpha=function(te){return/^[a-zA-Z]$/.test(te)};function Ze(K){for(var te=0;te0&&!(b.isValidAlpha(S)||M(S)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+K+'"')}}return b.createUnit=function(K,te){if(typeof K!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(te&&te.override){for(var ye in K)if($e(K,ye)&&b.deleteUnit(ye),K[ye].aliases)for(var ee=0;ee"u"||te===null)&&(te={}),typeof K!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if($e(H,K))throw new Error('Cannot create unit "'+K+'": a unit with that name already exists');Ze(K);var ye=null,ee=[],ne=0,ue,Ee,Ce;if(te&&te.type==="Unit")ye=te.clone();else if(typeof te=="string")te!==""&&(ue=te);else if(typeof te=="object")ue=te.definition,Ee=te.prefixes,ne=te.offset,Ce=te.baseName,te.aliases&&(ee=te.aliases.valueOf());else throw new TypeError('Cannot create unit "'+K+'" from "'+te.toString()+'": expecting "string" or "Unit" or "Object"');if(ee){for(var Le=0;Le1e-12){le=!1;break}if(le){Or=!0,Ie.base=U[re];break}}if(!Or){Ce=Ce||K+"_STUFF";var Oe={dimensions:ye.dimensions.slice(0)};Oe.key=Ce,U[Ce]=Oe,ge[Ce]={unit:Ie,prefix:R.NONE[""]},Ie.base=U[Ce]}}else{if(Ce=Ce||K+"_STUFF",j.indexOf(Ce)>=0)throw new Error('Cannot create new base unit "'+K+'": a base unit with that name already exists (and cannot be overridden)');j.push(Ce);for(var sr in U)$e(U,sr)&&(U[sr].dimensions[j.length-1]=0);for(var ir={dimensions:[]},Xe=0;Xe{var{typed:r,Unit:t}=e;return r(IS,{Unit:function(i){return i.clone()},string:function(i){return t.isValuelessUnit(i)?new t(null,i):t.parse(i,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(i,a){return new t(i,a)},"number | BigNumber | Fraction":function(i){return new t(i)},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var kS="sparse",kq=["typed","SparseMatrix"],RS=T(kS,kq,e=>{var{typed:r,SparseMatrix:t}=e;return r(kS,{"":function(){return new t([])},string:function(i){return new t([],i)},"Array | Matrix":function(i){return new t(i)},"Array | Matrix, string":function(i,a){return new t(i,a)}})});var LS="createUnit",Rq=["typed","Unit"],qS=T(LS,Rq,e=>{var{typed:r,Unit:t}=e;return r(LS,{"Object, Object":function(i,a){return t.createUnit(i,a)},Object:function(i){return t.createUnit(i,{})},"string, Unit | string | Object, Object":function(i,a,s){var c={};return c[i]=a,t.createUnit(c,s)},"string, Unit | string | Object":function(i,a){var s={};return s[i]=a,t.createUnit(s,{})},string:function(i){var a={};return a[i]={},t.createUnit(a,{})}})});var US="acos",Lq=["typed","config","Complex"],zS=T(US,Lq,e=>{var{typed:r,config:t,Complex:n}=e;return r(US,{number:function(a){return a>=-1&&a<=1||t.predictable?Math.acos(a):new n(a,0).acos()},Complex:function(a){return a.acos()},BigNumber:function(a){return a.acos()}})});var WS="acosh",qq=["typed","config","Complex"],VS=T(WS,qq,e=>{var{typed:r,config:t,Complex:n}=e;return r(WS,{number:function(a){return a>=1||t.predictable?Tv(a):a<=-1?new n(Math.log(Math.sqrt(a*a-1)-a),Math.PI):new n(a,0).acosh()},Complex:function(a){return a.acosh()},BigNumber:function(a){return a.acosh()}})});var YS="acot",Uq=["typed","BigNumber"],HS=T(YS,Uq,e=>{var{typed:r,BigNumber:t}=e;return r(YS,{number:Fv,Complex:function(i){return i.acot()},BigNumber:function(i){return new t(1).div(i).atan()}})});var GS="acoth",zq=["typed","config","Complex","BigNumber"],$S=T(GS,zq,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(GS,{number:function(s){return s>=1||s<=-1||t.predictable?Ov(s):new n(s,0).acoth()},Complex:function(s){return s.acoth()},BigNumber:function(s){return new i(1).div(s).atanh()}})});var ZS="acsc",Wq=["typed","config","Complex","BigNumber"],QS=T(ZS,Wq,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(ZS,{number:function(s){return s<=-1||s>=1||t.predictable?Bv(s):new n(s,0).acsc()},Complex:function(s){return s.acsc()},BigNumber:function(s){return new i(1).div(s).asin()}})});var XS="acsch",Vq=["typed","BigNumber"],JS=T(XS,Vq,e=>{var{typed:r,BigNumber:t}=e;return r(XS,{number:Iv,Complex:function(i){return i.acsch()},BigNumber:function(i){return new t(1).div(i).asinh()}})});var KS="asec",Yq=["typed","config","Complex","BigNumber"],jS=T(KS,Yq,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(KS,{number:function(s){return s<=-1||s>=1||t.predictable?Pv(s):new n(s,0).asec()},Complex:function(s){return s.asec()},BigNumber:function(s){return new i(1).div(s).acos()}})});var eN="asech",Hq=["typed","config","Complex","BigNumber"],rN=T(eN,Hq,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(eN,{number:function(s){if(s<=1&&s>=-1||t.predictable){var c=1/s;if(c>0||t.predictable)return kv(s);var f=Math.sqrt(c*c-1);return new n(Math.log(f-c),Math.PI)}return new n(s,0).asech()},Complex:function(s){return s.asech()},BigNumber:function(s){return new i(1).div(s).acosh()}})});var tN="asin",Gq=["typed","config","Complex"],nN=T(tN,Gq,e=>{var{typed:r,config:t,Complex:n}=e;return r(tN,{number:function(a){return a>=-1&&a<=1||t.predictable?Math.asin(a):new n(a,0).asin()},Complex:function(a){return a.asin()},BigNumber:function(a){return a.asin()}})});var $q="asinh",Zq=["typed"],iN=T($q,Zq,e=>{var{typed:r}=e;return r("asinh",{number:Rv,Complex:function(n){return n.asinh()},BigNumber:function(n){return n.asinh()}})});var Qq="atan",Xq=["typed"],aN=T(Qq,Xq,e=>{var{typed:r}=e;return r("atan",{number:function(n){return Math.atan(n)},Complex:function(n){return n.atan()},BigNumber:function(n){return n.atan()}})});var oN="atan2",Jq=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],sN=T(oN,Jq,e=>{var{typed:r,matrix:t,equalScalar:n,BigNumber:i,DenseMatrix:a,concat:s}=e,c=It({typed:r,equalScalar:n}),f=ft({typed:r}),o=Lc({typed:r,equalScalar:n}),u=Jr({typed:r,equalScalar:n}),p=Lr({typed:r,DenseMatrix:a}),d=vr({typed:r,matrix:t,concat:s});return r(oN,{"number, number":Math.atan2,"BigNumber, BigNumber":(h,x)=>i.atan2(h,x)},d({scalar:"number | BigNumber",SS:o,DS:f,SD:c,Ss:u,sS:p}))});var uN="atanh",Kq=["typed","config","Complex"],fN=T(uN,Kq,e=>{var{typed:r,config:t,Complex:n}=e;return r(uN,{number:function(a){return a<=1&&a>=-1||t.predictable?Lv(a):new n(a,0).atanh()},Complex:function(a){return a.atanh()},BigNumber:function(a){return a.atanh()}})});var xi=T("trigUnit",["typed"],e=>{var{typed:r}=e;return{Unit:r.referToSelf(t=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return r.find(t,n.valueType())(n.value)})}});var lN="cos",jq=["typed"],cN=T(lN,jq,e=>{var{typed:r}=e,t=xi({typed:r});return r(lN,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},t)});var pN="cosh",eU=["typed"],mN=T(pN,eU,e=>{var{typed:r}=e;return r(pN,{number:vc,"Complex | BigNumber":t=>t.cosh()})});var dN="cot",rU=["typed","BigNumber"],hN=T(dN,rU,e=>{var{typed:r,BigNumber:t}=e,n=xi({typed:r});return r(dN,{number:qv,Complex:i=>i.cot(),BigNumber:i=>new t(1).div(i.tan())},n)});var vN="coth",tU=["typed","BigNumber"],gN=T(vN,tU,e=>{var{typed:r,BigNumber:t}=e;return r(vN,{number:Uv,Complex:n=>n.coth(),BigNumber:n=>new t(1).div(n.tanh())})});var xN="csc",nU=["typed","BigNumber"],yN=T(xN,nU,e=>{var{typed:r,BigNumber:t}=e,n=xi({typed:r});return r(xN,{number:zv,Complex:i=>i.csc(),BigNumber:i=>new t(1).div(i.sin())},n)});var bN="csch",iU=["typed","BigNumber"],wN=T(bN,iU,e=>{var{typed:r,BigNumber:t}=e;return r(bN,{number:Wv,Complex:n=>n.csch(),BigNumber:n=>new t(1).div(n.sinh())})});var DN="sec",aU=["typed","BigNumber"],SN=T(DN,aU,e=>{var{typed:r,BigNumber:t}=e,n=xi({typed:r});return r(DN,{number:Vv,Complex:i=>i.sec(),BigNumber:i=>new t(1).div(i.cos())},n)});var NN="sech",oU=["typed","BigNumber"],AN=T(NN,oU,e=>{var{typed:r,BigNumber:t}=e;return r(NN,{number:Yv,Complex:n=>n.sech(),BigNumber:n=>new t(1).div(n.cosh())})});var EN="sin",sU=["typed"],CN=T(EN,sU,e=>{var{typed:r}=e,t=xi({typed:r});return r(EN,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},t)});var MN="sinh",uU=["typed"],_N=T(MN,uU,e=>{var{typed:r}=e;return r(MN,{number:Hv,"Complex | BigNumber":t=>t.sinh()})});var TN="tan",fU=["typed"],FN=T(TN,fU,e=>{var{typed:r}=e,t=xi({typed:r});return r(TN,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},t)});var lU="tanh",cU=["typed"],ON=T(lU,cU,e=>{var{typed:r}=e;return r("tanh",{number:gc,"Complex | BigNumber":t=>t.tanh()})});var BN="setCartesian",pU=["typed","size","subset","compareNatural","Index","DenseMatrix"],IN=T(BN,pU,e=>{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(BN,{"Array | Matrix, Array | Matrix":function(f,o){var u=[];if(n(t(f),new a(0))!==0&&n(t(o),new a(0))!==0){var p=gr(Array.isArray(f)?f:f.toArray()).sort(i),d=gr(Array.isArray(o)?o:o.toArray()).sort(i);u=[];for(var h=0;h{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(PN,{"Array | Matrix, Array | Matrix":function(f,o){var u;if(n(t(f),new a(0))===0)u=[];else{if(n(t(o),new a(0))===0)return gr(f.toArray());var p=Ia(gr(Array.isArray(f)?f:f.toArray()).sort(i)),d=Ia(gr(Array.isArray(o)?o:o.toArray()).sort(i));u=[];for(var h,x=0;x{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(RN,{"Array | Matrix":function(f){var o;if(n(t(f),new a(0))===0)o=[];else{var u=gr(Array.isArray(f)?f:f.toArray()).sort(i);o=[],o.push(u[0]);for(var p=1;p{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(qN,{"Array | Matrix, Array | Matrix":function(f,o){var u;if(n(t(f),new a(0))===0||n(t(o),new a(0))===0)u=[];else{var p=Ia(gr(Array.isArray(f)?f:f.toArray()).sort(i)),d=Ia(gr(Array.isArray(o)?o:o.toArray()).sort(i));u=[];for(var h=0;h{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(zN,{"Array | Matrix, Array | Matrix":function(c,f){if(n(t(c),new a(0))===0)return!0;if(n(t(f),new a(0))===0)return!1;for(var o=Ia(gr(Array.isArray(c)?c:c.toArray()).sort(i)),u=Ia(gr(Array.isArray(f)?f:f.toArray()).sort(i)),p,d=0;d{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(VN,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(c,f){if(n(t(f),new a(0))===0)return 0;for(var o=gr(Array.isArray(f)?f:f.toArray()),u=0,p=0;p{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(HN,{"Array | Matrix":function(o){if(n(t(o),new a(0))===0)return[];for(var u=gr(Array.isArray(o)?o:o.toArray()).sort(i),p=[],d=0;d.toString(2).length<=u.length;)p.push(s(u,d.toString(2).split("").reverse())),d++;return c(p)}});function s(f,o){for(var u=[],p=0;p0;u--)for(var p=0;pf[p+1].length&&(o=f[p],f[p]=f[p+1],f[p+1]=o);return f}});var $N="setSize",yU=["typed","compareNatural"],ZN=T($N,yU,e=>{var{typed:r,compareNatural:t}=e;return r($N,{"Array | Matrix":function(i){return Array.isArray(i)?gr(i).length:gr(i.toArray()).length},"Array | Matrix, boolean":function(i,a){if(a===!1||i.length===0)return Array.isArray(i)?gr(i).length:gr(i.toArray()).length;for(var s=gr(Array.isArray(i)?i:i.toArray()).sort(t),c=1,f=1;f{var{typed:r,size:t,concat:n,subset:i,setDifference:a,Index:s}=e;return r(QN,{"Array | Matrix, Array | Matrix":function(f,o){if(i(t(f),new s(0))===0)return gr(o);if(i(t(o),new s(0))===0)return gr(f);var u=gr(f),p=gr(o);return n(a(u,p),a(p,u))}})});var JN="setUnion",wU=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],KN=T(JN,wU,e=>{var{typed:r,size:t,concat:n,subset:i,setIntersect:a,setSymDifference:s,Index:c}=e;return r(JN,{"Array | Matrix, Array | Matrix":function(o,u){if(i(t(o),new c(0))===0)return gr(u);if(i(t(u),new c(0))===0)return gr(o);var p=gr(o),d=gr(u);return n(s(p,d),a(p,d))}})});var jN="add",DU=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],e2=T(jN,DU,e=>{var{typed:r,matrix:t,addScalar:n,equalScalar:i,DenseMatrix:a,SparseMatrix:s,concat:c}=e,f=hn({typed:r}),o=iu({typed:r,equalScalar:i}),u=Un({typed:r,DenseMatrix:a}),p=vr({typed:r,matrix:t,concat:c});return r(jN,{"any, any":n,"any, any, ...any":r.referToSelf(d=>(h,x,v)=>{for(var y=d(h,x),w=0;w{var{typed:r,abs:t,addScalar:n,divideScalar:i,multiplyScalar:a,sqrt:s,smaller:c,isPositive:f}=e;return r(r2,{"... number | BigNumber":o,Array:o,Matrix:u=>o(gr(u.toArray()))});function o(u){for(var p=0,d=0,h=0;h{var{typed:r,abs:t,add:n,pow:i,conj:a,sqrt:s,multiply:c,equalScalar:f,larger:o,smaller:u,matrix:p,ctranspose:d,eigs:h}=e;return r(n2,{number:Math.abs,Complex:function(F){return F.abs()},BigNumber:function(F){return F.abs()},boolean:function(F){return Math.abs(F)},Array:function(F){return S(p(F),2)},Matrix:function(F){return S(F,2)},"Array, number | BigNumber | string":function(F,M){return S(p(F),M)},"Matrix, number | BigNumber | string":function(F,M){return S(F,M)}});function x(O){var F=0;return O.forEach(function(M){var _=t(M);o(_,F)&&(F=_)},!0),F}function v(O){var F;return O.forEach(function(M){var _=t(M);(!F||u(_,F))&&(F=_)},!0),F||0}function y(O,F){if(F===Number.POSITIVE_INFINITY||F==="inf")return x(O);if(F===Number.NEGATIVE_INFINITY||F==="-inf")return v(O);if(F==="fro")return S(O,2);if(typeof F=="number"&&!isNaN(F)){if(!f(F,0)){var M=0;return O.forEach(function(_){M=n(i(t(_),F),M)},!0),i(M,1/F)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function w(O){var F=0;return O.forEach(function(M,_){F=n(F,c(M,a(M)))}),t(s(F))}function C(O){var F=[],M=0;return O.forEach(function(_,k){var L=k[1],Y=n(F[L]||0,t(_));o(Y,M)&&(M=Y),F[L]=Y},!0),M}function b(O){var F=O.size();if(F[0]!==F[1])throw new RangeError("Invalid matrix dimensions");var M=d(O),_=c(M,O),k=h(_).values.toArray(),L=k[k.length-1];return t(s(L))}function A(O){var F=[],M=0;return O.forEach(function(_,k){var L=k[0],Y=n(F[L]||0,t(_));o(Y,M)&&(M=Y),F[L]=Y},!0),M}function E(O,F){if(F===1)return C(O);if(F===Number.POSITIVE_INFINITY||F==="inf")return A(O);if(F==="fro")return w(O);if(F===2)return b(O);throw new Error("Unsupported parameter value "+F)}function S(O,F){var M=O.size();if(M.length===1)return y(O,F);if(M.length===2){if(M[0]&&M[1])return E(O,F);throw new RangeError("Invalid matrix dimensions")}}});var a2="dot",AU=["typed","addScalar","multiplyScalar","conj","size"],o2=T(a2,AU,e=>{var{typed:r,addScalar:t,multiplyScalar:n,conj:i,size:a}=e;return r(a2,{"Array | DenseMatrix, Array | DenseMatrix":c,"SparseMatrix, SparseMatrix":f});function s(u,p){var d=o(u),h=o(p),x,v;if(d.length===1)x=d[0];else if(d.length===2&&d[1]===1)x=d[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+d.join(", ")+")");if(h.length===1)v=h[0];else if(h.length===2&&h[1]===1)v=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(x!==v)throw new RangeError("Vectors must have equal length ("+x+" != "+v+")");if(x===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return x}function c(u,p){var d=s(u,p),h=Ge(u)?u._data:u,x=Ge(u)?u._datatype||u.getDataType():void 0,v=Ge(p)?p._data:p,y=Ge(p)?p._datatype||p.getDataType():void 0,w=o(u).length===2,C=o(p).length===2,b=t,A=n;if(x&&y&&x===y&&typeof x=="string"&&x!=="mixed"){var E=x;b=r.find(t,[E,E]),A=r.find(n,[E,E])}if(!w&&!C){for(var S=A(i(h[0]),v[0]),O=1;OS){A++;continue}E===S&&(y=w(y,C(h[b],v[A])),b++,A++)}return y}function o(u){return Ge(u)?u.size():a(u)}});var EU="trace",CU=["typed","matrix","add"],s2=T(EU,CU,e=>{var{typed:r,matrix:t,add:n}=e;return r("trace",{Array:function(c){return i(t(c))},SparseMatrix:a,DenseMatrix:i,any:tr});function i(s){var c=s._size,f=s._data;switch(c.length){case 1:if(c[0]===1)return tr(f[0]);throw new RangeError("Matrix must be square (size: "+lr(c)+")");case 2:{var o=c[0],u=c[1];if(o===u){for(var p=0,d=0;d0)for(var x=0;xx)break}return h}throw new RangeError("Matrix must be square (size: "+lr(u)+")")}});var u2="index",MU=["typed","Index"],f2=T(u2,MU,e=>{var{typed:r,Index:t}=e;return r(u2,{"...number | string | BigNumber | Range | Array | Matrix":function(i){var a=i.map(function(c){return je(c)?c.toNumber():Ar(c)||Ge(c)?c.map(function(f){return je(f)?f.toNumber():f}):c}),s=new t;return t.apply(s,a),s}})});var lp=new Set(["end"]);var _U="Node",TU=["mathWithTransform"],l2=T(_U,TU,e=>{var{mathWithTransform:r}=e;function t(i){for(var a of[...lp])if(i.has(a))throw new Error('Scope contains an illegal symbol, "'+a+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(a){return this.compile().evaluate(a)}compile(){var a=this._compile(r,{}),s={},c=null;function f(o){var u=Pa(o);return t(u),a(u,s,c)}return{evaluate:f}}_compile(a,s){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(a){throw new Error("Cannot run forEach on a Node interface")}map(a){throw new Error("Cannot run map on a Node interface")}_ifNode(a){if(!Sr(a))throw new TypeError("Callback function must return a Node");return a}traverse(a){a(this,null,null);function s(c,f){c.forEach(function(o,u,p){f(o,u,p),s(o,f)})}s(this,a)}transform(a){function s(c,f,o){var u=a(c,f,o);return u!==c?u:c.map(s)}return s(this,null,null)}filter(a){var s=[];return this.traverse(function(c,f,o){a(c,f,o)&&s.push(c)}),s}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(a){return a.cloneDeep()})}equals(a){return a?this.type===a.type&&Ui(this,a):!1}toString(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toString(a)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toHTML(a)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toTex(a)}_toTex(a){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(a){if(a&&typeof a=="object")switch(typeof a.handler){case"object":case"undefined":return;case"function":return a.handler(this,a);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});function lt(e){return e&&e.isIndexError?new Xt(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function cp(e){var{subset:r}=e;return function(n,i){try{if(Array.isArray(n))return r(n,i);if(n&&typeof n.subset=="function")return n.subset(i);if(typeof n=="string")return r(n,i);if(typeof n=="object"){if(!i.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return gt(n,i.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(a){throw lt(a)}}}var pp="AccessorNode",FU=["subset","Node"],c2=T(pp,FU,e=>{var{subset:r,Node:t}=e,n=cp({subset:r});function i(s){return!(Sn(s)||$t(s)||yr(s)||fn(s)||fa(s)||Zt(s)||rt(s))}class a extends t{constructor(c,f){if(super(),!Sr(c))throw new TypeError('Node expected for parameter "object"');if(!kn(f))throw new TypeError('IndexNode expected for parameter "index"');this.object=c,this.index=f}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return pp}get isAccessorNode(){return!0}_compile(c,f){var o=this.object._compile(c,f),u=this.index._compile(c,f);if(this.index.isObjectProperty()){var p=this.index.getObjectProperty();return function(h,x,v){return gt(o(h,x,v),p)}}else return function(h,x,v){var y=o(h,x,v),w=u(h,x,y);return n(y,w)}}forEach(c){c(this.object,"object",this),c(this.index,"index",this)}map(c){return new a(this._ifNode(c(this.object,"object",this)),this._ifNode(c(this.index,"index",this)))}clone(){return new a(this.object,this.index)}_toString(c){var f=this.object.toString(c);return i(this.object)&&(f="("+f+")"),f+this.index.toString(c)}_toHTML(c){var f=this.object.toHTML(c);return i(this.object)&&(f='('+f+')'),f+this.index.toHTML(c)}_toTex(c){var f=this.object.toTex(c);return i(this.object)&&(f="\\\\left(' + object + '\\\\right)"),f+this.index.toTex(c)}toJSON(){return{mathjs:pp,object:this.object,index:this.index}}static fromJSON(c){return new a(c.object,c.index)}}return Ur(a,"name",pp),a},{isClass:!0,isNode:!0});var mp="ArrayNode",OU=["Node"],p2=T(mp,OU,e=>{var{Node:r}=e;class t extends r{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(Sr))throw new TypeError("Array containing Nodes expected")}get type(){return mp}get isArrayNode(){return!0}_compile(i,a){var s=Rn(this.items,function(o){return o._compile(i,a)}),c=i.config.matrix!=="Array";if(c){var f=i.matrix;return function(u,p,d){return f(Rn(s,function(h){return h(u,p,d)}))}}else return function(u,p,d){return Rn(s,function(h){return h(u,p,d)})}}forEach(i){for(var a=0;a['+a.join(',')+']'}_toTex(i){function a(s,c){var f=s.some($t)&&!s.every($t),o=c||f,u=o?"&":"\\\\\\\\",p=s.map(function(d){return d.items?a(d.items,!c):d.toTex(i)}).join(u);return f||!o||o&&!c?"\\\\begin{bmatrix}"+p+"\\\\end{bmatrix}":p}return a(this.items,!1)}}return Ur(t,"name",mp),t},{isClass:!0,isNode:!0});function m2(e){var{subset:r,matrix:t}=e;return function(i,a,s){try{if(Array.isArray(i)){var c=t(i).subset(a,s).valueOf();return c.forEach((f,o)=>{i[o]=f}),i}else{if(i&&typeof i.subset=="function")return i.subset(a,s);if(typeof i=="string")return r(i,a,s);if(typeof i=="object"){if(!a.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return la(i,a.getObjectProperty(),s),i}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(f){throw lt(f)}}}var yi=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function dp(e,r){if(!r||r!=="auto")return e;for(var t=e;Zt(t);)t=t.content;return t}function Gr(e,r,t,n){var i=e;r!=="keep"&&(i=e.getContent());for(var a=i.getIdentifier(),s=null,c=0;c{var{subset:r,matrix:t,Node:n}=e,i=cp({subset:r}),a=m2({subset:r,matrix:t});function s(f,o,u){o||(o="keep");var p=Gr(f,o,u),d=Gr(f.value,o,u);return o==="all"||d!==null&&d<=p}class c extends n{constructor(o,u,p){if(super(),this.object=o,this.index=p?u:null,this.value=p||u,!rt(o)&&!Sn(o))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(rt(o)&&o.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!kn(this.index))throw new TypeError('IndexNode expected as "index"');if(!Sr(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return vp}get isAssignmentNode(){return!0}_compile(o,u){var p=this.object._compile(o,u),d=this.index?this.index._compile(o,u):null,h=this.value._compile(o,u),x=this.object.name;if(this.index)if(this.index.isObjectProperty()){var v=this.index.getObjectProperty();return function(A,E,S){var O=p(A,E,S),F=h(A,E,S);return la(O,v,F),F}}else{if(rt(this.object))return function(A,E,S){var O=p(A,E,S),F=h(A,E,S),M=d(A,E,O);return A.set(x,a(O,M,F)),F};var y=this.object.object._compile(o,u);if(this.object.index.isObjectProperty()){var w=this.object.index.getObjectProperty();return function(A,E,S){var O=y(A,E,S),F=gt(O,w),M=d(A,E,F),_=h(A,E,S);return la(O,w,a(F,M,_)),_}}else{var C=this.object.index._compile(o,u);return function(A,E,S){var O=y(A,E,S),F=C(A,E,O),M=i(O,F),_=d(A,E,M),k=h(A,E,S);return a(O,F,a(M,_,k)),k}}}else{if(!rt(this.object))throw new TypeError("SymbolNode expected as object");return function(A,E,S){var O=h(A,E,S);return A.set(x,O),O}}}forEach(o){o(this.object,"object",this),this.index&&o(this.index,"index",this),o(this.value,"value",this)}map(o){var u=this._ifNode(o(this.object,"object",this)),p=this.index?this._ifNode(o(this.index,"index",this)):null,d=this._ifNode(o(this.value,"value",this));return new c(u,p,d)}clone(){return new c(this.object,this.index,this.value)}_toString(o){var u=this.object.toString(o),p=this.index?this.index.toString(o):"",d=this.value.toString(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(d="("+d+")"),u+p+" = "+d}toJSON(){return{mathjs:vp,object:this.object,index:this.index,value:this.value}}static fromJSON(o){return new c(o.object,o.index,o.value)}_toHTML(o){var u=this.object.toHTML(o),p=this.index?this.index.toHTML(o):"",d=this.value.toHTML(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(d='('+d+')'),u+p+'='+d}_toTex(o){var u=this.object.toTex(o),p=this.index?this.index.toTex(o):"",d=this.value.toTex(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(d="\\\\left(".concat(d,"\\\\right)")),u+p+"="+d}}return Ur(c,"name",vp),c},{isClass:!0,isNode:!0});var gp="BlockNode",IU=["ResultSet","Node"],v2=T(gp,IU,e=>{var{ResultSet:r,Node:t}=e;class n extends t{constructor(a){if(super(),!Array.isArray(a))throw new Error("Array expected");this.blocks=a.map(function(s){var c=s&&s.node,f=s&&s.visible!==void 0?s.visible:!0;if(!Sr(c))throw new TypeError('Property "node" must be a Node');if(typeof f!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:c,visible:f}})}get type(){return gp}get isBlockNode(){return!0}_compile(a,s){var c=Rn(this.blocks,function(f){return{evaluate:f.node._compile(a,s),visible:f.visible}});return function(o,u,p){var d=[];return po(c,function(x){var v=x.evaluate(o,u,p);x.visible&&d.push(v)}),new r(d)}}forEach(a){for(var s=0;s;')}).join('
')}_toTex(a){return this.blocks.map(function(s){return s.node.toTex(a)+(s.visible?"":";")}).join(\`\\\\;\\\\; +\`)}}return Ur(n,"name",gp),n},{isClass:!0,isNode:!0});var xp="ConditionalNode",PU=["Node"],g2=T(xp,PU,e=>{var{Node:r}=e;function t(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if(je(i))return!i.isZero();if(Gt(i))return!!(i.re||i.im);if(qt(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+_r(i)+'"')}class n extends r{constructor(a,s,c){if(super(),!Sr(a))throw new TypeError("Parameter condition must be a Node");if(!Sr(s))throw new TypeError("Parameter trueExpr must be a Node");if(!Sr(c))throw new TypeError("Parameter falseExpr must be a Node");this.condition=a,this.trueExpr=s,this.falseExpr=c}get type(){return xp}get isConditionalNode(){return!0}_compile(a,s){var c=this.condition._compile(a,s),f=this.trueExpr._compile(a,s),o=this.falseExpr._compile(a,s);return function(p,d,h){return t(c(p,d,h))?f(p,d,h):o(p,d,h)}}forEach(a){a(this.condition,"condition",this),a(this.trueExpr,"trueExpr",this),a(this.falseExpr,"falseExpr",this)}map(a){return new n(this._ifNode(a(this.condition,"condition",this)),this._ifNode(a(this.trueExpr,"trueExpr",this)),this._ifNode(a(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(a){var s=a&&a.parenthesis?a.parenthesis:"keep",c=Gr(this,s,a&&a.implicit),f=this.condition.toString(a),o=Gr(this.condition,s,a&&a.implicit);(s==="all"||this.condition.type==="OperatorNode"||o!==null&&o<=c)&&(f="("+f+")");var u=this.trueExpr.toString(a),p=Gr(this.trueExpr,s,a&&a.implicit);(s==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=c)&&(u="("+u+")");var d=this.falseExpr.toString(a),h=Gr(this.falseExpr,s,a&&a.implicit);return(s==="all"||this.falseExpr.type==="OperatorNode"||h!==null&&h<=c)&&(d="("+d+")"),f+" ? "+u+" : "+d}toJSON(){return{mathjs:xp,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(a){return new n(a.condition,a.trueExpr,a.falseExpr)}_toHTML(a){var s=a&&a.parenthesis?a.parenthesis:"keep",c=Gr(this,s,a&&a.implicit),f=this.condition.toHTML(a),o=Gr(this.condition,s,a&&a.implicit);(s==="all"||this.condition.type==="OperatorNode"||o!==null&&o<=c)&&(f='('+f+')');var u=this.trueExpr.toHTML(a),p=Gr(this.trueExpr,s,a&&a.implicit);(s==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=c)&&(u='('+u+')');var d=this.falseExpr.toHTML(a),h=Gr(this.falseExpr,s,a&&a.implicit);return(s==="all"||this.falseExpr.type==="OperatorNode"||h!==null&&h<=c)&&(d='('+d+')'),f+'?'+u+':'+d}_toTex(a){return"\\\\begin{cases} {"+this.trueExpr.toTex(a)+"}, &\\\\quad{\\\\text{if }\\\\;"+this.condition.toTex(a)+"}\\\\\\\\{"+this.falseExpr.toTex(a)+"}, &\\\\quad{\\\\text{otherwise}}\\\\end{cases}"}}return Ur(n,"name",xp),n},{isClass:!0,isNode:!0});var w2=ci(y2(),1);var n0={Alpha:"A",alpha:"\\\\alpha",Beta:"B",beta:"\\\\beta",Gamma:"\\\\Gamma",gamma:"\\\\gamma",Delta:"\\\\Delta",delta:"\\\\delta",Epsilon:"E",epsilon:"\\\\epsilon",varepsilon:"\\\\varepsilon",Zeta:"Z",zeta:"\\\\zeta",Eta:"H",eta:"\\\\eta",Theta:"\\\\Theta",theta:"\\\\theta",vartheta:"\\\\vartheta",Iota:"I",iota:"\\\\iota",Kappa:"K",kappa:"\\\\kappa",varkappa:"\\\\varkappa",Lambda:"\\\\Lambda",lambda:"\\\\lambda",Mu:"M",mu:"\\\\mu",Nu:"N",nu:"\\\\nu",Xi:"\\\\Xi",xi:"\\\\xi",Omicron:"O",omicron:"o",Pi:"\\\\Pi",pi:"\\\\pi",varpi:"\\\\varpi",Rho:"P",rho:"\\\\rho",varrho:"\\\\varrho",Sigma:"\\\\Sigma",sigma:"\\\\sigma",varsigma:"\\\\varsigma",Tau:"T",tau:"\\\\tau",Upsilon:"\\\\Upsilon",upsilon:"\\\\upsilon",Phi:"\\\\Phi",phi:"\\\\phi",varphi:"\\\\varphi",Chi:"X",chi:"\\\\chi",Psi:"\\\\Psi",psi:"\\\\psi",Omega:"\\\\Omega",omega:"\\\\omega",true:"\\\\mathrm{True}",false:"\\\\mathrm{False}",i:"i",inf:"\\\\infty",Inf:"\\\\infty",infinity:"\\\\infty",Infinity:"\\\\infty",oo:"\\\\infty",lim:"\\\\lim",undefined:"\\\\mathbf{?}"},zr={transpose:"^\\\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\\\~",not:"\\\\neg",multiply:"\\\\cdot",divide:"\\\\frac",dotMultiply:".\\\\cdot",dotDivide:".:",mod:"\\\\mod",add:"+",subtract:"-",to:"\\\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\\\neq",smaller:"<",larger:">",smallerEq:"\\\\leq",largerEq:"\\\\geq",bitAnd:"\\\\&",bitXor:"\\\\underline{|}",bitOr:"|",and:"\\\\wedge",xor:"\\\\veebar",or:"\\\\vee"},i0={abs:{1:"\\\\left|\${args[0]}\\\\right|"},add:{2:"\\\\left(\${args[0]}".concat(zr.add,"\${args[1]}\\\\right)")},cbrt:{1:"\\\\sqrt[3]{\${args[0]}}"},ceil:{1:"\\\\left\\\\lceil\${args[0]}\\\\right\\\\rceil"},cube:{1:"\\\\left(\${args[0]}\\\\right)^3"},divide:{2:"\\\\frac{\${args[0]}}{\${args[1]}}"},dotDivide:{2:"\\\\left(\${args[0]}".concat(zr.dotDivide,"\${args[1]}\\\\right)")},dotMultiply:{2:"\\\\left(\${args[0]}".concat(zr.dotMultiply,"\${args[1]}\\\\right)")},dotPow:{2:"\\\\left(\${args[0]}".concat(zr.dotPow,"\${args[1]}\\\\right)")},exp:{1:"\\\\exp\\\\left(\${args[0]}\\\\right)"},expm1:"\\\\left(e".concat(zr.pow,"{\${args[0]}}-1\\\\right)"),fix:{1:"\\\\mathrm{\${name}}\\\\left(\${args[0]}\\\\right)"},floor:{1:"\\\\left\\\\lfloor\${args[0]}\\\\right\\\\rfloor"},gcd:"\\\\gcd\\\\left(\${args}\\\\right)",hypot:"\\\\hypot\\\\left(\${args}\\\\right)",log:{1:"\\\\ln\\\\left(\${args[0]}\\\\right)",2:"\\\\log_{\${args[1]}}\\\\left(\${args[0]}\\\\right)"},log10:{1:"\\\\log_{10}\\\\left(\${args[0]}\\\\right)"},log1p:{1:"\\\\ln\\\\left(\${args[0]}+1\\\\right)",2:"\\\\log_{\${args[1]}}\\\\left(\${args[0]}+1\\\\right)"},log2:"\\\\log_{2}\\\\left(\${args[0]}\\\\right)",mod:{2:"\\\\left(\${args[0]}".concat(zr.mod,"\${args[1]}\\\\right)")},multiply:{2:"\\\\left(\${args[0]}".concat(zr.multiply,"\${args[1]}\\\\right)")},norm:{1:"\\\\left\\\\|\${args[0]}\\\\right\\\\|",2:void 0},nthRoot:{2:"\\\\sqrt[\${args[1]}]{\${args[0]}}"},nthRoots:{2:"\\\\{y : $y^{args[1]} = {\${args[0]}}\\\\}"},pow:{2:"\\\\left(\${args[0]}\\\\right)".concat(zr.pow,"{\${args[1]}}")},round:{1:"\\\\left\\\\lfloor\${args[0]}\\\\right\\\\rceil",2:void 0},sign:{1:"\\\\mathrm{\${name}}\\\\left(\${args[0]}\\\\right)"},sqrt:{1:"\\\\sqrt{\${args[0]}}"},square:{1:"\\\\left(\${args[0]}\\\\right)^2"},subtract:{2:"\\\\left(\${args[0]}".concat(zr.subtract,"\${args[1]}\\\\right)")},unaryMinus:{1:"".concat(zr.unaryMinus,"\\\\left(\${args[0]}\\\\right)")},unaryPlus:{1:"".concat(zr.unaryPlus,"\\\\left(\${args[0]}\\\\right)")},bitAnd:{2:"\\\\left(\${args[0]}".concat(zr.bitAnd,"\${args[1]}\\\\right)")},bitNot:{1:zr.bitNot+"\\\\left(\${args[0]}\\\\right)"},bitOr:{2:"\\\\left(\${args[0]}".concat(zr.bitOr,"\${args[1]}\\\\right)")},bitXor:{2:"\\\\left(\${args[0]}".concat(zr.bitXor,"\${args[1]}\\\\right)")},leftShift:{2:"\\\\left(\${args[0]}".concat(zr.leftShift,"\${args[1]}\\\\right)")},rightArithShift:{2:"\\\\left(\${args[0]}".concat(zr.rightArithShift,"\${args[1]}\\\\right)")},rightLogShift:{2:"\\\\left(\${args[0]}".concat(zr.rightLogShift,"\${args[1]}\\\\right)")},bellNumbers:{1:"\\\\mathrm{B}_{\${args[0]}}"},catalan:{1:"\\\\mathrm{C}_{\${args[0]}}"},stirlingS2:{2:"\\\\mathrm{S}\\\\left(\${args}\\\\right)"},arg:{1:"\\\\arg\\\\left(\${args[0]}\\\\right)"},conj:{1:"\\\\left(\${args[0]}\\\\right)^*"},im:{1:"\\\\Im\\\\left\\\\lbrace\${args[0]}\\\\right\\\\rbrace"},re:{1:"\\\\Re\\\\left\\\\lbrace\${args[0]}\\\\right\\\\rbrace"},and:{2:"\\\\left(\${args[0]}".concat(zr.and,"\${args[1]}\\\\right)")},not:{1:zr.not+"\\\\left(\${args[0]}\\\\right)"},or:{2:"\\\\left(\${args[0]}".concat(zr.or,"\${args[1]}\\\\right)")},xor:{2:"\\\\left(\${args[0]}".concat(zr.xor,"\${args[1]}\\\\right)")},cross:{2:"\\\\left(\${args[0]}\\\\right)\\\\times\\\\left(\${args[1]}\\\\right)"},ctranspose:{1:"\\\\left(\${args[0]}\\\\right)".concat(zr.ctranspose)},det:{1:"\\\\det\\\\left(\${args[0]}\\\\right)"},dot:{2:"\\\\left(\${args[0]}\\\\cdot\${args[1]}\\\\right)"},expm:{1:"\\\\exp\\\\left(\${args[0]}\\\\right)"},inv:{1:"\\\\left(\${args[0]}\\\\right)^{-1}"},pinv:{1:"\\\\left(\${args[0]}\\\\right)^{+}"},sqrtm:{1:"{\${args[0]}}".concat(zr.pow,"{\\\\frac{1}{2}}")},trace:{1:"\\\\mathrm{tr}\\\\left(\${args[0]}\\\\right)"},transpose:{1:"\\\\left(\${args[0]}\\\\right)".concat(zr.transpose)},combinations:{2:"\\\\binom{\${args[0]}}{\${args[1]}}"},combinationsWithRep:{2:"\\\\left(\\\\!\\\\!{\\\\binom{\${args[0]}}{\${args[1]}}}\\\\!\\\\!\\\\right)"},factorial:{1:"\\\\left(\${args[0]}\\\\right)".concat(zr.factorial)},gamma:{1:"\\\\Gamma\\\\left(\${args[0]}\\\\right)"},lgamma:{1:"\\\\ln\\\\Gamma\\\\left(\${args[0]}\\\\right)"},equal:{2:"\\\\left(\${args[0]}".concat(zr.equal,"\${args[1]}\\\\right)")},larger:{2:"\\\\left(\${args[0]}".concat(zr.larger,"\${args[1]}\\\\right)")},largerEq:{2:"\\\\left(\${args[0]}".concat(zr.largerEq,"\${args[1]}\\\\right)")},smaller:{2:"\\\\left(\${args[0]}".concat(zr.smaller,"\${args[1]}\\\\right)")},smallerEq:{2:"\\\\left(\${args[0]}".concat(zr.smallerEq,"\${args[1]}\\\\right)")},unequal:{2:"\\\\left(\${args[0]}".concat(zr.unequal,"\${args[1]}\\\\right)")},erf:{1:"erf\\\\left(\${args[0]}\\\\right)"},max:"\\\\max\\\\left(\${args}\\\\right)",min:"\\\\min\\\\left(\${args}\\\\right)",variance:"\\\\mathrm{Var}\\\\left(\${args}\\\\right)",acos:{1:"\\\\cos^{-1}\\\\left(\${args[0]}\\\\right)"},acosh:{1:"\\\\cosh^{-1}\\\\left(\${args[0]}\\\\right)"},acot:{1:"\\\\cot^{-1}\\\\left(\${args[0]}\\\\right)"},acoth:{1:"\\\\coth^{-1}\\\\left(\${args[0]}\\\\right)"},acsc:{1:"\\\\csc^{-1}\\\\left(\${args[0]}\\\\right)"},acsch:{1:"\\\\mathrm{csch}^{-1}\\\\left(\${args[0]}\\\\right)"},asec:{1:"\\\\sec^{-1}\\\\left(\${args[0]}\\\\right)"},asech:{1:"\\\\mathrm{sech}^{-1}\\\\left(\${args[0]}\\\\right)"},asin:{1:"\\\\sin^{-1}\\\\left(\${args[0]}\\\\right)"},asinh:{1:"\\\\sinh^{-1}\\\\left(\${args[0]}\\\\right)"},atan:{1:"\\\\tan^{-1}\\\\left(\${args[0]}\\\\right)"},atan2:{2:"\\\\mathrm{atan2}\\\\left(\${args}\\\\right)"},atanh:{1:"\\\\tanh^{-1}\\\\left(\${args[0]}\\\\right)"},cos:{1:"\\\\cos\\\\left(\${args[0]}\\\\right)"},cosh:{1:"\\\\cosh\\\\left(\${args[0]}\\\\right)"},cot:{1:"\\\\cot\\\\left(\${args[0]}\\\\right)"},coth:{1:"\\\\coth\\\\left(\${args[0]}\\\\right)"},csc:{1:"\\\\csc\\\\left(\${args[0]}\\\\right)"},csch:{1:"\\\\mathrm{csch}\\\\left(\${args[0]}\\\\right)"},sec:{1:"\\\\sec\\\\left(\${args[0]}\\\\right)"},sech:{1:"\\\\mathrm{sech}\\\\left(\${args[0]}\\\\right)"},sin:{1:"\\\\sin\\\\left(\${args[0]}\\\\right)"},sinh:{1:"\\\\sinh\\\\left(\${args[0]}\\\\right)"},tan:{1:"\\\\tan\\\\left(\${args[0]}\\\\right)"},tanh:{1:"\\\\tanh\\\\left(\${args[0]}\\\\right)"},to:{2:"\\\\left(\${args[0]}".concat(zr.to,"\${args[1]}\\\\right)")},numeric:function(r,t){return r.args[0].toTex()},number:{0:"0",1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\\\\left(\${args[0]}\\\\right)\${args[1]}\\\\right)"},string:{0:'\\\\mathtt{""}',1:"\\\\mathrm{string}\\\\left(\${args[0]}\\\\right)"},bignumber:{0:"0",1:"\\\\left(\${args[0]}\\\\right)"},complex:{0:"0",1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\\\\left(\${args[0]}\\\\right)+".concat(n0.i,"\\\\cdot\\\\left(\${args[1]}\\\\right)\\\\right)")},matrix:{0:"\\\\begin{bmatrix}\\\\end{bmatrix}",1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\${args[0]}\\\\right)"},sparse:{0:"\\\\begin{bsparse}\\\\end{bsparse}",1:"\\\\left(\${args[0]}\\\\right)"},unit:{1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\\\\left(\${args[0]}\\\\right)\${args[1]}\\\\right)"}},D2="\\\\mathrm{\${name}}\\\\left(\${args}\\\\right)",b2={deg:"^\\\\circ"};function yp(e){return(0,w2.default)(e,{preserveFormatting:!0})}function bp(e,r){return r=typeof r>"u"?!1:r,r?$e(b2,e)?b2[e]:"\\\\mathrm{"+yp(e)+"}":$e(n0,e)?n0[e]:yp(e)}var wp="ConstantNode",qU=["Node"],S2=T(wp,qU,e=>{var{Node:r}=e;class t extends r{constructor(i){super(),this.value=i}get type(){return wp}get isConstantNode(){return!0}_compile(i,a){var s=this.value;return function(){return s}}forEach(i){}map(i){return this.clone()}clone(){return new t(this.value)}_toString(i){return lr(this.value,i)}_toHTML(i){var a=this._toString(i);switch(_r(this.value)){case"number":case"BigNumber":case"Fraction":return''+a+"";case"string":return''+a+"";case"boolean":return''+a+"";case"null":return''+a+"";case"undefined":return''+a+"";default:return''+a+""}}toJSON(){return{mathjs:wp,value:this.value}}static fromJSON(i){return new t(i.value)}_toTex(i){var a=this._toString(i),s=_r(this.value);switch(s){case"string":return"\\\\mathtt{"+yp(a)+"}";case"number":case"BigNumber":{var c=s==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!c)return this.value.valueOf()<0?"-\\\\infty":"\\\\infty";var f=a.toLowerCase().indexOf("e");return f!==-1?a.substring(0,f)+"\\\\cdot10^{"+a.substring(f+1)+"}":a}case"Fraction":return this.value.toLatex();default:return a}}}return Ur(t,"name",wp),t},{isClass:!0,isNode:!0});var Dp="FunctionAssignmentNode",UU=["typed","Node"],N2=T(Dp,UU,e=>{var{typed:r,Node:t}=e;function n(a,s,c){var f=Gr(a,s,c),o=Gr(a.expr,s,c);return s==="all"||o!==null&&o<=f}class i extends t{constructor(s,c,f){if(super(),typeof s!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(c))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!Sr(f))throw new TypeError('Node expected for parameter "expr"');if(lp.has(s))throw new Error('Illegal function name, "'+s+'" is a reserved keyword');var o=new Set;for(var u of c){var p=typeof u=="string"?u:u.name;if(o.has(p))throw new Error('Duplicate parameter name "'.concat(p,'"'));o.add(p)}this.name=s,this.params=c.map(function(d){return d&&d.name||d}),this.types=c.map(function(d){return d&&d.type||"any"}),this.expr=f}get type(){return Dp}get isFunctionAssignmentNode(){return!0}_compile(s,c){var f=Object.create(c);po(this.params,function(x){f[x]=!0});var o=this.expr._compile(s,f),u=this.name,p=this.params,d=Ph(this.types,","),h=u+"("+Ph(this.params,", ")+")";return function(v,y,w){var C={};C[d]=function(){for(var A=Object.create(y),E=0;E'+Qt(this.params[o])+"");var u=this.expr.toHTML(s);return n(this,c,s&&s.implicit)&&(u='('+u+')'),''+Qt(this.name)+'('+f.join(',')+')='+u}_toTex(s){var c=s&&s.parenthesis?s.parenthesis:"keep",f=this.expr.toTex(s);return n(this,c,s&&s.implicit)&&(f="\\\\left(".concat(f,"\\\\right)")),"\\\\mathrm{"+this.name+"}\\\\left("+this.params.map(bp).join(",")+"\\\\right)="+f}}return Ur(i,"name",Dp),i},{isClass:!0,isNode:!0});var Sp="IndexNode",zU=["Node","size"],A2=T(Sp,zU,e=>{var{Node:r,size:t}=e;class n extends r{constructor(a,s){if(super(),this.dimensions=a,this.dotNotation=s||!1,!Array.isArray(a)||!a.every(Sr))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return Sp}get isIndexNode(){return!0}_compile(a,s){var c=Rn(this.dimensions,function(o,u){var p=o.filter(x=>x.isSymbolNode&&x.name==="end").length>0;if(p){var d=Object.create(s);d.end=!0;var h=o._compile(a,d);return function(v,y,w){if(!Ge(w)&&!Ar(w)&&!yt(w))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+_r(w));var C=t(w).valueOf(),b=Object.create(y);return b.end=C[u],h(v,b,w)}}else return o._compile(a,s)}),f=gt(a,"index");return function(u,p,d){var h=Rn(c,function(x){return x(u,p,d)});return f(...h)}}forEach(a){for(var s=0;s.'+Qt(this.getObjectProperty())+"":'['+s.join(',')+']'}_toTex(a){var s=this.dimensions.map(function(c){return c.toTex(a)});return this.dotNotation?"."+this.getObjectProperty():"_{"+s.join(",")+"}"}}return Ur(n,"name",Sp),n},{isClass:!0,isNode:!0});var Np="ObjectNode",WU=["Node"],E2=T(Np,WU,e=>{var{Node:r}=e;class t extends r{constructor(i){if(super(),this.properties=i||{},i&&(typeof i!="object"||!Object.keys(i).every(function(a){return Sr(i[a])})))throw new TypeError("Object containing Nodes expected")}get type(){return Np}get isObjectNode(){return!0}_compile(i,a){var s={};for(var c in this.properties)if($e(this.properties,c)){var f=Jo(c),o=JSON.parse(f),u=gt(this.properties,c);s[o]=u._compile(i,a)}return function(d,h,x){var v={};for(var y in s)$e(s,y)&&(v[y]=s[y](d,h,x));return v}}forEach(i){for(var a in this.properties)$e(this.properties,a)&&i(this.properties[a],"properties["+Jo(a)+"]",this)}map(i){var a={};for(var s in this.properties)$e(this.properties,s)&&(a[s]=this._ifNode(i(this.properties[s],"properties["+Jo(s)+"]",this)));return new t(a)}clone(){var i={};for(var a in this.properties)$e(this.properties,a)&&(i[a]=this.properties[a]);return new t(i)}_toString(i){var a=[];for(var s in this.properties)$e(this.properties,s)&&a.push(Jo(s)+": "+this.properties[s].toString(i));return"{"+a.join(", ")+"}"}toJSON(){return{mathjs:Np,properties:this.properties}}static fromJSON(i){return new t(i.properties)}_toHTML(i){var a=[];for(var s in this.properties)$e(this.properties,s)&&a.push(''+Qt(s)+':'+this.properties[s].toHTML(i));return'{'+a.join(',')+'}'}_toTex(i){var a=[];for(var s in this.properties)$e(this.properties,s)&&a.push("\\\\mathbf{"+s+":} & "+this.properties[s].toTex(i)+"\\\\\\\\");var c="\\\\left\\\\{\\\\begin{array}{ll}"+a.join(\` +\`)+"\\\\end{array}\\\\right\\\\}";return c}}return Ur(t,"name",Np),t},{isClass:!0,isNode:!0});function as(e,r){return new Js(e,new es(r),new Set(Object.keys(r)))}var Ap="OperatorNode",VU=["Node"],C2=T(Ap,VU,e=>{var{Node:r}=e;function t(a,s){var c=a;if(s==="auto")for(;Zt(c);)c=c.content;return yr(c)?!0:ut(c)?t(c.args[0],s):!1}function n(a,s,c,f,o){var u=Gr(a,s,c),p=cu(a,s);if(s==="all"||f.length>2&&a.getIdentifier()!=="OperatorNode:add"&&a.getIdentifier()!=="OperatorNode:multiply")return f.map(function(_){switch(_.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var d;switch(f.length){case 0:d=[];break;case 1:{var h=Gr(f[0],s,c,a);if(o&&h!==null){var x,v;if(s==="keep"?(x=f[0].getIdentifier(),v=a.getIdentifier()):(x=f[0].getContent().getIdentifier(),v=a.getContent().getIdentifier()),yi[u][v].latexLeftParens===!1){d=[!1];break}if(yi[h][x].latexParens===!1){d=[!1];break}}if(h===null){d=[!1];break}if(h<=u){d=[!0];break}d=[!1]}break;case 2:{var y,w=Gr(f[0],s,c,a),C=hp(a,f[0],s);w===null?y=!1:w===u&&p==="right"&&!C||w=2&&a.getIdentifier()==="OperatorNode:multiply"&&a.implicit&&s!=="all"&&c==="hide")for(var M=1;M2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var y=o.map(function(w,C){return w=w.toString(s),u[C]&&(w="("+w+")"),w});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&f==="hide"?y.join(" "):y.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:Ap,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(s){return new i(s.op,s.fn,s.args,s.implicit,s.isPercentage)}_toHTML(s){var c=s&&s.parenthesis?s.parenthesis:"keep",f=s&&s.implicit?s.implicit:"hide",o=this.args,u=n(this,c,f,o,!1);if(o.length===1){var p=cu(this,c),d=o[0].toHTML(s);return u[0]&&(d='('+d+')'),p==="right"?''+Qt(this.op)+""+d:d+''+Qt(this.op)+""}else if(o.length===2){var h=o[0].toHTML(s),x=o[1].toHTML(s);return u[0]&&(h='('+h+')'),u[1]&&(x='('+x+')'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&f==="hide"?h+''+x:h+''+Qt(this.op)+""+x}else{var v=o.map(function(y,w){return y=y.toHTML(s),u[w]&&(y='('+y+')'),y});return o.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&f==="hide"?v.join(''):v.join(''+Qt(this.op)+""):''+Qt(this.fn)+'('+v.join(',')+')'}}_toTex(s){var c=s&&s.parenthesis?s.parenthesis:"keep",f=s&&s.implicit?s.implicit:"hide",o=this.args,u=n(this,c,f,o,!0),p=zr[this.fn];if(p=typeof p>"u"?this.op:p,o.length===1){var d=cu(this,c),h=o[0].toTex(s);return u[0]&&(h="\\\\left(".concat(h,"\\\\right)")),d==="right"?p+h:h+p}else if(o.length===2){var x=o[0],v=x.toTex(s);u[0]&&(v="\\\\left(".concat(v,"\\\\right)"));var y=o[1],w=y.toTex(s);u[1]&&(w="\\\\left(".concat(w,"\\\\right)"));var C;switch(c==="keep"?C=x.getIdentifier():C=x.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return p+"{"+v+"}{"+w+"}";case"OperatorNode:pow":switch(v="{"+v+"}",w="{"+w+"}",C){case"ConditionalNode":case"OperatorNode:divide":v="\\\\left(".concat(v,"\\\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&f==="hide")return v+"~"+w}return v+p+w}else if(o.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var b=o.map(function(A,E){return A=A.toTex(s),u[E]&&(A="\\\\left(".concat(A,"\\\\right)")),A});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&f==="hide"?b.join("~"):b.join(p)}else return"\\\\mathrm{"+this.fn+"}\\\\left("+o.map(function(A){return A.toTex(s)}).join(",")+"\\\\right)"}getIdentifier(){return this.type+":"+this.fn}}return Ur(i,"name",Ap),i},{isClass:!0,isNode:!0});var Ep="ParenthesisNode",YU=["Node"],M2=T(Ep,YU,e=>{var{Node:r}=e;class t extends r{constructor(i){if(super(),!Sr(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return Ep}get isParenthesisNode(){return!0}_compile(i,a){return this.content._compile(i,a)}getContent(){return this.content.getContent()}forEach(i){i(this.content,"content",this)}map(i){var a=i(this.content,"content",this);return new t(a)}clone(){return new t(this.content)}_toString(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"("+this.content.toString(i)+")":this.content.toString(i)}toJSON(){return{mathjs:Ep,content:this.content}}static fromJSON(i){return new t(i.content)}_toHTML(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?'('+this.content.toHTML(i)+')':this.content.toHTML(i)}_toTex(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"\\\\left(".concat(this.content.toTex(i),"\\\\right)"):this.content.toTex(i)}}return Ur(t,"name",Ep),t},{isClass:!0,isNode:!0});var Cp="RangeNode",HU=["Node"],_2=T(Cp,HU,e=>{var{Node:r}=e;function t(i,a,s){var c=Gr(i,a,s),f={},o=Gr(i.start,a,s);if(f.start=o!==null&&o<=c||a==="all",i.step){var u=Gr(i.step,a,s);f.step=u!==null&&u<=c||a==="all"}var p=Gr(i.end,a,s);return f.end=p!==null&&p<=c||a==="all",f}class n extends r{constructor(a,s,c){if(super(),!Sr(a))throw new TypeError("Node expected");if(!Sr(s))throw new TypeError("Node expected");if(c&&!Sr(c))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=a,this.end=s,this.step=c||null}get type(){return Cp}get isRangeNode(){return!0}needsEnd(){var a=this.filter(function(s){return rt(s)&&s.name==="end"});return a.length>0}_compile(a,s){var c=a.range,f=this.start._compile(a,s),o=this.end._compile(a,s);if(this.step){var u=this.step._compile(a,s);return function(d,h,x){return c(f(d,h,x),o(d,h,x),u(d,h,x))}}else return function(d,h,x){return c(f(d,h,x),o(d,h,x))}}forEach(a){a(this.start,"start",this),a(this.end,"end",this),this.step&&a(this.step,"step",this)}map(a){return new n(this._ifNode(a(this.start,"start",this)),this._ifNode(a(this.end,"end",this)),this.step&&this._ifNode(a(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(a){var s=a&&a.parenthesis?a.parenthesis:"keep",c=t(this,s,a&&a.implicit),f,o=this.start.toString(a);if(c.start&&(o="("+o+")"),f=o,this.step){var u=this.step.toString(a);c.step&&(u="("+u+")"),f+=":"+u}var p=this.end.toString(a);return c.end&&(p="("+p+")"),f+=":"+p,f}toJSON(){return{mathjs:Cp,start:this.start,end:this.end,step:this.step}}static fromJSON(a){return new n(a.start,a.end,a.step)}_toHTML(a){var s=a&&a.parenthesis?a.parenthesis:"keep",c=t(this,s,a&&a.implicit),f,o=this.start.toHTML(a);if(c.start&&(o='('+o+')'),f=o,this.step){var u=this.step.toHTML(a);c.step&&(u='('+u+')'),f+=':'+u}var p=this.end.toHTML(a);return c.end&&(p='('+p+')'),f+=':'+p,f}_toTex(a){var s=a&&a.parenthesis?a.parenthesis:"keep",c=t(this,s,a&&a.implicit),f=this.start.toTex(a);if(c.start&&(f="\\\\left(".concat(f,"\\\\right)")),this.step){var o=this.step.toTex(a);c.step&&(o="\\\\left(".concat(o,"\\\\right)")),f+=":"+o}var u=this.end.toTex(a);return c.end&&(u="\\\\left(".concat(u,"\\\\right)")),f+=":"+u,f}}return Ur(n,"name",Cp),n},{isClass:!0,isNode:!0});var Mp="RelationalNode",GU=["Node"],T2=T(Mp,GU,e=>{var{Node:r}=e,t={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends r{constructor(a,s){if(super(),!Array.isArray(a))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(s))throw new TypeError("Parameter params must be an array");if(a.length!==s.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=a,this.params=s}get type(){return Mp}get isRelationalNode(){return!0}_compile(a,s){var c=this,f=this.params.map(o=>o._compile(a,s));return function(u,p,d){for(var h,x=f[0](u,p,d),v=0;va(s,"params["+c+"]",this),this)}map(a){return new n(this.conditionals.slice(),this.params.map((s,c)=>this._ifNode(a(s,"params["+c+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(a){for(var s=a&&a.parenthesis?a.parenthesis:"keep",c=Gr(this,s,a&&a.implicit),f=this.params.map(function(p,d){var h=Gr(p,s,a&&a.implicit);return s==="all"||h!==null&&h<=c?"("+p.toString(a)+")":p.toString(a)}),o=f[0],u=0;u('+p.toHTML(a)+')':p.toHTML(a)}),o=f[0],u=0;u'+Qt(t[this.conditionals[u]])+""+f[u+1];return o}_toTex(a){for(var s=a&&a.parenthesis?a.parenthesis:"keep",c=Gr(this,s,a&&a.implicit),f=this.params.map(function(p,d){var h=Gr(p,s,a&&a.implicit);return s==="all"||h!==null&&h<=c?"\\\\left("+p.toTex(a)+"\\right)":p.toTex(a)}),o=f[0],u=0;u{var{math:r,Unit:t,Node:n}=e;function i(s){return t?t.isValuelessUnit(s):!1}class a extends n{constructor(c){if(super(),typeof c!="string")throw new TypeError('String expected for parameter "name"');this.name=c}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(c,f){var o=this.name;if(f[o]===!0)return function(p,d,h){return gt(d,o)};if(o in c)return function(p,d,h){return p.has(o)?p.get(o):gt(c,o)};var u=i(o);return function(p,d,h){return p.has(o)?p.get(o):u?new t(null,o):a.onUndefinedSymbol(o)}}forEach(c){}map(c){return this.clone()}static onUndefinedSymbol(c){throw new Error("Undefined symbol "+c)}clone(){return new a(this.name)}_toString(c){return this.name}_toHTML(c){var f=Qt(this.name);return f==="true"||f==="false"?''+f+"":f==="i"?''+f+"":f==="Infinity"?''+f+"":f==="NaN"?''+f+"":f==="null"?''+f+"":f==="undefined"?''+f+"":''+f+""}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(c){return new a(c.name)}_toTex(c){var f=!1;typeof r[this.name]>"u"&&i(this.name)&&(f=!0);var o=bp(this.name,f);return o[0]==="\\\\"?o:" "+o}}return a},{isClass:!0,isNode:!0});var _p="FunctionNode",QU=["math","Node","SymbolNode"],O2=T(_p,QU,e=>{var r,{math:t,Node:n,SymbolNode:i}=e,a=f=>lr(f,{truncate:78});function s(f,o,u){for(var p="",d=/\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)/gi,h=0,x;(x=d.exec(f))!==null;)if(p+=f.substring(h,x.index),h=x.index,x[0]==="$$")p+="$",h++;else{h+=x[0].length;var v=o[x[1]];if(!v)throw new ReferenceError("Template: Property "+x[1]+" does not exist.");if(x[2]===void 0)switch(typeof v){case"string":p+=v;break;case"object":if(Sr(v))p+=v.toTex(u);else if(Array.isArray(v))p+=v.map(function(y,w){if(Sr(y))return y.toTex(u);throw new TypeError("Template: "+x[1]+"["+w+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+x[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+x[1]+" has to be a Node, String or array of Nodes")}else if(Sr(v[x[2]]&&v[x[2]]))p+=v[x[2]].toTex(u);else throw new TypeError("Template: "+x[1]+"["+x[2]+"] is not a Node.")}return p+=f.slice(h),p}class c extends n{constructor(o,u){if(super(),typeof o=="string"&&(o=new i(o)),!Sr(o))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(u)||!u.every(Sr))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=o,this.args=u||[]}get name(){return this.fn.name||""}get type(){return _p}get isFunctionNode(){return!0}_compile(o,u){var p=this.args.map(F=>F._compile(o,u));if(rt(this.fn)){var d=this.fn.name;if(u[d]){var w=this.args;return function(M,_,k){var L=gt(_,d);if(typeof L!="function")throw new TypeError("Argument '".concat(d,"' was not a function; received: ").concat(a(L)));if(L.rawArgs)return L(w,o,as(M,_));var Y=p.map($=>$(M,_,k));return L.apply(L,Y)}}else{var h=d in o?gt(o,d):void 0,x=typeof h=="function"&&h.rawArgs===!0,v=F=>{var M;if(F.has(d))M=F.get(d);else if(d in o)M=gt(o,d);else return c.onUndefinedFunction(d);if(typeof M=="function")return M;throw new TypeError("'".concat(d,\`' is not a function; its value is: + \`).concat(a(M)))};if(x){var y=this.args;return function(M,_,k){var L=v(M);return L(y,o,as(M,_))}}else switch(p.length){case 0:return function(M,_,k){var L=v(M);return L()};case 1:return function(M,_,k){var L=v(M),Y=p[0];return L(Y(M,_,k))};case 2:return function(M,_,k){var L=v(M),Y=p[0],$=p[1];return L(Y(M,_,k),$(M,_,k))};default:return function(M,_,k){var L=v(M),Y=p.map($=>$(M,_,k));return L(...Y)}}}}else if(Sn(this.fn)&&kn(this.fn.index)&&this.fn.index.isObjectProperty()){var C=this.fn.object._compile(o,u),b=this.fn.index.getObjectProperty(),A=this.args;return function(M,_,k){var L=C(M,_,k),Y=hy(L,b);if(Y!=null&&Y.rawArgs)return Y(A,o,as(M,_));var $=p.map(V=>V(M,_,k));return Y.apply(L,$)}}else{var E=this.fn.toString(),S=this.fn._compile(o,u),O=this.args;return function(M,_,k){var L=S(M,_,k);if(typeof L!="function")throw new TypeError("Expression '".concat(E,"' did not evaluate to a function; value is:")+\` + \`.concat(a(L)));if(L.rawArgs)return L(O,o,as(M,_));var Y=p.map($=>$(M,_,k));return L.apply(L,Y)}}}forEach(o){o(this.fn,"fn",this);for(var u=0;u'+Qt(this.fn)+'('+u.join(',')+')'}toTex(o){var u;return o&&typeof o.handler=="object"&&$e(o.handler,this.name)&&(u=o.handler[this.name](this,o)),typeof u<"u"?u:super.toTex(o)}_toTex(o){var u=this.args.map(function(h){return h.toTex(o)}),p;i0[this.name]&&(p=i0[this.name]),t[this.name]&&(typeof t[this.name].toTex=="function"||typeof t[this.name].toTex=="object"||typeof t[this.name].toTex=="string")&&(p=t[this.name].toTex);var d;switch(typeof p){case"function":d=p(this,o);break;case"string":d=s(p,this,o);break;case"object":switch(typeof p[u.length]){case"function":d=p[u.length](this,o);break;case"string":d=s(p[u.length],this,o);break}}return typeof d<"u"?d:s(D2,this,o)}getIdentifier(){return this.type+":"+this.name}}return r=c,Ur(c,"name",_p),Ur(c,"onUndefinedFunction",function(f){throw new Error("Undefined function "+f)}),Ur(c,"fromJSON",function(f){return new r(f.fn,f.args)}),c},{isClass:!0,isNode:!0});var B2="parse",XU=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],I2=T(B2,XU,e=>{var{typed:r,numeric:t,config:n,AccessorNode:i,ArrayNode:a,AssignmentNode:s,BlockNode:c,ConditionalNode:f,ConstantNode:o,FunctionAssignmentNode:u,FunctionNode:p,IndexNode:d,ObjectNode:h,OperatorNode:x,ParenthesisNode:v,RangeNode:y,RelationalNode:w,SymbolNode:C}=e,b=r(B2,{string:function(Q){return me(Q,{})},"Array | Matrix":function(Q){return A(Q,{})},"string, Object":function(Q,ve){var Be=ve.nodes!==void 0?ve.nodes:{};return me(Q,Be)},"Array | Matrix, Object":A});function A(B){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ve=Q.nodes!==void 0?Q.nodes:{};return Je(B,function(Be){if(typeof Be!="string")throw new TypeError("String expected");return me(Be,ve)})}var E={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},S={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},O={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},F={true:!0,false:!1,null:null,undefined:void 0},M=["NaN","Infinity"],_={'"':'"',"'":"'","\\\\":"\\\\","/":"/",b:"\\b",f:"\\f",n:\` +\`,r:"\\r",t:" "};function k(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:E.NULL,nestingLevel:0,conditionalLevel:null}}function L(B,Q){return B.expression.substr(B.index,Q)}function Y(B){return L(B,1)}function $(B){B.index++}function V(B){return B.expression.charAt(B.index-1)}function q(B){return B.expression.charAt(B.index+1)}function R(B){for(B.tokenType=E.NULL,B.token="",B.comment="";;){if(Y(B)==="#")for(;Y(B)!==\` +\`&&Y(B)!=="";)B.comment+=Y(B),$(B);if(b.isWhitespace(Y(B),B.nestingLevel))$(B);else break}if(Y(B)===""){B.tokenType=E.DELIMITER;return}if(Y(B)===\` +\`&&!B.nestingLevel){B.tokenType=E.DELIMITER,B.token=Y(B),$(B);return}var Q=Y(B),ve=L(B,2),Be=L(B,3);if(Be.length===3&&S[Be]){B.tokenType=E.DELIMITER,B.token=Be,$(B),$(B),$(B);return}if(ve.length===2&&S[ve]){B.tokenType=E.DELIMITER,B.token=ve,$(B),$(B);return}if(S[Q]){B.tokenType=E.DELIMITER,B.token=Q,$(B);return}if(b.isDigitDot(Q)){B.tokenType=E.NUMBER;var er=L(B,2);if(er==="0b"||er==="0o"||er==="0x"){for(B.token+=Y(B),$(B),B.token+=Y(B),$(B);b.isHexDigit(Y(B));)B.token+=Y(B),$(B);if(Y(B)===".")for(B.token+=".",$(B);b.isHexDigit(Y(B));)B.token+=Y(B),$(B);else if(Y(B)==="i")for(B.token+="i",$(B);b.isDigit(Y(B));)B.token+=Y(B),$(B);return}if(Y(B)==="."){if(B.token+=Y(B),$(B),!b.isDigit(Y(B))){B.tokenType=E.DELIMITER;return}}else{for(;b.isDigit(Y(B));)B.token+=Y(B),$(B);b.isDecimalMark(Y(B),q(B))&&(B.token+=Y(B),$(B))}for(;b.isDigit(Y(B));)B.token+=Y(B),$(B);if(Y(B)==="E"||Y(B)==="e"){if(b.isDigit(q(B))||q(B)==="-"||q(B)==="+"){if(B.token+=Y(B),$(B),(Y(B)==="+"||Y(B)==="-")&&(B.token+=Y(B),$(B)),!b.isDigit(Y(B)))throw Pe(B,'Digit expected, got "'+Y(B)+'"');for(;b.isDigit(Y(B));)B.token+=Y(B),$(B);if(b.isDecimalMark(Y(B),q(B)))throw Pe(B,'Digit expected, got "'+Y(B)+'"')}else if(q(B)===".")throw $(B),Pe(B,'Digit expected, got "'+Y(B)+'"')}return}if(b.isAlpha(Y(B),V(B),q(B))){for(;b.isAlpha(Y(B),V(B),q(B))||b.isDigit(Y(B));)B.token+=Y(B),$(B);$e(O,B.token)?B.tokenType=E.DELIMITER:B.tokenType=E.SYMBOL;return}for(B.tokenType=E.UNKNOWN;Y(B)!=="";)B.token+=Y(B),$(B);throw Pe(B,'Syntax error in part "'+B.token+'"')}function j(B){do R(B);while(B.token===\` +\`)}function U(B){B.nestingLevel++}function oe(B){B.nestingLevel--}b.isAlpha=function(Q,ve,Be){return b.isValidLatinOrGreek(Q)||b.isValidMathSymbol(Q,Be)||b.isValidMathSymbol(ve,Q)},b.isValidLatinOrGreek=function(Q){return/^[a-zA-Z_$\\u00C0-\\u02AF\\u0370-\\u03FF\\u2100-\\u214F]$/.test(Q)},b.isValidMathSymbol=function(Q,ve){return/^[\\uD835]$/.test(Q)&&/^[\\uDC00-\\uDFFF]$/.test(ve)&&/^[^\\uDC55\\uDC9D\\uDCA0\\uDCA1\\uDCA3\\uDCA4\\uDCA7\\uDCA8\\uDCAD\\uDCBA\\uDCBC\\uDCC4\\uDD06\\uDD0B\\uDD0C\\uDD15\\uDD1D\\uDD3A\\uDD3F\\uDD45\\uDD47-\\uDD49\\uDD51\\uDEA6\\uDEA7\\uDFCC\\uDFCD]$/.test(ve)},b.isWhitespace=function(Q,ve){return Q===" "||Q===" "||Q===\` +\`&&ve>0},b.isDecimalMark=function(Q,ve){return Q==="."&&ve!=="/"&&ve!=="*"&&ve!=="^"},b.isDigitDot=function(Q){return Q>="0"&&Q<="9"||Q==="."},b.isDigit=function(Q){return Q>="0"&&Q<="9"},b.isHexDigit=function(Q){return Q>="0"&&Q<="9"||Q>="a"&&Q<="f"||Q>="A"&&Q<="F"};function me(B,Q){var ve=k();Mt(ve,{expression:B,extraNodes:Q}),R(ve);var Be=ie(ve);if(ve.token!=="")throw ve.tokenType===E.DELIMITER?We(ve,"Unexpected operator "+ve.token):Pe(ve,'Unexpected part "'+ve.token+'"');return Be}function ie(B){var Q,ve=[],Be;for(B.token!==""&&B.token!==\` +\`&&B.token!==";"&&(Q=H(B),B.comment&&(Q.comment=B.comment));B.token===\` +\`||B.token===";";)ve.length===0&&Q&&(Be=B.token!==";",ve.push({node:Q,visible:Be})),R(B),B.token!==\` +\`&&B.token!==";"&&B.token!==""&&(Q=H(B),B.comment&&(Q.comment=B.comment),Be=B.token!==";",ve.push({node:Q,visible:Be}));return ve.length>0?new c(ve):(Q||(Q=new o(void 0),B.comment&&(Q.comment=B.comment)),Q)}function H(B){var Q,ve,Be,er,fr=ce(B);if(B.token==="="){if(rt(fr))return Q=fr.name,j(B),Be=H(B),new s(new C(Q),Be);if(Sn(fr))return j(B),Be=H(B),new s(fr.object,fr.index,Be);if(fn(fr)&&rt(fr.fn)&&(er=!0,ve=[],Q=fr.name,fr.args.forEach(function(Zr,_t){rt(Zr)?ve[_t]=Zr.name:er=!1}),er))return j(B),Be=H(B),new u(Q,ve,Be);throw Pe(B,"Invalid left hand side of assignment operator =")}return fr}function ce(B){for(var Q=Me(B);B.token==="?";){var ve=B.conditionalLevel;B.conditionalLevel=B.nestingLevel,j(B);var Be=Q,er=H(B);if(B.token!==":")throw Pe(B,"False part of conditional expression expected");B.conditionalLevel=null,j(B);var fr=H(B);Q=new f(Be,er,fr),B.conditionalLevel=ve}return Q}function Me(B){for(var Q=pe(B);B.token==="or";)j(B),Q=new x("or","or",[Q,pe(B)]);return Q}function pe(B){for(var Q=ge(B);B.token==="xor";)j(B),Q=new x("xor","xor",[Q,ge(B)]);return Q}function ge(B){for(var Q=Se(B);B.token==="and";)j(B),Q=new x("and","and",[Q,Se(B)]);return Q}function Se(B){for(var Q=xe(B);B.token==="|";)j(B),Q=new x("|","bitOr",[Q,xe(B)]);return Q}function xe(B){for(var Q=be(B);B.token==="^|";)j(B),Q=new x("^|","bitXor",[Q,be(B)]);return Q}function be(B){for(var Q=De(B);B.token==="&";)j(B),Q=new x("&","bitAnd",[Q,De(B)]);return Q}function De(B){for(var Q=[Ae(B)],ve=[],Be={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};$e(Be,B.token);){var er={name:B.token,fn:Be[B.token]};ve.push(er),j(B),Q.push(Ae(B))}return Q.length===1?Q[0]:Q.length===2?new x(ve[0].name,ve[0].fn,Q):new w(ve.map(fr=>fr.fn),Q)}function Ae(B){var Q,ve,Be,er;Q=ze(B);for(var fr={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};$e(fr,B.token);)ve=B.token,Be=fr[ve],j(B),er=[Q,ze(B)],Q=new x(ve,Be,er);return Q}function ze(B){var Q,ve,Be,er;Q=Ze(B);for(var fr={to:"to",in:"to"};$e(fr,B.token);)ve=B.token,Be=fr[ve],j(B),ve==="in"&&B.token===""?Q=new x("*","multiply",[Q,new C("in")],!0):(er=[Q,Ze(B)],Q=new x(ve,Be,er));return Q}function Ze(B){var Q,ve=[];if(B.token===":"?Q=new o(1):Q=K(B),B.token===":"&&B.conditionalLevel!==B.nestingLevel){for(ve.push(Q);B.token===":"&&ve.length<3;)j(B),B.token===")"||B.token==="]"||B.token===","||B.token===""?ve.push(new C("end")):ve.push(K(B));ve.length===3?Q=new y(ve[0],ve[2],ve[1]):Q=new y(ve[0],ve[1])}return Q}function K(B){var Q,ve,Be,er;Q=te(B);for(var fr={"+":"add","-":"subtract"};$e(fr,B.token);){ve=B.token,Be=fr[ve],j(B);var Zr=te(B);Zr.isPercentage?er=[Q,new x("*","multiply",[Q,Zr])]:er=[Q,Zr],Q=new x(ve,Be,er)}return Q}function te(B){var Q,ve,Be,er;Q=ye(B),ve=Q;for(var fr={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};$e(fr,B.token);)Be=B.token,er=fr[Be],j(B),ve=ye(B),Q=new x(Be,er,[Q,ve]);return Q}function ye(B){var Q,ve;for(Q=ee(B),ve=Q;B.tokenType===E.SYMBOL||B.token==="in"&&yr(Q)||B.tokenType===E.NUMBER&&!yr(ve)&&(!ut(ve)||ve.op==="!")||B.token==="(";)ve=ee(B),Q=new x("*","multiply",[Q,ve],!0);return Q}function ee(B){for(var Q=ne(B),ve=Q,Be=[];B.token==="/"&&mf(ve);)if(Be.push(Mt({},B)),j(B),B.tokenType===E.NUMBER)if(Be.push(Mt({},B)),j(B),B.tokenType===E.SYMBOL||B.token==="(")Mt(B,Be.pop()),Be.pop(),ve=ne(B),Q=new x("/","divide",[Q,ve]);else{Be.pop(),Mt(B,Be.pop());break}else{Mt(B,Be.pop());break}return Q}function ne(B){var Q,ve,Be,er;Q=ue(B);for(var fr={"%":"mod",mod:"mod"};$e(fr,B.token);)ve=B.token,Be=fr[ve],j(B),ve==="%"&&B.tokenType===E.DELIMITER&&B.token!=="("?Q=new x("/","divide",[Q,new o(100)],!1,!0):(er=[Q,ue(B)],Q=new x(ve,Be,er));return Q}function ue(B){var Q,ve,Be,er={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return $e(er,B.token)?(Be=er[B.token],Q=B.token,j(B),ve=[ue(B)],new x(Q,Be,ve)):Ee(B)}function Ee(B){var Q,ve,Be,er;return Q=Ce(B),(B.token==="^"||B.token===".^")&&(ve=B.token,Be=ve==="^"?"pow":"dotPow",j(B),er=[Q,ue(B)],Q=new x(ve,Be,er)),Q}function Ce(B){var Q,ve,Be,er;Q=Le(B);for(var fr={"!":"factorial","'":"ctranspose"};$e(fr,B.token);)ve=B.token,Be=fr[ve],R(B),er=[Q],Q=new x(ve,Be,er),Q=sr(B,Q);return Q}function Le(B){var Q=[];if(B.tokenType===E.SYMBOL&&$e(B.extraNodes,B.token)){var ve=B.extraNodes[B.token];if(R(B),B.token==="("){if(Q=[],U(B),R(B),B.token!==")")for(Q.push(H(B));B.token===",";)R(B),Q.push(H(B));if(B.token!==")")throw Pe(B,"Parenthesis ) expected");oe(B),R(B)}return new ve(Q)}return Ie(B)}function Ie(B){var Q,ve;return B.tokenType===E.SYMBOL||B.tokenType===E.DELIMITER&&B.token in O?(ve=B.token,R(B),$e(F,ve)?Q=new o(F[ve]):M.indexOf(ve)!==-1?Q=new o(t(ve,"number")):Q=new C(ve),Q=sr(B,Q),Q):ir(B)}function sr(B,Q,ve){for(var Be;(B.token==="("||B.token==="["||B.token===".")&&(!ve||ve.indexOf(B.token)!==-1);)if(Be=[],B.token==="(")if(rt(Q)||Sn(Q)){if(U(B),R(B),B.token!==")")for(Be.push(H(B));B.token===",";)R(B),Be.push(H(B));if(B.token!==")")throw Pe(B,"Parenthesis ) expected");oe(B),R(B),Q=new p(Q,Be)}else return Q;else if(B.token==="["){if(U(B),R(B),B.token!=="]")for(Be.push(H(B));B.token===",";)R(B),Be.push(H(B));if(B.token!=="]")throw Pe(B,"Parenthesis ] expected");oe(B),R(B),Q=new i(Q,new d(Be))}else{R(B);var er=B.tokenType===E.SYMBOL||B.tokenType===E.DELIMITER&&B.token in O;if(!er)throw Pe(B,"Property name expected after dot");Be.push(new o(B.token)),R(B);var fr=!0;Q=new i(Q,new d(Be,fr))}return Q}function ir(B){var Q,ve;return B.token==='"'||B.token==="'"?(ve=Xe(B,B.token),Q=new o(ve),Q=sr(B,Q),Q):Or(B)}function Xe(B,Q){for(var ve="";Y(B)!==""&&Y(B)!==Q;)if(Y(B)==="\\\\"){$(B);var Be=Y(B),er=_[Be];if(er!==void 0)ve+=er,B.index+=1;else if(Be==="u"){var fr=B.expression.slice(B.index+1,B.index+5);if(/^[0-9A-Fa-f]{4}$/.test(fr))ve+=String.fromCharCode(parseInt(fr,16)),B.index+=5;else throw Pe(B,"Invalid unicode character \\\\u".concat(fr))}else throw Pe(B,"Bad escape character \\\\".concat(Be))}else ve+=Y(B),$(B);if(R(B),B.token!==Q)throw Pe(B,"End of string ".concat(Q," expected"));return R(B),ve}function Or(B){var Q,ve,Be,er;if(B.token==="["){if(U(B),R(B),B.token!=="]"){var fr=re(B);if(B.token===";"){for(Be=1,ve=[fr];B.token===";";)R(B),B.token!=="]"&&(ve[Be]=re(B),Be++);if(B.token!=="]")throw Pe(B,"End of matrix ] expected");oe(B),R(B),er=ve[0].items.length;for(var Zr=1;Zr{var{typed:r,parse:t}=e;return r(P2,{string:function(i){return t(i).compile()},"Array | Matrix":function(i){return Je(i,function(a){return t(a).compile()})}})});var R2="evaluate",KU=["typed","parse"],L2=T(R2,KU,e=>{var{typed:r,parse:t}=e;return r(R2,{string:function(i){var a=ho();return t(i).compile().evaluate(a)},"string, Map | Object":function(i,a){return t(i).compile().evaluate(a)},"Array | Matrix":function(i){var a=ho();return Je(i,function(s){return t(s).compile().evaluate(a)})},"Array | Matrix, Map | Object":function(i,a){return Je(i,function(s){return t(s).compile().evaluate(a)})}})});var jU="Parser",ez=["evaluate"],q2=T(jU,ez,e=>{var{evaluate:r}=e;function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:ho(),writable:!1})}return t.prototype.type="Parser",t.prototype.isParser=!0,t.prototype.evaluate=function(n){return r(n,this.scope)},t.prototype.get=function(n){if(this.scope.has(n))return this.scope.get(n)},t.prototype.getAll=function(){return xy(this.scope)},t.prototype.getAllAsMap=function(){return this.scope},t.prototype.set=function(n,i){return this.scope.set(n,i),i},t.prototype.remove=function(n){this.scope.delete(n)},t.prototype.clear=function(){this.scope.clear()},t},{isClass:!0});var U2="parser",rz=["typed","Parser"],z2=T(U2,rz,e=>{var{typed:r,Parser:t}=e;return r(U2,{"":function(){return new t}})});var W2="lup",tz=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],V2=T(W2,tz,e=>{var{typed:r,matrix:t,abs:n,addScalar:i,divideScalar:a,multiplyScalar:s,subtractScalar:c,larger:f,equalScalar:o,unaryMinus:u,DenseMatrix:p,SparseMatrix:d,Spa:h}=e;return r(W2,{DenseMatrix:function(w){return x(w)},SparseMatrix:function(w){return v(w)},Array:function(w){var C=t(w),b=x(C);return{L:b.L.valueOf(),U:b.U.valueOf(),p:b.p}}});function x(y){var w=y._size[0],C=y._size[1],b=Math.min(w,C),A=tr(y._data),E=[],S=[w,b],O=[],F=[b,C],M,_,k,L=[];for(M=0;M0)for(M=0;M0&&H.forEach(0,q-1,function(xe,be){d._forEachRow(xe,O,F,M,function(De,Ae){De>xe&&H.accumulate(De,u(s(Ae,be)))})});var pe=q,ge=H.get(q),Se=n(ge);H.forEach(q+1,w-1,function(xe,be){var De=n(be);f(De,Se)&&(pe=xe,Se=De,ge=be)}),q!==pe&&(d._swapRows(q,pe,_[1],O,F,M),d._swapRows(q,pe,$[1],k,L,Y),H.swap(q,pe),oe(q,pe)),H.forEach(0,w-1,function(xe,be){xe<=q?(k.push(be),L.push(xe)):(be=a(be,ge),o(be,0)||(O.push(be),F.push(xe)))})};for(q=0;q{var{typed:r,matrix:t,zeros:n,identity:i,isZero:a,equal:s,sign:c,sqrt:f,conj:o,unaryMinus:u,addScalar:p,divideScalar:d,multiplyScalar:h,subtractScalar:x,complex:v}=e;return Mt(r(Y2,{DenseMatrix:function(A){return w(A)},SparseMatrix:function(A){return C(A)},Array:function(A){var E=t(A),S=w(E);return{Q:S.Q.valueOf(),R:S.R.valueOf()}}}),{_denseQRimpl:y});function y(b){var A=b._size[0],E=b._size[1],S=i([A],"dense"),O=S._data,F=b.clone(),M=F._data,_,k,L,Y=n([A],"");for(L=0;L0)for(var S=E[0][0].type==="Complex"?v(0):0,O=0;O=0;){var f=t[s+c],o=t[n+f];o===-1?(c--,a[r++]=f):(t[n+f]=t[i+o],++c,t[s+c]=o)}return r}function $2(e,r){if(!e)return null;var t=0,n,i=[],a=[],s=0,c=r,f=2*r;for(n=0;n=0;n--)e[n]!==-1&&(a[c+n]=a[s+e[n]],a[s+e[n]]=n);for(n=0;n{var{add:r,multiply:t,transpose:n}=e;return function(u,p){if(!p||u<=0||u>3)return null;var d=p._size,h=d[0],x=d[1],v=0,y=Math.max(16,10*Math.sqrt(x));y=Math.min(x-2,y);var w=i(u,p,h,x,y);Q2(w,f,null);for(var C=w._index,b=w._ptr,A=b[x],E=[],S=[],O=0,F=x+1,M=2*(x+1),_=3*(x+1),k=4*(x+1),L=5*(x+1),Y=6*(x+1),$=7*(x+1),V=E,q=a(x,b,S,O,_,V,M,$,F,Y,k,L),R=s(x,b,S,L,k,Y,y,F,_,V,M),j=0,U,oe,me,ie,H,ce,Me,pe,ge,Se,xe,be,De,Ae,ze,Ze;RK?(ce=me,Me=ee,pe=S[O+me]-K):(ce=C[ee++],Me=b[ce],pe=S[O+ce]),H=1;H<=pe;H++)U=C[Me++],!((ge=S[F+U])<=0)&&(ye+=ge,S[F+U]=-ge,C[ue++]=U,S[M+U]!==-1&&(V[S[M+U]]=V[U]),V[U]!==-1?S[M+V[U]]=S[M+U]:S[_+S[L+U]]=S[M+U]);ce!==me&&(b[ce]=Hi(me),S[Y+ce]=0)}for(K!==0&&(A=ue),S[L+me]=ye,b[me]=ne,S[O+me]=ue-ne,S[k+me]=-2,q=c(q,v,S,Y,x),Se=ne;Se=q?S[Y+ce]-=ge:S[Y+ce]!==0&&(S[Y+ce]=S[L+ce]+Ee)}for(Se=ne;Se0?(Ze+=Ce,C[Ae++]=ce,ze+=ce):(b[ce]=Hi(me),S[Y+ce]=0)}S[k+U]=Ae-be+1;var Le=Ae,Ie=be+S[O+U];for(ee=De+1;ee=0))for(ze=V[U],U=S[$+ze],S[$+ze]=-1;U!==-1&&S[M+U]!==-1;U=S[M+U],q++){for(pe=S[O+U],xe=S[k+U],ee=b[U]+1;ee<=b[U]+pe-1;ee++)S[Y+C[ee]]=q;var ir=U;for(oe=S[M+U];oe!==-1;){var Xe=S[O+oe]===pe&&S[k+oe]===xe;for(ee=b[oe]+1;Xe&&ee<=b[oe]+pe-1;ee++)S[Y+C[ee]]!==q&&(Xe=0);Xe?(b[oe]=Hi(U),S[F+U]+=S[F+oe],S[F+oe]=0,S[k+oe]=-1,oe=S[M+oe],S[M+ir]=oe):(ir=oe,oe=S[M+oe])}}for(ee=ne,Se=ne;Se=0;oe--)S[F+oe]>0||(S[M+oe]=S[_+b[oe]],S[_+b[oe]]=oe);for(ce=x;ce>=0;ce--)S[F+ce]<=0||b[ce]!==-1&&(S[M+ce]=S[_+b[ce]],S[_+b[ce]]=ce);for(me=0,U=0;U<=x;U++)b[U]===-1&&(me=Tp(U,me,S,_,M,E,Y));return E.splice(E.length-1,1),E};function i(o,u,p,d,h){var x=n(u);if(o===1&&d===p)return r(u,x);if(o===2){for(var v=x._index,y=x._ptr,w=0,C=0;Ch))for(var A=y[C+1];bv)p[y+E]=0,p[h+E]=-1,A++,u[E]=Hi(o),p[y+o]++;else{var O=p[w+S];O!==-1&&(C[O]=E),p[b+E]=p[w+S],p[w+S]=E}}return A}function c(o,u,p,d,h){if(o<2||o+u<0){for(var x=0;x{var{transpose:r}=e;return function(t,n,i,a){if(!t||!n||!i)return null;var s=t._size,c=s[0],f=s[1],o,u,p,d,h,x,v,y=4*f+(a?f+c+1:0),w=[],C=0,b=f,A=2*f,E=3*f,S=4*f,O=5*f+1;for(p=0;p=1&&F[u]++,L.jleaf===2&&F[L.q]--}n[u]!==-1&&(w[C+u]=n[u])}for(u=0;u{var{add:r,multiply:t,transpose:n}=e,i=X2({add:r,multiply:t,transpose:n}),a=K2({transpose:n});return function(f,o,u){var p=o._ptr,d=o._size,h=d[1],x,v={};if(v.q=i(f,o),f&&!v.q)return null;if(u){var y=f?G2(o,null,v.q,0):o;v.parent=Z2(y,1);var w=$2(v.parent,h);if(v.cp=a(y,v.parent,w,1),y&&v.parent&&v.cp&&s(y,v))for(v.unz=0,x=0;x=0;O--)for(M=o[O],_=o[O+1],F=M;F<_;F++)y[u[F]]=O;for(S=d-1;S>=0;S--)v[S]=-1,O=y[S],O!==-1&&(w[E+O]++===0&&(w[A+O]=S),w[C+S]=w[b+O],w[b+O]=S);for(f.lnz=0,f.m2=d,O=0;O=0;){e=n[d];var h=i?i[e]:e;Af(s,e)||(Fp(s,e),n[f+d]=h<0?0:a0(s[h]));var x=1;for(u=n[f+d],p=h<0?0:a0(s[h+1]);u{var{divideScalar:r,multiply:t,subtract:n}=e;return function(a,s,c,f,o,u,p){var d=a._values,h=a._index,x=a._ptr,v=a._size,y=v[1],w=s._values,C=s._index,b=s._ptr,A,E,S,O,F=rA(a,s,c,f,u);for(A=F;A{var{abs:r,divideScalar:t,multiply:n,subtract:i,larger:a,largerEq:s,SparseMatrix:c}=e,f=tA({divideScalar:t,multiply:n,subtract:i});return function(u,p,d){if(!u)return null;var h=u._size,x=h[1],v,y=100,w=100;p&&(v=p.q,y=p.lnz||y,w=p.unz||w);var C=[],b=[],A=[],E=new c({values:C,index:b,ptr:A,size:[x,x]}),S=[],O=[],F=[],M=new c({values:S,index:O,ptr:F,size:[x,x]}),_=[],k,L,Y=[],$=[];for(k=0;k{var{typed:r,abs:t,add:n,multiply:i,transpose:a,divideScalar:s,subtract:c,larger:f,largerEq:o,SparseMatrix:u}=e,p=j2({add:n,multiply:i,transpose:a}),d=nA({abs:t,divideScalar:s,multiply:i,subtract:c,larger:f,largerEq:o,SparseMatrix:u});return r(iA,{"SparseMatrix, number, number":function(x,v,y){if(!He(v)||v<0||v>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(y<0||y>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var w=p(v,x,!1),C=d(x,w,y);return{L:C.L,U:C.U,p:C.pinv,q:w.q,toString:function(){return"L: "+this.L.toString()+\` +U: \`+this.U.toString()+\` +p: \`+this.p.toString()+(this.q?\` +q: \`+this.q.toString():"")+\` +\`}}}})});function o0(e,r){var t,n=r.length,i=[];if(e)for(t=0;t{var{typed:r,matrix:t,lup:n,slu:i,usolve:a,lsolve:s,DenseMatrix:c}=e,f=ma({DenseMatrix:c});return r(oA,{"Array, Array | Matrix":function(d,h){d=t(d);var x=n(d),v=u(x.L,x.U,x.p,null,h);return v.valueOf()},"DenseMatrix, Array | Matrix":function(d,h){var x=n(d);return u(x.L,x.U,x.p,null,h)},"SparseMatrix, Array | Matrix":function(d,h){var x=n(d);return u(x.L,x.U,x.p,null,h)},"SparseMatrix, Array | Matrix, number, number":function(d,h,x,v){var y=i(d,x,v);return u(y.L,y.U,y.p,y.q,h)},"Object, Array | Matrix":function(d,h){return u(d.L,d.U,d.p,d.q,h)}});function o(p){if(Ge(p))return p;if(Ar(p))return t(p);throw new TypeError("Invalid Matrix LU decomposition")}function u(p,d,h,x,v){p=o(p),d=o(d),h&&(v=f(p,v,!0),v._data=o0(h,v._data));var y=s(p,v),w=a(d,y);return x&&(w._data=o0(x,w._data)),w}});var uA="polynomialRoot",vz=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],fA=T(uA,vz,e=>{var{typed:r,isZero:t,equalScalar:n,add:i,subtract:a,multiply:s,divide:c,sqrt:f,unaryMinus:o,cbrt:u,typeOf:p,im:d,re:h}=e;return r(uA,{"number|Complex, ...number|Complex":(x,v)=>{for(var y=[x,...v];y.length>0&&t(y[y.length-1]);)y.pop();if(y.length<2)throw new RangeError("Polynomial [".concat(x,", ").concat(v,"] must have a non-zero non-constant coefficient"));switch(y.length){case 2:return[o(c(y[0],y[1]))];case 3:{var[w,C,b]=y,A=s(2,b),E=s(C,C),S=s(4,b,w);if(n(E,S))return[c(o(C),A)];var O=f(a(E,S));return[c(a(O,C),A),c(a(o(O),C),A)]}case 4:{var[F,M,_,k]=y,L=o(s(3,k)),Y=s(_,_),$=s(3,k,M),V=i(s(2,_,_,_),s(27,k,k,F)),q=s(9,k,_,M);if(n(Y,$)&&n(V,q))return[c(_,L)];var R=a(Y,$),j=a(V,q),U=i(s(18,k,_,M,F),s(_,_,M,M)),oe=i(s(4,_,_,_,F),s(4,k,M,M,M),s(27,k,k,F,F));if(n(U,oe))return[c(a(s(4,k,_,M),i(s(9,k,k,F),s(_,_,_))),s(k,R)),c(a(s(9,k,F),s(_,M)),s(2,R))];var me;n(Y,$)?me=j:me=c(i(j,f(a(s(j,j),s(4,R,R,R)))),2);var ie=!0,H=u(me,ie).toArray().map(ce=>c(i(_,ce,c(R,ce)),L));return H.map(ce=>p(ce)==="Complex"&&n(h(ce),h(ce)+d(ce))?h(ce):ce)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(y))}}})});var gz="Help",xz=["evaluate"],lA=T(gz,xz,e=>{var{evaluate:r}=e;function t(n){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(!n)throw new Error('Argument "doc" missing');this.doc=n}return t.prototype.type="Help",t.prototype.isHelp=!0,t.prototype.toString=function(){var n=this.doc||{},i=\` +\`;if(n.name&&(i+="Name: "+n.name+\` + +\`),n.category&&(i+="Category: "+n.category+\` + +\`),n.description&&(i+=\`Description: + \`+n.description+\` + +\`),n.syntax&&(i+=\`Syntax: + \`+n.syntax.join(\` + \`)+\` + +\`),n.examples){i+=\`Examples: +\`;for(var a=!1,s=r("config()"),c={config:p=>(a=!0,r("config(newConfig)",{newConfig:p}))},f=0;fa!=="mathjs").forEach(a=>{i[a]=n[a]}),new t(i)},t.prototype.valueOf=t.prototype.toString,t},{isClass:!0});var yz="Chain",bz=["?on","math","typed"],cA=T(yz,bz,e=>{var{on:r,math:t,typed:n}=e;function i(o){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");Vs(o)?this.value=o.value:this.value=o}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return lr(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(o){return new i(o.value)};function a(o,u){typeof u=="function"&&(i.prototype[o]=c(u))}function s(o,u){Hs(i.prototype,o,function(){var d=u();if(typeof d=="function")return c(d)})}function c(o){return function(){if(arguments.length===0)return new i(o(this.value));for(var u=[this.value],p=0;po[x])};for(var d in o)p(d)}};var f={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(t),r&&r("import",function(o,u,p){p||s(o,u)}),i},{isClass:!0});var s0={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]};var pA={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};var mA={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]};var dA={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]};var hA={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};var vA={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};var gA={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]};var xA={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]};var yA={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};var bA={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};var wA={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as \`(1 + sqrt(5)) / 2\` and is approximately 1.618034...",examples:["phi"],seealso:[]};var u0={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]};var DA={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]};var SA={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]};var NA={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]};var AA={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]};var EA={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]};var CA={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]};var MA={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]};var _A={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]};var TA={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]};var FA={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]};var OA={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]};var BA={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]};var IA={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]};var PA={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]};var kA={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]};var RA={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]};var LA={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]};var qA={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]};var UA={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]};var zA={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]};var WA={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]};var VA={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]};var YA={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]};var HA={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]};var GA={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]};var $A={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]};var ZA={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]};var QA={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix \`A\` is decomposed in two matrices (\`Q\`, \`R\`) where \`Q\` is an orthogonal matrix and \`R\` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]};var XA={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]};var JA={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]};var KA={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]};var jA={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]};var eE={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]};var rE={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]};var tE={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]};var nE={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]};var iE={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]};var aE={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]};var oE={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]};var sE={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When \`x\` is a number or complex number, an optional second argument \`allRoots\` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]};var uE={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]};var fE={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]};var lE={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]};var cE={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]};var pE={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]};var mE={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]};var dE={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]};var hE={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]};var vE={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]};var gE={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]};var xE={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]};var yE={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]};var bE={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]};var wE={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \\u2263 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]};var DE={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]};var SE={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]};var NE={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]};var AE={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a \`value+1\`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]};var EE={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating \`log(x, 2)\`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]};var CE={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]};var ME={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]};var _E={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']};var TE={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]};var FE={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]};var OE={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]};var BE={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]};var IE={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]};var PE={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]};var kE={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix \`X\` of another matrix \`A\` is such that \`X * X = A\`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]};var RE={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]};var LE={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]};var qE={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]};var UE={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]};var zE={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]};var WE={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]};var VE={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]};var YE={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]};var HE={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};var GE={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};var $E={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]};var ZE={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]};var QE={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]};var XE={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]};var JE={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]};var KE={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. \`bellNumbers\` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]};var jE={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]};var eC={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]};var rC={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. \`stirlingS2\` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]};var tC={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]};var nC={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]};var iC={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]};var aC={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]};var oC={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]};var sC={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]};var uC={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]};var fC={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]};var lC={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]};var cC={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]};var pC={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]};var mC={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]};var dC={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]};var hC={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var vC={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]};var gC={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]};var xC={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};var yC={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var bC={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var wC={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]};var DC={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]};var SC={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]};var NC={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]};var AC={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]};var EC={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]};var CC={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]};var MC={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var _C={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var TC={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore\\u2013Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]};var FC={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]};var OC={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]};var BC={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]};var IC={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]};var PC={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]};var kC={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]};var RC={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]};var LC={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]};var qC={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]};var UC={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]};var zC={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]};var WC={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]};var VC={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]};var YC={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]};var HC={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]};var GC={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]};var $C={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation \`l:u\`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]};var ZC={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]};var QC={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};var XC={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]};var JC={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]};var KC={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]};var jC={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]};var eM={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]};var rM={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]};var tM={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]};var nM={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]};var iM={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]};var aM={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from \`n\` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]};var oM={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]};var sM={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]};var uM={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]};var fM={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]};var lM={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]};var cM={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]};var pM={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]};var mM={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]};var dM={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]};var hM={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]};var vM={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]};var gM={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]};var xM={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]};var yM={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]};var bM={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]};var wM={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]};var DM={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]};var SM={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]};var NM={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]};var AM={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]};var EM={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]};var CM={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]};var MM={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]};var _M={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]};var TM={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]};var FM={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]};var OM={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]};var BM={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]};var IM={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]};var PM={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]};var kM={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]};var RM={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]};var LM={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]};var qM={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]};var UM={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]};var zM={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]};var WM={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:\`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. + +In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.\`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]};var VM={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]};var YM={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var HM={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var GM={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]};var $M={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]};var ZM={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]};var QM={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as \`acosh(x) = ln(sqrt(x^2 - 1) + x)\`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]};var XM={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]};var JM={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as \`acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2\`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]};var KM={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]};var jM={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as \`acsch(x) = ln(1/x + sqrt(1/x^2 + 1))\`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]};var e_={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]};var r_={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]};var t_={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]};var n_={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as \`asinh(x) = ln(x + sqrt(x^2 + 1))\`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]};var i_={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]};var a_={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]};var o_={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as \`atanh(x) = ln((1 + x)/(1 - x)) / 2\`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]};var s_={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]};var u_={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]};var f_={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]};var l_={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]};var c_={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]};var p_={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]};var m_={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]};var d_={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]};var h_={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]};var v_={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]};var g_={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]};var x_={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]};var y_={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]};var b_={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]};var w_={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]};var D_={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]};var S_={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]};var N_={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]};var A_={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]};var E_={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]};var C_={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]};var M_={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]};var __={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};var T_={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};var F_={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]};var O_={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]};var B_={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]};var I_={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]};var P_={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]};var k_={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]};var R_={bignumber:CA,boolean:MA,complex:_A,createUnit:TA,fraction:FA,index:OA,matrix:BA,number:IA,sparse:PA,splitUnit:kA,string:RA,unit:LA,e:s0,E:s0,false:pA,i:mA,Infinity:dA,LN2:vA,LN10:hA,LOG2E:xA,LOG10E:gA,NaN:yA,null:bA,pi:u0,PI:u0,phi:wA,SQRT1_2:DA,SQRT2:SA,tau:NA,true:AA,version:EA,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:WA,lsolve:YA,lsolveAll:HA,lup:GA,lusolve:$A,leafCount:VA,polynomialRoot:ZA,resolve:JA,simplify:KA,simplifyConstant:jA,simplifyCore:eE,symbolicEqual:tE,rationalize:XA,slu:rE,usolve:nE,usolveAll:iE,qr:QA,abs:aE,add:oE,cbrt:sE,ceil:uE,cube:fE,divide:lE,dotDivide:cE,dotMultiply:pE,dotPow:mE,exp:dE,expm:hE,expm1:vE,fix:gE,floor:xE,gcd:yE,hypot:bE,lcm:DE,log:SE,log2:EE,log1p:AE,log10:NE,mod:CE,multiply:ME,norm:_E,nthRoot:TE,nthRoots:FE,pow:OE,round:BE,sign:IE,sqrt:PE,sqrtm:kE,square:UE,subtract:zE,unaryMinus:WE,unaryPlus:VE,xgcd:YE,invmod:wE,bitAnd:HE,bitNot:GE,bitOr:$E,bitXor:ZE,leftShift:QE,rightArithShift:XE,rightLogShift:JE,bellNumbers:KE,catalan:jE,composition:eC,stirlingS2:rC,config:qA,import:UA,typed:zA,arg:tC,conj:nC,re:aC,im:iC,evaluate:oC,help:sC,distance:uC,intersect:fC,and:lC,not:cC,or:pC,xor:mC,concat:hC,count:vC,cross:gC,column:dC,ctranspose:xC,det:yC,diag:bC,diff:wC,dot:DC,getMatrixDataType:CC,identity:MC,filter:NC,flatten:AC,forEach:EC,inv:_C,pinv:TC,eigs:SC,kron:FC,matrixFromFunction:IC,matrixFromRows:PC,matrixFromColumns:BC,map:OC,ones:kC,partitionSelect:RC,range:LC,resize:UC,reshape:qC,rotate:zC,rotationMatrix:WC,row:VC,size:YC,sort:HC,squeeze:GC,subset:$C,trace:ZC,transpose:QC,zeros:XC,fft:JC,ifft:KC,sylvester:RE,schur:LE,lyap:qE,solveODE:k_,combinations:jC,combinationsWithRep:eM,factorial:rM,gamma:tM,kldivergence:iM,lgamma:nM,multinomial:aM,permutations:oM,pickRandom:sM,random:uM,randomInt:fM,compare:lM,compareNatural:cM,compareText:pM,deepEqual:mM,equal:dM,equalText:hM,larger:vM,largerEq:gM,smaller:xM,smallerEq:yM,unequal:bM,setCartesian:wM,setDifference:DM,setDistinct:SM,setIntersect:NM,setIsSubset:AM,setMultiplicity:EM,setPowerset:CM,setSize:MM,setSymDifference:_M,setUnion:TM,zpk2tf:FM,freqz:OM,erf:BM,zeta:IM,cumsum:YM,mad:PM,max:kM,mean:RM,median:LM,min:qM,mode:UM,prod:zM,quantileSeq:WM,std:VM,sum:HM,variance:GM,corr:$M,acos:ZM,acosh:QM,acot:XM,acoth:JM,acsc:KM,acsch:jM,asec:e_,asech:r_,asin:t_,asinh:n_,atan:i_,atanh:o_,atan2:a_,cos:s_,cosh:u_,cot:f_,coth:l_,csc:c_,csch:p_,sec:m_,sech:d_,sin:h_,sinh:v_,tan:g_,tanh:x_,to:y_,clone:w_,format:D_,bin:b_,oct:B_,hex:N_,isNaN:E_,isInteger:A_,isNegative:C_,isNumeric:M_,hasNumericValue:S_,isPositive:__,isPrime:T_,isZero:F_,print:I_,typeOf:P_,numeric:O_};var L_="help",wz=["typed","mathWithTransform","Help"],q_=T(L_,wz,e=>{var{typed:r,mathWithTransform:t,Help:n}=e;return r(L_,{any:function(a){var s,c=a;if(typeof a!="string"){for(s in t)if($e(t,s)&&a===t[s]){c=s;break}}var f=gt(R_,c);if(!f){var o=typeof c=="function"?c.name:c;throw new Error('No documentation found on "'+o+'"')}return new n(f)}})});var U_="chain",Dz=["typed","Chain"],z_=T(U_,Dz,e=>{var{typed:r,Chain:t}=e;return r(U_,{"":function(){return new t},any:function(i){return new t(i)}})});var W_="det",Sz=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],V_=T(W_,Sz,e=>{var{typed:r,matrix:t,subtractScalar:n,multiply:i,divideScalar:a,isZero:s,unaryMinus:c}=e;return r(W_,{any:function(u){return tr(u)},"Array | Matrix":function(u){var p;switch(Ge(u)?p=u.size():Array.isArray(u)?(u=t(u),p=u.size()):p=[],p.length){case 0:return tr(u);case 1:if(p[0]===1)return tr(u.valueOf()[0]);if(p[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(p)+")");case 2:{var d=p[0],h=p[1];if(d===h)return f(u.clone().valueOf(),d,h);if(h===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(p)+")")}}});function f(o,u,p){if(u===1)return tr(o[0][0]);if(u===2)return n(i(o[0][0],o[1][1]),i(o[1][0],o[0][1]));for(var d=!1,h=new Array(u).fill(0).map((O,F)=>F),x=0;x{var{typed:r,matrix:t,divideScalar:n,addScalar:i,multiply:a,unaryMinus:s,det:c,identity:f,abs:o}=e;return r(Y_,{"Array | Matrix":function(d){var h=Ge(d)?d.size():or(d);switch(h.length){case 1:if(h[0]===1)return Ge(d)?t([n(1,d.valueOf()[0])]):[n(1,d[0])];throw new RangeError("Matrix must be square (size: "+lr(h)+")");case 2:{var x=h[0],v=h[1];if(x===v)return Ge(d)?t(u(d.valueOf(),x,v),d.storage()):u(d,x,v);throw new RangeError("Matrix must be square (size: "+lr(h)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(h)+")")}},any:function(d){return n(1,d)}});function u(p,d,h){var x,v,y,w,C;if(d===1){if(w=p[0][0],w===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,w)]]}else if(d===2){var b=c(p);if(b===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(p[1][1],b),n(s(p[0][1]),b)],[n(s(p[1][0]),b),n(p[0][0],b)]]}else{var A=p.concat();for(x=0;xO&&(O=o(A[x][S]),F=x),x++;if(O===0)throw Error("Cannot calculate inverse, determinant is zero");x=F,x!==S&&(C=A[S],A[S]=A[x],A[x]=C,C=E[S],E[S]=E[x],E[x]=C);var M=A[S],_=E[S];for(x=0;x{var{typed:r,matrix:t,inv:n,deepEqual:i,equal:a,dotDivide:s,dot:c,ctranspose:f,divideScalar:o,multiply:u,add:p,Complex:d}=e;return r(G_,{"Array | Matrix":function(b){var A=Ge(b)?b.size():or(b);switch(A.length){case 1:return w(b)?f(b):A[0]===1?n(b):s(f(b),c(b,b));case 2:{if(w(b))return f(b);var E=A[0],S=A[1];if(E===S)try{return n(b)}catch(O){if(!(O instanceof Error&&O.message.match(/Cannot calculate inverse, determinant is zero/)))throw O}return Ge(b)?t(h(b.valueOf(),E,S),b.storage()):h(b,E,S)}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(A)+")")}},any:function(b){return a(b,0)?tr(b):o(1,b)}});function h(C,b,A){var{C:E,F:S}=v(C,b,A),O=u(n(u(f(E),E)),f(E)),F=u(f(S),n(u(S,f(S))));return u(F,O)}function x(C,b,A){for(var E=tr(C),S=0,O=0;OF.filter((_,k)=>k!y(c(E[M],E[M])));return{C:S,F:O}}function y(C){return a(p(C,d(1,1)),p(0,d(1,1)))}function w(C){return i(p(C,d(1,1)),p(u(C,0),d(1,1)))}});function Z_(e){var{addScalar:r,subtract:t,flatten:n,multiply:i,multiplyScalar:a,divideScalar:s,sqrt:c,abs:f,bignumber:o,diag:u,size:p,reshape:d,inv:h,qr:x,usolve:v,usolveAll:y,equal:w,complex:C,larger:b,smaller:A,matrixFromColumns:E,dot:S}=e;function O(ie,H,ce,Me){var pe=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ge=F(ie,H,ce,Me,pe);M(ie,H,ce,Me,pe,ge);var{values:Se,C:xe}=_(ie,H,ce,Me,pe);if(pe){var be=k(ie,H,xe,ge,Se,ce,Me);return{values:Se,eigenvectors:be}}return{values:Se}}function F(ie,H,ce,Me,pe){var ge=Me==="BigNumber",Se=Me==="Complex",xe=ge?o(0):0,be=ge?o(1):Se?C(1):1,De=ge?o(1):1,Ae=ge?o(10):2,ze=a(Ae,Ae),Ze;pe&&(Ze=Array(H).fill(be));for(var K=!1;!K;){K=!0;for(var te=0;te1&&(K=u(Array(Ae-1).fill(xe)))),Ae-=1,be.pop();for(var Ce=0;Ce2&&(K=u(Array(Ae-2).fill(xe)))),Ae-=2,be.pop(),be.pop();for(var Ie=0;Ie+t(f(Xe),f(Or))),te>100){var sr=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+De.join(", "));throw sr.values=De,sr.vectors=[],sr}var ir=pe?i(Ze,V(ze,H)):void 0;return{values:De,C:ir}}function k(ie,H,ce,Me,pe,ge,Se){var xe=h(ce),be=i(xe,ie,ce),De=Se==="BigNumber",Ae=Se==="Complex",ze=De?o(0):Ae?C(0):0,Ze=De?o(1):Ae?C(1):1,K=[],te=[];for(var ye of pe){var ee=q(K,ye,w);ee===-1?(K.push(ye),te.push(1)):te[ee]+=1}for(var ne=[],ue=K.length,Ee=Array(H).fill(ze),Ce=u(Array(H).fill(Ze)),Le=function(){var ir=K[Ie],Xe=t(be,i(ir,Ce)),Or=y(Xe,Ee);for(Or.shift();Or.lengthi(le,we)),ne.push(...Or.map(we=>({value:ir,vector:n(we)})))},Ie=0;Ie=5)return null;for(xe=0;;){var be=v(ie,Se);if(A(oe(U(Se,[be])),Me))break;if(++xe>=10)return null;Se=me(be)}return Se}function j(ie,H,ce){var Me=ce==="BigNumber",pe=ce==="Complex",ge=Array(ie).fill(0).map(Se=>2*Math.random()-1);return Me&&(ge=ge.map(Se=>o(Se))),pe&&(ge=ge.map(Se=>C(Se))),ge=U(ge,H),me(ge,ce)}function U(ie,H){var ce=p(ie);for(var Me of H)Me=d(Me,ce),ie=t(ie,i(s(S(Me,ie),S(Me,Me)),Me));return ie}function oe(ie){return f(c(S(ie,ie)))}function me(ie,H){var ce=H==="BigNumber",Me=H==="Complex",pe=ce?o(1):Me?C(1):1;return i(s(pe,oe(ie)),ie)}return O}function Q_(e){var{config:r,addScalar:t,subtract:n,abs:i,atan:a,cos:s,sin:c,multiplyScalar:f,inv:o,bignumber:u,multiply:p,add:d}=e;function h(M,_){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.epsilon,L=arguments.length>3?arguments[3]:void 0,Y=arguments.length>4?arguments[4]:void 0;if(L==="number")return x(M,k,Y);if(L==="BigNumber")return v(M,k,Y);throw TypeError("Unsupported data type: "+L)}function x(M,_,k){var L=M.length,Y=Math.abs(_/L),$,V;if(k){V=new Array(L);for(var q=0;q=Math.abs(Y);){var j=R[0][0],U=R[0][1];$=y(M[j][j],M[U][U],M[j][U]),M=E(M,$,j,U),k&&(V=C(V,$,j,U)),R=S(M)}for(var oe=Array(L).fill(0),me=0;me=i(Y);){var j=R[0][0],U=R[0][1];$=w(M[j][j],M[U][U],M[j][U]),M=A(M,$,j,U),k&&(V=b(V,$,j,U)),R=O(M)}for(var oe=Array(L).fill(0),me=0;me({value:Y[H],vector:ie}));return{values:Y,eigenvectors:me}}return h}var Ez="eigs",Cz=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],X_=T(Ez,Cz,e=>{var{config:r,typed:t,matrix:n,addScalar:i,subtract:a,equal:s,abs:c,atan:f,cos:o,sin:u,multiplyScalar:p,divideScalar:d,inv:h,bignumber:x,multiply:v,add:y,larger:w,column:C,flatten:b,number:A,complex:E,sqrt:S,diag:O,size:F,reshape:M,qr:_,usolve:k,usolveAll:L,im:Y,re:$,smaller:V,matrixFromColumns:q,dot:R}=e,j=Q_({config:r,addScalar:i,subtract:a,column:C,flatten:b,equal:s,abs:c,atan:f,cos:o,sin:u,multiplyScalar:p,inv:h,bignumber:x,complex:E,multiply:v,add:y}),U=Z_({config:r,addScalar:i,subtract:a,multiply:v,multiplyScalar:p,flatten:b,divideScalar:d,sqrt:S,abs:c,bignumber:x,diag:O,size:F,reshape:M,qr:_,inv:h,usolve:k,usolveAll:L,equal:s,complex:E,larger:w,smaller:V,matrixFromColumns:q,dot:R});return t("eigs",{Array:function(ge){return oe(n(ge))},"Array, number|BigNumber":function(ge,Se){return oe(n(ge),{precision:Se})},"Array, Object"(pe,ge){return oe(n(pe),ge)},Matrix:function(ge){return oe(ge,{matricize:!0})},"Matrix, number|BigNumber":function(ge,Se){return oe(ge,{precision:Se,matricize:!0})},"Matrix, Object":function(ge,Se){var xe={matricize:!0};return Mt(xe,Se),oe(ge,xe)}});function oe(pe){var ge,Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},xe="eigenvectors"in Se?Se.eigenvectors:!0,be=(ge=Se.precision)!==null&&ge!==void 0?ge:r.epsilon,De=me(pe,be,xe);return Se.matricize&&(De.values=n(De.values),xe&&(De.eigenvectors=De.eigenvectors.map(Ae=>{var{value:ze,vector:Ze}=Ae;return{value:ze,vector:n(Ze)}}))),xe&&Object.defineProperty(De,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),De}function me(pe,ge,Se){var xe=pe.toArray(),be=pe.size();if(be.length!==2||be[0]!==be[1])throw new RangeError("Matrix must be square (size: ".concat(lr(be),")"));var De=be[0];if(H(xe,De,ge)&&(ce(xe,De),ie(xe,De,ge))){var Ae=Me(pe,xe,De);return j(xe,De,ge,Ae,Se)}var ze=Me(pe,xe,De);return U(xe,De,ge,ze,Se)}function ie(pe,ge,Se){for(var xe=0;xe{var{typed:r,abs:t,add:n,identity:i,inv:a,multiply:s}=e;return r(J_,{Matrix:function(p){var d=p.size();if(d.length!==2||d[0]!==d[1])throw new RangeError("Matrix must be square (size: "+lr(d)+")");for(var h=d[0],x=1e-15,v=c(p),y=f(v,x),w=y.q,C=y.j,b=s(p,Math.pow(2,-C)),A=i(h),E=i(h),S=1,O=b,F=-1,M=1;M<=w;M++)M>1&&(O=s(O,b),F=-F),S=S*(w-M+1)/((2*w-M+1)*M),A=n(A,s(S,O)),E=n(E,s(S*F,O));for(var _=s(a(E),A),k=0;k{var{typed:r,abs:t,add:n,multiply:i,map:a,sqrt:s,subtract:c,inv:f,size:o,max:u,identity:p}=e,d=1e3,h=1e-6;function x(v){var y,w=0,C=v,b=p(o(v));do{var A=C;if(C=i(.5,n(A,f(b))),b=i(.5,n(b,f(A))),y=u(t(c(C,A))),y>h&&++w>d)throw new Error("computing square root of matrix: iterative method could not converge")}while(y>h);return C}return r(j_,{"Array | Matrix":function(y){var w=Ge(y)?y.size():or(y);switch(w.length){case 1:if(w[0]===1)return a(y,s);throw new RangeError("Matrix must be square (size: "+lr(w)+")");case 2:{var C=w[0],b=w[1];if(C===b)return x(y);throw new RangeError("Matrix must be square (size: "+lr(w)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+lr(w)+")")}}})});var rT="sylvester",Tz=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],tT=T(rT,Tz,e=>{var{typed:r,schur:t,matrixFromColumns:n,matrix:i,multiply:a,range:s,concat:c,transpose:f,index:o,subset:u,add:p,subtract:d,identity:h,lusolve:x,abs:v}=e;return r(rT,{"Matrix, Matrix, Matrix":y,"Array, Matrix, Matrix":function(C,b,A){return y(i(C),b,A)},"Array, Array, Matrix":function(C,b,A){return y(i(C),i(b),A)},"Array, Matrix, Array":function(C,b,A){return y(i(C),b,i(A))},"Matrix, Array, Matrix":function(C,b,A){return y(C,i(b),A)},"Matrix, Array, Array":function(C,b,A){return y(C,i(b),i(A))},"Matrix, Matrix, Array":function(C,b,A){return y(C,b,i(A))},"Array, Array, Array":function(C,b,A){return y(i(C),i(b),i(A)).toArray()}});function y(w,C,b){for(var A=C.size()[0],E=w.size()[0],S=t(w),O=S.T,F=S.U,M=t(a(-1,C)),_=M.T,k=M.U,L=a(a(f(F),b),k),Y=s(0,E),$=[],V=(Ae,ze)=>c(Ae,ze,1),q=(Ae,ze)=>c(Ae,ze,0),R=0;R1e-5){for(var j=q(u(L,o(Y,R)),u(L,o(Y,R+1))),U=0;U{var{typed:r,matrix:t,identity:n,multiply:i,qr:a,norm:s,subtract:c}=e;return r(nT,{Array:function(u){var p=f(t(u));return{U:p.U.valueOf(),T:p.T.valueOf()}},Matrix:function(u){return f(u)}});function f(o){var u=o.size()[0],p=o,d=n(u),h=0,x;do{x=p;var v=a(p),y=v.Q,w=v.R;if(p=i(w,y),d=i(d,y),h++>100)break}while(s(c(p,x))>1e-4);return{U:d,T:p}}});var aT="lyap",Oz=["typed","matrix","sylvester","multiply","transpose"],oT=T(aT,Oz,e=>{var{typed:r,matrix:t,sylvester:n,multiply:i,transpose:a}=e;return r(aT,{"Matrix, Matrix":function(c,f){return n(c,a(c),i(-1,f))},"Array, Matrix":function(c,f){return n(t(c),a(t(c)),i(-1,f))},"Matrix, Array":function(c,f){return n(c,a(t(c)),t(i(-1,f)))},"Array, Array":function(c,f){return n(t(c),a(t(c)),t(i(-1,f))).toArray()}})});var Bz="divide",Iz=["typed","matrix","multiply","equalScalar","divideScalar","inv"],sT=T(Bz,Iz,e=>{var{typed:r,matrix:t,multiply:n,equalScalar:i,divideScalar:a,inv:s}=e,c=Jr({typed:r,equalScalar:i}),f=Bt({typed:r});return r("divide",pc({"Array | Matrix, Array | Matrix":function(u,p){return n(u,s(p))},"DenseMatrix, any":function(u,p){return f(u,p,a,!1)},"SparseMatrix, any":function(u,p){return c(u,p,a,!1)},"Array, any":function(u,p){return f(t(u),p,a,!1).valueOf()},"any, Array | Matrix":function(u,p){return n(u,s(p))}},a.signatures))});var uT="distance",Pz=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],fT=T(uT,Pz,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:i,divideScalar:a,deepEqual:s,sqrt:c,abs:f}=e;return r(uT,{"Array, Array, Array":function(E,S,O){if(E.length===2&&S.length===2&&O.length===2){if(!u(E))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!u(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!u(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(s(S,O))throw new TypeError("LinePoint1 should not be same with LinePoint2");var F=n(O[1],S[1]),M=n(S[0],O[0]),_=n(i(O[0],S[1]),i(S[0],O[1]));return y(E[0],E[1],F,M,_)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(E,S,O){if(Object.keys(E).length===2&&Object.keys(S).length===2&&Object.keys(O).length===2){if(!u(E))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!u(S))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!u(O))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(s(x(S),x(O)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in E&&"pointY"in E&&"lineOnePtX"in S&&"lineOnePtY"in S&&"lineTwoPtX"in O&&"lineTwoPtY"in O){var F=n(O.lineTwoPtY,S.lineOnePtY),M=n(S.lineOnePtX,O.lineTwoPtX),_=n(i(O.lineTwoPtX,S.lineOnePtY),i(S.lineOnePtX,O.lineTwoPtY));return y(E.pointX,E.pointY,F,M,_)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(E,S){if(E.length===2&&S.length===3){if(!u(E))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return y(E[0],E[1],S[0],S[1],S[2])}else if(E.length===3&&S.length===6){if(!p(E))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!h(S))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return w(E[0],E[1],E[2],S[0],S[1],S[2],S[3],S[4],S[5])}else if(E.length===S.length&&E.length>0){if(!d(E))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!d(S))throw new TypeError("All values of an array should be numbers or BigNumbers");return C(E,S)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(E,S){if(Object.keys(E).length===2&&Object.keys(S).length===3){if(!u(E))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!p(S))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in E&&"pointY"in E&&"xCoeffLine"in S&&"yCoeffLine"in S&&"constant"in S)return y(E.pointX,E.pointY,S.xCoeffLine,S.yCoeffLine,S.constant);throw new TypeError("Key names do not match")}else if(Object.keys(E).length===3&&Object.keys(S).length===6){if(!p(E))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!h(S))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in E&&"pointY"in E&&"x0"in S&&"y0"in S&&"z0"in S&&"a"in S&&"b"in S&&"c"in S)return w(E.pointX,E.pointY,E.pointZ,S.x0,S.y0,S.z0,S.a,S.b,S.c);throw new TypeError("Key names do not match")}else if(Object.keys(E).length===2&&Object.keys(S).length===2){if(!u(E))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!u(S))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in E&&"pointOneY"in E&&"pointTwoX"in S&&"pointTwoY"in S)return C([E.pointOneX,E.pointOneY],[S.pointTwoX,S.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(E).length===3&&Object.keys(S).length===3){if(!p(E))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!p(S))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in E&&"pointOneY"in E&&"pointOneZ"in E&&"pointTwoX"in S&&"pointTwoY"in S&&"pointTwoZ"in S)return C([E.pointOneX,E.pointOneY,E.pointOneZ],[S.pointTwoX,S.pointTwoY,S.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(E){if(!v(E))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return b(E)}});function o(A){return typeof A=="number"||je(A)}function u(A){return A.constructor!==Array&&(A=x(A)),o(A[0])&&o(A[1])}function p(A){return A.constructor!==Array&&(A=x(A)),o(A[0])&&o(A[1])&&o(A[2])}function d(A){return Array.isArray(A)||(A=x(A)),A.every(o)}function h(A){return A.constructor!==Array&&(A=x(A)),o(A[0])&&o(A[1])&&o(A[2])&&o(A[3])&&o(A[4])&&o(A[5])}function x(A){for(var E=Object.keys(A),S=[],O=0;OE.length!==2||!o(E[0])||!o(E[1])))return!1}else if(A[0].length===3&&o(A[0][0])&&o(A[0][1])&&o(A[0][2])){if(A.some(E=>E.length!==3||!o(E[0])||!o(E[1])||!o(E[2])))return!1}else return!1;return!0}function y(A,E,S,O,F){var M=f(t(t(i(S,A),i(O,E)),F)),_=c(t(i(S,S),i(O,O)));return a(M,_)}function w(A,E,S,O,F,M,_,k,L){var Y=[n(i(n(F,E),L),i(n(M,S),k)),n(i(n(M,S),_),i(n(O,A),L)),n(i(n(O,A),k),i(n(F,E),_))];Y=c(t(t(i(Y[0],Y[0]),i(Y[1],Y[1])),i(Y[2],Y[2])));var $=c(t(t(i(_,_),i(k,k)),i(L,L)));return a(Y,$)}function C(A,E){for(var S=A.length,O=0,F=0,M=0;M{var{typed:r,config:t,abs:n,add:i,addScalar:a,matrix:s,multiply:c,multiplyScalar:f,divideScalar:o,subtract:u,smaller:p,equalScalar:d,flatten:h,isZero:x,isNumeric:v}=e;return r("intersect",{"Array, Array, Array":y,"Array, Array, Array, Array":w,"Matrix, Matrix, Matrix":function(k,L,Y){var $=y(k.valueOf(),L.valueOf(),Y.valueOf());return $===null?null:s($)},"Matrix, Matrix, Matrix, Matrix":function(k,L,Y,$){var V=w(k.valueOf(),L.valueOf(),Y.valueOf(),$.valueOf());return V===null?null:s(V)}});function y(_,k,L){if(_=C(_),k=C(k),L=C(L),!A(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!A(k))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!E(L))throw new TypeError("Array with 4 numbers expected as third argument");return M(_[0],_[1],_[2],k[0],k[1],k[2],L[0],L[1],L[2],L[3])}function w(_,k,L,Y){if(_=C(_),k=C(k),L=C(L),Y=C(Y),_.length===2){if(!b(_))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!b(k))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!b(L))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!b(Y))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return S(_,k,L,Y)}else if(_.length===3){if(!A(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!A(k))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!A(L))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!A(Y))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return F(_[0],_[1],_[2],k[0],k[1],k[2],L[0],L[1],L[2],Y[0],Y[1],Y[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function C(_){return _.length===1?_[0]:_.length>1&&Array.isArray(_[0])&&_.every(k=>Array.isArray(k)&&k.length===1)?h(_):_}function b(_){return _.length===2&&v(_[0])&&v(_[1])}function A(_){return _.length===3&&v(_[0])&&v(_[1])&&v(_[2])}function E(_){return _.length===4&&v(_[0])&&v(_[1])&&v(_[2])&&v(_[3])}function S(_,k,L,Y){var $=_,V=L,q=u($,k),R=u(V,Y),j=u(f(q[0],R[1]),f(R[0],q[1]));if(x(j)||p(n(j),t.epsilon))return null;var U=f(R[0],$[1]),oe=f(R[1],$[0]),me=f(R[0],V[1]),ie=f(R[1],V[0]),H=o(a(u(u(U,oe),me),ie),j);return i(c(q,H),$)}function O(_,k,L,Y,$,V,q,R,j,U,oe,me){var ie=f(u(_,k),u(L,Y)),H=f(u($,V),u(q,R)),ce=f(u(j,U),u(oe,me));return a(a(ie,H),ce)}function F(_,k,L,Y,$,V,q,R,j,U,oe,me){var ie=O(_,q,U,q,k,R,oe,R,L,j,me,j),H=O(U,q,Y,_,oe,R,$,k,me,j,V,L),ce=O(_,q,Y,_,k,R,$,k,L,j,V,L),Me=O(U,q,U,q,oe,R,oe,R,me,j,me,j),pe=O(Y,_,Y,_,$,k,$,k,V,L,V,L),ge=u(f(ie,H),f(ce,Me)),Se=u(f(pe,Me),f(H,H));if(x(Se))return null;var xe=o(ge,Se),be=o(a(ie,f(xe,H)),Me),De=a(_,f(xe,u(Y,_))),Ae=a(k,f(xe,u($,k))),ze=a(L,f(xe,u(V,L))),Ze=a(q,f(be,u(U,q))),K=a(R,f(be,u(oe,R))),te=a(j,f(be,u(me,j)));return d(De,Ze)&&d(Ae,K)&&d(ze,te)?[De,Ae,ze]:null}function M(_,k,L,Y,$,V,q,R,j,U){var oe=f(_,q),me=f(Y,q),ie=f(k,R),H=f($,R),ce=f(L,j),Me=f(V,j),pe=u(u(u(U,oe),ie),ce),ge=u(u(u(a(a(me,H),Me),oe),ie),ce),Se=o(pe,ge),xe=a(_,f(Se,u(Y,_))),be=a(k,f(Se,u($,k))),De=a(L,f(Se,u(V,L)));return[xe,be,De]}});var cT="sum",Lz=["typed","config","add","numeric"],Op=T(cT,Lz,e=>{var{typed:r,config:t,add:n,numeric:i}=e;return r(cT,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":s,"...":function(f){if(hi(f))throw new TypeError("Scalar values expected in function sum");return a(f)}});function a(c){var f;return dn(c,function(o){try{f=f===void 0?o:n(f,o)}catch(u){throw St(u,"sum",o)}}),f===void 0&&(f=i(0,t.number)),typeof f=="string"&&(f=i(f,t.number)),f}function s(c,f){try{var o=bo(c,f,n);return o}catch(u){throw St(u,"sum")}}});var Bp="cumsum",qz=["typed","add","unaryPlus"],Ip=T(Bp,qz,e=>{var{typed:r,add:t,unaryPlus:n}=e;return r(Bp,{Array:i,Matrix:function(o){return o.create(i(o.valueOf()))},"Array, number | BigNumber":s,"Matrix, number | BigNumber":function(o,u){return o.create(s(o.valueOf(),u))},"...":function(o){if(hi(o))throw new TypeError("All values expected to be scalar in function cumsum");return i(o)}});function i(f){try{return a(f)}catch(o){throw St(o,Bp)}}function a(f){if(f.length===0)return[];for(var o=[n(f[0])],u=1;u=u.length)throw new Xt(o,u.length);try{return c(f,o)}catch(p){throw St(p,Bp)}}function c(f,o){var u,p,d;if(o<=0){var h=f[0][0];if(Array.isArray(h)){for(d=Fc(f),p=[],u=0;u{var{typed:r,add:t,divide:n}=e;return r(pT,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":i,"...":function(c){if(hi(c))throw new TypeError("Scalar values expected in function mean");return a(c)}});function i(s,c){try{var f=bo(s,c,t),o=Array.isArray(s)?or(s):s.size();return n(f,o[c])}catch(u){throw St(u,"mean")}}function a(s){var c,f=0;if(dn(s,function(o){try{c=c===void 0?o:t(c,o),f++}catch(u){throw St(u,"mean",o)}}),f===0)throw new Error("Cannot calculate the mean of an empty array");return n(c,f)}});var mT="median",zz=["typed","add","divide","compare","partitionSelect"],dT=T(mT,zz,e=>{var{typed:r,add:t,divide:n,compare:i,partitionSelect:a}=e;function s(o){try{o=gr(o.valueOf());var u=o.length;if(u===0)throw new Error("Cannot calculate median of an empty array");if(u%2===0){for(var p=u/2-1,d=a(o,p+1),h=o[p],x=0;x0&&(h=o[x]);return f(h,d)}else{var v=a(o,(u-1)/2);return c(v)}}catch(y){throw St(y,"median")}}var c=r({"number | BigNumber | Complex | Unit":function(u){return u}}),f=r({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(u,p){return n(t(u,p),2)}});return r(mT,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(u,p){throw new Error("median(A, dim) is not yet supported")},"...":function(u){if(hi(u))throw new TypeError("Scalar values expected in function median");return s(u)}})});var hT="mad",Wz=["typed","abs","map","median","subtract"],vT=T(hT,Wz,e=>{var{typed:r,abs:t,map:n,median:i,subtract:a}=e;return r(hT,{"Array | Matrix":s,"...":function(f){return s(f)}});function s(c){if(c=gr(c.valueOf()),c.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var f=i(c);return i(n(c,function(o){return t(a(o,f))}))}catch(o){throw o instanceof TypeError&&o.message.indexOf("median")!==-1?new TypeError(o.message.replace("median","mad")):St(o,"mad")}}});var f0="unbiased",gT="variance",Vz=["typed","add","subtract","multiply","divide","apply","isNaN"],kp=T(gT,Vz,e=>{var{typed:r,add:t,subtract:n,multiply:i,divide:a,apply:s,isNaN:c}=e;return r(gT,{"Array | Matrix":function(p){return f(p,f0)},"Array | Matrix, string":f,"Array | Matrix, number | BigNumber":function(p,d){return o(p,d,f0)},"Array | Matrix, number | BigNumber, string":o,"...":function(p){return f(p,f0)}});function f(u,p){var d,h=0;if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(dn(u,function(y){try{d=d===void 0?y:t(d,y),h++}catch(w){throw St(w,"variance",y)}}),h===0)throw new Error("Cannot calculate variance of an empty array");var x=a(d,h);if(d=void 0,dn(u,function(y){var w=n(y,x);d=d===void 0?i(w,w):t(d,i(w,w))}),c(d))return d;switch(p){case"uncorrected":return a(d,h);case"biased":return a(d,h+1);case"unbiased":{var v=je(d)?d.mul(0):0;return h===1?v:a(d,h-1)}default:throw new Error('Unknown normalization "'+p+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function o(u,p,d){try{if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return s(u,p,h=>f(h,d))}catch(h){throw St(h,"variance")}}});var xT="quantileSeq",Yz=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Rp=T(xT,Yz,e=>{var{typed:r,bignumber:t,add:n,subtract:i,divide:a,multiply:s,partitionSelect:c,compare:f,isInteger:o,smaller:u,smallerEq:p,larger:d}=e,h=nu({typed:r,isInteger:o});return r(xT,{"Array | Matrix, number | BigNumber":(C,b)=>v(C,b,!1),"Array | Matrix, number | BigNumber, number":(C,b,A)=>x(C,b,!1,A,v),"Array | Matrix, number | BigNumber, boolean":v,"Array | Matrix, number | BigNumber, boolean, number":(C,b,A,E)=>x(C,b,A,E,v),"Array | Matrix, Array | Matrix":(C,b)=>y(C,b,!1),"Array | Matrix, Array | Matrix, number":(C,b,A)=>x(C,b,!1,A,y),"Array | Matrix, Array | Matrix, boolean":y,"Array | Matrix, Array | Matrix, boolean, number":(C,b,A,E)=>x(C,b,A,E,y)});function x(C,b,A,E,S){return h(C,E,O=>S(O,b,A))}function v(C,b,A){var E,S=C.valueOf();if(u(b,0))throw new Error("N/prob must be non-negative");if(p(b,1))return ar(b)?w(S,b,A):t(w(S,b,A));if(d(b,1)){if(!o(b))throw new Error("N must be a positive integer");if(d(b,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var O=n(b,1);E=[];for(var F=0;u(F,b);F++){var M=a(F+1,O);E.push(w(S,M,A))}return ar(b)?E:t(E)}}function y(C,b,A){for(var E=C.valueOf(),S=b.valueOf(),O=[],F=0;F0&&(_=E[L])}return n(s(_,i(1,M)),s(k,M))}});var yT="std",Hz=["typed","map","sqrt","variance"],Lp=T(yT,Hz,e=>{var{typed:r,map:t,sqrt:n,variance:i}=e;return r(yT,{"Array | Matrix":a,"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":a,"Array | Matrix, number | BigNumber, string":a,"...":function(c){return a(c)}});function a(s,c){if(s.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var f=i.apply(null,arguments);return bt(f)?t(f,n):n(f)}catch(o){throw o instanceof TypeError&&o.message.indexOf(" variance")!==-1?new TypeError(o.message.replace(" variance"," std")):o}}});var bT="corr",Gz=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],wT=T(bT,Gz,e=>{var{typed:r,matrix:t,sqrt:n,sum:i,add:a,subtract:s,multiply:c,pow:f,divide:o}=e;return r(bT,{"Array, Array":function(h,x){return u(h,x)},"Matrix, Matrix":function(h,x){var v=u(h.toArray(),x.toArray());return Array.isArray(v)?t(v):v}});function u(d,h){var x=[];if(Array.isArray(d[0])&&Array.isArray(h[0])){if(d.length!==h.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var v=0;va(S,c(O,h[F])),0),C=i(d.map(S=>f(S,2))),b=i(h.map(S=>f(S,2))),A=s(c(x,w),c(v,y)),E=n(c(s(c(x,C),f(v,2)),s(c(x,b),f(y,2))));return o(A,E)}});var DT="combinations",$z=["typed"],NT=T(DT,$z,e=>{var{typed:r}=e;return r(DT,{"number, number":Dv,"BigNumber, BigNumber":function(n,i){var a=n.constructor,s,c,f=n.minus(i),o=new a(1);if(!ST(n)||!ST(i))throw new TypeError("Positive integer value expected in function combinations");if(i.gt(n))throw new TypeError("k must be less than n in function combinations");if(s=o,i.lt(f))for(c=o;c.lte(f);c=c.plus(o))s=s.times(i.plus(c)).dividedBy(c);else for(c=o;c.lte(i);c=c.plus(o))s=s.times(f.plus(c)).dividedBy(c);return s}})});function ST(e){return e.isInteger()&&e.gte(0)}var AT="combinationsWithRep",Zz=["typed"],CT=T(AT,Zz,e=>{var{typed:r}=e;return r(AT,{"number, number":function(n,i){if(!He(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!He(i)||i<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n<1)throw new TypeError("k must be less than or equal to n + k - 1");if(i{var{typed:r,config:t,multiplyScalar:n,pow:i,BigNumber:a,Complex:s}=e;function c(o){if(o.im===0)return bf(o.re);if(o.re<.5){var u=new s(1-o.re,-o.im),p=new s(Math.PI*o.re,Math.PI*o.im);return new s(Math.PI).div(p.sin()).div(c(u))}o=new s(o.re-1,o.im);for(var d=new s(ns[0],0),h=1;h2;)d-=2,x+=d,h=h.times(x);return new a(h.toPrecision(a.precision))}});var TT="lgamma",Xz=["Complex","typed"],FT=T(TT,Xz,e=>{var{Complex:r,typed:t}=e,n=7,i=7,a=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(TT,{number:wf,Complex:s,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function s(o){var u=6.283185307179586,p=1.1447298858494002,d=.1;if(o.isNaN())return new r(NaN,NaN);if(o.im===0)return new r(wf(o.re),0);if(o.re>=n||Math.abs(o.im)>=i)return c(o);if(o.re<=d){var h=ry(u,o.im)*Math.floor(.5*o.re+.25),x=o.mul(Math.PI).sin().log(),v=s(new r(1-o.re,-o.im));return new r(p,h).sub(x).sub(v)}else return o.im>=0?f(o):f(o.conjugate()).conjugate()}function c(o){for(var u=o.sub(.5).mul(o.log()).sub(o).add(_v),p=new r(1,0).div(o),d=p.div(o),h=a[0],x=a[1],v=2*d.re,y=d.re*d.re+d.im*d.im,w=2;w<8;w++){var C=x;x=-y*h+a[w],h=v*h+C}var b=p.mul(d.mul(h).add(x));return u.add(b)}function f(o){var u=0,p=0,d=o;for(o=o.add(1);o.re<=n;){d=d.mul(o);var h=d.im<0?1:0;h!==0&&p===0&&u++,p=h,o=o.add(1)}return c(o).sub(d.log()).sub(new r(0,u*2*Math.PI*1))}});var OT="factorial",Jz=["typed","gamma"],BT=T(OT,Jz,e=>{var{typed:r,gamma:t}=e;return r(OT,{number:function(i){if(i<0)throw new Error("Value must be non-negative");return t(i+1)},BigNumber:function(i){if(i.isNegative())throw new Error("Value must be non-negative");return t(i.plus(1))},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var IT="kldivergence",Kz=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],PT=T(IT,Kz,e=>{var{typed:r,matrix:t,divide:n,sum:i,multiply:a,map:s,dotDivide:c,log:f,isNumeric:o}=e;return r(IT,{"Array, Array":function(d,h){return u(t(d),t(h))},"Matrix, Array":function(d,h){return u(d,t(h))},"Array, Matrix":function(d,h){return u(t(d),h)},"Matrix, Matrix":function(d,h){return u(d,h)}});function u(p,d){var h=d.size().length,x=p.size().length;if(h>1)throw new Error("first object must be one dimensional");if(x>1)throw new Error("second object must be one dimensional");if(h!==x)throw new Error("Length of two vectors must be equal");var v=i(p);if(v===0)throw new Error("Sum of elements in first object must be non zero");var y=i(d);if(y===0)throw new Error("Sum of elements in second object must be non zero");var w=n(p,i(p)),C=n(d,i(d)),b=i(a(w,s(c(w,C),A=>f(A))));return o(b)?b:Number.NaN}});var kT="multinomial",jz=["typed","add","divide","multiply","factorial","isInteger","isPositive"],RT=T(kT,jz,e=>{var{typed:r,add:t,divide:n,multiply:i,factorial:a,isInteger:s,isPositive:c}=e;return r(kT,{"Array | Matrix":function(o){var u=0,p=1;return dn(o,function(d){if(!s(d)||!c(d))throw new TypeError("Positive integer value expected in function multinomial");u=t(u,d),p=i(p,a(d))}),n(a(u),p)}})});var LT="permutations",eW=["typed","factorial"],UT=T(LT,eW,e=>{var{typed:r,factorial:t}=e;return r(LT,{"number | BigNumber":t,"number, number":function(i,a){if(!He(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(!He(a)||a<0)throw new TypeError("Positive integer value expected in function permutations");if(a>i)throw new TypeError("second argument k must be less than or equal to first argument n");return Kn(i-a+1,i)},"BigNumber, BigNumber":function(i,a){var s,c;if(!qT(i)||!qT(a))throw new TypeError("Positive integer value expected in function permutations");if(a.gt(i))throw new TypeError("second argument k must be less than or equal to first argument n");var f=i.mul(0).add(1);for(s=f,c=i.minus(a).plus(1);c.lte(i);c=c.plus(1))s=s.times(c);return s}})});function qT(e){return e.isInteger()&&e.gte(0)}var v0=ci(nF(),1),sW=(0,v0.default)(Date.now());function qa(e){var r;function t(i){r=i===null?sW:(0,v0.default)(String(i))}t(e);function n(){return r()}return n}var iF="pickRandom",uW=["typed","config","?on"],aF=T(iF,uW,e=>{var{typed:r,config:t,on:n}=e,i=qa(t.randomSeed);return n&&n("config",function(s,c){s.randomSeed!==c.randomSeed&&(i=qa(s.randomSeed))}),r(iF,{"Array | Matrix":function(c){return a(c,{})},"Array | Matrix, Object":function(c,f){return a(c,f)},"Array | Matrix, number":function(c,f){return a(c,{number:f})},"Array | Matrix, Array | Matrix":function(c,f){return a(c,{weights:f})},"Array | Matrix, Array | Matrix, number":function(c,f,o){return a(c,{number:o,weights:f})},"Array | Matrix, number, Array | Matrix":function(c,f,o){return a(c,{number:f,weights:o})}});function a(s,c){var{number:f,weights:o,elementWise:u=!0}=c,p=typeof f>"u";p&&(f=1);var d=Ge(s)?s.create:Ge(o)?o.create:null;s=s.valueOf(),o&&(o=o.valueOf()),u===!0&&(s=gr(s),o=gr(o));var h=0;if(typeof o<"u"){if(o.length!==s.length)throw new Error("Weights must have the same length as possibles");for(var x=0,v=o.length;x"u")C=s[Math.floor(i()*y)];else for(var b=i()*h,A=0,E=s.length;A1)for(var n=0,i=e.shift();n{var{typed:r,config:t,on:n}=e,i=qa(t.randomSeed);return n&&n("config",function(c,f){c.randomSeed!==f.randomSeed&&(i=qa(c.randomSeed))}),r(oF,{"":()=>s(0,1),number:c=>s(0,c),"number, number":(c,f)=>s(c,f),"Array | Matrix":c=>a(c,0,1),"Array | Matrix, number":(c,f)=>a(c,0,f),"Array | Matrix, number, number":(c,f,o)=>a(c,f,o)});function a(c,f,o){var u=Ef(c.valueOf(),()=>s(f,o));return Ge(c)?c.create(u):u}function s(c,f){return c+i()*(f-c)}});var uF="randomInt",lW=["typed","config","?on"],fF=T(uF,lW,e=>{var{typed:r,config:t,on:n}=e,i=qa(t.randomSeed);return n&&n("config",function(c,f){c.randomSeed!==f.randomSeed&&(i=qa(c.randomSeed))}),r(uF,{"":()=>s(0,1),number:c=>s(0,c),"number, number":(c,f)=>s(c,f),"Array | Matrix":c=>a(c,0,1),"Array | Matrix, number":(c,f)=>a(c,0,f),"Array | Matrix, number, number":(c,f,o)=>a(c,f,o)});function a(c,f,o){var u=Ef(c.valueOf(),()=>s(f,o));return Ge(c)?c.create(u):u}function s(c,f){return Math.floor(c+i()*(f-c))}});var lF="stirlingS2",cW=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],cF=T(lF,cW,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:i,divideScalar:a,pow:s,factorial:c,combinations:f,isNegative:o,isInteger:u,number:p,bignumber:d,larger:h}=e,x=[],v=[];return r(lF,{"number | BigNumber, number | BigNumber":function(w,C){if(!u(w)||o(w)||!u(C)||o(C))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(h(C,w))throw new TypeError("k must be less than or equal to n in function stirlingS2");var b=!(ar(w)&&ar(C)),A=b?v:x,E=b?d:p,S=p(w),O=p(C);if(A[S]&&A[S].length>O)return A[S][O];for(var F=0;F<=S;++F)if(A[F]||(A[F]=[E(F===0?1:0)]),F!==0)for(var M=A[F],_=A[F-1],k=M.length;k<=F&&k<=O;++k)k===F?M[k]=1:M[k]=t(i(E(k),_[k]),_[k-1]);return A[S][O]}})});var pF="bellNumbers",pW=["typed","addScalar","isNegative","isInteger","stirlingS2"],mF=T(pF,pW,e=>{var{typed:r,addScalar:t,isNegative:n,isInteger:i,stirlingS2:a}=e;return r(pF,{"number | BigNumber":function(c){if(!i(c)||n(c))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var f=0,o=0;o<=c;o++)f=t(f,a(c,o));return f}})});var dF="catalan",mW=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],hF=T(dF,mW,e=>{var{typed:r,addScalar:t,divideScalar:n,multiplyScalar:i,combinations:a,isNegative:s,isInteger:c}=e;return r(dF,{"number | BigNumber":function(o){if(!c(o)||s(o))throw new TypeError("Non-negative integer value expected in function catalan");return n(a(i(o,2),o),t(o,1))}})});var vF="composition",dW=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],gF=T(vF,dW,e=>{var{typed:r,addScalar:t,combinations:n,isPositive:i,isNegative:a,isInteger:s,larger:c}=e;return r(vF,{"number | BigNumber, number | BigNumber":function(o,u){if(!s(o)||!i(o)||!s(u)||!i(u))throw new TypeError("Positive integer value expected in function composition");if(c(u,o))throw new TypeError("k must be less than or equal to n in function composition");return n(t(o,-1),t(u,-1))}})});var xF="leafCount",hW=["parse","typed"],yF=T(xF,hW,e=>{var{parse:r,typed:t}=e;function n(i){var a=0;return i.forEach(s=>{a+=n(s)}),a||1}return t(xF,{Node:function(a){return n(a)}})});function g0(e){return yr(e)||ut(e)&&e.isUnary()&&yr(e.args[0])}function Cf(e){return!!(yr(e)||(fn(e)||ut(e))&&e.args.every(Cf)||Zt(e)&&Cf(e.content))}function bF(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function x0(e){for(var r=1;r{var{FunctionNode:r,OperatorNode:t,SymbolNode:n}=e,i=!0,a=!1,s="defaultF",c={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:a,total:i,commutative:a,associative:a},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:a,total:i,commutative:a,associative:a},paren:{trivial:i,total:i,commutative:i,associative:a},defaultF:{trivial:a,total:i,commutative:a,associative:a}},f={divide:{total:a},log:{total:a}},o={subtract:{total:a},abs:{trivial:i},log:{total:i}};function u(b,A){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:c,S=s;if(typeof b=="string"?S=b:ut(b)?S=b.fn.toString():fn(b)?S=b.name:Zt(b)&&(S="paren"),$e(E,S)){var O=E[S];if($e(O,A))return O[A];if($e(c,S))return c[S][A]}if($e(E,s)){var F=E[s];return $e(F,A)?F[A]:c[s][A]}if($e(c,S)){var M=c[S];if($e(M,A))return M[A]}return c[s][A]}function p(b){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return u(b,"commutative",A)}function d(b){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return u(b,"associative",A)}function h(b,A){var E=x0({},b);for(var S in A)$e(b,S)?E[S]=x0(x0({},A[S]),b[S]):E[S]=A[S];return E}function x(b,A){if(!b.args||b.args.length===0)return b;b.args=v(b,A);for(var E=0;E2&&d(b,A)){for(var F=b.args.pop();b.args.length>0;)F=E([b.args.pop(),F]);b.args=F.args}}}function w(b,A){if(!(!b.args||b.args.length===0)){for(var E=C(b),S=b.args.length,O=0;O2&&d(b,A)){for(var F=b.args.shift();b.args.length>0;)F=E([F,b.args.shift()]);b.args=F.args}}}function C(b){return ut(b)?function(A){try{return new t(b.op,b.fn,A,b.implicit)}catch(E){return console.error(E),[]}}:function(A){return new r(new n(b.name),A)}}return{createMakeNodeFunction:C,hasProperty:u,isCommutative:p,isAssociative:d,mergeContext:h,flatten:x,allChildren:v,unflattenr:y,unflattenl:w,defaultContext:c,realContext:f,positiveContext:o}});var xW="simplify",yW=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],wF=T(xW,yW,e=>{var{config:r,typed:t,parse:n,add:i,subtract:a,multiply:s,divide:c,pow:f,isZero:o,equal:u,resolve:p,simplifyConstant:d,simplifyCore:h,fraction:x,bignumber:v,mathWithTransform:y,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:A,FunctionNode:E,IndexNode:S,ObjectNode:O,OperatorNode:F,ParenthesisNode:M,SymbolNode:_}=e,{hasProperty:k,isCommutative:L,isAssociative:Y,mergeContext:$,flatten:V,unflattenr:q,unflattenl:R,createMakeNodeFunction:j,defaultContext:U,realContext:oe,positiveContext:me}=pu({FunctionNode:E,OperatorNode:F,SymbolNode:_});t.addConversion({from:"Object",to:"Map",convert:Pa});var ie=t("simplify",{Node:xe,"Node, Map":(ee,ne)=>xe(ee,!1,ne),"Node, Map, Object":(ee,ne,ue)=>xe(ee,!1,ne,ue),"Node, Array":xe,"Node, Array, Map":xe,"Node, Array, Map, Object":xe});t.removeConversion({from:"Object",to:"Map",convert:Pa}),ie.defaultContext=U,ie.realContext=oe,ie.positiveContext=me;function H(ee){return ee.transform(function(ne,ue,Ee){return Zt(ne)?H(ne.content):ne})}var ce={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};ie.rules=[h,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},d,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},d,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function Me(ee,ne){var ue={};if(ee.s){var Ee=ee.s.split("->");if(Ee.length===2)ue.l=Ee[0],ue.r=Ee[1];else throw SyntaxError("Could not parse rule: "+ee.s)}else ue.l=ee.l,ue.r=ee.r;ue.l=H(n(ue.l)),ue.r=H(n(ue.r));for(var Ce of["imposeContext","repeat","assuming"])Ce in ee&&(ue[Ce]=ee[Ce]);if(ee.evaluate&&(ue.evaluate=n(ee.evaluate)),Y(ue.l,ne)){var Le=!L(ue.l,ne),Ie;Le&&(Ie=Se());var sr=j(ue.l),ir=Se();ue.expanded={},ue.expanded.l=sr([ue.l,ir]),V(ue.expanded.l,ne),q(ue.expanded.l,ne),ue.expanded.r=sr([ue.r,ir]),Le&&(ue.expandedNC1={},ue.expandedNC1.l=sr([Ie,ue.l]),ue.expandedNC1.r=sr([Ie,ue.r]),ue.expandedNC2={},ue.expandedNC2.l=sr([Ie,ue.expanded.l]),ue.expandedNC2.r=sr([Ie,ue.expanded.r]))}return ue}function pe(ee,ne){for(var ue=[],Ee=0;Ee2&&arguments[2]!==void 0?arguments[2]:ho(),Ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Ce=Ee.consoleDebug;ne=pe(ne||ie.rules,Ee.context);var Le=p(ee,ue);Le=H(Le);for(var Ie={},sr=Le.toString({parenthesis:"all"});!Ie[sr];){Ie[sr]=!0,ge=0;var ir=sr;Ce&&console.log("Working on: ",sr);for(var Xe=0;Xe ").concat(ne[Xe].r.toString()))),Ce){var re=Le.toString({parenthesis:"all"});re!==ir&&(console.log("Applying",Or,"produced",re),ir=re)}R(Le,Ee.context)}sr=Le.toString({parenthesis:"all"})}return Le}function be(ee,ne,ue){var Ee=ee;if(ee)for(var Ce=0;Ce1&&(ir=Le(ee.args.slice(0,sr))),Ce=ee.args.slice(sr),Ee=Ce.length===1?Ce[0]:Le(Ce),ue.push(Le([ir,Ee]))}return ue}function ze(ee,ne){var ue={placeholders:{}};if(!ee.placeholders&&!ne.placeholders)return ue;if(ee.placeholders){if(!ne.placeholders)return ee}else return ne;for(var Ee in ee.placeholders)if($e(ee.placeholders,Ee)&&(ue.placeholders[Ee]=ee.placeholders[Ee],$e(ne.placeholders,Ee)&&!ye(ee.placeholders[Ee],ne.placeholders[Ee])))return null;for(var Ce in ne.placeholders)$e(ne.placeholders,Ce)&&(ue.placeholders[Ce]=ne.placeholders[Ce]);return ue}function Ze(ee,ne){var ue=[];if(ee.length===0||ne.length===0)return ue;for(var Ee,Ce=0;Ce2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var ir=te(ee.args[0],ne.args[1],ue);if(ir.length===0)return[];var Xe=te(ee.args[1],ne.args[0],ue);if(Xe.length===0)return[];Le=[ir,Xe]}Ce=K(Le)}else if(ne.args.length>=2&&ee.args.length===2){for(var Or=Ae(ne,ue),re=[],le=0;le2)throw Error("Unexpected non-binary associative function: "+ee.toString());return[]}}else if(ee instanceof _){if(ee.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(ce[ee.name]){if(ee.name!==ne.name)return[]}else switch(ee.name[1]>="a"&&ee.name[1]<="z"?ee.name.substring(0,2):ee.name[0]){case"n":case"_p":Ce[0].placeholders[ee.name]=ne;break;case"c":case"cl":if(yr(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"v":if(!yr(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"vl":if(rt(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"cd":if(g0(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"vd":if(!g0(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"ce":if(Cf(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"ve":if(!Cf(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;default:throw new Error("Invalid symbol in rule: "+ee.name)}}else if(ee instanceof A){if(!u(ee.value,ne.value))return[]}else return[];return Ce}function ye(ee,ne){if(ee instanceof A&&ne instanceof A){if(!u(ee.value,ne.value))return!1}else if(ee instanceof _&&ne instanceof _){if(ee.name!==ne.name)return!1}else if(ee instanceof F&&ne instanceof F||ee instanceof E&&ne instanceof E){if(ee instanceof F){if(ee.op!==ne.op||ee.fn!==ne.fn)return!1}else if(ee instanceof E&&ee.name!==ne.name)return!1;if(ee.args.length!==ne.args.length)return!1;for(var ue=0;ue{var{typed:r,config:t,mathWithTransform:n,matrix:i,fraction:a,bignumber:s,AccessorNode:c,ArrayNode:f,ConstantNode:o,FunctionNode:u,IndexNode:p,ObjectNode:d,OperatorNode:h,SymbolNode:x}=e,{isCommutative:v,isAssociative:y,allChildren:w,createMakeNodeFunction:C}=pu({FunctionNode:u,OperatorNode:h,SymbolNode:x}),b=r("simplifyConstant",{Node:V=>O($(V,{})),"Node, Object":function(q,R){return O($(q,R))}});function A(V){return Xn(V)?V.valueOf():V instanceof Array?V.map(A):Ge(V)?i(A(V.valueOf())):V}function E(V,q,R){try{return n[V].apply(null,q)}catch{return q=q.map(A),M(n[V].apply(null,q),R)}}var S=r({Fraction:k,number:function(q){return q<0?_(new o(-q)):new o(q)},BigNumber:function(q){return q<0?_(new o(-q)):new o(q)},Complex:function(q){throw new Error("Cannot convert Complex number to Node")},string:function(q){return new o(q)},Matrix:function(q){return new f(q.valueOf().map(R=>S(R)))}});function O(V){return Sr(V)?V:S(V)}function F(V,q){var R=q&&q.exactFractions!==!1;if(R&&isFinite(V)&&a){var j=a(V),U=q&&typeof q.fractionsLimit=="number"?q.fractionsLimit:1/0;if(j.valueOf()===V&&j.n0;)if(yr(j[0])&&typeof j[0].value!="string"){var U=M(j.shift().value,R);$t(V)?V=V.items[U-1]:(V=V.valueOf()[U-1],V instanceof Array&&(V=i(V)))}else if(j.length>1&&yr(j[1])&&typeof j[1].value!="string"){var oe=M(j[1].value,R),me=[],ie=$t(V)?V.items:V.valueOf();for(var H of ie)if($t(H))me.push(H.items[oe-1]);else if(Ge(V))me.push(H[oe-1]);else break;if(me.length===ie.length)$t(V)?V=new f(me):V=i(me),j.splice(1,1);else break}else break;return j.length===q.dimensions.length?new c(O(V),q):j.length>0?(q=new p(j),new c(O(V),q)):V}if(fa(V)&&q.dimensions.length===1&&yr(q.dimensions[0])){var ce=q.dimensions[0].value;return ce in V.properties?V.properties[ce]:new o}return new c(O(V),q)}function Y(V,q,R,j){var U=q.shift(),oe=q.reduce((me,ie)=>{if(!Sr(ie)){var H=me.pop();if(Sr(H))return[H,ie];try{return me.push(E(V,[H,ie],j)),me}catch{me.push(H)}}me.push(O(me.pop()));var ce=me.length===1?me[0]:R(me);return[R([ce,O(ie)])]},[U]);return oe.length===1?oe[0]:R([oe[0],S(oe[1])])}function $(V,q){switch(V.type){case"SymbolNode":return V;case"ConstantNode":switch(typeof V.value){case"number":return M(V.value,q);case"string":return V.value;default:if(!isNaN(V.value))return M(V.value,q)}return V;case"FunctionNode":if(n[V.name]&&n[V.name].rawArgs)return V;{var R=["add","multiply"];if(R.indexOf(V.name)===-1){var j=V.args.map(De=>$(De,q));if(!j.some(Sr))try{return E(V.name,j,q)}catch{}if(V.name==="size"&&j.length===1&&$t(j[0])){for(var U=[],oe=j[0];$t(oe);)U.push(oe.items.length),oe=oe.items[0];return i(U)}return new u(V.name,j.map(O))}}case"OperatorNode":{var me=V.fn.toString(),ie,H,ce=C(V);if(ut(V)&&V.isUnary())ie=[$(V.args[0],q)],Sr(ie[0])?H=ce(ie):H=E(me,ie,q);else if(y(V,q.context))if(ie=w(V,q.context),ie=ie.map(De=>$(De,q)),v(me,q.context)){for(var Me=[],pe=[],ge=0;ge1?(H=Y(me,Me,ce,q),pe.unshift(H),H=Y(me,pe,ce,q)):H=Y(me,ie,ce,q)}else H=Y(me,ie,ce,q);else ie=V.args.map(De=>$(De,q)),H=Y(me,ie,ce,q);return H}case"ParenthesisNode":return $(V.content,q);case"AccessorNode":return L($(V.object,q),$(V.index,q),q);case"ArrayNode":{var Se=V.items.map(De=>$(De,q));return Se.some(Sr)?new f(Se.map(O)):i(Se)}case"IndexNode":return new p(V.dimensions.map(De=>b(De,q)));case"ObjectNode":{var xe={};for(var be in V.properties)xe[be]=b(V.properties[be],q);return new d(xe)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(V.type))}}return b});var SF="simplifyCore",DW=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],NF=T(SF,DW,e=>{var{typed:r,parse:t,equal:n,isZero:i,add:a,subtract:s,multiply:c,divide:f,pow:o,AccessorNode:u,ArrayNode:p,ConstantNode:d,FunctionNode:h,IndexNode:x,ObjectNode:v,OperatorNode:y,ParenthesisNode:w,SymbolNode:C}=e,b=new d(0),A=new d(1),E=new d(!0),S=new d(!1);function O(k){return ut(k)&&["and","not","or"].includes(k.op)}var{hasProperty:F,isCommutative:M}=pu({FunctionNode:h,OperatorNode:y,SymbolNode:C});function _(k){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=L?L.context:void 0;if(F(k,"trivial",Y)){if(fn(k)&&k.args.length===1)return _(k.args[0],L);var $=!1,V=0;if(k.forEach(pe=>{++V,V===1&&($=_(pe,L))}),V===1)return $}var q=k;if(fn(q)){var R=d2(q.name);if(R){if(q.args.length>2&&F(q,"associative",Y))for(;q.args.length>2;){var j=q.args.pop(),U=q.args.pop();q.args.push(new y(R,q.name,[j,U]))}q=new y(R,q.name,q.args)}else return new h(_(q.fn),q.args.map(pe=>_(pe,L)))}if(ut(q)&&q.isUnary()){var oe=_(q.args[0],L);if(q.op==="~"&&ut(oe)&&oe.isUnary()&&oe.op==="~"||q.op==="not"&&ut(oe)&&oe.isUnary()&&oe.op==="not"&&O(oe.args[0]))return oe.args[0];var me=!0;if(q.op==="-"&&ut(oe)&&(oe.isBinary()&&oe.fn==="subtract"&&(q=new y("-","subtract",[oe.args[1],oe.args[0]]),me=!1),oe.isUnary()&&oe.op==="-"))return oe.args[0];if(me)return new y(q.op,q.fn,[oe])}if(ut(q)&&q.isBinary()){var ie=_(q.args[0],L),H=_(q.args[1],L);if(q.op==="+"){if(yr(ie)&&i(ie.value))return H;if(yr(H)&&i(H.value))return ie;ut(H)&&H.isUnary()&&H.op==="-"&&(H=H.args[0],q=new y("-","subtract",[ie,H]))}if(q.op==="-")return ut(H)&&H.isUnary()&&H.op==="-"?_(new y("+","add",[ie,H.args[0]]),L):yr(ie)&&i(ie.value)?_(new y("-","unaryMinus",[H])):yr(H)&&i(H.value)?ie:new y(q.op,q.fn,[ie,H]);if(q.op==="*"){if(yr(ie)){if(i(ie.value))return b;if(n(ie.value,1))return H}if(yr(H)){if(i(H.value))return b;if(n(H.value,1))return ie;if(M(q,Y))return new y(q.op,q.fn,[H,ie],q.implicit)}return new y(q.op,q.fn,[ie,H],q.implicit)}if(q.op==="/")return yr(ie)&&i(ie.value)?b:yr(H)&&n(H.value,1)?ie:new y(q.op,q.fn,[ie,H]);if(q.op==="^"&&yr(H)){if(i(H.value))return A;if(n(H.value,1))return ie}if(q.op==="and"){if(yr(ie))if(ie.value){if(O(H))return H;if(yr(H))return H.value?E:S}else return S;if(yr(H))if(H.value){if(O(ie))return ie}else return S}if(q.op==="or"){if(yr(ie)){if(ie.value)return E;if(O(H))return H}if(yr(H)){if(H.value)return E;if(O(ie))return ie}}return new y(q.op,q.fn,[ie,H])}if(ut(q))return new y(q.op,q.fn,q.args.map(pe=>_(pe,L)));if($t(q))return new p(q.items.map(pe=>_(pe,L)));if(Sn(q))return new u(_(q.object,L),_(q.index,L));if(kn(q))return new x(q.dimensions.map(pe=>_(pe,L)));if(fa(q)){var ce={};for(var Me in q.properties)ce[Me]=_(q.properties[Me],L);return new v(ce)}return q}return r(SF,{Node:_,"Node,Object":_})});var SW="resolve",NW=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],AF=T(SW,NW,e=>{var{typed:r,parse:t,ConstantNode:n,FunctionNode:i,OperatorNode:a,ParenthesisNode:s}=e;function c(f,o){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!o)return f;if(rt(f)){if(u.has(f.name)){var p=Array.from(u).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(p,"}"))}var d=o.get(f.name);if(Sr(d)){var h=new Set(u);return h.add(f.name),c(d,o,h)}else return typeof d=="number"?t(String(d)):d!==void 0?new n(d):f}else if(ut(f)){var x=f.args.map(function(y){return c(y,o,u)});return new a(f.op,f.fn,x,f.implicit)}else{if(Zt(f))return new s(c(f.content,o,u));if(fn(f)){var v=f.args.map(function(y){return c(y,o,u)});return new i(f.name,v)}}return f.map(y=>c(y,o,u))}return r("resolve",{Node:c,"Node, Map | null | undefined":c,"Node, Object":(f,o)=>c(f,Pa(o)),"Array | Matrix":r.referToSelf(f=>o=>o.map(u=>f(u))),"Array | Matrix, null | undefined":r.referToSelf(f=>o=>o.map(u=>f(u))),"Array, Object":r.referTo("Array,Map",f=>(o,u)=>f(o,Pa(u))),"Matrix, Object":r.referTo("Matrix,Map",f=>(o,u)=>f(o,Pa(u))),"Array | Matrix, Map":r.referToSelf(f=>(o,u)=>o.map(p=>f(p,u)))})});var EF="symbolicEqual",AW=["parse","simplify","typed","OperatorNode"],CF=T(EF,AW,e=>{var{parse:r,simplify:t,typed:n,OperatorNode:i}=e;function a(s,c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=new i("-","subtract",[s,c]),u=t(o,{},f);return yr(u)&&!u.value}return n(EF,{"Node, Node":a,"Node, Node, Object":a})});var MF="derivative",EW=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],_F=T(MF,EW,e=>{var{typed:r,config:t,parse:n,simplify:i,equal:a,isZero:s,numeric:c,ConstantNode:f,FunctionNode:o,OperatorNode:u,ParenthesisNode:p,SymbolNode:d}=e;function h(b,A){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},S={};y(S,b,A.name);var O=w(b,S);return E.simplify?i(O):O}r.addConversion({from:"identifier",to:"SymbolNode",convert:n});var x=r(MF,{"Node, SymbolNode":h,"Node, SymbolNode, Object":h});r.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),x._simplify=!0,x.toTex=function(b){return v.apply(null,b.args)};var v=r("_derivTex",{"Node, SymbolNode":function(A,E){return yr(A)&&_r(A.value)==="string"?v(n(A.value).toString(),E.toString(),1):v(A.toTex(),E.toString(),1)},"Node, ConstantNode":function(A,E){if(_r(E.value)==="string")return v(A,n(E.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(A,E,S){return v(A.toString(),E.name,S.value)},"string, string, number":function(A,E,S){var O;return S===1?O="{d\\\\over d"+E+"}":O="{d^{"+S+"}\\\\over d"+E+"^{"+S+"}}",O+"\\\\left[".concat(A,"\\\\right]")}}),y=r("constTag",{"Object, ConstantNode, string":function(A,E){return A[E]=!0,!0},"Object, SymbolNode, string":function(A,E,S){return E.name!==S?(A[E]=!0,!0):!1},"Object, ParenthesisNode, string":function(A,E,S){return y(A,E.content,S)},"Object, FunctionAssignmentNode, string":function(A,E,S){return E.params.indexOf(S)===-1?(A[E]=!0,!0):y(A,E.expr,S)},"Object, FunctionNode | OperatorNode, string":function(A,E,S){if(E.args.length>0){for(var O=y(A,E.args[0],S),F=1;F0){var O=A.args.filter(function(V){return E[V]===void 0}),F=O.length===1?O[0]:new u("*","multiply",O),M=S.concat(w(F,E));return new u("*","multiply",M)}return new u("+","add",A.args.map(function(V){return new u("*","multiply",A.args.map(function(q){return q===V?w(q,E):q.clone()}))}))}if(A.op==="/"&&A.isBinary()){var _=A.args[0],k=A.args[1];return E[k]!==void 0?new u("/","divide",[w(_,E),k]):E[_]!==void 0?new u("*","multiply",[new u("-","unaryMinus",[_]),new u("/","divide",[w(k,E),new u("^","pow",[k.clone(),C(2)])])]):new u("/","divide",[new u("-","subtract",[new u("*","multiply",[w(_,E),k.clone()]),new u("*","multiply",[_.clone(),w(k,E)])]),new u("^","pow",[k.clone(),C(2)])])}if(A.op==="^"&&A.isBinary()){var L=A.args[0],Y=A.args[1];if(E[L]!==void 0)return yr(L)&&(s(L.value)||a(L.value,1))?C(0):new u("*","multiply",[A,new u("*","multiply",[new o("log",[L.clone()]),w(Y.clone(),E)])]);if(E[Y]!==void 0){if(yr(Y)){if(s(Y.value))return C(0);if(a(Y.value,1))return w(L,E)}var $=new u("^","pow",[L.clone(),new u("-","subtract",[Y,C(1)])]);return new u("*","multiply",[Y.clone(),new u("*","multiply",[w(L,E),$])])}return new u("*","multiply",[new u("^","pow",[L.clone(),Y.clone()]),new u("+","add",[new u("*","multiply",[w(L,E),new u("/","divide",[Y.clone(),L.clone()])]),new u("*","multiply",[w(Y,E),new o("log",[L.clone()])])])])}throw new Error('Cannot process operator "'+A.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function C(b,A){return new f(c(b,A||t.number))}return x});var TF="rationalize",CW=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],FF=T(TF,CW,e=>{var{config:r,typed:t,equal:n,isZero:i,add:a,subtract:s,multiply:c,divide:f,pow:o,parse:u,simplifyConstant:p,simplifyCore:d,simplify:h,fraction:x,bignumber:v,mathWithTransform:y,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:A,FunctionNode:E,IndexNode:S,ObjectNode:O,OperatorNode:F,SymbolNode:M,ParenthesisNode:_}=e;function k(q){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,U=Y(),oe=L(q,R,!0,U.firstRules),me=oe.variables.length,ie={exactFractions:!1},H={exactFractions:!0};if(q=oe.expression,me>=1){q=$(q);var ce,Me,pe=!0,ge=!1;q=h(q,U.firstRules,{},ie);for(var Se;Me=pe?U.distrDivRules:U.sucDivRules,q=h(q,Me,{},H),pe=!pe,Se=q.toString(),Se!==ce;)ge=!0,ce=Se;ge&&(q=h(q,U.firstRulesAgain,{},ie)),q=h(q,U.finalRules,{},ie)}var xe=[],be={};return q.type==="OperatorNode"&&q.isBinary()&&q.op==="/"?(me===1&&(q.args[0]=V(q.args[0],xe),q.args[1]=V(q.args[1])),j&&(be.numerator=q.args[0],be.denominator=q.args[1])):(me===1&&(q=V(q,xe)),j&&(be.numerator=q,be.denominator=null)),j?(be.coefficients=xe,be.variables=oe.variables,be.expression=q,be):q}return t(TF,{Node:k,"Node, boolean":(q,R)=>k(q,{},R),"Node, Object":k,"Node, Object, boolean":k});function L(q,R,j,U){var oe=[],me=h(q,U,R,{exactFractions:!1});j=!!j;var ie="+-*"+(j?"/":"");ce(me);var H={};return H.expression=me,H.variables=oe,H;function ce(Me){var pe=Me.type;if(pe==="FunctionNode")throw new Error("There is an unsolved function call");if(pe==="OperatorNode")if(Me.op==="^"){if(Me.args[1].type!=="ConstantNode"||!He(parseFloat(Me.args[1].value)))throw new Error("There is a non-integer exponent");ce(Me.args[0])}else{if(ie.indexOf(Me.op)===-1)throw new Error("Operator "+Me.op+" invalid in polynomial expression");for(var ge=0;ge1;if(U==="OperatorNode"&&q.isBinary()){var me=!1,ie;if(q.op==="^"&&(q.args[0].type==="ParenthesisNode"||q.args[0].type==="OperatorNode")&&q.args[1].type==="ConstantNode"&&(ie=parseFloat(q.args[1].value),me=ie>=2&&He(ie)),me){if(ie>2){var H=q.args[0],ce=new F("^","pow",[q.args[0].cloneDeep(),new A(ie-1)]);q=new F("*","multiply",[H,ce])}else q=new F("*","multiply",[q.args[0],q.args[0].cloneDeep()]);oe&&(j==="content"?R.content=q:R.args[j]=q)}}if(U==="ParenthesisNode")$(q.content,q,"content");else if(U!=="ConstantNode"&&U!=="SymbolNode")for(var Me=0;Me=0;H--)if(R[H]!==0){var ce=new A(me?R[H]:Math.abs(R[H])),Me=R[H]<0?"-":"+";if(H>0){var pe=new M(oe);if(H>1){var ge=new A(H);pe=new F("^","pow",[pe,ge])}R[H]===-1&&me?ce=new F("-","unaryMinus",[pe]):Math.abs(R[H])===1?ce=pe:ce=new F("*","multiply",[ce,pe])}me?ie=ce:Me==="+"?ie=new F("+","add",[ie,ce]):ie=new F("-","subtract",[ie,ce]),me=!1}if(me)return new A(0);return ie;function Se(xe,be,De){var Ae=xe.type;if(Ae==="FunctionNode")throw new Error("There is an unsolved function call");if(Ae==="OperatorNode"){if("+-*^".indexOf(xe.op)===-1)throw new Error("Operator "+xe.op+" invalid");if(be!==null){if((xe.fn==="unaryMinus"||xe.fn==="pow")&&be.fn!=="add"&&be.fn!=="subtract"&&be.fn!=="multiply")throw new Error("Invalid "+xe.op+" placing");if((xe.fn==="subtract"||xe.fn==="add"||xe.fn==="multiply")&&be.fn!=="add"&&be.fn!=="subtract")throw new Error("Invalid "+xe.op+" placing");if((xe.fn==="subtract"||xe.fn==="add"||xe.fn==="unaryMinus")&&De.noFil!==0)throw new Error("Invalid "+xe.op+" placing")}(xe.op==="^"||xe.op==="*")&&(De.fire=xe.op);for(var ze=0;zeU&&(R[Ze]=0),R[Ze]+=De.cte*(De.oper==="+"?1:-1),U=Math.max(Ze,U);return}De.cte=Ze,De.fire===""&&(R[0]+=De.cte*(De.oper==="+"?1:-1))}else throw new Error("Type "+Ae+" is not allowed")}}});var OF="zpk2tf",MW=["typed","add","multiply","Complex","number"],BF=T(OF,MW,e=>{var{typed:r,add:t,multiply:n,Complex:i,number:a}=e;return r(OF,{"Array,Array,number":function(o,u,p){return s(o,u,p)},"Array,Array":function(o,u){return s(o,u,1)},"Matrix,Matrix,number":function(o,u,p){return s(o.valueOf(),u.valueOf(),p)},"Matrix,Matrix":function(o,u){return s(o.valueOf(),u.valueOf(),1)}});function s(f,o,u){f.some(C=>C.type==="BigNumber")&&(f=f.map(C=>a(C))),o.some(C=>C.type==="BigNumber")&&(o=o.map(C=>a(C)));for(var p=[i(1,0)],d=[i(1,0)],h=0;h=0&&p-d{var{typed:r,add:t,multiply:n,Complex:i,divide:a,matrix:s}=e;return r(IF,{"Array, Array":function(u,p){var d=f(512);return c(u,p,d)},"Array, Array, Array":function(u,p,d){return c(u,p,d)},"Array, Array, number":function(u,p,d){if(d<0)throw new Error("w must be a positive number");var h=f(d);return c(u,p,h)},"Matrix, Matrix":function(u,p){var d=f(512),{w:h,h:x}=c(u.valueOf(),p.valueOf(),d);return{w:s(h),h:s(x)}},"Matrix, Matrix, Matrix":function(u,p,d){var{h}=c(u.valueOf(),p.valueOf(),d.valueOf());return{h:s(h),w:s(d)}},"Matrix, Matrix, number":function(u,p,d){if(d<0)throw new Error("w must be a positive number");var h=f(d),{h:x}=c(u.valueOf(),p.valueOf(),h);return{h:s(x),w:s(h)}}});function c(o,u,p){for(var d=[],h=[],x=0;x{var{classes:r}=e;return function(n,i){var a=r[i&&i.mathjs];return a&&typeof a.fromJSON=="function"?a.fromJSON(i):i}});var OW="replacer",BW=[],RF=T(OW,BW,()=>function(r,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:t});var LF="12.4.1";var qF=T("true",[],()=>!0),UF=T("false",[],()=>!1),zF=T("null",[],()=>null),WF=ei("Infinity",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1/0):1/0}),VF=ei("NaN",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(NaN):NaN}),YF=ei("pi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?Nf(t):Ky}),HF=ei("tau",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?FS(t):jy}),GF=ei("e",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?_S(t):e1}),$F=ei("phi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?TS(t):r1}),ZF=ei("LN2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).ln():Math.LN2}),QF=ei("LN10",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(10).ln():Math.LN10}),XF=ei("LOG2E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(2).ln()):Math.LOG2E}),JF=ei("LOG10E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(10).ln()):Math.LOG10E}),KF=ei("SQRT1_2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t("0.5").sqrt():Math.SQRT1_2}),jF=ei("SQRT2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).sqrt():Math.SQRT2}),e3=ei("i",["Complex"],e=>{var{Complex:r}=e;return r.I}),r3=T("PI",["pi"],e=>{var{pi:r}=e;return r}),t3=T("E",["e"],e=>{var{e:r}=e;return r}),n3=T("version",[],()=>LF);function ei(e,r,t){return T(e,r,t,{recreateOnConfigChange:!0})}var i3=Cr("speedOfLight","299792458","m s^-1"),a3=Cr("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),o3=Cr("planckConstant","6.62607015e-34","J s"),s3=Cr("reducedPlanckConstant","1.0545718176461565e-34","J s"),u3=Cr("magneticConstant","1.25663706212e-6","N A^-2"),f3=Cr("electricConstant","8.8541878128e-12","F m^-1"),l3=Cr("vacuumImpedance","376.730313667","ohm"),c3=Cr("coulomb","8.987551792261171e9","N m^2 C^-2"),p3=Cr("elementaryCharge","1.602176634e-19","C"),m3=Cr("bohrMagneton","9.2740100783e-24","J T^-1"),d3=Cr("conductanceQuantum","7.748091729863649e-5","S"),h3=Cr("inverseConductanceQuantum","12906.403729652257","ohm"),v3=Cr("magneticFluxQuantum","2.0678338484619295e-15","Wb"),g3=Cr("nuclearMagneton","5.0507837461e-27","J T^-1"),x3=Cr("klitzing","25812.807459304513","ohm");var y3=Cr("bohrRadius","5.29177210903e-11","m"),b3=Cr("classicalElectronRadius","2.8179403262e-15","m"),w3=Cr("electronMass","9.1093837015e-31","kg"),D3=Cr("fermiCoupling","1.1663787e-5","GeV^-2"),S3=Up("fineStructure",.0072973525693),N3=Cr("hartreeEnergy","4.3597447222071e-18","J"),A3=Cr("protonMass","1.67262192369e-27","kg"),E3=Cr("deuteronMass","3.3435830926e-27","kg"),C3=Cr("neutronMass","1.6749271613e-27","kg"),M3=Cr("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),_3=Cr("rydberg","10973731.568160","m^-1"),T3=Cr("thomsonCrossSection","6.6524587321e-29","m^2"),F3=Up("weakMixingAngle",.2229),O3=Up("efimovFactor",22.7),B3=Cr("atomicMass","1.66053906660e-27","kg"),I3=Cr("avogadro","6.02214076e23","mol^-1"),P3=Cr("boltzmann","1.380649e-23","J K^-1"),k3=Cr("faraday","96485.33212331001","C mol^-1"),R3=Cr("firstRadiation","3.7417718521927573e-16","W m^2"),L3=Cr("loschmidt","2.686780111798444e25","m^-3"),q3=Cr("gasConstant","8.31446261815324","J K^-1 mol^-1"),U3=Cr("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),z3=Cr("molarVolume","0.022413969545014137","m^3 mol^-1"),W3=Up("sackurTetrode",-1.16487052358),V3=Cr("secondRadiation","0.014387768775039337","m K"),Y3=Cr("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),H3=Cr("wienDisplacement","2.897771955e-3","m K"),G3=Cr("molarMass","0.99999999965e-3","kg mol^-1"),$3=Cr("molarMassC12","11.9999999958e-3","kg mol^-1"),Z3=Cr("gravity","9.80665","m s^-2"),Q3=Cr("planckLength","1.616255e-35","m"),X3=Cr("planckMass","2.176435e-8","kg"),J3=Cr("planckTime","5.391245e-44","s"),K3=Cr("planckCharge","1.87554603778e-18","C"),j3=Cr("planckTemperature","1.416785e+32","K");function Cr(e,r,t){var n=["config","Unit","BigNumber"];return T(e,n,i=>{var{config:a,Unit:s,BigNumber:c}=i,f=a.number==="BigNumber"?new c(r):parseFloat(r),o=new s(f,t);return o.fixPrefix=!0,o})}function Up(e,r){var t=["config","BigNumber"];return T(e,t,n=>{var{config:i,BigNumber:a}=n;return i.number==="BigNumber"?new a(r):r})}var IW="apply",PW=["typed","isInteger"],eO=T(IW,PW,e=>{var{typed:r,isInteger:t}=e,n=nu({typed:r,isInteger:t});return r("apply",{"...any":function(a){var s=a[1];ar(s)?a[1]=s-1:je(s)&&(a[1]=s.minus(1));try{return n.apply(null,a)}catch(c){throw lt(c)}}})},{isTransformFunction:!0});var kW="column",RW=["typed","Index","matrix","range"],rO=T(kW,RW,e=>{var{typed:r,Index:t,matrix:n,range:i}=e,a=Yc({typed:r,Index:t,matrix:n,range:i});return r("column",{"...any":function(c){var f=c.length-1,o=c[f];ar(o)&&(c[f]=o-1);try{return a.apply(null,c)}catch(u){throw lt(u)}}})},{isTransformFunction:!0});function mu(e,r,t){var n=e.filter(function(f){return rt(f)&&!(f.name in r)&&!t.has(f.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,a=new Map,s=new Js(t,a,new Set([i])),c=e.compile();return function(o){return a.set(i,o),c.evaluate(s)}}var LW="filter",qW=["typed"],nO=T(LW,qW,e=>{var{typed:r}=e;function t(i,a,s){var c,f;return i[0]&&(c=i[0].compile().evaluate(s)),i[1]&&(rt(i[1])||mi(i[1])?f=i[1].compile().evaluate(s):f=mu(i[1],a,s)),n(c,f)}t.rawArgs=!0;var n=r("filter",{"Array, function":tO,"Matrix, function":function(a,s){return a.create(tO(a.toArray(),s))},"Array, RegExp":Qs,"Matrix, RegExp":function(a,s){return a.create(Qs(a.toArray(),s))}});return t},{isTransformFunction:!0});function tO(e,r){return bc(e,function(t,n,i){return gi(r,t,[n+1],i,"filter")})}var UW="forEach",zW=["typed"],iO=T(UW,zW,e=>{var{typed:r}=e;function t(i,a,s){var c,f;return i[0]&&(c=i[0].compile().evaluate(s)),i[1]&&(rt(i[1])||mi(i[1])?f=i[1].compile().evaluate(s):f=mu(i[1],a,s)),n(c,f)}t.rawArgs=!0;var n=r("forEach",{"Array | Matrix, function":function(a,s){var c=function f(o,u){if(Array.isArray(o))po(o,function(p,d){f(p,u.concat(d+1))});else return gi(s,o,u,a,"forEach")};c(a.valueOf(),[])}});return t},{isTransformFunction:!0});var WW="index",VW=["Index","getMatrixDataType"],aO=T(WW,VW,e=>{var{Index:r,getMatrixDataType:t}=e;return function(){for(var i=[],a=0,s=arguments.length;a0?0:2;else if(c&&c.isSet===!0)c=c.map(function(o){return o-1});else if(Ar(c)||Ge(c))t(c)!=="boolean"&&(c=c.map(function(o){return o-1}));else if(ar(c))c--;else if(je(c))c=c.toNumber()-1;else if(typeof c!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");i[a]=c}var f=new r;return r.apply(f,i),f}},{isTransformFunction:!0});var YW="map",HW=["typed"],sO=T(YW,HW,e=>{var{typed:r}=e;function t(i,a,s){var c,f;return i[0]&&(c=i[0].compile().evaluate(s)),i[1]&&(rt(i[1])||mi(i[1])?f=i[1].compile().evaluate(s):f=mu(i[1],a,s)),n(c,f)}t.rawArgs=!0;var n=r("map",{"Array, function":function(a,s){return oO(a,s,a)},"Matrix, function":function(a,s){return a.create(oO(a.valueOf(),s,a))}});return t},{isTransformFunction:!0});function oO(e,r,t){function n(i,a){return Array.isArray(i)?Rn(i,function(s,c){return n(s,a.concat(c+1))}):gi(r,i,a,t,"map")}return n(e,[])}function vn(e){if(e.length===2&&bt(e[0])){e=e.slice();var r=e[1];ar(r)?e[1]=r-1:je(r)&&(e[1]=r.minus(1))}return e}var GW="max",$W=["typed","config","numeric","larger"],uO=T(GW,$W,e=>{var{typed:r,config:t,numeric:n,larger:i}=e,a=sp({typed:r,config:t,numeric:n,larger:i});return r("max",{"...any":function(c){c=vn(c);try{return a.apply(null,c)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var ZW="mean",QW=["typed","add","divide"],fO=T(ZW,QW,e=>{var{typed:r,add:t,divide:n}=e,i=Pp({typed:r,add:t,divide:n});return r("mean",{"...any":function(s){s=vn(s);try{return i.apply(null,s)}catch(c){throw lt(c)}}})},{isTransformFunction:!0});var XW="min",JW=["typed","config","numeric","smaller"],lO=T(XW,JW,e=>{var{typed:r,config:t,numeric:n,smaller:i}=e,a=up({typed:r,config:t,numeric:n,smaller:i});return r("min",{"...any":function(c){c=vn(c);try{return a.apply(null,c)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var KW="range",jW=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],cO=T(KW,jW,e=>{var{typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:c,largerEq:f,add:o,isPositive:u}=e,p=Zc({typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:c,largerEq:f,add:o,isPositive:u});return r("range",{"...any":function(h){var x=h.length-1,v=h[x];return typeof v!="boolean"&&h.push(!0),p.apply(null,h)}})},{isTransformFunction:!0});var eV="row",rV=["typed","Index","matrix","range"],pO=T(eV,rV,e=>{var{typed:r,Index:t,matrix:n,range:i}=e,a=Qc({typed:r,Index:t,matrix:n,range:i});return r("row",{"...any":function(c){var f=c.length-1,o=c[f];ar(o)&&(c[f]=o-1);try{return a.apply(null,c)}catch(u){throw lt(u)}}})},{isTransformFunction:!0});var tV="subset",nV=["typed","matrix","zeros","add"],mO=T(tV,nV,e=>{var{typed:r,matrix:t,zeros:n,add:i}=e,a=Xc({typed:r,matrix:t,zeros:n,add:i});return r("subset",{"...any":function(c){try{return a.apply(null,c)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var iV="concat",aV=["typed","matrix","isInteger"],dO=T(iV,aV,e=>{var{typed:r,matrix:t,isInteger:n}=e,i=Vc({typed:r,matrix:t,isInteger:n});return r("concat",{"...any":function(s){var c=s.length-1,f=s[c];ar(f)?s[c]=f-1:je(f)&&(s[c]=f.minus(1));try{return i.apply(null,s)}catch(o){throw lt(o)}}})},{isTransformFunction:!0});var hO="diff",oV=["typed","matrix","subtract","number","bignumber"],vO=T(hO,oV,e=>{var{typed:r,matrix:t,subtract:n,number:i,bignumber:a}=e,s=Hc({typed:r,matrix:t,subtract:n,number:i,bignumber:a});return r(hO,{"...any":function(f){f=vn(f);try{return s.apply(null,f)}catch(o){throw lt(o)}}})},{isTransformFunction:!0});var sV="std",uV=["typed","map","sqrt","variance"],gO=T(sV,uV,e=>{var{typed:r,map:t,sqrt:n,variance:i}=e,a=Lp({typed:r,map:t,sqrt:n,variance:i});return r("std",{"...any":function(c){c=vn(c);try{return a.apply(null,c)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var xO="sum",fV=["typed","config","add","numeric"],yO=T(xO,fV,e=>{var{typed:r,config:t,add:n,numeric:i}=e,a=Op({typed:r,config:t,add:n,numeric:i});return r(xO,{"...any":function(c){c=vn(c);try{return a.apply(null,c)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var lV="quantileSeq",cV=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],bO=T(lV,cV,e=>{var{typed:r,bignumber:t,add:n,subtract:i,divide:a,multiply:s,partitionSelect:c,compare:f,isInteger:o,smaller:u,smallerEq:p,larger:d}=e,h=Rp({typed:r,bignumber:t,add:n,subtract:i,divide:a,multiply:s,partitionSelect:c,compare:f,isInteger:o,smaller:u,smallerEq:p,larger:d});return r("quantileSeq",{"Array | Matrix, number | BigNumber":h,"Array | Matrix, number | BigNumber, number":(v,y,w)=>h(v,y,x(w)),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(v,y,w,C)=>h(v,y,w,x(C)),"Array | Matrix, Array | Matrix":h,"Array | Matrix, Array | Matrix, number":(v,y,w)=>h(v,y,x(w)),"Array | Matrix, Array | Matrix, boolean":h,"Array | Matrix, Array | Matrix, boolean, number":(v,y,w,C)=>h(v,y,w,x(C))});function x(v){return vn([[],v])[1]}},{isTransformFunction:!0});var wO="cumsum",pV=["typed","add","unaryPlus"],DO=T(wO,pV,e=>{var{typed:r,add:t,unaryPlus:n}=e,i=Ip({typed:r,add:t,unaryPlus:n});return r(wO,{"...any":function(s){if(s.length===2&&bt(s[0])){var c=s[1];ar(c)?s[1]=c-1:je(c)&&(s[1]=c.minus(1))}try{return i.apply(null,s)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var SO="variance",mV=["typed","add","subtract","multiply","divide","apply","isNaN"],NO=T(SO,mV,e=>{var{typed:r,add:t,subtract:n,multiply:i,divide:a,apply:s,isNaN:c}=e,f=kp({typed:r,add:t,subtract:n,multiply:i,divide:a,apply:s,isNaN:c});return r(SO,{"...any":function(u){u=vn(u);try{return f.apply(null,u)}catch(p){throw lt(p)}}})},{isTransformFunction:!0});var AO="print",dV=["typed","matrix","zeros","add"],EO=T(AO,dV,e=>{var{typed:r,matrix:t,zeros:n,add:i}=e,a=Kc({typed:r,matrix:t,zeros:n,add:i});return r(AO,{"string, Object | Array":function(f,o){return a(s(f),o)},"string, Object | Array, number | Object":function(f,o,u){return a(s(f),o,u)}});function s(c){return c.replace(Jc,f=>{var o=f.slice(1).split("."),u=o.map(function(p){return!isNaN(p)&&p.length>0?parseInt(p)-1:p});return"$"+u.join(".")})}},{isTransformFunction:!0});var hV="and",vV=["typed","matrix","zeros","add","equalScalar","not","concat"],CO=T(hV,vV,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s}=e,c=jc({typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s});function f(o,u,p){var d=o[0].compile().evaluate(p);if(!bt(d)&&!c(d,!0))return!1;var h=o[1].compile().evaluate(p);return c(d,h)}return f.rawArgs=!0,f},{isTransformFunction:!0});var gV="or",xV=["typed","matrix","equalScalar","DenseMatrix","concat"],MO=T(gV,xV,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=Wc({typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a});function c(f,o,u){var p=f[0].compile().evaluate(u);if(!bt(p)&&s(p,!1))return!0;var d=f[1].compile().evaluate(u);return s(p,d)}return c.rawArgs=!0,c},{isTransformFunction:!0});var yV="bitAnd",bV=["typed","matrix","zeros","add","equalScalar","not","concat"],_O=T(yV,bV,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s}=e,c=Uc({typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s});function f(o,u,p){var d=o[0].compile().evaluate(p);if(!bt(d)){if(isNaN(d))return NaN;if(d===0||d===!1)return 0}var h=o[1].compile().evaluate(p);return c(d,h)}return f.rawArgs=!0,f},{isTransformFunction:!0});var wV="bitOr",DV=["typed","matrix","equalScalar","DenseMatrix","concat"],TO=T(wV,DV,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=zc({typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a});function c(f,o,u){var p=f[0].compile().evaluate(u);if(!bt(p)){if(isNaN(p))return NaN;if(p===-1)return-1;if(p===!0)return 1}var d=f[1].compile().evaluate(u);return s(p,d)}return c.rawArgs=!0,c},{isTransformFunction:!0});var b0=y0;var PO=ci(mc(),1);var OO=ci(FO(),1);function BO(e){var r=new OO.default;return e.on=r.on.bind(r),e.off=r.off.bind(r),e.once=r.once.bind(r),e.emit=r.emit.bind(r),e}function IO(e,r,t,n){function i(y,w){var C=arguments.length;if(C!==1&&C!==2)throw new jn("import",C,1,2);w||(w={});function b(O,F,M){if(Array.isArray(F))F.forEach(L=>b(O,L));else if(typeof F=="object")for(var _ in F)$e(F,_)&&b(O,F[_],_);else if(jo(F)||M!==void 0){var k=jo(F)?x(F)?F.fn+".transform":F.fn:M;if($e(O,k)&&O[k]!==F&&!w.silent)throw new Error('Cannot import "'+k+'" twice');O[k]=F}else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}var A={};b(A,y);for(var E in A)if($e(A,E)){var S=A[E];if(jo(S))o(S,w);else if(u(S))a(E,S,w);else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}}function a(y,w,C){if(C.wrap&&typeof w=="function"&&(w=f(w)),p(w)&&(w=e(y,{[w.signature]:w})),e.isTypedFunction(t[y])&&e.isTypedFunction(w)){C.override?w=e(y,w.signatures):w=e(t[y],w),t[y]=w,delete n[y],s(y,w),t.emit("import",y,function(){return w});return}if(t[y]===void 0||C.override){t[y]=w,delete n[y],s(y,w),t.emit("import",y,function(){return w});return}if(!C.silent)throw new Error('Cannot import "'+y+'": already exists')}function s(y,w){w&&typeof w.transform=="function"?(t.expression.transform[y]=w.transform,d(y)&&(t.expression.mathWithTransform[y]=w.transform)):(delete t.expression.transform[y],d(y)&&(t.expression.mathWithTransform[y]=w))}function c(y){delete t.expression.transform[y],d(y)?t.expression.mathWithTransform[y]=t[y]:delete t.expression.mathWithTransform[y]}function f(y){var w=function(){for(var b=[],A=0,E=arguments.length;A2&&arguments[2]!==void 0?arguments[2]:y.fn;if(kh(C,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(C));var b=x(y)?t.expression.transform:t,A=C in t.expression.transform,E=$e(b,C)?b[C]:void 0,S=function(){var F={};y.dependencies.map(qh).forEach(_=>{if(kh(_,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(_));_==="math"?F.math=t:_==="mathWithTransform"?F.mathWithTransform=t.expression.mathWithTransform:_==="classes"?F.classes=t:F[_]=t[_]});var M=y(F);if(M&&typeof M.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(E===void 0||w.override)return M;if(e.isTypedFunction(E)&&e.isTypedFunction(M))return e(E,M);if(w.silent)return E;throw new Error('Cannot import "'+C+'": already exists')};!y.meta||y.meta.lazy!==!1?(Hs(b,C,S),E&&A?c(C):(x(y)||h(y))&&Hs(t.expression.mathWithTransform,C,()=>b[C])):(b[C]=S(),E&&A?c(C):(x(y)||h(y))&&Hs(t.expression.mathWithTransform,C,()=>b[C])),n[C]=y,t.emit("import",C,S)}function u(y){return typeof y=="function"||typeof y=="number"||typeof y=="string"||typeof y=="boolean"||y===null||qt(y)||Gt(y)||je(y)||Xn(y)||Ge(y)||Array.isArray(y)}function p(y){return typeof y=="function"&&typeof y.signature=="string"}function d(y){return!$e(v,y)}function h(y){return y.fn.indexOf(".")===-1&&!$e(v,y.fn)&&(!y.meta||!y.meta.isClass)}function x(y){return y!==void 0&&y.meta!==void 0&&y.meta.isTransformFunction===!0||!1}var v={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return i}function zp(e,r){var t=Mt({},jl,r);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var n=BO({isNumber:ar,isComplex:Gt,isBigNumber:je,isFraction:Xn,isUnit:qt,isString:yt,isArray:Ar,isMatrix:Ge,isCollection:bt,isDenseMatrix:Ba,isSparseMatrix:Jn,isRange:co,isIndex:sa,isBoolean:ec,isResultSet:rc,isHelp:Ws,isFunction:tc,isDate:nc,isRegExp:ic,isObject:ua,isNull:ac,isUndefined:oc,isAccessorNode:Sn,isArrayNode:$t,isAssignmentNode:sc,isBlockNode:uc,isConditionalNode:fc,isConstantNode:yr,isFunctionAssignmentNode:mi,isFunctionNode:fn,isIndexNode:kn,isNode:Sr,isObjectNode:fa,isOperatorNode:ut,isParenthesisNode:Zt,isRangeNode:lc,isRelationalNode:cc,isSymbolNode:rt,isChain:Vs});n.config=Wx(t,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var i=[],a=[];function s(u){if(jo(u))return u(n);var p=u[Object.keys(u)[0]];if(jo(p))return p(n);if(!Rx(u))throw console.warn("Factory object with properties \`type\`, \`name\`, and \`factory\` expected",u),new Error("Factory object with properties \`type\`, \`name\`, and \`factory\` expected");var d=i.indexOf(u),h;return d===-1?(u.math===!0?h=u.factory(n.type,t,s,n.typed,n):h=u.factory(n.type,t,s,n.typed),i.push(u),a.push(h)):h=a[d],h}var c={};function f(){for(var u=arguments.length,p=new Array(u),d=0;d{Eh(c).forEach(u=>{u&&u.meta&&u.meta.recreateOnConfigChange&&o(u,{override:!0})})}),n.create=zp.bind(null,e),n.factory=T,n.import(Eh(Px(e))),n.ArgumentsError=jn,n.DimensionError=pr,n.IndexError=Xt,n}var hu=ci(S0());var kO=(e,r,t)=>{if(e.length!==1)return"";let n=e.map(function(s){return s.compile().evaluate(t)}),i=t.get(n[0]),a=t.get("$properties")?.[n[0]]?.type;return(a=="file"||a=="link"||a=="context")&&(a.includes("multi")?i=Xo(i).map(s=>t.get("$paths").get(s)??s):i=t.get("$paths").get(i)??i),i??""};kO.rawArgs=!0;var RO=(e,r,t)=>{if((e.length-1)%2!==0)return"";for(let n=0;n{if(e.length<1||e.length>2)return"";let n=e[0].compile().evaluate(t);n instanceof Date||(n=new Date(n));let i=e[1]?.compile().evaluate(t);return i?.length>0?Oa(n,i):Oa(n,t.get("$settings")?.dateFormat??"yyyy-MM-dd")};LO.rawArgs=!0;var ri=e=>typeof e=="string"||e instanceof String?e:e instanceof Date?Oa(e,"yyyy-MM-dd"):typeof e=="number"?e.toFixed(2):e.path?e.path:"",qO={prop:kO,slice:(e,r,t)=>(e=ri(e),e.slice(r,t)),if:(e,r,t)=>e===!0?r:t,ifs:RO,empty:e=>e.length!==1?"":e[0]===""?"true":"false",length:e=>e.length,substring:(e,r,t)=>(e=ri(e),t?e.substring(r,t):e.substring(r)),contains:(e,r)=>(e=ri(e),r=ri(r),e.includes(r)),test:(e,r)=>(e=ri(e),new RegExp(r).test(e)),match:(e,r)=>(e=ri(e),e.match(new RegExp(r))),replace:(e,r,t)=>(e=ri(e),e.replace(new RegExp(r),t)),replaceAll:(e,r,t)=>(e=ri(e),r=ri(r),t=ri(t),e.replace(new RegExp(r,"g"),t)),lower:e=>(e=ri(e),e.toLowerCase()),upper:e=>(e=ri(e),e.toUpperCase()),repeat:(e,r)=>e.repeat(r),format:ri,toNumber:e=>e instanceof Date?e.getTime():typeof e=="string"?parseFloat(e):e,now:()=>new Date,minute:e=>e.getMinutes(),hour:e=>e.getHours(),day:e=>e.getDay(),date:e=>e.getDate(),week:e=>Oa(e,"w"),month:e=>e.getMonth()+1,year:e=>e.getFullYear(),dateAdd:(e,r,t)=>(t==="days"&&e.setDate(e.getDate()+r),t==="months"&&e.setMonth(e.getMonth()+r),t==="years"&&e.setFullYear(e.getFullYear()+r),t==="quarters"&&e.setMonth(e.getMonth()+r*3),t==="weeks"&&e.setDate(e.getDate()+r*7),t==="hours"&&e.setHours(e.getHours()+r),t==="minutes"&&e.setMinutes(e.getMinutes()+r),t==="seconds"&&e.setSeconds(e.getSeconds()+r),e),dateSubtract:(e,r,t)=>(t==="day"&&e.setDate(e.getDate()-r),t==="month"&&e.setMonth(e.getMonth()-r),t==="year"&&e.setFullYear(e.getFullYear()-r),t==="quarter"&&e.setMonth(e.getMonth()-r*3),t==="week"&&e.setDate(e.getDate()-r*7),t==="hour"&&e.setHours(e.getHours()-r),t==="minute"&&e.setMinutes(e.getMinutes()-r),t==="second"&&e.setSeconds(e.getSeconds()-r),e),dateBetween:(e,r,t)=>{let s=Math.abs(r.getTime()-e.getTime());switch(t){case"days":return Math.round(s/864e5);case"months":return Math.round(s/2592e6);case"years":return Math.round(s/31536e6);case"hours":return Math.round(s/(60*60*1e3));case"minutes":return Math.round(s/(60*1e3));case"seconds":return Math.round(s/1e3);case"weeks":return Math.round(s/(864e5*7));case"quarters":return Math.round(s/(2592e6*3));default:return Math.round(s/864e5)}},style:(e,r)=>e,timeStamp:e=>e.getTime(),formatDate:LO,parseDate:e=>(0,hu.isNumber)(e)?new Date(e):(0,hu.isString)(e)?new Date(e):(0,hu.isDate)(e)?e:""};var UO=(e,r,t,n)=>{if(!r)return"";let i=new Map;Object.keys(n).forEach(f=>i.set(f,n[f])),i.set("$properties",t),i.set("$paths",e);let a={...b0,createAdd:T("add",[],()=>function(o,u){return o+u})},s=zp(a);s.import(qO,{override:!0});let c;try{c=s.evaluate(r,i),c=Mx("",c)}catch{}return c};var zO=(e,r,t)=>({...r,...t.filter(n=>n.type=="fileprop"||n.name=="tags").reduce((n,i)=>{let{value:a}=Kl(i.value,i.type);return{...n,[i.name]:UO(e,a,t.reduce((s,c)=>({...s,[c.name]:c}),{}),r)}},{})});var NV=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],$O=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],AV="\\u200C\\u200D\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0898-\\u089F\\u08CA-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EBC\\u0EC8-\\u0ECE\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u180F-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1ABF-\\u1ACE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\u30FB\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F\\uFF65",ZO="\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309B-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC",N0={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},A0="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",EV={5:A0,"5module":A0+" export import",6:A0+" const class extends export import super"},CV=/^in(stanceof)?$/,MV=new RegExp("["+ZO+"]"),_V=new RegExp("["+ZO+AV+"]");function C0(e,r){for(var t=65536,n=0;ne)return!1;if(t+=r[n+1],t>=e)return!0}return!1}function Ua(e,r){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&MV.test(String.fromCharCode(e)):r===!1?!1:C0(e,$O)}function vu(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&_V.test(String.fromCharCode(e)):r===!1?!1:C0(e,$O)||C0(e,NV)}var tt=function(r,t){t===void 0&&(t={}),this.label=r,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function bi(e,r){return new tt(e,{beforeExpr:!0,binop:r})}var wi={beforeExpr:!0},zn={startsExpr:!0},T0={};function $r(e,r){return r===void 0&&(r={}),r.keyword=e,T0[e]=new tt(e,r)}var X={num:new tt("num",zn),regexp:new tt("regexp",zn),string:new tt("string",zn),name:new tt("name",zn),privateId:new tt("privateId",zn),eof:new tt("eof"),bracketL:new tt("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new tt("]"),braceL:new tt("{",{beforeExpr:!0,startsExpr:!0}),braceR:new tt("}"),parenL:new tt("(",{beforeExpr:!0,startsExpr:!0}),parenR:new tt(")"),comma:new tt(",",wi),semi:new tt(";",wi),colon:new tt(":",wi),dot:new tt("."),question:new tt("?",wi),questionDot:new tt("?."),arrow:new tt("=>",wi),template:new tt("template"),invalidTemplate:new tt("invalidTemplate"),ellipsis:new tt("...",wi),backQuote:new tt("\`",zn),dollarBraceL:new tt("\${",{beforeExpr:!0,startsExpr:!0}),eq:new tt("=",{beforeExpr:!0,isAssign:!0}),assign:new tt("_=",{beforeExpr:!0,isAssign:!0}),incDec:new tt("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new tt("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:bi("||",1),logicalAND:bi("&&",2),bitwiseOR:bi("|",3),bitwiseXOR:bi("^",4),bitwiseAND:bi("&",5),equality:bi("==/!=/===/!==",6),relational:bi("/<=/>=",7),bitShift:bi("<>/>>>",8),plusMin:new tt("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:bi("%",10),star:bi("*",10),slash:bi("/",10),starstar:new tt("**",{beforeExpr:!0}),coalesce:bi("??",1),_break:$r("break"),_case:$r("case",wi),_catch:$r("catch"),_continue:$r("continue"),_debugger:$r("debugger"),_default:$r("default",wi),_do:$r("do",{isLoop:!0,beforeExpr:!0}),_else:$r("else",wi),_finally:$r("finally"),_for:$r("for",{isLoop:!0}),_function:$r("function",zn),_if:$r("if"),_return:$r("return",wi),_switch:$r("switch"),_throw:$r("throw",wi),_try:$r("try"),_var:$r("var"),_const:$r("const"),_while:$r("while",{isLoop:!0}),_with:$r("with"),_new:$r("new",{beforeExpr:!0,startsExpr:!0}),_this:$r("this",zn),_super:$r("super",zn),_class:$r("class",zn),_extends:$r("extends",wi),_export:$r("export"),_import:$r("import",zn),_null:$r("null",zn),_true:$r("true",zn),_false:$r("false",zn),_in:$r("in",{beforeExpr:!0,binop:7}),_instanceof:$r("instanceof",{beforeExpr:!0,binop:7}),_typeof:$r("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:$r("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:$r("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Ni=/\\r\\n?|\\n|\\u2028|\\u2029/,TV=new RegExp(Ni.source,"g");function gu(e){return e===10||e===13||e===8232||e===8233}function QO(e,r,t){t===void 0&&(t=e.length);for(var n=r;n>10)+55296,(e&1023)+56320))}var BV=/(?:[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/,Tf=function(r,t){this.line=r,this.column=t};Tf.prototype.offset=function(r){return new Tf(this.line,this.column+r)};var Gp=function(r,t,n){this.start=t,this.end=n,r.sourceFile!==null&&(this.source=r.sourceFile)};function KO(e,r){for(var t=1,n=0;;){var i=QO(e,n,r);if(i<0)return new Tf(t,r-n);++t,n=i}}var M0={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},YO=!1;function IV(e){var r={};for(var t in M0)r[t]=e&&Of(e,t)?e[t]:M0[t];if(r.ecmaVersion==="latest"?r.ecmaVersion=1e8:r.ecmaVersion==null?(!YO&&typeof console=="object"&&console.warn&&(YO=!0,console.warn(\`Since Acorn 8.0.0, options.ecmaVersion is required. +Defaulting to 2020, but this will stop working in the future.\`)),r.ecmaVersion=11):r.ecmaVersion>=2015&&(r.ecmaVersion-=2009),r.allowReserved==null&&(r.allowReserved=r.ecmaVersion<5),(!e||e.allowHashBang==null)&&(r.allowHashBang=r.ecmaVersion>=14),WO(r.onToken)){var n=r.onToken;r.onToken=function(i){return n.push(i)}}return WO(r.onComment)&&(r.onComment=PV(r,r.onComment)),r}function PV(e,r){return function(t,n,i,a,s,c){var f={type:t?"Block":"Line",value:n,start:i,end:a};e.locations&&(f.loc=new Gp(this,s,c)),e.ranges&&(f.range=[i,a]),r.push(f)}}var Ff=1,xu=2,F0=4,jO=8,eB=16,rB=32,O0=64,tB=128,Bf=256,B0=Ff|xu|Bf;function I0(e,r){return xu|(e?F0:0)|(r?jO:0)}var Vp=0,P0=1,Wa=2,nB=3,iB=4,aB=5,Kt=function(r,t,n){this.options=r=IV(r),this.sourceFile=r.sourceFile,this.keywords=So(EV[r.ecmaVersion>=6?6:r.sourceType==="module"?"5module":5]);var i="";r.allowReserved!==!0&&(i=N0[r.ecmaVersion>=6?6:r.ecmaVersion===5?5:3],r.sourceType==="module"&&(i+=" await")),this.reservedWords=So(i);var a=(i?i+" ":"")+N0.strict;this.reservedWordsStrict=So(a),this.reservedWordsStrictBind=So(a+" "+N0.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(\` +\`,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Ni).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=X.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=r.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&r.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Ff),this.regexpState=null,this.privateNameStack=[]},da={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};Kt.prototype.parse=function(){var r=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(r)};da.inFunction.get=function(){return(this.currentVarScope().flags&xu)>0};da.inGenerator.get=function(){return(this.currentVarScope().flags&jO)>0&&!this.currentVarScope().inClassFieldInit};da.inAsync.get=function(){return(this.currentVarScope().flags&F0)>0&&!this.currentVarScope().inClassFieldInit};da.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var r=this.scopeStack[e];if(r.inClassFieldInit||r.flags&Bf)return!1;if(r.flags&xu)return(r.flags&F0)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};da.allowSuper.get=function(){var e=this.currentThisScope(),r=e.flags,t=e.inClassFieldInit;return(r&O0)>0||t||this.options.allowSuperOutsideMethod};da.allowDirectSuper.get=function(){return(this.currentThisScope().flags&tB)>0};da.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};da.allowNewDotTarget.get=function(){var e=this.currentThisScope(),r=e.flags,t=e.inClassFieldInit;return(r&(xu|Bf))>0||t};da.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Bf)>0};Kt.extend=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];for(var n=this,i=0;i=,?^&]/.test(i)||i==="!"&&this.input.charAt(n+1)==="=")}e+=r[0].length,Di.lastIndex=e,e+=Di.exec(this.input)[0].length,this.input[e]===";"&&e++}};Nn.eat=function(e){return this.type===e?(this.next(),!0):!1};Nn.isContextual=function(e){return this.type===X.name&&this.value===e&&!this.containsEsc};Nn.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};Nn.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};Nn.canInsertSemicolon=function(){return this.type===X.eof||this.type===X.braceR||Ni.test(this.input.slice(this.lastTokEnd,this.start))};Nn.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};Nn.semicolon=function(){!this.eat(X.semi)&&!this.insertSemicolon()&&this.unexpected()};Nn.afterTrailingComma=function(e,r){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),r||this.next(),!0};Nn.expect=function(e){this.eat(e)||this.unexpected()};Nn.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var $p=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Nn.checkPatternErrors=function(e,r){if(!!e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var t=r?e.parenthesizedAssign:e.parenthesizedBind;t>-1&&this.raiseRecoverable(t,r?"Assigning to rvalue":"Parenthesized pattern")}};Nn.checkExpressionErrors=function(e,r){if(!e)return!1;var t=e.shorthandAssign,n=e.doubleProto;if(!r)return t>=0||n>=0;t>=0&&this.raise(t,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")};Nn.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&n<56320)return!0;if(Ua(n,!0)){for(var i=t+1;vu(n=this.input.charCodeAt(i),!0);)++i;if(n===92||n>55295&&n<56320)return!0;var a=this.input.slice(t,i);if(!CV.test(a))return!0}return!1};dr.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Di.lastIndex=this.pos;var e=Di.exec(this.input),r=this.pos+e[0].length,t;return!Ni.test(this.input.slice(this.pos,r))&&this.input.slice(r,r+8)==="function"&&(r+8===this.input.length||!(vu(t=this.input.charCodeAt(r+8))||t>55295&&t<56320))};dr.parseStatement=function(e,r,t){var n=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(n=X._var,a="let"),n){case X._break:case X._continue:return this.parseBreakContinueStatement(i,n.keyword);case X._debugger:return this.parseDebuggerStatement(i);case X._do:return this.parseDoStatement(i);case X._for:return this.parseForStatement(i);case X._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case X._class:return e&&this.unexpected(),this.parseClass(i,!0);case X._if:return this.parseIfStatement(i);case X._return:return this.parseReturnStatement(i);case X._switch:return this.parseSwitchStatement(i);case X._throw:return this.parseThrowStatement(i);case X._try:return this.parseTryStatement(i);case X._const:case X._var:return a=a||this.value,e&&a!=="var"&&this.unexpected(),this.parseVarStatement(i,a);case X._while:return this.parseWhileStatement(i);case X._with:return this.parseWithStatement(i);case X.braceL:return this.parseBlock(!0,i);case X.semi:return this.parseEmptyStatement(i);case X._export:case X._import:if(this.options.ecmaVersion>10&&n===X._import){Di.lastIndex=this.pos;var s=Di.exec(this.input),c=this.pos+s[0].length,f=this.input.charCodeAt(c);if(f===40||f===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(r||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===X._import?this.parseImport(i):this.parseExport(i,t);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var o=this.value,u=this.parseExpression();return n===X.name&&u.type==="Identifier"&&this.eat(X.colon)?this.parseLabeledStatement(i,o,u,e):this.parseExpressionStatement(i,u)}};dr.parseBreakContinueStatement=function(e,r){var t=r==="break";this.next(),this.eat(X.semi)||this.insertSemicolon()?e.label=null:this.type!==X.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n=6?this.eat(X.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};dr.parseForStatement=function(e){this.next();var r=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(k0),this.enterScope(0),this.expect(X.parenL),this.type===X.semi)return r>-1&&this.unexpected(r),this.parseFor(e,null);var t=this.isLet();if(this.type===X._var||this.type===X._const||t){var n=this.startNode(),i=t?"let":this.value;return this.next(),this.parseVar(n,!0,i),this.finishNode(n,"VariableDeclaration"),(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&n.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===X._in?r>-1&&this.unexpected(r):e.await=r>-1),this.parseForIn(e,n)):(r>-1&&this.unexpected(r),this.parseFor(e,n))}var a=this.isContextual("let"),s=!1,c=new $p,f=this.parseExpression(r>-1?"await":!0,c);return this.type===X._in||(s=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===X._in?r>-1&&this.unexpected(r):e.await=r>-1),a&&s&&this.raise(f.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(f,!1,c),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(c,!0),r>-1&&this.unexpected(r),this.parseFor(e,f))};dr.parseFunctionStatement=function(e,r,t){return this.next(),this.parseFunction(e,_f|(t?0:_0),!1,r)};dr.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(X._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};dr.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(X.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};dr.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(X.braceL),this.labels.push(RV),this.enterScope(0);for(var r,t=!1;this.type!==X.braceR;)if(this.type===X._case||this.type===X._default){var n=this.type===X._case;r&&this.finishNode(r,"SwitchCase"),e.cases.push(r=this.startNode()),r.consequent=[],this.next(),n?r.test=this.parseExpression():(t&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),t=!0,r.test=null),this.expect(X.colon)}else r||this.unexpected(),r.consequent.push(this.parseStatement(null));return this.exitScope(),r&&this.finishNode(r,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};dr.parseThrowStatement=function(e){return this.next(),Ni.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var LV=[];dr.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),r=e.type==="Identifier";return this.enterScope(r?rB:0),this.checkLValPattern(e,r?iB:Wa),this.expect(X.parenR),e};dr.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===X._catch){var r=this.startNode();this.next(),this.eat(X.parenL)?r.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),r.param=null,this.enterScope(0)),r.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(r,"CatchClause")}return e.finalizer=this.eat(X._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};dr.parseVarStatement=function(e,r,t){return this.next(),this.parseVar(e,!1,r,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")};dr.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(k0),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};dr.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};dr.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};dr.parseLabeledStatement=function(e,r,t,n){for(var i=0,a=this.labels;i=0;f--){var o=this.labels[f];if(o.statementStart===e.start)o.statementStart=this.start,o.kind=c;else break}return this.labels.push({name:r,kind:c,statementStart:this.start}),e.body=this.parseStatement(n?n.indexOf("label")===-1?n+"label":n:"label"),this.labels.pop(),e.label=t,this.finishNode(e,"LabeledStatement")};dr.parseExpressionStatement=function(e,r){return e.expression=r,this.semicolon(),this.finishNode(e,"ExpressionStatement")};dr.parseBlock=function(e,r,t){for(e===void 0&&(e=!0),r===void 0&&(r=this.startNode()),r.body=[],this.expect(X.braceL),e&&this.enterScope(0);this.type!==X.braceR;){var n=this.parseStatement(null);r.body.push(n)}return t&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(r,"BlockStatement")};dr.parseFor=function(e,r){return e.init=r,this.expect(X.semi),e.test=this.type===X.semi?null:this.parseExpression(),this.expect(X.semi),e.update=this.type===X.parenR?null:this.parseExpression(),this.expect(X.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};dr.parseForIn=function(e,r){var t=this.type===X._in;return this.next(),r.type==="VariableDeclaration"&&r.declarations[0].init!=null&&(!t||this.options.ecmaVersion<8||this.strict||r.kind!=="var"||r.declarations[0].id.type!=="Identifier")&&this.raise(r.start,(t?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=r,e.right=t?this.parseExpression():this.parseMaybeAssign(),this.expect(X.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,t?"ForInStatement":"ForOfStatement")};dr.parseVar=function(e,r,t,n){for(e.declarations=[],e.kind=t;;){var i=this.startNode();if(this.parseVarId(i,t),this.eat(X.eq)?i.init=this.parseMaybeAssign(r):!n&&t==="const"&&!(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!n&&i.id.type!=="Identifier"&&!(r&&(this.type===X._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):i.init=null,e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(X.comma))break}return e};dr.parseVarId=function(e,r){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,r==="var"?P0:Wa,!1)};var _f=1,_0=2,oB=4;dr.parseFunction=function(e,r,t,n,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===X.star&&r&_0&&this.unexpected(),e.generator=this.eat(X.star)),this.options.ecmaVersion>=8&&(e.async=!!n),r&_f&&(e.id=r&oB&&this.type!==X.name?null:this.parseIdent(),e.id&&!(r&_0)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?P0:Wa:nB));var a=this.yieldPos,s=this.awaitPos,c=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(I0(e.async,e.generator)),r&_f||(e.id=this.type===X.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,t,!1,i),this.yieldPos=a,this.awaitPos=s,this.awaitIdentPos=c,this.finishNode(e,r&_f?"FunctionDeclaration":"FunctionExpression")};dr.parseFunctionParams=function(e){this.expect(X.parenL),e.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};dr.parseClass=function(e,r){this.next();var t=this.strict;this.strict=!0,this.parseClassId(e,r),this.parseClassSuper(e);var n=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(X.braceL);this.type!==X.braceR;){var s=this.parseClassElement(e.superClass!==null);s&&(i.body.push(s),s.type==="MethodDefinition"&&s.kind==="constructor"?(a&&this.raiseRecoverable(s.start,"Duplicate constructor in the same class"),a=!0):s.key&&s.key.type==="PrivateIdentifier"&&qV(n,s)&&this.raiseRecoverable(s.key.start,"Identifier '#"+s.key.name+"' has already been declared"))}return this.strict=t,this.next(),e.body=this.finishNode(i,"ClassBody"),this.exitClassBody(),this.finishNode(e,r?"ClassDeclaration":"ClassExpression")};dr.parseClassElement=function(e){if(this.eat(X.semi))return null;var r=this.options.ecmaVersion,t=this.startNode(),n="",i=!1,a=!1,s="method",c=!1;if(this.eatContextual("static")){if(r>=13&&this.eat(X.braceL))return this.parseClassStaticBlock(t),t;this.isClassElementNameStart()||this.type===X.star?c=!0:n="static"}if(t.static=c,!n&&r>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===X.star)&&!this.canInsertSemicolon()?a=!0:n="async"),!n&&(r>=9||!a)&&this.eat(X.star)&&(i=!0),!n&&!a&&!i){var f=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?s=f:n=f)}if(n?(t.computed=!1,t.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),t.key.name=n,this.finishNode(t.key,"Identifier")):this.parseClassElementName(t),r<13||this.type===X.parenL||s!=="method"||i||a){var o=!t.static&&Yp(t,"constructor"),u=o&&e;o&&s!=="method"&&this.raise(t.key.start,"Constructor can't have get/set modifier"),t.kind=o?"constructor":s,this.parseClassMethod(t,i,a,u)}else this.parseClassField(t);return t};dr.isClassElementNameStart=function(){return this.type===X.name||this.type===X.privateId||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword};dr.parseClassElementName=function(e){this.type===X.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};dr.parseClassMethod=function(e,r,t,n){var i=e.key;e.kind==="constructor"?(r&&this.raise(i.start,"Constructor can't be a generator"),t&&this.raise(i.start,"Constructor can't be an async method")):e.static&&Yp(e,"prototype")&&this.raise(i.start,"Classes may not have a static property named prototype");var a=e.value=this.parseMethod(r,t,n);return e.kind==="get"&&a.params.length!==0&&this.raiseRecoverable(a.start,"getter should have no params"),e.kind==="set"&&a.params.length!==1&&this.raiseRecoverable(a.start,"setter should have exactly one param"),e.kind==="set"&&a.params[0].type==="RestElement"&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};dr.parseClassField=function(e){if(Yp(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Yp(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(X.eq)){var r=this.currentThisScope(),t=r.inClassFieldInit;r.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),r.inClassFieldInit=t}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};dr.parseClassStaticBlock=function(e){e.body=[];var r=this.labels;for(this.labels=[],this.enterScope(Bf|O0);this.type!==X.braceR;){var t=this.parseStatement(null);e.body.push(t)}return this.next(),this.exitScope(),this.labels=r,this.finishNode(e,"StaticBlock")};dr.parseClassId=function(e,r){this.type===X.name?(e.id=this.parseIdent(),r&&this.checkLValSimple(e.id,Wa,!1)):(r===!0&&this.unexpected(),e.id=null)};dr.parseClassSuper=function(e){e.superClass=this.eat(X._extends)?this.parseExprSubscripts(null,!1):null};dr.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};dr.exitClassBody=function(){var e=this.privateNameStack.pop(),r=e.declared,t=e.used;if(!!this.options.checkPrivateFields)for(var n=this.privateNameStack.length,i=n===0?null:this.privateNameStack[n-1],a=0;a=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(r,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==X.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};dr.parseExport=function(e,r){if(this.next(),this.eat(X.star))return this.parseExportAllDeclaration(e,r);if(this.eat(X._default))return this.checkExport(r,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(r,e.declaration.declarations):this.checkExport(r,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(r),this.eatContextual("from"))this.type!==X.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var t=0,n=e.specifiers;t=13&&this.type===X.string){var e=this.parseLiteral(this.value);return BV.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};dr.adaptDirectivePrologue=function(e){for(var r=0;r=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var Ai=Kt.prototype;Ai.toAssignable=function(e,r,t){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",t&&this.checkPatternErrors(t,!0);for(var n=0,i=e.properties;n=8&&!c&&f.name==="async"&&!this.canInsertSemicolon()&&this.eat(X._function))return this.overrideContext(Nt.f_expr),this.parseFunction(this.startNodeAt(a,s),0,!1,!0,r);if(i&&!this.canInsertSemicolon()){if(this.eat(X.arrow))return this.parseArrowExpression(this.startNodeAt(a,s),[f],!1,r);if(this.options.ecmaVersion>=8&&f.name==="async"&&this.type===X.name&&!c&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return f=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(X.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,s),[f],!0,r)}return f;case X.regexp:var o=this.value;return n=this.parseLiteral(o.value),n.regex={pattern:o.pattern,flags:o.flags},n;case X.num:case X.string:return this.parseLiteral(this.value);case X._null:case X._true:case X._false:return n=this.startNode(),n.value=this.type===X._null?null:this.type===X._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,"Literal");case X.parenL:var u=this.start,p=this.parseParenAndDistinguishExpression(i,r);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),p;case X.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(X.bracketR,!0,!0,e),this.finishNode(n,"ArrayExpression");case X.braceL:return this.overrideContext(Nt.b_expr),this.parseObj(!1,e);case X._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case X._class:return this.parseClass(this.startNode(),!1);case X._new:return this.parseNew();case X.backQuote:return this.parseTemplate();case X._import:return this.options.ecmaVersion>=11?this.parseExprImport(t):this.unexpected();default:return this.parseExprAtomDefault()}};Mr.parseExprAtomDefault=function(){this.unexpected()};Mr.parseExprImport=function(e){var r=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===X.parenL&&!e)return this.parseDynamicImport(r);if(this.type===X.dot){var t=this.startNodeAt(r.start,r.loc&&r.loc.start);return t.name="import",r.meta=this.finishNode(t,"Identifier"),this.parseImportMeta(r)}else this.unexpected()};Mr.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(X.parenR)){var r=this.start;this.eat(X.comma)&&this.eat(X.parenR)?this.raiseRecoverable(r,"Trailing comma is not allowed in import()"):this.unexpected(r)}return this.finishNode(e,"ImportExpression")};Mr.parseImportMeta=function(e){this.next();var r=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),r&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};Mr.parseLiteral=function(e){var r=this.startNode();return r.value=e,r.raw=this.input.slice(this.start,this.end),r.raw.charCodeAt(r.raw.length-1)===110&&(r.bigint=r.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(r,"Literal")};Mr.parseParenExpression=function(){this.expect(X.parenL);var e=this.parseExpression();return this.expect(X.parenR),e};Mr.shouldParseArrow=function(e){return!this.canInsertSemicolon()};Mr.parseParenAndDistinguishExpression=function(e,r){var t=this.start,n=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s=this.start,c=this.startLoc,f=[],o=!0,u=!1,p=new $p,d=this.yieldPos,h=this.awaitPos,x;for(this.yieldPos=0,this.awaitPos=0;this.type!==X.parenR;)if(o?o=!1:this.expect(X.comma),a&&this.afterTrailingComma(X.parenR,!0)){u=!0;break}else if(this.type===X.ellipsis){x=this.start,f.push(this.parseParenItem(this.parseRestBinding())),this.type===X.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else f.push(this.parseMaybeAssign(!1,p,this.parseParenItem));var v=this.lastTokEnd,y=this.lastTokEndLoc;if(this.expect(X.parenR),e&&this.shouldParseArrow(f)&&this.eat(X.arrow))return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=h,this.parseParenArrowList(t,n,f,r);(!f.length||u)&&this.unexpected(this.lastTokStart),x&&this.unexpected(x),this.checkExpressionErrors(p,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=h||this.awaitPos,f.length>1?(i=this.startNodeAt(s,c),i.expressions=f,this.finishNodeAt(i,"SequenceExpression",v,y)):i=f[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var w=this.startNodeAt(t,n);return w.expression=i,this.finishNode(w,"ParenthesizedExpression")}else return i};Mr.parseParenItem=function(e){return e};Mr.parseParenArrowList=function(e,r,t,n){return this.parseArrowExpression(this.startNodeAt(e,r),t,!1,n)};var UV=[];Mr.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===X.dot){var r=this.startNodeAt(e.start,e.loc&&e.loc.start);r.name="new",e.meta=this.finishNode(r,"Identifier"),this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),t&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var n=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),n,i,!0,!1),this.eat(X.parenL)?e.arguments=this.parseExprList(X.parenR,this.options.ecmaVersion>=8,!1):e.arguments=UV,this.finishNode(e,"NewExpression")};Mr.parseTemplateElement=function(e){var r=e.isTagged,t=this.startNode();return this.type===X.invalidTemplate?(r||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),t.value={raw:this.value,cooked:null}):t.value={raw:this.input.slice(this.start,this.end).replace(/\\r\\n?/g,\` +\`),cooked:this.value},this.next(),t.tail=this.type===X.backQuote,this.finishNode(t,"TemplateElement")};Mr.parseTemplate=function(e){e===void 0&&(e={});var r=e.isTagged;r===void 0&&(r=!1);var t=this.startNode();this.next(),t.expressions=[];var n=this.parseTemplateElement({isTagged:r});for(t.quasis=[n];!n.tail;)this.type===X.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(X.dollarBraceL),t.expressions.push(this.parseExpression()),this.expect(X.braceR),t.quasis.push(n=this.parseTemplateElement({isTagged:r}));return this.next(),this.finishNode(t,"TemplateLiteral")};Mr.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===X.name||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===X.star)&&!Ni.test(this.input.slice(this.lastTokEnd,this.start))};Mr.parseObj=function(e,r){var t=this.startNode(),n=!0,i={};for(t.properties=[],this.next();!this.eat(X.braceR);){if(n)n=!1;else if(this.expect(X.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(X.braceR))break;var a=this.parseProperty(e,r);e||this.checkPropClash(a,i,r),t.properties.push(a)}return this.finishNode(t,e?"ObjectPattern":"ObjectExpression")};Mr.parseProperty=function(e,r){var t=this.startNode(),n,i,a,s;if(this.options.ecmaVersion>=9&&this.eat(X.ellipsis))return e?(t.argument=this.parseIdent(!1),this.type===X.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(t,"RestElement")):(t.argument=this.parseMaybeAssign(!1,r),this.type===X.comma&&r&&r.trailingComma<0&&(r.trailingComma=this.start),this.finishNode(t,"SpreadElement"));this.options.ecmaVersion>=6&&(t.method=!1,t.shorthand=!1,(e||r)&&(a=this.start,s=this.startLoc),e||(n=this.eat(X.star)));var c=this.containsEsc;return this.parsePropertyName(t),!e&&!c&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(t)?(i=!0,n=this.options.ecmaVersion>=9&&this.eat(X.star),this.parsePropertyName(t)):i=!1,this.parsePropertyValue(t,e,n,i,a,s,r,c),this.finishNode(t,"Property")};Mr.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var r=e.kind==="get"?0:1;if(e.value.params.length!==r){var t=e.value.start;e.kind==="get"?this.raiseRecoverable(t,"getter should have no params"):this.raiseRecoverable(t,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};Mr.parsePropertyValue=function(e,r,t,n,i,a,s,c){(t||n)&&this.type===X.colon&&this.unexpected(),this.eat(X.colon)?(e.value=r?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,s),e.kind="init"):this.options.ecmaVersion>=6&&this.type===X.parenL?(r&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(t,n)):!r&&!c&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==X.comma&&this.type!==X.braceR&&this.type!==X.eq?((t||n)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((t||n)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=i),e.kind="init",r?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===X.eq&&s?(s.shorthandAssign<0&&(s.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};Mr.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(X.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(X.bracketR),e.key;e.computed=!1}return e.key=this.type===X.num||this.type===X.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};Mr.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};Mr.parseMethod=function(e,r,t){var n=this.startNode(),i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(I0(r,n.generator)|O0|(t?tB:0)),this.expect(X.parenL),n.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.finishNode(n,"FunctionExpression")};Mr.parseArrowExpression=function(e,r,t,n){var i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(I0(t,!1)|eB),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(r,!0),this.parseFunctionBody(e,!0,!1,n),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")};Mr.parseFunctionBody=function(e,r,t,n){var i=r&&this.type!==X.braceL,a=this.strict,s=!1;if(i)e.body=this.parseMaybeAssign(n),e.expression=!0,this.checkParams(e,!1);else{var c=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||c)&&(s=this.strictDirective(this.end),s&&c&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var f=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!a&&!s&&!r&&!t&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,aB),e.body=this.parseBlock(!1,void 0,s&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=f}this.exitScope()};Mr.isSimpleParamList=function(e){for(var r=0,t=e;r-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&Ff&&delete this.undefinedExports[e]}else if(r===iB){var a=this.currentScope();a.lexical.push(e)}else if(r===nB){var s=this.currentScope();this.treatFunctionsAsVar?n=s.lexical.indexOf(e)>-1:n=s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var c=this.scopeStack.length-1;c>=0;--c){var f=this.scopeStack[c];if(f.lexical.indexOf(e)>-1&&!(f.flags&rB&&f.lexical[0]===e)||!this.treatFunctionsAsVarInScope(f)&&f.functions.indexOf(e)>-1){n=!0;break}if(f.var.push(e),this.inModule&&f.flags&Ff&&delete this.undefinedExports[e],f.flags&B0)break}n&&this.raiseRecoverable(t,"Identifier '"+e+"' has already been declared")};Ao.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};Ao.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Ao.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&B0)return r}};Ao.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&B0&&!(r.flags&eB))return r}};var Zp=function(r,t,n){this.type="",this.start=t,this.end=0,r.options.locations&&(this.loc=new Gp(r,n)),r.options.directSourceFile&&(this.sourceFile=r.options.directSourceFile),r.options.ranges&&(this.range=[t,0])},If=Kt.prototype;If.startNode=function(){return new Zp(this,this.start,this.startLoc)};If.startNodeAt=function(e,r){return new Zp(this,e,r)};function uB(e,r,t,n){return e.type=r,e.end=t,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=t),e}If.finishNode=function(e,r){return uB.call(this,e,r,this.lastTokEnd,this.lastTokEndLoc)};If.finishNodeAt=function(e,r,t,n){return uB.call(this,e,r,t,n)};If.copyNode=function(e){var r=new Zp(this,e.start,this.startLoc);for(var t in e)r[t]=e[t];return r};var fB="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",lB=fB+" Extended_Pictographic",cB=lB,pB=cB+" EBase EComp EMod EPres ExtPict",mB=pB,WV=mB,VV={9:fB,10:lB,11:cB,12:pB,13:mB,14:WV},YV="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",HV={9:"",10:"",11:"",12:"",13:"",14:YV},HO="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",dB="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",hB=dB+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",vB=hB+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",gB=vB+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",xB=gB+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",GV=xB+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",$V={9:dB,10:hB,11:vB,12:gB,13:xB,14:GV},yB={};function ZV(e){var r=yB[e]={binary:So(VV[e]+" "+HO),binaryOfStrings:So(HV[e]),nonBinary:{General_Category:So(HO),Script:So($V[e])}};r.nonBinary.Script_Extensions=r.nonBinary.Script,r.nonBinary.gc=r.nonBinary.General_Category,r.nonBinary.sc=r.nonBinary.Script,r.nonBinary.scx=r.nonBinary.Script_Extensions}for(Wp=0,E0=[9,10,11,12,13,14];Wp=6?"uy":"")+(r.options.ecmaVersion>=9?"s":"")+(r.options.ecmaVersion>=13?"d":"")+(r.options.ecmaVersion>=15?"v":""),this.unicodeProperties=yB[r.options.ecmaVersion>=14?14:r.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};ha.prototype.reset=function(r,t,n){var i=n.indexOf("v")!==-1,a=n.indexOf("u")!==-1;this.start=r|0,this.source=t+"",this.flags=n,i&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=a&&this.parser.options.ecmaVersion>=9)};ha.prototype.raise=function(r){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+r)};ha.prototype.at=function(r,t){t===void 0&&(t=!1);var n=this.source,i=n.length;if(r>=i)return-1;var a=n.charCodeAt(r);if(!(t||this.switchU)||a<=55295||a>=57344||r+1>=i)return a;var s=n.charCodeAt(r+1);return s>=56320&&s<=57343?(a<<10)+s-56613888:a};ha.prototype.nextIndex=function(r,t){t===void 0&&(t=!1);var n=this.source,i=n.length;if(r>=i)return i;var a=n.charCodeAt(r),s;return!(t||this.switchU)||a<=55295||a>=57344||r+1>=i||(s=n.charCodeAt(r+1))<56320||s>57343?r+1:r+2};ha.prototype.current=function(r){return r===void 0&&(r=!1),this.at(this.pos,r)};ha.prototype.lookahead=function(r){return r===void 0&&(r=!1),this.at(this.nextIndex(this.pos,r),r)};ha.prototype.advance=function(r){r===void 0&&(r=!1),this.pos=this.nextIndex(this.pos,r)};ha.prototype.eat=function(r,t){return t===void 0&&(t=!1),this.current(t)===r?(this.advance(t),!0):!1};ha.prototype.eatChars=function(r,t){t===void 0&&(t=!1);for(var n=this.pos,i=0,a=r;i-1&&this.raise(e.start,"Duplicate regular expression flag"),s==="u"&&(n=!0),s==="v"&&(i=!0)}this.options.ecmaVersion>=15&&n&&i&&this.raise(e.start,"Invalid regular expression flag")};ur.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};ur.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var r=0,t=e.backReferenceNames;r=9&&(t=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!t,!0}return e.pos=r,!1};ur.regexp_eatQuantifier=function(e,r){return r===void 0&&(r=!1),this.regexp_eatQuantifierPrefix(e,r)?(e.eat(63),!0):!1};ur.regexp_eatQuantifierPrefix=function(e,r){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,r)};ur.regexp_eatBracedQuantifier=function(e,r){var t=e.pos;if(e.eat(123)){var n=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};ur.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};ur.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};ur.regexp_eatSyntaxCharacter=function(e){var r=e.current();return bB(r)?(e.lastIntValue=r,e.advance(),!0):!1};function bB(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}ur.regexp_eatPatternCharacters=function(e){for(var r=e.pos,t=0;(t=e.current())!==-1&&!bB(t);)e.advance();return e.pos!==r};ur.regexp_eatExtendedPatternCharacter=function(e){var r=e.current();return r!==-1&&r!==36&&!(r>=40&&r<=43)&&r!==46&&r!==63&&r!==91&&r!==94&&r!==124?(e.advance(),!0):!1};ur.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};ur.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};ur.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=No(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=No(e.lastIntValue);return!0}return!1};ur.regexp_eatRegExpIdentifierStart=function(e){var r=e.pos,t=this.options.ecmaVersion>=11,n=e.current(t);return e.advance(t),n===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,t)&&(n=e.lastIntValue),QV(n)?(e.lastIntValue=n,!0):(e.pos=r,!1)};function QV(e){return Ua(e,!0)||e===36||e===95}ur.regexp_eatRegExpIdentifierPart=function(e){var r=e.pos,t=this.options.ecmaVersion>=11,n=e.current(t);return e.advance(t),n===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,t)&&(n=e.lastIntValue),XV(n)?(e.lastIntValue=n,!0):(e.pos=r,!1)};function XV(e){return vu(e,!0)||e===36||e===95||e===8204||e===8205}ur.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};ur.regexp_eatBackReference=function(e){var r=e.pos;if(this.regexp_eatDecimalEscape(e)){var t=e.lastIntValue;if(e.switchU)return t>e.maxBackReference&&(e.maxBackReference=t),!0;if(t<=e.numCapturingParens)return!0;e.pos=r}return!1};ur.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};ur.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};ur.regexp_eatCControlLetter=function(e){var r=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=r}return!1};ur.regexp_eatZero=function(e){return e.current()===48&&!Qp(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};ur.regexp_eatControlEscape=function(e){var r=e.current();return r===116?(e.lastIntValue=9,e.advance(),!0):r===110?(e.lastIntValue=10,e.advance(),!0):r===118?(e.lastIntValue=11,e.advance(),!0):r===102?(e.lastIntValue=12,e.advance(),!0):r===114?(e.lastIntValue=13,e.advance(),!0):!1};ur.regexp_eatControlLetter=function(e){var r=e.current();return wB(r)?(e.lastIntValue=r%32,e.advance(),!0):!1};function wB(e){return e>=65&&e<=90||e>=97&&e<=122}ur.regexp_eatRegExpUnicodeEscapeSequence=function(e,r){r===void 0&&(r=!1);var t=e.pos,n=r||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(n&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(s>=56320&&s<=57343)return e.lastIntValue=(i-55296)*1024+(s-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(n&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&JV(e.lastIntValue))return!0;n&&e.raise("Invalid unicode escape"),e.pos=t}return!1};function JV(e){return e>=0&&e<=1114111}ur.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var r=e.current();return r!==99&&(!e.switchN||r!==107)?(e.lastIntValue=r,e.advance(),!0):!1};ur.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var r=e.current();if(r>=49&&r<=57){do e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();while((r=e.current())>=48&&r<=57);return!0}return!1};var DB=0,za=1,Si=2;ur.regexp_eatCharacterClassEscape=function(e){var r=e.current();if(KV(r))return e.lastIntValue=-1,e.advance(),za;var t=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((t=r===80)||r===112)){e.lastIntValue=-1,e.advance();var n;if(e.eat(123)&&(n=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return t&&n===Si&&e.raise("Invalid property name"),n;e.raise("Invalid property name")}return DB};function KV(e){return e===100||e===68||e===115||e===83||e===119||e===87}ur.regexp_eatUnicodePropertyValueExpression=function(e){var r=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var t=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,t,n),za}}if(e.pos=r,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return DB};ur.regexp_validateUnicodePropertyNameAndValue=function(e,r,t){Of(e.unicodeProperties.nonBinary,r)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[r].test(t)||e.raise("Invalid property value")};ur.regexp_validateUnicodePropertyNameOrValue=function(e,r){if(e.unicodeProperties.binary.test(r))return za;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(r))return Si;e.raise("Invalid property name")};ur.regexp_eatUnicodePropertyName=function(e){var r=0;for(e.lastStringValue="";SB(r=e.current());)e.lastStringValue+=No(r),e.advance();return e.lastStringValue!==""};function SB(e){return wB(e)||e===95}ur.regexp_eatUnicodePropertyValue=function(e){var r=0;for(e.lastStringValue="";jV(r=e.current());)e.lastStringValue+=No(r),e.advance();return e.lastStringValue!==""};function jV(e){return SB(e)||Qp(e)}ur.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};ur.regexp_eatCharacterClass=function(e){if(e.eat(91)){var r=e.eat(94),t=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),r&&t===Si&&e.raise("Negated character class may contain strings"),!0}return!1};ur.regexp_classContents=function(e){return e.current()===93?za:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),za)};ur.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var r=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var t=e.lastIntValue;e.switchU&&(r===-1||t===-1)&&e.raise("Invalid character class"),r!==-1&&t!==-1&&r>t&&e.raise("Range out of order in character class")}}};ur.regexp_eatClassAtom=function(e){var r=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var t=e.current();(t===99||EB(t))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=r}var n=e.current();return n!==93?(e.lastIntValue=n,e.advance(),!0):!1};ur.regexp_eatClassEscape=function(e){var r=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=r}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};ur.regexp_classSetExpression=function(e){var r=za,t;if(!this.regexp_eatClassSetRange(e))if(t=this.regexp_eatClassSetOperand(e)){t===Si&&(r=Si);for(var n=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(t=this.regexp_eatClassSetOperand(e))){t!==Si&&(r=za);continue}e.raise("Invalid character in character class")}if(n!==e.pos)return r;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(n!==e.pos)return r}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(t=this.regexp_eatClassSetOperand(e),!t)return r;t===Si&&(r=Si)}};ur.regexp_eatClassSetRange=function(e){var r=e.pos;if(this.regexp_eatClassSetCharacter(e)){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;return t!==-1&&n!==-1&&t>n&&e.raise("Range out of order in character class"),!0}e.pos=r}return!1};ur.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?za:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};ur.regexp_eatNestedClass=function(e){var r=e.pos;if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);if(e.eat(93))return t&&n===Si&&e.raise("Negated character class may contain strings"),n;e.pos=r}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=r}return null};ur.regexp_eatClassStringDisjunction=function(e){var r=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var t=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return t}else e.raise("Invalid escape");e.pos=r}return null};ur.regexp_classStringDisjunctionContents=function(e){for(var r=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===Si&&(r=Si);return r};ur.regexp_classString=function(e){for(var r=0;this.regexp_eatClassSetCharacter(e);)r++;return r===1?za:Si};ur.regexp_eatClassSetCharacter=function(e){var r=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=r,!1);var t=e.current();return t<0||t===e.lookahead()&&eY(t)||rY(t)?!1:(e.advance(),e.lastIntValue=t,!0)};function eY(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function rY(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}ur.regexp_eatClassSetReservedPunctuator=function(e){var r=e.current();return tY(r)?(e.lastIntValue=r,e.advance(),!0):!1};function tY(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}ur.regexp_eatClassControlLetter=function(e){var r=e.current();return Qp(r)||r===95?(e.lastIntValue=r%32,e.advance(),!0):!1};ur.regexp_eatHexEscapeSequence=function(e){var r=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=r}return!1};ur.regexp_eatDecimalDigits=function(e){var r=e.pos,t=0;for(e.lastIntValue=0;Qp(t=e.current());)e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();return e.pos!==r};function Qp(e){return e>=48&&e<=57}ur.regexp_eatHexDigits=function(e){var r=e.pos,t=0;for(e.lastIntValue=0;NB(t=e.current());)e.lastIntValue=16*e.lastIntValue+AB(t),e.advance();return e.pos!==r};function NB(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function AB(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}ur.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;r<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=r*64+t*8+e.lastIntValue:e.lastIntValue=r*8+t}else e.lastIntValue=r;return!0}return!1};ur.regexp_eatOctalDigit=function(e){var r=e.current();return EB(r)?(e.lastIntValue=r-48,e.advance(),!0):(e.lastIntValue=0,!1)};function EB(e){return e>=48&&e<=55}ur.regexp_eatFixedHexDigits=function(e,r){var t=e.pos;e.lastIntValue=0;for(var n=0;n=this.input.length)return this.finishToken(X.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};Yr.readToken=function(e){return Ua(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};Yr.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var r=this.input.charCodeAt(this.pos+1);return r<=56319||r>=57344?e:(e<<10)+r-56613888};Yr.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),r=this.pos,t=this.input.indexOf("*/",this.pos+=2);if(t===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=t+2,this.options.locations)for(var n=void 0,i=r;(n=QO(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=n;this.options.onComment&&this.options.onComment(!0,this.input.slice(r+2,t),r,this.pos,e,this.curPosition())};Yr.skipLineComment=function(e){for(var r=this.pos,t=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&XO.test(String.fromCharCode(e)))++this.pos;else break e}}};Yr.finishToken=function(e,r){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var t=this.type;this.type=e,this.value=r,this.updateContext(t)};Yr.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var r=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&r===46?(this.pos+=3,this.finishToken(X.ellipsis)):(++this.pos,this.finishToken(X.dot))};Yr.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(X.assign,2):this.finishOp(X.slash,1)};Yr.readToken_mult_modulo_exp=function(e){var r=this.input.charCodeAt(this.pos+1),t=1,n=e===42?X.star:X.modulo;return this.options.ecmaVersion>=7&&e===42&&r===42&&(++t,n=X.starstar,r=this.input.charCodeAt(this.pos+2)),r===61?this.finishOp(X.assign,t+1):this.finishOp(n,t)};Yr.readToken_pipe_amp=function(e){var r=this.input.charCodeAt(this.pos+1);if(r===e){if(this.options.ecmaVersion>=12){var t=this.input.charCodeAt(this.pos+2);if(t===61)return this.finishOp(X.assign,3)}return this.finishOp(e===124?X.logicalOR:X.logicalAND,2)}return r===61?this.finishOp(X.assign,2):this.finishOp(e===124?X.bitwiseOR:X.bitwiseAND,1)};Yr.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(X.assign,2):this.finishOp(X.bitwiseXOR,1)};Yr.readToken_plus_min=function(e){var r=this.input.charCodeAt(this.pos+1);return r===e?r===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Ni.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(X.incDec,2):r===61?this.finishOp(X.assign,2):this.finishOp(X.plusMin,1)};Yr.readToken_lt_gt=function(e){var r=this.input.charCodeAt(this.pos+1),t=1;return r===e?(t=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+t)===61?this.finishOp(X.assign,t+1):this.finishOp(X.bitShift,t)):r===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(r===61&&(t=2),this.finishOp(X.relational,t))};Yr.readToken_eq_excl=function(e){var r=this.input.charCodeAt(this.pos+1);return r===61?this.finishOp(X.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&r===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(X.arrow)):this.finishOp(e===61?X.eq:X.prefix,1)};Yr.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var r=this.input.charCodeAt(this.pos+1);if(r===46){var t=this.input.charCodeAt(this.pos+2);if(t<48||t>57)return this.finishOp(X.questionDot,2)}if(r===63){if(e>=12){var n=this.input.charCodeAt(this.pos+2);if(n===61)return this.finishOp(X.assign,3)}return this.finishOp(X.coalesce,2)}}return this.finishOp(X.question,1)};Yr.readToken_numberSign=function(){var e=this.options.ecmaVersion,r=35;if(e>=13&&(++this.pos,r=this.fullCharCodeAtPos(),Ua(r,!0)||r===92))return this.finishToken(X.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+No(r)+"'")};Yr.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(X.parenL);case 41:return++this.pos,this.finishToken(X.parenR);case 59:return++this.pos,this.finishToken(X.semi);case 44:return++this.pos,this.finishToken(X.comma);case 91:return++this.pos,this.finishToken(X.bracketL);case 93:return++this.pos,this.finishToken(X.bracketR);case 123:return++this.pos,this.finishToken(X.braceL);case 125:return++this.pos,this.finishToken(X.braceR);case 58:return++this.pos,this.finishToken(X.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(X.backQuote);case 48:var r=this.input.charCodeAt(this.pos+1);if(r===120||r===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(r===111||r===79)return this.readRadixNumber(8);if(r===98||r===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(X.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+No(e)+"'")};Yr.finishOp=function(e,r){var t=this.input.slice(this.pos,this.pos+r);return this.pos+=r,this.finishToken(e,t)};Yr.readRegexp=function(){for(var e,r,t=this.pos;;){this.pos>=this.input.length&&this.raise(t,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(Ni.test(n)&&this.raise(t,"Unterminated regular expression"),e)e=!1;else{if(n==="[")r=!0;else if(n==="]"&&r)r=!1;else if(n==="/"&&!r)break;e=n==="\\\\"}++this.pos}var i=this.input.slice(t,this.pos);++this.pos;var a=this.pos,s=this.readWord1();this.containsEsc&&this.unexpected(a);var c=this.regexpState||(this.regexpState=new ha(this));c.reset(t,i,s),this.validateRegExpFlags(c),this.validateRegExpPattern(c);var f=null;try{f=new RegExp(i,s)}catch{}return this.finishToken(X.regexp,{pattern:i,flags:s,value:f})};Yr.readInt=function(e,r,t){for(var n=this.options.ecmaVersion>=12&&r===void 0,i=t&&this.input.charCodeAt(this.pos)===48,a=this.pos,s=0,c=0,f=0,o=r??1/0;f=97?p=u-97+10:u>=65?p=u-65+10:u>=48&&u<=57?p=u-48:p=1/0,p>=e)break;c=u,s=s*e+p}return n&&c===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||r!=null&&this.pos-a!==r?null:s};function nY(e,r){return r?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function CB(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}Yr.readRadixNumber=function(e){var r=this.pos;this.pos+=2;var t=this.readInt(e);return t==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(t=CB(this.input.slice(r,this.pos)),++this.pos):Ua(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(X.num,t)};Yr.readNumber=function(e){var r=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(r,"Invalid number");var t=this.pos-r>=2&&this.input.charCodeAt(r)===48;t&&this.strict&&this.raise(r,"Invalid number");var n=this.input.charCodeAt(this.pos);if(!t&&!e&&this.options.ecmaVersion>=11&&n===110){var i=CB(this.input.slice(r,this.pos));return++this.pos,Ua(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(X.num,i)}t&&/[89]/.test(this.input.slice(r,this.pos))&&(t=!1),n===46&&!t&&(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),(n===69||n===101)&&!t&&(n=this.input.charCodeAt(++this.pos),(n===43||n===45)&&++this.pos,this.readInt(10)===null&&this.raise(r,"Invalid number")),Ua(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=nY(this.input.slice(r,this.pos),t);return this.finishToken(X.num,a)};Yr.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),r;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;r=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,r>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else r=this.readHexChar(4);return r};Yr.readString=function(e){for(var r="",t=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;n===92?(r+=this.input.slice(t,this.pos),r+=this.readEscapedChar(!1),t=this.pos):n===8232||n===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(gu(n)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return r+=this.input.slice(t,this.pos++),this.finishToken(X.string,r)};var MB={};Yr.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===MB)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};Yr.invalidStringToken=function(e,r){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw MB;this.raise(e,r)};Yr.readTmplToken=function(){for(var e="",r=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var t=this.input.charCodeAt(this.pos);if(t===96||t===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===X.template||this.type===X.invalidTemplate)?t===36?(this.pos+=2,this.finishToken(X.dollarBraceL)):(++this.pos,this.finishToken(X.backQuote)):(e+=this.input.slice(r,this.pos),this.finishToken(X.template,e));if(t===92)e+=this.input.slice(r,this.pos),e+=this.readEscapedChar(!0),r=this.pos;else if(gu(t)){switch(e+=this.input.slice(r,this.pos),++this.pos,t){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=\` +\`;break;default:e+=String.fromCharCode(t);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),r=this.pos}else++this.pos}};Yr.readInvalidTemplateToken=function(){for(;this.pos=48&&r<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(n,8);return i>255&&(n=n.slice(0,-1),i=parseInt(n,8)),this.pos+=n.length-1,r=this.input.charCodeAt(this.pos),(n!=="0"||r===56||r===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return gu(r)?"":String.fromCharCode(r)}};Yr.readHexChar=function(e){var r=this.pos,t=this.readInt(16,e);return t===null&&this.invalidStringToken(r,"Bad character escape sequence"),t};Yr.readWord1=function(){this.containsEsc=!1;for(var e="",r=!0,t=this.pos,n=this.options.ecmaVersion>=6;this.pos{let r=/^["'](?:[^"\\\\]|\\\\.)*["'](?:;)?$/.test(e),t=e?.replace(/;+$/,""),n=!isNaN(parseFloat(t))&&!isNaN(t);return r||n||t=="false"||t=="true"||e==null||e==""};var L0=(e,r)=>{let t=r?\`($event, $value, $state, $saveState, $api) => { \${e} }\`:e,n=typeof t=="string"||t instanceof String?t.includes(\` +\`):!1,i;try{i=n&&!r&&!t.startsWith("(")?new Function(\`with(this) { \${t} }\`):new Function(\`with(this) { return \${t}; }\`)}catch(a){console.log(a,e)}return i},q0=e=>{let r={...e,execActions:{},execProps:{},execStyles:{},execPropsOptions:{}},{sortedKeys:t,dependencies:n}=FB(r.node.props,\`\${r.id}.props\`),{sortedKeys:i,dependencies:a}=FB(r.node.styles,\`\${r.id}.styles\`);r.execPropsOptions.props=t.map(c=>({name:c,isConst:TB(r.node.props[c]),deps:n.get(c)||[]})),r.execProps=Jp(r.node.props,c=>L0(c,!1)),r.execStyles=Jp(r.node.styles,c=>L0(c,!1)),r.execActions=Jp(r.node.actions,c=>L0(c,!0)),r.children=r.children.map(c=>q0(c)),r.execPropsOptions.children=[...r.children.flatMap(c=>c.execPropsOptions.children),...r.children.map(c=>c.id)];let s=[...r.children.flatMap(c=>c.execPropsOptions.deps),...r.execPropsOptions.props.flatMap(c=>c.deps),...[...a.values()].flat()];return r.execPropsOptions.deps=s.filter(c=>c[0]!=r.id),r.node.type=="list"&&(r.execPropsOptions.template=r.children),r};function oY(e){let r=[];function t(i,a=[]){if(i.type==="Identifier")return a.push(i.name),a;if(i.type==="MemberExpression"){let s=t(i.object,a);if(s&&i.computed)return i.property.type==="Literal"?(s.push(String(i.property.value)),s):null;if(s)return t(i.property,s)}else if(i.type==="Literal")return a.push(String(i.value)),a;return null}function n(i){if(i.type==="MemberExpression"){let a=t(i);a&&r.push(a);return}for(let a in i)typeof i[a]=="object"&&i[a]!==null&&n(i[a])}try{let i=Xp(e.replace("return ",""),{ecmaVersion:2020});n(i)}catch{return[]}return r}function FB(e,r){let t=new Map,n=new Map,i=new Map;for(let o in e){let u=e[o],p=oY(u),d=p.filter(h=>h.slice(0,-1).join(".")===r);n.set(o,d),i.set(o,p),t.has(o)||t.set(o,new Set);for(let h of d){let x=h[h.length-1];x!==o&&t.get(o).add(x)}}let a=new Set,s=[],c=new Set,f=o=>{if(c.has(o))throw new Error("Circular dependency detected");if(!a.has(o)){c.add(o);let u=t.get(o)||new Set;for(let p of u)f(p);a.add(o),c.delete(o),s.push(o)}};for(let o in e)a.has(o)||f(o);return{sortedKeys:s,dependencies:i}}function OB(e,r,t,n,i){var a=[];t||(t=Qe),function s(c,f,o){var u=o||c.type,p=c!==a[a.length-1];p&&a.push(c),t[u](c,f,s),r[u]&&r[u](c,f||a,a),p&&a.pop()}(e,n,i)}function U0(e,r,t){t(e,r)}function ss(e,r,t){}var Qe={};Qe.Program=Qe.BlockStatement=Qe.StaticBlock=function(e,r,t){for(var n=0,i=e.body;n":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},$i=17,uY={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:$i,ClassExpression:$i,FunctionExpression:$i,ObjectExpression:$i,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function bu(e,r){let{generator:t}=e;if(e.write("("),r!=null&&r.length>0){t[r[0].type](r[0],e);let{length:n}=r;for(let i=1;i0){e.write(n);for(let s=1;s0){t.VariableDeclarator(n[0],e);for(let a=1;a0){r.write(n),i&&e.comments!=null&&An(r,e.comments,a,n);let{length:c}=s;for(let f=0;f0){for(;i0&&r.write(", ");let a=t[i],s=a.type[6];if(s==="D")r.write(a.local.name,a),i++;else if(s==="N")r.write("* as "+a.local.name,a),i++;else break}if(i0)for(let i=0;;){let a=t[i],{name:s}=a.local;if(r.write(s,a),s!==a.exported.name&&r.write(" as "+a.exported.name),++i "),e.body.type[0]==="O"?(r.write("("),this.ObjectExpression(e.body,r),r.write(")")):this[e.body.type](e.body,r)},ThisExpression(e,r){r.write("this",e)},Super(e,r){r.write("super",e)},RestElement:PB=function(e,r){r.write("..."),this[e.argument.type](e.argument,r)},SpreadElement:PB,YieldExpression(e,r){r.write(e.delegate?"yield*":"yield"),e.argument&&(r.write(" "),this[e.argument.type](e.argument,r))},AwaitExpression(e,r){r.write("await ",e),jp(r,e.argument,e)},TemplateLiteral(e,r){let{quasis:t,expressions:n}=e;r.write("\`");let{length:i}=n;for(let s=0;s0){let{elements:t}=e,{length:n}=t;for(let i=0;;){let a=t[i];if(a!=null&&this[a.type](a,r),++i0){r.write(n),i&&e.comments!=null&&An(r,e.comments,a,n);let s=","+n,{properties:c}=e,{length:f}=c;for(let o=0;;){let u=c[o];if(i&&u.comments!=null&&An(r,u.comments,a,n),r.write(a),this[u.type](u,r),++o0){let{properties:t}=e,{length:n}=t;for(let i=0;this[t[i].type](t[i],r),++i1||i[0]==="U"&&(i[1]==="n"||i[1]==="p")&&n.prefix&&n.operator[0]===t&&(t==="+"||t==="-"))&&r.write(" "),a?(r.write(t.length>1?" (":"("),this[i](n,r),r.write(")")):this[i](n,r)}else this[e.argument.type](e.argument,r),r.write(e.operator)},UpdateExpression(e,r){e.prefix?(r.write(e.operator),this[e.argument.type](e.argument,r)):(this[e.argument.type](e.argument,r),r.write(e.operator))},AssignmentExpression(e,r){this[e.left.type](e.left,r),r.write(" "+e.operator+" "),this[e.right.type](e.right,r)},AssignmentPattern(e,r){this[e.left.type](e.left,r),r.write(" = "),this[e.right.type](e.right,r)},BinaryExpression:kB=function(e,r){let t=e.operator==="in";t&&r.write("("),jp(r,e.left,e,!1),r.write(" "+e.operator+" "),jp(r,e.right,e,!0),t&&r.write(")")},LogicalExpression:kB,ConditionalExpression(e,r){let{test:t}=e,n=r.expressionsPrecedence[t.type];n===$i||n<=r.expressionsPrecedence.ConditionalExpression?(r.write("("),this[t.type](t,r),r.write(")")):this[t.type](t,r),r.write(" ? "),this[e.consequent.type](e.consequent,r),r.write(" : "),this[e.alternate.type](e.alternate,r)},NewExpression(e,r){r.write("new ");let t=r.expressionsPrecedence[e.callee.type];t===$i||t0&&(this.lineEndSize>0&&(i.length===1?r[n-1]===i:r.endsWith(i))?(this.line+=this.lineEndSize,this.column=0):this.column+=n)}toString(){return this.output}};function UB(e,r){let t=new W0(r);return t.generator[e.type](e,t),t.output}var V0=(e,r,t)=>{let n,i=lx(e),a=i.includes(\` +\`),s=!1;if(a){let c=i.split(\` +\`).filter(f=>f.trim()!=="");c[c.length-1].includes("return")&&(s=!0),c[c.length-1]=\`\${c[c.length-1].replace("return ","")}\`,i=c.join(\` +\`)}try{let c=Xp(i,{ecmaVersion:2020,locations:!0});OB(c,{Identifier(f,o){let u=o[o.length-2];(u.type!=="MemberExpression"||u.object===f)&&f.name==r&&(f.name=t)},Property(f){f.key.type==="Identifier"&&f.key.name===r&&(f.key.name=t)},ObjectExpression(f){f.properties.forEach(o=>{o.key.type==="Identifier"&&o.key.name===r&&(o.key.name=t)})}}),n=UB(c).trimEnd()}catch(c){console.log(c,e,name),n='"error"'}if(a&&s){let c=n.split(\` +\`).filter(f=>f.trim()!=="");c[c.length-1]=\`return \${c[c.length-1]}\`,n=c.join(\` +\`)}return n};var zB=(e,r)=>{let t=(i,a,s)=>{let c,f=s.node;return s.children&&(c=s.children.map(o=>t(i,a,o))),{...s,children:c,node:{...s.node,parentId:f.parentId==i?a:f.parentId,props:Object.keys(f?.props??{}).reduce((o,u)=>({...o,[u]:V0(f.props[u],i,a)}),f.props),actions:Object.keys(f?.actions??{}).reduce((o,u)=>({...o,[u]:V0(f.actions[u],i,a)}),f.actions),styles:Object.keys(f?.styles??{}).reduce((o,u)=>({...o,[u]:V0(f.styles[u],i,a)}),f.styles)}}};return((i,a,s)=>{let c=(f,o,u)=>{let p=o.node.parentId?o.id+u:f.id,d={...o,node:{...o.node,id:p},id:p};if(d=t(o.id,p,d),d.children){let[h,x]=d.children.reduce((v,y,w)=>{let[C,b]=c(d,y,u+w+1);return v[0].push(C),[v[0],b]},[[],u]);d.children=h,u=x}return[d,u+1]};return c(i,a,s)})(e,e,r)};var Y0=async(e,r,t)=>{let n=e;if(r.prevState[n.id]&&n.node.type!="content"){let a=!1;if(n.node.type=="slides"||n.node.type=="slide"||n.node.type=="delta")a=!1;else{let s=(n.execPropsOptions.children??[]).some(u=>Object.keys(r.newState).includes(u)),c=Object.keys(r.newState[n.id]?.props??{}).every(u=>r.newState[n.id]?.props[u]==r.prevState[n.id]?.props[u]),f=Object.keys(r.newState[n.id]?.styles??{}).every(u=>r.newState[n.id]?.styles[u]==r.prevState[n.id]?.styles[u]),o=n.execPropsOptions.deps.every(u=>u[0]=="$api"||r.newState[u[0]]?.[u[1]]?.[u[2]]===void 0?!0:r.newState[u[0]]?.[u[1]]?.[u[2]]===r.prevState[u[0]]?.[u[1]]?.[u[2]]);c&&f&&o&&!s&&(a=!0)}if(a)return{id:t.runID,root:t.root,exec:n,state:r.state,slides:r.slides,newState:r.newState,prevState:r.prevState}}let i=await mY(n,r,t.contexts,t.api);if(n.node.type=="list"){let a=0;n.children=fx(i.state[n.id].props.value).flatMap((s,c)=>n.execPropsOptions.template.map(f=>{let[o,u]=zB({...f,node:{...f.node,props:{...f.node.props,value:\`\${n.id}.props.value[\${c}]\`}}},a);return a=u,q0(o)}))}typeof i.state[n.id]?.actions?.onRun=="function"&&i.state[n.id].actions?.onRun(null,null,i,a=>{t.saveState(a,{state:i.state,slides:i.slides,root:t.root,exec:t.exec,id:t.runID})},t.api),n.children=[...n.children.filter(a=>a.node.type=="slides"),...n.children.filter(a=>a.node.type!="slides")];for(let a=0;a[{state:f.state,newState:f.newState,slides:f.slides,prevState:f.prevState},f.exec]);if(i=s,n.children[a]=c,c.node.type=="slides"){let f=s.state[c.id].props.value,o=s.state[c.node.parentId]?.props[f],u;t.selectedSlide&&(u=c.children.find(p=>p.id==t.selectedSlide)),o!==null&&!u&&(u=c.children.find(p=>s.state[p.id].props.value==o)),u&&u.children.forEach(p=>{i.newState[p.node.ref]||(i.newState[p.node.ref]={props:{},styles:{},actions:{}}),p.node.ref==n.id?(i.state[p.node.ref].props={...i.state[p.node.ref].props,...i.state[p.node.id].props},i.state[p.node.ref].styles={...i.state[p.node.ref].styles,...i.state[p.node.id].styles},i.state[p.node.ref].actions={...i.state[p.node.ref].actions,...i.state[p.node.id].actions}):(i.newState[p.node.ref].props={...i.newState[p.node.ref].props,...i.state[p.node.id].props},i.newState[p.node.ref].styles={...i.newState[p.node.ref].styles,...i.state[p.node.id].styles},i.newState[p.node.ref].actions={...i.newState[p.node.ref].actions,...i.state[p.node.id].actions})})}}return{id:t.runID,root:t.root,exec:n,state:i.state,slides:i.slides,newState:i.newState,prevState:i.prevState}},mY=async(e,r,t,n)=>{let i=await dY(e,r,t,n),a=WB(e.node,"styles",e.execStyles,i);return WB(e.node,"actions",e.execActions,a)};var dY=async(e,r,t,n)=>{let{id:i}=e.node,a=e.execProps??{},s=r.state;s[i]={props:r.state[i]?.props??{},actions:r.state[i]?.actions??{},styles:r.state[i]?.styles??{}},s.$contexts=t,s.$api=n;for(let{name:c,isConst:f}of e.execPropsOptions.props)try{let o;c in(r.newState?.[i]?.props||{})&&f?o=r.newState[i].props[c]:o=a[c]?.call(s),o!==null?(s[i].props[c]=o,r.state[i].props[c]=o,r.newState&&(r.newState[i]=r.newState[i]??{props:{},styles:{},actions:{}},r.newState[i].props[c]=o)):(delete s[i].props[c],delete r.state[i].props[c],r.newState?.[i]&&delete r.newState[i].props[c])}catch(o){console.log(c,o,a[c])}return r};function WB(e,r,t,n){let{id:i}=e;for(let a of Object.keys(t)){let s;try{a in(n.newState?.[i]?.[r]||{})?s=n.newState[i][r][a]:s=t[a]?.call(n.state),s!==null?n.state[e.id][r][a]=s:delete n.state[e.id][r][a]}catch(c){console.log(c,a)}}return n}function VB(e){return e.table.rows.map(r=>zO(e.paths,r,e.table.cols))}function YB(e){let{root:r,store:t,context:n}=e;return Y0(r,t,n)}var hY=self;hY.onmessage=async e=>{let{payload:r,job:t}=e.data,n;t.type=="table"?n=VB(r):t.type=="instance"&&(n=YB(r));try{postMessage({job:t,result:n})}catch(i){console.log(i),postMessage({job:t,result:{$error:\`Failed to run \${t.type} \${t.path}: \${i}\`}})}}; +/*! + * decimal.js v10.4.3 + * An arbitrary-precision Decimal type for JavaScript. + * https://github.com/MikeMcl/decimal.js + * Copyright (c) 2022 Michael Mclaughlin + * MIT Licence + */ /** * @license * Lodash @@ -88281,16 +88554,29 @@ Defaulting to 2020, but this will stop working in the future.\`)),r.ecmaVersion= * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ +/** + * @license Complex.js v2.1.1 12/05/2020 + * + * Copyright (c) 2020, Robert Eisele (robert@xarg.org) + * Dual licensed under the MIT or GPL Version 2 licenses. + **/ +/** + * @license Fraction.js v4.3.0 20/08/2023 + * https://www.xarg.org/2014/03/rational-numbers-in-javascript/ + * + * Copyright (c) 2023, Robert Eisele (robert@raw.org) + * Dual licensed under the MIT or GPL Version 2 licenses. + **/ //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! moment.js //! momentjs.com //! version : 2.29.4 -`, { "name": "Superstate Indexer" }); +`, { "name": "Superstate Runner" }); } -// src/core/superstate/workers/indexer.ts -var Indexer = class { +// src/core/superstate/workers/runner/runner.ts +var Runner = class { constructor(numWorkers, cache2) { this.numWorkers = numWorkers; this.cache = cache2; @@ -88300,13 +88586,13 @@ var Indexer = class { this.reloadSet = /* @__PURE__ */ new Set(); this.callbacks = /* @__PURE__ */ new Map(); for (let index = 0; index < numWorkers; index++) { - const worker = new Worker2({ name: "Make.md Superstate Indexer " + (index + 1) }); + const worker = new Worker3({ name: "Make.md Superstate Indexer " + (index + 1) }); worker.onmessage = (evt) => this.finish(evt.data.job, evt.data.result, index); this.workers.push(worker); this.busy.push(false); } } - reload(jerb) { + run(jerb) { const jobKey = stringifyJob(jerb); const promise = new Promise((resolve, reject) => { if (this.callbacks.has(jobKey)) @@ -88343,104 +88629,30 @@ var Indexer = class { } } async send(job, workerId) { - if (job.type == "paths") { - const payload = { - settings: this.cache.settings, - spacesCache: this.cache.spacesIndex, - pathCache: this.cache.spaceManager.allCaches(), - oldMetadata: this.cache.pathsIndex - }; + if (job.type == "table") { this.message(workerId, { job, - payload + payload: { + table: job.payload.table, + paths: this.cache.pathsIndex + } }); this.busy[workerId] = true; return; } - if (job.type == "path") { - const spaceState = this.cache.spacesIndex.get(job.path); - const cachePath = spaceState?.defPath ?? job.path; - const pathMetadata = await this.cache.spaceManager.readPathCache(cachePath) ?? await this.cache.spaceManager.readPathCache(job.path); - const label = pathMetadata?.label; - const parent = await this.cache.spaceManager.parentPathForPath(job.path); - const type = spaceState ? "space" : "file"; - const subtype = spaceState ? spaceState.type : pathMetadata.subtype; - const payload = { - path: job.path, - settings: this.cache.settings, - spacesCache: this.cache.spacesIndex, - pathMetadata, - label, - parent, - type, - subtype, - oldMetadata: this.cache.pathsIndex.get(job.path) - }; + if (job.type == "instance") { this.message(workerId, { job, - payload + payload: { + root: job.payload.root, + paths: this.cache.pathsIndex, + store: job.payload.store, + context: job.payload.context + } }); this.busy[workerId] = true; return; } - if (job.type == "context") { - const space2 = this.cache.spacesIndex.get(job.path)?.space; - if (!space2 || !space2.path) { - this.message(workerId, { - job, - payload: { - space: space2, - mdb: null, - paths: [...this.cache.spacesMap.getInverse(job.path)], - oldCache: this.cache.contextsIndex.get(job.path) - } - }); - this.busy[workerId] = true; - return; - } - const dbExists = await this.cache.spaceManager.spaceInitiated(space2.path); - this.cache.spaceManager.readAllTables(space2.path).then((mdb) => { - this.message(workerId, { - job, - payload: { - space: space2, - mdb, - paths: [...this.cache.spacesMap.getInverse(job.path)], - oldCache: this.cache.contextsIndex.get(job.path), - dbExists - } - }); - this.busy[workerId] = true; - }); - return; - } - if (job.type == "frames") { - const space2 = this.cache.spacesIndex.get(job.path)?.space; - if (!space2) { - this.message(workerId, { - job, - payload: { - space: space2, - mdb: null, - oldCache: this.cache.framesIndex.get(job.path) - } - }); - this.busy[workerId] = true; - return; - } - this.cache.spaceManager.readAllFrames(space2.path).then((mdb) => { - this.message(workerId, { - job, - payload: { - space: space2, - mdb, - oldCache: this.cache.framesIndex.get(job.path) - } - }); - this.busy[workerId] = true; - }); - return; - } } message(workerId, message) { this.workers[workerId].postMessage( @@ -88453,131 +88665,13 @@ var Indexer = class { } }; -// src/core/superstate/workers/runner.worker.ts -function Worker3() { - return inlineWorker(`"use strict";var n8=Object.create;var fd=Object.defineProperty;var i8=Object.getOwnPropertyDescriptor;var a8=Object.getOwnPropertyNames;var o8=Object.getPrototypeOf,s8=Object.prototype.hasOwnProperty;var un=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),u8=(e,r)=>{for(var t in r)fd(e,t,{get:r[t],enumerable:!0})},f8=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of a8(r))!s8.call(e,i)&&i!==t&&fd(e,i,{get:()=>r[i],enumerable:!(n=i8(r,i))||n.enumerable});return e};var Xn=(e,r,t)=>(t=e!=null?n8(o8(e)):{},f8(r||!e||!e.__esModule?fd(t,"default",{value:e,enumerable:!0}):t,e));var Xl=un((Us,cf)=>{(function(){var e,r="4.17.21",t=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid \`variable\` option passed into \`_.template\`",s="__lodash_hash_undefined__",l=500,f="__lodash_placeholder__",o=1,u=2,p=4,h=1,d=2,x=1,v=2,y=4,w=8,C=16,b=32,A=64,E=128,S=256,O=512,F=30,M="...",_=800,k=16,L=1,Y=2,$=3,V=1/0,q=9007199254740991,R=17976931348623157e292,j=0/0,U=4294967295,oe=U-1,me=U>>>1,ie=[["ary",E],["bind",x],["bindKey",v],["curry",w],["curryRight",C],["flip",O],["partial",b],["partialRight",A],["rearg",S]],H="[object Arguments]",ce="[object Array]",Me="[object AsyncFunction]",pe="[object Boolean]",ge="[object Date]",Se="[object DOMException]",xe="[object Error]",be="[object Function]",De="[object GeneratorFunction]",Ae="[object Map]",ze="[object Number]",Ze="[object Null]",K="[object Object]",te="[object Promise]",ye="[object Proxy]",ee="[object RegExp]",ne="[object Set]",ue="[object String]",Ee="[object Symbol]",Ce="[object Undefined]",Le="[object WeakMap]",Ie="[object WeakSet]",sr="[object ArrayBuffer]",ir="[object DataView]",Xe="[object Float32Array]",Or="[object Float64Array]",re="[object Int8Array]",le="[object Int16Array]",we="[object Int32Array]",Oe="[object Uint8Array]",ke="[object Uint8ClampedArray]",_e="[object Uint16Array]",Pe="[object Uint32Array]",We=/\\b__p \\+= '';/g,B=/\\b(__p \\+=) '' \\+/g,Q=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g,ve=/&(?:amp|lt|gt|quot|#39);/g,Be=/[&<>"']/g,er=RegExp(ve.source),fr=RegExp(Be.source),Zr=/<%-([\\s\\S]+?)%>/g,_t=/<%([\\s\\S]+?)%>/g,Yt=/<%=([\\s\\S]+?)%>/g,Qi=/\\.|\\[(?:[^[\\]]*|(["'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,Ei=/^\\w*$/,Su=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,Ci=/[\\\\^$.*+?()[\\]{}|]/g,Ya=RegExp(Ci.source),rr=/^\\s+/,Nu=/\\s/,Au=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,nn=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,Mo=/,? & /,nt=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,ga=/[()=,{}\\[\\]\\/\\s]/,Eu=/\\\\(\\\\)?/g,zt=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,En=/\\w*$/,Cn=/^[-+]0x[0-9a-f]+$/i,At=/^0b[01]+$/i,gn=/^\\[object .+?Constructor\\]$/,Wn=/^0o[0-7]+$/i,Mi=/^(?:0|[1-9]\\d*)$/,Cu=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,Ha=/($^)/,Mu=/['\\n\\r\\u2028\\u2029\\\\]/g,pt="\\\\ud800-\\\\udfff",Ga="\\\\u0300-\\\\u036f",_u="\\\\ufe20-\\\\ufe2f",fs="\\\\u20d0-\\\\u20ff",_o=Ga+_u+fs,ls="\\\\u2700-\\\\u27bf",cs="a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff",xa="\\\\xac\\\\xb1\\\\xd7\\\\xf7",Kr="\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf",jt="\\\\u2000-\\\\u206f",Tu=" \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000",Xi="A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde",_i="\\\\ufe0e\\\\ufe0f",ps=xa+Kr+jt+Tu,Fu="['\\u2019]",om="["+pt+"]",Ou="["+ps+"]",Ji="["+_o+"]",Bu="\\\\d+",sm="["+ls+"]",Rf="["+cs+"]",$a="[^"+pt+ps+Bu+ls+cs+Xi+"]",Za="\\\\ud83c[\\\\udffb-\\\\udfff]",Lf="(?:"+Ji+"|"+Za+")",Qa="[^"+pt+"]",Vn="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",Iu="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",Xa="["+Xi+"]",qf="\\\\u200d",Uf="(?:"+Rf+"|"+$a+")",um="(?:"+Xa+"|"+$a+")",zf="(?:"+Fu+"(?:d|ll|m|re|s|t|ve))?",Wf="(?:"+Fu+"(?:D|LL|M|RE|S|T|VE))?",Vf=Lf+"?",ms="["+_i+"]?",fm="(?:"+qf+"(?:"+[Qa,Vn,Iu].join("|")+")"+ms+Vf+")*",Yf="\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])",lm="\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])",Hf=ms+Vf+fm,cm="(?:"+[sm,Vn,Iu].join("|")+")"+Hf,pm="(?:"+[Qa+Ji+"?",Ji,Vn,Iu,om].join("|")+")",mm=RegExp(Fu,"g"),hm=RegExp(Ji,"g"),Pu=RegExp(Za+"(?="+Za+")|"+pm+Hf,"g"),dm=RegExp([Xa+"?"+Rf+"+"+zf+"(?="+[Ou,Xa,"$"].join("|")+")",um+"+"+Wf+"(?="+[Ou,Xa+Uf,"$"].join("|")+")",Xa+"?"+Uf+"+"+zf,Xa+"+"+Wf,lm,Yf,Bu,cm].join("|"),"g"),vm=RegExp("["+qf+pt+_o+_i+"]"),gm=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,xm=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ym=-1,dt={};dt[Xe]=dt[Or]=dt[re]=dt[le]=dt[we]=dt[Oe]=dt[ke]=dt[_e]=dt[Pe]=!0,dt[H]=dt[ce]=dt[sr]=dt[pe]=dt[ir]=dt[ge]=dt[xe]=dt[be]=dt[Ae]=dt[ze]=dt[K]=dt[ee]=dt[ne]=dt[ue]=dt[Le]=!1;var mt={};mt[H]=mt[ce]=mt[sr]=mt[ir]=mt[pe]=mt[ge]=mt[Xe]=mt[Or]=mt[re]=mt[le]=mt[we]=mt[Ae]=mt[ze]=mt[K]=mt[ee]=mt[ne]=mt[ue]=mt[Ee]=mt[Oe]=mt[ke]=mt[_e]=mt[Pe]=!0,mt[xe]=mt[be]=mt[Le]=!1;var bm={\\u00C0:"A",\\u00C1:"A",\\u00C2:"A",\\u00C3:"A",\\u00C4:"A",\\u00C5:"A",\\u00E0:"a",\\u00E1:"a",\\u00E2:"a",\\u00E3:"a",\\u00E4:"a",\\u00E5:"a",\\u00C7:"C",\\u00E7:"c",\\u00D0:"D",\\u00F0:"d",\\u00C8:"E",\\u00C9:"E",\\u00CA:"E",\\u00CB:"E",\\u00E8:"e",\\u00E9:"e",\\u00EA:"e",\\u00EB:"e",\\u00CC:"I",\\u00CD:"I",\\u00CE:"I",\\u00CF:"I",\\u00EC:"i",\\u00ED:"i",\\u00EE:"i",\\u00EF:"i",\\u00D1:"N",\\u00F1:"n",\\u00D2:"O",\\u00D3:"O",\\u00D4:"O",\\u00D5:"O",\\u00D6:"O",\\u00D8:"O",\\u00F2:"o",\\u00F3:"o",\\u00F4:"o",\\u00F5:"o",\\u00F6:"o",\\u00F8:"o",\\u00D9:"U",\\u00DA:"U",\\u00DB:"U",\\u00DC:"U",\\u00F9:"u",\\u00FA:"u",\\u00FB:"u",\\u00FC:"u",\\u00DD:"Y",\\u00FD:"y",\\u00FF:"y",\\u00C6:"Ae",\\u00E6:"ae",\\u00DE:"Th",\\u00FE:"th",\\u00DF:"ss",\\u0100:"A",\\u0102:"A",\\u0104:"A",\\u0101:"a",\\u0103:"a",\\u0105:"a",\\u0106:"C",\\u0108:"C",\\u010A:"C",\\u010C:"C",\\u0107:"c",\\u0109:"c",\\u010B:"c",\\u010D:"c",\\u010E:"D",\\u0110:"D",\\u010F:"d",\\u0111:"d",\\u0112:"E",\\u0114:"E",\\u0116:"E",\\u0118:"E",\\u011A:"E",\\u0113:"e",\\u0115:"e",\\u0117:"e",\\u0119:"e",\\u011B:"e",\\u011C:"G",\\u011E:"G",\\u0120:"G",\\u0122:"G",\\u011D:"g",\\u011F:"g",\\u0121:"g",\\u0123:"g",\\u0124:"H",\\u0126:"H",\\u0125:"h",\\u0127:"h",\\u0128:"I",\\u012A:"I",\\u012C:"I",\\u012E:"I",\\u0130:"I",\\u0129:"i",\\u012B:"i",\\u012D:"i",\\u012F:"i",\\u0131:"i",\\u0134:"J",\\u0135:"j",\\u0136:"K",\\u0137:"k",\\u0138:"k",\\u0139:"L",\\u013B:"L",\\u013D:"L",\\u013F:"L",\\u0141:"L",\\u013A:"l",\\u013C:"l",\\u013E:"l",\\u0140:"l",\\u0142:"l",\\u0143:"N",\\u0145:"N",\\u0147:"N",\\u014A:"N",\\u0144:"n",\\u0146:"n",\\u0148:"n",\\u014B:"n",\\u014C:"O",\\u014E:"O",\\u0150:"O",\\u014D:"o",\\u014F:"o",\\u0151:"o",\\u0154:"R",\\u0156:"R",\\u0158:"R",\\u0155:"r",\\u0157:"r",\\u0159:"r",\\u015A:"S",\\u015C:"S",\\u015E:"S",\\u0160:"S",\\u015B:"s",\\u015D:"s",\\u015F:"s",\\u0161:"s",\\u0162:"T",\\u0164:"T",\\u0166:"T",\\u0163:"t",\\u0165:"t",\\u0167:"t",\\u0168:"U",\\u016A:"U",\\u016C:"U",\\u016E:"U",\\u0170:"U",\\u0172:"U",\\u0169:"u",\\u016B:"u",\\u016D:"u",\\u016F:"u",\\u0171:"u",\\u0173:"u",\\u0174:"W",\\u0175:"w",\\u0176:"Y",\\u0177:"y",\\u0178:"Y",\\u0179:"Z",\\u017B:"Z",\\u017D:"Z",\\u017A:"z",\\u017C:"z",\\u017E:"z",\\u0132:"IJ",\\u0133:"ij",\\u0152:"Oe",\\u0153:"oe",\\u0149:"'n",\\u017F:"s"},ku={"&":"&","<":"<",">":">",'"':""","'":"'"},Ru={"&":"&","<":"<",">":">",""":'"',"'":"'"},wm={"\\\\":"\\\\","'":"'","\\n":"n","\\r":"r","\\u2028":"u2028","\\u2029":"u2029"},Gf=parseFloat,$f=parseInt,Zf=typeof global=="object"&&global&&global.Object===Object&&global,Dm=typeof self=="object"&&self&&self.Object===Object&&self,Wt=Zf||Dm||Function("return this")(),Lu=typeof Us=="object"&&Us&&!Us.nodeType&&Us,Ki=Lu&&typeof cf=="object"&&cf&&!cf.nodeType&&cf,vt=Ki&&Ki.exports===Lu,ya=vt&&Zf.process,en=function(){try{var he=Ki&&Ki.require&&Ki.require("util").types;return he||ya&&ya.binding&&ya.binding("util")}catch{}}(),Qf=en&&en.isArrayBuffer,qu=en&&en.isDate,Xf=en&&en.isMap,Jf=en&&en.isRegExp,To=en&&en.isSet,Ti=en&&en.isTypedArray;function an(he,Fe,Ne){switch(Ne.length){case 0:return he.call(Fe);case 1:return he.call(Fe,Ne[0]);case 2:return he.call(Fe,Ne[0],Ne[1]);case 3:return he.call(Fe,Ne[0],Ne[1],Ne[2])}return he.apply(Fe,Ne)}function Sm(he,Fe,Ne,nr){for(var Nr=-1,jr=he==null?0:he.length;++Nr-1}function Uu(he,Fe,Ne){for(var nr=-1,Nr=he==null?0:he.length;++nr-1;);return Ne}function il(he,Fe){for(var Ne=he.length;Ne--&&Ja(Fe,he[Ne],0)>-1;);return Ne}function _m(he,Fe){for(var Ne=he.length,nr=0;Ne--;)he[Ne]===Fe&&++nr;return nr}var al=Fo(bm),Tm=Fo(ku);function Fm(he){return"\\\\"+wm[he]}function Om(he,Fe){return he==null?e:he[Fe]}function ii(he){return vm.test(he)}function Bm(he){return gm.test(he)}function Im(he){for(var Fe,Ne=[];!(Fe=he.next()).done;)Ne.push(Fe.value);return Ne}function Zu(he){var Fe=-1,Ne=Array(he.size);return he.forEach(function(nr,Nr){Ne[++Fe]=[Nr,nr]}),Ne}function Oo(he,Fe){return function(Ne){return he(Fe(Ne))}}function Yn(he,Fe){for(var Ne=-1,nr=he.length,Nr=0,jr=[];++Ne-1}function bl(c,m){var D=this.__data__,I=Tn(D,c);return I<0?(++this.size,D.push([c,m])):D[I][1]=m,this}Bi.prototype.clear=uh,Bi.prototype.delete=yl,Bi.prototype.get=fh,Bi.prototype.has=lh,Bi.prototype.set=bl;function Ii(c){var m=-1,D=c==null?0:c.length;for(this.clear();++m=m?c:m)),c}function yn(c,m,D,I,W,J){var ae,fe=m&o,de=m&u,Re=m&p;if(D&&(ae=W?D(c,I,W,J):D(c)),ae!==e)return ae;if(!Ct(c))return c;var qe=Fr(c);if(qe){if(ae=OI(c),!fe)return Fn(c,ae)}else{var Ve=pn(c),Ke=Ve==be||Ve==De;if(uo(c))return l0(c,fe);if(Ve==K||Ve==H||Ke&&!W){if(ae=de||Ke?{}:_0(c),!fe)return de?wI(c,yh(ae,c)):bI(c,Ku(ae,c))}else{if(!mt[Ve])return W?c:{};ae=BI(c,Ve,fe)}}J||(J=new Hn);var cr=J.get(c);if(cr)return cr;J.set(c,ae),ix(c)?c.forEach(function(Dr){ae.add(yn(Dr,m,D,Dr,c,J))}):tx(c)&&c.forEach(function(Dr,qr){ae.set(qr,yn(Dr,m,D,qr,c,J))});var wr=Re?de?Uh:qh:de?Bn:rn,Pr=qe?e:wr(c);return Tt(Pr||c,function(Dr,qr){Pr&&(qr=Dr,Dr=c[qr]),Wo(ae,qr,yn(Dr,m,D,qr,c,J))}),ae}function ju(c){var m=rn(c);return function(D){return Al(D,c,m)}}function Al(c,m,D){var I=D.length;if(c==null)return!I;for(c=kr(c);I--;){var W=D[I],J=m[W],ae=c[W];if(ae===e&&!(W in c)||!J(ae))return!1}return!0}function El(c,m,D){if(typeof c!="function")throw new Mn(i);return ff(function(){c.apply(e,D)},m)}function bn(c,m,D,I){var W=-1,J=ds,ae=!0,fe=c.length,de=[],Re=m.length;if(!fe)return de;D&&(m=ct(m,cn(D))),I?(J=Uu,ae=!1):m.length>=t&&(J=Ka,ae=!1,m=new Sa(m));e:for(;++WW?0:W+D),I=I===e||I>W?W:Br(I),I<0&&(I+=W),I=D>I?0:ox(I);D0&&D(fe)?m>1?Ht(fe,m-1,D,I,W):ni(W,fe):I||(W[W.length]=fe)}return W}var ef=v0(),_l=v0(!0);function ai(c,m){return c&&ef(c,m,rn)}function rf(c,m){return c&&_l(c,m,rn)}function oi(c,m){return ji(m,function(D){return _a(c[D])})}function Aa(c,m){m=oo(m,c);for(var D=0,I=m.length;c!=null&&Dm}function Dh(c,m){return c!=null&&at.call(c,m)}function Sh(c,m){return c!=null&&m in kr(c)}function Nh(c,m,D){return c>=Et(m,D)&&c=120&&qe.length>=120)?new Sa(ae&&qe):e}qe=c[0];var Ve=-1,Ke=fe[0];e:for(;++Ve-1;)fe!==c&&wa.call(fe,de,1),wa.call(c,de,1);return c}function t0(c,m){for(var D=c?m.length:0,I=D-1;D--;){var W=m[D];if(D==I||W!==J){var J=W;Ma(W)?wa.call(c,W,1):Oh(c,W)}}return c}function _h(c,m){return c+ko(gl()*(m-c+1))}function fI(c,m,D,I){for(var W=-1,J=Ft(Ns((m-c)/(D||1)),0),ae=Ne(J);J--;)ae[I?J:++W]=c,c+=D;return ae}function Th(c,m){var D="";if(!c||m<1||m>q)return D;do m%2&&(D+=c),m=ko(m/2),m&&(c+=c);while(m);return D}function Rr(c,m){return $h(O0(c,m,In),c+"")}function lI(c){return Nl(qs(c))}function cI(c,m){var D=qs(c);return zl(D,Na(m,0,D.length))}function of(c,m,D,I){if(!Ct(c))return c;m=oo(m,c);for(var W=-1,J=m.length,ae=J-1,fe=c;fe!=null&&++WW?0:W+m),D=D>W?W:D,D<0&&(D+=W),W=m>D?0:D-m>>>0,m>>>=0;for(var J=Ne(W);++I>>1,ae=c[J];ae!==null&&!$n(ae)&&(D?ae<=m:ae=t){var Re=m?null:AI(c);if(Re)return ja(Re);ae=!1,W=Ka,de=new Sa}else de=m?[]:fe;e:for(;++I=I?c:fi(c,m,D)}var f0=Gm||function(c){return Wt.clearTimeout(c)};function l0(c,m){if(m)return c.slice();var D=c.length,I=ll?ll(D):new c.constructor(D);return c.copy(I),I}function kh(c){var m=new c.constructor(c.byteLength);return new ws(m).set(new ws(c)),m}function vI(c,m){var D=m?kh(c.buffer):c.buffer;return new c.constructor(D,c.byteOffset,c.byteLength)}function gI(c){var m=new c.constructor(c.source,En.exec(c));return m.lastIndex=c.lastIndex,m}function xI(c){return zo?kr(zo.call(c)):{}}function c0(c,m){var D=m?kh(c.buffer):c.buffer;return new c.constructor(D,c.byteOffset,c.length)}function p0(c,m){if(c!==m){var D=c!==e,I=c===null,W=c===c,J=$n(c),ae=m!==e,fe=m===null,de=m===m,Re=$n(m);if(!fe&&!Re&&!J&&c>m||J&&ae&&de&&!fe&&!Re||I&&ae&&de||!D&&de||!W)return 1;if(!I&&!J&&!Re&&c=fe)return de;var Re=D[I];return de*(Re=="desc"?-1:1)}}return c.index-m.index}function m0(c,m,D,I){for(var W=-1,J=c.length,ae=D.length,fe=-1,de=m.length,Re=Ft(J-ae,0),qe=Ne(de+Re),Ve=!I;++fe1?D[W-1]:e,ae=W>2?D[2]:e;for(J=c.length>3&&typeof J=="function"?(W--,J):e,ae&&wn(D[0],D[1],ae)&&(J=W<3?e:J,W=1),m=kr(m);++I-1?W[J?m[ae]:ae]:e}}function y0(c){return Ca(function(m){var D=m.length,I=D,W=_n.prototype.thru;for(c&&m.reverse();I--;){var J=m[I];if(typeof J!="function")throw new Mn(i);if(W&&!ae&&ql(J)=="wrapper")var ae=new _n([],!0)}for(I=ae?I:D;++I1&&Hr.reverse(),qe&&defe))return!1;var Re=J.get(c),qe=J.get(m);if(Re&&qe)return Re==m&&qe==c;var Ve=-1,Ke=!0,cr=D&d?new Sa:e;for(J.set(c,m),J.set(m,c);++Ve1?"& ":"")+m[I],m=m.join(D>2?", ":" "),c.replace(Au,\`{ -/* [wrapped with \`+m+\`] */ -\`)}function PI(c){return Fr(c)||$o(c)||!!(ml&&c&&c[ml])}function Ma(c,m){var D=typeof c;return m=m??q,!!m&&(D=="number"||D!="symbol"&&Mi.test(c))&&c>-1&&c%1==0&&c0){if(++m>=_)return arguments[0]}else m=0;return c.apply(e,arguments)}}function zl(c,m){var D=-1,I=c.length,W=I-1;for(m=m===e?I:m;++D1?c[m-1]:e;return D=typeof D=="function"?(c.pop(),D):e,Y0(c,D)});function H0(c){var m=Z(c);return m.__chain__=!0,m}function G4(c,m){return m(c),c}function Wl(c,m){return m(c)}var $4=Ca(function(c){var m=c.length,D=m?c[0]:0,I=this.__wrapped__,W=function(J){return Bs(J,c)};return m>1||this.__actions__.length||!(I instanceof Ir)||!Ma(D)?this.thru(W):(I=I.slice(D,+D+(m?1:0)),I.__actions__.push({func:Wl,args:[W],thisArg:e}),new _n(I,this.__chain__).thru(function(J){return m&&!J.length&&J.push(e),J}))});function Z4(){return H0(this)}function Q4(){return new _n(this.value(),this.__chain__)}function X4(){this.__values__===e&&(this.__values__=ax(this.value()));var c=this.__index__>=this.__values__.length,m=c?e:this.__values__[this.__index__++];return{done:c,value:m}}function J4(){return this}function K4(c){for(var m,D=this;D instanceof _s;){var I=L0(D);I.__index__=0,I.__values__=e,m?W.__wrapped__=I:m=I;var W=I;D=D.__wrapped__}return W.__wrapped__=c,m}function j4(){var c=this.__wrapped__;if(c instanceof Ir){var m=c;return this.__actions__.length&&(m=new Ir(this)),m=m.reverse(),m.__actions__.push({func:Wl,args:[Zh],thisArg:e}),new _n(m,this.__chain__)}return this.thru(Zh)}function eP(){return s0(this.__wrapped__,this.__actions__)}var rP=Il(function(c,m,D){at.call(c,D)?++c[D]:Pi(c,D,1)});function tP(c,m,D){var I=Fr(c)?hs:bh;return D&&wn(c,m,D)&&(m=e),I(c,xr(m,3))}function nP(c,m){var D=Fr(c)?ji:Ml;return D(c,xr(m,3))}var iP=x0(q0),aP=x0(U0);function oP(c,m){return Ht(Vl(c,m),1)}function sP(c,m){return Ht(Vl(c,m),V)}function uP(c,m,D){return D=D===e?1:Br(D),Ht(Vl(c,m),D)}function G0(c,m){var D=Fr(c)?Tt:ia;return D(c,xr(m,3))}function $0(c,m){var D=Fr(c)?Nm:Cl;return D(c,xr(m,3))}var fP=Il(function(c,m,D){at.call(c,D)?c[D].push(m):Pi(c,D,[m])});function lP(c,m,D,I){c=On(c)?c:qs(c),D=D&&!I?Br(D):0;var W=c.length;return D<0&&(D=Ft(W+D,0)),Zl(c)?D<=W&&c.indexOf(m,D)>-1:!!W&&Ja(c,m,D)>-1}var cP=Rr(function(c,m,D){var I=-1,W=typeof m=="function",J=On(c)?Ne(c.length):[];return ia(c,function(ae){J[++I]=W?an(m,ae,D):si(ae,m,D)}),J}),pP=Il(function(c,m,D){Pi(c,D,m)});function Vl(c,m){var D=Fr(c)?ct:Te;return D(c,xr(m,3))}function mP(c,m,D,I){return c==null?[]:(Fr(m)||(m=m==null?[]:[m]),D=I?e:D,Fr(D)||(D=D==null?[]:[D]),Ri(c,m,D))}var hP=Il(function(c,m,D){c[D?0:1].push(m)},function(){return[[],[]]});function dP(c,m,D){var I=Fr(c)?zu:tl,W=arguments.length<3;return I(c,xr(m,4),D,W,ia)}function vP(c,m,D){var I=Fr(c)?Am:tl,W=arguments.length<3;return I(c,xr(m,4),D,W,Cl)}function gP(c,m){var D=Fr(c)?ji:Ml;return D(c,Gl(xr(m,3)))}function xP(c){var m=Fr(c)?Nl:lI;return m(c)}function yP(c,m,D){(D?wn(c,m,D):m===e)?m=1:m=Br(m);var I=Fr(c)?vh:cI;return I(c,m)}function bP(c){var m=Fr(c)?gh:mI;return m(c)}function wP(c){if(c==null)return 0;if(On(c))return Zl(c)?ea(c):c.length;var m=pn(c);return m==Ae||m==ne?c.size:z(c).length}function DP(c,m,D){var I=Fr(c)?Wu:hI;return D&&wn(c,m,D)&&(m=e),I(c,xr(m,3))}var SP=Rr(function(c,m){if(c==null)return[];var D=m.length;return D>1&&wn(c,m[0],m[1])?m=[]:D>2&&wn(m[0],m[1],m[2])&&(m=[m[0]]),Ri(c,Ht(m,1),[])}),Yl=$m||function(){return Wt.Date.now()};function NP(c,m){if(typeof m!="function")throw new Mn(i);return c=Br(c),function(){if(--c<1)return m.apply(this,arguments)}}function Z0(c,m,D){return m=D?e:m,m=c&&m==null?c.length:m,Ea(c,E,e,e,e,e,m)}function Q0(c,m){var D;if(typeof m!="function")throw new Mn(i);return c=Br(c),function(){return--c>0&&(D=m.apply(this,arguments)),c<=1&&(m=e),D}}var Xh=Rr(function(c,m,D){var I=x;if(D.length){var W=Yn(D,Rs(Xh));I|=b}return Ea(c,I,m,D,W)}),X0=Rr(function(c,m,D){var I=x|v;if(D.length){var W=Yn(D,Rs(X0));I|=b}return Ea(m,I,c,D,W)});function J0(c,m,D){m=D?e:m;var I=Ea(c,w,e,e,e,e,e,m);return I.placeholder=J0.placeholder,I}function K0(c,m,D){m=D?e:m;var I=Ea(c,C,e,e,e,e,e,m);return I.placeholder=K0.placeholder,I}function j0(c,m,D){var I,W,J,ae,fe,de,Re=0,qe=!1,Ve=!1,Ke=!0;if(typeof c!="function")throw new Mn(i);m=ci(m)||0,Ct(D)&&(qe=!!D.leading,Ve="maxWait"in D,J=Ve?Ft(ci(D.maxWait)||0,m):J,Ke="trailing"in D?!!D.trailing:Ke);function cr(Rt){var qi=I,Fa=W;return I=W=e,Re=Rt,ae=c.apply(Fa,qi),ae}function wr(Rt){return Re=Rt,fe=ff(qr,m),qe?cr(Rt):ae}function Pr(Rt){var qi=Rt-de,Fa=Rt-Re,xx=m-qi;return Ve?Et(xx,J-Fa):xx}function Dr(Rt){var qi=Rt-de,Fa=Rt-Re;return de===e||qi>=m||qi<0||Ve&&Fa>=J}function qr(){var Rt=Yl();if(Dr(Rt))return Hr(Rt);fe=ff(qr,Pr(Rt))}function Hr(Rt){return fe=e,Ke&&I?cr(Rt):(I=W=e,ae)}function Zn(){fe!==e&&f0(fe),Re=0,I=de=W=fe=e}function Dn(){return fe===e?ae:Hr(Yl())}function Qn(){var Rt=Yl(),qi=Dr(Rt);if(I=arguments,W=this,de=Rt,qi){if(fe===e)return wr(de);if(Ve)return f0(fe),fe=ff(qr,m),cr(de)}return fe===e&&(fe=ff(qr,m)),ae}return Qn.cancel=Zn,Qn.flush=Dn,Qn}var AP=Rr(function(c,m){return El(c,1,m)}),EP=Rr(function(c,m,D){return El(c,ci(m)||0,D)});function CP(c){return Ea(c,O)}function Hl(c,m){if(typeof c!="function"||m!=null&&typeof m!="function")throw new Mn(i);var D=function(){var I=arguments,W=m?m.apply(this,I):I[0],J=D.cache;if(J.has(W))return J.get(W);var ae=c.apply(this,I);return D.cache=J.set(W,ae)||J,ae};return D.cache=new(Hl.Cache||Ii),D}Hl.Cache=Ii;function Gl(c){if(typeof c!="function")throw new Mn(i);return function(){var m=arguments;switch(m.length){case 0:return!c.call(this);case 1:return!c.call(this,m[0]);case 2:return!c.call(this,m[0],m[1]);case 3:return!c.call(this,m[0],m[1],m[2])}return!c.apply(this,m)}}function MP(c){return Q0(2,c)}var _P=dI(function(c,m){m=m.length==1&&Fr(m[0])?ct(m[0],cn(xr())):ct(Ht(m,1),cn(xr()));var D=m.length;return Rr(function(I){for(var W=-1,J=Et(I.length,D);++W=m}),$o=Fl(function(){return arguments}())?Fl:function(c){return Ot(c)&&at.call(c,"callee")&&!pl.call(c,"callee")},Fr=Ne.isArray,YP=Qf?cn(Qf):Ah;function On(c){return c!=null&&$l(c.length)&&!_a(c)}function kt(c){return Ot(c)&&On(c)}function HP(c){return c===!0||c===!1||Ot(c)&&on(c)==pe}var uo=hl||ud,GP=qu?cn(qu):Eh;function $P(c){return Ot(c)&&c.nodeType===1&&!lf(c)}function ZP(c){if(c==null)return!0;if(On(c)&&(Fr(c)||typeof c=="string"||typeof c.splice=="function"||uo(c)||Ls(c)||$o(c)))return!c.length;var m=pn(c);if(m==Ae||m==ne)return!c.size;if(uf(c))return!z(c).length;for(var D in c)if(at.call(c,D))return!1;return!0}function QP(c,m){return Vo(c,m)}function XP(c,m,D){D=typeof D=="function"?D:e;var I=D?D(c,m):e;return I===e?Vo(c,m,e,D):!!I}function Kh(c){if(!Ot(c))return!1;var m=on(c);return m==xe||m==Se||typeof c.message=="string"&&typeof c.name=="string"&&!lf(c)}function JP(c){return typeof c=="number"&&Ro(c)}function _a(c){if(!Ct(c))return!1;var m=on(c);return m==be||m==De||m==Me||m==ye}function rx(c){return typeof c=="number"&&c==Br(c)}function $l(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=q}function Ct(c){var m=typeof c;return c!=null&&(m=="object"||m=="function")}function Ot(c){return c!=null&&typeof c=="object"}var tx=Xf?cn(Xf):af;function KP(c,m){return c===m||aa(c,m,Wh(m))}function jP(c,m,D){return D=typeof D=="function"?D:e,aa(c,m,Wh(m),D)}function e5(c){return nx(c)&&c!=+c}function r5(c){if(LI(c))throw new Nr(n);return Yo(c)}function t5(c){return c===null}function n5(c){return c==null}function nx(c){return typeof c=="number"||Ot(c)&&on(c)==ze}function lf(c){if(!Ot(c)||on(c)!=K)return!1;var m=Ds(c);if(m===null)return!0;var D=at.call(m,"constructor")&&m.constructor;return typeof D=="function"&&D instanceof D&&Io.call(D)==Vm}var jh=Jf?cn(Jf):Wr;function i5(c){return rx(c)&&c>=-q&&c<=q}var ix=To?cn(To):g;function Zl(c){return typeof c=="string"||!Fr(c)&&Ot(c)&&on(c)==ue}function $n(c){return typeof c=="symbol"||Ot(c)&&on(c)==Ee}var Ls=Ti?cn(Ti):N;function a5(c){return c===e}function o5(c){return Ot(c)&&pn(c)==Le}function s5(c){return Ot(c)&&on(c)==Ie}var u5=Ll(se),f5=Ll(function(c,m){return c<=m});function ax(c){if(!c)return[];if(On(c))return Zl(c)?xn(c):Fn(c);if(Po&&c[Po])return Im(c[Po]());var m=pn(c),D=m==Ae?Zu:m==ne?ja:qs;return D(c)}function Ta(c){if(!c)return c===0?c:0;if(c=ci(c),c===V||c===-V){var m=c<0?-1:1;return m*R}return c===c?c:0}function Br(c){var m=Ta(c),D=m%1;return m===m?D?m-D:m:0}function ox(c){return c?Na(Br(c),0,U):0}function ci(c){if(typeof c=="number")return c;if($n(c))return j;if(Ct(c)){var m=typeof c.valueOf=="function"?c.valueOf():c;c=Ct(m)?m+"":m}if(typeof c!="string")return c===0?c:+c;c=nl(c);var D=At.test(c);return D||Wn.test(c)?$f(c.slice(2),D?2:8):Cn.test(c)?j:+c}function sx(c){return oa(c,Bn(c))}function l5(c){return c?Na(Br(c),-q,q):c===0?c:0}function st(c){return c==null?"":Gn(c)}var c5=Ps(function(c,m){if(uf(m)||On(m)){oa(m,rn(m),c);return}for(var D in m)at.call(m,D)&&Wo(c,D,m[D])}),ux=Ps(function(c,m){oa(m,Bn(m),c)}),Ql=Ps(function(c,m,D,I){oa(m,Bn(m),c,I)}),p5=Ps(function(c,m,D,I){oa(m,rn(m),c,I)}),m5=Ca(Bs);function h5(c,m){var D=io(c);return m==null?D:Ku(D,m)}var d5=Rr(function(c,m){c=kr(c);var D=-1,I=m.length,W=I>2?m[2]:e;for(W&&wn(m[0],m[1],W)&&(I=1);++D1),J}),oa(c,Uh(c),D),I&&(D=yn(D,o|u|p,EI));for(var W=m.length;W--;)Oh(D,m[W]);return D});function B5(c,m){return lx(c,Gl(xr(m)))}var I5=Ca(function(c,m){return c==null?{}:sI(c,m)});function lx(c,m){if(c==null)return{};var D=ct(Uh(c),function(I){return[I]});return m=xr(m),r0(c,D,function(I,W){return m(I,W[0])})}function P5(c,m,D){m=oo(m,c);var I=-1,W=m.length;for(W||(W=1,c=e);++Im){var I=c;c=m,m=I}if(D||c%1||m%1){var W=gl();return Et(c+W*(m-c+Gf("1e-"+((W+"").length-1))),m)}return _h(c,m)}var G5=ks(function(c,m,D){return m=m.toLowerCase(),c+(D?mx(m):m)});function mx(c){return td(st(c).toLowerCase())}function hx(c){return c=st(c),c&&c.replace(Cu,al).replace(hm,"")}function $5(c,m,D){c=st(c),m=Gn(m);var I=c.length;D=D===e?I:Na(Br(D),0,I);var W=D;return D-=m.length,D>=0&&c.slice(D,W)==m}function Z5(c){return c=st(c),c&&fr.test(c)?c.replace(Be,Tm):c}function Q5(c){return c=st(c),c&&Ya.test(c)?c.replace(Ci,"\\\\$&"):c}var X5=ks(function(c,m,D){return c+(D?"-":"")+m.toLowerCase()}),J5=ks(function(c,m,D){return c+(D?" ":"")+m.toLowerCase()}),K5=g0("toLowerCase");function j5(c,m,D){c=st(c),m=Br(m);var I=m?ea(c):0;if(!m||I>=m)return c;var W=(m-I)/2;return Rl(ko(W),D)+c+Rl(Ns(W),D)}function e6(c,m,D){c=st(c),m=Br(m);var I=m?ea(c):0;return m&&I>>0,D?(c=st(c),c&&(typeof m=="string"||m!=null&&!jh(m))&&(m=Gn(m),!m&&ii(c))?so(xn(c),0,D):c.split(m,D)):[]}var s6=ks(function(c,m,D){return c+(D?" ":"")+td(m)});function u6(c,m,D){return c=st(c),D=D==null?0:Na(Br(D),0,c.length),m=Gn(m),c.slice(D,D+m.length)==m}function f6(c,m,D){var I=Z.templateSettings;D&&wn(c,m,D)&&(m=e),c=st(c),m=Ql({},m,I,N0);var W=Ql({},m.imports,I.imports,N0),J=rn(W),ae=$u(W,J),fe,de,Re=0,qe=m.interpolate||Ha,Ve="__p += '",Ke=Fi((m.escape||Ha).source+"|"+qe.source+"|"+(qe===Yt?zt:Ha).source+"|"+(m.evaluate||Ha).source+"|$","g"),cr="//# sourceURL="+(at.call(m,"sourceURL")?(m.sourceURL+"").replace(/\\s/g," "):"lodash.templateSources["+ ++ym+"]")+\` -\`;c.replace(Ke,function(Dr,qr,Hr,Zn,Dn,Qn){return Hr||(Hr=Zn),Ve+=c.slice(Re,Qn).replace(Mu,Fm),qr&&(fe=!0,Ve+=\`' + -__e(\`+qr+\`) + -'\`),Dn&&(de=!0,Ve+=\`'; -\`+Dn+\`; -__p += '\`),Hr&&(Ve+=\`' + -((__t = (\`+Hr+\`)) == null ? '' : __t) + -'\`),Re=Qn+Dr.length,Dr}),Ve+=\`'; -\`;var wr=at.call(m,"variable")&&m.variable;if(!wr)Ve=\`with (obj) { -\`+Ve+\` -} -\`;else if(ga.test(wr))throw new Nr(a);Ve=(de?Ve.replace(We,""):Ve).replace(B,"$1").replace(Q,"$1;"),Ve="function("+(wr||"obj")+\`) { -\`+(wr?"":\`obj || (obj = {}); -\`)+"var __t, __p = ''"+(fe?", __e = _.escape":"")+(de?\`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -\`:\`; -\`)+Ve+\`return __p -}\`;var Pr=vx(function(){return jr(J,cr+"return "+Ve).apply(e,ae)});if(Pr.source=Ve,Kh(Pr))throw Pr;return Pr}function l6(c){return st(c).toLowerCase()}function c6(c){return st(c).toUpperCase()}function p6(c,m,D){if(c=st(c),c&&(D||m===e))return nl(c);if(!c||!(m=Gn(m)))return c;var I=xn(c),W=xn(m),J=ht(I,W),ae=il(I,W)+1;return so(I,J,ae).join("")}function m6(c,m,D){if(c=st(c),c&&(D||m===e))return c.slice(0,gs(c)+1);if(!c||!(m=Gn(m)))return c;var I=xn(c),W=il(I,xn(m))+1;return so(I,0,W).join("")}function h6(c,m,D){if(c=st(c),c&&(D||m===e))return c.replace(rr,"");if(!c||!(m=Gn(m)))return c;var I=xn(c),W=ht(I,xn(m));return so(I,W).join("")}function d6(c,m){var D=F,I=M;if(Ct(m)){var W="separator"in m?m.separator:W;D="length"in m?Br(m.length):D,I="omission"in m?Gn(m.omission):I}c=st(c);var J=c.length;if(ii(c)){var ae=xn(c);J=ae.length}if(D>=J)return c;var fe=D-ea(I);if(fe<1)return I;var de=ae?so(ae,0,fe).join(""):c.slice(0,fe);if(W===e)return de+I;if(ae&&(fe+=de.length-fe),jh(W)){if(c.slice(fe).search(W)){var Re,qe=de;for(W.global||(W=Fi(W.source,st(En.exec(W))+"g")),W.lastIndex=0;Re=W.exec(qe);)var Ve=Re.index;de=de.slice(0,Ve===e?fe:Ve)}}else if(c.indexOf(Gn(W),fe)!=fe){var Ke=de.lastIndexOf(W);Ke>-1&&(de=de.slice(0,Ke))}return de+I}function v6(c){return c=st(c),c&&er.test(c)?c.replace(ve,Rm):c}var g6=ks(function(c,m,D){return c+(D?" ":"")+m.toUpperCase()}),td=g0("toUpperCase");function dx(c,m,D){return c=st(c),m=D?e:m,m===e?Bm(c)?Um(c):Cm(c):c.match(m)||[]}var vx=Rr(function(c,m){try{return an(c,e,m)}catch(D){return Kh(D)?D:new Nr(D)}}),x6=Ca(function(c,m){return Tt(m,function(D){D=sa(D),Pi(c,D,Xh(c[D],c))}),c});function y6(c){var m=c==null?0:c.length,D=xr();return c=m?ct(c,function(I){if(typeof I[1]!="function")throw new Mn(i);return[D(I[0]),I[1]]}):[],Rr(function(I){for(var W=-1;++Wq)return[];var D=U,I=Et(c,U);m=xr(m),c-=U;for(var W=Gu(I,m);++D0||m<0)?new Ir(D):(c<0?D=D.takeRight(-c):c&&(D=D.drop(c)),m!==e&&(m=Br(m),D=m<0?D.dropRight(-m):D.take(m-c)),D)},Ir.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Ir.prototype.toArray=function(){return this.take(U)},ai(Ir.prototype,function(c,m){var D=/^(?:filter|find|map|reject)|While$/.test(m),I=/^(?:head|last)$/.test(m),W=Z[I?"take"+(m=="last"?"Right":""):m],J=I||/^find/.test(m);!W||(Z.prototype[m]=function(){var ae=this.__wrapped__,fe=I?[1]:arguments,de=ae instanceof Ir,Re=fe[0],qe=de||Fr(ae),Ve=function(qr){var Hr=W.apply(Z,ni([qr],fe));return I&&Ke?Hr[0]:Hr};qe&&D&&typeof Re=="function"&&Re.length!=1&&(de=qe=!1);var Ke=this.__chain__,cr=!!this.__actions__.length,wr=J&&!Ke,Pr=de&&!cr;if(!J&&qe){ae=Pr?ae:new Ir(this);var Dr=c.apply(ae,fe);return Dr.__actions__.push({func:Wl,args:[Ve],thisArg:e}),new _n(Dr,Ke)}return wr&&Pr?c.apply(this,fe):(Dr=this.thru(Ve),wr?I?Dr.value()[0]:Dr.value():Dr)})}),Tt(["pop","push","shift","sort","splice","unshift"],function(c){var m=Bo[c],D=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",I=/^(?:pop|shift)$/.test(c);Z.prototype[c]=function(){var W=arguments;if(I&&!this.__chain__){var J=this.value();return m.apply(Fr(J)?J:[],W)}return this[D](function(ae){return m.apply(Fr(ae)?ae:[],W)})}}),ai(Ir.prototype,function(c,m){var D=Z[m];if(D){var I=D.name+"";at.call(no,I)||(no[I]=[]),no[I].push({name:m,func:D})}}),no[Pl(e,v).name]=[{name:"wrapper",func:e}],Ir.prototype.clone=rh,Ir.prototype.reverse=th,Ir.prototype.value=nh,Z.prototype.at=$4,Z.prototype.chain=Z4,Z.prototype.commit=Q4,Z.prototype.next=X4,Z.prototype.plant=K4,Z.prototype.reverse=j4,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=eP,Z.prototype.first=Z.prototype.head,Po&&(Z.prototype[Po]=J4),Z},ra=zm();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Wt._=ra,define(function(){return ra})):Ki?((Ki.exports=ra)._=ra,Lu._=ra):Wt._=ra}).call(Us)});var Yx=un((Od,Ws)=>{(function(e,r){typeof Od=="object"&&typeof Ws<"u"?Ws.exports=r():typeof define=="function"&&define.amd?define(r):e.moment=r()})(Od,function(){"use strict";var e;function r(){return e.apply(null,arguments)}function t(g){e=g}function n(g){return g instanceof Array||Object.prototype.toString.call(g)==="[object Array]"}function i(g){return g!=null&&Object.prototype.toString.call(g)==="[object Object]"}function a(g,N){return Object.prototype.hasOwnProperty.call(g,N)}function s(g){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(g).length===0;var N;for(N in g)if(a(g,N))return!1;return!0}function l(g){return g===void 0}function f(g){return typeof g=="number"||Object.prototype.toString.call(g)==="[object Number]"}function o(g){return g instanceof Date||Object.prototype.toString.call(g)==="[object Date]"}function u(g,N){var P=[],z,G=g.length;for(z=0;z>>0,z;for(z=0;z0)for(P=0;P=0;return(se?P?"+":"":"-")+Math.pow(10,Math.max(0,G)).toString().substr(1)+z}var U=/(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,oe=/(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,me={},ie={};function H(g,N,P,z){var G=z;typeof z=="string"&&(G=function(){return this[z]()}),g&&(ie[g]=G),N&&(ie[N[0]]=function(){return j(G.apply(this,arguments),N[1],N[2])}),P&&(ie[P]=function(){return this.localeData().ordinal(G.apply(this,arguments),g)})}function ce(g){return g.match(/\\[[\\s\\S]/)?g.replace(/^\\[|\\]$/g,""):g.replace(/\\\\/g,"")}function Me(g){var N=g.match(U),P,z;for(P=0,z=N.length;P=0&&oe.test(g);)g=g.replace(oe,z),oe.lastIndex=0,P-=1;return g}var Se={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function xe(g){var N=this._longDateFormat[g],P=this._longDateFormat[g.toUpperCase()];return N||!P?N:(this._longDateFormat[g]=P.match(U).map(function(z){return z==="MMMM"||z==="MM"||z==="DD"||z==="dddd"?z.slice(1):z}).join(""),this._longDateFormat[g])}var be="Invalid date";function De(){return this._invalidDate}var Ae="%d",ze=/\\d{1,2}/;function Ze(g){return this._ordinal.replace("%d",g)}var K={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function te(g,N,P,z){var G=this._relativeTime[P];return k(G)?G(g,N,P,z):G.replace(/%d/i,g)}function ye(g,N){var P=this._relativeTime[g>0?"future":"past"];return k(P)?P(N):P.replace(/%s/i,N)}var ee={};function ne(g,N){var P=g.toLowerCase();ee[P]=ee[P+"s"]=ee[N]=g}function ue(g){return typeof g=="string"?ee[g]||ee[g.toLowerCase()]:void 0}function Ee(g){var N={},P,z;for(z in g)a(g,z)&&(P=ue(z),P&&(N[P]=g[z]));return N}var Ce={};function Le(g,N){Ce[g]=N}function Ie(g){var N=[],P;for(P in g)a(g,P)&&N.push({unit:P,priority:Ce[P]});return N.sort(function(z,G){return z.priority-G.priority}),N}function sr(g){return g%4===0&&g%100!==0||g%400===0}function ir(g){return g<0?Math.ceil(g)||0:Math.floor(g)}function Xe(g){var N=+g,P=0;return N!==0&&isFinite(N)&&(P=ir(N)),P}function Or(g,N){return function(P){return P!=null?(le(this,g,P),r.updateOffset(this,N),this):re(this,g)}}function re(g,N){return g.isValid()?g._d["get"+(g._isUTC?"UTC":"")+N]():NaN}function le(g,N,P){g.isValid()&&!isNaN(P)&&(N==="FullYear"&&sr(g.year())&&g.month()===1&&g.date()===29?(P=Xe(P),g._d["set"+(g._isUTC?"UTC":"")+N](P,g.month(),Ga(P,g.month()))):g._d["set"+(g._isUTC?"UTC":"")+N](P))}function we(g){return g=ue(g),k(this[g])?this[g]():this}function Oe(g,N){if(typeof g=="object"){g=Ee(g);var P=Ie(g),z,G=P.length;for(z=0;z68?1900:2e3)};var Bu=Or("FullYear",!0);function sm(){return sr(this.year())}function Rf(g,N,P,z,G,se,Te){var mr;return g<100&&g>=0?(mr=new Date(g+400,N,P,z,G,se,Te),isFinite(mr.getFullYear())&&mr.setFullYear(g)):mr=new Date(g,N,P,z,G,se,Te),mr}function $a(g){var N,P;return g<100&&g>=0?(P=Array.prototype.slice.call(arguments),P[0]=g+400,N=new Date(Date.UTC.apply(null,P)),isFinite(N.getUTCFullYear())&&N.setUTCFullYear(g)):N=new Date(Date.UTC.apply(null,arguments)),N}function Za(g,N,P){var z=7+N-P,G=(7+$a(g,0,z).getUTCDay()-N)%7;return-G+z-1}function Lf(g,N,P,z,G){var se=(7+P-z)%7,Te=Za(g,z,G),mr=1+7*(N-1)+se+Te,Tr,et;return mr<=0?(Tr=g-1,et=Ji(Tr)+mr):mr>Ji(g)?(Tr=g+1,et=mr-Ji(g)):(Tr=g,et=mr),{year:Tr,dayOfYear:et}}function Qa(g,N,P){var z=Za(g.year(),N,P),G=Math.floor((g.dayOfYear()-z-1)/7)+1,se,Te;return G<1?(Te=g.year()-1,se=G+Vn(Te,N,P)):G>Vn(g.year(),N,P)?(se=G-Vn(g.year(),N,P),Te=g.year()+1):(Te=g.year(),se=G),{week:se,year:Te}}function Vn(g,N,P){var z=Za(g,N,P),G=Za(g+1,N,P);return(Ji(g)-z+G)/7}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),ne("week","w"),ne("isoWeek","W"),Le("week",5),Le("isoWeek",5),rr("w",Q),rr("ww",Q,_e),rr("W",Q),rr("WW",Q,_e),ga(["w","ww","W","WW"],function(g,N,P,z){N[z.substr(0,1)]=Xe(g)});function Iu(g){return Qa(g,this._week.dow,this._week.doy).week}var Xa={dow:0,doy:6};function qf(){return this._week.dow}function Uf(){return this._week.doy}function um(g){var N=this.localeData().week(this);return g==null?N:this.add((g-N)*7,"d")}function zf(g){var N=Qa(this,1,4).week;return g==null?N:this.add((g-N)*7,"d")}H("d",0,"do","day"),H("dd",0,0,function(g){return this.localeData().weekdaysMin(this,g)}),H("ddd",0,0,function(g){return this.localeData().weekdaysShort(this,g)}),H("dddd",0,0,function(g){return this.localeData().weekdays(this,g)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),ne("day","d"),ne("weekday","e"),ne("isoWeekday","E"),Le("day",11),Le("weekday",11),Le("isoWeekday",11),rr("d",Q),rr("e",Q),rr("E",Q),rr("dd",function(g,N){return N.weekdaysMinRegex(g)}),rr("ddd",function(g,N){return N.weekdaysShortRegex(g)}),rr("dddd",function(g,N){return N.weekdaysRegex(g)}),ga(["dd","ddd","dddd"],function(g,N,P,z){var G=P._locale.weekdaysParse(g,z,P._strict);G!=null?N.d=G:x(P).invalidWeekday=g}),ga(["d","e","E"],function(g,N,P,z){N[z]=Xe(g)});function Wf(g,N){return typeof g!="string"?g:isNaN(g)?(g=N.weekdaysParse(g),typeof g=="number"?g:null):parseInt(g,10)}function Vf(g,N){return typeof g=="string"?N.weekdaysParse(g)%7||7:isNaN(g)?null:g}function ms(g,N){return g.slice(N,7).concat(g.slice(0,N))}var fm="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Yf="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),lm="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Hf=Ci,cm=Ci,pm=Ci;function mm(g,N){var P=n(this._weekdays)?this._weekdays:this._weekdays[g&&g!==!0&&this._weekdays.isFormat.test(N)?"format":"standalone"];return g===!0?ms(P,this._week.dow):g?P[g.day()]:P}function hm(g){return g===!0?ms(this._weekdaysShort,this._week.dow):g?this._weekdaysShort[g.day()]:this._weekdaysShort}function Pu(g){return g===!0?ms(this._weekdaysMin,this._week.dow):g?this._weekdaysMin[g.day()]:this._weekdaysMin}function dm(g,N,P){var z,G,se,Te=g.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],z=0;z<7;++z)se=h([2e3,1]).day(z),this._minWeekdaysParse[z]=this.weekdaysMin(se,"").toLocaleLowerCase(),this._shortWeekdaysParse[z]=this.weekdaysShort(se,"").toLocaleLowerCase(),this._weekdaysParse[z]=this.weekdays(se,"").toLocaleLowerCase();return P?N==="dddd"?(G=pt.call(this._weekdaysParse,Te),G!==-1?G:null):N==="ddd"?(G=pt.call(this._shortWeekdaysParse,Te),G!==-1?G:null):(G=pt.call(this._minWeekdaysParse,Te),G!==-1?G:null):N==="dddd"?(G=pt.call(this._weekdaysParse,Te),G!==-1||(G=pt.call(this._shortWeekdaysParse,Te),G!==-1)?G:(G=pt.call(this._minWeekdaysParse,Te),G!==-1?G:null)):N==="ddd"?(G=pt.call(this._shortWeekdaysParse,Te),G!==-1||(G=pt.call(this._weekdaysParse,Te),G!==-1)?G:(G=pt.call(this._minWeekdaysParse,Te),G!==-1?G:null)):(G=pt.call(this._minWeekdaysParse,Te),G!==-1||(G=pt.call(this._weekdaysParse,Te),G!==-1)?G:(G=pt.call(this._shortWeekdaysParse,Te),G!==-1?G:null))}function vm(g,N,P){var z,G,se;if(this._weekdaysParseExact)return dm.call(this,g,N,P);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),z=0;z<7;z++){if(G=h([2e3,1]).day(z),P&&!this._fullWeekdaysParse[z]&&(this._fullWeekdaysParse[z]=new RegExp("^"+this.weekdays(G,"").replace(".","\\\\.?")+"$","i"),this._shortWeekdaysParse[z]=new RegExp("^"+this.weekdaysShort(G,"").replace(".","\\\\.?")+"$","i"),this._minWeekdaysParse[z]=new RegExp("^"+this.weekdaysMin(G,"").replace(".","\\\\.?")+"$","i")),this._weekdaysParse[z]||(se="^"+this.weekdays(G,"")+"|^"+this.weekdaysShort(G,"")+"|^"+this.weekdaysMin(G,""),this._weekdaysParse[z]=new RegExp(se.replace(".",""),"i")),P&&N==="dddd"&&this._fullWeekdaysParse[z].test(g))return z;if(P&&N==="ddd"&&this._shortWeekdaysParse[z].test(g))return z;if(P&&N==="dd"&&this._minWeekdaysParse[z].test(g))return z;if(!P&&this._weekdaysParse[z].test(g))return z}}function gm(g){if(!this.isValid())return g!=null?this:NaN;var N=this._isUTC?this._d.getUTCDay():this._d.getDay();return g!=null?(g=Wf(g,this.localeData()),this.add(g-N,"d")):N}function xm(g){if(!this.isValid())return g!=null?this:NaN;var N=(this.day()+7-this.localeData()._week.dow)%7;return g==null?N:this.add(g-N,"d")}function ym(g){if(!this.isValid())return g!=null?this:NaN;if(g!=null){var N=Vf(g,this.localeData());return this.day(this.day()%7?N:N-7)}else return this.day()||7}function dt(g){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||ku.call(this),g?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Hf),this._weekdaysStrictRegex&&g?this._weekdaysStrictRegex:this._weekdaysRegex)}function mt(g){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||ku.call(this),g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=cm),this._weekdaysShortStrictRegex&&g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function bm(g){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||ku.call(this),g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=pm),this._weekdaysMinStrictRegex&&g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function ku(){function g(sn,ui){return ui.length-sn.length}var N=[],P=[],z=[],G=[],se,Te,mr,Tr,et;for(se=0;se<7;se++)Te=h([2e3,1]).day(se),mr=nn(this.weekdaysMin(Te,"")),Tr=nn(this.weekdaysShort(Te,"")),et=nn(this.weekdays(Te,"")),N.push(mr),P.push(Tr),z.push(et),G.push(mr),G.push(Tr),G.push(et);N.sort(g),P.sort(g),z.sort(g),G.sort(g),this._weekdaysRegex=new RegExp("^("+G.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+z.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+P.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+N.join("|")+")","i")}function Ru(){return this.hours()%12||12}function wm(){return this.hours()||24}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Ru),H("k",["kk",2],0,wm),H("hmm",0,0,function(){return""+Ru.apply(this)+j(this.minutes(),2)}),H("hmmss",0,0,function(){return""+Ru.apply(this)+j(this.minutes(),2)+j(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+j(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+j(this.minutes(),2)+j(this.seconds(),2)});function Gf(g,N){H(g,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),N)})}Gf("a",!0),Gf("A",!1),ne("hour","h"),Le("hour",13);function $f(g,N){return N._meridiemParse}rr("a",$f),rr("A",$f),rr("H",Q),rr("h",Q),rr("k",Q),rr("HH",Q,_e),rr("hh",Q,_e),rr("kk",Q,_e),rr("hmm",ve),rr("hmmss",Be),rr("Hmm",ve),rr("Hmmss",Be),nt(["H","HH"],At),nt(["k","kk"],function(g,N,P){var z=Xe(g);N[At]=z===24?0:z}),nt(["a","A"],function(g,N,P){P._isPm=P._locale.isPM(g),P._meridiem=g}),nt(["h","hh"],function(g,N,P){N[At]=Xe(g),x(P).bigHour=!0}),nt("hmm",function(g,N,P){var z=g.length-2;N[At]=Xe(g.substr(0,z)),N[gn]=Xe(g.substr(z)),x(P).bigHour=!0}),nt("hmmss",function(g,N,P){var z=g.length-4,G=g.length-2;N[At]=Xe(g.substr(0,z)),N[gn]=Xe(g.substr(z,2)),N[Wn]=Xe(g.substr(G)),x(P).bigHour=!0}),nt("Hmm",function(g,N,P){var z=g.length-2;N[At]=Xe(g.substr(0,z)),N[gn]=Xe(g.substr(z))}),nt("Hmmss",function(g,N,P){var z=g.length-4,G=g.length-2;N[At]=Xe(g.substr(0,z)),N[gn]=Xe(g.substr(z,2)),N[Wn]=Xe(g.substr(G))});function Zf(g){return(g+"").toLowerCase().charAt(0)==="p"}var Dm=/[ap]\\.?m?\\.?/i,Wt=Or("Hours",!0);function Lu(g,N,P){return g>11?P?"pm":"PM":P?"am":"AM"}var Ki={calendar:q,longDateFormat:Se,invalidDate:be,ordinal:Ae,dayOfMonthOrdinalParse:ze,relativeTime:K,months:_u,monthsShort:fs,week:Xa,weekdays:fm,weekdaysMin:lm,weekdaysShort:Yf,meridiemParse:Dm},vt={},ya={},en;function Qf(g,N){var P,z=Math.min(g.length,N.length);for(P=0;P0;){if(G=To(se.slice(0,P).join("-")),G)return G;if(z&&z.length>=P&&Qf(se,z)>=P-1)break;P--}N++}return en}function Jf(g){return g.match("^[^/\\\\\\\\]*$")!=null}function To(g){var N=null,P;if(vt[g]===void 0&&typeof Ws<"u"&&Ws&&Ws.exports&&Jf(g))try{N=en._abbr,P=require,P("./locale/"+g),Ti(N)}catch{vt[g]=null}return vt[g]}function Ti(g,N){var P;return g&&(l(N)?P=Tt(g):P=an(g,N),P?en=P:typeof console<"u"&&console.warn&&console.warn("Locale "+g+" not found. Did you forget to load it?")),en._abbr}function an(g,N){if(N!==null){var P,z=Ki;if(N.abbr=g,vt[g]!=null)_("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),z=vt[g]._config;else if(N.parentLocale!=null)if(vt[N.parentLocale]!=null)z=vt[N.parentLocale]._config;else if(P=To(N.parentLocale),P!=null)z=P._config;else return ya[N.parentLocale]||(ya[N.parentLocale]=[]),ya[N.parentLocale].push({name:g,config:N}),null;return vt[g]=new $(Y(z,N)),ya[g]&&ya[g].forEach(function(G){an(G.name,G.config)}),Ti(g),vt[g]}else return delete vt[g],null}function Sm(g,N){if(N!=null){var P,z,G=Ki;vt[g]!=null&&vt[g].parentLocale!=null?vt[g].set(Y(vt[g]._config,N)):(z=To(g),z!=null&&(G=z._config),N=Y(G,N),z==null&&(N.abbr=g),P=new $(N),P.parentLocale=vt[g],vt[g]=P),Ti(g)}else vt[g]!=null&&(vt[g].parentLocale!=null?(vt[g]=vt[g].parentLocale,g===Ti()&&Ti(g)):vt[g]!=null&&delete vt[g]);return vt[g]}function Tt(g){var N;if(g&&g._locale&&g._locale._abbr&&(g=g._locale._abbr),!g)return en;if(!n(g)){if(N=To(g),N)return N;g=[g]}return Xf(g)}function Nm(){return V(vt)}function hs(g){var N,P=g._a;return P&&x(g).overflow===-2&&(N=P[En]<0||P[En]>11?En:P[Cn]<1||P[Cn]>Ga(P[zt],P[En])?Cn:P[At]<0||P[At]>24||P[At]===24&&(P[gn]!==0||P[Wn]!==0||P[Mi]!==0)?At:P[gn]<0||P[gn]>59?gn:P[Wn]<0||P[Wn]>59?Wn:P[Mi]<0||P[Mi]>999?Mi:-1,x(g)._overflowDayOfYear&&(NCn)&&(N=Cn),x(g)._overflowWeeks&&N===-1&&(N=Cu),x(g)._overflowWeekday&&N===-1&&(N=Ha),x(g).overflow=N),g}var ji=/^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,ds=/^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,Uu=/Z|[+-]\\d\\d(?::?\\d\\d)?/,ct=[["YYYYYY-MM-DD",/[+-]\\d{6}-\\d\\d-\\d\\d/],["YYYY-MM-DD",/\\d{4}-\\d\\d-\\d\\d/],["GGGG-[W]WW-E",/\\d{4}-W\\d\\d-\\d/],["GGGG-[W]WW",/\\d{4}-W\\d\\d/,!1],["YYYY-DDD",/\\d{4}-\\d{3}/],["YYYY-MM",/\\d{4}-\\d\\d/,!1],["YYYYYYMMDD",/[+-]\\d{10}/],["YYYYMMDD",/\\d{8}/],["GGGG[W]WWE",/\\d{4}W\\d{3}/],["GGGG[W]WW",/\\d{4}W\\d{2}/,!1],["YYYYDDD",/\\d{7}/],["YYYYMM",/\\d{6}/,!1],["YYYY",/\\d{4}/,!1]],ni=[["HH:mm:ss.SSSS",/\\d\\d:\\d\\d:\\d\\d\\.\\d+/],["HH:mm:ss,SSSS",/\\d\\d:\\d\\d:\\d\\d,\\d+/],["HH:mm:ss",/\\d\\d:\\d\\d:\\d\\d/],["HH:mm",/\\d\\d:\\d\\d/],["HHmmss.SSSS",/\\d\\d\\d\\d\\d\\d\\.\\d+/],["HHmmss,SSSS",/\\d\\d\\d\\d\\d\\d,\\d+/],["HHmmss",/\\d\\d\\d\\d\\d\\d/],["HHmm",/\\d\\d\\d\\d/],["HH",/\\d\\d/]],zu=/^\\/?Date\\((-?\\d+)/i,Am=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,Wu={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Kf(g){var N,P,z=g._i,G=ji.exec(z)||ds.exec(z),se,Te,mr,Tr,et=ct.length,sn=ni.length;if(G){for(x(g).iso=!0,N=0,P=et;NJi(Te)||g._dayOfYear===0)&&(x(g)._overflowDayOfYear=!0),P=$a(Te,0,g._dayOfYear),g._a[En]=P.getUTCMonth(),g._a[Cn]=P.getUTCDate()),N=0;N<3&&g._a[N]==null;++N)g._a[N]=z[N]=G[N];for(;N<7;N++)g._a[N]=z[N]=g._a[N]==null?N===2?1:0:g._a[N];g._a[At]===24&&g._a[gn]===0&&g._a[Wn]===0&&g._a[Mi]===0&&(g._nextDay=!0,g._a[At]=0),g._d=(g._useUTC?$a:Rf).apply(null,z),se=g._useUTC?g._d.getUTCDay():g._d.getDay(),g._tzm!=null&&g._d.setUTCMinutes(g._d.getUTCMinutes()-g._tzm),g._nextDay&&(g._a[At]=24),g._w&&typeof g._w.d<"u"&&g._w.d!==se&&(x(g).weekdayMismatch=!0)}}function tl(g){var N,P,z,G,se,Te,mr,Tr,et;N=g._w,N.GG!=null||N.W!=null||N.E!=null?(se=1,Te=4,P=ba(N.GG,g._a[zt],Qa(ht(),1,4).year),z=ba(N.W,1),G=ba(N.E,1),(G<1||G>7)&&(Tr=!0)):(se=g._locale._week.dow,Te=g._locale._week.doy,et=Qa(ht(),se,Te),P=ba(N.gg,g._a[zt],et.year),z=ba(N.w,et.week),N.d!=null?(G=N.d,(G<0||G>6)&&(Tr=!0)):N.e!=null?(G=N.e+se,(N.e<0||N.e>6)&&(Tr=!0)):G=se),z<1||z>Vn(P,se,Te)?x(g)._overflowWeeks=!0:Tr!=null?x(g)._overflowWeekday=!0:(mr=Lf(P,z,G,se,Te),g._a[zt]=mr.year,g._dayOfYear=mr.dayOfYear)}r.ISO_8601=function(){},r.RFC_2822=function(){};function Yu(g){if(g._f===r.ISO_8601){Kf(g);return}if(g._f===r.RFC_2822){el(g);return}g._a=[],x(g).empty=!0;var N=""+g._i,P,z,G,se,Te,mr=N.length,Tr=0,et,sn;for(G=ge(g._f,g._locale).match(U)||[],sn=G.length,P=0;P0&&x(g).unusedInput.push(Te),N=N.slice(N.indexOf(z)+z.length),Tr+=z.length),ie[se]?(z?x(g).empty=!1:x(g).unusedTokens.push(se),Eu(se,z,g)):g._strict&&!z&&x(g).unusedTokens.push(se);x(g).charsLeftOver=mr-Tr,N.length>0&&x(g).unusedInput.push(N),g._a[At]<=12&&x(g).bigHour===!0&&g._a[At]>0&&(x(g).bigHour=void 0),x(g).parsedDateParts=g._a.slice(0),x(g).meridiem=g._meridiem,g._a[At]=Hu(g._locale,g._a[At],g._meridiem),et=x(g).era,et!==null&&(g._a[zt]=g._locale.erasConvertYear(et,g._a[zt])),Fo(g),hs(g)}function Hu(g,N,P){var z;return P==null?N:g.meridiemHour!=null?g.meridiemHour(N,P):(g.isPM!=null&&(z=g.isPM(P),z&&N<12&&(N+=12),!z&&N===12&&(N=0)),N)}function Gu(g){var N,P,z,G,se,Te,mr=!1,Tr=g._f.length;if(Tr===0){x(g).invalidFormat=!0,g._d=new Date(NaN);return}for(G=0;Gthis?this:g:w()});function al(g,N){var P,z;if(N.length===1&&n(N[0])&&(N=N[0]),!N.length)return ht();for(P=N[0],z=1;zthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Fe(){if(!l(this._isDSTShifted))return this._isDSTShifted;var g={},N;return A(g,this),g=cn(g),g._a?(N=g._isUTC?h(g._a):ht(g._a),this._isDSTShifted=this.isValid()&&Pm(g._a,N.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Ne(){return this.isValid()?!this._isUTC:!1}function nr(){return this.isValid()?this._isUTC:!1}function Nr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var jr=/^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,Pt=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function kr(g,N){var P=g,z=null,G,se,Te;return Yn(g)?P={ms:g._milliseconds,d:g._days,M:g._months}:f(g)||!isNaN(+g)?(P={},N?P[N]=+g:P.milliseconds=+g):(z=jr.exec(g))?(G=z[1]==="-"?-1:1,P={y:0,d:Xe(z[Cn])*G,h:Xe(z[At])*G,m:Xe(z[gn])*G,s:Xe(z[Wn])*G,ms:Xe(ja(z[Mi]*1e3))*G}):(z=Pt.exec(g))?(G=z[1]==="-"?-1:1,P={y:Fi(z[2],G),M:Fi(z[3],G),w:Fi(z[4],G),d:Fi(z[5],G),h:Fi(z[6],G),m:Fi(z[7],G),s:Fi(z[8],G)}):P==null?P={}:typeof P=="object"&&("from"in P||"to"in P)&&(Te=Mn(ht(P.from),ht(P.to)),P={},P.ms=Te.milliseconds,P.M=Te.months),se=new Oo(P),Yn(g)&&a(g,"_locale")&&(se._locale=g._locale),Yn(g)&&a(g,"_isValid")&&(se._isValid=g._isValid),se}kr.fn=Oo.prototype,kr.invalid=Zu;function Fi(g,N){var P=g&&parseFloat(g.replace(",","."));return(isNaN(P)?0:P)*N}function sl(g,N){var P={};return P.months=N.month()-g.month()+(N.year()-g.year())*12,g.clone().add(P.months,"M").isAfter(N)&&--P.months,P.milliseconds=+N-+g.clone().add(P.months,"M"),P}function Mn(g,N){var P;return g.isValid()&&N.isValid()?(N=xn(N,g),g.isBefore(N)?P=sl(g,N):(P=sl(N,g),P.milliseconds=-P.milliseconds,P.months=-P.months),P):{milliseconds:0,months:0}}function Bo(g,N){return function(P,z){var G,se;return z!==null&&!isNaN(+z)&&(_(N,"moment()."+N+"(period, number) is deprecated. Please use moment()."+N+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),se=P,P=z,z=se),G=kr(P,z),ul(this,G,g),this}}function ul(g,N,P,z){var G=N._milliseconds,se=ja(N._days),Te=ja(N._months);!g.isValid()||(z=z??!0,Te&&Xi(g,re(g,"Month")+Te*P),se&&le(g,"Date",re(g,"Date")+se*P),G&&g._d.setTime(g._d.valueOf()+G*P),z&&r.updateOffset(g,se||Te))}var eo=Bo(1,"add"),xs=Bo(-1,"subtract");function Io(g){return typeof g=="string"||g instanceof String}function at(g){return S(g)||o(g)||Io(g)||f(g)||fl(g)||Wm(g)||g===null||g===void 0}function Wm(g){var N=i(g)&&!s(g),P=!1,z=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],G,se,Te=z.length;for(G=0;GP.valueOf():P.valueOf()9999?pe(P,N?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):k(Date.prototype.toISOString)?N?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",pe(P,"Z")):pe(P,N?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Da(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var g="moment",N="",P,z,G,se;return this.isLocal()||(g=this.utcOffset()===0?"moment.utc":"moment.parseZone",N="Z"),P="["+g+'("]',z=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",G="-MM-DD[T]HH:mm:ss.SSS",se=N+'[")]',this.format(P+z+G+se)}function Ss(g){g||(g=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var N=pe(this,g);return this.localeData().postformat(N)}function Gm(g,N){return this.isValid()&&(S(g)&&g.isValid()||ht(g).isValid())?kr({to:this,from:g}).locale(this.locale()).humanize(!N):this.localeData().invalidDate()}function $m(g){return this.from(ht(),g)}function Zm(g,N){return this.isValid()&&(S(g)&&g.isValid()||ht(g).isValid())?kr({from:this,to:g}).locale(this.locale()).humanize(!N):this.localeData().invalidDate()}function Ns(g){return this.to(ht(),g)}function ko(g){var N;return g===void 0?this._locale._abbr:(N=Tt(g),N!=null&&(this._locale=N),this)}var As=F("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(g){return g===void 0?this.localeData():this.locale(g)});function hl(){return this._locale}var Ro=1e3,ro=60*Ro,Es=60*ro,Ft=(365*400+97)*24*Es;function Et(g,N){return(g%N+N)%N}function dl(g,N,P){return g<100&&g>=0?new Date(g+400,N,P)-Ft:new Date(g,N,P).valueOf()}function vl(g,N,P){return g<100&&g>=0?Date.UTC(g+400,N,P)-Ft:Date.UTC(g,N,P)}function gl(g){var N,P;if(g=ue(g),g===void 0||g==="millisecond"||!this.isValid())return this;switch(P=this._isUTC?vl:dl,g){case"year":N=P(this.year(),0,1);break;case"quarter":N=P(this.year(),this.month()-this.month()%3,1);break;case"month":N=P(this.year(),this.month(),1);break;case"week":N=P(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":N=P(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":N=P(this.year(),this.month(),this.date());break;case"hour":N=this._d.valueOf(),N-=Et(N+(this._isUTC?0:this.utcOffset()*ro),Es);break;case"minute":N=this._d.valueOf(),N-=Et(N,ro);break;case"second":N=this._d.valueOf(),N-=Et(N,Ro);break}return this._d.setTime(N),r.updateOffset(this,!0),this}function Qm(g){var N,P;if(g=ue(g),g===void 0||g==="millisecond"||!this.isValid())return this;switch(P=this._isUTC?vl:dl,g){case"year":N=P(this.year()+1,0,1)-1;break;case"quarter":N=P(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":N=P(this.year(),this.month()+1,1)-1;break;case"week":N=P(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":N=P(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":N=P(this.year(),this.month(),this.date()+1)-1;break;case"hour":N=this._d.valueOf(),N+=Es-Et(N+(this._isUTC?0:this.utcOffset()*ro),Es)-1;break;case"minute":N=this._d.valueOf(),N+=ro-Et(N,ro)-1;break;case"second":N=this._d.valueOf(),N+=Ro-Et(N,Ro)-1;break}return this._d.setTime(N),r.updateOffset(this,!0),this}function Qu(){return this._d.valueOf()-(this._offset||0)*6e4}function Lo(){return Math.floor(this.valueOf()/1e3)}function Xu(){return new Date(this.valueOf())}function to(){var g=this;return[g.year(),g.month(),g.date(),g.hour(),g.minute(),g.second(),g.millisecond()]}function qo(){var g=this;return{years:g.year(),months:g.month(),date:g.date(),hours:g.hours(),minutes:g.minutes(),seconds:g.seconds(),milliseconds:g.milliseconds()}}function Uo(){return this.isValid()?this.toISOString():null}function Cs(){return y(this)}function no(){return p({},x(this))}function Xm(){return x(this).overflow}function Jm(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),rr("N",Ir),rr("NN",Ir),rr("NNN",Ir),rr("NNNN",rh),rr("NNNNN",th),nt(["N","NN","NNN","NNNN","NNNNN"],function(g,N,P,z){var G=P._locale.erasParse(g,z,P._strict);G?x(P).era=G:x(P).invalidEra=g}),rr("y",_t),rr("yy",_t),rr("yyy",_t),rr("yyyy",_t),rr("yo",nh),nt(["y","yy","yyy","yyyy"],zt),nt(["yo"],function(g,N,P,z){var G;P._locale._eraYearOrdinalRegex&&(G=g.match(P._locale._eraYearOrdinalRegex)),P._locale.eraYearOrdinalParse?N[zt]=P._locale.eraYearOrdinalParse(g,G):N[zt]=parseInt(g,10)});function Km(g,N){var P,z,G,se=this._eras||Tt("en")._eras;for(P=0,z=se.length;P=0)return se[z]}function eh(g,N){var P=g.since<=g.until?1:-1;return N===void 0?r(g.since).year():r(g.since).year()+(N-g.offset)*P}function Ms(){var g,N,P,z=this.localeData().eras();for(g=0,N=z.length;gse&&(N=se),fh.call(this,g,N,P,z,G))}function fh(g,N,P,z,G){var se=Lf(g,N,P,z,G),Te=$a(se.year,0,se.dayOfYear);return this.year(Te.getUTCFullYear()),this.month(Te.getUTCMonth()),this.date(Te.getUTCDate()),this}H("Q",0,"Qo","quarter"),ne("quarter","Q"),Le("quarter",7),rr("Q",ke),nt("Q",function(g,N){N[En]=(Xe(g)-1)*3});function lh(g){return g==null?Math.ceil((this.month()+1)/3):this.month((g-1)*3+this.month()%3)}H("D",["DD",2],"Do","date"),ne("date","D"),Le("date",9),rr("D",Q),rr("DD",Q,_e),rr("Do",function(g,N){return g?N._dayOfMonthOrdinalParse||N._ordinalParse:N._dayOfMonthOrdinalParseLenient}),nt(["D","DD"],Cn),nt("Do",function(g,N){N[Cn]=Xe(g.match(Q)[0])});var bl=Or("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),ne("dayOfYear","DDD"),Le("dayOfYear",4),rr("DDD",er),rr("DDDD",Pe),nt(["DDD","DDDD"],function(g,N,P){P._dayOfYear=Xe(g)});function Ii(g){var N=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return g==null?N:this.add(g-N,"d")}H("m",["mm",2],0,"minute"),ne("minute","m"),Le("minute",14),rr("m",Q),rr("mm",Q,_e),nt(["m","mm"],gn);var ch=Or("Minutes",!1);H("s",["ss",2],0,"second"),ne("second","s"),Le("second",15),rr("s",Q),rr("ss",Q,_e),nt(["s","ss"],Wn);var ph=Or("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return this.millisecond()*10}),H(0,["SSSSS",5],0,function(){return this.millisecond()*100}),H(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),H(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),H(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),H(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),ne("millisecond","ms"),Le("millisecond",16),rr("S",er,ke),rr("SS",er,_e),rr("SSS",er,Pe);var na,wl;for(na="SSSS";na.length<=9;na+="S")rr(na,_t);function mh(g,N){N[Mi]=Xe(("0."+g)*1e3)}for(na="S";na.length<=9;na+="S")nt(na,mh);wl=Or("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");function Sa(){return this._isUTC?"UTC":""}function hh(){return this._isUTC?"Coordinated Universal Time":""}var Ye=E.prototype;Ye.add=eo,Ye.calendar=Ym,Ye.clone=Hm,Ye.diff=pl,Ye.endOf=Qm,Ye.format=Ss,Ye.from=Gm,Ye.fromNow=$m,Ye.to=Zm,Ye.toNow=Ns,Ye.get=we,Ye.invalidAt=Xm,Ye.isAfter=bs,Ye.isBefore=ta,Ye.isBetween=ws,Ye.isSame=ll,Ye.isSameOrAfter=Ds,Ye.isSameOrBefore=cl,Ye.isValid=Cs,Ye.lang=As,Ye.locale=ko,Ye.localeData=hl,Ye.max=_m,Ye.min=il,Ye.parsingFlags=no,Ye.set=Oe,Ye.startOf=gl,Ye.subtract=xs,Ye.toArray=to,Ye.toObject=qo,Ye.toDate=Xu,Ye.toISOString=Po,Ye.inspect=Da,typeof Symbol<"u"&&Symbol.for!=null&&(Ye[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Ye.toJSON=Uo,Ye.toString=ml,Ye.unix=Lo,Ye.valueOf=Qu,Ye.creationData=Jm,Ye.eraName=Ms,Ye.eraNarrow=zo,Ye.eraAbbr=xl,Ye.eraYear=Z,Ye.year=Bu,Ye.isLeapYear=sm,Ye.weekYear=ih,Ye.isoWeekYear=ah,Ye.quarter=Ye.quarters=lh,Ye.month=_i,Ye.daysInMonth=ps,Ye.week=Ye.weeks=um,Ye.isoWeek=Ye.isoWeeks=zf,Ye.weeksInYear=Bi,Ye.weeksInWeekYear=uh,Ye.isoWeeksInYear=oh,Ye.isoWeeksInISOWeekYear=sh,Ye.date=bl,Ye.day=Ye.days=gm,Ye.weekday=xm,Ye.isoWeekday=ym,Ye.dayOfYear=Ii,Ye.hour=Ye.hours=Wt,Ye.minute=Ye.minutes=ch,Ye.second=Ye.seconds=ph,Ye.millisecond=Ye.milliseconds=wl,Ye.utcOffset=Rm,Ye.utc=qm,Ye.local=Um,Ye.parseZone=zm,Ye.hasAlignedHourOffset=ra,Ye.isDST=he,Ye.isLocal=Ne,Ye.isUtcOffset=nr,Ye.isUtc=Nr,Ye.isUTC=Nr,Ye.zoneAbbr=Sa,Ye.zoneName=hh,Ye.dates=F("dates accessor is deprecated. Use date instead.",bl),Ye.months=F("months accessor is deprecated. Use month instead",_i),Ye.years=F("years accessor is deprecated. Use year instead",Bu),Ye.zone=F("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Lm),Ye.isDSTShifted=F("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Fe);function Hn(g){return ht(g*1e3)}function dh(){return ht.apply(null,arguments).parseZone()}function Dl(g){return g}var Qr=$.prototype;Qr.calendar=R,Qr.longDateFormat=xe,Qr.invalidDate=De,Qr.ordinal=Ze,Qr.preparse=Dl,Qr.postformat=Dl,Qr.relativeTime=te,Qr.pastFuture=ye,Qr.set=L,Qr.eras=Km,Qr.erasParse=jm,Qr.erasConvertYear=eh,Qr.erasAbbrRegex=_s,Qr.erasNameRegex=io,Qr.erasNarrowRegex=_n,Qr.months=xa,Qr.monthsShort=Kr,Qr.monthsParse=Tu,Qr.monthsRegex=om,Qr.monthsShortRegex=Fu,Qr.week=Iu,Qr.firstDayOfYear=Uf,Qr.firstDayOfWeek=qf,Qr.weekdays=mm,Qr.weekdaysMin=Pu,Qr.weekdaysShort=hm,Qr.weekdaysParse=vm,Qr.weekdaysRegex=dt,Qr.weekdaysShortRegex=mt,Qr.weekdaysMinRegex=bm,Qr.isPM=Zf,Qr.meridiem=Lu;function Fs(g,N,P,z){var G=Tt(),se=h().set(z,N);return G[P](se,g)}function Sl(g,N,P){if(f(g)&&(N=g,g=void 0),g=g||"",N!=null)return Fs(g,N,P,"month");var z,G=[];for(z=0;z<12;z++)G[z]=Fs(g,z,P,"month");return G}function Os(g,N,P,z){typeof g=="boolean"?(f(N)&&(P=N,N=void 0),N=N||""):(N=g,P=N,g=!1,f(N)&&(P=N,N=void 0),N=N||"");var G=Tt(),se=g?G._week.dow:0,Te,mr=[];if(P!=null)return Fs(N,(P+se)%7,z,"day");for(Te=0;Te<7;Te++)mr[Te]=Fs(N,(Te+se)%7,z,"day");return mr}function Nl(g,N){return Sl(g,N,"months")}function vh(g,N){return Sl(g,N,"monthsShort")}function gh(g,N,P){return Os(g,N,P,"weekdays")}function Ju(g,N,P){return Os(g,N,P,"weekdaysShort")}function Wo(g,N,P){return Os(g,N,P,"weekdaysMin")}Ti("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\\d{1,2}(th|st|nd|rd)/,ordinal:function(g){var N=g%10,P=Xe(g%100/10)===1?"th":N===1?"st":N===2?"nd":N===3?"rd":"th";return g+P}}),r.lang=F("moment.lang is deprecated. Use moment.locale instead.",Ti),r.langData=F("moment.langData is deprecated. Use moment.localeData instead.",Tt);var Tn=Math.abs;function xh(){var g=this._data;return this._milliseconds=Tn(this._milliseconds),this._days=Tn(this._days),this._months=Tn(this._months),g.milliseconds=Tn(g.milliseconds),g.seconds=Tn(g.seconds),g.minutes=Tn(g.minutes),g.hours=Tn(g.hours),g.months=Tn(g.months),g.years=Tn(g.years),this}function Ku(g,N,P,z){var G=kr(N,P);return g._milliseconds+=z*G._milliseconds,g._days+=z*G._days,g._months+=z*G._months,g._bubble()}function yh(g,N){return Ku(this,g,N,1)}function Pi(g,N){return Ku(this,g,N,-1)}function Bs(g){return g<0?Math.floor(g):Math.ceil(g)}function Na(){var g=this._milliseconds,N=this._days,P=this._months,z=this._data,G,se,Te,mr,Tr;return g>=0&&N>=0&&P>=0||g<=0&&N<=0&&P<=0||(g+=Bs(ju(P)+N)*864e5,N=0,P=0),z.milliseconds=g%1e3,G=ir(g/1e3),z.seconds=G%60,se=ir(G/60),z.minutes=se%60,Te=ir(se/60),z.hours=Te%24,N+=ir(Te/24),Tr=ir(yn(N)),P+=Tr,N-=Bs(ju(Tr)),mr=ir(P/12),P%=12,z.days=N,z.months=P,z.years=mr,this}function yn(g){return g*4800/146097}function ju(g){return g*146097/4800}function Al(g){if(!this.isValid())return NaN;var N,P,z=this._milliseconds;if(g=ue(g),g==="month"||g==="quarter"||g==="year")switch(N=this._days+z/864e5,P=this._months+yn(N),g){case"month":return P;case"quarter":return P/3;case"year":return P/12}else switch(N=this._days+Math.round(ju(this._months)),g){case"week":return N/7+z/6048e5;case"day":return N+z/864e5;case"hour":return N*24+z/36e5;case"minute":return N*1440+z/6e4;case"second":return N*86400+z/1e3;case"millisecond":return Math.floor(N*864e5)+z;default:throw new Error("Unknown unit "+g)}}function El(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+Xe(this._months/12)*31536e6:NaN}function bn(g){return function(){return this.as(g)}}var ia=bn("ms"),Cl=bn("s"),bh=bn("m"),Is=bn("h"),wh=bn("d"),Ml=bn("w"),Ht=bn("M"),ef=bn("Q"),_l=bn("y");function ai(){return kr(this)}function rf(g){return g=ue(g),this.isValid()?this[g+"s"]():NaN}function oi(g){return function(){return this.isValid()?this._data[g]:NaN}}var Aa=oi("milliseconds"),Tl=oi("seconds"),on=oi("minutes"),tf=oi("hours"),Dh=oi("days"),Sh=oi("months"),Nh=oi("years");function nf(){return ir(this.days()/7)}var ki=Math.round,si={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Fl(g,N,P,z,G){return G.relativeTime(N||1,!!P,g,z)}function Ah(g,N,P,z){var G=kr(g).abs(),se=ki(G.as("s")),Te=ki(G.as("m")),mr=ki(G.as("h")),Tr=ki(G.as("d")),et=ki(G.as("M")),sn=ki(G.as("w")),ui=ki(G.as("y")),Ri=se<=P.ss&&["s",se]||se0,Ri[4]=z,Fl.apply(null,Ri)}function Eh(g){return g===void 0?ki:typeof g=="function"?(ki=g,!0):!1}function Vo(g,N){return si[g]===void 0?!1:N===void 0?si[g]:(si[g]=N,g==="s"&&(si.ss=N-1),!0)}function Ch(g,N){if(!this.isValid())return this.localeData().invalidDate();var P=!1,z=si,G,se;return typeof g=="object"&&(N=g,g=!1),typeof g=="boolean"&&(P=g),typeof N=="object"&&(z=Object.assign({},si,N),N.s!=null&&N.ss==null&&(z.ss=N.s-1)),G=this.localeData(),se=Ah(this,!P,z,G),P&&(se=G.pastFuture(+this,se)),G.postformat(se)}var af=Math.abs;function aa(g){return(g>0)-(g<0)||+g}function Yo(){if(!this.isValid())return this.localeData().invalidDate();var g=af(this._milliseconds)/1e3,N=af(this._days),P=af(this._months),z,G,se,Te,mr=this.asSeconds(),Tr,et,sn,ui;return mr?(z=ir(g/60),G=ir(z/60),g%=60,z%=60,se=ir(P/12),P%=12,Te=g?g.toFixed(3).replace(/\\.?0+$/,""):"",Tr=mr<0?"-":"",et=aa(this._months)!==aa(mr)?"-":"",sn=aa(this._days)!==aa(mr)?"-":"",ui=aa(this._milliseconds)!==aa(mr)?"-":"",Tr+"P"+(se?et+se+"Y":"")+(P?et+P+"M":"")+(N?sn+N+"D":"")+(G||z||g?"T":"")+(G?ui+G+"H":"")+(z?ui+z+"M":"")+(g?ui+Te+"S":"")):"P0D"}var Wr=Oo.prototype;Wr.isValid=Im,Wr.abs=xh,Wr.add=yh,Wr.subtract=Pi,Wr.as=Al,Wr.asMilliseconds=ia,Wr.asSeconds=Cl,Wr.asMinutes=bh,Wr.asHours=Is,Wr.asDays=wh,Wr.asWeeks=Ml,Wr.asMonths=Ht,Wr.asQuarters=ef,Wr.asYears=_l,Wr.valueOf=El,Wr._bubble=Na,Wr.clone=ai,Wr.get=rf,Wr.milliseconds=Aa,Wr.seconds=Tl,Wr.minutes=on,Wr.hours=tf,Wr.days=Dh,Wr.weeks=nf,Wr.months=Sh,Wr.years=Nh,Wr.humanize=Ch,Wr.toISOString=Yo,Wr.toString=Yo,Wr.toJSON=Yo,Wr.locale=ko,Wr.localeData=hl,Wr.toIsoString=F("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Yo),Wr.lang=As,H("X",0,0,"unix"),H("x",0,0,"valueOf"),rr("x",Yt),rr("X",Su),nt("X",function(g,N,P){P._d=new Date(parseFloat(g)*1e3)}),nt("x",function(g,N,P){P._d=new Date(Xe(g))});return r.version="2.29.4",t(ht),r.fn=Ye,r.min=Tm,r.max=Fm,r.now=Om,r.utc=h,r.unix=Hn,r.months=Nl,r.isDate=o,r.locale=Ti,r.invalid=w,r.duration=kr,r.isMoment=S,r.weekdays=gh,r.parseZone=dh,r.localeData=Tt,r.isDuration=Yn,r.monthsShort=vh,r.weekdaysMin=Wo,r.defineLocale=an,r.updateLocale=Sm,r.locales=Nm,r.weekdaysShort=Ju,r.normalizeUnits=ue,r.relativeTimeRounding=Eh,r.relativeTimeThreshold=Vo,r.calendarFormat=Vm,r.prototype=Ye,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r})});var yc=un((Ld,qd)=>{(function(e,r){typeof Ld=="object"&&typeof qd<"u"?qd.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e["'typed'"]=r())})(Ld,function(){"use strict";function e(){return!0}function r(){return!1}function t(){}let n="Argument is not a typed-function.";function i(){function s(re){return typeof re=="object"&&re!==null&&re.constructor===Object}let l=[{name:"number",test:function(re){return typeof re=="number"}},{name:"string",test:function(re){return typeof re=="string"}},{name:"boolean",test:function(re){return typeof re=="boolean"}},{name:"Function",test:function(re){return typeof re=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(re){return re instanceof Date}},{name:"RegExp",test:function(re){return re instanceof RegExp}},{name:"Object",test:s},{name:"null",test:function(re){return re===null}},{name:"undefined",test:function(re){return re===void 0}}],f={name:"any",test:e,isAny:!0},o,u,p=0,h={createCount:0};function d(re){let le=o.get(re);if(le)return le;let we='Unknown type "'+re+'"',Oe=re.toLowerCase(),ke;for(ke of u)if(ke.toLowerCase()===Oe){we+='. Did you mean "'+ke+'" ?';break}throw new TypeError(we)}function x(re){let le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any",we=le?d(le).index:u.length,Oe=[];for(let _e=0;_e{let Oe=o.get(we);return!Oe.isAny&&Oe.test(re)});return le.length?le:["any"]}function C(re){return re&&typeof re=="function"&&"_typedFunctionData"in re}function b(re,le,we){if(!C(re))throw new TypeError(n);let Oe=we&&we.exact,ke=Array.isArray(le)?le.join(","):le,_e=_(ke),Pe=S(_e);if(!Oe||Pe in re.signatures){let ve=re._typedFunctionData.signatureMap.get(Pe);if(ve)return ve}let We=_e.length,B;if(Oe){B=[];let ve;for(ve in re.signatures)B.push(re._typedFunctionData.signatureMap.get(ve))}else B=re._typedFunctionData.signatures;for(let ve=0;ve!_t.has(Yt.name)))continue}er.push(fr)}}if(B=er,B.length===0)break}let Q;for(Q of B)if(Q.params.length<=We)return Q;throw new TypeError("Signature not found (signature: "+(re.name||"unnamed")+"("+S(_e,", ")+"))")}function A(re,le,we){return b(re,le,we).implementation}function E(re,le){let we=d(le);if(we.test(re))return re;let Oe=we.conversionsTo;if(Oe.length===0)throw new Error("There are no conversions to "+le+" defined.");for(let ke=0;ke1&&arguments[1]!==void 0?arguments[1]:",";return re.map(we=>we.name).join(le)}function O(re){let le=re.indexOf("...")===0,Oe=(le?re.length>3?re.slice(3):"any":re).split("|").map(We=>d(We.trim())),ke=!1,_e=le?"...":"";return{types:Oe.map(function(We){return ke=We.isAny||ke,_e+=We.name+"|",{name:We.name,typeIndex:We.index,test:We.test,isAny:We.isAny,conversion:null,conversionIndex:-1}}),name:_e.slice(0,-1),hasAny:ke,hasConversion:!1,restParam:le}}function F(re){let le=re.types.map(Pe=>Pe.name),we=H(le),Oe=re.hasAny,ke=re.name,_e=we.map(function(Pe){let We=d(Pe.from);return Oe=We.isAny||Oe,ke+="|"+Pe.from,{name:Pe.from,typeIndex:We.index,test:We.test,isAny:We.isAny,conversion:Pe,conversionIndex:Pe.index}});return{types:re.types.concat(_e),name:ke,hasAny:Oe,hasConversion:_e.length>0,restParam:re.restParam}}function M(re){return re.typeSet||(re.typeSet=new Set,re.types.forEach(le=>re.typeSet.add(le.name))),re.typeSet}function _(re){let le=[];if(typeof re!="string")throw new TypeError("Signatures must be strings");let we=re.trim();if(we==="")return le;let Oe=we.split(",");for(let ke=0;ke=ke+1}}else return re.length===0?function(_e){return _e.length===0}:re.length===1?(we=L(re[0]),function(_e){return we(_e[0])&&_e.length===1}):re.length===2?(we=L(re[0]),Oe=L(re[1]),function(_e){return we(_e[0])&&Oe(_e[1])&&_e.length===2}):(le=re.map(L),function(_e){for(let Pe=0;Pe{let ke=V(Oe.params,le),_e;for(_e of ke)we.add(_e)}),we.has("any")?["any"]:Array.from(we)}function j(re,le,we){let Oe,ke,_e=re||"unnamed",Pe=we,We;for(We=0;We{let fr=$(er.params,We),Zr=L(fr);(We0){let er=w(le[We]);return Oe=new TypeError("Unexpected type of argument in function "+_e+" (expected: "+ke.join(" or ")+", actual: "+er.join(" | ")+", index: "+We+")"),Oe.data={category:"wrongType",fn:_e,index:We,actual:er,expected:ke},Oe}}else Pe=Be}let B=Pe.map(function(Be){return k(Be.params)?1/0:Be.params.length});if(le.lengthQ)return Oe=new TypeError("Too many arguments in function "+_e+" (expected: "+Q+", actual: "+le.length+")"),Oe.data={category:"tooManyArgs",fn:_e,index:le.length,expectedLength:Q},Oe;let ve=[];for(let Be=0;Be0)return 1;let Oe=oe(re)-oe(le);return Oe<0?-1:Oe>0?1:0}function ie(re,le){let we=re.params,Oe=le.params,ke=K(we),_e=K(Oe),Pe=k(we),We=k(Oe);if(Pe&&ke.hasAny){if(!We||!_e.hasAny)return 1}else if(We&&_e.hasAny)return-1;let B=0,Q=0,ve;for(ve of we)ve.hasAny&&++B,ve.hasConversion&&++Q;let Be=0,er=0;for(ve of Oe)ve.hasAny&&++Be,ve.hasConversion&&++er;if(B!==Be)return B-Be;if(Pe&&ke.hasConversion){if(!We||!_e.hasConversion)return 1}else if(We&&_e.hasConversion)return-1;if(Q!==er)return Q-er;if(Pe){if(!We)return 1}else if(We)return-1;let fr=(we.length-Oe.length)*(Pe?-1:1);if(fr!==0)return fr;let Zr=[],_t=0;for(let Qi=0;Qi1&&le.sort((ke,_e)=>ke.index-_e.index);let we=le[0].conversionsTo;if(re.length===1)return we;we=we.concat([]);let Oe=new Set(re);for(let ke=1;keke.hasConversion)){let ke=k(re),_e=re.map(Me);we=function(){let We=[],B=ke?arguments.length-1:arguments.length;for(let Q=0;QB.name).join("|"),hasAny:We.some(B=>B.isAny),hasConversion:!1,restParam:!0}),Pe.push(_e)}else Pe=_e.types.map(function(We){return{types:[We],name:We.name,hasAny:We.isAny,hasConversion:We.conversion,restParam:!1}});return ee(Pe,function(We){return le(we,Oe+1,ke.concat([We]))})}else return[ke]}return le(re,0,[])}function ge(re,le){let we=Math.max(re.length,le.length);for(let We=0;We=Oe:Pe?Oe>=ke:Oe===ke}function Se(re){return re.map(le=>Le(le)?Ee(le.referToSelf.callback):Ce(le)?ue(le.referTo.references,le.referTo.callback):le)}function xe(re,le,we){let Oe=[],ke;for(ke of re){let _e=we[ke];if(typeof _e!="number")throw new TypeError('No definition for referenced signature "'+ke+'"');if(_e=le[_e],typeof _e!="function")return!1;Oe.push(_e)}return Oe}function be(re,le,we){let Oe=Se(re),ke=new Array(Oe.length).fill(!1),_e=!0;for(;_e;){_e=!1;let Pe=!0;for(let We=0;We{let Oe=re[we];if(le.test(Oe.toString()))throw new SyntaxError("Using \`this\` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function Ae(re,le){if(h.createCount++,Object.keys(le).length===0)throw new SyntaxError("No signatures provided");h.warnAgainstDeprecatedThis&&De(le);let we=[],Oe=[],ke={},_e=[],Pe;for(Pe in le){if(!Object.prototype.hasOwnProperty.call(le,Pe))continue;let Kr=_(Pe);if(!Kr)continue;we.forEach(function(_i){if(ge(_i,Kr))throw new TypeError('Conflicting signatures "'+S(_i)+'" and "'+S(Kr)+'".')}),we.push(Kr);let jt=Oe.length;Oe.push(le[Pe]);let Tu=Kr.map(F),Xi;for(Xi of pe(Tu)){let _i=S(Xi);_e.push({params:Xi,name:_i,fn:jt}),Xi.every(ps=>!ps.hasConversion)&&(ke[_i]=jt)}}_e.sort(ie);let We=be(Oe,ke,xa),B;for(B in ke)Object.prototype.hasOwnProperty.call(ke,B)&&(ke[B]=We[ke[B]]);let Q=[],ve=new Map;for(B of _e)ve.has(B.name)||(B.fn=We[B.fn],Q.push(B),ve.set(B.name,B));let Be=Q[0]&&Q[0].params.length<=2&&!k(Q[0].params),er=Q[1]&&Q[1].params.length<=2&&!k(Q[1].params),fr=Q[2]&&Q[2].params.length<=2&&!k(Q[2].params),Zr=Q[3]&&Q[3].params.length<=2&&!k(Q[3].params),_t=Q[4]&&Q[4].params.length<=2&&!k(Q[4].params),Yt=Q[5]&&Q[5].params.length<=2&&!k(Q[5].params),Qi=Be&&er&&fr&&Zr&&_t&&Yt;for(let Kr=0;KrKr.test),ls=Q.map(Kr=>Kr.implementation),cs=function(){for(let jt=_u;jtS(_(we))),le=K(arguments);if(typeof le!="function")throw new TypeError("Callback function expected as last argument");return ue(re,le)}function ue(re,le){return{referTo:{references:re,callback:le}}}function Ee(re){if(typeof re!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:re}}}function Ce(re){return re&&typeof re.referTo=="object"&&Array.isArray(re.referTo.references)&&typeof re.referTo.callback=="function"}function Le(re){return re&&typeof re.referToSelf=="object"&&typeof re.referToSelf.callback=="function"}function Ie(re,le){if(!re)return le;if(le&&le!==re){let we=new Error("Function names do not match (expected: "+re+", actual: "+le+")");throw we.data={actual:le,expected:re},we}return re}function sr(re){let le;for(let we in re)Object.prototype.hasOwnProperty.call(re,we)&&(C(re[we])||typeof re[we].signature=="string")&&(le=Ie(le,re[we].name));return le}function ir(re,le){let we;for(we in le)if(Object.prototype.hasOwnProperty.call(le,we)){if(we in re&&le[we]!==re[we]){let Oe=new Error('Signature "'+we+'" is defined twice');throw Oe.data={signature:we,sourceFunction:le[we],destFunction:re[we]},Oe}re[we]=le[we]}}let Xe=h;h=function(re){let le=typeof re=="string",we=le?1:0,Oe=le?re:"",ke={};for(let _e=we;_eke.from===re.from);if(!we)throw new Error("Attempt to remove nonexistent conversion from "+re.from+" to "+re.to);if(we.convert!==re.convert)throw new Error("Conversion to remove does not match existing conversion");let Oe=le.conversionsTo.indexOf(we);le.conversionsTo.splice(Oe,1)},h.resolve=function(re,le){if(!C(re))throw new TypeError(n);let we=re._typedFunctionData.signatures;for(let Oe=0;Oe{(function(e){"use strict";var r=Math.cosh||function(o){return Math.abs(o)<1e-9?1-o:(Math.exp(o)+Math.exp(-o))*.5},t=Math.sinh||function(o){return Math.abs(o)<1e-9?o:(Math.exp(o)-Math.exp(-o))*.5},n=function(o){var u=Math.PI/4;if(-u>o||o>u)return Math.cos(o)-1;var p=o*o;return p*(p*(p*(p*(p*(p*(p*(p/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},i=function(o,u){var p=Math.abs(o),h=Math.abs(u);return p<3e3&&h<3e3?Math.sqrt(p*p+h*h):(p0&&a();break;case"number":p.im=0,p.re=o;break;default:a()}return isNaN(p.re)||isNaN(p.im),p};function f(o,u){if(!(this instanceof f))return new f(o,u);var p=l(o,u);this.re=p.re,this.im=p.im}f.prototype={re:0,im:0,sign:function(){var o=this.abs();return new f(this.re/o,this.im/o)},add:function(o,u){var p=new f(o,u);return this.isInfinite()&&p.isInfinite()?f.NAN:this.isInfinite()||p.isInfinite()?f.INFINITY:new f(this.re+p.re,this.im+p.im)},sub:function(o,u){var p=new f(o,u);return this.isInfinite()&&p.isInfinite()?f.NAN:this.isInfinite()||p.isInfinite()?f.INFINITY:new f(this.re-p.re,this.im-p.im)},mul:function(o,u){var p=new f(o,u);return this.isInfinite()&&p.isZero()||this.isZero()&&p.isInfinite()?f.NAN:this.isInfinite()||p.isInfinite()?f.INFINITY:p.im===0&&this.im===0?new f(this.re*p.re,0):new f(this.re*p.re-this.im*p.im,this.re*p.im+this.im*p.re)},div:function(o,u){var p=new f(o,u);if(this.isZero()&&p.isZero()||this.isInfinite()&&p.isInfinite())return f.NAN;if(this.isInfinite()||p.isZero())return f.INFINITY;if(this.isZero()||p.isInfinite())return f.ZERO;o=this.re,u=this.im;var h=p.re,d=p.im,x,v;return d===0?new f(o/h,u/h):Math.abs(h)0)return new f(Math.pow(o,p.re),0);if(o===0)switch((p.re%4+4)%4){case 0:return new f(Math.pow(u,p.re),0);case 1:return new f(0,Math.pow(u,p.re));case 2:return new f(-Math.pow(u,p.re),0);case 3:return new f(0,-Math.pow(u,p.re))}}if(o===0&&u===0&&p.re>0&&p.im>=0)return f.ZERO;var h=Math.atan2(u,o),d=s(o,u);return o=Math.exp(p.re*d-p.im*h),u=p.im*d+p.re*h,new f(o*Math.cos(u),o*Math.sin(u))},sqrt:function(){var o=this.re,u=this.im,p=this.abs(),h,d;if(o>=0){if(u===0)return new f(Math.sqrt(o),0);h=.5*Math.sqrt(2*(p+o))}else h=Math.abs(u)/Math.sqrt(2*(p-o));return o<=0?d=.5*Math.sqrt(2*(p-o)):d=Math.abs(u)/Math.sqrt(2*(p+o)),new f(h,u<0?-d:d)},exp:function(){var o=Math.exp(this.re);return this.im,new f(o*Math.cos(this.im),o*Math.sin(this.im))},expm1:function(){var o=this.re,u=this.im;return new f(Math.expm1(o)*Math.cos(u)+n(u),Math.exp(o)*Math.sin(u))},log:function(){var o=this.re,u=this.im;return u===0&&o>0,new f(s(o,u),Math.atan2(u,o))},abs:function(){return i(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var o=this.re,u=this.im;return new f(Math.sin(o)*r(u),Math.cos(o)*t(u))},cos:function(){var o=this.re,u=this.im;return new f(Math.cos(o)*r(u),-Math.sin(o)*t(u))},tan:function(){var o=2*this.re,u=2*this.im,p=Math.cos(o)+r(u);return new f(Math.sin(o)/p,t(u)/p)},cot:function(){var o=2*this.re,u=2*this.im,p=Math.cos(o)-r(u);return new f(-Math.sin(o)/p,t(u)/p)},sec:function(){var o=this.re,u=this.im,p=.5*r(2*u)+.5*Math.cos(2*o);return new f(Math.cos(o)*r(u)/p,Math.sin(o)*t(u)/p)},csc:function(){var o=this.re,u=this.im,p=.5*r(2*u)-.5*Math.cos(2*o);return new f(Math.sin(o)*r(u)/p,-Math.cos(o)*t(u)/p)},asin:function(){var o=this.re,u=this.im,p=new f(u*u-o*o+1,-2*o*u).sqrt(),h=new f(p.re-u,p.im+o).log();return new f(h.im,-h.re)},acos:function(){var o=this.re,u=this.im,p=new f(u*u-o*o+1,-2*o*u).sqrt(),h=new f(p.re-u,p.im+o).log();return new f(Math.PI/2-h.im,h.re)},atan:function(){var o=this.re,u=this.im;if(o===0){if(u===1)return new f(0,1/0);if(u===-1)return new f(0,-1/0)}var p=o*o+(1-u)*(1-u),h=new f((1-u*u-o*o)/p,-2*o/p).log();return new f(-.5*h.im,.5*h.re)},acot:function(){var o=this.re,u=this.im;if(u===0)return new f(Math.atan2(1,o),0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).atan():new f(o!==0?o/0:0,u!==0?-u/0:0).atan()},asec:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new f(0,1/0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).acos():new f(o!==0?o/0:0,u!==0?-u/0:0).acos()},acsc:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new f(Math.PI/2,1/0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).asin():new f(o!==0?o/0:0,u!==0?-u/0:0).asin()},sinh:function(){var o=this.re,u=this.im;return new f(t(o)*Math.cos(u),r(o)*Math.sin(u))},cosh:function(){var o=this.re,u=this.im;return new f(r(o)*Math.cos(u),t(o)*Math.sin(u))},tanh:function(){var o=2*this.re,u=2*this.im,p=r(o)+Math.cos(u);return new f(t(o)/p,Math.sin(u)/p)},coth:function(){var o=2*this.re,u=2*this.im,p=r(o)-Math.cos(u);return new f(t(o)/p,-Math.sin(u)/p)},csch:function(){var o=this.re,u=this.im,p=Math.cos(2*u)-r(2*o);return new f(-2*t(o)*Math.cos(u)/p,2*r(o)*Math.sin(u)/p)},sech:function(){var o=this.re,u=this.im,p=Math.cos(2*u)+r(2*o);return new f(2*r(o)*Math.cos(u)/p,-2*t(o)*Math.sin(u)/p)},asinh:function(){var o=this.im;this.im=-this.re,this.re=o;var u=this.asin();return this.re=-this.im,this.im=o,o=u.re,u.re=-u.im,u.im=o,u},acosh:function(){var o=this.acos();if(o.im<=0){var u=o.re;o.re=-o.im,o.im=u}else{var u=o.im;o.im=-o.re,o.re=u}return o},atanh:function(){var o=this.re,u=this.im,p=o>1&&u===0,h=1-o,d=1+o,x=h*h+u*u,v=x!==0?new f((d*h-u*u)/x,(u*h+d*u)/x):new f(o!==-1?o/0:0,u!==0?u/0:0),y=v.re;return v.re=s(v.re,v.im)/2,v.im=Math.atan2(v.im,y)/2,p&&(v.im=-v.im),v},acoth:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new f(0,Math.PI/2);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).atanh():new f(o!==0?o/0:0,u!==0?-u/0:0).atanh()},acsch:function(){var o=this.re,u=this.im;if(u===0)return new f(o!==0?Math.log(o+Math.sqrt(o*o+1)):1/0,0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).asinh():new f(o!==0?o/0:0,u!==0?-u/0:0).asinh()},asech:function(){var o=this.re,u=this.im;if(this.isZero())return f.INFINITY;var p=o*o+u*u;return p!==0?new f(o/p,-u/p).acosh():new f(o!==0?o/0:0,u!==0?-u/0:0).acosh()},inverse:function(){if(this.isZero())return f.INFINITY;if(this.isInfinite())return f.ZERO;var o=this.re,u=this.im,p=o*o+u*u;return new f(o/p,-u/p)},conjugate:function(){return new f(this.re,-this.im)},neg:function(){return new f(-this.re,-this.im)},ceil:function(o){return o=Math.pow(10,o||0),new f(Math.ceil(this.re*o)/o,Math.ceil(this.im*o)/o)},floor:function(o){return o=Math.pow(10,o||0),new f(Math.floor(this.re*o)/o,Math.floor(this.im*o)/o)},round:function(o){return o=Math.pow(10,o||0),new f(Math.round(this.re*o)/o,Math.round(this.im*o)/o)},equals:function(o,u){var p=new f(o,u);return Math.abs(p.re-this.re)<=f.EPSILON&&Math.abs(p.im-this.im)<=f.EPSILON},clone:function(){return new f(this.re,this.im)},toString:function(){var o=this.re,u=this.im,p="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(o){(function(e){"use strict";var r=2e3,t={s:1,n:0,d:1};function n(v,y){if(isNaN(v=parseInt(v,10)))throw d();return v*y}function i(v,y){if(y===0)throw h();var w=Object.create(p.prototype);w.s=v<0?-1:1,v=v<0?-v:v;var C=u(v,y);return w.n=v/C,w.d=y/C,w}function a(v){for(var y={},w=v,C=2,b=4;b<=w;){for(;w%C===0;)w/=C,y[C]=(y[C]||0)+1;b+=1+2*C++}return w!==v?w>1&&(y[w]=(y[w]||0)+1):y[v]=(y[v]||0)+1,y}var s=function(v,y){var w=0,C=1,b=1,A=0,E=0,S=0,O=1,F=1,M=0,_=1,k=1,L=1,Y=1e7,$;if(v!=null)if(y!==void 0){if(w=v,C=y,b=w*C,w%1!==0||C%1!==0)throw x()}else switch(typeof v){case"object":{if("d"in v&&"n"in v)w=v.n,C=v.d,"s"in v&&(w*=v.s);else if(0 in v)w=v[0],1 in v&&(C=v[1]);else throw d();b=w*C;break}case"number":{if(v<0&&(b=v,v=-v),v%1===0)w=v;else if(v>0){for(v>=1&&(F=Math.pow(10,Math.floor(1+Math.log(v)/Math.LN10)),v/=F);_<=Y&&L<=Y;)if($=(M+k)/(_+L),v===$){_+L<=Y?(w=M+k,C=_+L):L>_?(w=k,C=L):(w=M,C=_);break}else v>$?(M+=k,_+=L):(k+=M,L+=_),_>Y?(w=k,C=L):(w=M,C=_);w*=F}else(isNaN(v)||isNaN(y))&&(C=w=NaN);break}case"string":{if(_=v.match(/\\d+|./g),_===null)throw d();if(_[M]==="-"?(b=-1,M++):_[M]==="+"&&M++,_.length===M+1?E=n(_[M++],b):_[M+1]==="."||_[M]==="."?(_[M]!=="."&&(A=n(_[M++],b)),M++,(M+1===_.length||_[M+1]==="("&&_[M+3]===")"||_[M+1]==="'"&&_[M+3]==="'")&&(E=n(_[M],b),O=Math.pow(10,_[M].length),M++),(_[M]==="("&&_[M+2]===")"||_[M]==="'"&&_[M+2]==="'")&&(S=n(_[M+1],b),F=Math.pow(10,_[M+1].length)-1,M+=3)):_[M+1]==="/"||_[M+1]===":"?(E=n(_[M],b),O=n(_[M+2],1),M+=3):_[M+3]==="/"&&_[M+1]===" "&&(A=n(_[M],b),E=n(_[M+2],b),O=n(_[M+4],1),M+=5),_.length<=M){C=O*F,b=w=S+C*A+F*E;break}}default:throw d()}if(C===0)throw h();t.s=b<0?-1:1,t.n=Math.abs(w),t.d=Math.abs(C)};function l(v,y,w){for(var C=1;y>0;v=v*v%w,y>>=1)y&1&&(C=C*v%w);return C}function f(v,y){for(;y%2===0;y/=2);for(;y%5===0;y/=5);if(y===1)return 0;for(var w=10%y,C=1;w!==1;C++)if(w=w*10%y,C>r)return 0;return C}function o(v,y,w){for(var C=1,b=l(10,w,y),A=0;A<300;A++){if(C===b)return A;C=C*10%y,b=b*10%y}return 0}function u(v,y){if(!v)return y;if(!y)return v;for(;;){if(v%=y,!v)return y;if(y%=v,!y)return v}}function p(v,y){if(s(v,y),this instanceof p)v=u(t.d,t.n),this.s=t.s,this.n=t.n/v,this.d=t.d/v;else return i(t.s*t.n,t.d)}var h=function(){return new Error("Division by Zero")},d=function(){return new Error("Invalid argument")},x=function(){return new Error("Parameters must be integer")};p.prototype={s:1,n:0,d:1,abs:function(){return i(this.n,this.d)},neg:function(){return i(-this.s*this.n,this.d)},add:function(v,y){return s(v,y),i(this.s*this.n*t.d+t.s*this.d*t.n,this.d*t.d)},sub:function(v,y){return s(v,y),i(this.s*this.n*t.d-t.s*this.d*t.n,this.d*t.d)},mul:function(v,y){return s(v,y),i(this.s*t.s*this.n*t.n,this.d*t.d)},div:function(v,y){return s(v,y),i(this.s*t.s*this.n*t.d,this.d*t.n)},clone:function(){return i(this.s*this.n,this.d)},mod:function(v,y){if(isNaN(this.n)||isNaN(this.d))return new p(NaN);if(v===void 0)return i(this.s*this.n%this.d,1);if(s(v,y),t.n===0&&this.d===0)throw h();return i(this.s*(t.d*this.n)%(t.n*this.d),t.d*this.d)},gcd:function(v,y){return s(v,y),i(u(t.n,this.n)*u(t.d,this.d),t.d*this.d)},lcm:function(v,y){return s(v,y),t.n===0&&this.n===0?i(0,1):i(t.n*this.n,u(t.n,this.n)*u(t.d,this.d))},ceil:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.ceil(v*this.s*this.n/this.d),v)},floor:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.floor(v*this.s*this.n/this.d),v)},round:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.round(v*this.s*this.n/this.d),v)},inverse:function(){return i(this.s*this.d,this.n)},pow:function(v,y){if(s(v,y),t.d===1)return t.s<0?i(Math.pow(this.s*this.d,t.n),Math.pow(this.n,t.n)):i(Math.pow(this.s*this.n,t.n),Math.pow(this.d,t.n));if(this.s<0)return null;var w=a(this.n),C=a(this.d),b=1,A=1;for(var E in w)if(E!=="1"){if(E==="0"){b=0;break}if(w[E]*=t.n,w[E]%t.d===0)w[E]/=t.d;else return null;b*=Math.pow(E,w[E])}for(var E in C)if(E!=="1"){if(C[E]*=t.n,C[E]%t.d===0)C[E]/=t.d;else return null;A*=Math.pow(E,C[E])}return t.s<0?i(A,b):i(b,A)},equals:function(v,y){return s(v,y),this.s*this.n*t.d===t.s*t.n*this.d},compare:function(v,y){s(v,y);var w=this.s*this.n*t.d-t.s*t.n*this.d;return(0=0;A--)b=b.inverse().add(w[A]);if(Math.abs(b.sub(y).valueOf())0&&(w+=y,w+=" ",C%=b),w+=C,w+="/",w+=b),w},toLatex:function(v){var y,w="",C=this.n,b=this.d;return this.s<0&&(w+="-"),b===1?w+=C:(v&&(y=Math.floor(C/b))>0&&(w+=y,C%=b),w+="\\\\frac{",w+=C,w+="}{",w+=b,w+="}"),w},toContinued:function(){var v,y=this.n,w=this.d,C=[];if(isNaN(y)||isNaN(w))return C;do C.push(Math.floor(y/w)),v=y%w,y=w,w=v;while(y!==1);return C},toString:function(v){var y=this.n,w=this.d;if(isNaN(y)||isNaN(w))return"NaN";v=v||15;var C=f(y,w),b=o(y,w,C),A=this.s<0?"-":"";if(A+=y/w|0,y%=w,y*=10,y&&(A+="."),C){for(var E=b;E--;)A+=y/w|0,y%=w,y*=10;A+="(";for(var E=C;E--;)A+=y/w|0,y%=w,y*=10;A+=")"}else for(var E=v;y&&E--;)A+=y/w|0,y%=w,y*=10;return A}},typeof uv=="object"?(Object.defineProperty(p,"__esModule",{value:!0}),p.default=p,p.Fraction=p,r1.exports=p):e.Fraction=p})(uv)});var xS=un((Yoe,gS)=>{gS.exports=function e(r,t){"use strict";var n=/(^([+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)?$|^0x[0-9a-f]+$|\\d+)/gi,i=/(^[ ]*|[ ]*$)/g,a=/(^([\\w ]+,?[\\w ]+)?[\\w ]+,?[\\w ]+\\d+:\\d+(:\\d+)?[\\w ]?|^\\d{1,4}[\\/\\-]\\d{1,4}[\\/\\-]\\d{1,4}|^\\w+, \\w+ \\d+, \\d{4})/,s=/^0x[0-9a-f]+$/i,l=/^0/,f=function(b){return e.insensitive&&(""+b).toLowerCase()||""+b},o=f(r).replace(i,"")||"",u=f(t).replace(i,"")||"",p=o.replace(n,"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0"),h=u.replace(n,"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0"),d=parseInt(o.match(s),16)||p.length!==1&&o.match(a)&&Date.parse(o),x=parseInt(u.match(s),16)||d&&u.match(a)&&Date.parse(u)||null,v,y;if(x){if(dx)return 1}for(var w=0,C=Math.max(p.length,h.length);wy)return 1}return 0}});var I2=un((spe,B2)=>{"use strict";var mg=Object.assign||function(e){for(var r=1;r1&&arguments[1]!==void 0?arguments[1]:{},t=r.preserveFormatting,n=t===void 0?!1:t,i=r.escapeMapFn,a=i===void 0?iz:i,s=String(e),l="",f=a(mg({},tz),n?mg({},nz):{}),o=Object.keys(f),u=function(){var h=!1;o.forEach(function(d,x){h||s.length>=d.length&&s.slice(0,d.length)===d&&(l+=f[o[x]],s=s.slice(d.length,s.length),h=!0)}),h||(l+=s.slice(0,1),s=s.slice(1,s.length))};s;)u();return l}});var nF=un((tF,wg)=>{(function(e,r,t){function n(l){var f=this,o=s();f.next=function(){var u=2091639*f.s0+f.c*23283064365386963e-26;return f.s0=f.s1,f.s1=f.s2,f.s2=u-(f.c=u|0)},f.c=1,f.s0=o(" "),f.s1=o(" "),f.s2=o(" "),f.s0-=o(l),f.s0<0&&(f.s0+=1),f.s1-=o(l),f.s1<0&&(f.s1+=1),f.s2-=o(l),f.s2<0&&(f.s2+=1),o=null}function i(l,f){return f.c=l.c,f.s0=l.s0,f.s1=l.s1,f.s2=l.s2,f}function a(l,f){var o=new n(l),u=f&&f.state,p=o.next;return p.int32=function(){return o.next()*4294967296|0},p.double=function(){return p()+(p()*2097152|0)*11102230246251565e-32},p.quick=p,u&&(typeof u=="object"&&i(u,o),p.state=function(){return i(o,{})}),p}function s(){var l=4022871197,f=function(o){o=String(o);for(var u=0;u>>0,p-=l,p*=l,l=p>>>0,p-=l,l+=p*4294967296}return(l>>>0)*23283064365386963e-26};return f}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.alea=a})(tF,typeof wg=="object"&&wg,typeof define=="function"&&define)});var aF=un((iF,Dg)=>{(function(e,r,t){function n(s){var l=this,f="";l.x=0,l.y=0,l.z=0,l.w=0,l.next=function(){var u=l.x^l.x<<11;return l.x=l.y,l.y=l.z,l.z=l.w,l.w^=l.w>>>19^u^u>>>8},s===(s|0)?l.x=s:f+=s;for(var o=0;o>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,h=(f.next()>>>0)/4294967296,d=(p+h)/(1<<21);while(d===0);return d},u.int32=f.next,u.quick=u,o&&(typeof o=="object"&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xor128=a})(iF,typeof Dg=="object"&&Dg,typeof define=="function"&&define)});var sF=un((oF,Sg)=>{(function(e,r,t){function n(s){var l=this,f="";l.next=function(){var u=l.x^l.x>>>2;return l.x=l.y,l.y=l.z,l.z=l.w,l.w=l.v,(l.d=l.d+362437|0)+(l.v=l.v^l.v<<4^(u^u<<1))|0},l.x=0,l.y=0,l.z=0,l.w=0,l.v=0,s===(s|0)?l.x=s:f+=s;for(var o=0;o>>4),l.next()}function i(s,l){return l.x=s.x,l.y=s.y,l.z=s.z,l.w=s.w,l.v=s.v,l.d=s.d,l}function a(s,l){var f=new n(s),o=l&&l.state,u=function(){return(f.next()>>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,h=(f.next()>>>0)/4294967296,d=(p+h)/(1<<21);while(d===0);return d},u.int32=f.next,u.quick=u,o&&(typeof o=="object"&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xorwow=a})(oF,typeof Sg=="object"&&Sg,typeof define=="function"&&define)});var fF=un((uF,Ng)=>{(function(e,r,t){function n(s){var l=this;l.next=function(){var o=l.x,u=l.i,p,h,d;return p=o[u],p^=p>>>7,h=p^p<<24,p=o[u+1&7],h^=p^p>>>10,p=o[u+3&7],h^=p^p>>>3,p=o[u+4&7],h^=p^p<<7,p=o[u+7&7],p=p^p<<13,h^=p^p<<9,o[u]=h,l.i=u+1&7,h};function f(o,u){var p,h,d=[];if(u===(u|0))h=d[0]=u;else for(u=""+u,p=0;p0;--p)o.next()}f(l,s)}function i(s,l){return l.x=s.x.slice(),l.i=s.i,l}function a(s,l){s==null&&(s=+new Date);var f=new n(s),o=l&&l.state,u=function(){return(f.next()>>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,h=(f.next()>>>0)/4294967296,d=(p+h)/(1<<21);while(d===0);return d},u.int32=f.next,u.quick=u,o&&(o.x&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xorshift7=a})(uF,typeof Ng=="object"&&Ng,typeof define=="function"&&define)});var cF=un((lF,Ag)=>{(function(e,r,t){function n(s){var l=this;l.next=function(){var o=l.w,u=l.X,p=l.i,h,d;return l.w=o=o+1640531527|0,d=u[p+34&127],h=u[p=p+1&127],d^=d<<13,h^=h<<17,d^=d>>>15,h^=h>>>12,d=u[p]=d^h,l.i=p,d+(o^o>>>16)|0};function f(o,u){var p,h,d,x,v,y=[],w=128;for(u===(u|0)?(h=u,u=null):(u=u+"\\0",h=0,w=Math.max(w,u.length)),d=0,x=-32;x>>15,h^=h<<4,h^=h>>>13,x>=0&&(v=v+1640531527|0,p=y[x&127]^=h+v,d=p==0?d+1:0);for(d>=128&&(y[(u&&u.length||0)&127]=-1),d=127,x=4*128;x>0;--x)h=y[d+34&127],p=y[d=d+1&127],h^=h<<13,p^=p<<17,h^=h>>>15,p^=p>>>12,y[d]=h^p;o.w=v,o.X=y,o.i=d}f(l,s)}function i(s,l){return l.i=s.i,l.w=s.w,l.X=s.X.slice(),l}function a(s,l){s==null&&(s=+new Date);var f=new n(s),o=l&&l.state,u=function(){return(f.next()>>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,h=(f.next()>>>0)/4294967296,d=(p+h)/(1<<21);while(d===0);return d},u.int32=f.next,u.quick=u,o&&(o.X&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xor4096=a})(lF,typeof Ag=="object"&&Ag,typeof define=="function"&&define)});var mF=un((pF,Eg)=>{(function(e,r,t){function n(s){var l=this,f="";l.next=function(){var u=l.b,p=l.c,h=l.d,d=l.a;return u=u<<25^u>>>7^p,p=p-h|0,h=h<<24^h>>>8^d,d=d-u|0,l.b=u=u<<20^u>>>12^p,l.c=p=p-h|0,l.d=h<<16^p>>>16^d,l.a=d-u|0},l.a=0,l.b=0,l.c=-1640531527,l.d=1367130551,s===Math.floor(s)?(l.a=s/4294967296|0,l.b=s|0):f+=s;for(var o=0;o>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,h=(f.next()>>>0)/4294967296,d=(p+h)/(1<<21);while(d===0);return d},u.int32=f.next,u.quick=u,o&&(typeof o=="object"&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.tychei=a})(pF,typeof Eg=="object"&&Eg,typeof define=="function"&&define)});var hF=un(()=>{});var vF=un((dF,Hp)=>{(function(e,r,t){var n=256,i=6,a=52,s="random",l=t.pow(n,i),f=t.pow(2,a),o=f*2,u=n-1,p;function h(b,A,E){var S=[];A=A==!0?{entropy:!0}:A||{};var O=y(v(A.entropy?[b,C(r)]:b??w(),3),S),F=new d(S),M=function(){for(var _=F.g(i),k=l,L=0;_=o;)_/=2,k/=2,L>>>=1;return(_+L)/k};return M.int32=function(){return F.g(4)|0},M.quick=function(){return F.g(4)/4294967296},M.double=M,y(C(F.S),r),(A.pass||E||function(_,k,L,Y){return Y&&(Y.S&&x(Y,F),_.state=function(){return x(F,{})}),L?(t[s]=_,k):_})(M,O,"global"in A?A.global:this==t,A.state)}function d(b){var A,E=b.length,S=this,O=0,F=S.i=S.j=0,M=S.S=[];for(E||(b=[E++]);O{var wW=nF(),DW=aF(),SW=sF(),NW=fF(),AW=cF(),EW=mF(),ss=vF();ss.alea=wW;ss.xor128=DW;ss.xorwow=SW;ss.xorshift7=NW;ss.xor4096=AW;ss.tychei=EW;gF.exports=ss});var GO=un((q3e,Bg)=>{function Og(){}Og.prototype={on:function(e,r,t){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:r,ctx:t}),this},once:function(e,r,t){var n=this;function i(){n.off(e,i),r.apply(t,arguments)}return i._=r,this.on(e,i,t)},emit:function(e){var r=[].slice.call(arguments,1),t=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=t.length;for(n;n[...new Set(e)];var fo="File";function ld(e){return Array.isArray(e)?e:typeof e=="string"?[e]:[]}function yx(e){return e?typeof e!="string"?e.toString():e:""}var bx=(e,r)=>r.indexOf(e)>0?r.indexOf(e):r.length;function pi(e){return pi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},pi(e)}function Pn(e){if(e===null||e===!0||e===!1)return NaN;var r=Number(e);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}function ot(e,r){if(r.length1?"s":"")+" required, but only "+r.length+" present")}function Lt(e){ot(1,arguments);var r=Object.prototype.toString.call(e);return e instanceof Date||pi(e)==="object"&&r==="[object Date]"?new Date(e.getTime()):typeof e=="number"||r==="[object Number]"?new Date(e):((typeof e=="string"||r==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use \`parseISO\` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function cd(e,r){ot(2,arguments);var t=Lt(e).getTime(),n=Pn(r);return new Date(t+n)}var c8={};function lo(){return c8}function pd(e){var r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),e.getTime()-r.getTime()}function md(e){return ot(1,arguments),e instanceof Date||pi(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function hd(e){if(ot(1,arguments),!md(e)&&typeof e!="number")return!1;var r=Lt(e);return!isNaN(Number(r))}function dd(e,r){ot(2,arguments);var t=Pn(r);return cd(e,-t)}var p8=864e5;function vd(e){ot(1,arguments);var r=Lt(e),t=r.getTime();r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0);var n=r.getTime(),i=t-n;return Math.floor(i/p8)+1}function co(e){ot(1,arguments);var r=1,t=Lt(e),n=t.getUTCDay(),i=(n=i.getTime()?t+1:r.getTime()>=s.getTime()?t:t-1}function gd(e){ot(1,arguments);var r=pf(e),t=new Date(0);t.setUTCFullYear(r,0,4),t.setUTCHours(0,0,0,0);var n=co(t);return n}var m8=6048e5;function xd(e){ot(1,arguments);var r=Lt(e),t=co(r).getTime()-gd(r).getTime();return Math.round(t/m8)+1}function po(e,r){var t,n,i,a,s,l,f,o;ot(1,arguments);var u=lo(),p=Pn((t=(n=(i=(a=r?.weekStartsOn)!==null&&a!==void 0?a:r==null||(s=r.locale)===null||s===void 0||(l=s.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&n!==void 0?n:(f=u.locale)===null||f===void 0||(o=f.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&t!==void 0?t:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=Lt(e),d=h.getUTCDay(),x=(d=1&&d<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(p+1,0,d),x.setUTCHours(0,0,0,0);var v=po(x,r),y=new Date(0);y.setUTCFullYear(p,0,d),y.setUTCHours(0,0,0,0);var w=po(y,r);return u.getTime()>=v.getTime()?p+1:u.getTime()>=w.getTime()?p:p-1}function yd(e,r){var t,n,i,a,s,l,f,o;ot(1,arguments);var u=lo(),p=Pn((t=(n=(i=(a=r?.firstWeekContainsDate)!==null&&a!==void 0?a:r==null||(s=r.locale)===null||s===void 0||(l=s.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&n!==void 0?n:(f=u.locale)===null||f===void 0||(o=f.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&t!==void 0?t:1),h=mf(e,r),d=new Date(0);d.setUTCFullYear(h,0,p),d.setUTCHours(0,0,0,0);var x=po(d,r);return x}var h8=6048e5;function bd(e,r){ot(1,arguments);var t=Lt(e),n=po(t,r).getTime()-yd(t,r).getTime();return Math.round(n/h8)+1}function it(e,r){for(var t=e<0?"-":"",n=Math.abs(e).toString();n.length0?n:1-n;return it(t==="yy"?i%100:i,t.length)},M:function(r,t){var n=r.getUTCMonth();return t==="M"?String(n+1):it(n+1,2)},d:function(r,t){return it(r.getUTCDate(),t.length)},a:function(r,t){var n=r.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(r,t){return it(r.getUTCHours()%12||12,t.length)},H:function(r,t){return it(r.getUTCHours(),t.length)},m:function(r,t){return it(r.getUTCMinutes(),t.length)},s:function(r,t){return it(r.getUTCSeconds(),t.length)},S:function(r,t){var n=t.length,i=r.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,n-3));return it(a,t.length)}},Oa=d8;var zs={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},v8={G:function(r,t,n){var i=r.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(r,t,n){if(t==="yo"){var i=r.getUTCFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return Oa.y(r,t)},Y:function(r,t,n,i){var a=mf(r,i),s=a>0?a:1-a;if(t==="YY"){var l=s%100;return it(l,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):it(s,t.length)},R:function(r,t){var n=pf(r);return it(n,t.length)},u:function(r,t){var n=r.getUTCFullYear();return it(n,t.length)},Q:function(r,t,n){var i=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return it(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(r,t,n){var i=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return it(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(r,t,n){var i=r.getUTCMonth();switch(t){case"M":case"MM":return Oa.M(r,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(r,t,n){var i=r.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return it(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(r,t,n,i){var a=bd(r,i);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):it(a,t.length)},I:function(r,t,n){var i=xd(r);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):it(i,t.length)},d:function(r,t,n){return t==="do"?n.ordinalNumber(r.getUTCDate(),{unit:"date"}):Oa.d(r,t)},D:function(r,t,n){var i=vd(r);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):it(i,t.length)},E:function(r,t,n){var i=r.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(r,t,n,i){var a=r.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return it(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(r,t,n,i){var a=r.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return it(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(r,t,n){var i=r.getUTCDay(),a=i===0?7:i;switch(t){case"i":return String(a);case"ii":return it(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(r,t,n){var i=r.getUTCHours(),a=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(r,t,n){var i=r.getUTCHours(),a;switch(i===12?a=zs.noon:i===0?a=zs.midnight:a=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(r,t,n){var i=r.getUTCHours(),a;switch(i>=17?a=zs.evening:i>=12?a=zs.afternoon:i>=4?a=zs.morning:a=zs.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(r,t,n){if(t==="ho"){var i=r.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Oa.h(r,t)},H:function(r,t,n){return t==="Ho"?n.ordinalNumber(r.getUTCHours(),{unit:"hour"}):Oa.H(r,t)},K:function(r,t,n){var i=r.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):it(i,t.length)},k:function(r,t,n){var i=r.getUTCHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):it(i,t.length)},m:function(r,t,n){return t==="mo"?n.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):Oa.m(r,t)},s:function(r,t,n){return t==="so"?n.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):Oa.s(r,t)},S:function(r,t){return Oa.S(r,t)},X:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return Dx(s);case"XXXX":case"XX":return Zo(s);case"XXXXX":case"XXX":default:return Zo(s,":")}},x:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();switch(t){case"x":return Dx(s);case"xxxx":case"xx":return Zo(s);case"xxxxx":case"xxx":default:return Zo(s,":")}},O:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+wx(s,":");case"OOOO":default:return"GMT"+Zo(s,":")}},z:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+wx(s,":");case"zzzz":default:return"GMT"+Zo(s,":")}},t:function(r,t,n,i){var a=i._originalDate||r,s=Math.floor(a.getTime()/1e3);return it(s,t.length)},T:function(r,t,n,i){var a=i._originalDate||r,s=a.getTime();return it(s,t.length)}};function wx(e,r){var t=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),a=n%60;if(a===0)return t+String(i);var s=r||"";return t+String(i)+s+it(a,2)}function Dx(e,r){if(e%60===0){var t=e>0?"-":"+";return t+it(Math.abs(e)/60,2)}return Zo(e,r)}function Zo(e,r){var t=r||"",n=e>0?"-":"+",i=Math.abs(e),a=it(Math.floor(i/60),2),s=it(i%60,2);return n+a+t+s}var Sx=v8;var Nx=function(r,t){switch(r){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Ax=function(r,t){switch(r){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},g8=function(r,t){var n=r.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return Nx(r,t);var s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Nx(i,t)).replace("{{time}}",Ax(a,t))},x8={p:Ax,P:g8},Ex=x8;var y8=["D","DD"],b8=["YY","YYYY"];function Cx(e){return y8.indexOf(e)!==-1}function Mx(e){return b8.indexOf(e)!==-1}function wd(e,r,t){if(e==="YYYY")throw new RangeError("Use \`yyyy\` instead of \`YYYY\` (in \`".concat(r,"\`) for formatting years to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use \`yy\` instead of \`YY\` (in \`".concat(r,"\`) for formatting years to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use \`d\` instead of \`D\` (in \`".concat(r,"\`) for formatting days of the month to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use \`dd\` instead of \`DD\` (in \`".concat(r,"\`) for formatting days of the month to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var w8={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},D8=function(r,t,n){var i,a=w8[r];return typeof a=="string"?i=a:t===1?i=a.one:i=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},_x=D8;function hf(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.width?String(r.width):e.defaultWidth,n=e.formats[t]||e.formats[e.defaultWidth];return n}}var S8={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},N8={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},A8={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},E8={date:hf({formats:S8,defaultWidth:"full"}),time:hf({formats:N8,defaultWidth:"full"}),dateTime:hf({formats:A8,defaultWidth:"full"})},Tx=E8;var C8={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},M8=function(r,t,n,i){return C8[r]},Fx=M8;function Qo(e){return function(r,t){var n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,s=t!=null&&t.width?String(t.width):a;i=e.formattingValues[s]||e.formattingValues[a]}else{var l=e.defaultWidth,f=t!=null&&t.width?String(t.width):e.defaultWidth;i=e.values[f]||e.values[l]}var o=e.argumentCallback?e.argumentCallback(r):r;return i[o]}}var _8={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},T8={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},F8={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},O8={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},B8={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},I8={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},P8=function(r,t){var n=Number(r),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},k8={ordinalNumber:P8,era:Qo({values:_8,defaultWidth:"wide"}),quarter:Qo({values:T8,defaultWidth:"wide",argumentCallback:function(r){return r-1}}),month:Qo({values:F8,defaultWidth:"wide"}),day:Qo({values:O8,defaultWidth:"wide"}),dayPeriod:Qo({values:B8,defaultWidth:"wide",formattingValues:I8,defaultFormattingWidth:"wide"})},Ox=k8;function Xo(e){return function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=r.match(i);if(!a)return null;var s=a[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],f=Array.isArray(l)?L8(l,function(p){return p.test(s)}):R8(l,function(p){return p.test(s)}),o;o=e.valueCallback?e.valueCallback(f):f,o=t.valueCallback?t.valueCallback(o):o;var u=r.slice(s.length);return{value:o,rest:u}}}function R8(e,r){for(var t in e)if(e.hasOwnProperty(t)&&r(e[t]))return t}function L8(e,r){for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:{},n=r.match(e.matchPattern);if(!n)return null;var i=n[0],a=r.match(e.parsePattern);if(!a)return null;var s=e.valueCallback?e.valueCallback(a[0]):a[0];s=t.valueCallback?t.valueCallback(s):s;var l=r.slice(i.length);return{value:s,rest:l}}}var q8=/^(\\d+)(th|st|nd|rd)?/i,U8=/\\d+/i,z8={narrow:/^(b|a)/i,abbreviated:/^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},W8={any:[/^b/i,/^(a|c)/i]},V8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Y8={any:[/1/i,/2/i,/3/i,/4/i]},H8={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},G8={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},$8={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Z8={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Q8={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},X8={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},J8={ordinalNumber:Dd({matchPattern:q8,parsePattern:U8,valueCallback:function(r){return parseInt(r,10)}}),era:Xo({matchPatterns:z8,defaultMatchWidth:"wide",parsePatterns:W8,defaultParseWidth:"any"}),quarter:Xo({matchPatterns:V8,defaultMatchWidth:"wide",parsePatterns:Y8,defaultParseWidth:"any",valueCallback:function(r){return r+1}}),month:Xo({matchPatterns:H8,defaultMatchWidth:"wide",parsePatterns:G8,defaultParseWidth:"any"}),day:Xo({matchPatterns:$8,defaultMatchWidth:"wide",parsePatterns:Z8,defaultParseWidth:"any"}),dayPeriod:Xo({matchPatterns:Q8,defaultMatchWidth:"any",parsePatterns:X8,defaultParseWidth:"any"})},Bx=J8;var K8={code:"en-US",formatDistance:_x,formatLong:Tx,formatRelative:Fx,localize:Ox,match:Bx,options:{weekStartsOn:0,firstWeekContainsDate:1}},Ix=K8;var Px=Ix;var j8=/[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g,ek=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rk=/^'([^]*?)'?$/,tk=/''/g,nk=/[a-zA-Z]/;function Ba(e,r,t){var n,i,a,s,l,f,o,u,p,h,d,x,v,y,w,C,b,A;ot(2,arguments);var E=String(r),S=lo(),O=(n=(i=t?.locale)!==null&&i!==void 0?i:S.locale)!==null&&n!==void 0?n:Px,F=Pn((a=(s=(l=(f=t?.firstWeekContainsDate)!==null&&f!==void 0?f:t==null||(o=t.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&l!==void 0?l:S.firstWeekContainsDate)!==null&&s!==void 0?s:(p=S.locale)===null||p===void 0||(h=p.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(F>=1&&F<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=Pn((d=(x=(v=(y=t?.weekStartsOn)!==null&&y!==void 0?y:t==null||(w=t.locale)===null||w===void 0||(C=w.options)===null||C===void 0?void 0:C.weekStartsOn)!==null&&v!==void 0?v:S.weekStartsOn)!==null&&x!==void 0?x:(b=S.locale)===null||b===void 0||(A=b.options)===null||A===void 0?void 0:A.weekStartsOn)!==null&&d!==void 0?d:0);if(!(M>=0&&M<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!O.localize)throw new RangeError("locale must contain localize property");if(!O.formatLong)throw new RangeError("locale must contain formatLong property");var _=Lt(e);if(!hd(_))throw new RangeError("Invalid time value");var k=pd(_),L=dd(_,k),Y={firstWeekContainsDate:F,weekStartsOn:M,locale:O,_originalDate:_},$=E.match(ek).map(function(V){var q=V[0];if(q==="p"||q==="P"){var R=Ex[q];return R(V,O.formatLong)}return V}).join("").match(j8).map(function(V){if(V==="''")return"'";var q=V[0];if(q==="'")return ik(V);var R=Sx[q];if(R)return!(t!=null&&t.useAdditionalWeekYearTokens)&&Mx(V)&&wd(V,r,String(e)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&Cx(V)&&wd(V,r,String(e)),R(L,V,O.localize,Y);if(q.match(nk))throw new RangeError("Format string contains an unescaped latin alphabet character \`"+q+"\`");return V}).join("");return $}function ik(e){var r=e.match(rk);return r?r[1].replace(tk,"'"):e}function Sd(e,r){if(pi(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(pi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Nd(e){var r=Sd(e,"string");return pi(r)=="symbol"?r:r+""}function Ur(e,r,t){return r=Nd(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var Ad=(e,r)=>{if(e instanceof Date)return"date";if(typeof e=="string"){if(/\\/\\/(\\S+?(?:jpe?g|png|gif|svg))/gi.test(e)||e.includes("unsplash"))return"image";if(/^\\d{4}-\\d{2}-\\d{2}$/.test(e))return"date";if(r=="tag"||r=="tags")return"tag";if(/\\[\\[.*?\\]\\]/.test(e))return"link"}else{if(typeof e=="number")return"number";if(typeof e=="boolean")return"boolean";if(e)if(Array.isArray(e)||typeof e=="string"&&e.indexOf(",")>-1){let t=Array.isArray(e)?e:[];if(typeof e=="string"&&e.indexOf(",")>-1&&(t=Ui(e)),r=="tag"||r=="tags")return"tag-multi";if(t.length==1&&Array.isArray(t[0])&&t[0].length==1&&typeof t[0][0]=="string")return"link";let n=Jl(t.map(i=>Ad(i,r)));return n.length==1&&n[0]=="link"?"link-multi":n.some(i=>i=="object")?"object-multi":"option-multi"}else{if(e.isLuxonDateTime)return"date";if(e.isLuxonDuration)return"duration";if(e.type=="file")return"link";if(typeof e=="object"&&!Array.isArray(e)&&e!==null)return"object"}else return"unknown"}return"text"};var kx=e=>e.map(r=>r.replace(",","\\\\,")).join(", "),Jo=e=>e.map(r=>r.replace(",","\\\\,")).join(", ");var Ui=e=>(e?.replace("\\\\,",",").match(/(\\\\.|[^,])+/g)??[]).map(r=>r.trim()),ec=(e,r)=>{switch(Ad(r,e)){case"object":return JSON.stringify(r);case"number":return r.toString();case"boolean":return r?"true":"false";case"date":{if(r instanceof Date){let n=Ba(r,"yyyy-MM-dd");if(typeof n=="string")return n}return typeof r!="string"?"":r}break;case"duration":return kx(Object.keys(r.values).reduce((n,i)=>[...n,...r.values[i]>0?[r.values[i]+" "+i]:[]],[]));case"option-multi":case"link-multi":return typeof r=="string"?jl(r):Jo(r.map(n=>n?typeof n=="string"?jl(n):n.path?n.path:Array.isArray(r)&&n.length==1&&Array.isArray(n[0])&&n[0].length==1&&typeof n[0][0]=="string"?n[0][0]:JSON.stringify(n):""));case"link":return Array.isArray(r)&&r.length==1&&Array.isArray(r[0])&&r[0].length==1&&typeof r[0][0]=="string"?r[0][0]:typeof r=="string"?jl(r):r.path;case"text":case"tag":case"image":return r}return""},Kl=e=>{let r;try{r=JSON.parse(e)}catch{}return r};var jl=e=>{if(!e)return"";let r=/\\[\\[(.*?)\\]\\]/g.exec(e),t=r?.length>1?r[1].substring(0,bx("|",r[1])):e;return t||e};var rc=(e,r)=>e==r,Ed=(e,r)=>(e??"").length==0,Cd=(e,r)=>(e??"").toLowerCase().includes((r??"").toLowerCase()),Md=(e,r)=>parseFloat(e)>parseFloat(r),_d=(e,r)=>parseInt(e)>parseInt(r),Rx=(e,r)=>{let t=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),n=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return t.valueOf()>n.valueOf()},Lx=(e,r)=>{let t=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),n=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return t.valueOf(){let t=e?Ui(e):[];return(r?Ui(r):[]).some(i=>t.some(a=>a==i))},qx=(e,r)=>{if(!e)return!1;let t=new Date(\`\${e.toString().replace(".",":")}\`),n=new Date(\`\${r}\`);return t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()},Ux=e=>{if(!e)return!1;let r=new Date(\`\${e.toString()}T00:00\`),t=new Date;return r.getMonth()===t.getMonth()&&r.getDate()===t.getDate()};var df={isNotEmpty:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>!Ed(e,""),valueType:"none"},isEmpty:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>Ed(e,""),valueType:"none"},include:{fn:(e,r)=>Cd(e,r),type:["text","file","link","link-multi","fileprop","image"],valueType:"text"},notInclude:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>!Cd(e,r),valueType:"text"},is:{type:["text","file","link","context","fileprop"],fn:(e,r)=>rc(e,r),valueType:"text"},isNot:{type:["text","file","link","context","fileprop"],fn:(e,r)=>!rc(e,r),valueType:"text"},equal:{type:["number"],fn:(e,r)=>rc(e,r),valueType:"number"},isGreatThan:{type:["number"],fn:(e,r)=>Md(e,r),valueType:"number"},isLessThan:{type:["number"],fn:(e,r)=>_d(e,r),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(e,r)=>!Md(e,r),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(e,r)=>!_d(e,r),valueType:"number"},dateBefore:{type:["date","fileprop"],fn:(e,r)=>Lx(e,r),valueType:"date"},dateAfter:{type:["date","fileprop"],fn:(e,r)=>Rx(e,r),valueType:"date"},isSameDate:{type:["date"],fn:(e,r)=>qx(e,r),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(e,r)=>Ux(e,r),valueType:"none"},isAnyInList:{type:["option","context","option-multi","context-multi","tags-multi","tags"],fn:(e,r)=>Td(e,r),valueType:"list"},isNoneInList:{type:["option","context","option-multi","context-multi","tags-multi","tags"],fn:(e,r)=>!Td(e,r),valueType:"list"},isTrue:{type:["boolean"],fn:(e,r)=>e=="true",valueType:"none"},isFalse:{type:["boolean"],fn:(e,r)=>e!="true",valueType:"none"}};var ak=(e,r)=>r.reduce((n,i)=>{let[a,s]=n,l=i.type=="path"?Wx(s,i):i.type=="frontmatter"?zx(s,i):Vx(s,i),f=s.filter(o=>!l.includes(o));return[[...a,...l],f]},[[],e])[0],ok=(e,r)=>r.reduce((t,n)=>n.type=="path"?Wx(t,n):n.type=="frontmatter"?zx(t,n):Vx(t,n),e),zx=(e,r)=>e.filter(t=>{let n=t.metadata?.property;if(!n||!n[r.field])return!1;let i=df[r.fn],a=!0;return i&&(a=i.fn(ec(r.field,n[r.field]),r.value)),a}),Wx=(e,r)=>e.filter(t=>{let n="";r.field=="outlinks"?n=Jo(t.outlinks??[]):r.field=="inlinks"?n=Jo(t.inlinks??[]):r.field=="tags"&&(n=Jo(t.tags??[]));let i=df[r.fn],a=!0;return i&&(a=i.fn(n,r.value)),a}),Vx=(e,r)=>e.filter(t=>{let n=df[r.fn],i=!0;return n&&(i=n.fn(t.metadata?.[r.type]?.[r.field],r.value)),i}),Fd=(e,r)=>e.reduce((n,i)=>!n||i.filters.length==0?!1:i.type=="any"?ak([r],i.filters).length>0:ok([r],i.filters).length>0,!0);var Hx=Xn(Yx()),Bd=class{constructor(){this.lang="en";this.all={en:{hintText:{dragDropModifierKeys:"Hold \${1} to Pin and \${2} to Copy",createListItem:"Select/Create List Item Frame",dragDropProperties:"Drag and drop properties to link them into the list",newItem:"+ New",selectNote:"Select Note...",newFrame:"New"},defaults:{spaceNote:"Current Note",spaceContext:"Current Space"},commands:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",columns:"Columns",button:"Button",label:"Label",column:"Column",idea:"New",group:"Group",paragraph:"Text",card:"Card",progress:"Progress",rating:"Rating",circularProgress:"Circular Progress",list:"Bullet List","ordered-list":"Numbered List",todo:"To-do List",quote:"Quote",divider:"Divider",note:"Link to Note",link:"Link",callout:"Callout",bookmark:"Bookmark",table:"Table",codeblock:"Code Block",toggle:"Toggle",emoji:"Emoji",image:"Image",flow:"Linked Note",newNote:"New Note",tag:"Tag",makeMenu:"Flow Menu",selectStyle:"Style",toggleKeyboard:"Toggle Keyboard",rows:"Rows",masonry:"Gallery"},styles:{bold:"Bold",italics:"Italics",strikethrough:"Strikethrough",code:"Code",link:"Web Link",blocklink:"Link to Note",textColor:"Text Color",highlight:"Highlight"},commandsSuggest:{noResult:"No result"},commandPalette:{enable:"Enable",disabled:"Disable",openFlow:"Open Flow Blocks in Selection",closeFlow:"Close Flow Blocks in Selection",toggleBold:"Toggle Bold",toggleItalics:"Toggle Italics",openSpaces:"Open Spaces",migrateData:"Migrate Spaces From 0.7",blink:"Blink",openFileContext:"Open Explorer",convertPathToSpace:"Convert to Space",revealFile:"Reveal File in Spaces",releaseNotes:"Release Notes",toggleBacklinks:"Toggle Backlinks",collapseAllFolders:"Collapse All Folders",addFileSpace:"Add File to Space",removeFileSpace:"Remove File from Space"},frames:{sections:{kit:"Kit",paths:"Paths"},label:{label:"Label",description:"Label"},note:{label:"Note",description:"Link to a note"},table:{label:"Table",description:"Table"},context:{label:"Context",description:"Display a context view from another space"},calendar:{label:"Calendar View"},field:{label:"Field",description:"Dynamic node that displays a value based on property type"},event:{label:"Event"},divider:{label:"Divider",description:"Divider to separate your content"},button:{label:"Button",description:"Buttons can perform actions and open links"},callout:{label:"Callout",description:"Callout to highlight important information"},toggle:{label:"Toggle",description:"Toggle to show/hide content"}},menu:{newView:"New View",closeSpace:"Close Space",customView:"Custom View",detailsView:"Details View",catalogView:"Catalog View",galleryView:"Gallery View",deleteContext:"Delete Context",openSpace:"Open Space",revealInDefault:"Reveal in Finder",setNone:"None",fileMetadataDescription:"This note only",openFilePane:"Open in a new pane",rename:"Rename",changeToFolderNote:"New Space from Note",moveFile:"Move file to...",moveFolder:"Move folder to...",duplicate:"Make a copy",edit:"Edit",delete:"Delete",getHelp:"Make.md Community",vault:"Vault",openVault:"Open Another Vault",openVaultInFolder:"Open Vault Folder",obSettings:"Obsidian Settings",commandPalette:"Command Palette",backToSpace:"Back to Spaces",collapseAllSections:"Collapse All Spaces",expandAllSections:"Expand All Spaces",collapseAllFolders:"Collapse All Folders",expandAllFolders:"Expand All Folders",spaceTitle:"Add/Remove in Space",home:"Home",waypoints:"Waypoints",none:"None",tableView:"Table View",cardView:"Card View",boardView:"Board View",listView:"List View",flowView:"Flow View",groupBy:"Group By",sortBy:"Sort By",newFilter:"New Filter",clearFilters:"Clear Filters",hide:"Hide",unhideFields:"Unhide All Properties",importDataview:"Import All Dataview Properties",saveAllProperties:"Save All Properties to Files",mergeProperties:"Merge Properties",removeFromSpace:"Unpin from Space",removeFromWaypoints:"Unpin from Waypoints",editCode:"Edit Code",deleteProperty:"Delete Property",hideProperty:"Hide Property",unhideProperty:"Unhide Property",saveProperty:"Save Property",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",deleteRow:"Delete Item",collapseAll:"Collapse All",customSort:"Custom Sort",groupSpaces:"Group Spaces",fileNameSortAlphaAsc:"File Name (A to Z)",fileNameSortAlphaDesc:"File Name (Z to A)",createdTimeSortAsc:"Created Time (new to old)",createdTimeSortDesc:"Created Time (old to new)",modifiedTimeSortAsc:"Modified Time (new to old)",modifiedTimeSortDesc:"Modified Time (old to new)",sizeSortAsc:"Size (smallest to largest)",sizeSortDesc:"Size (largest to smallest)",spaces:"Spaces",tags:"Tags",manageHiddenFiles:"Manage Hidden Files",manageActions:"Manage Actions",deleteSpace:"Delete",changeColor:"Change Color",changePropertyType:"Change Type",deleteFiles:"Delete Files",createFolderSpace:"Create Space from Folder",folder:"Folder",syncToContext:"Add Property to Context",setIcon:"Set Icon",copyEmbedLink:"Copy Embed Link",moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",groupNodes:"Group Nodes",moveFrame:"Move Frame",renameFrame:"Rename Frame",deleteFrame:"Delete Frame"},editor:{rows:"Rows",columns:"Columns",catalog:"Catalog",gallery:"Gallery",grid:"Grid",scaleToFit:"Change to Fit",scaleToFill:"Change to Fill",fit:"Fit",strokeNone:"None",strokeSolid:"Solid",strokeDotted:"Dotted",strokeDashed:"Dashed",size:"Size",gap:"Gap",marginLeft:"Left",marginTop:"Top",marginRight:"Right",marginBottom:"Bottom",minimize:"Minimize",paddingLeft:"Left",paddingTop:"Top",paddingRight:"Right",paddingBottom:"Bottom",unlinkProperty:"Unlink Property",linkedProperty:"Linked Property",linkProperty:"Link Property",currentSpace:"Current Space",linkName:"\${1} Link",linkThumbnail:"\${1} Thumbnail",linkSticker:"\${1} Sticker",opacity:"Opacity",shadowSpread:"Spread",shadowBlur:"Blur",width:"Width",height:"Height",margin:"Margin",padding:"Padding",bold:"Bold",italic:"Italic",underline:"Underline",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",numberOfLines:"Lines",createVerticalSection:"Create Vertical Section",createHorizontalSection:"Create Horizontal Section",themeColors:"Theme Colors",uiColors:"UI Colors",hex:"Hex"},buttons:{add:"Add",addFilter:"Add Filter",customize:"Customize",moreOptions:"More Options",saveProperty:"Save Property",newNote:"New Note",changeIcon:"Change Sticker",removeIcon:"Remove Sticker",addIcon:"Add Sticker",addCover:"Add Cover",changeBanner:"Change Cover",changeBannerShort:"Cover",saveChanges:"Save Changes",removeBanner:"Remove Cover",rename:"Change Name",editFrame:"Edit Frame",saveSpace:"Save Space",createSpace:"New Space",createFolder:"New Folder",createNote:"New Note",createCanvas:"New Canvas",addIntoSpace:"New Pin",addSmartSearch:"Add Smart Search",addItem:"Add Item",addProperty:"Add Property",addContext:"Add Context",cancel:"Cancel",search:"Search",delete:"Delete",toggleFlow:"Toggle Flow",openFlow:"Open Flow",hideFlow:"Hide Flow",openLink:"Open Link",addToSpace:"Add to Space",addToSpaceShort:"Pin",addTag:"Add Tag",tag:"Tag",syncFields:"Sync Properties",convertTable:"Convert to Markdown",cutTable:"Cut Table",deleteTable:"Delete Table",blink:"Blink",addFile:"Add Item",merge:"Merge",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",deleteView:"Delete View",renameTable:"Rename Table",renameTag:"Rename Tag",createTag:"Create Tag",currentFolder:"Current Folder",sync:"Sync",pasteCSS:"Paste CSS",save:"Save",run:"Run"},metadataTypes:{fileName:"File Name",path:"Path",folder:"Folder",sticker:"Sticker",color:"Color",created:"Created",lastModified:"Last Modified",extension:"Extension",size:"Size",tags:"Tags",inlinks:"Linked Mentions",outlinks:"Links",label:"Label",fileMetadata:"File Metadata",frontmatter:"Frontmatter"},filterTypes:{contains:"contains",notContains:"does not contain",is:"is",isNot:"is not",before:"before",after:"after",anyOf:"is any of",noneOf:"is none of",checked:"is checked",unchecked:"is unchecked",isEmpty:"is empty",isNotEmpty:"is not empty",isSameDate:"is same date",isSameDateAsToday:"today"},sortTypes:{alphaAsc:"A to Z",alphaDesc:"Z to A",earliest:"Earliest",latest:"Latest",checkAsc:"Checked \\u2192 Unchecked",checkDesc:"Unchecked \\u2192 Checked",itemsAsc:"Least Items",itemsDesc:"Most Items"},properties:{defaultField:"Name",audio:{label:"Audio",description:"Audio"},text:{label:"Text",description:"Text field"},number:{label:"Number",description:"Number field with optional unit"},boolean:{label:"Yes/No",description:"Yes or No toggle to indicate the status"},date:{label:"Date",description:"Select a date from a calendar"},option:{label:"Option",description:"Select one or multiple option from a list"},file:{label:"File"},link:{label:"Link",description:"Link to another note or a website"},tags:{label:"Tags",description:"Use tags to quickly organize your items"},object:{label:"Object",description:"Store any complex objects"},context:{label:"Relation",description:"Connect to another context property and create a relation"},image:{label:"Image",description:"Select any image from your system or from the internet"},color:{label:"Color",description:"Use colors to label your items or status"},space:{label:"Context",description:"Link to a context"},icon:{label:"Sticker",description:"Use stickers to uniquely label your items or status"},super:{label:"Super Property",links:"Open Link",properties:"Update Property",api:"API",obsidianCommands:"Run Command",runCommand:"Run Command",performAction:"Perform Action",whenClicked:"When Clicked"},fileProperty:{name:"Name",label:"Formula",createdTime:"Created",modifiedTime:"Last Edited",sticker:"Sticker",links:"Links",tags:"Tags",spaces:"Spaces",extension:"Extension",size:"Size",preview:"Note Preview",parentFolder:"Folder",description:"Use a formula to dynamically display a property"}},views:{navigator:"Navigator",explorer:"Explorer",space:"Space"},subViews:{spaceItems:"Items",spaceContext:"Context",spaceLists:"Lists",spaceActions:"Actions",spaceTemplates:"Templates",smartSearch:"Smart Search",filesAndFolders:"Files and Folders"},labels:{properties:"Properties",newAction:"New Action",newTable:"New Table",createFolder:"New Folder Name",rename:"Rename",createNew:"New",default:"Default",done:"Done",tables:"Tables",selectDateFormat:"Select/Type Date Format",renameSectionSmart:"Edit Smart Space",renameSection:"Edit Space",createSectionSmart:"New Smart Space",createSection:"New Folder",createNote:"New Note",contextMaker:"Context Maker",select:"Select",pinnedItems:"Pinned Items",collapse:"Collapse",expand:"Expand",all:"All",none:"None",view:"View",findStickers:"Find Sticker",mergeProperties:"Merge Properties",placeholder:"Type '\${1}' for commands",itemsSelected:"\${1} Selected",selectNote:"Select Note",selectIcon:"Select Icon",selectImage:"Select Image",selectSpace:"Select Space",styleSmall:"Small",styleMedium:"Medium",styleLarge:"Large",hiddenFilePattern:"Name, Suffixes and Extension",hiddenFileSpecific:"Exclude specific files and folders",textPlaceholder:"Enter Text",noFile:"is not created yet. Click to create.",navigatorSearchPlaceholder:"Search by Text or Filters",blinkPlaceholder:"Quickly Search a File, Folder, Tag... Press Tab to Edit",searchPlaceholder:"Type to search...",contextItemSelectPlaceholder:"Find Item",linkItemSelectPlaceholder:"Find or Create Note",pinNotePlaceholder:"Select a Note or Space to Pin",optionItemSelectPlaceholder:"Select Option",viewItemSelectPlaceholder:"Select View",tagItemSelectPlaceholder:"Find Tag",spaceSelectPlaceholder:"Select any Folder or Tag",propertyItemSelectPlaceholder:"Select Property",sortItemSelectPlaceholder:"Select Sort",filterItemSelectPlaceholder:"Select Filter",imageSelectPlaceholder:"Select an image or paste a URL",imageNotFoundPlaceholder:"No Images Found",syncFrontmatterProperty:"Sync Frontmatter Property",newProperty:"New Property",newPropertyShort:"New Property",propertyType:"Type",propertyDynamic:"Dyanmic",propertyValueSpace:"Space",propertyValueProperty:"Property",propertyLookup:"Edit Formula",dateFormat:"Date Format",propertyFileProp:"Property",multiple:"Multiple",filesCount:"{$1} Files",hiddenFiles:"Hidden Files",addExtension:"Add Rule",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",renameTable:"Rename Table",syncMetadata:"Sync Metadata",syncProperties:"Sync Properties",selectContext:"Select Context",metadata:"Metadata",backlinks:"Backlinks",spaces:"Spaces",context:"Context",content:"Content",deleteSpace:"Delete Space",deleteFiles:"Delete Files",outgoingLinks:"Outgoing Links",moveTo:"Move to",addTo:"Pin to",copyTo:"Copy to",reorderIn:"Reorder in",border:"Border",corners:"Corners",color:"Color",backgroundColor:"Background",cornerRadius:"Radius",onClick:"On Click",layout:"Layout",element:"Element",name:"Name",display:"Display",alignment:"Alignment",margin:"Margin",padding:"Padding",gap:"Gap",width:"Width",height:"Height",opacity:"Opacity",shadow:"Shadow",shadowBlur:"Blur",shadowSpread:"Spread",typography:"Typography",layers:"Layers",fontSize:"Size",props:"Props",styles:"Styles",events:"Events",code:"Code",selectedLayers:"\${1} Layers"},descriptions:{spaceActions:"Create actions that runs when you press a button",spaceLists:"Create lists to track data and organize them in your space",spaceItems:"Add new items to the space or pin items to the space",smartSearch:"Automatically pin notes to this space based on a set of searches",hiddenFileOptions:"Exclude any files and folders by name, suffix or extension.",deleteSpace:"Deleting the space will also delete the folder and its contents.",deleteFiles:"Delete \${1} files/folders and their contents?",addContext:"Contexts lets you connect properties from your tags",spaceProperties:"Define Properties for your Space Items",syncMetadata:"Select which fields from your notes to start syncing with the context.",syncProperties:"Contexts defines and syncs the same fields across your notes depending on their folder or tag.",selectContext:"Select which folder or tag context you want to sync the fields."},flowView:{emptyDoc:"Empty Document",itemsCount:" Items",emptyFolder:"This Folder is Empty"},notice:{duplicateFile:"Folder already contains note with same name",addedToSection:"Added to Space",fileExists:"File Already Exists",folderExists:"Folder Already Exists",noPropertyName:"Property Name is Required",duplicatePropertyName:"Duplicate Property Name",newSpaceName:"Enter a name for your space",duplicateSpaceName:"Space name already exists",cantConvertNoteToSpace:"The view is not a note",templateSaved:"Template saved to space: "},settings:{layoutVertical:"Vertical",layoutHorizontal:"Horizontal",sectionSidebar:"Spaces",sectionEditor:"Maker Mode",sectionFlow:"Flow",sectionAdvanced:"Advanced",sectionDataview:"Dataview",sectionContext:"Context",sectionStickers:"Stickers",sectionNavigator:"Navigator",sectionDefault:"Default Spaces",sectionSpaceView:"Space View",sectionBlink:"Blink",sectionInlineContext:"Inline Context",sectionFlowBlock:"Flow Block",sectionFlowMenu:"Flow Menu",sectionFlowStyler:"Flow Styler",experimental:{name:"Experimental",desc:"Experimental features that are subject to change and may not be optimized for performance"},generateThumbnails:{name:"Generate Thumbnails",desc:"Create thumbnails for images to speed up performance"},minimalThemeFix:{name:"Minimal Theme Fix",description:"Apply fixes for the popular theme Minimal"},inlineStickerMenu:{name:"Inline Stickers",desc:"Add inline stickers by typing :"},openSpacesOnLaunch:{name:"Open Spaces as Default Tab",desc:"Open the Spaces tab when Obsidian launches"},defaultSpaceTemplate:{name:"Default Space Template",desc:"Select the default template for new spaces"},defaultDateFormat:{name:"Default Date Format",desc:"Set the default date format, example: yyyy-MM-dd (see https://date-fns.org/v2.30.0/docs/format)"},newNotePlaceholder:{name:"New Note Placeholder",desc:"Default name for new notes"},folderIndentationLines:{name:"Show Folder Indentation Lines",desc:"Turn on to show a line on the left of folders to indicate indentation"},folderNoteLocation:{name:"Folder Note Location Inside Folder",desc:"Turn on to have folder notes inside the folder, turn off to have it outside"},folderViewDefault:{name:"Show Folder Note by Default",desc:"Show the folder note by default when opening a folder"},internalLinkFlowEditor:{name:"Open Flow Blocks on Internal Link Click",desc:"Turn on to toggle Flow Blocks directly by clicking on internal links, otherwise a tooltip will be shown"},syncContextToFrontmatter:{name:"Sync Context Fields to Frontmatter",desc:"Turn on to automatically save all context fields to frontmatter fields, not just existing frontmatter fields."},inlineBacklinks:{name:"Show Inline Backlinks (Inline Context required)",desc:"Show editable backlinks at the bottom of your notes"},dataviewInlineContext:{name:"Show Dataview in Inline Context",desc:"Show dataview when inline context is enabled"},inlineContextExplorer:{name:"Inline Context",desc:"Display the context and a banner at the top of your notes"},inlineContextExpanded:{name:"Auto Expand Inline Context",desc:"Expand the inline context sections when opening a note"},inlineContextHorizontal:{name:"Inline Title and Sticker Layout",desc:"Layout for inline title and sticker in Inline Context"},hideFrontmatter:{name:"Hide Frontmatter Properties",desc:"Hide the frontmatter properties in inline context"},openFileContext:{name:"Auto Open Explorer",desc:"Automatically open explorer panel in the right panel"},folderNote:{name:"Enable Folder Note",desc:"Access the folder note in the folder page and hide the folder note from spaces"},expandFolder:{name:"Auto Expand Folder",desc:"Auto expand folders on click"},hoverPreview:{name:"Preview on Hover",desc:"Preview on Hover while holding Control/Command key"},activeFile:{name:"Reveal Active File",desc:"Automatically reveal the active file in Spaces"},contexts:{name:"Contexts",desc:"Contexts allows you to have full control over the metadata of your files"},spaces:{name:"Navigator",desc:"The navigator lets you create and organize your spaces"},spacesStickers:{name:"Stickers",desc:"Use Emojis to make it easier to find your notes"},spacesAlias:{name:"Alias",desc:"Use the alias metadata to show in Spaces"},spacesFileExplorerDual:{name:"Compatibility Mode",desc:"This will improve the compatibility of plugins while using Spaces"},spacesDeleteOption:{name:"Delete File Option",desc:"Select how you want files to be deleted"},spacesDeleteOptions:{permanant:"Delete Permanently",trash:"Move to Obsidian Trash","system-trash":"Move to System Trash"},hideRibbon:{name:"App Ribbon",desc:"Show/hide the left menu aka. ribbon"},spaceView:{name:"Space View",desc:"Open the space view when you click on a space"},defaultSpaces:{name:"Default Spaces",desc:"Recommended spaces for quickly organizing your vault"},homeSpace:{name:"Home Space",desc:"An easy-to-access space where you can add/organize your other spaces"},tagSpaces:{name:"Tag Spaces",desc:"Automatically create spaces for each of your tags"},readableLineWidth:{name:"Readable Line Width",desc:"Use Readable Line Width"},sidebarTabs:{name:"Sidebar Tabs",desc:"Show/hide other sidebar tabs"},spacesPerformance:{name:"Performance Mode",desc:"Turn on performance mode for Spaces, may affect scrolling appearance. Requires Restart"},indexSVG:{name:"Use SVGs as Stickers",desc:"Use any svg file in your vault as a sticker"},inlineStyler:{name:"Flow Styler",desc:"Select text to add styling"},inlineStylerColor:{name:"Text and Highlight Colors \\u{1F9EA}",desc:"Select text color and highlight color, (this may change in the future because of the limitations with HTML and Obsidian)"},spaceRowHeight:{name:"Row Height",desc:"The height for each row in spaces (in pixels), default is 28"},makeChar:{name:"Flow Menu Trigger",desc:"Character to open the Flow Menu"},mobileMakeBar:{name:"Flow Styler (Mobile)",desc:"Replaces the mobile toolbar"},editorMarkSans:{name:"Mark Sans \\u{1F9EA}",desc:"Use the editor without Markdown."},editorMakerMode:{name:"Flow (Beta)",desc:"An integrated and intuitive editor experience"},editorMakePlacholder:{name:"Flow Menu Hint Text",desc:"Show a hint text on how to open the Flow Menu Shortcut"},blink:{name:"Blink",desc:"A faster way to search and edit your notes"},editorMakeMenu:{name:"Flow Menu",desc:"Open the Flow menu to quickly add content"},editorMakeMenuTrigger:{name:"Flow Menu Shortcut",desc:"Trigger key to use flow menu"},editorFlowReplace:{name:"Flow Block",desc:"Open your internal links or toggle your embeds in the flow block."},editorFlowStyle:{name:"Flow Block Style",desc:"Select a theme for your flow block",seamless:"Seamless",classic:"Classic",minimal:"Minimal"}}}};this.lang="en";let r=Hx.default.locale();["en"].includes(r)&&(this.lang=r)}get texts(){return this.all.en}},Vr=new Bd().texts;var Gx=(e,r)=>r==fo?Vs.find(t=>t.type=="file"):r=="tags"?Vs.find(t=>t.type=="tags"):r=="aliases"?Vs.find(t=>t.type=="option-multi"):r=="sticker"?Vs.find(t=>e=="icon"):Vs.find(t=>e==t.type)||Vs.find(t=>e==t.multiType),Vs=[{type:"unknown",label:"",restricted:!0,icon:"ui//file-question"},{type:"text",label:Vr.properties.text.label,metadata:!0,icon:"ui//text",description:Vr.properties.text.description},{type:"number",label:Vr.properties.number.label,metadata:!0,icon:"ui//binary",configKeys:["unit"],description:Vr.properties.number.description},{type:"boolean",label:Vr.properties.boolean.label,metadata:!0,icon:"ui//check-square",description:Vr.properties.boolean.description},{type:"date",label:Vr.properties.date.label,metadata:!0,icon:"ui//calendar",configKeys:["format"],description:Vr.properties.date.description},{type:"option",label:Vr.properties.option.label,multi:!0,multiType:"option-multi",icon:"ui//list",configKeys:["options","source"],description:Vr.properties.option.description},{type:"tags",label:Vr.properties.tags.label,icon:"ui//tags",description:Vr.properties.tags.description},{type:"file",label:Vr.properties.file.label,restricted:!0,icon:"ui//mk-make-h3"},{type:"fileprop",label:Vr.properties.fileProperty.label,icon:"ui//formula",configKeys:["field","value"],description:Vr.properties.fileProperty.description},{type:"link",label:Vr.properties.link.label,multi:!0,multiType:"link-multi",metadata:!0,icon:"ui//file-text",description:Vr.properties.link.description},{type:"context",label:Vr.properties.context.label,icon:"ui//mk-make-note",multi:!0,multiType:"context-multi",configKeys:["space"],description:Vr.properties.context.description},{type:"object",label:Vr.properties.object.label,multi:!0,multiType:"object-multi",metadata:!0,icon:"ui//list-tree",configKeys:["type"],description:Vr.properties.object.description},{type:"icon",label:Vr.properties.icon.label,multi:!0,multiType:"icon-multi",icon:"ui//gem",restricted:!0,description:Vr.properties.icon.description},{type:"image",label:Vr.properties.image.label,multi:!0,multiType:"image-multi",metadata:!0,icon:"ui//mk-make-image",description:Vr.properties.image.description},{type:"color",label:Vr.properties.color.label,icon:"ui//mk-make-image",restricted:!0,description:Vr.properties.color.description},{type:"space",label:Vr.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Vr.properties.space.description},{type:"table",label:Vr.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Vr.properties.space.description},{type:"super",label:Vr.properties.super.label,icon:"ui//zap",restricted:!0,configKeys:["dynamic","field"]},{type:"input",label:Vr.properties.super.label,icon:"ui//input",restricted:!0}];var Ys="files",ic={id:Ys,name:"Files",type:"db",primary:"true"},sk="filesView",uk={id:sk,name:"All",type:"view",def:JSON.stringify({db:Ys,icon:"ui//file-stack"})},fk="main",lk=e=>({id:e,name:e,type:"frame",def:"",predicate:"",primary:"true"}),_$={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[lk(fk),uk]},tc={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[ic]},$x={uniques:["name,schemaId"],cols:["name","schemaId","type","value","attrs","hidden","unique","primary"]},nc={...$x,rows:[{name:fo,schemaId:Ys,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""},{name:Vr.properties.fileProperty.createdTime,schemaId:Ys,type:"fileprop",value:fo+".ctime",hidden:"",unique:"",attrs:"",primary:"true"}]};var T$=[{name:Vr.properties.defaultField,schemaId:"",type:"text",primary:"true"}],Id={...$x,rows:[{name:fo,schemaId:Ys,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""}]};var F$={schema:ic,cols:nc.rows,rows:[]},O$={schema:ic,cols:nc.rows,rows:[]},B$={schema:ic,cols:Id.rows,rows:[]},Zx=(e,r)=>e.filter(t=>r.find(n=>n.id==t.schemaId&&n.type=="db")).reduce((t,n)=>({...t,...t[n.schemaId]?{[n.schemaId]:{uniques:n.unique=="true"?[...t[n.schemaId].uniques,n.name]:t[n.schemaId].uniques,cols:[...t[n.schemaId].cols,n.name],rows:[]}}:{[n.schemaId]:{uniques:n.unique=="true"?[n.name]:[],cols:[n.name],rows:[]}}}),{});var I$={m_schema:tc,m_fields:nc,...Zx(nc.rows,tc.rows)},P$={m_schema:tc,m_fields:Id,...Zx(Id.rows,tc.rows)};var pk=(e,r)=>{let t=n=>n=="builtin"?"Builtin":n=="api"?"Spaces":"Action";return[...(e.actionsIndex.get(r)??[]).map(n=>({name:n.schema.name,description:"Action",value:\`\${r}/#;\${n.schema.id}\`,section:"Action"}))??[],...[...e.cli.allCommands()].map(n=>({name:n.schema.name,description:t(n.schema.type),value:n.path,section:t(n.schema.type)}))]};var Qx=({field:e,value:r})=>r=="ctime"?{value:\`parseDate(prop('\${e}')['metadata']['file']['\${r}'])\`}:{value:\`prop('\${e}')['metadata']['file']['\${r}']\`},Pd=(e,r,t,n)=>{let i=Kl(e);if(i)return r=="fileprop"&&i.field?Qx(i):(r=="option"&&i.source?.length>0&&(i.source=="$commands"?i.options=t.cli.allCommands():i.source=="$links"?i.options=t.spaceManager.allPaths().map(a=>({name:a,value:a})):i.source=="$super"&&(i.options=pk(t,n))),[...Gx(r).configKeys??[],"alias","default"].reduce((a,s)=>({...a,[s]:i[s]}),{}));if(!r)return{};if(!i)if(r=="context")e?.length>0?i={space:e}:i={};else if(r.startsWith("date"))e?.length>0?i={format:e}:i={};else if(r.startsWith("fileprop"))if(e?.length>0){let[a,s]=e.split(".");i=Qx({field:a,value:s})}else i={};else r.startsWith("option")&&(e?.length>0?i={options:Ui(e).map(s=>({name:s,value:s}))}:i={});return i??{}};function Mt(){return Mt=Object.assign?Object.assign.bind():function(e){for(var r=1;re[r])}var ey=["Matrix","Array"],ry=["number","BigNumber","Fraction"];function ny(e,r){function t(n){if(n){var i=$s(e,tr);ty(n,"matrix",ey),ty(n,"number",ry),kd(e,n);var a=$s(e,tr),s=$s(n,tr);return r("config",a,i,s),a}else return $s(e,tr)}return t.MATRIX_OPTIONS=ey,t.NUMBER_OPTIONS=ry,Object.keys(ac).forEach(n=>{Object.defineProperty(t,n,{get:()=>e[n],enumerable:!0,configurable:!0})}),t}function mk(e,r){return e.indexOf(r)!==-1}function ty(e,r,t){e[r]!==void 0&&!mk(t,e[r])&&console.warn('Warning: Unknown value "'+e[r]+'" for configuration option "'+r+'". Available options: '+t.map(n=>JSON.stringify(n)).join(", ")+".")}var Tg={};u8(Tg,{createAbs:()=>ib,createAccessorNode:()=>E2,createAcos:()=>tN,createAcosh:()=>iN,createAcot:()=>oN,createAcoth:()=>uN,createAcsc:()=>lN,createAcsch:()=>pN,createAdd:()=>d2,createAddScalar:()=>sb,createAnd:()=>ap,createAndTransform:()=>WO,createApply:()=>ou,createApplyTransform:()=>dO,createArg:()=>uw,createArrayNode:()=>C2,createAsec:()=>hN,createAsech:()=>vN,createAsin:()=>xN,createAsinh:()=>yN,createAssignmentNode:()=>T2,createAtan:()=>bN,createAtan2:()=>DN,createAtanh:()=>NN,createAtomicMass:()=>Z3,createAvogadro:()=>Q3,createBellNumbers:()=>MF,createBigNumberClass:()=>Jy,createBignumber:()=>U1,createBin:()=>CD,createBitAnd:()=>Gc,createBitAndTransform:()=>YO,createBitNot:()=>nw,createBitOr:()=>$c,createBitOrTransform:()=>HO,createBitXor:()=>ow,createBlockNode:()=>F2,createBohrMagneton:()=>M3,createBohrRadius:()=>I3,createBoltzmann:()=>X3,createBoolean:()=>q1,createCatalan:()=>TF,createCbrt:()=>cb,createCeil:()=>pb,createChain:()=>tT,createChainClass:()=>EA,createClassicalElectronRadius:()=>P3,createClone:()=>f1,createColumn:()=>Xc,createColumnTransform:()=>vO,createCombinations:()=>qT,createCombinationsWithRep:()=>WT,createCompare:()=>vS,createCompareNatural:()=>bS,createCompareText:()=>DS,createCompile:()=>J2,createComplex:()=>z1,createComplexClass:()=>e1,createComposition:()=>OF,createConcat:()=>Qc,createConcatTransform:()=>_O,createConditionalNode:()=>O2,createConductanceQuantum:()=>_3,createConj:()=>lw,createConstantNode:()=>L2,createCorr:()=>kT,createCos:()=>EN,createCosh:()=>MN,createCot:()=>TN,createCoth:()=>ON,createCoulomb:()=>E3,createCount:()=>Sw,createCreateUnit:()=>eN,createCross:()=>Aw,createCsc:()=>IN,createCsch:()=>kN,createCtranspose:()=>uD,createCube:()=>hb,createCumSum:()=>Up,createCumSumTransform:()=>RO,createDeepEqual:()=>FS,createDenseMatrixClass:()=>s1,createDerivative:()=>YF,createDet:()=>iT,createDeuteronMass:()=>z3,createDiag:()=>Cw,createDiff:()=>Jc,createDiffTransform:()=>FO,createDistance:()=>NT,createDivide:()=>DT,createDivideScalar:()=>UD,createDot:()=>w2,createDotDivide:()=>eS,createDotMultiply:()=>Qb,createDotPow:()=>KD,createE:()=>s3,createEfimovFactor:()=>$3,createEigs:()=>cT,createElectricConstant:()=>N3,createElectronMass:()=>k3,createElementaryCharge:()=>C3,createEqual:()=>SS,createEqualScalar:()=>B1,createEqualText:()=>AS,createErf:()=>gD,createEvaluate:()=>j2,createExp:()=>vb,createExpm:()=>mT,createExpm1:()=>xb,createFactorial:()=>ZT,createFalse:()=>r3,createFaraday:()=>J3,createFermiCoupling:()=>R3,createFft:()=>pD,createFibonacciHeapClass:()=>WS,createFilter:()=>_w,createFilterTransform:()=>xO,createFineStructure:()=>L3,createFirstRadiation:()=>K3,createFix:()=>yb,createFlatten:()=>Fw,createFloor:()=>Wc,createForEach:()=>Bw,createForEachTransform:()=>yO,createFormat:()=>AD,createFraction:()=>W1,createFractionClass:()=>n1,createFreqz:()=>XF,createFunctionAssignmentNode:()=>q2,createFunctionNode:()=>$2,createGamma:()=>YT,createGasConstant:()=>eO,createGcd:()=>Ab,createGetMatrixDataType:()=>Pw,createGravitationConstant:()=>b3,createGravity:()=>fO,createHartreeEnergy:()=>q3,createHasNumericValue:()=>S1,createHelp:()=>eT,createHelpClass:()=>AA,createHex:()=>FD,createHypot:()=>g2,createI:()=>d3,createIdentity:()=>Rw,createIfft:()=>hD,createIm:()=>pw,createImmutableDenseMatrixClass:()=>qS,createIndex:()=>N2,createIndexClass:()=>zS,createIndexNode:()=>U2,createIndexTransform:()=>bO,createInfinity:()=>n3,createIntersect:()=>AT,createInv:()=>oT,createInverseConductanceQuantum:()=>T3,createInvmod:()=>$b,createIsInteger:()=>c1,createIsNaN:()=>_1,createIsNegative:()=>y1,createIsNumeric:()=>w1,createIsPositive:()=>A1,createIsPrime:()=>RD,createIsZero:()=>C1,createKldivergence:()=>XT,createKlitzing:()=>B3,createKron:()=>qw,createLN10:()=>l3,createLN2:()=>f3,createLOG10E:()=>p3,createLOG2E:()=>c3,createLarger:()=>MS,createLargerEq:()=>_S,createLcm:()=>Cb,createLeafCount:()=>IF,createLeftShift:()=>lS,createLgamma:()=>GT,createLog:()=>GD,createLog10:()=>_b,createLog1p:()=>ZD,createLog2:()=>Fb,createLoschmidt:()=>j3,createLsolve:()=>tS,createLsolveAll:()=>oS,createLup:()=>iA,createLusolve:()=>DA,createLyap:()=>wT,createMad:()=>FT,createMagneticConstant:()=>S3,createMagneticFluxQuantum:()=>F3,createMap:()=>zw,createMapTransform:()=>DO,createMatrix:()=>Y1,createMatrixClass:()=>a1,createMatrixFromColumns:()=>X1,createMatrixFromFunction:()=>G1,createMatrixFromRows:()=>Z1,createMax:()=>mp,createMaxTransform:()=>SO,createMean:()=>zp,createMeanTransform:()=>NO,createMedian:()=>_T,createMin:()=>hp,createMinTransform:()=>AO,createMod:()=>Vc,createMode:()=>wD,createMolarMass:()=>sO,createMolarMassC12:()=>uO,createMolarPlanckConstant:()=>rO,createMolarVolume:()=>tO,createMultinomial:()=>KT,createMultiply:()=>Ib,createMultiplyScalar:()=>Ob,createNaN:()=>i3,createNeutronMass:()=>W3,createNode:()=>A2,createNorm:()=>y2,createNot:()=>vw,createNthRoot:()=>kb,createNthRoots:()=>XD,createNuclearMagneton:()=>O3,createNull:()=>t3,createNumber:()=>P1,createNumeric:()=>LD,createObjectNode:()=>z2,createOct:()=>_D,createOnes:()=>Vw,createOperatorNode:()=>W2,createOr:()=>Zc,createOrTransform:()=>VO,createParenthesisNode:()=>V2,createParse:()=>Q2,createParser:()=>tA,createParserClass:()=>eA,createPartitionSelect:()=>IS,createPermutations:()=>rF,createPhi:()=>u3,createPi:()=>a3,createPickRandom:()=>bF,createPinv:()=>uT,createPlanckCharge:()=>mO,createPlanckConstant:()=>w3,createPlanckLength:()=>lO,createPlanckMass:()=>cO,createPlanckTemperature:()=>hO,createPlanckTime:()=>pO,createPolynomialRoot:()=>NA,createPow:()=>WD,createPrint:()=>ip,createPrintTransform:()=>zO,createProd:()=>SD,createProtonMass:()=>U3,createQr:()=>oA,createQuantileSeq:()=>Vp,createQuantileSeqTransform:()=>PO,createQuantumOfCirculation:()=>V3,createRandom:()=>DF,createRandomInt:()=>NF,createRange:()=>ep,createRangeClass:()=>i1,createRangeNode:()=>Y2,createRangeTransform:()=>EO,createRationalize:()=>GF,createRe:()=>hw,createReducedPlanckConstant:()=>D3,createRelationalNode:()=>H2,createReplacer:()=>KF,createReshape:()=>Gw,createResize:()=>$w,createResolve:()=>UF,createResultSet:()=>ky,createReviver:()=>JF,createRightArithShift:()=>pS,createRightLogShift:()=>hS,createRotate:()=>Qw,createRotationMatrix:()=>Jw,createRound:()=>YD,createRow:()=>rp,createRowTransform:()=>CO,createRydberg:()=>Y3,createSQRT1_2:()=>m3,createSQRT2:()=>h3,createSackurTetrode:()=>nO,createSchur:()=>yT,createSec:()=>LN,createSech:()=>UN,createSecondRadiation:()=>iO,createSetCartesian:()=>QN,createSetDifference:()=>JN,createSetDistinct:()=>jN,createSetIntersect:()=>r2,createSetIsSubset:()=>n2,createSetMultiplicity:()=>a2,createSetPowerset:()=>s2,createSetSize:()=>f2,createSetSymDifference:()=>c2,createSetUnion:()=>m2,createSign:()=>Lb,createSimplify:()=>kF,createSimplifyConstant:()=>RF,createSimplifyCore:()=>qF,createSin:()=>WN,createSinh:()=>YN,createSize:()=>eD,createSlu:()=>bA,createSmaller:()=>ES,createSmallerEq:()=>CS,createSolveODE:()=>vD,createSort:()=>kS,createSpaClass:()=>VS,createSparse:()=>KS,createSparseMatrixClass:()=>I1,createSpeedOfLight:()=>y3,createSplitUnit:()=>K1,createSqrt:()=>qb,createSqrtm:()=>dT,createSquare:()=>zb,createSqueeze:()=>tD,createStd:()=>Yp,createStdTransform:()=>OO,createStefanBoltzmann:()=>aO,createStirlingS2:()=>EF,createString:()=>R1,createSubset:()=>tp,createSubsetTransform:()=>MO,createSubtract:()=>Vb,createSubtractScalar:()=>fb,createSum:()=>Lp,createSumTransform:()=>IO,createSylvester:()=>gT,createSymbolNode:()=>G2,createSymbolicEqual:()=>WF,createTan:()=>GN,createTanh:()=>$N,createTau:()=>o3,createThomsonCrossSection:()=>H3,createTo:()=>PD,createTrace:()=>D2,createTranspose:()=>oD,createTrue:()=>e3,createTypeOf:()=>F1,createTyped:()=>Py,createUnaryMinus:()=>eb,createUnaryPlus:()=>tb,createUnequal:()=>OS,createUnitClass:()=>ZS,createUnitFunction:()=>XS,createUppercaseE:()=>g3,createUppercasePi:()=>v3,createUsolve:()=>iS,createUsolveAll:()=>uS,createVacuumImpedance:()=>A3,createVariance:()=>Wp,createVarianceTransform:()=>qO,createVersion:()=>x3,createWeakMixingAngle:()=>G3,createWienDisplacement:()=>oO,createXgcd:()=>Hb,createXor:()=>yw,createZeros:()=>lD,createZeta:()=>yD,createZpk2tf:()=>ZF});var ev=Xn(yc(),1);function He(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}var hi=Math.sign||function(e){return e>0?1:e<0?-1:0},oy=Math.log2||function(r){return Math.log(r)/Math.LN2},sy=Math.log10||function(r){return Math.log(r)/Math.LN10},bc=Math.log1p||function(e){return Math.log(e+1)},uy=Math.cbrt||function(r){if(r===0)return r;var t=r<0,n;return t&&(r=-r),isFinite(r)?(n=Math.exp(Math.log(r)/3),n=(r/(n*n)+2*n)/3):n=r,t?-n:n},fy=Math.expm1||function(r){return r>=2e-4||r<=-2e-4?Math.exp(r)-1:r+r*r/2+r*r*r/6};function Ud(e,r,t){var n={2:"0b",8:"0o",16:"0x"},i=n[r],a="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!He(t))throw new Error("size must be an integer");if(e>2**(t-1)-1||e<-(2**(t-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!He(e))throw new Error("Value must be an integer");e<0&&(e=e+2**t),a="i".concat(t)}var s="";return e<0&&(e=-e,s="-"),"".concat(s).concat(i).concat(e.toString(r)).concat(a)}function Wi(e,r){if(typeof r=="function")return r(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:t,precision:n,wordSize:i}=zd(r);switch(t){case"fixed":return Wd(e,n);case"exponential":return ly(e,n);case"engineering":return hk(e,n);case"bin":return Ud(e,2,i);case"oct":return Ud(e,8,i);case"hex":return Ud(e,16,i);case"auto":return dk(e,n,r).replace(/((\\.\\d*?)(0+))($|e)/,function(){var a=arguments[2],s=arguments[4];return a!=="."?a+s:s});default:throw new Error('Unknown notation "'+t+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function zd(e){var r="auto",t,n;if(e!==void 0)if(ar(e))t=e;else if(je(e))t=e.toNumber();else if(fa(e))e.precision!==void 0&&(t=iy(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=iy(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(r=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:r,precision:t,wordSize:n}}function Xs(e){var r=String(e).toLowerCase().match(/^(-?)(\\d+\\.?\\d*)(e([+-]?\\d+))?$/);if(!r)throw new SyntaxError("Invalid number "+e);var t=r[1],n=r[2],i=parseFloat(r[4]||"0"),a=n.indexOf(".");i+=a!==-1?a-1:n.length-1;var s=n.replace(".","").replace(/^0*/,function(l){return i-=l.length,""}).replace(/0*$/,"").split("").map(function(l){return parseInt(l)});return s.length===0&&(s.push(0),i++),{sign:t,coefficients:s,exponent:i}}function hk(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=Xs(e),n=wc(t,r),i=n.exponent,a=n.coefficients,s=i%3===0?i:i<0?i-3-i%3:i-i%3;if(ar(r))for(;r>a.length||i-s+1>a.length;)a.push(0);else for(var l=Math.abs(i-s)-(a.length-1),f=0;f0;)u++,o--;var p=a.slice(u).join(""),h=ar(r)&&p.length||p.match(/[1-9]/)?"."+p:"",d=a.slice(0,u).join("")+h+"e"+(i>=0?"+":"")+s.toString();return n.sign+d}function Wd(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=Xs(e),n=typeof r=="number"?wc(t,t.exponent+1+r):t,i=n.coefficients,a=n.exponent+1,s=a+(r||0);return i.length0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function dk(e,r,t){if(isNaN(e)||!isFinite(e))return String(e);var n=ay(t?.lowerExp,-3),i=ay(t?.upperExp,5),a=Xs(e),s=r?wc(a,r):a;if(s.exponent=i)return ly(e,r);var l=s.coefficients,f=s.exponent;l.length0?f:0;return or){var i=n.splice(r,n.length-r);if(i[0]>=5){var a=r-1;for(n[a]++;n[a]===10;)n.pop(),a===0&&(n.unshift(0),t.exponent++,a++),a--,n[a]++}}return t}function Qs(e){for(var r=[],t=0;t0?!0:e<0?!1:1/e===1/0,n=r>0?!0:r<0?!1:1/r===1/0;return t^n?-e:e}function iy(e,r){if(ar(e))return e;if(je(e))return e.toNumber();r()}function ay(e,r){return ar(e)?e:je(e)?e.toNumber():r}function Vd(e,r,t){var n=e.constructor,i=new n(2),a="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!He(t))throw new Error("size must be an integer");if(e.greaterThan(i.pow(t-1).sub(1))||e.lessThan(i.pow(t-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(t))),a="i".concat(t)}switch(r){case 2:return"".concat(e.toBinary()).concat(a);case 8:return"".concat(e.toOctal()).concat(a);case 16:return"".concat(e.toHexadecimal()).concat(a);default:throw new Error("Base ".concat(r," not supported "))}}function yy(e,r){if(typeof r=="function")return r(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:t,precision:n,wordSize:i}=zd(r);switch(t){case"fixed":return xk(e,n);case"exponential":return gy(e,n);case"engineering":return gk(e,n);case"bin":return Vd(e,2,i);case"oct":return Vd(e,8,i);case"hex":return Vd(e,16,i);case"auto":{var a=xy(r?.lowerExp,-3),s=xy(r?.upperExp,5);if(e.isZero())return"0";var l,f=e.toSignificantDigits(n),o=f.e;return o>=a&&o=0?"+":"")+n.toString()}function gy(e,r){return r!==void 0?e.toExponential(r-1):e.toExponential()}function xk(e,r){return e.toFixed(r)}function xy(e,r){return ar(e)?e:je(e)?e.toNumber():r}function wy(e,r){var t=e.length-r.length,n=e.length;return e.substring(t,n)===r}function lr(e,r){var t=yk(e,r);return r&&typeof r=="object"&&"truncate"in r&&t.length>r.truncate?t.substring(0,r.truncate-3)+"...":t}function yk(e,r){if(typeof e=="number")return Wi(e,r);if(je(e))return yy(e,r);if(bk(e))return!r||r.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return Dy(e,r);if(yt(e))return Ko(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(r);if(e&&e.toString(r)!=={}.toString())return e.toString(r);var t=Object.keys(e).map(n=>Ko(n)+": "+lr(e[n],r));return"{"+t.join(", ")+"}"}return String(e)}function Ko(e){for(var r=String(e),t="",n=0;n/g,">"),r}function Dy(e,r){if(Array.isArray(e)){for(var t="[",n=e.length,i=0;ir?1:-1}function pr(e,r,t){if(!(this instanceof pr))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=r,this.relation=t,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(r)?"["+r.join(", ")+"]":r)+")",this.stack=new Error().stack}pr.prototype=new RangeError;pr.prototype.constructor=RangeError;pr.prototype.name="DimensionError";pr.prototype.isDimensionError=!0;function Xt(e,r,t){if(!(this instanceof Xt))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=r):(this.min=r,this.max=t),this.min!==void 0&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}Xt.prototype=new RangeError;Xt.prototype.constructor=RangeError;Xt.prototype.name="IndexError";Xt.prototype.isIndexError=!0;function or(e){for(var r=[];Array.isArray(e);)r.push(e.length),e=e[0];return r}function Sy(e,r,t){var n,i=e.length;if(i!==r[t])throw new pr(i,r[t]);if(t")}function Hd(e,r){var t=r.length===0;if(t){if(Array.isArray(e))throw new pr(e.length,0)}else Sy(e,r,0)}function gf(e,r){var t=e.isMatrix?e._size:or(e),n=r._sourceSize;n.forEach((i,a)=>{if(i!==null&&i!==t[a])throw new pr(i,t[a])})}function Xr(e,r){if(e!==void 0){if(!ar(e)||!He(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof r=="number"&&e>=r)throw new Xt(e,r)}}function jo(e){for(var r=0;r=0,f=r%t===0;if(l)if(f)n[a]=-r/t;else throw new Error("Could not replace wildcard, since "+r+" is no multiple of "+-t);return n}function Ny(e){return e.reduce((r,t)=>r*t,1)}function wk(e,r){for(var t=e,n,i=r.length-1;i>0;i--){var a=r[i];n=[];for(var s=t.length/a,l=0;lr.test(t))}function Gd(e,r){return Array.prototype.join.call(e,r)}function Pa(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;var r=[],t=0;r[0]={value:e[0],identifier:0};for(var n=1;n1)return e.slice(1).reduce(function(t,n){return Cy(t,n,r,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function Dk(){for(var e=arguments.length,r=new Array(e),t=0;th.length),i=Math.max(...n),a=new Array(i).fill(null),s=0;sa[u]&&(a[u]=l[o])}for(var p=0;p1||e[i]>r[a])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(r[a]))}}function Qd(e,r){var t=or(e);if(zi(t,r))return e;bf(t,r);var n=Dk(t,r),i=n.length,a=[...Array(i-t.length).fill(1),...t],s=Nk(e);t.length!Ek(a)).every(a=>t[a]!==void 0);if(!n){var i=r.filter(a=>t[a]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(a=>'"'.concat(a,'"')).join(", "),"."))}}function Ek(e){return e&&e[0]==="?"}function Xd(e){return e&&e[0]==="?"?e.slice(1):e}function gt(e,r){if(Fy(e)&&_y(e,r))return e[r];throw typeof e[r]=="function"&&Cc(e,r)?new Error('Cannot access method "'+r+'" as a property'):new Error('No access to property "'+r+'"')}function ca(e,r,t){if(Fy(e)&&_y(e,r))return e[r]=t,t;throw new Error('No access to property "'+r+'"')}function My(e,r){return r in e}function _y(e,r){return!e||typeof e!="object"?!1:$e(Ck,r)?!0:!(r in Object.prototype||r in Function.prototype)}function Ty(e,r){if(!Cc(e,r))throw new Error('No access to method "'+r+'"');return e[r]}function Cc(e,r){return e==null||typeof e[r]!="function"||$e(e,r)&&Object.getPrototypeOf&&r in Object.getPrototypeOf(e)?!1:$e(Mk,r)?!0:!(r in Object.prototype||r in Function.prototype)}function Fy(e){return typeof e=="object"&&e&&e.constructor===Object}var Ck={length:!0,name:!0},Mk={toString:!0,valueOf:!0,toLocaleString:!0};var rs=class{constructor(r){this.wrappedObject=r,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(r){return gt(this.wrappedObject,r)}set(r,t){return ca(this.wrappedObject,r,t),this}has(r){return My(this.wrappedObject,r)}entries(){return Oy(this.keys(),r=>[r,this.get(r)])}forEach(r){for(var t of this.keys())r(this.get(t),t,this)}delete(r){delete this.wrappedObject[r]}clear(){for(var r of this.keys())this.delete(r)}get size(){return Object.keys(this.wrappedObject).length}},eu=class{constructor(r,t,n){this.a=r,this.b=t,this.bKeys=n,this[Symbol.iterator]=this.entries}get(r){return this.bKeys.has(r)?this.b.get(r):this.a.get(r)}set(r,t){return this.bKeys.has(r)?this.b.set(r,t):this.a.set(r,t),this}has(r){return this.b.has(r)||this.a.has(r)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return Oy(this.keys(),r=>[r,this.get(r)])}forEach(r){for(var t of this.keys())r(this.get(t),t,this)}delete(r){return this.bKeys.has(r)?this.b.delete(r):this.a.delete(r)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}};function Oy(e,r){return{next:()=>{var t=e.next();return t.done?t:{value:r(t.value),done:!1}}}}function go(){return new Map}function ka(e){if(!e)return go();if(Jd(e))return e;if(fa(e))return new rs(e);throw new Error("createMap can create maps from objects or Maps")}function By(e){if(e instanceof rs)return e.wrappedObject;var r={};for(var t of e.keys()){var n=e.get(t);ca(r,t,n)}return r}function Jd(e){return e?e instanceof Map||e instanceof rs||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var Iy=function(){return Iy=ev.default.create,ev.default},_k=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],Py=T("typed",_k,function(r){var{BigNumber:t,Complex:n,DenseMatrix:i,Fraction:a}=r,s=Iy();return s.clear(),s.addTypes([{name:"number",test:ar},{name:"Complex",test:Gt},{name:"BigNumber",test:je},{name:"Fraction",test:Jn},{name:"Unit",test:qt},{name:"identifier",test:l=>yt&&/^(?:[A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF40\\uDF42-\\uDF49\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDD70-\\uDD7A\\uDD7C-\\uDD8A\\uDD8C-\\uDD92\\uDD94\\uDD95\\uDD97-\\uDDA1\\uDDA3-\\uDDB1\\uDDB3-\\uDDB9\\uDDBB\\uDDBC\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67\\uDF80-\\uDF85\\uDF87-\\uDFB0\\uDFB2-\\uDFBA]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD23\\uDE80-\\uDEA9\\uDEB0\\uDEB1\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF45\\uDF70-\\uDF81\\uDFB0-\\uDFC4\\uDFE0-\\uDFF6]|\\uD804[\\uDC03-\\uDC37\\uDC71\\uDC72\\uDC75\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD44\\uDD47\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE3F\\uDE40\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC5F-\\uDC61\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-\\uDD52\\uDD55\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD837[\\uDF00-\\uDF1E\\uDF25-\\uDF2A]|\\uD838[\\uDC30-\\uDC6D\\uDD00-\\uDD2C\\uDD37-\\uDD3D\\uDD4E\\uDE90-\\uDEAD\\uDEC0-\\uDEEB]|\\uD839[\\uDCD0-\\uDCEB\\uDFE0-\\uDFE6\\uDFE8-\\uDFEB\\uDFED\\uDFEE\\uDFF0-\\uDFFE]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43\\uDD4B]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])(?:[0-9A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF40\\uDF42-\\uDF49\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDD70-\\uDD7A\\uDD7C-\\uDD8A\\uDD8C-\\uDD92\\uDD94\\uDD95\\uDD97-\\uDDA1\\uDDA3-\\uDDB1\\uDDB3-\\uDDB9\\uDDBB\\uDDBC\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67\\uDF80-\\uDF85\\uDF87-\\uDFB0\\uDFB2-\\uDFBA]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD23\\uDE80-\\uDEA9\\uDEB0\\uDEB1\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF45\\uDF70-\\uDF81\\uDFB0-\\uDFC4\\uDFE0-\\uDFF6]|\\uD804[\\uDC03-\\uDC37\\uDC71\\uDC72\\uDC75\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD44\\uDD47\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE3F\\uDE40\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC5F-\\uDC61\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-\\uDD52\\uDD55\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD837[\\uDF00-\\uDF1E\\uDF25-\\uDF2A]|\\uD838[\\uDC30-\\uDC6D\\uDD00-\\uDD2C\\uDD37-\\uDD3D\\uDD4E\\uDE90-\\uDEAD\\uDEC0-\\uDEEB]|\\uD839[\\uDCD0-\\uDCEB\\uDFE0-\\uDFE6\\uDFE8-\\uDFEB\\uDFED\\uDFEE\\uDFF0-\\uDFFE]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43\\uDD4B]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])*$/.test(l)},{name:"string",test:yt},{name:"Chain",test:Gs},{name:"Array",test:Ar},{name:"Matrix",test:Ge},{name:"DenseMatrix",test:Ia},{name:"SparseMatrix",test:Kn},{name:"Range",test:mo},{name:"Index",test:ua},{name:"boolean",test:oc},{name:"ResultSet",test:sc},{name:"Help",test:Hs},{name:"function",test:uc},{name:"Date",test:fc},{name:"RegExp",test:lc},{name:"null",test:cc},{name:"undefined",test:pc},{name:"AccessorNode",test:Sn},{name:"ArrayNode",test:$t},{name:"AssignmentNode",test:mc},{name:"BlockNode",test:hc},{name:"ConditionalNode",test:dc},{name:"ConstantNode",test:yr},{name:"FunctionNode",test:fn},{name:"FunctionAssignmentNode",test:mi},{name:"IndexNode",test:kn},{name:"Node",test:Sr},{name:"ObjectNode",test:la},{name:"OperatorNode",test:ut},{name:"ParenthesisNode",test:Zt},{name:"RangeNode",test:vc},{name:"RelationalNode",test:gc},{name:"SymbolNode",test:rt},{name:"Map",test:Jd},{name:"Object",test:fa}]),s.addConversions([{from:"number",to:"BigNumber",convert:function(f){if(t||Kd(f),cy(f)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+f+"). Use function bignumber(x) to convert to BigNumber.");return new t(f)}},{from:"number",to:"Complex",convert:function(f){return n||Mc(f),new n(f,0)}},{from:"BigNumber",to:"Complex",convert:function(f){return n||Mc(f),new n(f.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(f){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(f){return n||Mc(f),new n(f.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(f){a||jd(f);var o=new a(f);if(o.valueOf()!==f)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+f+"). Use function fraction(x) to convert to Fraction.");return o}},{from:"string",to:"number",convert:function(f){var o=Number(f);if(isNaN(o))throw new Error('Cannot convert "'+f+'" to a number');return o}},{from:"string",to:"BigNumber",convert:function(f){t||Kd(f);try{return new t(f)}catch{throw new Error('Cannot convert "'+f+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(f){a||jd(f);try{return new a(f)}catch{throw new Error('Cannot convert "'+f+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(f){n||Mc(f);try{return new n(f)}catch{throw new Error('Cannot convert "'+f+'" to Complex')}}},{from:"boolean",to:"number",convert:function(f){return+f}},{from:"boolean",to:"BigNumber",convert:function(f){return t||Kd(f),new t(+f)}},{from:"boolean",to:"Fraction",convert:function(f){return a||jd(f),new a(+f)}},{from:"boolean",to:"string",convert:function(f){return String(f)}},{from:"Array",to:"Matrix",convert:function(f){return i||Tk(),new i(f)}},{from:"Matrix",to:"Array",convert:function(f){return f.valueOf()}}]),s.onMismatch=(l,f,o)=>{var u=s.createError(l,f,o);if(["wrongType","mismatch"].includes(u.data.category)&&f.length===1&&bt(f[0])&&o.some(h=>!h.params.includes(","))){var p=new TypeError("Function '".concat(l,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(l,")'."));throw p.data=u.data,p}throw u},s.onMismatch=(l,f,o)=>{var u=s.createError(l,f,o);if(["wrongType","mismatch"].includes(u.data.category)&&f.length===1&&bt(f[0])&&o.some(h=>!h.params.includes(","))){var p=new TypeError("Function '".concat(l,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(l,")'."));throw p.data=u.data,p}throw u},s});function Kd(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Mc(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function Tk(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function jd(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var Fk="ResultSet",Ok=[],ky=T(Fk,Ok,()=>{function e(r){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=r||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(r){return new e(r.entries)},e},{isClass:!0});var ru=9e15,wo=1e9,rv="0123456789abcdef",Tc="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Fc="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",tv={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ru,maxE:ru,crypto:!1},Uy,Ra,Er=!0,Bc="[DecimalError] ",bo=Bc+"Invalid argument: ",zy=Bc+"Precision limit exceeded",Wy=Bc+"crypto unavailable",Vy="[object Decimal]",mn=Math.floor,Jt=Math.pow,Bk=/^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,Ik=/^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,Pk=/^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,Yy=/^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,Hi=1e7,br=7,kk=9007199254740991,Rk=Tc.length-1,nv=Fc.length-1,Ue={toStringTag:Vy};Ue.absoluteValue=Ue.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),dr(e)};Ue.ceil=function(){return dr(new this.constructor(this),this.e+1,2)};Ue.clampedTo=Ue.clamp=function(e,r){var t,n=this,i=n.constructor;if(e=new i(e),r=new i(r),!e.s||!r.s)return new i(NaN);if(e.gt(r))throw Error(bo+r);return t=n.cmp(e),t<0?e:n.cmp(r)>0?r:new i(n)};Ue.comparedTo=Ue.cmp=function(e){var r,t,n,i,a=this,s=a.d,l=(e=new a.constructor(e)).d,f=a.s,o=e.s;if(!s||!l)return!f||!o?NaN:f!==o?f:s===l?0:!s^f<0?1:-1;if(!s[0]||!l[0])return s[0]?f:l[0]?-o:0;if(f!==o)return f;if(a.e!==e.e)return a.e>e.e^f<0?1:-1;for(n=s.length,i=l.length,r=0,t=nl[r]^f<0?1:-1;return n===i?0:n>i^f<0?1:-1};Ue.cosine=Ue.cos=function(){var e,r,t=this,n=t.constructor;return t.d?t.d[0]?(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+br,n.rounding=1,t=Lk(n,Qy(n,t)),n.precision=e,n.rounding=r,dr(Ra==2||Ra==3?t.neg():t,e,r,!0)):new n(1):new n(NaN)};Ue.cubeRoot=Ue.cbrt=function(){var e,r,t,n,i,a,s,l,f,o,u=this,p=u.constructor;if(!u.isFinite()||u.isZero())return new p(u);for(Er=!1,a=u.s*Jt(u.s*u,1/3),!a||Math.abs(a)==1/0?(t=ln(u.d),e=u.e,(a=(e-t.length+1)%3)&&(t+=a==1||a==-2?"0":"00"),a=Jt(t,1/3),e=mn((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new p(t),n.s=u.s):n=new p(a.toString()),s=(e=p.precision)+3;;)if(l=n,f=l.times(l).times(l),o=f.plus(u),n=xt(o.plus(u).times(l),o.plus(f),s+2,1),ln(l.d).slice(0,s)===(t=ln(n.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!i&&t=="4999"){if(!i&&(dr(l,e+1,0),l.times(l).times(l).eq(u))){n=l;break}s+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(dr(n,e+1,1),r=!n.times(n).times(n).eq(u));break}return Er=!0,dr(n,e,p.rounding,r)};Ue.decimalPlaces=Ue.dp=function(){var e,r=this.d,t=NaN;if(r){if(e=r.length-1,t=(e-mn(this.e/br))*br,e=r[e],e)for(;e%10==0;e/=10)t--;t<0&&(t=0)}return t};Ue.dividedBy=Ue.div=function(e){return xt(this,new this.constructor(e))};Ue.dividedToIntegerBy=Ue.divToInt=function(e){var r=this,t=r.constructor;return dr(xt(r,new t(e),0,1,1),t.precision,t.rounding)};Ue.equals=Ue.eq=function(e){return this.cmp(e)===0};Ue.floor=function(){return dr(new this.constructor(this),this.e+1,3)};Ue.greaterThan=Ue.gt=function(e){return this.cmp(e)>0};Ue.greaterThanOrEqualTo=Ue.gte=function(e){var r=this.cmp(e);return r==1||r===0};Ue.hyperbolicCosine=Ue.cosh=function(){var e,r,t,n,i,a=this,s=a.constructor,l=new s(1);if(!a.isFinite())return new s(a.s?1/0:NaN);if(a.isZero())return l;t=s.precision,n=s.rounding,s.precision=t+Math.max(a.e,a.sd())+4,s.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),r=(1/Pc(4,e)).toString()):(e=16,r="2.3283064365386962890625e-10"),a=tu(s,1,a.times(r),new s(1),!0);for(var f,o=e,u=new s(8);o--;)f=a.times(a),a=l.minus(f.times(u.minus(f.times(u))));return dr(a,s.precision=t,s.rounding=n,!0)};Ue.hyperbolicSine=Ue.sinh=function(){var e,r,t,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(r=a.precision,t=a.rounding,a.precision=r+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<3)i=tu(a,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Pc(5,e)),i=tu(a,2,i,i,!0);for(var s,l=new a(5),f=new a(16),o=new a(20);e--;)s=i.times(i),i=i.times(l.plus(s.times(f.times(s).plus(o))))}return a.precision=r,a.rounding=t,dr(i,r,t,!0)};Ue.hyperbolicTangent=Ue.tanh=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+7,n.rounding=1,xt(t.sinh(),t.cosh(),n.precision=e,n.rounding=r)):new n(t.s)};Ue.inverseCosine=Ue.acos=function(){var e,r=this,t=r.constructor,n=r.abs().cmp(1),i=t.precision,a=t.rounding;return n!==-1?n===0?r.isNeg()?Yi(t,i,a):new t(0):new t(NaN):r.isZero()?Yi(t,i+4,a).times(.5):(t.precision=i+6,t.rounding=1,r=r.asin(),e=Yi(t,i+4,a).times(.5),t.precision=i,t.rounding=a,e.minus(r))};Ue.inverseHyperbolicCosine=Ue.acosh=function(){var e,r,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(e=n.precision,r=n.rounding,n.precision=e+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,Er=!1,t=t.times(t).minus(1).sqrt().plus(t),Er=!0,n.precision=e,n.rounding=r,t.ln()):new n(t)};Ue.inverseHyperbolicSine=Ue.asinh=function(){var e,r,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,Er=!1,t=t.times(t).plus(1).sqrt().plus(t),Er=!0,n.precision=e,n.rounding=r,t.ln())};Ue.inverseHyperbolicTangent=Ue.atanh=function(){var e,r,t,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,r=a.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?dr(new a(i),e,r,!0):(a.precision=t=n-i.e,i=xt(i.plus(1),new a(1).minus(i),t+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=r,i.times(.5))):new a(NaN)};Ue.inverseSine=Ue.asin=function(){var e,r,t,n,i=this,a=i.constructor;return i.isZero()?new a(i):(r=i.abs().cmp(1),t=a.precision,n=a.rounding,r!==-1?r===0?(e=Yi(a,t+4,n).times(.5),e.s=i.s,e):new a(NaN):(a.precision=t+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=t,a.rounding=n,i.times(2)))};Ue.inverseTangent=Ue.atan=function(){var e,r,t,n,i,a,s,l,f,o=this,u=o.constructor,p=u.precision,h=u.rounding;if(o.isFinite()){if(o.isZero())return new u(o);if(o.abs().eq(1)&&p+4<=nv)return s=Yi(u,p+4,h).times(.25),s.s=o.s,s}else{if(!o.s)return new u(NaN);if(p+4<=nv)return s=Yi(u,p+4,h).times(.5),s.s=o.s,s}for(u.precision=l=p+10,u.rounding=1,t=Math.min(28,l/br+2|0),e=t;e;--e)o=o.div(o.times(o).plus(1).sqrt().plus(1));for(Er=!1,r=Math.ceil(l/br),n=1,f=o.times(o),s=new u(o),i=o;e!==-1;)if(i=i.times(f),a=s.minus(i.div(n+=2)),i=i.times(f),s=a.plus(i.div(n+=2)),s.d[r]!==void 0)for(e=r;s.d[e]===a.d[e]&&e--;);return t&&(s=s.times(2<this.d.length-2};Ue.isNaN=function(){return!this.s};Ue.isNegative=Ue.isNeg=function(){return this.s<0};Ue.isPositive=Ue.isPos=function(){return this.s>0};Ue.isZero=function(){return!!this.d&&this.d[0]===0};Ue.lessThan=Ue.lt=function(e){return this.cmp(e)<0};Ue.lessThanOrEqualTo=Ue.lte=function(e){return this.cmp(e)<1};Ue.logarithm=Ue.log=function(e){var r,t,n,i,a,s,l,f,o=this,u=o.constructor,p=u.precision,h=u.rounding,d=5;if(e==null)e=new u(10),r=!0;else{if(e=new u(e),t=e.d,e.s<0||!t||!t[0]||e.eq(1))return new u(NaN);r=e.eq(10)}if(t=o.d,o.s<0||!t||!t[0]||o.eq(1))return new u(t&&!t[0]?-1/0:o.s!=1?NaN:t?0:1/0);if(r)if(t.length>1)a=!0;else{for(i=t[0];i%10===0;)i/=10;a=i!==1}if(Er=!1,l=p+d,s=yo(o,l),n=r?Oc(u,l+10):yo(e,l),f=xt(s,n,l,1),wf(f.d,i=p,h))do if(l+=10,s=yo(o,l),n=r?Oc(u,l+10):yo(e,l),f=xt(s,n,l,1),!a){+ln(f.d).slice(i+1,i+15)+1==1e14&&(f=dr(f,p+1,0));break}while(wf(f.d,i+=10,h));return Er=!0,dr(f,p,h)};Ue.minus=Ue.sub=function(e){var r,t,n,i,a,s,l,f,o,u,p,h,d=this,x=d.constructor;if(e=new x(e),!d.d||!e.d)return!d.s||!e.s?e=new x(NaN):d.d?e.s=-e.s:e=new x(e.d||d.s!==e.s?d:NaN),e;if(d.s!=e.s)return e.s=-e.s,d.plus(e);if(o=d.d,h=e.d,l=x.precision,f=x.rounding,!o[0]||!h[0]){if(h[0])e.s=-e.s;else if(o[0])e=new x(d);else return new x(f===3?-0:0);return Er?dr(e,l,f):e}if(t=mn(e.e/br),u=mn(d.e/br),o=o.slice(),a=u-t,a){for(p=a<0,p?(r=o,a=-a,s=h.length):(r=h,t=u,s=o.length),n=Math.max(Math.ceil(l/br),s)+2,a>n&&(a=n,r.length=1),r.reverse(),n=a;n--;)r.push(0);r.reverse()}else{for(n=o.length,s=h.length,p=n0;--n)o[s++]=0;for(n=h.length;n>a;){if(o[--n]s?a+1:s+1,i>s&&(i=s,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for(s=o.length,i=u.length,s-i<0&&(i=s,t=u,u=o,o=t),r=0;i;)r=(o[--i]=o[i]+u[i]+r)/Hi|0,o[i]%=Hi;for(r&&(o.unshift(r),++n),s=o.length;o[--s]==0;)o.pop();return e.d=o,e.e=Ic(o,n),Er?dr(e,l,f):e};Ue.precision=Ue.sd=function(e){var r,t=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(bo+e);return t.d?(r=Hy(t.d),e&&t.e+1>r&&(r=t.e+1)):r=NaN,r};Ue.round=function(){var e=this,r=e.constructor;return dr(new r(e),e.e+1,r.rounding)};Ue.sine=Ue.sin=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+br,n.rounding=1,t=Uk(n,Qy(n,t)),n.precision=e,n.rounding=r,dr(Ra>2?t.neg():t,e,r,!0)):new n(NaN)};Ue.squareRoot=Ue.sqrt=function(){var e,r,t,n,i,a,s=this,l=s.d,f=s.e,o=s.s,u=s.constructor;if(o!==1||!l||!l[0])return new u(!o||o<0&&(!l||l[0])?NaN:l?s:1/0);for(Er=!1,o=Math.sqrt(+s),o==0||o==1/0?(r=ln(l),(r.length+f)%2==0&&(r+="0"),o=Math.sqrt(r),f=mn((f+1)/2)-(f<0||f%2),o==1/0?r="5e"+f:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+f),n=new u(r)):n=new u(o.toString()),t=(f=u.precision)+3;;)if(a=n,n=a.plus(xt(s,a,t+2,1)).times(.5),ln(a.d).slice(0,t)===(r=ln(n.d)).slice(0,t))if(r=r.slice(t-3,t+1),r=="9999"||!i&&r=="4999"){if(!i&&(dr(a,f+1,0),a.times(a).eq(s))){n=a;break}t+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(dr(n,f+1,1),e=!n.times(n).eq(s));break}return Er=!0,dr(n,f,u.rounding,e)};Ue.tangent=Ue.tan=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+10,n.rounding=1,t=t.sin(),t.s=1,t=xt(t,new n(1).minus(t.times(t)).sqrt(),e+10,0),n.precision=e,n.rounding=r,dr(Ra==2||Ra==4?t.neg():t,e,r,!0)):new n(NaN)};Ue.times=Ue.mul=function(e){var r,t,n,i,a,s,l,f,o,u=this,p=u.constructor,h=u.d,d=(e=new p(e)).d;if(e.s*=u.s,!h||!h[0]||!d||!d[0])return new p(!e.s||h&&!h[0]&&!d||d&&!d[0]&&!h?NaN:!h||!d?e.s/0:e.s*0);for(t=mn(u.e/br)+mn(e.e/br),f=h.length,o=d.length,f=0;){for(r=0,i=f+n;i>n;)l=a[i]+d[n]*h[i-n-1]+r,a[i--]=l%Hi|0,r=l/Hi|0;a[i]=(a[i]+r)%Hi|0}for(;!a[--s];)a.pop();return r?++t:a.shift(),e.d=a,e.e=Ic(a,t),Er?dr(e,p.precision,p.rounding):e};Ue.toBinary=function(e,r){return ov(this,2,e,r)};Ue.toDecimalPlaces=Ue.toDP=function(e,r){var t=this,n=t.constructor;return t=new n(t),e===void 0?t:(Ln(e,0,wo),r===void 0?r=n.rounding:Ln(r,0,8),dr(t,e+t.e+1,r))};Ue.toExponential=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=pa(n,!0):(Ln(e,0,wo),r===void 0?r=i.rounding:Ln(r,0,8),n=dr(new i(n),e+1,r),t=pa(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+t:t};Ue.toFixed=function(e,r){var t,n,i=this,a=i.constructor;return e===void 0?t=pa(i):(Ln(e,0,wo),r===void 0?r=a.rounding:Ln(r,0,8),n=dr(new a(i),e+i.e+1,r),t=pa(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t};Ue.toFraction=function(e){var r,t,n,i,a,s,l,f,o,u,p,h,d=this,x=d.d,v=d.constructor;if(!x)return new v(d);if(o=t=new v(1),n=f=new v(0),r=new v(n),a=r.e=Hy(x)-d.e-1,s=a%br,r.d[0]=Jt(10,s<0?br+s:s),e==null)e=a>0?r:o;else{if(l=new v(e),!l.isInt()||l.lt(o))throw Error(bo+l);e=l.gt(r)?a>0?r:o:l}for(Er=!1,l=new v(ln(x)),u=v.precision,v.precision=a=x.length*br*2;p=xt(l,r,0,1,1),i=t.plus(p.times(n)),i.cmp(e)!=1;)t=n,n=i,i=o,o=f.plus(p.times(i)),f=i,i=r,r=l.minus(p.times(i)),l=i;return i=xt(e.minus(t),n,0,1,1),f=f.plus(i.times(o)),t=t.plus(i.times(n)),f.s=o.s=d.s,h=xt(o,n,a,1).minus(d).abs().cmp(xt(f,t,a,1).minus(d).abs())<1?[o,n]:[f,t],v.precision=u,Er=!0,h};Ue.toHexadecimal=Ue.toHex=function(e,r){return ov(this,16,e,r)};Ue.toNearest=function(e,r){var t=this,n=t.constructor;if(t=new n(t),e==null){if(!t.d)return t;e=new n(1),r=n.rounding}else{if(e=new n(e),r===void 0?r=n.rounding:Ln(r,0,8),!t.d)return e.s?t:e;if(!e.d)return e.s&&(e.s=t.s),e}return e.d[0]?(Er=!1,t=xt(t,e,0,r,1).times(e),Er=!0,dr(t)):(e.s=t.s,t=e),t};Ue.toNumber=function(){return+this};Ue.toOctal=function(e,r){return ov(this,8,e,r)};Ue.toPower=Ue.pow=function(e){var r,t,n,i,a,s,l=this,f=l.constructor,o=+(e=new f(e));if(!l.d||!e.d||!l.d[0]||!e.d[0])return new f(Jt(+l,o));if(l=new f(l),l.eq(1))return l;if(n=f.precision,a=f.rounding,e.eq(1))return dr(l,n,a);if(r=mn(e.e/br),r>=e.d.length-1&&(t=o<0?-o:o)<=kk)return i=Gy(f,l,t,n),e.s<0?new f(1).div(i):dr(i,n,a);if(s=l.s,s<0){if(rf.maxE+1||r0?s/0:0):(Er=!1,f.rounding=l.s=1,t=Math.min(12,(r+"").length),i=iv(e.times(yo(l,n+t)),n),i.d&&(i=dr(i,n+5,1),wf(i.d,n,a)&&(r=n+10,i=dr(iv(e.times(yo(l,r+t)),r),r+5,1),+ln(i.d).slice(n+1,n+15)+1==1e14&&(i=dr(i,n+1,0)))),i.s=s,Er=!0,f.rounding=a,dr(i,n,a))};Ue.toPrecision=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=pa(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Ln(e,1,wo),r===void 0?r=i.rounding:Ln(r,0,8),n=dr(new i(n),e,r),t=pa(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+t:t};Ue.toSignificantDigits=Ue.toSD=function(e,r){var t=this,n=t.constructor;return e===void 0?(e=n.precision,r=n.rounding):(Ln(e,1,wo),r===void 0?r=n.rounding:Ln(r,0,8)),dr(new n(t),e,r)};Ue.toString=function(){var e=this,r=e.constructor,t=pa(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()&&!e.isZero()?"-"+t:t};Ue.truncated=Ue.trunc=function(){return dr(new this.constructor(this),this.e+1,1)};Ue.valueOf=Ue.toJSON=function(){var e=this,r=e.constructor,t=pa(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()?"-"+t:t};function ln(e){var r,t,n,i=e.length-1,a="",s=e[0];if(i>0){for(a+=s,r=1;rt)throw Error(bo+e)}function wf(e,r,t,n){var i,a,s,l;for(a=e[0];a>=10;a/=10)--r;return--r<0?(r+=br,i=0):(i=Math.ceil((r+1)/br),r%=br),a=Jt(10,br-r),l=e[i]%a|0,n==null?r<3?(r==0?l=l/100|0:r==1&&(l=l/10|0),s=t<4&&l==99999||t>3&&l==49999||l==5e4||l==0):s=(t<4&&l+1==a||t>3&&l+1==a/2)&&(e[i+1]/a/100|0)==Jt(10,r-2)-1||(l==a/2||l==0)&&(e[i+1]/a/100|0)==0:r<4?(r==0?l=l/1e3|0:r==1?l=l/100|0:r==2&&(l=l/10|0),s=(n||t<4)&&l==9999||!n&&t>3&&l==4999):s=((n||t<4)&&l+1==a||!n&&t>3&&l+1==a/2)&&(e[i+1]/a/1e3|0)==Jt(10,r-3)-1,s}function _c(e,r,t){for(var n,i=[0],a,s=0,l=e.length;st-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/t|0,i[n]%=t)}return i.reverse()}function Lk(e,r){var t,n,i;if(r.isZero())return r;n=r.d.length,n<32?(t=Math.ceil(n/3),i=(1/Pc(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),e.precision+=t,r=tu(e,1,r.times(i),new e(1));for(var a=t;a--;){var s=r.times(r);r=s.times(s).minus(s).times(8).plus(1)}return e.precision-=t,r}var xt=function(){function e(n,i,a){var s,l=0,f=n.length;for(n=n.slice();f--;)s=n[f]*i+l,n[f]=s%a|0,l=s/a|0;return l&&n.unshift(l),n}function r(n,i,a,s){var l,f;if(a!=s)f=a>s?1:-1;else for(l=f=0;li[l]?1:-1;break}return f}function t(n,i,a,s){for(var l=0;a--;)n[a]-=l,l=n[a]1;)n.shift()}return function(n,i,a,s,l,f){var o,u,p,h,d,x,v,y,w,C,b,A,E,S,O,F,M,_,k,L,Y=n.constructor,$=n.s==i.s?1:-1,V=n.d,q=i.d;if(!V||!V[0]||!q||!q[0])return new Y(!n.s||!i.s||(V?q&&V[0]==q[0]:!q)?NaN:V&&V[0]==0||!q?$*0:$/0);for(f?(d=1,u=n.e-i.e):(f=Hi,d=br,u=mn(n.e/d)-mn(i.e/d)),k=q.length,M=V.length,w=new Y($),C=w.d=[],p=0;q[p]==(V[p]||0);p++);if(q[p]>(V[p]||0)&&u--,a==null?(S=a=Y.precision,s=Y.rounding):l?S=a+(n.e-i.e)+1:S=a,S<0)C.push(1),x=!0;else{if(S=S/d+2|0,p=0,k==1){for(h=0,q=q[0],S++;(p1&&(q=e(q,h,f),V=e(V,h,f),k=q.length,M=V.length),F=k,b=V.slice(0,k),A=b.length;A=f/2&&++_;do h=0,o=r(q,b,k,A),o<0?(E=b[0],k!=A&&(E=E*f+(b[1]||0)),h=E/_|0,h>1?(h>=f&&(h=f-1),v=e(q,h,f),y=v.length,A=b.length,o=r(v,b,y,A),o==1&&(h--,t(v,k=10;h/=10)p++;w.e=p+u*d-1,dr(w,l?a+w.e+1:a,s,x)}return w}}();function dr(e,r,t,n){var i,a,s,l,f,o,u,p,h,d=e.constructor;e:if(r!=null){if(p=e.d,!p)return e;for(i=1,l=p[0];l>=10;l/=10)i++;if(a=r-i,a<0)a+=br,s=r,u=p[h=0],f=u/Jt(10,i-s-1)%10|0;else if(h=Math.ceil((a+1)/br),l=p.length,h>=l)if(n){for(;l++<=h;)p.push(0);u=f=0,i=1,a%=br,s=a-br+1}else break e;else{for(u=l=p[h],i=1;l>=10;l/=10)i++;a%=br,s=a-br+i,f=s<0?0:u/Jt(10,i-s-1)%10|0}if(n=n||r<0||p[h+1]!==void 0||(s<0?u:u%Jt(10,i-s-1)),o=t<4?(f||n)&&(t==0||t==(e.s<0?3:2)):f>5||f==5&&(t==4||n||t==6&&(a>0?s>0?u/Jt(10,i-s):0:p[h-1])%10&1||t==(e.s<0?8:7)),r<1||!p[0])return p.length=0,o?(r-=e.e+1,p[0]=Jt(10,(br-r%br)%br),e.e=-r||0):p[0]=e.e=0,e;if(a==0?(p.length=h,l=1,h--):(p.length=h+1,l=Jt(10,br-a),p[h]=s>0?(u/Jt(10,i-s)%Jt(10,s)|0)*l:0),o)for(;;)if(h==0){for(a=1,s=p[0];s>=10;s/=10)a++;for(s=p[0]+=l,l=1;s>=10;s/=10)l++;a!=l&&(e.e++,p[0]==Hi&&(p[0]=1));break}else{if(p[h]+=l,p[h]!=Hi)break;p[h--]=0,l=1}for(a=p.length;p[--a]===0;)p.pop()}return Er&&(e.e>d.maxE?(e.d=null,e.e=NaN):e.e0?a=a.charAt(0)+"."+a.slice(1)+xo(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+xo(-i-1)+a,t&&(n=t-s)>0&&(a+=xo(n))):i>=s?(a+=xo(i+1-s),t&&(n=t-i-1)>0&&(a=a+"."+xo(n))):((n=i+1)0&&(i+1===s&&(a+="."),a+=xo(n))),a}function Ic(e,r){var t=e[0];for(r*=br;t>=10;t/=10)r++;return r}function Oc(e,r,t){if(r>Rk)throw Er=!0,t&&(e.precision=t),Error(zy);return dr(new e(Tc),r,1,!0)}function Yi(e,r,t){if(r>nv)throw Error(zy);return dr(new e(Fc),r,t,!0)}function Hy(e){var r=e.length-1,t=r*br+1;if(r=e[r],r){for(;r%10==0;r/=10)t--;for(r=e[0];r>=10;r/=10)t++}return t}function xo(e){for(var r="";e--;)r+="0";return r}function Gy(e,r,t,n){var i,a=new e(1),s=Math.ceil(n/br+4);for(Er=!1;;){if(t%2&&(a=a.times(r),Ly(a.d,s)&&(i=!0)),t=mn(t/2),t===0){t=a.d.length-1,i&&a.d[t]===0&&++a.d[t];break}r=r.times(r),Ly(r.d,s)}return Er=!0,a}function Ry(e){return e.d[e.d.length-1]&1}function $y(e,r,t){for(var n,i=new e(r[0]),a=0;++a17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(r==null?(Er=!1,f=x):f=r,l=new h(.03125);e.e>-2;)e=e.times(l),p+=5;for(n=Math.log(Jt(2,p))/Math.LN10*2+5|0,f+=n,t=a=s=new h(1),h.precision=f;;){if(a=dr(a.times(e),f,1),t=t.times(++u),l=s.plus(xt(a,t,f,1)),ln(l.d).slice(0,f)===ln(s.d).slice(0,f)){for(i=p;i--;)s=dr(s.times(s),f,1);if(r==null)if(o<3&&wf(s.d,f-n,d,o))h.precision=f+=10,t=a=l=new h(1),u=0,o++;else return dr(s,h.precision=x,d,Er=!0);else return h.precision=x,s}s=l}}function yo(e,r){var t,n,i,a,s,l,f,o,u,p,h,d=1,x=10,v=e,y=v.d,w=v.constructor,C=w.rounding,b=w.precision;if(v.s<0||!y||!y[0]||!v.e&&y[0]==1&&y.length==1)return new w(y&&!y[0]?-1/0:v.s!=1?NaN:y?0:v);if(r==null?(Er=!1,u=b):u=r,w.precision=u+=x,t=ln(y),n=t.charAt(0),Math.abs(a=v.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)v=v.times(e),t=ln(v.d),n=t.charAt(0),d++;a=v.e,n>1?(v=new w("0."+t),a++):v=new w(n+"."+t.slice(1))}else return o=Oc(w,u+2,b).times(a+""),v=yo(new w(n+"."+t.slice(1)),u-x).plus(o),w.precision=b,r==null?dr(v,b,C,Er=!0):v;for(p=v,f=s=v=xt(v.minus(1),v.plus(1),u,1),h=dr(v.times(v),u,1),i=3;;){if(s=dr(s.times(h),u,1),o=f.plus(xt(s,new w(i),u,1)),ln(o.d).slice(0,u)===ln(f.d).slice(0,u))if(f=f.times(2),a!==0&&(f=f.plus(Oc(w,u+2,b).times(a+""))),f=xt(f,new w(d),u,1),r==null)if(wf(f.d,u-x,C,l))w.precision=u+=x,o=s=v=xt(p.minus(1),p.plus(1),u,1),h=dr(v.times(v),u,1),i=l=1;else return dr(f,w.precision=b,C,Er=!0);else return w.precision=b,f;f=o,i+=2}}function Zy(e){return String(e.s*e.s/0)}function av(e,r){var t,n,i;for((t=r.indexOf("."))>-1&&(r=r.replace(".","")),(n=r.search(/e/i))>0?(t<0&&(t=n),t+=+r.slice(n+1),r=r.substring(0,n)):t<0&&(t=r.length),n=0;r.charCodeAt(n)===48;n++);for(i=r.length;r.charCodeAt(i-1)===48;--i);if(r=r.slice(n,i),r){if(i-=n,e.e=t=t-n-1,e.d=[],n=(t+1)%br,t<0&&(n+=br),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(r=r.replace(/(\\d)_(?=\\d)/g,"$1"),Yy.test(r))return av(e,r)}else if(r==="Infinity"||r==="NaN")return+r||(e.s=NaN),e.e=NaN,e.d=null,e;if(Ik.test(r))t=16,r=r.toLowerCase();else if(Bk.test(r))t=2;else if(Pk.test(r))t=8;else throw Error(bo+r);for(a=r.search(/p/i),a>0?(f=+r.slice(a+1),r=r.substring(2,a)):r=r.slice(2),a=r.indexOf("."),s=a>=0,n=e.constructor,s&&(r=r.replace(".",""),l=r.length,a=l-a,i=Gy(n,new n(t),a,a*2)),o=_c(r,t,Hi),u=o.length-1,a=u;o[a]===0;--a)o.pop();return a<0?new n(e.s*0):(e.e=Ic(o,u),e.d=o,Er=!1,s&&(e=xt(e,i,l*4)),f&&(e=e.times(Math.abs(f)<54?Jt(2,f):Df.pow(2,f))),Er=!0,e)}function Uk(e,r){var t,n=r.d.length;if(n<3)return r.isZero()?r:tu(e,2,r,r);t=1.4*Math.sqrt(n),t=t>16?16:t|0,r=r.times(1/Pc(5,t)),r=tu(e,2,r,r);for(var i,a=new e(5),s=new e(16),l=new e(20);t--;)i=r.times(r),r=r.times(a.plus(i.times(s.times(i).minus(l))));return r}function tu(e,r,t,n,i){var a,s,l,f,o=1,u=e.precision,p=Math.ceil(u/br);for(Er=!1,f=t.times(t),l=new e(n);;){if(s=xt(l.times(f),new e(r++*r++),u,1),l=i?n.plus(s):n.minus(s),n=xt(s.times(f),new e(r++*r++),u,1),s=l.plus(n),s.d[p]!==void 0){for(a=p;s.d[a]===l.d[a]&&a--;);if(a==-1)break}a=l,l=n,n=s,s=a,o++}return Er=!0,s.d.length=p+1,s}function Pc(e,r){for(var t=e;--r;)t*=e;return t}function Qy(e,r){var t,n=r.s<0,i=Yi(e,e.precision,1),a=i.times(.5);if(r=r.abs(),r.lte(a))return Ra=n?4:1,r;if(t=r.divToInt(i),t.isZero())Ra=n?3:2;else{if(r=r.minus(t.times(i)),r.lte(a))return Ra=Ry(t)?n?2:3:n?4:1,r;Ra=Ry(t)?n?1:4:n?3:2}return r.minus(i).abs()}function ov(e,r,t,n){var i,a,s,l,f,o,u,p,h,d=e.constructor,x=t!==void 0;if(x?(Ln(t,1,wo),n===void 0?n=d.rounding:Ln(n,0,8)):(t=d.precision,n=d.rounding),!e.isFinite())u=Zy(e);else{for(u=pa(e),s=u.indexOf("."),x?(i=2,r==16?t=t*4-3:r==8&&(t=t*3-2)):i=r,s>=0&&(u=u.replace(".",""),h=new d(1),h.e=u.length-s,h.d=_c(pa(h),10,i),h.e=h.d.length),p=_c(u,10,i),a=f=p.length;p[--f]==0;)p.pop();if(!p[0])u=x?"0p+0":"0";else{if(s<0?a--:(e=new d(e),e.d=p,e.e=a,e=xt(e,h,t,n,0,i),p=e.d,a=e.e,o=Uy),s=p[t],l=i/2,o=o||p[t+1]!==void 0,o=n<4?(s!==void 0||o)&&(n===0||n===(e.s<0?3:2)):s>l||s===l&&(n===4||o||n===6&&p[t-1]&1||n===(e.s<0?8:7)),p.length=t,o)for(;++p[--t]>i-1;)p[t]=0,t||(++a,p.unshift(1));for(f=p.length;!p[f-1];--f);for(s=0,u="";s1)if(r==16||r==8){for(s=r==16?4:3,--f;f%s;f++)u+="0";for(p=_c(u,i,r),f=p.length;!p[f-1];--f);for(s=1,u="1.";sf)for(a-=f;a--;)u+="0";else ar)return e.length=r,!0}function zk(e){return new this(e).abs()}function Wk(e){return new this(e).acos()}function Vk(e){return new this(e).acosh()}function Yk(e,r){return new this(e).plus(r)}function Hk(e){return new this(e).asin()}function Gk(e){return new this(e).asinh()}function $k(e){return new this(e).atan()}function Zk(e){return new this(e).atanh()}function Qk(e,r){e=new this(e),r=new this(r);var t,n=this.precision,i=this.rounding,a=n+4;return!e.s||!r.s?t=new this(NaN):!e.d&&!r.d?(t=Yi(this,a,1).times(r.s>0?.25:.75),t.s=e.s):!r.d||e.isZero()?(t=r.s<0?Yi(this,n,i):new this(0),t.s=e.s):!e.d||r.isZero()?(t=Yi(this,a,1).times(.5),t.s=e.s):r.s<0?(this.precision=a,this.rounding=1,t=this.atan(xt(e,r,a,1)),r=Yi(this,a,1),this.precision=n,this.rounding=i,t=e.s<0?t.minus(r):t.plus(r)):t=this.atan(xt(e,r,a,1)),t}function Xk(e){return new this(e).cbrt()}function Jk(e){return dr(e=new this(e),e.e+1,2)}function Kk(e,r,t){return new this(e).clamp(r,t)}function jk(e){if(!e||typeof e!="object")throw Error(Bc+"Object expected");var r,t,n,i=e.defaults===!0,a=["precision",1,wo,"rounding",0,8,"toExpNeg",-ru,0,"toExpPos",0,ru,"maxE",0,ru,"minE",-ru,0,"modulo",0,9];for(r=0;r=a[r+1]&&n<=a[r+2])this[t]=n;else throw Error(bo+t+": "+n);if(t="crypto",i&&(this[t]=tv[t]),(n=e[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(Wy);else this[t]=!1;else throw Error(bo+t+": "+n);return this}function eR(e){return new this(e).cos()}function rR(e){return new this(e).cosh()}function Xy(e){var r,t,n;function i(a){var s,l,f,o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,qy(a)){o.s=a.s,Er?!a.d||a.e>i.maxE?(o.e=NaN,o.d=null):a.e=10;l/=10)s++;Er?s>i.maxE?(o.e=NaN,o.d=null):s=429e7?r[a]=crypto.getRandomValues(new Uint32Array(1))[0]:l[a++]=i%1e7;else if(crypto.randomBytes){for(r=crypto.randomBytes(n*=4);a=214e7?crypto.randomBytes(4).copy(r,a):(l.push(i%1e7),a+=4);a=n/4}else throw Error(Wy);else for(;a=10;i/=10)n++;n{var{on:r,config:t}=e,n=ts.clone({precision:t.precision,modulo:ts.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(i){return new n(i.value)},r&&r("config",function(i,a){i.precision!==a.precision&&n.config({precision:i.precision})}),n},{isClass:!0});var tn=Xn(jy(),1);var MR="Complex",_R=[],e1=T(MR,_R,()=>(Object.defineProperty(tn.default,"name",{value:"Complex"}),tn.default.prototype.constructor=tn.default,tn.default.prototype.type="Complex",tn.default.prototype.isComplex=!0,tn.default.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},tn.default.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},tn.default.prototype.format=function(e){var r="",t=this.im,n=this.re,i=Wi(this.re,e),a=Wi(this.im,e),s=ar(e)?e:e?e.precision:null;if(s!==null){var l=Math.pow(10,-s);Math.abs(n/t)r.re?1:e.rer.im?1:e.im(Object.defineProperty(ma.default,"name",{value:"Fraction"}),ma.default.prototype.constructor=ma.default,ma.default.prototype.type="Fraction",ma.default.prototype.isFraction=!0,ma.default.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},ma.default.fromJSON=function(e){return new ma.default(e)},ma.default),{isClass:!0});var OR="Range",BR=[],i1=T(OR,BR,()=>{function e(r,t,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=r!=null,a=t!=null,s=n!=null;if(i){if(je(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter start must be a number")}if(a){if(je(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter end must be a number")}if(s){if(je(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=i?parseFloat(r):0,this.end=a?parseFloat(t):0,this.step=s?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(r){if(typeof r!="string")return null;var t=r.split(":"),n=t.map(function(a){return parseFloat(a)}),i=n.some(function(a){return isNaN(a)});if(i)return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var r=0,t=this.start,n=this.step,i=this.end,a=i-t;return hi(n)===hi(a)?r=Math.ceil(a/n):a===0&&(r=0),isNaN(r)&&(r=0),[r]},e.prototype.min=function(){var r=this.size()[0];if(r>0)return this.step>0?this.start:this.start+(r-1)*this.step},e.prototype.max=function(){var r=this.size()[0];if(r>0)return this.step>0?this.start+(r-1)*this.step:this.start},e.prototype.forEach=function(r){var t=this.start,n=this.step,i=this.end,a=0;if(n>0)for(;ti;)r(t,[a],this),t+=n,a++},e.prototype.map=function(r){var t=[];return this.forEach(function(n,i,a){t[i[0]]=r(n,i,a)}),t},e.prototype.toArray=function(){var r=[];return this.forEach(function(t,n){r[n[0]]=t}),r},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(r){var t=Wi(this.start,r);return this.step!==1&&(t+=":"+Wi(this.step,r)),t+=":"+Wi(this.end,r),t},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(r){return new e(r.start,r.end,r.step)},e},{isClass:!0});var IR="Matrix",PR=[],a1=T(IR,PR,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(r,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(r,t,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(r){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(r,t,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(r,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(r,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(r,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(r){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(r){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function o1(e){var r=0,t=1,n=Object.create(null),i=Object.create(null),a=0,s=function(f){var o=i[f];if(!!o&&(delete n[o],delete i[f],--r,t===o)){if(!r){a=0,t=1;return}for(;!Object.prototype.hasOwnProperty.call(n,++t););}};return e=Math.abs(e),{hit:function(f){var o=i[f],u=++a;if(n[u]=f,i[f]=u,!o)return++r,r<=e?void 0:(f=n[t],s(f),f);if(delete n[o],t===o)for(;!Object.prototype.hasOwnProperty.call(n,++t););},delete:s,clear:function(){r=a=0,t=1,n=Object.create(null),i=Object.create(null)}}}function ns(e){var{hasher:r,limit:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t=t??Number.POSITIVE_INFINITY,r=r??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:o1(t||Number.POSITIVE_INFINITY)});for(var i=[],a=0;a{var{Matrix:r}=e;function t(u,p){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(p&&!yt(p))throw new Error("Invalid datatype: "+p);if(Ge(u))u.type==="DenseMatrix"?(this._data=tr(u._data),this._size=tr(u._size),this._datatype=p||u._datatype):(this._data=u.toArray(),this._size=u.size(),this._datatype=p||u._datatype);else if(u&&Ar(u.data)&&Ar(u.size))this._data=u.data,this._size=u.size,Hd(this._data,this._size),this._datatype=p||u.datatype;else if(Ar(u))this._data=o(u),this._size=or(this._data),Hd(this._data,this._size),this._datatype=p;else{if(u)throw new TypeError("Unsupported type of data ("+_r(u)+")");this._data=[],this._size=[0],this._datatype=p}}t.prototype=new r,t.prototype.createDenseMatrix=function(u,p){return new t(u,p)},Object.defineProperty(t,"name",{value:"DenseMatrix"}),t.prototype.constructor=t,t.prototype.type="DenseMatrix",t.prototype.isDenseMatrix=!0,t.prototype.getDataType=function(){return vo(this._data,_r)},t.prototype.storage=function(){return"dense"},t.prototype.datatype=function(){return this._datatype},t.prototype.create=function(u,p){return new t(u,p)},t.prototype.subset=function(u,p,h){switch(arguments.length){case 1:return n(this,u);case 2:case 3:return a(this,u,p,h);default:throw new SyntaxError("Wrong number of arguments")}},t.prototype.get=function(u){if(!Ar(u))throw new TypeError("Array expected");if(u.length!==this._size.length)throw new pr(u.length,this._size.length);for(var p=0;p");var b=p.max().map(function(S){return S+1});f(u,b,d);var A=x.length,E=0;s(u._data,p,h,A,E)}return u}function s(u,p,h,d,x){var v=x===d-1,y=p.dimension(x);v?y.forEach(function(w,C){Xr(w),u[w]=h[C[0]]}):y.forEach(function(w,C){Xr(w),s(u[w],p,h[C[0]],d,x+1)})}t.prototype.resize=function(u,p,h){if(!bt(u))throw new TypeError("Array or Matrix expected");var d=u.valueOf().map(v=>Array.isArray(v)&&v.length===1?v[0]:v),x=h?this.clone():this;return l(x,d,p)};function l(u,p,h){if(p.length===0){for(var d=u._data;Ar(d);)d=d[0];return d}return u._size=p.slice(0),u._data=Vi(u._data,u._size,h),u}t.prototype.reshape=function(u,p){var h=p?this.clone():this;h._data=xf(h._data,u);var d=h._size.reduce((x,v)=>x*v);return h._size=yf(u,d),h};function f(u,p,h){for(var d=u._size.slice(0),x=!1;d.lengthd[v]&&(d[v]=p[v],x=!0);x&&l(u,d,h)}t.prototype.clone=function(){var u=new t({data:tr(this._data),size:tr(this._size),datatype:this._datatype});return u},t.prototype.size=function(){return this._size.slice(0)},t.prototype.map=function(u){var p=this,h=kc(u),d=function y(w,C){return Ar(w)?w.map(function(b,A){return y(b,C.concat(A))}):h===1?u(w):h===2?u(w,C):u(w,C,p)},x=d(this._data,[]),v=this._datatype!==void 0?vo(x,_r):void 0;return new t(x,v)},t.prototype.forEach=function(u){var p=this,h=function d(x,v){Ar(x)?x.forEach(function(y,w){d(y,v.concat(w))}):u(x,v,p)};h(this._data,[])},t.prototype[Symbol.iterator]=function*(){var u=function*p(h,d){if(Ar(h))for(var x=0;x[b[w]]);p.push(new t(C,u._datatype))},v=0;v0?u:0,h=u<0?-u:0,d=this._size[0],x=this._size[1],v=Math.min(d-h,x-p),y=[],w=0;w0?h:0,v=h<0?-h:0,y=u[0],w=u[1],C=Math.min(y-v,w-x),b;if(Ar(p)){if(p.length!==C)throw new Error("Invalid value array length");b=function(F){return p[F]}}else if(Ge(p)){var A=p.size();if(A.length!==1||A[0]!==C)throw new Error("Invalid matrix length");b=function(F){return p.get([F])}}else b=function(){return p};d||(d=je(b(0))?b(0).mul(0):0);var E=[];if(u.length>0){E=Vi(E,u,d);for(var S=0;S{var{typed:r}=e;return r(u1,{any:tr})});function Rc(e){var r=e.length,t=e[0].length,n,i,a=[];for(i=0;i=n.length)throw new Xt(r,n.length);return Ge(e)?e.create(Lc(e.valueOf(),r,t)):Lc(e,r,t)}function Lc(e,r,t){var n,i,a,s;if(r<=0)if(Array.isArray(e[0])){for(s=Rc(e),i=[],n=0;n{var{typed:r}=e;return r(l1,{number:He,BigNumber:function(n){return n.isInt()},Fraction:function(n){return n.d===1&&isFinite(n.n)},"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var qn="number",La="number, number";function lv(e){return Math.abs(e)}lv.signature=qn;function cv(e,r){return e+r}cv.signature=La;function pv(e,r){return e-r}pv.signature=La;function mv(e,r){return e*r}mv.signature=La;function UR(e,r){return e/r}UR.signature=La;function hv(e){return-e}hv.signature=qn;function dv(e){return e}dv.signature=qn;function nu(e){return uy(e)}nu.signature=qn;function vv(e){return e*e*e}vv.signature=qn;function gv(e){return Math.exp(e)}gv.signature=qn;function xv(e){return fy(e)}xv.signature=qn;function zR(e,r){if(!He(e)||!He(r))throw new Error("Parameters in function gcd must be integer numbers");for(var t;r!==0;)t=e%r,e=r,r=t;return e<0?-e:e}zR.signature=La;function yv(e,r){if(!He(e)||!He(r))throw new Error("Parameters in function lcm must be integer numbers");if(e===0||r===0)return 0;for(var t,n=e*r;r!==0;)t=r,r=e%t,e=t;return Math.abs(n/e)}yv.signature=La;function p1(e,r){return r?Math.log(e)/Math.log(r):Math.log(e)}function bv(e){return sy(e)}bv.signature=qn;function wv(e){return oy(e)}wv.signature=qn;function WR(e){return bc(e)}WR.signature=qn;function VR(e,r){return r===0?e:e-r*Math.floor(e/r)}VR.signature=La;function Dv(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,t=r<0;if(t&&(r=-r),r===0)throw new Error("Root must be non-zero");if(e<0&&Math.abs(r)%2!==1)throw new Error("Root must be odd when a is negative.");if(e===0)return t?1/0:0;if(!isFinite(e))return t?0:e;var n=Math.pow(Math.abs(e),1/r);return n=e<0?-n:n,t?1/n:n}function qc(e){return hi(e)}qc.signature=qn;function YR(e){return Math.sqrt(e)}YR.signature=qn;function Sv(e){return e*e}Sv.signature=qn;function Nv(e,r){var t,n,i,a=0,s=1,l=1,f=0;if(!He(e)||!He(r))throw new Error("Parameters in function xgcd must be integer numbers");for(;r;)n=Math.floor(e/r),i=e-n*r,t=a,a=s-n*a,s=t,t=l,l=f-n*l,f=t,e=r,r=i;var o;return e<0?o=[-e,-s,-f]:o=[e,e?s:0,f],o}Nv.signature=La;function Av(e,r){return e*e<1&&r===1/0||e*e>1&&r===-1/0?0:Math.pow(e,r)}Av.signature=La;function iu(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!He(r)||r<0||r>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(Wd(e,r))}function HR(e){return Math.abs(e)}HR.signature=qn;var GR="number",au="number, number";function Ev(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function bitAnd");return e&r}Ev.signature=au;function Cv(e){if(!He(e))throw new Error("Integer expected in function bitNot");return~e}Cv.signature=GR;function Mv(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function bitOr");return e|r}Mv.signature=au;function _v(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function bitXor");return e^r}_v.signature=au;function Tv(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function leftShift");return e<>r}Fv.signature=au;function Ov(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function rightLogShift");return e>>>r}Ov.signature=au;function jn(e,r){if(r>1;return jn(e,t)*jn(t+1,r)}function Bv(e,r){if(!He(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!He(r)||r<0)throw new TypeError("Positive integer value expected in function combinations");if(r>e)throw new TypeError("k must be less than or equal to n");for(var t=e-r,n=1,i=r171?1/0:jn(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*Sf(1-e));if(e>=171.35)return 1/0;if(e>85){var t=e*e,n=t*e,i=n*e,a=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*t)-139/(51840*n)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,r=is[0];for(var s=1;s=1;n--)t+=g1[n]/(e+n);return Uv+(e+.5)*Math.log(r)-r+Math.log(t)}Nf.signature="number";var Dt="number",XR="number, number";function JR(e){return Math.acos(e)}JR.signature=Dt;function zv(e){return py(e)}zv.signature=Dt;function Wv(e){return Math.atan(1/e)}Wv.signature=Dt;function Vv(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}Vv.signature=Dt;function Yv(e){return Math.asin(1/e)}Yv.signature=Dt;function Hv(e){var r=1/e;return Math.log(r+Math.sqrt(r*r+1))}Hv.signature=Dt;function Gv(e){return Math.acos(1/e)}Gv.signature=Dt;function $v(e){var r=1/e,t=Math.sqrt(r*r-1);return Math.log(t+r)}$v.signature=Dt;function KR(e){return Math.asin(e)}KR.signature=Dt;function Zv(e){return my(e)}Zv.signature=Dt;function jR(e){return Math.atan(e)}jR.signature=Dt;function e9(e,r){return Math.atan2(e,r)}e9.signature=XR;function Qv(e){return hy(e)}Qv.signature=Dt;function r9(e){return Math.cos(e)}r9.signature=Dt;function t9(e){return Dc(e)}t9.signature=Dt;function Xv(e){return 1/Math.tan(e)}Xv.signature=Dt;function Jv(e){var r=Math.exp(2*e);return(r+1)/(r-1)}Jv.signature=Dt;function Kv(e){return 1/Math.sin(e)}Kv.signature=Dt;function jv(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*hi(e)}jv.signature=Dt;function eg(e){return 1/Math.cos(e)}eg.signature=Dt;function rg(e){return 2/(Math.exp(e)+Math.exp(-e))}rg.signature=Dt;function n9(e){return Math.sin(e)}n9.signature=Dt;function tg(e){return dy(e)}tg.signature=Dt;function i9(e){return Math.tan(e)}i9.signature=Dt;function a9(e){return Sc(e)}a9.signature=Dt;var Af="number";function o9(e){return He(e)}o9.signature=Af;function ng(e){return e<0}ng.signature=Af;function ig(e){return e>0}ig.signature=Af;function ag(e){return e===0}ag.signature=Af;function og(e){return Number.isNaN(e)}og.signature=Af;var x1="isNegative",s9=["typed"],y1=T(x1,s9,e=>{var{typed:r}=e;return r(x1,{number:ng,BigNumber:function(n){return n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s<0},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var b1="isNumeric",u9=["typed"],w1=T(b1,u9,e=>{var{typed:r}=e;return r(b1,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var D1="hasNumericValue",f9=["typed","isNumeric"],S1=T(D1,f9,e=>{var{typed:r,isNumeric:t}=e;return r(D1,{boolean:()=>!0,string:function(i){return i.trim().length>0&&!isNaN(Number(i))},any:function(i){return t(i)}})});var N1="isPositive",l9=["typed"],A1=T(N1,l9,e=>{var{typed:r}=e;return r(N1,{number:ig,BigNumber:function(n){return!n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s>0&&n.n>0},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var E1="isZero",c9=["typed"],C1=T(E1,c9,e=>{var{typed:r}=e;return r(E1,{number:ag,BigNumber:function(n){return n.isZero()},Complex:function(n){return n.re===0&&n.im===0},Fraction:function(n){return n.d===1&&n.n===0},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var M1="isNaN",p9=["typed"],_1=T(M1,p9,e=>{var{typed:r}=e;return r(M1,{number:og,BigNumber:function(n){return n.isNaN()},Fraction:function(n){return!1},Complex:function(n){return n.isNaN()},Unit:function(n){return Number.isNaN(n.value)},"Array | Matrix":function(n){return Je(n,Number.isNaN)}})});var T1="typeOf",m9=["typed"],F1=T(T1,m9,e=>{var{typed:r}=e;return r(T1,{any:_r})});function Ut(e,r,t){if(t==null)return e.eq(r);if(e.eq(r))return!0;if(e.isNaN()||r.isNaN())return!1;if(e.isFinite()&&r.isFinite()){var n=e.minus(r).abs();if(n.isZero())return!0;var i=e.constructor.max(e.abs(),r.abs());return n.lte(i.times(t))}return!1}function O1(e,r,t){return wt(e.re,r.re,t)&&wt(e.im,r.im,t)}var vi=T("compareUnits",["typed"],e=>{var{typed:r}=e;return{"Unit, Unit":r.referToSelf(t=>(n,i)=>{if(!n.equalBase(i))throw new Error("Cannot compare units with different base");return r.find(t,[n.valueType(),i.valueType()])(n.value,i.value)})}});var Uc="equalScalar",h9=["typed","config"],B1=T(Uc,h9,e=>{var{typed:r,config:t}=e,n=vi({typed:r});return r(Uc,{"boolean, boolean":function(a,s){return a===s},"number, number":function(a,s){return wt(a,s,t.epsilon)},"BigNumber, BigNumber":function(a,s){return a.eq(s)||Ut(a,s,t.epsilon)},"Fraction, Fraction":function(a,s){return a.equals(s)},"Complex, Complex":function(a,s){return O1(a,s,t.epsilon)}},n)}),NX=T(Uc,["typed","config"],e=>{var{typed:r,config:t}=e;return r(Uc,{"number, number":function(i,a){return wt(i,a,t.epsilon)}})});var d9="SparseMatrix",v9=["typed","equalScalar","Matrix"],I1=T(d9,v9,e=>{var{typed:r,equalScalar:t,Matrix:n}=e;function i(v,y){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(y&&!yt(y))throw new Error("Invalid datatype: "+y);if(Ge(v))a(this,v,y);else if(v&&Ar(v.index)&&Ar(v.ptr)&&Ar(v.size))this._values=v.values,this._index=v.index,this._ptr=v.ptr,this._size=v.size,this._datatype=y||v.datatype;else if(Ar(v))s(this,v,y);else{if(v)throw new TypeError("Unsupported type of data ("+_r(v)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=y}}function a(v,y,w){y.type==="SparseMatrix"?(v._values=y._values?tr(y._values):void 0,v._index=tr(y._index),v._ptr=tr(y._ptr),v._size=tr(y._size),v._datatype=w||y._datatype):s(v,y.valueOf(),w||y._datatype)}function s(v,y,w){v._values=[],v._index=[],v._ptr=[],v._datatype=w;var C=y.length,b=0,A=t,E=0;if(yt(w)&&(A=r.find(t,[w,w])||t,E=r.convert(0,w)),C>0){var S=0;do{v._ptr.push(v._index.length);for(var O=0;O");if(b.length===1){var F=y.dimension(0);F.forEach(function(k,L){Xr(k),v.set([k,0],w[L[0]],C)})}else{var M=y.dimension(0),_=y.dimension(1);M.forEach(function(k,L){Xr(k),_.forEach(function(Y,$){Xr(Y),v.set([k,Y],w[L[0]][$[0]],C)})})}}return v}i.prototype.get=function(v){if(!Ar(v))throw new TypeError("Array expected");if(v.length!==this._size.length)throw new pr(v.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var y=v[0],w=v[1];Xr(y,this._size[0]),Xr(w,this._size[1]);var C=o(y,this._ptr[w],this._ptr[w+1],this._index);return CA-1||b>E-1)&&(h(this,Math.max(C+1,A),Math.max(b+1,E),w),A=this._size[0],E=this._size[1]),Xr(C,A),Xr(b,E);var F=o(C,this._ptr[b],this._ptr[b+1],this._index);return FArray.isArray(A)&&A.length===1?A[0]:A);if(C.length!==2)throw new Error("Only two dimensions matrix are supported");C.forEach(function(A){if(!ar(A)||!He(A)||A<0)throw new TypeError("Invalid size, must contain positive integers (size: "+lr(C)+")")});var b=w?this.clone():this;return h(b,C[0],C[1],y)};function h(v,y,w,C){var b=C||0,A=t,E=0;yt(v._datatype)&&(A=r.find(t,[v._datatype,v._datatype])||t,E=r.convert(0,v._datatype),b=r.convert(b,v._datatype));var S=!A(b,E),O=v._size[0],F=v._size[1],M,_,k;if(w>F){for(_=F;_O){if(S){var L=0;for(_=0;_y-1&&(v._values.splice(k,1),v._index.splice(k,1),$++)}v._ptr[_]=v._values.length}return v._size[0]=y,v._size[1]=w,v}i.prototype.reshape=function(v,y){if(!Ar(v))throw new TypeError("Array expected");if(v.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");v.forEach(function(U){if(!ar(U)||!He(U)||U<=-2||U===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+lr(v)+")")});var w=this._size[0]*this._size[1];v=yf(v,w);var C=v[0]*v[1];if(w!==C)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var b=y?this.clone():this;if(this._size[0]===v[0]&&this._size[1]===v[1])return b;for(var A=[],E=0;E=y&&q<=w&&k(v._values[V],q-y,L-C)}else{for(var R={},j=Y;j<$;j++){var U=v._index[j];R[U]=v._values[j]}for(var oe=y;oe<=w;oe++){var me=oe in R?R[oe]:0;k(me,oe-y,L-C)}}}return F.push(S.length),new i({values:S,index:O,ptr:F,size:[w-y+1,b-C+1]})}i.prototype.forEach=function(v,y){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var w=this,C=this._size[0],b=this._size[1],A=0;A "+(this._values?lr(this._values[O],v):"X")}return b},i.prototype.toString=function(){return lr(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(v){if(v){if(je(v)&&(v=v.toNumber()),!ar(v)||!He(v))throw new TypeError("The parameter k must be an integer number")}else v=0;var y=v>0?v:0,w=v<0?-v:0,C=this._size[0],b=this._size[1],A=Math.min(C-w,b-y),E=[],S=[],O=[];O[0]=0;for(var F=y;F0?w:0,O=w<0?-w:0,F=v[0],M=v[1],_=Math.min(F-O,M-S),k;if(Ar(y)){if(y.length!==_)throw new Error("Invalid value array length");k=function(oe){return y[oe]}}else if(Ge(y)){var L=y.size();if(L.length!==1||L[0]!==_)throw new Error("Invalid matrix length");k=function(oe){return y.get([oe])}}else k=function(){return y};for(var Y=[],$=[],V=[],q=0;q=0&&R<_){var j=k(R);A(j,E)||($.push(R+O),Y.push(j))}}return V.push(Y.length),new i({values:Y,index:$,ptr:V,size:[F,M]})},i.prototype.swapRows=function(v,y){if(!ar(v)||!He(v)||!ar(y)||!He(y))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Xr(v,this._size[0]),Xr(y,this._size[0]),i._swapRows(v,y,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(v,y,w,C,b){for(var A=C[v],E=C[v+1],S=A;S=O||b[M]!==y)){var k=C?C[F]:void 0;b.splice(M,0,y),C&&C.splice(M,0,k),b.splice(M<=F?F+1:F,1),C&&C.splice(M<=F?F+1:F,1);continue}if(M=O||b[F]!==v)){var L=C?C[M]:void 0;b.splice(F,0,v),C&&C.splice(F,0,L),b.splice(F<=M?M+1:M,1),C&&C.splice(F<=M?M+1:M,1)}}},i},{isClass:!0});var g9="number",x9=["typed"];function y9(e){var r=e.match(/(0[box])([0-9a-fA-F]*)\\.([0-9a-fA-F]*)/);if(r){var t={"0b":2,"0o":8,"0x":16}[r[1]],n=r[2],i=r[3];return{input:e,radix:t,integerPart:n,fractionalPart:i}}else return null}function b9(e){for(var r=parseInt(e.integerPart,e.radix),t=0,n=0;n{var{typed:r}=e,t=r("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var a=y9(i);if(a)return b9(a);var s=0,l=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);l&&(s=Number(l[2]),i=l[1]);var f=Number(i);if(isNaN(f))throw new SyntaxError('String "'+i+'" is not a valid number');if(l){if(f>2**s-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));f>=2**(s-1)&&(f=f-2**s)}return f},BigNumber:function(i){return i.toNumber()},Fraction:function(i){return i.valueOf()},Unit:r.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),null:function(i){return 0},"Unit, string | Unit":function(i,a){return i.toNumber(a)},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))});return t.fromJSON=function(n){return parseFloat(n.value)},t});var k1="string",w9=["typed"],R1=T(k1,w9,e=>{var{typed:r}=e;return r(k1,{"":function(){return""},number:Wi,null:function(n){return"null"},boolean:function(n){return n+""},string:function(n){return n},"Array | Matrix":r.referToSelf(t=>n=>Je(n,t)),any:function(n){return String(n)}})});var L1="boolean",D9=["typed"],q1=T(L1,D9,e=>{var{typed:r}=e;return r(L1,{"":function(){return!1},boolean:function(n){return n},number:function(n){return!!n},null:function(n){return!1},BigNumber:function(n){return!n.isZero()},string:function(n){var i=n.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;var a=Number(n);if(n!==""&&!isNaN(a))return!!a;throw new Error('Cannot convert "'+n+'" to a boolean')},"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var S9="bignumber",N9=["typed","BigNumber"],U1=T(S9,N9,e=>{var{typed:r,BigNumber:t}=e;return r("bignumber",{"":function(){return new t(0)},number:function(i){return new t(i+"")},string:function(i){var a=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(a){var s=a[2],l=t(a[1]),f=new t(2).pow(Number(s));if(l.gt(f.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var o=new t(2).pow(Number(s)-1);return l.gte(o)?l.sub(f):l}return new t(i)},BigNumber:function(i){return i},Unit:r.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Fraction:function(i){return new t(i.n).div(i.d).times(i.s)},null:function(i){return new t(0)},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var A9="complex",E9=["typed","Complex"],z1=T(A9,E9,e=>{var{typed:r,Complex:t}=e;return r("complex",{"":function(){return t.ZERO},number:function(i){return new t(i,0)},"number, number":function(i,a){return new t(i,a)},"BigNumber, BigNumber":function(i,a){return new t(i.toNumber(),a.toNumber())},Fraction:function(i){return new t(i.valueOf(),0)},Complex:function(i){return i.clone()},string:function(i){return t(i)},null:function(i){return t(0)},Object:function(i){if("re"in i&&"im"in i)return new t(i.re,i.im);if("r"in i&&"phi"in i||"abs"in i&&"arg"in i)return new t(i);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var C9="fraction",M9=["typed","Fraction"],W1=T(C9,M9,e=>{var{typed:r,Fraction:t}=e;return r("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new t(i)},string:function(i){return new t(i)},"number, number":function(i,a){return new t(i,a)},null:function(i){return new t(0)},BigNumber:function(i){return new t(i.toString())},Fraction:function(i){return i},Unit:r.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Object:function(i){return new t(i)},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var V1="matrix",_9=["typed","Matrix","DenseMatrix","SparseMatrix"],Y1=T(V1,_9,e=>{var{typed:r,Matrix:t,DenseMatrix:n,SparseMatrix:i}=e;return r(V1,{"":function(){return a([])},string:function(l){return a([],l)},"string, string":function(l,f){return a([],l,f)},Array:function(l){return a(l)},Matrix:function(l){return a(l,l.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(s,l,f){if(l==="dense"||l==="default"||l===void 0)return new n(s,f);if(l==="sparse")return new i(s,f);throw new TypeError("Unknown matrix type "+JSON.stringify(l)+".")}});var H1="matrixFromFunction",T9=["typed","matrix","isZero"],G1=T(H1,T9,e=>{var{typed:r,matrix:t,isZero:n}=e;return r(H1,{"Array | Matrix, function, string, string":function(s,l,f,o){return i(s,l,f,o)},"Array | Matrix, function, string":function(s,l,f){return i(s,l,f)},"Matrix, function":function(s,l){return i(s,l,"dense")},"Array, function":function(s,l){return i(s,l,"dense").toArray()},"Array | Matrix, string, function":function(s,l,f){return i(s,f,l)},"Array | Matrix, string, string, function":function(s,l,f,o){return i(s,o,l,f)}});function i(a,s,l,f){var o;return f!==void 0?o=t(l,f):o=t(l),o.resize(a),o.forEach(function(u,p){var h=s(p);n(h)||o.set(p,h)}),o}});var $1="matrixFromRows",F9=["typed","matrix","flatten","size"],Z1=T($1,F9,e=>{var{typed:r,matrix:t,flatten:n,size:i}=e;return r($1,{"...Array":function(f){return a(f)},"...Matrix":function(f){return t(a(f.map(o=>o.toArray())))}});function a(l){if(l.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var f=s(l[0]),o=[];for(var u of l){var p=s(u);if(p!==f)throw new TypeError("The vectors had different length: "+(f|0)+" \\u2260 "+(p|0));o.push(n(u))}return o}function s(l){var f=i(l);if(f.length===1)return f[0];if(f.length===2){if(f[0]===1)return f[1];if(f[1]===1)return f[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}});var Q1="matrixFromColumns",O9=["typed","matrix","flatten","size"],X1=T(Q1,O9,e=>{var{typed:r,matrix:t,flatten:n,size:i}=e;return r(Q1,{"...Array":function(f){return a(f)},"...Matrix":function(f){return t(a(f.map(o=>o.toArray())))}});function a(l){if(l.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var f=s(l[0]),o=[],u=0;u{var{typed:r}=e;return r(J1,{"Unit, Array":function(n,i){return n.splitUnit(i)}})});var j1="unaryMinus",I9=["typed"],eb=T(j1,I9,e=>{var{typed:r}=e;return r(j1,{number:hv,"Complex | BigNumber | Fraction":t=>t.neg(),Unit:r.referToSelf(t=>n=>{var i=n.clone();return i.value=r.find(t,i.valueType())(n.value),i}),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t,!0))})});var rb="unaryPlus",P9=["typed","config","BigNumber"],tb=T(rb,P9,e=>{var{typed:r,config:t,BigNumber:n}=e;return r(rb,{number:dv,Complex:function(a){return a},BigNumber:function(a){return a},Fraction:function(a){return a},Unit:function(a){return a.clone()},"Array | Matrix":r.referToSelf(i=>a=>Je(a,i,!0)),"boolean | string":function(a){return t.number==="BigNumber"?new n(+a):+a}})});var nb="abs",k9=["typed"],ib=T(nb,k9,e=>{var{typed:r}=e;return r(nb,{number:lv,"Complex | BigNumber | Fraction | Unit":t=>t.abs(),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t,!0))})});var ab="apply",R9=["typed","isInteger"],ou=T(ab,R9,e=>{var{typed:r,isInteger:t}=e;return r(ab,{"Array | Matrix, number | BigNumber, function":function(i,a,s){if(!t(a))throw new TypeError("Integer number expected for dimension");var l=Array.isArray(i)?or(i):i.size();if(a<0||a>=l.length)throw new Xt(a,l.length);return Ge(i)?i.create(zc(i.valueOf(),a,s)):zc(i,a,s)}})});function zc(e,r,t){var n,i,a;if(r<=0)if(Array.isArray(e[0])){for(a=L9(e),i=[],n=0;n{var{typed:r}=e;return r(ob,{"number, number":cv,"Complex, Complex":function(n,i){return n.add(i)},"BigNumber, BigNumber":function(n,i){return n.plus(i)},"Fraction, Fraction":function(n,i){return n.add(i)},"Unit, Unit":r.referToSelf(t=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=r.find(t,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})});var ub="subtractScalar",U9=["typed"],fb=T(ub,U9,e=>{var{typed:r}=e;return r(ub,{"number, number":pv,"Complex, Complex":function(n,i){return n.sub(i)},"BigNumber, BigNumber":function(n,i){return n.minus(i)},"Fraction, Fraction":function(n,i){return n.sub(i)},"Unit, Unit":r.referToSelf(t=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=r.find(t,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})});var lb="cbrt",z9=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],cb=T(lb,z9,e=>{var{config:r,typed:t,isNegative:n,unaryMinus:i,matrix:a,Complex:s,BigNumber:l,Fraction:f}=e;return t(lb,{number:nu,Complex:o,"Complex, boolean":o,BigNumber:function(h){return h.cbrt()},Unit:u});function o(p,h){var d=p.arg()/3,x=p.abs(),v=new s(nu(x),0).mul(new s(0,d).exp());if(h){var y=[v,new s(nu(x),0).mul(new s(0,d+Math.PI*2/3).exp()),new s(nu(x),0).mul(new s(0,d-Math.PI*2/3).exp())];return r.matrix==="Array"?y:a(y)}else return v}function u(p){if(p.value&&Gt(p.value)){var h=p.clone();return h.value=1,h=h.pow(1/3),h.value=o(p.value),h}else{var d=n(p.value);d&&(p.value=i(p.value));var x;je(p.value)?x=new l(1).div(3):Jn(p.value)?x=new f(1,3):x=1/3;var v=p.pow(x);return d&&(v.value=i(v.value)),v}}});var W9="matAlgo11xS0s",V9=["typed","equalScalar"],Jr=T(W9,V9,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s,l){var f=i._values,o=i._index,u=i._ptr,p=i._size,h=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=p[0],x=p[1],v,y=t,w=0,C=s;typeof h=="string"&&(v=h,y=r.find(t,[v,v]),w=r.convert(0,v),a=r.convert(a,v),C=r.find(s,[v,v]));for(var b=[],A=[],E=[],S=0;S{var{typed:r,DenseMatrix:t}=e;return function(i,a,s,l){var f=i._values,o=i._index,u=i._ptr,p=i._size,h=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=p[0],x=p[1],v,y=s;typeof h=="string"&&(v=h,a=r.convert(a,v),y=r.find(s,[v,v]));for(var w=[],C=[],b=[],A=0;A{var{typed:r}=e;return function(i,a,s,l){var f=i._data,o=i._size,u=i._datatype,p,h=s;typeof u=="string"&&(p=u,a=r.convert(a,p),h=r.find(s,[p,p]));var d=o.length>0?t(h,0,o,o[0],f,a,l):[];return i.createDenseMatrix({data:d,size:tr(o),datatype:p})};function t(n,i,a,s,l,f,o){var u=[];if(i===a.length-1)for(var p=0;p{var{typed:r,config:t,round:n}=e;return r(sg,{number:function(a){return wt(a,n(a),t.epsilon)?n(a):Math.ceil(a)},"number, number":function(a,s){if(wt(a,n(a,s),t.epsilon))return n(a,s);var[l,f]="".concat(a,"e").split("e"),o=Math.ceil(Number("".concat(l,"e").concat(Number(f)+s)));return[l,f]="".concat(o,"e").split("e"),Number("".concat(l,"e").concat(Number(f)-s))}})}),pb=T(sg,Z9,e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:l}=e,f=Jr({typed:r,equalScalar:a}),o=Lr({typed:r,DenseMatrix:l}),u=Bt({typed:r}),p=Q9({typed:r,config:t,round:n});return r("ceil",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(d){return d.ceil()},"Complex, number":function(d,x){return d.ceil(x)},"Complex, BigNumber":function(d,x){return d.ceil(x.toNumber())},BigNumber:function(d){return Ut(d,n(d),t.epsilon)?n(d):d.ceil()},"BigNumber, BigNumber":function(d,x){return Ut(d,n(d,x),t.epsilon)?n(d,x):d.toDecimalPlaces(x.toNumber(),ts.ROUND_CEIL)},Fraction:function(d){return d.ceil()},"Fraction, number":function(d,x){return d.ceil(x)},"Fraction, BigNumber":function(d,x){return d.ceil(x.toNumber())},"Array | Matrix":r.referToSelf(h=>d=>Je(d,h,!0)),"Array, number | BigNumber":r.referToSelf(h=>(d,x)=>Je(d,v=>h(v,x),!0)),"SparseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>f(d,x,h,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>u(d,x,h,!1)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(h=>(d,x)=>u(i(x),d,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(h=>(d,x)=>a(d,0)?s(x.size(),x.storage()):x.storage()==="dense"?u(x,d,h,!0):o(x,d,h,!0))})});var mb="cube",X9=["typed"],hb=T(mb,X9,e=>{var{typed:r}=e;return r(mb,{number:vv,Complex:function(n){return n.mul(n).mul(n)},BigNumber:function(n){return n.times(n).times(n)},Fraction:function(n){return n.pow(3)},Unit:function(n){return n.pow(3)}})});var db="exp",J9=["typed"],vb=T(db,J9,e=>{var{typed:r}=e;return r(db,{number:gv,Complex:function(n){return n.exp()},BigNumber:function(n){return n.exp()}})});var gb="expm1",K9=["typed","Complex"],xb=T(gb,K9,e=>{var{typed:r,Complex:t}=e;return r(gb,{number:xv,Complex:function(i){var a=Math.exp(i.re);return new t(a*Math.cos(i.im)-1,a*Math.sin(i.im))},BigNumber:function(i){return i.exp().minus(1)}})});var ug="fix",j9=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],e7=T(ug,["typed","ceil","floor"],e=>{var{typed:r,ceil:t,floor:n}=e;return r(ug,{number:function(a){return a>0?n(a):t(a)},"number, number":function(a,s){return a>0?n(a,s):t(a,s)}})}),yb=T(ug,j9,e=>{var{typed:r,Complex:t,matrix:n,ceil:i,floor:a,equalScalar:s,zeros:l,DenseMatrix:f}=e,o=Lr({typed:r,DenseMatrix:f}),u=Bt({typed:r}),p=e7({typed:r,ceil:i,floor:a});return r("fix",{number:p.signatures.number,"number, number | BigNumber":p.signatures["number,number"],Complex:function(d){return new t(d.re>0?Math.floor(d.re):Math.ceil(d.re),d.im>0?Math.floor(d.im):Math.ceil(d.im))},"Complex, number":function(d,x){return new t(d.re>0?a(d.re,x):i(d.re,x),d.im>0?a(d.im,x):i(d.im,x))},"Complex, BigNumber":function(d,x){var v=x.toNumber();return new t(d.re>0?a(d.re,v):i(d.re,v),d.im>0?a(d.im,v):i(d.im,v))},BigNumber:function(d){return d.isNegative()?i(d):a(d)},"BigNumber, number | BigNumber":function(d,x){return d.isNegative()?i(d,x):a(d,x)},Fraction:function(d){return d.s<0?d.ceil():d.floor()},"Fraction, number | BigNumber":function(d,x){return d.s<0?i(d,x):a(d,x)},"Array | Matrix":r.referToSelf(h=>d=>Je(d,h,!0)),"Array | Matrix, number | BigNumber":r.referToSelf(h=>(d,x)=>Je(d,v=>h(v,x),!0)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(h=>(d,x)=>u(n(x),d,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(h=>(d,x)=>s(d,0)?l(x.size(),x.storage()):x.storage()==="dense"?u(x,d,h,!0):o(x,d,h,!0))})});var fg="floor",r7=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],t7=T(fg,["typed","config","round"],e=>{var{typed:r,config:t,round:n}=e;return r(fg,{number:function(a){return wt(a,n(a),t.epsilon)?n(a):Math.floor(a)},"number, number":function(a,s){if(wt(a,n(a,s),t.epsilon))return n(a,s);var[l,f]="".concat(a,"e").split("e"),o=Math.floor(Number("".concat(l,"e").concat(Number(f)+s)));return[l,f]="".concat(o,"e").split("e"),Number("".concat(l,"e").concat(Number(f)-s))}})}),Wc=T(fg,r7,e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:l}=e,f=Jr({typed:r,equalScalar:a}),o=Lr({typed:r,DenseMatrix:l}),u=Bt({typed:r}),p=t7({typed:r,config:t,round:n});return r("floor",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(d){return d.floor()},"Complex, number":function(d,x){return d.floor(x)},"Complex, BigNumber":function(d,x){return d.floor(x.toNumber())},BigNumber:function(d){return Ut(d,n(d),t.epsilon)?n(d):d.floor()},"BigNumber, BigNumber":function(d,x){return Ut(d,n(d,x),t.epsilon)?n(d,x):d.toDecimalPlaces(x.toNumber(),ts.ROUND_FLOOR)},Fraction:function(d){return d.floor()},"Fraction, number":function(d,x){return d.floor(x)},"Fraction, BigNumber":function(d,x){return d.floor(x.toNumber())},"Array | Matrix":r.referToSelf(h=>d=>Je(d,h,!0)),"Array, number | BigNumber":r.referToSelf(h=>(d,x)=>Je(d,v=>h(v,x),!0)),"SparseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>f(d,x,h,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>u(d,x,h,!1)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(h=>(d,x)=>u(i(x),d,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(h=>(d,x)=>a(d,0)?s(x.size(),x.storage()):x.storage()==="dense"?u(x,d,h,!0):o(x,d,h,!0))})});var n7="matAlgo02xDS0",i7=["typed","equalScalar"],It=T(n7,i7,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s,l){var f=i._data,o=i._size,u=i._datatype||i.getDataType(),p=a._values,h=a._index,d=a._ptr,x=a._size,v=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(o.length!==x.length)throw new pr(o.length,x.length);if(o[0]!==x[0]||o[1]!==x[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+x+")");if(!p)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var y=o[0],w=o[1],C,b=t,A=0,E=s;typeof u=="string"&&u===v&&u!=="mixed"&&(C=u,b=r.find(t,[C,C]),A=r.convert(0,C),E=r.find(s,[C,C]));for(var S=[],O=[],F=[],M=0;M{var{typed:r}=e;return function(n,i,a,s){var l=n._data,f=n._size,o=n._datatype||n.getDataType(),u=i._values,p=i._index,h=i._ptr,d=i._size,x=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(f.length!==d.length)throw new pr(f.length,d.length);if(f[0]!==d[0]||f[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+d+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var v=f[0],y=f[1],w,C=0,b=a;typeof o=="string"&&o===x&&o!=="mixed"&&(w=o,C=r.convert(0,w),b=r.find(a,[w,w]));for(var A=[],E=0;E{var{typed:r,equalScalar:t}=e;return function(i,a,s){var l=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,d=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new pr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");var w=u[0],C=u[1],b,A=t,E=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),E=r.convert(0,b),S=r.find(s,[b,b]));var O=l&&h?[]:void 0,F=[],M=[],_=O?[]:void 0,k=O?[]:void 0,L=[],Y=[],$,V,q,R;for(V=0;V{var{typed:r}=e;return function(i,a,s){var l=i._data,f=i._size,o=i._datatype,u=a._data,p=a._size,h=a._datatype,d=[];if(f.length!==p.length)throw new pr(f.length,p.length);for(var x=0;x0?t(y,0,d,d[0],l,u):[];return i.createDenseMatrix({data:w,size:d,datatype:v})};function t(n,i,a,s,l,f){var o=[];if(i===a.length-1)for(var u=0;u{var{concat:r}=e;return function(i,a){var s=Math.max(i._size.length,a._size.length);if(i._size.length===a._size.length&&i._size.every((x,v)=>x===a._size[v]))return[i,a];for(var l=t(i._size,s,0),f=t(a._size,s,0),o=[],u=0;u{var{typed:r,matrix:t,concat:n}=e,i=bb({typed:r}),a=Bt({typed:r}),s=wb({concat:n});return function(f){var o=f.elop,u=f.SD||f.DS,p;o?(p={"DenseMatrix, DenseMatrix":(v,y)=>i(...s(v,y),o),"Array, Array":(v,y)=>i(...s(t(v),t(y)),o).valueOf(),"Array, DenseMatrix":(v,y)=>i(...s(t(v),y),o),"DenseMatrix, Array":(v,y)=>i(...s(v,t(y)),o)},f.SS&&(p["SparseMatrix, SparseMatrix"]=(v,y)=>f.SS(...s(v,y),o,!1)),f.DS&&(p["DenseMatrix, SparseMatrix"]=(v,y)=>f.DS(...s(v,y),o,!1),p["Array, SparseMatrix"]=(v,y)=>f.DS(...s(t(v),y),o,!1)),u&&(p["SparseMatrix, DenseMatrix"]=(v,y)=>u(...s(y,v),o,!0),p["SparseMatrix, Array"]=(v,y)=>u(...s(t(y),v),o,!0))):(p={"DenseMatrix, DenseMatrix":r.referToSelf(v=>(y,w)=>i(...s(y,w),v)),"Array, Array":r.referToSelf(v=>(y,w)=>i(...s(t(y),t(w)),v).valueOf()),"Array, DenseMatrix":r.referToSelf(v=>(y,w)=>i(...s(t(y),w),v)),"DenseMatrix, Array":r.referToSelf(v=>(y,w)=>i(...s(y,t(w)),v))},f.SS&&(p["SparseMatrix, SparseMatrix"]=r.referToSelf(v=>(y,w)=>f.SS(...s(y,w),v,!1))),f.DS&&(p["DenseMatrix, SparseMatrix"]=r.referToSelf(v=>(y,w)=>f.DS(...s(y,w),v,!1)),p["Array, SparseMatrix"]=r.referToSelf(v=>(y,w)=>f.DS(...s(t(y),w),v,!1))),u&&(p["SparseMatrix, DenseMatrix"]=r.referToSelf(v=>(y,w)=>u(...s(w,y),v,!0)),p["SparseMatrix, Array"]=r.referToSelf(v=>(y,w)=>u(...s(t(w),y),v,!0))));var h=f.scalar||"any",d=f.Ds||f.Ss;d&&(o?(p["DenseMatrix,"+h]=(v,y)=>a(v,y,o,!1),p[h+", DenseMatrix"]=(v,y)=>a(y,v,o,!0),p["Array,"+h]=(v,y)=>a(t(v),y,o,!1).valueOf(),p[h+", Array"]=(v,y)=>a(t(y),v,o,!0).valueOf()):(p["DenseMatrix,"+h]=r.referToSelf(v=>(y,w)=>a(y,w,v,!1)),p[h+", DenseMatrix"]=r.referToSelf(v=>(y,w)=>a(w,y,v,!0)),p["Array,"+h]=r.referToSelf(v=>(y,w)=>a(t(y),w,v,!1).valueOf()),p[h+", Array"]=r.referToSelf(v=>(y,w)=>a(t(w),y,v,!0).valueOf())));var x=f.sS!==void 0?f.sS:f.Ss;return o?(f.Ss&&(p["SparseMatrix,"+h]=(v,y)=>f.Ss(v,y,o,!1)),x&&(p[h+", SparseMatrix"]=(v,y)=>x(y,v,o,!0))):(f.Ss&&(p["SparseMatrix,"+h]=r.referToSelf(v=>(y,w)=>f.Ss(y,w,v,!1))),x&&(p[h+", SparseMatrix"]=r.referToSelf(v=>(y,w)=>x(w,y,v,!0)))),o&&o.signatures&&xc(p,o.signatures),p}});var Db="mod",d7=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],Vc=T(Db,d7,e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:l,concat:f}=e,o=Wc({typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:l}),u=It({typed:r,equalScalar:a}),p=ft({typed:r}),h=So({typed:r,equalScalar:a}),d=Jr({typed:r,equalScalar:a}),x=Lr({typed:r,DenseMatrix:l}),v=vr({typed:r,matrix:i,concat:f});return r(Db,{"number, number":y,"BigNumber, BigNumber":function(C,b){return b.isZero()?C:C.sub(b.mul(o(C.div(b))))},"Fraction, Fraction":function(C,b){return b.equals(0)?C:C.sub(b.mul(o(C.div(b))))}},v({SS:h,DS:p,SD:u,Ss:d,sS:x}));function y(w,C){return C===0?w:w-C*o(w/C)}});var v7="matAlgo01xDSid",g7=["typed"],dn=T(v7,g7,e=>{var{typed:r}=e;return function(n,i,a,s){var l=n._data,f=n._size,o=n._datatype||n.getDataType(),u=i._values,p=i._index,h=i._ptr,d=i._size,x=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(f.length!==d.length)throw new pr(f.length,d.length);if(f[0]!==d[0]||f[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+d+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var v=f[0],y=f[1],w=typeof o=="string"&&o!=="mixed"&&o===x?o:void 0,C=w?r.find(a,[w,w]):a,b,A,E=[];for(b=0;b{var{typed:r,equalScalar:t}=e;return function(i,a,s){var l=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,d=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new pr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");var w=u[0],C=u[1],b,A=t,E=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),E=r.convert(0,b),S=r.find(s,[b,b]));var O=l&&h?[]:void 0,F=[],M=[],_=l&&h?[]:void 0,k=l&&h?[]:void 0,L=[],Y=[],$,V,q,R,j;for(V=0;V{var{typed:r,DenseMatrix:t}=e;return function(i,a,s,l){var f=i._values,o=i._index,u=i._ptr,p=i._size,h=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=p[0],x=p[1],v,y=s;typeof h=="string"&&(v=h,a=r.convert(a,v),y=r.find(s,[v,v]));for(var w=[],C=[],b=[],A=0;AArray.isArray(r))}var Ab=T(Sb,D7,e=>{var{typed:r,matrix:t,config:n,round:i,equalScalar:a,zeros:s,BigNumber:l,DenseMatrix:f,concat:o}=e,u=Vc({typed:r,config:n,round:i,matrix:t,equalScalar:a,zeros:s,DenseMatrix:f,concat:o}),p=dn({typed:r}),h=su({typed:r,equalScalar:a}),d=Un({typed:r,DenseMatrix:f}),x=vr({typed:r,matrix:t,concat:o});return r(Sb,{"number, number":v,"BigNumber, BigNumber":y,"Fraction, Fraction":(w,C)=>w.gcd(C)},x({SS:h,DS:p,Ss:d}),{[S7]:r.referToSelf(w=>(C,b,A)=>{for(var E=w(C,b),S=0;SC=>{if(C.length===1&&Array.isArray(C[0])&&Nb(C[0]))return w(...C[0]);if(Nb(C))return w(...C);throw new ei("gcd() supports only 1d matrices!")}),Matrix:r.referToSelf(w=>C=>w(C.toArray()))});function v(w,C){if(!He(w)||!He(C))throw new Error("Parameters in function gcd must be integer numbers");for(var b;C!==0;)b=u(w,C),w=C,C=b;return w<0?-w:w}function y(w,C){if(!w.isInt()||!C.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var b=new l(0);!C.isZero();){var A=u(w,C);w=C,C=A}return w.lt(b)?w.neg():w}});var N7="matAlgo06xS0S0",A7=["typed","equalScalar"],No=T(N7,A7,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s){var l=i._values,f=i._size,o=i._datatype||i._data===void 0?i._datatype:i.getDataType(),u=a._values,p=a._size,h=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(f.length!==p.length)throw new pr(f.length,p.length);if(f[0]!==p[0]||f[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+p+")");var d=f[0],x=f[1],v,y=t,w=0,C=s;typeof o=="string"&&o===h&&o!=="mixed"&&(v=o,y=r.find(t,[v,v]),w=r.convert(0,v),C=r.find(s,[v,v]));for(var b=l&&u?[]:void 0,A=[],E=[],S=b?[]:void 0,O=[],F=[],M=0;M{var{typed:r,matrix:t,equalScalar:n,concat:i}=e,a=It({typed:r,equalScalar:n}),s=No({typed:r,equalScalar:n}),l=Jr({typed:r,equalScalar:n}),f=vr({typed:r,matrix:t,concat:i}),o="number | BigNumber | Fraction | Matrix | Array",u={};return u["".concat(o,", ").concat(o,", ...").concat(o)]=r.referToSelf(h=>(d,x,v)=>{for(var y=h(d,x),w=0;wh.lcm(d)},f({SS:s,DS:a,Ss:l}),u);function p(h,d){if(!h.isInt()||!d.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(h.isZero())return h;if(d.isZero())return d;for(var x=h.times(d);!d.isZero();){var v=d;d=h.mod(v),h=v}return x.div(h).abs()}});var Mb="log10",C7=["typed","config","Complex"],_b=T(Mb,C7,e=>{var{typed:r,config:t,Complex:n}=e;return r(Mb,{number:function(a){return a>=0||t.predictable?bv(a):new n(a,0).log().div(Math.LN10)},Complex:function(a){return new n(a).log().div(Math.LN10)},BigNumber:function(a){return!a.isNegative()||t.predictable?a.log():new n(a.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":r.referToSelf(i=>a=>Je(a,i))})});var Tb="log2",M7=["typed","config","Complex"],Fb=T(Tb,M7,e=>{var{typed:r,config:t,Complex:n}=e;return r(Tb,{number:function(s){return s>=0||t.predictable?wv(s):i(new n(s,0))},Complex:i,BigNumber:function(s){return!s.isNegative()||t.predictable?s.log(2):i(new n(s.toNumber(),0))},"Array | Matrix":r.referToSelf(a=>s=>Je(s,a))});function i(a){var s=Math.sqrt(a.re*a.re+a.im*a.im);return new n(Math.log2?Math.log2(s):Math.log(s)/Math.LN2,Math.atan2(a.im,a.re)/Math.LN2)}});var _7="multiplyScalar",T7=["typed"],Ob=T(_7,T7,e=>{var{typed:r}=e;return r("multiplyScalar",{"number, number":mv,"Complex, Complex":function(n,i){return n.mul(i)},"BigNumber, BigNumber":function(n,i){return n.times(i)},"Fraction, Fraction":function(n,i){return n.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(t,n)=>n.multiply(t),"Unit, number | Fraction | BigNumber | Complex | Unit":(t,n)=>t.multiply(n)})});var Bb="multiply",F7=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],Ib=T(Bb,F7,e=>{var{typed:r,matrix:t,addScalar:n,multiplyScalar:i,equalScalar:a,dot:s}=e,l=Jr({typed:r,equalScalar:a}),f=Bt({typed:r});function o(E,S){switch(E.length){case 1:switch(S.length){case 1:if(E[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(E[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+E[0]+") must match Matrix rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;case 2:switch(S.length){case 1:if(E[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+E[1]+") must match Vector length ("+S[0]+")");break;case 2:if(E[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+E[1]+") must match Matrix B rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+E.length+" dimensions)")}}function u(E,S,O){if(O===0)throw new Error("Cannot multiply two empty vectors");return s(E,S)}function p(E,S){if(S.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return h(E,S)}function h(E,S){var O=E._data,F=E._size,M=E._datatype||E.getDataType(),_=S._data,k=S._size,L=S._datatype||S.getDataType(),Y=F[0],$=k[1],V,q=n,R=i;M&&L&&M===L&&typeof M=="string"&&M!=="mixed"&&(V=M,q=r.find(n,[V,V]),R=r.find(i,[V,V]));for(var j=[],U=0;U<$;U++){for(var oe=R(O[0],_[0][U]),me=1;mege)for(var xe=0,be=0;be(S,O)=>{o(or(S),or(O));var F=E(t(S),t(O));return Ge(F)?F.valueOf():F}),"Matrix, Matrix":function(S,O){var F=S.size(),M=O.size();return o(F,M),F.length===1?M.length===1?u(S,O,F[0]):p(S,O):M.length===1?d(S,O):x(S,O)},"Matrix, Array":r.referTo("Matrix,Matrix",E=>(S,O)=>E(S,t(O))),"Array, Matrix":r.referToSelf(E=>(S,O)=>E(t(S,O.storage()),O)),"SparseMatrix, any":function(S,O){return l(S,O,i,!1)},"DenseMatrix, any":function(S,O){return f(S,O,i,!1)},"any, SparseMatrix":function(S,O){return l(O,S,i,!0)},"any, DenseMatrix":function(S,O){return f(O,S,i,!0)},"Array, any":function(S,O){return f(t(S),O,i,!1).valueOf()},"any, Array":function(S,O){return f(t(O),S,i,!0).valueOf()},"any, any":i,"any, any, ...any":r.referToSelf(E=>(S,O,F)=>{for(var M=E(S,O),_=0;_{var{typed:r,matrix:t,equalScalar:n,BigNumber:i,concat:a}=e,s=dn({typed:r}),l=It({typed:r,equalScalar:n}),f=No({typed:r,equalScalar:n}),o=Jr({typed:r,equalScalar:n}),u=vr({typed:r,matrix:t,concat:a});function p(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return r(Pb,{number:Dv,"number, number":Dv,BigNumber:d=>h(d,new i(2)),"BigNumber, BigNumber":h,Complex:p,"Complex, number":p,Array:r.referTo("DenseMatrix,number",d=>x=>d(t(x),2).valueOf()),DenseMatrix:r.referTo("DenseMatrix,number",d=>x=>d(x,2)),SparseMatrix:r.referTo("SparseMatrix,number",d=>x=>d(x,2)),"SparseMatrix, SparseMatrix":r.referToSelf(d=>(x,v)=>{if(v.density()===1)return f(x,v,d);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":r.referToSelf(d=>(x,v)=>{if(v.density()===1)return s(x,v,d,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":r.referTo("DenseMatrix,SparseMatrix",d=>(x,v)=>d(t(x),v)),"number | BigNumber, SparseMatrix":r.referToSelf(d=>(x,v)=>{if(v.density()===1)return o(v,x,d,!0);throw new Error("Root must be non-zero")})},u({scalar:"number | BigNumber",SD:l,Ss:o,sS:!1}));function h(d,x){var v=i.precision,y=i.clone({precision:v+2}),w=new i(0),C=new y(1),b=x.isNegative();if(b&&(x=x.neg()),x.isZero())throw new Error("Root must be non-zero");if(d.isNegative()&&!x.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(d.isZero())return b?new y(1/0):0;if(!d.isFinite())return b?w:d;var A=d.abs().pow(C.div(x));return A=d.isNeg()?A.neg():A,new i((b?C.div(A):A).toPrecision(v))}});var Rb="sign",B7=["typed","BigNumber","Fraction","complex"],Lb=T(Rb,B7,e=>{var{typed:r,BigNumber:t,complex:n,Fraction:i}=e;return r(Rb,{number:qc,Complex:function(s){return s.im===0?n(qc(s.re)):s.sign()},BigNumber:function(s){return new t(s.cmp(0))},Fraction:function(s){return new i(s.s,1)},"Array | Matrix":r.referToSelf(a=>s=>Je(s,a,!0)),Unit:r.referToSelf(a=>s=>{if(!s._isDerived()&&s.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return r.find(a,s.valueType())(s.value)})})});var I7="sqrt",P7=["config","typed","Complex"],qb=T(I7,P7,e=>{var{config:r,typed:t,Complex:n}=e;return t("sqrt",{number:i,Complex:function(s){return s.sqrt()},BigNumber:function(s){return!s.isNegative()||r.predictable?s.sqrt():i(s.toNumber())},Unit:function(s){return s.pow(.5)}});function i(a){return isNaN(a)?NaN:a>=0||r.predictable?Math.sqrt(a):new n(a,0).sqrt()}});var Ub="square",k7=["typed"],zb=T(Ub,k7,e=>{var{typed:r}=e;return r(Ub,{number:Sv,Complex:function(n){return n.mul(n)},BigNumber:function(n){return n.times(n)},Fraction:function(n){return n.mul(n)},Unit:function(n){return n.pow(2)}})});var Wb="subtract",R7=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],Vb=T(Wb,R7,e=>{var{typed:r,matrix:t,equalScalar:n,subtractScalar:i,unaryMinus:a,DenseMatrix:s,concat:l}=e,f=dn({typed:r}),o=ft({typed:r}),u=So({typed:r,equalScalar:n}),p=Un({typed:r,DenseMatrix:s}),h=Lr({typed:r,DenseMatrix:s}),d=vr({typed:r,matrix:t,concat:l});return r(Wb,{"any, any":i},d({elop:i,SS:u,DS:f,SD:o,Ss:h,sS:p}))});var Yb="xgcd",L7=["typed","config","matrix","BigNumber"],Hb=T(Yb,L7,e=>{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r(Yb,{"number, number":function(l,f){var o=Nv(l,f);return t.matrix==="Array"?o:n(o)},"BigNumber, BigNumber":a});function a(s,l){var f,o,u,p=new i(0),h=new i(1),d=p,x=h,v=h,y=p;if(!s.isInt()||!l.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!l.isZero();)o=s.div(l).floor(),u=s.mod(l),f=d,d=x.minus(o.times(d)),x=f,f=v,v=y.minus(o.times(v)),y=f,s=l,l=u;var w;return s.lt(p)?w=[s.neg(),x.neg(),y.neg()]:w=[s,s.isZero()?0:x,y],t.matrix==="Array"?w:n(w)}});var Gb="invmod",q7=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],$b=T(Gb,q7,e=>{var{typed:r,config:t,BigNumber:n,xgcd:i,equal:a,smaller:s,mod:l,add:f,isInteger:o}=e;return r(Gb,{"number, number":u,"BigNumber, BigNumber":u});function u(p,h){if(!o(p)||!o(h))throw new Error("Parameters in function invmod must be integer numbers");if(p=l(p,h),a(h,0))throw new Error("Divisor must be non zero");var d=i(p,h);d=d.valueOf();var[x,v]=d;return a(x,n(1))?(v=l(v,h),s(v,n(0))&&(v=f(v,h)),v):NaN}});var U7="matAlgo09xS0Sf",z7=["typed","equalScalar"],Yc=T(U7,z7,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s){var l=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,d=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new pr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");var w=u[0],C=u[1],b,A=t,E=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),E=r.convert(0,b),S=r.find(s,[b,b]));var O=l&&h?[]:void 0,F=[],M=[],_=O?[]:void 0,k=[],L,Y,$,V,q;for(Y=0;Y{var{typed:r,matrix:t,equalScalar:n,multiplyScalar:i,concat:a}=e,s=It({typed:r,equalScalar:n}),l=Yc({typed:r,equalScalar:n}),f=Jr({typed:r,equalScalar:n}),o=vr({typed:r,matrix:t,concat:a});return r(Zb,o({elop:i,SS:l,DS:s,Ss:f}))});function Xb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitAnd");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);if(e.isZero()||r.eq(-1)||e.eq(r))return e;if(r.isZero()||e.eq(-1))return r;if(!e.isFinite()||!r.isFinite()){if(!e.isFinite()&&!r.isFinite())return e.isNegative()===r.isNegative()?e:new t(0);if(!e.isFinite())return r.isNegative()?e:e.isNegative()?new t(0):r;if(!r.isFinite())return e.isNegative()?r:r.isNegative()?new t(0):e}return cg(e,r,function(n,i){return n&i})}function uu(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var r=e.constructor,t=r.precision;r.config({precision:1e9});var n=e.plus(new r(1));return n.s=-n.s||null,r.config({precision:t}),n}function Jb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitOr");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);var n=new t(-1);return e.isZero()||r.eq(n)||e.eq(r)?r:r.isZero()||e.eq(n)?e:!e.isFinite()||!r.isFinite()?!e.isFinite()&&!e.isNegative()&&r.isNegative()||e.isNegative()&&!r.isNegative()&&!r.isFinite()?n:e.isNegative()&&r.isNegative()?e.isFinite()?e:r:e.isFinite()?r:e:cg(e,r,function(i,a){return i|a})}function cg(e,r,t){var n=e.constructor,i,a,s=+(e.s<0),l=+(r.s<0);if(s){i=Hc(uu(e));for(var f=0;f0;)t(u[--d],p[--x])===v&&(y=y.plus(w)),w=w.times(C);for(;x>0;)t(h,p[--x])===v&&(y=y.plus(w)),w=w.times(C);return n.config({precision:b}),v===0&&(y.s=-y.s),y}function Hc(e){for(var r=e.d,t=r[0]+"",n=1;n0)if(++l>o)for(l-=o;l--;)f+="0";else l1&&((u[d+1]===null||u[d+1]===void 0)&&(u[d+1]=0),u[d+1]+=u[d]>>1,u[d]&=1)}return u.reverse()}function Kb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitXor");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);if(e.isZero())return r;if(r.isZero())return e;if(e.eq(r))return new t(0);var n=new t(-1);return e.eq(n)?uu(r):r.eq(n)?uu(e):!e.isFinite()||!r.isFinite()?!e.isFinite()&&!r.isFinite()?n:new t(e.isNegative()===r.isNegative()?1/0:-1/0):cg(e,r,function(i,a){return i^a})}function jb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function leftShift");var t=e.constructor;return e.isNaN()||r.isNaN()||r.isNegative()&&!r.isZero()?new t(NaN):e.isZero()||r.isZero()?e:!e.isFinite()&&!r.isFinite()?new t(NaN):r.lt(55)?e.times(Math.pow(2,r.toNumber())+""):e.times(new t(2).pow(r))}function ew(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function rightArithShift");var t=e.constructor;return e.isNaN()||r.isNaN()||r.isNegative()&&!r.isZero()?new t(NaN):e.isZero()||r.isZero()?e:r.isFinite()?r.lt(55)?e.div(Math.pow(2,r.toNumber())+"").floor():e.div(new t(2).pow(r)).floor():e.isNegative()?new t(-1):e.isFinite()?new t(0):new t(NaN)}var rw="bitAnd",V7=["typed","matrix","equalScalar","concat"],Gc=T(rw,V7,e=>{var{typed:r,matrix:t,equalScalar:n,concat:i}=e,a=It({typed:r,equalScalar:n}),s=No({typed:r,equalScalar:n}),l=Jr({typed:r,equalScalar:n}),f=vr({typed:r,matrix:t,concat:i});return r(rw,{"number, number":Ev,"BigNumber, BigNumber":Xb},f({SS:s,DS:a,Ss:l}))});var tw="bitNot",Y7=["typed"],nw=T(tw,Y7,e=>{var{typed:r}=e;return r(tw,{number:Cv,BigNumber:uu,"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var iw="bitOr",H7=["typed","matrix","equalScalar","DenseMatrix","concat"],$c=T(iw,H7,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=dn({typed:r}),l=su({typed:r,equalScalar:n}),f=Un({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:t,concat:a});return r(iw,{"number, number":Mv,"BigNumber, BigNumber":Jb},o({SS:l,DS:s,Ss:f}))});var G7="matAlgo07xSSf",$7=["typed","DenseMatrix"],Vt=T(G7,$7,e=>{var{typed:r,DenseMatrix:t}=e;return function(a,s,l){var f=a._size,o=a._datatype||a._data===void 0?a._datatype:a.getDataType(),u=s._size,p=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(f.length!==u.length)throw new pr(f.length,u.length);if(f[0]!==u[0]||f[1]!==u[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+u+")");var h=f[0],d=f[1],x,v=0,y=l;typeof o=="string"&&o===p&&o!=="mixed"&&(x=o,v=r.convert(0,x),y=r.find(l,[x,x]));var w,C,b=[];for(w=0;w{var{typed:r,matrix:t,DenseMatrix:n,concat:i}=e,a=ft({typed:r}),s=Vt({typed:r,DenseMatrix:n}),l=Lr({typed:r,DenseMatrix:n}),f=vr({typed:r,matrix:t,concat:i});return r(aw,{"number, number":_v,"BigNumber, BigNumber":Kb},f({SS:s,DS:a,Ss:l}))});var sw="arg",Q7=["typed"],uw=T(sw,Q7,e=>{var{typed:r}=e;return r(sw,{number:function(n){return Math.atan2(0,n)},BigNumber:function(n){return n.constructor.atan2(0,n)},Complex:function(n){return n.arg()},"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var fw="conj",X7=["typed"],lw=T(fw,X7,e=>{var{typed:r}=e;return r(fw,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.conjugate(),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var cw="im",J7=["typed"],pw=T(cw,J7,e=>{var{typed:r}=e;return r(cw,{number:()=>0,"BigNumber | Fraction":t=>t.mul(0),Complex:t=>t.im,"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var mw="re",K7=["typed"],hw=T(mw,K7,e=>{var{typed:r}=e;return r(mw,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.re,"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var dw="not",j7=["typed"],vw=T(dw,j7,e=>{var{typed:r}=e;return r(dw,{"null | undefined":()=>!0,number:Pv,Complex:function(n){return n.re===0&&n.im===0},BigNumber:function(n){return n.isZero()||n.isNaN()},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var gw="or",eL=["typed","matrix","equalScalar","DenseMatrix","concat"],Zc=T(gw,eL,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),l=So({typed:r,equalScalar:n}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:t,concat:a});return r(gw,{"number, number":kv,"Complex, Complex":function(p,h){return p.re!==0||p.im!==0||h.re!==0||h.im!==0},"BigNumber, BigNumber":function(p,h){return!p.isZero()&&!p.isNaN()||!h.isZero()&&!h.isNaN()},"Unit, Unit":r.referToSelf(u=>(p,h)=>u(p.value||0,h.value||0))},o({SS:l,DS:s,Ss:f}))});var xw="xor",rL=["typed","matrix","DenseMatrix","concat"],yw=T(xw,rL,e=>{var{typed:r,matrix:t,DenseMatrix:n,concat:i}=e,a=ft({typed:r}),s=Vt({typed:r,DenseMatrix:n}),l=Lr({typed:r,DenseMatrix:n}),f=vr({typed:r,matrix:t,concat:i});return r(xw,{"number, number":Rv,"Complex, Complex":function(u,p){return(u.re!==0||u.im!==0)!=(p.re!==0||p.im!==0)},"BigNumber, BigNumber":function(u,p){return(!u.isZero()&&!u.isNaN())!=(!p.isZero()&&!p.isNaN())},"Unit, Unit":r.referToSelf(o=>(u,p)=>o(u.value||0,p.value||0))},f({SS:s,DS:a,Ss:l}))});var bw="concat",tL=["typed","matrix","isInteger"],Qc=T(bw,tL,e=>{var{typed:r,matrix:t,isInteger:n}=e;return r(bw,{"...Array | Matrix | number | BigNumber":function(a){var s,l=a.length,f=-1,o,u=!1,p=[];for(s=0;s0&&f>o)throw new Xt(f,o+1)}else{var d=tr(h).valueOf(),x=or(d);if(p[s]=d,o=f,f=x.length-1,s>0&&f!==o)throw new pr(o+1,f+1)}}if(p.length===0)throw new SyntaxError("At least one matrix expected");for(var v=p.shift();p.length;)v=Zd(v,p.shift(),f);return u?t(v):v},"...string":function(a){return a.join("")}})});var ww="column",nL=["typed","Index","matrix","range"],Xc=T(ww,nL,e=>{var{typed:r,Index:t,matrix:n,range:i}=e;return r(ww,{"Matrix, number":a,"Array, number":function(l,f){return a(n(tr(l)),f).valueOf()}});function a(s,l){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");Xr(l,s.size()[1]);var f=i(0,s.size()[0]),o=new t(f,l),u=s.subset(o);return Ge(u)?u:n([[u]])}});var Dw="count",iL=["typed","size","prod"],Sw=T(Dw,iL,e=>{var{typed:r,size:t,prod:n}=e;return r(Dw,{string:function(a){return a.length},"Matrix | Array":function(a){return n(t(a))}})});var Nw="cross",aL=["typed","matrix","subtract","multiply"],Aw=T(Nw,aL,e=>{var{typed:r,matrix:t,subtract:n,multiply:i}=e;return r(Nw,{"Matrix, Matrix":function(l,f){return t(a(l.toArray(),f.toArray()))},"Matrix, Array":function(l,f){return t(a(l.toArray(),f))},"Array, Matrix":function(l,f){return t(a(l,f.toArray()))},"Array, Array":a});function a(s,l){var f=Math.max(or(s).length,or(l).length);s=Js(s),l=Js(l);var o=or(s),u=or(l);if(o.length!==1||u.length!==1||o[0]!==3||u[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+o.join(", ")+"], B = ["+u.join(", ")+"])");var p=[n(i(s[1],l[2]),i(s[2],l[1])),n(i(s[2],l[0]),i(s[0],l[2])),n(i(s[0],l[1]),i(s[1],l[0]))];return f>1?[p]:p}});var Ew="diag",oL=["typed","matrix","DenseMatrix","SparseMatrix"],Cw=T(Ew,oL,e=>{var{typed:r,matrix:t,DenseMatrix:n,SparseMatrix:i}=e;return r(Ew,{Array:function(o){return a(o,0,or(o),null)},"Array, number":function(o,u){return a(o,u,or(o),null)},"Array, BigNumber":function(o,u){return a(o,u.toNumber(),or(o),null)},"Array, string":function(o,u){return a(o,0,or(o),u)},"Array, number, string":function(o,u,p){return a(o,u,or(o),p)},"Array, BigNumber, string":function(o,u,p){return a(o,u.toNumber(),or(o),p)},Matrix:function(o){return a(o,0,o.size(),o.storage())},"Matrix, number":function(o,u){return a(o,u,o.size(),o.storage())},"Matrix, BigNumber":function(o,u){return a(o,u.toNumber(),o.size(),o.storage())},"Matrix, string":function(o,u){return a(o,0,o.size(),u)},"Matrix, number, string":function(o,u,p){return a(o,u,o.size(),p)},"Matrix, BigNumber, string":function(o,u,p){return a(o,u.toNumber(),o.size(),p)}});function a(f,o,u,p){if(!He(o))throw new TypeError("Second parameter in function diag must be an integer");var h=o>0?o:0,d=o<0?-o:0;switch(u.length){case 1:return s(f,o,p,u[0],d,h);case 2:return l(f,o,p,u,d,h)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function s(f,o,u,p,h,d){var x=[p+h,p+d];if(u&&u!=="sparse"&&u!=="dense")throw new TypeError("Unknown matrix type ".concat(u,'"'));var v=u==="sparse"?i.diagonal(x,f,o):n.diagonal(x,f,o);return u!==null?v:v.valueOf()}function l(f,o,u,p,h,d){if(Ge(f)){var x=f.diagonal(o);return u!==null?u!==x.storage()?t(x,u):x:x.valueOf()}for(var v=Math.min(p[0]-h,p[1]-d),y=[],w=0;w=2&&v.push("index: ".concat(_r(t))),d.length>=3&&v.push("array: ".concat(_r(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(e.name,"(").concat(v.join(", "),") at index ").concat(JSON.stringify(t)))}else throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(y.message))}}}var sL="filter",uL=["typed"],_w=T(sL,uL,e=>{var{typed:r}=e;return r("filter",{"Array, function":Mw,"Matrix, function":function(n,i){return n.create(Mw(n.toArray(),i))},"Array, RegExp":Ks,"Matrix, RegExp":function(n,i){return n.create(Ks(n.toArray(),i))}})});function Mw(e,r){return Ec(e,function(t,n,i){return gi(r,t,[n],i,"filter")})}var Tw="flatten",fL=["typed","matrix"],Fw=T(Tw,fL,e=>{var{typed:r,matrix:t}=e;return r(Tw,{Array:function(i){return gr(i)},Matrix:function(i){var a=gr(i.toArray());return t(a)}})});var Ow="forEach",lL=["typed"],Bw=T(Ow,lL,e=>{var{typed:r}=e;return r(Ow,{"Array, function":cL,"Matrix, function":function(n,i){n.forEach(i)}})});function cL(e,r){var t=function n(i,a){if(Array.isArray(i))ho(i,function(s,l){n(s,a.concat(l))});else return gi(r,i,a,e,"forEach")};t(e,[])}var Iw="getMatrixDataType",pL=["typed"],Pw=T(Iw,pL,e=>{var{typed:r}=e;return r(Iw,{Array:function(n){return vo(n,_r)},Matrix:function(n){return n.getDataType()}})});var kw="identity",mL=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],Rw=T(kw,mL,e=>{var{typed:r,config:t,matrix:n,BigNumber:i,DenseMatrix:a,SparseMatrix:s}=e;return r(kw,{"":function(){return t.matrix==="Matrix"?n([]):[]},string:function(u){return n(u)},"number | BigNumber":function(u){return f(u,u,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(u,p){return f(u,u,p)},"number | BigNumber, number | BigNumber":function(u,p){return f(u,p,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(u,p,h){return f(u,p,h)},Array:function(u){return l(u)},"Array, string":function(u,p){return l(u,p)},Matrix:function(u){return l(u.valueOf(),u.storage())},"Matrix, string":function(u,p){return l(u.valueOf(),p)}});function l(o,u){switch(o.length){case 0:return u?n(u):[];case 1:return f(o[0],o[0],u);case 2:return f(o[0],o[1],u);default:throw new Error("Vector containing two values expected")}}function f(o,u,p){var h=je(o)||je(u)?i:null;if(je(o)&&(o=o.toNumber()),je(u)&&(u=u.toNumber()),!He(o)||o<1)throw new Error("Parameters in function identity must be positive integers");if(!He(u)||u<1)throw new Error("Parameters in function identity must be positive integers");var d=h?new i(1):1,x=h?new h(0):0,v=[o,u];if(p){if(p==="sparse")return s.diagonal(v,d,0,x);if(p==="dense")return a.diagonal(v,d,0,x);throw new TypeError('Unknown matrix type "'.concat(p,'"'))}for(var y=Vi([],v,x),w=o{var{typed:r,matrix:t,multiplyScalar:n}=e;return r(Lw,{"Matrix, Matrix":function(s,l){return t(i(s.toArray(),l.toArray()))},"Matrix, Array":function(s,l){return t(i(s.toArray(),l))},"Array, Matrix":function(s,l){return t(i(s,l.toArray()))},"Array, Array":i});function i(a,s){if(or(a).length===1&&(a=[a]),or(s).length===1&&(s=[s]),or(a).length>2||or(s).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(a.length)+", y = "+JSON.stringify(s.length)+")");var l=[],f=[];return a.map(function(o){return s.map(function(u){return f=[],l.push(f),o.map(function(p){return u.map(function(h){return f.push(n(p,h))})})})})&&l}});var Uw="map",dL=["typed"],zw=T(Uw,dL,e=>{var{typed:r}=e;return r(Uw,{"Array, function":vL,"Matrix, function":function(n,i){return n.map(i)}})});function vL(e,r){var t=function n(i,a){return Array.isArray(i)?i.map(function(s,l){return n(s,a.concat(l))}):gi(r,i,a,e,"map")};return t(e,[])}var Ww="diff",gL=["typed","matrix","subtract","number"],Jc=T(Ww,gL,e=>{var{typed:r,matrix:t,subtract:n,number:i}=e;return r(Ww,{"Array | Matrix":function(u){return Ge(u)?t(s(u.toArray())):s(u)},"Array | Matrix, number":function(u,p){if(!He(p))throw new RangeError("Dimension must be a whole number");return Ge(u)?t(a(u.toArray(),p)):a(u,p)},"Array, BigNumber":r.referTo("Array,number",o=>(u,p)=>o(u,i(p))),"Matrix, BigNumber":r.referTo("Matrix,number",o=>(u,p)=>o(u,i(p)))});function a(o,u){if(Ge(o)&&(o=o.toArray()),!Array.isArray(o))throw RangeError("Array/Matrix does not have that many dimensions");if(u>0){var p=[];return o.forEach(h=>{p.push(a(h,u-1))}),p}else{if(u===0)return s(o);throw RangeError("Cannot have negative dimension")}}function s(o){for(var u=[],p=o.length,h=1;h{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r("ones",{"":function(){return t.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(o){var u=o[o.length-1];if(typeof u=="string"){var p=o.pop();return a(o,p)}else return t.matrix==="Array"?a(o):a(o,"default")},Array:a,Matrix:function(o){var u=o.storage();return a(o.valueOf(),u)},"Array | Matrix, string":function(o,u){return a(o.valueOf(),u)}});function a(f,o){var u=s(f),p=u?new i(1):1;if(l(f),o){var h=n(o);return f.length>0?h.resize(f,p):h}else{var d=[];return f.length>0?Vi(d,f,p):d}}function s(f){var o=!1;return f.forEach(function(u,p,h){je(u)&&(o=!0,h[p]=u.toNumber())}),o}function l(f){f.forEach(function(o){if(typeof o!="number"||!He(o)||o<0)throw new Error("Parameters in function ones must be positive integers")})}});function fu(){throw new Error('No "bignumber" implementation available')}function Kc(){throw new Error('No "fraction" implementation available')}function jc(){throw new Error('No "matrix" implementation available')}var Yw="range",bL=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],ep=T(Yw,bL,e=>{var{typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:l,largerEq:f,add:o,isPositive:u}=e;return r(Yw,{string:h,"string, boolean":h,"number, number":function(y,w){return p(d(y,w,1,!1))},"number, number, number":function(y,w,C){return p(d(y,w,C,!1))},"number, number, boolean":function(y,w,C){return p(d(y,w,1,C))},"number, number, number, boolean":function(y,w,C,b){return p(d(y,w,C,b))},"BigNumber, BigNumber":function(y,w){var C=y.constructor;return p(d(y,w,new C(1),!1))},"BigNumber, BigNumber, BigNumber":function(y,w,C){return p(d(y,w,C,!1))},"BigNumber, BigNumber, boolean":function(y,w,C){var b=y.constructor;return p(d(y,w,new b(1),C))},"BigNumber, BigNumber, BigNumber, boolean":function(y,w,C,b){return p(d(y,w,C,b))},"Unit, Unit, Unit":function(y,w,C){return p(d(y,w,C,!1))},"Unit, Unit, Unit, boolean":function(y,w,C,b){return p(d(y,w,C,b))}});function p(v){return t.matrix==="Matrix"?n?n(v):jc():v}function h(v,y){var w=x(v);if(!w)throw new SyntaxError('String "'+v+'" is no valid range');return t.number==="BigNumber"?(i===void 0&&fu(),p(d(i(w.start),i(w.end),i(w.step)),y)):p(d(w.start,w.end,w.step,y))}function d(v,y,w,C){for(var b=[],A=u(w)?C?s:a:C?f:l,E=v;A(E,y);)b.push(E),E=o(E,w);return b}function x(v){var y=v.split(":"),w=y.map(function(b){return Number(b)}),C=w.some(function(b){return isNaN(b)});if(C)return null;switch(w.length){case 2:return{start:w[0],end:w[1],step:1};case 3:return{start:w[0],end:w[2],step:w[1]};default:return null}}});var Hw="reshape",wL=["typed","isInteger","matrix"],Gw=T(Hw,wL,e=>{var{typed:r,isInteger:t}=e;return r(Hw,{"Matrix, Array":function(i,a){return i.reshape(a,!0)},"Array, Array":function(i,a){return a.forEach(function(s){if(!t(s))throw new TypeError("Invalid size for dimension: "+s)}),xf(i,a)}})});var DL="resize",SL=["config","matrix"],$w=T(DL,SL,e=>{var{config:r,matrix:t}=e;return function(a,s,l){if(arguments.length!==2&&arguments.length!==3)throw new ei("resize",arguments.length,2,3);if(Ge(s)&&(s=s.valueOf()),je(s[0])&&(s=s.map(function(u){return je(u)?u.toNumber():u})),Ge(a))return a.resize(s,l,!0);if(typeof a=="string")return n(a,s,l);var f=Array.isArray(a)?!1:r.matrix!=="Array";if(s.length===0){for(;Array.isArray(a);)a=a[0];return tr(a)}else{Array.isArray(a)||(a=[a]),a=tr(a);var o=Vi(a,s,l);return f?t(o):o}};function n(i,a,s){if(s!==void 0){if(typeof s!="string"||s.length!==1)throw new TypeError("Single character expected as defaultValue")}else s=" ";if(a.length!==1)throw new pr(a.length,1);var l=a[0];if(typeof l!="number"||!He(l))throw new TypeError("Invalid size, must contain positive integers (size: "+lr(a)+")");if(i.length>l)return i.substring(0,l);if(i.length{var{typed:r,multiply:t,rotationMatrix:n}=e;return r(Zw,{"Array , number | BigNumber | Complex | Unit":function(s,l){i(s,2);var f=t(n(l),s);return f.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(s,l){return i(s,2),t(n(l),s)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(s,l,f){i(s,3);var o=t(n(l,f),s);return o},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(s,l,f){return i(s,3),t(n(l,f),s)}});function i(a,s){var l=Array.isArray(a)?or(a):a.size();if(l.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(s));if(l.length===2&&l[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(s));if(l[0]!==s)throw new RangeError("Vector must be of dimensions 1x".concat(s))}});var Xw="rotationMatrix",AL=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],Jw=T(Xw,AL,e=>{var{typed:r,config:t,multiplyScalar:n,addScalar:i,unaryMinus:a,norm:s,BigNumber:l,matrix:f,DenseMatrix:o,SparseMatrix:u,cos:p,sin:h}=e;return r(Xw,{"":function(){return t.matrix==="Matrix"?f([]):[]},string:function(b){return f(b)},"number | BigNumber | Complex | Unit":function(b){return d(b,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(b,A){return d(b,A)},"number | BigNumber | Complex | Unit, Array":function(b,A){var E=f(A);return x(E),w(b,E,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(b,A){x(A);var E=A.storage()||(t.matrix==="Matrix"?"dense":void 0);return w(b,A,E)},"number | BigNumber | Complex | Unit, Array, string":function(b,A,E){var S=f(A);return x(S),w(b,S,E)},"number | BigNumber | Complex | Unit, Matrix, string":function(b,A,E){return x(A),w(b,A,E)}});function d(C,b){var A=je(C),E=A?new l(-1):-1,S=p(C),O=h(C),F=[[S,n(E,O)],[O,S]];return y(F,b)}function x(C){var b=C.size();if(b.length<1||b[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function v(C){return C.reduce((b,A)=>n(b,A))}function y(C,b){if(b){if(b==="sparse")return new u(C);if(b==="dense")return new o(C);throw new TypeError('Unknown matrix type "'.concat(b,'"'))}return C}function w(C,b,A){var E=s(b);if(E===0)throw new RangeError("Rotation around zero vector");var S=je(C)?l:null,O=S?new S(1):1,F=S?new S(-1):-1,M=S?new S(b.get([0])/E):b.get([0])/E,_=S?new S(b.get([1])/E):b.get([1])/E,k=S?new S(b.get([2])/E):b.get([2])/E,L=p(C),Y=i(O,a(L)),$=h(C),V=i(L,v([M,M,Y])),q=i(v([M,_,Y]),v([F,k,$])),R=i(v([M,k,Y]),v([_,$])),j=i(v([M,_,Y]),v([k,$])),U=i(L,v([_,_,Y])),oe=i(v([_,k,Y]),v([F,M,$])),me=i(v([M,k,Y]),v([F,_,$])),ie=i(v([_,k,Y]),v([M,$])),H=i(L,v([k,k,Y])),ce=[[V,q,R],[j,U,oe],[me,ie,H]];return y(ce,A)}});var Kw="row",EL=["typed","Index","matrix","range"],rp=T(Kw,EL,e=>{var{typed:r,Index:t,matrix:n,range:i}=e;return r(Kw,{"Matrix, number":a,"Array, number":function(l,f){return a(n(tr(l)),f).valueOf()}});function a(s,l){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");Xr(l,s.size()[0]);var f=i(0,s.size()[1]),o=new t(l,f),u=s.subset(o);return Ge(u)?u:n([[u]])}});var jw="size",CL=["typed","config","?matrix"],eD=T(jw,CL,e=>{var{typed:r,config:t,matrix:n}=e;return r(jw,{Matrix:function(a){return a.create(a.size())},Array:or,string:function(a){return t.matrix==="Array"?[a.length]:n([a.length])},"number | Complex | BigNumber | Unit | boolean | null":function(a){return t.matrix==="Array"?[]:n?n([]):jc()}})});var rD="squeeze",ML=["typed","matrix"],tD=T(rD,ML,e=>{var{typed:r,matrix:t}=e;return r(rD,{Array:function(i){return Js(tr(i))},Matrix:function(i){var a=Js(i.toArray());return Array.isArray(a)?t(a):a},any:function(i){return tr(i)}})});var nD="subset",_L=["typed","matrix","zeros","add"],tp=T(nD,_L,e=>{var{typed:r,matrix:t,zeros:n,add:i}=e;return r(nD,{"Matrix, Index":function(l,f){return jo(f)?t():(gf(l,f),l.subset(f))},"Array, Index":r.referTo("Matrix, Index",function(s){return function(l,f){var o=s(t(l),f);return f.isScalar()?o:o.valueOf()}}),"Object, Index":FL,"string, Index":TL,"Matrix, Index, any, any":function(l,f,o,u){return jo(f)?l:(gf(l,f),l.clone().subset(f,a(o,f),u))},"Array, Index, any, any":r.referTo("Matrix, Index, any, any",function(s){return function(l,f,o,u){var p=s(t(l),f,o,u);return p.isMatrix?p.valueOf():p}}),"Array, Index, any":r.referTo("Matrix, Index, any, any",function(s){return function(l,f,o){return s(t(l),f,o,void 0).valueOf()}}),"Matrix, Index, any":r.referTo("Matrix, Index, any, any",function(s){return function(l,f,o){return s(l,f,o,void 0)}}),"string, Index, string":iD,"string, Index, string, string":iD,"Object, Index, any":OL});function a(s,l){if(typeof s=="string")throw new Error("can't boradcast a string");if(l._isScalar)return s;var f=l.size();if(f.every(o=>o>0))try{return i(s,n(f))}catch{return s}else return s}});function TL(e,r){if(!ua(r))throw new TypeError("Index expected");if(jo(r))return"";if(gf(Array.from(e),r),r.size().length!==1)throw new pr(r.size().length,1);var t=e.length;Xr(r.min()[0],t),Xr(r.max()[0],t);var n=r.dimension(0),i="";return n.forEach(function(a){i+=e.charAt(a)}),i}function iD(e,r,t,n){if(!r||r.isIndex!==!0)throw new TypeError("Index expected");if(jo(r))return e;if(gf(Array.from(e),r),r.size().length!==1)throw new pr(r.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=r.dimension(0),a=i.size()[0];if(a!==t.length)throw new pr(i.size()[0],t.length);var s=e.length;Xr(r.min()[0]),Xr(r.max()[0]);for(var l=[],f=0;fs)for(var o=s-1,u=l.length;o{var{typed:r,matrix:t}=e;return r(aD,{Array:s=>n(t(s)).valueOf(),Matrix:n,any:tr});function n(s){var l=s.size(),f;switch(l.length){case 1:f=s.clone();break;case 2:{var o=l[0],u=l[1];if(u===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+lr(l)+")");switch(s.storage()){case"dense":f=i(s,o,u);break;case"sparse":f=a(s,o,u);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+lr(l)+")")}return f}function i(s,l,f){for(var o=s._data,u=[],p,h=0;h{var{typed:r,transpose:t,conj:n}=e;return r(sD,{any:function(a){return n(t(a))}})});var fD="zeros",PL=["typed","config","matrix","BigNumber"],lD=T(fD,PL,e=>{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r(fD,{"":function(){return t.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(o){var u=o[o.length-1];if(typeof u=="string"){var p=o.pop();return a(o,p)}else return t.matrix==="Array"?a(o):a(o,"default")},Array:a,Matrix:function(o){var u=o.storage();return a(o.valueOf(),u)},"Array | Matrix, string":function(o,u){return a(o.valueOf(),u)}});function a(f,o){var u=s(f),p=u?new i(0):0;if(l(f),o){var h=n(o);return f.length>0?h.resize(f,p):h}else{var d=[];return f.length>0?Vi(d,f,p):d}}function s(f){var o=!1;return f.forEach(function(u,p,h){je(u)&&(o=!0,h[p]=u.toNumber())}),o}function l(f){f.forEach(function(o){if(typeof o!="number"||!He(o)||o<0)throw new Error("Parameters in function zeros must be positive integers")})}});var cD="fft",kL=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],pD=T(cD,kL,e=>{var{typed:r,matrix:t,addScalar:n,multiplyScalar:i,divideScalar:a,exp:s,tau:l,i:f,dotDivide:o,conj:u,pow:p,ceil:h,log2:d}=e;return r(cD,{Array:x,Matrix:function(b){return b.create(x(b.toArray()))}});function x(C){var b=or(C);return b.length===1?w(C,b[0]):v(C.map(A=>x(A,b.slice(1))),0)}function v(C,b){var A=or(C);if(b!==0)return new Array(A[0]).fill(0).map((S,O)=>v(C[O],b-1));if(A.length===1)return w(C);function E(S){var O=or(S);return new Array(O[1]).fill(0).map((F,M)=>new Array(O[0]).fill(0).map((_,k)=>S[k][M]))}return E(v(E(C),1))}function y(C){for(var b=C.length,A=s(a(i(-1,i(f,l)),b)),E=[],S=1-b;Si(C[R],E[b-1+R])),...new Array(O-b).fill(0)],M=[...new Array(b+b-1).fill(0).map((q,R)=>a(1,E[R])),...new Array(O-(b+b-1)).fill(0)],_=w(F),k=w(M),L=new Array(O).fill(0).map((q,R)=>i(_[R],k[R])),Y=o(u(x(u(L))),O),$=[],V=b-1;VM%2===0),b/2),...w(C.filter((F,M)=>M%2===1),b/2)],E=0;E{var{typed:r,fft:t,dotDivide:n,conj:i}=e;return r(mD,{"Array | Matrix":function(s){var l=Ge(s)?s.size():or(s);return n(i(t(i(s))),l.reduce((f,o)=>f*o,1))}})});function dD(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function LL(e){for(var r=1;r{var{typed:r,add:t,subtract:n,multiply:i,divide:a,max:s,map:l,abs:f,isPositive:o,isNegative:u,larger:p,smaller:h,matrix:d,bignumber:x,unaryMinus:v}=e;function y(F){return function(M,_,k,L){var Y=!(_.length===2&&(_.every(S)||_.every(qt)));if(Y)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var $=_[0],V=_[1],q=p(V,$),R=L.firstStep;if(R!==void 0&&!o(R))throw new Error('"firstStep" must be positive');var j=L.maxStep;if(j!==void 0&&!o(j))throw new Error('"maxStep" must be positive');var U=L.minStep;if(U&&u(U))throw new Error('"minStep" must be positive or zero');var oe=[$,V,R,U,j].filter(Le=>Le!==void 0);if(!(oe.every(S)||oe.every(qt)))throw new Error('Inconsistent type of "t" dependant variables');for(var me=1,ie=L.tol?L.tol:1e-4,H=L.minDelta?L.minDelta:.2,ce=L.maxDelta?L.maxDelta:5,Me=L.maxIter?L.maxIter:1e4,pe=[$,V,...k,j,U].some(je),[ge,Se,xe,be]=pe?[x(F.a),x(F.c),x(F.b),x(F.bp)]:[F.a,F.c,F.b,F.bp],De=R?q?R:v(R):a(n(V,$),me),Ae=[$],ze=[k],Ze=n(xe,be),K=0,te=0,ye=A(q),ee=E(q);ye(Ae[K],V);){var ne=[];De=ee(Ae[K],V,De),ne.push(M(Ae[K],ze[K]));for(var ue=1;ueqt(Le)?Le.value:Le)));Ee1/4&&(Ae.push(t(Ae[K],De)),ze.push(t(ze[K],i(De,xe,ne))),K++);var Ce=.84*(ie/Ee)**(1/5);if(h(Ce,H)?Ce=H:p(Ce,ce)&&(Ce=ce),Ce=pe?x(Ce):Ce,De=i(De,Ce),j&&p(f(De),j)?De=q?j:v(j):U&&h(f(De),U)&&(De=q?U:v(U)),te++,te>Me)throw new Error("Maximum number of iterations reached, try changing options")}return{t:Ae,y:ze}}}function w(F,M,_,k){var L=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],Y=[null,1/2,3/4,1],$=[2/9,1/3,4/9,0],V=[7/24,1/4,1/3,1/8],q={a:L,c:Y,b:$,bp:V};return y(q)(F,M,_,k)}function C(F,M,_,k){var L=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],Y=[null,1/5,3/10,4/5,8/9,1,1],$=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],V=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],q={a:L,c:Y,b:$,bp:V};return y(q)(F,M,_,k)}function b(F,M,_,k){var L=k.method?k.method:"RK45",Y={RK23:w,RK45:C};if(L.toUpperCase()in Y){var $=LL({},k);return delete $.method,Y[L.toUpperCase()](F,M,_,$)}else{var V=Object.keys(Y).map(R=>'"'.concat(R,'"')),q="".concat(V.slice(0,-1).join(", ")," and ").concat(V.slice(-1));throw new Error('Unavailable method "'.concat(L,'". Available methods are ').concat(q))}}function A(F){return F?h:p}function E(F){var M=F?p:h;return function(_,k,L){var Y=t(_,L);return M(Y,k)?n(k,_):L}}function S(F){return je(F)||ar(F)}function O(F,M,_,k){var L=b(F,M.toArray(),_.toArray(),k);return{t:d(L.t),y:d(L.y)}}return r("solveODE",{"function, Array, Array, Object":b,"function, Matrix, Matrix, Object":O,"function, Array, Array":(F,M,_)=>b(F,M,_,{}),"function, Matrix, Matrix":(F,M,_)=>O(F,M,_,{}),"function, Array, number | BigNumber | Unit":(F,M,_)=>{var k=b(F,M,[_],{});return{t:k.t,y:k.y.map(L=>L[0])}},"function, Matrix, number | BigNumber | Unit":(F,M,_)=>{var k=b(F,M.toArray(),[_],{});return{t:d(k.t),y:d(k.y.map(L=>L[0]))}},"function, Array, number | BigNumber | Unit, Object":(F,M,_,k)=>{var L=b(F,M,[_],k);return{t:L.t,y:L.y.map(Y=>Y[0])}},"function, Matrix, number | BigNumber | Unit, Object":(F,M,_,k)=>{var L=b(F,M.toArray(),[_],k);return{t:d(L.t),y:d(L.y.map(Y=>Y[0]))}}})});var zL="erf",WL=["typed"],gD=T(zL,WL,e=>{var{typed:r}=e;return r("name",{number:function(s){var l=Math.abs(s);return l>=HL?hi(s):l<=VL?hi(s)*t(l):l<=4?hi(s)*(1-n(l)):hi(s)*(1-i(l))},"Array | Matrix":r.referToSelf(a=>s=>Je(s,a))});function t(a){var s=a*a,l=qa[0][4]*s,f=s,o;for(o=0;o<3;o+=1)l=(l+qa[0][o])*s,f=(f+lu[0][o])*s;return a*(l+qa[0][3])/(f+lu[0][3])}function n(a){var s=qa[1][8]*a,l=a,f;for(f=0;f<7;f+=1)s=(s+qa[1][f])*a,l=(l+lu[1][f])*a;var o=(s+qa[1][7])/(l+lu[1][7]),u=parseInt(a*16)/16,p=(a-u)*(a+u);return Math.exp(-u*u)*Math.exp(-p)*o}function i(a){var s=1/(a*a),l=qa[2][5]*s,f=s,o;for(o=0;o<4;o+=1)l=(l+qa[2][o])*s,f=(f+lu[2][o])*s;var u=s*(l+qa[2][4])/(f+lu[2][4]);u=(YL-u)/a,s=parseInt(a*16)/16;var p=(a-s)*(a+s);return Math.exp(-s*s)*Math.exp(-p)*u}}),VL=.46875,YL=.5641895835477563,qa=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],lu=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],HL=Math.pow(2,53);var xD="zeta",GL=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],yD=T(xD,GL,e=>{var{typed:r,config:t,multiply:n,pow:i,divide:a,factorial:s,equal:l,smallerEq:f,isNegative:o,gamma:u,sin:p,subtract:h,add:d,Complex:x,BigNumber:v,pi:y}=e;return r(xD,{number:S=>w(S,O=>O,()=>20),BigNumber:S=>w(S,O=>new v(O),()=>Math.abs(Math.log10(t.epsilon))),Complex:C});function w(S,O,F){return l(S,0)?O(-.5):l(S,1)?O(NaN):isFinite(S)?b(S,O,F,M=>M):o(S)?O(NaN):O(1)}function C(S){return S.re===0&&S.im===0?new x(-.5):S.re===1?new x(NaN,NaN):S.re===1/0&&S.im===0?new x(1):S.im===1/0||S.re===-1/0?new x(NaN,NaN):b(S,O=>O,O=>Math.round(1.3*15+.9*Math.abs(O.im)),O=>O.re)}function b(S,O,F,M){var _=F(S);if(M(S)>-(_-1)/2)return E(S,O(_),O);var k=n(i(2,S),i(O(y),h(S,1)));return k=n(k,p(n(a(O(y),2),S))),k=n(k,u(h(1,S))),n(k,b(h(1,S),O,F,M))}function A(S,O){for(var F=S,M=S;f(M,O);M=d(M,1)){var _=a(n(s(d(O,h(M,1))),i(4,M)),n(s(h(O,M)),s(n(2,M))));F=d(F,_)}return n(O,F)}function E(S,O,F){for(var M=a(1,n(A(F(0),O),h(1,i(2,h(1,S))))),_=F(0),k=F(1);f(k,O);k=d(k,1))_=d(_,a(n((-1)**(k-1),A(k,O)),i(k,S)));return n(M,_)}});var bD="mode",$L=["typed","isNaN","isNumeric"],wD=T(bD,$L,e=>{var{typed:r,isNaN:t,isNumeric:n}=e;return r(bD,{"Array | Matrix":i,"...":function(s){return i(s)}});function i(a){a=gr(a.valueOf());var s=a.length;if(s===0)throw new Error("Cannot calculate mode of an empty array");for(var l={},f=[],o=0,u=0;uo&&(o=l[p],f=[p])}return f}});function St(e,r,t){var n;return String(e).indexOf("Unexpected type")!==-1?(n=arguments.length>2?" (type: "+_r(t)+", value: "+JSON.stringify(t)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+r+", unexpected type of argument"+n)):String(e).indexOf("complex numbers")!==-1?(n=arguments.length>2?" (type: "+_r(t)+", value: "+JSON.stringify(t)+")":"",new TypeError("Cannot calculate "+r+", no ordering relation is defined for complex numbers"+n)):e}var DD="prod",ZL=["typed","config","multiplyScalar","numeric"],SD=T(DD,ZL,e=>{var{typed:r,config:t,multiplyScalar:n,numeric:i}=e;return r(DD,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(l,f){throw new Error("prod(A, dim) is not yet supported")},"...":function(l){return a(l)}});function a(s){var l;if(hn(s,function(f){try{l=l===void 0?f:n(l,f)}catch(o){throw St(o,"prod",f)}}),typeof l=="string"&&(l=i(l,t.number)),l===void 0)throw new Error("Cannot calculate prod of an empty array");return l}});var ND="format",QL=["typed"],AD=T(ND,QL,e=>{var{typed:r}=e;return r(ND,{any:lr,"any, Object | function | number | BigNumber":lr})});var ED="bin",XL=["typed","format"],CD=T(ED,XL,e=>{var{typed:r,format:t}=e;return r(ED,{"number | BigNumber":function(i){return t(i,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(i,a){return t(i,{notation:"bin",wordSize:a})}})});var MD="oct",JL=["typed","format"],_D=T(MD,JL,e=>{var{typed:r,format:t}=e;return r(MD,{"number | BigNumber":function(i){return t(i,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(i,a){return t(i,{notation:"oct",wordSize:a})}})});var TD="hex",KL=["typed","format"],FD=T(TD,KL,e=>{var{typed:r,format:t}=e;return r(TD,{"number | BigNumber":function(i){return t(i,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(i,a){return t(i,{notation:"hex",wordSize:a})}})});var np=/\\$([\\w.]+)/g;var OD="print",jL=["typed"],ip=T(OD,jL,e=>{var{typed:r}=e;return r(OD,{"string, Object | Array":BD,"string, Object | Array, number | Object":BD})});function BD(e,r,t){return e.replace(np,function(n,i){var a=i.split("."),s=r[a.shift()];for(s!==void 0&&s.isMatrix&&(s=s.toArray());a.length&&s!==void 0;){var l=a.shift();s=l?s[l]:s+"."}return s!==void 0?yt(s)?s:lr(s,t):n})}var ID="to",eq=["typed","matrix","concat"],PD=T(ID,eq,e=>{var{typed:r,matrix:t,concat:n}=e,i=vr({typed:r,matrix:t,concat:n});return r(ID,{"Unit, Unit | string":(a,s)=>a.to(s)},i({Ds:!0}))});var kD="isPrime",rq=["typed"],RD=T(kD,rq,e=>{var{typed:r}=e;return r(kD,{number:function(n){if(n*0!==0)return!1;if(n<=3)return n>1;if(n%2===0||n%3===0)return!1;for(var i=5;i*i<=n;i+=6)if(n%i===0||n%(i+2)===0)return!1;return!0},BigNumber:function(n){if(n.toNumber()*0!==0)return!1;if(n.lte(3))return n.gt(1);if(n.mod(2).eq(0)||n.mod(3).eq(0))return!1;if(n.lt(Math.pow(2,32))){for(var i=n.toNumber(),a=5;a*a<=i;a+=6)if(i%a===0||i%(a+2)===0)return!1;return!0}function s(C,b,A){for(var E=1;!b.eq(0);)b.mod(2).eq(0)?(b=b.div(2),C=C.mul(C).mod(A)):(b=b.sub(1),E=C.mul(E).mod(A));return E}var l=n.constructor.clone({precision:n.toFixed(0).length*2});n=new l(n);for(var f=0,o=n.sub(1);o.mod(2).eq(0);)o=o.div(2),f+=1;var u=null;if(n.lt("3317044064679887385961981"))u=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(C=>Cn=>Je(n,t))})});var tq="numeric",nq=["number","?bignumber","?fraction"],LD=T(tq,nq,e=>{var{number:r,bignumber:t,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:s=>r(s),BigNumber:t?s=>t(s):fu,Fraction:n?s=>n(s):Kc};return function(l){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",o=arguments.length>2?arguments[2]:void 0;if(o!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var u=_r(l);if(!(u in i))throw new TypeError("Cannot convert "+l+' of type "'+u+'"; valid input types are '+Object.keys(i).join(", "));if(!(f in a))throw new TypeError("Cannot convert "+l+' to type "'+f+'"; valid output types are '+Object.keys(a).join(", "));return f===u?l:a[f](l)}});var qD="divideScalar",iq=["typed","numeric"],UD=T(qD,iq,e=>{var{typed:r,numeric:t}=e;return r(qD,{"number, number":function(i,a){return i/a},"Complex, Complex":function(i,a){return i.div(a)},"BigNumber, BigNumber":function(i,a){return i.div(a)},"Fraction, Fraction":function(i,a){return i.div(a)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,i)=>n.divide(i),"number | Fraction | Complex | BigNumber, Unit":(n,i)=>i.divideInto(n)})});var zD="pow",aq=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],WD=T(zD,aq,e=>{var{typed:r,config:t,identity:n,multiply:i,matrix:a,inv:s,number:l,fraction:f,Complex:o}=e;return r(zD,{"number, number":u,"Complex, Complex":function(x,v){return x.pow(v)},"BigNumber, BigNumber":function(x,v){return v.isInteger()||x>=0||t.predictable?x.pow(v):new o(x.toNumber(),0).pow(v.toNumber(),0)},"Fraction, Fraction":function(x,v){var y=x.pow(v);if(y!=null)return y;if(t.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return u(x.valueOf(),v.valueOf())},"Array, number":p,"Array, BigNumber":function(x,v){return p(x,v.toNumber())},"Matrix, number":h,"Matrix, BigNumber":function(x,v){return h(x,v.toNumber())},"Unit, number | BigNumber":function(x,v){return x.pow(v)}});function u(d,x){if(t.predictable&&!He(x)&&d<0)try{var v=f(x),y=l(v);if((x===y||Math.abs((x-y)/x)<1e-14)&&v.d%2===1)return(v.n%2===0?1:-1)*Math.pow(-d,x)}catch{}return t.predictable&&(d<-1&&x===1/0||d>-1&&d<0&&x===-1/0)?NaN:He(x)||d>=0||t.predictable?Av(d,x):d*d<1&&x===1/0||d*d>1&&x===-1/0?0:new o(d,0).pow(x,0)}function p(d,x){if(!He(x))throw new TypeError("For A^b, b must be an integer (value is "+x+")");var v=or(d);if(v.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+v.length+" dimensions)");if(v[0]!==v[1])throw new Error("For A^b, A must be square (size is "+v[0]+"x"+v[1]+")");if(x<0)try{return p(s(d),-x)}catch(C){throw C.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+x+")"):C}for(var y=n(v[0]).valueOf(),w=d;x>=1;)(x&1)===1&&(y=i(w,y)),x>>=1,w=i(w,w);return y}function h(d,x){return a(p(d.valueOf(),x))}});var cu="Number of decimals in function round must be an integer",VD="round",oq=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],YD=T(VD,oq,e=>{var{typed:r,config:t,matrix:n,equalScalar:i,zeros:a,BigNumber:s,DenseMatrix:l}=e,f=Jr({typed:r,equalScalar:i}),o=Lr({typed:r,DenseMatrix:l}),u=Bt({typed:r});function p(h){return Math.abs(Xs(h).exponent)}return r(VD,{number:function(d){var x=iu(d,p(t.epsilon)),v=wt(d,x,t.epsilon)?x:d;return iu(v)},"number, number":function(d,x){var v=p(t.epsilon);if(x>=v)return iu(d,x);var y=iu(d,v),w=wt(d,y,t.epsilon)?y:d;return iu(w,x)},"number, BigNumber":function(d,x){if(!x.isInteger())throw new TypeError(cu);return new s(d).toDecimalPlaces(x.toNumber())},Complex:function(d){return d.round()},"Complex, number":function(d,x){if(x%1)throw new TypeError(cu);return d.round(x)},"Complex, BigNumber":function(d,x){if(!x.isInteger())throw new TypeError(cu);var v=x.toNumber();return d.round(v)},BigNumber:function(d){var x=new s(d).toDecimalPlaces(p(t.epsilon)),v=Ut(d,x,t.epsilon)?x:d;return v.toDecimalPlaces(0)},"BigNumber, BigNumber":function(d,x){if(!x.isInteger())throw new TypeError(cu);var v=p(t.epsilon);if(x>=v)return d.toDecimalPlaces(x.toNumber());var y=d.toDecimalPlaces(v),w=Ut(d,y,t.epsilon)?y:d;return w.toDecimalPlaces(x.toNumber())},Fraction:function(d){return d.round()},"Fraction, number":function(d,x){if(x%1)throw new TypeError(cu);return d.round(x)},"Fraction, BigNumber":function(d,x){if(!x.isInteger())throw new TypeError(cu);return d.round(x.toNumber())},"Unit, number, Unit":r.referToSelf(h=>function(d,x,v){var y=d.toNumeric(v);return v.multiply(h(y,x))}),"Unit, BigNumber, Unit":r.referToSelf(h=>(d,x,v)=>h(d,x.toNumber(),v)),"Unit, Unit":r.referToSelf(h=>(d,x)=>h(d,0,x)),"Array | Matrix, number, Unit":r.referToSelf(h=>(d,x,v)=>Je(d,y=>h(y,x,v),!0)),"Array | Matrix, BigNumber, Unit":r.referToSelf(h=>(d,x,v)=>h(d,x.toNumber(),v)),"Array | Matrix, Unit":r.referToSelf(h=>(d,x)=>h(d,0,x)),"Array | Matrix":r.referToSelf(h=>d=>Je(d,h,!0)),"SparseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>f(d,x,h,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>u(d,x,h,!1)),"Array, number | BigNumber":r.referToSelf(h=>(d,x)=>u(n(d),x,h,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":r.referToSelf(h=>(d,x)=>i(d,0)?a(x.size(),x.storage()):o(x,d,h,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":r.referToSelf(h=>(d,x)=>i(d,0)?a(x.size(),x.storage()):u(x,d,h,!0)),"number | Complex | BigNumber | Fraction, Array":r.referToSelf(h=>(d,x)=>u(n(x),d,h,!0).valueOf())})});var HD="log",sq=["config","typed","divideScalar","Complex"],GD=T(HD,sq,e=>{var{typed:r,config:t,divideScalar:n,Complex:i}=e;return r(HD,{number:function(s){return s>=0||t.predictable?p1(s):new i(s,0).log()},Complex:function(s){return s.log()},BigNumber:function(s){return!s.isNegative()||t.predictable?s.ln():new i(s.toNumber(),0).log()},"any, any":r.referToSelf(a=>(s,l)=>n(a(s),a(l)))})});var $D="log1p",uq=["typed","config","divideScalar","log","Complex"],ZD=T($D,uq,e=>{var{typed:r,config:t,divideScalar:n,log:i,Complex:a}=e;return r($D,{number:function(f){return f>=-1||t.predictable?bc(f):s(new a(f,0))},Complex:s,BigNumber:function(f){var o=f.plus(1);return!o.isNegative()||t.predictable?o.ln():s(new a(f.toNumber(),0))},"Array | Matrix":r.referToSelf(l=>f=>Je(f,l)),"any, any":r.referToSelf(l=>(f,o)=>n(l(f),i(o)))});function s(l){var f=l.re+1;return new a(Math.log(Math.sqrt(f*f+l.im*l.im)),Math.atan2(l.im,f))}});var QD="nthRoots",fq=["config","typed","divideScalar","Complex"],XD=T(QD,fq,e=>{var{typed:r,config:t,divideScalar:n,Complex:i}=e,a=[function(f){return new i(f,0)},function(f){return new i(0,f)},function(f){return new i(-f,0)},function(f){return new i(0,-f)}];function s(l,f){if(f<0)throw new Error("Root must be greater than zero");if(f===0)throw new Error("Root must be non-zero");if(f%1!==0)throw new Error("Root must be an integer");if(l===0||l.abs()===0)return[new i(0,0)];var o=typeof l=="number",u;(o||l.re===0||l.im===0)&&(o?u=2*+(l<0):l.im===0?u=2*+(l.re<0):u=2*+(l.im<0)+1);for(var p=l.arg(),h=l.abs(),d=[],x=Math.pow(h,1/f),v=0;v{var{typed:r,equalScalar:t,matrix:n,pow:i,DenseMatrix:a,concat:s}=e,l=ft({typed:r}),f=Vt({typed:r,DenseMatrix:a}),o=Jr({typed:r,equalScalar:t}),u=Lr({typed:r,DenseMatrix:a}),p=vr({typed:r,matrix:n,concat:s}),h={};for(var d in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,d)&&!d.includes("Matrix")&&!d.includes("Array")&&(h[d]=i.signatures[d]);var x=r(h);return r(JD,p({elop:x,SS:f,DS:l,Ss:o,sS:u}))});var jD="dotDivide",cq=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],eS=T(jD,cq,e=>{var{typed:r,matrix:t,equalScalar:n,divideScalar:i,DenseMatrix:a,concat:s}=e,l=It({typed:r,equalScalar:n}),f=ft({typed:r}),o=Vt({typed:r,DenseMatrix:a}),u=Jr({typed:r,equalScalar:n}),p=Lr({typed:r,DenseMatrix:a}),h=vr({typed:r,matrix:t,concat:s});return r(jD,h({elop:i,SS:o,DS:f,SD:l,Ss:u,sS:p}))});function ha(e){var{DenseMatrix:r}=e;return function(n,i,a){var s=n.size();if(s.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+lr(s)+")");var l=s[0],f=s[1];if(l!==f)throw new RangeError("Matrix must be square (size: "+lr(s)+")");var o=[];if(Ge(i)){var u=i.size(),p=i._data;if(u.length===1){if(u[0]!==l)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var h=0;h{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:l}=e,f=ha({DenseMatrix:l});return r(rS,{"SparseMatrix, Array | Matrix":function(h,d){return u(h,d)},"DenseMatrix, Array | Matrix":function(h,d){return o(h,d)},"Array, Array | Matrix":function(h,d){var x=t(h),v=o(x,d);return v.valueOf()}});function o(p,h){h=f(p,h,!0);for(var d=h._data,x=p._size[0],v=p._size[1],y=[],w=p._data,C=0;CA&&(O.push(y[k]),F.push(L))}if(s(S,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var Y=n(E,S),$=0,V=F.length;${var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:l}=e,f=ha({DenseMatrix:l});return r(nS,{"SparseMatrix, Array | Matrix":function(h,d){return u(h,d)},"DenseMatrix, Array | Matrix":function(h,d){return o(h,d)},"Array, Array | Matrix":function(h,d){var x=t(h),v=o(x,d);return v.valueOf()}});function o(p,h){h=f(p,h,!0);for(var d=h._data,x=p._size[0],v=p._size[1],y=[],w=p._data,C=v-1;C>=0;C--){var b=d[C][0]||0,A=void 0;if(s(b,0))A=0;else{var E=w[C][C];if(s(E,0))throw new Error("Linear system cannot be solved since matrix is singular");A=n(b,E);for(var S=C-1;S>=0;S--)d[S]=[a(d[S][0]||0,i(A,w[S][C]))]}y[C]=[A]}return new l({data:y,size:[x,1]})}function u(p,h){h=f(p,h,!0);for(var d=h._data,x=p._size[0],v=p._size[1],y=p._values,w=p._index,C=p._ptr,b=[],A=v-1;A>=0;A--){var E=d[A][0]||0;if(s(E,0))b[A]=[0];else{for(var S=0,O=[],F=[],M=C[A],_=C[A+1],k=_-1;k>=M;k--){var L=w[k];L===A?S=y[k]:L{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:l}=e,f=ha({DenseMatrix:l});return r(aS,{"SparseMatrix, Array | Matrix":function(h,d){return u(h,d)},"DenseMatrix, Array | Matrix":function(h,d){return o(h,d)},"Array, Array | Matrix":function(h,d){var x=t(h),v=o(x,d);return v.map(y=>y.valueOf())}});function o(p,h){for(var d=[f(p,h,!0)._data.map(F=>F[0])],x=p._data,v=p._size[0],y=p._size[1],w=0;wnew l({data:F.map(M=>[M]),size:[v,1]}))}function u(p,h){for(var d=[f(p,h,!0)._data.map(me=>me[0])],x=p._size[0],v=p._size[1],y=p._values,w=p._index,C=p._ptr,b=0;bb&&(O.push(y[L]),F.push(Y))}if(s(k,0))if(s(S[b],0)){if(E===0){var R=[...S];R[b]=1;for(var j=0,U=F.length;jnew l({data:me.map(ie=>[ie]),size:[x,1]}))}});var sS="usolveAll",dq=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],uS=T(sS,dq,e=>{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:l}=e,f=ha({DenseMatrix:l});return r(sS,{"SparseMatrix, Array | Matrix":function(h,d){return u(h,d)},"DenseMatrix, Array | Matrix":function(h,d){return o(h,d)},"Array, Array | Matrix":function(h,d){var x=t(h),v=o(x,d);return v.map(y=>y.valueOf())}});function o(p,h){for(var d=[f(p,h,!0)._data.map(F=>F[0])],x=p._data,v=p._size[0],y=p._size[1],w=y-1;w>=0;w--)for(var C=d.length,b=0;b=0;O--)S[O]=a(S[O],x[O][w]);d.push(S)}}else{if(b===0)return[];d.splice(b,1),b-=1,C-=1}else{A[w]=n(A[w],x[w][w]);for(var E=w-1;E>=0;E--)A[E]=a(A[E],i(A[w],x[E][w]))}}return d.map(F=>new l({data:F.map(M=>[M]),size:[v,1]}))}function u(p,h){for(var d=[f(p,h,!0)._data.map(me=>me[0])],x=p._size[0],v=p._size[1],y=p._values,w=p._index,C=p._ptr,b=v-1;b>=0;b--)for(var A=d.length,E=0;E=M;L--){var Y=w[L];Y===b?k=y[L]:Ynew l({data:me.map(ie=>[ie]),size:[x,1]}))}});var vq="matAlgo08xS0Sid",gq=["typed","equalScalar"],pu=T(vq,gq,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s){var l=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,d=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new pr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");if(!l||!h)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var w=u[0],C=u[1],b,A=t,E=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),E=r.convert(0,b),S=r.find(s,[b,b]));for(var O=[],F=[],M=[],_=[],k=[],L,Y,$,V,q=0;q{var{typed:r,matrix:t}=e;return{"Array, number":r.referTo("DenseMatrix, number",n=>(i,a)=>n(t(i),a).valueOf()),"Array, BigNumber":r.referTo("DenseMatrix, BigNumber",n=>(i,a)=>n(t(i),a).valueOf()),"number, Array":r.referTo("number, DenseMatrix",n=>(i,a)=>n(i,t(a)).valueOf()),"BigNumber, Array":r.referTo("BigNumber, DenseMatrix",n=>(i,a)=>n(i,t(a)).valueOf())}});var fS="leftShift",xq=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],lS=T(fS,xq,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=e,l=dn({typed:r}),f=It({typed:r,equalScalar:n}),o=pu({typed:r,equalScalar:n}),u=Un({typed:r,DenseMatrix:a}),p=Jr({typed:r,equalScalar:n}),h=Bt({typed:r}),d=vr({typed:r,matrix:t,concat:s}),x=mu({typed:r,matrix:t});return r(fS,{"number, number":Tv,"BigNumber, BigNumber":jb,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():p(y,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():h(y,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):u(w,y,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):h(w,y,v,!0))},x,d({SS:o,DS:l,SD:f}))});var cS="rightArithShift",yq=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],pS=T(cS,yq,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=e,l=dn({typed:r}),f=It({typed:r,equalScalar:n}),o=pu({typed:r,equalScalar:n}),u=Un({typed:r,DenseMatrix:a}),p=Jr({typed:r,equalScalar:n}),h=Bt({typed:r}),d=vr({typed:r,matrix:t,concat:s}),x=mu({typed:r,matrix:t});return r(cS,{"number, number":Fv,"BigNumber, BigNumber":ew,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():p(y,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():h(y,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):u(w,y,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):h(w,y,v,!0))},x,d({SS:o,DS:l,SD:f}))});var mS="rightLogShift",bq=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],hS=T(mS,bq,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=e,l=dn({typed:r}),f=It({typed:r,equalScalar:n}),o=pu({typed:r,equalScalar:n}),u=Un({typed:r,DenseMatrix:a}),p=Jr({typed:r,equalScalar:n}),h=Bt({typed:r}),d=vr({typed:r,matrix:t,concat:s}),x=mu({typed:r,matrix:t});return r(mS,{"number, number":Ov,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():p(y,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():h(y,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):u(w,y,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):h(w,y,v,!0))},x,d({SS:o,DS:l,SD:f}))});var dS="and",wq=["typed","matrix","equalScalar","zeros","not","concat"],ap=T(dS,wq,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s}=e,l=It({typed:r,equalScalar:n}),f=No({typed:r,equalScalar:n}),o=Jr({typed:r,equalScalar:n}),u=Bt({typed:r}),p=vr({typed:r,matrix:t,concat:s});return r(dS,{"number, number":Lv,"Complex, Complex":function(d,x){return(d.re!==0||d.im!==0)&&(x.re!==0||x.im!==0)},"BigNumber, BigNumber":function(d,x){return!d.isZero()&&!x.isZero()&&!d.isNaN()&&!x.isNaN()},"Unit, Unit":r.referToSelf(h=>(d,x)=>h(d.value||0,x.value||0)),"SparseMatrix, any":r.referToSelf(h=>(d,x)=>a(x)?i(d.size(),d.storage()):o(d,x,h,!1)),"DenseMatrix, any":r.referToSelf(h=>(d,x)=>a(x)?i(d.size(),d.storage()):u(d,x,h,!1)),"any, SparseMatrix":r.referToSelf(h=>(d,x)=>a(d)?i(d.size(),d.storage()):o(x,d,h,!0)),"any, DenseMatrix":r.referToSelf(h=>(d,x)=>a(d)?i(d.size(),d.storage()):u(x,d,h,!0)),"Array, any":r.referToSelf(h=>(d,x)=>h(t(d),x).valueOf()),"any, Array":r.referToSelf(h=>(d,x)=>h(d,t(x)).valueOf())},p({SS:f,DS:l}))});var op="compare",Dq=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],vS=T(op,Dq,e=>{var{typed:r,config:t,equalScalar:n,matrix:i,BigNumber:a,Fraction:s,DenseMatrix:l,concat:f}=e,o=ft({typed:r}),u=So({typed:r,equalScalar:n}),p=Lr({typed:r,DenseMatrix:l}),h=vr({typed:r,matrix:i,concat:f}),d=vi({typed:r});return r(op,Sq({typed:r,config:t}),{"boolean, boolean":function(v,y){return v===y?0:v>y?1:-1},"BigNumber, BigNumber":function(v,y){return Ut(v,y,t.epsilon)?new a(0):new a(v.cmp(y))},"Fraction, Fraction":function(v,y){return new s(v.compare(y))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},d,h({SS:u,DS:o,Ss:p}))}),Sq=T(op,["typed","config"],e=>{var{typed:r,config:t}=e;return r(op,{"number, number":function(i,a){return wt(i,a,t.epsilon)?0:i>a?1:-1}})});var as=Xn(xS(),1);var yS="compareNatural",Nq=["typed","compare"],bS=T(yS,Nq,e=>{var{typed:r,compare:t}=e,n=t.signatures["boolean,boolean"];return r(yS,{"any, any":i});function i(f,o){var u=_r(f),p=_r(o),h;if((u==="number"||u==="BigNumber"||u==="Fraction")&&(p==="number"||p==="BigNumber"||p==="Fraction"))return h=t(f,o),h.toString()!=="0"?h>0?1:-1:(0,as.default)(u,p);var d=["Array","DenseMatrix","SparseMatrix"];if(d.includes(u)||d.includes(p))return h=a(i,f,o),h!==0?h:(0,as.default)(u,p);if(u!==p)return(0,as.default)(u,p);if(u==="Complex")return Aq(f,o);if(u==="Unit")return f.equalBase(o)?i(f.value,o.value):s(i,f.formatUnits(),o.formatUnits());if(u==="boolean")return n(f,o);if(u==="string")return(0,as.default)(f,o);if(u==="Object")return l(i,f,o);if(u==="null"||u==="undefined")return 0;throw new TypeError('Unsupported type of value "'+u+'"')}function a(f,o,u){return Kn(o)&&Kn(u)?s(f,o.toJSON().values,u.toJSON().values):Kn(o)?a(f,o.toArray(),u):Kn(u)?a(f,o,u.toArray()):Ia(o)?a(f,o.toJSON().data,u):Ia(u)?a(f,o,u.toJSON().data):Array.isArray(o)?Array.isArray(u)?s(f,o,u):a(f,o,[u]):a(f,[o],u)}function s(f,o,u){for(var p=0,h=Math.min(o.length,u.length);pu.length?1:o.lengthr.re?1:e.rer.im?1:e.im{var{typed:r,matrix:t,concat:n}=e,i=vr({typed:r,matrix:t,concat:n});return r(wS,Nc,i({elop:Nc,Ds:!0}))});var sp="equal",Cq=["typed","matrix","equalScalar","DenseMatrix","concat"],SS=T(sp,Cq,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),l=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:t,concat:a});return r(sp,Mq({typed:r,equalScalar:n}),o({elop:n,SS:l,DS:s,Ss:f}))}),Mq=T(sp,["typed","equalScalar"],e=>{var{typed:r,equalScalar:t}=e;return r(sp,{"any, any":function(i,a){return i===null?a===null:a===null?i===null:i===void 0?a===void 0:a===void 0?i===void 0:t(i,a)}})});var NS="equalText",_q=["typed","compareText","isZero"],AS=T(NS,_q,e=>{var{typed:r,compareText:t,isZero:n}=e;return r(NS,{"any, any":function(a,s){return n(t(a,s))}})});var up="smaller",Tq=["typed","config","matrix","DenseMatrix","concat"],ES=T(up,Tq,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),l=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:n,concat:a}),u=vi({typed:r});return r(up,Fq({typed:r,config:t}),{"boolean, boolean":(p,h)=>pp.compare(h)===-1,"Complex, Complex":function(h,d){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:l,DS:s,Ss:f}))}),Fq=T(up,["typed","config"],e=>{var{typed:r,config:t}=e;return r(up,{"number, number":function(i,a){return i{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),l=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:n,concat:a}),u=vi({typed:r});return r(fp,Bq({typed:r,config:t}),{"boolean, boolean":(p,h)=>p<=h,"BigNumber, BigNumber":function(h,d){return h.lte(d)||Ut(h,d,t.epsilon)},"Fraction, Fraction":(p,h)=>p.compare(h)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:l,DS:s,Ss:f}))}),Bq=T(fp,["typed","config"],e=>{var{typed:r,config:t}=e;return r(fp,{"number, number":function(i,a){return i<=a||wt(i,a,t.epsilon)}})});var lp="larger",Iq=["typed","config","matrix","DenseMatrix","concat"],MS=T(lp,Iq,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),l=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:n,concat:a}),u=vi({typed:r});return r(lp,Pq({typed:r,config:t}),{"boolean, boolean":(p,h)=>p>h,"BigNumber, BigNumber":function(h,d){return h.gt(d)&&!Ut(h,d,t.epsilon)},"Fraction, Fraction":(p,h)=>p.compare(h)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:l,DS:s,Ss:f}))}),Pq=T(lp,["typed","config"],e=>{var{typed:r,config:t}=e;return r(lp,{"number, number":function(i,a){return i>a&&!wt(i,a,t.epsilon)}})});var cp="largerEq",kq=["typed","config","matrix","DenseMatrix","concat"],_S=T(cp,kq,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),l=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:n,concat:a}),u=vi({typed:r});return r(cp,Rq({typed:r,config:t}),{"boolean, boolean":(p,h)=>p>=h,"BigNumber, BigNumber":function(h,d){return h.gte(d)||Ut(h,d,t.epsilon)},"Fraction, Fraction":(p,h)=>p.compare(h)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:l,DS:s,Ss:f}))}),Rq=T(cp,["typed","config"],e=>{var{typed:r,config:t}=e;return r(cp,{"number, number":function(i,a){return i>=a||wt(i,a,t.epsilon)}})});var TS="deepEqual",Lq=["typed","equal"],FS=T(TS,Lq,e=>{var{typed:r,equal:t}=e;return r(TS,{"any, any":function(a,s){return n(a.valueOf(),s.valueOf())}});function n(i,a){if(Array.isArray(i))if(Array.isArray(a)){var s=i.length;if(s!==a.length)return!1;for(var l=0;l{var{typed:r,config:t,equalScalar:n,matrix:i,DenseMatrix:a,concat:s}=e,l=ft({typed:r}),f=Vt({typed:r,DenseMatrix:a}),o=Lr({typed:r,DenseMatrix:a}),u=vr({typed:r,matrix:i,concat:s});return r(pp,Uq({typed:r,equalScalar:n}),u({elop:p,SS:f,DS:l,Ss:o}));function p(h,d){return!n(h,d)}}),Uq=T(pp,["typed","equalScalar"],e=>{var{typed:r,equalScalar:t}=e;return r(pp,{"any, any":function(i,a){return i===null?a!==null:a===null?i!==null:i===void 0?a!==void 0:a===void 0?i!==void 0:!t(i,a)}})});var BS="partitionSelect",zq=["typed","isNumeric","isNaN","compare"],IS=T(BS,zq,e=>{var{typed:r,isNumeric:t,isNaN:n,compare:i}=e,a=i,s=(o,u)=>-i(o,u);return r(BS,{"Array | Matrix, number":function(u,p){return l(u,p,a)},"Array | Matrix, number, string":function(u,p,h){if(h==="asc")return l(u,p,a);if(h==="desc")return l(u,p,s);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":l});function l(o,u,p){if(!He(u)||u<0)throw new Error("k must be a non-negative integer");if(Ge(o)){var h=o.size();if(h.length>1)throw new Error("Only one dimensional matrices supported");return f(o.valueOf(),u,p)}if(Array.isArray(o))return f(o,u,p)}function f(o,u,p){if(u>=o.length)throw new Error("k out of bounds");for(var h=0;h=0){var C=o[y];o[y]=o[v],o[v]=C,--y}else++v;p(o[v],w)>0&&--v,u<=v?x=v:d=v+1}return o[u]}});var PS="sort",Wq=["typed","matrix","compare","compareNatural"],kS=T(PS,Wq,e=>{var{typed:r,matrix:t,compare:n,compareNatural:i}=e,a=n,s=(u,p)=>-n(u,p);return r(PS,{Array:function(p){return f(p),p.sort(a)},Matrix:function(p){return o(p),t(p.toArray().sort(a),p.storage())},"Array, function":function(p,h){return f(p),p.sort(h)},"Matrix, function":function(p,h){return o(p),t(p.toArray().sort(h),p.storage())},"Array, string":function(p,h){return f(p),p.sort(l(h))},"Matrix, string":function(p,h){return o(p),t(p.toArray().sort(l(h)),p.storage())}});function l(u){if(u==="asc")return a;if(u==="desc")return s;if(u==="natural")return i;throw new Error('String "asc", "desc", or "natural" expected')}function f(u){if(or(u).length!==1)throw new Error("One dimensional array expected")}function o(u){if(u.size().length!==1)throw new Error("One dimensional matrix expected")}});var RS="max",Vq=["typed","config","numeric","larger"],mp=T(RS,Vq,e=>{var{typed:r,config:t,numeric:n,larger:i}=e;return r(RS,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(f,o){return Do(f,o.valueOf(),a)},"...":function(f){if(di(f))throw new TypeError("Scalar values expected in function max");return s(f)}});function a(l,f){try{return i(l,f)?l:f}catch(o){throw St(o,"max",f)}}function s(l){var f;if(hn(l,function(o){try{isNaN(o)&&typeof o=="number"?f=NaN:(f===void 0||i(o,f))&&(f=o)}catch(u){throw St(u,"max",o)}}),f===void 0)throw new Error("Cannot calculate max of an empty array");return typeof f=="string"&&(f=n(f,t.number)),f}});var LS="min",Yq=["typed","config","numeric","smaller"],hp=T(LS,Yq,e=>{var{typed:r,config:t,numeric:n,smaller:i}=e;return r(LS,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(f,o){return Do(f,o.valueOf(),a)},"...":function(f){if(di(f))throw new TypeError("Scalar values expected in function min");return s(f)}});function a(l,f){try{return i(l,f)?l:f}catch(o){throw St(o,"min",f)}}function s(l){var f;if(hn(l,function(o){try{isNaN(o)&&typeof o=="number"?f=NaN:(f===void 0||i(o,f))&&(f=o)}catch(u){throw St(u,"min",o)}}),f===void 0)throw new Error("Cannot calculate min of an empty array");return typeof f=="string"&&(f=n(f,t.number)),f}});var Hq="ImmutableDenseMatrix",Gq=["smaller","DenseMatrix"],qS=T(Hq,Gq,e=>{var{smaller:r,DenseMatrix:t}=e;function n(i,a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!yt(a))throw new Error("Invalid datatype: "+a);if(Ge(i)||Ar(i)){var s=new t(i,a);this._data=s._data,this._size=s._size,this._datatype=s._datatype,this._min=null,this._max=null}else if(i&&Ar(i.data)&&Ar(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+_r(i)+")");this._data=[],this._size=[0],this._datatype=a,this._min=null,this._max=null}}return n.prototype=new t,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(i){switch(arguments.length){case 1:{var a=t.prototype.subset.call(this,i);return Ge(a)?new n({data:a._data,size:a._size,datatype:a._datatype}):a}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:tr(this._data),size:tr(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(i){return new n(i)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(a){(i===null||r(a,i))&&(i=a)}),this._min=i!==null?i:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(a){(i===null||r(i,a))&&(i=a)}),this._max=i!==null?i:void 0}return this._max},n},{isClass:!0});var $q="Index",Zq=["ImmutableDenseMatrix","getMatrixDataType"],zS=T($q,Zq,e=>{var{ImmutableDenseMatrix:r,getMatrixDataType:t}=e;function n(a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var s=0,l=arguments.length;s{t&&r.push(n)}),r}var Qq="FibonacciHeap",Xq=["smaller","larger"],WS=T(Qq,Xq,e=>{var{smaller:r,larger:t}=e,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(u,p){var h={key:u,value:p,degree:0};if(this._minimum){var d=this._minimum;h.left=d,h.right=d.right,d.right=h,h.right.left=h,r(u,d.key)&&(this._minimum=h)}else h.left=h,h.right=h,this._minimum=h;return this._size++,h},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return this._size===0},i.prototype.extractMinimum=function(){var u=this._minimum;if(u===null)return u;for(var p=this._minimum,h=u.degree,d=u.child;h>0;){var x=d.right;d.left.right=d.right,d.right.left=d.left,d.left=p,d.right=p.right,p.right=d,d.right.left=d,d.parent=null,d=x,h--}return u.left.right=u.right,u.right.left=u.left,u===u.right?p=null:(p=u.right,p=o(p,this._size)),this._size--,this._minimum=p,u},i.prototype.remove=function(u){this._minimum=a(this._minimum,u,-1),this.extractMinimum()};function a(u,p,h){p.key=h;var d=p.parent;return d&&r(p.key,d.key)&&(s(u,p,d),l(u,d)),r(p.key,u.key)&&(u=p),u}function s(u,p,h){p.left.right=p.right,p.right.left=p.left,h.degree--,h.child===p&&(h.child=p.right),h.degree===0&&(h.child=null),p.left=u,p.right=u.right,u.right=p,p.right.left=p,p.parent=null,p.mark=!1}function l(u,p){var h=p.parent;!h||(p.mark?(s(u,p,h),l(h)):p.mark=!0)}var f=function(p,h){p.left.right=p.right,p.right.left=p.left,p.parent=h,h.child?(p.left=h.child,p.right=h.child.right,h.child.right=p,p.right.left=p):(h.child=p,p.right=p,p.left=p),h.degree++,p.mark=!1};function o(u,p){var h=Math.floor(Math.log(p)*n)+1,d=new Array(h),x=0,v=u;if(v)for(x++,v=v.right;v!==u;)x++,v=v.right;for(var y;x>0;){for(var w=v.degree,C=v.right;y=d[w],!!y;){if(t(v.key,y.key)){var b=y;y=v,v=b}f(y,v),d[w]=null,w++}d[w]=v,v=C,x--}u=null;for(var A=0;A{var{addScalar:r,equalScalar:t,FibonacciHeap:n}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(a,s){if(this._values[a])this._values[a].value=s;else{var l=this._heap.insert(a,s);this._values[a]=l}},i.prototype.get=function(a){var s=this._values[a];return s?s.value:0},i.prototype.accumulate=function(a,s){var l=this._values[a];l?l.value=r(l.value,s):(l=this._heap.insert(a,s),this._values[a]=l)},i.prototype.forEach=function(a,s,l){var f=this._heap,o=this._values,u=[],p=f.extractMinimum();for(p&&u.push(p);p&&p.key<=s;)p.key>=a&&(t(p.value,0)||l(p.key,p.value,this)),p=f.extractMinimum(),p&&u.push(p);for(var h=0;h{var{on:r,config:t,addScalar:n,subtractScalar:i,multiplyScalar:a,divideScalar:s,pow:l,abs:f,fix:o,round:u,equal:p,isNumeric:h,format:d,number:x,Complex:v,BigNumber:y,Fraction:w}=e,C=x;function b(K,te){if(!(this instanceof b))throw new Error("Constructor must be called with the new operator");if(!(K==null||h(K)||Gt(K)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,te===void 0)this.units=[],this.dimensions=j.map(ee=>0);else if(typeof te=="string"){var ye=b.parse(te);this.units=ye.units,this.dimensions=ye.dimensions}else if(qt(te)&&te.value===null)this.fixPrefix=te.fixPrefix,this.skipAutomaticSimplification=te.skipAutomaticSimplification,this.dimensions=te.dimensions.slice(0),this.units=te.units.map(ee=>Mt({},ee));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(K)}Object.defineProperty(b,"name",{value:"Unit"}),b.prototype.constructor=b,b.prototype.type="Unit",b.prototype.isUnit=!0;var A,E,S;function O(){for(;S===" "||S===" ";)_()}function F(K){return K>="0"&&K<="9"||K==="."}function M(K){return K>="0"&&K<="9"}function _(){E++,S=A.charAt(E)}function k(K){E=K,S=A.charAt(E)}function L(){var K="",te=E;if(S==="+"?_():S==="-"&&(K+=S,_()),!F(S))return k(te),null;if(S==="."){if(K+=S,_(),!M(S))return k(te),null}else{for(;M(S);)K+=S,_();S==="."&&(K+=S,_())}for(;M(S);)K+=S,_();if(S==="E"||S==="e"){var ye="",ee=E;if(ye+=S,_(),(S==="+"||S==="-")&&(ye+=S,_()),!M(S))return k(ee),K;for(K=K+ye;M(S);)K+=S,_()}return K}function Y(){for(var K="";M(S)||b.isValidAlpha(S);)K+=S,_();var te=K.charAt(0);return b.isValidAlpha(te)?K:null}function $(K){return S===K?(_(),K):null}b.parse=function(K,te){if(te=te||{},A=K,E=-1,S="",typeof A!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var ye=new b;ye.units=[];var ee=1,ne=!1;_(),O();var ue=L(),Ee=null;if(ue){if(t.number==="BigNumber")Ee=new y(ue);else if(t.number==="Fraction")try{Ee=new w(ue)}catch{Ee=parseFloat(ue)}else Ee=parseFloat(ue);O(),$("*")?(ee=1,ne=!0):$("/")&&(ee=-1,ne=!0)}for(var Ce=[],Le=1;;){for(O();S==="(";)Ce.push(ee),Le*=ee,ee=1,_(),O();var Ie=void 0;if(S){var sr=S;if(Ie=Y(),Ie===null)throw new SyntaxError('Unexpected "'+sr+'" in "'+A+'" at index '+E.toString())}else break;var ir=V(Ie);if(ir===null)throw new SyntaxError('Unit "'+Ie+'" not found.');var Xe=ee*Le;if(O(),$("^")){O();var Or=L();if(Or===null)throw new SyntaxError('In "'+K+'", "^" must be followed by a floating-point number');Xe*=Or}ye.units.push({unit:ir.unit,prefix:ir.prefix,power:Xe});for(var re=0;re1||Math.abs(this.units[0].power-1)>1e-15},b.prototype._normalize=function(K){if(K==null||this.units.length===0)return K;for(var te=K,ye=b._getNumberConverter(_r(K)),ee=0;ee{if($e(H,K)){var te=H[K],ye=te.prefixes[""];return{unit:te,prefix:ye}}for(var ee in H)if($e(H,ee)&&wy(K,ee)){var ne=H[ee],ue=K.length-ee.length,Ee=K.substring(0,ue),Ce=$e(ne.prefixes,Ee)?ne.prefixes[Ee]:void 0;if(Ce!==void 0)return{unit:ne,prefix:Ce}}return null},{hasher:K=>K[0],limit:100});b.isValuelessUnit=function(K){return V(K)!==null},b.prototype.hasBase=function(K){if(typeof K=="string"&&(K=U[K]),!K)return!1;for(var te=0;te1e-12)return!1;return!0},b.prototype.equalBase=function(K){for(var te=0;te1e-12)return!1;return!0},b.prototype.equals=function(K){return this.equalBase(K)&&p(this.value,K.value)},b.prototype.multiply=function(K){for(var te=this.clone(),ye=qt(K)?K:new b(K),ee=0;ee1e-12&&($e(ge,Ce)?te.push({unit:ge[Ce].unit,prefix:ge[Ce].prefix,power:K.dimensions[Ee]||0}):ue=!0)}te.length1e-12)if($e(pe.si,ee))te.push({unit:pe.si[ee].unit,prefix:pe.si[ee].prefix,power:K.dimensions[ye]||0});else throw new Error("Cannot express custom unit "+ee+" in SI units")}return K.units=te,K.fixPrefix=!0,K.skipAutomaticSimplification=!0,this.value!==null?(K.value=null,this.to(K)):K},b.prototype.formatUnits=function(){for(var K="",te="",ye=0,ee=0,ne=0;ne0?(ye++,K+=" "+this.units[ne].prefix.name+this.units[ne].unit.name,Math.abs(this.units[ne].power-1)>1e-15&&(K+="^"+this.units[ne].power)):this.units[ne].power<0&&ee++;if(ee>0)for(var ue=0;ue0?(te+=" "+this.units[ue].prefix.name+this.units[ue].unit.name,Math.abs(this.units[ue].power+1)>1e-15&&(te+="^"+-this.units[ue].power)):(te+=" "+this.units[ue].prefix.name+this.units[ue].unit.name,te+="^"+this.units[ue].power));K=K.substr(1),te=te.substr(1),ye>1&&ee>0&&(K="("+K+")"),ee>1&&ye>0&&(te="("+te+")");var Ee=K;return ye>0&&ee>0&&(Ee+=" / "),Ee+=te,Ee},b.prototype.format=function(K){var te=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),ye=!1;typeof te.value<"u"&&te.value!==null&&Gt(te.value)&&(ye=Math.abs(te.value.re)<1e-14);for(var ee in te.units)$e(te.units,ee)&&te.units[ee].unit&&(te.units[ee].unit.name==="VA"&&ye?te.units[ee].unit=H.VAR:te.units[ee].unit.name==="VAR"&&!ye&&(te.units[ee].unit=H.VA));te.units.length===1&&!te.fixPrefix&&Math.abs(te.units[0].power-Math.round(te.units[0].power))<1e-14&&(te.units[0].prefix=te._bestPrefix());var ne=te._denormalize(te.value),ue=te.value!==null?d(ne,K||{}):"",Ee=te.formatUnits();return te.value&&Gt(te.value)&&(ue="("+ue+")"),Ee.length>0&&ue.length>0&&(ue+=" "),ue+=Ee,ue},b.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var K=this.value!==null?f(this.value):0,te=f(this.units[0].unit.value),ye=this.units[0].prefix;if(K===0)return ye;var ee=this.units[0].power,ne=Math.log(K/Math.pow(ye.value*te,ee))/Math.LN10-1.2;if(ne>-2.200001&&ne<1.800001)return ye;ne=Math.abs(ne);var ue=this.units[0].unit.prefixes;for(var Ee in ue)if($e(ue,Ee)){var Ce=ue[Ee];if(Ce.scientific){var Le=Math.abs(Math.log(K/Math.pow(Ce.value*te,ee))/Math.LN10-1.2);(Le0)},H={meter:{name:"meter",base:U.LENGTH,prefixes:R.LONG,value:1,offset:0},inch:{name:"inch",base:U.LENGTH,prefixes:R.NONE,value:.0254,offset:0},foot:{name:"foot",base:U.LENGTH,prefixes:R.NONE,value:.3048,offset:0},yard:{name:"yard",base:U.LENGTH,prefixes:R.NONE,value:.9144,offset:0},mile:{name:"mile",base:U.LENGTH,prefixes:R.NONE,value:1609.344,offset:0},link:{name:"link",base:U.LENGTH,prefixes:R.NONE,value:.201168,offset:0},rod:{name:"rod",base:U.LENGTH,prefixes:R.NONE,value:5.0292,offset:0},chain:{name:"chain",base:U.LENGTH,prefixes:R.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:U.LENGTH,prefixes:R.NONE,value:1e-10,offset:0},m:{name:"m",base:U.LENGTH,prefixes:R.SHORT,value:1,offset:0},in:{name:"in",base:U.LENGTH,prefixes:R.NONE,value:.0254,offset:0},ft:{name:"ft",base:U.LENGTH,prefixes:R.NONE,value:.3048,offset:0},yd:{name:"yd",base:U.LENGTH,prefixes:R.NONE,value:.9144,offset:0},mi:{name:"mi",base:U.LENGTH,prefixes:R.NONE,value:1609.344,offset:0},li:{name:"li",base:U.LENGTH,prefixes:R.NONE,value:.201168,offset:0},rd:{name:"rd",base:U.LENGTH,prefixes:R.NONE,value:5.02921,offset:0},ch:{name:"ch",base:U.LENGTH,prefixes:R.NONE,value:20.1168,offset:0},mil:{name:"mil",base:U.LENGTH,prefixes:R.NONE,value:254e-7,offset:0},m2:{name:"m2",base:U.SURFACE,prefixes:R.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:U.SURFACE,prefixes:R.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:U.SURFACE,prefixes:R.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:U.SURFACE,prefixes:R.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:U.SURFACE,prefixes:R.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:U.SURFACE,prefixes:R.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:U.SURFACE,prefixes:R.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:U.SURFACE,prefixes:R.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:U.SURFACE,prefixes:R.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:U.SURFACE,prefixes:R.NONE,value:1e4,offset:0},m3:{name:"m3",base:U.VOLUME,prefixes:R.CUBIC,value:1,offset:0},L:{name:"L",base:U.VOLUME,prefixes:R.SHORT,value:.001,offset:0},l:{name:"l",base:U.VOLUME,prefixes:R.SHORT,value:.001,offset:0},litre:{name:"litre",base:U.VOLUME,prefixes:R.LONG,value:.001,offset:0},cuin:{name:"cuin",base:U.VOLUME,prefixes:R.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:U.VOLUME,prefixes:R.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:U.VOLUME,prefixes:R.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:U.VOLUME,prefixes:R.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:U.VOLUME,prefixes:R.NONE,value:15e-6,offset:0},drop:{name:"drop",base:U.VOLUME,prefixes:R.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:U.VOLUME,prefixes:R.NONE,value:5e-8,offset:0},minim:{name:"minim",base:U.VOLUME,prefixes:R.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:U.VOLUME,prefixes:R.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:U.VOLUME,prefixes:R.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:U.VOLUME,prefixes:R.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:U.VOLUME,prefixes:R.NONE,value:1e-6,offset:0},cup:{name:"cup",base:U.VOLUME,prefixes:R.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:U.VOLUME,prefixes:R.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:U.VOLUME,prefixes:R.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:U.VOLUME,prefixes:R.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:U.VOLUME,prefixes:R.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:U.VOLUME,prefixes:R.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:U.VOLUME,prefixes:R.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:U.VOLUME,prefixes:R.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:U.VOLUME,prefixes:R.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:U.VOLUME,prefixes:R.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:U.VOLUME,prefixes:R.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:U.VOLUME,prefixes:R.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:U.VOLUME,prefixes:R.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:U.VOLUME,prefixes:R.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:U.VOLUME,prefixes:R.NONE,value:.1173478,offset:0},obl:{name:"obl",base:U.VOLUME,prefixes:R.NONE,value:.1589873,offset:0},g:{name:"g",base:U.MASS,prefixes:R.SHORT,value:.001,offset:0},gram:{name:"gram",base:U.MASS,prefixes:R.LONG,value:.001,offset:0},ton:{name:"ton",base:U.MASS,prefixes:R.SHORT,value:907.18474,offset:0},t:{name:"t",base:U.MASS,prefixes:R.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:U.MASS,prefixes:R.LONG,value:1e3,offset:0},grain:{name:"grain",base:U.MASS,prefixes:R.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:U.MASS,prefixes:R.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:U.MASS,prefixes:R.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:U.MASS,prefixes:R.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:U.MASS,prefixes:R.NONE,value:45.359237,offset:0},stick:{name:"stick",base:U.MASS,prefixes:R.NONE,value:.115,offset:0},stone:{name:"stone",base:U.MASS,prefixes:R.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:U.MASS,prefixes:R.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:U.MASS,prefixes:R.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:U.MASS,prefixes:R.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:U.MASS,prefixes:R.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:U.MASS,prefixes:R.NONE,value:45.359237,offset:0},s:{name:"s",base:U.TIME,prefixes:R.SHORT,value:1,offset:0},min:{name:"min",base:U.TIME,prefixes:R.NONE,value:60,offset:0},h:{name:"h",base:U.TIME,prefixes:R.NONE,value:3600,offset:0},second:{name:"second",base:U.TIME,prefixes:R.LONG,value:1,offset:0},sec:{name:"sec",base:U.TIME,prefixes:R.LONG,value:1,offset:0},minute:{name:"minute",base:U.TIME,prefixes:R.NONE,value:60,offset:0},hour:{name:"hour",base:U.TIME,prefixes:R.NONE,value:3600,offset:0},day:{name:"day",base:U.TIME,prefixes:R.NONE,value:86400,offset:0},week:{name:"week",base:U.TIME,prefixes:R.NONE,value:7*86400,offset:0},month:{name:"month",base:U.TIME,prefixes:R.NONE,value:2629800,offset:0},year:{name:"year",base:U.TIME,prefixes:R.NONE,value:31557600,offset:0},decade:{name:"decade",base:U.TIME,prefixes:R.NONE,value:315576e3,offset:0},century:{name:"century",base:U.TIME,prefixes:R.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:U.TIME,prefixes:R.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:U.FREQUENCY,prefixes:R.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:U.FREQUENCY,prefixes:R.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:U.ANGLE,prefixes:R.SHORT,value:1,offset:0},radian:{name:"radian",base:U.ANGLE,prefixes:R.LONG,value:1,offset:0},deg:{name:"deg",base:U.ANGLE,prefixes:R.SHORT,value:null,offset:0},degree:{name:"degree",base:U.ANGLE,prefixes:R.LONG,value:null,offset:0},grad:{name:"grad",base:U.ANGLE,prefixes:R.SHORT,value:null,offset:0},gradian:{name:"gradian",base:U.ANGLE,prefixes:R.LONG,value:null,offset:0},cycle:{name:"cycle",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},A:{name:"A",base:U.CURRENT,prefixes:R.SHORT,value:1,offset:0},ampere:{name:"ampere",base:U.CURRENT,prefixes:R.LONG,value:1,offset:0},K:{name:"K",base:U.TEMPERATURE,prefixes:R.SHORT,value:1,offset:0},degC:{name:"degC",base:U.TEMPERATURE,prefixes:R.SHORT,value:1,offset:273.15},degF:{name:"degF",base:U.TEMPERATURE,prefixes:R.SHORT,value:new w(5,9),offset:459.67},degR:{name:"degR",base:U.TEMPERATURE,prefixes:R.SHORT,value:new w(5,9),offset:0},kelvin:{name:"kelvin",base:U.TEMPERATURE,prefixes:R.LONG,value:1,offset:0},celsius:{name:"celsius",base:U.TEMPERATURE,prefixes:R.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:U.TEMPERATURE,prefixes:R.LONG,value:new w(5,9),offset:459.67},rankine:{name:"rankine",base:U.TEMPERATURE,prefixes:R.LONG,value:new w(5,9),offset:0},mol:{name:"mol",base:U.AMOUNT_OF_SUBSTANCE,prefixes:R.SHORT,value:1,offset:0},mole:{name:"mole",base:U.AMOUNT_OF_SUBSTANCE,prefixes:R.LONG,value:1,offset:0},cd:{name:"cd",base:U.LUMINOUS_INTENSITY,prefixes:R.SHORT,value:1,offset:0},candela:{name:"candela",base:U.LUMINOUS_INTENSITY,prefixes:R.LONG,value:1,offset:0},N:{name:"N",base:U.FORCE,prefixes:R.SHORT,value:1,offset:0},newton:{name:"newton",base:U.FORCE,prefixes:R.LONG,value:1,offset:0},dyn:{name:"dyn",base:U.FORCE,prefixes:R.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:U.FORCE,prefixes:R.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:U.FORCE,prefixes:R.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:U.FORCE,prefixes:R.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:U.FORCE,prefixes:R.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:U.FORCE,prefixes:R.NONE,value:9.80665,offset:0},J:{name:"J",base:U.ENERGY,prefixes:R.SHORT,value:1,offset:0},joule:{name:"joule",base:U.ENERGY,prefixes:R.LONG,value:1,offset:0},erg:{name:"erg",base:U.ENERGY,prefixes:R.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:U.ENERGY,prefixes:R.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:U.ENERGY,prefixes:R.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:U.ENERGY,prefixes:R.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:U.ENERGY,prefixes:R.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:U.POWER,prefixes:R.SHORT,value:1,offset:0},watt:{name:"watt",base:U.POWER,prefixes:R.LONG,value:1,offset:0},hp:{name:"hp",base:U.POWER,prefixes:R.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:U.POWER,prefixes:R.SHORT,value:v.I,offset:0},VA:{name:"VA",base:U.POWER,prefixes:R.SHORT,value:1,offset:0},Pa:{name:"Pa",base:U.PRESSURE,prefixes:R.SHORT,value:1,offset:0},psi:{name:"psi",base:U.PRESSURE,prefixes:R.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:U.PRESSURE,prefixes:R.NONE,value:101325,offset:0},bar:{name:"bar",base:U.PRESSURE,prefixes:R.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:U.PRESSURE,prefixes:R.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:U.PRESSURE,prefixes:R.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:U.PRESSURE,prefixes:R.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:U.PRESSURE,prefixes:R.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:U.ELECTRIC_CHARGE,prefixes:R.LONG,value:1,offset:0},C:{name:"C",base:U.ELECTRIC_CHARGE,prefixes:R.SHORT,value:1,offset:0},farad:{name:"farad",base:U.ELECTRIC_CAPACITANCE,prefixes:R.LONG,value:1,offset:0},F:{name:"F",base:U.ELECTRIC_CAPACITANCE,prefixes:R.SHORT,value:1,offset:0},volt:{name:"volt",base:U.ELECTRIC_POTENTIAL,prefixes:R.LONG,value:1,offset:0},V:{name:"V",base:U.ELECTRIC_POTENTIAL,prefixes:R.SHORT,value:1,offset:0},ohm:{name:"ohm",base:U.ELECTRIC_RESISTANCE,prefixes:R.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:U.ELECTRIC_INDUCTANCE,prefixes:R.LONG,value:1,offset:0},H:{name:"H",base:U.ELECTRIC_INDUCTANCE,prefixes:R.SHORT,value:1,offset:0},siemens:{name:"siemens",base:U.ELECTRIC_CONDUCTANCE,prefixes:R.LONG,value:1,offset:0},S:{name:"S",base:U.ELECTRIC_CONDUCTANCE,prefixes:R.SHORT,value:1,offset:0},weber:{name:"weber",base:U.MAGNETIC_FLUX,prefixes:R.LONG,value:1,offset:0},Wb:{name:"Wb",base:U.MAGNETIC_FLUX,prefixes:R.SHORT,value:1,offset:0},tesla:{name:"tesla",base:U.MAGNETIC_FLUX_DENSITY,prefixes:R.LONG,value:1,offset:0},T:{name:"T",base:U.MAGNETIC_FLUX_DENSITY,prefixes:R.SHORT,value:1,offset:0},b:{name:"b",base:U.BIT,prefixes:R.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:U.BIT,prefixes:R.BINARY_LONG,value:1,offset:0},B:{name:"B",base:U.BIT,prefixes:R.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:U.BIT,prefixes:R.BINARY_LONG,value:8,offset:0}},ce={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function Me(K){if(K.number==="BigNumber"){var te=Cf(y);H.rad.value=new y(1),H.deg.value=te.div(180),H.grad.value=te.div(200),H.cycle.value=te.times(2),H.arcsec.value=te.div(648e3),H.arcmin.value=te.div(10800)}else H.rad.value=1,H.deg.value=Math.PI/180,H.grad.value=Math.PI/200,H.cycle.value=Math.PI*2,H.arcsec.value=Math.PI/648e3,H.arcmin.value=Math.PI/10800;H.radian.value=H.rad.value,H.degree.value=H.deg.value,H.gradian.value=H.grad.value}Me(t),r&&r("config",function(K,te){K.number!==te.number&&Me(K)});var pe={si:{NONE:{unit:ie,prefix:R.NONE[""]},LENGTH:{unit:H.m,prefix:R.SHORT[""]},MASS:{unit:H.g,prefix:R.SHORT.k},TIME:{unit:H.s,prefix:R.SHORT[""]},CURRENT:{unit:H.A,prefix:R.SHORT[""]},TEMPERATURE:{unit:H.K,prefix:R.SHORT[""]},LUMINOUS_INTENSITY:{unit:H.cd,prefix:R.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:H.mol,prefix:R.SHORT[""]},ANGLE:{unit:H.rad,prefix:R.SHORT[""]},BIT:{unit:H.bits,prefix:R.SHORT[""]},FORCE:{unit:H.N,prefix:R.SHORT[""]},ENERGY:{unit:H.J,prefix:R.SHORT[""]},POWER:{unit:H.W,prefix:R.SHORT[""]},PRESSURE:{unit:H.Pa,prefix:R.SHORT[""]},ELECTRIC_CHARGE:{unit:H.C,prefix:R.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:H.F,prefix:R.SHORT[""]},ELECTRIC_POTENTIAL:{unit:H.V,prefix:R.SHORT[""]},ELECTRIC_RESISTANCE:{unit:H.ohm,prefix:R.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:H.H,prefix:R.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:H.S,prefix:R.SHORT[""]},MAGNETIC_FLUX:{unit:H.Wb,prefix:R.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:H.T,prefix:R.SHORT[""]},FREQUENCY:{unit:H.Hz,prefix:R.SHORT[""]}}};pe.cgs=JSON.parse(JSON.stringify(pe.si)),pe.cgs.LENGTH={unit:H.m,prefix:R.SHORT.c},pe.cgs.MASS={unit:H.g,prefix:R.SHORT[""]},pe.cgs.FORCE={unit:H.dyn,prefix:R.SHORT[""]},pe.cgs.ENERGY={unit:H.erg,prefix:R.NONE[""]},pe.us=JSON.parse(JSON.stringify(pe.si)),pe.us.LENGTH={unit:H.ft,prefix:R.NONE[""]},pe.us.MASS={unit:H.lbm,prefix:R.NONE[""]},pe.us.TEMPERATURE={unit:H.degF,prefix:R.NONE[""]},pe.us.FORCE={unit:H.lbf,prefix:R.NONE[""]},pe.us.ENERGY={unit:H.BTU,prefix:R.BTU[""]},pe.us.POWER={unit:H.hp,prefix:R.NONE[""]},pe.us.PRESSURE={unit:H.psi,prefix:R.NONE[""]},pe.auto=JSON.parse(JSON.stringify(pe.si));var ge=pe.auto;b.setUnitSystem=function(K){if($e(pe,K))ge=pe[K];else throw new Error("Unit system "+K+" does not exist. Choices are: "+Object.keys(pe).join(", "))},b.getUnitSystem=function(){for(var K in pe)if($e(pe,K)&&pe[K]===ge)return K},b.typeConverters={BigNumber:function(te){return te!=null&&te.isFraction?new y(te.n).div(te.d).times(te.s):new y(te+"")},Fraction:function(te){return new w(te)},Complex:function(te){return te},number:function(te){return te!=null&&te.isFraction?x(te):te}},b.prototype._numberConverter=function(){var K=b.typeConverters[this.valueType()];if(K)return K;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},b._getNumberConverter=function(K){if(!b.typeConverters[K])throw new TypeError('Unsupported type "'+K+'"');return b.typeConverters[K]};for(var Se in H)if($e(H,Se)){var xe=H[Se];xe.dimensions=xe.base.dimensions}for(var be in ce)if($e(ce,be)){var De=H[ce[be]],Ae={};for(var ze in De)$e(De,ze)&&(Ae[ze]=De[ze]);Ae.name=be,H[be]=Ae}b.isValidAlpha=function(te){return/^[a-zA-Z]$/.test(te)};function Ze(K){for(var te=0;te0&&!(b.isValidAlpha(S)||M(S)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+K+'"')}}return b.createUnit=function(K,te){if(typeof K!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(te&&te.override){for(var ye in K)if($e(K,ye)&&b.deleteUnit(ye),K[ye].aliases)for(var ee=0;ee"u"||te===null)&&(te={}),typeof K!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if($e(H,K))throw new Error('Cannot create unit "'+K+'": a unit with that name already exists');Ze(K);var ye=null,ee=[],ne=0,ue,Ee,Ce;if(te&&te.type==="Unit")ye=te.clone();else if(typeof te=="string")te!==""&&(ue=te);else if(typeof te=="object")ue=te.definition,Ee=te.prefixes,ne=te.offset,Ce=te.baseName,te.aliases&&(ee=te.aliases.valueOf());else throw new TypeError('Cannot create unit "'+K+'" from "'+te.toString()+'": expecting "string" or "Unit" or "Object"');if(ee){for(var Le=0;Le1e-12){le=!1;break}if(le){Or=!0,Ie.base=U[re];break}}if(!Or){Ce=Ce||K+"_STUFF";var Oe={dimensions:ye.dimensions.slice(0)};Oe.key=Ce,U[Ce]=Oe,ge[Ce]={unit:Ie,prefix:R.NONE[""]},Ie.base=U[Ce]}}else{if(Ce=Ce||K+"_STUFF",j.indexOf(Ce)>=0)throw new Error('Cannot create new base unit "'+K+'": a base unit with that name already exists (and cannot be overridden)');j.push(Ce);for(var sr in U)$e(U,sr)&&(U[sr].dimensions[j.length-1]=0);for(var ir={dimensions:[]},Xe=0;Xe{var{typed:r,Unit:t}=e;return r(QS,{Unit:function(i){return i.clone()},string:function(i){return t.isValuelessUnit(i)?new t(null,i):t.parse(i,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(i,a){return new t(i,a)},"number | BigNumber | Fraction":function(i){return new t(i)},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var JS="sparse",tU=["typed","SparseMatrix"],KS=T(JS,tU,e=>{var{typed:r,SparseMatrix:t}=e;return r(JS,{"":function(){return new t([])},string:function(i){return new t([],i)},"Array | Matrix":function(i){return new t(i)},"Array | Matrix, string":function(i,a){return new t(i,a)}})});var jS="createUnit",nU=["typed","Unit"],eN=T(jS,nU,e=>{var{typed:r,Unit:t}=e;return r(jS,{"Object, Object":function(i,a){return t.createUnit(i,a)},Object:function(i){return t.createUnit(i,{})},"string, Unit | string | Object, Object":function(i,a,s){var l={};return l[i]=a,t.createUnit(l,s)},"string, Unit | string | Object":function(i,a){var s={};return s[i]=a,t.createUnit(s,{})},string:function(i){var a={};return a[i]={},t.createUnit(a,{})}})});var rN="acos",iU=["typed","config","Complex"],tN=T(rN,iU,e=>{var{typed:r,config:t,Complex:n}=e;return r(rN,{number:function(a){return a>=-1&&a<=1||t.predictable?Math.acos(a):new n(a,0).acos()},Complex:function(a){return a.acos()},BigNumber:function(a){return a.acos()}})});var nN="acosh",aU=["typed","config","Complex"],iN=T(nN,aU,e=>{var{typed:r,config:t,Complex:n}=e;return r(nN,{number:function(a){return a>=1||t.predictable?zv(a):a<=-1?new n(Math.log(Math.sqrt(a*a-1)-a),Math.PI):new n(a,0).acosh()},Complex:function(a){return a.acosh()},BigNumber:function(a){return a.acosh()}})});var aN="acot",oU=["typed","BigNumber"],oN=T(aN,oU,e=>{var{typed:r,BigNumber:t}=e;return r(aN,{number:Wv,Complex:function(i){return i.acot()},BigNumber:function(i){return new t(1).div(i).atan()}})});var sN="acoth",sU=["typed","config","Complex","BigNumber"],uN=T(sN,sU,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(sN,{number:function(s){return s>=1||s<=-1||t.predictable?Vv(s):new n(s,0).acoth()},Complex:function(s){return s.acoth()},BigNumber:function(s){return new i(1).div(s).atanh()}})});var fN="acsc",uU=["typed","config","Complex","BigNumber"],lN=T(fN,uU,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(fN,{number:function(s){return s<=-1||s>=1||t.predictable?Yv(s):new n(s,0).acsc()},Complex:function(s){return s.acsc()},BigNumber:function(s){return new i(1).div(s).asin()}})});var cN="acsch",fU=["typed","BigNumber"],pN=T(cN,fU,e=>{var{typed:r,BigNumber:t}=e;return r(cN,{number:Hv,Complex:function(i){return i.acsch()},BigNumber:function(i){return new t(1).div(i).asinh()}})});var mN="asec",lU=["typed","config","Complex","BigNumber"],hN=T(mN,lU,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(mN,{number:function(s){return s<=-1||s>=1||t.predictable?Gv(s):new n(s,0).asec()},Complex:function(s){return s.asec()},BigNumber:function(s){return new i(1).div(s).acos()}})});var dN="asech",cU=["typed","config","Complex","BigNumber"],vN=T(dN,cU,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(dN,{number:function(s){if(s<=1&&s>=-1||t.predictable){var l=1/s;if(l>0||t.predictable)return $v(s);var f=Math.sqrt(l*l-1);return new n(Math.log(f-l),Math.PI)}return new n(s,0).asech()},Complex:function(s){return s.asech()},BigNumber:function(s){return new i(1).div(s).acosh()}})});var gN="asin",pU=["typed","config","Complex"],xN=T(gN,pU,e=>{var{typed:r,config:t,Complex:n}=e;return r(gN,{number:function(a){return a>=-1&&a<=1||t.predictable?Math.asin(a):new n(a,0).asin()},Complex:function(a){return a.asin()},BigNumber:function(a){return a.asin()}})});var mU="asinh",hU=["typed"],yN=T(mU,hU,e=>{var{typed:r}=e;return r("asinh",{number:Zv,Complex:function(n){return n.asinh()},BigNumber:function(n){return n.asinh()}})});var dU="atan",vU=["typed"],bN=T(dU,vU,e=>{var{typed:r}=e;return r("atan",{number:function(n){return Math.atan(n)},Complex:function(n){return n.atan()},BigNumber:function(n){return n.atan()}})});var wN="atan2",gU=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],DN=T(wN,gU,e=>{var{typed:r,matrix:t,equalScalar:n,BigNumber:i,DenseMatrix:a,concat:s}=e,l=It({typed:r,equalScalar:n}),f=ft({typed:r}),o=Yc({typed:r,equalScalar:n}),u=Jr({typed:r,equalScalar:n}),p=Lr({typed:r,DenseMatrix:a}),h=vr({typed:r,matrix:t,concat:s});return r(wN,{"number, number":Math.atan2,"BigNumber, BigNumber":(d,x)=>i.atan2(d,x)},h({scalar:"number | BigNumber",SS:o,DS:f,SD:l,Ss:u,sS:p}))});var SN="atanh",xU=["typed","config","Complex"],NN=T(SN,xU,e=>{var{typed:r,config:t,Complex:n}=e;return r(SN,{number:function(a){return a<=1&&a>=-1||t.predictable?Qv(a):new n(a,0).atanh()},Complex:function(a){return a.atanh()},BigNumber:function(a){return a.atanh()}})});var xi=T("trigUnit",["typed"],e=>{var{typed:r}=e;return{Unit:r.referToSelf(t=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return r.find(t,n.valueType())(n.value)})}});var AN="cos",yU=["typed"],EN=T(AN,yU,e=>{var{typed:r}=e,t=xi({typed:r});return r(AN,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},t)});var CN="cosh",bU=["typed"],MN=T(CN,bU,e=>{var{typed:r}=e;return r(CN,{number:Dc,"Complex | BigNumber":t=>t.cosh()})});var _N="cot",wU=["typed","BigNumber"],TN=T(_N,wU,e=>{var{typed:r,BigNumber:t}=e,n=xi({typed:r});return r(_N,{number:Xv,Complex:i=>i.cot(),BigNumber:i=>new t(1).div(i.tan())},n)});var FN="coth",DU=["typed","BigNumber"],ON=T(FN,DU,e=>{var{typed:r,BigNumber:t}=e;return r(FN,{number:Jv,Complex:n=>n.coth(),BigNumber:n=>new t(1).div(n.tanh())})});var BN="csc",SU=["typed","BigNumber"],IN=T(BN,SU,e=>{var{typed:r,BigNumber:t}=e,n=xi({typed:r});return r(BN,{number:Kv,Complex:i=>i.csc(),BigNumber:i=>new t(1).div(i.sin())},n)});var PN="csch",NU=["typed","BigNumber"],kN=T(PN,NU,e=>{var{typed:r,BigNumber:t}=e;return r(PN,{number:jv,Complex:n=>n.csch(),BigNumber:n=>new t(1).div(n.sinh())})});var RN="sec",AU=["typed","BigNumber"],LN=T(RN,AU,e=>{var{typed:r,BigNumber:t}=e,n=xi({typed:r});return r(RN,{number:eg,Complex:i=>i.sec(),BigNumber:i=>new t(1).div(i.cos())},n)});var qN="sech",EU=["typed","BigNumber"],UN=T(qN,EU,e=>{var{typed:r,BigNumber:t}=e;return r(qN,{number:rg,Complex:n=>n.sech(),BigNumber:n=>new t(1).div(n.cosh())})});var zN="sin",CU=["typed"],WN=T(zN,CU,e=>{var{typed:r}=e,t=xi({typed:r});return r(zN,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},t)});var VN="sinh",MU=["typed"],YN=T(VN,MU,e=>{var{typed:r}=e;return r(VN,{number:tg,"Complex | BigNumber":t=>t.sinh()})});var HN="tan",_U=["typed"],GN=T(HN,_U,e=>{var{typed:r}=e,t=xi({typed:r});return r(HN,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},t)});var TU="tanh",FU=["typed"],$N=T(TU,FU,e=>{var{typed:r}=e;return r("tanh",{number:Sc,"Complex | BigNumber":t=>t.tanh()})});var ZN="setCartesian",OU=["typed","size","subset","compareNatural","Index","DenseMatrix"],QN=T(ZN,OU,e=>{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(ZN,{"Array | Matrix, Array | Matrix":function(f,o){var u=[];if(n(t(f),new a(0))!==0&&n(t(o),new a(0))!==0){var p=gr(Array.isArray(f)?f:f.toArray()).sort(i),h=gr(Array.isArray(o)?o:o.toArray()).sort(i);u=[];for(var d=0;d{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(XN,{"Array | Matrix, Array | Matrix":function(f,o){var u;if(n(t(f),new a(0))===0)u=[];else{if(n(t(o),new a(0))===0)return gr(f.toArray());var p=Pa(gr(Array.isArray(f)?f:f.toArray()).sort(i)),h=Pa(gr(Array.isArray(o)?o:o.toArray()).sort(i));u=[];for(var d,x=0;x{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(KN,{"Array | Matrix":function(f){var o;if(n(t(f),new a(0))===0)o=[];else{var u=gr(Array.isArray(f)?f:f.toArray()).sort(i);o=[],o.push(u[0]);for(var p=1;p{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(e2,{"Array | Matrix, Array | Matrix":function(f,o){var u;if(n(t(f),new a(0))===0||n(t(o),new a(0))===0)u=[];else{var p=Pa(gr(Array.isArray(f)?f:f.toArray()).sort(i)),h=Pa(gr(Array.isArray(o)?o:o.toArray()).sort(i));u=[];for(var d=0;d{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(t2,{"Array | Matrix, Array | Matrix":function(l,f){if(n(t(l),new a(0))===0)return!0;if(n(t(f),new a(0))===0)return!1;for(var o=Pa(gr(Array.isArray(l)?l:l.toArray()).sort(i)),u=Pa(gr(Array.isArray(f)?f:f.toArray()).sort(i)),p,h=0;h{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(i2,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(l,f){if(n(t(f),new a(0))===0)return 0;for(var o=gr(Array.isArray(f)?f:f.toArray()),u=0,p=0;p{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(o2,{"Array | Matrix":function(o){if(n(t(o),new a(0))===0)return[];for(var u=gr(Array.isArray(o)?o:o.toArray()).sort(i),p=[],h=0;h.toString(2).length<=u.length;)p.push(s(u,h.toString(2).split("").reverse())),h++;return l(p)}});function s(f,o){for(var u=[],p=0;p0;u--)for(var p=0;pf[p+1].length&&(o=f[p],f[p]=f[p+1],f[p+1]=o);return f}});var u2="setSize",qU=["typed","compareNatural"],f2=T(u2,qU,e=>{var{typed:r,compareNatural:t}=e;return r(u2,{"Array | Matrix":function(i){return Array.isArray(i)?gr(i).length:gr(i.toArray()).length},"Array | Matrix, boolean":function(i,a){if(a===!1||i.length===0)return Array.isArray(i)?gr(i).length:gr(i.toArray()).length;for(var s=gr(Array.isArray(i)?i:i.toArray()).sort(t),l=1,f=1;f{var{typed:r,size:t,concat:n,subset:i,setDifference:a,Index:s}=e;return r(l2,{"Array | Matrix, Array | Matrix":function(f,o){if(i(t(f),new s(0))===0)return gr(o);if(i(t(o),new s(0))===0)return gr(f);var u=gr(f),p=gr(o);return n(a(u,p),a(p,u))}})});var p2="setUnion",zU=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],m2=T(p2,zU,e=>{var{typed:r,size:t,concat:n,subset:i,setIntersect:a,setSymDifference:s,Index:l}=e;return r(p2,{"Array | Matrix, Array | Matrix":function(o,u){if(i(t(o),new l(0))===0)return gr(u);if(i(t(u),new l(0))===0)return gr(o);var p=gr(o),h=gr(u);return n(s(p,h),a(p,h))}})});var h2="add",WU=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],d2=T(h2,WU,e=>{var{typed:r,matrix:t,addScalar:n,equalScalar:i,DenseMatrix:a,SparseMatrix:s,concat:l}=e,f=dn({typed:r}),o=su({typed:r,equalScalar:i}),u=Un({typed:r,DenseMatrix:a}),p=vr({typed:r,matrix:t,concat:l});return r(h2,{"any, any":n,"any, any, ...any":r.referToSelf(h=>(d,x,v)=>{for(var y=h(d,x),w=0;w{var{typed:r,abs:t,addScalar:n,divideScalar:i,multiplyScalar:a,sqrt:s,smaller:l,isPositive:f}=e;return r(v2,{"... number | BigNumber":o,Array:o,Matrix:u=>o(gr(u.toArray()))});function o(u){for(var p=0,h=0,d=0;d{var{typed:r,abs:t,add:n,pow:i,conj:a,sqrt:s,multiply:l,equalScalar:f,larger:o,smaller:u,matrix:p,ctranspose:h,eigs:d}=e;return r(x2,{number:Math.abs,Complex:function(F){return F.abs()},BigNumber:function(F){return F.abs()},boolean:function(F){return Math.abs(F)},Array:function(F){return S(p(F),2)},Matrix:function(F){return S(F,2)},"Array, number | BigNumber | string":function(F,M){return S(p(F),M)},"Matrix, number | BigNumber | string":function(F,M){return S(F,M)}});function x(O){var F=0;return O.forEach(function(M){var _=t(M);o(_,F)&&(F=_)},!0),F}function v(O){var F;return O.forEach(function(M){var _=t(M);(!F||u(_,F))&&(F=_)},!0),F||0}function y(O,F){if(F===Number.POSITIVE_INFINITY||F==="inf")return x(O);if(F===Number.NEGATIVE_INFINITY||F==="-inf")return v(O);if(F==="fro")return S(O,2);if(typeof F=="number"&&!isNaN(F)){if(!f(F,0)){var M=0;return O.forEach(function(_){M=n(i(t(_),F),M)},!0),i(M,1/F)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function w(O){var F=0;return O.forEach(function(M,_){F=n(F,l(M,a(M)))}),t(s(F))}function C(O){var F=[],M=0;return O.forEach(function(_,k){var L=k[1],Y=n(F[L]||0,t(_));o(Y,M)&&(M=Y),F[L]=Y},!0),M}function b(O){var F=O.size();if(F[0]!==F[1])throw new RangeError("Invalid matrix dimensions");var M=h(O),_=l(M,O),k=d(_).values.toArray(),L=k[k.length-1];return t(s(L))}function A(O){var F=[],M=0;return O.forEach(function(_,k){var L=k[0],Y=n(F[L]||0,t(_));o(Y,M)&&(M=Y),F[L]=Y},!0),M}function E(O,F){if(F===1)return C(O);if(F===Number.POSITIVE_INFINITY||F==="inf")return A(O);if(F==="fro")return w(O);if(F===2)return b(O);throw new Error("Unsupported parameter value "+F)}function S(O,F){var M=O.size();if(M.length===1)return y(O,F);if(M.length===2){if(M[0]&&M[1])return E(O,F);throw new RangeError("Invalid matrix dimensions")}}});var b2="dot",HU=["typed","addScalar","multiplyScalar","conj","size"],w2=T(b2,HU,e=>{var{typed:r,addScalar:t,multiplyScalar:n,conj:i,size:a}=e;return r(b2,{"Array | DenseMatrix, Array | DenseMatrix":l,"SparseMatrix, SparseMatrix":f});function s(u,p){var h=o(u),d=o(p),x,v;if(h.length===1)x=h[0];else if(h.length===2&&h[1]===1)x=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(d.length===1)v=d[0];else if(d.length===2&&d[1]===1)v=d[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+d.join(", ")+")");if(x!==v)throw new RangeError("Vectors must have equal length ("+x+" != "+v+")");if(x===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return x}function l(u,p){var h=s(u,p),d=Ge(u)?u._data:u,x=Ge(u)?u._datatype||u.getDataType():void 0,v=Ge(p)?p._data:p,y=Ge(p)?p._datatype||p.getDataType():void 0,w=o(u).length===2,C=o(p).length===2,b=t,A=n;if(x&&y&&x===y&&typeof x=="string"&&x!=="mixed"){var E=x;b=r.find(t,[E,E]),A=r.find(n,[E,E])}if(!w&&!C){for(var S=A(i(d[0]),v[0]),O=1;OS){A++;continue}E===S&&(y=w(y,C(d[b],v[A])),b++,A++)}return y}function o(u){return Ge(u)?u.size():a(u)}});var GU="trace",$U=["typed","matrix","add"],D2=T(GU,$U,e=>{var{typed:r,matrix:t,add:n}=e;return r("trace",{Array:function(l){return i(t(l))},SparseMatrix:a,DenseMatrix:i,any:tr});function i(s){var l=s._size,f=s._data;switch(l.length){case 1:if(l[0]===1)return tr(f[0]);throw new RangeError("Matrix must be square (size: "+lr(l)+")");case 2:{var o=l[0],u=l[1];if(o===u){for(var p=0,h=0;h0)for(var x=0;xx)break}return d}throw new RangeError("Matrix must be square (size: "+lr(u)+")")}});var S2="index",ZU=["typed","Index"],N2=T(S2,ZU,e=>{var{typed:r,Index:t}=e;return r(S2,{"...number | string | BigNumber | Range | Array | Matrix":function(i){var a=i.map(function(l){return je(l)?l.toNumber():Ar(l)||Ge(l)?l.map(function(f){return je(f)?f.toNumber():f}):l}),s=new t;return t.apply(s,a),s}})});var vp=new Set(["end"]);var QU="Node",XU=["mathWithTransform"],A2=T(QU,XU,e=>{var{mathWithTransform:r}=e;function t(i){for(var a of[...vp])if(i.has(a))throw new Error('Scope contains an illegal symbol, "'+a+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(a){return this.compile().evaluate(a)}compile(){var a=this._compile(r,{}),s={},l=null;function f(o){var u=ka(o);return t(u),a(u,s,l)}return{evaluate:f}}_compile(a,s){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(a){throw new Error("Cannot run forEach on a Node interface")}map(a){throw new Error("Cannot run map on a Node interface")}_ifNode(a){if(!Sr(a))throw new TypeError("Callback function must return a Node");return a}traverse(a){a(this,null,null);function s(l,f){l.forEach(function(o,u,p){f(o,u,p),s(o,f)})}s(this,a)}transform(a){function s(l,f,o){var u=a(l,f,o);return u!==l?u:l.map(s)}return s(this,null,null)}filter(a){var s=[];return this.traverse(function(l,f,o){a(l,f,o)&&s.push(l)}),s}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(a){return a.cloneDeep()})}equals(a){return a?this.type===a.type&&zi(this,a):!1}toString(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toString(a)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toHTML(a)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toTex(a)}_toTex(a){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(a){if(a&&typeof a=="object")switch(typeof a.handler){case"object":case"undefined":return;case"function":return a.handler(this,a);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});function lt(e){return e&&e.isIndexError?new Xt(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function gp(e){var{subset:r}=e;return function(n,i){try{if(Array.isArray(n))return r(n,i);if(n&&typeof n.subset=="function")return n.subset(i);if(typeof n=="string")return r(n,i);if(typeof n=="object"){if(!i.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return gt(n,i.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(a){throw lt(a)}}}var xp="AccessorNode",JU=["subset","Node"],E2=T(xp,JU,e=>{var{subset:r,Node:t}=e,n=gp({subset:r});function i(s){return!(Sn(s)||$t(s)||yr(s)||fn(s)||la(s)||Zt(s)||rt(s))}class a extends t{constructor(l,f){if(super(),!Sr(l))throw new TypeError('Node expected for parameter "object"');if(!kn(f))throw new TypeError('IndexNode expected for parameter "index"');this.object=l,this.index=f}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return xp}get isAccessorNode(){return!0}_compile(l,f){var o=this.object._compile(l,f),u=this.index._compile(l,f);if(this.index.isObjectProperty()){var p=this.index.getObjectProperty();return function(d,x,v){return gt(o(d,x,v),p)}}else return function(d,x,v){var y=o(d,x,v),w=u(d,x,y);return n(y,w)}}forEach(l){l(this.object,"object",this),l(this.index,"index",this)}map(l){return new a(this._ifNode(l(this.object,"object",this)),this._ifNode(l(this.index,"index",this)))}clone(){return new a(this.object,this.index)}_toString(l){var f=this.object.toString(l);return i(this.object)&&(f="("+f+")"),f+this.index.toString(l)}_toHTML(l){var f=this.object.toHTML(l);return i(this.object)&&(f='('+f+')'),f+this.index.toHTML(l)}_toTex(l){var f=this.object.toTex(l);return i(this.object)&&(f="\\\\left(' + object + '\\\\right)"),f+this.index.toTex(l)}toJSON(){return{mathjs:xp,object:this.object,index:this.index}}static fromJSON(l){return new a(l.object,l.index)}}return Ur(a,"name",xp),a},{isClass:!0,isNode:!0});var yp="ArrayNode",KU=["Node"],C2=T(yp,KU,e=>{var{Node:r}=e;class t extends r{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(Sr))throw new TypeError("Array containing Nodes expected")}get type(){return yp}get isArrayNode(){return!0}_compile(i,a){var s=Rn(this.items,function(o){return o._compile(i,a)}),l=i.config.matrix!=="Array";if(l){var f=i.matrix;return function(u,p,h){return f(Rn(s,function(d){return d(u,p,h)}))}}else return function(u,p,h){return Rn(s,function(d){return d(u,p,h)})}}forEach(i){for(var a=0;a['+a.join(',')+']'}_toTex(i){function a(s,l){var f=s.some($t)&&!s.every($t),o=l||f,u=o?"&":"\\\\\\\\",p=s.map(function(h){return h.items?a(h.items,!l):h.toTex(i)}).join(u);return f||!o||o&&!l?"\\\\begin{bmatrix}"+p+"\\\\end{bmatrix}":p}return a(this.items,!1)}}return Ur(t,"name",yp),t},{isClass:!0,isNode:!0});function M2(e){var{subset:r,matrix:t}=e;return function(i,a,s){try{if(Array.isArray(i)){var l=t(i).subset(a,s).valueOf();return l.forEach((f,o)=>{i[o]=f}),i}else{if(i&&typeof i.subset=="function")return i.subset(a,s);if(typeof i=="string")return r(i,a,s);if(typeof i=="object"){if(!a.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return ca(i,a.getObjectProperty(),s),i}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(f){throw lt(f)}}}var yi=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function bp(e,r){if(!r||r!=="auto")return e;for(var t=e;Zt(t);)t=t.content;return t}function Gr(e,r,t,n){var i=e;r!=="keep"&&(i=e.getContent());for(var a=i.getIdentifier(),s=null,l=0;l{var{subset:r,matrix:t,Node:n}=e,i=gp({subset:r}),a=M2({subset:r,matrix:t});function s(f,o,u){o||(o="keep");var p=Gr(f,o,u),h=Gr(f.value,o,u);return o==="all"||h!==null&&h<=p}class l extends n{constructor(o,u,p){if(super(),this.object=o,this.index=p?u:null,this.value=p||u,!rt(o)&&!Sn(o))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(rt(o)&&o.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!kn(this.index))throw new TypeError('IndexNode expected as "index"');if(!Sr(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Dp}get isAssignmentNode(){return!0}_compile(o,u){var p=this.object._compile(o,u),h=this.index?this.index._compile(o,u):null,d=this.value._compile(o,u),x=this.object.name;if(this.index)if(this.index.isObjectProperty()){var v=this.index.getObjectProperty();return function(A,E,S){var O=p(A,E,S),F=d(A,E,S);return ca(O,v,F),F}}else{if(rt(this.object))return function(A,E,S){var O=p(A,E,S),F=d(A,E,S),M=h(A,E,O);return A.set(x,a(O,M,F)),F};var y=this.object.object._compile(o,u);if(this.object.index.isObjectProperty()){var w=this.object.index.getObjectProperty();return function(A,E,S){var O=y(A,E,S),F=gt(O,w),M=h(A,E,F),_=d(A,E,S);return ca(O,w,a(F,M,_)),_}}else{var C=this.object.index._compile(o,u);return function(A,E,S){var O=y(A,E,S),F=C(A,E,O),M=i(O,F),_=h(A,E,M),k=d(A,E,S);return a(O,F,a(M,_,k)),k}}}else{if(!rt(this.object))throw new TypeError("SymbolNode expected as object");return function(A,E,S){var O=d(A,E,S);return A.set(x,O),O}}}forEach(o){o(this.object,"object",this),this.index&&o(this.index,"index",this),o(this.value,"value",this)}map(o){var u=this._ifNode(o(this.object,"object",this)),p=this.index?this._ifNode(o(this.index,"index",this)):null,h=this._ifNode(o(this.value,"value",this));return new l(u,p,h)}clone(){return new l(this.object,this.index,this.value)}_toString(o){var u=this.object.toString(o),p=this.index?this.index.toString(o):"",h=this.value.toString(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(h="("+h+")"),u+p+" = "+h}toJSON(){return{mathjs:Dp,object:this.object,index:this.index,value:this.value}}static fromJSON(o){return new l(o.object,o.index,o.value)}_toHTML(o){var u=this.object.toHTML(o),p=this.index?this.index.toHTML(o):"",h=this.value.toHTML(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(h='('+h+')'),u+p+'='+h}_toTex(o){var u=this.object.toTex(o),p=this.index?this.index.toTex(o):"",h=this.value.toTex(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(h="\\\\left(".concat(h,"\\\\right)")),u+p+"="+h}}return Ur(l,"name",Dp),l},{isClass:!0,isNode:!0});var Sp="BlockNode",ez=["ResultSet","Node"],F2=T(Sp,ez,e=>{var{ResultSet:r,Node:t}=e;class n extends t{constructor(a){if(super(),!Array.isArray(a))throw new Error("Array expected");this.blocks=a.map(function(s){var l=s&&s.node,f=s&&s.visible!==void 0?s.visible:!0;if(!Sr(l))throw new TypeError('Property "node" must be a Node');if(typeof f!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:l,visible:f}})}get type(){return Sp}get isBlockNode(){return!0}_compile(a,s){var l=Rn(this.blocks,function(f){return{evaluate:f.node._compile(a,s),visible:f.visible}});return function(o,u,p){var h=[];return ho(l,function(x){var v=x.evaluate(o,u,p);x.visible&&h.push(v)}),new r(h)}}forEach(a){for(var s=0;s;')}).join('
')}_toTex(a){return this.blocks.map(function(s){return s.node.toTex(a)+(s.visible?"":";")}).join(\`\\\\;\\\\; -\`)}}return Ur(n,"name",Sp),n},{isClass:!0,isNode:!0});var Np="ConditionalNode",rz=["Node"],O2=T(Np,rz,e=>{var{Node:r}=e;function t(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if(je(i))return!i.isZero();if(Gt(i))return!!(i.re||i.im);if(qt(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+_r(i)+'"')}class n extends r{constructor(a,s,l){if(super(),!Sr(a))throw new TypeError("Parameter condition must be a Node");if(!Sr(s))throw new TypeError("Parameter trueExpr must be a Node");if(!Sr(l))throw new TypeError("Parameter falseExpr must be a Node");this.condition=a,this.trueExpr=s,this.falseExpr=l}get type(){return Np}get isConditionalNode(){return!0}_compile(a,s){var l=this.condition._compile(a,s),f=this.trueExpr._compile(a,s),o=this.falseExpr._compile(a,s);return function(p,h,d){return t(l(p,h,d))?f(p,h,d):o(p,h,d)}}forEach(a){a(this.condition,"condition",this),a(this.trueExpr,"trueExpr",this),a(this.falseExpr,"falseExpr",this)}map(a){return new n(this._ifNode(a(this.condition,"condition",this)),this._ifNode(a(this.trueExpr,"trueExpr",this)),this._ifNode(a(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(a){var s=a&&a.parenthesis?a.parenthesis:"keep",l=Gr(this,s,a&&a.implicit),f=this.condition.toString(a),o=Gr(this.condition,s,a&&a.implicit);(s==="all"||this.condition.type==="OperatorNode"||o!==null&&o<=l)&&(f="("+f+")");var u=this.trueExpr.toString(a),p=Gr(this.trueExpr,s,a&&a.implicit);(s==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=l)&&(u="("+u+")");var h=this.falseExpr.toString(a),d=Gr(this.falseExpr,s,a&&a.implicit);return(s==="all"||this.falseExpr.type==="OperatorNode"||d!==null&&d<=l)&&(h="("+h+")"),f+" ? "+u+" : "+h}toJSON(){return{mathjs:Np,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(a){return new n(a.condition,a.trueExpr,a.falseExpr)}_toHTML(a){var s=a&&a.parenthesis?a.parenthesis:"keep",l=Gr(this,s,a&&a.implicit),f=this.condition.toHTML(a),o=Gr(this.condition,s,a&&a.implicit);(s==="all"||this.condition.type==="OperatorNode"||o!==null&&o<=l)&&(f='('+f+')');var u=this.trueExpr.toHTML(a),p=Gr(this.trueExpr,s,a&&a.implicit);(s==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=l)&&(u='('+u+')');var h=this.falseExpr.toHTML(a),d=Gr(this.falseExpr,s,a&&a.implicit);return(s==="all"||this.falseExpr.type==="OperatorNode"||d!==null&&d<=l)&&(h='('+h+')'),f+'?'+u+':'+h}_toTex(a){return"\\\\begin{cases} {"+this.trueExpr.toTex(a)+"}, &\\\\quad{\\\\text{if }\\\\;"+this.condition.toTex(a)+"}\\\\\\\\{"+this.falseExpr.toTex(a)+"}, &\\\\quad{\\\\text{otherwise}}\\\\end{cases}"}}return Ur(n,"name",Np),n},{isClass:!0,isNode:!0});var k2=Xn(I2(),1);var hg={Alpha:"A",alpha:"\\\\alpha",Beta:"B",beta:"\\\\beta",Gamma:"\\\\Gamma",gamma:"\\\\gamma",Delta:"\\\\Delta",delta:"\\\\delta",Epsilon:"E",epsilon:"\\\\epsilon",varepsilon:"\\\\varepsilon",Zeta:"Z",zeta:"\\\\zeta",Eta:"H",eta:"\\\\eta",Theta:"\\\\Theta",theta:"\\\\theta",vartheta:"\\\\vartheta",Iota:"I",iota:"\\\\iota",Kappa:"K",kappa:"\\\\kappa",varkappa:"\\\\varkappa",Lambda:"\\\\Lambda",lambda:"\\\\lambda",Mu:"M",mu:"\\\\mu",Nu:"N",nu:"\\\\nu",Xi:"\\\\Xi",xi:"\\\\xi",Omicron:"O",omicron:"o",Pi:"\\\\Pi",pi:"\\\\pi",varpi:"\\\\varpi",Rho:"P",rho:"\\\\rho",varrho:"\\\\varrho",Sigma:"\\\\Sigma",sigma:"\\\\sigma",varsigma:"\\\\varsigma",Tau:"T",tau:"\\\\tau",Upsilon:"\\\\Upsilon",upsilon:"\\\\upsilon",Phi:"\\\\Phi",phi:"\\\\phi",varphi:"\\\\varphi",Chi:"X",chi:"\\\\chi",Psi:"\\\\Psi",psi:"\\\\psi",Omega:"\\\\Omega",omega:"\\\\omega",true:"\\\\mathrm{True}",false:"\\\\mathrm{False}",i:"i",inf:"\\\\infty",Inf:"\\\\infty",infinity:"\\\\infty",Infinity:"\\\\infty",oo:"\\\\infty",lim:"\\\\lim",undefined:"\\\\mathbf{?}"},zr={transpose:"^\\\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\\\~",not:"\\\\neg",multiply:"\\\\cdot",divide:"\\\\frac",dotMultiply:".\\\\cdot",dotDivide:".:",mod:"\\\\mod",add:"+",subtract:"-",to:"\\\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\\\neq",smaller:"<",larger:">",smallerEq:"\\\\leq",largerEq:"\\\\geq",bitAnd:"\\\\&",bitXor:"\\\\underline{|}",bitOr:"|",and:"\\\\wedge",xor:"\\\\veebar",or:"\\\\vee"},dg={abs:{1:"\\\\left|\${args[0]}\\\\right|"},add:{2:"\\\\left(\${args[0]}".concat(zr.add,"\${args[1]}\\\\right)")},cbrt:{1:"\\\\sqrt[3]{\${args[0]}}"},ceil:{1:"\\\\left\\\\lceil\${args[0]}\\\\right\\\\rceil"},cube:{1:"\\\\left(\${args[0]}\\\\right)^3"},divide:{2:"\\\\frac{\${args[0]}}{\${args[1]}}"},dotDivide:{2:"\\\\left(\${args[0]}".concat(zr.dotDivide,"\${args[1]}\\\\right)")},dotMultiply:{2:"\\\\left(\${args[0]}".concat(zr.dotMultiply,"\${args[1]}\\\\right)")},dotPow:{2:"\\\\left(\${args[0]}".concat(zr.dotPow,"\${args[1]}\\\\right)")},exp:{1:"\\\\exp\\\\left(\${args[0]}\\\\right)"},expm1:"\\\\left(e".concat(zr.pow,"{\${args[0]}}-1\\\\right)"),fix:{1:"\\\\mathrm{\${name}}\\\\left(\${args[0]}\\\\right)"},floor:{1:"\\\\left\\\\lfloor\${args[0]}\\\\right\\\\rfloor"},gcd:"\\\\gcd\\\\left(\${args}\\\\right)",hypot:"\\\\hypot\\\\left(\${args}\\\\right)",log:{1:"\\\\ln\\\\left(\${args[0]}\\\\right)",2:"\\\\log_{\${args[1]}}\\\\left(\${args[0]}\\\\right)"},log10:{1:"\\\\log_{10}\\\\left(\${args[0]}\\\\right)"},log1p:{1:"\\\\ln\\\\left(\${args[0]}+1\\\\right)",2:"\\\\log_{\${args[1]}}\\\\left(\${args[0]}+1\\\\right)"},log2:"\\\\log_{2}\\\\left(\${args[0]}\\\\right)",mod:{2:"\\\\left(\${args[0]}".concat(zr.mod,"\${args[1]}\\\\right)")},multiply:{2:"\\\\left(\${args[0]}".concat(zr.multiply,"\${args[1]}\\\\right)")},norm:{1:"\\\\left\\\\|\${args[0]}\\\\right\\\\|",2:void 0},nthRoot:{2:"\\\\sqrt[\${args[1]}]{\${args[0]}}"},nthRoots:{2:"\\\\{y : $y^{args[1]} = {\${args[0]}}\\\\}"},pow:{2:"\\\\left(\${args[0]}\\\\right)".concat(zr.pow,"{\${args[1]}}")},round:{1:"\\\\left\\\\lfloor\${args[0]}\\\\right\\\\rceil",2:void 0},sign:{1:"\\\\mathrm{\${name}}\\\\left(\${args[0]}\\\\right)"},sqrt:{1:"\\\\sqrt{\${args[0]}}"},square:{1:"\\\\left(\${args[0]}\\\\right)^2"},subtract:{2:"\\\\left(\${args[0]}".concat(zr.subtract,"\${args[1]}\\\\right)")},unaryMinus:{1:"".concat(zr.unaryMinus,"\\\\left(\${args[0]}\\\\right)")},unaryPlus:{1:"".concat(zr.unaryPlus,"\\\\left(\${args[0]}\\\\right)")},bitAnd:{2:"\\\\left(\${args[0]}".concat(zr.bitAnd,"\${args[1]}\\\\right)")},bitNot:{1:zr.bitNot+"\\\\left(\${args[0]}\\\\right)"},bitOr:{2:"\\\\left(\${args[0]}".concat(zr.bitOr,"\${args[1]}\\\\right)")},bitXor:{2:"\\\\left(\${args[0]}".concat(zr.bitXor,"\${args[1]}\\\\right)")},leftShift:{2:"\\\\left(\${args[0]}".concat(zr.leftShift,"\${args[1]}\\\\right)")},rightArithShift:{2:"\\\\left(\${args[0]}".concat(zr.rightArithShift,"\${args[1]}\\\\right)")},rightLogShift:{2:"\\\\left(\${args[0]}".concat(zr.rightLogShift,"\${args[1]}\\\\right)")},bellNumbers:{1:"\\\\mathrm{B}_{\${args[0]}}"},catalan:{1:"\\\\mathrm{C}_{\${args[0]}}"},stirlingS2:{2:"\\\\mathrm{S}\\\\left(\${args}\\\\right)"},arg:{1:"\\\\arg\\\\left(\${args[0]}\\\\right)"},conj:{1:"\\\\left(\${args[0]}\\\\right)^*"},im:{1:"\\\\Im\\\\left\\\\lbrace\${args[0]}\\\\right\\\\rbrace"},re:{1:"\\\\Re\\\\left\\\\lbrace\${args[0]}\\\\right\\\\rbrace"},and:{2:"\\\\left(\${args[0]}".concat(zr.and,"\${args[1]}\\\\right)")},not:{1:zr.not+"\\\\left(\${args[0]}\\\\right)"},or:{2:"\\\\left(\${args[0]}".concat(zr.or,"\${args[1]}\\\\right)")},xor:{2:"\\\\left(\${args[0]}".concat(zr.xor,"\${args[1]}\\\\right)")},cross:{2:"\\\\left(\${args[0]}\\\\right)\\\\times\\\\left(\${args[1]}\\\\right)"},ctranspose:{1:"\\\\left(\${args[0]}\\\\right)".concat(zr.ctranspose)},det:{1:"\\\\det\\\\left(\${args[0]}\\\\right)"},dot:{2:"\\\\left(\${args[0]}\\\\cdot\${args[1]}\\\\right)"},expm:{1:"\\\\exp\\\\left(\${args[0]}\\\\right)"},inv:{1:"\\\\left(\${args[0]}\\\\right)^{-1}"},pinv:{1:"\\\\left(\${args[0]}\\\\right)^{+}"},sqrtm:{1:"{\${args[0]}}".concat(zr.pow,"{\\\\frac{1}{2}}")},trace:{1:"\\\\mathrm{tr}\\\\left(\${args[0]}\\\\right)"},transpose:{1:"\\\\left(\${args[0]}\\\\right)".concat(zr.transpose)},combinations:{2:"\\\\binom{\${args[0]}}{\${args[1]}}"},combinationsWithRep:{2:"\\\\left(\\\\!\\\\!{\\\\binom{\${args[0]}}{\${args[1]}}}\\\\!\\\\!\\\\right)"},factorial:{1:"\\\\left(\${args[0]}\\\\right)".concat(zr.factorial)},gamma:{1:"\\\\Gamma\\\\left(\${args[0]}\\\\right)"},lgamma:{1:"\\\\ln\\\\Gamma\\\\left(\${args[0]}\\\\right)"},equal:{2:"\\\\left(\${args[0]}".concat(zr.equal,"\${args[1]}\\\\right)")},larger:{2:"\\\\left(\${args[0]}".concat(zr.larger,"\${args[1]}\\\\right)")},largerEq:{2:"\\\\left(\${args[0]}".concat(zr.largerEq,"\${args[1]}\\\\right)")},smaller:{2:"\\\\left(\${args[0]}".concat(zr.smaller,"\${args[1]}\\\\right)")},smallerEq:{2:"\\\\left(\${args[0]}".concat(zr.smallerEq,"\${args[1]}\\\\right)")},unequal:{2:"\\\\left(\${args[0]}".concat(zr.unequal,"\${args[1]}\\\\right)")},erf:{1:"erf\\\\left(\${args[0]}\\\\right)"},max:"\\\\max\\\\left(\${args}\\\\right)",min:"\\\\min\\\\left(\${args}\\\\right)",variance:"\\\\mathrm{Var}\\\\left(\${args}\\\\right)",acos:{1:"\\\\cos^{-1}\\\\left(\${args[0]}\\\\right)"},acosh:{1:"\\\\cosh^{-1}\\\\left(\${args[0]}\\\\right)"},acot:{1:"\\\\cot^{-1}\\\\left(\${args[0]}\\\\right)"},acoth:{1:"\\\\coth^{-1}\\\\left(\${args[0]}\\\\right)"},acsc:{1:"\\\\csc^{-1}\\\\left(\${args[0]}\\\\right)"},acsch:{1:"\\\\mathrm{csch}^{-1}\\\\left(\${args[0]}\\\\right)"},asec:{1:"\\\\sec^{-1}\\\\left(\${args[0]}\\\\right)"},asech:{1:"\\\\mathrm{sech}^{-1}\\\\left(\${args[0]}\\\\right)"},asin:{1:"\\\\sin^{-1}\\\\left(\${args[0]}\\\\right)"},asinh:{1:"\\\\sinh^{-1}\\\\left(\${args[0]}\\\\right)"},atan:{1:"\\\\tan^{-1}\\\\left(\${args[0]}\\\\right)"},atan2:{2:"\\\\mathrm{atan2}\\\\left(\${args}\\\\right)"},atanh:{1:"\\\\tanh^{-1}\\\\left(\${args[0]}\\\\right)"},cos:{1:"\\\\cos\\\\left(\${args[0]}\\\\right)"},cosh:{1:"\\\\cosh\\\\left(\${args[0]}\\\\right)"},cot:{1:"\\\\cot\\\\left(\${args[0]}\\\\right)"},coth:{1:"\\\\coth\\\\left(\${args[0]}\\\\right)"},csc:{1:"\\\\csc\\\\left(\${args[0]}\\\\right)"},csch:{1:"\\\\mathrm{csch}\\\\left(\${args[0]}\\\\right)"},sec:{1:"\\\\sec\\\\left(\${args[0]}\\\\right)"},sech:{1:"\\\\mathrm{sech}\\\\left(\${args[0]}\\\\right)"},sin:{1:"\\\\sin\\\\left(\${args[0]}\\\\right)"},sinh:{1:"\\\\sinh\\\\left(\${args[0]}\\\\right)"},tan:{1:"\\\\tan\\\\left(\${args[0]}\\\\right)"},tanh:{1:"\\\\tanh\\\\left(\${args[0]}\\\\right)"},to:{2:"\\\\left(\${args[0]}".concat(zr.to,"\${args[1]}\\\\right)")},numeric:function(r,t){return r.args[0].toTex()},number:{0:"0",1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\\\\left(\${args[0]}\\\\right)\${args[1]}\\\\right)"},string:{0:'\\\\mathtt{""}',1:"\\\\mathrm{string}\\\\left(\${args[0]}\\\\right)"},bignumber:{0:"0",1:"\\\\left(\${args[0]}\\\\right)"},complex:{0:"0",1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\\\\left(\${args[0]}\\\\right)+".concat(hg.i,"\\\\cdot\\\\left(\${args[1]}\\\\right)\\\\right)")},matrix:{0:"\\\\begin{bmatrix}\\\\end{bmatrix}",1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\${args[0]}\\\\right)"},sparse:{0:"\\\\begin{bsparse}\\\\end{bsparse}",1:"\\\\left(\${args[0]}\\\\right)"},unit:{1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\\\\left(\${args[0]}\\\\right)\${args[1]}\\\\right)"}},R2="\\\\mathrm{\${name}}\\\\left(\${args}\\\\right)",P2={deg:"^\\\\circ"};function Ap(e){return(0,k2.default)(e,{preserveFormatting:!0})}function Ep(e,r){return r=typeof r>"u"?!1:r,r?$e(P2,e)?P2[e]:"\\\\mathrm{"+Ap(e)+"}":$e(hg,e)?hg[e]:Ap(e)}var Cp="ConstantNode",az=["Node"],L2=T(Cp,az,e=>{var{Node:r}=e;class t extends r{constructor(i){super(),this.value=i}get type(){return Cp}get isConstantNode(){return!0}_compile(i,a){var s=this.value;return function(){return s}}forEach(i){}map(i){return this.clone()}clone(){return new t(this.value)}_toString(i){return lr(this.value,i)}_toHTML(i){var a=this._toString(i);switch(_r(this.value)){case"number":case"BigNumber":case"Fraction":return''+a+"";case"string":return''+a+"";case"boolean":return''+a+"";case"null":return''+a+"";case"undefined":return''+a+"";default:return''+a+""}}toJSON(){return{mathjs:Cp,value:this.value}}static fromJSON(i){return new t(i.value)}_toTex(i){var a=this._toString(i),s=_r(this.value);switch(s){case"string":return"\\\\mathtt{"+Ap(a)+"}";case"number":case"BigNumber":{var l=s==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!l)return this.value.valueOf()<0?"-\\\\infty":"\\\\infty";var f=a.toLowerCase().indexOf("e");return f!==-1?a.substring(0,f)+"\\\\cdot10^{"+a.substring(f+1)+"}":a}case"Fraction":return this.value.toLatex();default:return a}}}return Ur(t,"name",Cp),t},{isClass:!0,isNode:!0});var Mp="FunctionAssignmentNode",oz=["typed","Node"],q2=T(Mp,oz,e=>{var{typed:r,Node:t}=e;function n(a,s,l){var f=Gr(a,s,l),o=Gr(a.expr,s,l);return s==="all"||o!==null&&o<=f}class i extends t{constructor(s,l,f){if(super(),typeof s!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(l))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!Sr(f))throw new TypeError('Node expected for parameter "expr"');if(vp.has(s))throw new Error('Illegal function name, "'+s+'" is a reserved keyword');var o=new Set;for(var u of l){var p=typeof u=="string"?u:u.name;if(o.has(p))throw new Error('Duplicate parameter name "'.concat(p,'"'));o.add(p)}this.name=s,this.params=l.map(function(h){return h&&h.name||h}),this.types=l.map(function(h){return h&&h.type||"any"}),this.expr=f}get type(){return Mp}get isFunctionAssignmentNode(){return!0}_compile(s,l){var f=Object.create(l);ho(this.params,function(x){f[x]=!0});var o=this.expr._compile(s,f),u=this.name,p=this.params,h=Gd(this.types,","),d=u+"("+Gd(this.params,", ")+")";return function(v,y,w){var C={};C[h]=function(){for(var A=Object.create(y),E=0;E'+Qt(this.params[o])+"");var u=this.expr.toHTML(s);return n(this,l,s&&s.implicit)&&(u='('+u+')'),''+Qt(this.name)+'('+f.join(',')+')='+u}_toTex(s){var l=s&&s.parenthesis?s.parenthesis:"keep",f=this.expr.toTex(s);return n(this,l,s&&s.implicit)&&(f="\\\\left(".concat(f,"\\\\right)")),"\\\\mathrm{"+this.name+"}\\\\left("+this.params.map(Ep).join(",")+"\\\\right)="+f}}return Ur(i,"name",Mp),i},{isClass:!0,isNode:!0});var _p="IndexNode",sz=["Node","size"],U2=T(_p,sz,e=>{var{Node:r,size:t}=e;class n extends r{constructor(a,s){if(super(),this.dimensions=a,this.dotNotation=s||!1,!Array.isArray(a)||!a.every(Sr))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return _p}get isIndexNode(){return!0}_compile(a,s){var l=Rn(this.dimensions,function(o,u){var p=o.filter(x=>x.isSymbolNode&&x.name==="end").length>0;if(p){var h=Object.create(s);h.end=!0;var d=o._compile(a,h);return function(v,y,w){if(!Ge(w)&&!Ar(w)&&!yt(w))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+_r(w));var C=t(w).valueOf(),b=Object.create(y);return b.end=C[u],d(v,b,w)}}else return o._compile(a,s)}),f=gt(a,"index");return function(u,p,h){var d=Rn(l,function(x){return x(u,p,h)});return f(...d)}}forEach(a){for(var s=0;s.'+Qt(this.getObjectProperty())+"":'['+s.join(',')+']'}_toTex(a){var s=this.dimensions.map(function(l){return l.toTex(a)});return this.dotNotation?"."+this.getObjectProperty():"_{"+s.join(",")+"}"}}return Ur(n,"name",_p),n},{isClass:!0,isNode:!0});var Tp="ObjectNode",uz=["Node"],z2=T(Tp,uz,e=>{var{Node:r}=e;class t extends r{constructor(i){if(super(),this.properties=i||{},i&&(typeof i!="object"||!Object.keys(i).every(function(a){return Sr(i[a])})))throw new TypeError("Object containing Nodes expected")}get type(){return Tp}get isObjectNode(){return!0}_compile(i,a){var s={};for(var l in this.properties)if($e(this.properties,l)){var f=Ko(l),o=JSON.parse(f),u=gt(this.properties,l);s[o]=u._compile(i,a)}return function(h,d,x){var v={};for(var y in s)$e(s,y)&&(v[y]=s[y](h,d,x));return v}}forEach(i){for(var a in this.properties)$e(this.properties,a)&&i(this.properties[a],"properties["+Ko(a)+"]",this)}map(i){var a={};for(var s in this.properties)$e(this.properties,s)&&(a[s]=this._ifNode(i(this.properties[s],"properties["+Ko(s)+"]",this)));return new t(a)}clone(){var i={};for(var a in this.properties)$e(this.properties,a)&&(i[a]=this.properties[a]);return new t(i)}_toString(i){var a=[];for(var s in this.properties)$e(this.properties,s)&&a.push(Ko(s)+": "+this.properties[s].toString(i));return"{"+a.join(", ")+"}"}toJSON(){return{mathjs:Tp,properties:this.properties}}static fromJSON(i){return new t(i.properties)}_toHTML(i){var a=[];for(var s in this.properties)$e(this.properties,s)&&a.push(''+Qt(s)+':'+this.properties[s].toHTML(i));return'{'+a.join(',')+'}'}_toTex(i){var a=[];for(var s in this.properties)$e(this.properties,s)&&a.push("\\\\mathbf{"+s+":} & "+this.properties[s].toTex(i)+"\\\\\\\\");var l="\\\\left\\\\{\\\\begin{array}{ll}"+a.join(\` -\`)+"\\\\end{array}\\\\right\\\\}";return l}}return Ur(t,"name",Tp),t},{isClass:!0,isNode:!0});function os(e,r){return new eu(e,new rs(r),new Set(Object.keys(r)))}var Fp="OperatorNode",fz=["Node"],W2=T(Fp,fz,e=>{var{Node:r}=e;function t(a,s){var l=a;if(s==="auto")for(;Zt(l);)l=l.content;return yr(l)?!0:ut(l)?t(l.args[0],s):!1}function n(a,s,l,f,o){var u=Gr(a,s,l),p=hu(a,s);if(s==="all"||f.length>2&&a.getIdentifier()!=="OperatorNode:add"&&a.getIdentifier()!=="OperatorNode:multiply")return f.map(function(_){switch(_.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var h;switch(f.length){case 0:h=[];break;case 1:{var d=Gr(f[0],s,l,a);if(o&&d!==null){var x,v;if(s==="keep"?(x=f[0].getIdentifier(),v=a.getIdentifier()):(x=f[0].getContent().getIdentifier(),v=a.getContent().getIdentifier()),yi[u][v].latexLeftParens===!1){h=[!1];break}if(yi[d][x].latexParens===!1){h=[!1];break}}if(d===null){h=[!1];break}if(d<=u){h=[!0];break}h=[!1]}break;case 2:{var y,w=Gr(f[0],s,l,a),C=wp(a,f[0],s);w===null?y=!1:w===u&&p==="right"&&!C||w=2&&a.getIdentifier()==="OperatorNode:multiply"&&a.implicit&&s!=="all"&&l==="hide")for(var M=1;M2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var y=o.map(function(w,C){return w=w.toString(s),u[C]&&(w="("+w+")"),w});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&f==="hide"?y.join(" "):y.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:Fp,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(s){return new i(s.op,s.fn,s.args,s.implicit,s.isPercentage)}_toHTML(s){var l=s&&s.parenthesis?s.parenthesis:"keep",f=s&&s.implicit?s.implicit:"hide",o=this.args,u=n(this,l,f,o,!1);if(o.length===1){var p=hu(this,l),h=o[0].toHTML(s);return u[0]&&(h='('+h+')'),p==="right"?''+Qt(this.op)+""+h:h+''+Qt(this.op)+""}else if(o.length===2){var d=o[0].toHTML(s),x=o[1].toHTML(s);return u[0]&&(d='('+d+')'),u[1]&&(x='('+x+')'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&f==="hide"?d+''+x:d+''+Qt(this.op)+""+x}else{var v=o.map(function(y,w){return y=y.toHTML(s),u[w]&&(y='('+y+')'),y});return o.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&f==="hide"?v.join(''):v.join(''+Qt(this.op)+""):''+Qt(this.fn)+'('+v.join(',')+')'}}_toTex(s){var l=s&&s.parenthesis?s.parenthesis:"keep",f=s&&s.implicit?s.implicit:"hide",o=this.args,u=n(this,l,f,o,!0),p=zr[this.fn];if(p=typeof p>"u"?this.op:p,o.length===1){var h=hu(this,l),d=o[0].toTex(s);return u[0]&&(d="\\\\left(".concat(d,"\\\\right)")),h==="right"?p+d:d+p}else if(o.length===2){var x=o[0],v=x.toTex(s);u[0]&&(v="\\\\left(".concat(v,"\\\\right)"));var y=o[1],w=y.toTex(s);u[1]&&(w="\\\\left(".concat(w,"\\\\right)"));var C;switch(l==="keep"?C=x.getIdentifier():C=x.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return p+"{"+v+"}{"+w+"}";case"OperatorNode:pow":switch(v="{"+v+"}",w="{"+w+"}",C){case"ConditionalNode":case"OperatorNode:divide":v="\\\\left(".concat(v,"\\\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&f==="hide")return v+"~"+w}return v+p+w}else if(o.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var b=o.map(function(A,E){return A=A.toTex(s),u[E]&&(A="\\\\left(".concat(A,"\\\\right)")),A});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&f==="hide"?b.join("~"):b.join(p)}else return"\\\\mathrm{"+this.fn+"}\\\\left("+o.map(function(A){return A.toTex(s)}).join(",")+"\\\\right)"}getIdentifier(){return this.type+":"+this.fn}}return Ur(i,"name",Fp),i},{isClass:!0,isNode:!0});var Op="ParenthesisNode",lz=["Node"],V2=T(Op,lz,e=>{var{Node:r}=e;class t extends r{constructor(i){if(super(),!Sr(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return Op}get isParenthesisNode(){return!0}_compile(i,a){return this.content._compile(i,a)}getContent(){return this.content.getContent()}forEach(i){i(this.content,"content",this)}map(i){var a=i(this.content,"content",this);return new t(a)}clone(){return new t(this.content)}_toString(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"("+this.content.toString(i)+")":this.content.toString(i)}toJSON(){return{mathjs:Op,content:this.content}}static fromJSON(i){return new t(i.content)}_toHTML(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?'('+this.content.toHTML(i)+')':this.content.toHTML(i)}_toTex(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"\\\\left(".concat(this.content.toTex(i),"\\\\right)"):this.content.toTex(i)}}return Ur(t,"name",Op),t},{isClass:!0,isNode:!0});var Bp="RangeNode",cz=["Node"],Y2=T(Bp,cz,e=>{var{Node:r}=e;function t(i,a,s){var l=Gr(i,a,s),f={},o=Gr(i.start,a,s);if(f.start=o!==null&&o<=l||a==="all",i.step){var u=Gr(i.step,a,s);f.step=u!==null&&u<=l||a==="all"}var p=Gr(i.end,a,s);return f.end=p!==null&&p<=l||a==="all",f}class n extends r{constructor(a,s,l){if(super(),!Sr(a))throw new TypeError("Node expected");if(!Sr(s))throw new TypeError("Node expected");if(l&&!Sr(l))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=a,this.end=s,this.step=l||null}get type(){return Bp}get isRangeNode(){return!0}needsEnd(){var a=this.filter(function(s){return rt(s)&&s.name==="end"});return a.length>0}_compile(a,s){var l=a.range,f=this.start._compile(a,s),o=this.end._compile(a,s);if(this.step){var u=this.step._compile(a,s);return function(h,d,x){return l(f(h,d,x),o(h,d,x),u(h,d,x))}}else return function(h,d,x){return l(f(h,d,x),o(h,d,x))}}forEach(a){a(this.start,"start",this),a(this.end,"end",this),this.step&&a(this.step,"step",this)}map(a){return new n(this._ifNode(a(this.start,"start",this)),this._ifNode(a(this.end,"end",this)),this.step&&this._ifNode(a(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(a){var s=a&&a.parenthesis?a.parenthesis:"keep",l=t(this,s,a&&a.implicit),f,o=this.start.toString(a);if(l.start&&(o="("+o+")"),f=o,this.step){var u=this.step.toString(a);l.step&&(u="("+u+")"),f+=":"+u}var p=this.end.toString(a);return l.end&&(p="("+p+")"),f+=":"+p,f}toJSON(){return{mathjs:Bp,start:this.start,end:this.end,step:this.step}}static fromJSON(a){return new n(a.start,a.end,a.step)}_toHTML(a){var s=a&&a.parenthesis?a.parenthesis:"keep",l=t(this,s,a&&a.implicit),f,o=this.start.toHTML(a);if(l.start&&(o='('+o+')'),f=o,this.step){var u=this.step.toHTML(a);l.step&&(u='('+u+')'),f+=':'+u}var p=this.end.toHTML(a);return l.end&&(p='('+p+')'),f+=':'+p,f}_toTex(a){var s=a&&a.parenthesis?a.parenthesis:"keep",l=t(this,s,a&&a.implicit),f=this.start.toTex(a);if(l.start&&(f="\\\\left(".concat(f,"\\\\right)")),this.step){var o=this.step.toTex(a);l.step&&(o="\\\\left(".concat(o,"\\\\right)")),f+=":"+o}var u=this.end.toTex(a);return l.end&&(u="\\\\left(".concat(u,"\\\\right)")),f+=":"+u,f}}return Ur(n,"name",Bp),n},{isClass:!0,isNode:!0});var Ip="RelationalNode",pz=["Node"],H2=T(Ip,pz,e=>{var{Node:r}=e,t={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends r{constructor(a,s){if(super(),!Array.isArray(a))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(s))throw new TypeError("Parameter params must be an array");if(a.length!==s.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=a,this.params=s}get type(){return Ip}get isRelationalNode(){return!0}_compile(a,s){var l=this,f=this.params.map(o=>o._compile(a,s));return function(u,p,h){for(var d,x=f[0](u,p,h),v=0;va(s,"params["+l+"]",this),this)}map(a){return new n(this.conditionals.slice(),this.params.map((s,l)=>this._ifNode(a(s,"params["+l+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(a){for(var s=a&&a.parenthesis?a.parenthesis:"keep",l=Gr(this,s,a&&a.implicit),f=this.params.map(function(p,h){var d=Gr(p,s,a&&a.implicit);return s==="all"||d!==null&&d<=l?"("+p.toString(a)+")":p.toString(a)}),o=f[0],u=0;u('+p.toHTML(a)+')':p.toHTML(a)}),o=f[0],u=0;u'+Qt(t[this.conditionals[u]])+""+f[u+1];return o}_toTex(a){for(var s=a&&a.parenthesis?a.parenthesis:"keep",l=Gr(this,s,a&&a.implicit),f=this.params.map(function(p,h){var d=Gr(p,s,a&&a.implicit);return s==="all"||d!==null&&d<=l?"\\\\left("+p.toTex(a)+"\\right)":p.toTex(a)}),o=f[0],u=0;u{var{math:r,Unit:t,Node:n}=e;function i(s){return t?t.isValuelessUnit(s):!1}class a extends n{constructor(l){if(super(),typeof l!="string")throw new TypeError('String expected for parameter "name"');this.name=l}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(l,f){var o=this.name;if(f[o]===!0)return function(p,h,d){return gt(h,o)};if(o in l)return function(p,h,d){return p.has(o)?p.get(o):gt(l,o)};var u=i(o);return function(p,h,d){return p.has(o)?p.get(o):u?new t(null,o):a.onUndefinedSymbol(o)}}forEach(l){}map(l){return this.clone()}static onUndefinedSymbol(l){throw new Error("Undefined symbol "+l)}clone(){return new a(this.name)}_toString(l){return this.name}_toHTML(l){var f=Qt(this.name);return f==="true"||f==="false"?''+f+"":f==="i"?''+f+"":f==="Infinity"?''+f+"":f==="NaN"?''+f+"":f==="null"?''+f+"":f==="undefined"?''+f+"":''+f+""}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(l){return new a(l.name)}_toTex(l){var f=!1;typeof r[this.name]>"u"&&i(this.name)&&(f=!0);var o=Ep(this.name,f);return o[0]==="\\\\"?o:" "+o}}return a},{isClass:!0,isNode:!0});var Pp="FunctionNode",dz=["math","Node","SymbolNode"],$2=T(Pp,dz,e=>{var r,{math:t,Node:n,SymbolNode:i}=e,a=f=>lr(f,{truncate:78});function s(f,o,u){for(var p="",h=/\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)/gi,d=0,x;(x=h.exec(f))!==null;)if(p+=f.substring(d,x.index),d=x.index,x[0]==="$$")p+="$",d++;else{d+=x[0].length;var v=o[x[1]];if(!v)throw new ReferenceError("Template: Property "+x[1]+" does not exist.");if(x[2]===void 0)switch(typeof v){case"string":p+=v;break;case"object":if(Sr(v))p+=v.toTex(u);else if(Array.isArray(v))p+=v.map(function(y,w){if(Sr(y))return y.toTex(u);throw new TypeError("Template: "+x[1]+"["+w+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+x[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+x[1]+" has to be a Node, String or array of Nodes")}else if(Sr(v[x[2]]&&v[x[2]]))p+=v[x[2]].toTex(u);else throw new TypeError("Template: "+x[1]+"["+x[2]+"] is not a Node.")}return p+=f.slice(d),p}class l extends n{constructor(o,u){if(super(),typeof o=="string"&&(o=new i(o)),!Sr(o))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(u)||!u.every(Sr))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=o,this.args=u||[]}get name(){return this.fn.name||""}get type(){return Pp}get isFunctionNode(){return!0}_compile(o,u){var p=this.args.map(F=>F._compile(o,u));if(rt(this.fn)){var h=this.fn.name;if(u[h]){var w=this.args;return function(M,_,k){var L=gt(_,h);if(typeof L!="function")throw new TypeError("Argument '".concat(h,"' was not a function; received: ").concat(a(L)));if(L.rawArgs)return L(w,o,os(M,_));var Y=p.map($=>$(M,_,k));return L.apply(L,Y)}}else{var d=h in o?gt(o,h):void 0,x=typeof d=="function"&&d.rawArgs===!0,v=F=>{var M;if(F.has(h))M=F.get(h);else if(h in o)M=gt(o,h);else return l.onUndefinedFunction(h);if(typeof M=="function")return M;throw new TypeError("'".concat(h,\`' is not a function; its value is: - \`).concat(a(M)))};if(x){var y=this.args;return function(M,_,k){var L=v(M);return L(y,o,os(M,_))}}else switch(p.length){case 0:return function(M,_,k){var L=v(M);return L()};case 1:return function(M,_,k){var L=v(M),Y=p[0];return L(Y(M,_,k))};case 2:return function(M,_,k){var L=v(M),Y=p[0],$=p[1];return L(Y(M,_,k),$(M,_,k))};default:return function(M,_,k){var L=v(M),Y=p.map($=>$(M,_,k));return L(...Y)}}}}else if(Sn(this.fn)&&kn(this.fn.index)&&this.fn.index.isObjectProperty()){var C=this.fn.object._compile(o,u),b=this.fn.index.getObjectProperty(),A=this.args;return function(M,_,k){var L=C(M,_,k),Y=Ty(L,b);if(Y!=null&&Y.rawArgs)return Y(A,o,os(M,_));var $=p.map(V=>V(M,_,k));return Y.apply(L,$)}}else{var E=this.fn.toString(),S=this.fn._compile(o,u),O=this.args;return function(M,_,k){var L=S(M,_,k);if(typeof L!="function")throw new TypeError("Expression '".concat(E,"' did not evaluate to a function; value is:")+\` - \`.concat(a(L)));if(L.rawArgs)return L(O,o,os(M,_));var Y=p.map($=>$(M,_,k));return L.apply(L,Y)}}}forEach(o){o(this.fn,"fn",this);for(var u=0;u'+Qt(this.fn)+'('+u.join(',')+')'}toTex(o){var u;return o&&typeof o.handler=="object"&&$e(o.handler,this.name)&&(u=o.handler[this.name](this,o)),typeof u<"u"?u:super.toTex(o)}_toTex(o){var u=this.args.map(function(d){return d.toTex(o)}),p;dg[this.name]&&(p=dg[this.name]),t[this.name]&&(typeof t[this.name].toTex=="function"||typeof t[this.name].toTex=="object"||typeof t[this.name].toTex=="string")&&(p=t[this.name].toTex);var h;switch(typeof p){case"function":h=p(this,o);break;case"string":h=s(p,this,o);break;case"object":switch(typeof p[u.length]){case"function":h=p[u.length](this,o);break;case"string":h=s(p[u.length],this,o);break}}return typeof h<"u"?h:s(R2,this,o)}getIdentifier(){return this.type+":"+this.name}}return r=l,Ur(l,"name",Pp),Ur(l,"onUndefinedFunction",function(f){throw new Error("Undefined function "+f)}),Ur(l,"fromJSON",function(f){return new r(f.fn,f.args)}),l},{isClass:!0,isNode:!0});var Z2="parse",vz=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],Q2=T(Z2,vz,e=>{var{typed:r,numeric:t,config:n,AccessorNode:i,ArrayNode:a,AssignmentNode:s,BlockNode:l,ConditionalNode:f,ConstantNode:o,FunctionAssignmentNode:u,FunctionNode:p,IndexNode:h,ObjectNode:d,OperatorNode:x,ParenthesisNode:v,RangeNode:y,RelationalNode:w,SymbolNode:C}=e,b=r(Z2,{string:function(Q){return me(Q,{})},"Array | Matrix":function(Q){return A(Q,{})},"string, Object":function(Q,ve){var Be=ve.nodes!==void 0?ve.nodes:{};return me(Q,Be)},"Array | Matrix, Object":A});function A(B){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ve=Q.nodes!==void 0?Q.nodes:{};return Je(B,function(Be){if(typeof Be!="string")throw new TypeError("String expected");return me(Be,ve)})}var E={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},S={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},O={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},F={true:!0,false:!1,null:null,undefined:void 0},M=["NaN","Infinity"],_={'"':'"',"'":"'","\\\\":"\\\\","/":"/",b:"\\b",f:"\\f",n:\` -\`,r:"\\r",t:" "};function k(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:E.NULL,nestingLevel:0,conditionalLevel:null}}function L(B,Q){return B.expression.substr(B.index,Q)}function Y(B){return L(B,1)}function $(B){B.index++}function V(B){return B.expression.charAt(B.index-1)}function q(B){return B.expression.charAt(B.index+1)}function R(B){for(B.tokenType=E.NULL,B.token="",B.comment="";;){if(Y(B)==="#")for(;Y(B)!==\` -\`&&Y(B)!=="";)B.comment+=Y(B),$(B);if(b.isWhitespace(Y(B),B.nestingLevel))$(B);else break}if(Y(B)===""){B.tokenType=E.DELIMITER;return}if(Y(B)===\` -\`&&!B.nestingLevel){B.tokenType=E.DELIMITER,B.token=Y(B),$(B);return}var Q=Y(B),ve=L(B,2),Be=L(B,3);if(Be.length===3&&S[Be]){B.tokenType=E.DELIMITER,B.token=Be,$(B),$(B),$(B);return}if(ve.length===2&&S[ve]){B.tokenType=E.DELIMITER,B.token=ve,$(B),$(B);return}if(S[Q]){B.tokenType=E.DELIMITER,B.token=Q,$(B);return}if(b.isDigitDot(Q)){B.tokenType=E.NUMBER;var er=L(B,2);if(er==="0b"||er==="0o"||er==="0x"){for(B.token+=Y(B),$(B),B.token+=Y(B),$(B);b.isHexDigit(Y(B));)B.token+=Y(B),$(B);if(Y(B)===".")for(B.token+=".",$(B);b.isHexDigit(Y(B));)B.token+=Y(B),$(B);else if(Y(B)==="i")for(B.token+="i",$(B);b.isDigit(Y(B));)B.token+=Y(B),$(B);return}if(Y(B)==="."){if(B.token+=Y(B),$(B),!b.isDigit(Y(B))){B.tokenType=E.DELIMITER;return}}else{for(;b.isDigit(Y(B));)B.token+=Y(B),$(B);b.isDecimalMark(Y(B),q(B))&&(B.token+=Y(B),$(B))}for(;b.isDigit(Y(B));)B.token+=Y(B),$(B);if(Y(B)==="E"||Y(B)==="e"){if(b.isDigit(q(B))||q(B)==="-"||q(B)==="+"){if(B.token+=Y(B),$(B),(Y(B)==="+"||Y(B)==="-")&&(B.token+=Y(B),$(B)),!b.isDigit(Y(B)))throw Pe(B,'Digit expected, got "'+Y(B)+'"');for(;b.isDigit(Y(B));)B.token+=Y(B),$(B);if(b.isDecimalMark(Y(B),q(B)))throw Pe(B,'Digit expected, got "'+Y(B)+'"')}else if(q(B)===".")throw $(B),Pe(B,'Digit expected, got "'+Y(B)+'"')}return}if(b.isAlpha(Y(B),V(B),q(B))){for(;b.isAlpha(Y(B),V(B),q(B))||b.isDigit(Y(B));)B.token+=Y(B),$(B);$e(O,B.token)?B.tokenType=E.DELIMITER:B.tokenType=E.SYMBOL;return}for(B.tokenType=E.UNKNOWN;Y(B)!=="";)B.token+=Y(B),$(B);throw Pe(B,'Syntax error in part "'+B.token+'"')}function j(B){do R(B);while(B.token===\` -\`)}function U(B){B.nestingLevel++}function oe(B){B.nestingLevel--}b.isAlpha=function(Q,ve,Be){return b.isValidLatinOrGreek(Q)||b.isValidMathSymbol(Q,Be)||b.isValidMathSymbol(ve,Q)},b.isValidLatinOrGreek=function(Q){return/^[a-zA-Z_$\\u00C0-\\u02AF\\u0370-\\u03FF\\u2100-\\u214F]$/.test(Q)},b.isValidMathSymbol=function(Q,ve){return/^[\\uD835]$/.test(Q)&&/^[\\uDC00-\\uDFFF]$/.test(ve)&&/^[^\\uDC55\\uDC9D\\uDCA0\\uDCA1\\uDCA3\\uDCA4\\uDCA7\\uDCA8\\uDCAD\\uDCBA\\uDCBC\\uDCC4\\uDD06\\uDD0B\\uDD0C\\uDD15\\uDD1D\\uDD3A\\uDD3F\\uDD45\\uDD47-\\uDD49\\uDD51\\uDEA6\\uDEA7\\uDFCC\\uDFCD]$/.test(ve)},b.isWhitespace=function(Q,ve){return Q===" "||Q===" "||Q===\` -\`&&ve>0},b.isDecimalMark=function(Q,ve){return Q==="."&&ve!=="/"&&ve!=="*"&&ve!=="^"},b.isDigitDot=function(Q){return Q>="0"&&Q<="9"||Q==="."},b.isDigit=function(Q){return Q>="0"&&Q<="9"},b.isHexDigit=function(Q){return Q>="0"&&Q<="9"||Q>="a"&&Q<="f"||Q>="A"&&Q<="F"};function me(B,Q){var ve=k();Mt(ve,{expression:B,extraNodes:Q}),R(ve);var Be=ie(ve);if(ve.token!=="")throw ve.tokenType===E.DELIMITER?We(ve,"Unexpected operator "+ve.token):Pe(ve,'Unexpected part "'+ve.token+'"');return Be}function ie(B){var Q,ve=[],Be;for(B.token!==""&&B.token!==\` -\`&&B.token!==";"&&(Q=H(B),B.comment&&(Q.comment=B.comment));B.token===\` -\`||B.token===";";)ve.length===0&&Q&&(Be=B.token!==";",ve.push({node:Q,visible:Be})),R(B),B.token!==\` -\`&&B.token!==";"&&B.token!==""&&(Q=H(B),B.comment&&(Q.comment=B.comment),Be=B.token!==";",ve.push({node:Q,visible:Be}));return ve.length>0?new l(ve):(Q||(Q=new o(void 0),B.comment&&(Q.comment=B.comment)),Q)}function H(B){var Q,ve,Be,er,fr=ce(B);if(B.token==="="){if(rt(fr))return Q=fr.name,j(B),Be=H(B),new s(new C(Q),Be);if(Sn(fr))return j(B),Be=H(B),new s(fr.object,fr.index,Be);if(fn(fr)&&rt(fr.fn)&&(er=!0,ve=[],Q=fr.name,fr.args.forEach(function(Zr,_t){rt(Zr)?ve[_t]=Zr.name:er=!1}),er))return j(B),Be=H(B),new u(Q,ve,Be);throw Pe(B,"Invalid left hand side of assignment operator =")}return fr}function ce(B){for(var Q=Me(B);B.token==="?";){var ve=B.conditionalLevel;B.conditionalLevel=B.nestingLevel,j(B);var Be=Q,er=H(B);if(B.token!==":")throw Pe(B,"False part of conditional expression expected");B.conditionalLevel=null,j(B);var fr=H(B);Q=new f(Be,er,fr),B.conditionalLevel=ve}return Q}function Me(B){for(var Q=pe(B);B.token==="or";)j(B),Q=new x("or","or",[Q,pe(B)]);return Q}function pe(B){for(var Q=ge(B);B.token==="xor";)j(B),Q=new x("xor","xor",[Q,ge(B)]);return Q}function ge(B){for(var Q=Se(B);B.token==="and";)j(B),Q=new x("and","and",[Q,Se(B)]);return Q}function Se(B){for(var Q=xe(B);B.token==="|";)j(B),Q=new x("|","bitOr",[Q,xe(B)]);return Q}function xe(B){for(var Q=be(B);B.token==="^|";)j(B),Q=new x("^|","bitXor",[Q,be(B)]);return Q}function be(B){for(var Q=De(B);B.token==="&";)j(B),Q=new x("&","bitAnd",[Q,De(B)]);return Q}function De(B){for(var Q=[Ae(B)],ve=[],Be={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};$e(Be,B.token);){var er={name:B.token,fn:Be[B.token]};ve.push(er),j(B),Q.push(Ae(B))}return Q.length===1?Q[0]:Q.length===2?new x(ve[0].name,ve[0].fn,Q):new w(ve.map(fr=>fr.fn),Q)}function Ae(B){var Q,ve,Be,er;Q=ze(B);for(var fr={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};$e(fr,B.token);)ve=B.token,Be=fr[ve],j(B),er=[Q,ze(B)],Q=new x(ve,Be,er);return Q}function ze(B){var Q,ve,Be,er;Q=Ze(B);for(var fr={to:"to",in:"to"};$e(fr,B.token);)ve=B.token,Be=fr[ve],j(B),ve==="in"&&B.token===""?Q=new x("*","multiply",[Q,new C("in")],!0):(er=[Q,Ze(B)],Q=new x(ve,Be,er));return Q}function Ze(B){var Q,ve=[];if(B.token===":"?Q=new o(1):Q=K(B),B.token===":"&&B.conditionalLevel!==B.nestingLevel){for(ve.push(Q);B.token===":"&&ve.length<3;)j(B),B.token===")"||B.token==="]"||B.token===","||B.token===""?ve.push(new C("end")):ve.push(K(B));ve.length===3?Q=new y(ve[0],ve[2],ve[1]):Q=new y(ve[0],ve[1])}return Q}function K(B){var Q,ve,Be,er;Q=te(B);for(var fr={"+":"add","-":"subtract"};$e(fr,B.token);){ve=B.token,Be=fr[ve],j(B);var Zr=te(B);Zr.isPercentage?er=[Q,new x("*","multiply",[Q,Zr])]:er=[Q,Zr],Q=new x(ve,Be,er)}return Q}function te(B){var Q,ve,Be,er;Q=ye(B),ve=Q;for(var fr={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};$e(fr,B.token);)Be=B.token,er=fr[Be],j(B),ve=ye(B),Q=new x(Be,er,[Q,ve]);return Q}function ye(B){var Q,ve;for(Q=ee(B),ve=Q;B.tokenType===E.SYMBOL||B.token==="in"&&yr(Q)||B.tokenType===E.NUMBER&&!yr(ve)&&(!ut(ve)||ve.op==="!")||B.token==="(";)ve=ee(B),Q=new x("*","multiply",[Q,ve],!0);return Q}function ee(B){for(var Q=ne(B),ve=Q,Be=[];B.token==="/"&&vf(ve);)if(Be.push(Mt({},B)),j(B),B.tokenType===E.NUMBER)if(Be.push(Mt({},B)),j(B),B.tokenType===E.SYMBOL||B.token==="(")Mt(B,Be.pop()),Be.pop(),ve=ne(B),Q=new x("/","divide",[Q,ve]);else{Be.pop(),Mt(B,Be.pop());break}else{Mt(B,Be.pop());break}return Q}function ne(B){var Q,ve,Be,er;Q=ue(B);for(var fr={"%":"mod",mod:"mod"};$e(fr,B.token);)ve=B.token,Be=fr[ve],j(B),ve==="%"&&B.tokenType===E.DELIMITER&&B.token!=="("?Q=new x("/","divide",[Q,new o(100)],!1,!0):(er=[Q,ue(B)],Q=new x(ve,Be,er));return Q}function ue(B){var Q,ve,Be,er={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return $e(er,B.token)?(Be=er[B.token],Q=B.token,j(B),ve=[ue(B)],new x(Q,Be,ve)):Ee(B)}function Ee(B){var Q,ve,Be,er;return Q=Ce(B),(B.token==="^"||B.token===".^")&&(ve=B.token,Be=ve==="^"?"pow":"dotPow",j(B),er=[Q,ue(B)],Q=new x(ve,Be,er)),Q}function Ce(B){var Q,ve,Be,er;Q=Le(B);for(var fr={"!":"factorial","'":"ctranspose"};$e(fr,B.token);)ve=B.token,Be=fr[ve],R(B),er=[Q],Q=new x(ve,Be,er),Q=sr(B,Q);return Q}function Le(B){var Q=[];if(B.tokenType===E.SYMBOL&&$e(B.extraNodes,B.token)){var ve=B.extraNodes[B.token];if(R(B),B.token==="("){if(Q=[],U(B),R(B),B.token!==")")for(Q.push(H(B));B.token===",";)R(B),Q.push(H(B));if(B.token!==")")throw Pe(B,"Parenthesis ) expected");oe(B),R(B)}return new ve(Q)}return Ie(B)}function Ie(B){var Q,ve;return B.tokenType===E.SYMBOL||B.tokenType===E.DELIMITER&&B.token in O?(ve=B.token,R(B),$e(F,ve)?Q=new o(F[ve]):M.indexOf(ve)!==-1?Q=new o(t(ve,"number")):Q=new C(ve),Q=sr(B,Q),Q):ir(B)}function sr(B,Q,ve){for(var Be;(B.token==="("||B.token==="["||B.token===".")&&(!ve||ve.indexOf(B.token)!==-1);)if(Be=[],B.token==="(")if(rt(Q)||Sn(Q)){if(U(B),R(B),B.token!==")")for(Be.push(H(B));B.token===",";)R(B),Be.push(H(B));if(B.token!==")")throw Pe(B,"Parenthesis ) expected");oe(B),R(B),Q=new p(Q,Be)}else return Q;else if(B.token==="["){if(U(B),R(B),B.token!=="]")for(Be.push(H(B));B.token===",";)R(B),Be.push(H(B));if(B.token!=="]")throw Pe(B,"Parenthesis ] expected");oe(B),R(B),Q=new i(Q,new h(Be))}else{R(B);var er=B.tokenType===E.SYMBOL||B.tokenType===E.DELIMITER&&B.token in O;if(!er)throw Pe(B,"Property name expected after dot");Be.push(new o(B.token)),R(B);var fr=!0;Q=new i(Q,new h(Be,fr))}return Q}function ir(B){var Q,ve;return B.token==='"'||B.token==="'"?(ve=Xe(B,B.token),Q=new o(ve),Q=sr(B,Q),Q):Or(B)}function Xe(B,Q){for(var ve="";Y(B)!==""&&Y(B)!==Q;)if(Y(B)==="\\\\"){$(B);var Be=Y(B),er=_[Be];if(er!==void 0)ve+=er,B.index+=1;else if(Be==="u"){var fr=B.expression.slice(B.index+1,B.index+5);if(/^[0-9A-Fa-f]{4}$/.test(fr))ve+=String.fromCharCode(parseInt(fr,16)),B.index+=5;else throw Pe(B,"Invalid unicode character \\\\u".concat(fr))}else throw Pe(B,"Bad escape character \\\\".concat(Be))}else ve+=Y(B),$(B);if(R(B),B.token!==Q)throw Pe(B,"End of string ".concat(Q," expected"));return R(B),ve}function Or(B){var Q,ve,Be,er;if(B.token==="["){if(U(B),R(B),B.token!=="]"){var fr=re(B);if(B.token===";"){for(Be=1,ve=[fr];B.token===";";)R(B),B.token!=="]"&&(ve[Be]=re(B),Be++);if(B.token!=="]")throw Pe(B,"End of matrix ] expected");oe(B),R(B),er=ve[0].items.length;for(var Zr=1;Zr{var{typed:r,parse:t}=e;return r(X2,{string:function(i){return t(i).compile()},"Array | Matrix":function(i){return Je(i,function(a){return t(a).compile()})}})});var K2="evaluate",xz=["typed","parse"],j2=T(K2,xz,e=>{var{typed:r,parse:t}=e;return r(K2,{string:function(i){var a=go();return t(i).compile().evaluate(a)},"string, Map | Object":function(i,a){return t(i).compile().evaluate(a)},"Array | Matrix":function(i){var a=go();return Je(i,function(s){return t(s).compile().evaluate(a)})},"Array | Matrix, Map | Object":function(i,a){return Je(i,function(s){return t(s).compile().evaluate(a)})}})});var yz="Parser",bz=["evaluate"],eA=T(yz,bz,e=>{var{evaluate:r}=e;function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:go(),writable:!1})}return t.prototype.type="Parser",t.prototype.isParser=!0,t.prototype.evaluate=function(n){return r(n,this.scope)},t.prototype.get=function(n){if(this.scope.has(n))return this.scope.get(n)},t.prototype.getAll=function(){return By(this.scope)},t.prototype.getAllAsMap=function(){return this.scope},t.prototype.set=function(n,i){return this.scope.set(n,i),i},t.prototype.remove=function(n){this.scope.delete(n)},t.prototype.clear=function(){this.scope.clear()},t},{isClass:!0});var rA="parser",wz=["typed","Parser"],tA=T(rA,wz,e=>{var{typed:r,Parser:t}=e;return r(rA,{"":function(){return new t}})});var nA="lup",Dz=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],iA=T(nA,Dz,e=>{var{typed:r,matrix:t,abs:n,addScalar:i,divideScalar:a,multiplyScalar:s,subtractScalar:l,larger:f,equalScalar:o,unaryMinus:u,DenseMatrix:p,SparseMatrix:h,Spa:d}=e;return r(nA,{DenseMatrix:function(w){return x(w)},SparseMatrix:function(w){return v(w)},Array:function(w){var C=t(w),b=x(C);return{L:b.L.valueOf(),U:b.U.valueOf(),p:b.p}}});function x(y){var w=y._size[0],C=y._size[1],b=Math.min(w,C),A=tr(y._data),E=[],S=[w,b],O=[],F=[b,C],M,_,k,L=[];for(M=0;M0)for(M=0;M0&&H.forEach(0,q-1,function(xe,be){h._forEachRow(xe,O,F,M,function(De,Ae){De>xe&&H.accumulate(De,u(s(Ae,be)))})});var pe=q,ge=H.get(q),Se=n(ge);H.forEach(q+1,w-1,function(xe,be){var De=n(be);f(De,Se)&&(pe=xe,Se=De,ge=be)}),q!==pe&&(h._swapRows(q,pe,_[1],O,F,M),h._swapRows(q,pe,$[1],k,L,Y),H.swap(q,pe),oe(q,pe)),H.forEach(0,w-1,function(xe,be){xe<=q?(k.push(be),L.push(xe)):(be=a(be,ge),o(be,0)||(O.push(be),F.push(xe)))})};for(q=0;q{var{typed:r,matrix:t,zeros:n,identity:i,isZero:a,equal:s,sign:l,sqrt:f,conj:o,unaryMinus:u,addScalar:p,divideScalar:h,multiplyScalar:d,subtractScalar:x,complex:v}=e;return Mt(r(aA,{DenseMatrix:function(A){return w(A)},SparseMatrix:function(A){return C(A)},Array:function(A){var E=t(A),S=w(E);return{Q:S.Q.valueOf(),R:S.R.valueOf()}}}),{_denseQRimpl:y});function y(b){var A=b._size[0],E=b._size[1],S=i([A],"dense"),O=S._data,F=b.clone(),M=F._data,_,k,L,Y=n([A],"");for(L=0;L0)for(var S=E[0][0].type==="Complex"?v(0):0,O=0;O=0;){var f=t[s+l],o=t[n+f];o===-1?(l--,a[r++]=f):(t[n+f]=t[i+o],++l,t[s+l]=o)}return r}function uA(e,r){if(!e)return null;var t=0,n,i=[],a=[],s=0,l=r,f=2*r;for(n=0;n=0;n--)e[n]!==-1&&(a[l+n]=a[s+e[n]],a[s+e[n]]=n);for(n=0;n{var{add:r,multiply:t,transpose:n}=e;return function(u,p){if(!p||u<=0||u>3)return null;var h=p._size,d=h[0],x=h[1],v=0,y=Math.max(16,10*Math.sqrt(x));y=Math.min(x-2,y);var w=i(u,p,d,x,y);lA(w,f,null);for(var C=w._index,b=w._ptr,A=b[x],E=[],S=[],O=0,F=x+1,M=2*(x+1),_=3*(x+1),k=4*(x+1),L=5*(x+1),Y=6*(x+1),$=7*(x+1),V=E,q=a(x,b,S,O,_,V,M,$,F,Y,k,L),R=s(x,b,S,L,k,Y,y,F,_,V,M),j=0,U,oe,me,ie,H,ce,Me,pe,ge,Se,xe,be,De,Ae,ze,Ze;RK?(ce=me,Me=ee,pe=S[O+me]-K):(ce=C[ee++],Me=b[ce],pe=S[O+ce]),H=1;H<=pe;H++)U=C[Me++],!((ge=S[F+U])<=0)&&(ye+=ge,S[F+U]=-ge,C[ue++]=U,S[M+U]!==-1&&(V[S[M+U]]=V[U]),V[U]!==-1?S[M+V[U]]=S[M+U]:S[_+S[L+U]]=S[M+U]);ce!==me&&(b[ce]=Gi(me),S[Y+ce]=0)}for(K!==0&&(A=ue),S[L+me]=ye,b[me]=ne,S[O+me]=ue-ne,S[k+me]=-2,q=l(q,v,S,Y,x),Se=ne;Se=q?S[Y+ce]-=ge:S[Y+ce]!==0&&(S[Y+ce]=S[L+ce]+Ee)}for(Se=ne;Se0?(Ze+=Ce,C[Ae++]=ce,ze+=ce):(b[ce]=Gi(me),S[Y+ce]=0)}S[k+U]=Ae-be+1;var Le=Ae,Ie=be+S[O+U];for(ee=De+1;ee=0))for(ze=V[U],U=S[$+ze],S[$+ze]=-1;U!==-1&&S[M+U]!==-1;U=S[M+U],q++){for(pe=S[O+U],xe=S[k+U],ee=b[U]+1;ee<=b[U]+pe-1;ee++)S[Y+C[ee]]=q;var ir=U;for(oe=S[M+U];oe!==-1;){var Xe=S[O+oe]===pe&&S[k+oe]===xe;for(ee=b[oe]+1;Xe&&ee<=b[oe]+pe-1;ee++)S[Y+C[ee]]!==q&&(Xe=0);Xe?(b[oe]=Gi(U),S[F+U]+=S[F+oe],S[F+oe]=0,S[k+oe]=-1,oe=S[M+oe],S[M+ir]=oe):(ir=oe,oe=S[M+oe])}}for(ee=ne,Se=ne;Se=0;oe--)S[F+oe]>0||(S[M+oe]=S[_+b[oe]],S[_+b[oe]]=oe);for(ce=x;ce>=0;ce--)S[F+ce]<=0||b[ce]!==-1&&(S[M+ce]=S[_+b[ce]],S[_+b[ce]]=ce);for(me=0,U=0;U<=x;U++)b[U]===-1&&(me=kp(U,me,S,_,M,E,Y));return E.splice(E.length-1,1),E};function i(o,u,p,h,d){var x=n(u);if(o===1&&h===p)return r(u,x);if(o===2){for(var v=x._index,y=x._ptr,w=0,C=0;Cd))for(var A=y[C+1];bv)p[y+E]=0,p[d+E]=-1,A++,u[E]=Gi(o),p[y+o]++;else{var O=p[w+S];O!==-1&&(C[O]=E),p[b+E]=p[w+S],p[w+S]=E}}return A}function l(o,u,p,h,d){if(o<2||o+u<0){for(var x=0;x{var{transpose:r}=e;return function(t,n,i,a){if(!t||!n||!i)return null;var s=t._size,l=s[0],f=s[1],o,u,p,h,d,x,v,y=4*f+(a?f+l+1:0),w=[],C=0,b=f,A=2*f,E=3*f,S=4*f,O=5*f+1;for(p=0;p=1&&F[u]++,L.jleaf===2&&F[L.q]--}n[u]!==-1&&(w[C+u]=n[u])}for(u=0;u{var{add:r,multiply:t,transpose:n}=e,i=cA({add:r,multiply:t,transpose:n}),a=mA({transpose:n});return function(f,o,u){var p=o._ptr,h=o._size,d=h[1],x,v={};if(v.q=i(f,o),f&&!v.q)return null;if(u){var y=f?sA(o,null,v.q,0):o;v.parent=fA(y,1);var w=uA(v.parent,d);if(v.cp=a(y,v.parent,w,1),y&&v.parent&&v.cp&&s(y,v))for(v.unz=0,x=0;x=0;O--)for(M=o[O],_=o[O+1],F=M;F<_;F++)y[u[F]]=O;for(S=h-1;S>=0;S--)v[S]=-1,O=y[S],O!==-1&&(w[E+O]++===0&&(w[A+O]=S),w[C+S]=w[b+O],w[b+O]=S);for(f.lnz=0,f.m2=h,O=0;O=0;){e=n[h];var d=i?i[e]:e;Mf(s,e)||(Rp(s,e),n[f+h]=d<0?0:vg(s[d]));var x=1;for(u=n[f+h],p=d<0?0:vg(s[d+1]);u{var{divideScalar:r,multiply:t,subtract:n}=e;return function(a,s,l,f,o,u,p){var h=a._values,d=a._index,x=a._ptr,v=a._size,y=v[1],w=s._values,C=s._index,b=s._ptr,A,E,S,O,F=vA(a,s,l,f,u);for(A=F;A{var{abs:r,divideScalar:t,multiply:n,subtract:i,larger:a,largerEq:s,SparseMatrix:l}=e,f=gA({divideScalar:t,multiply:n,subtract:i});return function(u,p,h){if(!u)return null;var d=u._size,x=d[1],v,y=100,w=100;p&&(v=p.q,y=p.lnz||y,w=p.unz||w);var C=[],b=[],A=[],E=new l({values:C,index:b,ptr:A,size:[x,x]}),S=[],O=[],F=[],M=new l({values:S,index:O,ptr:F,size:[x,x]}),_=[],k,L,Y=[],$=[];for(k=0;k{var{typed:r,abs:t,add:n,multiply:i,transpose:a,divideScalar:s,subtract:l,larger:f,largerEq:o,SparseMatrix:u}=e,p=hA({add:n,multiply:i,transpose:a}),h=xA({abs:t,divideScalar:s,multiply:i,subtract:l,larger:f,largerEq:o,SparseMatrix:u});return r(yA,{"SparseMatrix, number, number":function(x,v,y){if(!He(v)||v<0||v>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(y<0||y>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var w=p(v,x,!1),C=h(x,w,y);return{L:C.L,U:C.U,p:C.pinv,q:w.q,toString:function(){return"L: "+this.L.toString()+\` -U: \`+this.U.toString()+\` -p: \`+this.p.toString()+(this.q?\` -q: \`+this.q.toString():"")+\` -\`}}}})});function gg(e,r){var t,n=r.length,i=[];if(e)for(t=0;t{var{typed:r,matrix:t,lup:n,slu:i,usolve:a,lsolve:s,DenseMatrix:l}=e,f=ha({DenseMatrix:l});return r(wA,{"Array, Array | Matrix":function(h,d){h=t(h);var x=n(h),v=u(x.L,x.U,x.p,null,d);return v.valueOf()},"DenseMatrix, Array | Matrix":function(h,d){var x=n(h);return u(x.L,x.U,x.p,null,d)},"SparseMatrix, Array | Matrix":function(h,d){var x=n(h);return u(x.L,x.U,x.p,null,d)},"SparseMatrix, Array | Matrix, number, number":function(h,d,x,v){var y=i(h,x,v);return u(y.L,y.U,y.p,y.q,d)},"Object, Array | Matrix":function(h,d){return u(h.L,h.U,h.p,h.q,d)}});function o(p){if(Ge(p))return p;if(Ar(p))return t(p);throw new TypeError("Invalid Matrix LU decomposition")}function u(p,h,d,x,v){p=o(p),h=o(h),d&&(v=f(p,v,!0),v._data=gg(d,v._data));var y=s(p,v),w=a(h,y);return x&&(w._data=gg(x,w._data)),w}});var SA="polynomialRoot",kz=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],NA=T(SA,kz,e=>{var{typed:r,isZero:t,equalScalar:n,add:i,subtract:a,multiply:s,divide:l,sqrt:f,unaryMinus:o,cbrt:u,typeOf:p,im:h,re:d}=e;return r(SA,{"number|Complex, ...number|Complex":(x,v)=>{for(var y=[x,...v];y.length>0&&t(y[y.length-1]);)y.pop();if(y.length<2)throw new RangeError("Polynomial [".concat(x,", ").concat(v,"] must have a non-zero non-constant coefficient"));switch(y.length){case 2:return[o(l(y[0],y[1]))];case 3:{var[w,C,b]=y,A=s(2,b),E=s(C,C),S=s(4,b,w);if(n(E,S))return[l(o(C),A)];var O=f(a(E,S));return[l(a(O,C),A),l(a(o(O),C),A)]}case 4:{var[F,M,_,k]=y,L=o(s(3,k)),Y=s(_,_),$=s(3,k,M),V=i(s(2,_,_,_),s(27,k,k,F)),q=s(9,k,_,M);if(n(Y,$)&&n(V,q))return[l(_,L)];var R=a(Y,$),j=a(V,q),U=i(s(18,k,_,M,F),s(_,_,M,M)),oe=i(s(4,_,_,_,F),s(4,k,M,M,M),s(27,k,k,F,F));if(n(U,oe))return[l(a(s(4,k,_,M),i(s(9,k,k,F),s(_,_,_))),s(k,R)),l(a(s(9,k,F),s(_,M)),s(2,R))];var me;n(Y,$)?me=j:me=l(i(j,f(a(s(j,j),s(4,R,R,R)))),2);var ie=!0,H=u(me,ie).toArray().map(ce=>l(i(_,ce,l(R,ce)),L));return H.map(ce=>p(ce)==="Complex"&&n(d(ce),d(ce)+h(ce))?d(ce):ce)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(y))}}})});var Rz="Help",Lz=["evaluate"],AA=T(Rz,Lz,e=>{var{evaluate:r}=e;function t(n){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(!n)throw new Error('Argument "doc" missing');this.doc=n}return t.prototype.type="Help",t.prototype.isHelp=!0,t.prototype.toString=function(){var n=this.doc||{},i=\` -\`;if(n.name&&(i+="Name: "+n.name+\` - -\`),n.category&&(i+="Category: "+n.category+\` - -\`),n.description&&(i+=\`Description: - \`+n.description+\` - -\`),n.syntax&&(i+=\`Syntax: - \`+n.syntax.join(\` - \`)+\` - -\`),n.examples){i+=\`Examples: -\`;for(var a=!1,s=r("config()"),l={config:p=>(a=!0,r("config(newConfig)",{newConfig:p}))},f=0;fa!=="mathjs").forEach(a=>{i[a]=n[a]}),new t(i)},t.prototype.valueOf=t.prototype.toString,t},{isClass:!0});var qz="Chain",Uz=["?on","math","typed"],EA=T(qz,Uz,e=>{var{on:r,math:t,typed:n}=e;function i(o){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");Gs(o)?this.value=o.value:this.value=o}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return lr(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(o){return new i(o.value)};function a(o,u){typeof u=="function"&&(i.prototype[o]=l(u))}function s(o,u){Zs(i.prototype,o,function(){var h=u();if(typeof h=="function")return l(h)})}function l(o){return function(){if(arguments.length===0)return new i(o(this.value));for(var u=[this.value],p=0;po[x])};for(var h in o)p(h)}};var f={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(t),r&&r("import",function(o,u,p){p||s(o,u)}),i},{isClass:!0});var xg={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]};var CA={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};var MA={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]};var _A={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]};var TA={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};var FA={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};var OA={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]};var BA={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]};var IA={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};var PA={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};var kA={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as \`(1 + sqrt(5)) / 2\` and is approximately 1.618034...",examples:["phi"],seealso:[]};var yg={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]};var RA={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]};var LA={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]};var qA={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]};var UA={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]};var zA={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]};var WA={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]};var VA={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]};var YA={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]};var HA={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]};var GA={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]};var $A={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]};var ZA={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]};var QA={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]};var XA={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]};var JA={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]};var KA={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]};var jA={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]};var eE={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]};var rE={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]};var tE={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]};var nE={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]};var iE={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]};var aE={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]};var oE={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]};var sE={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]};var uE={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]};var fE={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]};var lE={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix \`A\` is decomposed in two matrices (\`Q\`, \`R\`) where \`Q\` is an orthogonal matrix and \`R\` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]};var cE={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]};var pE={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]};var mE={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]};var hE={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]};var dE={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]};var vE={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]};var gE={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]};var xE={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]};var yE={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]};var bE={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]};var wE={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]};var DE={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When \`x\` is a number or complex number, an optional second argument \`allRoots\` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]};var SE={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]};var NE={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]};var AE={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]};var EE={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]};var CE={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]};var ME={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]};var _E={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]};var TE={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]};var FE={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]};var OE={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]};var BE={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]};var IE={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]};var PE={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]};var kE={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \\u2263 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]};var RE={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]};var LE={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]};var qE={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]};var UE={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a \`value+1\`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]};var zE={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating \`log(x, 2)\`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]};var WE={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]};var VE={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]};var YE={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']};var HE={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]};var GE={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]};var $E={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]};var ZE={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]};var QE={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]};var XE={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]};var JE={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix \`X\` of another matrix \`A\` is such that \`X * X = A\`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]};var KE={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]};var jE={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]};var eC={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]};var rC={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]};var tC={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]};var nC={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]};var iC={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]};var aC={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]};var oC={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};var sC={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};var uC={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]};var fC={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]};var lC={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]};var cC={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]};var pC={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]};var mC={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. \`bellNumbers\` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]};var hC={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]};var dC={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]};var vC={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. \`stirlingS2\` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]};var gC={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]};var xC={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]};var yC={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]};var bC={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]};var wC={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]};var DC={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]};var SC={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]};var NC={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]};var AC={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]};var EC={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]};var CC={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]};var MC={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]};var _C={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]};var TC={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var FC={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]};var OC={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]};var BC={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};var IC={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var PC={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var kC={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]};var RC={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]};var LC={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]};var qC={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]};var UC={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]};var zC={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]};var WC={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]};var VC={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var YC={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var HC={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore\\u2013Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]};var GC={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]};var $C={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]};var ZC={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]};var QC={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]};var XC={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]};var JC={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]};var KC={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]};var jC={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]};var eM={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]};var rM={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]};var tM={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]};var nM={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]};var iM={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]};var aM={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]};var oM={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]};var sM={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]};var uM={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation \`l:u\`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]};var fM={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]};var lM={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};var cM={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]};var pM={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]};var mM={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]};var hM={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]};var dM={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]};var vM={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]};var gM={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]};var xM={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]};var yM={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]};var bM={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from \`n\` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]};var wM={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]};var DM={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]};var SM={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]};var NM={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]};var AM={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]};var EM={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]};var CM={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]};var MM={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]};var _M={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]};var TM={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]};var FM={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]};var OM={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]};var BM={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]};var IM={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]};var PM={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]};var kM={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]};var RM={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]};var LM={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]};var qM={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]};var UM={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]};var zM={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]};var WM={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]};var VM={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]};var YM={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]};var HM={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]};var GM={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]};var $M={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]};var ZM={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]};var QM={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]};var XM={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]};var JM={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]};var KM={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]};var jM={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]};var e_={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]};var r_={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]};var t_={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]};var n_={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:\`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. - -In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.\`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]};var i_={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]};var a_={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var o_={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var s_={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]};var u_={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]};var f_={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]};var l_={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as \`acosh(x) = ln(sqrt(x^2 - 1) + x)\`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]};var c_={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]};var p_={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as \`acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2\`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]};var m_={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]};var h_={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as \`acsch(x) = ln(1/x + sqrt(1/x^2 + 1))\`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]};var d_={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]};var v_={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]};var g_={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]};var x_={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as \`asinh(x) = ln(x + sqrt(x^2 + 1))\`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]};var y_={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]};var b_={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]};var w_={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as \`atanh(x) = ln((1 + x)/(1 - x)) / 2\`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]};var D_={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]};var S_={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]};var N_={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]};var A_={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]};var E_={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]};var C_={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]};var M_={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]};var __={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]};var T_={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]};var F_={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]};var O_={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]};var B_={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]};var I_={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]};var P_={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]};var k_={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]};var R_={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]};var L_={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]};var q_={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]};var U_={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]};var z_={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]};var W_={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]};var V_={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]};var Y_={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};var H_={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};var G_={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]};var $_={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]};var Z_={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]};var Q_={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]};var X_={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]};var J_={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]};var K_={bignumber:WA,boolean:VA,complex:YA,createUnit:HA,fraction:GA,index:$A,matrix:ZA,number:QA,sparse:XA,splitUnit:JA,string:KA,unit:jA,e:xg,E:xg,false:CA,i:MA,Infinity:_A,LN2:FA,LN10:TA,LOG2E:BA,LOG10E:OA,NaN:IA,null:PA,pi:yg,PI:yg,phi:kA,SQRT1_2:RA,SQRT2:LA,tau:qA,true:UA,version:zA,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:nE,lsolve:aE,lsolveAll:oE,lup:sE,lusolve:uE,leafCount:iE,polynomialRoot:fE,resolve:pE,simplify:mE,simplifyConstant:hE,simplifyCore:dE,symbolicEqual:gE,rationalize:cE,slu:vE,usolve:xE,usolveAll:yE,qr:lE,abs:bE,add:wE,cbrt:DE,ceil:SE,cube:NE,divide:AE,dotDivide:EE,dotMultiply:CE,dotPow:ME,exp:_E,expm:TE,expm1:FE,fix:OE,floor:BE,gcd:IE,hypot:PE,lcm:RE,log:LE,log2:zE,log1p:UE,log10:qE,mod:WE,multiply:VE,norm:YE,nthRoot:HE,nthRoots:GE,pow:$E,round:ZE,sign:QE,sqrt:XE,sqrtm:JE,square:rC,subtract:tC,unaryMinus:nC,unaryPlus:iC,xgcd:aC,invmod:kE,bitAnd:oC,bitNot:sC,bitOr:uC,bitXor:fC,leftShift:lC,rightArithShift:cC,rightLogShift:pC,bellNumbers:mC,catalan:hC,composition:dC,stirlingS2:vC,config:eE,import:rE,typed:tE,arg:gC,conj:xC,re:bC,im:yC,evaluate:wC,help:DC,distance:SC,intersect:NC,and:AC,not:EC,or:CC,xor:MC,concat:TC,count:FC,cross:OC,column:_C,ctranspose:BC,det:IC,diag:PC,diff:kC,dot:RC,getMatrixDataType:WC,identity:VC,filter:qC,flatten:UC,forEach:zC,inv:YC,pinv:HC,eigs:LC,kron:GC,matrixFromFunction:QC,matrixFromRows:XC,matrixFromColumns:ZC,map:$C,ones:JC,partitionSelect:KC,range:jC,resize:rM,reshape:eM,rotate:tM,rotationMatrix:nM,row:iM,size:aM,sort:oM,squeeze:sM,subset:uM,trace:fM,transpose:lM,zeros:cM,fft:pM,ifft:mM,sylvester:KE,schur:jE,lyap:eC,solveODE:J_,combinations:hM,combinationsWithRep:dM,factorial:vM,gamma:gM,kldivergence:yM,lgamma:xM,multinomial:bM,permutations:wM,pickRandom:DM,random:SM,randomInt:NM,compare:AM,compareNatural:EM,compareText:CM,deepEqual:MM,equal:_M,equalText:TM,larger:FM,largerEq:OM,smaller:BM,smallerEq:IM,unequal:PM,setCartesian:kM,setDifference:RM,setDistinct:LM,setIntersect:qM,setIsSubset:UM,setMultiplicity:zM,setPowerset:WM,setSize:VM,setSymDifference:YM,setUnion:HM,zpk2tf:GM,freqz:$M,erf:ZM,zeta:QM,cumsum:a_,mad:XM,max:JM,mean:KM,median:jM,min:e_,mode:r_,prod:t_,quantileSeq:n_,std:i_,sum:o_,variance:s_,corr:u_,acos:f_,acosh:l_,acot:c_,acoth:p_,acsc:m_,acsch:h_,asec:d_,asech:v_,asin:g_,asinh:x_,atan:y_,atanh:w_,atan2:b_,cos:D_,cosh:S_,cot:N_,coth:A_,csc:E_,csch:C_,sec:M_,sech:__,sin:T_,sinh:F_,tan:O_,tanh:B_,to:I_,clone:k_,format:R_,bin:P_,oct:Z_,hex:q_,isNaN:z_,isInteger:U_,isNegative:W_,isNumeric:V_,hasNumericValue:L_,isPositive:Y_,isPrime:H_,isZero:G_,print:Q_,typeOf:X_,numeric:$_};var j_="help",zz=["typed","mathWithTransform","Help"],eT=T(j_,zz,e=>{var{typed:r,mathWithTransform:t,Help:n}=e;return r(j_,{any:function(a){var s,l=a;if(typeof a!="string"){for(s in t)if($e(t,s)&&a===t[s]){l=s;break}}var f=gt(K_,l);if(!f){var o=typeof l=="function"?l.name:l;throw new Error('No documentation found on "'+o+'"')}return new n(f)}})});var rT="chain",Wz=["typed","Chain"],tT=T(rT,Wz,e=>{var{typed:r,Chain:t}=e;return r(rT,{"":function(){return new t},any:function(i){return new t(i)}})});var nT="det",Vz=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],iT=T(nT,Vz,e=>{var{typed:r,matrix:t,subtractScalar:n,multiply:i,divideScalar:a,isZero:s,unaryMinus:l}=e;return r(nT,{any:function(u){return tr(u)},"Array | Matrix":function(u){var p;switch(Ge(u)?p=u.size():Array.isArray(u)?(u=t(u),p=u.size()):p=[],p.length){case 0:return tr(u);case 1:if(p[0]===1)return tr(u.valueOf()[0]);if(p[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(p)+")");case 2:{var h=p[0],d=p[1];if(h===d)return f(u.clone().valueOf(),h,d);if(d===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(p)+")")}}});function f(o,u,p){if(u===1)return tr(o[0][0]);if(u===2)return n(i(o[0][0],o[1][1]),i(o[1][0],o[0][1]));for(var h=!1,d=new Array(u).fill(0).map((O,F)=>F),x=0;x{var{typed:r,matrix:t,divideScalar:n,addScalar:i,multiply:a,unaryMinus:s,det:l,identity:f,abs:o}=e;return r(aT,{"Array | Matrix":function(h){var d=Ge(h)?h.size():or(h);switch(d.length){case 1:if(d[0]===1)return Ge(h)?t([n(1,h.valueOf()[0])]):[n(1,h[0])];throw new RangeError("Matrix must be square (size: "+lr(d)+")");case 2:{var x=d[0],v=d[1];if(x===v)return Ge(h)?t(u(h.valueOf(),x,v),h.storage()):u(h,x,v);throw new RangeError("Matrix must be square (size: "+lr(d)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(d)+")")}},any:function(h){return n(1,h)}});function u(p,h,d){var x,v,y,w,C;if(h===1){if(w=p[0][0],w===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,w)]]}else if(h===2){var b=l(p);if(b===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(p[1][1],b),n(s(p[0][1]),b)],[n(s(p[1][0]),b),n(p[0][0],b)]]}else{var A=p.concat();for(x=0;xO&&(O=o(A[x][S]),F=x),x++;if(O===0)throw Error("Cannot calculate inverse, determinant is zero");x=F,x!==S&&(C=A[S],A[S]=A[x],A[x]=C,C=E[S],E[S]=E[x],E[x]=C);var M=A[S],_=E[S];for(x=0;x{var{typed:r,matrix:t,inv:n,deepEqual:i,equal:a,dotDivide:s,dot:l,ctranspose:f,divideScalar:o,multiply:u,add:p,Complex:h}=e;return r(sT,{"Array | Matrix":function(b){var A=Ge(b)?b.size():or(b);switch(A.length){case 1:return w(b)?f(b):A[0]===1?n(b):s(f(b),l(b,b));case 2:{if(w(b))return f(b);var E=A[0],S=A[1];if(E===S)try{return n(b)}catch(O){if(!(O instanceof Error&&O.message.match(/Cannot calculate inverse, determinant is zero/)))throw O}return Ge(b)?t(d(b.valueOf(),E,S),b.storage()):d(b,E,S)}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(A)+")")}},any:function(b){return a(b,0)?tr(b):o(1,b)}});function d(C,b,A){var{C:E,F:S}=v(C,b,A),O=u(n(u(f(E),E)),f(E)),F=u(f(S),n(u(S,f(S))));return u(F,O)}function x(C,b,A){for(var E=tr(C),S=0,O=0;OF.filter((_,k)=>k!y(l(E[M],E[M])));return{C:S,F:O}}function y(C){return a(p(C,h(1,1)),p(0,h(1,1)))}function w(C){return i(p(C,h(1,1)),p(u(C,0),h(1,1)))}});function fT(e){var{addScalar:r,subtract:t,flatten:n,multiply:i,multiplyScalar:a,divideScalar:s,sqrt:l,abs:f,bignumber:o,diag:u,size:p,reshape:h,inv:d,qr:x,usolve:v,usolveAll:y,equal:w,complex:C,larger:b,smaller:A,matrixFromColumns:E,dot:S}=e;function O(ie,H,ce,Me){var pe=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ge=F(ie,H,ce,Me,pe);M(ie,H,ce,Me,pe,ge);var{values:Se,C:xe}=_(ie,H,ce,Me,pe);if(pe){var be=k(ie,H,xe,ge,Se,ce,Me);return{values:Se,eigenvectors:be}}return{values:Se}}function F(ie,H,ce,Me,pe){var ge=Me==="BigNumber",Se=Me==="Complex",xe=ge?o(0):0,be=ge?o(1):Se?C(1):1,De=ge?o(1):1,Ae=ge?o(10):2,ze=a(Ae,Ae),Ze;pe&&(Ze=Array(H).fill(be));for(var K=!1;!K;){K=!0;for(var te=0;te1&&(K=u(Array(Ae-1).fill(xe)))),Ae-=1,be.pop();for(var Ce=0;Ce2&&(K=u(Array(Ae-2).fill(xe)))),Ae-=2,be.pop(),be.pop();for(var Ie=0;Ie+t(f(Xe),f(Or))),te>100){var sr=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+De.join(", "));throw sr.values=De,sr.vectors=[],sr}var ir=pe?i(Ze,V(ze,H)):void 0;return{values:De,C:ir}}function k(ie,H,ce,Me,pe,ge,Se){var xe=d(ce),be=i(xe,ie,ce),De=Se==="BigNumber",Ae=Se==="Complex",ze=De?o(0):Ae?C(0):0,Ze=De?o(1):Ae?C(1):1,K=[],te=[];for(var ye of pe){var ee=q(K,ye,w);ee===-1?(K.push(ye),te.push(1)):te[ee]+=1}for(var ne=[],ue=K.length,Ee=Array(H).fill(ze),Ce=u(Array(H).fill(Ze)),Le=function(){var ir=K[Ie],Xe=t(be,i(ir,Ce)),Or=y(Xe,Ee);for(Or.shift();Or.lengthi(le,we)),ne.push(...Or.map(we=>({value:ir,vector:n(we)})))},Ie=0;Ie=5)return null;for(xe=0;;){var be=v(ie,Se);if(A(oe(U(Se,[be])),Me))break;if(++xe>=10)return null;Se=me(be)}return Se}function j(ie,H,ce){var Me=ce==="BigNumber",pe=ce==="Complex",ge=Array(ie).fill(0).map(Se=>2*Math.random()-1);return Me&&(ge=ge.map(Se=>o(Se))),pe&&(ge=ge.map(Se=>C(Se))),ge=U(ge,H),me(ge,ce)}function U(ie,H){var ce=p(ie);for(var Me of H)Me=h(Me,ce),ie=t(ie,i(s(S(Me,ie),S(Me,Me)),Me));return ie}function oe(ie){return f(l(S(ie,ie)))}function me(ie,H){var ce=H==="BigNumber",Me=H==="Complex",pe=ce?o(1):Me?C(1):1;return i(s(pe,oe(ie)),ie)}return O}function lT(e){var{config:r,addScalar:t,subtract:n,abs:i,atan:a,cos:s,sin:l,multiplyScalar:f,inv:o,bignumber:u,multiply:p,add:h}=e;function d(M,_){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.epsilon,L=arguments.length>3?arguments[3]:void 0,Y=arguments.length>4?arguments[4]:void 0;if(L==="number")return x(M,k,Y);if(L==="BigNumber")return v(M,k,Y);throw TypeError("Unsupported data type: "+L)}function x(M,_,k){var L=M.length,Y=Math.abs(_/L),$,V;if(k){V=new Array(L);for(var q=0;q=Math.abs(Y);){var j=R[0][0],U=R[0][1];$=y(M[j][j],M[U][U],M[j][U]),M=E(M,$,j,U),k&&(V=C(V,$,j,U)),R=S(M)}for(var oe=Array(L).fill(0),me=0;me=i(Y);){var j=R[0][0],U=R[0][1];$=w(M[j][j],M[U][U],M[j][U]),M=A(M,$,j,U),k&&(V=b(V,$,j,U)),R=O(M)}for(var oe=Array(L).fill(0),me=0;me({value:Y[H],vector:ie}));return{values:Y,eigenvectors:me}}return d}var Gz="eigs",$z=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],cT=T(Gz,$z,e=>{var{config:r,typed:t,matrix:n,addScalar:i,subtract:a,equal:s,abs:l,atan:f,cos:o,sin:u,multiplyScalar:p,divideScalar:h,inv:d,bignumber:x,multiply:v,add:y,larger:w,column:C,flatten:b,number:A,complex:E,sqrt:S,diag:O,size:F,reshape:M,qr:_,usolve:k,usolveAll:L,im:Y,re:$,smaller:V,matrixFromColumns:q,dot:R}=e,j=lT({config:r,addScalar:i,subtract:a,column:C,flatten:b,equal:s,abs:l,atan:f,cos:o,sin:u,multiplyScalar:p,inv:d,bignumber:x,complex:E,multiply:v,add:y}),U=fT({config:r,addScalar:i,subtract:a,multiply:v,multiplyScalar:p,flatten:b,divideScalar:h,sqrt:S,abs:l,bignumber:x,diag:O,size:F,reshape:M,qr:_,inv:d,usolve:k,usolveAll:L,equal:s,complex:E,larger:w,smaller:V,matrixFromColumns:q,dot:R});return t("eigs",{Array:function(ge){return oe(n(ge))},"Array, number|BigNumber":function(ge,Se){return oe(n(ge),{precision:Se})},"Array, Object"(pe,ge){return oe(n(pe),ge)},Matrix:function(ge){return oe(ge,{matricize:!0})},"Matrix, number|BigNumber":function(ge,Se){return oe(ge,{precision:Se,matricize:!0})},"Matrix, Object":function(ge,Se){var xe={matricize:!0};return Mt(xe,Se),oe(ge,xe)}});function oe(pe){var ge,Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},xe="eigenvectors"in Se?Se.eigenvectors:!0,be=(ge=Se.precision)!==null&&ge!==void 0?ge:r.epsilon,De=me(pe,be,xe);return Se.matricize&&(De.values=n(De.values),xe&&(De.eigenvectors=De.eigenvectors.map(Ae=>{var{value:ze,vector:Ze}=Ae;return{value:ze,vector:n(Ze)}}))),xe&&Object.defineProperty(De,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),De}function me(pe,ge,Se){var xe=pe.toArray(),be=pe.size();if(be.length!==2||be[0]!==be[1])throw new RangeError("Matrix must be square (size: ".concat(lr(be),")"));var De=be[0];if(H(xe,De,ge)&&(ce(xe,De),ie(xe,De,ge))){var Ae=Me(pe,xe,De);return j(xe,De,ge,Ae,Se)}var ze=Me(pe,xe,De);return U(xe,De,ge,ze,Se)}function ie(pe,ge,Se){for(var xe=0;xe{var{typed:r,abs:t,add:n,identity:i,inv:a,multiply:s}=e;return r(pT,{Matrix:function(p){var h=p.size();if(h.length!==2||h[0]!==h[1])throw new RangeError("Matrix must be square (size: "+lr(h)+")");for(var d=h[0],x=1e-15,v=l(p),y=f(v,x),w=y.q,C=y.j,b=s(p,Math.pow(2,-C)),A=i(d),E=i(d),S=1,O=b,F=-1,M=1;M<=w;M++)M>1&&(O=s(O,b),F=-F),S=S*(w-M+1)/((2*w-M+1)*M),A=n(A,s(S,O)),E=n(E,s(S*F,O));for(var _=s(a(E),A),k=0;k{var{typed:r,abs:t,add:n,multiply:i,map:a,sqrt:s,subtract:l,inv:f,size:o,max:u,identity:p}=e,h=1e3,d=1e-6;function x(v){var y,w=0,C=v,b=p(o(v));do{var A=C;if(C=i(.5,n(A,f(b))),b=i(.5,n(b,f(A))),y=u(t(l(C,A))),y>d&&++w>h)throw new Error("computing square root of matrix: iterative method could not converge")}while(y>d);return C}return r(hT,{"Array | Matrix":function(y){var w=Ge(y)?y.size():or(y);switch(w.length){case 1:if(w[0]===1)return a(y,s);throw new RangeError("Matrix must be square (size: "+lr(w)+")");case 2:{var C=w[0],b=w[1];if(C===b)return x(y);throw new RangeError("Matrix must be square (size: "+lr(w)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+lr(w)+")")}}})});var vT="sylvester",Xz=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],gT=T(vT,Xz,e=>{var{typed:r,schur:t,matrixFromColumns:n,matrix:i,multiply:a,range:s,concat:l,transpose:f,index:o,subset:u,add:p,subtract:h,identity:d,lusolve:x,abs:v}=e;return r(vT,{"Matrix, Matrix, Matrix":y,"Array, Matrix, Matrix":function(C,b,A){return y(i(C),b,A)},"Array, Array, Matrix":function(C,b,A){return y(i(C),i(b),A)},"Array, Matrix, Array":function(C,b,A){return y(i(C),b,i(A))},"Matrix, Array, Matrix":function(C,b,A){return y(C,i(b),A)},"Matrix, Array, Array":function(C,b,A){return y(C,i(b),i(A))},"Matrix, Matrix, Array":function(C,b,A){return y(C,b,i(A))},"Array, Array, Array":function(C,b,A){return y(i(C),i(b),i(A)).toArray()}});function y(w,C,b){for(var A=C.size()[0],E=w.size()[0],S=t(w),O=S.T,F=S.U,M=t(a(-1,C)),_=M.T,k=M.U,L=a(a(f(F),b),k),Y=s(0,E),$=[],V=(Ae,ze)=>l(Ae,ze,1),q=(Ae,ze)=>l(Ae,ze,0),R=0;R1e-5){for(var j=q(u(L,o(Y,R)),u(L,o(Y,R+1))),U=0;U{var{typed:r,matrix:t,identity:n,multiply:i,qr:a,norm:s,subtract:l}=e;return r(xT,{Array:function(u){var p=f(t(u));return{U:p.U.valueOf(),T:p.T.valueOf()}},Matrix:function(u){return f(u)}});function f(o){var u=o.size()[0],p=o,h=n(u),d=0,x;do{x=p;var v=a(p),y=v.Q,w=v.R;if(p=i(w,y),h=i(h,y),d++>100)break}while(s(l(p,x))>1e-4);return{U:h,T:p}}});var bT="lyap",Kz=["typed","matrix","sylvester","multiply","transpose"],wT=T(bT,Kz,e=>{var{typed:r,matrix:t,sylvester:n,multiply:i,transpose:a}=e;return r(bT,{"Matrix, Matrix":function(l,f){return n(l,a(l),i(-1,f))},"Array, Matrix":function(l,f){return n(t(l),a(t(l)),i(-1,f))},"Matrix, Array":function(l,f){return n(l,a(t(l)),t(i(-1,f)))},"Array, Array":function(l,f){return n(t(l),a(t(l)),t(i(-1,f))).toArray()}})});var jz="divide",eW=["typed","matrix","multiply","equalScalar","divideScalar","inv"],DT=T(jz,eW,e=>{var{typed:r,matrix:t,multiply:n,equalScalar:i,divideScalar:a,inv:s}=e,l=Jr({typed:r,equalScalar:i}),f=Bt({typed:r});return r("divide",xc({"Array | Matrix, Array | Matrix":function(u,p){return n(u,s(p))},"DenseMatrix, any":function(u,p){return f(u,p,a,!1)},"SparseMatrix, any":function(u,p){return l(u,p,a,!1)},"Array, any":function(u,p){return f(t(u),p,a,!1).valueOf()},"any, Array | Matrix":function(u,p){return n(u,s(p))}},a.signatures))});var ST="distance",rW=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],NT=T(ST,rW,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:i,divideScalar:a,deepEqual:s,sqrt:l,abs:f}=e;return r(ST,{"Array, Array, Array":function(E,S,O){if(E.length===2&&S.length===2&&O.length===2){if(!u(E))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!u(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!u(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(s(S,O))throw new TypeError("LinePoint1 should not be same with LinePoint2");var F=n(O[1],S[1]),M=n(S[0],O[0]),_=n(i(O[0],S[1]),i(S[0],O[1]));return y(E[0],E[1],F,M,_)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(E,S,O){if(Object.keys(E).length===2&&Object.keys(S).length===2&&Object.keys(O).length===2){if(!u(E))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!u(S))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!u(O))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(s(x(S),x(O)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in E&&"pointY"in E&&"lineOnePtX"in S&&"lineOnePtY"in S&&"lineTwoPtX"in O&&"lineTwoPtY"in O){var F=n(O.lineTwoPtY,S.lineOnePtY),M=n(S.lineOnePtX,O.lineTwoPtX),_=n(i(O.lineTwoPtX,S.lineOnePtY),i(S.lineOnePtX,O.lineTwoPtY));return y(E.pointX,E.pointY,F,M,_)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(E,S){if(E.length===2&&S.length===3){if(!u(E))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return y(E[0],E[1],S[0],S[1],S[2])}else if(E.length===3&&S.length===6){if(!p(E))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!d(S))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return w(E[0],E[1],E[2],S[0],S[1],S[2],S[3],S[4],S[5])}else if(E.length===S.length&&E.length>0){if(!h(E))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!h(S))throw new TypeError("All values of an array should be numbers or BigNumbers");return C(E,S)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(E,S){if(Object.keys(E).length===2&&Object.keys(S).length===3){if(!u(E))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!p(S))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in E&&"pointY"in E&&"xCoeffLine"in S&&"yCoeffLine"in S&&"constant"in S)return y(E.pointX,E.pointY,S.xCoeffLine,S.yCoeffLine,S.constant);throw new TypeError("Key names do not match")}else if(Object.keys(E).length===3&&Object.keys(S).length===6){if(!p(E))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!d(S))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in E&&"pointY"in E&&"x0"in S&&"y0"in S&&"z0"in S&&"a"in S&&"b"in S&&"c"in S)return w(E.pointX,E.pointY,E.pointZ,S.x0,S.y0,S.z0,S.a,S.b,S.c);throw new TypeError("Key names do not match")}else if(Object.keys(E).length===2&&Object.keys(S).length===2){if(!u(E))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!u(S))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in E&&"pointOneY"in E&&"pointTwoX"in S&&"pointTwoY"in S)return C([E.pointOneX,E.pointOneY],[S.pointTwoX,S.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(E).length===3&&Object.keys(S).length===3){if(!p(E))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!p(S))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in E&&"pointOneY"in E&&"pointOneZ"in E&&"pointTwoX"in S&&"pointTwoY"in S&&"pointTwoZ"in S)return C([E.pointOneX,E.pointOneY,E.pointOneZ],[S.pointTwoX,S.pointTwoY,S.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(E){if(!v(E))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return b(E)}});function o(A){return typeof A=="number"||je(A)}function u(A){return A.constructor!==Array&&(A=x(A)),o(A[0])&&o(A[1])}function p(A){return A.constructor!==Array&&(A=x(A)),o(A[0])&&o(A[1])&&o(A[2])}function h(A){return Array.isArray(A)||(A=x(A)),A.every(o)}function d(A){return A.constructor!==Array&&(A=x(A)),o(A[0])&&o(A[1])&&o(A[2])&&o(A[3])&&o(A[4])&&o(A[5])}function x(A){for(var E=Object.keys(A),S=[],O=0;OE.length!==2||!o(E[0])||!o(E[1])))return!1}else if(A[0].length===3&&o(A[0][0])&&o(A[0][1])&&o(A[0][2])){if(A.some(E=>E.length!==3||!o(E[0])||!o(E[1])||!o(E[2])))return!1}else return!1;return!0}function y(A,E,S,O,F){var M=f(t(t(i(S,A),i(O,E)),F)),_=l(t(i(S,S),i(O,O)));return a(M,_)}function w(A,E,S,O,F,M,_,k,L){var Y=[n(i(n(F,E),L),i(n(M,S),k)),n(i(n(M,S),_),i(n(O,A),L)),n(i(n(O,A),k),i(n(F,E),_))];Y=l(t(t(i(Y[0],Y[0]),i(Y[1],Y[1])),i(Y[2],Y[2])));var $=l(t(t(i(_,_),i(k,k)),i(L,L)));return a(Y,$)}function C(A,E){for(var S=A.length,O=0,F=0,M=0;M{var{typed:r,config:t,abs:n,add:i,addScalar:a,matrix:s,multiply:l,multiplyScalar:f,divideScalar:o,subtract:u,smaller:p,equalScalar:h,flatten:d,isZero:x,isNumeric:v}=e;return r("intersect",{"Array, Array, Array":y,"Array, Array, Array, Array":w,"Matrix, Matrix, Matrix":function(k,L,Y){var $=y(k.valueOf(),L.valueOf(),Y.valueOf());return $===null?null:s($)},"Matrix, Matrix, Matrix, Matrix":function(k,L,Y,$){var V=w(k.valueOf(),L.valueOf(),Y.valueOf(),$.valueOf());return V===null?null:s(V)}});function y(_,k,L){if(_=C(_),k=C(k),L=C(L),!A(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!A(k))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!E(L))throw new TypeError("Array with 4 numbers expected as third argument");return M(_[0],_[1],_[2],k[0],k[1],k[2],L[0],L[1],L[2],L[3])}function w(_,k,L,Y){if(_=C(_),k=C(k),L=C(L),Y=C(Y),_.length===2){if(!b(_))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!b(k))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!b(L))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!b(Y))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return S(_,k,L,Y)}else if(_.length===3){if(!A(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!A(k))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!A(L))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!A(Y))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return F(_[0],_[1],_[2],k[0],k[1],k[2],L[0],L[1],L[2],Y[0],Y[1],Y[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function C(_){return _.length===1?_[0]:_.length>1&&Array.isArray(_[0])&&_.every(k=>Array.isArray(k)&&k.length===1)?d(_):_}function b(_){return _.length===2&&v(_[0])&&v(_[1])}function A(_){return _.length===3&&v(_[0])&&v(_[1])&&v(_[2])}function E(_){return _.length===4&&v(_[0])&&v(_[1])&&v(_[2])&&v(_[3])}function S(_,k,L,Y){var $=_,V=L,q=u($,k),R=u(V,Y),j=u(f(q[0],R[1]),f(R[0],q[1]));if(x(j)||p(n(j),t.epsilon))return null;var U=f(R[0],$[1]),oe=f(R[1],$[0]),me=f(R[0],V[1]),ie=f(R[1],V[0]),H=o(a(u(u(U,oe),me),ie),j);return i(l(q,H),$)}function O(_,k,L,Y,$,V,q,R,j,U,oe,me){var ie=f(u(_,k),u(L,Y)),H=f(u($,V),u(q,R)),ce=f(u(j,U),u(oe,me));return a(a(ie,H),ce)}function F(_,k,L,Y,$,V,q,R,j,U,oe,me){var ie=O(_,q,U,q,k,R,oe,R,L,j,me,j),H=O(U,q,Y,_,oe,R,$,k,me,j,V,L),ce=O(_,q,Y,_,k,R,$,k,L,j,V,L),Me=O(U,q,U,q,oe,R,oe,R,me,j,me,j),pe=O(Y,_,Y,_,$,k,$,k,V,L,V,L),ge=u(f(ie,H),f(ce,Me)),Se=u(f(pe,Me),f(H,H));if(x(Se))return null;var xe=o(ge,Se),be=o(a(ie,f(xe,H)),Me),De=a(_,f(xe,u(Y,_))),Ae=a(k,f(xe,u($,k))),ze=a(L,f(xe,u(V,L))),Ze=a(q,f(be,u(U,q))),K=a(R,f(be,u(oe,R))),te=a(j,f(be,u(me,j)));return h(De,Ze)&&h(Ae,K)&&h(ze,te)?[De,Ae,ze]:null}function M(_,k,L,Y,$,V,q,R,j,U){var oe=f(_,q),me=f(Y,q),ie=f(k,R),H=f($,R),ce=f(L,j),Me=f(V,j),pe=u(u(u(U,oe),ie),ce),ge=u(u(u(a(a(me,H),Me),oe),ie),ce),Se=o(pe,ge),xe=a(_,f(Se,u(Y,_))),be=a(k,f(Se,u($,k))),De=a(L,f(Se,u(V,L)));return[xe,be,De]}});var ET="sum",iW=["typed","config","add","numeric"],Lp=T(ET,iW,e=>{var{typed:r,config:t,add:n,numeric:i}=e;return r(ET,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":s,"...":function(f){if(di(f))throw new TypeError("Scalar values expected in function sum");return a(f)}});function a(l){var f;return hn(l,function(o){try{f=f===void 0?o:n(f,o)}catch(u){throw St(u,"sum",o)}}),f===void 0&&(f=i(0,t.number)),typeof f=="string"&&(f=i(f,t.number)),f}function s(l,f){try{var o=Do(l,f,n);return o}catch(u){throw St(u,"sum")}}});var qp="cumsum",aW=["typed","add","unaryPlus"],Up=T(qp,aW,e=>{var{typed:r,add:t,unaryPlus:n}=e;return r(qp,{Array:i,Matrix:function(o){return o.create(i(o.valueOf()))},"Array, number | BigNumber":s,"Matrix, number | BigNumber":function(o,u){return o.create(s(o.valueOf(),u))},"...":function(o){if(di(o))throw new TypeError("All values expected to be scalar in function cumsum");return i(o)}});function i(f){try{return a(f)}catch(o){throw St(o,qp)}}function a(f){if(f.length===0)return[];for(var o=[n(f[0])],u=1;u=u.length)throw new Xt(o,u.length);try{return l(f,o)}catch(p){throw St(p,qp)}}function l(f,o){var u,p,h;if(o<=0){var d=f[0][0];if(Array.isArray(d)){for(h=Rc(f),p=[],u=0;u{var{typed:r,add:t,divide:n}=e;return r(CT,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":i,"...":function(l){if(di(l))throw new TypeError("Scalar values expected in function mean");return a(l)}});function i(s,l){try{var f=Do(s,l,t),o=Array.isArray(s)?or(s):s.size();return n(f,o[l])}catch(u){throw St(u,"mean")}}function a(s){var l,f=0;if(hn(s,function(o){try{l=l===void 0?o:t(l,o),f++}catch(u){throw St(u,"mean",o)}}),f===0)throw new Error("Cannot calculate the mean of an empty array");return n(l,f)}});var MT="median",sW=["typed","add","divide","compare","partitionSelect"],_T=T(MT,sW,e=>{var{typed:r,add:t,divide:n,compare:i,partitionSelect:a}=e;function s(o){try{o=gr(o.valueOf());var u=o.length;if(u===0)throw new Error("Cannot calculate median of an empty array");if(u%2===0){for(var p=u/2-1,h=a(o,p+1),d=o[p],x=0;x0&&(d=o[x]);return f(d,h)}else{var v=a(o,(u-1)/2);return l(v)}}catch(y){throw St(y,"median")}}var l=r({"number | BigNumber | Complex | Unit":function(u){return u}}),f=r({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(u,p){return n(t(u,p),2)}});return r(MT,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(u,p){throw new Error("median(A, dim) is not yet supported")},"...":function(u){if(di(u))throw new TypeError("Scalar values expected in function median");return s(u)}})});var TT="mad",uW=["typed","abs","map","median","subtract"],FT=T(TT,uW,e=>{var{typed:r,abs:t,map:n,median:i,subtract:a}=e;return r(TT,{"Array | Matrix":s,"...":function(f){return s(f)}});function s(l){if(l=gr(l.valueOf()),l.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var f=i(l);return i(n(l,function(o){return t(a(o,f))}))}catch(o){throw o instanceof TypeError&&o.message.indexOf("median")!==-1?new TypeError(o.message.replace("median","mad")):St(o,"mad")}}});var bg="unbiased",OT="variance",fW=["typed","add","subtract","multiply","divide","apply","isNaN"],Wp=T(OT,fW,e=>{var{typed:r,add:t,subtract:n,multiply:i,divide:a,apply:s,isNaN:l}=e;return r(OT,{"Array | Matrix":function(p){return f(p,bg)},"Array | Matrix, string":f,"Array | Matrix, number | BigNumber":function(p,h){return o(p,h,bg)},"Array | Matrix, number | BigNumber, string":o,"...":function(p){return f(p,bg)}});function f(u,p){var h,d=0;if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(hn(u,function(y){try{h=h===void 0?y:t(h,y),d++}catch(w){throw St(w,"variance",y)}}),d===0)throw new Error("Cannot calculate variance of an empty array");var x=a(h,d);if(h=void 0,hn(u,function(y){var w=n(y,x);h=h===void 0?i(w,w):t(h,i(w,w))}),l(h))return h;switch(p){case"uncorrected":return a(h,d);case"biased":return a(h,d+1);case"unbiased":{var v=je(h)?h.mul(0):0;return d===1?v:a(h,d-1)}default:throw new Error('Unknown normalization "'+p+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function o(u,p,h){try{if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return s(u,p,d=>f(d,h))}catch(d){throw St(d,"variance")}}});var BT="quantileSeq",lW=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Vp=T(BT,lW,e=>{var{typed:r,bignumber:t,add:n,subtract:i,divide:a,multiply:s,partitionSelect:l,compare:f,isInteger:o,smaller:u,smallerEq:p,larger:h}=e,d=ou({typed:r,isInteger:o});return r(BT,{"Array | Matrix, number | BigNumber":(C,b)=>v(C,b,!1),"Array | Matrix, number | BigNumber, number":(C,b,A)=>x(C,b,!1,A,v),"Array | Matrix, number | BigNumber, boolean":v,"Array | Matrix, number | BigNumber, boolean, number":(C,b,A,E)=>x(C,b,A,E,v),"Array | Matrix, Array | Matrix":(C,b)=>y(C,b,!1),"Array | Matrix, Array | Matrix, number":(C,b,A)=>x(C,b,!1,A,y),"Array | Matrix, Array | Matrix, boolean":y,"Array | Matrix, Array | Matrix, boolean, number":(C,b,A,E)=>x(C,b,A,E,y)});function x(C,b,A,E,S){return d(C,E,O=>S(O,b,A))}function v(C,b,A){var E,S=C.valueOf();if(u(b,0))throw new Error("N/prob must be non-negative");if(p(b,1))return ar(b)?w(S,b,A):t(w(S,b,A));if(h(b,1)){if(!o(b))throw new Error("N must be a positive integer");if(h(b,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var O=n(b,1);E=[];for(var F=0;u(F,b);F++){var M=a(F+1,O);E.push(w(S,M,A))}return ar(b)?E:t(E)}}function y(C,b,A){for(var E=C.valueOf(),S=b.valueOf(),O=[],F=0;F0&&(_=E[L])}return n(s(_,i(1,M)),s(k,M))}});var IT="std",cW=["typed","map","sqrt","variance"],Yp=T(IT,cW,e=>{var{typed:r,map:t,sqrt:n,variance:i}=e;return r(IT,{"Array | Matrix":a,"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":a,"Array | Matrix, number | BigNumber, string":a,"...":function(l){return a(l)}});function a(s,l){if(s.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var f=i.apply(null,arguments);return bt(f)?t(f,n):n(f)}catch(o){throw o instanceof TypeError&&o.message.indexOf(" variance")!==-1?new TypeError(o.message.replace(" variance"," std")):o}}});var PT="corr",pW=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],kT=T(PT,pW,e=>{var{typed:r,matrix:t,sqrt:n,sum:i,add:a,subtract:s,multiply:l,pow:f,divide:o}=e;return r(PT,{"Array, Array":function(d,x){return u(d,x)},"Matrix, Matrix":function(d,x){var v=u(d.toArray(),x.toArray());return Array.isArray(v)?t(v):v}});function u(h,d){var x=[];if(Array.isArray(h[0])&&Array.isArray(d[0])){if(h.length!==d.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var v=0;va(S,l(O,d[F])),0),C=i(h.map(S=>f(S,2))),b=i(d.map(S=>f(S,2))),A=s(l(x,w),l(v,y)),E=n(l(s(l(x,C),f(v,2)),s(l(x,b),f(y,2))));return o(A,E)}});var RT="combinations",mW=["typed"],qT=T(RT,mW,e=>{var{typed:r}=e;return r(RT,{"number, number":Bv,"BigNumber, BigNumber":function(n,i){var a=n.constructor,s,l,f=n.minus(i),o=new a(1);if(!LT(n)||!LT(i))throw new TypeError("Positive integer value expected in function combinations");if(i.gt(n))throw new TypeError("k must be less than n in function combinations");if(s=o,i.lt(f))for(l=o;l.lte(f);l=l.plus(o))s=s.times(i.plus(l)).dividedBy(l);else for(l=o;l.lte(i);l=l.plus(o))s=s.times(f.plus(l)).dividedBy(l);return s}})});function LT(e){return e.isInteger()&&e.gte(0)}var UT="combinationsWithRep",hW=["typed"],WT=T(UT,hW,e=>{var{typed:r}=e;return r(UT,{"number, number":function(n,i){if(!He(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!He(i)||i<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n<1)throw new TypeError("k must be less than or equal to n + k - 1");if(i{var{typed:r,config:t,multiplyScalar:n,pow:i,BigNumber:a,Complex:s}=e;function l(o){if(o.im===0)return Sf(o.re);if(o.re<.5){var u=new s(1-o.re,-o.im),p=new s(Math.PI*o.re,Math.PI*o.im);return new s(Math.PI).div(p.sin()).div(l(u))}o=new s(o.re-1,o.im);for(var h=new s(is[0],0),d=1;d2;)h-=2,x+=h,d=d.times(x);return new a(d.toPrecision(a.precision))}});var HT="lgamma",vW=["Complex","typed"],GT=T(HT,vW,e=>{var{Complex:r,typed:t}=e,n=7,i=7,a=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(HT,{number:Nf,Complex:s,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function s(o){var u=6.283185307179586,p=1.1447298858494002,h=.1;if(o.isNaN())return new r(NaN,NaN);if(o.im===0)return new r(Nf(o.re),0);if(o.re>=n||Math.abs(o.im)>=i)return l(o);if(o.re<=h){var d=vy(u,o.im)*Math.floor(.5*o.re+.25),x=o.mul(Math.PI).sin().log(),v=s(new r(1-o.re,-o.im));return new r(p,d).sub(x).sub(v)}else return o.im>=0?f(o):f(o.conjugate()).conjugate()}function l(o){for(var u=o.sub(.5).mul(o.log()).sub(o).add(Uv),p=new r(1,0).div(o),h=p.div(o),d=a[0],x=a[1],v=2*h.re,y=h.re*h.re+h.im*h.im,w=2;w<8;w++){var C=x;x=-y*d+a[w],d=v*d+C}var b=p.mul(h.mul(d).add(x));return u.add(b)}function f(o){var u=0,p=0,h=o;for(o=o.add(1);o.re<=n;){h=h.mul(o);var d=h.im<0?1:0;d!==0&&p===0&&u++,p=d,o=o.add(1)}return l(o).sub(h.log()).sub(new r(0,u*2*Math.PI*1))}});var $T="factorial",gW=["typed","gamma"],ZT=T($T,gW,e=>{var{typed:r,gamma:t}=e;return r($T,{number:function(i){if(i<0)throw new Error("Value must be non-negative");return t(i+1)},BigNumber:function(i){if(i.isNegative())throw new Error("Value must be non-negative");return t(i.plus(1))},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var QT="kldivergence",xW=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],XT=T(QT,xW,e=>{var{typed:r,matrix:t,divide:n,sum:i,multiply:a,map:s,dotDivide:l,log:f,isNumeric:o}=e;return r(QT,{"Array, Array":function(h,d){return u(t(h),t(d))},"Matrix, Array":function(h,d){return u(h,t(d))},"Array, Matrix":function(h,d){return u(t(h),d)},"Matrix, Matrix":function(h,d){return u(h,d)}});function u(p,h){var d=h.size().length,x=p.size().length;if(d>1)throw new Error("first object must be one dimensional");if(x>1)throw new Error("second object must be one dimensional");if(d!==x)throw new Error("Length of two vectors must be equal");var v=i(p);if(v===0)throw new Error("Sum of elements in first object must be non zero");var y=i(h);if(y===0)throw new Error("Sum of elements in second object must be non zero");var w=n(p,i(p)),C=n(h,i(h)),b=i(a(w,s(l(w,C),A=>f(A))));return o(b)?b:Number.NaN}});var JT="multinomial",yW=["typed","add","divide","multiply","factorial","isInteger","isPositive"],KT=T(JT,yW,e=>{var{typed:r,add:t,divide:n,multiply:i,factorial:a,isInteger:s,isPositive:l}=e;return r(JT,{"Array | Matrix":function(o){var u=0,p=1;return hn(o,function(h){if(!s(h)||!l(h))throw new TypeError("Positive integer value expected in function multinomial");u=t(u,h),p=i(p,a(h))}),n(a(u),p)}})});var jT="permutations",bW=["typed","factorial"],rF=T(jT,bW,e=>{var{typed:r,factorial:t}=e;return r(jT,{"number | BigNumber":t,"number, number":function(i,a){if(!He(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(!He(a)||a<0)throw new TypeError("Positive integer value expected in function permutations");if(a>i)throw new TypeError("second argument k must be less than or equal to first argument n");return jn(i-a+1,i)},"BigNumber, BigNumber":function(i,a){var s,l;if(!eF(i)||!eF(a))throw new TypeError("Positive integer value expected in function permutations");if(a.gt(i))throw new TypeError("second argument k must be less than or equal to first argument n");var f=i.mul(0).add(1);for(s=f,l=i.minus(a).plus(1);l.lte(i);l=l.plus(1))s=s.times(l);return s}})});function eF(e){return e.isInteger()&&e.gte(0)}var Cg=Xn(xF(),1),CW=(0,Cg.default)(Date.now());function Ua(e){var r;function t(i){r=i===null?CW:(0,Cg.default)(String(i))}t(e);function n(){return r()}return n}var yF="pickRandom",MW=["typed","config","?on"],bF=T(yF,MW,e=>{var{typed:r,config:t,on:n}=e,i=Ua(t.randomSeed);return n&&n("config",function(s,l){s.randomSeed!==l.randomSeed&&(i=Ua(s.randomSeed))}),r(yF,{"Array | Matrix":function(l){return a(l,{})},"Array | Matrix, Object":function(l,f){return a(l,f)},"Array | Matrix, number":function(l,f){return a(l,{number:f})},"Array | Matrix, Array | Matrix":function(l,f){return a(l,{weights:f})},"Array | Matrix, Array | Matrix, number":function(l,f,o){return a(l,{number:o,weights:f})},"Array | Matrix, number, Array | Matrix":function(l,f,o){return a(l,{number:f,weights:o})}});function a(s,l){var{number:f,weights:o,elementWise:u=!0}=l,p=typeof f>"u";p&&(f=1);var h=Ge(s)?s.create:Ge(o)?o.create:null;s=s.valueOf(),o&&(o=o.valueOf()),u===!0&&(s=gr(s),o=gr(o));var d=0;if(typeof o<"u"){if(o.length!==s.length)throw new Error("Weights must have the same length as possibles");for(var x=0,v=o.length;x"u")C=s[Math.floor(i()*y)];else for(var b=i()*d,A=0,E=s.length;A1)for(var n=0,i=e.shift();n{var{typed:r,config:t,on:n}=e,i=Ua(t.randomSeed);return n&&n("config",function(l,f){l.randomSeed!==f.randomSeed&&(i=Ua(l.randomSeed))}),r(wF,{"":()=>s(0,1),number:l=>s(0,l),"number, number":(l,f)=>s(l,f),"Array | Matrix":l=>a(l,0,1),"Array | Matrix, number":(l,f)=>a(l,0,f),"Array | Matrix, number, number":(l,f,o)=>a(l,f,o)});function a(l,f,o){var u=_f(l.valueOf(),()=>s(f,o));return Ge(l)?l.create(u):u}function s(l,f){return l+i()*(f-l)}});var SF="randomInt",TW=["typed","config","?on"],NF=T(SF,TW,e=>{var{typed:r,config:t,on:n}=e,i=Ua(t.randomSeed);return n&&n("config",function(l,f){l.randomSeed!==f.randomSeed&&(i=Ua(l.randomSeed))}),r(SF,{"":()=>s(0,1),number:l=>s(0,l),"number, number":(l,f)=>s(l,f),"Array | Matrix":l=>a(l,0,1),"Array | Matrix, number":(l,f)=>a(l,0,f),"Array | Matrix, number, number":(l,f,o)=>a(l,f,o)});function a(l,f,o){var u=_f(l.valueOf(),()=>s(f,o));return Ge(l)?l.create(u):u}function s(l,f){return Math.floor(l+i()*(f-l))}});var AF="stirlingS2",FW=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],EF=T(AF,FW,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:i,divideScalar:a,pow:s,factorial:l,combinations:f,isNegative:o,isInteger:u,number:p,bignumber:h,larger:d}=e,x=[],v=[];return r(AF,{"number | BigNumber, number | BigNumber":function(w,C){if(!u(w)||o(w)||!u(C)||o(C))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(d(C,w))throw new TypeError("k must be less than or equal to n in function stirlingS2");var b=!(ar(w)&&ar(C)),A=b?v:x,E=b?h:p,S=p(w),O=p(C);if(A[S]&&A[S].length>O)return A[S][O];for(var F=0;F<=S;++F)if(A[F]||(A[F]=[E(F===0?1:0)]),F!==0)for(var M=A[F],_=A[F-1],k=M.length;k<=F&&k<=O;++k)k===F?M[k]=1:M[k]=t(i(E(k),_[k]),_[k-1]);return A[S][O]}})});var CF="bellNumbers",OW=["typed","addScalar","isNegative","isInteger","stirlingS2"],MF=T(CF,OW,e=>{var{typed:r,addScalar:t,isNegative:n,isInteger:i,stirlingS2:a}=e;return r(CF,{"number | BigNumber":function(l){if(!i(l)||n(l))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var f=0,o=0;o<=l;o++)f=t(f,a(l,o));return f}})});var _F="catalan",BW=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],TF=T(_F,BW,e=>{var{typed:r,addScalar:t,divideScalar:n,multiplyScalar:i,combinations:a,isNegative:s,isInteger:l}=e;return r(_F,{"number | BigNumber":function(o){if(!l(o)||s(o))throw new TypeError("Non-negative integer value expected in function catalan");return n(a(i(o,2),o),t(o,1))}})});var FF="composition",IW=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],OF=T(FF,IW,e=>{var{typed:r,addScalar:t,combinations:n,isPositive:i,isNegative:a,isInteger:s,larger:l}=e;return r(FF,{"number | BigNumber, number | BigNumber":function(o,u){if(!s(o)||!i(o)||!s(u)||!i(u))throw new TypeError("Positive integer value expected in function composition");if(l(u,o))throw new TypeError("k must be less than or equal to n in function composition");return n(t(o,-1),t(u,-1))}})});var BF="leafCount",PW=["parse","typed"],IF=T(BF,PW,e=>{var{parse:r,typed:t}=e;function n(i){var a=0;return i.forEach(s=>{a+=n(s)}),a||1}return t(BF,{Node:function(a){return n(a)}})});function Mg(e){return yr(e)||ut(e)&&e.isUnary()&&yr(e.args[0])}function Tf(e){return!!(yr(e)||(fn(e)||ut(e))&&e.args.every(Tf)||Zt(e)&&Tf(e.content))}function PF(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function _g(e){for(var r=1;r{var{FunctionNode:r,OperatorNode:t,SymbolNode:n}=e,i=!0,a=!1,s="defaultF",l={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:a,total:i,commutative:a,associative:a},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:a,total:i,commutative:a,associative:a},paren:{trivial:i,total:i,commutative:i,associative:a},defaultF:{trivial:a,total:i,commutative:a,associative:a}},f={divide:{total:a},log:{total:a}},o={subtract:{total:a},abs:{trivial:i},log:{total:i}};function u(b,A){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l,S=s;if(typeof b=="string"?S=b:ut(b)?S=b.fn.toString():fn(b)?S=b.name:Zt(b)&&(S="paren"),$e(E,S)){var O=E[S];if($e(O,A))return O[A];if($e(l,S))return l[S][A]}if($e(E,s)){var F=E[s];return $e(F,A)?F[A]:l[s][A]}if($e(l,S)){var M=l[S];if($e(M,A))return M[A]}return l[s][A]}function p(b){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return u(b,"commutative",A)}function h(b){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return u(b,"associative",A)}function d(b,A){var E=_g({},b);for(var S in A)$e(b,S)?E[S]=_g(_g({},A[S]),b[S]):E[S]=A[S];return E}function x(b,A){if(!b.args||b.args.length===0)return b;b.args=v(b,A);for(var E=0;E2&&h(b,A)){for(var F=b.args.pop();b.args.length>0;)F=E([b.args.pop(),F]);b.args=F.args}}}function w(b,A){if(!(!b.args||b.args.length===0)){for(var E=C(b),S=b.args.length,O=0;O2&&h(b,A)){for(var F=b.args.shift();b.args.length>0;)F=E([F,b.args.shift()]);b.args=F.args}}}function C(b){return ut(b)?function(A){try{return new t(b.op,b.fn,A,b.implicit)}catch(E){return console.error(E),[]}}:function(A){return new r(new n(b.name),A)}}return{createMakeNodeFunction:C,hasProperty:u,isCommutative:p,isAssociative:h,mergeContext:d,flatten:x,allChildren:v,unflattenr:y,unflattenl:w,defaultContext:l,realContext:f,positiveContext:o}});var LW="simplify",qW=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],kF=T(LW,qW,e=>{var{config:r,typed:t,parse:n,add:i,subtract:a,multiply:s,divide:l,pow:f,isZero:o,equal:u,resolve:p,simplifyConstant:h,simplifyCore:d,fraction:x,bignumber:v,mathWithTransform:y,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:A,FunctionNode:E,IndexNode:S,ObjectNode:O,OperatorNode:F,ParenthesisNode:M,SymbolNode:_}=e,{hasProperty:k,isCommutative:L,isAssociative:Y,mergeContext:$,flatten:V,unflattenr:q,unflattenl:R,createMakeNodeFunction:j,defaultContext:U,realContext:oe,positiveContext:me}=du({FunctionNode:E,OperatorNode:F,SymbolNode:_});t.addConversion({from:"Object",to:"Map",convert:ka});var ie=t("simplify",{Node:xe,"Node, Map":(ee,ne)=>xe(ee,!1,ne),"Node, Map, Object":(ee,ne,ue)=>xe(ee,!1,ne,ue),"Node, Array":xe,"Node, Array, Map":xe,"Node, Array, Map, Object":xe});t.removeConversion({from:"Object",to:"Map",convert:ka}),ie.defaultContext=U,ie.realContext=oe,ie.positiveContext=me;function H(ee){return ee.transform(function(ne,ue,Ee){return Zt(ne)?H(ne.content):ne})}var ce={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};ie.rules=[d,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},h,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},h,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function Me(ee,ne){var ue={};if(ee.s){var Ee=ee.s.split("->");if(Ee.length===2)ue.l=Ee[0],ue.r=Ee[1];else throw SyntaxError("Could not parse rule: "+ee.s)}else ue.l=ee.l,ue.r=ee.r;ue.l=H(n(ue.l)),ue.r=H(n(ue.r));for(var Ce of["imposeContext","repeat","assuming"])Ce in ee&&(ue[Ce]=ee[Ce]);if(ee.evaluate&&(ue.evaluate=n(ee.evaluate)),Y(ue.l,ne)){var Le=!L(ue.l,ne),Ie;Le&&(Ie=Se());var sr=j(ue.l),ir=Se();ue.expanded={},ue.expanded.l=sr([ue.l,ir]),V(ue.expanded.l,ne),q(ue.expanded.l,ne),ue.expanded.r=sr([ue.r,ir]),Le&&(ue.expandedNC1={},ue.expandedNC1.l=sr([Ie,ue.l]),ue.expandedNC1.r=sr([Ie,ue.r]),ue.expandedNC2={},ue.expandedNC2.l=sr([Ie,ue.expanded.l]),ue.expandedNC2.r=sr([Ie,ue.expanded.r]))}return ue}function pe(ee,ne){for(var ue=[],Ee=0;Ee2&&arguments[2]!==void 0?arguments[2]:go(),Ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Ce=Ee.consoleDebug;ne=pe(ne||ie.rules,Ee.context);var Le=p(ee,ue);Le=H(Le);for(var Ie={},sr=Le.toString({parenthesis:"all"});!Ie[sr];){Ie[sr]=!0,ge=0;var ir=sr;Ce&&console.log("Working on: ",sr);for(var Xe=0;Xe ").concat(ne[Xe].r.toString()))),Ce){var re=Le.toString({parenthesis:"all"});re!==ir&&(console.log("Applying",Or,"produced",re),ir=re)}R(Le,Ee.context)}sr=Le.toString({parenthesis:"all"})}return Le}function be(ee,ne,ue){var Ee=ee;if(ee)for(var Ce=0;Ce1&&(ir=Le(ee.args.slice(0,sr))),Ce=ee.args.slice(sr),Ee=Ce.length===1?Ce[0]:Le(Ce),ue.push(Le([ir,Ee]))}return ue}function ze(ee,ne){var ue={placeholders:{}};if(!ee.placeholders&&!ne.placeholders)return ue;if(ee.placeholders){if(!ne.placeholders)return ee}else return ne;for(var Ee in ee.placeholders)if($e(ee.placeholders,Ee)&&(ue.placeholders[Ee]=ee.placeholders[Ee],$e(ne.placeholders,Ee)&&!ye(ee.placeholders[Ee],ne.placeholders[Ee])))return null;for(var Ce in ne.placeholders)$e(ne.placeholders,Ce)&&(ue.placeholders[Ce]=ne.placeholders[Ce]);return ue}function Ze(ee,ne){var ue=[];if(ee.length===0||ne.length===0)return ue;for(var Ee,Ce=0;Ce2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var ir=te(ee.args[0],ne.args[1],ue);if(ir.length===0)return[];var Xe=te(ee.args[1],ne.args[0],ue);if(Xe.length===0)return[];Le=[ir,Xe]}Ce=K(Le)}else if(ne.args.length>=2&&ee.args.length===2){for(var Or=Ae(ne,ue),re=[],le=0;le2)throw Error("Unexpected non-binary associative function: "+ee.toString());return[]}}else if(ee instanceof _){if(ee.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(ce[ee.name]){if(ee.name!==ne.name)return[]}else switch(ee.name[1]>="a"&&ee.name[1]<="z"?ee.name.substring(0,2):ee.name[0]){case"n":case"_p":Ce[0].placeholders[ee.name]=ne;break;case"c":case"cl":if(yr(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"v":if(!yr(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"vl":if(rt(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"cd":if(Mg(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"vd":if(!Mg(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"ce":if(Tf(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"ve":if(!Tf(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;default:throw new Error("Invalid symbol in rule: "+ee.name)}}else if(ee instanceof A){if(!u(ee.value,ne.value))return[]}else return[];return Ce}function ye(ee,ne){if(ee instanceof A&&ne instanceof A){if(!u(ee.value,ne.value))return!1}else if(ee instanceof _&&ne instanceof _){if(ee.name!==ne.name)return!1}else if(ee instanceof F&&ne instanceof F||ee instanceof E&&ne instanceof E){if(ee instanceof F){if(ee.op!==ne.op||ee.fn!==ne.fn)return!1}else if(ee instanceof E&&ee.name!==ne.name)return!1;if(ee.args.length!==ne.args.length)return!1;for(var ue=0;ue{var{typed:r,config:t,mathWithTransform:n,matrix:i,fraction:a,bignumber:s,AccessorNode:l,ArrayNode:f,ConstantNode:o,FunctionNode:u,IndexNode:p,ObjectNode:h,OperatorNode:d,SymbolNode:x}=e,{isCommutative:v,isAssociative:y,allChildren:w,createMakeNodeFunction:C}=du({FunctionNode:u,OperatorNode:d,SymbolNode:x}),b=r("simplifyConstant",{Node:V=>O($(V,{})),"Node, Object":function(q,R){return O($(q,R))}});function A(V){return Jn(V)?V.valueOf():V instanceof Array?V.map(A):Ge(V)?i(A(V.valueOf())):V}function E(V,q,R){try{return n[V].apply(null,q)}catch{return q=q.map(A),M(n[V].apply(null,q),R)}}var S=r({Fraction:k,number:function(q){return q<0?_(new o(-q)):new o(q)},BigNumber:function(q){return q<0?_(new o(-q)):new o(q)},Complex:function(q){throw new Error("Cannot convert Complex number to Node")},string:function(q){return new o(q)},Matrix:function(q){return new f(q.valueOf().map(R=>S(R)))}});function O(V){return Sr(V)?V:S(V)}function F(V,q){var R=q&&q.exactFractions!==!1;if(R&&isFinite(V)&&a){var j=a(V),U=q&&typeof q.fractionsLimit=="number"?q.fractionsLimit:1/0;if(j.valueOf()===V&&j.n0;)if(yr(j[0])&&typeof j[0].value!="string"){var U=M(j.shift().value,R);$t(V)?V=V.items[U-1]:(V=V.valueOf()[U-1],V instanceof Array&&(V=i(V)))}else if(j.length>1&&yr(j[1])&&typeof j[1].value!="string"){var oe=M(j[1].value,R),me=[],ie=$t(V)?V.items:V.valueOf();for(var H of ie)if($t(H))me.push(H.items[oe-1]);else if(Ge(V))me.push(H[oe-1]);else break;if(me.length===ie.length)$t(V)?V=new f(me):V=i(me),j.splice(1,1);else break}else break;return j.length===q.dimensions.length?new l(O(V),q):j.length>0?(q=new p(j),new l(O(V),q)):V}if(la(V)&&q.dimensions.length===1&&yr(q.dimensions[0])){var ce=q.dimensions[0].value;return ce in V.properties?V.properties[ce]:new o}return new l(O(V),q)}function Y(V,q,R,j){var U=q.shift(),oe=q.reduce((me,ie)=>{if(!Sr(ie)){var H=me.pop();if(Sr(H))return[H,ie];try{return me.push(E(V,[H,ie],j)),me}catch{me.push(H)}}me.push(O(me.pop()));var ce=me.length===1?me[0]:R(me);return[R([ce,O(ie)])]},[U]);return oe.length===1?oe[0]:R([oe[0],S(oe[1])])}function $(V,q){switch(V.type){case"SymbolNode":return V;case"ConstantNode":switch(typeof V.value){case"number":return M(V.value,q);case"string":return V.value;default:if(!isNaN(V.value))return M(V.value,q)}return V;case"FunctionNode":if(n[V.name]&&n[V.name].rawArgs)return V;{var R=["add","multiply"];if(R.indexOf(V.name)===-1){var j=V.args.map(De=>$(De,q));if(!j.some(Sr))try{return E(V.name,j,q)}catch{}if(V.name==="size"&&j.length===1&&$t(j[0])){for(var U=[],oe=j[0];$t(oe);)U.push(oe.items.length),oe=oe.items[0];return i(U)}return new u(V.name,j.map(O))}}case"OperatorNode":{var me=V.fn.toString(),ie,H,ce=C(V);if(ut(V)&&V.isUnary())ie=[$(V.args[0],q)],Sr(ie[0])?H=ce(ie):H=E(me,ie,q);else if(y(V,q.context))if(ie=w(V,q.context),ie=ie.map(De=>$(De,q)),v(me,q.context)){for(var Me=[],pe=[],ge=0;ge1?(H=Y(me,Me,ce,q),pe.unshift(H),H=Y(me,pe,ce,q)):H=Y(me,ie,ce,q)}else H=Y(me,ie,ce,q);else ie=V.args.map(De=>$(De,q)),H=Y(me,ie,ce,q);return H}case"ParenthesisNode":return $(V.content,q);case"AccessorNode":return L($(V.object,q),$(V.index,q),q);case"ArrayNode":{var Se=V.items.map(De=>$(De,q));return Se.some(Sr)?new f(Se.map(O)):i(Se)}case"IndexNode":return new p(V.dimensions.map(De=>b(De,q)));case"ObjectNode":{var xe={};for(var be in V.properties)xe[be]=b(V.properties[be],q);return new h(xe)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(V.type))}}return b});var LF="simplifyCore",WW=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],qF=T(LF,WW,e=>{var{typed:r,parse:t,equal:n,isZero:i,add:a,subtract:s,multiply:l,divide:f,pow:o,AccessorNode:u,ArrayNode:p,ConstantNode:h,FunctionNode:d,IndexNode:x,ObjectNode:v,OperatorNode:y,ParenthesisNode:w,SymbolNode:C}=e,b=new h(0),A=new h(1),E=new h(!0),S=new h(!1);function O(k){return ut(k)&&["and","not","or"].includes(k.op)}var{hasProperty:F,isCommutative:M}=du({FunctionNode:d,OperatorNode:y,SymbolNode:C});function _(k){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=L?L.context:void 0;if(F(k,"trivial",Y)){if(fn(k)&&k.args.length===1)return _(k.args[0],L);var $=!1,V=0;if(k.forEach(pe=>{++V,V===1&&($=_(pe,L))}),V===1)return $}var q=k;if(fn(q)){var R=_2(q.name);if(R){if(q.args.length>2&&F(q,"associative",Y))for(;q.args.length>2;){var j=q.args.pop(),U=q.args.pop();q.args.push(new y(R,q.name,[j,U]))}q=new y(R,q.name,q.args)}else return new d(_(q.fn),q.args.map(pe=>_(pe,L)))}if(ut(q)&&q.isUnary()){var oe=_(q.args[0],L);if(q.op==="~"&&ut(oe)&&oe.isUnary()&&oe.op==="~"||q.op==="not"&&ut(oe)&&oe.isUnary()&&oe.op==="not"&&O(oe.args[0]))return oe.args[0];var me=!0;if(q.op==="-"&&ut(oe)&&(oe.isBinary()&&oe.fn==="subtract"&&(q=new y("-","subtract",[oe.args[1],oe.args[0]]),me=!1),oe.isUnary()&&oe.op==="-"))return oe.args[0];if(me)return new y(q.op,q.fn,[oe])}if(ut(q)&&q.isBinary()){var ie=_(q.args[0],L),H=_(q.args[1],L);if(q.op==="+"){if(yr(ie)&&i(ie.value))return H;if(yr(H)&&i(H.value))return ie;ut(H)&&H.isUnary()&&H.op==="-"&&(H=H.args[0],q=new y("-","subtract",[ie,H]))}if(q.op==="-")return ut(H)&&H.isUnary()&&H.op==="-"?_(new y("+","add",[ie,H.args[0]]),L):yr(ie)&&i(ie.value)?_(new y("-","unaryMinus",[H])):yr(H)&&i(H.value)?ie:new y(q.op,q.fn,[ie,H]);if(q.op==="*"){if(yr(ie)){if(i(ie.value))return b;if(n(ie.value,1))return H}if(yr(H)){if(i(H.value))return b;if(n(H.value,1))return ie;if(M(q,Y))return new y(q.op,q.fn,[H,ie],q.implicit)}return new y(q.op,q.fn,[ie,H],q.implicit)}if(q.op==="/")return yr(ie)&&i(ie.value)?b:yr(H)&&n(H.value,1)?ie:new y(q.op,q.fn,[ie,H]);if(q.op==="^"&&yr(H)){if(i(H.value))return A;if(n(H.value,1))return ie}if(q.op==="and"){if(yr(ie))if(ie.value){if(O(H))return H;if(yr(H))return H.value?E:S}else return S;if(yr(H))if(H.value){if(O(ie))return ie}else return S}if(q.op==="or"){if(yr(ie)){if(ie.value)return E;if(O(H))return H}if(yr(H)){if(H.value)return E;if(O(ie))return ie}}return new y(q.op,q.fn,[ie,H])}if(ut(q))return new y(q.op,q.fn,q.args.map(pe=>_(pe,L)));if($t(q))return new p(q.items.map(pe=>_(pe,L)));if(Sn(q))return new u(_(q.object,L),_(q.index,L));if(kn(q))return new x(q.dimensions.map(pe=>_(pe,L)));if(la(q)){var ce={};for(var Me in q.properties)ce[Me]=_(q.properties[Me],L);return new v(ce)}return q}return r(LF,{Node:_,"Node,Object":_})});var VW="resolve",YW=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],UF=T(VW,YW,e=>{var{typed:r,parse:t,ConstantNode:n,FunctionNode:i,OperatorNode:a,ParenthesisNode:s}=e;function l(f,o){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!o)return f;if(rt(f)){if(u.has(f.name)){var p=Array.from(u).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(p,"}"))}var h=o.get(f.name);if(Sr(h)){var d=new Set(u);return d.add(f.name),l(h,o,d)}else return typeof h=="number"?t(String(h)):h!==void 0?new n(h):f}else if(ut(f)){var x=f.args.map(function(y){return l(y,o,u)});return new a(f.op,f.fn,x,f.implicit)}else{if(Zt(f))return new s(l(f.content,o,u));if(fn(f)){var v=f.args.map(function(y){return l(y,o,u)});return new i(f.name,v)}}return f.map(y=>l(y,o,u))}return r("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(f,o)=>l(f,ka(o)),"Array | Matrix":r.referToSelf(f=>o=>o.map(u=>f(u))),"Array | Matrix, null | undefined":r.referToSelf(f=>o=>o.map(u=>f(u))),"Array, Object":r.referTo("Array,Map",f=>(o,u)=>f(o,ka(u))),"Matrix, Object":r.referTo("Matrix,Map",f=>(o,u)=>f(o,ka(u))),"Array | Matrix, Map":r.referToSelf(f=>(o,u)=>o.map(p=>f(p,u)))})});var zF="symbolicEqual",HW=["parse","simplify","typed","OperatorNode"],WF=T(zF,HW,e=>{var{parse:r,simplify:t,typed:n,OperatorNode:i}=e;function a(s,l){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=new i("-","subtract",[s,l]),u=t(o,{},f);return yr(u)&&!u.value}return n(zF,{"Node, Node":a,"Node, Node, Object":a})});var VF="derivative",GW=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],YF=T(VF,GW,e=>{var{typed:r,config:t,parse:n,simplify:i,equal:a,isZero:s,numeric:l,ConstantNode:f,FunctionNode:o,OperatorNode:u,ParenthesisNode:p,SymbolNode:h}=e;function d(b,A){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},S={};y(S,b,A.name);var O=w(b,S);return E.simplify?i(O):O}r.addConversion({from:"identifier",to:"SymbolNode",convert:n});var x=r(VF,{"Node, SymbolNode":d,"Node, SymbolNode, Object":d});r.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),x._simplify=!0,x.toTex=function(b){return v.apply(null,b.args)};var v=r("_derivTex",{"Node, SymbolNode":function(A,E){return yr(A)&&_r(A.value)==="string"?v(n(A.value).toString(),E.toString(),1):v(A.toTex(),E.toString(),1)},"Node, ConstantNode":function(A,E){if(_r(E.value)==="string")return v(A,n(E.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(A,E,S){return v(A.toString(),E.name,S.value)},"string, string, number":function(A,E,S){var O;return S===1?O="{d\\\\over d"+E+"}":O="{d^{"+S+"}\\\\over d"+E+"^{"+S+"}}",O+"\\\\left[".concat(A,"\\\\right]")}}),y=r("constTag",{"Object, ConstantNode, string":function(A,E){return A[E]=!0,!0},"Object, SymbolNode, string":function(A,E,S){return E.name!==S?(A[E]=!0,!0):!1},"Object, ParenthesisNode, string":function(A,E,S){return y(A,E.content,S)},"Object, FunctionAssignmentNode, string":function(A,E,S){return E.params.indexOf(S)===-1?(A[E]=!0,!0):y(A,E.expr,S)},"Object, FunctionNode | OperatorNode, string":function(A,E,S){if(E.args.length>0){for(var O=y(A,E.args[0],S),F=1;F0){var O=A.args.filter(function(V){return E[V]===void 0}),F=O.length===1?O[0]:new u("*","multiply",O),M=S.concat(w(F,E));return new u("*","multiply",M)}return new u("+","add",A.args.map(function(V){return new u("*","multiply",A.args.map(function(q){return q===V?w(q,E):q.clone()}))}))}if(A.op==="/"&&A.isBinary()){var _=A.args[0],k=A.args[1];return E[k]!==void 0?new u("/","divide",[w(_,E),k]):E[_]!==void 0?new u("*","multiply",[new u("-","unaryMinus",[_]),new u("/","divide",[w(k,E),new u("^","pow",[k.clone(),C(2)])])]):new u("/","divide",[new u("-","subtract",[new u("*","multiply",[w(_,E),k.clone()]),new u("*","multiply",[_.clone(),w(k,E)])]),new u("^","pow",[k.clone(),C(2)])])}if(A.op==="^"&&A.isBinary()){var L=A.args[0],Y=A.args[1];if(E[L]!==void 0)return yr(L)&&(s(L.value)||a(L.value,1))?C(0):new u("*","multiply",[A,new u("*","multiply",[new o("log",[L.clone()]),w(Y.clone(),E)])]);if(E[Y]!==void 0){if(yr(Y)){if(s(Y.value))return C(0);if(a(Y.value,1))return w(L,E)}var $=new u("^","pow",[L.clone(),new u("-","subtract",[Y,C(1)])]);return new u("*","multiply",[Y.clone(),new u("*","multiply",[w(L,E),$])])}return new u("*","multiply",[new u("^","pow",[L.clone(),Y.clone()]),new u("+","add",[new u("*","multiply",[w(L,E),new u("/","divide",[Y.clone(),L.clone()])]),new u("*","multiply",[w(Y,E),new o("log",[L.clone()])])])])}throw new Error('Cannot process operator "'+A.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function C(b,A){return new f(l(b,A||t.number))}return x});var HF="rationalize",$W=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],GF=T(HF,$W,e=>{var{config:r,typed:t,equal:n,isZero:i,add:a,subtract:s,multiply:l,divide:f,pow:o,parse:u,simplifyConstant:p,simplifyCore:h,simplify:d,fraction:x,bignumber:v,mathWithTransform:y,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:A,FunctionNode:E,IndexNode:S,ObjectNode:O,OperatorNode:F,SymbolNode:M,ParenthesisNode:_}=e;function k(q){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,U=Y(),oe=L(q,R,!0,U.firstRules),me=oe.variables.length,ie={exactFractions:!1},H={exactFractions:!0};if(q=oe.expression,me>=1){q=$(q);var ce,Me,pe=!0,ge=!1;q=d(q,U.firstRules,{},ie);for(var Se;Me=pe?U.distrDivRules:U.sucDivRules,q=d(q,Me,{},H),pe=!pe,Se=q.toString(),Se!==ce;)ge=!0,ce=Se;ge&&(q=d(q,U.firstRulesAgain,{},ie)),q=d(q,U.finalRules,{},ie)}var xe=[],be={};return q.type==="OperatorNode"&&q.isBinary()&&q.op==="/"?(me===1&&(q.args[0]=V(q.args[0],xe),q.args[1]=V(q.args[1])),j&&(be.numerator=q.args[0],be.denominator=q.args[1])):(me===1&&(q=V(q,xe)),j&&(be.numerator=q,be.denominator=null)),j?(be.coefficients=xe,be.variables=oe.variables,be.expression=q,be):q}return t(HF,{Node:k,"Node, boolean":(q,R)=>k(q,{},R),"Node, Object":k,"Node, Object, boolean":k});function L(q,R,j,U){var oe=[],me=d(q,U,R,{exactFractions:!1});j=!!j;var ie="+-*"+(j?"/":"");ce(me);var H={};return H.expression=me,H.variables=oe,H;function ce(Me){var pe=Me.type;if(pe==="FunctionNode")throw new Error("There is an unsolved function call");if(pe==="OperatorNode")if(Me.op==="^"){if(Me.args[1].type!=="ConstantNode"||!He(parseFloat(Me.args[1].value)))throw new Error("There is a non-integer exponent");ce(Me.args[0])}else{if(ie.indexOf(Me.op)===-1)throw new Error("Operator "+Me.op+" invalid in polynomial expression");for(var ge=0;ge1;if(U==="OperatorNode"&&q.isBinary()){var me=!1,ie;if(q.op==="^"&&(q.args[0].type==="ParenthesisNode"||q.args[0].type==="OperatorNode")&&q.args[1].type==="ConstantNode"&&(ie=parseFloat(q.args[1].value),me=ie>=2&&He(ie)),me){if(ie>2){var H=q.args[0],ce=new F("^","pow",[q.args[0].cloneDeep(),new A(ie-1)]);q=new F("*","multiply",[H,ce])}else q=new F("*","multiply",[q.args[0],q.args[0].cloneDeep()]);oe&&(j==="content"?R.content=q:R.args[j]=q)}}if(U==="ParenthesisNode")$(q.content,q,"content");else if(U!=="ConstantNode"&&U!=="SymbolNode")for(var Me=0;Me=0;H--)if(R[H]!==0){var ce=new A(me?R[H]:Math.abs(R[H])),Me=R[H]<0?"-":"+";if(H>0){var pe=new M(oe);if(H>1){var ge=new A(H);pe=new F("^","pow",[pe,ge])}R[H]===-1&&me?ce=new F("-","unaryMinus",[pe]):Math.abs(R[H])===1?ce=pe:ce=new F("*","multiply",[ce,pe])}me?ie=ce:Me==="+"?ie=new F("+","add",[ie,ce]):ie=new F("-","subtract",[ie,ce]),me=!1}if(me)return new A(0);return ie;function Se(xe,be,De){var Ae=xe.type;if(Ae==="FunctionNode")throw new Error("There is an unsolved function call");if(Ae==="OperatorNode"){if("+-*^".indexOf(xe.op)===-1)throw new Error("Operator "+xe.op+" invalid");if(be!==null){if((xe.fn==="unaryMinus"||xe.fn==="pow")&&be.fn!=="add"&&be.fn!=="subtract"&&be.fn!=="multiply")throw new Error("Invalid "+xe.op+" placing");if((xe.fn==="subtract"||xe.fn==="add"||xe.fn==="multiply")&&be.fn!=="add"&&be.fn!=="subtract")throw new Error("Invalid "+xe.op+" placing");if((xe.fn==="subtract"||xe.fn==="add"||xe.fn==="unaryMinus")&&De.noFil!==0)throw new Error("Invalid "+xe.op+" placing")}(xe.op==="^"||xe.op==="*")&&(De.fire=xe.op);for(var ze=0;zeU&&(R[Ze]=0),R[Ze]+=De.cte*(De.oper==="+"?1:-1),U=Math.max(Ze,U);return}De.cte=Ze,De.fire===""&&(R[0]+=De.cte*(De.oper==="+"?1:-1))}else throw new Error("Type "+Ae+" is not allowed")}}});var $F="zpk2tf",ZW=["typed","add","multiply","Complex","number"],ZF=T($F,ZW,e=>{var{typed:r,add:t,multiply:n,Complex:i,number:a}=e;return r($F,{"Array,Array,number":function(o,u,p){return s(o,u,p)},"Array,Array":function(o,u){return s(o,u,1)},"Matrix,Matrix,number":function(o,u,p){return s(o.valueOf(),u.valueOf(),p)},"Matrix,Matrix":function(o,u){return s(o.valueOf(),u.valueOf(),1)}});function s(f,o,u){f.some(C=>C.type==="BigNumber")&&(f=f.map(C=>a(C))),o.some(C=>C.type==="BigNumber")&&(o=o.map(C=>a(C)));for(var p=[i(1,0)],h=[i(1,0)],d=0;d=0&&p-h{var{typed:r,add:t,multiply:n,Complex:i,divide:a,matrix:s}=e;return r(QF,{"Array, Array":function(u,p){var h=f(512);return l(u,p,h)},"Array, Array, Array":function(u,p,h){return l(u,p,h)},"Array, Array, number":function(u,p,h){if(h<0)throw new Error("w must be a positive number");var d=f(h);return l(u,p,d)},"Matrix, Matrix":function(u,p){var h=f(512),{w:d,h:x}=l(u.valueOf(),p.valueOf(),h);return{w:s(d),h:s(x)}},"Matrix, Matrix, Matrix":function(u,p,h){var{h:d}=l(u.valueOf(),p.valueOf(),h.valueOf());return{h:s(d),w:s(h)}},"Matrix, Matrix, number":function(u,p,h){if(h<0)throw new Error("w must be a positive number");var d=f(h),{h:x}=l(u.valueOf(),p.valueOf(),d);return{h:s(x),w:s(d)}}});function l(o,u,p){for(var h=[],d=[],x=0;x{var{classes:r}=e;return function(n,i){var a=r[i&&i.mathjs];return a&&typeof a.fromJSON=="function"?a.fromJSON(i):i}});var KW="replacer",jW=[],KF=T(KW,jW,()=>function(r,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:t});var jF="12.4.1";var e3=T("true",[],()=>!0),r3=T("false",[],()=>!1),t3=T("null",[],()=>null),n3=ri("Infinity",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1/0):1/0}),i3=ri("NaN",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(NaN):NaN}),a3=ri("pi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?Cf(t):m1}),o3=ri("tau",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?GS(t):h1}),s3=ri("e",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?YS(t):d1}),u3=ri("phi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?HS(t):v1}),f3=ri("LN2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).ln():Math.LN2}),l3=ri("LN10",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(10).ln():Math.LN10}),c3=ri("LOG2E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(2).ln()):Math.LOG2E}),p3=ri("LOG10E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(10).ln()):Math.LOG10E}),m3=ri("SQRT1_2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t("0.5").sqrt():Math.SQRT1_2}),h3=ri("SQRT2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).sqrt():Math.SQRT2}),d3=ri("i",["Complex"],e=>{var{Complex:r}=e;return r.I}),v3=T("PI",["pi"],e=>{var{pi:r}=e;return r}),g3=T("E",["e"],e=>{var{e:r}=e;return r}),x3=T("version",[],()=>jF);function ri(e,r,t){return T(e,r,t,{recreateOnConfigChange:!0})}var y3=Cr("speedOfLight","299792458","m s^-1"),b3=Cr("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),w3=Cr("planckConstant","6.62607015e-34","J s"),D3=Cr("reducedPlanckConstant","1.0545718176461565e-34","J s"),S3=Cr("magneticConstant","1.25663706212e-6","N A^-2"),N3=Cr("electricConstant","8.8541878128e-12","F m^-1"),A3=Cr("vacuumImpedance","376.730313667","ohm"),E3=Cr("coulomb","8.987551792261171e9","N m^2 C^-2"),C3=Cr("elementaryCharge","1.602176634e-19","C"),M3=Cr("bohrMagneton","9.2740100783e-24","J T^-1"),_3=Cr("conductanceQuantum","7.748091729863649e-5","S"),T3=Cr("inverseConductanceQuantum","12906.403729652257","ohm"),F3=Cr("magneticFluxQuantum","2.0678338484619295e-15","Wb"),O3=Cr("nuclearMagneton","5.0507837461e-27","J T^-1"),B3=Cr("klitzing","25812.807459304513","ohm");var I3=Cr("bohrRadius","5.29177210903e-11","m"),P3=Cr("classicalElectronRadius","2.8179403262e-15","m"),k3=Cr("electronMass","9.1093837015e-31","kg"),R3=Cr("fermiCoupling","1.1663787e-5","GeV^-2"),L3=Gp("fineStructure",.0072973525693),q3=Cr("hartreeEnergy","4.3597447222071e-18","J"),U3=Cr("protonMass","1.67262192369e-27","kg"),z3=Cr("deuteronMass","3.3435830926e-27","kg"),W3=Cr("neutronMass","1.6749271613e-27","kg"),V3=Cr("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),Y3=Cr("rydberg","10973731.568160","m^-1"),H3=Cr("thomsonCrossSection","6.6524587321e-29","m^2"),G3=Gp("weakMixingAngle",.2229),$3=Gp("efimovFactor",22.7),Z3=Cr("atomicMass","1.66053906660e-27","kg"),Q3=Cr("avogadro","6.02214076e23","mol^-1"),X3=Cr("boltzmann","1.380649e-23","J K^-1"),J3=Cr("faraday","96485.33212331001","C mol^-1"),K3=Cr("firstRadiation","3.7417718521927573e-16","W m^2"),j3=Cr("loschmidt","2.686780111798444e25","m^-3"),eO=Cr("gasConstant","8.31446261815324","J K^-1 mol^-1"),rO=Cr("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),tO=Cr("molarVolume","0.022413969545014137","m^3 mol^-1"),nO=Gp("sackurTetrode",-1.16487052358),iO=Cr("secondRadiation","0.014387768775039337","m K"),aO=Cr("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),oO=Cr("wienDisplacement","2.897771955e-3","m K"),sO=Cr("molarMass","0.99999999965e-3","kg mol^-1"),uO=Cr("molarMassC12","11.9999999958e-3","kg mol^-1"),fO=Cr("gravity","9.80665","m s^-2"),lO=Cr("planckLength","1.616255e-35","m"),cO=Cr("planckMass","2.176435e-8","kg"),pO=Cr("planckTime","5.391245e-44","s"),mO=Cr("planckCharge","1.87554603778e-18","C"),hO=Cr("planckTemperature","1.416785e+32","K");function Cr(e,r,t){var n=["config","Unit","BigNumber"];return T(e,n,i=>{var{config:a,Unit:s,BigNumber:l}=i,f=a.number==="BigNumber"?new l(r):parseFloat(r),o=new s(f,t);return o.fixPrefix=!0,o})}function Gp(e,r){var t=["config","BigNumber"];return T(e,t,n=>{var{config:i,BigNumber:a}=n;return i.number==="BigNumber"?new a(r):r})}var eV="apply",rV=["typed","isInteger"],dO=T(eV,rV,e=>{var{typed:r,isInteger:t}=e,n=ou({typed:r,isInteger:t});return r("apply",{"...any":function(a){var s=a[1];ar(s)?a[1]=s-1:je(s)&&(a[1]=s.minus(1));try{return n.apply(null,a)}catch(l){throw lt(l)}}})},{isTransformFunction:!0});var tV="column",nV=["typed","Index","matrix","range"],vO=T(tV,nV,e=>{var{typed:r,Index:t,matrix:n,range:i}=e,a=Xc({typed:r,Index:t,matrix:n,range:i});return r("column",{"...any":function(l){var f=l.length-1,o=l[f];ar(o)&&(l[f]=o-1);try{return a.apply(null,l)}catch(u){throw lt(u)}}})},{isTransformFunction:!0});function vu(e,r,t){var n=e.filter(function(f){return rt(f)&&!(f.name in r)&&!t.has(f.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,a=new Map,s=new eu(t,a,new Set([i])),l=e.compile();return function(o){return a.set(i,o),l.evaluate(s)}}var iV="filter",aV=["typed"],xO=T(iV,aV,e=>{var{typed:r}=e;function t(i,a,s){var l,f;return i[0]&&(l=i[0].compile().evaluate(s)),i[1]&&(rt(i[1])||mi(i[1])?f=i[1].compile().evaluate(s):f=vu(i[1],a,s)),n(l,f)}t.rawArgs=!0;var n=r("filter",{"Array, function":gO,"Matrix, function":function(a,s){return a.create(gO(a.toArray(),s))},"Array, RegExp":Ks,"Matrix, RegExp":function(a,s){return a.create(Ks(a.toArray(),s))}});return t},{isTransformFunction:!0});function gO(e,r){return Ec(e,function(t,n,i){return gi(r,t,[n+1],i,"filter")})}var oV="forEach",sV=["typed"],yO=T(oV,sV,e=>{var{typed:r}=e;function t(i,a,s){var l,f;return i[0]&&(l=i[0].compile().evaluate(s)),i[1]&&(rt(i[1])||mi(i[1])?f=i[1].compile().evaluate(s):f=vu(i[1],a,s)),n(l,f)}t.rawArgs=!0;var n=r("forEach",{"Array | Matrix, function":function(a,s){var l=function f(o,u){if(Array.isArray(o))ho(o,function(p,h){f(p,u.concat(h+1))});else return gi(s,o,u,a,"forEach")};l(a.valueOf(),[])}});return t},{isTransformFunction:!0});var uV="index",fV=["Index","getMatrixDataType"],bO=T(uV,fV,e=>{var{Index:r,getMatrixDataType:t}=e;return function(){for(var i=[],a=0,s=arguments.length;a0?0:2;else if(l&&l.isSet===!0)l=l.map(function(o){return o-1});else if(Ar(l)||Ge(l))t(l)!=="boolean"&&(l=l.map(function(o){return o-1}));else if(ar(l))l--;else if(je(l))l=l.toNumber()-1;else if(typeof l!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");i[a]=l}var f=new r;return r.apply(f,i),f}},{isTransformFunction:!0});var lV="map",cV=["typed"],DO=T(lV,cV,e=>{var{typed:r}=e;function t(i,a,s){var l,f;return i[0]&&(l=i[0].compile().evaluate(s)),i[1]&&(rt(i[1])||mi(i[1])?f=i[1].compile().evaluate(s):f=vu(i[1],a,s)),n(l,f)}t.rawArgs=!0;var n=r("map",{"Array, function":function(a,s){return wO(a,s,a)},"Matrix, function":function(a,s){return a.create(wO(a.valueOf(),s,a))}});return t},{isTransformFunction:!0});function wO(e,r,t){function n(i,a){return Array.isArray(i)?Rn(i,function(s,l){return n(s,a.concat(l+1))}):gi(r,i,a,t,"map")}return n(e,[])}function vn(e){if(e.length===2&&bt(e[0])){e=e.slice();var r=e[1];ar(r)?e[1]=r-1:je(r)&&(e[1]=r.minus(1))}return e}var pV="max",mV=["typed","config","numeric","larger"],SO=T(pV,mV,e=>{var{typed:r,config:t,numeric:n,larger:i}=e,a=mp({typed:r,config:t,numeric:n,larger:i});return r("max",{"...any":function(l){l=vn(l);try{return a.apply(null,l)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var hV="mean",dV=["typed","add","divide"],NO=T(hV,dV,e=>{var{typed:r,add:t,divide:n}=e,i=zp({typed:r,add:t,divide:n});return r("mean",{"...any":function(s){s=vn(s);try{return i.apply(null,s)}catch(l){throw lt(l)}}})},{isTransformFunction:!0});var vV="min",gV=["typed","config","numeric","smaller"],AO=T(vV,gV,e=>{var{typed:r,config:t,numeric:n,smaller:i}=e,a=hp({typed:r,config:t,numeric:n,smaller:i});return r("min",{"...any":function(l){l=vn(l);try{return a.apply(null,l)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var xV="range",yV=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],EO=T(xV,yV,e=>{var{typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:l,largerEq:f,add:o,isPositive:u}=e,p=ep({typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:l,largerEq:f,add:o,isPositive:u});return r("range",{"...any":function(d){var x=d.length-1,v=d[x];return typeof v!="boolean"&&d.push(!0),p.apply(null,d)}})},{isTransformFunction:!0});var bV="row",wV=["typed","Index","matrix","range"],CO=T(bV,wV,e=>{var{typed:r,Index:t,matrix:n,range:i}=e,a=rp({typed:r,Index:t,matrix:n,range:i});return r("row",{"...any":function(l){var f=l.length-1,o=l[f];ar(o)&&(l[f]=o-1);try{return a.apply(null,l)}catch(u){throw lt(u)}}})},{isTransformFunction:!0});var DV="subset",SV=["typed","matrix","zeros","add"],MO=T(DV,SV,e=>{var{typed:r,matrix:t,zeros:n,add:i}=e,a=tp({typed:r,matrix:t,zeros:n,add:i});return r("subset",{"...any":function(l){try{return a.apply(null,l)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var NV="concat",AV=["typed","matrix","isInteger"],_O=T(NV,AV,e=>{var{typed:r,matrix:t,isInteger:n}=e,i=Qc({typed:r,matrix:t,isInteger:n});return r("concat",{"...any":function(s){var l=s.length-1,f=s[l];ar(f)?s[l]=f-1:je(f)&&(s[l]=f.minus(1));try{return i.apply(null,s)}catch(o){throw lt(o)}}})},{isTransformFunction:!0});var TO="diff",EV=["typed","matrix","subtract","number","bignumber"],FO=T(TO,EV,e=>{var{typed:r,matrix:t,subtract:n,number:i,bignumber:a}=e,s=Jc({typed:r,matrix:t,subtract:n,number:i,bignumber:a});return r(TO,{"...any":function(f){f=vn(f);try{return s.apply(null,f)}catch(o){throw lt(o)}}})},{isTransformFunction:!0});var CV="std",MV=["typed","map","sqrt","variance"],OO=T(CV,MV,e=>{var{typed:r,map:t,sqrt:n,variance:i}=e,a=Yp({typed:r,map:t,sqrt:n,variance:i});return r("std",{"...any":function(l){l=vn(l);try{return a.apply(null,l)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var BO="sum",_V=["typed","config","add","numeric"],IO=T(BO,_V,e=>{var{typed:r,config:t,add:n,numeric:i}=e,a=Lp({typed:r,config:t,add:n,numeric:i});return r(BO,{"...any":function(l){l=vn(l);try{return a.apply(null,l)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var TV="quantileSeq",FV=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],PO=T(TV,FV,e=>{var{typed:r,bignumber:t,add:n,subtract:i,divide:a,multiply:s,partitionSelect:l,compare:f,isInteger:o,smaller:u,smallerEq:p,larger:h}=e,d=Vp({typed:r,bignumber:t,add:n,subtract:i,divide:a,multiply:s,partitionSelect:l,compare:f,isInteger:o,smaller:u,smallerEq:p,larger:h});return r("quantileSeq",{"Array | Matrix, number | BigNumber":d,"Array | Matrix, number | BigNumber, number":(v,y,w)=>d(v,y,x(w)),"Array | Matrix, number | BigNumber, boolean":d,"Array | Matrix, number | BigNumber, boolean, number":(v,y,w,C)=>d(v,y,w,x(C)),"Array | Matrix, Array | Matrix":d,"Array | Matrix, Array | Matrix, number":(v,y,w)=>d(v,y,x(w)),"Array | Matrix, Array | Matrix, boolean":d,"Array | Matrix, Array | Matrix, boolean, number":(v,y,w,C)=>d(v,y,w,x(C))});function x(v){return vn([[],v])[1]}},{isTransformFunction:!0});var kO="cumsum",OV=["typed","add","unaryPlus"],RO=T(kO,OV,e=>{var{typed:r,add:t,unaryPlus:n}=e,i=Up({typed:r,add:t,unaryPlus:n});return r(kO,{"...any":function(s){if(s.length===2&&bt(s[0])){var l=s[1];ar(l)?s[1]=l-1:je(l)&&(s[1]=l.minus(1))}try{return i.apply(null,s)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var LO="variance",BV=["typed","add","subtract","multiply","divide","apply","isNaN"],qO=T(LO,BV,e=>{var{typed:r,add:t,subtract:n,multiply:i,divide:a,apply:s,isNaN:l}=e,f=Wp({typed:r,add:t,subtract:n,multiply:i,divide:a,apply:s,isNaN:l});return r(LO,{"...any":function(u){u=vn(u);try{return f.apply(null,u)}catch(p){throw lt(p)}}})},{isTransformFunction:!0});var UO="print",IV=["typed","matrix","zeros","add"],zO=T(UO,IV,e=>{var{typed:r,matrix:t,zeros:n,add:i}=e,a=ip({typed:r,matrix:t,zeros:n,add:i});return r(UO,{"string, Object | Array":function(f,o){return a(s(f),o)},"string, Object | Array, number | Object":function(f,o,u){return a(s(f),o,u)}});function s(l){return l.replace(np,f=>{var o=f.slice(1).split("."),u=o.map(function(p){return!isNaN(p)&&p.length>0?parseInt(p)-1:p});return"$"+u.join(".")})}},{isTransformFunction:!0});var PV="and",kV=["typed","matrix","zeros","add","equalScalar","not","concat"],WO=T(PV,kV,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s}=e,l=ap({typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s});function f(o,u,p){var h=o[0].compile().evaluate(p);if(!bt(h)&&!l(h,!0))return!1;var d=o[1].compile().evaluate(p);return l(h,d)}return f.rawArgs=!0,f},{isTransformFunction:!0});var RV="or",LV=["typed","matrix","equalScalar","DenseMatrix","concat"],VO=T(RV,LV,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=Zc({typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a});function l(f,o,u){var p=f[0].compile().evaluate(u);if(!bt(p)&&s(p,!1))return!0;var h=f[1].compile().evaluate(u);return s(p,h)}return l.rawArgs=!0,l},{isTransformFunction:!0});var qV="bitAnd",UV=["typed","matrix","zeros","add","equalScalar","not","concat"],YO=T(qV,UV,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s}=e,l=Gc({typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s});function f(o,u,p){var h=o[0].compile().evaluate(p);if(!bt(h)){if(isNaN(h))return NaN;if(h===0||h===!1)return 0}var d=o[1].compile().evaluate(p);return l(h,d)}return f.rawArgs=!0,f},{isTransformFunction:!0});var zV="bitOr",WV=["typed","matrix","equalScalar","DenseMatrix","concat"],HO=T(zV,WV,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=$c({typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a});function l(f,o,u){var p=f[0].compile().evaluate(u);if(!bt(p)){if(isNaN(p))return NaN;if(p===-1)return-1;if(p===!0)return 1}var h=f[1].compile().evaluate(u);return s(p,h)}return l.rawArgs=!0,l},{isTransformFunction:!0});var Fg=Tg;var XO=Xn(yc(),1);var $O=Xn(GO(),1);function ZO(e){var r=new $O.default;return e.on=r.on.bind(r),e.off=r.off.bind(r),e.once=r.once.bind(r),e.emit=r.emit.bind(r),e}function QO(e,r,t,n){function i(y,w){var C=arguments.length;if(C!==1&&C!==2)throw new ei("import",C,1,2);w||(w={});function b(O,F,M){if(Array.isArray(F))F.forEach(L=>b(O,L));else if(typeof F=="object")for(var _ in F)$e(F,_)&&b(O,F[_],_);else if(es(F)||M!==void 0){var k=es(F)?x(F)?F.fn+".transform":F.fn:M;if($e(O,k)&&O[k]!==F&&!w.silent)throw new Error('Cannot import "'+k+'" twice');O[k]=F}else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}var A={};b(A,y);for(var E in A)if($e(A,E)){var S=A[E];if(es(S))o(S,w);else if(u(S))a(E,S,w);else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}}function a(y,w,C){if(C.wrap&&typeof w=="function"&&(w=f(w)),p(w)&&(w=e(y,{[w.signature]:w})),e.isTypedFunction(t[y])&&e.isTypedFunction(w)){C.override?w=e(y,w.signatures):w=e(t[y],w),t[y]=w,delete n[y],s(y,w),t.emit("import",y,function(){return w});return}if(t[y]===void 0||C.override){t[y]=w,delete n[y],s(y,w),t.emit("import",y,function(){return w});return}if(!C.silent)throw new Error('Cannot import "'+y+'": already exists')}function s(y,w){w&&typeof w.transform=="function"?(t.expression.transform[y]=w.transform,h(y)&&(t.expression.mathWithTransform[y]=w.transform)):(delete t.expression.transform[y],h(y)&&(t.expression.mathWithTransform[y]=w))}function l(y){delete t.expression.transform[y],h(y)?t.expression.mathWithTransform[y]=t[y]:delete t.expression.mathWithTransform[y]}function f(y){var w=function(){for(var b=[],A=0,E=arguments.length;A2&&arguments[2]!==void 0?arguments[2]:y.fn;if($d(C,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(C));var b=x(y)?t.expression.transform:t,A=C in t.expression.transform,E=$e(b,C)?b[C]:void 0,S=function(){var F={};y.dependencies.map(Xd).forEach(_=>{if($d(_,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(_));_==="math"?F.math=t:_==="mathWithTransform"?F.mathWithTransform=t.expression.mathWithTransform:_==="classes"?F.classes=t:F[_]=t[_]});var M=y(F);if(M&&typeof M.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(E===void 0||w.override)return M;if(e.isTypedFunction(E)&&e.isTypedFunction(M))return e(E,M);if(w.silent)return E;throw new Error('Cannot import "'+C+'": already exists')};!y.meta||y.meta.lazy!==!1?(Zs(b,C,S),E&&A?l(C):(x(y)||d(y))&&Zs(t.expression.mathWithTransform,C,()=>b[C])):(b[C]=S(),E&&A?l(C):(x(y)||d(y))&&Zs(t.expression.mathWithTransform,C,()=>b[C])),n[C]=y,t.emit("import",C,S)}function u(y){return typeof y=="function"||typeof y=="number"||typeof y=="string"||typeof y=="boolean"||y===null||qt(y)||Gt(y)||je(y)||Jn(y)||Ge(y)||Array.isArray(y)}function p(y){return typeof y=="function"&&typeof y.signature=="string"}function h(y){return!$e(v,y)}function d(y){return y.fn.indexOf(".")===-1&&!$e(v,y.fn)&&(!y.meta||!y.meta.isClass)}function x(y){return y!==void 0&&y.meta!==void 0&&y.meta.isTransformFunction===!0||!1}var v={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return i}function $p(e,r){var t=Mt({},ac,r);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var n=ZO({isNumber:ar,isComplex:Gt,isBigNumber:je,isFraction:Jn,isUnit:qt,isString:yt,isArray:Ar,isMatrix:Ge,isCollection:bt,isDenseMatrix:Ia,isSparseMatrix:Kn,isRange:mo,isIndex:ua,isBoolean:oc,isResultSet:sc,isHelp:Hs,isFunction:uc,isDate:fc,isRegExp:lc,isObject:fa,isNull:cc,isUndefined:pc,isAccessorNode:Sn,isArrayNode:$t,isAssignmentNode:mc,isBlockNode:hc,isConditionalNode:dc,isConstantNode:yr,isFunctionAssignmentNode:mi,isFunctionNode:fn,isIndexNode:kn,isNode:Sr,isObjectNode:la,isOperatorNode:ut,isParenthesisNode:Zt,isRangeNode:vc,isRelationalNode:gc,isSymbolNode:rt,isChain:Gs});n.config=ny(t,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var i=[],a=[];function s(u){if(es(u))return u(n);var p=u[Object.keys(u)[0]];if(es(p))return p(n);if(!Kx(u))throw console.warn("Factory object with properties \`type\`, \`name\`, and \`factory\` expected",u),new Error("Factory object with properties \`type\`, \`name\`, and \`factory\` expected");var h=i.indexOf(u),d;return h===-1?(u.math===!0?d=u.factory(n.type,t,s,n.typed,n):d=u.factory(n.type,t,s,n.typed),i.push(u),a.push(d)):d=a[h],d}var l={};function f(){for(var u=arguments.length,p=new Array(u),h=0;h{Rd(l).forEach(u=>{u&&u.meta&&u.meta.recreateOnConfigChange&&o(u,{override:!0})})}),n.create=$p.bind(null,e),n.factory=T,n.import(Rd(Xx(e))),n.ArgumentsError=ei,n.DimensionError=pr,n.IndexError=Xt,n}var gu=Xn(Xl());var JO=(e,r,t)=>{if(e.length!==1)return"";let n=e.map(function(s){return s.compile().evaluate(t)}),i=t.get(n[0]),a=t.get("$properties")?.[n[0]]?.type;return(a=="file"||a=="link"||a=="context")&&(a.includes("multi")?i=Ui(i).map(s=>t.get("$paths").get(s)??s):i=t.get("$paths").get(i)??i),i??""};JO.rawArgs=!0;var KO=(e,r,t)=>{if((e.length-1)%2!==0)return"";for(let n=0;n{if(e.length<1||e.length>2)return"";let n=e[0].compile().evaluate(t);n instanceof Date||(n=new Date(n));let i=e[1]?.compile().evaluate(t);return i?.length>0?Ba(n,i):Ba(n,t.get("$settings")?.dateFormat??"yyyy-MM-dd")};jO.rawArgs=!0;var ti=e=>typeof e=="string"||e instanceof String?e:e instanceof Date?Ba(e,"yyyy-MM-dd"):typeof e=="number"?e.toFixed(2):e.path?e.path:"",eB={prop:JO,slice:(e,r,t)=>(e=ti(e),e.slice(r,t)),if:(e,r,t)=>e===!0?r:t,ifs:KO,empty:e=>e.length!==1?"":e[0]===""?"true":"false",length:e=>e.length,substring:(e,r,t)=>(e=ti(e),t?e.substring(r,t):e.substring(r)),contains:(e,r)=>(e=ti(e),r=ti(r),e.includes(r)),test:(e,r)=>(e=ti(e),new RegExp(r).test(e)),match:(e,r)=>(e=ti(e),e.match(new RegExp(r))),replace:(e,r,t)=>(e=ti(e),e.replace(new RegExp(r),t)),replaceAll:(e,r,t)=>(e=ti(e),r=ti(r),t=ti(t),e.replace(new RegExp(r,"g"),t)),lower:e=>(e=ti(e),e.toLowerCase()),upper:e=>(e=ti(e),e.toUpperCase()),repeat:(e,r)=>e.repeat(r),format:ti,toNumber:e=>e instanceof Date?e.getTime():typeof e=="string"?parseFloat(e):e,now:()=>new Date,minute:e=>e.getMinutes(),hour:e=>e.getHours(),day:e=>e.getDay(),date:e=>e.getDate(),week:e=>Ba(e,"w"),month:e=>e.getMonth()+1,year:e=>e.getFullYear(),dateAdd:(e,r,t)=>(t==="days"&&e.setDate(e.getDate()+r),t==="months"&&e.setMonth(e.getMonth()+r),t==="years"&&e.setFullYear(e.getFullYear()+r),t==="quarters"&&e.setMonth(e.getMonth()+r*3),t==="weeks"&&e.setDate(e.getDate()+r*7),t==="hours"&&e.setHours(e.getHours()+r),t==="minutes"&&e.setMinutes(e.getMinutes()+r),t==="seconds"&&e.setSeconds(e.getSeconds()+r),e),dateSubtract:(e,r,t)=>(t==="day"&&e.setDate(e.getDate()-r),t==="month"&&e.setMonth(e.getMonth()-r),t==="year"&&e.setFullYear(e.getFullYear()-r),t==="quarter"&&e.setMonth(e.getMonth()-r*3),t==="week"&&e.setDate(e.getDate()-r*7),t==="hour"&&e.setHours(e.getHours()-r),t==="minute"&&e.setMinutes(e.getMinutes()-r),t==="second"&&e.setSeconds(e.getSeconds()-r),e),dateBetween:(e,r,t)=>{let s=Math.abs(r.getTime()-e.getTime());switch(t){case"days":return Math.round(s/864e5);case"months":return Math.round(s/2592e6);case"years":return Math.round(s/31536e6);case"hours":return Math.round(s/(60*60*1e3));case"minutes":return Math.round(s/(60*1e3));case"seconds":return Math.round(s/1e3);case"weeks":return Math.round(s/(864e5*7));case"quarters":return Math.round(s/(2592e6*3));default:return Math.round(s/864e5)}},style:(e,r)=>e,timeStamp:e=>e.getTime(),formatDate:jO,parseDate:e=>(0,gu.isNumber)(e)?new Date(e):(0,gu.isString)(e)?new Date(e):(0,gu.isDate)(e)?e:""};var rB=(e,r,t,n)=>{if(!r)return"";let i=new Map;Object.keys(n).forEach(f=>i.set(f,n[f])),i.set("$properties",t),i.set("$paths",e);let a={...Fg,createAdd:T("add",[],()=>function(o,u){return o+u})},s=$p(a);s.import(eB,{override:!0});let l;try{l=s.evaluate(r,i),l=ec("",l)}catch(f){console.log(r,f)}return l};var tB=(e,r,t)=>({...r,...t.filter(n=>n.type=="fileprop"||n.name=="tags").reduce((n,i)=>{let{value:a}=Pd(i.value,i.type);return{...n,[i.name]:rB(e,a,t.reduce((s,l)=>({...s,[l.name]:l}),{}),r)}},{})});var YV=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],uB=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],HV="\\u200C\\u200D\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0898-\\u089F\\u08CA-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EBC\\u0EC8-\\u0ECE\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u180F-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1ABF-\\u1ACE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\u30FB\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F\\uFF65",fB="\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309B-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC",Ig={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Pg="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",GV={5:Pg,"5module":Pg+" export import",6:Pg+" const class extends export import super"},$V=/^in(stanceof)?$/,ZV=new RegExp("["+fB+"]"),QV=new RegExp("["+fB+HV+"]");function Rg(e,r){for(var t=65536,n=0;ne)return!1;if(t+=r[n+1],t>=e)return!0}return!1}function za(e,r){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&ZV.test(String.fromCharCode(e)):r===!1?!1:Rg(e,uB)}function xu(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&QV.test(String.fromCharCode(e)):r===!1?!1:Rg(e,uB)||Rg(e,YV)}var tt=function(r,t){t===void 0&&(t={}),this.label=r,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function bi(e,r){return new tt(e,{beforeExpr:!0,binop:r})}var wi={beforeExpr:!0},zn={startsExpr:!0},Ug={};function $r(e,r){return r===void 0&&(r={}),r.keyword=e,Ug[e]=new tt(e,r)}var X={num:new tt("num",zn),regexp:new tt("regexp",zn),string:new tt("string",zn),name:new tt("name",zn),privateId:new tt("privateId",zn),eof:new tt("eof"),bracketL:new tt("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new tt("]"),braceL:new tt("{",{beforeExpr:!0,startsExpr:!0}),braceR:new tt("}"),parenL:new tt("(",{beforeExpr:!0,startsExpr:!0}),parenR:new tt(")"),comma:new tt(",",wi),semi:new tt(";",wi),colon:new tt(":",wi),dot:new tt("."),question:new tt("?",wi),questionDot:new tt("?."),arrow:new tt("=>",wi),template:new tt("template"),invalidTemplate:new tt("invalidTemplate"),ellipsis:new tt("...",wi),backQuote:new tt("\`",zn),dollarBraceL:new tt("\${",{beforeExpr:!0,startsExpr:!0}),eq:new tt("=",{beforeExpr:!0,isAssign:!0}),assign:new tt("_=",{beforeExpr:!0,isAssign:!0}),incDec:new tt("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new tt("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:bi("||",1),logicalAND:bi("&&",2),bitwiseOR:bi("|",3),bitwiseXOR:bi("^",4),bitwiseAND:bi("&",5),equality:bi("==/!=/===/!==",6),relational:bi("/<=/>=",7),bitShift:bi("<>/>>>",8),plusMin:new tt("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:bi("%",10),star:bi("*",10),slash:bi("/",10),starstar:new tt("**",{beforeExpr:!0}),coalesce:bi("??",1),_break:$r("break"),_case:$r("case",wi),_catch:$r("catch"),_continue:$r("continue"),_debugger:$r("debugger"),_default:$r("default",wi),_do:$r("do",{isLoop:!0,beforeExpr:!0}),_else:$r("else",wi),_finally:$r("finally"),_for:$r("for",{isLoop:!0}),_function:$r("function",zn),_if:$r("if"),_return:$r("return",wi),_switch:$r("switch"),_throw:$r("throw",wi),_try:$r("try"),_var:$r("var"),_const:$r("const"),_while:$r("while",{isLoop:!0}),_with:$r("with"),_new:$r("new",{beforeExpr:!0,startsExpr:!0}),_this:$r("this",zn),_super:$r("super",zn),_class:$r("class",zn),_extends:$r("extends",wi),_export:$r("export"),_import:$r("import",zn),_null:$r("null",zn),_true:$r("true",zn),_false:$r("false",zn),_in:$r("in",{beforeExpr:!0,binop:7}),_instanceof:$r("instanceof",{beforeExpr:!0,binop:7}),_typeof:$r("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:$r("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:$r("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Ni=/\\r\\n?|\\n|\\u2028|\\u2029/,XV=new RegExp(Ni.source,"g");function yu(e){return e===10||e===13||e===8232||e===8233}function lB(e,r,t){t===void 0&&(t=e.length);for(var n=r;n>10)+55296,(e&1023)+56320))}var jV=/(?:[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/,Of=function(r,t){this.line=r,this.column=t};Of.prototype.offset=function(r){return new Of(this.line,this.column+r)};var Kp=function(r,t,n){this.start=t,this.end=n,r.sourceFile!==null&&(this.source=r.sourceFile)};function mB(e,r){for(var t=1,n=0;;){var i=lB(e,n,r);if(i<0)return new Of(t,r-n);++t,n=i}}var Lg={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},aB=!1;function eY(e){var r={};for(var t in Lg)r[t]=e&&If(e,t)?e[t]:Lg[t];if(r.ecmaVersion==="latest"?r.ecmaVersion=1e8:r.ecmaVersion==null?(!aB&&typeof console=="object"&&console.warn&&(aB=!0,console.warn(\`Since Acorn 8.0.0, options.ecmaVersion is required. -Defaulting to 2020, but this will stop working in the future.\`)),r.ecmaVersion=11):r.ecmaVersion>=2015&&(r.ecmaVersion-=2009),r.allowReserved==null&&(r.allowReserved=r.ecmaVersion<5),(!e||e.allowHashBang==null)&&(r.allowHashBang=r.ecmaVersion>=14),nB(r.onToken)){var n=r.onToken;r.onToken=function(i){return n.push(i)}}return nB(r.onComment)&&(r.onComment=rY(r,r.onComment)),r}function rY(e,r){return function(t,n,i,a,s,l){var f={type:t?"Block":"Line",value:n,start:i,end:a};e.locations&&(f.loc=new Kp(this,s,l)),e.ranges&&(f.range=[i,a]),r.push(f)}}var Bf=1,bu=2,zg=4,hB=8,dB=16,vB=32,Wg=64,gB=128,Pf=256,Vg=Bf|bu|Pf;function Yg(e,r){return bu|(e?zg:0)|(r?hB:0)}var Qp=0,Hg=1,Va=2,xB=3,yB=4,bB=5,Kt=function(r,t,n){this.options=r=eY(r),this.sourceFile=r.sourceFile,this.keywords=Ao(GV[r.ecmaVersion>=6?6:r.sourceType==="module"?"5module":5]);var i="";r.allowReserved!==!0&&(i=Ig[r.ecmaVersion>=6?6:r.ecmaVersion===5?5:3],r.sourceType==="module"&&(i+=" await")),this.reservedWords=Ao(i);var a=(i?i+" ":"")+Ig.strict;this.reservedWordsStrict=Ao(a),this.reservedWordsStrictBind=Ao(a+" "+Ig.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(\` -\`,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Ni).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=X.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=r.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&r.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Bf),this.regexpState=null,this.privateNameStack=[]},da={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};Kt.prototype.parse=function(){var r=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(r)};da.inFunction.get=function(){return(this.currentVarScope().flags&bu)>0};da.inGenerator.get=function(){return(this.currentVarScope().flags&hB)>0&&!this.currentVarScope().inClassFieldInit};da.inAsync.get=function(){return(this.currentVarScope().flags&zg)>0&&!this.currentVarScope().inClassFieldInit};da.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var r=this.scopeStack[e];if(r.inClassFieldInit||r.flags&Pf)return!1;if(r.flags&bu)return(r.flags&zg)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};da.allowSuper.get=function(){var e=this.currentThisScope(),r=e.flags,t=e.inClassFieldInit;return(r&Wg)>0||t||this.options.allowSuperOutsideMethod};da.allowDirectSuper.get=function(){return(this.currentThisScope().flags&gB)>0};da.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};da.allowNewDotTarget.get=function(){var e=this.currentThisScope(),r=e.flags,t=e.inClassFieldInit;return(r&(bu|Pf))>0||t};da.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Pf)>0};Kt.extend=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];for(var n=this,i=0;i=,?^&]/.test(i)||i==="!"&&this.input.charAt(n+1)==="=")}e+=r[0].length,Di.lastIndex=e,e+=Di.exec(this.input)[0].length,this.input[e]===";"&&e++}};Nn.eat=function(e){return this.type===e?(this.next(),!0):!1};Nn.isContextual=function(e){return this.type===X.name&&this.value===e&&!this.containsEsc};Nn.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};Nn.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};Nn.canInsertSemicolon=function(){return this.type===X.eof||this.type===X.braceR||Ni.test(this.input.slice(this.lastTokEnd,this.start))};Nn.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};Nn.semicolon=function(){!this.eat(X.semi)&&!this.insertSemicolon()&&this.unexpected()};Nn.afterTrailingComma=function(e,r){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),r||this.next(),!0};Nn.expect=function(e){this.eat(e)||this.unexpected()};Nn.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var jp=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Nn.checkPatternErrors=function(e,r){if(!!e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var t=r?e.parenthesizedAssign:e.parenthesizedBind;t>-1&&this.raiseRecoverable(t,r?"Assigning to rvalue":"Parenthesized pattern")}};Nn.checkExpressionErrors=function(e,r){if(!e)return!1;var t=e.shorthandAssign,n=e.doubleProto;if(!r)return t>=0||n>=0;t>=0&&this.raise(t,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")};Nn.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&n<56320)return!0;if(za(n,!0)){for(var i=t+1;xu(n=this.input.charCodeAt(i),!0);)++i;if(n===92||n>55295&&n<56320)return!0;var a=this.input.slice(t,i);if(!$V.test(a))return!0}return!1};hr.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Di.lastIndex=this.pos;var e=Di.exec(this.input),r=this.pos+e[0].length,t;return!Ni.test(this.input.slice(this.pos,r))&&this.input.slice(r,r+8)==="function"&&(r+8===this.input.length||!(xu(t=this.input.charCodeAt(r+8))||t>55295&&t<56320))};hr.parseStatement=function(e,r,t){var n=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(n=X._var,a="let"),n){case X._break:case X._continue:return this.parseBreakContinueStatement(i,n.keyword);case X._debugger:return this.parseDebuggerStatement(i);case X._do:return this.parseDoStatement(i);case X._for:return this.parseForStatement(i);case X._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case X._class:return e&&this.unexpected(),this.parseClass(i,!0);case X._if:return this.parseIfStatement(i);case X._return:return this.parseReturnStatement(i);case X._switch:return this.parseSwitchStatement(i);case X._throw:return this.parseThrowStatement(i);case X._try:return this.parseTryStatement(i);case X._const:case X._var:return a=a||this.value,e&&a!=="var"&&this.unexpected(),this.parseVarStatement(i,a);case X._while:return this.parseWhileStatement(i);case X._with:return this.parseWithStatement(i);case X.braceL:return this.parseBlock(!0,i);case X.semi:return this.parseEmptyStatement(i);case X._export:case X._import:if(this.options.ecmaVersion>10&&n===X._import){Di.lastIndex=this.pos;var s=Di.exec(this.input),l=this.pos+s[0].length,f=this.input.charCodeAt(l);if(f===40||f===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(r||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===X._import?this.parseImport(i):this.parseExport(i,t);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var o=this.value,u=this.parseExpression();return n===X.name&&u.type==="Identifier"&&this.eat(X.colon)?this.parseLabeledStatement(i,o,u,e):this.parseExpressionStatement(i,u)}};hr.parseBreakContinueStatement=function(e,r){var t=r==="break";this.next(),this.eat(X.semi)||this.insertSemicolon()?e.label=null:this.type!==X.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n=6?this.eat(X.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};hr.parseForStatement=function(e){this.next();var r=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Gg),this.enterScope(0),this.expect(X.parenL),this.type===X.semi)return r>-1&&this.unexpected(r),this.parseFor(e,null);var t=this.isLet();if(this.type===X._var||this.type===X._const||t){var n=this.startNode(),i=t?"let":this.value;return this.next(),this.parseVar(n,!0,i),this.finishNode(n,"VariableDeclaration"),(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&n.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===X._in?r>-1&&this.unexpected(r):e.await=r>-1),this.parseForIn(e,n)):(r>-1&&this.unexpected(r),this.parseFor(e,n))}var a=this.isContextual("let"),s=!1,l=new jp,f=this.parseExpression(r>-1?"await":!0,l);return this.type===X._in||(s=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===X._in?r>-1&&this.unexpected(r):e.await=r>-1),a&&s&&this.raise(f.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(f,!1,l),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(l,!0),r>-1&&this.unexpected(r),this.parseFor(e,f))};hr.parseFunctionStatement=function(e,r,t){return this.next(),this.parseFunction(e,Ff|(t?0:qg),!1,r)};hr.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(X._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};hr.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(X.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};hr.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(X.braceL),this.labels.push(nY),this.enterScope(0);for(var r,t=!1;this.type!==X.braceR;)if(this.type===X._case||this.type===X._default){var n=this.type===X._case;r&&this.finishNode(r,"SwitchCase"),e.cases.push(r=this.startNode()),r.consequent=[],this.next(),n?r.test=this.parseExpression():(t&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),t=!0,r.test=null),this.expect(X.colon)}else r||this.unexpected(),r.consequent.push(this.parseStatement(null));return this.exitScope(),r&&this.finishNode(r,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};hr.parseThrowStatement=function(e){return this.next(),Ni.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var iY=[];hr.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),r=e.type==="Identifier";return this.enterScope(r?vB:0),this.checkLValPattern(e,r?yB:Va),this.expect(X.parenR),e};hr.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===X._catch){var r=this.startNode();this.next(),this.eat(X.parenL)?r.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),r.param=null,this.enterScope(0)),r.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(r,"CatchClause")}return e.finalizer=this.eat(X._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};hr.parseVarStatement=function(e,r,t){return this.next(),this.parseVar(e,!1,r,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")};hr.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Gg),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};hr.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};hr.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};hr.parseLabeledStatement=function(e,r,t,n){for(var i=0,a=this.labels;i=0;f--){var o=this.labels[f];if(o.statementStart===e.start)o.statementStart=this.start,o.kind=l;else break}return this.labels.push({name:r,kind:l,statementStart:this.start}),e.body=this.parseStatement(n?n.indexOf("label")===-1?n+"label":n:"label"),this.labels.pop(),e.label=t,this.finishNode(e,"LabeledStatement")};hr.parseExpressionStatement=function(e,r){return e.expression=r,this.semicolon(),this.finishNode(e,"ExpressionStatement")};hr.parseBlock=function(e,r,t){for(e===void 0&&(e=!0),r===void 0&&(r=this.startNode()),r.body=[],this.expect(X.braceL),e&&this.enterScope(0);this.type!==X.braceR;){var n=this.parseStatement(null);r.body.push(n)}return t&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(r,"BlockStatement")};hr.parseFor=function(e,r){return e.init=r,this.expect(X.semi),e.test=this.type===X.semi?null:this.parseExpression(),this.expect(X.semi),e.update=this.type===X.parenR?null:this.parseExpression(),this.expect(X.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};hr.parseForIn=function(e,r){var t=this.type===X._in;return this.next(),r.type==="VariableDeclaration"&&r.declarations[0].init!=null&&(!t||this.options.ecmaVersion<8||this.strict||r.kind!=="var"||r.declarations[0].id.type!=="Identifier")&&this.raise(r.start,(t?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=r,e.right=t?this.parseExpression():this.parseMaybeAssign(),this.expect(X.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,t?"ForInStatement":"ForOfStatement")};hr.parseVar=function(e,r,t,n){for(e.declarations=[],e.kind=t;;){var i=this.startNode();if(this.parseVarId(i,t),this.eat(X.eq)?i.init=this.parseMaybeAssign(r):!n&&t==="const"&&!(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!n&&i.id.type!=="Identifier"&&!(r&&(this.type===X._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):i.init=null,e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(X.comma))break}return e};hr.parseVarId=function(e,r){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,r==="var"?Hg:Va,!1)};var Ff=1,qg=2,wB=4;hr.parseFunction=function(e,r,t,n,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===X.star&&r&qg&&this.unexpected(),e.generator=this.eat(X.star)),this.options.ecmaVersion>=8&&(e.async=!!n),r&Ff&&(e.id=r&wB&&this.type!==X.name?null:this.parseIdent(),e.id&&!(r&qg)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Hg:Va:xB));var a=this.yieldPos,s=this.awaitPos,l=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Yg(e.async,e.generator)),r&Ff||(e.id=this.type===X.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,t,!1,i),this.yieldPos=a,this.awaitPos=s,this.awaitIdentPos=l,this.finishNode(e,r&Ff?"FunctionDeclaration":"FunctionExpression")};hr.parseFunctionParams=function(e){this.expect(X.parenL),e.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};hr.parseClass=function(e,r){this.next();var t=this.strict;this.strict=!0,this.parseClassId(e,r),this.parseClassSuper(e);var n=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(X.braceL);this.type!==X.braceR;){var s=this.parseClassElement(e.superClass!==null);s&&(i.body.push(s),s.type==="MethodDefinition"&&s.kind==="constructor"?(a&&this.raiseRecoverable(s.start,"Duplicate constructor in the same class"),a=!0):s.key&&s.key.type==="PrivateIdentifier"&&aY(n,s)&&this.raiseRecoverable(s.key.start,"Identifier '#"+s.key.name+"' has already been declared"))}return this.strict=t,this.next(),e.body=this.finishNode(i,"ClassBody"),this.exitClassBody(),this.finishNode(e,r?"ClassDeclaration":"ClassExpression")};hr.parseClassElement=function(e){if(this.eat(X.semi))return null;var r=this.options.ecmaVersion,t=this.startNode(),n="",i=!1,a=!1,s="method",l=!1;if(this.eatContextual("static")){if(r>=13&&this.eat(X.braceL))return this.parseClassStaticBlock(t),t;this.isClassElementNameStart()||this.type===X.star?l=!0:n="static"}if(t.static=l,!n&&r>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===X.star)&&!this.canInsertSemicolon()?a=!0:n="async"),!n&&(r>=9||!a)&&this.eat(X.star)&&(i=!0),!n&&!a&&!i){var f=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?s=f:n=f)}if(n?(t.computed=!1,t.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),t.key.name=n,this.finishNode(t.key,"Identifier")):this.parseClassElementName(t),r<13||this.type===X.parenL||s!=="method"||i||a){var o=!t.static&&Xp(t,"constructor"),u=o&&e;o&&s!=="method"&&this.raise(t.key.start,"Constructor can't have get/set modifier"),t.kind=o?"constructor":s,this.parseClassMethod(t,i,a,u)}else this.parseClassField(t);return t};hr.isClassElementNameStart=function(){return this.type===X.name||this.type===X.privateId||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword};hr.parseClassElementName=function(e){this.type===X.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};hr.parseClassMethod=function(e,r,t,n){var i=e.key;e.kind==="constructor"?(r&&this.raise(i.start,"Constructor can't be a generator"),t&&this.raise(i.start,"Constructor can't be an async method")):e.static&&Xp(e,"prototype")&&this.raise(i.start,"Classes may not have a static property named prototype");var a=e.value=this.parseMethod(r,t,n);return e.kind==="get"&&a.params.length!==0&&this.raiseRecoverable(a.start,"getter should have no params"),e.kind==="set"&&a.params.length!==1&&this.raiseRecoverable(a.start,"setter should have exactly one param"),e.kind==="set"&&a.params[0].type==="RestElement"&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};hr.parseClassField=function(e){if(Xp(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Xp(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(X.eq)){var r=this.currentThisScope(),t=r.inClassFieldInit;r.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),r.inClassFieldInit=t}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};hr.parseClassStaticBlock=function(e){e.body=[];var r=this.labels;for(this.labels=[],this.enterScope(Pf|Wg);this.type!==X.braceR;){var t=this.parseStatement(null);e.body.push(t)}return this.next(),this.exitScope(),this.labels=r,this.finishNode(e,"StaticBlock")};hr.parseClassId=function(e,r){this.type===X.name?(e.id=this.parseIdent(),r&&this.checkLValSimple(e.id,Va,!1)):(r===!0&&this.unexpected(),e.id=null)};hr.parseClassSuper=function(e){e.superClass=this.eat(X._extends)?this.parseExprSubscripts(null,!1):null};hr.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};hr.exitClassBody=function(){var e=this.privateNameStack.pop(),r=e.declared,t=e.used;if(!!this.options.checkPrivateFields)for(var n=this.privateNameStack.length,i=n===0?null:this.privateNameStack[n-1],a=0;a=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(r,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==X.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};hr.parseExport=function(e,r){if(this.next(),this.eat(X.star))return this.parseExportAllDeclaration(e,r);if(this.eat(X._default))return this.checkExport(r,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(r,e.declaration.declarations):this.checkExport(r,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(r),this.eatContextual("from"))this.type!==X.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var t=0,n=e.specifiers;t=13&&this.type===X.string){var e=this.parseLiteral(this.value);return jV.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};hr.adaptDirectivePrologue=function(e){for(var r=0;r=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var Ai=Kt.prototype;Ai.toAssignable=function(e,r,t){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",t&&this.checkPatternErrors(t,!0);for(var n=0,i=e.properties;n=8&&!l&&f.name==="async"&&!this.canInsertSemicolon()&&this.eat(X._function))return this.overrideContext(Nt.f_expr),this.parseFunction(this.startNodeAt(a,s),0,!1,!0,r);if(i&&!this.canInsertSemicolon()){if(this.eat(X.arrow))return this.parseArrowExpression(this.startNodeAt(a,s),[f],!1,r);if(this.options.ecmaVersion>=8&&f.name==="async"&&this.type===X.name&&!l&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return f=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(X.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,s),[f],!0,r)}return f;case X.regexp:var o=this.value;return n=this.parseLiteral(o.value),n.regex={pattern:o.pattern,flags:o.flags},n;case X.num:case X.string:return this.parseLiteral(this.value);case X._null:case X._true:case X._false:return n=this.startNode(),n.value=this.type===X._null?null:this.type===X._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,"Literal");case X.parenL:var u=this.start,p=this.parseParenAndDistinguishExpression(i,r);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),p;case X.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(X.bracketR,!0,!0,e),this.finishNode(n,"ArrayExpression");case X.braceL:return this.overrideContext(Nt.b_expr),this.parseObj(!1,e);case X._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case X._class:return this.parseClass(this.startNode(),!1);case X._new:return this.parseNew();case X.backQuote:return this.parseTemplate();case X._import:return this.options.ecmaVersion>=11?this.parseExprImport(t):this.unexpected();default:return this.parseExprAtomDefault()}};Mr.parseExprAtomDefault=function(){this.unexpected()};Mr.parseExprImport=function(e){var r=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===X.parenL&&!e)return this.parseDynamicImport(r);if(this.type===X.dot){var t=this.startNodeAt(r.start,r.loc&&r.loc.start);return t.name="import",r.meta=this.finishNode(t,"Identifier"),this.parseImportMeta(r)}else this.unexpected()};Mr.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(X.parenR)){var r=this.start;this.eat(X.comma)&&this.eat(X.parenR)?this.raiseRecoverable(r,"Trailing comma is not allowed in import()"):this.unexpected(r)}return this.finishNode(e,"ImportExpression")};Mr.parseImportMeta=function(e){this.next();var r=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),r&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};Mr.parseLiteral=function(e){var r=this.startNode();return r.value=e,r.raw=this.input.slice(this.start,this.end),r.raw.charCodeAt(r.raw.length-1)===110&&(r.bigint=r.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(r,"Literal")};Mr.parseParenExpression=function(){this.expect(X.parenL);var e=this.parseExpression();return this.expect(X.parenR),e};Mr.shouldParseArrow=function(e){return!this.canInsertSemicolon()};Mr.parseParenAndDistinguishExpression=function(e,r){var t=this.start,n=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s=this.start,l=this.startLoc,f=[],o=!0,u=!1,p=new jp,h=this.yieldPos,d=this.awaitPos,x;for(this.yieldPos=0,this.awaitPos=0;this.type!==X.parenR;)if(o?o=!1:this.expect(X.comma),a&&this.afterTrailingComma(X.parenR,!0)){u=!0;break}else if(this.type===X.ellipsis){x=this.start,f.push(this.parseParenItem(this.parseRestBinding())),this.type===X.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else f.push(this.parseMaybeAssign(!1,p,this.parseParenItem));var v=this.lastTokEnd,y=this.lastTokEndLoc;if(this.expect(X.parenR),e&&this.shouldParseArrow(f)&&this.eat(X.arrow))return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=h,this.awaitPos=d,this.parseParenArrowList(t,n,f,r);(!f.length||u)&&this.unexpected(this.lastTokStart),x&&this.unexpected(x),this.checkExpressionErrors(p,!0),this.yieldPos=h||this.yieldPos,this.awaitPos=d||this.awaitPos,f.length>1?(i=this.startNodeAt(s,l),i.expressions=f,this.finishNodeAt(i,"SequenceExpression",v,y)):i=f[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var w=this.startNodeAt(t,n);return w.expression=i,this.finishNode(w,"ParenthesizedExpression")}else return i};Mr.parseParenItem=function(e){return e};Mr.parseParenArrowList=function(e,r,t,n){return this.parseArrowExpression(this.startNodeAt(e,r),t,!1,n)};var oY=[];Mr.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===X.dot){var r=this.startNodeAt(e.start,e.loc&&e.loc.start);r.name="new",e.meta=this.finishNode(r,"Identifier"),this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),t&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var n=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),n,i,!0,!1),this.eat(X.parenL)?e.arguments=this.parseExprList(X.parenR,this.options.ecmaVersion>=8,!1):e.arguments=oY,this.finishNode(e,"NewExpression")};Mr.parseTemplateElement=function(e){var r=e.isTagged,t=this.startNode();return this.type===X.invalidTemplate?(r||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),t.value={raw:this.value,cooked:null}):t.value={raw:this.input.slice(this.start,this.end).replace(/\\r\\n?/g,\` -\`),cooked:this.value},this.next(),t.tail=this.type===X.backQuote,this.finishNode(t,"TemplateElement")};Mr.parseTemplate=function(e){e===void 0&&(e={});var r=e.isTagged;r===void 0&&(r=!1);var t=this.startNode();this.next(),t.expressions=[];var n=this.parseTemplateElement({isTagged:r});for(t.quasis=[n];!n.tail;)this.type===X.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(X.dollarBraceL),t.expressions.push(this.parseExpression()),this.expect(X.braceR),t.quasis.push(n=this.parseTemplateElement({isTagged:r}));return this.next(),this.finishNode(t,"TemplateLiteral")};Mr.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===X.name||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===X.star)&&!Ni.test(this.input.slice(this.lastTokEnd,this.start))};Mr.parseObj=function(e,r){var t=this.startNode(),n=!0,i={};for(t.properties=[],this.next();!this.eat(X.braceR);){if(n)n=!1;else if(this.expect(X.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(X.braceR))break;var a=this.parseProperty(e,r);e||this.checkPropClash(a,i,r),t.properties.push(a)}return this.finishNode(t,e?"ObjectPattern":"ObjectExpression")};Mr.parseProperty=function(e,r){var t=this.startNode(),n,i,a,s;if(this.options.ecmaVersion>=9&&this.eat(X.ellipsis))return e?(t.argument=this.parseIdent(!1),this.type===X.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(t,"RestElement")):(t.argument=this.parseMaybeAssign(!1,r),this.type===X.comma&&r&&r.trailingComma<0&&(r.trailingComma=this.start),this.finishNode(t,"SpreadElement"));this.options.ecmaVersion>=6&&(t.method=!1,t.shorthand=!1,(e||r)&&(a=this.start,s=this.startLoc),e||(n=this.eat(X.star)));var l=this.containsEsc;return this.parsePropertyName(t),!e&&!l&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(t)?(i=!0,n=this.options.ecmaVersion>=9&&this.eat(X.star),this.parsePropertyName(t)):i=!1,this.parsePropertyValue(t,e,n,i,a,s,r,l),this.finishNode(t,"Property")};Mr.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var r=e.kind==="get"?0:1;if(e.value.params.length!==r){var t=e.value.start;e.kind==="get"?this.raiseRecoverable(t,"getter should have no params"):this.raiseRecoverable(t,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};Mr.parsePropertyValue=function(e,r,t,n,i,a,s,l){(t||n)&&this.type===X.colon&&this.unexpected(),this.eat(X.colon)?(e.value=r?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,s),e.kind="init"):this.options.ecmaVersion>=6&&this.type===X.parenL?(r&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(t,n)):!r&&!l&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==X.comma&&this.type!==X.braceR&&this.type!==X.eq?((t||n)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((t||n)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=i),e.kind="init",r?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===X.eq&&s?(s.shorthandAssign<0&&(s.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};Mr.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(X.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(X.bracketR),e.key;e.computed=!1}return e.key=this.type===X.num||this.type===X.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};Mr.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};Mr.parseMethod=function(e,r,t){var n=this.startNode(),i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Yg(r,n.generator)|Wg|(t?gB:0)),this.expect(X.parenL),n.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.finishNode(n,"FunctionExpression")};Mr.parseArrowExpression=function(e,r,t,n){var i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(Yg(t,!1)|dB),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(r,!0),this.parseFunctionBody(e,!0,!1,n),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")};Mr.parseFunctionBody=function(e,r,t,n){var i=r&&this.type!==X.braceL,a=this.strict,s=!1;if(i)e.body=this.parseMaybeAssign(n),e.expression=!0,this.checkParams(e,!1);else{var l=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||l)&&(s=this.strictDirective(this.end),s&&l&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var f=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!a&&!s&&!r&&!t&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,bB),e.body=this.parseBlock(!1,void 0,s&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=f}this.exitScope()};Mr.isSimpleParamList=function(e){for(var r=0,t=e;r-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&Bf&&delete this.undefinedExports[e]}else if(r===yB){var a=this.currentScope();a.lexical.push(e)}else if(r===xB){var s=this.currentScope();this.treatFunctionsAsVar?n=s.lexical.indexOf(e)>-1:n=s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var l=this.scopeStack.length-1;l>=0;--l){var f=this.scopeStack[l];if(f.lexical.indexOf(e)>-1&&!(f.flags&vB&&f.lexical[0]===e)||!this.treatFunctionsAsVarInScope(f)&&f.functions.indexOf(e)>-1){n=!0;break}if(f.var.push(e),this.inModule&&f.flags&Bf&&delete this.undefinedExports[e],f.flags&Vg)break}n&&this.raiseRecoverable(t,"Identifier '"+e+"' has already been declared")};Co.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};Co.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Co.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&Vg)return r}};Co.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&Vg&&!(r.flags&dB))return r}};var em=function(r,t,n){this.type="",this.start=t,this.end=0,r.options.locations&&(this.loc=new Kp(r,n)),r.options.directSourceFile&&(this.sourceFile=r.options.directSourceFile),r.options.ranges&&(this.range=[t,0])},kf=Kt.prototype;kf.startNode=function(){return new em(this,this.start,this.startLoc)};kf.startNodeAt=function(e,r){return new em(this,e,r)};function SB(e,r,t,n){return e.type=r,e.end=t,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=t),e}kf.finishNode=function(e,r){return SB.call(this,e,r,this.lastTokEnd,this.lastTokEndLoc)};kf.finishNodeAt=function(e,r,t,n){return SB.call(this,e,r,t,n)};kf.copyNode=function(e){var r=new em(this,e.start,this.startLoc);for(var t in e)r[t]=e[t];return r};var NB="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",AB=NB+" Extended_Pictographic",EB=AB,CB=EB+" EBase EComp EMod EPres ExtPict",MB=CB,uY=MB,fY={9:NB,10:AB,11:EB,12:CB,13:MB,14:uY},lY="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",cY={9:"",10:"",11:"",12:"",13:"",14:lY},oB="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",_B="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",TB=_B+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",FB=TB+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",OB=FB+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",BB=OB+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",pY=BB+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",mY={9:_B,10:TB,11:FB,12:OB,13:BB,14:pY},IB={};function hY(e){var r=IB[e]={binary:Ao(fY[e]+" "+oB),binaryOfStrings:Ao(cY[e]),nonBinary:{General_Category:Ao(oB),Script:Ao(mY[e])}};r.nonBinary.Script_Extensions=r.nonBinary.Script,r.nonBinary.gc=r.nonBinary.General_Category,r.nonBinary.sc=r.nonBinary.Script,r.nonBinary.scx=r.nonBinary.Script_Extensions}for(Zp=0,kg=[9,10,11,12,13,14];Zp=6?"uy":"")+(r.options.ecmaVersion>=9?"s":"")+(r.options.ecmaVersion>=13?"d":"")+(r.options.ecmaVersion>=15?"v":""),this.unicodeProperties=IB[r.options.ecmaVersion>=14?14:r.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};va.prototype.reset=function(r,t,n){var i=n.indexOf("v")!==-1,a=n.indexOf("u")!==-1;this.start=r|0,this.source=t+"",this.flags=n,i&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=a&&this.parser.options.ecmaVersion>=9)};va.prototype.raise=function(r){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+r)};va.prototype.at=function(r,t){t===void 0&&(t=!1);var n=this.source,i=n.length;if(r>=i)return-1;var a=n.charCodeAt(r);if(!(t||this.switchU)||a<=55295||a>=57344||r+1>=i)return a;var s=n.charCodeAt(r+1);return s>=56320&&s<=57343?(a<<10)+s-56613888:a};va.prototype.nextIndex=function(r,t){t===void 0&&(t=!1);var n=this.source,i=n.length;if(r>=i)return i;var a=n.charCodeAt(r),s;return!(t||this.switchU)||a<=55295||a>=57344||r+1>=i||(s=n.charCodeAt(r+1))<56320||s>57343?r+1:r+2};va.prototype.current=function(r){return r===void 0&&(r=!1),this.at(this.pos,r)};va.prototype.lookahead=function(r){return r===void 0&&(r=!1),this.at(this.nextIndex(this.pos,r),r)};va.prototype.advance=function(r){r===void 0&&(r=!1),this.pos=this.nextIndex(this.pos,r)};va.prototype.eat=function(r,t){return t===void 0&&(t=!1),this.current(t)===r?(this.advance(t),!0):!1};va.prototype.eatChars=function(r,t){t===void 0&&(t=!1);for(var n=this.pos,i=0,a=r;i-1&&this.raise(e.start,"Duplicate regular expression flag"),s==="u"&&(n=!0),s==="v"&&(i=!0)}this.options.ecmaVersion>=15&&n&&i&&this.raise(e.start,"Invalid regular expression flag")};ur.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};ur.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var r=0,t=e.backReferenceNames;r=9&&(t=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!t,!0}return e.pos=r,!1};ur.regexp_eatQuantifier=function(e,r){return r===void 0&&(r=!1),this.regexp_eatQuantifierPrefix(e,r)?(e.eat(63),!0):!1};ur.regexp_eatQuantifierPrefix=function(e,r){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,r)};ur.regexp_eatBracedQuantifier=function(e,r){var t=e.pos;if(e.eat(123)){var n=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};ur.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};ur.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};ur.regexp_eatSyntaxCharacter=function(e){var r=e.current();return PB(r)?(e.lastIntValue=r,e.advance(),!0):!1};function PB(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}ur.regexp_eatPatternCharacters=function(e){for(var r=e.pos,t=0;(t=e.current())!==-1&&!PB(t);)e.advance();return e.pos!==r};ur.regexp_eatExtendedPatternCharacter=function(e){var r=e.current();return r!==-1&&r!==36&&!(r>=40&&r<=43)&&r!==46&&r!==63&&r!==91&&r!==94&&r!==124?(e.advance(),!0):!1};ur.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};ur.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};ur.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Eo(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Eo(e.lastIntValue);return!0}return!1};ur.regexp_eatRegExpIdentifierStart=function(e){var r=e.pos,t=this.options.ecmaVersion>=11,n=e.current(t);return e.advance(t),n===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,t)&&(n=e.lastIntValue),dY(n)?(e.lastIntValue=n,!0):(e.pos=r,!1)};function dY(e){return za(e,!0)||e===36||e===95}ur.regexp_eatRegExpIdentifierPart=function(e){var r=e.pos,t=this.options.ecmaVersion>=11,n=e.current(t);return e.advance(t),n===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,t)&&(n=e.lastIntValue),vY(n)?(e.lastIntValue=n,!0):(e.pos=r,!1)};function vY(e){return xu(e,!0)||e===36||e===95||e===8204||e===8205}ur.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};ur.regexp_eatBackReference=function(e){var r=e.pos;if(this.regexp_eatDecimalEscape(e)){var t=e.lastIntValue;if(e.switchU)return t>e.maxBackReference&&(e.maxBackReference=t),!0;if(t<=e.numCapturingParens)return!0;e.pos=r}return!1};ur.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};ur.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};ur.regexp_eatCControlLetter=function(e){var r=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=r}return!1};ur.regexp_eatZero=function(e){return e.current()===48&&!rm(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};ur.regexp_eatControlEscape=function(e){var r=e.current();return r===116?(e.lastIntValue=9,e.advance(),!0):r===110?(e.lastIntValue=10,e.advance(),!0):r===118?(e.lastIntValue=11,e.advance(),!0):r===102?(e.lastIntValue=12,e.advance(),!0):r===114?(e.lastIntValue=13,e.advance(),!0):!1};ur.regexp_eatControlLetter=function(e){var r=e.current();return kB(r)?(e.lastIntValue=r%32,e.advance(),!0):!1};function kB(e){return e>=65&&e<=90||e>=97&&e<=122}ur.regexp_eatRegExpUnicodeEscapeSequence=function(e,r){r===void 0&&(r=!1);var t=e.pos,n=r||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(n&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(s>=56320&&s<=57343)return e.lastIntValue=(i-55296)*1024+(s-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(n&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&gY(e.lastIntValue))return!0;n&&e.raise("Invalid unicode escape"),e.pos=t}return!1};function gY(e){return e>=0&&e<=1114111}ur.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var r=e.current();return r!==99&&(!e.switchN||r!==107)?(e.lastIntValue=r,e.advance(),!0):!1};ur.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var r=e.current();if(r>=49&&r<=57){do e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();while((r=e.current())>=48&&r<=57);return!0}return!1};var RB=0,Wa=1,Si=2;ur.regexp_eatCharacterClassEscape=function(e){var r=e.current();if(xY(r))return e.lastIntValue=-1,e.advance(),Wa;var t=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((t=r===80)||r===112)){e.lastIntValue=-1,e.advance();var n;if(e.eat(123)&&(n=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return t&&n===Si&&e.raise("Invalid property name"),n;e.raise("Invalid property name")}return RB};function xY(e){return e===100||e===68||e===115||e===83||e===119||e===87}ur.regexp_eatUnicodePropertyValueExpression=function(e){var r=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var t=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,t,n),Wa}}if(e.pos=r,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return RB};ur.regexp_validateUnicodePropertyNameAndValue=function(e,r,t){If(e.unicodeProperties.nonBinary,r)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[r].test(t)||e.raise("Invalid property value")};ur.regexp_validateUnicodePropertyNameOrValue=function(e,r){if(e.unicodeProperties.binary.test(r))return Wa;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(r))return Si;e.raise("Invalid property name")};ur.regexp_eatUnicodePropertyName=function(e){var r=0;for(e.lastStringValue="";LB(r=e.current());)e.lastStringValue+=Eo(r),e.advance();return e.lastStringValue!==""};function LB(e){return kB(e)||e===95}ur.regexp_eatUnicodePropertyValue=function(e){var r=0;for(e.lastStringValue="";yY(r=e.current());)e.lastStringValue+=Eo(r),e.advance();return e.lastStringValue!==""};function yY(e){return LB(e)||rm(e)}ur.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};ur.regexp_eatCharacterClass=function(e){if(e.eat(91)){var r=e.eat(94),t=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),r&&t===Si&&e.raise("Negated character class may contain strings"),!0}return!1};ur.regexp_classContents=function(e){return e.current()===93?Wa:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),Wa)};ur.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var r=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var t=e.lastIntValue;e.switchU&&(r===-1||t===-1)&&e.raise("Invalid character class"),r!==-1&&t!==-1&&r>t&&e.raise("Range out of order in character class")}}};ur.regexp_eatClassAtom=function(e){var r=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var t=e.current();(t===99||zB(t))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=r}var n=e.current();return n!==93?(e.lastIntValue=n,e.advance(),!0):!1};ur.regexp_eatClassEscape=function(e){var r=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=r}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};ur.regexp_classSetExpression=function(e){var r=Wa,t;if(!this.regexp_eatClassSetRange(e))if(t=this.regexp_eatClassSetOperand(e)){t===Si&&(r=Si);for(var n=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(t=this.regexp_eatClassSetOperand(e))){t!==Si&&(r=Wa);continue}e.raise("Invalid character in character class")}if(n!==e.pos)return r;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(n!==e.pos)return r}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(t=this.regexp_eatClassSetOperand(e),!t)return r;t===Si&&(r=Si)}};ur.regexp_eatClassSetRange=function(e){var r=e.pos;if(this.regexp_eatClassSetCharacter(e)){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;return t!==-1&&n!==-1&&t>n&&e.raise("Range out of order in character class"),!0}e.pos=r}return!1};ur.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?Wa:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};ur.regexp_eatNestedClass=function(e){var r=e.pos;if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);if(e.eat(93))return t&&n===Si&&e.raise("Negated character class may contain strings"),n;e.pos=r}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=r}return null};ur.regexp_eatClassStringDisjunction=function(e){var r=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var t=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return t}else e.raise("Invalid escape");e.pos=r}return null};ur.regexp_classStringDisjunctionContents=function(e){for(var r=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===Si&&(r=Si);return r};ur.regexp_classString=function(e){for(var r=0;this.regexp_eatClassSetCharacter(e);)r++;return r===1?Wa:Si};ur.regexp_eatClassSetCharacter=function(e){var r=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=r,!1);var t=e.current();return t<0||t===e.lookahead()&&bY(t)||wY(t)?!1:(e.advance(),e.lastIntValue=t,!0)};function bY(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function wY(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}ur.regexp_eatClassSetReservedPunctuator=function(e){var r=e.current();return DY(r)?(e.lastIntValue=r,e.advance(),!0):!1};function DY(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}ur.regexp_eatClassControlLetter=function(e){var r=e.current();return rm(r)||r===95?(e.lastIntValue=r%32,e.advance(),!0):!1};ur.regexp_eatHexEscapeSequence=function(e){var r=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=r}return!1};ur.regexp_eatDecimalDigits=function(e){var r=e.pos,t=0;for(e.lastIntValue=0;rm(t=e.current());)e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();return e.pos!==r};function rm(e){return e>=48&&e<=57}ur.regexp_eatHexDigits=function(e){var r=e.pos,t=0;for(e.lastIntValue=0;qB(t=e.current());)e.lastIntValue=16*e.lastIntValue+UB(t),e.advance();return e.pos!==r};function qB(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function UB(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}ur.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;r<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=r*64+t*8+e.lastIntValue:e.lastIntValue=r*8+t}else e.lastIntValue=r;return!0}return!1};ur.regexp_eatOctalDigit=function(e){var r=e.current();return zB(r)?(e.lastIntValue=r-48,e.advance(),!0):(e.lastIntValue=0,!1)};function zB(e){return e>=48&&e<=55}ur.regexp_eatFixedHexDigits=function(e,r){var t=e.pos;e.lastIntValue=0;for(var n=0;n=this.input.length)return this.finishToken(X.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};Yr.readToken=function(e){return za(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};Yr.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var r=this.input.charCodeAt(this.pos+1);return r<=56319||r>=57344?e:(e<<10)+r-56613888};Yr.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),r=this.pos,t=this.input.indexOf("*/",this.pos+=2);if(t===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=t+2,this.options.locations)for(var n=void 0,i=r;(n=lB(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=n;this.options.onComment&&this.options.onComment(!0,this.input.slice(r+2,t),r,this.pos,e,this.curPosition())};Yr.skipLineComment=function(e){for(var r=this.pos,t=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&cB.test(String.fromCharCode(e)))++this.pos;else break e}}};Yr.finishToken=function(e,r){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var t=this.type;this.type=e,this.value=r,this.updateContext(t)};Yr.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var r=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&r===46?(this.pos+=3,this.finishToken(X.ellipsis)):(++this.pos,this.finishToken(X.dot))};Yr.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(X.assign,2):this.finishOp(X.slash,1)};Yr.readToken_mult_modulo_exp=function(e){var r=this.input.charCodeAt(this.pos+1),t=1,n=e===42?X.star:X.modulo;return this.options.ecmaVersion>=7&&e===42&&r===42&&(++t,n=X.starstar,r=this.input.charCodeAt(this.pos+2)),r===61?this.finishOp(X.assign,t+1):this.finishOp(n,t)};Yr.readToken_pipe_amp=function(e){var r=this.input.charCodeAt(this.pos+1);if(r===e){if(this.options.ecmaVersion>=12){var t=this.input.charCodeAt(this.pos+2);if(t===61)return this.finishOp(X.assign,3)}return this.finishOp(e===124?X.logicalOR:X.logicalAND,2)}return r===61?this.finishOp(X.assign,2):this.finishOp(e===124?X.bitwiseOR:X.bitwiseAND,1)};Yr.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(X.assign,2):this.finishOp(X.bitwiseXOR,1)};Yr.readToken_plus_min=function(e){var r=this.input.charCodeAt(this.pos+1);return r===e?r===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Ni.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(X.incDec,2):r===61?this.finishOp(X.assign,2):this.finishOp(X.plusMin,1)};Yr.readToken_lt_gt=function(e){var r=this.input.charCodeAt(this.pos+1),t=1;return r===e?(t=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+t)===61?this.finishOp(X.assign,t+1):this.finishOp(X.bitShift,t)):r===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(r===61&&(t=2),this.finishOp(X.relational,t))};Yr.readToken_eq_excl=function(e){var r=this.input.charCodeAt(this.pos+1);return r===61?this.finishOp(X.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&r===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(X.arrow)):this.finishOp(e===61?X.eq:X.prefix,1)};Yr.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var r=this.input.charCodeAt(this.pos+1);if(r===46){var t=this.input.charCodeAt(this.pos+2);if(t<48||t>57)return this.finishOp(X.questionDot,2)}if(r===63){if(e>=12){var n=this.input.charCodeAt(this.pos+2);if(n===61)return this.finishOp(X.assign,3)}return this.finishOp(X.coalesce,2)}}return this.finishOp(X.question,1)};Yr.readToken_numberSign=function(){var e=this.options.ecmaVersion,r=35;if(e>=13&&(++this.pos,r=this.fullCharCodeAtPos(),za(r,!0)||r===92))return this.finishToken(X.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Eo(r)+"'")};Yr.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(X.parenL);case 41:return++this.pos,this.finishToken(X.parenR);case 59:return++this.pos,this.finishToken(X.semi);case 44:return++this.pos,this.finishToken(X.comma);case 91:return++this.pos,this.finishToken(X.bracketL);case 93:return++this.pos,this.finishToken(X.bracketR);case 123:return++this.pos,this.finishToken(X.braceL);case 125:return++this.pos,this.finishToken(X.braceR);case 58:return++this.pos,this.finishToken(X.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(X.backQuote);case 48:var r=this.input.charCodeAt(this.pos+1);if(r===120||r===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(r===111||r===79)return this.readRadixNumber(8);if(r===98||r===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(X.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Eo(e)+"'")};Yr.finishOp=function(e,r){var t=this.input.slice(this.pos,this.pos+r);return this.pos+=r,this.finishToken(e,t)};Yr.readRegexp=function(){for(var e,r,t=this.pos;;){this.pos>=this.input.length&&this.raise(t,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(Ni.test(n)&&this.raise(t,"Unterminated regular expression"),e)e=!1;else{if(n==="[")r=!0;else if(n==="]"&&r)r=!1;else if(n==="/"&&!r)break;e=n==="\\\\"}++this.pos}var i=this.input.slice(t,this.pos);++this.pos;var a=this.pos,s=this.readWord1();this.containsEsc&&this.unexpected(a);var l=this.regexpState||(this.regexpState=new va(this));l.reset(t,i,s),this.validateRegExpFlags(l),this.validateRegExpPattern(l);var f=null;try{f=new RegExp(i,s)}catch{}return this.finishToken(X.regexp,{pattern:i,flags:s,value:f})};Yr.readInt=function(e,r,t){for(var n=this.options.ecmaVersion>=12&&r===void 0,i=t&&this.input.charCodeAt(this.pos)===48,a=this.pos,s=0,l=0,f=0,o=r??1/0;f=97?p=u-97+10:u>=65?p=u-65+10:u>=48&&u<=57?p=u-48:p=1/0,p>=e)break;l=u,s=s*e+p}return n&&l===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||r!=null&&this.pos-a!==r?null:s};function SY(e,r){return r?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function WB(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}Yr.readRadixNumber=function(e){var r=this.pos;this.pos+=2;var t=this.readInt(e);return t==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(t=WB(this.input.slice(r,this.pos)),++this.pos):za(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(X.num,t)};Yr.readNumber=function(e){var r=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(r,"Invalid number");var t=this.pos-r>=2&&this.input.charCodeAt(r)===48;t&&this.strict&&this.raise(r,"Invalid number");var n=this.input.charCodeAt(this.pos);if(!t&&!e&&this.options.ecmaVersion>=11&&n===110){var i=WB(this.input.slice(r,this.pos));return++this.pos,za(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(X.num,i)}t&&/[89]/.test(this.input.slice(r,this.pos))&&(t=!1),n===46&&!t&&(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),(n===69||n===101)&&!t&&(n=this.input.charCodeAt(++this.pos),(n===43||n===45)&&++this.pos,this.readInt(10)===null&&this.raise(r,"Invalid number")),za(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=SY(this.input.slice(r,this.pos),t);return this.finishToken(X.num,a)};Yr.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),r;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;r=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,r>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else r=this.readHexChar(4);return r};Yr.readString=function(e){for(var r="",t=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;n===92?(r+=this.input.slice(t,this.pos),r+=this.readEscapedChar(!1),t=this.pos):n===8232||n===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(yu(n)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return r+=this.input.slice(t,this.pos++),this.finishToken(X.string,r)};var VB={};Yr.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===VB)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};Yr.invalidStringToken=function(e,r){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw VB;this.raise(e,r)};Yr.readTmplToken=function(){for(var e="",r=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var t=this.input.charCodeAt(this.pos);if(t===96||t===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===X.template||this.type===X.invalidTemplate)?t===36?(this.pos+=2,this.finishToken(X.dollarBraceL)):(++this.pos,this.finishToken(X.backQuote)):(e+=this.input.slice(r,this.pos),this.finishToken(X.template,e));if(t===92)e+=this.input.slice(r,this.pos),e+=this.readEscapedChar(!0),r=this.pos;else if(yu(t)){switch(e+=this.input.slice(r,this.pos),++this.pos,t){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=\` -\`;break;default:e+=String.fromCharCode(t);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),r=this.pos}else++this.pos}};Yr.readInvalidTemplateToken=function(){for(;this.pos=48&&r<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(n,8);return i>255&&(n=n.slice(0,-1),i=parseInt(n,8)),this.pos+=n.length-1,r=this.input.charCodeAt(this.pos),(n!=="0"||r===56||r===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return yu(r)?"":String.fromCharCode(r)}};Yr.readHexChar=function(e){var r=this.pos,t=this.readInt(16,e);return t===null&&this.invalidStringToken(r,"Bad character escape sequence"),t};Yr.readWord1=function(){this.containsEsc=!1;for(var e="",r=!0,t=this.pos,n=this.options.ecmaVersion>=6;this.pos{let r=/^["'](?:[^"\\\\]|\\\\.)*["'](?:;)?$/.test(e),t=e?.replace(/;+$/,""),n=!isNaN(parseFloat(t))&&!isNaN(t);return r||n||t=="false"||t=="true"||e==null||e==""};var Zg=(e,r)=>{let t=r?\`($event, $value, $state, $saveState, $api) => { \${e} }\`:e,n=typeof t=="string"||t instanceof String?t.includes(\` -\`):!1,i;try{i=n&&!r&&!t.startsWith("(")?new Function(\`with(this) { \${t} }\`):new Function(\`with(this) { return \${t}; }\`)}catch(a){console.log(a,e)}return i},Qg=e=>{let r={...e,execActions:{},execProps:{},execStyles:{},execPropsOptions:{}},{sortedKeys:t,dependencies:n}=GB(r.node.props,\`\${r.id}.props\`),{sortedKeys:i,dependencies:a}=GB(r.node.styles,\`\${r.id}.styles\`);r.execPropsOptions.props=t.map(l=>({name:l,isConst:HB(r.node.props[l]),deps:n.get(l)||[]})),r.execProps=nm(r.node.props,l=>Zg(l,!1)),r.execStyles=nm(r.node.styles,l=>Zg(l,!1)),r.execActions=nm(r.node.actions,l=>Zg(l,!0)),r.children=r.children.map(l=>Qg(l)),r.execPropsOptions.children=[...r.children.flatMap(l=>l.execPropsOptions.children),...r.children.map(l=>l.id)];let s=[...r.children.flatMap(l=>l.execPropsOptions.deps),...r.execPropsOptions.props.flatMap(l=>l.deps),...[...a.values()].flat()];return r.execPropsOptions.deps=s.filter(l=>l[0]!=r.id),r.node.type=="list"&&(r.execPropsOptions.template=r.children),r};function EY(e){let r=[];function t(i,a=[]){if(i.type==="Identifier")return a.push(i.name),a;if(i.type==="MemberExpression"){let s=t(i.object,a);if(s&&i.computed)return i.property.type==="Literal"?(s.push(String(i.property.value)),s):null;if(s)return t(i.property,s)}else if(i.type==="Literal")return a.push(String(i.value)),a;return null}function n(i){if(i.type==="MemberExpression"){let a=t(i);a&&r.push(a);return}for(let a in i)typeof i[a]=="object"&&i[a]!==null&&n(i[a])}try{let i=tm(e.replace("return ",""),{ecmaVersion:2020});n(i)}catch{return[]}return r}function GB(e,r){let t=new Map,n=new Map,i=new Map;for(let o in e){let u=e[o],p=EY(u),h=p.filter(d=>d.slice(0,-1).join(".")===r);n.set(o,h),i.set(o,p),t.has(o)||t.set(o,new Set);for(let d of h){let x=d[d.length-1];x!==o&&t.get(o).add(x)}}let a=new Set,s=[],l=new Set,f=o=>{if(l.has(o))throw new Error("Circular dependency detected");if(!a.has(o)){l.add(o);let u=t.get(o)||new Set;for(let p of u)f(p);a.add(o),l.delete(o),s.push(o)}};for(let o in e)a.has(o)||f(o);return{sortedKeys:s,dependencies:i}}function $B(e,r,t,n,i){var a=[];t||(t=Qe),function s(l,f,o){var u=o||l.type,p=l!==a[a.length-1];p&&a.push(l),t[u](l,f,s),r[u]&&r[u](l,f||a,a),p&&a.pop()}(e,n,i)}function Xg(e,r,t){t(e,r)}function us(e,r,t){}var Qe={};Qe.Program=Qe.BlockStatement=Qe.StaticBlock=function(e,r,t){for(var n=0,i=e.body;n":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},Zi=17,MY={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:Zi,ClassExpression:Zi,FunctionExpression:Zi,ObjectExpression:Zi,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function Du(e,r){let{generator:t}=e;if(e.write("("),r!=null&&r.length>0){t[r[0].type](r[0],e);let{length:n}=r;for(let i=1;i0){e.write(n);for(let s=1;s0){t.VariableDeclarator(n[0],e);for(let a=1;a0){r.write(n),i&&e.comments!=null&&An(r,e.comments,a,n);let{length:l}=s;for(let f=0;f0){for(;i0&&r.write(", ");let a=t[i],s=a.type[6];if(s==="D")r.write(a.local.name,a),i++;else if(s==="N")r.write("* as "+a.local.name,a),i++;else break}if(i0)for(let i=0;;){let a=t[i],{name:s}=a.local;if(r.write(s,a),s!==a.exported.name&&r.write(" as "+a.exported.name),++i "),e.body.type[0]==="O"?(r.write("("),this.ObjectExpression(e.body,r),r.write(")")):this[e.body.type](e.body,r)},ThisExpression(e,r){r.write("this",e)},Super(e,r){r.write("super",e)},RestElement:XB=function(e,r){r.write("..."),this[e.argument.type](e.argument,r)},SpreadElement:XB,YieldExpression(e,r){r.write(e.delegate?"yield*":"yield"),e.argument&&(r.write(" "),this[e.argument.type](e.argument,r))},AwaitExpression(e,r){r.write("await ",e),am(r,e.argument,e)},TemplateLiteral(e,r){let{quasis:t,expressions:n}=e;r.write("\`");let{length:i}=n;for(let s=0;s0){let{elements:t}=e,{length:n}=t;for(let i=0;;){let a=t[i];if(a!=null&&this[a.type](a,r),++i0){r.write(n),i&&e.comments!=null&&An(r,e.comments,a,n);let s=","+n,{properties:l}=e,{length:f}=l;for(let o=0;;){let u=l[o];if(i&&u.comments!=null&&An(r,u.comments,a,n),r.write(a),this[u.type](u,r),++o0){let{properties:t}=e,{length:n}=t;for(let i=0;this[t[i].type](t[i],r),++i1||i[0]==="U"&&(i[1]==="n"||i[1]==="p")&&n.prefix&&n.operator[0]===t&&(t==="+"||t==="-"))&&r.write(" "),a?(r.write(t.length>1?" (":"("),this[i](n,r),r.write(")")):this[i](n,r)}else this[e.argument.type](e.argument,r),r.write(e.operator)},UpdateExpression(e,r){e.prefix?(r.write(e.operator),this[e.argument.type](e.argument,r)):(this[e.argument.type](e.argument,r),r.write(e.operator))},AssignmentExpression(e,r){this[e.left.type](e.left,r),r.write(" "+e.operator+" "),this[e.right.type](e.right,r)},AssignmentPattern(e,r){this[e.left.type](e.left,r),r.write(" = "),this[e.right.type](e.right,r)},BinaryExpression:JB=function(e,r){let t=e.operator==="in";t&&r.write("("),am(r,e.left,e,!1),r.write(" "+e.operator+" "),am(r,e.right,e,!0),t&&r.write(")")},LogicalExpression:JB,ConditionalExpression(e,r){let{test:t}=e,n=r.expressionsPrecedence[t.type];n===Zi||n<=r.expressionsPrecedence.ConditionalExpression?(r.write("("),this[t.type](t,r),r.write(")")):this[t.type](t,r),r.write(" ? "),this[e.consequent.type](e.consequent,r),r.write(" : "),this[e.alternate.type](e.alternate,r)},NewExpression(e,r){r.write("new ");let t=r.expressionsPrecedence[e.callee.type];t===Zi||t0&&(this.lineEndSize>0&&(i.length===1?r[n-1]===i:r.endsWith(i))?(this.line+=this.lineEndSize,this.column=0):this.column+=n)}toString(){return this.output}};function rI(e,r){let t=new Kg(r);return t.generator[e.type](e,t),t.output}var jg=(e,r,t)=>{let n,i=yx(e),a=i.includes(\` -\`),s=!1;if(a){let l=i.split(\` -\`).filter(f=>f.trim()!=="");l[l.length-1].includes("return")&&(s=!0),l[l.length-1]=\`\${l[l.length-1].replace("return ","")}\`,i=l.join(\` -\`)}try{let l=tm(i,{ecmaVersion:2020,locations:!0});$B(l,{Identifier(f,o){let u=o[o.length-2];(u.type!=="MemberExpression"||u.object===f)&&f.name==r&&(f.name=t)},Property(f){f.key.type==="Identifier"&&f.key.name===r&&(f.key.name=t)},ObjectExpression(f){f.properties.forEach(o=>{o.key.type==="Identifier"&&o.key.name===r&&(o.key.name=t)})}}),n=rI(l).trimEnd()}catch(l){console.log(l,e,name),n='"error"'}if(a&&s){let l=n.split(\` -\`).filter(f=>f.trim()!=="");l[l.length-1]=\`return \${l[l.length-1]}\`,n=l.join(\` -\`)}return n};var tI=(e,r)=>{let t=(i,a,s)=>{let l,f=s.node;return s.children&&(l=s.children.map(o=>t(i,a,o))),{...s,children:l,node:{...s.node,parentId:f.parentId==i?a:f.parentId,props:Object.keys(f?.props??{}).reduce((o,u)=>({...o,[u]:jg(f.props[u],i,a)}),f.props),actions:Object.keys(f?.actions??{}).reduce((o,u)=>({...o,[u]:jg(f.actions[u],i,a)}),f.actions),styles:Object.keys(f?.styles??{}).reduce((o,u)=>({...o,[u]:jg(f.styles[u],i,a)}),f.styles)}}};return((i,a,s)=>{let l=(f,o,u)=>{let p=o.node.parentId?o.id+u:f.id,h={...o,node:{...o.node,id:p},id:p};if(h=t(o.id,p,h),h.children){let[d,x]=h.children.reduce((v,y,w)=>{let[C,b]=l(h,y,u+w+1);return v[0].push(C),[v[0],b]},[[],u]);h.children=d,u=x}return[h,u+1]};return l(i,a,s)})(e,e,r)};var e0=async(e,r,t)=>{let n=e;if(r.prevState[n.id]&&n.node.type!="content"){let a=!1;if(n.node.type=="slides"||n.node.type=="slide"||n.node.type=="delta")a=!1;else{let s=(n.execPropsOptions.children??[]).some(u=>Object.keys(r.newState).includes(u)),l=Object.keys(r.newState[n.id]?.props??{}).every(u=>r.newState[n.id]?.props[u]==r.prevState[n.id]?.props[u]),f=Object.keys(r.newState[n.id]?.styles??{}).every(u=>r.newState[n.id]?.styles[u]==r.prevState[n.id]?.styles[u]),o=n.execPropsOptions.deps.every(u=>u[0]=="$api"||r.newState[u[0]]?.[u[1]]?.[u[2]]===void 0?!0:r.newState[u[0]]?.[u[1]]?.[u[2]]===r.prevState[u[0]]?.[u[1]]?.[u[2]]);l&&f&&o&&!s&&(a=!0)}if(a)return{id:t.runID,root:t.root,exec:n,state:r.state,slides:r.slides,newState:r.newState,prevState:r.prevState}}let i=await BY(n,r,t.contexts,t.api);if(n.node.type=="list"){let a=0;n.children=ld(i.state[n.id].props.value).flatMap((s,l)=>n.execPropsOptions.template.map(f=>{let[o,u]=tI({...f,node:{...f.node,props:{...f.node.props,value:\`\${n.id}.props.value[\${l}]\`}}},a);return a=u,Qg(o)}))}typeof i.state[n.id]?.actions?.onRun=="function"&&i.state[n.id].actions?.onRun(null,null,i,a=>{t.saveState(a,{state:i.state,slides:i.slides,root:t.root,exec:t.exec,id:t.runID})},t.api),n.children=[...n.children.filter(a=>a.node.type=="slides"),...n.children.filter(a=>a.node.type!="slides")];for(let a=0;a[{state:f.state,newState:f.newState,slides:f.slides,prevState:f.prevState},f.exec]);if(i=s,n.children[a]=l,l.node.type=="slides"){let f=s.state[l.id].props.value,o=s.state[l.node.parentId]?.props[f],u;t.selectedSlide&&(u=l.children.find(p=>p.id==t.selectedSlide)),o!==null&&!u&&(u=l.children.find(p=>s.state[p.id].props.value==o)),u&&u.children.forEach(p=>{i.newState[p.node.ref]||(i.newState[p.node.ref]={props:{},styles:{},actions:{}}),p.node.ref==n.id?(i.state[p.node.ref].props={...i.state[p.node.ref].props,...i.state[p.node.id].props},i.state[p.node.ref].styles={...i.state[p.node.ref].styles,...i.state[p.node.id].styles},i.state[p.node.ref].actions={...i.state[p.node.ref].actions,...i.state[p.node.id].actions}):(i.newState[p.node.ref].props={...i.newState[p.node.ref].props,...i.state[p.node.id].props},i.newState[p.node.ref].styles={...i.newState[p.node.ref].styles,...i.state[p.node.id].styles},i.newState[p.node.ref].actions={...i.newState[p.node.ref].actions,...i.state[p.node.id].actions})})}}return{id:t.runID,root:t.root,exec:n,state:i.state,slides:i.slides,newState:i.newState,prevState:i.prevState}},BY=async(e,r,t,n)=>{let i=await IY(e,r,t,n),a=nI(e.node,"styles",e.execStyles,i);return nI(e.node,"actions",e.execActions,a)};var IY=async(e,r,t,n)=>{let{id:i}=e.node,a=e.execProps??{},s=r.state;s[i]={props:r.state[i]?.props??{},actions:r.state[i]?.actions??{},styles:r.state[i]?.styles??{}},s.$contexts=t,s.$api=n;for(let{name:l,isConst:f}of e.execPropsOptions.props)try{let o;l in(r.newState?.[i]?.props||{})&&f?o=r.newState[i].props[l]:o=a[l]?.call(s),o!==null?(s[i].props[l]=o,r.state[i].props[l]=o,r.newState&&(r.newState[i]=r.newState[i]??{props:{},styles:{},actions:{}},r.newState[i].props[l]=o)):(delete s[i].props[l],delete r.state[i].props[l],r.newState?.[i]&&delete r.newState[i].props[l])}catch(o){console.log(l,o,a[l])}return r};function nI(e,r,t,n){let{id:i}=e;for(let a of Object.keys(t)){let s;try{a in(n.newState?.[i]?.[r]||{})?s=n.newState[i][r][a]:s=t[a]?.call(n.state),s!==null?n.state[e.id][r][a]=s:delete n.state[e.id][r][a]}catch(l){console.log(l,a)}}return n}function iI(e){return e.table.rows.map(r=>tB(e.paths,r,e.table.cols))}function aI(e){let{queries:r,pathsIndex:t,count:n}=e,i=[];for(let[a,s]of t)!s.hidden&&Fd(r,s)&&i.push(s);return i.slice(0,n)}function oI(e){let{root:r,store:t,context:n}=e;return e0(r,t,n)}var PY=self;PY.onmessage=async e=>{let{payload:r,job:t}=e.data,n;t.type=="search"?n=aI(r):t.type=="table"?n=iI(r):t.type=="instance"&&(n=oI(r));try{postMessage({job:t,result:n})}catch(i){console.log(i),postMessage({job:t,result:{$error:\`Failed to run \${t.type} \${t.path}: \${i}\`}})}}; -/*! - * decimal.js v10.4.3 - * An arbitrary-precision Decimal type for JavaScript. - * https://github.com/MikeMcl/decimal.js - * Copyright (c) 2022 Michael Mclaughlin - * MIT Licence - */ -/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -/** - * @license Complex.js v2.1.1 12/05/2020 - * - * Copyright (c) 2020, Robert Eisele (robert@xarg.org) - * Dual licensed under the MIT or GPL Version 2 licenses. - **/ -/** - * @license Fraction.js v4.3.0 20/08/2023 - * https://www.xarg.org/2014/03/rational-numbers-in-javascript/ - * - * Copyright (c) 2023, Robert Eisele (robert@raw.org) - * Dual licensed under the MIT or GPL Version 2 licenses. - **/ -//! authors : Tim Wood, Iskren Chernev, Moment.js contributors -//! license : MIT -//! moment.js -//! momentjs.com -//! version : 2.29.4 -`, { "name": "Superstate Runner" }); +// src/core/superstate/workers/search/search.worker.ts +function Worker4() { + return inlineWorker('"use strict";var ge=(t,e)=>e.indexOf(t)>0?e.indexOf(t):e.length;function k(t){return k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(t)}function x(t){if(t===null||t===!0||t===!1)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function f(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function m(t){f(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||k(t)==="object"&&e==="[object Date]"?new Date(t.getTime()):typeof t=="number"||e==="[object Number]"?new Date(t):((typeof t=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn\'t accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function J(t,e){f(2,arguments);var r=m(t).getTime(),a=x(e);return new Date(r+a)}var Ve={};function T(){return Ve}function z(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function K(t){return f(1,arguments),t instanceof Date||k(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Z(t){if(f(1,arguments),!K(t)&&typeof t!="number")return!1;var e=m(t);return!isNaN(Number(e))}function ee(t,e){f(2,arguments);var r=x(e);return J(t,-r)}var Je=864e5;function te(t){f(1,arguments);var e=m(t),r=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var a=e.getTime(),n=r-a;return Math.floor(n/Je)+1}function O(t){f(1,arguments);var e=1,r=m(t),a=r.getUTCDay(),n=(a=n.getTime()?r+1:e.getTime()>=i.getTime()?r:r-1}function re(t){f(1,arguments);var e=q(t),r=new Date(0);r.setUTCFullYear(e,0,4),r.setUTCHours(0,0,0,0);var a=O(r);return a}var ze=6048e5;function ae(t){f(1,arguments);var e=m(t),r=O(e).getTime()-re(e).getTime();return Math.round(r/ze)+1}function S(t,e){var r,a,n,o,i,u,d,l;f(1,arguments);var p=T(),c=x((r=(a=(n=(o=e?.weekStartsOn)!==null&&o!==void 0?o:e==null||(i=e.locale)===null||i===void 0||(u=i.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:p.weekStartsOn)!==null&&a!==void 0?a:(d=p.locale)===null||d===void 0||(l=d.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&r!==void 0?r:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=m(t),g=h.getUTCDay(),v=(g=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var v=new Date(0);v.setUTCFullYear(c+1,0,g),v.setUTCHours(0,0,0,0);var U=S(v,e),D=new Date(0);D.setUTCFullYear(c,0,g),D.setUTCHours(0,0,0,0);var E=S(D,e);return p.getTime()>=U.getTime()?c+1:p.getTime()>=E.getTime()?c:c-1}function ne(t,e){var r,a,n,o,i,u,d,l;f(1,arguments);var p=T(),c=x((r=(a=(n=(o=e?.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(i=e.locale)===null||i===void 0||(u=i.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:p.firstWeekContainsDate)!==null&&a!==void 0?a:(d=p.locale)===null||d===void 0||(l=d.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&r!==void 0?r:1),h=_(t,e),g=new Date(0);g.setUTCFullYear(h,0,c),g.setUTCHours(0,0,0,0);var v=S(g,e);return v}var Ke=6048e5;function oe(t,e){f(1,arguments);var r=m(t),a=S(r,e).getTime()-ne(r,e).getTime();return Math.round(a/Ke)+1}function s(t,e){for(var r=t<0?"-":"",a=Math.abs(t).toString();a.length0?a:1-a;return s(r==="yy"?n%100:n,r.length)},M:function(e,r){var a=e.getUTCMonth();return r==="M"?String(a+1):s(a+1,2)},d:function(e,r){return s(e.getUTCDate(),r.length)},a:function(e,r){var a=e.getUTCHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},h:function(e,r){return s(e.getUTCHours()%12||12,r.length)},H:function(e,r){return s(e.getUTCHours(),r.length)},m:function(e,r){return s(e.getUTCMinutes(),r.length)},s:function(e,r){return s(e.getUTCSeconds(),r.length)},S:function(e,r){var a=r.length,n=e.getUTCMilliseconds(),o=Math.floor(n*Math.pow(10,a-3));return s(o,r.length)}},b=Ze;var F={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},et={G:function(e,r,a){var n=e.getUTCFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return a.era(n,{width:"abbreviated"});case"GGGGG":return a.era(n,{width:"narrow"});case"GGGG":default:return a.era(n,{width:"wide"})}},y:function(e,r,a){if(r==="yo"){var n=e.getUTCFullYear(),o=n>0?n:1-n;return a.ordinalNumber(o,{unit:"year"})}return b.y(e,r)},Y:function(e,r,a,n){var o=_(e,n),i=o>0?o:1-o;if(r==="YY"){var u=i%100;return s(u,2)}return r==="Yo"?a.ordinalNumber(i,{unit:"year"}):s(i,r.length)},R:function(e,r){var a=q(e);return s(a,r.length)},u:function(e,r){var a=e.getUTCFullYear();return s(a,r.length)},Q:function(e,r,a){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(r){case"Q":return String(n);case"QQ":return s(n,2);case"Qo":return a.ordinalNumber(n,{unit:"quarter"});case"QQQ":return a.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,r,a){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(r){case"q":return String(n);case"qq":return s(n,2);case"qo":return a.ordinalNumber(n,{unit:"quarter"});case"qqq":return a.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,r,a){var n=e.getUTCMonth();switch(r){case"M":case"MM":return b.M(e,r);case"Mo":return a.ordinalNumber(n+1,{unit:"month"});case"MMM":return a.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(n,{width:"wide",context:"formatting"})}},L:function(e,r,a){var n=e.getUTCMonth();switch(r){case"L":return String(n+1);case"LL":return s(n+1,2);case"Lo":return a.ordinalNumber(n+1,{unit:"month"});case"LLL":return a.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(n,{width:"wide",context:"standalone"})}},w:function(e,r,a,n){var o=oe(e,n);return r==="wo"?a.ordinalNumber(o,{unit:"week"}):s(o,r.length)},I:function(e,r,a){var n=ae(e);return r==="Io"?a.ordinalNumber(n,{unit:"week"}):s(n,r.length)},d:function(e,r,a){return r==="do"?a.ordinalNumber(e.getUTCDate(),{unit:"date"}):b.d(e,r)},D:function(e,r,a){var n=te(e);return r==="Do"?a.ordinalNumber(n,{unit:"dayOfYear"}):s(n,r.length)},E:function(e,r,a){var n=e.getUTCDay();switch(r){case"E":case"EE":case"EEE":return a.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(n,{width:"short",context:"formatting"});case"EEEE":default:return a.day(n,{width:"wide",context:"formatting"})}},e:function(e,r,a,n){var o=e.getUTCDay(),i=(o-n.weekStartsOn+8)%7||7;switch(r){case"e":return String(i);case"ee":return s(i,2);case"eo":return a.ordinalNumber(i,{unit:"day"});case"eee":return a.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(o,{width:"short",context:"formatting"});case"eeee":default:return a.day(o,{width:"wide",context:"formatting"})}},c:function(e,r,a,n){var o=e.getUTCDay(),i=(o-n.weekStartsOn+8)%7||7;switch(r){case"c":return String(i);case"cc":return s(i,r.length);case"co":return a.ordinalNumber(i,{unit:"day"});case"ccc":return a.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(o,{width:"narrow",context:"standalone"});case"cccccc":return a.day(o,{width:"short",context:"standalone"});case"cccc":default:return a.day(o,{width:"wide",context:"standalone"})}},i:function(e,r,a){var n=e.getUTCDay(),o=n===0?7:n;switch(r){case"i":return String(o);case"ii":return s(o,r.length);case"io":return a.ordinalNumber(o,{unit:"day"});case"iii":return a.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(n,{width:"short",context:"formatting"});case"iiii":default:return a.day(n,{width:"wide",context:"formatting"})}},a:function(e,r,a){var n=e.getUTCHours(),o=n/12>=1?"pm":"am";switch(r){case"a":case"aa":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,r,a){var n=e.getUTCHours(),o;switch(n===12?o=F.noon:n===0?o=F.midnight:o=n/12>=1?"pm":"am",r){case"b":case"bb":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,r,a){var n=e.getUTCHours(),o;switch(n>=17?o=F.evening:n>=12?o=F.afternoon:n>=4?o=F.morning:o=F.night,r){case"B":case"BB":case"BBB":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,r,a){if(r==="ho"){var n=e.getUTCHours()%12;return n===0&&(n=12),a.ordinalNumber(n,{unit:"hour"})}return b.h(e,r)},H:function(e,r,a){return r==="Ho"?a.ordinalNumber(e.getUTCHours(),{unit:"hour"}):b.H(e,r)},K:function(e,r,a){var n=e.getUTCHours()%12;return r==="Ko"?a.ordinalNumber(n,{unit:"hour"}):s(n,r.length)},k:function(e,r,a){var n=e.getUTCHours();return n===0&&(n=24),r==="ko"?a.ordinalNumber(n,{unit:"hour"}):s(n,r.length)},m:function(e,r,a){return r==="mo"?a.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):b.m(e,r)},s:function(e,r,a){return r==="so"?a.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):b.s(e,r)},S:function(e,r){return b.S(e,r)},X:function(e,r,a,n){var o=n._originalDate||e,i=o.getTimezoneOffset();if(i===0)return"Z";switch(r){case"X":return xe(i);case"XXXX":case"XX":return M(i);case"XXXXX":case"XXX":default:return M(i,":")}},x:function(e,r,a,n){var o=n._originalDate||e,i=o.getTimezoneOffset();switch(r){case"x":return xe(i);case"xxxx":case"xx":return M(i);case"xxxxx":case"xxx":default:return M(i,":")}},O:function(e,r,a,n){var o=n._originalDate||e,i=o.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+he(i,":");case"OOOO":default:return"GMT"+M(i,":")}},z:function(e,r,a,n){var o=n._originalDate||e,i=o.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+he(i,":");case"zzzz":default:return"GMT"+M(i,":")}},t:function(e,r,a,n){var o=n._originalDate||e,i=Math.floor(o.getTime()/1e3);return s(i,r.length)},T:function(e,r,a,n){var o=n._originalDate||e,i=o.getTime();return s(i,r.length)}};function he(t,e){var r=t>0?"-":"+",a=Math.abs(t),n=Math.floor(a/60),o=a%60;if(o===0)return r+String(n);var i=e||"";return r+String(n)+i+s(o,2)}function xe(t,e){if(t%60===0){var r=t>0?"-":"+";return r+s(Math.abs(t)/60,2)}return M(t,e)}function M(t,e){var r=e||"",a=t>0?"-":"+",n=Math.abs(t),o=s(Math.floor(n/60),2),i=s(n%60,2);return a+o+r+i}var ye=et;var ve=function(e,r){switch(e){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},be=function(e,r){switch(e){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},tt=function(e,r){var a=e.match(/(P+)(p+)?/)||[],n=a[1],o=a[2];if(!o)return ve(e,r);var i;switch(n){case"P":i=r.dateTime({width:"short"});break;case"PP":i=r.dateTime({width:"medium"});break;case"PPP":i=r.dateTime({width:"long"});break;case"PPPP":default:i=r.dateTime({width:"full"});break}return i.replace("{{date}}",ve(n,r)).replace("{{time}}",be(o,r))},rt={p:be,P:tt},we=rt;var at=["D","DD"],nt=["YY","YYYY"];function Te(t){return at.indexOf(t)!==-1}function Oe(t){return nt.indexOf(t)!==-1}function ie(t,e,r){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var ot={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},it=function(e,r,a){var n,o=ot[e];return typeof o=="string"?n=o:r===1?n=o.one:n=o.other.replace("{{count}}",r.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"in "+n:n+" ago":n},Se=it;function L(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.width?String(e.width):t.defaultWidth,a=t.formats[r]||t.formats[t.defaultWidth];return a}}var st={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ft={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ut={full:"{{date}} \'at\' {{time}}",long:"{{date}} \'at\' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},lt={date:L({formats:st,defaultWidth:"full"}),time:L({formats:ft,defaultWidth:"full"}),dateTime:L({formats:ut,defaultWidth:"full"})},De=lt;var dt={lastWeek:"\'last\' eeee \'at\' p",yesterday:"\'yesterday at\' p",today:"\'today at\' p",tomorrow:"\'tomorrow at\' p",nextWeek:"eeee \'at\' p",other:"P"},mt=function(e,r,a,n){return dt[e]},ke=mt;function W(t){return function(e,r){var a=r!=null&&r.context?String(r.context):"standalone",n;if(a==="formatting"&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,i=r!=null&&r.width?String(r.width):o;n=t.formattingValues[i]||t.formattingValues[o]}else{var u=t.defaultWidth,d=r!=null&&r.width?String(r.width):t.defaultWidth;n=t.values[d]||t.values[u]}var l=t.argumentCallback?t.argumentCallback(e):e;return n[l]}}var ct={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},pt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},xt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},yt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vt=function(e,r){var a=Number(e),n=a%100;if(n>20||n<10)switch(n%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},bt={ordinalNumber:vt,era:W({values:ct,defaultWidth:"wide"}),quarter:W({values:pt,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:W({values:gt,defaultWidth:"wide"}),day:W({values:ht,defaultWidth:"wide"}),dayPeriod:W({values:xt,defaultWidth:"wide",formattingValues:yt,defaultFormattingWidth:"wide"})},Me=bt;function C(t){return function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.width,n=a&&t.matchPatterns[a]||t.matchPatterns[t.defaultMatchWidth],o=e.match(n);if(!o)return null;var i=o[0],u=a&&t.parsePatterns[a]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(u)?Tt(u,function(c){return c.test(i)}):wt(u,function(c){return c.test(i)}),l;l=t.valueCallback?t.valueCallback(d):d,l=r.valueCallback?r.valueCallback(l):l;var p=e.slice(i.length);return{value:l,rest:p}}}function wt(t,e){for(var r in t)if(t.hasOwnProperty(r)&&e(t[r]))return r}function Tt(t,e){for(var r=0;r1&&arguments[1]!==void 0?arguments[1]:{},a=e.match(t.matchPattern);if(!a)return null;var n=a[0],o=e.match(t.parsePattern);if(!o)return null;var i=t.valueCallback?t.valueCallback(o[0]):o[0];i=r.valueCallback?r.valueCallback(i):i;var u=e.slice(n.length);return{value:i,rest:u}}}var Ot=/^(\\d+)(th|st|nd|rd)?/i,St=/\\d+/i,Dt={narrow:/^(b|a)/i,abbreviated:/^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},kt={any:[/^b/i,/^(a|c)/i]},Mt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wt={any:[/1/i,/2/i,/3/i,/4/i]},Ct={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Pt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ft={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},It={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Yt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ut={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Et={ordinalNumber:se({matchPattern:Ot,parsePattern:St,valueCallback:function(e){return parseInt(e,10)}}),era:C({matchPatterns:Dt,defaultMatchWidth:"wide",parsePatterns:kt,defaultParseWidth:"any"}),quarter:C({matchPatterns:Mt,defaultMatchWidth:"wide",parsePatterns:Wt,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:C({matchPatterns:Ct,defaultMatchWidth:"wide",parsePatterns:Pt,defaultParseWidth:"any"}),day:C({matchPatterns:Ft,defaultMatchWidth:"wide",parsePatterns:It,defaultParseWidth:"any"}),dayPeriod:C({matchPatterns:Yt,defaultMatchWidth:"any",parsePatterns:Ut,defaultParseWidth:"any"})},We=Et;var Nt={code:"en-US",formatDistance:Se,formatLong:De,formatRelative:ke,localize:Me,match:We,options:{weekStartsOn:0,firstWeekContainsDate:1}},Ce=Nt;var Pe=Ce;var At=/[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|\'\'|\'(\'\'|[^\'])+(\'|$)|./g,qt=/P+p+|P+|p+|\'\'|\'(\'\'|[^\'])+(\'|$)|./g,_t=/^\'([^]*?)\'?$/,Lt=/\'\'/g,$t=/[a-zA-Z]/;function B(t,e,r){var a,n,o,i,u,d,l,p,c,h,g,v,U,D,E,j,R,G;f(2,arguments);var Be=String(e),N=T(),A=(a=(n=r?.locale)!==null&&n!==void 0?n:N.locale)!==null&&a!==void 0?a:Pe,X=x((o=(i=(u=(d=r?.firstWeekContainsDate)!==null&&d!==void 0?d:r==null||(l=r.locale)===null||l===void 0||(p=l.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&u!==void 0?u:N.firstWeekContainsDate)!==null&&i!==void 0?i:(c=N.locale)===null||c===void 0||(h=c.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(X>=1&&X<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var V=x((g=(v=(U=(D=r?.weekStartsOn)!==null&&D!==void 0?D:r==null||(E=r.locale)===null||E===void 0||(j=E.options)===null||j===void 0?void 0:j.weekStartsOn)!==null&&U!==void 0?U:N.weekStartsOn)!==null&&v!==void 0?v:(R=N.locale)===null||R===void 0||(G=R.options)===null||G===void 0?void 0:G.weekStartsOn)!==null&&g!==void 0?g:0);if(!(V>=0&&V<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!A.localize)throw new RangeError("locale must contain localize property");if(!A.formatLong)throw new RangeError("locale must contain formatLong property");var Q=m(t);if(!Z(Q))throw new RangeError("Invalid time value");var je=z(Q),Re=ee(Q,je),Ge={firstWeekContainsDate:X,weekStartsOn:V,locale:A,_originalDate:Q},Xe=Be.match(qt).map(function(y){var w=y[0];if(w==="p"||w==="P"){var H=we[w];return H(y,A.formatLong)}return y}).join("").match(At).map(function(y){if(y==="\'\'")return"\'";var w=y[0];if(w==="\'")return Qt(y);var H=ye[w];if(H)return!(r!=null&&r.useAdditionalWeekYearTokens)&&Oe(y)&&ie(y,e,String(t)),!(r!=null&&r.useAdditionalDayOfYearTokens)&&Te(y)&&ie(y,e,String(t)),H(Re,y,A.localize,Ge);if(w.match($t))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return y}).join("");return Xe}function Qt(t){var e=t.match(_t);return e?e[1].replace(Lt,"\'"):t}var Fe=t=>[...new Set(t)];var fe=(t,e)=>{if(t instanceof Date)return"date";if(typeof t=="string"){if(/\\/\\/(\\S+?(?:jpe?g|png|gif|svg))/gi.test(t)||t.includes("unsplash"))return"image";if(/^\\d{4}-\\d{2}-\\d{2}$/.test(t))return"date";if(e=="tag"||e=="tags")return"tag";if(/\\[\\[.*?\\]\\]/.test(t))return"link"}else{if(typeof t=="number")return"number";if(typeof t=="boolean")return"boolean";if(t)if(Array.isArray(t)||typeof t=="string"&&t.indexOf(",")>-1){let r=Array.isArray(t)?t:[];if(typeof t=="string"&&t.indexOf(",")>-1&&(r=P(t)),e=="tag"||e=="tags")return"tag-multi";if(r.length==1&&Array.isArray(r[0])&&r[0].length==1&&typeof r[0][0]=="string")return"link";let a=Fe(r.map(n=>fe(n,e)));return a.length==1&&a[0]=="link"?"link-multi":a.some(n=>n=="object")?"object-multi":"option-multi"}else{if(t.isLuxonDateTime)return"date";if(t.isLuxonDuration)return"duration";if(t.type=="file")return"link";if(typeof t=="object"&&!Array.isArray(t)&&t!==null)return"object"}else return"unknown"}return"text"};var Ie=t=>t.map(e=>e.replace(",","\\\\,")).join(", "),I=t=>t?.map(e=>e.replace(",","\\\\,")).join(", ")??"";var P=t=>(t?.replace("\\\\,",",")?.match(/(\\\\.|[^,])+/g)??[]).map(e=>e.trim()),Ye=(t,e)=>{switch(fe(e,t)){case"object":return JSON.stringify(e);case"number":return e.toString();case"boolean":return e?"true":"false";case"date":{if(e instanceof Date){let a=B(e,"yyyy-MM-dd");if(typeof a=="string")return a}return typeof e!="string"?"":e}break;case"duration":return Ie(Object.keys(e.values).reduce((a,n)=>[...a,...e.values[n]>0?[e.values[n]+" "+n]:[]],[]));case"option-multi":case"link-multi":return typeof e=="string"?ue(e):I(e.map(a=>a?typeof a=="string"?ue(a):a.path?a.path:Array.isArray(e)&&a.length==1&&Array.isArray(a[0])&&a[0].length==1&&typeof a[0][0]=="string"?a[0][0]:JSON.stringify(a):""));case"link":return Array.isArray(e)&&e.length==1&&Array.isArray(e[0])&&e[0].length==1&&typeof e[0][0]=="string"?e[0][0]:typeof e=="string"?ue(e):e.path;case"text":case"tag":case"image":return e}return""};var ue=t=>{if(!t)return"";let e=/\\[\\[(.*?)\\]\\]/g.exec(t),r=e?.length>1?e[1].substring(0,ge("|",e[1])):t;return r||t};var Ue=(t,e)=>{let r=t?P(t):[],a=e?P(e):[];return a.every(n=>r.some(o=>o==n))&&r.every(n=>a.some(o=>o==n))},Y=(t,e)=>t==e,le=(t,e)=>(t??"").length==0,de=(t,e)=>(t??"").toLowerCase().includes((e??"").toLowerCase()),me=(t,e)=>parseFloat(t)>parseFloat(e),ce=(t,e)=>parseInt(t){let r=isNaN(Date.parse(t))?new Date(parseInt(t)):new Date(t),a=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e);return r.valueOf()>a.valueOf()},Ne=(t,e)=>{let r=isNaN(Date.parse(t))?new Date(parseInt(t)):new Date(t),a=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e);return r.valueOf(){let r=t?P(t):[];return(e?P(e):[]).some(n=>r.some(o=>o==n))},Ae=(t,e)=>{if(!t)return!1;let r=new Date(`${t.toString().replace(".",":")}`),a=new Date(`${e}`);return r.getMonth()===a.getMonth()&&r.getDate()===a.getDate()},qe=t=>{if(!t)return!1;let e=new Date(`${t.toString()}T00:00`),r=new Date;return e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()};var $={isNotEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(t,e)=>!le(t,""),valueType:"none"},isEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(t,e)=>le(t,""),valueType:"none"},include:{fn:(t,e)=>de(t,e),type:["text","file","link","image"],valueType:"text"},notInclude:{type:["text","file","link","image"],fn:(t,e)=>!de(t,e),valueType:"text"},is:{type:["text"],fn:(t,e)=>Y(t,e),valueType:"text"},isNot:{type:["text"],fn:(t,e)=>!Y(t,e),valueType:"text"},equal:{type:["number"],fn:(t,e)=>Y(t,e),valueType:"number"},isLink:{type:["link","context"],fn:(t,e)=>Y(t,e),valueType:"link"},isNotLink:{type:["link","context"],fn:(t,e)=>!Y(t,e),valueType:"link"},isGreatThan:{type:["number"],fn:(t,e)=>me(t,e),valueType:"number"},isLessThan:{type:["number"],fn:(t,e)=>ce(t,e),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(t,e)=>!me(t,e),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(t,e)=>!ce(t,e),valueType:"number"},dateBefore:{type:["date"],fn:(t,e)=>Ne(t,e),valueType:"date"},dateAfter:{type:["date"],fn:(t,e)=>Ee(t,e),valueType:"date"},isSameDate:{type:["date"],fn:(t,e)=>Ae(t,e),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(t,e)=>qe(t,e),valueType:"none"},isExactList:{type:["option","option-multi","link-multi","context-multi","tags-multi","tags"],fn:(t,e)=>Ue(t,e),valueType:"list"},isAnyInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi","tags"],fn:(t,e)=>pe(t,e),valueType:"list"},isNoneInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi","tags"],fn:(t,e)=>!pe(t,e),valueType:"list"},isTrue:{type:["boolean"],fn:(t,e)=>t=="true",valueType:"none"},isFalse:{type:["boolean"],fn:(t,e)=>t!="true",valueType:"none"}};var Ht=(t,e)=>e.reduce((a,n)=>{let[o,i]=a,u=n.type=="path"?Le(i,n):n.type=="frontmatter"?_e(i,n):$e(i,n),d=i.filter(l=>!u.includes(l));return[[...o,...u],d]},[[],t])[0],Bt=(t,e)=>e.reduce((r,a)=>a.type=="path"?Le(r,a):a.type=="frontmatter"?_e(r,a):$e(r,a),t),_e=(t,e)=>t.filter(r=>{let a=r.metadata?.property;if(!a||!a[e.field])return!1;let n=$[e.fn],o=!0;return n&&(o=n.fn(Ye(e.field,a[e.field]),e.value)),o}),Le=(t,e)=>t.filter(r=>{let a="";e.field=="outlinks"?a=I(r.outlinks??[]):e.field=="inlinks"?a=I(r.inlinks??[]):e.field=="tags"&&(a=I(r.tags??[]));let n=$[e.fn],o=!0;return n&&(o=n.fn(a,e.value)),o}),$e=(t,e)=>t.filter(r=>{let a=$[e.fn],n=!0;return a&&(n=a.fn(r.metadata?.[e.type]?.[e.field],e.value)),n}),Qe=(t,e)=>t.reduce((a,n)=>!a||n.filters.length==0?!1:n.type=="any"?Ht([e],n.filters).length>0:Bt([e],n.filters).length>0,!0);function He(t){let{queries:e,pathsIndex:r,count:a}=t,n=[];for(let[o,i]of r)!i.hidden&&Qe(e,i)&&n.push(i);return n.slice(0,a)}var jt=self;jt.onmessage=async t=>{let{payload:e,job:r}=t.data,a;r.type=="search"&&(a=He(e));try{postMessage({job:r,result:a})}catch(n){console.log(n),postMessage({job:r,result:{$error:`Failed to run ${r.type} ${r.path}: ${n}`}})}};\n', { "name": "Superstate Search" }); } -// src/core/superstate/workers/runner.ts -var Runner = class { +// src/core/superstate/workers/search/search.ts +var Searcher = class { constructor(numWorkers, cache2) { this.numWorkers = numWorkers; this.cache = cache2; @@ -88587,7 +88681,7 @@ var Runner = class { this.reloadSet = /* @__PURE__ */ new Set(); this.callbacks = /* @__PURE__ */ new Map(); for (let index = 0; index < numWorkers; index++) { - const worker = new Worker3({ name: "Make.md Superstate Indexer " + (index + 1) }); + const worker = new Worker4({ name: "Make.md Superstate Indexer " + (index + 1) }); worker.onmessage = (evt) => this.finish(evt.data.job, evt.data.result, index); this.workers.push(worker); this.busy.push(false); @@ -88641,30 +88735,6 @@ var Runner = class { }); this.busy[workerId] = true; } - if (job.type == "table") { - this.message(workerId, { - job, - payload: { - table: job.payload.table, - paths: this.cache.pathsIndex - } - }); - this.busy[workerId] = true; - return; - } - if (job.type == "instance") { - this.message(workerId, { - job, - payload: { - root: job.payload.root, - paths: this.cache.pathsIndex, - store: job.payload.store, - context: job.payload.context - } - }); - this.busy[workerId] = true; - return; - } } message(workerId, message) { this.workers[workerId].postMessage( @@ -88743,6 +88813,7 @@ var Superstate = class { this.vaultDBCache = []; this.indexer = new Indexer(2, this); this.runner = new Runner(1, this); + this.searcher = new Searcher(1, this); } static create(indexVersion, onChange, spaceManager, uiManager, commandsManager) { return new Superstate(indexVersion, onChange, spaceManager, uiManager, commandsManager); @@ -88770,7 +88841,6 @@ var Superstate = class { await this.initializePaths(); await this.initializeContexts(); await this.initializeFrames(); - await this.initializeDefaults(); this.cleanContexts(); this.dispatchEvent("superstateUpdated", null); this.ui.notify(`Make.md - Superstate Loaded in ${(Date.now() - start) / 1e3} seconds`, "console"); @@ -88816,14 +88886,6 @@ var Superstate = class { this.templateCache.set(f2, allTemplates[f2]); }); } - initializeDefaults() { - if (this.settings.enableDefaultSpaces) { - if (this.settings.enableTagSpaces) { - this.spacesIndex.set(tagsSpace.path, tagsSpace); - this.pathsIndex.set(tagsPath.path, tagsPath); - } - } - } async initializeSpaces() { const allSpaces = [...this.spaceManager.allSpaces().values()]; const promises = allSpaces.map((f2) => this.reloadSpace(f2, null, true)); @@ -88917,7 +88979,7 @@ var Superstate = class { } async initializeTags() { const allTags = this.spaceManager.readTags().map((f2) => tagSpacePathFromTag(f2)); - const promises = allTags.map((l2) => this.reloadPath(l2, true)); + const promises = [tagsSpacePath, ...allTags].map((l2) => this.reloadPath(l2, true)); await Promise.all(promises); } async onSpaceDefinitionChanged(space2, oldDef) { @@ -89233,6 +89295,10 @@ var Superstate = class { return; const metadata = spaceMetadata ?? await this.spaceManager.spaceDefForSpace(space2.path); const type = this.spaceManager.spaceTypeByString(this.spaceManager.uriByString(space2.path)); + if (type == "default" || type == "tag") { + metadata.filters = []; + metadata.links = []; + } const spaceSort = metadata?.sort ?? { field: "rank", asc: true, group: true }; const sortable = spaceSort.field == "rank" || !spaceSort; const contexts = metadata?.contexts ?? []; @@ -89703,6 +89769,20 @@ var FilesystemSpaceAdapter = class { readPathCache(path) { const uri = this.uriByPath(path); if (uri.scheme == "spaces") { + if (path.startsWith(tagsSpacePath)) { + return { + file: null, + metadata: null, + label: { + name: "Tags", + sticker: "", + color: "" + }, + type: "space", + parent: "", + tags: [] + }; + } if (uri.authority.charAt(0) == "#") { return { file: null, @@ -89716,6 +89796,19 @@ var FilesystemSpaceAdapter = class { parent: "", tags: [] }; + } else { + return { + file: null, + metadata: null, + label: { + name: "Tags", + sticker: "", + color: "" + }, + type: "space", + parent: "", + tags: [] + }; } } return this.fileSystem.getFileCache(path); @@ -90089,14 +90182,15 @@ var FilesystemSpaceAdapter = class { this.fileSystem.deleteFileFragment(file, "property", property); } allSpaces() { + const tagSpace = this.spaceManager.spaceInfoForPath(tagsSpacePath); const getAllTagContextFiles = () => this.readTags().map((f2) => fileSystemSpaceInfoFromTag(this.spaceManager, tagPathToTag(f2))) ?? []; const getAllFolderContextFiles = () => { const folders = this.allPaths(["folder"]).filter((f2) => !f2.startsWith(this.spaceManager.superstate.settings.spacesFolder + "/#")); return folders.map((f2) => fileSystemSpaceInfoFromFolder(this.spaceManager, f2)); }; - const allTagSpaces = this.spaceManager.superstate.settings.enableTagSpaces && this.spaceManager.superstate.settings.enableDefaultSpaces ? getAllTagContextFiles() : []; + const allTagSpaces = this.spaceManager.superstate.settings.enableDefaultSpaces ? getAllTagContextFiles() : []; const allFolders = getAllFolderContextFiles(); - return [...allTagSpaces, ...allFolders]; + return [tagSpace, ...allTagSpaces, ...allFolders]; } readTags() { return this.fileSystem.allTags(); @@ -91472,7 +91566,7 @@ var STYLE_PROPS = [ ]; var SelectMenuSearch = (0, import_react12.forwardRef)( (props, input) => { - const { classNames: classNames10, inputAttributes, inputEventHandlers, index } = props; + const { classNames: classNames11, inputAttributes, inputEventHandlers, index } = props; const sizer = (0, import_react12.useRef)(null); const [inputWidth, setInputWidth] = (0, import_react12.useState)(null); const [query, setQuery] = (0, import_react12.useState)(""); @@ -91504,14 +91598,14 @@ var SelectMenuSearch = (0, import_react12.forwardRef)( } }; return /* @__PURE__ */ import_react12.default.createElement("div", { - className: classNames10.searchWrapper + className: classNames11.searchWrapper }, /* @__PURE__ */ import_react12.default.createElement("input", { ...inputAttributes, ...inputEventHandlers, ref: input, value: query, placeholder: placeholderText, - className: classNames10.searchInput, + className: classNames11.searchInput, role: "combobox", style: { width: "100%" }, onClick: (e4) => e4.stopPropagation() @@ -91755,6 +91849,7 @@ var CLASS_NAMES = { root: "mk-menu-container", rootFocused: "mk-focused", selected: "mk-menu-input-wrapper", + selectedTagWrapper: "mk-menu-selected-tag-wrapper", selectedTag: "mk-menu-selected-tag", selectedTagName: "mk-menu-selected-tag-name", search: "mk-menu-search", @@ -92027,12 +92122,12 @@ var SelectMenuComponent = import_react16.default.forwardRef( }; }, [options, index]); const expanded = focused && query.length >= props.minQueryLength; - const classNames10 = Object.assign({}, CLASS_NAMES, props.classNames); + const classNames11 = Object.assign({}, CLASS_NAMES, props.classNames); if (props.wrapperClass) { - classNames10.root = `${classNames10.root} ${props.wrapperClass}`; + classNames11.root = `${classNames11.root} ${props.wrapperClass}`; } - const rootClassNames = [classNames10.root]; - focused && rootClassNames.push(classNames10.rootFocused); + const rootClassNames = [classNames11.root]; + focused && rootClassNames.push(classNames11.rootFocused); const submenuRef = (0, import_react16.useRef)(null); const openSubmenu = (menu) => { if (submenuRef.current) { @@ -92047,23 +92142,25 @@ var SelectMenuComponent = import_react16.default.forwardRef( "--mk-menu-max-height": "200px" } : {} }, !props.suggestionsOnly ? /* @__PURE__ */ import_react16.default.createElement("div", { - className: classNames10.selected, + className: classNames11.selected, "aria-relevant": "additions removals", "aria-live": "polite" - }, /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, props.tags.map((tag2, i3) => /* @__PURE__ */ import_react16.default.createElement(SelectMenuPill_default, { + }, props.tags.length > 0 && /* @__PURE__ */ import_react16.default.createElement("div", { + className: classNames11.selectedTagWrapper + }, props.tags.map((tag2, i3) => /* @__PURE__ */ import_react16.default.createElement(SelectMenuPill_default, { key: i3, tag: tag2, - classNames: classNames10, + classNames: classNames11, onDelete: (e4) => onDeleteTag(i3, e4) }))), /* @__PURE__ */ import_react16.default.createElement("div", { - className: classNames10.search + className: classNames11.search }, /* @__PURE__ */ import_react16.default.createElement(SelectMenuInput_default, { ui: props.ui, ref: inputRef, query, index, id: props.id, - classNames: classNames10, + classNames: classNames11, inputAttributes: props.inputAttributes, inputEventHandlers, expanded, @@ -92089,7 +92186,7 @@ var SelectMenuComponent = import_react16.default.forwardRef( setIndex, index, id: props.id, - classNames: classNames10, + classNames: classNames11, expanded, selectOption: addTag2, allowNew: props.allowNew, @@ -92407,6 +92504,11 @@ var simpleSort = (a4, b2) => { return 1; return 0; }; +var linkSort = (value, filterValue) => { + const a4 = value.split("/").pop(); + const b2 = filterValue.split("/").pop(); + return simpleSort(a4, b2); +}; var stringSort = (value, filterValue) => simpleSort(value, filterValue); var numSort = (value, filterValue) => simpleSort(parseFloat(value), parseFloat(filterValue)); var boolSort = (value, filterValue) => simpleSort(value == "true" ? 1 : 0, filterValue == "true" ? 1 : 0); @@ -92418,25 +92520,37 @@ var normalizedSortForType = (type, desc) => { }; var sortFnTypes = { alphabetical: { - type: ["text", "file", "link", "context", "fileprop"], + type: ["text", "option", "tags"], fn: stringSort, label: i18n_default.sortTypes.alphaAsc, desc: false }, reverseAlphabetical: { - type: ["text", "file", "link", "context", "fileprop"], + type: ["text", "option", "tags"], fn: (v2, f2) => stringSort(v2, f2) * -1, label: i18n_default.sortTypes.alphaDesc, desc: true }, + linkAlphabetical: { + type: ["link", "context", "file", "image"], + fn: linkSort, + label: i18n_default.sortTypes.alphaAsc, + desc: false + }, + linkReverseAlphabetical: { + type: ["link", "context", "file", "image"], + fn: (v2, f2) => linkSort(v2, f2) * -1, + label: i18n_default.sortTypes.alphaDesc, + desc: true + }, earliest: { - type: ["date", "fileprop"], + type: ["date"], fn: stringSort, label: i18n_default.sortTypes.earliest, desc: false }, latest: { - type: ["date", "fileprop"], + type: ["date"], fn: (v2, f2) => stringSort(v2, f2) * -1, label: i18n_default.sortTypes.latest, desc: true @@ -92454,19 +92568,19 @@ var sortFnTypes = { desc: true }, number: { - type: ["number", "fileprop"], + type: ["number"], fn: numSort, label: "1 \u2192 9", desc: false }, reverseNumber: { - type: ["number", "fileprop"], + type: ["number"], fn: (v2, f2) => numSort(v2, f2) * -1, label: "9 \u2192 1", desc: true }, count: { - type: ["option-multi", "context-multi", "link-multi"], + type: ["option-multi", "context-multi", "link-multi", "tag"], fn: countSort, label: i18n_default.sortTypes.itemsDesc, desc: true @@ -92645,10 +92759,10 @@ var ContextMDBProvider = (props) => { }; if (table.id == dbSchema?.id) { setActiveSchema(table); - setTableData((f2) => ({ - ...f2, + updateTable({ + ...tableData, schema: table - })); + }); } setSchemaTable(newSchemaTable); }; @@ -92715,6 +92829,8 @@ var ContextMDBProvider = (props) => { const schemas2 = await props.superstate.spaceManager.tablesForSpace( spaceInfo.path ); + if (dbSchema) + retrieveCachedTable(dbSchema); if (schemas2) setSchemaTable(() => ({ ...defaultSchema, @@ -92737,10 +92853,14 @@ var ContextMDBProvider = (props) => { loadContextFields(c3); } } - setTableData(f2); + updateTable(f2); } }); }; + const updateTable = (newTable) => { + setTableData(newTable); + calculateTableData(newTable); + }; (0, import_react22.useEffect)(() => { const refreshMDB = (payload) => { if (dbSchema?.primary != "true") { @@ -92798,13 +92918,15 @@ var ContextMDBProvider = (props) => { if (spaceInfo.readOnly) return; await props.superstate.spaceManager.saveTable(spaceInfo.path, newTable, true).then((f2) => { - setTableData(newTable); + updateTable(newTable); }); }; const setActiveSchema = (schema) => { if (schema) { + if (schema.id != dbSchema?.id) { + retrieveCachedTable(schema); + } setDBSchema(schema); - retrieveCachedTable(schema); } }; const cols = (0, import_react22.useMemo)( @@ -92818,9 +92940,9 @@ var ContextMDBProvider = (props) => { [] ) : [] ] : [], - [tableData, contextTable, contexts] + [tableData, contextTable, contexts, dbSchema] ); - const calculateTableData = (newTable) => { + const calculateTableData = async (newTable) => { if (dbSchema) props.superstate.runner.run({ type: "table", @@ -92830,13 +92952,12 @@ var ContextMDBProvider = (props) => { if (import_lodash9.default.isEqual(g, data2)) return; if (g) { - setData(g); + setTableData({ ...newTable, rows: g }); } }); }; - const [data2, setData] = (0, import_react22.useState)([]); - (0, import_react22.useEffect)(() => { - const rows = tableData?.rows.map((r2, index) => ({ + const data2 = (0, import_react22.useMemo)( + () => tableData?.rows.map((r2, index) => ({ _index: index.toString(), ...r2, ...r2[PathPropertyName] ? { @@ -92857,10 +92978,9 @@ var ContextMDBProvider = (props) => { }); return { ...p, ...contextRowsWithKeysAppended }; }, {}) - })) ?? []; - setData(rows); - calculateTableData({ rows, cols, schema: dbSchema }); - }, [tableData, contextTable]); + })) ?? [], + [tableData, contextTable, cols, dbSchema, spaceCache] + ); (0, import_react22.useEffect)(() => { if (tableData) { for (const c3 of contexts) { @@ -93193,7 +93313,7 @@ var ContextEditorContext = (0, import_react24.createContext)({ selectedRows: [], selectRows: () => null, setContextTable: () => null, - predicate: defaultPredicate, + predicate: null, savePredicate: () => null, hideColumn: () => null, saveColumn: () => false, @@ -93219,7 +93339,7 @@ var ContextEditorProvider = (props) => { } = (0, import_react24.useContext)(ContextMDBContext); const { frameSchemas, saveSchema, frameSchema } = (0, import_react24.useContext)(FramesMDBContext); const [searchString, setSearchString] = (0, import_react24.useState)(null); - const [predicate, setPredicate] = (0, import_react24.useState)(defaultPredicate); + const [predicate, setPredicate] = (0, import_react24.useState)(null); const [selectedRows, setSelectedRows] = (0, import_react24.useState)([]); const [editMode, setEditMode] = (0, import_react24.useState)(0); const views = (0, import_react24.useMemo)(() => { @@ -93230,14 +93350,14 @@ var ContextEditorProvider = (props) => { }, [frameSchemas, frameSchema, dbSchema]); const sortedColumns = (0, import_react24.useMemo)(() => { return cols.filter( - (f2) => f2.hidden != "true" && !predicate.colsHidden.some((c3) => c3 == f2.name + f2.table) + (f2) => f2.hidden != "true" && (predicate?.colsOrder ?? []).some((c3) => c3 == f2.name + f2.table) ).sort( - (a4, b2) => predicate.colsOrder.findIndex((x2) => x2 == a4.name + a4.table) - predicate.colsOrder.findIndex((x2) => x2 == b2.name + b2.table) + (a4, b2) => (predicate?.colsOrder ?? []).findIndex((x2) => x2 == a4.name + a4.table) - (predicate?.colsOrder ?? []).findIndex((x2) => x2 == b2.name + b2.table) ); }, [cols, predicate]); const filteredData = (0, import_react24.useMemo)( () => data2.filter((f2) => { - return predicate.filters.reduce((p, c3) => { + return (predicate?.filters ?? []).reduce((p, c3) => { return p ? filterReturnForCol( cols.find((col) => col.name + col.table == c3.field), c3, @@ -93249,7 +93369,7 @@ var ContextEditorProvider = (props) => { Object.keys(f2).filter((g) => g.charAt(0) != "_").map((g) => f2[g]).join("|") ) : true ).sort((a4, b2) => { - return predicate.sort.reduce((p, c3) => { + return (predicate?.sort ?? []).reduce((p, c3) => { return p == 0 ? sortReturnForCol( cols.find((col) => col.name + col.table == c3.field), c3, @@ -93298,13 +93418,11 @@ var ContextEditorProvider = (props) => { }; const sortColumn = (sort) => { savePredicate({ - ...predicate, sort: [sort] }); }; const hideColumn = (col, hidden) => { savePredicate({ - ...predicate, colsHidden: hidden ? [ ...predicate.colsHidden.filter((s4) => s4 != col.name + col.table), col.name + col.table @@ -93417,14 +93535,19 @@ var ContextEditorProvider = (props) => { if (!(dbSchema?.primary == "true")) return; if (lastSelected) { - const path = tableData.rows[parseInt(lastSelected)][PathPropertyName]; - props.superstate.ui.setActivePath(path); + const path = tableData.rows[parseInt(lastSelected)]?.[PathPropertyName]; + if (path) + props.superstate.ui.setActivePath(path); } else { props.superstate.ui.setActivePath(spaceInfo.path); } }; const savePredicate = (newPredicate) => { - const cleanedPredicate = validatePredicate(newPredicate); + const pred = { + ...predicate ?? defaultPredicate, + ...newPredicate + }; + const cleanedPredicate = validatePredicate(pred); if (frameSchema) { saveSchema({ ...frameSchema, @@ -93445,17 +93568,24 @@ var ContextEditorProvider = (props) => { setPredicate(cleanedPredicate); }; (0, import_react24.useEffect)(() => { - setPredicate((p) => ({ - ...p, + if (predicate) + setPredicate((p) => ({ + ...p, + colsOrder: uniq([ + ...p.colsOrder, + ...cols.filter((f2) => f2.hidden != "true").map((c3) => c3.name + c3.table) + ]) + })); + }, [cols]); + const parsePredicate = (predicateStr) => { + const newPredicate = validatePredicate(safelyParseJSON(predicateStr)); + setPredicate({ + ...newPredicate, colsOrder: uniq([ - ...p.colsOrder, + ...newPredicate.colsOrder, ...cols.filter((f2) => f2.hidden != "true").map((c3) => c3.name + c3.table) ]) - })); - }, [cols]); - const parsePredicate = (predicateStr) => { - const newPredicate = safelyParseJSON(predicateStr); - setPredicate(validatePredicate(newPredicate)); + }); }; const delColumn = (column) => { let mdbtable; @@ -93524,18 +93654,13 @@ var ContextEditorProvider = (props) => { }; if (oldColumn) savePredicate({ - view: predicate.view, - listItem: predicate.listItem, - frameProps: predicate.frameProps, - listGroup: predicate.listGroup, - listView: predicate.listView, - filters: predicate.filters.map( + filters: (predicate?.filters ?? []).map( (f2) => f2.field == oldColumn.name + oldColumn.table ? { ...f2, field: column.name + column.table } : f2 ), - sort: predicate.sort.map( + sort: (predicate?.sort ?? []).map( (f2) => f2.field == oldColumn.name + oldColumn.table ? { ...f2, field: column.name + column.table } : f2 ), - groupBy: predicate.groupBy.map( + groupBy: (predicate?.groupBy ?? []).map( (f2) => f2 == oldColumn.name + oldColumn.table ? column.name + column.table : f2 ), colsHidden: predicate.colsHidden.map( @@ -96328,6 +96453,48 @@ function groupBy(rows, columnId) { return map2; }, groupMap); } +function getPaginationRowModel(opts) { + return (table) => memo2(() => [table.getState().pagination, table.getPrePaginationRowModel(), table.options.paginateExpandedRows ? void 0 : table.getState().expanded], (pagination, rowModel) => { + if (!rowModel.rows.length) { + return rowModel; + } + const { + pageSize, + pageIndex + } = pagination; + let { + rows, + flatRows, + rowsById + } = rowModel; + const pageStart = pageSize * pageIndex; + const pageEnd = pageStart + pageSize; + rows = rows.slice(pageStart, pageEnd); + let paginatedRowModel; + if (!table.options.paginateExpandedRows) { + paginatedRowModel = expandRows({ + rows, + flatRows, + rowsById + }); + } else { + paginatedRowModel = { + rows, + flatRows, + rowsById + }; + } + paginatedRowModel.flatRows = []; + const handleRow = (row) => { + paginatedRowModel.flatRows.push(row); + if (row.subRows.length) { + row.subRows.forEach(handleRow); + } + }; + paginatedRowModel.rows.forEach(handleRow); + return paginatedRowModel; + }, getMemoOptions(table.options, "debugTable", "getPaginationRowModel")); +} // node_modules/@tanstack/react-table/build/lib/index.mjs function flexRender(Comp, props) { @@ -96373,7 +96540,7 @@ function useReactTable(options) { } // src/core/react/components/SpaceView/Contexts/TableView/TableView.tsx -var import_react72 = __toESM(require_react()); +var import_react73 = __toESM(require_react()); var import_react_dom4 = __toESM(require_react_dom()); // src/core/react/components/SpaceView/Contexts/DataTypeView/BooleanCell.tsx @@ -96565,7 +96732,7 @@ var PathCrumb = (props) => { }, cache2 && /* @__PURE__ */ import_react27.default.createElement(PathStickerView, { superstate: props.superstate, pathState: cache2 - }), (!props.hideName && cache2?.displayName) ?? path, props.children); + }), /* @__PURE__ */ import_react27.default.createElement("span", null, (!props.hideName && cache2?.displayName) ?? path), props.children); }; // src/core/react/components/SpaceView/Contexts/DataTypeView/ContextCell.tsx @@ -97120,7 +97287,7 @@ var labels = /* @__PURE__ */ Object.freeze({ }); function getDefaultContextValues() { var captionLayout = "buttons"; - var classNames10 = defaultClassNames; + var classNames11 = defaultClassNames; var locale2 = en_US_default; var modifiersClassNames = {}; var modifiers = {}; @@ -97129,7 +97296,7 @@ function getDefaultContextValues() { var today = new Date(); return { captionLayout, - classNames: classNames10, + classNames: classNames11, formatters: formatters3, labels, locale: locale2, @@ -97184,8 +97351,8 @@ function useDayPicker() { return context; } function CaptionLabel(props) { - var _a = useDayPicker(), locale2 = _a.locale, classNames10 = _a.classNames, styles2 = _a.styles, formatCaption2 = _a.formatters.formatCaption; - return jsxRuntimeExports.jsx("div", { className: classNames10.caption_label, style: styles2.caption_label, "aria-live": "polite", role: "presentation", id: props.id, children: formatCaption2(props.displayMonth, { locale: locale2 }) }); + var _a = useDayPicker(), locale2 = _a.locale, classNames11 = _a.classNames, styles2 = _a.styles, formatCaption2 = _a.formatters.formatCaption; + return jsxRuntimeExports.jsx("div", { className: classNames11.caption_label, style: styles2.caption_label, "aria-live": "polite", role: "presentation", id: props.id, children: formatCaption2(props.displayMonth, { locale: locale2 }) }); } function IconDropdown(props) { return jsxRuntimeExports.jsx("svg", __assign({ width: "8px", height: "8px", viewBox: "0 0 120 120", "data-testid": "iconDropdown" }, props, { children: jsxRuntimeExports.jsx("path", { d: "M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z", fill: "currentColor", fillRule: "nonzero" }) })); @@ -97199,7 +97366,7 @@ function Dropdown(props) { } function MonthsDropdown(props) { var _a; - var _b = useDayPicker(), fromDate = _b.fromDate, toDate2 = _b.toDate, styles2 = _b.styles, locale2 = _b.locale, formatMonthCaption2 = _b.formatters.formatMonthCaption, classNames10 = _b.classNames, components = _b.components, labelMonthDropdown2 = _b.labels.labelMonthDropdown; + var _b = useDayPicker(), fromDate = _b.fromDate, toDate2 = _b.toDate, styles2 = _b.styles, locale2 = _b.locale, formatMonthCaption2 = _b.formatters.formatMonthCaption, classNames11 = _b.classNames, components = _b.components, labelMonthDropdown2 = _b.labels.labelMonthDropdown; if (!fromDate) return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}); if (!toDate2) @@ -97222,14 +97389,14 @@ function MonthsDropdown(props) { props.onChange(newMonth); }; var DropdownComponent2 = (_a = components === null || components === void 0 ? void 0 : components.Dropdown) !== null && _a !== void 0 ? _a : Dropdown; - return jsxRuntimeExports.jsx(DropdownComponent2, { name: "months", "aria-label": labelMonthDropdown2(), className: classNames10.dropdown_month, style: styles2.dropdown_month, onChange: handleChange, value: props.displayMonth.getMonth(), caption: formatMonthCaption2(props.displayMonth, { locale: locale2 }), children: dropdownMonths.map(function(m4) { + return jsxRuntimeExports.jsx(DropdownComponent2, { name: "months", "aria-label": labelMonthDropdown2(), className: classNames11.dropdown_month, style: styles2.dropdown_month, onChange: handleChange, value: props.displayMonth.getMonth(), caption: formatMonthCaption2(props.displayMonth, { locale: locale2 }), children: dropdownMonths.map(function(m4) { return jsxRuntimeExports.jsx("option", { value: m4.getMonth(), children: formatMonthCaption2(m4, { locale: locale2 }) }, m4.getMonth()); }) }); } function YearsDropdown(props) { var _a; var displayMonth = props.displayMonth; - var _b = useDayPicker(), fromDate = _b.fromDate, toDate2 = _b.toDate, locale2 = _b.locale, styles2 = _b.styles, classNames10 = _b.classNames, components = _b.components, formatYearCaption2 = _b.formatters.formatYearCaption, labelYearDropdown2 = _b.labels.labelYearDropdown; + var _b = useDayPicker(), fromDate = _b.fromDate, toDate2 = _b.toDate, locale2 = _b.locale, styles2 = _b.styles, classNames11 = _b.classNames, components = _b.components, formatYearCaption2 = _b.formatters.formatYearCaption, labelYearDropdown2 = _b.labels.labelYearDropdown; var years = []; if (!fromDate) return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}); @@ -97245,7 +97412,7 @@ function YearsDropdown(props) { props.onChange(newMonth); }; var DropdownComponent2 = (_a = components === null || components === void 0 ? void 0 : components.Dropdown) !== null && _a !== void 0 ? _a : Dropdown; - return jsxRuntimeExports.jsx(DropdownComponent2, { name: "years", "aria-label": labelYearDropdown2(), className: classNames10.dropdown_year, style: styles2.dropdown_year, onChange: handleChange, value: displayMonth.getFullYear(), caption: formatYearCaption2(displayMonth, { locale: locale2 }), children: years.map(function(year2) { + return jsxRuntimeExports.jsx(DropdownComponent2, { name: "years", "aria-label": labelYearDropdown2(), className: classNames11.dropdown_year, style: styles2.dropdown_year, onChange: handleChange, value: displayMonth.getFullYear(), caption: formatYearCaption2(displayMonth, { locale: locale2 }), children: years.map(function(year2) { return jsxRuntimeExports.jsx("option", { value: year2.getFullYear(), children: formatYearCaption2(year2, { locale: locale2 }) }, year2.getFullYear()); }) }); } @@ -97369,14 +97536,14 @@ function useNavigation() { } function CaptionDropdowns(props) { var _a; - var _b = useDayPicker(), classNames10 = _b.classNames, styles2 = _b.styles, components = _b.components; + var _b = useDayPicker(), classNames11 = _b.classNames, styles2 = _b.styles, components = _b.components; var goToMonth = useNavigation().goToMonth; var handleMonthChange = function(newMonth) { goToMonth(addMonths(newMonth, props.displayIndex ? -props.displayIndex : 0)); }; var CaptionLabelComponent = (_a = components === null || components === void 0 ? void 0 : components.CaptionLabel) !== null && _a !== void 0 ? _a : CaptionLabel; var captionLabel = jsxRuntimeExports.jsx(CaptionLabelComponent, { id: props.id, displayMonth: props.displayMonth }); - return jsxRuntimeExports.jsxs("div", { className: classNames10.caption_dropdowns, style: styles2.caption_dropdowns, children: [jsxRuntimeExports.jsx("div", { className: classNames10.vhidden, children: captionLabel }), jsxRuntimeExports.jsx(MonthsDropdown, { onChange: handleMonthChange, displayMonth: props.displayMonth }), jsxRuntimeExports.jsx(YearsDropdown, { onChange: handleMonthChange, displayMonth: props.displayMonth })] }); + return jsxRuntimeExports.jsxs("div", { className: classNames11.caption_dropdowns, style: styles2.caption_dropdowns, children: [jsxRuntimeExports.jsx("div", { className: classNames11.vhidden, children: captionLabel }), jsxRuntimeExports.jsx(MonthsDropdown, { onChange: handleMonthChange, displayMonth: props.displayMonth }), jsxRuntimeExports.jsx(YearsDropdown, { onChange: handleMonthChange, displayMonth: props.displayMonth })] }); } function IconLeft(props) { return jsxRuntimeExports.jsx("svg", __assign({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, props, { children: jsxRuntimeExports.jsx("path", { d: "M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z", fill: "currentColor", fillRule: "nonzero" }) })); @@ -97385,8 +97552,8 @@ function IconRight(props) { return jsxRuntimeExports.jsx("svg", __assign({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, props, { children: jsxRuntimeExports.jsx("path", { d: "M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z", fill: "currentColor" }) })); } var Button = (0, import_react30.forwardRef)(function(props, ref2) { - var _a = useDayPicker(), classNames10 = _a.classNames, styles2 = _a.styles; - var classNamesArr = [classNames10.button_reset, classNames10.button]; + var _a = useDayPicker(), classNames11 = _a.classNames, styles2 = _a.styles; + var classNamesArr = [classNames11.button_reset, classNames11.button]; if (props.className) { classNamesArr.push(props.className); } @@ -97399,23 +97566,23 @@ var Button = (0, import_react30.forwardRef)(function(props, ref2) { }); function Navigation(props) { var _a, _b; - var _c = useDayPicker(), dir = _c.dir, locale2 = _c.locale, classNames10 = _c.classNames, styles2 = _c.styles, _d = _c.labels, labelPrevious2 = _d.labelPrevious, labelNext2 = _d.labelNext, components = _c.components; + var _c = useDayPicker(), dir = _c.dir, locale2 = _c.locale, classNames11 = _c.classNames, styles2 = _c.styles, _d = _c.labels, labelPrevious2 = _d.labelPrevious, labelNext2 = _d.labelNext, components = _c.components; if (!props.nextMonth && !props.previousMonth) { return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}); } var previousLabel = labelPrevious2(props.previousMonth, { locale: locale2 }); var previousClassName = [ - classNames10.nav_button, - classNames10.nav_button_previous + classNames11.nav_button, + classNames11.nav_button_previous ].join(" "); var nextLabel = labelNext2(props.nextMonth, { locale: locale2 }); var nextClassName = [ - classNames10.nav_button, - classNames10.nav_button_next + classNames11.nav_button, + classNames11.nav_button_next ].join(" "); var IconRightComponent = (_a = components === null || components === void 0 ? void 0 : components.IconRight) !== null && _a !== void 0 ? _a : IconRight; var IconLeftComponent = (_b = components === null || components === void 0 ? void 0 : components.IconLeft) !== null && _b !== void 0 ? _b : IconLeft; - return jsxRuntimeExports.jsxs("div", { className: classNames10.nav, style: styles2.nav, children: [!props.hidePrevious && jsxRuntimeExports.jsx(Button, { name: "previous-month", "aria-label": previousLabel, className: previousClassName, style: styles2.nav_button_previous, disabled: !props.previousMonth, onClick: props.onPreviousClick, children: dir === "rtl" ? jsxRuntimeExports.jsx(IconRightComponent, { className: classNames10.nav_icon, style: styles2.nav_icon }) : jsxRuntimeExports.jsx(IconLeftComponent, { className: classNames10.nav_icon, style: styles2.nav_icon }) }), !props.hideNext && jsxRuntimeExports.jsx(Button, { name: "next-month", "aria-label": nextLabel, className: nextClassName, style: styles2.nav_button_next, disabled: !props.nextMonth, onClick: props.onNextClick, children: dir === "rtl" ? jsxRuntimeExports.jsx(IconLeftComponent, { className: classNames10.nav_icon, style: styles2.nav_icon }) : jsxRuntimeExports.jsx(IconRightComponent, { className: classNames10.nav_icon, style: styles2.nav_icon }) })] }); + return jsxRuntimeExports.jsxs("div", { className: classNames11.nav, style: styles2.nav, children: [!props.hidePrevious && jsxRuntimeExports.jsx(Button, { name: "previous-month", "aria-label": previousLabel, className: previousClassName, style: styles2.nav_button_previous, disabled: !props.previousMonth, onClick: props.onPreviousClick, children: dir === "rtl" ? jsxRuntimeExports.jsx(IconRightComponent, { className: classNames11.nav_icon, style: styles2.nav_icon }) : jsxRuntimeExports.jsx(IconLeftComponent, { className: classNames11.nav_icon, style: styles2.nav_icon }) }), !props.hideNext && jsxRuntimeExports.jsx(Button, { name: "next-month", "aria-label": nextLabel, className: nextClassName, style: styles2.nav_button_next, disabled: !props.nextMonth, onClick: props.onNextClick, children: dir === "rtl" ? jsxRuntimeExports.jsx(IconLeftComponent, { className: classNames11.nav_icon, style: styles2.nav_icon }) : jsxRuntimeExports.jsx(IconRightComponent, { className: classNames11.nav_icon, style: styles2.nav_icon }) })] }); } function CaptionNavigation(props) { var numberOfMonths = useDayPicker().numberOfMonths; @@ -97441,7 +97608,7 @@ function CaptionNavigation(props) { } function Caption(props) { var _a; - var _b = useDayPicker(), classNames10 = _b.classNames, disableNavigation = _b.disableNavigation, styles2 = _b.styles, captionLayout = _b.captionLayout, components = _b.components; + var _b = useDayPicker(), classNames11 = _b.classNames, disableNavigation = _b.disableNavigation, styles2 = _b.styles, captionLayout = _b.captionLayout, components = _b.components; var CaptionLabelComponent = (_a = components === null || components === void 0 ? void 0 : components.CaptionLabel) !== null && _a !== void 0 ? _a : CaptionLabel; var caption; if (disableNavigation) { @@ -97453,7 +97620,7 @@ function Caption(props) { } else { caption = jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(CaptionLabelComponent, { id: props.id, displayMonth: props.displayMonth, displayIndex: props.displayIndex }), jsxRuntimeExports.jsx(CaptionNavigation, { displayMonth: props.displayMonth, id: props.id })] }); } - return jsxRuntimeExports.jsx("div", { className: classNames10.caption, style: styles2.caption, children: caption }); + return jsxRuntimeExports.jsx("div", { className: classNames11.caption, style: styles2.caption, children: caption }); } function Footer(props) { var _a = useDayPicker(), footer = _a.footer, styles2 = _a.styles, tfoot = _a.classNames.tfoot; @@ -97471,17 +97638,17 @@ function getWeekdays(locale2, weekStartsOn, ISOWeek) { return days; } function HeadRow() { - var _a = useDayPicker(), classNames10 = _a.classNames, styles2 = _a.styles, showWeekNumber = _a.showWeekNumber, locale2 = _a.locale, weekStartsOn = _a.weekStartsOn, ISOWeek = _a.ISOWeek, formatWeekdayName2 = _a.formatters.formatWeekdayName, labelWeekday2 = _a.labels.labelWeekday; + var _a = useDayPicker(), classNames11 = _a.classNames, styles2 = _a.styles, showWeekNumber = _a.showWeekNumber, locale2 = _a.locale, weekStartsOn = _a.weekStartsOn, ISOWeek = _a.ISOWeek, formatWeekdayName2 = _a.formatters.formatWeekdayName, labelWeekday2 = _a.labels.labelWeekday; var weekdays = getWeekdays(locale2, weekStartsOn, ISOWeek); - return jsxRuntimeExports.jsxs("tr", { style: styles2.head_row, className: classNames10.head_row, children: [showWeekNumber && jsxRuntimeExports.jsx("td", { style: styles2.head_cell, className: classNames10.head_cell }), weekdays.map(function(weekday, i3) { - return jsxRuntimeExports.jsx("th", { scope: "col", className: classNames10.head_cell, style: styles2.head_cell, "aria-label": labelWeekday2(weekday, { locale: locale2 }), children: formatWeekdayName2(weekday, { locale: locale2 }) }, i3); + return jsxRuntimeExports.jsxs("tr", { style: styles2.head_row, className: classNames11.head_row, children: [showWeekNumber && jsxRuntimeExports.jsx("td", { style: styles2.head_cell, className: classNames11.head_cell }), weekdays.map(function(weekday, i3) { + return jsxRuntimeExports.jsx("th", { scope: "col", className: classNames11.head_cell, style: styles2.head_cell, "aria-label": labelWeekday2(weekday, { locale: locale2 }), children: formatWeekdayName2(weekday, { locale: locale2 }) }, i3); })] }); } function Head() { var _a; - var _b = useDayPicker(), classNames10 = _b.classNames, styles2 = _b.styles, components = _b.components; + var _b = useDayPicker(), classNames11 = _b.classNames, styles2 = _b.styles, components = _b.components; var HeadRowComponent = (_a = components === null || components === void 0 ? void 0 : components.HeadRow) !== null && _a !== void 0 ? _a : HeadRow; - return jsxRuntimeExports.jsx("thead", { style: styles2.head, className: classNames10.head, children: jsxRuntimeExports.jsx(HeadRowComponent, {}) }); + return jsxRuntimeExports.jsx("thead", { style: styles2.head, className: classNames11.head, children: jsxRuntimeExports.jsx(HeadRowComponent, {}) }); } function DayContent(props) { var _a = useDayPicker(), locale2 = _a.locale, formatDay2 = _a.formatters.formatDay; @@ -98187,19 +98354,19 @@ function isInternalModifier(modifier) { return Object.values(InternalModifier).includes(modifier); } function getDayClassNames(dayPicker, activeModifiers) { - var classNames10 = [dayPicker.classNames.day]; + var classNames11 = [dayPicker.classNames.day]; Object.keys(activeModifiers).forEach(function(modifier) { var customClassName = dayPicker.modifiersClassNames[modifier]; if (customClassName) { - classNames10.push(customClassName); + classNames11.push(customClassName); } else if (isInternalModifier(modifier)) { var internalClassName = dayPicker.classNames["day_".concat(modifier)]; if (internalClassName) { - classNames10.push(internalClassName); + classNames11.push(internalClassName); } } }); - return classNames10; + return classNames11; } function getDayStyle(dayPicker, activeModifiers) { var style = __assign({}, dayPicker.styles.day); @@ -98273,28 +98440,28 @@ function Day(props) { } function WeekNumber(props) { var weekNumber = props.number, dates = props.dates; - var _a = useDayPicker(), onWeekNumberClick = _a.onWeekNumberClick, styles2 = _a.styles, classNames10 = _a.classNames, locale2 = _a.locale, labelWeekNumber2 = _a.labels.labelWeekNumber, formatWeekNumber2 = _a.formatters.formatWeekNumber; + var _a = useDayPicker(), onWeekNumberClick = _a.onWeekNumberClick, styles2 = _a.styles, classNames11 = _a.classNames, locale2 = _a.locale, labelWeekNumber2 = _a.labels.labelWeekNumber, formatWeekNumber2 = _a.formatters.formatWeekNumber; var content3 = formatWeekNumber2(Number(weekNumber), { locale: locale2 }); if (!onWeekNumberClick) { - return jsxRuntimeExports.jsx("span", { className: classNames10.weeknumber, style: styles2.weeknumber, children: content3 }); + return jsxRuntimeExports.jsx("span", { className: classNames11.weeknumber, style: styles2.weeknumber, children: content3 }); } var label = labelWeekNumber2(Number(weekNumber), { locale: locale2 }); var handleClick = function(e4) { onWeekNumberClick(weekNumber, dates, e4); }; - return jsxRuntimeExports.jsx(Button, { name: "week-number", "aria-label": label, className: classNames10.weeknumber, style: styles2.weeknumber, onClick: handleClick, children: content3 }); + return jsxRuntimeExports.jsx(Button, { name: "week-number", "aria-label": label, className: classNames11.weeknumber, style: styles2.weeknumber, onClick: handleClick, children: content3 }); } function Row(props) { var _a, _b; - var _c = useDayPicker(), styles2 = _c.styles, classNames10 = _c.classNames, showWeekNumber = _c.showWeekNumber, components = _c.components; + var _c = useDayPicker(), styles2 = _c.styles, classNames11 = _c.classNames, showWeekNumber = _c.showWeekNumber, components = _c.components; var DayComponent = (_a = components === null || components === void 0 ? void 0 : components.Day) !== null && _a !== void 0 ? _a : Day; var WeeknumberComponent = (_b = components === null || components === void 0 ? void 0 : components.WeekNumber) !== null && _b !== void 0 ? _b : WeekNumber; var weekNumberCell; if (showWeekNumber) { - weekNumberCell = jsxRuntimeExports.jsx("td", { className: classNames10.cell, style: styles2.cell, children: jsxRuntimeExports.jsx(WeeknumberComponent, { number: props.weekNumber, dates: props.dates }) }); + weekNumberCell = jsxRuntimeExports.jsx("td", { className: classNames11.cell, style: styles2.cell, children: jsxRuntimeExports.jsx(WeeknumberComponent, { number: props.weekNumber, dates: props.dates }) }); } - return jsxRuntimeExports.jsxs("tr", { className: classNames10.row, style: styles2.row, children: [weekNumberCell, props.dates.map(function(date) { - return jsxRuntimeExports.jsx("td", { className: classNames10.cell, style: styles2.cell, role: "presentation", children: jsxRuntimeExports.jsx(DayComponent, { displayMonth: props.displayMonth, date }) }, getUnixTime(date)); + return jsxRuntimeExports.jsxs("tr", { className: classNames11.row, style: styles2.row, children: [weekNumberCell, props.dates.map(function(date) { + return jsxRuntimeExports.jsx("td", { className: classNames11.cell, style: styles2.cell, role: "presentation", children: jsxRuntimeExports.jsx(DayComponent, { displayMonth: props.displayMonth, date }) }, getUnixTime(date)); })] }); } function daysToMonthWeeks(fromDate, toDate2, options) { @@ -98338,7 +98505,7 @@ function getMonthWeeks(month, options) { } function Table(props) { var _a, _b, _c; - var _d = useDayPicker(), locale2 = _d.locale, classNames10 = _d.classNames, styles2 = _d.styles, hideHead = _d.hideHead, fixedWeeks = _d.fixedWeeks, components = _d.components, weekStartsOn = _d.weekStartsOn, firstWeekContainsDate = _d.firstWeekContainsDate, ISOWeek = _d.ISOWeek; + var _d = useDayPicker(), locale2 = _d.locale, classNames11 = _d.classNames, styles2 = _d.styles, hideHead = _d.hideHead, fixedWeeks = _d.fixedWeeks, components = _d.components, weekStartsOn = _d.weekStartsOn, firstWeekContainsDate = _d.firstWeekContainsDate, ISOWeek = _d.ISOWeek; var weeks = getMonthWeeks(props.displayMonth, { useFixedWeeks: Boolean(fixedWeeks), ISOWeek, @@ -98349,7 +98516,7 @@ function Table(props) { var HeadComponent = (_a = components === null || components === void 0 ? void 0 : components.Head) !== null && _a !== void 0 ? _a : Head; var RowComponent = (_b = components === null || components === void 0 ? void 0 : components.Row) !== null && _b !== void 0 ? _b : Row; var FooterComponent = (_c = components === null || components === void 0 ? void 0 : components.Footer) !== null && _c !== void 0 ? _c : Footer; - return jsxRuntimeExports.jsxs("table", { id: props.id, className: classNames10.table, style: styles2.table, role: "grid", "aria-labelledby": props["aria-labelledby"], children: [!hideHead && jsxRuntimeExports.jsx(HeadComponent, {}), jsxRuntimeExports.jsx("tbody", { className: classNames10.tbody, style: styles2.tbody, children: weeks.map(function(week) { + return jsxRuntimeExports.jsxs("table", { id: props.id, className: classNames11.table, style: styles2.table, role: "grid", "aria-labelledby": props["aria-labelledby"], children: [!hideHead && jsxRuntimeExports.jsx(HeadComponent, {}), jsxRuntimeExports.jsx("tbody", { className: classNames11.tbody, style: styles2.tbody, children: weeks.map(function(week) { return jsxRuntimeExports.jsx(RowComponent, { displayMonth: props.displayMonth, dates: week.dates, weekNumber: week.weekNumber }, week.weekNumber); }) }), jsxRuntimeExports.jsx(FooterComponent, { displayMonth: props.displayMonth })] }); } @@ -98382,11 +98549,11 @@ function Month(props) { var _a; var _b; var dayPicker = useDayPicker(); - var dir = dayPicker.dir, classNames10 = dayPicker.classNames, styles2 = dayPicker.styles, components = dayPicker.components; + var dir = dayPicker.dir, classNames11 = dayPicker.classNames, styles2 = dayPicker.styles, components = dayPicker.components; var displayMonths = useNavigation().displayMonths; var captionId = useId(dayPicker.id ? "".concat(dayPicker.id, "-").concat(props.displayIndex) : void 0); var tableId = dayPicker.id ? "".concat(dayPicker.id, "-grid-").concat(props.displayIndex) : void 0; - var className = [classNames10.month]; + var className = [classNames11.month]; var style = styles2.month; var isStart = props.displayIndex === 0; var isEnd = props.displayIndex === displayMonths.length - 1; @@ -98395,23 +98562,23 @@ function Month(props) { _a = [isStart, isEnd], isEnd = _a[0], isStart = _a[1]; } if (isStart) { - className.push(classNames10.caption_start); + className.push(classNames11.caption_start); style = __assign(__assign({}, style), styles2.caption_start); } if (isEnd) { - className.push(classNames10.caption_end); + className.push(classNames11.caption_end); style = __assign(__assign({}, style), styles2.caption_end); } if (isCenter) { - className.push(classNames10.caption_between); + className.push(classNames11.caption_between); style = __assign(__assign({}, style), styles2.caption_between); } var CaptionComponent = (_b = components === null || components === void 0 ? void 0 : components.Caption) !== null && _b !== void 0 ? _b : Caption; return jsxRuntimeExports.jsxs("div", { className: className.join(" "), style, children: [jsxRuntimeExports.jsx(CaptionComponent, { id: captionId, displayMonth: props.displayMonth, displayIndex: props.displayIndex }), jsxRuntimeExports.jsx(Table, { id: tableId, "aria-labelledby": captionId, displayMonth: props.displayMonth })] }, props.displayIndex); } function Months(props) { - var _a = useDayPicker(), classNames10 = _a.classNames, styles2 = _a.styles; - return jsxRuntimeExports.jsx("div", { className: classNames10.months, style: styles2.months, children: props.children }); + var _a = useDayPicker(), classNames11 = _a.classNames, styles2 = _a.styles; + return jsxRuntimeExports.jsx("div", { className: classNames11.months, style: styles2.months, children: props.children }); } function Root(_a) { var _b, _c; @@ -98436,12 +98603,12 @@ function Root(_a) { focusContext.focusTarget, focusContext ]); - var classNames10 = [dayPicker.classNames.root, dayPicker.className]; + var classNames11 = [dayPicker.classNames.root, dayPicker.className]; if (dayPicker.numberOfMonths > 1) { - classNames10.push(dayPicker.classNames.multiple_months); + classNames11.push(dayPicker.classNames.multiple_months); } if (dayPicker.showWeekNumber) { - classNames10.push(dayPicker.classNames.with_weeknumber); + classNames11.push(dayPicker.classNames.with_weeknumber); } var style = __assign(__assign({}, dayPicker.styles.root), dayPicker.style); var dataAttributes = Object.keys(initialProps).filter(function(key2) { @@ -98451,7 +98618,7 @@ function Root(_a) { return __assign(__assign({}, attrs), (_a2 = {}, _a2[key2] = initialProps[key2], _a2)); }, {}); var MonthsComponent = (_c = (_b = initialProps.components) === null || _b === void 0 ? void 0 : _b.Months) !== null && _c !== void 0 ? _c : Months; - return jsxRuntimeExports.jsx("div", __assign({ className: classNames10.join(" "), style, dir: dayPicker.dir, id: dayPicker.id, nonce: initialProps.nonce, title: initialProps.title, lang: initialProps.lang }, dataAttributes, { children: jsxRuntimeExports.jsx(MonthsComponent, { children: navigation.displayMonths.map(function(month, i3) { + return jsxRuntimeExports.jsx("div", __assign({ className: classNames11.join(" "), style, dir: dayPicker.dir, id: dayPicker.id, nonce: initialProps.nonce, title: initialProps.title, lang: initialProps.lang }, dataAttributes, { children: jsxRuntimeExports.jsx(MonthsComponent, { children: navigation.displayMonths.map(function(month, i3) { return jsxRuntimeExports.jsx(Month, { displayIndex: i3, displayMonth: month }, i3); }) }) })); } @@ -104336,7 +104503,7 @@ var import_commands3 = require("@codemirror/commands"); var import_view4 = require("@codemirror/view"); var import_state4 = require("@codemirror/state"); var import_commands2 = require("@codemirror/commands"); -var import_search = require("@codemirror/search"); +var import_search3 = require("@codemirror/search"); var import_autocomplete2 = require("@codemirror/autocomplete"); var import_language4 = require("@codemirror/language"); var import_lint = require("@codemirror/lint"); @@ -104355,7 +104522,7 @@ var basicSetup = function basicSetup2(options) { keymaps = keymaps.concat(import_commands2.defaultKeymap); } if (options.searchKeymap !== false) { - keymaps = keymaps.concat(import_search.searchKeymap); + keymaps = keymaps.concat(import_search3.searchKeymap); } if (options.historyKeymap !== false) { keymaps = keymaps.concat(import_commands2.historyKeymap); @@ -104405,7 +104572,7 @@ var basicSetup = function basicSetup2(options) { if (options.highlightActiveLine !== false) extensions.push((0, import_view4.highlightActiveLine)()); if (options.highlightSelectionMatches !== false) - extensions.push((0, import_search.highlightSelectionMatches)()); + extensions.push((0, import_search3.highlightSelectionMatches)()); if (options.tabSize && typeof options.tabSize === "number") extensions.push(import_language4.indentUnit.of(" ".repeat(options.tabSize))); return extensions.concat([import_view4.keymap.of(keymaps.flat())]).filter(Boolean); @@ -104996,10 +105163,233 @@ var FormulaEditor = (props) => { }; // src/core/react/components/SpaceView/Contexts/DataTypeView/LookUpCell.tsx +var import_react41 = __toESM(require_react()); + +// src/core/react/components/SpaceView/Contexts/DataTypeView/IconCell.tsx var import_react37 = __toESM(require_react()); +var IconCell = (props) => { + const value = (0, import_react37.useMemo)( + () => props.multi ? parseMultiString(props.initialValue) ?? [] : [props.initialValue], + [props.initialValue] + ); + const ref2 = (0, import_react37.useRef)(null); + (0, import_react37.useEffect)(() => { + if (props.editMode == 4 /* EditModeActive */) { + ref2?.current?.focus(); + } + }, [props.editMode]); + const triggerStickerMenu = (e4) => { + props.superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react37.default.createElement(StickerModal_default, { + ui: props.superstate.ui, + hide: _props.hide, + selectedSticker: (emoji) => props.saveValue(emoji) + })); + }; + return /* @__PURE__ */ import_react37.default.createElement("div", { + className: "mk-cell-icon" + }, value.map( + (v2, i3) => v2?.length > 0 ? /* @__PURE__ */ import_react37.default.createElement("div", { + key: i3, + "aria-label": i18n_default.buttons.changeIcon, + dangerouslySetInnerHTML: { + __html: props.superstate.ui.getSticker(v2) + }, + onClick: (e4) => triggerStickerMenu(e4) + }) : /* @__PURE__ */ import_react37.default.createElement("div", { + key: i3, + className: "mk-cell-placeholder", + onClick: (e4) => triggerStickerMenu(e4) + }, i18n_default.labels.selectIcon) + )); +}; + +// src/core/react/components/UI/Modals/ImageModal.tsx +var import_react38 = __toESM(require_react()); + +// src/utils/regex.ts +var urlRegex = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi; + +// src/core/react/components/UI/Modals/ImageModal.tsx +var ImageModal = (props) => { + const [query, setQuery] = (0, import_react38.useState)(""); + const [allImages, setAllImages] = (0, import_react38.useState)([]); + const [images, setImages] = (0, import_react38.useState)([]); + const [selectedImage, setSelectedImage] = (0, import_react38.useState)(null); + (0, import_react38.useEffect)(() => { + const _allImages = []; + _allImages.push( + ...[...props.superstate.pathsIndex.values()].filter((f2) => f2.subtype == "image").map((f2) => ({ path: f2.path, thumnail: f2.label.thumbnail })) + ); + setAllImages(_allImages); + setImages(_allImages); + }, []); + (0, import_react38.useEffect)(() => { + query.match(urlRegex) ? setImages([{ path: query, thumnail: query }]) : setImages(allImages.filter((f2) => f2.path.includes(query))); + }, [query, allImages]); + const handleInputChange = (event) => { + setQuery(event.target.value); + }; + const handleKeyDown = (event) => { + const currentIndex = images.findIndex((f2) => f2.path == selectedImage); + if (event.key === "ArrowUp" && currentIndex > 0) { + setSelectedImage(images[currentIndex - 1].path); + } else if (event.key === "ArrowDown" && currentIndex < images.length - 1) { + setSelectedImage(images[currentIndex + 1].path); + } else if (event.key === "Enter") { + props.selectedPath(selectedImage); + props.hide(); + } + }; + const ref2 = (0, import_react38.useRef)(null); + (0, import_react38.useEffect)(() => { + if (ref2.current) { + ref2.current.focus(); + } + }, [ref2.current]); + return /* @__PURE__ */ import_react38.default.createElement(import_react38.default.Fragment, null, /* @__PURE__ */ import_react38.default.createElement("input", { + onKeyDown: handleKeyDown, + value: query, + ref: ref2, + onChange: handleInputChange, + className: "mk-input mk-input-large mk-border-bottom" + }), /* @__PURE__ */ import_react38.default.createElement("div", { + className: "mk-layout-masonry mk-padding-12 mk-layout-scroll" + }, images.map((image) => /* @__PURE__ */ import_react38.default.createElement("img", { + key: image.path, + src: props.superstate.ui.getUIPath(image.thumnail), + className: selectedImage === image.path ? "mk-selected" : "", + onClick: () => { + props.selectedPath(image.path); + props.hide(); + } + })))); +}; +var ImageModal_default = ImageModal; + +// src/core/react/components/SpaceView/Contexts/DataTypeView/ImageCell.tsx +var import_react39 = __toESM(require_react()); +var ImageCell = (props) => { + const { initialValue, saveValue } = props; + const [value, setValue] = import_react39.default.useState(initialValue); + const menuRef = (0, import_react39.useRef)(null); + (0, import_react39.useEffect)(() => { + if (props.editMode == 4 /* EditModeActive */) { + if (!menuRef.current) + showModal2(); + } + }, []); + const sourcePath = (0, import_react39.useMemo)(() => { + if (value?.length > 0) { + return props.superstate.ui.getUIPath(value); + } + return null; + }, [value]); + import_react39.default.useEffect(() => { + setValue(initialValue); + }, [initialValue]); + const showModal2 = () => { + props.superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react39.default.createElement(ImageModal_default, { + superstate: props.superstate, + hide: _props.hide, + selectedPath: (image) => saveValue(image) + })); + props.setEditMode(null); + }; + return /* @__PURE__ */ import_react39.default.createElement("div", { + className: "mk-cell-image" + }, /* @__PURE__ */ import_react39.default.createElement("img", { + src: sourcePath + }), props.editMode > 1 /* EditModeNone */ ? /* @__PURE__ */ import_react39.default.createElement("div", { + className: "mk-image-selector" + }, /* @__PURE__ */ import_react39.default.createElement("div", { + onClick: showModal2, + className: "mk-hover-button mk-icon-xsmall", + dangerouslySetInnerHTML: { + __html: props.superstate.ui.getSticker("ui//edit") + } + }), value?.length > 0 && /* @__PURE__ */ import_react39.default.createElement("div", { + onClick: () => saveValue(""), + className: "mk-hover-button mk-icon-xsmall", + dangerouslySetInnerHTML: { + __html: props.superstate.ui.getSticker("ui//close") + } + })) : /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null)); +}; + +// src/core/react/components/SpaceView/Contexts/DataTypeView/LinkCell.tsx +var import_react40 = __toESM(require_react()); +var LinkCell = (props) => { + const parseValue = (v2) => props.multi ? parseMultiString(v2) ?? [] : [v2].filter((f2) => f2); + (0, import_react40.useEffect)(() => { + setValue(parseValue(props.initialValue)); + }, [props.initialValue]); + const [value, setValue] = (0, import_react40.useState)(parseValue(props.initialValue)); + const removeValue = (v2) => { + const newValues = value.filter((f2) => f2 != v2); + setValue(newValues); + props.saveValue(serializeMultiString(newValues)); + }; + const saveOptions = (_18, _value) => { + if (!props.multi) { + setValue(_value); + props.saveValue(serializeMultiString(_value)); + } else { + const newValue = _value[0]; + if (newValue) { + const newValues = uniq([...value, newValue]); + setValue(newValues); + props.saveValue(serializeMultiString(newValues)); + } + } + }; + const menuProps = () => { + const options = [...props.superstate.pathsIndex.values()].filter((f2) => !f2.hidden).map((f2) => ({ + name: f2.name, + value: f2.path, + description: f2.path + })); + const _options = !props.multi ? [{ name: i18n_default.menu.none, value: "" }, ...options] : options; + return { + ui: props.superstate.ui, + multi: false, + editable: true, + value: value.map((f2) => f2), + options: _options, + saveOptions, + placeholder: i18n_default.labels.linkItemSelectPlaceholder, + detail: true, + searchable: true + }; + }; + const openLink = async (o2) => { + const pathExists = await props.superstate.spaceManager.pathExists(o2); + if (pathExists) { + props.superstate.ui.openPath(o2, false); + } else { + await props.superstate.spaceManager.createItemAtPath("/", "md", o2); + props.superstate.ui.openPath(o2, false); + } + }; + return /* @__PURE__ */ import_react40.default.createElement(OptionCellBase, { + superstate: props.superstate, + baseClass: "mk-cell-link", + removeValue, + selectLabel: props.compactMode ? props.property.name : i18n_default.labels.select, + menuProps, + labelElement: (_props) => /* @__PURE__ */ import_react40.default.createElement(PathCrumb, { + superstate: props.superstate, + path: _props.value + }, _props.children), + value, + multi: props.multi, + editMode: props.editMode + }); +}; + +// src/core/react/components/SpaceView/Contexts/DataTypeView/LookUpCell.tsx var LookUpCell = (props) => { const initialValue = ensureString(props.initialValue); - const parsedValue = (0, import_react37.useMemo)( + const parsedValue = (0, import_react41.useMemo)( () => parseFieldValue(props.propertyValue, "fileprop", props.superstate), [props.propertyValue] ); @@ -105016,25 +105406,36 @@ var LookUpCell = (props) => { }; props.superstate.ui.openCustomMenu( e4.target.getBoundingClientRect(), - /* @__PURE__ */ import_react37.default.createElement(FormulaEditor, { + /* @__PURE__ */ import_react41.default.createElement(FormulaEditor, { ..._props }), { ..._props }, "bottom" ); }; - return /* @__PURE__ */ import_react37.default.createElement("div", { + return parsedValue.type == "image" ? /* @__PURE__ */ import_react41.default.createElement(ImageCell, { + ...props, + editMode: 0 /* EditModeReadOnly */ + }) : parsedValue.type == "icon" ? /* @__PURE__ */ import_react41.default.createElement(IconCell, { + ...props, + multi: false, + editMode: 0 /* EditModeReadOnly */ + }) : parsedValue.type == "link" ? /* @__PURE__ */ import_react41.default.createElement(LinkCell, { + ...props, + multi: false, + editMode: 0 /* EditModeReadOnly */ + }) : /* @__PURE__ */ import_react41.default.createElement("div", { className: "mk-cell-fileprop", onClick: (e4) => editFormula(e4) }, initialValue); }; // src/core/react/components/SpaceView/Contexts/DataTypeView/NumberCell.tsx -var import_react38 = __toESM(require_react()); +var import_react42 = __toESM(require_react()); var NumberCell = (props) => { const { initialValue, saveValue } = props; - const [value, setValue] = import_react38.default.useState(initialValue); - const ref2 = (0, import_react38.useRef)(null); + const [value, setValue] = import_react42.default.useState(initialValue); + const ref2 = (0, import_react42.useRef)(null); const onBlur = () => { if (initialValue != value) saveValue(value); @@ -105051,15 +105452,15 @@ var NumberCell = (props) => { props.setEditMode(null); } }; - import_react38.default.useEffect(() => { + import_react42.default.useEffect(() => { setValue(initialValue); }, [initialValue]); - (0, import_react38.useEffect)(() => { + (0, import_react42.useEffect)(() => { if (props.editMode == 4 /* EditModeActive */) { ref2?.current?.focus(); } }, [props.editMode]); - return props.editMode > 2 /* EditModeView */ ? /* @__PURE__ */ import_react38.default.createElement("input", { + return props.editMode > 2 /* EditModeView */ ? /* @__PURE__ */ import_react42.default.createElement("input", { className: "mk-cell-text", type: "number", ref: ref2, @@ -105067,13 +105468,13 @@ var NumberCell = (props) => { onChange: (e4) => setValue(e4.target.value), onKeyDown, onBlur - }) : /* @__PURE__ */ import_react38.default.createElement("div", { + }) : /* @__PURE__ */ import_react42.default.createElement("div", { className: "mk-cell-number" }, value); }; // src/core/react/components/SpaceView/Contexts/DataTypeView/PathCell.tsx -var import_react39 = __toESM(require_react()); +var import_react43 = __toESM(require_react()); var PathCell = (props) => { const fileOrCleanPath = (f2) => { if (!f2) @@ -105087,11 +105488,11 @@ var PathCell = (props) => { const pathState = props.superstate.pathsIndex.get(resolvedPath); return pathState ? { path: f2, pathState } : { path: f2 }; }; - const value = (0, import_react39.useMemo)( + const value = (0, import_react43.useMemo)( () => (props.multi ? parseMultiString(props.initialValue) ?? [] : [props.initialValue]).map((f2) => fileOrCleanPath(f2)), [props.initialValue] ); - const ref2 = (0, import_react39.useRef)(null); + const ref2 = (0, import_react43.useRef)(null); const onKeyDown = (e4) => { e4.stopPropagation(); e4.key == "Enter" && e4.target.blur(); @@ -105130,22 +105531,22 @@ var PathCell = (props) => { const deleteRow = () => { props.deleteRow(); }; - (0, import_react39.useEffect)(() => { + (0, import_react43.useEffect)(() => { if (props.editMode == 4 /* EditModeActive */) { ref2?.current?.focus(); } }, [props.editMode]); - return /* @__PURE__ */ import_react39.default.createElement("div", { + return /* @__PURE__ */ import_react43.default.createElement("div", { className: "mk-cell-file" }, value.map((v2, i3) => { if (props.editMode == 0 /* EditModeReadOnly */) { if (v2.pathState) { - return /* @__PURE__ */ import_react39.default.createElement("div", { + return /* @__PURE__ */ import_react43.default.createElement("div", { key: i3, className: "mk-cell-file-title" - }, v2 && v2.pathState ? v2.pathState.name : "", v2.pathState.type == "file" && v2.pathState.subtype != "md" && /* @__PURE__ */ import_react39.default.createElement("span", { + }, v2 && v2.pathState ? v2.pathState.name : "", v2.pathState.type == "file" && v2.pathState.subtype != "md" && /* @__PURE__ */ import_react43.default.createElement("span", { className: "nav-file-tag" - }, v2.pathState.metadata.file.extension), /* @__PURE__ */ import_react39.default.createElement("button", { + }, v2.pathState.metadata.file.extension), /* @__PURE__ */ import_react43.default.createElement("button", { "aria-label": i18n_default.buttons.toggleFlow, className: "mk-cell-file-flow mk-inline-button", dangerouslySetInnerHTML: { @@ -105159,32 +105560,32 @@ var PathCell = (props) => { } })); } else { - return /* @__PURE__ */ import_react39.default.createElement("div", { + return /* @__PURE__ */ import_react43.default.createElement("div", { key: i3, className: "mk-cell-file-title" }, v2.path); } } if (v2.pathState) { - return /* @__PURE__ */ import_react39.default.createElement("div", { + return /* @__PURE__ */ import_react43.default.createElement("div", { className: "mk-cell-file-item", key: i3 - }, /* @__PURE__ */ import_react39.default.createElement(PathCrumb, { + }, /* @__PURE__ */ import_react43.default.createElement(PathCrumb, { superstate: props.superstate, path: v2.pathState.path })); } - return /* @__PURE__ */ import_react39.default.createElement("div", { + return /* @__PURE__ */ import_react43.default.createElement("div", { className: "mk-cell-file-item", key: i3 - }, /* @__PURE__ */ import_react39.default.createElement("div", { + }, /* @__PURE__ */ import_react43.default.createElement("div", { className: "mk-path-icon" - }, /* @__PURE__ */ import_react39.default.createElement("button", { + }, /* @__PURE__ */ import_react43.default.createElement("button", { onClick: (e4) => newPath(v2), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//new-file") } - })), props.editMode > 2 /* EditModeView */ ? /* @__PURE__ */ import_react39.default.createElement("input", { + })), props.editMode > 2 /* EditModeView */ ? /* @__PURE__ */ import_react43.default.createElement("input", { className: "mk-cell-file-name", type: "text", placeholder: i18n_default.buttons.newNote, @@ -105192,17 +105593,17 @@ var PathCell = (props) => { defaultValue: v2.path, onKeyDown, onBlur - }) : /* @__PURE__ */ import_react39.default.createElement("div", { + }) : /* @__PURE__ */ import_react43.default.createElement("div", { className: "mk-cell-file-name" }, v2.path)); })); }; // src/core/react/components/SpaceView/Contexts/DataTypeView/TextCell.tsx -var import_react40 = __toESM(require_react()); +var import_react44 = __toESM(require_react()); var TextCell = (props) => { const { initialValue, saveValue } = props; - const ref2 = (0, import_react40.useRef)(null); + const ref2 = (0, import_react44.useRef)(null); const onBlur = (e4) => { const value = e4.currentTarget.innerText; if (initialValue != value) @@ -105222,12 +105623,12 @@ var TextCell = (props) => { props.setEditMode(null); } }; - (0, import_react40.useEffect)(() => { + (0, import_react44.useEffect)(() => { if (props.editMode == 4 /* EditModeActive */) { ref2?.current?.focus(); } }, [props.editMode]); - return props.editMode > 2 /* EditModeView */ ? /* @__PURE__ */ import_react40.default.createElement("div", { + return props.editMode > 2 /* EditModeView */ ? /* @__PURE__ */ import_react44.default.createElement("div", { onClick: (e4) => e4.stopPropagation(), className: "mk-cell-text", ref: ref2, @@ -105236,13 +105637,13 @@ var TextCell = (props) => { onBlur, contentEditable: true, dangerouslySetInnerHTML: { __html: initialValue } - }) : /* @__PURE__ */ import_react40.default.createElement("div", { + }) : /* @__PURE__ */ import_react44.default.createElement("div", { className: "mk-cell-text" }, initialValue); }; // src/core/react/components/UI/Menus/contexts/newSpacePropertyMenu.tsx -var import_react42 = __toESM(require_react()); +var import_react46 = __toESM(require_react()); // src/core/utils/properties/allProperties.ts var allCacheTypesForPaths = (superstate, paths) => { @@ -105266,7 +105667,7 @@ var allCacheTypesForPaths = (superstate, paths) => { }; // src/core/react/components/UI/Menus/contexts/PropertyValue.tsx -var import_react41 = __toESM(require_react()); +var import_react45 = __toESM(require_react()); var PropertyValueComponent = (props) => { const showOptions = (e4, value, options, field, saveProperty) => { props.superstate.ui.openMenu( @@ -105289,7 +105690,27 @@ var PropertyValueComponent = (props) => { } ); }; - const parsedValue = (0, import_react41.useMemo)( + const selectType = (e4) => { + props.superstate.ui.openMenu( + e4.target.getBoundingClientRect(), + { + ui: props.superstate.ui, + multi: false, + editable: false, + searchable: false, + saveOptions: (_18, v2) => saveParsedValue("type", v2[0]), + value: [], + showAll: true, + options: fieldTypes.filter((f2) => f2.primative).map((f2, i3) => ({ + id: i3 + 1, + name: f2.label, + value: f2.type, + icon: f2.icon + })) + } + ); + }; + const parsedValue = (0, import_react45.useMemo)( () => parseFieldValue(props.value, props.fieldType, props.superstate), [props.value, props.fieldType] ); @@ -105363,7 +105784,7 @@ var PropertyValueComponent = (props) => { }; props.superstate.ui.openCustomMenu( e4.target.getBoundingClientRect(), - /* @__PURE__ */ import_react41.default.createElement(FormulaEditor, { + /* @__PURE__ */ import_react45.default.createElement(FormulaEditor, { ..._props }), { ..._props }, @@ -105387,43 +105808,46 @@ var PropertyValueComponent = (props) => { ]; showOptions(e4, null, formats, "format"); }; - return props.fieldType.startsWith("date") ? /* @__PURE__ */ import_react41.default.createElement("div", { + return props.fieldType.startsWith("date") ? /* @__PURE__ */ import_react45.default.createElement("div", { className: "mk-menu-option", onClick: (e4) => selectDateFormat(e4) - }, /* @__PURE__ */ import_react41.default.createElement("span", null, i18n_default.labels.dateFormat), /* @__PURE__ */ import_react41.default.createElement("span", null, parsedValue.format)) : props.fieldType.startsWith("context") ? /* @__PURE__ */ import_react41.default.createElement(import_react41.default.Fragment, null, /* @__PURE__ */ import_react41.default.createElement("div", { + }, /* @__PURE__ */ import_react45.default.createElement("span", null, i18n_default.labels.dateFormat), /* @__PURE__ */ import_react45.default.createElement("span", null, parsedValue.format)) : props.fieldType.startsWith("context") ? /* @__PURE__ */ import_react45.default.createElement(import_react45.default.Fragment, null, /* @__PURE__ */ import_react45.default.createElement("div", { className: "mk-menu-option", onClick: (e4) => selectContext(e4) - }, /* @__PURE__ */ import_react41.default.createElement("span", null, i18n_default.labels.propertyValueSpace), /* @__PURE__ */ import_react41.default.createElement("span", null, spaceNameFromSpacePath(parsedValue.space, props.superstate))), parsedValue.space?.length > 0 && props.contextPath && /* @__PURE__ */ import_react41.default.createElement("div", { + }, /* @__PURE__ */ import_react45.default.createElement("span", null, i18n_default.labels.propertyValueSpace), /* @__PURE__ */ import_react45.default.createElement("span", null, spaceNameFromSpacePath(parsedValue.space, props.superstate))), parsedValue.space?.length > 0 && props.contextPath && /* @__PURE__ */ import_react45.default.createElement("div", { className: "mk-menu-option", onClick: (e4) => selectSpaceProperty(e4) - }, /* @__PURE__ */ import_react41.default.createElement("span", null, i18n_default.labels.propertyValueProperty), /* @__PURE__ */ import_react41.default.createElement("span", null, parsedValue.field))) : props.fieldType == "number" ? /* @__PURE__ */ import_react41.default.createElement(import_react41.default.Fragment, null) : props.fieldType == "fileprop" ? /* @__PURE__ */ import_react41.default.createElement(import_react41.default.Fragment, null, /* @__PURE__ */ import_react41.default.createElement("div", { + }, /* @__PURE__ */ import_react45.default.createElement("span", null, i18n_default.labels.propertyValueProperty), /* @__PURE__ */ import_react45.default.createElement("span", null, parsedValue.field))) : props.fieldType == "number" ? /* @__PURE__ */ import_react45.default.createElement(import_react45.default.Fragment, null) : props.fieldType == "fileprop" ? /* @__PURE__ */ import_react45.default.createElement(import_react45.default.Fragment, null, /* @__PURE__ */ import_react45.default.createElement("div", { className: "mk-menu-option", onClick: (e4) => editFormula(e4) - }, /* @__PURE__ */ import_react41.default.createElement("span", null, i18n_default.labels.propertyLookup))) : props.fieldType == "super" ? /* @__PURE__ */ import_react41.default.createElement(import_react41.default.Fragment, null, /* @__PURE__ */ import_react41.default.createElement("div", { + }, /* @__PURE__ */ import_react45.default.createElement("span", null, i18n_default.labels.propertyLookup)), /* @__PURE__ */ import_react45.default.createElement("div", { + className: "mk-menu-option", + onClick: (e4) => selectType(e4) + }, /* @__PURE__ */ import_react45.default.createElement("span", null, i18n_default.labels.propertyType), /* @__PURE__ */ import_react45.default.createElement("span", null, fieldTypeForType(parsedValue.type)?.label))) : props.fieldType == "super" ? /* @__PURE__ */ import_react45.default.createElement(import_react45.default.Fragment, null, /* @__PURE__ */ import_react45.default.createElement("div", { className: "mk-menu-option" - }, /* @__PURE__ */ import_react41.default.createElement("span", null, i18n_default.labels.propertyDynamic), /* @__PURE__ */ import_react41.default.createElement("input", { + }, /* @__PURE__ */ import_react45.default.createElement("span", null, i18n_default.labels.propertyDynamic), /* @__PURE__ */ import_react45.default.createElement("input", { type: "checkbox", checked: parsedValue.dynamic == true, onChange: () => saveParsedValue("dynamic", !parsedValue.dynamic) - })), /* @__PURE__ */ import_react41.default.createElement("div", { + })), /* @__PURE__ */ import_react45.default.createElement("div", { className: "mk-menu-option", onClick: (e4) => selectProperty(e4) - }, /* @__PURE__ */ import_react41.default.createElement("span", null, i18n_default.labels.propertyFileProp), /* @__PURE__ */ import_react41.default.createElement("span", null, parsedValue.field))) : /* @__PURE__ */ import_react41.default.createElement(import_react41.default.Fragment, null); + }, /* @__PURE__ */ import_react45.default.createElement("span", null, i18n_default.labels.propertyFileProp), /* @__PURE__ */ import_react45.default.createElement("span", null, parsedValue.field))) : /* @__PURE__ */ import_react45.default.createElement(import_react45.default.Fragment, null); }; // src/core/react/components/UI/Menus/contexts/newSpacePropertyMenu.tsx var NewPropertyMenuComponent = (props) => { - const [fieldName, setFieldName] = (0, import_react42.useState)(""); - const [fieldSource, setFieldSource] = (0, import_react42.useState)( + const [fieldName, setFieldName] = (0, import_react46.useState)(""); + const [fieldSource, setFieldSource] = (0, import_react46.useState)( props.fileMetadata ? "$fm" : "" ); - const spaceCaches = (0, import_react42.useMemo)( + const spaceCaches = (0, import_react46.useMemo)( () => props.spaces.map((f2) => props.superstate.spacesIndex.get(f2)).filter((f2) => f2), [props.spaces] ); - const [fieldValue, setFieldValue] = (0, import_react42.useState)(""); - const [fieldType, setFieldType] = (0, import_react42.useState)("text"); - const options = (0, import_react42.useMemo)(() => { + const [fieldValue, setFieldValue] = (0, import_react46.useState)(""); + const [fieldType, setFieldType] = (0, import_react46.useState)("text"); + const options = (0, import_react46.useMemo)(() => { const options2 = []; if (props.fileMetadata) { options2.push({ @@ -105486,7 +105910,7 @@ var NewPropertyMenuComponent = (props) => { const selectedContext = (value) => { setFieldValue(value); }; - const type = (0, import_react42.useMemo)( + const type = (0, import_react46.useMemo)( () => fieldTypeForType(fieldType, fieldName) ?? fieldTypes[0], [fieldType, fieldName] ); @@ -105524,19 +105948,19 @@ var NewPropertyMenuComponent = (props) => { saveField(); } }; - (0, import_react42.useEffect)(() => { + (0, import_react46.useEffect)(() => { setTimeout(() => { input.current?.focus(); }, 50); }, []); - const input = (0, import_react42.useRef)(null); - return /* @__PURE__ */ import_react42.default.createElement("div", { + const input = (0, import_react46.useRef)(null); + return /* @__PURE__ */ import_react46.default.createElement("div", { className: "mk-menu-container" - }, /* @__PURE__ */ import_react42.default.createElement("div", { + }, /* @__PURE__ */ import_react46.default.createElement("div", { className: "mk-menu-suggestions" - }, /* @__PURE__ */ import_react42.default.createElement("div", { + }, /* @__PURE__ */ import_react46.default.createElement("div", { className: "mk-menu-input" - }, /* @__PURE__ */ import_react42.default.createElement("input", { + }, /* @__PURE__ */ import_react46.default.createElement("input", { type: "text", ref: input, placeholder: "Name", @@ -105544,27 +105968,27 @@ var NewPropertyMenuComponent = (props) => { onChange: (e4) => setFieldName(e4.target.value), onMouseDown: (e4) => e4.stopPropagation(), value: fieldName - })), /* @__PURE__ */ import_react42.default.createElement("div", { + })), /* @__PURE__ */ import_react46.default.createElement("div", { className: "mk-menu-separator" - }), options.length > 1 && /* @__PURE__ */ import_react42.default.createElement("div", { + }), options.length > 1 && /* @__PURE__ */ import_react46.default.createElement("div", { className: "mk-menu-option", onClick: (e4) => selectSource(e4) - }, /* @__PURE__ */ import_react42.default.createElement("div", { + }, /* @__PURE__ */ import_react46.default.createElement("div", { className: "mk-menu-options-inner" - }, i18n_default.labels.propertyValueSpace), /* @__PURE__ */ import_react42.default.createElement("span", null, fieldSource == "$fm" ? "None" : fieldSource == "" ? props.contextPath : fieldSource)), /* @__PURE__ */ import_react42.default.createElement("div", { + }, i18n_default.labels.propertyValueSpace), /* @__PURE__ */ import_react46.default.createElement("span", null, fieldSource == "$fm" ? "None" : fieldSource == "" ? props.contextPath : fieldSource)), /* @__PURE__ */ import_react46.default.createElement("div", { className: "mk-menu-option", onClick: (e4) => selectType(e4) - }, /* @__PURE__ */ import_react42.default.createElement("div", { + }, /* @__PURE__ */ import_react46.default.createElement("div", { className: "mk-menu-options-inner" - }, i18n_default.labels.propertyValueProperty), /* @__PURE__ */ import_react42.default.createElement("span", null, type.label)), type.multi ? /* @__PURE__ */ import_react42.default.createElement("div", { + }, i18n_default.labels.propertyValueProperty), /* @__PURE__ */ import_react46.default.createElement("span", null, type.label)), type.multi ? /* @__PURE__ */ import_react46.default.createElement("div", { className: "mk-menu-option" - }, /* @__PURE__ */ import_react42.default.createElement("span", null, i18n_default.labels.multiple), /* @__PURE__ */ import_react42.default.createElement("input", { + }, /* @__PURE__ */ import_react46.default.createElement("span", null, i18n_default.labels.multiple), /* @__PURE__ */ import_react46.default.createElement("input", { type: "checkbox", checked: fieldType == type.multiType, onChange: () => toggleMulti() - })) : /* @__PURE__ */ import_react42.default.createElement(import_react42.default.Fragment, null), /* @__PURE__ */ import_react42.default.createElement("div", { + })) : /* @__PURE__ */ import_react46.default.createElement(import_react46.default.Fragment, null), /* @__PURE__ */ import_react46.default.createElement("div", { className: "mk-menu-separator" - }), fieldSource != "$fm" || props.isSpace ? /* @__PURE__ */ import_react42.default.createElement(PropertyValueComponent, { + }), fieldSource != "$fm" || props.isSpace ? /* @__PURE__ */ import_react46.default.createElement(PropertyValueComponent, { superstate: props.superstate, table: fieldSource, fields: props.fields, @@ -105572,20 +105996,20 @@ var NewPropertyMenuComponent = (props) => { value: fieldValue, contextPath: props.contextPath, saveValue: selectedValue - }) : /* @__PURE__ */ import_react42.default.createElement(import_react42.default.Fragment, null), /* @__PURE__ */ import_react42.default.createElement("div", { + }) : /* @__PURE__ */ import_react46.default.createElement(import_react46.default.Fragment, null), /* @__PURE__ */ import_react46.default.createElement("div", { className: "mk-menu-separator" - }), /* @__PURE__ */ import_react42.default.createElement("div", { + }), /* @__PURE__ */ import_react46.default.createElement("div", { className: "mk-menu-option", onClick: (e4) => saveField() - }, /* @__PURE__ */ import_react42.default.createElement("span", null, i18n_default.buttons.saveProperty)), /* @__PURE__ */ import_react42.default.createElement("div", { + }, /* @__PURE__ */ import_react46.default.createElement("span", null, i18n_default.buttons.saveProperty)), /* @__PURE__ */ import_react46.default.createElement("div", { className: "mk-menu-option", onClick: (e4) => props.hide() - }, /* @__PURE__ */ import_react42.default.createElement("span", null, i18n_default.buttons.cancel)))); + }, /* @__PURE__ */ import_react46.default.createElement("span", null, i18n_default.buttons.cancel)))); }; var showNewPropertyMenu = (superstate, rect, spaces2, fields, saveField, schemaId, contextPath, fileMetadata, isSpace) => { return superstate.ui.openCustomMenu( rect, - /* @__PURE__ */ import_react42.default.createElement(NewPropertyMenuComponent, { + /* @__PURE__ */ import_react46.default.createElement(NewPropertyMenuComponent, { superstate, spaces: spaces2, schemaId, @@ -105601,7 +106025,7 @@ var showNewPropertyMenu = (superstate, rect, spaces2, fields, saveField, schemaI }; // src/core/react/components/UI/Menus/contexts/spacePropertyMenu.tsx -var import_react43 = __toESM(require_react()); +var import_react47 = __toESM(require_react()); var selectPropertyTypeMenu = (e4, ui, selectedType) => { ui.openMenu(e4.target.getBoundingClientRect(), { ui, @@ -105620,7 +106044,7 @@ var selectPropertyTypeMenu = (e4, ui, selectedType) => { }); }; var PropertyMenuComponent = (props) => { - const [field, setField] = (0, import_react43.useState)(props.field); + const [field, setField] = (0, import_react47.useState)(props.field); const selectedType = (_18, value) => { const newField = { ...field, @@ -105655,18 +106079,18 @@ var PropertyMenuComponent = (props) => { } return value[0] == fieldType.type || value[0] == fieldType.multiType ? f2.value : null; }; - return /* @__PURE__ */ import_react43.default.createElement(import_react43.default.Fragment, null, /* @__PURE__ */ import_react43.default.createElement("li", null, /* @__PURE__ */ import_react43.default.createElement("div", { + return /* @__PURE__ */ import_react47.default.createElement(import_react47.default.Fragment, null, /* @__PURE__ */ import_react47.default.createElement("li", null, /* @__PURE__ */ import_react47.default.createElement("div", { className: "mk-menu-option", onClick: (e4) => selectPropertyTypeMenu(e4, props.superstate.ui, selectedType) - }, /* @__PURE__ */ import_react43.default.createElement("span", null, i18n_default.labels.propertyType), /* @__PURE__ */ import_react43.default.createElement("span", null, fieldType.label))), fieldType.multi ? /* @__PURE__ */ import_react43.default.createElement("div", { + }, /* @__PURE__ */ import_react47.default.createElement("span", null, i18n_default.labels.propertyType), /* @__PURE__ */ import_react47.default.createElement("span", null, fieldType.label))), fieldType.multi ? /* @__PURE__ */ import_react47.default.createElement("div", { className: "mk-menu-option" - }, /* @__PURE__ */ import_react43.default.createElement("span", null, i18n_default.labels.multiple), /* @__PURE__ */ import_react43.default.createElement("input", { + }, /* @__PURE__ */ import_react47.default.createElement("span", null, i18n_default.labels.multiple), /* @__PURE__ */ import_react47.default.createElement("input", { type: "checkbox", checked: field.type == fieldType.multiType, onChange: () => toggleMulti() - })) : /* @__PURE__ */ import_react43.default.createElement(import_react43.default.Fragment, null), /* @__PURE__ */ import_react43.default.createElement("div", { + })) : /* @__PURE__ */ import_react47.default.createElement(import_react47.default.Fragment, null), /* @__PURE__ */ import_react47.default.createElement("div", { className: "mk-menu-separator" - }), /* @__PURE__ */ import_react43.default.createElement(PropertyValueComponent, { + }), /* @__PURE__ */ import_react47.default.createElement(PropertyValueComponent, { superstate: props.superstate, name: field.name, table: field.table, @@ -105705,7 +106129,7 @@ var showPropertyMenu = (props) => { menuOptions.push({ name: "", type: 5 /* Custom */, - fragment: () => /* @__PURE__ */ import_react43.default.createElement(PropertyMenuComponent, { + fragment: () => /* @__PURE__ */ import_react47.default.createElement(PropertyMenuComponent, { superstate, field, fields, @@ -105719,7 +106143,7 @@ var showPropertyMenu = (props) => { name: i18n_default.menu.setIcon, icon: "ui//gem", onClick: () => { - superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react43.default.createElement(StickerModal_default, { + superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react47.default.createElement(StickerModal_default, { ui: superstate.ui, hide: _props.hide, selectedSticker: (emoji) => saveField({ ...field, attrs: JSON.stringify({ icon: emoji }) }) @@ -105796,9 +106220,9 @@ var showPropertyMenu = (props) => { }; // src/core/react/hooks/useCombinedRef.tsx -var import_react44 = __toESM(require_react()); +var import_react48 = __toESM(require_react()); function useCombinedRefs2(...refs) { - return (0, import_react44.useMemo)( + return (0, import_react48.useMemo)( () => (node) => { refs.forEach((ref2) => ref2(node)); }, @@ -105807,7 +106231,7 @@ function useCombinedRefs2(...refs) { } // src/core/react/components/SpaceView/Contexts/TableView/ColumnHeader.tsx -var import_react45 = __toESM(require_react()); +var import_react49 = __toESM(require_react()); var filePropTypes = [ { name: i18n_default.properties.fileProperty.name, @@ -105851,10 +106275,10 @@ var filePropTypes = [ } ]; var ColumnHeader = (props) => { - const [field, setField] = (0, import_react45.useState)(props.column); - const menuRef = (0, import_react45.useRef)(null); - const { spaceInfo, spaceState: spaceCache } = (0, import_react45.useContext)(SpaceContext); - const { tableData, contextTable, cols } = (0, import_react45.useContext)(ContextMDBContext); + const [field, setField] = (0, import_react49.useState)(props.column); + const menuRef = (0, import_react49.useRef)(null); + const { spaceInfo, spaceState: spaceCache } = (0, import_react49.useContext)(SpaceContext); + const { tableData, contextTable, cols } = (0, import_react49.useContext)(ContextMDBContext); const { predicate, newColumn, @@ -105862,8 +106286,8 @@ var ColumnHeader = (props) => { hideColumn, sortColumn, delColumn - } = (0, import_react45.useContext)(ContextEditorContext); - (0, import_react45.useEffect)(() => { + } = (0, import_react49.useContext)(ContextEditorContext); + (0, import_react49.useEffect)(() => { setField(props.column); }, [props.column]); const { @@ -105925,13 +106349,13 @@ var ColumnHeader = (props) => { hide: hideColumn, deleteColumn: delColumn, sortColumn, - hidden: predicate.colsHidden.includes(field.name + field.table) + hidden: predicate?.colsHidden.includes(field.name + field.table) }); } }; - const ref2 = (0, import_react45.useRef)(null); + const ref2 = (0, import_react49.useRef)(null); const setNodeRef = useCombinedRefs2(setDroppableNodeRef, setDraggableNodeRef); - return /* @__PURE__ */ import_react45.default.createElement("div", { + return /* @__PURE__ */ import_react49.default.createElement("div", { ref: setNodeRef, ...listeners, ...attributes, @@ -105939,35 +106363,35 @@ var ColumnHeader = (props) => { onClick: (e4) => { toggleMenu(e4); } - }, /* @__PURE__ */ import_react45.default.createElement("div", { + }, /* @__PURE__ */ import_react49.default.createElement("div", { ref: ref2 - }, props.column.name.length > 0 ? /* @__PURE__ */ import_react45.default.createElement(import_react45.default.Fragment, null, /* @__PURE__ */ import_react45.default.createElement("div", { + }, props.column.name.length > 0 ? /* @__PURE__ */ import_react49.default.createElement(import_react49.default.Fragment, null, /* @__PURE__ */ import_react49.default.createElement("div", { className: "mk-path-context-field-icon", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker( stickerForField(props.column) ) } - }), /* @__PURE__ */ import_react45.default.createElement("div", { + }), /* @__PURE__ */ import_react49.default.createElement("div", { className: "mk-path-context-field-key" - }, field.name)) : "+", /* @__PURE__ */ import_react45.default.createElement("span", { + }, field.name)) : "+", /* @__PURE__ */ import_react49.default.createElement("span", { className: "mk-col-header-context", "aria-label": props.column.table.length > 0 ? props.column.table : "" }, props.column.table.length > 0 ? "#" : ""))); }; // src/core/react/components/UI/Menus/navigator/spaceContextMenu.tsx -var import_react61 = __toESM(require_react()); +var import_react65 = __toESM(require_react()); // src/core/react/components/SpaceView/Contexts/ContextBuilder/SpacePropertyEditor.tsx -var import_react46 = __toESM(require_react()); +var import_react50 = __toESM(require_react()); var import_react_dom2 = __toESM(require_react_dom()); var SpacePropertyEditor = (props) => { - const [activeId, setActiveId] = (0, import_react46.useState)(""); + const [activeId, setActiveId] = (0, import_react50.useState)(""); const items = props.columns.map((f2) => ({ ...f2, table: "", id: f2.name })); - const [openNodes, setOpenNodes] = (0, import_react46.useState)([]); - const [overId, setOverId] = (0, import_react46.useState)(""); - const contextProperties = (0, import_react46.useMemo)(() => { + const [openNodes, setOpenNodes] = (0, import_react50.useState)([]); + const [overId, setOverId] = (0, import_react50.useState)(""); + const contextProperties = (0, import_react50.useMemo)(() => { return props.contexts.reduce((p, c3) => { return { ...p, @@ -106036,7 +106460,7 @@ var SpacePropertyEditor = (props) => { showAll: true }); }; - return /* @__PURE__ */ import_react46.default.createElement(DndContext, { + return /* @__PURE__ */ import_react50.default.createElement(DndContext, { sensors, collisionDetection: closestCenter, measuring: { @@ -106068,28 +106492,28 @@ var SpacePropertyEditor = (props) => { resetState(); }, onDragCancel: resetState - }, /* @__PURE__ */ import_react46.default.createElement("div", { + }, /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-space-editor" - }, /* @__PURE__ */ import_react46.default.createElement("div", { + }, /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-space-editor-section" - }, /* @__PURE__ */ import_react46.default.createElement("div", { + }, /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-space-editor-title" - }, /* @__PURE__ */ import_react46.default.createElement("div", { + }, /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//list") } - }), i18n_default.labels.properties), /* @__PURE__ */ import_react46.default.createElement("div", { + }), i18n_default.labels.properties), /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-space-editor-description" - }, i18n_default.descriptions.spaceProperties), /* @__PURE__ */ import_react46.default.createElement("div", { + }, i18n_default.descriptions.spaceProperties), /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-property-editor-context-list" - }, /* @__PURE__ */ import_react46.default.createElement("div", { + }, /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-property-editor-list" - }, /* @__PURE__ */ import_react46.default.createElement(SortableContext, { + }, /* @__PURE__ */ import_react50.default.createElement(SortableContext, { items, strategy: verticalListSortingStrategy }, items.map((value, index) => { - return /* @__PURE__ */ import_react46.default.createElement(SortableItem, { + return /* @__PURE__ */ import_react50.default.createElement(SortableItem, { key: index, id: value.id, field: value, @@ -106100,37 +106524,37 @@ var SpacePropertyEditor = (props) => { hideColumn: props.hideColumn, delColumn: props.delColumn }); - })))), /* @__PURE__ */ import_react46.default.createElement("button", { + })))), /* @__PURE__ */ import_react50.default.createElement("button", { className: "mk-inline-button", onClick: (e4) => newProperty(e4) - }, /* @__PURE__ */ import_react46.default.createElement("div", { + }, /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } - }), i18n_default.buttons.addProperty)), /* @__PURE__ */ import_react46.default.createElement("div", { + }), i18n_default.buttons.addProperty)), /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-space-editor-section" - }, /* @__PURE__ */ import_react46.default.createElement("div", { + }, /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-space-editor-title" - }, /* @__PURE__ */ import_react46.default.createElement("div", { + }, /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//combine") } - }), "Contexts"), /* @__PURE__ */ import_react46.default.createElement("div", { + }), "Contexts"), /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-space-editor-description" - }, i18n_default.descriptions.addContext), props.contexts.map((f2, i3) => /* @__PURE__ */ import_react46.default.createElement("div", { + }, i18n_default.descriptions.addContext), props.contexts.map((f2, i3) => /* @__PURE__ */ import_react50.default.createElement("div", { key: i3, className: "mk-property-editor-context" - }, /* @__PURE__ */ import_react46.default.createElement("div", { + }, /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-property-editor-context-title" - }, f2, /* @__PURE__ */ import_react46.default.createElement(CollapseToggle, { + }, f2, /* @__PURE__ */ import_react50.default.createElement(CollapseToggle, { superstate: props.superstate, collapsed: !openNodes.some((g) => g == f2), onToggle: (c3) => setOpenNodes( (p) => p.some((g) => g == f2) ? p.filter((o2) => o2 != f2) : [...p, f2] ) - }), /* @__PURE__ */ import_react46.default.createElement("span", null), /* @__PURE__ */ import_react46.default.createElement("div", null, /* @__PURE__ */ import_react46.default.createElement("div", { + }), /* @__PURE__ */ import_react50.default.createElement("span", null), /* @__PURE__ */ import_react50.default.createElement("div", null, /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//close") @@ -106138,9 +106562,9 @@ var SpacePropertyEditor = (props) => { onClick: (e4) => { props.saveContexts(props.contexts.filter((g) => g != f2)); } - }))), openNodes.some((g) => g == f2) ? /* @__PURE__ */ import_react46.default.createElement("div", { + }))), openNodes.some((g) => g == f2) ? /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-property-editor-list" - }, contextProperties[f2]?.cols.filter((f3) => f3.primary != "true").map((g, h3) => /* @__PURE__ */ import_react46.default.createElement(SortableItem, { + }, contextProperties[f2]?.cols.filter((f3) => f3.primary != "true").map((g, h3) => /* @__PURE__ */ import_react50.default.createElement(SortableItem, { key: h3, id: g.name + "#" + f2, field: g, @@ -106150,18 +106574,18 @@ var SpacePropertyEditor = (props) => { colsHidden: props.colsHidden, hideColumn: props.hideColumn, delColumn: props.delColumn - }))) : /* @__PURE__ */ import_react46.default.createElement(import_react46.default.Fragment, null))), /* @__PURE__ */ import_react46.default.createElement("div", { + }))) : /* @__PURE__ */ import_react50.default.createElement(import_react50.default.Fragment, null))), /* @__PURE__ */ import_react50.default.createElement("div", { onClick: (e4) => newContexts(e4), className: "mk-inline-button" - }, /* @__PURE__ */ import_react46.default.createElement("div", { + }, /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } }), i18n_default.buttons.addContext))), (0, import_react_dom2.createPortal)( - /* @__PURE__ */ import_react46.default.createElement(DragOverlay, { + /* @__PURE__ */ import_react50.default.createElement(DragOverlay, { adjustScale: false - }, activeId ? /* @__PURE__ */ import_react46.default.createElement(SortableItem, { + }, activeId ? /* @__PURE__ */ import_react50.default.createElement(SortableItem, { id: items.find((f2) => f2.id == activeId).id, field: items.find((f2) => f2.id == activeId), superstate: props.superstate, @@ -106172,7 +106596,7 @@ var SpacePropertyEditor = (props) => { )); }; function SortableItem(props) { - const { spaceInfo } = (0, import_react46.useContext)(SpaceContext); + const { spaceInfo } = (0, import_react50.useContext)(SpaceContext); const { field } = props; const saveField = (field2, oldField) => { if (field2.name.length > 0) { @@ -106194,13 +106618,13 @@ function SortableItem(props) { }; props.saveColumn(newField); }; - return /* @__PURE__ */ import_react46.default.createElement("div", { + return /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-property-editor-property", ref: setNodeRef, style, ...attributes, ...listeners - }, /* @__PURE__ */ import_react46.default.createElement("div", { + }, /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-path-context-field-icon", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker(icon) @@ -106208,7 +106632,7 @@ function SortableItem(props) { onClick: (e4) => { selectPropertyTypeMenu(e4, props.superstate.ui, selectedType); } - }), props.field.name, /* @__PURE__ */ import_react46.default.createElement("span", null), /* @__PURE__ */ import_react46.default.createElement("div", { + }), props.field.name, /* @__PURE__ */ import_react50.default.createElement("span", null), /* @__PURE__ */ import_react50.default.createElement("div", { className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//options") @@ -106233,7 +106657,7 @@ function SortableItem(props) { } // src/core/react/components/UI/Modals/ContextEditor.tsx -var import_react60 = __toESM(require_react()); +var import_react64 = __toESM(require_react()); // src/core/react/components/UI/Menus/properties/linkMenu.tsx var showLinkMenu = (e4, superstate, saveLink, options) => { @@ -106394,7 +106818,7 @@ var allMetadata = (superstate) => ({ }); // src/core/react/components/Navigator/SpaceEditor.tsx -var import_react59 = __toESM(require_react()); +var import_react63 = __toESM(require_react()); // src/core/utils/contexts/embed.ts var framePathForSpace = (space2, schema) => { @@ -106428,19 +106852,19 @@ var contextViewEmbedStringFromContext = (space2, schema) => `![![${framePathForS var contextEmbedStringFromContext = (space2, schema) => `![![${contextPathForSpace(space2, schema)}]]`; // src/core/react/components/SpaceView/Contexts/Header/ActionsList.tsx -var import_react47 = __toESM(require_react()); +var import_react51 = __toESM(require_react()); var ActionsList = (props) => { - const { pathState } = (0, import_react47.useContext)(PathContext); - const { spaceState } = (0, import_react47.useContext)(SpaceContext); - const [actions, setActions] = import_react47.default.useState([]); - (0, import_react47.useEffect)(() => { + const { pathState } = (0, import_react51.useContext)(PathContext); + const { spaceState } = (0, import_react51.useContext)(SpaceContext); + const [actions, setActions] = import_react51.default.useState([]); + (0, import_react51.useEffect)(() => { refreshData({ path: pathState.path }); }, []); const refreshData = (payload) => { if (payload.path == pathState?.path) props.superstate.spaceManager.commandsForSpace(pathState.path).then((f2) => setActions(f2)); }; - (0, import_react47.useEffect)(() => { + (0, import_react51.useEffect)(() => { props.superstate.eventsDispatcher.addListener( "actionStateUpdated", refreshData @@ -106455,7 +106879,7 @@ var ActionsList = (props) => { const newAction = (e4) => { props.superstate.ui.openModal( i18n_default.labels.newAction, - (_props) => /* @__PURE__ */ import_react47.default.createElement(InputModal, { + (_props) => /* @__PURE__ */ import_react51.default.createElement(InputModal, { value: "", saveLabel: i18n_default.buttons.save, hide: _props.hide, @@ -106469,37 +106893,37 @@ var ActionsList = (props) => { }) ); }; - return /* @__PURE__ */ import_react47.default.createElement("div", { + return /* @__PURE__ */ import_react51.default.createElement("div", { className: "mk-actions-list" - }, /* @__PURE__ */ import_react47.default.createElement("div", { + }, /* @__PURE__ */ import_react51.default.createElement("div", { className: "mk-space-editor-title" - }, /* @__PURE__ */ import_react47.default.createElement("div", { + }, /* @__PURE__ */ import_react51.default.createElement("div", { className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//file-stack") } - }), i18n_default.subViews.spaceActions, /* @__PURE__ */ import_react47.default.createElement("span", null), /* @__PURE__ */ import_react47.default.createElement("button", { + }), i18n_default.subViews.spaceActions, /* @__PURE__ */ import_react51.default.createElement("span", null), /* @__PURE__ */ import_react51.default.createElement("button", { className: "mk-button-new", "aria-label": i18n_default.labels.newAction, onClick: (e4) => newAction(e4), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } - })), /* @__PURE__ */ import_react47.default.createElement("div", { + })), /* @__PURE__ */ import_react51.default.createElement("div", { className: "mk-space-editor-description" - }, i18n_default.descriptions.spaceActions), actions.map((f2, i3) => /* @__PURE__ */ import_react47.default.createElement("div", { + }, i18n_default.descriptions.spaceActions), actions.map((f2, i3) => /* @__PURE__ */ import_react51.default.createElement("div", { key: i3, className: "mk-action" - }, /* @__PURE__ */ import_react47.default.createElement("div", { + }, /* @__PURE__ */ import_react51.default.createElement("div", { className: "mk-path" - }, /* @__PURE__ */ import_react47.default.createElement("div", { + }, /* @__PURE__ */ import_react51.default.createElement("div", { className: "mk-path-icon", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker( stickerForSchema(f2.schema) ) } - }), /* @__PURE__ */ import_react47.default.createElement("div", { + }), /* @__PURE__ */ import_react51.default.createElement("div", { onClick: (e4) => { props.superstate.ui.openPath( actionPathForSpace(spaceState, f2.schema.id), @@ -106507,7 +106931,7 @@ var ActionsList = (props) => { ); props.close(); } - }, f2.schema.name)), /* @__PURE__ */ import_react47.default.createElement("span", null), /* @__PURE__ */ import_react47.default.createElement("button", { + }, f2.schema.name)), /* @__PURE__ */ import_react51.default.createElement("span", null), /* @__PURE__ */ import_react51.default.createElement("button", { onClick: () => props.superstate.cli.runCommand( actionPathForSpace(spaceState, f2.schema.id), { iterations: 0, instanceProps: {}, props: {} } @@ -106519,12 +106943,12 @@ var ActionsList = (props) => { }; // src/core/react/components/SpaceView/Contexts/Header/SpaceTemplates.tsx -var import_react48 = __toESM(require_react()); +var import_react52 = __toESM(require_react()); var TemplatesList = (props) => { - const { pathState } = (0, import_react48.useContext)(PathContext); - const { spaceState } = (0, import_react48.useContext)(SpaceContext); - const [templates, setTemplates] = import_react48.default.useState([]); - (0, import_react48.useEffect)(() => { + const { pathState } = (0, import_react52.useContext)(PathContext); + const { spaceState } = (0, import_react52.useContext)(SpaceContext); + const [templates, setTemplates] = import_react52.default.useState([]); + (0, import_react52.useEffect)(() => { refreshData({ path: pathState.path }); }, []); const refreshData = (payload) => { @@ -106533,7 +106957,7 @@ var TemplatesList = (props) => { props.superstate.spacesIndex.get(spaceState.path)?.templates ); }; - (0, import_react48.useEffect)(() => { + (0, import_react52.useEffect)(() => { props.superstate.eventsDispatcher.addListener( "spaceStateUpdated", refreshData @@ -106550,35 +106974,35 @@ var TemplatesList = (props) => { saveSpaceTemplate(props.superstate, pathState.path, space2); }); }; - return /* @__PURE__ */ import_react48.default.createElement("div", { + return /* @__PURE__ */ import_react52.default.createElement("div", { className: "mk-actions-list" - }, /* @__PURE__ */ import_react48.default.createElement("div", { + }, /* @__PURE__ */ import_react52.default.createElement("div", { className: "mk-space-editor-title" - }, /* @__PURE__ */ import_react48.default.createElement("div", { + }, /* @__PURE__ */ import_react52.default.createElement("div", { className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//file-stack") } - }), i18n_default.subViews.spaceTemplates, /* @__PURE__ */ import_react48.default.createElement("span", null), /* @__PURE__ */ import_react48.default.createElement("button", { + }), i18n_default.subViews.spaceTemplates, /* @__PURE__ */ import_react52.default.createElement("span", null), /* @__PURE__ */ import_react52.default.createElement("button", { className: "mk-button-new", "aria-label": i18n_default.labels.newAction, onClick: (e4) => newAction(e4), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } - })), /* @__PURE__ */ import_react48.default.createElement("div", { + })), /* @__PURE__ */ import_react52.default.createElement("div", { className: "mk-space-editor-description" - }, i18n_default.descriptions.spaceActions), templates.map((f2, i3) => /* @__PURE__ */ import_react48.default.createElement("div", { + }, i18n_default.descriptions.spaceActions), templates.map((f2, i3) => /* @__PURE__ */ import_react52.default.createElement("div", { key: i3, className: "mk-action" - }, /* @__PURE__ */ import_react48.default.createElement("div", { + }, /* @__PURE__ */ import_react52.default.createElement("div", { className: "mk-path" - }, /* @__PURE__ */ import_react48.default.createElement("div", { + }, /* @__PURE__ */ import_react52.default.createElement("div", { className: "mk-path-icon", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//clipboard-pen") } - }), /* @__PURE__ */ import_react48.default.createElement("div", null, f2)), /* @__PURE__ */ import_react48.default.createElement("span", null), /* @__PURE__ */ import_react48.default.createElement("div", { + }), /* @__PURE__ */ import_react52.default.createElement("div", null, f2)), /* @__PURE__ */ import_react52.default.createElement("span", null), /* @__PURE__ */ import_react52.default.createElement("div", { className: "mk-path-icon", onClick: () => props.superstate.spaceManager.deleteTemplate(f2, spaceState.path), dangerouslySetInnerHTML: { @@ -106588,15 +107012,15 @@ var TemplatesList = (props) => { }; // src/core/react/context/WindowContext.tsx -var import_react49 = __toESM(require_react()); +var import_react53 = __toESM(require_react()); var import_react_dom3 = __toESM(require_react_dom()); -var WindowContext = import_react49.default.createContext({ +var WindowContext = import_react53.default.createContext({ dragNode: null, setDragNode: () => null, dragActive: false }); var WindowProvider = (props) => { - const [dragNode, setDragNode] = import_react49.default.useState(null); + const [dragNode, setDragNode] = import_react53.default.useState(null); useDndMonitor({ onDragCancel: () => { setDragNode(null); @@ -106605,14 +107029,14 @@ var WindowProvider = (props) => { setDragNode(null); } }); - return /* @__PURE__ */ import_react49.default.createElement(WindowContext.Provider, { + return /* @__PURE__ */ import_react53.default.createElement(WindowContext.Provider, { value: { dragNode, setDragNode, dragActive: props.dragActive } }, props.children, dragNode && (0, import_react_dom3.createPortal)( - /* @__PURE__ */ import_react49.default.createElement(DragOverlay, { + /* @__PURE__ */ import_react53.default.createElement(DragOverlay, { dropAnimation: null, zIndex: 1600 }, dragNode), @@ -106621,10 +107045,10 @@ var WindowProvider = (props) => { }; // src/core/react/components/UI/Crumbs/ContextTableCrumb.tsx -var import_react50 = __toESM(require_react()); +var import_react54 = __toESM(require_react()); var ContextTableCrumb = (props) => { - const { setDragNode } = (0, import_react50.useContext)(WindowContext); - const { spaceInfo } = (0, import_react50.useContext)(SpaceContext); + const { setDragNode } = (0, import_react54.useContext)(WindowContext); + const { spaceInfo } = (0, import_react54.useContext)(SpaceContext); const dragId = spaceInfo.path + props.schema.id; const { attributes, @@ -106640,19 +107064,19 @@ var ContextTableCrumb = (props) => { schema: props.schema.id } }); - const ref2 = (0, import_react50.useRef)(null); + const ref2 = (0, import_react54.useRef)(null); useDndMonitor({ onDragStart: (e4) => { if (e4.active.data.current.id == dragId) { setDragNode( - /* @__PURE__ */ import_react50.default.createElement("div", { + /* @__PURE__ */ import_react54.default.createElement("div", { dangerouslySetInnerHTML: { __html: ref2.current.innerHTML } }) ); } } }); - return /* @__PURE__ */ import_react50.default.createElement("div", { + return /* @__PURE__ */ import_react54.default.createElement("div", { className: "mk-path", onClick: (e4) => props.onClick(e4), ref: (el) => { @@ -106662,7 +107086,7 @@ var ContextTableCrumb = (props) => { onContextMenu: (e4) => props.onContextMenu(e4), ...attributes, ...listeners - }, /* @__PURE__ */ import_react50.default.createElement("div", { + }, /* @__PURE__ */ import_react54.default.createElement("div", { className: "mk-path-icon", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker( @@ -106673,12 +107097,12 @@ var ContextTableCrumb = (props) => { }; // src/core/react/components/SpaceView/Contexts/Header/TableList.tsx -var import_react51 = __toESM(require_react()); +var import_react55 = __toESM(require_react()); var TableList = (props) => { - const { pathState } = (0, import_react51.useContext)(PathContext); - const { spaceState } = (0, import_react51.useContext)(SpaceContext); - const [tables, setTables] = (0, import_react51.useState)([]); - (0, import_react51.useEffect)(() => { + const { pathState } = (0, import_react55.useContext)(PathContext); + const { spaceState } = (0, import_react55.useContext)(SpaceContext); + const [tables, setTables] = (0, import_react55.useState)([]); + (0, import_react55.useEffect)(() => { refreshData({ path: pathState.path }); }, []); const refreshData = (payload) => { @@ -106687,7 +107111,7 @@ var TableList = (props) => { (props.superstate.contextsIndex.get(pathState?.path)?.schemas ?? []).filter((f2) => f2.primary != "true") ); }; - (0, import_react51.useEffect)(() => { + (0, import_react55.useEffect)(() => { props.superstate.eventsDispatcher.addListener( "contextStateUpdated", refreshData @@ -106702,7 +107126,7 @@ var TableList = (props) => { const newTable = (e4) => { props.superstate.ui.openModal( i18n_default.labels.newTable, - (_props) => /* @__PURE__ */ import_react51.default.createElement(InputModal, { + (_props) => /* @__PURE__ */ import_react55.default.createElement(InputModal, { value: "", saveLabel: i18n_default.buttons.save, hide: _props.hide, @@ -106744,7 +107168,7 @@ var TableList = (props) => { onClick: (e5) => { props.superstate.ui.openModal( i18n_default.labels.renameView, - (_props) => /* @__PURE__ */ import_react51.default.createElement(InputModal, { + (_props) => /* @__PURE__ */ import_react55.default.createElement(InputModal, { value: _schema.name, saveLabel: i18n_default.labels.renameView, hide: _props.hide, @@ -106774,23 +107198,23 @@ var TableList = (props) => { defaultMenu(props.superstate.ui, menuOptions) ); }; - return /* @__PURE__ */ import_react51.default.createElement("div", null, /* @__PURE__ */ import_react51.default.createElement("div", { + return /* @__PURE__ */ import_react55.default.createElement("div", null, /* @__PURE__ */ import_react55.default.createElement("div", { className: "mk-space-editor-title" - }, /* @__PURE__ */ import_react51.default.createElement("div", { + }, /* @__PURE__ */ import_react55.default.createElement("div", { className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//file-stack") } - }), i18n_default.subViews.spaceLists, /* @__PURE__ */ import_react51.default.createElement("span", null), /* @__PURE__ */ import_react51.default.createElement("button", { + }), i18n_default.subViews.spaceLists, /* @__PURE__ */ import_react55.default.createElement("span", null), /* @__PURE__ */ import_react55.default.createElement("button", { className: "mk-button-new", "aria-label": i18n_default.labels.newTable, onClick: (e4) => newTable(e4), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } - })), /* @__PURE__ */ import_react51.default.createElement("div", { + })), /* @__PURE__ */ import_react55.default.createElement("div", { className: "mk-space-editor-description" - }, i18n_default.descriptions.spaceLists), tables.map((f2, i3) => /* @__PURE__ */ import_react51.default.createElement(ContextTableCrumb, { + }, i18n_default.descriptions.spaceLists), tables.map((f2, i3) => /* @__PURE__ */ import_react55.default.createElement(ContextTableCrumb, { key: i3, superstate: props.superstate, schema: f2, @@ -106815,6 +107239,8 @@ var filterFnLabels = { notInclude: i18n_default.filterTypes.notContains, is: i18n_default.filterTypes.is, isNot: i18n_default.filterTypes.isNot, + isLink: i18n_default.filterTypes.is, + isNotLink: i18n_default.filterTypes.isNot, equal: "=", isGreatThan: ">", isLessThan: "<", @@ -106824,6 +107250,7 @@ var filterFnLabels = { dateAfter: i18n_default.filterTypes.after, isSameDate: i18n_default.filterTypes.isSameDate, isSameDateAsToday: i18n_default.filterTypes.isSameDateAsToday, + isExactList: i18n_default.filterTypes.is, isAnyInList: i18n_default.filterTypes.anyOf, isNoneInList: i18n_default.filterTypes.noneOf, isTrue: i18n_default.filterTypes.checked, @@ -106831,74 +107258,91 @@ var filterFnLabels = { }; // src/core/react/components/Navigator/SpaceQuery.tsx -var import_react58 = __toESM(require_react()); +var import_react62 = __toESM(require_react()); // src/core/react/components/UI/Menus/navigator/showSpaceAddMenu.tsx -var import_react52 = __toESM(require_react()); +var import_react56 = __toESM(require_react()); var showSpaceAddMenu = (superstate, offset2, space2, dontOpen) => { const menuOptions = []; - menuOptions.push({ - name: i18n_default.labels.createNote, - icon: "ui//edit", - onClick: (e4) => { - newPathInSpace( - superstate, - space2, - "md", - superstate.settings.newNotePlaceholder, - dontOpen - ); - } - }); - menuOptions.push({ - name: i18n_default.buttons.createCanvas, - icon: "ui//layout-dashboard", - onClick: (e4) => { - newPathInSpace(superstate, space2, "canvas", null, dontOpen); - } - }); - menuOptions.push({ - name: i18n_default.labels.createSection, - icon: "ui//folder-plus", - onClick: (e4) => { - superstate.ui.openModal( - i18n_default.labels.createSection, - (props) => /* @__PURE__ */ import_react52.default.createElement(InputModal, { - saveLabel: i18n_default.buttons.createFolder, - value: "", - hide: props.hide, - saveValue: (v2) => { - let pathState = superstate.pathsIndex.get(space2?.path); - if (!pathState) { - pathState = superstate.pathsIndex.get("/"); - } - const newName = v2.replace(/\//g, ""); - const parentPath = pathState?.subtype == "folder" ? pathState.path : pathState.parent ? pathState.parent : "/"; - const newPath = !parentPath || parentPath == "/" ? newName : parentPath + "/" + newName; - if (newName.length == 0) { - superstate.ui.notify(i18n_default.notice.newSpaceName); - return; - } - if (superstate.spacesIndex.has(newPath)) { - superstate.ui.notify(i18n_default.notice.duplicateSpaceName); - return; + if (space2.type == "default") { + menuOptions.push({ + name: "New Tag", + icon: "ui//tags", + onClick: (e4) => { + superstate.ui.openModal("New Tag", (props) => { + return /* @__PURE__ */ import_react56.default.createElement(InputModal, { + value: "", + saveLabel: i18n_default.labels.saveView, + hide: props.hide, + saveValue: (value) => addTag(superstate, value) + }); + }); + } + }); + } else { + menuOptions.push({ + name: i18n_default.labels.createNote, + icon: "ui//edit", + onClick: (e4) => { + newPathInSpace( + superstate, + space2, + "md", + superstate.settings.newNotePlaceholder, + dontOpen + ); + } + }); + menuOptions.push({ + name: i18n_default.buttons.createCanvas, + icon: "ui//layout-dashboard", + onClick: (e4) => { + newPathInSpace(superstate, space2, "canvas", null, dontOpen); + } + }); + menuOptions.push({ + name: i18n_default.labels.createSection, + icon: "ui//folder-plus", + onClick: (e4) => { + superstate.ui.openModal( + i18n_default.labels.createSection, + (props) => /* @__PURE__ */ import_react56.default.createElement(InputModal, { + saveLabel: i18n_default.buttons.createFolder, + value: "", + hide: props.hide, + saveValue: (v2) => { + let pathState = superstate.pathsIndex.get(space2?.path); + if (!pathState) { + pathState = superstate.pathsIndex.get("/"); + } + const newName = v2.replace(/\//g, ""); + const parentPath = pathState?.subtype == "folder" ? pathState.path : pathState.parent ? pathState.parent : "/"; + const newPath = !parentPath || parentPath == "/" ? newName : parentPath + "/" + newName; + if (newName.length == 0) { + superstate.ui.notify(i18n_default.notice.newSpaceName); + return; + } + if (superstate.spacesIndex.has(newPath)) { + superstate.ui.notify(i18n_default.notice.duplicateSpaceName); + return; + } + createSpace(superstate, newPath, {}); } - createSpace(superstate, newPath, {}); + }) + ); + } + }); + if (space2.templates.length > 0) { + menuOptions.push(menuSeparator); + for (const template2 of space2.templates) { + menuOptions.push({ + name: template2, + icon: "ui//clipboard-pen", + onClick: (e4) => { + newTemplateInSpace(superstate, space2, template2); } - }) - ); - } - }); - if (space2.templates.length > 0) { - menuOptions.push(menuSeparator); - for (const template2 of space2.templates) { - menuOptions.push({ - name: template2, - icon: "ui//clipboard-pen", - onClick: (e4) => { - newTemplateInSpace(superstate, space2, template2); - } - }); + }); + } } } return superstate.ui.openMenu( @@ -106908,27 +107352,27 @@ var showSpaceAddMenu = (superstate, offset2, space2, dontOpen) => { }; // src/core/react/components/SpaceView/Contexts/FilterBar/FilterBar.tsx -var import_react57 = __toESM(require_react()); +var import_react61 = __toESM(require_react()); // src/core/react/components/SpaceView/Contexts/FilterBar/CustomVIewOption.tsx -var import_react53 = __toESM(require_react()); +var import_react57 = __toESM(require_react()); var CustomViewOption = (props) => { - return /* @__PURE__ */ import_react53.default.createElement("div", { + return /* @__PURE__ */ import_react57.default.createElement("div", { className: "mk-menu-option", onClick: () => { props.onSelect(); props.hide(); } - }, /* @__PURE__ */ import_react53.default.createElement(Sticker, { + }, /* @__PURE__ */ import_react57.default.createElement(Sticker, { ui: props.ui, sticker: props.icon - }), /* @__PURE__ */ import_react53.default.createElement("div", { + }), /* @__PURE__ */ import_react57.default.createElement("div", { className: "mk-menu-options-inner" - }, /* @__PURE__ */ import_react53.default.createElement("span", null, props.type)), props.selected && /* @__PURE__ */ import_react53.default.createElement("div", { + }, /* @__PURE__ */ import_react57.default.createElement("span", null, props.type)), props.selected && /* @__PURE__ */ import_react57.default.createElement("div", { dangerouslySetInnerHTML: { __html: props.ui.getSticker("ui//check") } - }), /* @__PURE__ */ import_react53.default.createElement("button", { + }), /* @__PURE__ */ import_react57.default.createElement("button", { onClick: (e4) => { e4.preventDefault(); props.hide(); @@ -106943,13 +107387,13 @@ var CustomViewOption = (props) => { }; // src/core/react/components/UI/Crumbs/ContextViewCrumb.tsx -var import_react54 = __toESM(require_react()); +var import_react58 = __toESM(require_react()); var ContextViewCrumb = (props) => { - return /* @__PURE__ */ import_react54.default.createElement("div", { + return /* @__PURE__ */ import_react58.default.createElement("div", { onClick: (e4) => props.onSelect(e4), onContextMenu: (e4) => props.onContextMenu(e4, props.schema), className: "mk-context" - }, /* @__PURE__ */ import_react54.default.createElement("div", { + }, /* @__PURE__ */ import_react58.default.createElement("div", { className: "mk-path-icon", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker( @@ -106960,16 +107404,16 @@ var ContextViewCrumb = (props) => { }; // src/core/react/components/SpaceView/Contexts/FilterBar/ListSelector.tsx -var import_react55 = __toESM(require_react()); +var import_react59 = __toESM(require_react()); var ListSelector = (props) => { - const { views, setEditMode } = (0, import_react55.useContext)(ContextEditorContext); - const { spaceState } = (0, import_react55.useContext)(SpaceContext); + const { views, setEditMode } = (0, import_react59.useContext)(ContextEditorContext); + const { spaceState } = (0, import_react59.useContext)(SpaceContext); const { frameSchema: schema, setFrameSchema: setSchema, saveSchema, deleteSchema - } = (0, import_react55.useContext)(FramesMDBContext); + } = (0, import_react59.useContext)(FramesMDBContext); const viewContextMenu = (e4, _schema) => { const menuOptions = []; menuOptions.push({ @@ -106987,7 +107431,7 @@ var ListSelector = (props) => { onClick: (e5) => { props.superstate.ui.openModal( i18n_default.labels.renameView, - (props2) => /* @__PURE__ */ import_react55.default.createElement(InputModal, { + (props2) => /* @__PURE__ */ import_react59.default.createElement(InputModal, { value: _schema.name, saveLabel: i18n_default.labels.renameView, hide: props2.hide, @@ -107016,11 +107460,11 @@ var ListSelector = (props) => { if (props.setView) props.setView(value); }; - const ref2 = (0, import_react55.useRef)(null); + const ref2 = (0, import_react59.useRef)(null); const showSaveViewModal = () => { props.superstate.ui.openModal( i18n_default.labels.saveView, - (props2) => /* @__PURE__ */ import_react55.default.createElement(InputModal, { + (props2) => /* @__PURE__ */ import_react59.default.createElement(InputModal, { value: "", saveLabel: i18n_default.labels.saveView, hide: props2.hide, @@ -107055,23 +107499,23 @@ var ListSelector = (props) => { "bottom" ); }; - return schema && /* @__PURE__ */ import_react55.default.createElement(import_react55.default.Fragment, null, /* @__PURE__ */ import_react55.default.createElement("div", { + return schema && /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, /* @__PURE__ */ import_react59.default.createElement("div", { className: "mk-view-selector", ref: ref2 - }, props.expanded ? /* @__PURE__ */ import_react55.default.createElement(import_react55.default.Fragment, null, views.map((f2, i3) => /* @__PURE__ */ import_react55.default.createElement(ContextViewCrumb, { + }, props.expanded ? /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, views.map((f2, i3) => /* @__PURE__ */ import_react59.default.createElement(ContextViewCrumb, { key: i3, superstate: props.superstate, schema: f2, onSelect: () => setSchema(views.find((g) => g.id == f2.id)), onContextMenu: viewContextMenu - })), /* @__PURE__ */ import_react55.default.createElement("button", { + })), /* @__PURE__ */ import_react59.default.createElement("button", { onClick: (e4) => showSaveViewModal() - }, "+")) : /* @__PURE__ */ import_react55.default.createElement(ContextViewCrumb, { + }, "+")) : /* @__PURE__ */ import_react59.default.createElement(ContextViewCrumb, { superstate: props.superstate, schema, onSelect: (e4) => selectViewMenu(e4), onContextMenu: viewContextMenu - }, /* @__PURE__ */ import_react55.default.createElement(CollapseToggle, { + }, /* @__PURE__ */ import_react59.default.createElement(CollapseToggle, { collapsed: false, onToggle: null, superstate: props.superstate @@ -107079,20 +107523,20 @@ var ListSelector = (props) => { }; // src/core/react/components/SpaceView/Contexts/FilterBar/SearchBar.tsx -var import_react56 = __toESM(require_react()); +var import_react60 = __toESM(require_react()); var SearchBar = (props) => { - const [searchActive, setSearchActive] = import_react56.default.useState(false); + const [searchActive, setSearchActive] = import_react60.default.useState(false); const clearSearch = () => { setSearchActive(false); props.setSearchString(""); }; - const ref2 = import_react56.default.useRef(null); - (0, import_react56.useEffect)(() => { + const ref2 = import_react60.default.useRef(null); + (0, import_react60.useEffect)(() => { if (searchActive) { ref2.current?.focus(); } }, [searchActive]); - return !searchActive ? /* @__PURE__ */ import_react56.default.createElement("button", { + return !searchActive ? /* @__PURE__ */ import_react60.default.createElement("button", { onClick: (e4) => { e4.stopPropagation(); setSearchActive(true); @@ -107100,18 +107544,18 @@ var SearchBar = (props) => { dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//search") } - }) : /* @__PURE__ */ import_react56.default.createElement("div", { + }) : /* @__PURE__ */ import_react60.default.createElement("div", { className: "mk-view-search" - }, /* @__PURE__ */ import_react56.default.createElement("button", { + }, /* @__PURE__ */ import_react60.default.createElement("button", { dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//search") } - }), /* @__PURE__ */ import_react56.default.createElement(import_react56.default.Fragment, null, /* @__PURE__ */ import_react56.default.createElement("input", { + }), /* @__PURE__ */ import_react60.default.createElement(import_react60.default.Fragment, null, /* @__PURE__ */ import_react60.default.createElement("input", { onChange: (e4) => props.setSearchString(e4.target.value), placeholder: i18n_default.labels.searchPlaceholder, className: "mk-search-bar", ref: ref2 - }), /* @__PURE__ */ import_react56.default.createElement("button", { + }), /* @__PURE__ */ import_react60.default.createElement("button", { dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//clear") }, @@ -107124,8 +107568,8 @@ var SearchBar = (props) => { // src/core/react/components/SpaceView/Contexts/FilterBar/FilterBar.tsx var FilterBar = (props) => { - const { spaceInfo, spaceState: spaceCache } = (0, import_react57.useContext)(SpaceContext); - const { setDBSchema, saveSchema, dbSchema, contextTable, cols, tableData } = (0, import_react57.useContext)(ContextMDBContext); + const { spaceInfo, spaceState: spaceCache } = (0, import_react61.useContext)(SpaceContext); + const { setDBSchema, saveSchema, dbSchema, contextTable, cols, tableData } = (0, import_react61.useContext)(ContextMDBContext); const { setSearchString, setEditMode, @@ -107135,13 +107579,12 @@ var FilterBar = (props) => { saveColumn, sortColumn, delColumn - } = (0, import_react57.useContext)(ContextEditorContext); + } = (0, import_react61.useContext)(ContextEditorContext); const filteredCols = cols.filter((f2) => f2.hidden != "true"); - const [expanded, setExpanded] = (0, import_react57.useState)(false); + const [expanded, setExpanded] = (0, import_react61.useState)(false); const saveViewType = (type) => { if (type == "table") { savePredicate({ - ...predicate, view: "table", listView: "", listGroup: "", @@ -107150,7 +107593,6 @@ var FilterBar = (props) => { } if (type == "flow") { savePredicate({ - ...predicate, view: "list", listView: "spaces://$kit/#*listView", listGroup: "spaces://$kit/#*listGroup", @@ -107159,7 +107601,6 @@ var FilterBar = (props) => { } if (type == "list") { savePredicate({ - ...predicate, view: "list", listView: "spaces://$kit/#*listView", listGroup: "spaces://$kit/#*listGroup", @@ -107168,7 +107609,6 @@ var FilterBar = (props) => { } if (type == "details") { savePredicate({ - ...predicate, view: "list", listView: "spaces://$kit/#*listView", listGroup: "spaces://$kit/#*listGroup", @@ -107177,7 +107617,6 @@ var FilterBar = (props) => { } if (type == "board") { savePredicate({ - ...predicate, view: "list", listView: "spaces://$kit/#*columnView", listGroup: "spaces://$kit/#*columnGroup", @@ -107186,7 +107625,6 @@ var FilterBar = (props) => { } if (type == "cards") { savePredicate({ - ...predicate, view: "list", listView: "spaces://$kit/#*listView", listGroup: "spaces://$kit/#*gridGroup", @@ -107195,7 +107633,6 @@ var FilterBar = (props) => { } if (type == "catalog") { savePredicate({ - ...predicate, view: "list", listView: "spaces://$kit/#*listView", listGroup: "spaces://$kit/#*rowGroup", @@ -107204,7 +107641,6 @@ var FilterBar = (props) => { } if (type == "gallery") { savePredicate({ - ...predicate, view: "list", listView: "spaces://$kit/#*listView", listGroup: "spaces://$kit/#*masonryGroup", @@ -107213,7 +107649,6 @@ var FilterBar = (props) => { } if (type == "calendar") { savePredicate({ - ...predicate, view: "list", listView: "spaces://$kit/#*calendarView", listGroup: "spaces://$kit/#*dateGroup", @@ -107223,33 +107658,29 @@ var FilterBar = (props) => { }; const clearFilters = () => { savePredicate({ - ...predicate, filters: [], sort: [] }); }; const clearHiddenCols = () => { savePredicate({ - ...predicate, colsHidden: [] }); }; - const removeFilter = (filter2) => { - const newFilters = [ - ...predicate.filters.filter((f2) => f2.field != filter2.field) - ]; + const removeFilter = (filter2, index) => { + const pred = predicate ?? defaultPredicate; + const newFilters = [...pred.filters.filter((f2, i3) => i3 != index)]; savePredicate({ - ...predicate, filters: newFilters }); }; const showViewsMenu = (e4) => { const menuOptions = []; - if (predicate.listItem?.length > 0 && !predicate.listItem.startsWith("spaces://$kit")) { + if (predicate?.listItem?.length > 0 && !predicate.listItem.startsWith("spaces://$kit")) { menuOptions.push({ name: i18n_default.menu.customView, type: 5 /* Custom */, - fragment: (_props) => /* @__PURE__ */ import_react57.default.createElement(CustomViewOption, { + fragment: (_props) => /* @__PURE__ */ import_react61.default.createElement(CustomViewOption, { ui: props.superstate.ui, icon: "ui//toy-brick", type: i18n_default.menu.customView, @@ -107265,12 +107696,12 @@ var FilterBar = (props) => { menuOptions.push({ name: i18n_default.menu.listView, type: 5 /* Custom */, - fragment: (_props) => /* @__PURE__ */ import_react57.default.createElement(CustomViewOption, { + fragment: (_props) => /* @__PURE__ */ import_react61.default.createElement(CustomViewOption, { ui: props.superstate.ui, icon: "ui//list", type: i18n_default.menu.listView, onSelect: () => saveViewType("list"), - selected: predicate.listItem == "spaces://$kit/#*rowItem", + selected: predicate?.listItem == "spaces://$kit/#*rowItem", hide: _props.hide, onCustomize: () => { saveViewType("list"); @@ -107281,13 +107712,13 @@ var FilterBar = (props) => { menuOptions.push({ name: i18n_default.menu.cardView, type: 5 /* Custom */, - fragment: (_props) => /* @__PURE__ */ import_react57.default.createElement(CustomViewOption, { + fragment: (_props) => /* @__PURE__ */ import_react61.default.createElement(CustomViewOption, { ui: props.superstate.ui, icon: "ui//layout-grid", type: i18n_default.menu.cardView, onSelect: () => saveViewType("cards"), hide: _props.hide, - selected: predicate.listItem == "spaces://$kit/#*cardsListItem", + selected: predicate?.listItem == "spaces://$kit/#*cardsListItem", onCustomize: () => { saveViewType("card"); setEditMode(3 /* Group */); @@ -107297,13 +107728,13 @@ var FilterBar = (props) => { menuOptions.push({ name: i18n_default.menu.detailsView, type: 5 /* Custom */, - fragment: (_props) => /* @__PURE__ */ import_react57.default.createElement(CustomViewOption, { + fragment: (_props) => /* @__PURE__ */ import_react61.default.createElement(CustomViewOption, { ui: props.superstate.ui, icon: "ui//layout-list", type: i18n_default.menu.detailsView, onSelect: () => saveViewType("details"), hide: _props.hide, - selected: predicate.listItem == "spaces://$kit/#*detailItem", + selected: predicate?.listItem == "spaces://$kit/#*detailItem", onCustomize: () => { saveViewType("details"); setEditMode(3 /* Group */); @@ -107321,13 +107752,13 @@ var FilterBar = (props) => { menuOptions.push({ name: i18n_default.menu.boardView, type: 5 /* Custom */, - fragment: (_props) => /* @__PURE__ */ import_react57.default.createElement(CustomViewOption, { + fragment: (_props) => /* @__PURE__ */ import_react61.default.createElement(CustomViewOption, { ui: props.superstate.ui, icon: "ui//square-kanban", type: i18n_default.menu.boardView, onSelect: () => saveViewType("board"), hide: _props.hide, - selected: predicate.listItem == "spaces://$kit/#*cardListItem", + selected: predicate?.listItem == "spaces://$kit/#*cardListItem", onCustomize: () => { saveViewType("card"); setEditMode(3 /* Group */); @@ -107338,13 +107769,13 @@ var FilterBar = (props) => { menuOptions.push({ name: i18n_default.menu.catalogView, type: 5 /* Custom */, - fragment: (_props) => /* @__PURE__ */ import_react57.default.createElement(CustomViewOption, { + fragment: (_props) => /* @__PURE__ */ import_react61.default.createElement(CustomViewOption, { ui: props.superstate.ui, icon: "ui//gallery-horizontal-end", type: i18n_default.menu.catalogView, hide: _props.hide, onSelect: () => saveViewType("catalog"), - selected: predicate.listItem == "spaces://$kit/#*coverListItem", + selected: predicate?.listItem == "spaces://$kit/#*coverListItem", onCustomize: () => { saveViewType("catalog"); setEditMode(3 /* Group */); @@ -107354,13 +107785,13 @@ var FilterBar = (props) => { menuOptions.push({ name: i18n_default.menu.galleryView, type: 5 /* Custom */, - fragment: (_props) => /* @__PURE__ */ import_react57.default.createElement(CustomViewOption, { + fragment: (_props) => /* @__PURE__ */ import_react61.default.createElement(CustomViewOption, { ui: props.superstate.ui, icon: "ui//layout-dashboard", type: i18n_default.menu.galleryView, hide: _props.hide, onSelect: () => saveViewType("gallery"), - selected: predicate.listItem == "spaces://$kit/#*imageListItem", + selected: predicate?.listItem == "spaces://$kit/#*imageListItem", onCustomize: () => { saveViewType("gallery"); setEditMode(3 /* Group */); @@ -107371,13 +107802,13 @@ var FilterBar = (props) => { menuOptions.push({ name: i18n_default.menu.flowView, type: 5 /* Custom */, - fragment: (_props) => /* @__PURE__ */ import_react57.default.createElement(CustomViewOption, { + fragment: (_props) => /* @__PURE__ */ import_react61.default.createElement(CustomViewOption, { ui: props.superstate.ui, icon: "ui//infinity", type: i18n_default.menu.flowView, onSelect: () => saveViewType("flow"), hide: _props.hide, - selected: predicate.listItem == "spaces://$kit/#*flowListItem", + selected: predicate?.listItem == "spaces://$kit/#*flowListItem", onCustomize: () => { saveViewType("flow"); setEditMode(3 /* Group */); @@ -107449,9 +107880,8 @@ var FilterBar = (props) => { fn: type }; savePredicate({ - ...predicate, sort: [ - ...predicate.sort.filter((s4) => s4.field != newSort.field), + ...predicate?.sort.filter((s4) => s4.field != newSort.field) ?? [], newSort ] }); @@ -107459,22 +107889,25 @@ var FilterBar = (props) => { }; const saveGroupBy = (_18, groupBy2) => { savePredicate({ - ...predicate, groupBy: groupBy2 }); }; const removeSort = (sort) => { - const newSort = [...predicate.sort.filter((f2) => f2.field != sort.field)]; + const newSort = [ + ...(predicate?.sort ?? []).filter((f2) => f2.field != sort.field) + ]; savePredicate({ - ...predicate, sort: newSort }); }; const addFilter = (_18, filter2) => { const field = filter2[0]; - const fieldType = filteredCols.find((f2) => f2.name + f2.table == field)?.type; + const fieldObject = filteredCols.find((f2) => f2.name + f2.table == field); + const fieldType = fieldTypeForField(fieldObject); if (fieldType) { const type = defaultPredicateFnForType(fieldType, filterFnTypes); + if (!type) + return; const newFilter = fieldType == "boolean" ? { field, fn: type, @@ -107485,11 +107918,7 @@ var FilterBar = (props) => { value: "" }; savePredicate({ - ...predicate, - filters: [ - ...predicate.filters.filter((s4) => s4.field != newFilter.field), - newFilter - ] + filters: [...predicate?.filters ?? [], newFilter] }); } }; @@ -107502,16 +107931,16 @@ var FilterBar = (props) => { fn: type }; savePredicate({ - ...predicate, sort: [ - ...predicate.sort.filter((s4) => s4.field != newSort.field), + ...(predicate?.sort ?? []).filter((s4) => s4.field != newSort.field), newSort ] }); }; - const fieldType = filteredCols.find( + const fieldObject = filteredCols.find( (f2) => f2.name + f2.table == sort.field - )?.type; + ); + const fieldType = fieldTypeForField(fieldObject); const sortsForType = predicateFnsForType(fieldType, sortFnTypes); props.superstate.ui.openMenu(offset2, { ui: props.superstate.ui, @@ -107556,10 +107985,10 @@ var FilterBar = (props) => { hide: hideColumn, deleteColumn: delColumn, sortColumn, - hidden: predicate.colsHidden.includes(field.name + field.table) + hidden: predicate?.colsHidden.includes(field.name + field.table) }); }; - const changeFilterMenu = (e4, filter2) => { + const changeFilterMenu = (e4, filter2, index) => { const offset2 = e4.target.getBoundingClientRect(); const saveFilter = (_18, newType) => { const type = newType[0]; @@ -107568,16 +107997,13 @@ var FilterBar = (props) => { fn: type }; savePredicate({ - ...predicate, - filters: [ - ...predicate.filters.filter((s4) => s4.field != newFilter.field), - newFilter - ] + filters: (predicate?.filters ?? []).map( + (s4, i3) => i3 == index ? newFilter : s4 + ) }); }; - const fieldType = filteredCols.find( - (f2) => f2.name + f2.table == filter2.field - )?.type; + const field = filteredCols.find((f2) => f2.name + f2.table == filter2.field); + const fieldType = fieldTypeForField(field); const filtersForType = predicateFnsForType(fieldType, filterFnTypes); props.superstate.ui.openMenu(offset2, { ui: props.superstate.ui, @@ -107601,13 +108027,16 @@ var FilterBar = (props) => { multi: false, editable: false, value: [], - options: filteredCols.filter((f2) => predicateFnsForType(f2.type, filterFnTypes).length > 0).map((f2) => ({ + options: filteredCols.filter( + (f2) => f2.type == "fileprop" || predicateFnsForType(f2.type, filterFnTypes).length > 0 + ).map((f2) => ({ name: f2.name + f2.table, - value: f2.name + f2.table + value: f2.name + f2.table, + icon: stickerForField(f2) })), saveOptions: addFilter, placeholder: i18n_default.labels.propertyItemSelectPlaceholder, - searchable: false, + searchable: true, showAll: true }); }; @@ -107624,7 +108053,7 @@ var FilterBar = (props) => { })), saveOptions: addSort, placeholder: i18n_default.labels.sortItemSelectPlaceholder, - searchable: false, + searchable: true, showAll: true }); }; @@ -107649,17 +108078,15 @@ var FilterBar = (props) => { "right" ); }; - const selectFilterValue = (e4, filter2) => { + const selectFilterValue = (e4, filter2, index) => { switch (filterFnTypes[filter2.fn].valueType) { case "text": case "number": { savePredicate({ - ...predicate, - filters: [ - ...predicate.filters.filter((s4) => s4.field != filter2.field), - filter2 - ] + filters: (predicate?.filters ?? []).map( + (s4, i3) => i3 == index ? filter2 : s4 + ) }); } break; @@ -107670,11 +108097,9 @@ var FilterBar = (props) => { value: date2 ? format(date2, "yyyy-MM-dd") : "" }; savePredicate({ - ...predicate, - filters: [ - ...predicate.filters.filter((s4) => s4.field != newFilter.field), - newFilter - ] + filters: (predicate?.filters ?? []).map( + (s4, i3) => i3 == index ? newFilter : s4 + ) }); }; const offset2 = e4.target.getBoundingClientRect(); @@ -107687,6 +108112,62 @@ var FilterBar = (props) => { ); break; } + case "link": + { + const col = cols.find((f2) => f2.name + f2.table == filter2.field); + if (col?.type.startsWith("context")) { + const space2 = parseFieldValue(col.value, col.type)?.space; + if (!space2) + return; + const contextData = props.superstate.contextsIndex.get(space2)?.paths ?? []; + const offset2 = e4.target.getBoundingClientRect(); + props.superstate.ui.openMenu(offset2, { + ui: props.superstate.ui, + multi: false, + editable: false, + value: parseMultiString(filter2.value), + options: contextData.map((f2) => ({ + name: pathToString(f2), + value: f2 + })) ?? [], + saveOptions: (options, values2) => { + const newFilter = { + ...filter2, + value: values2[0] + }; + savePredicate({ + filters: (predicate?.filters ?? []).map( + (s4, i3) => i3 == index ? newFilter : s4 + ) + }); + }, + placeholder: i18n_default.labels.optionItemSelectPlaceholder, + searchable: true, + showAll: true + }); + return; + } + const saveValue = (link) => { + const newFilter = { + ...filter2, + value: link + }; + savePredicate({ + filters: (predicate?.filters ?? []).map( + (s4, i3) => i3 == index ? newFilter : s4 + ) + }); + }; + showLinkMenu( + e4, + props.superstate, + (link) => { + saveValue(link); + }, + { multi: true } + ); + } + break; case "list": { const col = cols.find((f2) => f2.name + f2.table == filter2.field); @@ -107696,11 +108177,9 @@ var FilterBar = (props) => { value: serializeMultiString(values2) }; savePredicate({ - ...predicate, - filters: [ - ...predicate.filters.filter((s4) => s4.field != newFilter.field), - newFilter - ] + filters: (predicate?.filters ?? []).map( + (s4, i3) => i3 == index ? newFilter : s4 + ) }); }; if (col.type.startsWith("option")) { @@ -107718,7 +108197,10 @@ var FilterBar = (props) => { showAll: true }); } else if (col.type.startsWith("context")) { - const contextData = contextTable[col.table]?.rows ?? []; + const space2 = parseFieldValue(col.value, col.type)?.space; + if (!space2) + return; + const contextData = props.superstate.contextsIndex.get(space2)?.paths ?? []; const offset2 = e4.target.getBoundingClientRect(); props.superstate.ui.openMenu(offset2, { ui: props.superstate.ui, @@ -107726,14 +108208,23 @@ var FilterBar = (props) => { editable: false, value: parseMultiString(filter2.value), options: contextData.map((f2) => ({ - name: pathToString(f2[PathPropertyName]), - value: f2[PathPropertyName] + name: pathToString(f2), + value: f2 })) ?? [], saveOptions, placeholder: i18n_default.labels.optionItemSelectPlaceholder, searchable: true, showAll: true }); + } else if (col.type.startsWith("link")) { + showLinkMenu( + e4, + props.superstate, + (link) => { + saveOptions([link], [link]); + }, + { multi: true } + ); } } break; @@ -107770,38 +108261,38 @@ var FilterBar = (props) => { e4.preventDefault(); } }; - return /* @__PURE__ */ import_react57.default.createElement(import_react57.default.Fragment, null, /* @__PURE__ */ import_react57.default.createElement("div", { + return /* @__PURE__ */ import_react61.default.createElement(import_react61.default.Fragment, null, /* @__PURE__ */ import_react61.default.createElement("div", { className: "mk-view-config" - }, !expanded && dbSchema?.primary == "true" && /* @__PURE__ */ import_react57.default.createElement(ListSelector, { + }, !expanded && dbSchema?.primary == "true" && /* @__PURE__ */ import_react61.default.createElement(ListSelector, { superstate: props.superstate, expanded: false, setView: props.setView - }), /* @__PURE__ */ import_react57.default.createElement("div", { + }), /* @__PURE__ */ import_react61.default.createElement("div", { className: "mk-view-options" - }, /* @__PURE__ */ import_react57.default.createElement("span", null), /* @__PURE__ */ import_react57.default.createElement(SearchBar, { + }, /* @__PURE__ */ import_react61.default.createElement("span", null), /* @__PURE__ */ import_react61.default.createElement(SearchBar, { superstate: props.superstate, setSearchString - }), /* @__PURE__ */ import_react57.default.createElement("button", { + }), /* @__PURE__ */ import_react61.default.createElement("button", { onClick: (e4) => showViewsMenu(e4), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//layout-panel-left") } - }), /* @__PURE__ */ import_react57.default.createElement("button", { + }), /* @__PURE__ */ import_react61.default.createElement("button", { onClick: (e4) => showFilterMenu(e4), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//view-options") } - }), props.superstate.settings.experimental && /* @__PURE__ */ import_react57.default.createElement("button", { + }), props.superstate.settings.experimental && /* @__PURE__ */ import_react61.default.createElement("button", { onClick: (e4) => setEditMode((p) => p == 0 ? 3 /* Group */ : 0), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//build") } - }), dbSchema?.id == defaultContextSchemaID && /* @__PURE__ */ import_react57.default.createElement(import_react57.default.Fragment, null, /* @__PURE__ */ import_react57.default.createElement("button", { + }), dbSchema?.id == defaultContextSchemaID && /* @__PURE__ */ import_react61.default.createElement(import_react61.default.Fragment, null, /* @__PURE__ */ import_react61.default.createElement("button", { onClick: (e4) => showColsMenu(e4), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//list") } - }), /* @__PURE__ */ import_react57.default.createElement("button", { + }), /* @__PURE__ */ import_react61.default.createElement("button", { className: "mk-button-new", onClick: (e4) => showSpaceAddMenu( props.superstate, @@ -107812,69 +108303,98 @@ var FilterBar = (props) => { dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } - })))), (predicate.filters.length > 0 || predicate.sort.length > 0 || predicate.groupBy.length > 0) && /* @__PURE__ */ import_react57.default.createElement("div", { + })))), (predicate?.filters.length > 0 || predicate?.sort.length > 0 || predicate?.groupBy.length > 0) && /* @__PURE__ */ import_react61.default.createElement("div", { className: "mk-filter-bar" - }, predicate.groupBy.length > 0 && /* @__PURE__ */ import_react57.default.createElement("div", { + }, predicate.groupBy.length > 0 && /* @__PURE__ */ import_react61.default.createElement("div", { className: "mk-filter" - }, /* @__PURE__ */ import_react57.default.createElement("span", null, i18n_default.menu.groupBy), /* @__PURE__ */ import_react57.default.createElement("span", { + }, /* @__PURE__ */ import_react61.default.createElement("span", null, i18n_default.menu.groupBy), /* @__PURE__ */ import_react61.default.createElement("span", { onClick: (e4) => showGroupByMenu( e4.target.getBoundingClientRect() ) - }, predicate.groupBy[0]), /* @__PURE__ */ import_react57.default.createElement("div", { + }, predicate.groupBy[0]), /* @__PURE__ */ import_react61.default.createElement("div", { onClick: () => saveGroupBy(null, []), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//close") } - })), predicate.sort.map((f2, i3) => /* @__PURE__ */ import_react57.default.createElement("div", { + })), (predicate?.sort ?? []).map((f2, i3) => /* @__PURE__ */ import_react61.default.createElement("div", { key: i3, className: "mk-filter" - }, /* @__PURE__ */ import_react57.default.createElement("span", null, f2.field), /* @__PURE__ */ import_react57.default.createElement("span", { + }, /* @__PURE__ */ import_react61.default.createElement("span", null, f2.field), /* @__PURE__ */ import_react61.default.createElement("span", { onClick: (e4) => changeSortMenu(e4, f2) - }, sortFnTypes[f2.fn].label), /* @__PURE__ */ import_react57.default.createElement("div", { + }, sortFnTypes[f2.fn].label), /* @__PURE__ */ import_react61.default.createElement("div", { onClick: () => removeSort(f2), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//close") } - }))), predicate.filters.map((f2, i3) => /* @__PURE__ */ import_react57.default.createElement("div", { + }))), (predicate?.filters ?? [] ?? []).map((f2, i3) => /* @__PURE__ */ import_react61.default.createElement("div", { key: i3, className: "mk-filter" - }, /* @__PURE__ */ import_react57.default.createElement("span", null, f2.field), /* @__PURE__ */ import_react57.default.createElement("span", { - onClick: (e4) => changeFilterMenu(e4, f2) - }, filterFnLabels[f2.fn]), /* @__PURE__ */ import_react57.default.createElement(FilterValueSpan, { + }, /* @__PURE__ */ import_react61.default.createElement("span", null, f2.field), /* @__PURE__ */ import_react61.default.createElement("span", { + onClick: (e4) => changeFilterMenu(e4, f2, i3) + }, filterFnLabels[f2.fn]), /* @__PURE__ */ import_react61.default.createElement(FilterValueSpan, { + superstate: props.superstate, fieldType: cols.find((c3) => c3.name + c3.table == f2.field)?.type, filter: f2, - selectFilterValue - }), /* @__PURE__ */ import_react57.default.createElement("div", { - onClick: () => removeFilter(f2), + selectFilterValue: (e4, f3) => selectFilterValue(e4, f3, i3) + }), /* @__PURE__ */ import_react61.default.createElement("div", { + onClick: () => removeFilter(f2, i3), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//close") } - }))), /* @__PURE__ */ import_react57.default.createElement("span", null))); + }))), (predicate?.filters ?? []).length > 0 && /* @__PURE__ */ import_react61.default.createElement("div", { + className: "mk-filter-add", + onClick: (e4) => showAddFilterMenu(e4) + }, /* @__PURE__ */ import_react61.default.createElement("span", null, /* @__PURE__ */ import_react61.default.createElement("span", { + className: "mk-icon-xsmall", + dangerouslySetInnerHTML: { + __html: props.superstate.ui.getSticker("ui//plus") + } + }), i18n_default.buttons.addFilter)), /* @__PURE__ */ import_react61.default.createElement("span", null))); }; var FilterValueSpan = (props) => { const { filter: filter2, selectFilterValue, fieldType } = props; const fnType = filterFnTypes[filter2.fn]; + const [value, setValue] = (0, import_react61.useState)(filter2.value); + (0, import_react61.useEffect)(() => setValue(filter2.value), [filter2.value]); if (!fieldType || !fnType || fnType.valueType == "none") { - return /* @__PURE__ */ import_react57.default.createElement(import_react57.default.Fragment, null); - } else if (fieldType.startsWith("option") || fieldType.startsWith("context")) { - const options = parseMultiString(filter2.value); - return /* @__PURE__ */ import_react57.default.createElement("span", { - onClick: (e4) => selectFilterValue(e4, filter2) - }, options.map((f2, i3) => /* @__PURE__ */ import_react57.default.createElement("span", { - key: i3 - }, f2))); - } else if (fnType.valueType == "text") { - return /* @__PURE__ */ import_react57.default.createElement("input", { + return /* @__PURE__ */ import_react61.default.createElement(import_react61.default.Fragment, null); + } else if (fnType.valueType == "text" || fnType.valueType == "number") { + return /* @__PURE__ */ import_react61.default.createElement("input", { type: "text", - onInput: (e4) => selectFilterValue(null, { ...filter2, value: e4.currentTarget.value }), - value: filter2.value + onChange: (e4) => setValue(e4.currentTarget.value), + onBlur: (e4) => { + selectFilterValue(null, { ...filter2, value }); + }, + onKeyDown: (e4) => { + if (e4.key == "Escape") { + setValue(filter2.value); + e4.currentTarget.blur(); + } + if (e4.key == "Enter") { + e4.currentTarget.blur(); + } + }, + value }); + } else if (fieldType.startsWith("option") || fieldType.startsWith("context") || fieldType.startsWith("link")) { + const options = parseMultiString(filter2.value); + return /* @__PURE__ */ import_react61.default.createElement("span", { + onClick: (e4) => selectFilterValue(e4, filter2) + }, options.length == 0 ? i18n_default.labels.select : options.map( + (f2, i3) => fieldType.startsWith("option") ? /* @__PURE__ */ import_react61.default.createElement("span", { + key: i3 + }, f2) : /* @__PURE__ */ import_react61.default.createElement(PathCrumb, { + superstate: props.superstate, + key: i3, + path: f2 + }) + )); } else if (!filter2.value || filter2.value.length == 0) { - return /* @__PURE__ */ import_react57.default.createElement("span", { + return /* @__PURE__ */ import_react61.default.createElement("span", { onClick: (e4) => selectFilterValue(e4, filter2) }, i18n_default.labels.select); } - return /* @__PURE__ */ import_react57.default.createElement("span", { + return /* @__PURE__ */ import_react61.default.createElement("span", { onClick: (e4) => selectFilterValue(e4, filter2) }, filter2.value); }; @@ -108126,7 +108646,11 @@ var SpaceQuery = (props) => { multi: false, editable: false, value: [], - options: props.fields.map((f2) => ({ name: f2.label, value: f2 })), + options: props.fields.map((f2) => ({ + name: f2.label, + value: f2, + section: f2.type + })), saveOptions: (_18, value) => setDefFilter(value[0], i3, k2), placeholder: i18n_default.labels.contextItemSelectPlaceholder, searchable: true, @@ -108135,9 +108659,9 @@ var SpaceQuery = (props) => { showSections: true }); }; - return /* @__PURE__ */ import_react58.default.createElement("div", { + return /* @__PURE__ */ import_react62.default.createElement("div", { className: "mk-query" - }, filters.length == 0 ? /* @__PURE__ */ import_react58.default.createElement(DefFilterGroup, { + }, filters.length == 0 ? /* @__PURE__ */ import_react62.default.createElement(DefFilterGroup, { superstate: props.superstate, selectGroupType, group: null, @@ -108146,7 +108670,7 @@ var SpaceQuery = (props) => { i: 0, removeable: props.removeable, removeDefGroup - }) : filters.map((f2, i3) => /* @__PURE__ */ import_react58.default.createElement(DefFilterGroup, { + }) : filters.map((f2, i3) => /* @__PURE__ */ import_react62.default.createElement(DefFilterGroup, { superstate: props.superstate, key: i3, group: f2, @@ -108156,9 +108680,9 @@ var SpaceQuery = (props) => { removeable: props.removeable, i: i3, removeDefGroup - }, f2.filters.map((filter2, k2, arr) => /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, { + }, f2.filters.map((filter2, k2, arr) => /* @__PURE__ */ import_react62.default.createElement(import_react62.default.Fragment, { key: k2 - }, /* @__PURE__ */ import_react58.default.createElement(DefFilter, { + }, /* @__PURE__ */ import_react62.default.createElement(DefFilter, { superstate: props.superstate, key: k2, filter: filter2, @@ -108168,10 +108692,10 @@ var SpaceQuery = (props) => { selectFilter, selectFilterValue, removeDefFilter - }), k2 != arr.length - 1 && /* @__PURE__ */ import_react58.default.createElement("div", { + }), k2 != arr.length - 1 && /* @__PURE__ */ import_react62.default.createElement("div", { className: "mk-filter", onClick: (e4) => selectGroupType(e4, i3) - }, /* @__PURE__ */ import_react58.default.createElement("span", null, f2.type == "any" ? "or" : "and"))))))); + }, /* @__PURE__ */ import_react62.default.createElement("span", null, f2.type == "any" ? "or" : "and"))))))); }; var DefFilter = (props) => { const { @@ -108183,22 +108707,23 @@ var DefFilter = (props) => { i: i3, k: k2 } = props; - return /* @__PURE__ */ import_react58.default.createElement("div", { + return /* @__PURE__ */ import_react62.default.createElement("div", { className: "mk-filter" - }, /* @__PURE__ */ import_react58.default.createElement("span", { + }, /* @__PURE__ */ import_react62.default.createElement("span", { onClick: (e4) => selectField(e4, i3, k2) - }, filter2.field.length == 0 ? i18n_default.labels.select : filter2.field), filter2.field.length > 0 && /* @__PURE__ */ import_react58.default.createElement("span", { + }, filter2.field.length == 0 ? i18n_default.labels.select : filter2.field), filter2.field.length > 0 && /* @__PURE__ */ import_react62.default.createElement("span", { onClick: (e4) => selectFilter(e4, i3, k2) - }, !filterFnLabels[filter2.fn] ? i18n_default.labels.select : filterFnLabels[filter2.fn]), filter2.field.length > 0 && filterFnLabels[filter2.fn] && filterFnTypes[filter2.fn]?.valueType != "none" && /* @__PURE__ */ import_react58.default.createElement("span", null, /* @__PURE__ */ import_react58.default.createElement(FilterValueSpan, { + }, !filterFnLabels[filter2.fn] ? i18n_default.labels.select : filterFnLabels[filter2.fn]), filter2.field.length > 0 && filterFnLabels[filter2.fn] && filterFnTypes[filter2.fn]?.valueType != "none" && /* @__PURE__ */ import_react62.default.createElement("span", null, /* @__PURE__ */ import_react62.default.createElement(FilterValueSpan, { + superstate: props.superstate, fieldType: filter2.fType, filter: filter2, selectFilterValue: (e4, h3) => selectFilterValue(e4, h3, i3, k2) - })), /* @__PURE__ */ import_react58.default.createElement("span", { + })), /* @__PURE__ */ import_react62.default.createElement("span", { onClick: (e4) => { removeDefFilter(k2, i3); e4.stopPropagation(); } - }, /* @__PURE__ */ import_react58.default.createElement("div", { + }, /* @__PURE__ */ import_react62.default.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//close") @@ -108214,19 +108739,19 @@ var DefFilterGroup = (props) => { i: i3, removeDefGroup } = props; - return /* @__PURE__ */ import_react58.default.createElement("div", { + return /* @__PURE__ */ import_react62.default.createElement("div", { className: "mk-query-group" - }, /* @__PURE__ */ import_react58.default.createElement("div", { + }, /* @__PURE__ */ import_react62.default.createElement("div", { className: "mk-filter-bar mk-query-filters" - }, props.children, /* @__PURE__ */ import_react58.default.createElement("div", { + }, props.children, /* @__PURE__ */ import_react62.default.createElement("div", { className: "mk-filter-add", onClick: (e4) => selectField(e4, i3, group?.filters.length ?? 0) - }, /* @__PURE__ */ import_react58.default.createElement("span", null, /* @__PURE__ */ import_react58.default.createElement("span", { + }, /* @__PURE__ */ import_react62.default.createElement("span", null, /* @__PURE__ */ import_react62.default.createElement("span", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } - }), i18n_default.buttons.addFilter))), props.removeable && /* @__PURE__ */ import_react58.default.createElement("div", { + }), i18n_default.buttons.addFilter))), props.removeable && /* @__PURE__ */ import_react62.default.createElement("div", { className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//close") @@ -108240,54 +108765,56 @@ var DefFilterGroup = (props) => { // src/core/react/components/Navigator/SpaceEditor.tsx var SpaceEditor = (props) => { - const [tab, setTab] = (0, import_react59.useState)(props.tab); - return /* @__PURE__ */ import_react59.default.createElement("div", null, /* @__PURE__ */ import_react59.default.createElement("div", { + const [tab, setTab] = (0, import_react63.useState)( + props.space?.type == "tag" ? Math.max(1, props.tab) : props.tab + ); + return /* @__PURE__ */ import_react63.default.createElement("div", null, /* @__PURE__ */ import_react63.default.createElement("div", { className: "mk-tab-group" - }, /* @__PURE__ */ import_react59.default.createElement("div", { + }, props.space?.type != "tag" && /* @__PURE__ */ import_react63.default.createElement("div", { onClick: () => setTab(0), className: `mk-tab ${tab == 0 ? "mk-active" : ""}` - }, i18n_default.subViews.spaceItems), /* @__PURE__ */ import_react59.default.createElement("div", { + }, i18n_default.subViews.spaceItems), /* @__PURE__ */ import_react63.default.createElement("div", { onClick: () => setTab(1), className: `mk-tab ${tab == 1 ? "mk-active" : ""}` - }, i18n_default.subViews.spaceContext), /* @__PURE__ */ import_react59.default.createElement("div", { + }, i18n_default.subViews.spaceContext), /* @__PURE__ */ import_react63.default.createElement("div", { onClick: () => setTab(2), className: `mk-tab ${tab == 2 ? "mk-active" : ""}` - }, i18n_default.subViews.spaceLists), /* @__PURE__ */ import_react59.default.createElement("div", { + }, i18n_default.subViews.spaceLists), /* @__PURE__ */ import_react63.default.createElement("div", { onClick: () => setTab(3), className: `mk-tab ${tab == 3 ? "mk-active" : ""}` - }, i18n_default.subViews.spaceActions), /* @__PURE__ */ import_react59.default.createElement("div", { + }, i18n_default.subViews.spaceActions), /* @__PURE__ */ import_react63.default.createElement("div", { onClick: () => setTab(4), className: `mk-tab ${tab == 4 ? "mk-active" : ""}` - }, i18n_default.subViews.spaceTemplates)), /* @__PURE__ */ import_react59.default.createElement(PathProvider, { + }, i18n_default.subViews.spaceTemplates)), /* @__PURE__ */ import_react63.default.createElement(PathProvider, { superstate: props.superstate, path: props.space.path, readMode: false - }, /* @__PURE__ */ import_react59.default.createElement(SpaceProvider, { + }, /* @__PURE__ */ import_react63.default.createElement(SpaceProvider, { superstate: props.superstate - }, tab == 0 ? /* @__PURE__ */ import_react59.default.createElement(SpaceItems, { + }, tab == 0 ? /* @__PURE__ */ import_react63.default.createElement(SpaceItems, { superstate: props.superstate, space: props.space - }) : tab == 1 ? /* @__PURE__ */ import_react59.default.createElement(ContextMDBProvider, { + }) : tab == 1 ? /* @__PURE__ */ import_react63.default.createElement(ContextMDBProvider, { superstate: props.superstate - }, /* @__PURE__ */ import_react59.default.createElement(FramesMDBProvider, { + }, /* @__PURE__ */ import_react63.default.createElement(FramesMDBProvider, { superstate: props.superstate - }, /* @__PURE__ */ import_react59.default.createElement(ContextEditorProvider, { + }, /* @__PURE__ */ import_react63.default.createElement(ContextEditorProvider, { superstate: props.superstate - }, /* @__PURE__ */ import_react59.default.createElement(SpacePropertyEditorContext, { + }, /* @__PURE__ */ import_react63.default.createElement(SpacePropertyEditorContext, { superstate: props.superstate - })))) : tab == 2 ? /* @__PURE__ */ import_react59.default.createElement(TableList, { + })))) : tab == 2 ? /* @__PURE__ */ import_react63.default.createElement(TableList, { superstate: props.superstate, hide: props.close - }) : tab == 3 ? /* @__PURE__ */ import_react59.default.createElement(ActionsList, { + }) : tab == 3 ? /* @__PURE__ */ import_react63.default.createElement(ActionsList, { superstate: props.superstate, close: props.close - }) : tab == 4 ? /* @__PURE__ */ import_react59.default.createElement(TemplatesList, { + }) : tab == 4 ? /* @__PURE__ */ import_react63.default.createElement(TemplatesList, { superstate: props.superstate, close: props.close - }) : /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null)))); + }) : /* @__PURE__ */ import_react63.default.createElement(import_react63.default.Fragment, null)))); }; var SpaceItems = (props) => { - const [metadata, setMetadata] = (0, import_react59.useState)( + const [metadata, setMetadata] = (0, import_react63.useState)( props.space.metadata ?? {} ); const saveMetadata = (metadata2) => { @@ -108300,11 +108827,11 @@ var SpaceItems = (props) => { filters: q2 }); }; - const linkCaches = (0, import_react59.useMemo)( + const linkCaches = (0, import_react63.useMemo)( () => (metadata?.links ?? []).map((f2) => props.superstate.pathsIndex.get(f2)).filter((f2) => f2), [metadata] ); - const directChildren = (0, import_react59.useMemo)(() => { + const directChildren = (0, import_react63.useMemo)(() => { return [...props.superstate.spacesMap.getInverse(props.space.path)].map((f2) => props.superstate.pathsIndex.get(f2)).filter((f2) => f2.parent == props.space.path); }, [props.space]); const metadataProperties = allMetadata(props.superstate); @@ -108320,30 +108847,30 @@ var SpaceItems = (props) => { value: f2 }; }); - return /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, /* @__PURE__ */ import_react59.default.createElement("div", { + return /* @__PURE__ */ import_react63.default.createElement(import_react63.default.Fragment, null, /* @__PURE__ */ import_react63.default.createElement("div", { className: "mk-space-editor" - }, /* @__PURE__ */ import_react59.default.createElement("div", { + }, /* @__PURE__ */ import_react63.default.createElement("div", { className: "mk-space-editor-section" - }, /* @__PURE__ */ import_react59.default.createElement("div", { + }, /* @__PURE__ */ import_react63.default.createElement("div", { className: "mk-space-editor-title" - }, /* @__PURE__ */ import_react59.default.createElement("div", { + }, /* @__PURE__ */ import_react63.default.createElement("div", { className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//file-stack") } - }), i18n_default.subViews.spaceItems), /* @__PURE__ */ import_react59.default.createElement("div", { + }), i18n_default.subViews.spaceItems), /* @__PURE__ */ import_react63.default.createElement("div", { className: "mk-space-editor-description" - }, i18n_default.descriptions.spaceItems), /* @__PURE__ */ import_react59.default.createElement("div", { + }, i18n_default.descriptions.spaceItems), /* @__PURE__ */ import_react63.default.createElement("div", { className: "mk-space-editor-contents" - }, linkCaches.map((f2, i3) => /* @__PURE__ */ import_react59.default.createElement(PathCrumb, { + }, linkCaches.map((f2, i3) => /* @__PURE__ */ import_react63.default.createElement(PathCrumb, { key: i3, superstate: props.superstate, path: f2.path - })), directChildren.map((f2, i3) => /* @__PURE__ */ import_react59.default.createElement(PathCrumb, { + })), directChildren.map((f2, i3) => /* @__PURE__ */ import_react63.default.createElement(PathCrumb, { key: i3, superstate: props.superstate, path: f2.path - }))), /* @__PURE__ */ import_react59.default.createElement("button", { + }))), /* @__PURE__ */ import_react63.default.createElement("button", { className: "mk-inline-button", onClick: (e4) => showLinkMenu( e4, @@ -108353,30 +108880,30 @@ var SpaceItems = (props) => { links: [...metadata.links ?? [], link] }) ) - }, /* @__PURE__ */ import_react59.default.createElement("div", { + }, /* @__PURE__ */ import_react63.default.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } - }), i18n_default.buttons.addItem)), /* @__PURE__ */ import_react59.default.createElement("div", { + }), i18n_default.buttons.addItem)), /* @__PURE__ */ import_react63.default.createElement("div", { className: "mk-space-editor-section" - }, /* @__PURE__ */ import_react59.default.createElement("div", { + }, /* @__PURE__ */ import_react63.default.createElement("div", { className: "mk-space-editor-title" - }, /* @__PURE__ */ import_react59.default.createElement("div", { + }, /* @__PURE__ */ import_react63.default.createElement("div", { className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//file-search") } - }), i18n_default.subViews.smartSearch), /* @__PURE__ */ import_react59.default.createElement("div", { + }), i18n_default.subViews.smartSearch), /* @__PURE__ */ import_react63.default.createElement("div", { className: "mk-space-editor-description" - }, i18n_default.descriptions.smartSearch), metadata?.filters?.length > 0 && /* @__PURE__ */ import_react59.default.createElement(SpaceQuery, { + }, i18n_default.descriptions.smartSearch), metadata?.filters?.length > 0 && /* @__PURE__ */ import_react63.default.createElement(SpaceQuery, { superstate: props.superstate, filters: metadata.filters ?? [], setFilters: saveQuery, removeable: true, fields: allOptions, sections - }), /* @__PURE__ */ import_react59.default.createElement("button", { + }), /* @__PURE__ */ import_react63.default.createElement("button", { className: "mk-inline-button", "aria-label": i18n_default.buttons.addSmartSearch, onClick: (e4) => saveMetadata({ @@ -108390,7 +108917,7 @@ var SpaceItems = (props) => { } ] }) - }, /* @__PURE__ */ import_react59.default.createElement("div", { + }, /* @__PURE__ */ import_react63.default.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") @@ -108401,7 +108928,7 @@ var SpaceEditor_default = SpaceEditor; // src/core/react/components/UI/Modals/ContextEditor.tsx var openSpaceEditorModal = (superstate, space2, tab) => { - superstate.ui.openModal(space2.name, (props) => /* @__PURE__ */ import_react60.default.createElement(SpaceEditor_default, { + superstate.ui.openModal(space2.name, (props) => /* @__PURE__ */ import_react64.default.createElement(SpaceEditor_default, { superstate, space: space2, tab, @@ -108411,7 +108938,7 @@ var openSpaceEditorModal = (superstate, space2, tab) => { })); }; var SpacePropertyEditorContext = (props) => { - const { spaceState: spaceCache } = (0, import_react60.useContext)(SpaceContext); + const { spaceState: spaceCache } = (0, import_react64.useContext)(SpaceContext); const { predicate, savePredicate, @@ -108419,11 +108946,11 @@ var SpacePropertyEditorContext = (props) => { hideColumn, delColumn, saveColumn - } = (0, import_react60.useContext)(ContextEditorContext); - const { tableData } = (0, import_react60.useContext)(ContextMDBContext); - const columns = (0, import_react60.useMemo)(() => { + } = (0, import_react64.useContext)(ContextEditorContext); + const { tableData } = (0, import_react64.useContext)(ContextMDBContext); + const columns = (0, import_react64.useMemo)(() => { return (tableData?.cols ?? []).sort( - (a4, b2) => predicate.colsOrder.findIndex((x2) => x2 == a4.name) - predicate.colsOrder.findIndex((x2) => x2 == b2.name) + (a4, b2) => (predicate?.colsOrder ?? []).findIndex((x2) => x2 == a4.name) - (predicate?.colsOrder ?? []).findIndex((x2) => x2 == b2.name) ); }, [tableData, predicate]); const saveContexts = (contexts) => { @@ -108434,11 +108961,11 @@ var SpacePropertyEditorContext = (props) => { contexts ); }; - return /* @__PURE__ */ import_react60.default.createElement(SpacePropertyEditor, { + return /* @__PURE__ */ import_react64.default.createElement(SpacePropertyEditor, { superstate: props.superstate, - colsOrder: predicate.colsOrder, - setColumnOrder: (cols) => savePredicate({ ...predicate, colsOrder: cols }), - colsHidden: predicate.colsHidden, + colsOrder: predicate?.colsOrder ?? [], + setColumnOrder: (cols) => savePredicate({ colsOrder: cols }), + colsHidden: predicate?.colsHidden ?? [], columns, contexts: spaceCache?.contexts ?? [], saveContexts, @@ -108462,23 +108989,27 @@ var triggerSpaceMenu = (superstate, path, e4, activePath, parentSpace, onClose) }, icon: "ui//plus" }); - menuOptions.push({ - name: i18n_default.buttons.addIntoSpace, - icon: "ui//pin", - onClick: (e5) => { - showLinkMenu(e5, superstate, (link) => { - pinPathToSpaceAtIndex(superstate, space2, link); - }); - } - }); + if (space2.type == "folder") { + menuOptions.push({ + name: i18n_default.buttons.addIntoSpace, + icon: "ui//pin", + onClick: (e5) => { + showLinkMenu(e5, superstate, (link) => { + pinPathToSpaceAtIndex(superstate, space2, link); + }); + } + }); + } menuOptions.push(menuSeparator); - menuOptions.push({ - name: i18n_default.labels.renameSection, - icon: "ui//edit", - onClick: (e5) => { - openSpaceEditorModal(superstate, space2, 0); - } - }); + if (space2.type != "default") { + menuOptions.push({ + name: i18n_default.labels.renameSection, + icon: "ui//edit", + onClick: (e5) => { + openSpaceEditorModal(superstate, space2, 0); + } + }); + } if (onClose) { menuOptions.push({ name: i18n_default.menu.closeSpace, @@ -108501,50 +109032,46 @@ var triggerSpaceMenu = (superstate, path, e4, activePath, parentSpace, onClose) } }); } - menuOptions.push({ - name: i18n_default.buttons.addToSpace, - icon: "ui//pin", - onClick: (e5) => { - showSpacesMenu( - e5, - superstate, - (link) => { - const spaceCache = superstate.spacesIndex.get(link); - if (spaceCache) - addPathToSpaceAtIndex(superstate, spaceCache, space2.path, -1); - }, - true - ); - } - }); - menuOptions.push(menuSeparator); - menuOptions.push({ - name: "Save as Template", - icon: "ui//clipboard-add", - onClick: (e5) => { - saveSpaceTemplate(superstate, space2.path, parentSpace); - } - }); - if (parentSpace && parentSpace != path.parent) { - const spaceCache = superstate.spacesIndex.get(parentSpace); - if (spaceCache) { - menuOptions.push({ - name: i18n_default.menu.removeFromSpace, - icon: "ui//pin-off", - onClick: (e5) => { - removePathsFromSpace(superstate, spaceCache.path, [space2.path]); - } - }); - } + if (space2.type == "folder") { + menuOptions.push({ + name: i18n_default.buttons.addToSpace, + icon: "ui//pin", + onClick: (e5) => { + showSpacesMenu( + e5, + superstate, + (link) => { + const spaceCache = superstate.spacesIndex.get(link); + if (spaceCache) + addPathToSpaceAtIndex(superstate, spaceCache, space2.path, -1); + }, + true + ); + } + }); + menuOptions.push(menuSeparator); } - if (parentSpace == "spaces://$waypoints") { + const parentSpaceCache = superstate.spacesIndex.get(parentSpace); + if (parentSpaceCache && (parentSpaceCache.type == "folder" || parentSpaceCache.type == "vault")) { menuOptions.push({ - name: i18n_default.menu.removeFromWaypoints, - icon: "ui//pin-off", + name: "Save as Template", + icon: "ui//clipboard-add", onClick: (e5) => { - toggleWaypoint(superstate, space2.path, true); + saveSpaceTemplate(superstate, space2.path, parentSpace); } }); + if (parentSpace != path.parent) { + const spaceCache = superstate.spacesIndex.get(parentSpace); + if (spaceCache) { + menuOptions.push({ + name: i18n_default.menu.removeFromSpace, + icon: "ui//pin-off", + onClick: (e5) => { + removePathsFromSpace(superstate, spaceCache.path, [space2.path]); + } + }); + } + } } menuOptions.push(menuSeparator); if (superstate.settings.spacesStickers) { @@ -108565,7 +109092,7 @@ var triggerSpaceMenu = (superstate, path, e4, activePath, parentSpace, onClose) name: i18n_default.buttons.changeIcon, icon: "ui//sticker", onClick: (e5) => { - superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react61.default.createElement(StickerModal_default, { + superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react65.default.createElement(StickerModal_default, { ui: superstate.ui, hide: _props.hide, selectedSticker: (emoji) => savePathSticker(superstate, space2.path, emoji) @@ -108709,35 +109236,37 @@ var triggerSpaceMenu = (superstate, path, e4, activePath, parentSpace, onClose) } }); } - menuOptions.push(menuSeparator); - menuOptions.push({ - name: i18n_default.menu.rename, - icon: "ui//edit", - onClick: (e5) => { - superstate.ui.openModal( - i18n_default.labels.rename, - (_props) => /* @__PURE__ */ import_react61.default.createElement(InputModal, { - saveLabel: i18n_default.buttons.rename, - value: space2.type == "tag" ? stringFromTag(space2.name) : space2.name, - hide: _props.hide, - saveValue: (v2) => renamePathByName(superstate, space2.path, v2) - }) - ); - } - }); - menuOptions.push({ - name: i18n_default.menu.moveFile, - icon: "ui//paper-plane", - onClick: (e5) => { - showSpacesMenu(e5, superstate, (link) => { - superstate.spaceManager.renameSpace( - space2.path, - movePath(space2.path, link) + if (space2.type != "default") { + menuOptions.push(menuSeparator); + menuOptions.push({ + name: i18n_default.menu.rename, + icon: "ui//edit", + onClick: (e5) => { + superstate.ui.openModal( + i18n_default.labels.rename, + (_props) => /* @__PURE__ */ import_react65.default.createElement(InputModal, { + saveLabel: i18n_default.buttons.rename, + value: space2.type == "tag" ? stringFromTag(space2.name) : space2.name, + hide: _props.hide, + saveValue: (v2) => renamePathByName(superstate, space2.path, v2) + }) ); - }); - } - }); + } + }); + } if (space2.type == "folder") { + menuOptions.push({ + name: i18n_default.menu.moveFile, + icon: "ui//paper-plane", + onClick: (e5) => { + showSpacesMenu(e5, superstate, (link) => { + superstate.spaceManager.renameSpace( + space2.path, + movePath(space2.path, link) + ); + }); + } + }); menuOptions.push({ name: i18n_default.menu.hide, icon: "ui//eye-off", @@ -108753,7 +109282,7 @@ var triggerSpaceMenu = (superstate, path, e4, activePath, parentSpace, onClose) onClick: (e5) => { superstate.ui.openModal( i18n_default.labels.deleteSpace, - (_props) => /* @__PURE__ */ import_react61.default.createElement(ConfirmationModal, { + (_props) => /* @__PURE__ */ import_react65.default.createElement(ConfirmationModal, { hide: _props.hide, confirmAction: () => removeSpace(superstate, space2.path), confirmLabel: i18n_default.buttons.delete, @@ -108796,189 +109325,6 @@ var selectRange = (currSel, newSel, array) => { // src/core/react/components/SpaceView/Contexts/TableView/TableView.tsx var import_lodash13 = __toESM(require_lodash()); -// src/core/react/components/UI/Modals/ImageModal.tsx -var import_react62 = __toESM(require_react()); - -// src/utils/regex.ts -var urlRegex = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi; - -// src/core/react/components/UI/Modals/ImageModal.tsx -var ImageModal = (props) => { - const [query, setQuery] = (0, import_react62.useState)(""); - const [allImages, setAllImages] = (0, import_react62.useState)([]); - const [images, setImages] = (0, import_react62.useState)([]); - const [selectedImage, setSelectedImage] = (0, import_react62.useState)(null); - (0, import_react62.useEffect)(() => { - const _allImages = []; - _allImages.push( - ...[...props.superstate.pathsIndex.values()].filter((f2) => f2.subtype == "image").map((f2) => ({ path: f2.path, thumnail: f2.label.thumbnail })) - ); - setAllImages(_allImages); - setImages(_allImages); - }, []); - (0, import_react62.useEffect)(() => { - query.match(urlRegex) ? setImages([{ path: query, thumnail: query }]) : setImages(allImages.filter((f2) => f2.path.includes(query))); - }, [query, allImages]); - const handleInputChange = (event) => { - setQuery(event.target.value); - }; - const handleKeyDown = (event) => { - const currentIndex = images.findIndex((f2) => f2.path == selectedImage); - if (event.key === "ArrowUp" && currentIndex > 0) { - setSelectedImage(images[currentIndex - 1].path); - } else if (event.key === "ArrowDown" && currentIndex < images.length - 1) { - setSelectedImage(images[currentIndex + 1].path); - } else if (event.key === "Enter") { - props.selectedPath(selectedImage); - props.hide(); - } - }; - const ref2 = (0, import_react62.useRef)(null); - (0, import_react62.useEffect)(() => { - if (ref2.current) { - ref2.current.focus(); - } - }, [ref2.current]); - return /* @__PURE__ */ import_react62.default.createElement(import_react62.default.Fragment, null, /* @__PURE__ */ import_react62.default.createElement("input", { - onKeyDown: handleKeyDown, - value: query, - ref: ref2, - onChange: handleInputChange, - className: "mk-input mk-input-large mk-border-bottom" - }), /* @__PURE__ */ import_react62.default.createElement("div", { - className: "mk-layout-masonry mk-padding-12 mk-layout-scroll" - }, images.map((image) => /* @__PURE__ */ import_react62.default.createElement("img", { - key: image.path, - src: props.superstate.ui.getUIPath(image.thumnail), - className: selectedImage === image.path ? "mk-selected" : "", - onClick: () => { - props.selectedPath(image.path); - props.hide(); - } - })))); -}; -var ImageModal_default = ImageModal; - -// src/core/react/components/SpaceView/Contexts/DataTypeView/ImageCell.tsx -var import_react63 = __toESM(require_react()); -var ImageCell = (props) => { - const { initialValue, saveValue } = props; - const [value, setValue] = import_react63.default.useState(initialValue); - const menuRef = (0, import_react63.useRef)(null); - (0, import_react63.useEffect)(() => { - if (props.editMode == 4 /* EditModeActive */) { - if (!menuRef.current) - showModal2(); - } - }, []); - const sourcePath = (0, import_react63.useMemo)(() => { - if (value?.length > 0) { - return props.superstate.ui.getUIPath(value); - } - return null; - }, [value]); - import_react63.default.useEffect(() => { - setValue(initialValue); - }, [initialValue]); - const showModal2 = () => { - props.superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react63.default.createElement(ImageModal_default, { - superstate: props.superstate, - hide: _props.hide, - selectedPath: (image) => saveValue(image) - })); - props.setEditMode(null); - }; - return /* @__PURE__ */ import_react63.default.createElement("div", { - className: "mk-cell-image" - }, /* @__PURE__ */ import_react63.default.createElement("img", { - src: sourcePath - }), props.editMode > 1 /* EditModeNone */ ? /* @__PURE__ */ import_react63.default.createElement("div", { - className: "mk-image-selector" - }, /* @__PURE__ */ import_react63.default.createElement("div", { - onClick: showModal2, - className: "mk-hover-button mk-icon-xsmall", - dangerouslySetInnerHTML: { - __html: props.superstate.ui.getSticker("ui//edit") - } - }), value?.length > 0 && /* @__PURE__ */ import_react63.default.createElement("div", { - onClick: () => saveValue(""), - className: "mk-hover-button mk-icon-xsmall", - dangerouslySetInnerHTML: { - __html: props.superstate.ui.getSticker("ui//close") - } - })) : /* @__PURE__ */ import_react63.default.createElement(import_react63.default.Fragment, null)); -}; - -// src/core/react/components/SpaceView/Contexts/DataTypeView/LinkCell.tsx -var import_react64 = __toESM(require_react()); -var LinkCell = (props) => { - const parseValue = (v2) => props.multi ? parseMultiString(v2) ?? [] : [v2].filter((f2) => f2); - (0, import_react64.useEffect)(() => { - setValue(parseValue(props.initialValue)); - }, [props.initialValue]); - const [value, setValue] = (0, import_react64.useState)(parseValue(props.initialValue)); - const removeValue = (v2) => { - const newValues = value.filter((f2) => f2 != v2); - setValue(newValues); - props.saveValue(serializeMultiString(newValues)); - }; - const saveOptions = (_18, _value) => { - if (!props.multi) { - setValue(_value); - props.saveValue(serializeMultiString(_value)); - } else { - const newValue = _value[0]; - if (newValue) { - const newValues = uniq([...value, newValue]); - setValue(newValues); - props.saveValue(serializeMultiString(newValues)); - } - } - }; - const menuProps = () => { - const options = [...props.superstate.pathsIndex.values()].filter((f2) => !f2.hidden).map((f2) => ({ - name: f2.name, - value: f2.path, - description: f2.path - })); - const _options = !props.multi ? [{ name: i18n_default.menu.none, value: "" }, ...options] : options; - return { - ui: props.superstate.ui, - multi: false, - editable: true, - value: value.map((f2) => f2), - options: _options, - saveOptions, - placeholder: i18n_default.labels.linkItemSelectPlaceholder, - detail: true, - searchable: true - }; - }; - const openLink = async (o2) => { - const pathExists = await props.superstate.spaceManager.pathExists(o2); - if (pathExists) { - props.superstate.ui.openPath(o2, false); - } else { - await props.superstate.spaceManager.createItemAtPath("/", "md", o2); - props.superstate.ui.openPath(o2, false); - } - }; - return /* @__PURE__ */ import_react64.default.createElement(OptionCellBase, { - superstate: props.superstate, - baseClass: "mk-cell-link", - removeValue, - selectLabel: props.compactMode ? props.property.name : i18n_default.labels.select, - menuProps, - labelElement: (_props) => /* @__PURE__ */ import_react64.default.createElement(PathCrumb, { - superstate: props.superstate, - path: _props.value - }, _props.children), - value, - multi: props.multi, - editMode: props.editMode - }); -}; - // src/core/react/components/UI/Menus/properties/propertiesMenu.tsx var showPropertiesMenu = (superstate, rect, property, deleteProperty2, syncProperty, renameProperty2, changeType) => { const menuOptions = []; @@ -109026,12 +109372,12 @@ var linkContextRow = (paths, row, fields) => { }; // src/core/react/components/Explorer/PropertiesView.tsx -var import_react68 = __toESM(require_react()); +var import_react69 = __toESM(require_react()); // src/core/react/components/UI/Toggles/CollapseToggleSmall.tsx -var import_react65 = __toESM(require_react()); +var import_react66 = __toESM(require_react()); var CollapseToggleSmall = (props) => { - return /* @__PURE__ */ import_react65.default.createElement("button", { + return /* @__PURE__ */ import_react66.default.createElement("button", { className: `mk-collapse mk-inline-button mk-icon-xsmall ${props.collapsed ? "mk-collapsed" : ""}`, onClick: (e4) => { props.onToggle(!props.collapsed, e4); @@ -109044,12 +109390,12 @@ var CollapseToggleSmall = (props) => { }; // src/core/react/components/SpaceView/Contexts/ContextBuilder/ContextListEditSelector.tsx -var import_react67 = __toESM(require_react()); +var import_react68 = __toESM(require_react()); // src/core/react/components/SpaceView/Frames/Setters/ToggleSetter.tsx -var import_react66 = __toESM(require_react()); +var import_react67 = __toESM(require_react()); var ToggleSetter = (props) => { - return /* @__PURE__ */ import_react66.default.createElement("div", { + return /* @__PURE__ */ import_react67.default.createElement("div", { className: `mk-editor-frame-node-button ${props.value == props.onValue ? "mk-active" : ""}`, onClick: (e4) => props.value == props.onValue ? props.setValue(props.defaultValue) : props.setValue(props.onValue), dangerouslySetInnerHTML: { @@ -109060,15 +109406,17 @@ var ToggleSetter = (props) => { // src/core/react/components/SpaceView/Contexts/ContextBuilder/ContextListEditSelector.tsx var ContextListEditSelector = (props) => { - const { pathState } = (0, import_react67.useContext)(PathContext); - const { spaceInfo } = (0, import_react67.useContext)(SpaceContext); - const { dbSchema } = (0, import_react67.useContext)(ContextMDBContext); - const { predicate, savePredicate, editMode, setEditMode, sortedColumns } = (0, import_react67.useContext)(ContextEditorContext); + const { pathState } = (0, import_react68.useContext)(PathContext); + const { spaceInfo } = (0, import_react68.useContext)(SpaceContext); + const { predicate, savePredicate, sortedColumns } = (0, import_react68.useContext)(ContextEditorContext); const selectFrame = (frameRef, type) => { - savePredicate({ ...predicate, view: "frame", [type]: frameRef }); + savePredicate({ + view: "frame", + [type]: frameRef + }); }; - const { frameSchemas, saveSchema } = (0, import_react67.useContext)(FramesMDBContext); - const listItems = (0, import_react67.useMemo)(() => { + const { frameSchemas, saveSchema } = (0, import_react68.useContext)(FramesMDBContext); + const listItems = (0, import_react68.useMemo)(() => { const items = []; if (frameSchemas) { items.push( @@ -109147,20 +109495,20 @@ var ContextListEditSelector = (props) => { } props.setEditSection(type); }; - const [loaded, setLoaded] = (0, import_react67.useState)(false); - const [isPending, startTransition] = (0, import_react67.useTransition)(); - (0, import_react67.useEffect)(() => { + const [loaded, setLoaded] = (0, import_react68.useState)(false); + const [isPending, startTransition] = (0, import_react68.useTransition)(); + (0, import_react68.useEffect)(() => { startTransition(() => { setLoaded(true); }); }, []); - return /* @__PURE__ */ import_react67.default.createElement("div", { + return predicate ? /* @__PURE__ */ import_react68.default.createElement("div", { className: "mk-editor-context-selector" - }, /* @__PURE__ */ import_react67.default.createElement("div", { + }, /* @__PURE__ */ import_react68.default.createElement("div", { className: "mk-editor-context-groups" - }, /* @__PURE__ */ import_react67.default.createElement("div", { + }, /* @__PURE__ */ import_react68.default.createElement("div", { className: "mk-editor-context-group" - }, /* @__PURE__ */ import_react67.default.createElement(ToggleSetter, { + }, /* @__PURE__ */ import_react68.default.createElement(ToggleSetter, { superstate: props.superstate, name: i18n_default.editor.rows, icon: "ui//rows", @@ -109169,13 +109517,12 @@ var ContextListEditSelector = (props) => { onValue: "spaces://$kit/#*listGroup", setValue: (value) => { savePredicate({ - ...predicate, view: "list", listView: "spaces://$kit/#*listView", listGroup: "spaces://$kit/#*listGroup" }); } - }), /* @__PURE__ */ import_react67.default.createElement(ToggleSetter, { + }), /* @__PURE__ */ import_react68.default.createElement(ToggleSetter, { superstate: props.superstate, name: i18n_default.editor.columns, icon: "ui//columns", @@ -109184,13 +109531,12 @@ var ContextListEditSelector = (props) => { onValue: "spaces://$kit/#*columnGroup", setValue: (value) => { savePredicate({ - ...predicate, view: "list", listView: "spaces://$kit/#*columnView", listGroup: "spaces://$kit/#*columnGroup" }); } - }), /* @__PURE__ */ import_react67.default.createElement(ToggleSetter, { + }), /* @__PURE__ */ import_react68.default.createElement(ToggleSetter, { superstate: props.superstate, name: i18n_default.editor.catalog, icon: "ui//gallery-horizontal-end", @@ -109199,13 +109545,12 @@ var ContextListEditSelector = (props) => { onValue: "spaces://$kit/#*rowGroup", setValue: (value) => { savePredicate({ - ...predicate, view: "list", listView: "spaces://$kit/#*listView", listGroup: "spaces://$kit/#*rowGroup" }); } - }), /* @__PURE__ */ import_react67.default.createElement(ToggleSetter, { + }), /* @__PURE__ */ import_react68.default.createElement(ToggleSetter, { superstate: props.superstate, name: i18n_default.editor.grid, icon: "ui//layout-grid", @@ -109214,13 +109559,12 @@ var ContextListEditSelector = (props) => { onValue: "spaces://$kit/#*gridGroup", setValue: (value) => { savePredicate({ - ...predicate, view: "list", listView: "spaces://$kit/#*listView", listGroup: "spaces://$kit/#*gridGroup" }); } - }), /* @__PURE__ */ import_react67.default.createElement("button", { + }), /* @__PURE__ */ import_react68.default.createElement("button", { onClick: (e4) => { editItem("listGroup"); }, @@ -109230,22 +109574,22 @@ var ContextListEditSelector = (props) => { __html: props.superstate.ui.getSticker("ui//brush") }, style: { height: "20px", padding: "8px" } - })), /* @__PURE__ */ import_react67.default.createElement("div", { + })), /* @__PURE__ */ import_react68.default.createElement("div", { className: "mk-editor-context-group" - }, /* @__PURE__ */ import_react67.default.createElement("div", { + }, /* @__PURE__ */ import_react68.default.createElement("div", { className: "mk-editor-context-group-select", onClick: (e4) => { selectFrameMenu(e4, "listItem"); e4.stopPropagation(); } - }, listItems.find((f2) => f2.value == predicate.listItem)?.name ?? i18n_default.labels.select, /* @__PURE__ */ import_react67.default.createElement(CollapseToggleSmall, { + }, listItems.find((f2) => f2.value == predicate.listItem)?.name ?? i18n_default.labels.select, /* @__PURE__ */ import_react68.default.createElement(CollapseToggleSmall, { superstate: props.superstate, collapsed: false, onToggle: (c3, e4) => { selectFrameMenu(e4, "listItem"); e4.stopPropagation(); } - })), /* @__PURE__ */ import_react67.default.createElement("button", { + })), /* @__PURE__ */ import_react68.default.createElement("button", { onClick: (e4) => { editItem("listItem"); }, @@ -109255,7 +109599,7 @@ var ContextListEditSelector = (props) => { dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//brush") } - }), /* @__PURE__ */ import_react67.default.createElement("button", { + }), /* @__PURE__ */ import_react68.default.createElement("button", { onClick: (e4) => { addListItemToKit(); }, @@ -109264,33 +109608,33 @@ var ContextListEditSelector = (props) => { __html: props.superstate.ui.getSticker("ui//package-plus") }, style: { height: "20px", padding: "8px" } - })), /* @__PURE__ */ import_react67.default.createElement("span", null), /* @__PURE__ */ import_react67.default.createElement("div", { + })), /* @__PURE__ */ import_react68.default.createElement("span", null), /* @__PURE__ */ import_react68.default.createElement("div", { className: "mk-editor-frame-node-button-primary", onClick: (e4) => { props.setEditMode(0 /* Read */); e4.stopPropagation(); } - }, i18n_default.labels.done)), props.editSection == "listItem" && /* @__PURE__ */ import_react67.default.createElement("div", { + }, i18n_default.labels.done)), props.editSection == "listItem" && /* @__PURE__ */ import_react68.default.createElement("div", { className: "mk-editor-context-properties" - }, /* @__PURE__ */ import_react67.default.createElement("div", { + }, /* @__PURE__ */ import_react68.default.createElement("div", { style: { display: "flex" } - }, i18n_default.labels.properties, /* @__PURE__ */ import_react67.default.createElement("div", { + }, i18n_default.labels.properties, /* @__PURE__ */ import_react68.default.createElement("div", { "aria-label": i18n_default.hintText.dragDropProperties, className: `mk-icon-xsmall`, dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//help-circle") } - })), /* @__PURE__ */ import_react67.default.createElement("div", null, sortedColumns.map((f2, i3) => /* @__PURE__ */ import_react67.default.createElement(PropertyField, { + })), /* @__PURE__ */ import_react68.default.createElement("div", null, sortedColumns.map((f2, i3) => /* @__PURE__ */ import_react68.default.createElement(PropertyField, { context: pathState, path: pathState.path, key: i3, superstate: props.superstate, property: f2, draggable: true - }))))); + }))))) : null; }; var PropertyField = (props) => { - const { uid } = (0, import_react67.useContext)(PathContext); + const { uid } = (0, import_react68.useContext)(PathContext); const id3 = `${uid}_props_${props.context?.path ?? ""}${props.property.name}`; const { attributes, @@ -109308,60 +109652,60 @@ var PropertyField = (props) => { type: "property" } }); - const { setDragNode } = (0, import_react67.useContext)(WindowContext); + const { setDragNode } = (0, import_react68.useContext)(WindowContext); useDndMonitor({ onDragStart: (e4) => { if (e4.active.data.current.id == id3) setDragNode( - /* @__PURE__ */ import_react67.default.createElement("div", { + /* @__PURE__ */ import_react68.default.createElement("div", { className: "mk-path-context-field", onClick: (e5) => props.onClick ? props.onClick(e5) : null - }, /* @__PURE__ */ import_react67.default.createElement("div", { + }, /* @__PURE__ */ import_react68.default.createElement("div", { className: "mk-path-context-field-icon", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker( stickerForField(props.property) ) } - }), /* @__PURE__ */ import_react67.default.createElement("div", { + }), /* @__PURE__ */ import_react68.default.createElement("div", { className: "mk-path-context-field-key" }, props.property.name)) ); } }); - return /* @__PURE__ */ import_react67.default.createElement("div", { + return /* @__PURE__ */ import_react68.default.createElement("div", { ref: setDraggableNodeRef, className: "mk-path-context-field", onClick: (e4) => props.onClick ? props.onClick(e4) : null, ...attributes, ...listeners - }, /* @__PURE__ */ import_react67.default.createElement("div", { + }, /* @__PURE__ */ import_react68.default.createElement("div", { className: "mk-path-context-field-icon", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker( stickerForField(props.property) ) } - }), props.context && /* @__PURE__ */ import_react67.default.createElement("div", { + }), props.context && /* @__PURE__ */ import_react68.default.createElement("div", { className: "mk-path-context-field-space", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker( props.context.label?.sticker ) } - }), /* @__PURE__ */ import_react67.default.createElement("div", { + }), /* @__PURE__ */ import_react68.default.createElement("div", { className: "mk-path-context-field-key" }, props.property.name)); }; // src/core/react/components/Explorer/PropertiesView.tsx var PropertiesView = (props) => { - const { pathState } = (0, import_react68.useContext)(PathContext); - const [values2, setValues] = (0, import_react68.useState)({}); - const [cols, setCols] = (0, import_react68.useState)([]); - const [excludeKeys, setExcludeKeys] = (0, import_react68.useState)([]); - const { tableData, saveProperty, delProperty, saveFrame, path } = (0, import_react68.useContext)(FramesMDBContext); - const { newProperty: newPropertyInFrame } = (0, import_react68.useContext)(FramesMDBContext); + const { pathState } = (0, import_react69.useContext)(PathContext); + const [values2, setValues] = (0, import_react69.useState)({}); + const [cols, setCols] = (0, import_react69.useState)([]); + const [excludeKeys, setExcludeKeys] = (0, import_react69.useState)([]); + const { tableData, saveProperty, delProperty, saveFrame, path } = (0, import_react69.useContext)(FramesMDBContext); + const { newProperty: newPropertyInFrame } = (0, import_react69.useContext)(FramesMDBContext); const saveField = (source, field) => { if (source == "$fm") { if (pathState.type == "space" && newPropertyInFrame) { @@ -109429,7 +109773,7 @@ var PropertiesView = (props) => { refreshData(); } }; - (0, import_react68.useEffect)(() => { + (0, import_react69.useEffect)(() => { refreshData(); props.superstate.eventsDispatcher.addListener( "contextStateUpdated", @@ -109538,8 +109882,8 @@ var PropertiesView = (props) => { })) }); }; - const [dragProperty, setDragProperty] = (0, import_react68.useState)(null); - const [hoverNode, setHoverNode] = (0, import_react68.useState)(null); + const [dragProperty, setDragProperty] = (0, import_react69.useState)(null); + const [hoverNode, setHoverNode] = (0, import_react69.useState)(null); const resetState = () => { setHoverNode(null); setDragProperty(null); @@ -109608,9 +109952,9 @@ var PropertiesView = (props) => { ); }; const propertiessuperstate = props.superstate.settings.hideFrontmatter; - return !propertiessuperstate || props.force ? /* @__PURE__ */ import_react68.default.createElement("div", { + return !propertiessuperstate || props.force ? /* @__PURE__ */ import_react69.default.createElement("div", { className: "mk-path-context-properties" - }, cols.map((f2, i3) => /* @__PURE__ */ import_react68.default.createElement(PropertyView, { + }, cols.map((f2, i3) => /* @__PURE__ */ import_react69.default.createElement(PropertyView, { key: i3, columns: [], showMenu: showMenu2, @@ -109621,35 +109965,35 @@ var PropertiesView = (props) => { path: pathState.path, property: f2, editable: props.editable - })), /* @__PURE__ */ import_react68.default.createElement("button", { + })), /* @__PURE__ */ import_react69.default.createElement("button", { className: "mk-inline-button", onClick: (e4) => newProperty(e4) - }, /* @__PURE__ */ import_react68.default.createElement("div", { + }, /* @__PURE__ */ import_react69.default.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } - }), i18n_default.labels.newProperty)) : excludeKeys.length > 0 ? /* @__PURE__ */ import_react68.default.createElement("style", null, `${excludeKeys.map((f2) => `.metadata-property[data-property-key="${f2}"]`).join(", ")} + }), i18n_default.labels.newProperty)) : excludeKeys.length > 0 ? /* @__PURE__ */ import_react69.default.createElement("style", null, `${excludeKeys.map((f2) => `.metadata-property[data-property-key="${f2}"]`).join(", ")} { display: none; - }`) : /* @__PURE__ */ import_react68.default.createElement(import_react68.default.Fragment, null); + }`) : /* @__PURE__ */ import_react69.default.createElement(import_react69.default.Fragment, null); }; var PropertyView = (props) => { - const isObjectType = (0, import_react68.useMemo)( + const isObjectType = (0, import_react69.useMemo)( () => propertyIsObjectType(props.property), [props.property, props.values] ); - return /* @__PURE__ */ import_react68.default.createElement(import_react68.default.Fragment, null, /* @__PURE__ */ import_react68.default.createElement("div", { + return /* @__PURE__ */ import_react69.default.createElement(import_react69.default.Fragment, null, /* @__PURE__ */ import_react69.default.createElement("div", { className: "mk-path-context-row" - }, /* @__PURE__ */ import_react68.default.createElement(PropertyField, { + }, /* @__PURE__ */ import_react69.default.createElement(PropertyField, { path: props.path, superstate: props.superstate, property: props.property, onClick: (e4) => props.showMenu(e4, props.property), draggable: true - }), (props.compactMode || !isObjectType) && /* @__PURE__ */ import_react68.default.createElement("div", { + }), (props.compactMode || !isObjectType) && /* @__PURE__ */ import_react69.default.createElement("div", { className: "mk-path-context-value" - }, /* @__PURE__ */ import_react68.default.createElement(DataTypeView, { + }, /* @__PURE__ */ import_react69.default.createElement(DataTypeView, { superstate: props.superstate, initialValue: props.values[props.property.name], row: props.values, @@ -109664,9 +110008,9 @@ var PropertyView = (props) => { }), contextTable: {}, source: props.path - }))), !props.compactMode && isObjectType && /* @__PURE__ */ import_react68.default.createElement("div", { + }))), !props.compactMode && isObjectType && /* @__PURE__ */ import_react69.default.createElement("div", { className: "mk-path-context-value" - }, /* @__PURE__ */ import_react68.default.createElement(DataTypeView, { + }, /* @__PURE__ */ import_react69.default.createElement(DataTypeView, { superstate: props.superstate, initialValue: props.values[props.property.name], row: props.values, @@ -109686,7 +110030,7 @@ var PropertyView = (props) => { // src/core/react/components/SpaceView/Contexts/DataTypeView/ObjectCell.tsx var import_lodash12 = __toESM(require_lodash()); -var import_react69 = __toESM(require_react()); +var import_react70 = __toESM(require_react()); var ObjectEditor = (props) => { const { value, saveValue, saveType } = props; const type = props.type ?? {}; @@ -109718,7 +110062,7 @@ var ObjectEditor = (props) => { false ); }; - return /* @__PURE__ */ import_react69.default.createElement(import_react69.default.Fragment, null, Object.keys(type).map((f2, i3) => /* @__PURE__ */ import_react69.default.createElement(PropertyView, { + return /* @__PURE__ */ import_react70.default.createElement(import_react70.default.Fragment, null, Object.keys(type).map((f2, i3) => /* @__PURE__ */ import_react70.default.createElement(PropertyView, { key: i3, superstate: props.superstate, savePropertyValue: (v2, f3) => saveVal(f3.name, v2), @@ -109734,10 +110078,10 @@ var ObjectEditor = (props) => { value: type[f2].value }, editable: true - })), props.editMode > 3 /* EditModeValueOnly */ && /* @__PURE__ */ import_react69.default.createElement("button", { + })), props.editMode > 3 /* EditModeValueOnly */ && /* @__PURE__ */ import_react70.default.createElement("button", { onClick: (e4) => newProperty(e4), className: "mk-inline-button" - }, /* @__PURE__ */ import_react69.default.createElement("div", { + }, /* @__PURE__ */ import_react70.default.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") @@ -109752,7 +110096,7 @@ var ObjectCell = (props) => { ); const type = parsedValue.type; const { initialValue, superstate } = props; - const [value, setValue] = import_react69.default.useState( + const [value, setValue] = import_react70.default.useState( props.multi ? ensureArray(safelyParseJSON(initialValue)) : safelyParseJSON(initialValue) ?? {} ); const saveType = (newType) => { @@ -109780,12 +110124,12 @@ var ObjectCell = (props) => { [key2]: "" }); }; - import_react69.default.useEffect(() => { + import_react70.default.useEffect(() => { props.multi ? setValue(ensureArray(safelyParseJSON(initialValue))) : setValue(safelyParseJSON(initialValue) ?? {}); }, [initialValue, props.multi]); - return /* @__PURE__ */ import_react69.default.createElement("div", { + return /* @__PURE__ */ import_react70.default.createElement("div", { className: "mk-cell-object" - }, !props.compactMode ? /* @__PURE__ */ import_react69.default.createElement(ObjectEditor, { + }, !props.compactMode ? /* @__PURE__ */ import_react70.default.createElement(ObjectEditor, { superstate, value, compactMode: props.compactMode, @@ -109795,12 +110139,12 @@ var ObjectCell = (props) => { saveValue, saveType, editMode: props.editMode - }) : /* @__PURE__ */ import_react69.default.createElement("div", { + }) : /* @__PURE__ */ import_react70.default.createElement("div", { className: "mk-path-context-field", onClick: (e4) => { superstate.ui.openModal( i18n_default.menu.edit, - (_props) => /* @__PURE__ */ import_react69.default.createElement(ObjectEditor, { + (_props) => /* @__PURE__ */ import_react70.default.createElement(ObjectEditor, { superstate, value, compactMode: props.compactMode, @@ -109817,9 +110161,9 @@ var ObjectCell = (props) => { }; // src/core/react/components/SpaceView/Contexts/DataTypeView/SuperCell.tsx -var import_react70 = __toESM(require_react()); +var import_react71 = __toESM(require_react()); var SuperCell = (props) => { - const command = (0, import_react70.useMemo)(() => { + const command = (0, import_react71.useMemo)(() => { const parsedValue = parseFieldValue( props.propertyValue, "super", @@ -109845,10 +110189,10 @@ var SuperCell = (props) => { } return parsedValue; }; - const [value, setValue] = (0, import_react70.useState)( + const [value, setValue] = (0, import_react71.useState)( parseValue(unwrapParanthesis(props.initialValue)) ); - (0, import_react70.useEffect)(() => { + (0, import_react71.useEffect)(() => { setValue(parseValue(unwrapParanthesis(props.initialValue))); }, [props.initialValue]); const replacer = (key2, value2) => typeof value2 === "string" ? `|${value2}|` : value2; @@ -109869,45 +110213,45 @@ var SuperCell = (props) => { }; props.superstate.ui.openCustomMenu( rect, - /* @__PURE__ */ import_react70.default.createElement(ParameterSetter, { + /* @__PURE__ */ import_react71.default.createElement(ParameterSetter, { ..._props }), _props, "bottom" ); }; - return /* @__PURE__ */ import_react70.default.createElement(import_react70.default.Fragment, null, command && /* @__PURE__ */ import_react70.default.createElement("div", { + return /* @__PURE__ */ import_react71.default.createElement(import_react71.default.Fragment, null, command && /* @__PURE__ */ import_react71.default.createElement("div", { className: "mk-cell-super", onClick: (e4) => editParameters(e4) }, "Edit Parameters")); }; var ParameterSetter = (props) => { - const [value, setValue] = (0, import_react70.useState)(props.value); + const [value, setValue] = (0, import_react71.useState)(props.value); const saveValue = (key2, val) => { setValue({ ...value, [key2]: val }); props.saveValue(key2, val); }; - return /* @__PURE__ */ import_react70.default.createElement("div", { + return /* @__PURE__ */ import_react71.default.createElement("div", { className: "mk-editor-actions-body" - }, /* @__PURE__ */ import_react70.default.createElement("div", { + }, /* @__PURE__ */ import_react71.default.createElement("div", { className: "mk-editor-actions-name" - }, /* @__PURE__ */ import_react70.default.createElement("div", { + }, /* @__PURE__ */ import_react71.default.createElement("div", { className: "mk-path-icon", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker( stickerForSchema(props.command.schema) ) } - }), props.command.schema.name), /* @__PURE__ */ import_react70.default.createElement("div", { + }), props.command.schema.name), /* @__PURE__ */ import_react71.default.createElement("div", { className: "mk-editor-actions-fields" - }, props.command.fields.map((field, i3) => /* @__PURE__ */ import_react70.default.createElement("div", { + }, props.command.fields.map((field, i3) => /* @__PURE__ */ import_react71.default.createElement("div", { className: "mk-path-context-row", key: i3 - }, /* @__PURE__ */ import_react70.default.createElement("div", { + }, /* @__PURE__ */ import_react71.default.createElement("div", { className: "mk-path-context-field" - }, field.name), /* @__PURE__ */ import_react70.default.createElement("div", { + }, field.name), /* @__PURE__ */ import_react71.default.createElement("div", { className: "mk-path-context-value" - }, /* @__PURE__ */ import_react70.default.createElement(DataTypeView, { + }, /* @__PURE__ */ import_react71.default.createElement(DataTypeView, { superstate: props.superstate, initialValue: removeQuotes(value?.[field.name]), compactMode: true, @@ -109919,13 +110263,13 @@ var ParameterSetter = (props) => { }; // src/core/react/components/SpaceView/Contexts/DataTypeView/TagCell.tsx -var import_react71 = __toESM(require_react()); +var import_react72 = __toESM(require_react()); var TagCell = (props) => { - const [value, setValue] = (0, import_react71.useState)([]); - (0, import_react71.useEffect)(() => { + const [value, setValue] = (0, import_react72.useState)([]); + (0, import_react72.useEffect)(() => { setValue([...props.superstate.tagsMap.get(props.path) ?? []]); }, []); - (0, import_react71.useEffect)(() => { + (0, import_react72.useEffect)(() => { const updateValue2 = (payload) => { if (payload.path == props.path) setValue([...props.superstate.tagsMap.get(props.path) ?? []]); @@ -109966,7 +110310,7 @@ var TagCell = (props) => { onHide: () => props.setEditMode(null) }; }; - return /* @__PURE__ */ import_react71.default.createElement(OptionCellBase, { + return /* @__PURE__ */ import_react72.default.createElement(OptionCellBase, { superstate: props.superstate, baseClass: "mk-cell-tags", removeValue, @@ -109975,7 +110319,7 @@ var TagCell = (props) => { value, multi: true, editMode: props.editMode, - labelElement: (_props) => /* @__PURE__ */ import_react71.default.createElement("div", { + labelElement: (_props) => /* @__PURE__ */ import_react72.default.createElement("div", { className: "mk-cell-tags-label" }, _props.value, _props.children) }); @@ -109987,13 +110331,13 @@ var TableView = (props) => { spaceInfo, readMode, spaceState: spaceCache - } = (0, import_react72.useContext)(SpaceContext); + } = (0, import_react73.useContext)(SpaceContext); const { tableData, dbSchema, contextTable, saveDB - } = (0, import_react72.useContext)(ContextMDBContext); + } = (0, import_react73.useContext)(ContextMDBContext); const { selectedRows, selectRows, @@ -110003,20 +110347,24 @@ var TableView = (props) => { savePredicate, updateFieldValue, updateValue: updateValue2 - } = (0, import_react72.useContext)(ContextEditorContext); - const [activeId, setActiveId] = (0, import_react72.useState)(null); - const [lastSelectedIndex, setLastSelectedIndex] = (0, import_react72.useState)(null); - const [selectedColumn, setSelectedColumn] = (0, import_react72.useState)(null); - const [currentEdit, setCurrentEdit] = (0, import_react72.useState)(null); - const [overId, setOverId] = (0, import_react72.useState)(null); - const [openFlows, setOpenFlows] = (0, import_react72.useState)([]); - const [colsSize, setColsSize] = (0, import_react72.useState)({}); - const ref2 = (0, import_react72.useRef)(null); + } = (0, import_react73.useContext)(ContextEditorContext); + const [pagination, setPagination] = import_react73.default.useState({ + pageIndex: 0, + pageSize: 10 + }); + const [activeId, setActiveId] = (0, import_react73.useState)(null); + const [lastSelectedIndex, setLastSelectedIndex] = (0, import_react73.useState)(null); + const [selectedColumn, setSelectedColumn] = (0, import_react73.useState)(null); + const [currentEdit, setCurrentEdit] = (0, import_react73.useState)(null); + const [overId, setOverId] = (0, import_react73.useState)(null); + const [openFlows, setOpenFlows] = (0, import_react73.useState)([]); + const [colsSize, setColsSize] = (0, import_react73.useState)({}); + const ref2 = (0, import_react73.useRef)(null); const primaryCol = cols.find((f2) => f2.primary == "true"); - (0, import_react72.useEffect)(() => { - setColsSize({ ...predicate.colsSize, "+": 30 }); + (0, import_react73.useEffect)(() => { + setColsSize({ ...predicate?.colsSize ?? {}, "+": 30 }); }, [predicate]); - (0, import_react72.useEffect)(() => { + (0, import_react73.useEffect)(() => { setCurrentEdit(null); }, [selectedColumn, lastSelectedIndex]); const saveColsSize = (colSize) => { @@ -110024,10 +110372,9 @@ var TableView = (props) => { setColsSize(newColSize); debouncedSavePredicate(newColSize); }; - const debouncedSavePredicate = (0, import_react72.useCallback)( + const debouncedSavePredicate = (0, import_react73.useCallback)( (0, import_lodash13.debounce)( (nextValue) => savePredicate({ - ...predicate, colsSize: nextValue }), 1e3 @@ -110181,7 +110528,7 @@ var TableView = (props) => { setSelectedColumn(newIndex); } }; - const columns = (0, import_react72.useMemo)( + const columns = (0, import_react73.useMemo)( () => [ ...cols.map((f2) => { return { @@ -110237,10 +110584,10 @@ var TableView = (props) => { }; const fieldType = fieldTypeForType(f2.type, f2.name); if (!fieldType) { - return /* @__PURE__ */ import_react72.default.createElement(import_react72.default.Fragment, null, initialValue); + return /* @__PURE__ */ import_react73.default.createElement(import_react73.default.Fragment, null, initialValue); } if (fieldType.type == "file") { - return /* @__PURE__ */ import_react72.default.createElement(PathCell, { + return /* @__PURE__ */ import_react73.default.createElement(PathCell, { ...cellProps, multi: fieldType.multiType == f2.type, folder: spaceInfo.path, @@ -110248,51 +110595,51 @@ var TableView = (props) => { deleteRow: () => deleteRow(index) }); } else if (fieldType.type == "boolean") { - return /* @__PURE__ */ import_react72.default.createElement(BooleanCell, { + return /* @__PURE__ */ import_react73.default.createElement(BooleanCell, { ...cellProps, column: f2 }); } else if (fieldType.type == "option") { - return /* @__PURE__ */ import_react72.default.createElement(OptionCell, { + return /* @__PURE__ */ import_react73.default.createElement(OptionCell, { ...cellProps, multi: fieldType.multiType == f2.type, saveOptions: saveFieldValue }); } else if (fieldType.type == "date") { - return /* @__PURE__ */ import_react72.default.createElement(DateCell, { + return /* @__PURE__ */ import_react73.default.createElement(DateCell, { ...cellProps }); } else if (fieldType.type == "context") { - return /* @__PURE__ */ import_react72.default.createElement(ContextCell, { + return /* @__PURE__ */ import_react73.default.createElement(ContextCell, { ...cellProps, multi: fieldType.multiType == f2.type }); } else if (fieldType.type == "fileprop") { - return /* @__PURE__ */ import_react72.default.createElement(LookUpCell, { + return /* @__PURE__ */ import_react73.default.createElement(LookUpCell, { ...cellProps, row: data2[index], columns: cols, saveOptions: saveFieldValue }); } else if (fieldType.type == "tags") { - return /* @__PURE__ */ import_react72.default.createElement(TagCell, { + return /* @__PURE__ */ import_react73.default.createElement(TagCell, { ...cellProps }); } else if (fieldType.type == "number") { - return /* @__PURE__ */ import_react72.default.createElement(NumberCell, { + return /* @__PURE__ */ import_react73.default.createElement(NumberCell, { ...cellProps }); } else if (fieldType.type == "link") { - return /* @__PURE__ */ import_react72.default.createElement(LinkCell, { + return /* @__PURE__ */ import_react73.default.createElement(LinkCell, { ...cellProps, multi: fieldType.multiType == f2.type }); } else if (fieldType.type == "image") { - return /* @__PURE__ */ import_react72.default.createElement(ImageCell, { + return /* @__PURE__ */ import_react73.default.createElement(ImageCell, { ...cellProps }); } else if (fieldType.type == "object") { - return /* @__PURE__ */ import_react72.default.createElement(ObjectCell, { + return /* @__PURE__ */ import_react73.default.createElement(ObjectCell, { ...cellProps, multi: fieldType.multiType == f2.type, savePropValue: saveFieldValue, @@ -110301,14 +110648,14 @@ var TableView = (props) => { row: data2[index] }); } else if (fieldType.type == "super") { - return /* @__PURE__ */ import_react72.default.createElement(SuperCell, { + return /* @__PURE__ */ import_react73.default.createElement(SuperCell, { ...cellProps, row: data2[index], columns: cols, compactMode: true }); } else { - return /* @__PURE__ */ import_react72.default.createElement(TextCell, { + return /* @__PURE__ */ import_react73.default.createElement(TextCell, { ...cellProps }); } @@ -110321,14 +110668,14 @@ var TableView = (props) => { meta: { schemaId: dbSchema?.id }, accessorKey: "+", size: 20, - cell: () => /* @__PURE__ */ import_react72.default.createElement(import_react72.default.Fragment, null) + cell: () => /* @__PURE__ */ import_react73.default.createElement(import_react73.default.Fragment, null) } ] ], [cols, currentEdit, predicate, contextTable, toggleFlow, openFlows] ); - const groupBy2 = (0, import_react72.useMemo)( - () => predicate.groupBy?.length > 0 && cols.find((f2) => f2.name + f2.table == predicate.groupBy[0]) ? predicate.groupBy : [], + const groupBy2 = (0, import_react73.useMemo)( + () => predicate?.groupBy?.length > 0 && cols.find((f2) => f2.name + f2.table == predicate.groupBy[0]) ? predicate.groupBy : [], [predicate, cols] ); const table = useReactTable({ @@ -110336,22 +110683,25 @@ var TableView = (props) => { columns, columnResizeMode: "onChange", state: { - columnVisibility: predicate.colsHidden.reduce( + columnVisibility: predicate?.colsHidden.reduce( (p, c3) => ({ ...p, [c3]: false }), {} ), - columnOrder: predicate.colsOrder, + columnOrder: predicate?.colsOrder, columnSizing: { ...columns.reduce((p, c3) => ({ ...p, [c3.accessorKey]: 150 }), {}), ...colsSize }, grouping: groupBy2, - expanded: true + expanded: true, + pagination }, onColumnSizingChange: saveColsSize, getCoreRowModel: getCoreRowModel(), getExpandedRowModel: getExpandedRowModel(), getGroupedRowModel: getGroupedRowModel(), + getPaginationRowModel: getPaginationRowModel(), + onPaginationChange: setPagination, meta: { updateData: updateValue2, updateFieldValue @@ -110391,9 +110741,8 @@ var TableView = (props) => { } const saveFilter = (filter2) => { savePredicate({ - ...predicate, filters: [ - ...predicate.filters.filter((s4) => s4.field != filter2.field), + ...(predicate?.filters ?? []).filter((s4) => s4.field != filter2.field), filter2 ] }); @@ -110460,12 +110809,12 @@ var TableView = (props) => { }; function handleDragEnd({ active, over }) { resetState(); + const currentCols = predicate?.colsOrder ?? []; savePredicate({ - ...predicate, colsOrder: arrayMove( - predicate.colsOrder, - predicate.colsOrder.findIndex((f2) => f2 == activeId), - predicate.colsOrder.findIndex((f2) => f2 == overId) + currentCols, + currentCols.findIndex((f2) => f2 == activeId), + currentCols.findIndex((f2) => f2 == overId) ) }); } @@ -110477,7 +110826,7 @@ var TableView = (props) => { setActiveId(null); document.body.style.setProperty("cursor", ""); } - return /* @__PURE__ */ import_react72.default.createElement(DndContext, { + return /* @__PURE__ */ import_react73.default.createElement(DndContext, { sensors, collisionDetection: closestCenter, measuring, @@ -110485,29 +110834,29 @@ var TableView = (props) => { onDragOver: handleDragOver, onDragEnd: handleDragEnd, onDragCancel: handleDragCancel - }, /* @__PURE__ */ import_react72.default.createElement("div", { + }, /* @__PURE__ */ import_react73.default.createElement("div", { className: "mk-table", ref: ref2, tabIndex: 1, onKeyDown - }, /* @__PURE__ */ import_react72.default.createElement("table", { + }, /* @__PURE__ */ import_react73.default.createElement("table", { ...{} - }, /* @__PURE__ */ import_react72.default.createElement("thead", null, table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ import_react72.default.createElement("tr", { + }, /* @__PURE__ */ import_react73.default.createElement("thead", null, table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ import_react73.default.createElement("tr", { key: headerGroup.id - }, /* @__PURE__ */ import_react72.default.createElement("th", null), headerGroup.headers.map((header) => /* @__PURE__ */ import_react72.default.createElement("th", { + }, /* @__PURE__ */ import_react73.default.createElement("th", null), headerGroup.headers.map((header) => /* @__PURE__ */ import_react73.default.createElement("th", { className: "mk-th", key: header.id, style: { minWidth: header.column.getIsGrouped() ? "0px" : colsSize[header.column.columnDef.accessorKey] ?? "150px", maxWidth: header.column.getIsGrouped() ? "0px" : colsSize[header.column.columnDef.accessorKey] ?? "150px" } - }, header.isPlaceholder ? null : header.column.columnDef.header != "+" ? header.column.getIsGrouped() ? /* @__PURE__ */ import_react72.default.createElement(import_react72.default.Fragment, null) : /* @__PURE__ */ import_react72.default.createElement(ColumnHeader, { + }, header.isPlaceholder ? null : header.column.columnDef.header != "+" ? header.column.getIsGrouped() ? /* @__PURE__ */ import_react73.default.createElement(import_react73.default.Fragment, null) : /* @__PURE__ */ import_react73.default.createElement(ColumnHeader, { superstate: props.superstate, editable: header.column.columnDef.meta.editable, column: cols.find( (f2) => f2.name == header.column.columnDef.header && f2.table == header.column.columnDef.meta.table ) - }) : /* @__PURE__ */ import_react72.default.createElement(ColumnHeader, { + }) : /* @__PURE__ */ import_react73.default.createElement(ColumnHeader, { superstate: props.superstate, isNew: true, editable: true, @@ -110517,13 +110866,13 @@ var TableView = (props) => { type: "text", table: "" } - }), /* @__PURE__ */ import_react72.default.createElement("div", { + }), /* @__PURE__ */ import_react73.default.createElement("div", { ...{ onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), className: `mk-resizer ${header.column.getIsResizing() ? "isResizing" : ""}` } - })))))), /* @__PURE__ */ import_react72.default.createElement("tbody", null, table.getRowModel().rows.map((row) => /* @__PURE__ */ import_react72.default.createElement("tr", { + })))))), /* @__PURE__ */ import_react73.default.createElement("tbody", null, table.getRowModel().rows.map((row) => /* @__PURE__ */ import_react73.default.createElement("tr", { className: selectedRows?.some( (f2) => f2 == data2[row.index]["_index"] ) ? "mk-active" : void 0, @@ -110534,12 +110883,12 @@ var TableView = (props) => { showContextMenu(e4, rowIndex); }, key: row.id - }, /* @__PURE__ */ import_react72.default.createElement("td", null), row.getVisibleCells().map( - (cell, i3) => cell.getIsGrouped() ? /* @__PURE__ */ import_react72.default.createElement("td", { + }, /* @__PURE__ */ import_react73.default.createElement("td", null), row.getVisibleCells().map( + (cell, i3) => cell.getIsGrouped() ? /* @__PURE__ */ import_react73.default.createElement("td", { key: i3, className: "mk-td-group", colSpan: cols.length + (readMode ? 0 : 1) - }, /* @__PURE__ */ import_react72.default.createElement("div", { + }, /* @__PURE__ */ import_react73.default.createElement("div", { ...{ onClick: row.getToggleExpandedHandler(), style: { @@ -110551,10 +110900,12 @@ var TableView = (props) => { }, flexRender( cell.column.columnDef.cell, cell.getContext() - ), " ", "(", row.subRows.length, ")")) : cell.getIsAggregated() ? flexRender( + ), " ", "(", row.subRows.length, ")")) : cell.getIsAggregated() ? /* @__PURE__ */ import_react73.default.createElement(import_react73.default.Fragment, { + key: i3 + }, flexRender( cell.column.columnDef.aggregatedCell ?? cell.column.columnDef.cell, cell.getContext() - ) : /* @__PURE__ */ import_react72.default.createElement("td", { + )) : /* @__PURE__ */ import_react73.default.createElement("td", { onClick: (e4) => selectCell( e4, cell.row.index, @@ -110569,7 +110920,11 @@ var TableView = (props) => { cell.column.columnDef.cell, cell.getContext() )) - )))), /* @__PURE__ */ import_react72.default.createElement("tfoot", null, !readMode ? /* @__PURE__ */ import_react72.default.createElement("tr", null, /* @__PURE__ */ import_react72.default.createElement("th", { + )))), /* @__PURE__ */ import_react73.default.createElement("tfoot", null, table.getCanNextPage() && /* @__PURE__ */ import_react73.default.createElement("tr", null, /* @__PURE__ */ import_react73.default.createElement("th", { + className: "mk-row-new", + colSpan: cols.length + (readMode ? 1 : 2), + onClick: () => table.setPageSize(pagination.pageSize + 25) + }, "Load More")), !readMode ? /* @__PURE__ */ import_react73.default.createElement("tr", null, /* @__PURE__ */ import_react73.default.createElement("th", { className: "mk-row-new", colSpan: cols.length + (readMode ? 1 : 2), "data-placeholder": i18n_default.hintText.newItem, @@ -110581,11 +110936,11 @@ var TableView = (props) => { } }, contentEditable: true - })) : /* @__PURE__ */ import_react72.default.createElement(import_react72.default.Fragment, null))), (0, import_react_dom4.createPortal)( - /* @__PURE__ */ import_react72.default.createElement(DragOverlay, { + })) : /* @__PURE__ */ import_react73.default.createElement(import_react73.default.Fragment, null))), (0, import_react_dom4.createPortal)( + /* @__PURE__ */ import_react73.default.createElement(DragOverlay, { dropAnimation: null, zIndex: 1600 - }, activeId ? /* @__PURE__ */ import_react72.default.createElement(ColumnHeader, { + }, activeId ? /* @__PURE__ */ import_react73.default.createElement(ColumnHeader, { superstate: props.superstate, editable: false, column: { @@ -110600,7 +110955,7 @@ var TableView = (props) => { }; // src/core/react/components/SpaceView/Contexts/DataTypeView/ColorCell.tsx -var import_react73 = __toESM(require_react()); +var import_react74 = __toESM(require_react()); var ColorCell = (props) => { const showMenu2 = (e4) => { const handleChangeComplete = (color2) => { @@ -110614,7 +110969,7 @@ var ColorCell = (props) => { handleChangeComplete ); }; - return /* @__PURE__ */ import_react73.default.createElement("div", null, /* @__PURE__ */ import_react73.default.createElement("div", { + return /* @__PURE__ */ import_react74.default.createElement("div", null, /* @__PURE__ */ import_react74.default.createElement("div", { className: "mk-setter-color", onClick: (e4) => showMenu2(e4), style: { @@ -110625,44 +110980,6 @@ var ColorCell = (props) => { })); }; -// src/core/react/components/SpaceView/Contexts/DataTypeView/IconCell.tsx -var import_react74 = __toESM(require_react()); -var IconCell = (props) => { - const value = (0, import_react74.useMemo)( - () => props.multi ? parseMultiString(props.initialValue) ?? [] : [props.initialValue], - [props.initialValue] - ); - const ref2 = (0, import_react74.useRef)(null); - (0, import_react74.useEffect)(() => { - if (props.editMode == 4 /* EditModeActive */) { - ref2?.current?.focus(); - } - }, [props.editMode]); - const triggerStickerMenu = (e4) => { - props.superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react74.default.createElement(StickerModal_default, { - ui: props.superstate.ui, - hide: _props.hide, - selectedSticker: (emoji) => props.saveValue(emoji) - })); - }; - return /* @__PURE__ */ import_react74.default.createElement("div", { - className: "mk-cell-icon" - }, value.map( - (v2, i3) => v2?.length > 0 ? /* @__PURE__ */ import_react74.default.createElement("div", { - key: i3, - "aria-label": i18n_default.buttons.changeIcon, - dangerouslySetInnerHTML: { - __html: props.superstate.ui.getSticker(v2) - }, - onClick: (e4) => triggerStickerMenu(e4) - }) : /* @__PURE__ */ import_react74.default.createElement("div", { - key: i3, - className: "mk-cell-placeholder", - onClick: (e4) => triggerStickerMenu(e4) - }, i18n_default.labels.selectIcon) - )); -}; - // src/core/react/components/SpaceView/Contexts/DataTypeView/PropertySelectCell.tsx var import_react75 = __toESM(require_react()); var PropertySelectCell = (props) => { @@ -110963,7 +111280,7 @@ var PathContextList = (props) => { saveField: (newField) => saveField(newField, field), hide: hideColumn, deleteColumn: delColumn, - hidden: predicate.colsHidden.includes(field.name + field.table) + hidden: predicate?.colsHidden.includes(field.name + field.table) }); }; return pathContext && pathContext.cols.length > 0 && /* @__PURE__ */ import_react78.default.createElement(import_react78.default.Fragment, null, pathContext.cols.map((f2, i3) => /* @__PURE__ */ import_react78.default.createElement(import_react78.default.Fragment, { @@ -113873,7 +114190,7 @@ var SidebarProvider = (props) => { const newWaypoints = props.superstate.waypoints.map( (f2, i3) => i3 == props.superstate.settings.currentWaypoint ? newWaypoint : f2 ); - props.superstate.spaceManager.saveWaypoints(newWaypoints); + props.superstate.spaceManager.saveWaypoints(newWaypoints.filter((f2) => f2)); }; const closeActiveViewSpace = (path) => { const newWaypoint = props.superstate.waypoints[props.superstate.settings.currentWaypoint] ?? { sticker: "", name: "Waypoint", paths: [] }; @@ -113887,10 +114204,10 @@ var SidebarProvider = (props) => { const newWaypoints = props.superstate.waypoints.map( (f2, i3) => i3 == props.superstate.settings.currentWaypoint ? newWaypoint : f2 ); - props.superstate.spaceManager.saveWaypoints(newWaypoints); + props.superstate.spaceManager.saveWaypoints(newWaypoints.filter((f2) => f2)); }; const saveWaypoints = (paths) => { - props.superstate.spaceManager.saveWaypoints(paths); + props.superstate.spaceManager.saveWaypoints(paths.filter((f2) => f2)); }; const refreshSpaces = (payload) => { if (props.superstate.waypoints[props.superstate.settings.currentWaypoint]?.paths?.includes(payload.path)) { @@ -115508,6 +115825,17 @@ var TreeItem = (props) => { ); return; } + if (space2.path == tagsSpacePath) { + superstate.ui.openModal("New Tag", (props2) => { + return /* @__PURE__ */ import_react105.default.createElement(InputModal, { + value: "", + saveLabel: i18n_default.labels.saveView, + hide: props2.hide, + saveValue: (value) => addTag(superstate, value) + }); + }); + return; + } newPathInSpace( superstate, space2, @@ -115527,7 +115855,7 @@ var TreeItem = (props) => { e4, activePath, data2.space, - () => closeActiveSpace(data2.path) + data2.type == "group" ? () => closeActiveSpace(data2.path) : null ); return; } @@ -117223,6 +117551,9 @@ var PinnedSpace = (0, import_react109.forwardRef)( clone4 && "mk-clone", ghost && "mk-ghost" ), + style: { + ...style + }, dangerouslySetInnerHTML: { __html: superstate.ui.getSticker(pin.sticker) } @@ -117246,11 +117577,7 @@ var PinnedSpace = (0, import_react109.forwardRef)( indicator && "mk-indicator", clone4 && "mk-clone", ghost && "mk-ghost" - ), - style: { - ...style, - ...{ pointerEvents: "none" } - } + ) })); } ); @@ -117280,33 +117607,18 @@ var SpaceSwitcher = (props) => { const waypoint = waypoints.find((f2, i3) => i3 == overId); if (!waypoint) return; - if (dragPaths.length > 1) { - const _projected = { - depth: 0, - overId, - parentId: null, - sortable: false, - insert: true, - droppable: true, - copy: false, - reorder: false - }; - setProjected(_projected); - return; - } else { - const insert2 = !activeId && (!pathIsSpace(props.superstate, dragPaths[0]) || modifier == "copy" || modifier == "link"); - const _projected = { - depth: 0, - overId, - parentId: null, - sortable: false, - insert: insert2, - droppable: true, - copy: modifier == "copy" || modifier == "link", - reorder: false - }; - setProjected(_projected); - } + const _projected = { + depth: 0, + overId, + parentId: null, + sortable: false, + insert: true, + droppable: true, + copy: false, + reorder: false + }; + setProjected(_projected); + return; }, [overId, dragPaths, offset2, modifier, waypoints, activeId]); const resetState = () => { setModifier(null); @@ -117344,7 +117656,14 @@ var SpaceSwitcher = (props) => { }; const dragOver = (id3, x2) => { setOffset(x2); - setOverId(id3); + if (activeId == null) { + setOverId(id3); + } else { + if (id3 == activeId) + return; + setWaypoints(arrayMove(waypoints, activeId, id3)); + setActiveId(id3); + } }; const dragEnded = () => { if (projected && projected.insert) { @@ -117390,7 +117709,13 @@ var SpaceSwitcher = (props) => { function handleDragOver({ over }) { const overId2 = over?.id; if (overId2 !== null) { - setOverId(overId2); + if (activeId == null) { + setOverId(overId2); + } else { + setWaypoints( + arrayMove(waypoints, overId2, parseInt(activeId)) + ); + } } } function handleDragEnd({ active, over }) { @@ -117968,6 +118293,7 @@ var Suggester = (0, import_react116.forwardRef)( root: "mk-menu-container", rootFocused: "mk-focused", selected: "mk-selected", + selectedTagWrapper: "mk-menu-selected-tag-wrapper", selectedTag: "mk-menu-selected-tag", selectedTagName: "mk-menu-selected-tag-name", search: "mk-menu-search", @@ -122274,7 +122600,7 @@ var ContextListView = (props) => { } = (0, import_react148.useContext)(ContextEditorContext); const { instance } = (0, import_react148.useContext)(FrameInstanceContext); const { cols, dbSchema } = (0, import_react148.useContext)(ContextMDBContext); - const groupBy2 = predicate.groupBy?.length > 0 ? cols.find((f2) => f2.name + f2.table == predicate.groupBy[0]) : null; + const groupBy2 = predicate?.groupBy?.length > 0 ? cols.find((f2) => f2.name + f2.table == predicate.groupBy[0]) : null; const groupByOptions = (0, import_react148.useMemo)(() => { const groupByOptions2 = instance?.state[instance?.root?.id].props?.groupOptions; if (groupByOptions2) @@ -122444,18 +122770,22 @@ var ContextListContainer = (props) => { const { frameSchema } = (0, import_react149.useContext)(FramesMDBContext); const [editSection, setEditSection] = (0, import_react149.useState)(null); const [selectedIndex, setSelectedIndex] = (0, import_react149.useState)(null); - const [uris, setURIs] = (0, import_react149.useState)({ - listView: props.superstate.spaceManager.uriByString( - initiateString(predicate.listView, "spaces://$kit/#*listView") - ), - listGroup: props.superstate.spaceManager.uriByString( - initiateString(predicate.listGroup, "spaces://$kit/#*listGroup") - ), - listItem: props.superstate.spaceManager.uriByString( - initiateString(predicate.listItem, "spaces://$kit/#*rowItem") - ) - }); + const [uris, setURIs] = (0, import_react149.useState)( + predicate ? { + listView: props.superstate.spaceManager.uriByString( + initiateString(predicate.listView, "spaces://$kit/#*listView") + ), + listGroup: props.superstate.spaceManager.uriByString( + initiateString(predicate.listGroup, "spaces://$kit/#*listGroup") + ), + listItem: props.superstate.spaceManager.uriByString( + initiateString(predicate.listItem, "spaces://$kit/#*rowItem") + ) + } : null + ); (0, import_react149.useEffect)(() => { + if (!predicate) + return; const newURIs = { listView: props.superstate.spaceManager.uriByString( initiateString(predicate.listView, "spaces://$kit/#*listView") @@ -122474,7 +122804,7 @@ var ContextListContainer = (props) => { }, !props.minMode && /* @__PURE__ */ import_react149.default.createElement(FilterBar, { superstate: props.superstate, setView: props.setView - }), predicate.view == "table" || predicate.view == "db" || dbSchema?.primary != "true" && !frameSchema ? /* @__PURE__ */ import_react149.default.createElement(TableView, { + }), uris && (predicate.view == "table" || predicate.view == "db" || dbSchema?.primary != "true" && !frameSchema ? /* @__PURE__ */ import_react149.default.createElement(TableView, { superstate: props.superstate }) : /* @__PURE__ */ import_react149.default.createElement("div", { className: "mk-editor-context" @@ -122511,7 +122841,7 @@ var ContextListContainer = (props) => { setSelectedIndex, groupURI: uris.listGroup, itemURI: uris.listItem - })))))); + }))))))); }; // src/core/react/components/MDBView/MDBViewer.tsx @@ -122860,12 +123190,13 @@ var import_react156 = __toESM(require_react()); var import_react154 = __toESM(require_react()); var TitleComponent = (props) => { const { pathState } = (0, import_react154.useContext)(PathContext); + const { spaceState } = (0, import_react154.useContext)(SpaceContext); const fileNameRef = (0, import_react154.useRef)(null); const name317 = (0, import_react154.useMemo)( () => pathState ? props.superstate.settings.spacesUseAlias ? pathState?.displayName : pathState.subtype == "tag" ? stringFromTag(pathState?.name) : pathState?.name : null, [pathState] ); - const contentEditable = !props.readOnly; + const contentEditable = !props.readOnly && spaceState?.type != "default"; const onBlur = (e4) => { const newValue = e4.target.innerHTML; if (newValue != name317) { @@ -123463,6 +123794,7 @@ var TextCacher = class { // src/adapters/obsidian/ui/editors/markdownView/FileLinkViewComponent.tsx var import_obsidian2 = require("obsidian"); +var import_classnames9 = __toESM(require_classnames()); var import_react162 = __toESM(require_react()); // src/adapters/obsidian/filetypes/frontmatter/frontMatterKeys.ts @@ -123601,7 +123933,10 @@ var FileLinkViewComponent = (props) => { }); }, [props.path]); return /* @__PURE__ */ import_react162.default.createElement("div", { - className: "markdown-preview-view markdown-rendered node-insert-event is-readable-line-width allow-fold-headings show-indentation-guide allow-fold-lists show-frontmatter" + className: (0, import_classnames9.default)( + "markdown-preview-view markdown-rendered node-insert-event allow-fold-headings show-indentation-guide allow-fold-lists show-frontmatter", + props.superstate.settings.readableLineWidth ? "is-readable-line-width" : "" + ) }, /* @__PURE__ */ import_react162.default.createElement("div", { className: "mk-remote-header" }, /* @__PURE__ */ import_react162.default.createElement(RemoteMarkdownHeaderView, { @@ -123740,6 +124075,7 @@ var import_react169 = __toESM(require_react()); var import_react167 = __toESM(require_react()); var SpaceHeader = (props) => { const { readMode } = (0, import_react167.useContext)(PathContext); + const { spaceState } = (0, import_react167.useContext)(SpaceContext); const [collapsed, setCollapsed] = (0, import_react167.useState)( !props.superstate.settings.inlineContextExpanded ); @@ -123764,7 +124100,7 @@ var SpaceHeader = (props) => { superstate: props.superstate, collapsed, onToggle: (c3) => setCollapsed(c3) - })))), !collapsed && /* @__PURE__ */ import_react167.default.createElement(NoteSpacesBar, { + })))), !collapsed && spaceState?.type == "folder" && /* @__PURE__ */ import_react167.default.createElement(NoteSpacesBar, { superstate: props.superstate }))); }; @@ -125492,7 +125828,7 @@ var toggleMarkExtension = import_state11.EditorState.transactionFilter.of( ); // src/adapters/obsidian/ui/editors/markdownView/menus/inlineStylerView/InlineMenu.tsx -var import_classnames9 = __toESM(require_classnames()); +var import_classnames10 = __toESM(require_classnames()); var import_react174 = __toESM(require_react()); // src/adapters/obsidian/ui/editors/markdownView/menus/inlineStylerView/Mark.tsx @@ -125764,7 +126100,7 @@ var InlineMenuComponent = (props) => { } })) : /* @__PURE__ */ import_react174.default.createElement(import_react174.default.Fragment, null)); return /* @__PURE__ */ import_react174.default.createElement("div", { - className: (0, import_classnames9.default)("mk-style-menu", props.mobile ? "" : "menu"), + className: (0, import_classnames10.default)("mk-style-menu", props.mobile ? "" : "menu"), onMouseDown: (e4) => e4.preventDefault() }, mode == 0 && props.mobile ? makeMode() : mode == 2 ? colorsMode() : marksMode()); }; @@ -125970,6 +126306,7 @@ var replaceAllEmbed = (el, ctx, superstate, app2) => { var DEFAULT_SETTINGS = { newNotePlaceholder: "Untitled", defaultInitialization: false, + navigatorEnabled: true, filePreviewOnHover: false, flowMenuEnabled: true, markSans: false, @@ -126042,7 +126379,6 @@ var DEFAULT_SETTINGS = { autoMigration08: false, releaseNotesPrompt: 0.8, enableDefaultSpaces: true, - enableTagSpaces: true, showSpacePinIcon: true, minimalFix: false, experimental: false, @@ -126062,6 +126398,9 @@ var MakeMDPluginSettingsTab = class extends import_obsidian10.PluginSettingTab { super(app2, plugin); this.plugin = plugin; } + refreshObsidian() { + this.app.commands.executeCommandById("app:reload"); + } refreshView() { this.display(); } @@ -126070,18 +126409,19 @@ var MakeMDPluginSettingsTab = class extends import_obsidian10.PluginSettingTab { containerEl.innerHTML = ""; containerEl.createEl("h1", { text: i18n_default.settings.sectionSidebar }); new import_obsidian10.Setting(containerEl).setName(i18n_default.settings.spaces.name).setDesc(i18n_default.settings.spaces.desc).addToggle( - (toggle) => toggle.setValue(this.plugin.superstate.settings.spacesEnabled).onChange((value) => { - this.plugin.superstate.settings.spacesEnabled = value; + (toggle) => toggle.setValue(this.plugin.superstate.settings.navigatorEnabled).onChange((value) => { + this.plugin.superstate.settings.navigatorEnabled = value; this.plugin.saveSettings(); if (value) { this.plugin.openFileTreeLeaf(true); } else { this.plugin.detachFileTreeLeafs(); + this.refreshObsidian(); } this.refreshView(); }) ); - new import_obsidian10.Setting(containerEl).setName(i18n_default.settings.defaultSpaces.name).setDesc(i18n_default.settings.defaultSpaces.desc).addToggle( + new import_obsidian10.Setting(containerEl).setName(i18n_default.settings.tagSpaces.name).setDesc(i18n_default.settings.tagSpaces.desc).addToggle( (toggle) => toggle.setValue(this.plugin.superstate.settings.enableDefaultSpaces).onChange((value) => { this.plugin.superstate.settings.enableDefaultSpaces = value; this.plugin.saveSettings(); @@ -126100,16 +126440,6 @@ var MakeMDPluginSettingsTab = class extends import_obsidian10.PluginSettingTab { this.plugin.saveSettings(); }) ); - if (this.plugin.superstate.settings.enableDefaultSpaces) { - containerEl.createEl("h3", { text: i18n_default.settings.sectionDefault }); - const defaultSpaces = containerEl.createEl("div"); - new import_obsidian10.Setting(defaultSpaces).setName(i18n_default.settings.tagSpaces.name).setDesc(i18n_default.settings.tagSpaces.desc).addToggle( - (toggle) => toggle.setValue(this.plugin.superstate.settings.enableTagSpaces).onChange((value) => { - this.plugin.superstate.settings.enableTagSpaces = value; - this.plugin.saveSettings(); - }) - ); - } if (this.plugin.superstate.settings.spacesEnabled) { containerEl.createEl("h3", { text: i18n_default.settings.sectionNavigator }); const spaceAppearances = containerEl.createEl("div"); @@ -129279,6 +129609,8 @@ var ObsidianFileSystem = class { this.middleware = middleware; } resourcePathForPath(path) { + if (!path) + return path; const file = this.plugin.app.vault.getAbstractFileByPath(path); if (file instanceof import_obsidian20.TFile) { return this.plugin.app.vault.getResourcePath(file); @@ -137111,6 +137443,7 @@ var CLIManager = class { var import_react193 = __toESM(require_react()); // src/core/react/components/Blink/BlinkComponent.tsx +var import_lodash27 = __toESM(require_lodash()); var import_react192 = __toESM(require_react()); var BlinkComponent = (props) => { const [previewPath, setPreviewPath] = (0, import_react192.useState)(null); @@ -137157,21 +137490,24 @@ var BlinkComponent = (props) => { ); }; (0, import_react192.useEffect)(() => { - props.superstate.runner.run({ - type: "search", - path: "", - payload: { queries, count: 10 } - }).then( - (g) => setFilteredPaths( - g.map((f2) => ({ - name: f2.name, - icon: f2.label.sticker, - description: f2.path, - value: f2.path - })) - ) - ); - }, [queries]); + const runQuery = (path, _queries) => { + props.superstate.searcher.run({ + type: "search", + path, + payload: { queries: _queries, count: 10 } + }).then( + (g) => setFilteredPaths( + g.map((f2) => ({ + name: f2.name, + icon: f2.label.sticker, + description: f2.subtype == "tag" || f2.subtype == "default" ? null : f2.path, + value: f2.path + })) + ) + ); + }; + (0, import_lodash27.debounce)(() => runQuery(query, queries), 300)(); + }, [query, queries]); (0, import_react192.useEffect)(() => { const path = suggestions[index]?.value; if (!path || path == previewPath) @@ -137199,6 +137535,8 @@ var BlinkComponent = (props) => { if (e4.key == "ArrowUp") { const size = 0; const newIndex = index <= size ? suggestions.length - 1 : index - 1; + if (suggestions.length == 0) + return; if (suggestions[newIndex].disabled) { setIndex(newIndex < size ? suggestions.length - 1 : newIndex - 1); } else { @@ -137230,6 +137568,7 @@ var BlinkComponent = (props) => { root: "mk-menu-container", rootFocused: "mk-focused", selected: "mk-selected", + selectedTagWrapper: "mk-menu-selected-tag-wrapper", selectedTag: "mk-menu-selected-tag", selectedTagName: "mk-menu-selected-tag-name", search: "mk-menu-search", @@ -137245,9 +137584,9 @@ var BlinkComponent = (props) => { }, [ref2.current]); const metadataProperties = allMetadata(props.superstate); const allOptions = []; - Object.keys(allMetadata).forEach((type) => { + Object.keys(metadataProperties).forEach((type) => { metadataProperties[type].properties.forEach((field) => { - allOptions.push(field); + allOptions.push({ ...field }); }); }); const allSections = Object.keys(metadataProperties).map((f2) => { @@ -137257,13 +137596,19 @@ var BlinkComponent = (props) => { }; }); return /* @__PURE__ */ import_react192.default.createElement(import_react192.default.Fragment, null, /* @__PURE__ */ import_react192.default.createElement("div", { + className: "mk-blink-input" + }, /* @__PURE__ */ import_react192.default.createElement("div", { + className: "mk-icon-small", + dangerouslySetInnerHTML: { + __html: props.superstate.ui.getSticker("ui//search") + } + }), /* @__PURE__ */ import_react192.default.createElement("div", { "data-placeholder": i18n_default.labels.blinkPlaceholder, onInput: (e4) => onChange(e4.currentTarget.innerText), onKeyDown: (e4) => keyDown(e4), - className: "mk-input-large mk-border-bottom", ref: ref2, contentEditable: true - }), /* @__PURE__ */ import_react192.default.createElement("div", { + })), /* @__PURE__ */ import_react192.default.createElement("div", { className: "mk-blink-filters" }, /* @__PURE__ */ import_react192.default.createElement("div", { className: "mk-icon-xsmall", @@ -137301,16 +137646,28 @@ var BlinkComponent = (props) => { }; var BlinkPathWrapper = (props) => { const ref2 = import_react192.default.useRef(null); + const [showProperties, setShowProperties] = (0, import_react192.useState)(false); return /* @__PURE__ */ import_react192.default.createElement("div", { className: "mk-blink-preview", ref: ref2 - }, /* @__PURE__ */ import_react192.default.createElement(PathView, { + }, /* @__PURE__ */ import_react192.default.createElement("div", { + className: "mk-blink-preview-title" + }, /* @__PURE__ */ import_react192.default.createElement(PathCrumb, { + superstate: props.superstate, + path: props.path + }), /* @__PURE__ */ import_react192.default.createElement("span", null), /* @__PURE__ */ import_react192.default.createElement("button", { + className: showProperties ? "is-active mk-icon-small" : "mk-icon-small", + dangerouslySetInnerHTML: { + __html: props.superstate.ui.getSticker("ui//list") + }, + onClick: () => setShowProperties(!showProperties) + })), /* @__PURE__ */ import_react192.default.createElement(PathView, { id: "blink", superstate: props.superstate, path: props.path, containerRef: ref2, styles: {} - }), /* @__PURE__ */ import_react192.default.createElement("div", { + }), showProperties && /* @__PURE__ */ import_react192.default.createElement("div", { className: "mk-blink-properties" }, /* @__PURE__ */ import_react192.default.createElement("div", { className: "mk-blink-properties-header" @@ -137717,7 +138074,9 @@ var MakeMDPlugin = class extends import_obsidian28.Plugin { if (this.superstate.settings.spacesEnabled) { await this.superstate.initializeIndex(); this.obsidianAdapter.loadCacheFromObsidianCache(); - this.openFileTreeLeaf(this.superstate.settings.openSpacesOnLaunch); + if (this.superstate.settings.navigatorEnabled) { + this.openFileTreeLeaf(this.superstate.settings.openSpacesOnLaunch); + } } else { await this.superstate.loadFromCache(); this.superstate.initialize(); @@ -137759,6 +138118,7 @@ var MakeMDPlugin = class extends import_obsidian28.Plugin { } async loadSpaces() { document.body.classList.toggle("mk-readable-line", this.app.vault.getConfig("readableLineLength")); + this.superstate.settings.readableLineWidth = this.app.vault.getConfig("readableLineLength"); if (this.superstate.settings.spacesEnabled) { document.body.classList.toggle("mk-hide-tabs", !this.superstate.settings.sidebarTabs); document.body.classList.toggle("mk-hide-ribbon", !this.superstate.settings.showRibbon); @@ -137774,7 +138134,7 @@ var MakeMDPlugin = class extends import_obsidian28.Plugin { "mk-spaces-enabled", this.superstate.settings.spacesEnabled ); - if (!this.superstate.settings.spacesDisablePatch) + if (!this.superstate.settings.spacesDisablePatch && this.superstate.settings.navigatorEnabled) patchFilesPlugin(this); } this.registerEvent( diff --git a/manifest.json b/manifest.json index c90f2be..b997f64 100755 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "make-md", "name": "MAKE.md", - "version": "0.9.17", + "version": "0.9.18", "minAppVersion": "0.16.0", "description": "Make.md brings powerful and modern note-taking features to Obsidian. Capture, organize and connect information with more flexibility without any code.", "author": "MAKE.md", diff --git a/styles.css b/styles.css index 463d42c..6e55d29 100644 --- a/styles.css +++ b/styles.css @@ -441,10 +441,13 @@ body:not(.is-mobile) .mk-view-config button:hover { align-items: center; } .mk-filter input { - height: 22px; + height: 100%; width: 100px !important; border: none; } +.mk-filter .mk-path { + padding: 0 4px; +} .mk-filter div { display: flex; align-items: center; @@ -1811,14 +1814,19 @@ body:not(.is-mobile) .mk-main-menu-button:hover { background: var(--mk-ui-active); color: var(--text-on-accent); } +.mk-menu-selected-tag-wrapper { + padding: 8px; + display: flex; + gap: 8px; + flex-wrap: wrap; +} .mk-menu-selected-tag { display: inline-block; box-sizing: border-box; - margin: 0 6px 6px 0; - padding: 6px 8px; - border-radius: 2px; + padding: 4px 8px; + border-radius: 4px; box-shadow: unset !important; - font-size: inherit; + font-size: 12px; line-height: inherit; } .mk-menu-selected-tag:after { @@ -2239,6 +2247,40 @@ body:not(.is-mobile) .mk-main-menu-button:hover { display: flex; flex-direction: column; } +.mk-blink-preview-title { + padding: 8px; + display: flex; +} +.mk-blink-preview-title span { + flex: 1; +} +.mk-blink-preview-title button { + padding: 4px 8px; + font-size: max(13px, 1em); + gap: 8px; + font-weight: var(--font-medium); + background: rgba(var(--nav-item-background-active), 0.3); + border: none; + box-shadow: none; + color: var(--mk-ui-text-tertiary); + height: 30px; +} +.mk-blink-input { + padding: 14px; + gap: 8px; + font-size: 14px; + display: flex; + border-bottom: 1px solid var(--mk-ui-divider); +} +.mk-blink-input div[data-placeholder]:empty::before { + content: attr(data-placeholder); + color: var(--mk-ui-text-tertiary); +} +.mk-blink-preview-title button:hover, +.mk-blink-preview-title button.is-active { + color: var(--mk-ui-text-primary); + background: var(--mk-ui-background-hover); +} .mk-blink-properties { border-top: thin solid var(--mk-ui-border); padding: 8px; @@ -2282,12 +2324,12 @@ body:not(.is-mobile) .mk-main-menu-button:hover { min-height: 0; } .mk-blink-suggester .mk-menu-suggestions { - width: 50%; + width: 200px; overflow-y: scroll; height: auto; } .mk-blink-suggester .mk-blink-preview { - width: 50%; + flex: 1; } /* src/css/Panels/ContextBuilder.css */ @@ -2574,7 +2616,7 @@ body .markdown-source-view.mod-cm6.mod-cm6.is-readable-line-width .mk-inline-tit max-width: 100px; overflow-x: hidden; align-items: flex-start; - -webkit-mask-image: -webkit-gradient(linear, left 90%, right bottom, from(rgba(0, 0, 0, 1)), to(rgba(0, 0, 0, 0))); + mask-image: -webkit-gradient(linear, left 90%, right bottom, from(rgba(0, 0, 0, 1)), to(rgba(0, 0, 0, 0))); } .mk-path-info { display: flex; @@ -2798,6 +2840,12 @@ body .markdown-source-view.mod-cm6.mod-cm6.is-readable-line-width .mk-inline-tit overflow: hidden; color: var(--mk-ui-text-secondary); } +.mk-path span { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + display: inline-block; +} .mk-context:hover, .mk-path:hover { background: var(--mk-ui-background-hover); @@ -3808,7 +3856,9 @@ body:not(.mk-readable-line) { .mk-title-container .mk-title-prefix { display: flex; font-size: var(--inline-title-size); + margin-top: 8px; font-weight: var(--inline-title-weight); + line-height: var(--inline-title-line-height); } .mk-title-container span { flex: 1; @@ -4293,6 +4343,9 @@ body:not(.is-mobile) .markdown-source-view.mod-cm6.is-readable-line-width .mk-sp .mk-cell-link .mk-path { background: var(--mk-color-none); } +.mk-celllink .mk-path span { + max-width: 100px; +} .mk-cell-boolean { padding: 4px; display: flex;