From 8b311fd5c9183ec98437c32c138c01dbb5f3d04f Mon Sep 17 00:00:00 2001 From: JP Cen Date: Fri, 26 Jul 2024 12:46:33 -0400 Subject: [PATCH] 0.9.994 --- main.js | 1920 +++++++++-------- manifest.json | 2 +- src/core/assets/icons.ts | 3 +- src/core/i18n.ts | 7 +- .../components/Explorer/PropertiesView.tsx | 64 +- .../Navigator/SpaceTree/SpaceTreeItem.tsx | 2 +- .../UI/Menus/contexts/PropertyValue.tsx | 26 - .../Menus/contexts/newSpacePropertyMenu.tsx | 101 +- src/core/superstate/superstate.ts | 5 +- .../workers/indexer/indexer.worker.ts | 5 +- src/core/utils/formula/formulas.ts | 4 +- src/core/utils/formula/parser.ts | 10 +- src/core/utils/properties/allProperties.ts | 29 +- 13 files changed, 1145 insertions(+), 1033 deletions(-) diff --git a/main.js b/main.js index f03fc73..141ae93 100644 --- a/main.js +++ b/main.js @@ -32661,6 +32661,7 @@ var T = class { propertyValueSpace: "Space", propertyValueProperty: "Property", propertyLookup: "Edit Formula", + existingFrontmatter: "Existing Property", dateFormat: "Date Format", propertyFileProp: "Property", multiple: "Multiple", @@ -32741,6 +32742,7 @@ var T = class { fileExists: "File Already Exists", folderExists: "Folder Already Exists", noPropertyName: "Property Name is Required", + noPropertiesFound: "No Properties Found", duplicatePropertyName: "Duplicate Property Name", newSpaceName: "Enter a name for your space", duplicateSpaceName: "Space name already exists", @@ -32851,8 +32853,8 @@ var T = class { desc: "Layout for inline title and sticker in Inline Context" }, hideFrontmatter: { - name: "Hide Frontmatter Properties", - desc: "Hide the frontmatter properties in inline context" + name: "Hide Context Properties", + desc: "Hide properties you have addeed in context from the Obsidian properties panel" }, openFileContext: { name: "Auto Open Explorer", @@ -90407,7 +90409,7 @@ var map3 = (args, math2, scope) => { return result; }); } - return ""; + return []; }; map3.rawArgs = true; var some = (args, math2, scope) => { @@ -93156,8 +93158,24 @@ var showSpaceContextMenu = (superstate, path2, e5, activePath, parentSpace, onCl return false; }; +// src/core/utils/properties/allProperties.ts +var allPropertiesForPaths = (superstate, paths) => { + const properties3 = {}; + for (const path2 of paths) { + const f2 = superstate.pathsIndex.get(path2)?.metadata?.property; + if (f2) { + Object.keys(f2).forEach((k2) => { + properties3[k2] = [...properties3[k2] ?? [], detectPropertyType(f2[k2], k2)]; + }); + } + } + return Object.keys(properties3).reduce((p, c3) => { + return [...p, { name: c3, type: properties3[c3][0] }]; + }, []); +}; + // src/core/react/components/UI/Menus/contexts/newSpacePropertyMenu.tsx -var import_react26 = __toESM(require_react()); +var import_react19 = __toESM(require_react()); // node_modules/@uiw/codemirror-themes/esm/index.js var import_view3 = require("@codemirror/view"); @@ -96667,6 +96685,466 @@ var FormulaEditor = (props) => { })); }; +// src/core/react/components/UI/Menus/contexts/PropertyValue.tsx +var import_react18 = __toESM(require_react()); +var PropertyValueComponent = (props) => { + const showOptions = (e5, value, options, field, saveProperty) => { + props.superstate.ui.openMenu( + e5.target.getBoundingClientRect(), + { + ui: props.superstate.ui, + multi: false, + editable: true, + searchable: true, + saveOptions: (_16, v2) => { + if (saveProperty) { + saveProperty(v2[0]); + } else { + saveParsedValue(field, v2[0]); + } + }, + placeholder: i18n_default.labels.propertyValueSpace, + value: [value ?? ""], + options + }, + windowFromDocument(e5.view.document) + ); + }; + const selectType = (e5) => { + props.superstate.ui.openMenu( + e5.target.getBoundingClientRect(), + { + ui: props.superstate.ui, + multi: false, + editable: false, + searchable: false, + saveOptions: (_16, v2) => saveParsedValue("type", v2[0]), + value: [], + showAll: true, + options: fieldTypes.filter((f2) => f2.primative).map((f2, i4) => ({ + id: i4 + 1, + name: f2.label, + value: f2.type, + icon: f2.icon + })) + }, + windowFromDocument(e5.view.document) + ); + }; + const parsedValue = (0, import_react18.useMemo)( + () => parseFieldValue(props.value, props.fieldType, props.superstate), + [props.value, props.fieldType] + ); + const saveParsedValue = (field, value) => { + props.saveValue(JSON.stringify({ ...parsedValue, [field]: value })); + }; + const saveSpaceProperty = (field) => { + const colExists = props.superstate.contextsIndex.get(parsedValue.space)?.contextTable?.cols?.some((f2) => f2.name == field); + if (!colExists) { + props.superstate.spaceManager.addSpaceProperty(parsedValue.space, { + name: field, + schemaId: defaultContextSchemaID, + type: "context", + value: props.name + }); + } + saveParsedValue("field", field); + }; + const selectContext = (e5) => { + showOptions( + e5, + parsedValue.space, + props.superstate.allSpaces().filter((f2) => f2.type != "default").map((m4) => ({ name: m4.name, value: m4.path, description: m4.path })), + "space" + ); + }; + const selectSpaceProperty = (e5) => { + showOptions( + e5, + parsedValue.property, + props.superstate.contextsIndex.get(parsedValue.space)?.contextTable?.cols.filter((f2) => { + return f2.type?.startsWith("context") && parseFieldValue(f2.value, f2.type, props.superstate)["space"] == props.contextPath ? true : false; + }).map((m4) => ({ name: m4.name, value: m4.name })) ?? [], + "field", + saveSpaceProperty + ); + }; + const selectProperty = (e5) => { + const properties3 = props.fields.filter( + (f2) => f2.type == "file" || f2.type == "link" || f2.type == "context" + ).map((f2) => ({ + name: f2.name, + value: f2.name + })) ?? []; + showOptions(e5, null, properties3, "field"); + }; + const editFormula = (e5) => { + const _props = { + superstate: props.superstate, + saveFormula: (value) => saveParsedValue("value", value), + formula: parsedValue.value, + value: {}, + fields: props.fields.filter((f2) => f2.name != props.name), + path: "" + }; + props.superstate.ui.openCustomMenu( + e5.target.getBoundingClientRect(), + /* @__PURE__ */ import_react18.default.createElement(FormulaEditor, { + ..._props + }), + { ..._props }, + windowFromDocument(e5.view.document), + "bottom" + ); + }; + const selectDateFormat = (e5) => { + const formats = [ + { + name: "2020-04-21", + value: "yyyy-MM-dd" + }, + { + name: "Apr 21, 2020", + value: "MMM d, yyyy" + }, + { + name: "Tue Apr 21, 2020", + value: "EEE MMM d, yyyy" + } + ]; + showOptions(e5, null, formats, "format"); + }; + return props.fieldType?.startsWith("date") ? /* @__PURE__ */ import_react18.default.createElement("div", { + className: "mk-menu-option", + onClick: (e5) => selectDateFormat(e5) + }, /* @__PURE__ */ import_react18.default.createElement("span", null, i18n_default.labels.dateFormat), /* @__PURE__ */ import_react18.default.createElement("span", null, parsedValue.format)) : props.fieldType?.startsWith("context") ? /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement("div", { + className: "mk-menu-option", + onClick: (e5) => selectContext(e5) + }, /* @__PURE__ */ import_react18.default.createElement("span", null, i18n_default.labels.propertyValueSpace), /* @__PURE__ */ import_react18.default.createElement("span", null, spaceNameFromSpacePath(parsedValue.space, props.superstate))), parsedValue.space?.length > 0 && props.contextPath && /* @__PURE__ */ import_react18.default.createElement("div", { + className: "mk-menu-option", + onClick: (e5) => selectSpaceProperty(e5) + }, /* @__PURE__ */ import_react18.default.createElement("span", null, i18n_default.labels.propertyValueProperty), /* @__PURE__ */ import_react18.default.createElement("span", null, parsedValue.field))) : props.fieldType == "number" ? /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null) : props.fieldType == "fileprop" ? /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement("div", { + className: "mk-menu-option", + onClick: (e5) => editFormula(e5) + }, /* @__PURE__ */ import_react18.default.createElement("span", null, i18n_default.labels.propertyLookup)), /* @__PURE__ */ import_react18.default.createElement("div", { + className: "mk-menu-option", + onClick: (e5) => selectType(e5) + }, /* @__PURE__ */ import_react18.default.createElement("span", null, i18n_default.labels.propertyType), /* @__PURE__ */ import_react18.default.createElement("span", null, fieldTypeForType(parsedValue.type)?.label))) : props.fieldType == "object" ? /* @__PURE__ */ import_react18.default.createElement("div", { + className: "mk-menu-option", + onClick: (e5) => { + props.superstate.ui.openModal( + "Object Name", + (_props) => /* @__PURE__ */ import_react18.default.createElement(InputModal, { + value: parsedValue.typeName, + saveLabel: "Rename Object", + saveValue: (value) => { + saveParsedValue("typeName", value); + }, + hide: _props.hide + }), + windowFromDocument(e5.view.document) + ); + } + }, /* @__PURE__ */ import_react18.default.createElement("span", null, "Name"), /* @__PURE__ */ import_react18.default.createElement("span", null, parsedValue.typeName)) : props.fieldType == "super" ? /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement("div", { + className: "mk-menu-option" + }, /* @__PURE__ */ import_react18.default.createElement("span", null, i18n_default.labels.propertyDynamic), /* @__PURE__ */ import_react18.default.createElement("input", { + type: "checkbox", + checked: parsedValue.dynamic == true, + onChange: () => saveParsedValue("dynamic", !parsedValue.dynamic) + })), /* @__PURE__ */ import_react18.default.createElement("div", { + className: "mk-menu-option", + onClick: (e5) => selectProperty(e5) + }, /* @__PURE__ */ import_react18.default.createElement("span", null, i18n_default.labels.propertyFileProp), /* @__PURE__ */ import_react18.default.createElement("span", null, parsedValue.field))) : /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null); +}; + +// src/core/react/components/UI/Menus/contexts/newSpacePropertyMenu.tsx +var NewPropertyMenuComponent = (props) => { + const [fieldName, setFieldName] = (0, import_react19.useState)(""); + const [fieldSource, setFieldSource] = (0, import_react19.useState)( + props.fileMetadata ? "$fm" : "" + ); + const spaceCaches = (0, import_react19.useMemo)( + () => props.spaces.map((f2) => props.superstate.spacesIndex.get(f2)).filter((f2) => f2), + [props.spaces] + ); + const [fieldValue, setFieldValue] = (0, import_react19.useState)(""); + const [fieldType, setFieldType] = (0, import_react19.useState)(props.type ?? "text"); + const options = (0, import_react19.useMemo)(() => { + const options2 = []; + if (props.fileMetadata) { + options2.push({ + name: i18n_default.menu.setNone, + value: "$fm" + }); + } + if (props.contextPath && (!props.fileMetadata || props.contextPath != "$fm")) { + options2.push({ + name: folderPathToString(props.contextPath), + value: "" + }); + } + options2.push( + ...(spaceCaches ?? []).map((f2) => ({ + name: f2.name, + value: f2.path + })) + ); + return options2; + }, [spaceCaches]); + const selectedType = (_16, value) => { + setFieldType(value[0]); + }; + const selectedValue = (value) => { + setFieldValue(value); + }; + const selectedSource = (_16, value) => { + setFieldSource(value[0]); + }; + const toggleMulti = () => { + const field = fieldTypes.find( + (f2) => f2.type == fieldType || f2.multiType == fieldType + ); + setFieldType(field.type == fieldType ? field.multiType : field.type); + }; + const selectType = (e5) => { + props.superstate.ui.openMenu( + e5.target.getBoundingClientRect(), + { + ui: props.superstate.ui, + multi: false, + editable: false, + searchable: true, + saveOptions: selectedType, + value: [], + showAll: true, + options: fieldTypes.filter( + (f2) => fieldSource == "$fm" && !props.isSpace ? f2.metadata : !f2.restricted + ).map((f2, i4) => ({ + id: i4 + 1, + name: f2.label, + value: f2.type, + icon: f2.icon, + description: f2.description + })) + }, + windowFromDocument(e5.view.document) + ); + }; + const selectedContext = (value) => { + setFieldValue(value); + }; + const type = (0, import_react19.useMemo)( + () => fieldTypeForType(fieldType, fieldName) ?? fieldTypes[0], + [fieldType, fieldName] + ); + const selectSource = (e5) => { + e5.stopPropagation(); + props.superstate.ui.openMenu( + e5.target.getBoundingClientRect(), + { + ui: props.superstate.ui, + multi: false, + editable: false, + searchable: false, + saveOptions: selectedSource, + value: [], + showAll: true, + options + }, + windowFromDocument(e5.view.document) + ); + }; + const saveField = () => { + if (fieldName.length == 0) { + props.superstate.ui.notify(i18n_default.notice.noPropertyName); + return; + } + const result = props.saveField(fieldSource, { + name: fieldName, + type: fieldType, + value: fieldValue, + schemaId: props.schemaId + }); + if (result) + props.hide(); + }; + const onKeyDown = (e5) => { + if (e5.key == "Enter") { + saveField(); + } + }; + (0, import_react19.useEffect)(() => { + setTimeout(() => { + input.current?.focus(); + }, 50); + }, []); + const input = (0, import_react19.useRef)(null); + const addExistingProperty = (e5) => { + const source = fieldSource == "" ? props.contextPath : fieldSource; + e5.stopPropagation(); + const existingCols = props.superstate.contextsIndex.get(source)?.contextTable?.cols ?? []; + const existingProps = allPropertiesForPaths( + props.superstate, + [...props.superstate.spacesMap.getInverse(source) ?? []] + ).filter( + (f2) => !existingCols.some((g) => g.name == f2.name) && ![ + ...FMMetadataKeys(props.superstate.settings), + "tags", + ...FMSpaceKeys(props.superstate.settings) + ].some((g) => g == f2.name) + ).map((f2) => ({ + name: f2.name, + type: f2.type, + value: "", + schemaId: props.schemaId + })); + if (existingProps.length == 0) { + props.superstate.ui.notify(i18n_default.notice.noPropertiesFound); + return; + } + props.superstate.ui.openMenu( + e5.target.getBoundingClientRect(), + { + ui: props.superstate.ui, + multi: false, + editable: false, + searchable: true, + saveOptions: (_16, value) => { + if (value[0] == "all") { + props.superstate.spaceManager.readTable(source, defaultContextSchemaID).then( + (f2) => props.superstate.spaceManager.saveTable(source, { + ...f2, + cols: [...f2.cols, ...existingProps] + }) + ).then((f2) => props.superstate.reloadContextByPath(source)); + props.hide(); + return; + } + const result = props.saveField(fieldSource, value[0]); + if (result) + props.hide(); + }, + value: [], + showAll: true, + options: [ + { name: i18n_default.labels.all, value: "all", icon: "ui//plus" }, + menuSeparator, + ...existingProps.map((f2, i4) => ({ + id: i4 + 1, + name: f2.name, + value: f2, + icon: stickerForField(f2) + })) + ], + placeholder: i18n_default.labels.existingFrontmatter + }, + windowFromDocument(e5.view.document) + ); + }; + return /* @__PURE__ */ import_react19.default.createElement("div", { + className: "mk-menu-container" + }, /* @__PURE__ */ import_react19.default.createElement("div", { + className: "mk-menu-suggestions" + }, /* @__PURE__ */ import_react19.default.createElement("div", { + className: "mk-menu-input" + }, /* @__PURE__ */ import_react19.default.createElement("input", { + type: "text", + ref: input, + placeholder: "Name", + onKeyDown, + onChange: (e5) => setFieldName(e5.target.value), + onMouseDown: (e5) => e5.stopPropagation(), + value: fieldName + }), fieldSource != "$fm" && /* @__PURE__ */ import_react19.default.createElement("button", { + "aria-label": i18n_default.labels.existingFrontmatter, + className: "mk-toolbar-button", + onClick: (e5) => addExistingProperty(e5), + dangerouslySetInnerHTML: { + __html: props.superstate.ui.getSticker("ui//import") + } + })), /* @__PURE__ */ import_react19.default.createElement("div", { + className: "mk-menu-separator" + }), options.length > 1 && /* @__PURE__ */ import_react19.default.createElement("div", { + className: "mk-menu-option", + onClick: (e5) => selectSource(e5) + }, /* @__PURE__ */ import_react19.default.createElement("div", { + className: "mk-menu-options-inner" + }, i18n_default.labels.propertyValueSpace), /* @__PURE__ */ import_react19.default.createElement("span", null, fieldSource == "$fm" ? "None" : fieldSource == "" ? props.superstate.spacesIndex.get(props.contextPath)?.name : props.superstate.spacesIndex.get(fieldSource)?.name)), /* @__PURE__ */ import_react19.default.createElement("div", { + className: "mk-menu-option", + onClick: (e5) => selectType(e5) + }, /* @__PURE__ */ import_react19.default.createElement("div", { + className: "mk-menu-options-inner" + }, i18n_default.labels.propertyType), /* @__PURE__ */ import_react19.default.createElement("span", null, type.label)), type.multi ? /* @__PURE__ */ import_react19.default.createElement("div", { + className: "mk-menu-option" + }, /* @__PURE__ */ import_react19.default.createElement("span", null, i18n_default.labels.multiple), /* @__PURE__ */ import_react19.default.createElement("input", { + type: "checkbox", + checked: fieldType == type.multiType, + onChange: () => toggleMulti() + })) : /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null), /* @__PURE__ */ import_react19.default.createElement("div", { + className: "mk-menu-separator" + }), fieldSource != "$fm" || props.isSpace ? /* @__PURE__ */ import_react19.default.createElement(PropertyValueComponent, { + superstate: props.superstate, + table: fieldSource, + fields: props.fields, + fieldType, + value: fieldValue, + contextPath: props.contextPath, + saveValue: selectedValue + }) : /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null), /* @__PURE__ */ import_react19.default.createElement("div", { + className: "mk-menu-separator" + }), /* @__PURE__ */ import_react19.default.createElement("div", { + className: "mk-menu-option", + onClick: (e5) => saveField() + }, /* @__PURE__ */ import_react19.default.createElement("span", null, i18n_default.buttons.saveProperty)), /* @__PURE__ */ import_react19.default.createElement("div", { + className: "mk-menu-option", + onClick: (e5) => props.hide() + }, /* @__PURE__ */ import_react19.default.createElement("span", null, i18n_default.buttons.cancel)))); +}; +var showNewPropertyMenu = (superstate, rect, win, props, onHide) => { + return superstate.ui.openCustomMenu( + rect, + /* @__PURE__ */ import_react19.default.createElement(NewPropertyMenuComponent, { + superstate, + ...props + }), + {}, + win, + "bottom", + onHide + ); +}; + +// src/core/react/components/SpaceView/Contexts/DataTypeView/DataPropertyView.tsx +var import_react55 = __toESM(require_react()); + +// src/core/react/components/UI/Toggles/CollapseToggleSmall.tsx +var import_react20 = __toESM(require_react()); +var CollapseToggleSmall = (props) => { + return /* @__PURE__ */ import_react20.default.createElement("button", { + className: `mk-collapse mk-inline-button mk-icon-xsmall ${props.collapsed ? "mk-collapsed" : ""}`, + onClick: (e5) => { + if (props.onToggle) { + props.onToggle(!props.collapsed, e5); + e5.stopPropagation(); + } + }, + dangerouslySetInnerHTML: { + __html: props.superstate.ui.getSticker("ui//collapse-solid") + } + }); +}; + +// src/core/react/components/UI/Menus/menu/concerns/matchers.js +function escapeForRegExp(string6) { + return string6.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"); +} +function matchAny(string6) { + return new RegExp(escapeForRegExp(string6), "gi"); +} +function matchExact(string6) { + return new RegExp(`^${escapeForRegExp(string6)}$`, "i"); +} + // src/core/utils/contexts/predicate/sort.ts var simpleSort = (a4, b2) => { if (a4 < b2) @@ -96773,239 +97251,9 @@ var sortReturnForCol = (col, sort2, row2, row22) => { return 0; }; -// src/core/react/components/UI/Menus/contexts/spacePropertyMenu.tsx -var import_react18 = __toESM(require_react()); -var selectPropertyTypeMenu = (e5, ui, selectedType) => { - ui.openMenu( - e5.target.getBoundingClientRect(), - { - ui, - multi: false, - editable: false, - searchable: false, - saveOptions: selectedType, - value: [], - showAll: true, - options: fieldTypes.filter((f2) => !f2.restricted).map((f2, i4) => ({ - id: i4 + 1, - name: f2.label, - value: f2.type, - icon: f2.icon - })) - }, - windowFromDocument(e5.view.document) - ); -}; -var PropertyMenuComponent = (props) => { - const [field, setField] = (0, import_react18.useState)(props.field); - const selectedType = (_16, value) => { - const newField = { - ...field, - type: value[0], - value: JSON.stringify(getNewValueForType(field, value)) - }; - setField(newField); - props.saveField(newField); - }; - const selectedValue = (value) => { - const newField = { ...field, value }; - setField(newField); - props.saveField(newField); - }; - const toggleMulti = () => { - const newField = { - ...field, - type: field.type == fieldType.multiType ? fieldType.type : fieldType.multiType - }; - setField(newField); - props.saveField(newField); - }; - const fieldType = fieldTypeForType(field.type, field.name) ?? fieldTypes[0]; - const getNewValueForType = (f2, value) => { - if (value[0].startsWith("option")) { - return JSON.stringify({ - options: props.options.map((f3) => ({ - name: f3, - value: f3 - })) - }); - } - return value[0] == fieldType.type || value[0] == fieldType.multiType ? f2.value : null; - }; - return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement("li", null, /* @__PURE__ */ import_react18.default.createElement("div", { - className: "mk-menu-option", - onClick: (e5) => selectPropertyTypeMenu(e5, props.superstate.ui, selectedType) - }, /* @__PURE__ */ import_react18.default.createElement("span", null, i18n_default.labels.propertyType), /* @__PURE__ */ import_react18.default.createElement("span", null, fieldType.label))), fieldType.multi ? /* @__PURE__ */ import_react18.default.createElement("div", { - className: "mk-menu-option" - }, /* @__PURE__ */ import_react18.default.createElement("span", null, i18n_default.labels.multiple), /* @__PURE__ */ import_react18.default.createElement("input", { - type: "checkbox", - checked: field.type == fieldType.multiType, - onChange: () => toggleMulti() - })) : /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null), /* @__PURE__ */ import_react18.default.createElement("div", { - className: "mk-menu-separator" - }), /* @__PURE__ */ import_react18.default.createElement(PropertyValueComponent, { - superstate: props.superstate, - name: field.name, - table: field.table, - fields: props.fields, - fieldType: fieldType.type, - value: field.value, - contextPath: props.contextPath, - saveValue: selectedValue - })); -}; -var showPropertyMenu = (props, onHide) => { - const { - superstate, - rect, - editable, - options, - field, - fields, - contextPath, - saveField, - hide, - deleteColumn, - sortColumn, - editCode, - hidden - } = props; - const saveName = (value) => { - if (!editable) { - const fieldValue = safelyParseJSON(field.value); - saveField({ ...field, value: JSON.stringify({ - ...fieldValue, - alias: value - }) }); - return; - } - saveField({ ...field, name: value }); - }; - const menuOptions = []; - menuOptions.push( - menuInput( - nameForField(field, props.superstate) ?? "", - (value) => saveName(value) - ) - ); - menuOptions.push(menuSeparator); - if (editable) { - menuOptions.push({ - name: "", - type: 5 /* Custom */, - fragment: () => /* @__PURE__ */ import_react18.default.createElement(PropertyMenuComponent, { - superstate, - field, - fields, - contextPath, - options, - saveField - }) - }); - } - menuOptions.push(menuSeparator); - menuOptions.push({ - name: i18n_default.menu.setIcon, - icon: "ui//gem", - onClick: (e5) => { - superstate.ui.openPalette( - (_props) => /* @__PURE__ */ import_react18.default.createElement(StickerModal_default, { - ui: superstate.ui, - hide: _props.hide, - selectedSticker: (emoji) => saveField({ ...field, attrs: JSON.stringify({ icon: emoji }) }) - }), - windowFromDocument(e5.view.document) - ); - } - }); - menuOptions.push(menuSeparator); - const sortableString = normalizedSortForType(field.type, false); - if (sortableString && sortColumn) { - menuOptions.push({ - name: i18n_default.menu.sortAscending, - icon: "ui//sort-asc", - onClick: () => { - sortColumn({ - field: field.name + field.table, - fn: sortableString - }); - } - }); - menuOptions.push({ - name: i18n_default.menu.sortDescending, - icon: "ui//sort-desc", - onClick: () => { - sortColumn({ - field: field.name + field.table, - fn: normalizedSortForType(field.type, true) - }); - } - }); - } - menuOptions.push(menuSeparator); - if (hide) { - if (!hidden) { - menuOptions.push({ - name: i18n_default.menu.hideProperty, - icon: "ui//eye-off", - onClick: () => { - hide(field, true); - } - }); - } else { - menuOptions.push({ - name: i18n_default.menu.unhideProperty, - icon: "ui//eye", - onClick: () => { - hide(field, false); - } - }); - } - } - if (editable) { - if (editCode) { - menuOptions.push({ - name: i18n_default.menu.editCode, - icon: "ui//code", - onClick: () => { - editCode(); - } - }); - } - if (deleteColumn) { - menuOptions.push({ - name: i18n_default.menu.deleteProperty, - icon: "ui//trash", - onClick: () => { - deleteColumn(field); - } - }); - } - } - const menu = superstate.ui.openMenu( - rect, - defaultMenu(superstate.ui, menuOptions), - props.win, - props.anchor, - onHide - ); - return menu; -}; - -// src/core/react/components/UI/Menus/menu/concerns/matchers.js -function escapeForRegExp(string6) { - return string6.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"); -} -function matchAny(string6) { - return new RegExp(escapeForRegExp(string6), "gi"); -} -function matchExact(string6) { - return new RegExp(`^${escapeForRegExp(string6)}$`, "i"); -} - // src/core/react/context/ContextEditorContext.tsx var import_lodash10 = __toESM(require_lodash()); -var import_react22 = __toESM(require_react()); +var import_react24 = __toESM(require_react()); // src/core/utils/contexts/predicate/predicate.tsx var defaultPredicateFnForType = (type, types2) => { @@ -97072,10 +97320,10 @@ var defaultPredicate = { }; // src/core/react/context/FramesMDBContext.tsx -var import_react21 = __toESM(require_react()); +var import_react23 = __toESM(require_react()); // src/core/react/context/SpaceContext.tsx -var import_react20 = __toESM(require_react()); +var import_react22 = __toESM(require_react()); // src/core/utils/uuid.js function genId() { @@ -97086,8 +97334,8 @@ function genId() { } // src/core/react/context/PathContext.tsx -var import_react19 = __toESM(require_react()); -var PathContext = (0, import_react19.createContext)({ +var import_react21 = __toESM(require_react()); +var PathContext = (0, import_react21.createContext)({ uid: "", readMode: false, pathState: null, @@ -97095,7 +97343,7 @@ var PathContext = (0, import_react19.createContext)({ removeFromSpace: () => null }); var PathProvider = (props) => { - const [pathState, setPathState] = (0, import_react19.useState)( + const [pathState, setPathState] = (0, import_react21.useState)( props.pathState ?? props.superstate.pathsIndex.get(props.path) ); const addToSpace = async (spacePath) => { @@ -97108,7 +97356,7 @@ var PathProvider = (props) => { removePathsFromSpace(props.superstate, spacePath, [pathState.path]); }; const readMode = pathState?.readOnly || props.readMode; - (0, import_react19.useEffect)(() => { + (0, import_react21.useEffect)(() => { const reloadPath = () => { if (!props.pathState) setPathState(props.superstate.pathsIndex.get(props.path)); @@ -97148,7 +97396,7 @@ var PathProvider = (props) => { ); }; }, [props.path]); - return /* @__PURE__ */ import_react19.default.createElement(PathContext.Provider, { + return /* @__PURE__ */ import_react21.default.createElement(PathContext.Provider, { value: { uid: genId(), readMode, @@ -97156,23 +97404,23 @@ var PathProvider = (props) => { addToSpace, removeFromSpace } - }, pathState ? props.children : /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null)); + }, pathState ? props.children : /* @__PURE__ */ import_react21.default.createElement(import_react21.default.Fragment, null)); }; // src/core/react/context/SpaceContext.tsx -var SpaceContext = (0, import_react20.createContext)({ +var SpaceContext = (0, import_react22.createContext)({ spaceInfo: null, readMode: false, spaceState: null }); var SpaceProvider = (props) => { - const { pathState } = (0, import_react20.useContext)(PathContext); - const spaceInfo = (0, import_react20.useMemo)(() => { + const { pathState } = (0, import_react22.useContext)(PathContext); + const spaceInfo = (0, import_react22.useMemo)(() => { return props.superstate.spacesIndex.get(pathState.path)?.space; }, [pathState]); const readMode = spaceInfo?.readOnly; - const [spaceState, setSpaceState] = (0, import_react20.useState)(null); - (0, import_react20.useEffect)(() => { + const [spaceState, setSpaceState] = (0, import_react22.useState)(null); + (0, import_react22.useEffect)(() => { const reloadSpace = () => { setSpaceState(props.superstate.spacesIndex.get(pathState.path)); }; @@ -97193,7 +97441,7 @@ var SpaceProvider = (props) => { ); }; }, [pathState]); - return /* @__PURE__ */ import_react20.default.createElement(SpaceContext.Provider, { + return /* @__PURE__ */ import_react22.default.createElement(SpaceContext.Provider, { value: { spaceState, readMode, @@ -97203,7 +97451,7 @@ var SpaceProvider = (props) => { }; // src/core/react/context/FramesMDBContext.tsx -var FramesMDBContext = (0, import_react21.createContext)({ +var FramesMDBContext = (0, import_react23.createContext)({ frameSchemas: [], frames: [], tableData: null, @@ -97220,22 +97468,22 @@ var FramesMDBContext = (0, import_react21.createContext)({ redoAction: () => null }); var FramesMDBProvider = (props) => { - const [history2, setHistory] = (0, import_react21.useState)([]); - const [future, setFuture] = (0, import_react21.useState)([]); - const [schemaTable, setSchemaTable] = (0, import_react21.useState)(null); - const schemas = (0, import_react21.useMemo)( + const [history2, setHistory] = (0, import_react23.useState)([]); + const [future, setFuture] = (0, import_react23.useState)([]); + const [schemaTable, setSchemaTable] = (0, import_react23.useState)(null); + const schemas = (0, import_react23.useMemo)( () => (schemaTable?.rows ?? []).map( (f2) => mdbSchemaToFrameSchema(f2) ) ?? [], [schemaTable] ); const frames = schemas.filter((f2) => f2.type == "frame"); - const [frameData, setFrameData] = (0, import_react21.useState)(null); - const [frameSchema, setFrameSchema] = (0, import_react21.useState)(null); - const tableData = (0, import_react21.useMemo)(() => { + const [frameData, setFrameData] = (0, import_react23.useState)(null); + const [frameSchema, setFrameSchema] = (0, import_react23.useState)(null); + const tableData = (0, import_react23.useMemo)(() => { return frameData?.[frameSchema?.id]; }, [frameData, frameSchema]); - const { spaceInfo, readMode } = (0, import_react21.useContext)(SpaceContext); + const { spaceInfo, readMode } = (0, import_react23.useContext)(SpaceContext); const deleteSchema = async (table) => { if (table.primary) return; @@ -97276,7 +97524,7 @@ var FramesMDBProvider = (props) => { } setSchemaTable(newSchemaTable); }; - (0, import_react21.useEffect)(() => { + (0, import_react23.useEffect)(() => { if (schemaTable) getMDBData().then((f2) => { if (f2 && Object.keys(f2).length > 0) { @@ -97284,7 +97532,7 @@ var FramesMDBProvider = (props) => { } }); }, [schemaTable]); - (0, import_react21.useEffect)(() => { + (0, import_react23.useEffect)(() => { if (schemaTable) { setFrameSchema((p) => { if (props.schema) { @@ -97341,7 +97589,7 @@ var FramesMDBProvider = (props) => { }); } }, [schemaTable, props.contextSchema, props.schema]); - const loadTables = (0, import_react21.useCallback)(async () => { + const loadTables = (0, import_react23.useCallback)(async () => { if (!spaceInfo) return; props.superstate.spaceManager.framesForSpace(spaceInfo.path).then((f2) => { @@ -97353,7 +97601,7 @@ var FramesMDBProvider = (props) => { })); }); }, [props.schema, spaceInfo]); - const refreshSpace = (0, import_react21.useCallback)( + const refreshSpace = (0, import_react23.useCallback)( async (payload) => { if (payload.path == spaceInfo.path) { loadTables(); @@ -97362,7 +97610,7 @@ var FramesMDBProvider = (props) => { }, [spaceInfo, loadTables] ); - (0, import_react21.useEffect)(() => { + (0, import_react23.useEffect)(() => { props.superstate.eventsDispatcher.addListener( "frameStateUpdated", refreshSpace @@ -97380,7 +97628,7 @@ var FramesMDBProvider = (props) => { ); return tables; }; - (0, import_react21.useEffect)(() => { + (0, import_react23.useEffect)(() => { loadTables(); }, [spaceInfo, props.schema]); const saveFrame = async (newTable, track = true) => { @@ -97459,7 +97707,7 @@ var FramesMDBProvider = (props) => { saveFrame(newTable); return true; }; - return /* @__PURE__ */ import_react21.default.createElement(FramesMDBContext.Provider, { + return /* @__PURE__ */ import_react23.default.createElement(FramesMDBContext.Provider, { value: { frames, tableData, @@ -97480,7 +97728,7 @@ var FramesMDBProvider = (props) => { }; // src/core/react/context/ContextEditorContext.tsx -var ContextEditorContext = (0, import_react22.createContext)({ +var ContextEditorContext = (0, import_react24.createContext)({ dbSchema: null, views: [], source: "", @@ -97508,21 +97756,21 @@ var ContextEditorContext = (0, import_react22.createContext)({ cols: [] }); var ContextEditorProvider = (props) => { - const { frameSchemas, saveSchema, frameSchema } = (0, import_react22.useContext)(FramesMDBContext); + const { frameSchemas, saveSchema, frameSchema } = (0, import_react24.useContext)(FramesMDBContext); const { spaceInfo, readMode, spaceState: spaceCache - } = (0, import_react22.useContext)(SpaceContext); - const [schemaTable, setSchemaTable] = (0, import_react22.useState)(null); - const [contextTable, setContextTable] = (0, import_react22.useState)({}); - const [tableData, setTableData] = (0, import_react22.useState)(null); - const [searchString, setSearchString] = (0, import_react22.useState)(null); - const [predicate, setPredicate] = (0, import_react22.useState)(null); - const [selectedRows, setSelectedRows] = (0, import_react22.useState)([]); - const [editMode, setEditMode] = (0, import_react22.useState)(0); + } = (0, import_react24.useContext)(SpaceContext); + const [schemaTable, setSchemaTable] = (0, import_react24.useState)(null); + const [contextTable, setContextTable] = (0, import_react24.useState)({}); + const [tableData, setTableData] = (0, import_react24.useState)(null); + const [searchString, setSearchString] = (0, import_react24.useState)(null); + const [predicate, setPredicate] = (0, import_react24.useState)(null); + const [selectedRows, setSelectedRows] = (0, import_react24.useState)([]); + const [editMode, setEditMode] = (0, import_react24.useState)(0); const contextPath = frameSchema?.def?.context ?? spaceInfo?.path; - const dbSchema = (0, import_react22.useMemo)(() => { + const dbSchema = (0, import_react24.useMemo)(() => { if (frameSchema && frameSchema.def?.db) { if (schemaTable) return schemaTable?.rows.find( @@ -97535,7 +97783,7 @@ var ContextEditorProvider = (props) => { } return null; }, [frameSchema, schemaTable]); - const views = (0, import_react22.useMemo)(() => { + const views = (0, import_react24.useMemo)(() => { const _views = frameSchemas.filter( (f2) => f2.type == "view" && f2.def.db == dbSchema?.id ); @@ -97557,11 +97805,11 @@ var ContextEditorProvider = (props) => { retrieveCachedTable(dbSchema); } }; - (0, import_react22.useEffect)(() => { + (0, import_react24.useEffect)(() => { if (dbSchema) retrieveCachedTable(dbSchema); }, [dbSchema]); - const loadContextFields = (0, import_react22.useCallback)(async (tag2) => { + const loadContextFields = (0, import_react24.useCallback)(async (tag2) => { props.superstate.spaceManager.contextForSpace(tagSpacePathFromTag(tag2)).then((f2) => { setContextTable((t7) => ({ ...t7, @@ -97584,7 +97832,7 @@ var ContextEditorProvider = (props) => { const updateTable = (newTable) => { setTableData(newTable); }; - (0, import_react22.useEffect)(() => { + (0, import_react24.useEffect)(() => { const refreshMDB = (payload) => { if (payload.path == contextPath) { loadTables(); @@ -97622,7 +97870,7 @@ var ContextEditorProvider = (props) => { ); }; }, [contextTable, dbSchema, retrieveCachedTable, spaceInfo, tableData]); - (0, import_react22.useEffect)(() => { + (0, import_react24.useEffect)(() => { loadTables(); }, [spaceInfo, frameSchema]); const saveDB = async (newTable) => { @@ -97630,7 +97878,7 @@ var ContextEditorProvider = (props) => { return; await props.superstate.spaceManager.saveTable(contextPath, newTable, true).then((f2) => props.superstate.reloadContext(spaceInfo)); }; - const cols = (0, import_react22.useMemo)( + const cols = (0, import_react24.useMemo)( () => tableData ? [ ...tableData.cols.map((f2) => ({ ...f2, table: "" })) ?? [], ...dbSchema?.primary == "true" ? contexts.reduce( @@ -97643,7 +97891,7 @@ var ContextEditorProvider = (props) => { ] : [], [tableData, contextTable, contexts, dbSchema] ); - const data2 = (0, import_react22.useMemo)( + const data2 = (0, import_react24.useMemo)( () => tableData?.rows.map((r2, index3) => ({ _index: index3.toString(), ...r2, @@ -97668,7 +97916,7 @@ var ContextEditorProvider = (props) => { })) ?? [], [tableData, contextTable, cols, dbSchema, spaceCache] ); - (0, import_react22.useEffect)(() => { + (0, import_react24.useEffect)(() => { if (tableData) { for (const c3 of contexts) { loadContextFields(c3); @@ -97680,14 +97928,14 @@ var ContextEditorProvider = (props) => { (f2) => props.superstate.reloadContextByPath(tagSpacePathFromTag(tag2)) ); }; - const sortedColumns = (0, import_react22.useMemo)(() => { + const sortedColumns = (0, import_react24.useMemo)(() => { return cols.filter( (f2) => f2.hidden != "true" && !(predicate?.colsHidden ?? []).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) ); }, [cols, predicate]); - const filteredData = (0, import_react22.useMemo)( + const filteredData = (0, import_react24.useMemo)( () => data2.filter((f2) => { return (predicate?.filters ?? []).reduce((p, c3) => { return p ? filterReturnForCol( @@ -97859,7 +98107,7 @@ var ContextEditorProvider = (props) => { }); } }; - (0, import_react22.useEffect)(() => { + (0, import_react24.useEffect)(() => { if (frameSchema) { parsePredicate(frameSchema.predicate); } @@ -97902,7 +98150,7 @@ var ContextEditorProvider = (props) => { } setPredicate(cleanedPredicate); }; - (0, import_react22.useEffect)(() => { + (0, import_react24.useEffect)(() => { if (predicate) setPredicate((p) => ({ ...p, @@ -98030,7 +98278,7 @@ var ContextEditorProvider = (props) => { } return true; }; - return /* @__PURE__ */ import_react22.default.createElement(ContextEditorContext.Provider, { + return /* @__PURE__ */ import_react24.default.createElement(ContextEditorContext.Provider, { value: { source: contextPath, views, @@ -98061,602 +98309,16 @@ var ContextEditorProvider = (props) => { }, props.children); }; -// src/core/react/hooks/useCombinedRef.tsx -var import_react23 = __toESM(require_react()); -function useCombinedRefs2(...refs) { - return (0, import_react23.useMemo)( - () => (node) => { - refs.forEach((ref2) => ref2(node)); - }, - refs - ); -} - -// src/core/react/components/SpaceView/Contexts/TableView/ColumnHeader.tsx -var import_react24 = __toESM(require_react()); -var filePropTypes = [ - { - name: i18n_default.properties.fileProperty.name, - value: "name" - }, - { - name: i18n_default.properties.fileProperty.createdTime, - value: "ctime" - }, - { - name: i18n_default.properties.fileProperty.modifiedTime, - value: "mtime" - }, - { - name: i18n_default.properties.fileProperty.sticker, - value: "sticker" - }, - { - name: i18n_default.properties.fileProperty.extension, - value: "extension" - }, - { - name: i18n_default.properties.fileProperty.size, - value: "size" - }, - { - name: i18n_default.properties.fileProperty.parentFolder, - value: "folder" - }, - { - name: i18n_default.properties.fileProperty.links, - value: "inlinks" - }, - { - name: i18n_default.properties.fileProperty.tags, - value: "tags" - }, - { - name: i18n_default.properties.fileProperty.spaces, - value: "spaces" - } -]; -var ColumnHeader = (props) => { - const [field, setField] = (0, import_react24.useState)(props.column); - const menuRef = (0, import_react24.useRef)(null); - const { spaceInfo, spaceState: spaceCache } = (0, import_react24.useContext)(SpaceContext); - const { - predicate, - tableData, - contextTable, - cols, - newColumn, - saveColumn, - hideColumn, - sortColumn, - delColumn - } = (0, import_react24.useContext)(ContextEditorContext); - (0, import_react24.useEffect)(() => { - setField(props.column); - }, [props.column]); - const { - attributes, - listeners, - setNodeRef: setDraggableNodeRef, - transform - } = useDraggable({ - id: field.name + field.table, - data: { name: field.name } - }); - const { setNodeRef: setDroppableNodeRef } = useDroppable({ - id: field.name + field.table, - data: { name: field.name } - }); - const saveField = (field2) => { - if (field2.name.length > 0) { - if (field2.name != props.column.name || field2.type != props.column.type || field2.value != props.column.value || field2.attrs != props.column.attrs) { - const saveResult = saveColumn(field2, props.column); - if (saveResult) { - if (props.isNew) { - setField(props.column); - } - } - } - } - }; - const showNewMenu = (e5) => { - const offset2 = ref2.current.getBoundingClientRect(); - showNewPropertyMenu( - props.superstate, - offset2, - windowFromDocument(e5.view.document), - { - spaces: spaceCache?.contexts ?? [], - fields: cols, - saveField: (source, field2) => { - return newColumn({ ...field2, table: source }); - }, - schemaId: tableData.schema.id, - contextPath: spaceInfo.path - } - ); - }; - const toggleMenu = (e5) => { - if (props.isNew) { - showNewMenu(e5); - } else { - const offset2 = e5.target.getBoundingClientRect(); - const options = optionValuesForColumn( - field.name, - field.table == "" ? tableData : contextTable[field.table] - ); - showPropertyMenu({ - superstate: props.superstate, - rect: offset2, - win: windowFromDocument(e5.view.document), - editable: field.name != PathPropertyName, - options, - field, - fields: cols, - contextPath: spaceInfo.path, - saveField, - hide: hideColumn, - deleteColumn: delColumn, - sortColumn, - hidden: predicate?.colsHidden.includes(field.name + field.table) - }); - } - }; - const ref2 = (0, import_react24.useRef)(null); - const setNodeRef = useCombinedRefs2(setDroppableNodeRef, setDraggableNodeRef); - return /* @__PURE__ */ import_react24.default.createElement("div", { - ref: setNodeRef, - ...listeners, - ...attributes, - className: "mk-col-header", - onClick: (e5) => { - toggleMenu(e5); - } - }, /* @__PURE__ */ import_react24.default.createElement("div", { - ref: ref2 - }, props.column.name.length > 0 ? /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, /* @__PURE__ */ import_react24.default.createElement("div", { - className: "mk-path-context-field-icon", - dangerouslySetInnerHTML: { - __html: props.superstate.ui.getSticker( - stickerForField(props.column) - ) - } - }), /* @__PURE__ */ import_react24.default.createElement("div", { - className: "mk-path-context-field-key" - }, nameForField(field, props.superstate))) : "+", /* @__PURE__ */ import_react24.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/utils/properties/allProperties.ts -var allCacheTypesForPaths = (superstate, paths) => { - if (!superstate.settings.experimental) - return []; - ; - const properties3 = {}; - for (const path2 of paths) { - const f2 = superstate.pathsIndex.get(path2)?.metadata; - if (f2) { - Object.keys(f2).forEach((k2) => { - const type = detectPropertyType(f2[k2], k2); - if (type != "unknown" && type != "object") - properties3[k2] = [...properties3[k2] ?? [], type]; - }); - } - } - return Object.keys(properties3).reduce((p, c3) => { - return [...p, { name: c3, type: properties3[c3][0] }]; - }, []); -}; - -// src/core/react/components/UI/Menus/contexts/PropertyValue.tsx -var import_react25 = __toESM(require_react()); -var PropertyValueComponent = (props) => { - const showOptions = (e5, value, options, field, saveProperty) => { - props.superstate.ui.openMenu( - e5.target.getBoundingClientRect(), - { - ui: props.superstate.ui, - multi: false, - editable: true, - searchable: true, - saveOptions: (_16, v2) => { - if (saveProperty) { - saveProperty(v2[0]); - } else { - saveParsedValue(field, v2[0]); - } - }, - placeholder: i18n_default.labels.propertyValueSpace, - value: [value ?? ""], - options - }, - windowFromDocument(e5.view.document) - ); - }; - const selectType = (e5) => { - props.superstate.ui.openMenu( - e5.target.getBoundingClientRect(), - { - ui: props.superstate.ui, - multi: false, - editable: false, - searchable: false, - saveOptions: (_16, v2) => saveParsedValue("type", v2[0]), - value: [], - showAll: true, - options: fieldTypes.filter((f2) => f2.primative).map((f2, i4) => ({ - id: i4 + 1, - name: f2.label, - value: f2.type, - icon: f2.icon - })) - }, - windowFromDocument(e5.view.document) - ); - }; - const parsedValue = (0, import_react25.useMemo)( - () => parseFieldValue(props.value, props.fieldType, props.superstate), - [props.value, props.fieldType] - ); - const saveParsedValue = (field, value) => { - props.saveValue(JSON.stringify({ ...parsedValue, [field]: value })); - }; - const saveSpaceProperty = (field) => { - const colExists = props.superstate.contextsIndex.get(parsedValue.space)?.contextTable?.cols?.some((f2) => f2.name == field); - if (!colExists) { - props.superstate.spaceManager.addSpaceProperty(parsedValue.space, { - name: field, - schemaId: defaultContextSchemaID, - type: "context", - value: props.name - }); - } - saveParsedValue("field", field); - }; - const selectContext = (e5) => { - showOptions( - e5, - parsedValue.space, - props.superstate.allSpaces().filter((f2) => f2.type != "default").map((m4) => ({ name: m4.name, value: m4.path, description: m4.path })), - "space" - ); - }; - const selectSpaceProperty = (e5) => { - showOptions( - e5, - parsedValue.property, - props.superstate.contextsIndex.get(parsedValue.space)?.contextTable?.cols.filter((f2) => { - return f2.type?.startsWith("context") && parseFieldValue(f2.value, f2.type, props.superstate)["space"] == props.contextPath ? true : false; - }).map((m4) => ({ name: m4.name, value: m4.name })) ?? [], - "field", - saveSpaceProperty - ); - }; - const selectProperty = (e5) => { - const properties3 = props.fields.filter( - (f2) => f2.type == "file" || f2.type == "link" || f2.type == "context" - ).map((f2) => ({ - name: f2.name, - value: f2.name - })) ?? []; - showOptions(e5, null, properties3, "field"); - }; - const selectPathProp = (e5) => { - const property = props.fields.find((f2) => f2.name == parsedValue.field); - const allPaths = props.superstate.spaceManager.allPaths(); - const fileProps = property ? property.type == "file" || property.type == "link" ? filePropTypes.map((f2) => ({ - name: f2.name, - value: f2.value - })) : props.superstate.contextsIndex.get( - parseFieldValue(property.value, "context", props.superstate).space - )?.contextTable?.cols.filter((f2) => f2.hidden != "true").map((f2) => ({ - name: f2.name, - value: f2.name - })) ?? [] : []; - const cacheTypes = allCacheTypesForPaths(props.superstate, allPaths).map( - (f2) => ({ name: f2.name, value: f2.name }) - ); - showOptions(e5, null, [...fileProps, ...cacheTypes], "value"); - }; - const editFormula = (e5) => { - const _props = { - superstate: props.superstate, - saveFormula: (value) => saveParsedValue("value", value), - formula: parsedValue.value, - value: {}, - fields: props.fields.filter((f2) => f2.name != props.name), - path: "" - }; - props.superstate.ui.openCustomMenu( - e5.target.getBoundingClientRect(), - /* @__PURE__ */ import_react25.default.createElement(FormulaEditor, { - ..._props - }), - { ..._props }, - windowFromDocument(e5.view.document), - "bottom" - ); - }; - const selectDateFormat = (e5) => { - const formats = [ - { - name: "2020-04-21", - value: "yyyy-MM-dd" - }, - { - name: "Apr 21, 2020", - value: "MMM d, yyyy" - }, - { - name: "Tue Apr 21, 2020", - value: "EEE MMM d, yyyy" - } - ]; - showOptions(e5, null, formats, "format"); - }; - return props.fieldType?.startsWith("date") ? /* @__PURE__ */ import_react25.default.createElement("div", { - className: "mk-menu-option", - onClick: (e5) => selectDateFormat(e5) - }, /* @__PURE__ */ import_react25.default.createElement("span", null, i18n_default.labels.dateFormat), /* @__PURE__ */ import_react25.default.createElement("span", null, parsedValue.format)) : props.fieldType?.startsWith("context") ? /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("div", { - className: "mk-menu-option", - onClick: (e5) => selectContext(e5) - }, /* @__PURE__ */ import_react25.default.createElement("span", null, i18n_default.labels.propertyValueSpace), /* @__PURE__ */ import_react25.default.createElement("span", null, spaceNameFromSpacePath(parsedValue.space, props.superstate))), parsedValue.space?.length > 0 && props.contextPath && /* @__PURE__ */ import_react25.default.createElement("div", { - className: "mk-menu-option", - onClick: (e5) => selectSpaceProperty(e5) - }, /* @__PURE__ */ import_react25.default.createElement("span", null, i18n_default.labels.propertyValueProperty), /* @__PURE__ */ import_react25.default.createElement("span", null, parsedValue.field))) : props.fieldType == "number" ? /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null) : props.fieldType == "fileprop" ? /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("div", { - className: "mk-menu-option", - onClick: (e5) => editFormula(e5) - }, /* @__PURE__ */ import_react25.default.createElement("span", null, i18n_default.labels.propertyLookup)), /* @__PURE__ */ import_react25.default.createElement("div", { - className: "mk-menu-option", - onClick: (e5) => selectType(e5) - }, /* @__PURE__ */ import_react25.default.createElement("span", null, i18n_default.labels.propertyType), /* @__PURE__ */ import_react25.default.createElement("span", null, fieldTypeForType(parsedValue.type)?.label))) : props.fieldType == "object" ? /* @__PURE__ */ import_react25.default.createElement("div", { - className: "mk-menu-option", - onClick: (e5) => { - props.superstate.ui.openModal( - "Object Name", - (_props) => /* @__PURE__ */ import_react25.default.createElement(InputModal, { - value: parsedValue.typeName, - saveLabel: "Rename Object", - saveValue: (value) => { - saveParsedValue("typeName", value); - }, - hide: _props.hide - }), - windowFromDocument(e5.view.document) - ); - } - }, /* @__PURE__ */ import_react25.default.createElement("span", null, "Name"), /* @__PURE__ */ import_react25.default.createElement("span", null, parsedValue.typeName)) : props.fieldType == "super" ? /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("div", { - className: "mk-menu-option" - }, /* @__PURE__ */ import_react25.default.createElement("span", null, i18n_default.labels.propertyDynamic), /* @__PURE__ */ import_react25.default.createElement("input", { - type: "checkbox", - checked: parsedValue.dynamic == true, - onChange: () => saveParsedValue("dynamic", !parsedValue.dynamic) - })), /* @__PURE__ */ import_react25.default.createElement("div", { - className: "mk-menu-option", - onClick: (e5) => selectProperty(e5) - }, /* @__PURE__ */ import_react25.default.createElement("span", null, i18n_default.labels.propertyFileProp), /* @__PURE__ */ import_react25.default.createElement("span", null, parsedValue.field))) : /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null); -}; - -// src/core/react/components/UI/Menus/contexts/newSpacePropertyMenu.tsx -var NewPropertyMenuComponent = (props) => { - const [fieldName, setFieldName] = (0, import_react26.useState)(""); - const [fieldSource, setFieldSource] = (0, import_react26.useState)( - props.fileMetadata ? "$fm" : "" - ); - const spaceCaches = (0, import_react26.useMemo)( - () => props.spaces.map((f2) => props.superstate.spacesIndex.get(f2)).filter((f2) => f2), - [props.spaces] - ); - const [fieldValue, setFieldValue] = (0, import_react26.useState)(""); - const [fieldType, setFieldType] = (0, import_react26.useState)(props.type ?? "text"); - const options = (0, import_react26.useMemo)(() => { - const options2 = []; - if (props.fileMetadata) { - options2.push({ - name: i18n_default.menu.setNone, - value: "$fm" - }); - } - if (props.contextPath && (!props.fileMetadata || props.contextPath != "$fm")) { - options2.push({ - name: folderPathToString(props.contextPath), - value: "" - }); - } - options2.push( - ...(spaceCaches ?? []).map((f2) => ({ - name: f2.name, - value: f2.path - })) - ); - return options2; - }, [spaceCaches]); - const selectedType = (_16, value) => { - setFieldType(value[0]); - }; - const selectedValue = (value) => { - setFieldValue(value); - }; - const selectedSource = (_16, value) => { - setFieldSource(value[0]); - }; - const toggleMulti = () => { - const field = fieldTypes.find( - (f2) => f2.type == fieldType || f2.multiType == fieldType - ); - setFieldType(field.type == fieldType ? field.multiType : field.type); - }; - const selectType = (e5) => { - props.superstate.ui.openMenu( - e5.target.getBoundingClientRect(), - { - ui: props.superstate.ui, - multi: false, - editable: false, - searchable: true, - saveOptions: selectedType, - value: [], - showAll: true, - options: fieldTypes.filter( - (f2) => fieldSource == "$fm" && !props.isSpace ? f2.metadata : !f2.restricted - ).map((f2, i4) => ({ - id: i4 + 1, - name: f2.label, - value: f2.type, - icon: f2.icon, - description: f2.description - })) - }, - windowFromDocument(e5.view.document) - ); - }; - const selectedContext = (value) => { - setFieldValue(value); - }; - const type = (0, import_react26.useMemo)( - () => fieldTypeForType(fieldType, fieldName) ?? fieldTypes[0], - [fieldType, fieldName] - ); - const selectSource = (e5) => { - e5.stopPropagation(); - props.superstate.ui.openMenu( - e5.target.getBoundingClientRect(), - { - ui: props.superstate.ui, - multi: false, - editable: false, - searchable: false, - saveOptions: selectedSource, - value: [], - showAll: true, - options - }, - windowFromDocument(e5.view.document) - ); - }; - const saveField = () => { - if (fieldName.length == 0) { - props.superstate.ui.notify(i18n_default.notice.noPropertyName); - return; - } - const result = props.saveField(fieldSource, { - name: fieldName, - type: fieldType, - value: fieldValue, - schemaId: props.schemaId - }); - if (result) - props.hide(); - }; - const onKeyDown = (e5) => { - if (e5.key == "Enter") { - saveField(); - } - }; - (0, import_react26.useEffect)(() => { - setTimeout(() => { - input.current?.focus(); - }, 50); - }, []); - const input = (0, import_react26.useRef)(null); - return /* @__PURE__ */ import_react26.default.createElement("div", { - className: "mk-menu-container" - }, /* @__PURE__ */ import_react26.default.createElement("div", { - className: "mk-menu-suggestions" - }, /* @__PURE__ */ import_react26.default.createElement("div", { - className: "mk-menu-input" - }, /* @__PURE__ */ import_react26.default.createElement("input", { - type: "text", - ref: input, - placeholder: "Name", - onKeyDown, - onChange: (e5) => setFieldName(e5.target.value), - onMouseDown: (e5) => e5.stopPropagation(), - value: fieldName - })), /* @__PURE__ */ import_react26.default.createElement("div", { - className: "mk-menu-separator" - }), options.length > 1 && /* @__PURE__ */ import_react26.default.createElement("div", { - className: "mk-menu-option", - onClick: (e5) => selectSource(e5) - }, /* @__PURE__ */ import_react26.default.createElement("div", { - className: "mk-menu-options-inner" - }, i18n_default.labels.propertyValueSpace), /* @__PURE__ */ import_react26.default.createElement("span", null, fieldSource == "$fm" ? "None" : fieldSource == "" ? props.contextPath : fieldSource)), /* @__PURE__ */ import_react26.default.createElement("div", { - className: "mk-menu-option", - onClick: (e5) => selectType(e5) - }, /* @__PURE__ */ import_react26.default.createElement("div", { - className: "mk-menu-options-inner" - }, i18n_default.labels.propertyValueProperty), /* @__PURE__ */ import_react26.default.createElement("span", null, type.label)), type.multi ? /* @__PURE__ */ import_react26.default.createElement("div", { - className: "mk-menu-option" - }, /* @__PURE__ */ import_react26.default.createElement("span", null, i18n_default.labels.multiple), /* @__PURE__ */ import_react26.default.createElement("input", { - type: "checkbox", - checked: fieldType == type.multiType, - onChange: () => toggleMulti() - })) : /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null), /* @__PURE__ */ import_react26.default.createElement("div", { - className: "mk-menu-separator" - }), fieldSource != "$fm" || props.isSpace ? /* @__PURE__ */ import_react26.default.createElement(PropertyValueComponent, { - superstate: props.superstate, - table: fieldSource, - fields: props.fields, - fieldType, - value: fieldValue, - contextPath: props.contextPath, - saveValue: selectedValue - }) : /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null), /* @__PURE__ */ import_react26.default.createElement("div", { - className: "mk-menu-separator" - }), /* @__PURE__ */ import_react26.default.createElement("div", { - className: "mk-menu-option", - onClick: (e5) => saveField() - }, /* @__PURE__ */ import_react26.default.createElement("span", null, i18n_default.buttons.saveProperty)), /* @__PURE__ */ import_react26.default.createElement("div", { - className: "mk-menu-option", - onClick: (e5) => props.hide() - }, /* @__PURE__ */ import_react26.default.createElement("span", null, i18n_default.buttons.cancel)))); -}; -var showNewPropertyMenu = (superstate, rect, win, props, onHide) => { - return superstate.ui.openCustomMenu( - rect, - /* @__PURE__ */ import_react26.default.createElement(NewPropertyMenuComponent, { - superstate, - ...props - }), - {}, - win, - "bottom", - onHide - ); -}; - -// src/core/react/components/SpaceView/Contexts/DataTypeView/DataPropertyView.tsx -var import_react55 = __toESM(require_react()); - -// src/core/react/components/UI/Toggles/CollapseToggleSmall.tsx -var import_react27 = __toESM(require_react()); -var CollapseToggleSmall = (props) => { - return /* @__PURE__ */ import_react27.default.createElement("button", { - className: `mk-collapse mk-inline-button mk-icon-xsmall ${props.collapsed ? "mk-collapsed" : ""}`, - onClick: (e5) => { - if (props.onToggle) { - props.onToggle(!props.collapsed, e5); - e5.stopPropagation(); - } - }, - dangerouslySetInnerHTML: { - __html: props.superstate.ui.getSticker("ui//collapse-solid") - } - }); -}; - // src/core/react/context/WindowContext.tsx -var import_react28 = __toESM(require_react()); +var import_react25 = __toESM(require_react()); var import_react_dom2 = __toESM(require_react_dom()); -var WindowContext = import_react28.default.createContext({ +var WindowContext = import_react25.default.createContext({ dragNode: null, setDragNode: () => null, dragActive: false }); var WindowProvider = (props) => { - const [dragNode, setDragNode] = import_react28.default.useState(null); + const [dragNode, setDragNode] = import_react25.default.useState(null); useDndMonitor({ onDragCancel: () => { setDragNode(null); @@ -98665,14 +98327,14 @@ var WindowProvider = (props) => { setDragNode(null); } }); - return /* @__PURE__ */ import_react28.default.createElement(WindowContext.Provider, { + return /* @__PURE__ */ import_react25.default.createElement(WindowContext.Provider, { value: { dragNode, setDragNode, dragActive: props.dragActive } }, props.children, dragNode && (0, import_react_dom2.createPortal)( - /* @__PURE__ */ import_react28.default.createElement(DragOverlay, { + /* @__PURE__ */ import_react25.default.createElement(DragOverlay, { dropAnimation: null, zIndex: 1600 }, dragNode), @@ -98681,12 +98343,12 @@ var WindowProvider = (props) => { }; // src/core/react/components/SpaceView/Contexts/ContextBuilder/ContextListEditSelector.tsx -var import_react30 = __toESM(require_react()); +var import_react27 = __toESM(require_react()); // src/core/react/components/SpaceView/Frames/Setters/ToggleSetter.tsx -var import_react29 = __toESM(require_react()); +var import_react26 = __toESM(require_react()); var ToggleSetter = (props) => { - return /* @__PURE__ */ import_react29.default.createElement("div", { + return /* @__PURE__ */ import_react26.default.createElement("div", { "aria-label": props.name, className: `mk-editor-frame-node-button ${props.value == props.onValue ? "mk-active" : ""}`, onClick: (e5) => props.value == props.onValue ? props.setValue(props.defaultValue) : props.setValue(props.onValue), @@ -98698,17 +98360,17 @@ var ToggleSetter = (props) => { // src/core/react/components/SpaceView/Contexts/ContextBuilder/ContextListEditSelector.tsx var ContextListEditSelector = (props) => { - const { pathState } = (0, import_react30.useContext)(PathContext); - const { spaceInfo } = (0, import_react30.useContext)(SpaceContext); - const { predicate, savePredicate, sortedColumns } = (0, import_react30.useContext)(ContextEditorContext); + const { pathState } = (0, import_react27.useContext)(PathContext); + const { spaceInfo } = (0, import_react27.useContext)(SpaceContext); + const { predicate, savePredicate, sortedColumns } = (0, import_react27.useContext)(ContextEditorContext); const selectFrame = (frameRef, type) => { savePredicate({ view: "frame", [type]: frameRef }); }; - const { frameSchemas, saveSchema } = (0, import_react30.useContext)(FramesMDBContext); - const listItems = (0, import_react30.useMemo)(() => { + const { frameSchemas, saveSchema } = (0, import_react27.useContext)(FramesMDBContext); + const listItems = (0, import_react27.useMemo)(() => { const items = []; if (frameSchemas) { items.push( @@ -98794,20 +98456,20 @@ var ContextListEditSelector = (props) => { } props.setEditSection(type); }; - const [loaded, setLoaded] = (0, import_react30.useState)(false); - const [isPending, startTransition] = (0, import_react30.useTransition)(); - (0, import_react30.useEffect)(() => { + const [loaded, setLoaded] = (0, import_react27.useState)(false); + const [isPending, startTransition] = (0, import_react27.useTransition)(); + (0, import_react27.useEffect)(() => { startTransition(() => { setLoaded(true); }); }, []); - return predicate ? /* @__PURE__ */ import_react30.default.createElement("div", { + return predicate ? /* @__PURE__ */ import_react27.default.createElement("div", { className: "mk-editor-context-selector" - }, /* @__PURE__ */ import_react30.default.createElement("div", { + }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "mk-editor-context-groups" - }, /* @__PURE__ */ import_react30.default.createElement("div", { + }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "mk-editor-context-group" - }, /* @__PURE__ */ import_react30.default.createElement(ToggleSetter, { + }, /* @__PURE__ */ import_react27.default.createElement(ToggleSetter, { superstate: props.superstate, name: i18n_default.editor.rows, icon: "ui//rows", @@ -98821,7 +98483,7 @@ var ContextListEditSelector = (props) => { listGroup: "spaces://$kit/#*listGroup" }); } - }), /* @__PURE__ */ import_react30.default.createElement(ToggleSetter, { + }), /* @__PURE__ */ import_react27.default.createElement(ToggleSetter, { superstate: props.superstate, name: i18n_default.editor.columns, icon: "ui//columns", @@ -98835,7 +98497,7 @@ var ContextListEditSelector = (props) => { listGroup: "spaces://$kit/#*columnGroup" }); } - }), /* @__PURE__ */ import_react30.default.createElement(ToggleSetter, { + }), /* @__PURE__ */ import_react27.default.createElement(ToggleSetter, { superstate: props.superstate, name: i18n_default.editor.catalog, icon: "ui//gallery-horizontal-end", @@ -98849,7 +98511,7 @@ var ContextListEditSelector = (props) => { listGroup: "spaces://$kit/#*rowGroup" }); } - }), /* @__PURE__ */ import_react30.default.createElement(ToggleSetter, { + }), /* @__PURE__ */ import_react27.default.createElement(ToggleSetter, { superstate: props.superstate, name: i18n_default.editor.grid, icon: "ui//layout-grid", @@ -98863,7 +98525,7 @@ var ContextListEditSelector = (props) => { listGroup: "spaces://$kit/#*gridGroup" }); } - }), /* @__PURE__ */ import_react30.default.createElement("button", { + }), /* @__PURE__ */ import_react27.default.createElement("button", { onClick: (e5) => { editItem("listGroup"); }, @@ -98873,22 +98535,22 @@ var ContextListEditSelector = (props) => { __html: props.superstate.ui.getSticker("ui//brush") }, style: { height: "20px", padding: "8px" } - })), /* @__PURE__ */ import_react30.default.createElement("div", { + })), /* @__PURE__ */ import_react27.default.createElement("div", { className: "mk-editor-context-group" - }, /* @__PURE__ */ import_react30.default.createElement("div", { + }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "mk-editor-context-group-select", onClick: (e5) => { selectFrameMenu(e5, "listItem"); e5.stopPropagation(); } - }, listItems.find((f2) => f2.value == predicate.listItem)?.name ?? i18n_default.labels.select, /* @__PURE__ */ import_react30.default.createElement(CollapseToggleSmall, { + }, listItems.find((f2) => f2.value == predicate.listItem)?.name ?? i18n_default.labels.select, /* @__PURE__ */ import_react27.default.createElement(CollapseToggleSmall, { superstate: props.superstate, collapsed: false, onToggle: (c3, e5) => { selectFrameMenu(e5, "listItem"); e5.stopPropagation(); } - })), /* @__PURE__ */ import_react30.default.createElement("button", { + })), /* @__PURE__ */ import_react27.default.createElement("button", { onClick: (e5) => { editItem("listItem"); }, @@ -98898,7 +98560,7 @@ var ContextListEditSelector = (props) => { dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//brush") } - }), /* @__PURE__ */ import_react30.default.createElement("button", { + }), /* @__PURE__ */ import_react27.default.createElement("button", { onClick: (e5) => { addListItemToKit(); }, @@ -98907,23 +98569,23 @@ var ContextListEditSelector = (props) => { __html: props.superstate.ui.getSticker("ui//package-plus") }, style: { height: "20px", padding: "8px" } - })), /* @__PURE__ */ import_react30.default.createElement("span", null), /* @__PURE__ */ import_react30.default.createElement("div", { + })), /* @__PURE__ */ import_react27.default.createElement("span", null), /* @__PURE__ */ import_react27.default.createElement("div", { className: "mk-editor-frame-node-button-primary", onClick: (e5) => { props.setEditMode(0 /* Read */); e5.stopPropagation(); } - }, i18n_default.labels.done)), props.editSection == "listItem" && /* @__PURE__ */ import_react30.default.createElement("div", { + }, i18n_default.labels.done)), props.editSection == "listItem" && /* @__PURE__ */ import_react27.default.createElement("div", { className: "mk-editor-context-properties" - }, /* @__PURE__ */ import_react30.default.createElement("div", { + }, /* @__PURE__ */ import_react27.default.createElement("div", { style: { display: "flex" } - }, i18n_default.labels.properties, /* @__PURE__ */ import_react30.default.createElement("div", { + }, i18n_default.labels.properties, /* @__PURE__ */ import_react27.default.createElement("div", { "aria-label": i18n_default.hintText.dragDropProperties, className: `mk-icon-xsmall`, dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//help-circle") } - })), /* @__PURE__ */ import_react30.default.createElement("div", null, sortedColumns.map((f2, i4) => /* @__PURE__ */ import_react30.default.createElement(PropertyField, { + })), /* @__PURE__ */ import_react27.default.createElement("div", null, sortedColumns.map((f2, i4) => /* @__PURE__ */ import_react27.default.createElement(PropertyField, { contexts: [pathState.path], path: pathState.path, key: i4, @@ -98933,7 +98595,7 @@ var ContextListEditSelector = (props) => { }))))) : null; }; var PropertyField = (props) => { - const { uid } = (0, import_react30.useContext)(PathContext); + const { uid } = (0, import_react27.useContext)(PathContext); const primaryContext = props.contexts?.[0]; const id3 = `${uid}_props_${primaryContext ?? ""}${props.property.name}`; const { @@ -98952,54 +98614,54 @@ var PropertyField = (props) => { type: "property" } }); - const { setDragNode } = (0, import_react30.useContext)(WindowContext); + const { setDragNode } = (0, import_react27.useContext)(WindowContext); useDndMonitor({ onDragStart: (e5) => { if (e5.active.data.current.id == id3) setDragNode( - /* @__PURE__ */ import_react30.default.createElement("div", { + /* @__PURE__ */ import_react27.default.createElement("div", { className: "mk-path-context-field", onClick: (e6) => props.onClick ? props.onClick(e6) : null - }, /* @__PURE__ */ import_react30.default.createElement("div", { + }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "mk-path-context-field-icon", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker( stickerForField(props.property) ) } - }), /* @__PURE__ */ import_react30.default.createElement("div", { + }), /* @__PURE__ */ import_react27.default.createElement("div", { className: "mk-path-context-field-key" }, nameForField(props.property, props.superstate))) ); } }); - return /* @__PURE__ */ import_react30.default.createElement("div", { + return /* @__PURE__ */ import_react27.default.createElement("div", { ref: setDraggableNodeRef, className: "mk-path-context-field", onClick: (e5) => props.onClick ? props.onClick(e5) : null, ...attributes, ...listeners - }, /* @__PURE__ */ import_react30.default.createElement("div", { + }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "mk-path-context-field-icon", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker( stickerForField(props.property) ) } - }), props.contexts?.length > 0 && /* @__PURE__ */ import_react30.default.createElement("div", { + }), props.contexts?.length > 0 && /* @__PURE__ */ import_react27.default.createElement("div", { className: "mk-path-context-field-space", dangerouslySetInnerHTML: { __html: props.contexts.length == 1 ? props.superstate.ui.getSticker( props.superstate.pathsIndex.get(props.contexts[0])?.label?.sticker ) : props.contexts.length } - }), /* @__PURE__ */ import_react30.default.createElement("div", { + }), /* @__PURE__ */ import_react27.default.createElement("div", { className: "mk-path-context-field-key" }, nameForField(props.property, props.superstate))); }; // node_modules/@tanstack/react-table/build/lib/index.mjs -var React28 = __toESM(require_react(), 1); +var React26 = __toESM(require_react(), 1); // node_modules/@tanstack/table-core/build/lib/index.mjs function functionalUpdate(updater, input) { @@ -101777,7 +101439,7 @@ function getPaginationRowModel(opts) { // node_modules/@tanstack/react-table/build/lib/index.mjs function flexRender(Comp, props) { - return !Comp ? null : isReactComponent(Comp) ? /* @__PURE__ */ React28.createElement(Comp, props) : Comp; + return !Comp ? null : isReactComponent(Comp) ? /* @__PURE__ */ React26.createElement(Comp, props) : Comp; } function isReactComponent(component) { return isClassComponent(component) || typeof component === "function" || isExoticComponent(component); @@ -101799,10 +101461,10 @@ function useReactTable(options) { renderFallbackValue: null, ...options }; - const [tableRef] = React28.useState(() => ({ + const [tableRef] = React26.useState(() => ({ current: createTable(resolvedOptions) })); - const [state, setState] = React28.useState(() => tableRef.current.initialState); + const [state, setState] = React26.useState(() => tableRef.current.initialState); tableRef.current.setOptions((prev) => ({ ...prev, ...options, @@ -101821,6 +101483,395 @@ function useReactTable(options) { // src/core/react/components/SpaceView/Contexts/TableView/TableView.tsx var import_react54 = __toESM(require_react()); var import_react_dom4 = __toESM(require_react_dom()); + +// src/core/react/components/UI/Menus/contexts/spacePropertyMenu.tsx +var import_react28 = __toESM(require_react()); +var selectPropertyTypeMenu = (e5, ui, selectedType) => { + ui.openMenu( + e5.target.getBoundingClientRect(), + { + ui, + multi: false, + editable: false, + searchable: false, + saveOptions: selectedType, + value: [], + showAll: true, + options: fieldTypes.filter((f2) => !f2.restricted).map((f2, i4) => ({ + id: i4 + 1, + name: f2.label, + value: f2.type, + icon: f2.icon + })) + }, + windowFromDocument(e5.view.document) + ); +}; +var PropertyMenuComponent = (props) => { + const [field, setField] = (0, import_react28.useState)(props.field); + const selectedType = (_16, value) => { + const newField = { + ...field, + type: value[0], + value: JSON.stringify(getNewValueForType(field, value)) + }; + setField(newField); + props.saveField(newField); + }; + const selectedValue = (value) => { + const newField = { ...field, value }; + setField(newField); + props.saveField(newField); + }; + const toggleMulti = () => { + const newField = { + ...field, + type: field.type == fieldType.multiType ? fieldType.type : fieldType.multiType + }; + setField(newField); + props.saveField(newField); + }; + const fieldType = fieldTypeForType(field.type, field.name) ?? fieldTypes[0]; + const getNewValueForType = (f2, value) => { + if (value[0].startsWith("option")) { + return JSON.stringify({ + options: props.options.map((f3) => ({ + name: f3, + value: f3 + })) + }); + } + return value[0] == fieldType.type || value[0] == fieldType.multiType ? f2.value : null; + }; + return /* @__PURE__ */ import_react28.default.createElement(import_react28.default.Fragment, null, /* @__PURE__ */ import_react28.default.createElement("li", null, /* @__PURE__ */ import_react28.default.createElement("div", { + className: "mk-menu-option", + onClick: (e5) => selectPropertyTypeMenu(e5, props.superstate.ui, selectedType) + }, /* @__PURE__ */ import_react28.default.createElement("span", null, i18n_default.labels.propertyType), /* @__PURE__ */ import_react28.default.createElement("span", null, fieldType.label))), fieldType.multi ? /* @__PURE__ */ import_react28.default.createElement("div", { + className: "mk-menu-option" + }, /* @__PURE__ */ import_react28.default.createElement("span", null, i18n_default.labels.multiple), /* @__PURE__ */ import_react28.default.createElement("input", { + type: "checkbox", + checked: field.type == fieldType.multiType, + onChange: () => toggleMulti() + })) : /* @__PURE__ */ import_react28.default.createElement(import_react28.default.Fragment, null), /* @__PURE__ */ import_react28.default.createElement("div", { + className: "mk-menu-separator" + }), /* @__PURE__ */ import_react28.default.createElement(PropertyValueComponent, { + superstate: props.superstate, + name: field.name, + table: field.table, + fields: props.fields, + fieldType: fieldType.type, + value: field.value, + contextPath: props.contextPath, + saveValue: selectedValue + })); +}; +var showPropertyMenu = (props, onHide) => { + const { + superstate, + rect, + editable, + options, + field, + fields, + contextPath, + saveField, + hide, + deleteColumn, + sortColumn, + editCode, + hidden + } = props; + const saveName = (value) => { + if (!editable) { + const fieldValue = safelyParseJSON(field.value); + saveField({ ...field, value: JSON.stringify({ + ...fieldValue, + alias: value + }) }); + return; + } + saveField({ ...field, name: value }); + }; + const menuOptions = []; + menuOptions.push( + menuInput( + nameForField(field, props.superstate) ?? "", + (value) => saveName(value) + ) + ); + menuOptions.push(menuSeparator); + if (editable) { + menuOptions.push({ + name: "", + type: 5 /* Custom */, + fragment: () => /* @__PURE__ */ import_react28.default.createElement(PropertyMenuComponent, { + superstate, + field, + fields, + contextPath, + options, + saveField + }) + }); + } + menuOptions.push(menuSeparator); + menuOptions.push({ + name: i18n_default.menu.setIcon, + icon: "ui//gem", + onClick: (e5) => { + superstate.ui.openPalette( + (_props) => /* @__PURE__ */ import_react28.default.createElement(StickerModal_default, { + ui: superstate.ui, + hide: _props.hide, + selectedSticker: (emoji) => saveField({ ...field, attrs: JSON.stringify({ icon: emoji }) }) + }), + windowFromDocument(e5.view.document) + ); + } + }); + menuOptions.push(menuSeparator); + const sortableString = normalizedSortForType(field.type, false); + if (sortableString && sortColumn) { + menuOptions.push({ + name: i18n_default.menu.sortAscending, + icon: "ui//sort-asc", + onClick: () => { + sortColumn({ + field: field.name + field.table, + fn: sortableString + }); + } + }); + menuOptions.push({ + name: i18n_default.menu.sortDescending, + icon: "ui//sort-desc", + onClick: () => { + sortColumn({ + field: field.name + field.table, + fn: normalizedSortForType(field.type, true) + }); + } + }); + } + menuOptions.push(menuSeparator); + if (hide) { + if (!hidden) { + menuOptions.push({ + name: i18n_default.menu.hideProperty, + icon: "ui//eye-off", + onClick: () => { + hide(field, true); + } + }); + } else { + menuOptions.push({ + name: i18n_default.menu.unhideProperty, + icon: "ui//eye", + onClick: () => { + hide(field, false); + } + }); + } + } + if (editable) { + if (editCode) { + menuOptions.push({ + name: i18n_default.menu.editCode, + icon: "ui//code", + onClick: () => { + editCode(); + } + }); + } + if (deleteColumn) { + menuOptions.push({ + name: i18n_default.menu.deleteProperty, + icon: "ui//trash", + onClick: () => { + deleteColumn(field); + } + }); + } + } + const menu = superstate.ui.openMenu( + rect, + defaultMenu(superstate.ui, menuOptions), + props.win, + props.anchor, + onHide + ); + return menu; +}; + +// src/core/react/hooks/useCombinedRef.tsx +var import_react29 = __toESM(require_react()); +function useCombinedRefs2(...refs) { + return (0, import_react29.useMemo)( + () => (node) => { + refs.forEach((ref2) => ref2(node)); + }, + refs + ); +} + +// src/core/react/components/SpaceView/Contexts/TableView/ColumnHeader.tsx +var import_react30 = __toESM(require_react()); +var filePropTypes = [ + { + name: i18n_default.properties.fileProperty.name, + value: "name" + }, + { + name: i18n_default.properties.fileProperty.createdTime, + value: "ctime" + }, + { + name: i18n_default.properties.fileProperty.modifiedTime, + value: "mtime" + }, + { + name: i18n_default.properties.fileProperty.sticker, + value: "sticker" + }, + { + name: i18n_default.properties.fileProperty.extension, + value: "extension" + }, + { + name: i18n_default.properties.fileProperty.size, + value: "size" + }, + { + name: i18n_default.properties.fileProperty.parentFolder, + value: "folder" + }, + { + name: i18n_default.properties.fileProperty.links, + value: "inlinks" + }, + { + name: i18n_default.properties.fileProperty.tags, + value: "tags" + }, + { + name: i18n_default.properties.fileProperty.spaces, + value: "spaces" + } +]; +var ColumnHeader = (props) => { + const [field, setField] = (0, import_react30.useState)(props.column); + const menuRef = (0, import_react30.useRef)(null); + const { spaceInfo, spaceState: spaceCache } = (0, import_react30.useContext)(SpaceContext); + const { + predicate, + tableData, + contextTable, + cols, + newColumn, + saveColumn, + hideColumn, + sortColumn, + delColumn + } = (0, import_react30.useContext)(ContextEditorContext); + (0, import_react30.useEffect)(() => { + setField(props.column); + }, [props.column]); + const { + attributes, + listeners, + setNodeRef: setDraggableNodeRef, + transform + } = useDraggable({ + id: field.name + field.table, + data: { name: field.name } + }); + const { setNodeRef: setDroppableNodeRef } = useDroppable({ + id: field.name + field.table, + data: { name: field.name } + }); + const saveField = (field2) => { + if (field2.name.length > 0) { + if (field2.name != props.column.name || field2.type != props.column.type || field2.value != props.column.value || field2.attrs != props.column.attrs) { + const saveResult = saveColumn(field2, props.column); + if (saveResult) { + if (props.isNew) { + setField(props.column); + } + } + } + } + }; + const showNewMenu = (e5) => { + const offset2 = ref2.current.getBoundingClientRect(); + showNewPropertyMenu( + props.superstate, + offset2, + windowFromDocument(e5.view.document), + { + spaces: spaceCache?.contexts ?? [], + fields: cols, + saveField: (source, field2) => { + return newColumn({ ...field2, table: source }); + }, + schemaId: tableData.schema.id, + contextPath: spaceInfo.path + } + ); + }; + const toggleMenu = (e5) => { + if (props.isNew) { + showNewMenu(e5); + } else { + const offset2 = e5.target.getBoundingClientRect(); + const options = optionValuesForColumn( + field.name, + field.table == "" ? tableData : contextTable[field.table] + ); + showPropertyMenu({ + superstate: props.superstate, + rect: offset2, + win: windowFromDocument(e5.view.document), + editable: field.name != PathPropertyName, + options, + field, + fields: cols, + contextPath: spaceInfo.path, + saveField, + hide: hideColumn, + deleteColumn: delColumn, + sortColumn, + hidden: predicate?.colsHidden.includes(field.name + field.table) + }); + } + }; + const ref2 = (0, import_react30.useRef)(null); + const setNodeRef = useCombinedRefs2(setDroppableNodeRef, setDraggableNodeRef); + return /* @__PURE__ */ import_react30.default.createElement("div", { + ref: setNodeRef, + ...listeners, + ...attributes, + className: "mk-col-header", + onClick: (e5) => { + toggleMenu(e5); + } + }, /* @__PURE__ */ import_react30.default.createElement("div", { + ref: ref2 + }, props.column.name.length > 0 ? /* @__PURE__ */ import_react30.default.createElement(import_react30.default.Fragment, null, /* @__PURE__ */ import_react30.default.createElement("div", { + className: "mk-path-context-field-icon", + dangerouslySetInnerHTML: { + __html: props.superstate.ui.getSticker( + stickerForField(props.column) + ) + } + }), /* @__PURE__ */ import_react30.default.createElement("div", { + className: "mk-path-context-field-key" + }, nameForField(field, props.superstate))) : "+", /* @__PURE__ */ import_react30.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/SpaceView/Contexts/TableView/TableView.tsx var import_classnames2 = __toESM(require_classnames()); // src/core/utils/contexts/predicate/aggregates.ts @@ -109675,17 +109726,17 @@ function print() { __p += __j.call(arguments, '') } \`:\`; \`)+He+\`return __p }\`;var kr=aA(function(){return rt(X,mr+"return "+He).apply(e,ie)});if(kr.source=He,sb(kr))throw kr;return kr}function _9(f){return ft(f).toLowerCase()}function O9(f){return ft(f).toUpperCase()}function B9(f,p,D){if(f=ft(f),f&&(D||p===e))return ml(f);if(!f||!(p=ua(p)))return f;var P=Bn(f),Y=Bn(p),X=yt(P,Y),ie=pl(P,Y)+1;return Ao(P,X,ie).join("")}function P9(f,p,D){if(f=ft(f),f&&(D||p===e))return f.slice(0,Vs(f)+1);if(!f||!(p=ua(p)))return f;var P=Bn(f),Y=pl(P,Bn(p))+1;return Ao(P,0,Y).join("")}function I9(f,p,D){if(f=ft(f),f&&(D||p===e))return f.replace(nr,"");if(!f||!(p=ua(p)))return f;var P=Bn(f),Y=yt(P,Bn(p));return Ao(P,Y).join("")}function R9(f,p){var D=_,P=E;if(_t(p)){var Y="separator"in p?p.separator:Y;D="length"in p?Rr(p.length):D,P="omission"in p?ua(p.omission):P}f=ft(f);var X=f.length;if(Sa(f)){var ie=Bn(f);X=ie.length}if(D>=X)return f;var fe=D-gi(P);if(fe<1)return P;var he=ie?Ao(ie,0,fe).join(""):f.slice(0,fe);if(Y===e)return he+P;if(ie&&(fe+=he.length-fe),ub(Y)){if(f.slice(fe).search(Y)){var ke,ze=he;for(Y.global||(Y=Za(Y.source,ft(Un.exec(Y))+"g")),Y.lastIndex=0;ke=Y.exec(ze);)var He=ke.index;he=he.slice(0,He===e?fe:He)}}else if(f.indexOf(ua(Y),fe)!=fe){var er=he.lastIndexOf(Y);er>-1&&(he=he.slice(0,er))}return he+P}function q9(f){return f=ft(f),f&&tr.test(f)?f.replace(ve,Gx):f}var k9=mu(function(f,p,D){return f+(D?" ":"")+p.toUpperCase()}),lb=iN("toUpperCase");function nA(f,p,D){return f=ft(f),p=D?e:p,p===e?Wx(f)?Qx(f):Rx(f):f.match(p)||[]}var aA=Ur(function(f,p){try{return pn(f,e,p)}catch(D){return sb(D)?D:new Ar(D)}}),L9=$i(function(f,p){return It(p,function(D){D=Ni(D),Ka(f,D,ib(f[D],f))}),f});function z9(f){var p=f==null?0:f.length,D=yr();return f=p?dt(f,function(P){if(typeof P[1]!="function")throw new Yn(a);return[D(P[0]),P[1]]}):[],Ur(function(P){for(var Y=-1;++Yk)return[];var D=z,P=Ft(f,z);p=yr(p),f-=z;for(var Y=Jf(P,p);++D0||p<0)?new qr(D):(f<0?D=D.takeRight(-f):f&&(D=D.drop(f)),p!==e&&(p=Rr(p),D=p<0?D.dropRight(-p):D.take(p-f)),D)},qr.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},qr.prototype.toArray=function(){return this.take(z)},Na(qr.prototype,function(f,p){var D=/^(?:filter|find|map|reject)|While$/.test(p),P=/^(?:head|last)$/.test(p),Y=Z[P?"take"+(p=="last"?"Right":""):p],X=P||/^find/.test(p);!Y||(Z.prototype[p]=function(){var ie=this.__wrapped__,fe=P?[1]:arguments,he=ie instanceof qr,ke=fe[0],ze=he||Or(ie),He=function(Yr){var Zr=Y.apply(Z,Da([Yr],fe));return P&&er?Zr[0]:Zr};ze&&D&&typeof ke=="function"&&ke.length!=1&&(he=ze=!1);var er=this.__chain__,mr=!!this.__actions__.length,Dr=X&&!er,kr=he&&!mr;if(!X&&ze){ie=kr?ie:new qr(this);var Sr=f.apply(ie,fe);return Sr.__actions__.push({func:Jl,args:[He],thisArg:e}),new Hn(Sr,er)}return Dr&&kr?f.apply(this,fe):(Sr=this.thru(He),Dr?P?Sr.value()[0]:Sr.value():Sr)})}),It(["pop","push","shift","sort","splice","unshift"],function(f){var p=ns[f],D=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",P=/^(?:pop|shift)$/.test(f);Z.prototype[f]=function(){var Y=arguments;if(P&&!this.__chain__){var X=this.value();return p.apply(Or(X)?X:[],Y)}return this[D](function(ie){return p.apply(Or(ie)?ie:[],Y)})}}),Na(qr.prototype,function(f,p){var D=Z[p];if(D){var P=D.name+"";ut.call(wo,P)||(wo[P]=[]),wo[P].push({name:p,func:D})}}),wo[Hl(e,v).name]=[{name:"wrapper",func:e}],qr.prototype.clone=c1,qr.prototype.reverse=l1,qr.prototype.value=m1,Z.prototype.at=d6,Z.prototype.chain=h6,Z.prototype.commit=v6,Z.prototype.next=g6,Z.prototype.plant=x6,Z.prototype.reverse=b6,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=w6,Z.prototype.first=Z.prototype.head,is&&(Z.prototype[is]=y6),Z},yi=Xx();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Vt._=yi,define(function(){return yi})):hi?((hi.exports=yi)._=yi,Yf._=yi):Vt._=yi}).call(gu)});var Nm=vn((Wb,Yb)=>{(function(e,r){typeof Wb=="object"&&typeof Yb<"u"?Yb.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e["'typed'"]=r())})(Wb,function(){"use strict";function e(){return!0}function r(){return!1}function t(){}let n="Argument is not a typed-function.";function a(){function s(ee){return typeof ee=="object"&&ee!==null&&ee.constructor===Object}let l=[{name:"number",test:function(ee){return typeof ee=="number"}},{name:"string",test:function(ee){return typeof ee=="string"}},{name:"boolean",test:function(ee){return typeof ee=="boolean"}},{name:"Function",test:function(ee){return typeof ee=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(ee){return ee instanceof Date}},{name:"RegExp",test:function(ee){return ee instanceof RegExp}},{name:"Object",test:s},{name:"null",test:function(ee){return ee===null}},{name:"undefined",test:function(ee){return ee===void 0}}],c={name:"any",test:e,isAny:!0},o,u,m=0,d={createCount:0};function h(ee){let ce=o.get(ee);if(ce)return ce;let we='Unknown type "'+ee+'"',Be=ee.toLowerCase(),qe;for(qe of u)if(qe.toLowerCase()===Be){we+='. Did you mean "'+qe+'" ?';break}throw new TypeError(we)}function y(ee){let ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any",we=ce?h(ce).index:u.length,Be=[];for(let Te=0;Te{let Be=o.get(we);return!Be.isAny&&Be.test(ee)});return ce.length?ce:["any"]}function C(ee){return ee&&typeof ee=="function"&&"_typedFunctionData"in ee}function b(ee,ce,we){if(!C(ee))throw new TypeError(n);let Be=we&&we.exact,qe=Array.isArray(ce)?ce.join(","):ce,Te=T(qe),Re=S(Te);if(!Be||Re in ee.signatures){let ve=ee._typedFunctionData.signatureMap.get(Re);if(ve)return ve}let Ye=Te.length,B;if(Be){B=[];let ve;for(ve in ee.signatures)B.push(ee._typedFunctionData.signatureMap.get(ve))}else B=ee._typedFunctionData.signatures;for(let ve=0;ve!Pt.has(Xt.name)))continue}tr.push(cr)}}if(B=tr,B.length===0)break}let Q;for(Q of B)if(Q.params.length<=Ye)return Q;throw new TypeError("Signature not found (signature: "+(ee.name||"unnamed")+"("+S(Te,", ")+"))")}function N(ee,ce,we){return b(ee,ce,we).implementation}function M(ee,ce){let we=h(ce);if(we.test(ee))return ee;let Be=we.conversionsTo;if(Be.length===0)throw new Error("There are no conversions to "+ce+" defined.");for(let qe=0;qe1&&arguments[1]!==void 0?arguments[1]:",";return ee.map(we=>we.name).join(ce)}function O(ee){let ce=ee.indexOf("...")===0,Be=(ce?ee.length>3?ee.slice(3):"any":ee).split("|").map(Ye=>h(Ye.trim())),qe=!1,Te=ce?"...":"";return{types:Be.map(function(Ye){return qe=Ye.isAny||qe,Te+=Ye.name+"|",{name:Ye.name,typeIndex:Ye.index,test:Ye.test,isAny:Ye.isAny,conversion:null,conversionIndex:-1}}),name:Te.slice(0,-1),hasAny:qe,hasConversion:!1,restParam:ce}}function _(ee){let ce=ee.types.map(Re=>Re.name),we=$(ce),Be=ee.hasAny,qe=ee.name,Te=we.map(function(Re){let Ye=h(Re.from);return Be=Ye.isAny||Be,qe+="|"+Re.from,{name:Re.from,typeIndex:Ye.index,test:Ye.test,isAny:Ye.isAny,conversion:Re,conversionIndex:Re.index}});return{types:ee.types.concat(Te),name:qe,hasAny:Be,hasConversion:Te.length>0,restParam:ee.restParam}}function E(ee){return ee.typeSet||(ee.typeSet=new Set,ee.types.forEach(ce=>ee.typeSet.add(ce.name))),ee.typeSet}function T(ee){let ce=[];if(typeof ee!="string")throw new TypeError("Signatures must be strings");let we=ee.trim();if(we==="")return ce;let Be=we.split(",");for(let qe=0;qe=qe+1}}else return ee.length===0?function(Te){return Te.length===0}:ee.length===1?(we=L(ee[0]),function(Te){return we(Te[0])&&Te.length===1}):ee.length===2?(we=L(ee[0]),Be=L(ee[1]),function(Te){return we(Te[0])&&Be(Te[1])&&Te.length===2}):(ce=ee.map(L),function(Te){for(let Re=0;Re{let qe=W(Be.params,ce),Te;for(Te of qe)we.add(Te)}),we.has("any")?["any"]:Array.from(we)}function K(ee,ce,we){let Be,qe,Te=ee||"unnamed",Re=we,Ye;for(Ye=0;Ye{let cr=V(tr.params,Ye),Xr=L(cr);(Ye0){let tr=w(ce[Ye]);return Be=new TypeError("Unexpected type of argument in function "+Te+" (expected: "+qe.join(" or ")+", actual: "+tr.join(" | ")+", index: "+Ye+")"),Be.data={category:"wrongType",fn:Te,index:Ye,actual:tr,expected:qe},Be}}else Re=Pe}let B=Re.map(function(Pe){return R(Pe.params)?1/0:Pe.params.length});if(ce.lengthQ)return Be=new TypeError("Too many arguments in function "+Te+" (expected: "+Q+", actual: "+ce.length+")"),Be.data={category:"tooManyArgs",fn:Te,index:ce.length,expectedLength:Q},Be;let ve=[];for(let Pe=0;Pe0)return 1;let Be=oe(ee)-oe(ce);return Be<0?-1:Be>0?1:0}function ae(ee,ce){let we=ee.params,Be=ce.params,qe=J(we),Te=J(Be),Re=R(we),Ye=R(Be);if(Re&&qe.hasAny){if(!Ye||!Te.hasAny)return 1}else if(Ye&&Te.hasAny)return-1;let B=0,Q=0,ve;for(ve of we)ve.hasAny&&++B,ve.hasConversion&&++Q;let Pe=0,tr=0;for(ve of Be)ve.hasAny&&++Pe,ve.hasConversion&&++tr;if(B!==Pe)return B-Pe;if(Re&&qe.hasConversion){if(!Ye||!Te.hasConversion)return 1}else if(Ye&&Te.hasConversion)return-1;if(Q!==tr)return Q-tr;if(Re){if(!Ye)return 1}else if(Ye)return-1;let cr=(we.length-Be.length)*(Re?-1:1);if(cr!==0)return cr;let Xr=[],Pt=0;for(let mi=0;mi1&&ce.sort((qe,Te)=>qe.index-Te.index);let we=ce[0].conversionsTo;if(ee.length===1)return we;we=we.concat([]);let Be=new Set(ee);for(let qe=1;qeqe.hasConversion)){let qe=R(ee),Te=ee.map(Ee);we=function(){let Ye=[],B=qe?arguments.length-1:arguments.length;for(let Q=0;QB.name).join("|"),hasAny:Ye.some(B=>B.isAny),hasConversion:!1,restParam:!0}),Re.push(Te)}else Re=Te.types.map(function(Ye){return{types:[Ye],name:Ye.name,hasAny:Ye.isAny,hasConversion:Ye.conversion,restParam:!1}});return j(Re,function(Ye){return ce(we,Be+1,qe.concat([Ye]))})}else return[qe]}return ce(ee,0,[])}function ge(ee,ce){let we=Math.max(ee.length,ce.length);for(let Ye=0;Ye=Be:Re?Be>=qe:Be===qe}function Se(ee){return ee.map(ce=>Le(ce)?Me(ce.referToSelf.callback):Ce(ce)?ue(ce.referTo.references,ce.referTo.callback):ce)}function ye(ee,ce,we){let Be=[],qe;for(qe of ee){let Te=we[qe];if(typeof Te!="number")throw new TypeError('No definition for referenced signature "'+qe+'"');if(Te=ce[Te],typeof Te!="function")return!1;Be.push(Te)}return Be}function be(ee,ce,we){let Be=Se(ee),qe=new Array(Be.length).fill(!1),Te=!0;for(;Te;){Te=!1;let Re=!0;for(let Ye=0;Ye{let Be=ee[we];if(ce.test(Be.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(ee,ce){if(d.createCount++,Object.keys(ce).length===0)throw new SyntaxError("No signatures provided");d.warnAgainstDeprecatedThis&&De(ce);let we=[],Be=[],qe={},Te=[],Re;for(Re in ce){if(!Object.prototype.hasOwnProperty.call(ce,Re))continue;let et=T(Re);if(!et)continue;we.forEach(function(Ga){if(ge(Ga,et))throw new TypeError('Conflicting signatures "'+S(Ga)+'" and "'+S(et)+'".')}),we.push(et);let on=Be.length;Be.push(ce[Re]);let If=et.map(_),pi;for(pi of pe(If)){let Ga=S(pi);Te.push({params:pi,name:Ga,fn:on}),pi.every(Ws=>!Ws.hasConversion)&&(qe[Ga]=on)}}Te.sort(ae);let Ye=be(Be,qe,Ri),B;for(B in qe)Object.prototype.hasOwnProperty.call(qe,B)&&(qe[B]=Ye[qe[B]]);let Q=[],ve=new Map;for(B of Te)ve.has(B.name)||(B.fn=Ye[B.fn],Q.push(B),ve.set(B.name,B));let Pe=Q[0]&&Q[0].params.length<=2&&!R(Q[0].params),tr=Q[1]&&Q[1].params.length<=2&&!R(Q[1].params),cr=Q[2]&&Q[2].params.length<=2&&!R(Q[2].params),Xr=Q[3]&&Q[3].params.length<=2&&!R(Q[3].params),Pt=Q[4]&&Q[4].params.length<=2&&!R(Q[4].params),Xt=Q[5]&&Q[5].params.length<=2&&!R(Q[5].params),mi=Pe&&tr&&cr&&Xr&&Pt&&Xt;for(let et=0;etet.test),zs=Q.map(et=>et.implementation),Us=function(){for(let on=Pf;onS(T(we))),ce=J(arguments);if(typeof ce!="function")throw new TypeError("Callback function expected as last argument");return ue(ee,ce)}function ue(ee,ce){return{referTo:{references:ee,callback:ce}}}function Me(ee){if(typeof ee!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:ee}}}function Ce(ee){return ee&&typeof ee.referTo=="object"&&Array.isArray(ee.referTo.references)&&typeof ee.referTo.callback=="function"}function Le(ee){return ee&&typeof ee.referToSelf=="object"&&typeof ee.referToSelf.callback=="function"}function Ie(ee,ce){if(!ee)return ce;if(ce&&ce!==ee){let we=new Error("Function names do not match (expected: "+ee+", actual: "+ce+")");throw we.data={actual:ce,expected:ee},we}return ee}function fr(ee){let ce;for(let we in ee)Object.prototype.hasOwnProperty.call(ee,we)&&(C(ee[we])||typeof ee[we].signature=="string")&&(ce=Ie(ce,ee[we].name));return ce}function or(ee,ce){let we;for(we in ce)if(Object.prototype.hasOwnProperty.call(ce,we)){if(we in ee&&ce[we]!==ee[we]){let Be=new Error('Signature "'+we+'" is defined twice');throw Be.data={signature:we,sourceFunction:ce[we],destFunction:ee[we]},Be}ee[we]=ce[we]}}let Ke=d;d=function(ee){let ce=typeof ee=="string",we=ce?1:0,Be=ce?ee:"",qe={};for(let Te=we;Teqe.from===ee.from);if(!we)throw new Error("Attempt to remove nonexistent conversion from "+ee.from+" to "+ee.to);if(we.convert!==ee.convert)throw new Error("Conversion to remove does not match existing conversion");let Be=ce.conversionsTo.indexOf(we);ce.conversionsTo.splice(Be,1)},d.resolve=function(ee,ce){if(!C(ee))throw new TypeError(n);let we=ee._typedFunctionData.signatures;for(let Be=0;Be{(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 m=o*o;return m*(m*(m*(m*(m*(m*(m*(m/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},a=function(o,u){var m=Math.abs(o),d=Math.abs(u);return m<3e3&&d<3e3?Math.sqrt(m*m+d*d):(m0&&i();break;case"number":m.im=0,m.re=o;break;default:i()}return isNaN(m.re)||isNaN(m.im),m};function c(o,u){if(!(this instanceof c))return new c(o,u);var m=l(o,u);this.re=m.re,this.im=m.im}c.prototype={re:0,im:0,sign:function(){var o=this.abs();return new c(this.re/o,this.im/o)},add:function(o,u){var m=new c(o,u);return this.isInfinite()&&m.isInfinite()?c.NAN:this.isInfinite()||m.isInfinite()?c.INFINITY:new c(this.re+m.re,this.im+m.im)},sub:function(o,u){var m=new c(o,u);return this.isInfinite()&&m.isInfinite()?c.NAN:this.isInfinite()||m.isInfinite()?c.INFINITY:new c(this.re-m.re,this.im-m.im)},mul:function(o,u){var m=new c(o,u);return this.isInfinite()&&m.isZero()||this.isZero()&&m.isInfinite()?c.NAN:this.isInfinite()||m.isInfinite()?c.INFINITY:m.im===0&&this.im===0?new c(this.re*m.re,0):new c(this.re*m.re-this.im*m.im,this.re*m.im+this.im*m.re)},div:function(o,u){var m=new c(o,u);if(this.isZero()&&m.isZero()||this.isInfinite()&&m.isInfinite())return c.NAN;if(this.isInfinite()||m.isZero())return c.INFINITY;if(this.isZero()||m.isInfinite())return c.ZERO;o=this.re,u=this.im;var d=m.re,h=m.im,y,v;return h===0?new c(o/d,u/d):Math.abs(d)0)return new c(Math.pow(o,m.re),0);if(o===0)switch((m.re%4+4)%4){case 0:return new c(Math.pow(u,m.re),0);case 1:return new c(0,Math.pow(u,m.re));case 2:return new c(-Math.pow(u,m.re),0);case 3:return new c(0,-Math.pow(u,m.re))}}if(o===0&&u===0&&m.re>0&&m.im>=0)return c.ZERO;var d=Math.atan2(u,o),h=s(o,u);return o=Math.exp(m.re*h-m.im*d),u=m.im*h+m.re*d,new c(o*Math.cos(u),o*Math.sin(u))},sqrt:function(){var o=this.re,u=this.im,m=this.abs(),d,h;if(o>=0){if(u===0)return new c(Math.sqrt(o),0);d=.5*Math.sqrt(2*(m+o))}else d=Math.abs(u)/Math.sqrt(2*(m-o));return o<=0?h=.5*Math.sqrt(2*(m-o)):h=Math.abs(u)/Math.sqrt(2*(m+o)),new c(d,u<0?-h:h)},exp:function(){var o=Math.exp(this.re);return this.im,new c(o*Math.cos(this.im),o*Math.sin(this.im))},expm1:function(){var o=this.re,u=this.im;return new c(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 c(s(o,u),Math.atan2(u,o))},abs:function(){return a(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var o=this.re,u=this.im;return new c(Math.sin(o)*r(u),Math.cos(o)*t(u))},cos:function(){var o=this.re,u=this.im;return new c(Math.cos(o)*r(u),-Math.sin(o)*t(u))},tan:function(){var o=2*this.re,u=2*this.im,m=Math.cos(o)+r(u);return new c(Math.sin(o)/m,t(u)/m)},cot:function(){var o=2*this.re,u=2*this.im,m=Math.cos(o)-r(u);return new c(-Math.sin(o)/m,t(u)/m)},sec:function(){var o=this.re,u=this.im,m=.5*r(2*u)+.5*Math.cos(2*o);return new c(Math.cos(o)*r(u)/m,Math.sin(o)*t(u)/m)},csc:function(){var o=this.re,u=this.im,m=.5*r(2*u)-.5*Math.cos(2*o);return new c(Math.sin(o)*r(u)/m,-Math.cos(o)*t(u)/m)},asin:function(){var o=this.re,u=this.im,m=new c(u*u-o*o+1,-2*o*u).sqrt(),d=new c(m.re-u,m.im+o).log();return new c(d.im,-d.re)},acos:function(){var o=this.re,u=this.im,m=new c(u*u-o*o+1,-2*o*u).sqrt(),d=new c(m.re-u,m.im+o).log();return new c(Math.PI/2-d.im,d.re)},atan:function(){var o=this.re,u=this.im;if(o===0){if(u===1)return new c(0,1/0);if(u===-1)return new c(0,-1/0)}var m=o*o+(1-u)*(1-u),d=new c((1-u*u-o*o)/m,-2*o/m).log();return new c(-.5*d.im,.5*d.re)},acot:function(){var o=this.re,u=this.im;if(u===0)return new c(Math.atan2(1,o),0);var m=o*o+u*u;return m!==0?new c(o/m,-u/m).atan():new c(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 c(0,1/0);var m=o*o+u*u;return m!==0?new c(o/m,-u/m).acos():new c(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 c(Math.PI/2,1/0);var m=o*o+u*u;return m!==0?new c(o/m,-u/m).asin():new c(o!==0?o/0:0,u!==0?-u/0:0).asin()},sinh:function(){var o=this.re,u=this.im;return new c(t(o)*Math.cos(u),r(o)*Math.sin(u))},cosh:function(){var o=this.re,u=this.im;return new c(r(o)*Math.cos(u),t(o)*Math.sin(u))},tanh:function(){var o=2*this.re,u=2*this.im,m=r(o)+Math.cos(u);return new c(t(o)/m,Math.sin(u)/m)},coth:function(){var o=2*this.re,u=2*this.im,m=r(o)-Math.cos(u);return new c(t(o)/m,-Math.sin(u)/m)},csch:function(){var o=this.re,u=this.im,m=Math.cos(2*u)-r(2*o);return new c(-2*t(o)*Math.cos(u)/m,2*r(o)*Math.sin(u)/m)},sech:function(){var o=this.re,u=this.im,m=Math.cos(2*u)+r(2*o);return new c(2*r(o)*Math.cos(u)/m,-2*t(o)*Math.sin(u)/m)},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,m=o>1&&u===0,d=1-o,h=1+o,y=d*d+u*u,v=y!==0?new c((h*d-u*u)/y,(u*d+h*u)/y):new c(o!==-1?o/0:0,u!==0?u/0:0),x=v.re;return v.re=s(v.re,v.im)/2,v.im=Math.atan2(v.im,x)/2,m&&(v.im=-v.im),v},acoth:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new c(0,Math.PI/2);var m=o*o+u*u;return m!==0?new c(o/m,-u/m).atanh():new c(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 c(o!==0?Math.log(o+Math.sqrt(o*o+1)):1/0,0);var m=o*o+u*u;return m!==0?new c(o/m,-u/m).asinh():new c(o!==0?o/0:0,u!==0?-u/0:0).asinh()},asech:function(){var o=this.re,u=this.im;if(this.isZero())return c.INFINITY;var m=o*o+u*u;return m!==0?new c(o/m,-u/m).acosh():new c(o!==0?o/0:0,u!==0?-u/0:0).acosh()},inverse:function(){if(this.isZero())return c.INFINITY;if(this.isInfinite())return c.ZERO;var o=this.re,u=this.im,m=o*o+u*u;return new c(o/m,-u/m)},conjugate:function(){return new c(this.re,-this.im)},neg:function(){return new c(-this.re,-this.im)},ceil:function(o){return o=Math.pow(10,o||0),new c(Math.ceil(this.re*o)/o,Math.ceil(this.im*o)/o)},floor:function(o){return o=Math.pow(10,o||0),new c(Math.floor(this.re*o)/o,Math.floor(this.im*o)/o)},round:function(o){return o=Math.pow(10,o||0),new c(Math.round(this.re*o)/o,Math.round(this.im*o)/o)},equals:function(o,u){var m=new c(o,u);return Math.abs(m.re-this.re)<=c.EPSILON&&Math.abs(m.im-this.im)<=c.EPSILON},clone:function(){return new c(this.re,this.im)},toString:function(){var o=this.re,u=this.im,m="";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,x){if(isNaN(v=parseInt(v,10)))throw h();return v*x}function a(v,x){if(x===0)throw d();var w=Object.create(m.prototype);w.s=v<0?-1:1,v=v<0?-v:v;var C=u(v,x);return w.n=v/C,w.d=x/C,w}function i(v){for(var x={},w=v,C=2,b=4;b<=w;){for(;w%C===0;)w/=C,x[C]=(x[C]||0)+1;b+=1+2*C++}return w!==v?w>1&&(x[w]=(x[w]||0)+1):x[v]=(x[v]||0)+1,x}var s=function(v,x){var w=0,C=1,b=1,N=0,M=0,S=0,O=1,_=1,E=0,T=1,R=1,L=1,H=1e7,V;if(v!=null)if(x!==void 0){if(w=v,C=x,b=w*C,w%1!==0||C%1!==0)throw y()}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&&(_=Math.pow(10,Math.floor(1+Math.log(v)/Math.LN10)),v/=_);T<=H&&L<=H;)if(V=(E+R)/(T+L),v===V){T+L<=H?(w=E+R,C=T+L):L>T?(w=R,C=L):(w=E,C=T);break}else v>V?(E+=R,T+=L):(R+=E,L+=T),T>H?(w=R,C=L):(w=E,C=T);w*=_}else(isNaN(v)||isNaN(x))&&(C=w=NaN);break}case"string":{if(T=v.match(/\\d+|./g),T===null)throw h();if(T[E]==="-"?(b=-1,E++):T[E]==="+"&&E++,T.length===E+1?M=n(T[E++],b):T[E+1]==="."||T[E]==="."?(T[E]!=="."&&(N=n(T[E++],b)),E++,(E+1===T.length||T[E+1]==="("&&T[E+3]===")"||T[E+1]==="'"&&T[E+3]==="'")&&(M=n(T[E],b),O=Math.pow(10,T[E].length),E++),(T[E]==="("&&T[E+2]===")"||T[E]==="'"&&T[E+2]==="'")&&(S=n(T[E+1],b),_=Math.pow(10,T[E+1].length)-1,E+=3)):T[E+1]==="/"||T[E+1]===":"?(M=n(T[E],b),O=n(T[E+2],1),E+=3):T[E+3]==="/"&&T[E+1]===" "&&(N=n(T[E],b),M=n(T[E+2],b),O=n(T[E+4],1),E+=5),T.length<=E){C=O*_,b=w=S+C*N+_*M;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 l(v,x,w){for(var C=1;x>0;v=v*v%w,x>>=1)x&1&&(C=C*v%w);return C}function c(v,x){for(;x%2===0;x/=2);for(;x%5===0;x/=5);if(x===1)return 0;for(var w=10%x,C=1;w!==1;C++)if(w=w*10%x,C>r)return 0;return C}function o(v,x,w){for(var C=1,b=l(10,w,x),N=0;N<300;N++){if(C===b)return N;C=C*10%x,b=b*10%x}return 0}function u(v,x){if(!v)return x;if(!x)return v;for(;;){if(v%=x,!v)return x;if(x%=v,!x)return v}}function m(v,x){if(s(v,x),this instanceof m)v=u(t.d,t.n),this.s=t.s,this.n=t.n/v,this.d=t.d/v;else return a(t.s*t.n,t.d)}var d=function(){return new Error("Division by Zero")},h=function(){return new Error("Invalid argument")},y=function(){return new Error("Parameters must be integer")};m.prototype={s:1,n:0,d:1,abs:function(){return a(this.n,this.d)},neg:function(){return a(-this.s*this.n,this.d)},add:function(v,x){return s(v,x),a(this.s*this.n*t.d+t.s*this.d*t.n,this.d*t.d)},sub:function(v,x){return s(v,x),a(this.s*this.n*t.d-t.s*this.d*t.n,this.d*t.d)},mul:function(v,x){return s(v,x),a(this.s*t.s*this.n*t.n,this.d*t.d)},div:function(v,x){return s(v,x),a(this.s*t.s*this.n*t.d,this.d*t.n)},clone:function(){return a(this.s*this.n,this.d)},mod:function(v,x){if(isNaN(this.n)||isNaN(this.d))return new m(NaN);if(v===void 0)return a(this.s*this.n%this.d,1);if(s(v,x),t.n===0&&this.d===0)throw d();return a(this.s*(t.d*this.n)%(t.n*this.d),t.d*this.d)},gcd:function(v,x){return s(v,x),a(u(t.n,this.n)*u(t.d,this.d),t.d*this.d)},lcm:function(v,x){return s(v,x),t.n===0&&this.n===0?a(0,1):a(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 m(NaN):a(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 m(NaN):a(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 m(NaN):a(Math.round(v*this.s*this.n/this.d),v)},inverse:function(){return a(this.s*this.d,this.n)},pow:function(v,x){if(s(v,x),t.d===1)return t.s<0?a(Math.pow(this.s*this.d,t.n),Math.pow(this.n,t.n)):a(Math.pow(this.s*this.n,t.n),Math.pow(this.d,t.n));if(this.s<0)return null;var w=i(this.n),C=i(this.d),b=1,N=1;for(var M in w)if(M!=="1"){if(M==="0"){b=0;break}if(w[M]*=t.n,w[M]%t.d===0)w[M]/=t.d;else return null;b*=Math.pow(M,w[M])}for(var M in C)if(M!=="1"){if(C[M]*=t.n,C[M]%t.d===0)C[M]/=t.d;else return null;N*=Math.pow(M,C[M])}return t.s<0?a(N,b):a(b,N)},equals:function(v,x){return s(v,x),this.s*this.n*t.d===t.s*t.n*this.d},compare:function(v,x){s(v,x);var w=this.s*this.n*t.d-t.s*t.n*this.d;return(0=0;N--)b=b.inverse().add(w[N]);if(Math.abs(b.sub(x).valueOf())0&&(w+=x,w+=" ",C%=b),w+=C,w+="/",w+=b),w},toLatex:function(v){var x,w="",C=this.n,b=this.d;return this.s<0&&(w+="-"),b===1?w+=C:(v&&(x=Math.floor(C/b))>0&&(w+=x,C%=b),w+="\\\\frac{",w+=C,w+="}{",w+=b,w+="}"),w},toContinued:function(){var v,x=this.n,w=this.d,C=[];if(isNaN(x)||isNaN(w))return C;do C.push(Math.floor(x/w)),v=x%w,x=w,w=v;while(x!==1);return C},toString:function(v){var x=this.n,w=this.d;if(isNaN(x)||isNaN(w))return"NaN";v=v||15;var C=c(x,w),b=o(x,w,C),N=this.s<0?"-":"";if(N+=x/w|0,x%=w,x*=10,x&&(N+="."),C){for(var M=b;M--;)N+=x/w|0,x%=w,x*=10;N+="(";for(var M=C;M--;)N+=x/w|0,x%=w,x*=10;N+=")"}else for(var M=v;x&&M--;)N+=x/w|0,x%=w,x*=10;return N}},typeof mw=="object"?(Object.defineProperty(m,"__esModule",{value:!0}),m.default=m,m.Fraction=m,WM.exports=m):e.Fraction=m})(mw)});var aE=vn((Fce,nE)=>{nE.exports=function e(r,t){"use strict";var n=/(^([+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)?$|^0x[0-9a-f]+$|\\d+)/gi,a=/(^[ ]*|[ ]*$)/g,i=/(^([\\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/,c=function(b){return e.insensitive&&(""+b).toLowerCase()||""+b},o=c(r).replace(a,"")||"",u=c(t).replace(a,"")||"",m=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)||m.length!==1&&o.match(i)&&Date.parse(o),y=parseInt(u.match(s),16)||h&&u.match(i)&&Date.parse(u)||null,v,x;if(y){if(hy)return 1}for(var w=0,C=Math.max(m.length,d.length);wx)return 1}return 0}});var sT=vn((Vhe,oT)=>{"use strict";var gD=Object.assign||function(e){for(var r=1;r1&&arguments[1]!==void 0?arguments[1]:{},t=r.preserveFormatting,n=t===void 0?!1:t,a=r.escapeMapFn,i=a===void 0?q$:a,s=String(e),l="",c=i(gD({},I$),n?gD({},R$):{}),o=Object.keys(c),u=function(){var d=!1;o.forEach(function(h,y){d||s.length>=h.length&&s.slice(0,h.length)===h&&(l+=c[o[y]],s=s.slice(h.length,s.length),d=!0)}),d||(l+=s.slice(0,1),s=s.slice(1,s.length))};s;)u();return l}});var qB=vn((RB,AD)=>{(function(e,r,t){function n(l){var c=this,o=s();c.next=function(){var u=2091639*c.s0+c.c*23283064365386963e-26;return c.s0=c.s1,c.s1=c.s2,c.s2=u-(c.c=u|0)},c.c=1,c.s0=o(" "),c.s1=o(" "),c.s2=o(" "),c.s0-=o(l),c.s0<0&&(c.s0+=1),c.s1-=o(l),c.s1<0&&(c.s1+=1),c.s2-=o(l),c.s2<0&&(c.s2+=1),o=null}function a(l,c){return c.c=l.c,c.s0=l.s0,c.s1=l.s1,c.s2=l.s2,c}function i(l,c){var o=new n(l),u=c&&c.state,m=o.next;return m.int32=function(){return o.next()*4294967296|0},m.double=function(){return m()+(m()*2097152|0)*11102230246251565e-32},m.quick=m,u&&(typeof u=="object"&&a(u,o),m.state=function(){return a(o,{})}),m}function s(){var l=4022871197,c=function(o){o=String(o);for(var u=0;u>>0,m-=l,m*=l,l=m>>>0,m-=l,l+=m*4294967296}return(l>>>0)*23283064365386963e-26};return c}r&&r.exports?r.exports=i:t&&t.amd?t(function(){return i}):this.alea=i})(RB,typeof AD=="object"&&AD,typeof define=="function"&&define)});var LB=vn((kB,MD)=>{(function(e,r,t){function n(s){var l=this,c="";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:c+=s;for(var o=0;o>>0)/4294967296};return u.double=function(){do var m=c.next()>>>11,d=(c.next()>>>0)/4294967296,h=(m+d)/(1<<21);while(h===0);return h},u.int32=c.next,u.quick=u,o&&(typeof o=="object"&&a(o,c),u.state=function(){return a(c,{})}),u}r&&r.exports?r.exports=i:t&&t.amd?t(function(){return i}):this.xor128=i})(kB,typeof MD=="object"&&MD,typeof define=="function"&&define)});var UB=vn((zB,CD)=>{(function(e,r,t){function n(s){var l=this,c="";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:c+=s;for(var o=0;o>>4),l.next()}function a(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 i(s,l){var c=new n(s),o=l&&l.state,u=function(){return(c.next()>>>0)/4294967296};return u.double=function(){do var m=c.next()>>>11,d=(c.next()>>>0)/4294967296,h=(m+d)/(1<<21);while(h===0);return h},u.int32=c.next,u.quick=u,o&&(typeof o=="object"&&a(o,c),u.state=function(){return a(c,{})}),u}r&&r.exports?r.exports=i:t&&t.amd?t(function(){return i}):this.xorwow=i})(zB,typeof CD=="object"&&CD,typeof define=="function"&&define)});var YB=vn((WB,ED)=>{(function(e,r,t){function n(s){var l=this;l.next=function(){var o=l.x,u=l.i,m,d,h;return m=o[u],m^=m>>>7,d=m^m<<24,m=o[u+1&7],d^=m^m>>>10,m=o[u+3&7],d^=m^m>>>3,m=o[u+4&7],d^=m^m<<7,m=o[u+7&7],m=m^m<<13,d^=m^m<<9,o[u]=d,l.i=u+1&7,d};function c(o,u){var m,d,h=[];if(u===(u|0))d=h[0]=u;else for(u=""+u,m=0;m0;--m)o.next()}c(l,s)}function a(s,l){return l.x=s.x.slice(),l.i=s.i,l}function i(s,l){s==null&&(s=+new Date);var c=new n(s),o=l&&l.state,u=function(){return(c.next()>>>0)/4294967296};return u.double=function(){do var m=c.next()>>>11,d=(c.next()>>>0)/4294967296,h=(m+d)/(1<<21);while(h===0);return h},u.int32=c.next,u.quick=u,o&&(o.x&&a(o,c),u.state=function(){return a(c,{})}),u}r&&r.exports?r.exports=i:t&&t.amd?t(function(){return i}):this.xorshift7=i})(WB,typeof ED=="object"&&ED,typeof define=="function"&&define)});var $B=vn((HB,TD)=>{(function(e,r,t){function n(s){var l=this;l.next=function(){var o=l.w,u=l.X,m=l.i,d,h;return l.w=o=o+1640531527|0,h=u[m+34&127],d=u[m=m+1&127],h^=h<<13,d^=d<<17,h^=h>>>15,d^=d>>>12,h=u[m]=h^d,l.i=m,h+(o^o>>>16)|0};function c(o,u){var m,d,h,y,v,x=[],w=128;for(u===(u|0)?(d=u,u=null):(u=u+"\\0",d=0,w=Math.max(w,u.length)),h=0,y=-32;y>>15,d^=d<<4,d^=d>>>13,y>=0&&(v=v+1640531527|0,m=x[y&127]^=d+v,h=m==0?h+1:0);for(h>=128&&(x[(u&&u.length||0)&127]=-1),h=127,y=4*128;y>0;--y)d=x[h+34&127],m=x[h=h+1&127],d^=d<<13,m^=m<<17,d^=d>>>15,m^=m>>>12,x[h]=d^m;o.w=v,o.X=x,o.i=h}c(l,s)}function a(s,l){return l.i=s.i,l.w=s.w,l.X=s.X.slice(),l}function i(s,l){s==null&&(s=+new Date);var c=new n(s),o=l&&l.state,u=function(){return(c.next()>>>0)/4294967296};return u.double=function(){do var m=c.next()>>>11,d=(c.next()>>>0)/4294967296,h=(m+d)/(1<<21);while(h===0);return h},u.int32=c.next,u.quick=u,o&&(o.X&&a(o,c),u.state=function(){return a(c,{})}),u}r&&r.exports?r.exports=i:t&&t.amd?t(function(){return i}):this.xor4096=i})(HB,typeof TD=="object"&&TD,typeof define=="function"&&define)});var VB=vn((GB,FD)=>{(function(e,r,t){function n(s){var l=this,c="";l.next=function(){var u=l.b,m=l.c,d=l.d,h=l.a;return u=u<<25^u>>>7^m,m=m-d|0,d=d<<24^d>>>8^h,h=h-u|0,l.b=u=u<<20^u>>>12^m,l.c=m=m-d|0,l.d=d<<16^m>>>16^h,l.a=h-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):c+=s;for(var o=0;o>>0)/4294967296};return u.double=function(){do var m=c.next()>>>11,d=(c.next()>>>0)/4294967296,h=(m+d)/(1<<21);while(h===0);return h},u.int32=c.next,u.quick=u,o&&(typeof o=="object"&&a(o,c),u.state=function(){return a(c,{})}),u}r&&r.exports?r.exports=i:t&&t.amd?t(function(){return i}):this.tychei=i})(GB,typeof FD=="object"&&FD,typeof define=="function"&&define)});var ZB=vn(()=>{});var XB=vn((QB,zg)=>{(function(e,r,t){var n=256,a=6,i=52,s="random",l=t.pow(n,a),c=t.pow(2,i),o=c*2,u=n-1,m;function d(b,N,M){var S=[];N=N==!0?{entropy:!0}:N||{};var O=x(v(N.entropy?[b,C(r)]:b??w(),3),S),_=new h(S),E=function(){for(var T=_.g(a),R=l,L=0;T=o;)T/=2,R/=2,L>>>=1;return(T+L)/R};return E.int32=function(){return _.g(4)|0},E.quick=function(){return _.g(4)/4294967296},E.double=E,x(C(_.S),r),(N.pass||M||function(T,R,L,H){return H&&(H.S&&y(H,_),T.state=function(){return y(_,{})}),L?(t[s]=T,R):T})(E,O,"global"in N?N.global:this==t,N.state)}function h(b){var N,M=b.length,S=this,O=0,_=S.i=S.j=0,E=S.S=[];for(M||(b=[M++]);O{var eV=qB(),rV=LB(),tV=UB(),nV=YB(),aV=$B(),iV=VB(),Bs=XB();Bs.alea=eV;Bs.xor128=rV;Bs.xorwow=tV;Bs.xorshift7=nV;Bs.xor4096=aV;Bs.tychei=iV;JB.exports=Bs});var jR=vn((BIe,CS)=>{function MS(){}MS.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 a(){n.off(e,a),r.apply(t,arguments)}return a._=r,this.on(e,a,t)},emit:function(e){var r=[].slice.call(arguments,1),t=((this.e||(this.e={}))[e]||[]).slice(),n=0,a=t.length;for(n;n{(function(e,r){typeof ES=="object"&&typeof Nf<"u"?Nf.exports=r():typeof define=="function"&&define.amd?define(r):e.moment=r()})(ES,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 a(g){return g!=null&&Object.prototype.toString.call(g)==="[object Object]"}function i(g,A){return Object.prototype.hasOwnProperty.call(g,A)}function s(g){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(g).length===0;var A;for(A in g)if(i(g,A))return!1;return!0}function l(g){return g===void 0}function c(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,A){var I=[],U,G=g.length;for(U=0;U>>0,U;for(U=0;U0)for(I=0;I0&&i();break;case"number":m.im=0,m.re=o;break;default:i()}return isNaN(m.re)||isNaN(m.im),m};function c(o,u){if(!(this instanceof c))return new c(o,u);var m=l(o,u);this.re=m.re,this.im=m.im}c.prototype={re:0,im:0,sign:function(){var o=this.abs();return new c(this.re/o,this.im/o)},add:function(o,u){var m=new c(o,u);return this.isInfinite()&&m.isInfinite()?c.NAN:this.isInfinite()||m.isInfinite()?c.INFINITY:new c(this.re+m.re,this.im+m.im)},sub:function(o,u){var m=new c(o,u);return this.isInfinite()&&m.isInfinite()?c.NAN:this.isInfinite()||m.isInfinite()?c.INFINITY:new c(this.re-m.re,this.im-m.im)},mul:function(o,u){var m=new c(o,u);return this.isInfinite()&&m.isZero()||this.isZero()&&m.isInfinite()?c.NAN:this.isInfinite()||m.isInfinite()?c.INFINITY:m.im===0&&this.im===0?new c(this.re*m.re,0):new c(this.re*m.re-this.im*m.im,this.re*m.im+this.im*m.re)},div:function(o,u){var m=new c(o,u);if(this.isZero()&&m.isZero()||this.isInfinite()&&m.isInfinite())return c.NAN;if(this.isInfinite()||m.isZero())return c.INFINITY;if(this.isZero()||m.isInfinite())return c.ZERO;o=this.re,u=this.im;var d=m.re,h=m.im,y,v;return h===0?new c(o/d,u/d):Math.abs(d)0)return new c(Math.pow(o,m.re),0);if(o===0)switch((m.re%4+4)%4){case 0:return new c(Math.pow(u,m.re),0);case 1:return new c(0,Math.pow(u,m.re));case 2:return new c(-Math.pow(u,m.re),0);case 3:return new c(0,-Math.pow(u,m.re))}}if(o===0&&u===0&&m.re>0&&m.im>=0)return c.ZERO;var d=Math.atan2(u,o),h=s(o,u);return o=Math.exp(m.re*h-m.im*d),u=m.im*h+m.re*d,new c(o*Math.cos(u),o*Math.sin(u))},sqrt:function(){var o=this.re,u=this.im,m=this.abs(),d,h;if(o>=0){if(u===0)return new c(Math.sqrt(o),0);d=.5*Math.sqrt(2*(m+o))}else d=Math.abs(u)/Math.sqrt(2*(m-o));return o<=0?h=.5*Math.sqrt(2*(m-o)):h=Math.abs(u)/Math.sqrt(2*(m+o)),new c(d,u<0?-h:h)},exp:function(){var o=Math.exp(this.re);return this.im,new c(o*Math.cos(this.im),o*Math.sin(this.im))},expm1:function(){var o=this.re,u=this.im;return new c(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 c(s(o,u),Math.atan2(u,o))},abs:function(){return a(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var o=this.re,u=this.im;return new c(Math.sin(o)*r(u),Math.cos(o)*t(u))},cos:function(){var o=this.re,u=this.im;return new c(Math.cos(o)*r(u),-Math.sin(o)*t(u))},tan:function(){var o=2*this.re,u=2*this.im,m=Math.cos(o)+r(u);return new c(Math.sin(o)/m,t(u)/m)},cot:function(){var o=2*this.re,u=2*this.im,m=Math.cos(o)-r(u);return new c(-Math.sin(o)/m,t(u)/m)},sec:function(){var o=this.re,u=this.im,m=.5*r(2*u)+.5*Math.cos(2*o);return new c(Math.cos(o)*r(u)/m,Math.sin(o)*t(u)/m)},csc:function(){var o=this.re,u=this.im,m=.5*r(2*u)-.5*Math.cos(2*o);return new c(Math.sin(o)*r(u)/m,-Math.cos(o)*t(u)/m)},asin:function(){var o=this.re,u=this.im,m=new c(u*u-o*o+1,-2*o*u).sqrt(),d=new c(m.re-u,m.im+o).log();return new c(d.im,-d.re)},acos:function(){var o=this.re,u=this.im,m=new c(u*u-o*o+1,-2*o*u).sqrt(),d=new c(m.re-u,m.im+o).log();return new c(Math.PI/2-d.im,d.re)},atan:function(){var o=this.re,u=this.im;if(o===0){if(u===1)return new c(0,1/0);if(u===-1)return new c(0,-1/0)}var m=o*o+(1-u)*(1-u),d=new c((1-u*u-o*o)/m,-2*o/m).log();return new c(-.5*d.im,.5*d.re)},acot:function(){var o=this.re,u=this.im;if(u===0)return new c(Math.atan2(1,o),0);var m=o*o+u*u;return m!==0?new c(o/m,-u/m).atan():new c(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 c(0,1/0);var m=o*o+u*u;return m!==0?new c(o/m,-u/m).acos():new c(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 c(Math.PI/2,1/0);var m=o*o+u*u;return m!==0?new c(o/m,-u/m).asin():new c(o!==0?o/0:0,u!==0?-u/0:0).asin()},sinh:function(){var o=this.re,u=this.im;return new c(t(o)*Math.cos(u),r(o)*Math.sin(u))},cosh:function(){var o=this.re,u=this.im;return new c(r(o)*Math.cos(u),t(o)*Math.sin(u))},tanh:function(){var o=2*this.re,u=2*this.im,m=r(o)+Math.cos(u);return new c(t(o)/m,Math.sin(u)/m)},coth:function(){var o=2*this.re,u=2*this.im,m=r(o)-Math.cos(u);return new c(t(o)/m,-Math.sin(u)/m)},csch:function(){var o=this.re,u=this.im,m=Math.cos(2*u)-r(2*o);return new c(-2*t(o)*Math.cos(u)/m,2*r(o)*Math.sin(u)/m)},sech:function(){var o=this.re,u=this.im,m=Math.cos(2*u)+r(2*o);return new c(2*r(o)*Math.cos(u)/m,-2*t(o)*Math.sin(u)/m)},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,m=o>1&&u===0,d=1-o,h=1+o,y=d*d+u*u,v=y!==0?new c((h*d-u*u)/y,(u*d+h*u)/y):new c(o!==-1?o/0:0,u!==0?u/0:0),x=v.re;return v.re=s(v.re,v.im)/2,v.im=Math.atan2(v.im,x)/2,m&&(v.im=-v.im),v},acoth:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new c(0,Math.PI/2);var m=o*o+u*u;return m!==0?new c(o/m,-u/m).atanh():new c(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 c(o!==0?Math.log(o+Math.sqrt(o*o+1)):1/0,0);var m=o*o+u*u;return m!==0?new c(o/m,-u/m).asinh():new c(o!==0?o/0:0,u!==0?-u/0:0).asinh()},asech:function(){var o=this.re,u=this.im;if(this.isZero())return c.INFINITY;var m=o*o+u*u;return m!==0?new c(o/m,-u/m).acosh():new c(o!==0?o/0:0,u!==0?-u/0:0).acosh()},inverse:function(){if(this.isZero())return c.INFINITY;if(this.isInfinite())return c.ZERO;var o=this.re,u=this.im,m=o*o+u*u;return new c(o/m,-u/m)},conjugate:function(){return new c(this.re,-this.im)},neg:function(){return new c(-this.re,-this.im)},ceil:function(o){return o=Math.pow(10,o||0),new c(Math.ceil(this.re*o)/o,Math.ceil(this.im*o)/o)},floor:function(o){return o=Math.pow(10,o||0),new c(Math.floor(this.re*o)/o,Math.floor(this.im*o)/o)},round:function(o){return o=Math.pow(10,o||0),new c(Math.round(this.re*o)/o,Math.round(this.im*o)/o)},equals:function(o,u){var m=new c(o,u);return Math.abs(m.re-this.re)<=c.EPSILON&&Math.abs(m.im-this.im)<=c.EPSILON},clone:function(){return new c(this.re,this.im)},toString:function(){var o=this.re,u=this.im,m="";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,x){if(isNaN(v=parseInt(v,10)))throw h();return v*x}function a(v,x){if(x===0)throw d();var w=Object.create(m.prototype);w.s=v<0?-1:1,v=v<0?-v:v;var C=u(v,x);return w.n=v/C,w.d=x/C,w}function i(v){for(var x={},w=v,C=2,b=4;b<=w;){for(;w%C===0;)w/=C,x[C]=(x[C]||0)+1;b+=1+2*C++}return w!==v?w>1&&(x[w]=(x[w]||0)+1):x[v]=(x[v]||0)+1,x}var s=function(v,x){var w=0,C=1,b=1,N=0,M=0,S=0,O=1,_=1,E=0,T=1,R=1,L=1,H=1e7,V;if(v!=null)if(x!==void 0){if(w=v,C=x,b=w*C,w%1!==0||C%1!==0)throw y()}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&&(_=Math.pow(10,Math.floor(1+Math.log(v)/Math.LN10)),v/=_);T<=H&&L<=H;)if(V=(E+R)/(T+L),v===V){T+L<=H?(w=E+R,C=T+L):L>T?(w=R,C=L):(w=E,C=T);break}else v>V?(E+=R,T+=L):(R+=E,L+=T),T>H?(w=R,C=L):(w=E,C=T);w*=_}else(isNaN(v)||isNaN(x))&&(C=w=NaN);break}case"string":{if(T=v.match(/\\d+|./g),T===null)throw h();if(T[E]==="-"?(b=-1,E++):T[E]==="+"&&E++,T.length===E+1?M=n(T[E++],b):T[E+1]==="."||T[E]==="."?(T[E]!=="."&&(N=n(T[E++],b)),E++,(E+1===T.length||T[E+1]==="("&&T[E+3]===")"||T[E+1]==="'"&&T[E+3]==="'")&&(M=n(T[E],b),O=Math.pow(10,T[E].length),E++),(T[E]==="("&&T[E+2]===")"||T[E]==="'"&&T[E+2]==="'")&&(S=n(T[E+1],b),_=Math.pow(10,T[E+1].length)-1,E+=3)):T[E+1]==="/"||T[E+1]===":"?(M=n(T[E],b),O=n(T[E+2],1),E+=3):T[E+3]==="/"&&T[E+1]===" "&&(N=n(T[E],b),M=n(T[E+2],b),O=n(T[E+4],1),E+=5),T.length<=E){C=O*_,b=w=S+C*N+_*M;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 l(v,x,w){for(var C=1;x>0;v=v*v%w,x>>=1)x&1&&(C=C*v%w);return C}function c(v,x){for(;x%2===0;x/=2);for(;x%5===0;x/=5);if(x===1)return 0;for(var w=10%x,C=1;w!==1;C++)if(w=w*10%x,C>r)return 0;return C}function o(v,x,w){for(var C=1,b=l(10,w,x),N=0;N<300;N++){if(C===b)return N;C=C*10%x,b=b*10%x}return 0}function u(v,x){if(!v)return x;if(!x)return v;for(;;){if(v%=x,!v)return x;if(x%=v,!x)return v}}function m(v,x){if(s(v,x),this instanceof m)v=u(t.d,t.n),this.s=t.s,this.n=t.n/v,this.d=t.d/v;else return a(t.s*t.n,t.d)}var d=function(){return new Error("Division by Zero")},h=function(){return new Error("Invalid argument")},y=function(){return new Error("Parameters must be integer")};m.prototype={s:1,n:0,d:1,abs:function(){return a(this.n,this.d)},neg:function(){return a(-this.s*this.n,this.d)},add:function(v,x){return s(v,x),a(this.s*this.n*t.d+t.s*this.d*t.n,this.d*t.d)},sub:function(v,x){return s(v,x),a(this.s*this.n*t.d-t.s*this.d*t.n,this.d*t.d)},mul:function(v,x){return s(v,x),a(this.s*t.s*this.n*t.n,this.d*t.d)},div:function(v,x){return s(v,x),a(this.s*t.s*this.n*t.d,this.d*t.n)},clone:function(){return a(this.s*this.n,this.d)},mod:function(v,x){if(isNaN(this.n)||isNaN(this.d))return new m(NaN);if(v===void 0)return a(this.s*this.n%this.d,1);if(s(v,x),t.n===0&&this.d===0)throw d();return a(this.s*(t.d*this.n)%(t.n*this.d),t.d*this.d)},gcd:function(v,x){return s(v,x),a(u(t.n,this.n)*u(t.d,this.d),t.d*this.d)},lcm:function(v,x){return s(v,x),t.n===0&&this.n===0?a(0,1):a(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 m(NaN):a(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 m(NaN):a(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 m(NaN):a(Math.round(v*this.s*this.n/this.d),v)},inverse:function(){return a(this.s*this.d,this.n)},pow:function(v,x){if(s(v,x),t.d===1)return t.s<0?a(Math.pow(this.s*this.d,t.n),Math.pow(this.n,t.n)):a(Math.pow(this.s*this.n,t.n),Math.pow(this.d,t.n));if(this.s<0)return null;var w=i(this.n),C=i(this.d),b=1,N=1;for(var M in w)if(M!=="1"){if(M==="0"){b=0;break}if(w[M]*=t.n,w[M]%t.d===0)w[M]/=t.d;else return null;b*=Math.pow(M,w[M])}for(var M in C)if(M!=="1"){if(C[M]*=t.n,C[M]%t.d===0)C[M]/=t.d;else return null;N*=Math.pow(M,C[M])}return t.s<0?a(N,b):a(b,N)},equals:function(v,x){return s(v,x),this.s*this.n*t.d===t.s*t.n*this.d},compare:function(v,x){s(v,x);var w=this.s*this.n*t.d-t.s*t.n*this.d;return(0=0;N--)b=b.inverse().add(w[N]);if(Math.abs(b.sub(x).valueOf())0&&(w+=x,w+=" ",C%=b),w+=C,w+="/",w+=b),w},toLatex:function(v){var x,w="",C=this.n,b=this.d;return this.s<0&&(w+="-"),b===1?w+=C:(v&&(x=Math.floor(C/b))>0&&(w+=x,C%=b),w+="\\\\frac{",w+=C,w+="}{",w+=b,w+="}"),w},toContinued:function(){var v,x=this.n,w=this.d,C=[];if(isNaN(x)||isNaN(w))return C;do C.push(Math.floor(x/w)),v=x%w,x=w,w=v;while(x!==1);return C},toString:function(v){var x=this.n,w=this.d;if(isNaN(x)||isNaN(w))return"NaN";v=v||15;var C=c(x,w),b=o(x,w,C),N=this.s<0?"-":"";if(N+=x/w|0,x%=w,x*=10,x&&(N+="."),C){for(var M=b;M--;)N+=x/w|0,x%=w,x*=10;N+="(";for(var M=C;M--;)N+=x/w|0,x%=w,x*=10;N+=")"}else for(var M=v;x&&M--;)N+=x/w|0,x%=w,x*=10;return N}},typeof mw=="object"?(Object.defineProperty(m,"__esModule",{value:!0}),m.default=m,m.Fraction=m,WM.exports=m):e.Fraction=m})(mw)});var aE=vn((_ce,nE)=>{nE.exports=function e(r,t){"use strict";var n=/(^([+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)?$|^0x[0-9a-f]+$|\\d+)/gi,a=/(^[ ]*|[ ]*$)/g,i=/(^([\\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/,c=function(b){return e.insensitive&&(""+b).toLowerCase()||""+b},o=c(r).replace(a,"")||"",u=c(t).replace(a,"")||"",m=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)||m.length!==1&&o.match(i)&&Date.parse(o),y=parseInt(u.match(s),16)||h&&u.match(i)&&Date.parse(u)||null,v,x;if(y){if(hy)return 1}for(var w=0,C=Math.max(m.length,d.length);wx)return 1}return 0}});var sT=vn((Zhe,oT)=>{"use strict";var gD=Object.assign||function(e){for(var r=1;r1&&arguments[1]!==void 0?arguments[1]:{},t=r.preserveFormatting,n=t===void 0?!1:t,a=r.escapeMapFn,i=a===void 0?q$:a,s=String(e),l="",c=i(gD({},I$),n?gD({},R$):{}),o=Object.keys(c),u=function(){var d=!1;o.forEach(function(h,y){d||s.length>=h.length&&s.slice(0,h.length)===h&&(l+=c[o[y]],s=s.slice(h.length,s.length),d=!0)}),d||(l+=s.slice(0,1),s=s.slice(1,s.length))};s;)u();return l}});var qB=vn((RB,AD)=>{(function(e,r,t){function n(l){var c=this,o=s();c.next=function(){var u=2091639*c.s0+c.c*23283064365386963e-26;return c.s0=c.s1,c.s1=c.s2,c.s2=u-(c.c=u|0)},c.c=1,c.s0=o(" "),c.s1=o(" "),c.s2=o(" "),c.s0-=o(l),c.s0<0&&(c.s0+=1),c.s1-=o(l),c.s1<0&&(c.s1+=1),c.s2-=o(l),c.s2<0&&(c.s2+=1),o=null}function a(l,c){return c.c=l.c,c.s0=l.s0,c.s1=l.s1,c.s2=l.s2,c}function i(l,c){var o=new n(l),u=c&&c.state,m=o.next;return m.int32=function(){return o.next()*4294967296|0},m.double=function(){return m()+(m()*2097152|0)*11102230246251565e-32},m.quick=m,u&&(typeof u=="object"&&a(u,o),m.state=function(){return a(o,{})}),m}function s(){var l=4022871197,c=function(o){o=String(o);for(var u=0;u>>0,m-=l,m*=l,l=m>>>0,m-=l,l+=m*4294967296}return(l>>>0)*23283064365386963e-26};return c}r&&r.exports?r.exports=i:t&&t.amd?t(function(){return i}):this.alea=i})(RB,typeof AD=="object"&&AD,typeof define=="function"&&define)});var LB=vn((kB,MD)=>{(function(e,r,t){function n(s){var l=this,c="";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:c+=s;for(var o=0;o>>0)/4294967296};return u.double=function(){do var m=c.next()>>>11,d=(c.next()>>>0)/4294967296,h=(m+d)/(1<<21);while(h===0);return h},u.int32=c.next,u.quick=u,o&&(typeof o=="object"&&a(o,c),u.state=function(){return a(c,{})}),u}r&&r.exports?r.exports=i:t&&t.amd?t(function(){return i}):this.xor128=i})(kB,typeof MD=="object"&&MD,typeof define=="function"&&define)});var UB=vn((zB,CD)=>{(function(e,r,t){function n(s){var l=this,c="";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:c+=s;for(var o=0;o>>4),l.next()}function a(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 i(s,l){var c=new n(s),o=l&&l.state,u=function(){return(c.next()>>>0)/4294967296};return u.double=function(){do var m=c.next()>>>11,d=(c.next()>>>0)/4294967296,h=(m+d)/(1<<21);while(h===0);return h},u.int32=c.next,u.quick=u,o&&(typeof o=="object"&&a(o,c),u.state=function(){return a(c,{})}),u}r&&r.exports?r.exports=i:t&&t.amd?t(function(){return i}):this.xorwow=i})(zB,typeof CD=="object"&&CD,typeof define=="function"&&define)});var YB=vn((WB,ED)=>{(function(e,r,t){function n(s){var l=this;l.next=function(){var o=l.x,u=l.i,m,d,h;return m=o[u],m^=m>>>7,d=m^m<<24,m=o[u+1&7],d^=m^m>>>10,m=o[u+3&7],d^=m^m>>>3,m=o[u+4&7],d^=m^m<<7,m=o[u+7&7],m=m^m<<13,d^=m^m<<9,o[u]=d,l.i=u+1&7,d};function c(o,u){var m,d,h=[];if(u===(u|0))d=h[0]=u;else for(u=""+u,m=0;m0;--m)o.next()}c(l,s)}function a(s,l){return l.x=s.x.slice(),l.i=s.i,l}function i(s,l){s==null&&(s=+new Date);var c=new n(s),o=l&&l.state,u=function(){return(c.next()>>>0)/4294967296};return u.double=function(){do var m=c.next()>>>11,d=(c.next()>>>0)/4294967296,h=(m+d)/(1<<21);while(h===0);return h},u.int32=c.next,u.quick=u,o&&(o.x&&a(o,c),u.state=function(){return a(c,{})}),u}r&&r.exports?r.exports=i:t&&t.amd?t(function(){return i}):this.xorshift7=i})(WB,typeof ED=="object"&&ED,typeof define=="function"&&define)});var $B=vn((HB,TD)=>{(function(e,r,t){function n(s){var l=this;l.next=function(){var o=l.w,u=l.X,m=l.i,d,h;return l.w=o=o+1640531527|0,h=u[m+34&127],d=u[m=m+1&127],h^=h<<13,d^=d<<17,h^=h>>>15,d^=d>>>12,h=u[m]=h^d,l.i=m,h+(o^o>>>16)|0};function c(o,u){var m,d,h,y,v,x=[],w=128;for(u===(u|0)?(d=u,u=null):(u=u+"\\0",d=0,w=Math.max(w,u.length)),h=0,y=-32;y>>15,d^=d<<4,d^=d>>>13,y>=0&&(v=v+1640531527|0,m=x[y&127]^=d+v,h=m==0?h+1:0);for(h>=128&&(x[(u&&u.length||0)&127]=-1),h=127,y=4*128;y>0;--y)d=x[h+34&127],m=x[h=h+1&127],d^=d<<13,m^=m<<17,d^=d>>>15,m^=m>>>12,x[h]=d^m;o.w=v,o.X=x,o.i=h}c(l,s)}function a(s,l){return l.i=s.i,l.w=s.w,l.X=s.X.slice(),l}function i(s,l){s==null&&(s=+new Date);var c=new n(s),o=l&&l.state,u=function(){return(c.next()>>>0)/4294967296};return u.double=function(){do var m=c.next()>>>11,d=(c.next()>>>0)/4294967296,h=(m+d)/(1<<21);while(h===0);return h},u.int32=c.next,u.quick=u,o&&(o.X&&a(o,c),u.state=function(){return a(c,{})}),u}r&&r.exports?r.exports=i:t&&t.amd?t(function(){return i}):this.xor4096=i})(HB,typeof TD=="object"&&TD,typeof define=="function"&&define)});var VB=vn((GB,FD)=>{(function(e,r,t){function n(s){var l=this,c="";l.next=function(){var u=l.b,m=l.c,d=l.d,h=l.a;return u=u<<25^u>>>7^m,m=m-d|0,d=d<<24^d>>>8^h,h=h-u|0,l.b=u=u<<20^u>>>12^m,l.c=m=m-d|0,l.d=d<<16^m>>>16^h,l.a=h-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):c+=s;for(var o=0;o>>0)/4294967296};return u.double=function(){do var m=c.next()>>>11,d=(c.next()>>>0)/4294967296,h=(m+d)/(1<<21);while(h===0);return h},u.int32=c.next,u.quick=u,o&&(typeof o=="object"&&a(o,c),u.state=function(){return a(c,{})}),u}r&&r.exports?r.exports=i:t&&t.amd?t(function(){return i}):this.tychei=i})(GB,typeof FD=="object"&&FD,typeof define=="function"&&define)});var ZB=vn(()=>{});var XB=vn((QB,zg)=>{(function(e,r,t){var n=256,a=6,i=52,s="random",l=t.pow(n,a),c=t.pow(2,i),o=c*2,u=n-1,m;function d(b,N,M){var S=[];N=N==!0?{entropy:!0}:N||{};var O=x(v(N.entropy?[b,C(r)]:b??w(),3),S),_=new h(S),E=function(){for(var T=_.g(a),R=l,L=0;T=o;)T/=2,R/=2,L>>>=1;return(T+L)/R};return E.int32=function(){return _.g(4)|0},E.quick=function(){return _.g(4)/4294967296},E.double=E,x(C(_.S),r),(N.pass||M||function(T,R,L,H){return H&&(H.S&&y(H,_),T.state=function(){return y(_,{})}),L?(t[s]=T,R):T})(E,O,"global"in N?N.global:this==t,N.state)}function h(b){var N,M=b.length,S=this,O=0,_=S.i=S.j=0,E=S.S=[];for(M||(b=[M++]);O{var eV=qB(),rV=LB(),tV=UB(),nV=YB(),aV=$B(),iV=VB(),Bs=XB();Bs.alea=eV;Bs.xor128=rV;Bs.xorwow=tV;Bs.xorshift7=nV;Bs.xor4096=aV;Bs.tychei=iV;JB.exports=Bs});var jR=vn((PIe,CS)=>{function MS(){}MS.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 a(){n.off(e,a),r.apply(t,arguments)}return a._=r,this.on(e,a,t)},emit:function(e){var r=[].slice.call(arguments,1),t=((this.e||(this.e={}))[e]||[]).slice(),n=0,a=t.length;for(n;n{(function(e,r){typeof ES=="object"&&typeof Nf<"u"?Nf.exports=r():typeof define=="function"&&define.amd?define(r):e.moment=r()})(ES,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 a(g){return g!=null&&Object.prototype.toString.call(g)==="[object Object]"}function i(g,A){return Object.prototype.hasOwnProperty.call(g,A)}function s(g){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(g).length===0;var A;for(A in g)if(i(g,A))return!1;return!0}function l(g){return g===void 0}function c(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,A){var I=[],U,G=g.length;for(U=0;U>>0,U;for(U=0;U0)for(I=0;I=0;return(se?I?"+":"":"-")+Math.pow(10,Math.max(0,G)).toString().substr(1)+U}var z=/(\\[[^\\[]*\\])|(\\\\)?([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,le={},ae={};function $(g,A,I,U){var G=U;typeof U=="string"&&(G=function(){return this[U]()}),g&&(ae[g]=G),A&&(ae[A[0]]=function(){return K(G.apply(this,arguments),A[1],A[2])}),I&&(ae[I]=function(){return this.localeData().ordinal(G.apply(this,arguments),g)})}function me(g){return g.match(/\\[[\\s\\S]/)?g.replace(/^\\[|\\]$/g,""):g.replace(/\\\\/g,"")}function Ee(g){var A=g.match(z),I,U;for(I=0,U=A.length;I=0&&oe.test(g);)g=g.replace(oe,U),oe.lastIndex=0,I-=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 ye(g){var A=this._longDateFormat[g],I=this._longDateFormat[g.toUpperCase()];return A||!I?A:(this._longDateFormat[g]=I.match(z).map(function(U){return U==="MMMM"||U==="MM"||U==="DD"||U==="dddd"?U.slice(1):U}).join(""),this._longDateFormat[g])}var be="Invalid date";function De(){return this._invalidDate}var Ae="%d",We=/\\d{1,2}/;function Je(g){return this._ordinal.replace("%d",g)}var J={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 re(g,A,I,U){var G=this._relativeTime[I];return R(G)?G(g,A,I,U):G.replace(/%d/i,g)}function xe(g,A){var I=this._relativeTime[g>0?"future":"past"];return R(I)?I(A):I.replace(/%s/i,A)}var j={};function ne(g,A){var I=g.toLowerCase();j[I]=j[I+"s"]=j[A]=g}function ue(g){return typeof g=="string"?j[g]||j[g.toLowerCase()]:void 0}function Me(g){var A={},I,U;for(U in g)i(g,U)&&(I=ue(U),I&&(A[I]=g[U]));return A}var Ce={};function Le(g,A){Ce[g]=A}function Ie(g){var A=[],I;for(I in g)i(g,I)&&A.push({unit:I,priority:Ce[I]});return A.sort(function(U,G){return U.priority-G.priority}),A}function fr(g){return g%4===0&&g%100!==0||g%400===0}function or(g){return g<0?Math.ceil(g)||0:Math.floor(g)}function Ke(g){var A=+g,I=0;return A!==0&&isFinite(A)&&(I=or(A)),I}function Pr(g,A){return function(I){return I!=null?(ce(this,g,I),r.updateOffset(this,A),this):ee(this,g)}}function ee(g,A){return g.isValid()?g._d["get"+(g._isUTC?"UTC":"")+A]():NaN}function ce(g,A,I){g.isValid()&&!isNaN(I)&&(A==="FullYear"&&fr(g.year())&&g.month()===1&&g.date()===29?(I=Ke(I),g._d["set"+(g._isUTC?"UTC":"")+A](I,g.month(),fo(I,g.month()))):g._d["set"+(g._isUTC?"UTC":"")+A](I))}function we(g){return g=ue(g),R(this[g])?this[g]():this}function Be(g,A){if(typeof g=="object"){g=Me(g);var I=Ie(g),U,G=I.length;for(U=0;U68?1900:2e3)};var kf=Pr("FullYear",!0);function vx(){return fr(this.year())}function Gc(g,A,I,U,G,se,Fe){var dr;return g<100&&g>=0?(dr=new Date(g+400,A,I,U,G,se,Fe),isFinite(dr.getFullYear())&&dr.setFullYear(g)):dr=new Date(g,A,I,U,G,se,Fe),dr}function co(g){var A,I;return g<100&&g>=0?(I=Array.prototype.slice.call(arguments),I[0]=g+400,A=new Date(Date.UTC.apply(null,I)),isFinite(A.getUTCFullYear())&&A.setUTCFullYear(g)):A=new Date(Date.UTC.apply(null,arguments)),A}function lo(g,A,I){var U=7+A-I,G=(7+co(g,0,U).getUTCDay()-A)%7;return-G+U-1}function Vc(g,A,I,U,G){var se=(7+I-U)%7,Fe=lo(g,U,G),dr=1+7*(A-1)+se+Fe,_r,tt;return dr<=0?(_r=g-1,tt=di(_r)+dr):dr>di(g)?(_r=g+1,tt=dr-di(g)):(_r=g,tt=dr),{year:_r,dayOfYear:tt}}function mo(g,A,I){var U=lo(g.year(),A,I),G=Math.floor((g.dayOfYear()-U-1)/7)+1,se,Fe;return G<1?(Fe=g.year()-1,se=G+ia(Fe,A,I)):G>ia(g.year(),A,I)?(se=G-ia(g.year(),A,I),Fe=g.year()+1):(Fe=g.year(),se=G),{week:se,year:Fe}}function ia(g,A,I){var U=lo(g,A,I),G=lo(g+1,A,I);return(di(g)-U+G)/7}$("w",["ww",2],"wo","week"),$("W",["WW",2],"Wo","isoWeek"),ne("week","w"),ne("isoWeek","W"),Le("week",5),Le("isoWeek",5),nr("w",Q),nr("ww",Q,Te),nr("W",Q),nr("WW",Q,Te),Ii(["w","ww","W","WW"],function(g,A,I,U){A[U.substr(0,1)]=Ke(g)});function Lf(g){return mo(g,this._week.dow,this._week.doy).week}var po={dow:0,doy:6};function Zc(){return this._week.dow}function Qc(){return this._week.doy}function gx(g){var A=this.localeData().week(this);return g==null?A:this.add((g-A)*7,"d")}function Xc(g){var A=mo(this,1,4).week;return g==null?A:this.add((g-A)*7,"d")}$("d",0,"do","day"),$("dd",0,0,function(g){return this.localeData().weekdaysMin(this,g)}),$("ddd",0,0,function(g){return this.localeData().weekdaysShort(this,g)}),$("dddd",0,0,function(g){return this.localeData().weekdays(this,g)}),$("e",0,0,"weekday"),$("E",0,0,"isoWeekday"),ne("day","d"),ne("weekday","e"),ne("isoWeekday","E"),Le("day",11),Le("weekday",11),Le("isoWeekday",11),nr("d",Q),nr("e",Q),nr("E",Q),nr("dd",function(g,A){return A.weekdaysMinRegex(g)}),nr("ddd",function(g,A){return A.weekdaysShortRegex(g)}),nr("dddd",function(g,A){return A.weekdaysRegex(g)}),Ii(["dd","ddd","dddd"],function(g,A,I,U){var G=I._locale.weekdaysParse(g,U,I._strict);G!=null?A.d=G:y(I).invalidWeekday=g}),Ii(["d","e","E"],function(g,A,I,U){A[U]=Ke(g)});function Jc(g,A){return typeof g!="string"?g:isNaN(g)?(g=A.weekdaysParse(g),typeof g=="number"?g:null):parseInt(g,10)}function Kc(g,A){return typeof g=="string"?A.weekdaysParse(g)%7||7:isNaN(g)?null:g}function Ys(g,A){return g.slice(A,7).concat(g.slice(0,A))}var yx="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),jc="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),xx="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),el=Ha,bx=Ha,wx=Ha;function Dx(g,A){var I=n(this._weekdays)?this._weekdays:this._weekdays[g&&g!==!0&&this._weekdays.isFormat.test(A)?"format":"standalone"];return g===!0?Ys(I,this._week.dow):g?I[g.day()]:I}function Sx(g){return g===!0?Ys(this._weekdaysShort,this._week.dow):g?this._weekdaysShort[g.day()]:this._weekdaysShort}function zf(g){return g===!0?Ys(this._weekdaysMin,this._week.dow):g?this._weekdaysMin[g.day()]:this._weekdaysMin}function Nx(g,A,I){var U,G,se,Fe=g.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],U=0;U<7;++U)se=d([2e3,1]).day(U),this._minWeekdaysParse[U]=this.weekdaysMin(se,"").toLocaleLowerCase(),this._shortWeekdaysParse[U]=this.weekdaysShort(se,"").toLocaleLowerCase(),this._weekdaysParse[U]=this.weekdays(se,"").toLocaleLowerCase();return I?A==="dddd"?(G=vt.call(this._weekdaysParse,Fe),G!==-1?G:null):A==="ddd"?(G=vt.call(this._shortWeekdaysParse,Fe),G!==-1?G:null):(G=vt.call(this._minWeekdaysParse,Fe),G!==-1?G:null):A==="dddd"?(G=vt.call(this._weekdaysParse,Fe),G!==-1||(G=vt.call(this._shortWeekdaysParse,Fe),G!==-1)?G:(G=vt.call(this._minWeekdaysParse,Fe),G!==-1?G:null)):A==="ddd"?(G=vt.call(this._shortWeekdaysParse,Fe),G!==-1||(G=vt.call(this._weekdaysParse,Fe),G!==-1)?G:(G=vt.call(this._minWeekdaysParse,Fe),G!==-1?G:null)):(G=vt.call(this._minWeekdaysParse,Fe),G!==-1||(G=vt.call(this._weekdaysParse,Fe),G!==-1)?G:(G=vt.call(this._shortWeekdaysParse,Fe),G!==-1?G:null))}function Ax(g,A,I){var U,G,se;if(this._weekdaysParseExact)return Nx.call(this,g,A,I);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),U=0;U<7;U++){if(G=d([2e3,1]).day(U),I&&!this._fullWeekdaysParse[U]&&(this._fullWeekdaysParse[U]=new RegExp("^"+this.weekdays(G,"").replace(".","\\\\.?")+"$","i"),this._shortWeekdaysParse[U]=new RegExp("^"+this.weekdaysShort(G,"").replace(".","\\\\.?")+"$","i"),this._minWeekdaysParse[U]=new RegExp("^"+this.weekdaysMin(G,"").replace(".","\\\\.?")+"$","i")),this._weekdaysParse[U]||(se="^"+this.weekdays(G,"")+"|^"+this.weekdaysShort(G,"")+"|^"+this.weekdaysMin(G,""),this._weekdaysParse[U]=new RegExp(se.replace(".",""),"i")),I&&A==="dddd"&&this._fullWeekdaysParse[U].test(g))return U;if(I&&A==="ddd"&&this._shortWeekdaysParse[U].test(g))return U;if(I&&A==="dd"&&this._minWeekdaysParse[U].test(g))return U;if(!I&&this._weekdaysParse[U].test(g))return U}}function Mx(g){if(!this.isValid())return g!=null?this:NaN;var A=this._isUTC?this._d.getUTCDay():this._d.getDay();return g!=null?(g=Jc(g,this.localeData()),this.add(g-A,"d")):A}function Cx(g){if(!this.isValid())return g!=null?this:NaN;var A=(this.day()+7-this.localeData()._week.dow)%7;return g==null?A:this.add(g-A,"d")}function Ex(g){if(!this.isValid())return g!=null?this:NaN;if(g!=null){var A=Kc(g,this.localeData());return this.day(this.day()%7?A:A-7)}else return this.day()||7}function xt(g){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Uf.call(this),g?this._weekdaysStrictRegex:this._weekdaysRegex):(i(this,"_weekdaysRegex")||(this._weekdaysRegex=el),this._weekdaysStrictRegex&&g?this._weekdaysStrictRegex:this._weekdaysRegex)}function gt(g){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Uf.call(this),g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(i(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=bx),this._weekdaysShortStrictRegex&&g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Tx(g){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Uf.call(this),g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(i(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=wx),this._weekdaysMinStrictRegex&&g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Uf(){function g(hn,Ca){return Ca.length-hn.length}var A=[],I=[],U=[],G=[],se,Fe,dr,_r,tt;for(se=0;se<7;se++)Fe=d([2e3,1]).day(se),dr=mn(this.weekdaysMin(Fe,"")),_r=mn(this.weekdaysShort(Fe,"")),tt=mn(this.weekdays(Fe,"")),A.push(dr),I.push(_r),U.push(tt),G.push(dr),G.push(_r),G.push(tt);A.sort(g),I.sort(g),U.sort(g),G.sort(g),this._weekdaysRegex=new RegExp("^("+G.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+U.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+I.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+A.join("|")+")","i")}function Wf(){return this.hours()%12||12}function Fx(){return this.hours()||24}$("H",["HH",2],0,"hour"),$("h",["hh",2],0,Wf),$("k",["kk",2],0,Fx),$("hmm",0,0,function(){return""+Wf.apply(this)+K(this.minutes(),2)}),$("hmmss",0,0,function(){return""+Wf.apply(this)+K(this.minutes(),2)+K(this.seconds(),2)}),$("Hmm",0,0,function(){return""+this.hours()+K(this.minutes(),2)}),$("Hmmss",0,0,function(){return""+this.hours()+K(this.minutes(),2)+K(this.seconds(),2)});function rl(g,A){$(g,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),A)})}rl("a",!0),rl("A",!1),ne("hour","h"),Le("hour",13);function tl(g,A){return A._meridiemParse}nr("a",tl),nr("A",tl),nr("H",Q),nr("h",Q),nr("k",Q),nr("HH",Q,Te),nr("hh",Q,Te),nr("kk",Q,Te),nr("hmm",ve),nr("hmmss",Pe),nr("Hmm",ve),nr("Hmmss",Pe),ot(["H","HH"],Tt),ot(["k","kk"],function(g,A,I){var U=Ke(g);A[Tt]=U===24?0:U}),ot(["a","A"],function(g,A,I){I._isPm=I._locale.isPM(g),I._meridiem=g}),ot(["h","hh"],function(g,A,I){A[Tt]=Ke(g),y(I).bigHour=!0}),ot("hmm",function(g,A,I){var U=g.length-2;A[Tt]=Ke(g.substr(0,U)),A[On]=Ke(g.substr(U)),y(I).bigHour=!0}),ot("hmmss",function(g,A,I){var U=g.length-4,G=g.length-2;A[Tt]=Ke(g.substr(0,U)),A[On]=Ke(g.substr(U,2)),A[aa]=Ke(g.substr(G)),y(I).bigHour=!0}),ot("Hmm",function(g,A,I){var U=g.length-2;A[Tt]=Ke(g.substr(0,U)),A[On]=Ke(g.substr(U))}),ot("Hmmss",function(g,A,I){var U=g.length-4,G=g.length-2;A[Tt]=Ke(g.substr(0,U)),A[On]=Ke(g.substr(U,2)),A[aa]=Ke(g.substr(G))});function nl(g){return(g+"").toLowerCase().charAt(0)==="p"}var _x=/[ap]\\.?m?\\.?/i,Vt=Pr("Hours",!0);function Yf(g,A,I){return g>11?I?"pm":"PM":I?"am":"AM"}var hi={calendar:k,longDateFormat:Se,invalidDate:be,ordinal:Ae,dayOfMonthOrdinalParse:We,relativeTime:J,months:Pf,monthsShort:Ls,week:po,weekdays:yx,weekdaysMin:xx,weekdaysShort:jc,meridiemParse:_x},bt={},qi={},sn;function al(g,A){var I,U=Math.min(g.length,A.length);for(I=0;I0;){if(G=es(se.slice(0,I).join("-")),G)return G;if(U&&U.length>=I&&al(se,U)>=I-1)break;I--}A++}return sn}function ol(g){return g.match("^[^/\\\\\\\\]*$")!=null}function es(g){var A=null,I;if(bt[g]===void 0&&typeof Nf<"u"&&Nf&&Nf.exports&&ol(g))try{A=sn._abbr,I=require,I("./locale/"+g),Va(A)}catch{bt[g]=null}return bt[g]}function Va(g,A){var I;return g&&(l(A)?I=It(g):I=pn(g,A),I?sn=I:typeof console<"u"&&console.warn&&console.warn("Locale "+g+" not found. Did you forget to load it?")),sn._abbr}function pn(g,A){if(A!==null){var I,U=hi;if(A.abbr=g,bt[g]!=null)T("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=bt[g]._config;else if(A.parentLocale!=null)if(bt[A.parentLocale]!=null)U=bt[A.parentLocale]._config;else if(I=es(A.parentLocale),I!=null)U=I._config;else return qi[A.parentLocale]||(qi[A.parentLocale]=[]),qi[A.parentLocale].push({name:g,config:A}),null;return bt[g]=new V(H(U,A)),qi[g]&&qi[g].forEach(function(G){pn(G.name,G.config)}),Va(g),bt[g]}else return delete bt[g],null}function Ox(g,A){if(A!=null){var I,U,G=hi;bt[g]!=null&&bt[g].parentLocale!=null?bt[g].set(H(bt[g]._config,A)):(U=es(g),U!=null&&(G=U._config),A=H(G,A),U==null&&(A.abbr=g),I=new V(A),I.parentLocale=bt[g],bt[g]=I),Va(g)}else bt[g]!=null&&(bt[g].parentLocale!=null?(bt[g]=bt[g].parentLocale,g===Va()&&Va(g)):bt[g]!=null&&delete bt[g]);return bt[g]}function It(g){var A;if(g&&g._locale&&g._locale._abbr&&(g=g._locale._abbr),!g)return sn;if(!n(g)){if(A=es(g),A)return A;g=[g]}return il(g)}function Bx(){return W(bt)}function Hs(g){var A,I=g._a;return I&&y(g).overflow===-2&&(A=I[Un]<0||I[Un]>11?Un:I[Wn]<1||I[Wn]>fo(I[Gt],I[Un])?Wn:I[Tt]<0||I[Tt]>24||I[Tt]===24&&(I[On]!==0||I[aa]!==0||I[$a]!==0)?Tt:I[On]<0||I[On]>59?On:I[aa]<0||I[aa]>59?aa:I[$a]<0||I[$a]>999?$a:-1,y(g)._overflowDayOfYear&&(AWn)&&(A=Wn),y(g)._overflowWeeks&&A===-1&&(A=Of),y(g)._overflowWeekday&&A===-1&&(A=uo),y(g).overflow=A),g}var vi=/^\\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)?)?$/,$s=/^\\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)?)?$/,$f=/Z|[+-]\\d\\d(?::?\\d\\d)?/,dt=[["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]],Da=[["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/]],Gf=/^\\/?Date\\((-?\\d+)/i,Px=/^(?:(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}))$/,Vf={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 sl(g){var A,I,U=g._i,G=vi.exec(U)||$s.exec(U),se,Fe,dr,_r,tt=dt.length,hn=Da.length;if(G){for(y(g).iso=!0,A=0,I=tt;Adi(Fe)||g._dayOfYear===0)&&(y(g)._overflowDayOfYear=!0),I=co(Fe,0,g._dayOfYear),g._a[Un]=I.getUTCMonth(),g._a[Wn]=I.getUTCDate()),A=0;A<3&&g._a[A]==null;++A)g._a[A]=U[A]=G[A];for(;A<7;A++)g._a[A]=U[A]=g._a[A]==null?A===2?1:0:g._a[A];g._a[Tt]===24&&g._a[On]===0&&g._a[aa]===0&&g._a[$a]===0&&(g._nextDay=!0,g._a[Tt]=0),g._d=(g._useUTC?co:Gc).apply(null,U),se=g._useUTC?g._d.getUTCDay():g._d.getDay(),g._tzm!=null&&g._d.setUTCMinutes(g._d.getUTCMinutes()-g._tzm),g._nextDay&&(g._a[Tt]=24),g._w&&typeof g._w.d<"u"&&g._w.d!==se&&(y(g).weekdayMismatch=!0)}}function ll(g){var A,I,U,G,se,Fe,dr,_r,tt;A=g._w,A.GG!=null||A.W!=null||A.E!=null?(se=1,Fe=4,I=ki(A.GG,g._a[Gt],mo(yt(),1,4).year),U=ki(A.W,1),G=ki(A.E,1),(G<1||G>7)&&(_r=!0)):(se=g._locale._week.dow,Fe=g._locale._week.doy,tt=mo(yt(),se,Fe),I=ki(A.gg,g._a[Gt],tt.year),U=ki(A.w,tt.week),A.d!=null?(G=A.d,(G<0||G>6)&&(_r=!0)):A.e!=null?(G=A.e+se,(A.e<0||A.e>6)&&(_r=!0)):G=se),U<1||U>ia(I,se,Fe)?y(g)._overflowWeeks=!0:_r!=null?y(g)._overflowWeekday=!0:(dr=Vc(I,U,G,se,Fe),g._a[Gt]=dr.year,g._dayOfYear=dr.dayOfYear)}r.ISO_8601=function(){},r.RFC_2822=function(){};function Qf(g){if(g._f===r.ISO_8601){sl(g);return}if(g._f===r.RFC_2822){fl(g);return}g._a=[],y(g).empty=!0;var A=""+g._i,I,U,G,se,Fe,dr=A.length,_r=0,tt,hn;for(G=ge(g._f,g._locale).match(z)||[],hn=G.length,I=0;I0&&y(g).unusedInput.push(Fe),A=A.slice(A.indexOf(U)+U.length),_r+=U.length),ae[se]?(U?y(g).empty=!1:y(g).unusedTokens.push(se),_f(se,U,g)):g._strict&&!U&&y(g).unusedTokens.push(se);y(g).charsLeftOver=dr-_r,A.length>0&&y(g).unusedInput.push(A),g._a[Tt]<=12&&y(g).bigHour===!0&&g._a[Tt]>0&&(y(g).bigHour=void 0),y(g).parsedDateParts=g._a.slice(0),y(g).meridiem=g._meridiem,g._a[Tt]=Xf(g._locale,g._a[Tt],g._meridiem),tt=y(g).era,tt!==null&&(g._a[Gt]=g._locale.erasConvertYear(tt,g._a[Gt])),rs(g),Hs(g)}function Xf(g,A,I){var U;return I==null?A:g.meridiemHour!=null?g.meridiemHour(A,I):(g.isPM!=null&&(U=g.isPM(I),U&&A<12&&(A+=12),!U&&A===12&&(A=0)),A)}function Jf(g){var A,I,U,G,se,Fe,dr=!1,_r=g._f.length;if(_r===0){y(g).invalidFormat=!0,g._d=new Date(NaN);return}for(G=0;G<_r;G++)se=0,Fe=!1,A=N({},g),g._useUTC!=null&&(A._useUTC=g._useUTC),A._f=g._f[G],Qf(A),x(A)&&(Fe=!0),se+=y(A).charsLeftOver,se+=y(A).unusedTokens.length*10,y(A).score=se,dr?sethis?this:g:w()});function dl(g,A){var I,U;if(A.length===1&&n(A[0])&&(A=A[0]),!A.length)return yt();for(I=A[0],U=1;Uthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _e(){if(!l(this._isDSTShifted))return this._isDSTShifted;var g={},A;return N(g,this),g=wn(g),g._a?(A=g._isUTC?d(g._a):yt(g._a),this._isDSTShifted=this.isValid()&&Hx(g._a,A.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Ne(){return this.isValid()?!this._isUTC:!1}function ir(){return this.isValid()?this._isUTC:!1}function Ar(){return this.isValid()?this._isUTC&&this._offset===0:!1}var rt=/^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,zt=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function zr(g,A){var I=g,U=null,G,se,Fe;return oa(g)?I={ms:g._milliseconds,d:g._days,M:g._months}:c(g)||!isNaN(+g)?(I={},A?I[A]=+g:I.milliseconds=+g):(U=rt.exec(g))?(G=U[1]==="-"?-1:1,I={y:0,d:Ke(U[Wn])*G,h:Ke(U[Tt])*G,m:Ke(U[On])*G,s:Ke(U[aa])*G,ms:Ke(go(U[$a]*1e3))*G}):(U=zt.exec(g))?(G=U[1]==="-"?-1:1,I={y:Za(U[2],G),M:Za(U[3],G),w:Za(U[4],G),d:Za(U[5],G),h:Za(U[6],G),m:Za(U[7],G),s:Za(U[8],G)}):I==null?I={}:typeof I=="object"&&("from"in I||"to"in I)&&(Fe=Yn(yt(I.from),yt(I.to)),I={},I.ms=Fe.milliseconds,I.M=Fe.months),se=new ts(I),oa(g)&&i(g,"_locale")&&(se._locale=g._locale),oa(g)&&i(g,"_isValid")&&(se._isValid=g._isValid),se}zr.fn=ts.prototype,zr.invalid=jf;function Za(g,A){var I=g&&parseFloat(g.replace(",","."));return(isNaN(I)?0:I)*A}function vl(g,A){var I={};return I.months=A.month()-g.month()+(A.year()-g.year())*12,g.clone().add(I.months,"M").isAfter(A)&&--I.months,I.milliseconds=+A-+g.clone().add(I.months,"M"),I}function Yn(g,A){var I;return g.isValid()&&A.isValid()?(A=Bn(A,g),g.isBefore(A)?I=vl(g,A):(I=vl(A,g),I.milliseconds=-I.milliseconds,I.months=-I.months),I):{milliseconds:0,months:0}}function ns(g,A){return function(I,U){var G,se;return U!==null&&!isNaN(+U)&&(T(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."),se=I,I=U,U=se),G=zr(I,U),gl(this,G,g),this}}function gl(g,A,I,U){var G=A._milliseconds,se=go(A._days),Fe=go(A._months);!g.isValid()||(U=U??!0,Fe&&pi(g,ee(g,"Month")+Fe*I),se&&ce(g,"Date",ee(g,"Date")+se*I),G&&g._d.setTime(g._d.valueOf()+G*I),U&&r.updateOffset(g,se||Fe))}var yo=ns(1,"add"),Zs=ns(-1,"subtract");function as(g){return typeof g=="string"||g instanceof String}function ut(g){return S(g)||o(g)||as(g)||c(g)||yl(g)||Jx(g)||g===null||g===void 0}function Jx(g){var A=a(g)&&!s(g),I=!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"],G,se,Fe=U.length;for(G=0;GI.valueOf():I.valueOf()9999?pe(I,A?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):R(Date.prototype.toISOString)?A?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",pe(I,"Z")):pe(I,A?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function zi(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var g="moment",A="",I,U,G,se;return this.isLocal()||(g=this.utcOffset()===0?"moment.utc":"moment.parseZone",A="Z"),I="["+g+'("]',U=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",G="-MM-DD[T]HH:mm:ss.SSS",se=A+'[")]',this.format(I+U+G+se)}function js(g){g||(g=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var A=pe(this,g);return this.localeData().postformat(A)}function r1(g,A){return this.isValid()&&(S(g)&&g.isValid()||yt(g).isValid())?zr({to:this,from:g}).locale(this.locale()).humanize(!A):this.localeData().invalidDate()}function t1(g){return this.from(yt(),g)}function n1(g,A){return this.isValid()&&(S(g)&&g.isValid()||yt(g).isValid())?zr({from:this,to:g}).locale(this.locale()).humanize(!A):this.localeData().invalidDate()}function eu(g){return this.to(yt(),g)}function os(g){var A;return g===void 0?this._locale._abbr:(A=It(g),A!=null&&(this._locale=A),this)}var ru=_("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 Sl(){return this._locale}var ss=1e3,xo=60*ss,tu=60*xo,Rt=(365*400+97)*24*tu;function Ft(g,A){return(g%A+A)%A}function Nl(g,A,I){return g<100&&g>=0?new Date(g+400,A,I)-Rt:new Date(g,A,I).valueOf()}function Al(g,A,I){return g<100&&g>=0?Date.UTC(g+400,A,I)-Rt:Date.UTC(g,A,I)}function Ml(g){var A,I;if(g=ue(g),g===void 0||g==="millisecond"||!this.isValid())return this;switch(I=this._isUTC?Al:Nl,g){case"year":A=I(this.year(),0,1);break;case"quarter":A=I(this.year(),this.month()-this.month()%3,1);break;case"month":A=I(this.year(),this.month(),1);break;case"week":A=I(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":A=I(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":A=I(this.year(),this.month(),this.date());break;case"hour":A=this._d.valueOf(),A-=Ft(A+(this._isUTC?0:this.utcOffset()*xo),tu);break;case"minute":A=this._d.valueOf(),A-=Ft(A,xo);break;case"second":A=this._d.valueOf(),A-=Ft(A,ss);break}return this._d.setTime(A),r.updateOffset(this,!0),this}function a1(g){var A,I;if(g=ue(g),g===void 0||g==="millisecond"||!this.isValid())return this;switch(I=this._isUTC?Al:Nl,g){case"year":A=I(this.year()+1,0,1)-1;break;case"quarter":A=I(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":A=I(this.year(),this.month()+1,1)-1;break;case"week":A=I(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":A=I(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":A=I(this.year(),this.month(),this.date()+1)-1;break;case"hour":A=this._d.valueOf(),A+=tu-Ft(A+(this._isUTC?0:this.utcOffset()*xo),tu)-1;break;case"minute":A=this._d.valueOf(),A+=xo-Ft(A,xo)-1;break;case"second":A=this._d.valueOf(),A+=ss-Ft(A,ss)-1;break}return this._d.setTime(A),r.updateOffset(this,!0),this}function ec(){return this._d.valueOf()-(this._offset||0)*6e4}function us(){return Math.floor(this.valueOf()/1e3)}function rc(){return new Date(this.valueOf())}function bo(){var g=this;return[g.year(),g.month(),g.date(),g.hour(),g.minute(),g.second(),g.millisecond()]}function fs(){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 cs(){return this.isValid()?this.toISOString():null}function nu(){return x(this)}function wo(){return m({},y(this))}function i1(){return y(this).overflow}function o1(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}$("N",0,0,"eraAbbr"),$("NN",0,0,"eraAbbr"),$("NNN",0,0,"eraAbbr"),$("NNNN",0,0,"eraName"),$("NNNNN",0,0,"eraNarrow"),$("y",["y",1],"yo","eraYear"),$("y",["yy",2],0,"eraYear"),$("y",["yyy",3],0,"eraYear"),$("y",["yyyy",4],0,"eraYear"),nr("N",qr),nr("NN",qr),nr("NNN",qr),nr("NNNN",c1),nr("NNNNN",l1),ot(["N","NN","NNN","NNNN","NNNNN"],function(g,A,I,U){var G=I._locale.erasParse(g,U,I._strict);G?y(I).era=G:y(I).invalidEra=g}),nr("y",Pt),nr("yy",Pt),nr("yyy",Pt),nr("yyyy",Pt),nr("yo",m1),ot(["y","yy","yyy","yyyy"],Gt),ot(["yo"],function(g,A,I,U){var G;I._locale._eraYearOrdinalRegex&&(G=g.match(I._locale._eraYearOrdinalRegex)),I._locale.eraYearOrdinalParse?A[Gt]=I._locale.eraYearOrdinalParse(g,G):A[Gt]=parseInt(g,10)});function s1(g,A){var I,U,G,se=this._eras||It("en")._eras;for(I=0,U=se.length;I=0)return se[U]}function f1(g,A){var I=g.since<=g.until?1:-1;return A===void 0?r(g.since).year():r(g.since).year()+(A-g.offset)*I}function au(){var g,A,I,U=this.localeData().eras();for(g=0,A=U.length;gse&&(A=se),y1.call(this,g,A,I,U,G))}function y1(g,A,I,U,G){var se=Vc(g,A,I,U,G),Fe=co(se.year,0,se.dayOfYear);return this.year(Fe.getUTCFullYear()),this.month(Fe.getUTCMonth()),this.date(Fe.getUTCDate()),this}$("Q",0,"Qo","quarter"),ne("quarter","Q"),Le("quarter",7),nr("Q",qe),ot("Q",function(g,A){A[Un]=(Ke(g)-1)*3});function x1(g){return g==null?Math.ceil((this.month()+1)/3):this.month((g-1)*3+this.month()%3)}$("D",["DD",2],"Do","date"),ne("date","D"),Le("date",9),nr("D",Q),nr("DD",Q,Te),nr("Do",function(g,A){return g?A._dayOfMonthOrdinalParse||A._ordinalParse:A._dayOfMonthOrdinalParseLenient}),ot(["D","DD"],Wn),ot("Do",function(g,A){A[Wn]=Ke(g.match(Q)[0])});var Tl=Pr("Date",!0);$("DDD",["DDDD",3],"DDDo","dayOfYear"),ne("dayOfYear","DDD"),Le("dayOfYear",4),nr("DDD",tr),nr("DDDD",Re),ot(["DDD","DDDD"],function(g,A,I){I._dayOfYear=Ke(g)});function Ja(g){var A=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return g==null?A:this.add(g-A,"d")}$("m",["mm",2],0,"minute"),ne("minute","m"),Le("minute",14),nr("m",Q),nr("mm",Q,Te),ot(["m","mm"],On);var b1=Pr("Minutes",!1);$("s",["ss",2],0,"second"),ne("second","s"),Le("second",15),nr("s",Q),nr("ss",Q,Te),ot(["s","ss"],aa);var w1=Pr("Seconds",!1);$("S",0,0,function(){return~~(this.millisecond()/100)}),$(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),$(0,["SSS",3],0,"millisecond"),$(0,["SSSS",4],0,function(){return this.millisecond()*10}),$(0,["SSSSS",5],0,function(){return this.millisecond()*100}),$(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),$(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),$(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),$(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),ne("millisecond","ms"),Le("millisecond",16),nr("S",tr,qe),nr("SS",tr,Te),nr("SSS",tr,Re);var bi,Fl;for(bi="SSSS";bi.length<=9;bi+="S")nr(bi,Pt);function D1(g,A){A[$a]=Ke(("0."+g)*1e3)}for(bi="S";bi.length<=9;bi+="S")ot(bi,D1);Fl=Pr("Milliseconds",!1),$("z",0,0,"zoneAbbr"),$("zz",0,0,"zoneName");function Ui(){return this._isUTC?"UTC":""}function S1(){return this._isUTC?"Coordinated Universal Time":""}var Ve=M.prototype;Ve.add=yo,Ve.calendar=jx,Ve.clone=e1,Ve.diff=wl,Ve.endOf=a1,Ve.format=js,Ve.from=r1,Ve.fromNow=t1,Ve.to=n1,Ve.toNow=eu,Ve.get=we,Ve.invalidAt=i1,Ve.isAfter=Xs,Ve.isBefore=xi,Ve.isBetween=Js,Ve.isSame=xl,Ve.isSameOrAfter=Ks,Ve.isSameOrBefore=bl,Ve.isValid=nu,Ve.lang=ru,Ve.locale=os,Ve.localeData=Sl,Ve.max=kx,Ve.min=pl,Ve.parsingFlags=wo,Ve.set=Be,Ve.startOf=Ml,Ve.subtract=Zs,Ve.toArray=bo,Ve.toObject=fs,Ve.toDate=rc,Ve.toISOString=is,Ve.inspect=zi,typeof Symbol<"u"&&Symbol.for!=null&&(Ve[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Ve.toJSON=cs,Ve.toString=Dl,Ve.unix=us,Ve.valueOf=ec,Ve.creationData=o1,Ve.eraName=au,Ve.eraNarrow=ls,Ve.eraAbbr=Cl,Ve.eraYear=Z,Ve.year=kf,Ve.isLeapYear=vx,Ve.weekYear=p1,Ve.isoWeekYear=d1,Ve.quarter=Ve.quarters=x1,Ve.month=Ga,Ve.daysInMonth=Ws,Ve.week=Ve.weeks=gx,Ve.isoWeek=Ve.isoWeeks=Xc,Ve.weeksInYear=Xa,Ve.weeksInWeekYear=g1,Ve.isoWeeksInYear=h1,Ve.isoWeeksInISOWeekYear=v1,Ve.date=Tl,Ve.day=Ve.days=Mx,Ve.weekday=Cx,Ve.isoWeekday=Ex,Ve.dayOfYear=Ja,Ve.hour=Ve.hours=Vt,Ve.minute=Ve.minutes=b1,Ve.second=Ve.seconds=w1,Ve.millisecond=Ve.milliseconds=Fl,Ve.utcOffset=Gx,Ve.utc=Zx,Ve.local=Qx,Ve.parseZone=Xx,Ve.hasAlignedHourOffset=yi,Ve.isDST=de,Ve.isLocal=Ne,Ve.isUtcOffset=ir,Ve.isUtc=Ar,Ve.isUTC=Ar,Ve.zoneAbbr=Ui,Ve.zoneName=S1,Ve.dates=_("dates accessor is deprecated. Use date instead.",Tl),Ve.months=_("months accessor is deprecated. Use month instead",Ga),Ve.years=_("years accessor is deprecated. Use year instead",kf),Ve.zone=_("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Vx),Ve.isDSTShifted=_("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",_e);function sa(g){return yt(g*1e3)}function N1(){return yt.apply(null,arguments).parseZone()}function _l(g){return g}var Jr=V.prototype;Jr.calendar=q,Jr.longDateFormat=ye,Jr.invalidDate=De,Jr.ordinal=Je,Jr.preparse=_l,Jr.postformat=_l,Jr.relativeTime=re,Jr.pastFuture=xe,Jr.set=L,Jr.eras=s1,Jr.erasParse=u1,Jr.erasConvertYear=f1,Jr.erasAbbrRegex=iu,Jr.erasNameRegex=Do,Jr.erasNarrowRegex=Hn,Jr.months=Ri,Jr.monthsShort=et,Jr.monthsParse=If,Jr.monthsRegex=hx,Jr.monthsShortRegex=Rf,Jr.week=Lf,Jr.firstDayOfYear=Qc,Jr.firstDayOfWeek=Zc,Jr.weekdays=Dx,Jr.weekdaysMin=zf,Jr.weekdaysShort=Sx,Jr.weekdaysParse=Ax,Jr.weekdaysRegex=xt,Jr.weekdaysShortRegex=gt,Jr.weekdaysMinRegex=Tx,Jr.isPM=nl,Jr.meridiem=Yf;function su(g,A,I,U){var G=It(),se=d().set(U,A);return G[I](se,g)}function Ol(g,A,I){if(c(g)&&(A=g,g=void 0),g=g||"",A!=null)return su(g,A,I,"month");var U,G=[];for(U=0;U<12;U++)G[U]=su(g,U,I,"month");return G}function uu(g,A,I,U){typeof g=="boolean"?(c(A)&&(I=A,A=void 0),A=A||""):(A=g,I=A,g=!1,c(A)&&(I=A,A=void 0),A=A||"");var G=It(),se=g?G._week.dow:0,Fe,dr=[];if(I!=null)return su(A,(I+se)%7,U,"day");for(Fe=0;Fe<7;Fe++)dr[Fe]=su(A,(Fe+se)%7,U,"day");return dr}function Bl(g,A){return Ol(g,A,"months")}function A1(g,A){return Ol(g,A,"monthsShort")}function M1(g,A,I){return uu(g,A,I,"weekdays")}function tc(g,A,I){return uu(g,A,I,"weekdaysShort")}function ms(g,A,I){return uu(g,A,I,"weekdaysMin")}Va("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 A=g%10,I=Ke(g%100/10)===1?"th":A===1?"st":A===2?"nd":A===3?"rd":"th";return g+I}}),r.lang=_("moment.lang is deprecated. Use moment.locale instead.",Va),r.langData=_("moment.langData is deprecated. Use moment.localeData instead.",It);var $n=Math.abs;function C1(){var g=this._data;return this._milliseconds=$n(this._milliseconds),this._days=$n(this._days),this._months=$n(this._months),g.milliseconds=$n(g.milliseconds),g.seconds=$n(g.seconds),g.minutes=$n(g.minutes),g.hours=$n(g.hours),g.months=$n(g.months),g.years=$n(g.years),this}function nc(g,A,I,U){var G=zr(A,I);return g._milliseconds+=U*G._milliseconds,g._days+=U*G._days,g._months+=U*G._months,g._bubble()}function E1(g,A){return nc(this,g,A,1)}function Ka(g,A){return nc(this,g,A,-1)}function fu(g){return g<0?Math.floor(g):Math.ceil(g)}function Wi(){var g=this._milliseconds,A=this._days,I=this._months,U=this._data,G,se,Fe,dr,_r;return g>=0&&A>=0&&I>=0||g<=0&&A<=0&&I<=0||(g+=fu(ac(I)+A)*864e5,A=0,I=0),U.milliseconds=g%1e3,G=or(g/1e3),U.seconds=G%60,se=or(G/60),U.minutes=se%60,Fe=or(se/60),U.hours=Fe%24,A+=or(Fe/24),_r=or(Pn(A)),I+=_r,A-=fu(ac(_r)),dr=or(I/12),I%=12,U.days=A,U.months=I,U.years=dr,this}function Pn(g){return g*4800/146097}function ac(g){return g*146097/4800}function Pl(g){if(!this.isValid())return NaN;var A,I,U=this._milliseconds;if(g=ue(g),g==="month"||g==="quarter"||g==="year")switch(A=this._days+U/864e5,I=this._months+Pn(A),g){case"month":return I;case"quarter":return I/3;case"year":return I/12}else switch(A=this._days+Math.round(ac(this._months)),g){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 "+g)}}function Il(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+Ke(this._months/12)*31536e6:NaN}function In(g){return function(){return this.as(g)}}var wi=In("ms"),Rl=In("s"),T1=In("m"),cu=In("h"),F1=In("d"),ql=In("w"),Jt=In("M"),ic=In("Q"),kl=In("y");function Na(){return zr(this)}function oc(g){return g=ue(g),this.isValid()?this[g+"s"]():NaN}function Aa(g){return function(){return this.isValid()?this._data[g]:NaN}}var Yi=Aa("milliseconds"),Ll=Aa("seconds"),dn=Aa("minutes"),sc=Aa("hours"),_1=Aa("days"),O1=Aa("months"),B1=Aa("years");function uc(){return or(this.days()/7)}var ja=Math.round,Ma={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function zl(g,A,I,U,G){return G.relativeTime(A||1,!!I,g,U)}function P1(g,A,I,U){var G=zr(g).abs(),se=ja(G.as("s")),Fe=ja(G.as("m")),dr=ja(G.as("h")),_r=ja(G.as("d")),tt=ja(G.as("M")),hn=ja(G.as("w")),Ca=ja(G.as("y")),ei=se<=I.ss&&["s",se]||se0,ei[4]=U,zl.apply(null,ei)}function I1(g){return g===void 0?ja:typeof g=="function"?(ja=g,!0):!1}function ps(g,A){return Ma[g]===void 0?!1:A===void 0?Ma[g]:(Ma[g]=A,g==="s"&&(Ma.ss=A-1),!0)}function R1(g,A){if(!this.isValid())return this.localeData().invalidDate();var I=!1,U=Ma,G,se;return typeof g=="object"&&(A=g,g=!1),typeof g=="boolean"&&(I=g),typeof A=="object"&&(U=Object.assign({},Ma,A),A.s!=null&&A.ss==null&&(U.ss=A.s-1)),G=this.localeData(),se=P1(this,!I,U,G),I&&(se=G.pastFuture(+this,se)),G.postformat(se)}var fc=Math.abs;function Di(g){return(g>0)-(g<0)||+g}function ds(){if(!this.isValid())return this.localeData().invalidDate();var g=fc(this._milliseconds)/1e3,A=fc(this._days),I=fc(this._months),U,G,se,Fe,dr=this.asSeconds(),_r,tt,hn,Ca;return dr?(U=or(g/60),G=or(U/60),g%=60,U%=60,se=or(I/12),I%=12,Fe=g?g.toFixed(3).replace(/\\.?0+$/,""):"",_r=dr<0?"-":"",tt=Di(this._months)!==Di(dr)?"-":"",hn=Di(this._days)!==Di(dr)?"-":"",Ca=Di(this._milliseconds)!==Di(dr)?"-":"",_r+"P"+(se?tt+se+"Y":"")+(I?tt+I+"M":"")+(A?hn+A+"D":"")+(G||U||g?"T":"")+(G?Ca+G+"H":"")+(U?Ca+U+"M":"")+(g?Ca+Fe+"S":"")):"P0D"}var Vr=ts.prototype;Vr.isValid=Yx,Vr.abs=C1,Vr.add=E1,Vr.subtract=Ka,Vr.as=Pl,Vr.asMilliseconds=wi,Vr.asSeconds=Rl,Vr.asMinutes=T1,Vr.asHours=cu,Vr.asDays=F1,Vr.asWeeks=ql,Vr.asMonths=Jt,Vr.asQuarters=ic,Vr.asYears=kl,Vr.valueOf=Il,Vr._bubble=Wi,Vr.clone=Na,Vr.get=oc,Vr.milliseconds=Yi,Vr.seconds=Ll,Vr.minutes=dn,Vr.hours=sc,Vr.days=_1,Vr.weeks=uc,Vr.months=O1,Vr.years=B1,Vr.humanize=R1,Vr.toISOString=ds,Vr.toString=ds,Vr.toJSON=ds,Vr.locale=os,Vr.localeData=Sl,Vr.toIsoString=_("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ds),Vr.lang=ru,$("X",0,0,"unix"),$("x",0,0,"valueOf"),nr("x",Xt),nr("X",Ef),ot("X",function(g,A,I){I._d=new Date(parseFloat(g)*1e3)}),ot("x",function(g,A,I){I._d=new Date(Ke(g))});return r.version="2.29.4",t(yt),r.fn=Ve,r.min=Lx,r.max=zx,r.now=Ux,r.utc=d,r.unix=sa,r.months=Bl,r.isDate=o,r.locale=Va,r.invalid=w,r.duration=zr,r.isMoment=S,r.weekdays=M1,r.parseZone=N1,r.localeData=It,r.isDuration=oa,r.monthsShort=A1,r.weekdaysMin=ms,r.defineLocale=pn,r.updateLocale=Ox,r.locales=Bx,r.weekdaysShort=tc,r.normalizeUnits=ue,r.relativeTimeRounding=I1,r.relativeTimeThreshold=ps,r.calendarFormat=Kx,r.prototype=Ve,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})});function _a(e){return _a=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},_a(e)}function Sn(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 nt(e,r){if(r.length1?"s":"")+" required, but only "+r.length+" present")}function Yt(e){nt(1,arguments);var r=Object.prototype.toString.call(e);return e instanceof Date||_a(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 xb(e,r){nt(2,arguments);var t=Yt(e).getTime(),n=Sn(r);return new Date(t+n)}var _q={};function Co(){return _q}function bb(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()}var Oq=365.2425,Bq=Math.pow(10,8)*24*60*60*1e3,wb=6e4,Db=36e5;var nQ=-Bq;var Pq=3600;var sA=Pq*24,aQ=sA*7,Iq=sA*Oq,Rq=Iq/12,iQ=Rq*3;function Sb(e){return nt(1,arguments),e instanceof Date||_a(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Nb(e){if(nt(1,arguments),!Sb(e)&&typeof e!="number")return!1;var r=Yt(e);return!isNaN(Number(r))}function Ab(e,r){nt(2,arguments);var t=Sn(r);return xb(e,-t)}var qq=864e5;function Mb(e){nt(1,arguments);var r=Yt(e),t=r.getTime();r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0);var n=r.getTime(),a=t-n;return Math.floor(a/qq)+1}function Eo(e){nt(1,arguments);var r=1,t=Yt(e),n=t.getUTCDay(),a=(n=a.getTime()?t+1:r.getTime()>=s.getTime()?t:t-1}function Cb(e){nt(1,arguments);var r=hc(e),t=new Date(0);t.setUTCFullYear(r,0,4),t.setUTCHours(0,0,0,0);var n=Eo(t);return n}var kq=6048e5;function Eb(e){nt(1,arguments);var r=Yt(e),t=Eo(r).getTime()-Cb(r).getTime();return Math.round(t/kq)+1}function To(e,r){var t,n,a,i,s,l,c,o;nt(1,arguments);var u=Co(),m=Sn((t=(n=(a=(i=r?.weekStartsOn)!==null&&i!==void 0?i:r==null||(s=r.locale)===null||s===void 0||(l=s.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&a!==void 0?a:u.weekStartsOn)!==null&&n!==void 0?n:(c=u.locale)===null||c===void 0||(o=c.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&t!==void 0?t:0);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Yt(e),h=d.getUTCDay(),y=(h=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(m+1,0,h),y.setUTCHours(0,0,0,0);var v=To(y,r),x=new Date(0);x.setUTCFullYear(m,0,h),x.setUTCHours(0,0,0,0);var w=To(x,r);return u.getTime()>=v.getTime()?m+1:u.getTime()>=w.getTime()?m:m-1}function Tb(e,r){var t,n,a,i,s,l,c,o;nt(1,arguments);var u=Co(),m=Sn((t=(n=(a=(i=r?.firstWeekContainsDate)!==null&&i!==void 0?i:r==null||(s=r.locale)===null||s===void 0||(l=s.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&a!==void 0?a:u.firstWeekContainsDate)!==null&&n!==void 0?n:(c=u.locale)===null||c===void 0||(o=c.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&t!==void 0?t:1),d=vc(e,r),h=new Date(0);h.setUTCFullYear(d,0,m),h.setUTCHours(0,0,0,0);var y=To(h,r);return y}var Lq=6048e5;function Fb(e,r){nt(1,arguments);var t=Yt(e),n=To(t,r).getTime()-Tb(t,r).getTime();return Math.round(n/Lq)+1}function st(e,r){for(var t=e<0?"-":"",n=Math.abs(e).toString();n.length0?n:1-n;return st(t==="yy"?a%100:a,t.length)},M:function(r,t){var n=r.getUTCMonth();return t==="M"?String(n+1):st(n+1,2)},d:function(r,t){return st(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 st(r.getUTCHours()%12||12,t.length)},H:function(r,t){return st(r.getUTCHours(),t.length)},m:function(r,t){return st(r.getUTCMinutes(),t.length)},s:function(r,t){return st(r.getUTCSeconds(),t.length)},S:function(r,t){var n=t.length,a=r.getUTCMilliseconds(),i=Math.floor(a*Math.pow(10,n-3));return st(i,t.length)}},Xi=zq;var vu={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Uq={G:function(r,t,n){var a=r.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});case"GGGG":default:return n.era(a,{width:"wide"})}},y:function(r,t,n){if(t==="yo"){var a=r.getUTCFullYear(),i=a>0?a:1-a;return n.ordinalNumber(i,{unit:"year"})}return Xi.y(r,t)},Y:function(r,t,n,a){var i=vc(r,a),s=i>0?i:1-i;if(t==="YY"){var l=s%100;return st(l,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):st(s,t.length)},R:function(r,t){var n=hc(r);return st(n,t.length)},u:function(r,t){var n=r.getUTCFullYear();return st(n,t.length)},Q:function(r,t,n){var a=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return st(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(r,t,n){var a=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return st(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(r,t,n){var a=r.getUTCMonth();switch(t){case"M":case"MM":return Xi.M(r,t);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(r,t,n){var a=r.getUTCMonth();switch(t){case"L":return String(a+1);case"LL":return st(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(r,t,n,a){var i=Fb(r,a);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):st(i,t.length)},I:function(r,t,n){var a=Eb(r);return t==="Io"?n.ordinalNumber(a,{unit:"week"}):st(a,t.length)},d:function(r,t,n){return t==="do"?n.ordinalNumber(r.getUTCDate(),{unit:"date"}):Xi.d(r,t)},D:function(r,t,n){var a=Mb(r);return t==="Do"?n.ordinalNumber(a,{unit:"dayOfYear"}):st(a,t.length)},E:function(r,t,n){var a=r.getUTCDay();switch(t){case"E":case"EE":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"})}},e:function(r,t,n,a){var i=r.getUTCDay(),s=(i-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return st(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});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"})}},c:function(r,t,n,a){var i=r.getUTCDay(),s=(i-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return st(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(r,t,n){var a=r.getUTCDay(),i=a===0?7:a;switch(t){case"i":return String(i);case"ii":return st(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});case"iiii":default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(r,t,n){var a=r.getUTCHours(),i=a/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(r,t,n){var a=r.getUTCHours(),i;switch(a===12?i=vu.noon:a===0?i=vu.midnight:i=a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(r,t,n){var a=r.getUTCHours(),i;switch(a>=17?i=vu.evening:a>=12?i=vu.afternoon:a>=4?i=vu.morning:i=vu.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(r,t,n){if(t==="ho"){var a=r.getUTCHours()%12;return a===0&&(a=12),n.ordinalNumber(a,{unit:"hour"})}return Xi.h(r,t)},H:function(r,t,n){return t==="Ho"?n.ordinalNumber(r.getUTCHours(),{unit:"hour"}):Xi.H(r,t)},K:function(r,t,n){var a=r.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(a,{unit:"hour"}):st(a,t.length)},k:function(r,t,n){var a=r.getUTCHours();return a===0&&(a=24),t==="ko"?n.ordinalNumber(a,{unit:"hour"}):st(a,t.length)},m:function(r,t,n){return t==="mo"?n.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):Xi.m(r,t)},s:function(r,t,n){return t==="so"?n.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):Xi.s(r,t)},S:function(r,t){return Xi.S(r,t)},X:function(r,t,n,a){var i=a._originalDate||r,s=i.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return fA(s);case"XXXX":case"XX":return ys(s);case"XXXXX":case"XXX":default:return ys(s,":")}},x:function(r,t,n,a){var i=a._originalDate||r,s=i.getTimezoneOffset();switch(t){case"x":return fA(s);case"xxxx":case"xx":return ys(s);case"xxxxx":case"xxx":default:return ys(s,":")}},O:function(r,t,n,a){var i=a._originalDate||r,s=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+uA(s,":");case"OOOO":default:return"GMT"+ys(s,":")}},z:function(r,t,n,a){var i=a._originalDate||r,s=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+uA(s,":");case"zzzz":default:return"GMT"+ys(s,":")}},t:function(r,t,n,a){var i=a._originalDate||r,s=Math.floor(i.getTime()/1e3);return st(s,t.length)},T:function(r,t,n,a){var i=a._originalDate||r,s=i.getTime();return st(s,t.length)}};function uA(e,r){var t=e>0?"-":"+",n=Math.abs(e),a=Math.floor(n/60),i=n%60;if(i===0)return t+String(a);var s=r||"";return t+String(a)+s+st(i,2)}function fA(e,r){if(e%60===0){var t=e>0?"-":"+";return t+st(Math.abs(e)/60,2)}return ys(e,r)}function ys(e,r){var t=r||"",n=e>0?"-":"+",a=Math.abs(e),i=st(Math.floor(a/60),2),s=st(a%60,2);return n+i+t+s}var cA=Uq;var lA=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"})}},mA=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"})}},Wq=function(r,t){var n=r.match(/(P+)(p+)?/)||[],a=n[1],i=n[2];if(!i)return lA(r,t);var s;switch(a){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}}",lA(a,t)).replace("{{time}}",mA(i,t))},Yq={p:mA,P:Wq},pA=Yq;var Hq=["D","DD"],$q=["YY","YYYY"];function dA(e){return Hq.indexOf(e)!==-1}function hA(e){return $q.indexOf(e)!==-1}function _b(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 Gq={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"}},Vq=function(r,t,n){var a,i=Gq[r];return typeof i=="string"?a=i:t===1?a=i.one:a=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a},vA=Vq;function gc(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 Zq={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Qq={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Xq={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Jq={date:gc({formats:Zq,defaultWidth:"full"}),time:gc({formats:Qq,defaultWidth:"full"}),dateTime:gc({formats:Xq,defaultWidth:"full"})},gA=Jq;var Kq={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},jq=function(r,t,n,a){return Kq[r]},yA=jq;function xs(e){return function(r,t){var n=t!=null&&t.context?String(t.context):"standalone",a;if(n==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,s=t!=null&&t.width?String(t.width):i;a=e.formattingValues[s]||e.formattingValues[i]}else{var l=e.defaultWidth,c=t!=null&&t.width?String(t.width):e.defaultWidth;a=e.values[c]||e.values[l]}var o=e.argumentCallback?e.argumentCallback(r):r;return a[o]}}var ek={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},rk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},tk={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"]},nk={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"]},ak={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"}},ik={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"}},ok=function(r,t){var n=Number(r),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},sk={ordinalNumber:ok,era:xs({values:ek,defaultWidth:"wide"}),quarter:xs({values:rk,defaultWidth:"wide",argumentCallback:function(r){return r-1}}),month:xs({values:tk,defaultWidth:"wide"}),day:xs({values:nk,defaultWidth:"wide"}),dayPeriod:xs({values:ak,defaultWidth:"wide",formattingValues:ik,defaultFormattingWidth:"wide"})},xA=sk;function bs(e){return function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,a=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=r.match(a);if(!i)return null;var s=i[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?fk(l,function(m){return m.test(s)}):uk(l,function(m){return m.test(s)}),o;o=e.valueCallback?e.valueCallback(c):c,o=t.valueCallback?t.valueCallback(o):o;var u=r.slice(s.length);return{value:o,rest:u}}}function uk(e,r){for(var t in e)if(e.hasOwnProperty(t)&&r(e[t]))return t}function fk(e,r){for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:{},n=r.match(e.matchPattern);if(!n)return null;var a=n[0],i=r.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];s=t.valueCallback?t.valueCallback(s):s;var l=r.slice(a.length);return{value:s,rest:l}}}var ck=/^(\\d+)(th|st|nd|rd)?/i,lk=/\\d+/i,mk={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},pk={any:[/^b/i,/^(a|c)/i]},dk={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},hk={any:[/1/i,/2/i,/3/i,/4/i]},vk={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},gk={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]},yk={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},xk={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]},bk={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},wk={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}},Dk={ordinalNumber:Ob({matchPattern:ck,parsePattern:lk,valueCallback:function(r){return parseInt(r,10)}}),era:bs({matchPatterns:mk,defaultMatchWidth:"wide",parsePatterns:pk,defaultParseWidth:"any"}),quarter:bs({matchPatterns:dk,defaultMatchWidth:"wide",parsePatterns:hk,defaultParseWidth:"any",valueCallback:function(r){return r+1}}),month:bs({matchPatterns:vk,defaultMatchWidth:"wide",parsePatterns:gk,defaultParseWidth:"any"}),day:bs({matchPatterns:yk,defaultMatchWidth:"wide",parsePatterns:xk,defaultParseWidth:"any"}),dayPeriod:bs({matchPatterns:bk,defaultMatchWidth:"any",parsePatterns:wk,defaultParseWidth:"any"})},bA=Dk;var Sk={code:"en-US",formatDistance:vA,formatLong:gA,formatRelative:yA,localize:xA,match:bA,options:{weekStartsOn:0,firstWeekContainsDate:1}},wA=Sk;var DA=wA;var Nk=/[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g,Ak=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Mk=/^'([^]*?)'?$/,Ck=/''/g,Ek=/[a-zA-Z]/;function Ai(e,r,t){var n,a,i,s,l,c,o,u,m,d,h,y,v,x,w,C,b,N;nt(2,arguments);var M=String(r),S=Co(),O=(n=(a=t?.locale)!==null&&a!==void 0?a:S.locale)!==null&&n!==void 0?n:DA,_=Sn((i=(s=(l=(c=t?.firstWeekContainsDate)!==null&&c!==void 0?c: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:(m=S.locale)===null||m===void 0||(d=m.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(_>=1&&_<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=Sn((h=(y=(v=(x=t?.weekStartsOn)!==null&&x!==void 0?x: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&&y!==void 0?y:(b=S.locale)===null||b===void 0||(N=b.options)===null||N===void 0?void 0:N.weekStartsOn)!==null&&h!==void 0?h:0);if(!(E>=0&&E<=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 T=Yt(e);if(!Nb(T))throw new RangeError("Invalid time value");var R=bb(T),L=Ab(T,R),H={firstWeekContainsDate:_,weekStartsOn:E,locale:O,_originalDate:T},V=M.match(Ak).map(function(W){var k=W[0];if(k==="p"||k==="P"){var q=pA[k];return q(W,O.formatLong)}return W}).join("").match(Nk).map(function(W){if(W==="''")return"'";var k=W[0];if(k==="'")return Tk(W);var q=cA[k];if(q)return!(t!=null&&t.useAdditionalWeekYearTokens)&&hA(W)&&_b(W,r,String(e)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&dA(W)&&_b(W,r,String(e)),q(L,W,O.localize,H);if(k.match(Ek))throw new RangeError("Format string contains an unescaped latin alphabet character \`"+k+"\`");return W}).join("");return V}function Tk(e){var r=e.match(Mk);return r?r[1].replace(Ck,"'"):e}function Bb(e,r){if(_a(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(_a(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Pb(e){var r=Bb(e,"string");return _a(r)=="symbol"?r:r+""}function Hr(e,r,t){return r=Pb(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function om(e,r){var t;nt(1,arguments);var n=Sn((t=r?.additionalDigits)!==null&&t!==void 0?t:2);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var a=Bk(e),i;if(a.date){var s=Pk(a.date,n);i=Ik(s.restDateString,s.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);var l=i.getTime(),c=0,o;if(a.time&&(c=Rk(a.time),isNaN(c)))return new Date(NaN);if(a.timezone){if(o=qk(a.timezone),isNaN(o))return new Date(NaN)}else{var u=new Date(l+c),m=new Date(0);return m.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),m.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),m}return new Date(l+c+o)}var im={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Fk=/^-?(?:(\\d{3})|(\\d{2})(?:-?(\\d{2}))?|W(\\d{2})(?:-?(\\d{1}))?|)$/,_k=/^(\\d{2}(?:[.,]\\d*)?)(?::?(\\d{2}(?:[.,]\\d*)?))?(?::?(\\d{2}(?:[.,]\\d*)?))?$/,Ok=/^([+-])(\\d{2})(?::?(\\d{2}))?$/;function Bk(e){var r={},t=e.split(im.dateTimeDelimiter),n;if(t.length>2)return r;if(/:/.test(t[0])?n=t[0]:(r.date=t[0],n=t[1],im.timeZoneDelimiter.test(r.date)&&(r.date=e.split(im.timeZoneDelimiter)[0],n=e.substr(r.date.length,e.length))),n){var a=im.timezone.exec(n);a?(r.time=n.replace(a[1],""),r.timezone=a[1]):r.time=n}return r}function Pk(e,r){var t=new RegExp("^(?:(\\\\d{4}|[+-]\\\\d{"+(4+r)+"})|(\\\\d{2}|[+-]\\\\d{"+(2+r)+"})$)"),n=e.match(t);if(!n)return{year:NaN,restDateString:""};var a=n[1]?parseInt(n[1]):null,i=n[2]?parseInt(n[2]):null;return{year:i===null?a:i*100,restDateString:e.slice((n[1]||n[2]).length)}}function Ik(e,r){if(r===null)return new Date(NaN);var t=e.match(Fk);if(!t)return new Date(NaN);var n=!!t[4],a=yc(t[1]),i=yc(t[2])-1,s=yc(t[3]),l=yc(t[4]),c=yc(t[5])-1;if(n)return Wk(r,l,c)?kk(r,l,c):new Date(NaN);var o=new Date(0);return!zk(r,i,s)||!Uk(r,a)?new Date(NaN):(o.setUTCFullYear(r,i,Math.max(a,s)),o)}function yc(e){return e?parseInt(e):1}function Rk(e){var r=e.match(_k);if(!r)return NaN;var t=Ib(r[1]),n=Ib(r[2]),a=Ib(r[3]);return Yk(t,n,a)?t*Db+n*wb+a*1e3:NaN}function Ib(e){return e&&parseFloat(e.replace(",","."))||0}function qk(e){if(e==="Z")return 0;var r=e.match(Ok);if(!r)return 0;var t=r[1]==="+"?-1:1,n=parseInt(r[2]),a=r[3]&&parseInt(r[3])||0;return Hk(n,a)?t*(n*Db+a*wb):NaN}function kk(e,r,t){var n=new Date(0);n.setUTCFullYear(e,0,4);var a=n.getUTCDay()||7,i=(r-1)*7+t+1-a;return n.setUTCDate(n.getUTCDate()+i),n}var Lk=[31,null,31,30,31,30,31,31,30,31,30,31];function SA(e){return e%400===0||e%4===0&&e%100!==0}function zk(e,r,t){return r>=0&&r<=11&&t>=1&&t<=(Lk[r]||(SA(e)?29:28))}function Uk(e,r){return r>=1&&r<=(SA(e)?366:365)}function Wk(e,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function Yk(e,r,t){return e===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&e>=0&&e<25}function Hk(e,r){return r>=0&&r<=59}var pa=e=>[...new Set(e)];var NA=(e,r)=>e.sort(function(t,n){let a=r.indexOf(t),i=r.indexOf(n);return a>i?a!=-1&&i==-1?-1:1:i!=-1&&a==-1?1:-1});var Xn="File";function sm(e){return Array.isArray(e)?e:typeof e=="string"?[e]:[]}var AA=(e,r)=>r.indexOf(e)>0?r.indexOf(e):r.length;var xc=e=>"spaces://"+e;var MA=e=>e.charAt(0)=="/"?e.substring(1):e;var Rb=(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"tags-multi";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=gn(e)),r=="tag"||r=="tags")return"tags-multi";if(t.length==1&&Array.isArray(t[0])&&t[0].length==1&&typeof t[0][0]=="string")return"link";let n=pa(t.map(a=>Rb(a,r)));return n.length==1&&n[0]=="link"?"link-multi":n.some(a=>a=="object")?"object-multi":"option-multi"}else return e.isLuxonDateTime?"date":e.isLuxonDuration?"duration":e.type=="file"?"link":typeof e=="object"&&!Array.isArray(e)&&e!==null?"object":"unknown";else return"unknown"}return"text"};var qb=(e,r,t)=>e=="object"||e=="object-multi"?JSON.parse(r):e=="number"?parseFloat(r):e=="boolean"?r=="true":e.includes("-multi")?gn(r).map(n=>qb(e.replace("-multi",""),n,t)):(e.includes("link")||e.includes("context"))&&t?\`[[\${r}]]\`:r;var CA=e=>e.map(r=>r.replace(",","\\\\,")).join(", "),ws=e=>JSON.stringify(e);var gn=e=>e?.startsWith("[")?sm(bc(e)):$k(e),$k=e=>(e?.replace("\\\\,",",")?.match(/(\\\\.|[^,])+/g)??[]).map(r=>r.trim()),Ds=(e,r)=>{switch(Rb(r,e)){case"tags-multi":return r;case"object":case"object-multi":return JSON.stringify(r);case"number":return r.toString();case"boolean":return r?"true":"false";case"date":{if(r instanceof Date){let n=Ai(r,"yyyy-MM-dd");return typeof n=="string"?n:""}return typeof r!="string"?"":r}break;case"duration":return CA(Object.keys(r.values).reduce((n,a)=>[...n,...r.values[a]>0?[r.values[a]+" "+a]:[]],[]));case"option-multi":case"link-multi":return typeof r=="string"?wc(r):ws(r.map(n=>n?typeof n=="string"?wc(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"?wc(r):r.path;case"text":case"tag":case"image":return r}return""};var bc=e=>{let r;try{r=JSON.parse(e)}catch{}return r};var wc=e=>{if(!e)return"";let r=/\\[\\[(.*?)\\]\\]/g.exec(e),t=r?.length>1?r[1].substring(0,AA("|",r[1])):e;return t||e};var yu=ma(um());var kb=e=>(0,yu.isNumber)(e)?new Date(e):(0,yu.isString)(e)?om(e):(0,yu.isDate)(e)?e:new Date;var EA=(e,r,t)=>{let n=e[0];if(!n.isSymbolNode||e.length!==3)return"";let a=n.name,i=e[1];return r.evaluate(\`\${a} = \${i.toString()}\`,t),e[2].compile().evaluate(t)};EA.rawArgs=!0;var TA=(e,r,t)=>{if(e.length%2!==1)return"";for(let a=0;a{if(e.length!==1)return"";let n=e.map(function(i){return i.compile().evaluate(t)});return t.get("$paths").get(n[0])};FA.rawArgs=!0;var _A=(e,r,t)=>t?.get("$current");_A.rawArgs=!0;var OA=(e,r,t)=>t?.get("$index");OA.rawArgs=!0;var BA=(e,r,t)=>{if(e.length!==2)return"";let n=e[0].compile().evaluate?e[0].compile().evaluate(t):e[0];return Array.isArray(n)?n.find((a,i)=>{t.set("$current",a),t.set("$index",i),r.evaluate("current = _current(); index = _index()",t);let s=e[1].compile().evaluate?e[1].compile().evaluate(t):e[1];return a===s})??"":""};BA.rawArgs=!0;var PA=(e,r,t)=>{if(e.length!==2)return"";let n=e[0].compile().evaluate?e[0].compile().evaluate(t):e[0];return Array.isArray(n)?n.findIndex((a,i)=>{t.set("$current",a),t.set("$index",i),r.evaluate("current = _current(); index = _index()",t);let s=e[1].compile().evaluate?e[1].compile().evaluate(t):e[1];return a===s}):""};PA.rawArgs=!0;var IA=(e,r,t)=>{if(e.length!==2)return"";let n=e[0].compile().evaluate?e[0].compile().evaluate(t):e[0];return Array.isArray(n)?n.filter((a,i)=>(t.set("$current",a),t.set("$index",i),r.evaluate("current = _current(); index = _index()",t),e[1].compile().evaluate(t))):""};IA.rawArgs=!0;var RA=(e,r,t)=>{if(e.length!==2)return"";let n=e[0].compile().evaluate?e[0].compile().evaluate(t):e[0];return Array.isArray(n)?n.map((a,i)=>(t.set("$current",a),t.set("$index",i),r.evaluate("current = _current(); index = _index()",t),e[1].compile().evaluate(t))):""};RA.rawArgs=!0;var qA=(e,r,t)=>{if(e.length!==2)return"";let n=e[0].compile().evaluate?e[0].compile().evaluate(t):e[0];return Array.isArray(n)?n.some((a,i)=>(t.set("$current",a),t.set("$index",i),r.evaluate("current = _current(); index = _index()",t),e[1].compile().evaluate(t))):""};qA.rawArgs=!0;var kA=(e,r,t)=>{if(e.length!==2)return"";let n=e[0].compile().evaluate?e[0].compile().evaluate(t):e[0];return Array.isArray(n)?n.every((a,i)=>(t.set("$current",a),t.set("$index",i),r.evaluate("current = _current(); index = _index()",t),e[1].compile().evaluate(t))):""};kA.rawArgs=!0;var LA=(e,r,t)=>{if(e.length!==1)return"";let n=e[0].compile().evaluate?e[0].compile().evaluate(t):e[0];return Array.isArray(n)?n.flat():""};LA.rawArgs=!0;var zA=(e,r,t)=>{if(e.length!==1)return"";let n=e.map(function(s){return s.compile().evaluate(t)}),a=t.get("$properties")?.[n[0]]?.type,i=qb(a,t.get(n[0]));return(a=="file"||a=="link"||a=="context")&&(a.includes("multi")?i=gn(i).map(s=>t.get("$paths").get(s)??s):i=t.get("$paths").get(i)??i),a=="date"&&(i=kb(i)),i??""};zA.rawArgs=!0;var UA=(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 a=e[1]?.compile().evaluate(t);return a?.length>0?Ai(n,a):Ai(n,t.get("$settings")?.dateFormat??"yyyy-MM-dd")};WA.rawArgs=!0;var kn=e=>typeof e=="string"||e instanceof String?e:e instanceof Date?Ai(e,"yyyy-MM-dd"):typeof e=="number"?e.toFixed(0):e?.path?e.path:"",Lb={prop:zA,_current:_A,_index:OA,slice:(e,r,t)=>(e=kn(e),e.slice(r,t)),if:(e,r,t)=>e===!0?r:t,ifs:UA,empty:e=>e.length!==1?"":Array.isArray(e[0])?e[0].length===0:e[0]===""?"true":"false",length:e=>e.length,values:e=>e.flat().length,uniques:e=>pa(e.flat()).length,substring:(e,r,t)=>(e=kn(e),t?e.substring(r,t):e.substring(r)),startsWith:(e,r)=>(e=kn(e),r=kn(r),e.startsWith(r)),contains:(e,r)=>(e=kn(e),r=kn(r),e.includes(r)),test:(e,r)=>(e=kn(e),new RegExp(r).test(e)),match:(e,r)=>(e=kn(e),e.match(new RegExp(r))),replace:(e,r,t)=>(e=kn(e),e.replace(new RegExp(r),t)),replaceAll:(e,r,t)=>(e=kn(e),r=kn(r),t=kn(t),e.replace(new RegExp(r,"g"),t)),lower:e=>(e=kn(e),e.toLowerCase()),upper:e=>(e=kn(e),e.toUpperCase()),repeat:(e,r)=>e.repeat(r),format:kn,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=>Ai(e,"w"),month:e=>e.getMonth()+1,year:e=>e.getFullYear(),pad:(e,r,t)=>e.padStart(r,t),range:e=>Math.max(...e)-Math.min(...e),latest:e=>new Date(Math.max(...e.map(r=>r.getTime()))),earliest:e=>new Date(Math.min(...e.map(r=>r.getTime()))),dateRange:(e,r)=>{let t=Math.abs(Math.max(...e.map(n=>n.getTime()))-Math.min(...e.map(n=>n.getTime())));return r.startsWith("day")?t/(1e3*60*60*24):r.startsWith("month")?t/(1e3*60*60*24*30):r.startsWith("year")?t/(1e3*60*60*24*365):r.startsWith("hour")?t/(1e3*60*60):r.startsWith("minute")?t/(1e3*60):r.startsWith("second")?t/1e3:r.startsWith("week")?t/(1e3*60*60*24*7):r.startsWith("quarter")?t/(1e3*60*60*24*30*3):t/(1e3*60*60*24)},dateAdd:(e,r,t)=>(t.startsWith("day")&&e.setDate(e.getDate()+r),t.startsWith("month")&&e.setMonth(e.getMonth()+r),t.startsWith("year")&&e.setFullYear(e.getFullYear()+r),t.startsWith("quarter")&&e.setMonth(e.getMonth()+r*3),t.startsWith("week")&&e.setDate(e.getDate()+r*7),t.startsWith("hour")&&e.setHours(e.getHours()+r),t.startsWith("minute")&&e.setMinutes(e.getMinutes()+r),t.startsWith("second")&&e.setSeconds(e.getSeconds()+r),e),dateSubtract:(e,r,t)=>(t.startsWith("day")&&e.setDate(e.getDate()-r),t.startsWith("month")&&e.setMonth(e.getMonth()-r),t.startsWith("year")&&e.setFullYear(e.getFullYear()-r),t.startsWith("quarter")&&e.setMonth(e.getMonth()-r*3),t.startsWith("week")&&e.setDate(e.getDate()-r*7),t.startsWith("hour")&&e.setHours(e.getHours()-r),t.startsWith("minute")&&e.setMinutes(e.getMinutes()-r),t.startsWith("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(),at:(e,r)=>e[r],first:e=>e[0],last:e=>e[e.length-1],concat:(e,r)=>e.concat(r),sort:e=>e.sort((r,t)=>t-r),reverse:e=>e.reverse(),join:(e,r)=>e.join(r),includes:(e,r)=>e.includes(r),split:(e,r)=>e.split(r),formatDate:WA,parseDate:e=>kb(e),find:BA,findIndex:PA,filter:IA,map:RA,some:qA,every:kA,flat:LA,path:FA,let:EA,lets:TA};function ht(){return ht=Object.assign?Object.assign.bind():function(e){for(var r=1;re[r])}var Dm=["Matrix","Array"],Sm=["number","BigNumber","Fraction"];function ZA(e,r){function t(n){if(n){var a=wu(e,ar);VA(n,"matrix",Dm),VA(n,"number",Sm),zb(e,n);var i=wu(e,ar),s=wu(n,ar);return r("config",i,a,s),i}else return wu(e,ar)}return t.MATRIX_OPTIONS=Dm,t.NUMBER_OPTIONS=Sm,Object.keys(Ss).forEach(n=>{Object.defineProperty(t,n,{get:()=>e[n],enumerable:!0,configurable:!0})}),t}function Gk(e,r){return e.indexOf(r)!==-1}function VA(e,r,t){e[r]!==void 0&&!Gk(t,e[r])&&console.warn('Warning: Unknown value "'+e[r]+'" for configuration option "'+r+'". Available options: '+t.map(n=>JSON.stringify(n)).join(", ")+".")}var Oe=function(r){if(r)throw new Error(\`The global config is readonly. +\`+new Error().stack),I=!1}return A.apply(this,arguments)},A)}var E={};function T(g,A){r.deprecationHandler!=null&&r.deprecationHandler(g,A),E[g]||(O(A),E[g]=!0)}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null;function R(g){return typeof Function<"u"&&g instanceof Function||Object.prototype.toString.call(g)==="[object Function]"}function L(g){var A,I;for(I in g)i(g,I)&&(A=g[I],R(A)?this[I]=A:this["_"+I]=A);this._config=g,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\\d{1,2}/.source)}function H(g,A){var I=m({},g),U;for(U in A)i(A,U)&&(a(g[U])&&a(A[U])?(I[U]={},m(I[U],g[U]),m(I[U],A[U])):A[U]!=null?I[U]=A[U]:delete I[U]);for(U in g)i(g,U)&&!i(A,U)&&a(g[U])&&(I[U]=m({},I[U]));return I}function V(g){g!=null&&this.set(g)}var W;Object.keys?W=Object.keys:W=function(g){var A,I=[];for(A in g)i(g,A)&&I.push(A);return I};var k={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function q(g,A,I){var U=this._calendar[g]||this._calendar.sameElse;return R(U)?U.call(A,I):U}function K(g,A,I){var U=""+Math.abs(g),G=A-U.length,se=g>=0;return(se?I?"+":"":"-")+Math.pow(10,Math.max(0,G)).toString().substr(1)+U}var z=/(\\[[^\\[]*\\])|(\\\\)?([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,le={},ae={};function $(g,A,I,U){var G=U;typeof U=="string"&&(G=function(){return this[U]()}),g&&(ae[g]=G),A&&(ae[A[0]]=function(){return K(G.apply(this,arguments),A[1],A[2])}),I&&(ae[I]=function(){return this.localeData().ordinal(G.apply(this,arguments),g)})}function me(g){return g.match(/\\[[\\s\\S]/)?g.replace(/^\\[|\\]$/g,""):g.replace(/\\\\/g,"")}function Ee(g){var A=g.match(z),I,U;for(I=0,U=A.length;I=0&&oe.test(g);)g=g.replace(oe,U),oe.lastIndex=0,I-=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 ye(g){var A=this._longDateFormat[g],I=this._longDateFormat[g.toUpperCase()];return A||!I?A:(this._longDateFormat[g]=I.match(z).map(function(U){return U==="MMMM"||U==="MM"||U==="DD"||U==="dddd"?U.slice(1):U}).join(""),this._longDateFormat[g])}var be="Invalid date";function De(){return this._invalidDate}var Ae="%d",We=/\\d{1,2}/;function Je(g){return this._ordinal.replace("%d",g)}var J={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 re(g,A,I,U){var G=this._relativeTime[I];return R(G)?G(g,A,I,U):G.replace(/%d/i,g)}function xe(g,A){var I=this._relativeTime[g>0?"future":"past"];return R(I)?I(A):I.replace(/%s/i,A)}var j={};function ne(g,A){var I=g.toLowerCase();j[I]=j[I+"s"]=j[A]=g}function ue(g){return typeof g=="string"?j[g]||j[g.toLowerCase()]:void 0}function Me(g){var A={},I,U;for(U in g)i(g,U)&&(I=ue(U),I&&(A[I]=g[U]));return A}var Ce={};function Le(g,A){Ce[g]=A}function Ie(g){var A=[],I;for(I in g)i(g,I)&&A.push({unit:I,priority:Ce[I]});return A.sort(function(U,G){return U.priority-G.priority}),A}function fr(g){return g%4===0&&g%100!==0||g%400===0}function or(g){return g<0?Math.ceil(g)||0:Math.floor(g)}function Ke(g){var A=+g,I=0;return A!==0&&isFinite(A)&&(I=or(A)),I}function Pr(g,A){return function(I){return I!=null?(ce(this,g,I),r.updateOffset(this,A),this):ee(this,g)}}function ee(g,A){return g.isValid()?g._d["get"+(g._isUTC?"UTC":"")+A]():NaN}function ce(g,A,I){g.isValid()&&!isNaN(I)&&(A==="FullYear"&&fr(g.year())&&g.month()===1&&g.date()===29?(I=Ke(I),g._d["set"+(g._isUTC?"UTC":"")+A](I,g.month(),fo(I,g.month()))):g._d["set"+(g._isUTC?"UTC":"")+A](I))}function we(g){return g=ue(g),R(this[g])?this[g]():this}function Be(g,A){if(typeof g=="object"){g=Me(g);var I=Ie(g),U,G=I.length;for(U=0;U68?1900:2e3)};var kf=Pr("FullYear",!0);function vx(){return fr(this.year())}function Gc(g,A,I,U,G,se,Fe){var dr;return g<100&&g>=0?(dr=new Date(g+400,A,I,U,G,se,Fe),isFinite(dr.getFullYear())&&dr.setFullYear(g)):dr=new Date(g,A,I,U,G,se,Fe),dr}function co(g){var A,I;return g<100&&g>=0?(I=Array.prototype.slice.call(arguments),I[0]=g+400,A=new Date(Date.UTC.apply(null,I)),isFinite(A.getUTCFullYear())&&A.setUTCFullYear(g)):A=new Date(Date.UTC.apply(null,arguments)),A}function lo(g,A,I){var U=7+A-I,G=(7+co(g,0,U).getUTCDay()-A)%7;return-G+U-1}function Vc(g,A,I,U,G){var se=(7+I-U)%7,Fe=lo(g,U,G),dr=1+7*(A-1)+se+Fe,_r,tt;return dr<=0?(_r=g-1,tt=di(_r)+dr):dr>di(g)?(_r=g+1,tt=dr-di(g)):(_r=g,tt=dr),{year:_r,dayOfYear:tt}}function mo(g,A,I){var U=lo(g.year(),A,I),G=Math.floor((g.dayOfYear()-U-1)/7)+1,se,Fe;return G<1?(Fe=g.year()-1,se=G+ia(Fe,A,I)):G>ia(g.year(),A,I)?(se=G-ia(g.year(),A,I),Fe=g.year()+1):(Fe=g.year(),se=G),{week:se,year:Fe}}function ia(g,A,I){var U=lo(g,A,I),G=lo(g+1,A,I);return(di(g)-U+G)/7}$("w",["ww",2],"wo","week"),$("W",["WW",2],"Wo","isoWeek"),ne("week","w"),ne("isoWeek","W"),Le("week",5),Le("isoWeek",5),nr("w",Q),nr("ww",Q,Te),nr("W",Q),nr("WW",Q,Te),Ii(["w","ww","W","WW"],function(g,A,I,U){A[U.substr(0,1)]=Ke(g)});function Lf(g){return mo(g,this._week.dow,this._week.doy).week}var po={dow:0,doy:6};function Zc(){return this._week.dow}function Qc(){return this._week.doy}function gx(g){var A=this.localeData().week(this);return g==null?A:this.add((g-A)*7,"d")}function Xc(g){var A=mo(this,1,4).week;return g==null?A:this.add((g-A)*7,"d")}$("d",0,"do","day"),$("dd",0,0,function(g){return this.localeData().weekdaysMin(this,g)}),$("ddd",0,0,function(g){return this.localeData().weekdaysShort(this,g)}),$("dddd",0,0,function(g){return this.localeData().weekdays(this,g)}),$("e",0,0,"weekday"),$("E",0,0,"isoWeekday"),ne("day","d"),ne("weekday","e"),ne("isoWeekday","E"),Le("day",11),Le("weekday",11),Le("isoWeekday",11),nr("d",Q),nr("e",Q),nr("E",Q),nr("dd",function(g,A){return A.weekdaysMinRegex(g)}),nr("ddd",function(g,A){return A.weekdaysShortRegex(g)}),nr("dddd",function(g,A){return A.weekdaysRegex(g)}),Ii(["dd","ddd","dddd"],function(g,A,I,U){var G=I._locale.weekdaysParse(g,U,I._strict);G!=null?A.d=G:y(I).invalidWeekday=g}),Ii(["d","e","E"],function(g,A,I,U){A[U]=Ke(g)});function Jc(g,A){return typeof g!="string"?g:isNaN(g)?(g=A.weekdaysParse(g),typeof g=="number"?g:null):parseInt(g,10)}function Kc(g,A){return typeof g=="string"?A.weekdaysParse(g)%7||7:isNaN(g)?null:g}function Ys(g,A){return g.slice(A,7).concat(g.slice(0,A))}var yx="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),jc="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),xx="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),el=Ha,bx=Ha,wx=Ha;function Dx(g,A){var I=n(this._weekdays)?this._weekdays:this._weekdays[g&&g!==!0&&this._weekdays.isFormat.test(A)?"format":"standalone"];return g===!0?Ys(I,this._week.dow):g?I[g.day()]:I}function Sx(g){return g===!0?Ys(this._weekdaysShort,this._week.dow):g?this._weekdaysShort[g.day()]:this._weekdaysShort}function zf(g){return g===!0?Ys(this._weekdaysMin,this._week.dow):g?this._weekdaysMin[g.day()]:this._weekdaysMin}function Nx(g,A,I){var U,G,se,Fe=g.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],U=0;U<7;++U)se=d([2e3,1]).day(U),this._minWeekdaysParse[U]=this.weekdaysMin(se,"").toLocaleLowerCase(),this._shortWeekdaysParse[U]=this.weekdaysShort(se,"").toLocaleLowerCase(),this._weekdaysParse[U]=this.weekdays(se,"").toLocaleLowerCase();return I?A==="dddd"?(G=vt.call(this._weekdaysParse,Fe),G!==-1?G:null):A==="ddd"?(G=vt.call(this._shortWeekdaysParse,Fe),G!==-1?G:null):(G=vt.call(this._minWeekdaysParse,Fe),G!==-1?G:null):A==="dddd"?(G=vt.call(this._weekdaysParse,Fe),G!==-1||(G=vt.call(this._shortWeekdaysParse,Fe),G!==-1)?G:(G=vt.call(this._minWeekdaysParse,Fe),G!==-1?G:null)):A==="ddd"?(G=vt.call(this._shortWeekdaysParse,Fe),G!==-1||(G=vt.call(this._weekdaysParse,Fe),G!==-1)?G:(G=vt.call(this._minWeekdaysParse,Fe),G!==-1?G:null)):(G=vt.call(this._minWeekdaysParse,Fe),G!==-1||(G=vt.call(this._weekdaysParse,Fe),G!==-1)?G:(G=vt.call(this._shortWeekdaysParse,Fe),G!==-1?G:null))}function Ax(g,A,I){var U,G,se;if(this._weekdaysParseExact)return Nx.call(this,g,A,I);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),U=0;U<7;U++){if(G=d([2e3,1]).day(U),I&&!this._fullWeekdaysParse[U]&&(this._fullWeekdaysParse[U]=new RegExp("^"+this.weekdays(G,"").replace(".","\\\\.?")+"$","i"),this._shortWeekdaysParse[U]=new RegExp("^"+this.weekdaysShort(G,"").replace(".","\\\\.?")+"$","i"),this._minWeekdaysParse[U]=new RegExp("^"+this.weekdaysMin(G,"").replace(".","\\\\.?")+"$","i")),this._weekdaysParse[U]||(se="^"+this.weekdays(G,"")+"|^"+this.weekdaysShort(G,"")+"|^"+this.weekdaysMin(G,""),this._weekdaysParse[U]=new RegExp(se.replace(".",""),"i")),I&&A==="dddd"&&this._fullWeekdaysParse[U].test(g))return U;if(I&&A==="ddd"&&this._shortWeekdaysParse[U].test(g))return U;if(I&&A==="dd"&&this._minWeekdaysParse[U].test(g))return U;if(!I&&this._weekdaysParse[U].test(g))return U}}function Mx(g){if(!this.isValid())return g!=null?this:NaN;var A=this._isUTC?this._d.getUTCDay():this._d.getDay();return g!=null?(g=Jc(g,this.localeData()),this.add(g-A,"d")):A}function Cx(g){if(!this.isValid())return g!=null?this:NaN;var A=(this.day()+7-this.localeData()._week.dow)%7;return g==null?A:this.add(g-A,"d")}function Ex(g){if(!this.isValid())return g!=null?this:NaN;if(g!=null){var A=Kc(g,this.localeData());return this.day(this.day()%7?A:A-7)}else return this.day()||7}function xt(g){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Uf.call(this),g?this._weekdaysStrictRegex:this._weekdaysRegex):(i(this,"_weekdaysRegex")||(this._weekdaysRegex=el),this._weekdaysStrictRegex&&g?this._weekdaysStrictRegex:this._weekdaysRegex)}function gt(g){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Uf.call(this),g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(i(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=bx),this._weekdaysShortStrictRegex&&g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Tx(g){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Uf.call(this),g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(i(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=wx),this._weekdaysMinStrictRegex&&g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Uf(){function g(hn,Ca){return Ca.length-hn.length}var A=[],I=[],U=[],G=[],se,Fe,dr,_r,tt;for(se=0;se<7;se++)Fe=d([2e3,1]).day(se),dr=mn(this.weekdaysMin(Fe,"")),_r=mn(this.weekdaysShort(Fe,"")),tt=mn(this.weekdays(Fe,"")),A.push(dr),I.push(_r),U.push(tt),G.push(dr),G.push(_r),G.push(tt);A.sort(g),I.sort(g),U.sort(g),G.sort(g),this._weekdaysRegex=new RegExp("^("+G.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+U.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+I.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+A.join("|")+")","i")}function Wf(){return this.hours()%12||12}function Fx(){return this.hours()||24}$("H",["HH",2],0,"hour"),$("h",["hh",2],0,Wf),$("k",["kk",2],0,Fx),$("hmm",0,0,function(){return""+Wf.apply(this)+K(this.minutes(),2)}),$("hmmss",0,0,function(){return""+Wf.apply(this)+K(this.minutes(),2)+K(this.seconds(),2)}),$("Hmm",0,0,function(){return""+this.hours()+K(this.minutes(),2)}),$("Hmmss",0,0,function(){return""+this.hours()+K(this.minutes(),2)+K(this.seconds(),2)});function rl(g,A){$(g,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),A)})}rl("a",!0),rl("A",!1),ne("hour","h"),Le("hour",13);function tl(g,A){return A._meridiemParse}nr("a",tl),nr("A",tl),nr("H",Q),nr("h",Q),nr("k",Q),nr("HH",Q,Te),nr("hh",Q,Te),nr("kk",Q,Te),nr("hmm",ve),nr("hmmss",Pe),nr("Hmm",ve),nr("Hmmss",Pe),ot(["H","HH"],Tt),ot(["k","kk"],function(g,A,I){var U=Ke(g);A[Tt]=U===24?0:U}),ot(["a","A"],function(g,A,I){I._isPm=I._locale.isPM(g),I._meridiem=g}),ot(["h","hh"],function(g,A,I){A[Tt]=Ke(g),y(I).bigHour=!0}),ot("hmm",function(g,A,I){var U=g.length-2;A[Tt]=Ke(g.substr(0,U)),A[On]=Ke(g.substr(U)),y(I).bigHour=!0}),ot("hmmss",function(g,A,I){var U=g.length-4,G=g.length-2;A[Tt]=Ke(g.substr(0,U)),A[On]=Ke(g.substr(U,2)),A[aa]=Ke(g.substr(G)),y(I).bigHour=!0}),ot("Hmm",function(g,A,I){var U=g.length-2;A[Tt]=Ke(g.substr(0,U)),A[On]=Ke(g.substr(U))}),ot("Hmmss",function(g,A,I){var U=g.length-4,G=g.length-2;A[Tt]=Ke(g.substr(0,U)),A[On]=Ke(g.substr(U,2)),A[aa]=Ke(g.substr(G))});function nl(g){return(g+"").toLowerCase().charAt(0)==="p"}var _x=/[ap]\\.?m?\\.?/i,Vt=Pr("Hours",!0);function Yf(g,A,I){return g>11?I?"pm":"PM":I?"am":"AM"}var hi={calendar:k,longDateFormat:Se,invalidDate:be,ordinal:Ae,dayOfMonthOrdinalParse:We,relativeTime:J,months:Pf,monthsShort:Ls,week:po,weekdays:yx,weekdaysMin:xx,weekdaysShort:jc,meridiemParse:_x},bt={},qi={},sn;function al(g,A){var I,U=Math.min(g.length,A.length);for(I=0;I0;){if(G=es(se.slice(0,I).join("-")),G)return G;if(U&&U.length>=I&&al(se,U)>=I-1)break;I--}A++}return sn}function ol(g){return g.match("^[^/\\\\\\\\]*$")!=null}function es(g){var A=null,I;if(bt[g]===void 0&&typeof Nf<"u"&&Nf&&Nf.exports&&ol(g))try{A=sn._abbr,I=require,I("./locale/"+g),Va(A)}catch{bt[g]=null}return bt[g]}function Va(g,A){var I;return g&&(l(A)?I=It(g):I=pn(g,A),I?sn=I:typeof console<"u"&&console.warn&&console.warn("Locale "+g+" not found. Did you forget to load it?")),sn._abbr}function pn(g,A){if(A!==null){var I,U=hi;if(A.abbr=g,bt[g]!=null)T("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=bt[g]._config;else if(A.parentLocale!=null)if(bt[A.parentLocale]!=null)U=bt[A.parentLocale]._config;else if(I=es(A.parentLocale),I!=null)U=I._config;else return qi[A.parentLocale]||(qi[A.parentLocale]=[]),qi[A.parentLocale].push({name:g,config:A}),null;return bt[g]=new V(H(U,A)),qi[g]&&qi[g].forEach(function(G){pn(G.name,G.config)}),Va(g),bt[g]}else return delete bt[g],null}function Ox(g,A){if(A!=null){var I,U,G=hi;bt[g]!=null&&bt[g].parentLocale!=null?bt[g].set(H(bt[g]._config,A)):(U=es(g),U!=null&&(G=U._config),A=H(G,A),U==null&&(A.abbr=g),I=new V(A),I.parentLocale=bt[g],bt[g]=I),Va(g)}else bt[g]!=null&&(bt[g].parentLocale!=null?(bt[g]=bt[g].parentLocale,g===Va()&&Va(g)):bt[g]!=null&&delete bt[g]);return bt[g]}function It(g){var A;if(g&&g._locale&&g._locale._abbr&&(g=g._locale._abbr),!g)return sn;if(!n(g)){if(A=es(g),A)return A;g=[g]}return il(g)}function Bx(){return W(bt)}function Hs(g){var A,I=g._a;return I&&y(g).overflow===-2&&(A=I[Un]<0||I[Un]>11?Un:I[Wn]<1||I[Wn]>fo(I[Gt],I[Un])?Wn:I[Tt]<0||I[Tt]>24||I[Tt]===24&&(I[On]!==0||I[aa]!==0||I[$a]!==0)?Tt:I[On]<0||I[On]>59?On:I[aa]<0||I[aa]>59?aa:I[$a]<0||I[$a]>999?$a:-1,y(g)._overflowDayOfYear&&(AWn)&&(A=Wn),y(g)._overflowWeeks&&A===-1&&(A=Of),y(g)._overflowWeekday&&A===-1&&(A=uo),y(g).overflow=A),g}var vi=/^\\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)?)?$/,$s=/^\\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)?)?$/,$f=/Z|[+-]\\d\\d(?::?\\d\\d)?/,dt=[["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]],Da=[["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/]],Gf=/^\\/?Date\\((-?\\d+)/i,Px=/^(?:(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}))$/,Vf={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 sl(g){var A,I,U=g._i,G=vi.exec(U)||$s.exec(U),se,Fe,dr,_r,tt=dt.length,hn=Da.length;if(G){for(y(g).iso=!0,A=0,I=tt;Adi(Fe)||g._dayOfYear===0)&&(y(g)._overflowDayOfYear=!0),I=co(Fe,0,g._dayOfYear),g._a[Un]=I.getUTCMonth(),g._a[Wn]=I.getUTCDate()),A=0;A<3&&g._a[A]==null;++A)g._a[A]=U[A]=G[A];for(;A<7;A++)g._a[A]=U[A]=g._a[A]==null?A===2?1:0:g._a[A];g._a[Tt]===24&&g._a[On]===0&&g._a[aa]===0&&g._a[$a]===0&&(g._nextDay=!0,g._a[Tt]=0),g._d=(g._useUTC?co:Gc).apply(null,U),se=g._useUTC?g._d.getUTCDay():g._d.getDay(),g._tzm!=null&&g._d.setUTCMinutes(g._d.getUTCMinutes()-g._tzm),g._nextDay&&(g._a[Tt]=24),g._w&&typeof g._w.d<"u"&&g._w.d!==se&&(y(g).weekdayMismatch=!0)}}function ll(g){var A,I,U,G,se,Fe,dr,_r,tt;A=g._w,A.GG!=null||A.W!=null||A.E!=null?(se=1,Fe=4,I=ki(A.GG,g._a[Gt],mo(yt(),1,4).year),U=ki(A.W,1),G=ki(A.E,1),(G<1||G>7)&&(_r=!0)):(se=g._locale._week.dow,Fe=g._locale._week.doy,tt=mo(yt(),se,Fe),I=ki(A.gg,g._a[Gt],tt.year),U=ki(A.w,tt.week),A.d!=null?(G=A.d,(G<0||G>6)&&(_r=!0)):A.e!=null?(G=A.e+se,(A.e<0||A.e>6)&&(_r=!0)):G=se),U<1||U>ia(I,se,Fe)?y(g)._overflowWeeks=!0:_r!=null?y(g)._overflowWeekday=!0:(dr=Vc(I,U,G,se,Fe),g._a[Gt]=dr.year,g._dayOfYear=dr.dayOfYear)}r.ISO_8601=function(){},r.RFC_2822=function(){};function Qf(g){if(g._f===r.ISO_8601){sl(g);return}if(g._f===r.RFC_2822){fl(g);return}g._a=[],y(g).empty=!0;var A=""+g._i,I,U,G,se,Fe,dr=A.length,_r=0,tt,hn;for(G=ge(g._f,g._locale).match(z)||[],hn=G.length,I=0;I0&&y(g).unusedInput.push(Fe),A=A.slice(A.indexOf(U)+U.length),_r+=U.length),ae[se]?(U?y(g).empty=!1:y(g).unusedTokens.push(se),_f(se,U,g)):g._strict&&!U&&y(g).unusedTokens.push(se);y(g).charsLeftOver=dr-_r,A.length>0&&y(g).unusedInput.push(A),g._a[Tt]<=12&&y(g).bigHour===!0&&g._a[Tt]>0&&(y(g).bigHour=void 0),y(g).parsedDateParts=g._a.slice(0),y(g).meridiem=g._meridiem,g._a[Tt]=Xf(g._locale,g._a[Tt],g._meridiem),tt=y(g).era,tt!==null&&(g._a[Gt]=g._locale.erasConvertYear(tt,g._a[Gt])),rs(g),Hs(g)}function Xf(g,A,I){var U;return I==null?A:g.meridiemHour!=null?g.meridiemHour(A,I):(g.isPM!=null&&(U=g.isPM(I),U&&A<12&&(A+=12),!U&&A===12&&(A=0)),A)}function Jf(g){var A,I,U,G,se,Fe,dr=!1,_r=g._f.length;if(_r===0){y(g).invalidFormat=!0,g._d=new Date(NaN);return}for(G=0;G<_r;G++)se=0,Fe=!1,A=N({},g),g._useUTC!=null&&(A._useUTC=g._useUTC),A._f=g._f[G],Qf(A),x(A)&&(Fe=!0),se+=y(A).charsLeftOver,se+=y(A).unusedTokens.length*10,y(A).score=se,dr?sethis?this:g:w()});function dl(g,A){var I,U;if(A.length===1&&n(A[0])&&(A=A[0]),!A.length)return yt();for(I=A[0],U=1;Uthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _e(){if(!l(this._isDSTShifted))return this._isDSTShifted;var g={},A;return N(g,this),g=wn(g),g._a?(A=g._isUTC?d(g._a):yt(g._a),this._isDSTShifted=this.isValid()&&Hx(g._a,A.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Ne(){return this.isValid()?!this._isUTC:!1}function ir(){return this.isValid()?this._isUTC:!1}function Ar(){return this.isValid()?this._isUTC&&this._offset===0:!1}var rt=/^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,zt=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function zr(g,A){var I=g,U=null,G,se,Fe;return oa(g)?I={ms:g._milliseconds,d:g._days,M:g._months}:c(g)||!isNaN(+g)?(I={},A?I[A]=+g:I.milliseconds=+g):(U=rt.exec(g))?(G=U[1]==="-"?-1:1,I={y:0,d:Ke(U[Wn])*G,h:Ke(U[Tt])*G,m:Ke(U[On])*G,s:Ke(U[aa])*G,ms:Ke(go(U[$a]*1e3))*G}):(U=zt.exec(g))?(G=U[1]==="-"?-1:1,I={y:Za(U[2],G),M:Za(U[3],G),w:Za(U[4],G),d:Za(U[5],G),h:Za(U[6],G),m:Za(U[7],G),s:Za(U[8],G)}):I==null?I={}:typeof I=="object"&&("from"in I||"to"in I)&&(Fe=Yn(yt(I.from),yt(I.to)),I={},I.ms=Fe.milliseconds,I.M=Fe.months),se=new ts(I),oa(g)&&i(g,"_locale")&&(se._locale=g._locale),oa(g)&&i(g,"_isValid")&&(se._isValid=g._isValid),se}zr.fn=ts.prototype,zr.invalid=jf;function Za(g,A){var I=g&&parseFloat(g.replace(",","."));return(isNaN(I)?0:I)*A}function vl(g,A){var I={};return I.months=A.month()-g.month()+(A.year()-g.year())*12,g.clone().add(I.months,"M").isAfter(A)&&--I.months,I.milliseconds=+A-+g.clone().add(I.months,"M"),I}function Yn(g,A){var I;return g.isValid()&&A.isValid()?(A=Bn(A,g),g.isBefore(A)?I=vl(g,A):(I=vl(A,g),I.milliseconds=-I.milliseconds,I.months=-I.months),I):{milliseconds:0,months:0}}function ns(g,A){return function(I,U){var G,se;return U!==null&&!isNaN(+U)&&(T(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."),se=I,I=U,U=se),G=zr(I,U),gl(this,G,g),this}}function gl(g,A,I,U){var G=A._milliseconds,se=go(A._days),Fe=go(A._months);!g.isValid()||(U=U??!0,Fe&&pi(g,ee(g,"Month")+Fe*I),se&&ce(g,"Date",ee(g,"Date")+se*I),G&&g._d.setTime(g._d.valueOf()+G*I),U&&r.updateOffset(g,se||Fe))}var yo=ns(1,"add"),Zs=ns(-1,"subtract");function as(g){return typeof g=="string"||g instanceof String}function ut(g){return S(g)||o(g)||as(g)||c(g)||yl(g)||Jx(g)||g===null||g===void 0}function Jx(g){var A=a(g)&&!s(g),I=!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"],G,se,Fe=U.length;for(G=0;GI.valueOf():I.valueOf()9999?pe(I,A?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):R(Date.prototype.toISOString)?A?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",pe(I,"Z")):pe(I,A?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function zi(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var g="moment",A="",I,U,G,se;return this.isLocal()||(g=this.utcOffset()===0?"moment.utc":"moment.parseZone",A="Z"),I="["+g+'("]',U=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",G="-MM-DD[T]HH:mm:ss.SSS",se=A+'[")]',this.format(I+U+G+se)}function js(g){g||(g=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var A=pe(this,g);return this.localeData().postformat(A)}function r1(g,A){return this.isValid()&&(S(g)&&g.isValid()||yt(g).isValid())?zr({to:this,from:g}).locale(this.locale()).humanize(!A):this.localeData().invalidDate()}function t1(g){return this.from(yt(),g)}function n1(g,A){return this.isValid()&&(S(g)&&g.isValid()||yt(g).isValid())?zr({from:this,to:g}).locale(this.locale()).humanize(!A):this.localeData().invalidDate()}function eu(g){return this.to(yt(),g)}function os(g){var A;return g===void 0?this._locale._abbr:(A=It(g),A!=null&&(this._locale=A),this)}var ru=_("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 Sl(){return this._locale}var ss=1e3,xo=60*ss,tu=60*xo,Rt=(365*400+97)*24*tu;function Ft(g,A){return(g%A+A)%A}function Nl(g,A,I){return g<100&&g>=0?new Date(g+400,A,I)-Rt:new Date(g,A,I).valueOf()}function Al(g,A,I){return g<100&&g>=0?Date.UTC(g+400,A,I)-Rt:Date.UTC(g,A,I)}function Ml(g){var A,I;if(g=ue(g),g===void 0||g==="millisecond"||!this.isValid())return this;switch(I=this._isUTC?Al:Nl,g){case"year":A=I(this.year(),0,1);break;case"quarter":A=I(this.year(),this.month()-this.month()%3,1);break;case"month":A=I(this.year(),this.month(),1);break;case"week":A=I(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":A=I(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":A=I(this.year(),this.month(),this.date());break;case"hour":A=this._d.valueOf(),A-=Ft(A+(this._isUTC?0:this.utcOffset()*xo),tu);break;case"minute":A=this._d.valueOf(),A-=Ft(A,xo);break;case"second":A=this._d.valueOf(),A-=Ft(A,ss);break}return this._d.setTime(A),r.updateOffset(this,!0),this}function a1(g){var A,I;if(g=ue(g),g===void 0||g==="millisecond"||!this.isValid())return this;switch(I=this._isUTC?Al:Nl,g){case"year":A=I(this.year()+1,0,1)-1;break;case"quarter":A=I(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":A=I(this.year(),this.month()+1,1)-1;break;case"week":A=I(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":A=I(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":A=I(this.year(),this.month(),this.date()+1)-1;break;case"hour":A=this._d.valueOf(),A+=tu-Ft(A+(this._isUTC?0:this.utcOffset()*xo),tu)-1;break;case"minute":A=this._d.valueOf(),A+=xo-Ft(A,xo)-1;break;case"second":A=this._d.valueOf(),A+=ss-Ft(A,ss)-1;break}return this._d.setTime(A),r.updateOffset(this,!0),this}function ec(){return this._d.valueOf()-(this._offset||0)*6e4}function us(){return Math.floor(this.valueOf()/1e3)}function rc(){return new Date(this.valueOf())}function bo(){var g=this;return[g.year(),g.month(),g.date(),g.hour(),g.minute(),g.second(),g.millisecond()]}function fs(){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 cs(){return this.isValid()?this.toISOString():null}function nu(){return x(this)}function wo(){return m({},y(this))}function i1(){return y(this).overflow}function o1(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}$("N",0,0,"eraAbbr"),$("NN",0,0,"eraAbbr"),$("NNN",0,0,"eraAbbr"),$("NNNN",0,0,"eraName"),$("NNNNN",0,0,"eraNarrow"),$("y",["y",1],"yo","eraYear"),$("y",["yy",2],0,"eraYear"),$("y",["yyy",3],0,"eraYear"),$("y",["yyyy",4],0,"eraYear"),nr("N",qr),nr("NN",qr),nr("NNN",qr),nr("NNNN",c1),nr("NNNNN",l1),ot(["N","NN","NNN","NNNN","NNNNN"],function(g,A,I,U){var G=I._locale.erasParse(g,U,I._strict);G?y(I).era=G:y(I).invalidEra=g}),nr("y",Pt),nr("yy",Pt),nr("yyy",Pt),nr("yyyy",Pt),nr("yo",m1),ot(["y","yy","yyy","yyyy"],Gt),ot(["yo"],function(g,A,I,U){var G;I._locale._eraYearOrdinalRegex&&(G=g.match(I._locale._eraYearOrdinalRegex)),I._locale.eraYearOrdinalParse?A[Gt]=I._locale.eraYearOrdinalParse(g,G):A[Gt]=parseInt(g,10)});function s1(g,A){var I,U,G,se=this._eras||It("en")._eras;for(I=0,U=se.length;I=0)return se[U]}function f1(g,A){var I=g.since<=g.until?1:-1;return A===void 0?r(g.since).year():r(g.since).year()+(A-g.offset)*I}function au(){var g,A,I,U=this.localeData().eras();for(g=0,A=U.length;gse&&(A=se),y1.call(this,g,A,I,U,G))}function y1(g,A,I,U,G){var se=Vc(g,A,I,U,G),Fe=co(se.year,0,se.dayOfYear);return this.year(Fe.getUTCFullYear()),this.month(Fe.getUTCMonth()),this.date(Fe.getUTCDate()),this}$("Q",0,"Qo","quarter"),ne("quarter","Q"),Le("quarter",7),nr("Q",qe),ot("Q",function(g,A){A[Un]=(Ke(g)-1)*3});function x1(g){return g==null?Math.ceil((this.month()+1)/3):this.month((g-1)*3+this.month()%3)}$("D",["DD",2],"Do","date"),ne("date","D"),Le("date",9),nr("D",Q),nr("DD",Q,Te),nr("Do",function(g,A){return g?A._dayOfMonthOrdinalParse||A._ordinalParse:A._dayOfMonthOrdinalParseLenient}),ot(["D","DD"],Wn),ot("Do",function(g,A){A[Wn]=Ke(g.match(Q)[0])});var Tl=Pr("Date",!0);$("DDD",["DDDD",3],"DDDo","dayOfYear"),ne("dayOfYear","DDD"),Le("dayOfYear",4),nr("DDD",tr),nr("DDDD",Re),ot(["DDD","DDDD"],function(g,A,I){I._dayOfYear=Ke(g)});function Ja(g){var A=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return g==null?A:this.add(g-A,"d")}$("m",["mm",2],0,"minute"),ne("minute","m"),Le("minute",14),nr("m",Q),nr("mm",Q,Te),ot(["m","mm"],On);var b1=Pr("Minutes",!1);$("s",["ss",2],0,"second"),ne("second","s"),Le("second",15),nr("s",Q),nr("ss",Q,Te),ot(["s","ss"],aa);var w1=Pr("Seconds",!1);$("S",0,0,function(){return~~(this.millisecond()/100)}),$(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),$(0,["SSS",3],0,"millisecond"),$(0,["SSSS",4],0,function(){return this.millisecond()*10}),$(0,["SSSSS",5],0,function(){return this.millisecond()*100}),$(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),$(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),$(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),$(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),ne("millisecond","ms"),Le("millisecond",16),nr("S",tr,qe),nr("SS",tr,Te),nr("SSS",tr,Re);var bi,Fl;for(bi="SSSS";bi.length<=9;bi+="S")nr(bi,Pt);function D1(g,A){A[$a]=Ke(("0."+g)*1e3)}for(bi="S";bi.length<=9;bi+="S")ot(bi,D1);Fl=Pr("Milliseconds",!1),$("z",0,0,"zoneAbbr"),$("zz",0,0,"zoneName");function Ui(){return this._isUTC?"UTC":""}function S1(){return this._isUTC?"Coordinated Universal Time":""}var Ve=M.prototype;Ve.add=yo,Ve.calendar=jx,Ve.clone=e1,Ve.diff=wl,Ve.endOf=a1,Ve.format=js,Ve.from=r1,Ve.fromNow=t1,Ve.to=n1,Ve.toNow=eu,Ve.get=we,Ve.invalidAt=i1,Ve.isAfter=Xs,Ve.isBefore=xi,Ve.isBetween=Js,Ve.isSame=xl,Ve.isSameOrAfter=Ks,Ve.isSameOrBefore=bl,Ve.isValid=nu,Ve.lang=ru,Ve.locale=os,Ve.localeData=Sl,Ve.max=kx,Ve.min=pl,Ve.parsingFlags=wo,Ve.set=Be,Ve.startOf=Ml,Ve.subtract=Zs,Ve.toArray=bo,Ve.toObject=fs,Ve.toDate=rc,Ve.toISOString=is,Ve.inspect=zi,typeof Symbol<"u"&&Symbol.for!=null&&(Ve[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Ve.toJSON=cs,Ve.toString=Dl,Ve.unix=us,Ve.valueOf=ec,Ve.creationData=o1,Ve.eraName=au,Ve.eraNarrow=ls,Ve.eraAbbr=Cl,Ve.eraYear=Z,Ve.year=kf,Ve.isLeapYear=vx,Ve.weekYear=p1,Ve.isoWeekYear=d1,Ve.quarter=Ve.quarters=x1,Ve.month=Ga,Ve.daysInMonth=Ws,Ve.week=Ve.weeks=gx,Ve.isoWeek=Ve.isoWeeks=Xc,Ve.weeksInYear=Xa,Ve.weeksInWeekYear=g1,Ve.isoWeeksInYear=h1,Ve.isoWeeksInISOWeekYear=v1,Ve.date=Tl,Ve.day=Ve.days=Mx,Ve.weekday=Cx,Ve.isoWeekday=Ex,Ve.dayOfYear=Ja,Ve.hour=Ve.hours=Vt,Ve.minute=Ve.minutes=b1,Ve.second=Ve.seconds=w1,Ve.millisecond=Ve.milliseconds=Fl,Ve.utcOffset=Gx,Ve.utc=Zx,Ve.local=Qx,Ve.parseZone=Xx,Ve.hasAlignedHourOffset=yi,Ve.isDST=de,Ve.isLocal=Ne,Ve.isUtcOffset=ir,Ve.isUtc=Ar,Ve.isUTC=Ar,Ve.zoneAbbr=Ui,Ve.zoneName=S1,Ve.dates=_("dates accessor is deprecated. Use date instead.",Tl),Ve.months=_("months accessor is deprecated. Use month instead",Ga),Ve.years=_("years accessor is deprecated. Use year instead",kf),Ve.zone=_("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Vx),Ve.isDSTShifted=_("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",_e);function sa(g){return yt(g*1e3)}function N1(){return yt.apply(null,arguments).parseZone()}function _l(g){return g}var Jr=V.prototype;Jr.calendar=q,Jr.longDateFormat=ye,Jr.invalidDate=De,Jr.ordinal=Je,Jr.preparse=_l,Jr.postformat=_l,Jr.relativeTime=re,Jr.pastFuture=xe,Jr.set=L,Jr.eras=s1,Jr.erasParse=u1,Jr.erasConvertYear=f1,Jr.erasAbbrRegex=iu,Jr.erasNameRegex=Do,Jr.erasNarrowRegex=Hn,Jr.months=Ri,Jr.monthsShort=et,Jr.monthsParse=If,Jr.monthsRegex=hx,Jr.monthsShortRegex=Rf,Jr.week=Lf,Jr.firstDayOfYear=Qc,Jr.firstDayOfWeek=Zc,Jr.weekdays=Dx,Jr.weekdaysMin=zf,Jr.weekdaysShort=Sx,Jr.weekdaysParse=Ax,Jr.weekdaysRegex=xt,Jr.weekdaysShortRegex=gt,Jr.weekdaysMinRegex=Tx,Jr.isPM=nl,Jr.meridiem=Yf;function su(g,A,I,U){var G=It(),se=d().set(U,A);return G[I](se,g)}function Ol(g,A,I){if(c(g)&&(A=g,g=void 0),g=g||"",A!=null)return su(g,A,I,"month");var U,G=[];for(U=0;U<12;U++)G[U]=su(g,U,I,"month");return G}function uu(g,A,I,U){typeof g=="boolean"?(c(A)&&(I=A,A=void 0),A=A||""):(A=g,I=A,g=!1,c(A)&&(I=A,A=void 0),A=A||"");var G=It(),se=g?G._week.dow:0,Fe,dr=[];if(I!=null)return su(A,(I+se)%7,U,"day");for(Fe=0;Fe<7;Fe++)dr[Fe]=su(A,(Fe+se)%7,U,"day");return dr}function Bl(g,A){return Ol(g,A,"months")}function A1(g,A){return Ol(g,A,"monthsShort")}function M1(g,A,I){return uu(g,A,I,"weekdays")}function tc(g,A,I){return uu(g,A,I,"weekdaysShort")}function ms(g,A,I){return uu(g,A,I,"weekdaysMin")}Va("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 A=g%10,I=Ke(g%100/10)===1?"th":A===1?"st":A===2?"nd":A===3?"rd":"th";return g+I}}),r.lang=_("moment.lang is deprecated. Use moment.locale instead.",Va),r.langData=_("moment.langData is deprecated. Use moment.localeData instead.",It);var $n=Math.abs;function C1(){var g=this._data;return this._milliseconds=$n(this._milliseconds),this._days=$n(this._days),this._months=$n(this._months),g.milliseconds=$n(g.milliseconds),g.seconds=$n(g.seconds),g.minutes=$n(g.minutes),g.hours=$n(g.hours),g.months=$n(g.months),g.years=$n(g.years),this}function nc(g,A,I,U){var G=zr(A,I);return g._milliseconds+=U*G._milliseconds,g._days+=U*G._days,g._months+=U*G._months,g._bubble()}function E1(g,A){return nc(this,g,A,1)}function Ka(g,A){return nc(this,g,A,-1)}function fu(g){return g<0?Math.floor(g):Math.ceil(g)}function Wi(){var g=this._milliseconds,A=this._days,I=this._months,U=this._data,G,se,Fe,dr,_r;return g>=0&&A>=0&&I>=0||g<=0&&A<=0&&I<=0||(g+=fu(ac(I)+A)*864e5,A=0,I=0),U.milliseconds=g%1e3,G=or(g/1e3),U.seconds=G%60,se=or(G/60),U.minutes=se%60,Fe=or(se/60),U.hours=Fe%24,A+=or(Fe/24),_r=or(Pn(A)),I+=_r,A-=fu(ac(_r)),dr=or(I/12),I%=12,U.days=A,U.months=I,U.years=dr,this}function Pn(g){return g*4800/146097}function ac(g){return g*146097/4800}function Pl(g){if(!this.isValid())return NaN;var A,I,U=this._milliseconds;if(g=ue(g),g==="month"||g==="quarter"||g==="year")switch(A=this._days+U/864e5,I=this._months+Pn(A),g){case"month":return I;case"quarter":return I/3;case"year":return I/12}else switch(A=this._days+Math.round(ac(this._months)),g){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 "+g)}}function Il(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+Ke(this._months/12)*31536e6:NaN}function In(g){return function(){return this.as(g)}}var wi=In("ms"),Rl=In("s"),T1=In("m"),cu=In("h"),F1=In("d"),ql=In("w"),Jt=In("M"),ic=In("Q"),kl=In("y");function Na(){return zr(this)}function oc(g){return g=ue(g),this.isValid()?this[g+"s"]():NaN}function Aa(g){return function(){return this.isValid()?this._data[g]:NaN}}var Yi=Aa("milliseconds"),Ll=Aa("seconds"),dn=Aa("minutes"),sc=Aa("hours"),_1=Aa("days"),O1=Aa("months"),B1=Aa("years");function uc(){return or(this.days()/7)}var ja=Math.round,Ma={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function zl(g,A,I,U,G){return G.relativeTime(A||1,!!I,g,U)}function P1(g,A,I,U){var G=zr(g).abs(),se=ja(G.as("s")),Fe=ja(G.as("m")),dr=ja(G.as("h")),_r=ja(G.as("d")),tt=ja(G.as("M")),hn=ja(G.as("w")),Ca=ja(G.as("y")),ei=se<=I.ss&&["s",se]||se0,ei[4]=U,zl.apply(null,ei)}function I1(g){return g===void 0?ja:typeof g=="function"?(ja=g,!0):!1}function ps(g,A){return Ma[g]===void 0?!1:A===void 0?Ma[g]:(Ma[g]=A,g==="s"&&(Ma.ss=A-1),!0)}function R1(g,A){if(!this.isValid())return this.localeData().invalidDate();var I=!1,U=Ma,G,se;return typeof g=="object"&&(A=g,g=!1),typeof g=="boolean"&&(I=g),typeof A=="object"&&(U=Object.assign({},Ma,A),A.s!=null&&A.ss==null&&(U.ss=A.s-1)),G=this.localeData(),se=P1(this,!I,U,G),I&&(se=G.pastFuture(+this,se)),G.postformat(se)}var fc=Math.abs;function Di(g){return(g>0)-(g<0)||+g}function ds(){if(!this.isValid())return this.localeData().invalidDate();var g=fc(this._milliseconds)/1e3,A=fc(this._days),I=fc(this._months),U,G,se,Fe,dr=this.asSeconds(),_r,tt,hn,Ca;return dr?(U=or(g/60),G=or(U/60),g%=60,U%=60,se=or(I/12),I%=12,Fe=g?g.toFixed(3).replace(/\\.?0+$/,""):"",_r=dr<0?"-":"",tt=Di(this._months)!==Di(dr)?"-":"",hn=Di(this._days)!==Di(dr)?"-":"",Ca=Di(this._milliseconds)!==Di(dr)?"-":"",_r+"P"+(se?tt+se+"Y":"")+(I?tt+I+"M":"")+(A?hn+A+"D":"")+(G||U||g?"T":"")+(G?Ca+G+"H":"")+(U?Ca+U+"M":"")+(g?Ca+Fe+"S":"")):"P0D"}var Vr=ts.prototype;Vr.isValid=Yx,Vr.abs=C1,Vr.add=E1,Vr.subtract=Ka,Vr.as=Pl,Vr.asMilliseconds=wi,Vr.asSeconds=Rl,Vr.asMinutes=T1,Vr.asHours=cu,Vr.asDays=F1,Vr.asWeeks=ql,Vr.asMonths=Jt,Vr.asQuarters=ic,Vr.asYears=kl,Vr.valueOf=Il,Vr._bubble=Wi,Vr.clone=Na,Vr.get=oc,Vr.milliseconds=Yi,Vr.seconds=Ll,Vr.minutes=dn,Vr.hours=sc,Vr.days=_1,Vr.weeks=uc,Vr.months=O1,Vr.years=B1,Vr.humanize=R1,Vr.toISOString=ds,Vr.toString=ds,Vr.toJSON=ds,Vr.locale=os,Vr.localeData=Sl,Vr.toIsoString=_("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ds),Vr.lang=ru,$("X",0,0,"unix"),$("x",0,0,"valueOf"),nr("x",Xt),nr("X",Ef),ot("X",function(g,A,I){I._d=new Date(parseFloat(g)*1e3)}),ot("x",function(g,A,I){I._d=new Date(Ke(g))});return r.version="2.29.4",t(yt),r.fn=Ve,r.min=Lx,r.max=zx,r.now=Ux,r.utc=d,r.unix=sa,r.months=Bl,r.isDate=o,r.locale=Va,r.invalid=w,r.duration=zr,r.isMoment=S,r.weekdays=M1,r.parseZone=N1,r.localeData=It,r.isDuration=oa,r.monthsShort=A1,r.weekdaysMin=ms,r.defineLocale=pn,r.updateLocale=Ox,r.locales=Bx,r.weekdaysShort=tc,r.normalizeUnits=ue,r.relativeTimeRounding=I1,r.relativeTimeThreshold=ps,r.calendarFormat=Kx,r.prototype=Ve,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})});function _a(e){return _a=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},_a(e)}function Sn(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 nt(e,r){if(r.length1?"s":"")+" required, but only "+r.length+" present")}function Yt(e){nt(1,arguments);var r=Object.prototype.toString.call(e);return e instanceof Date||_a(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 xb(e,r){nt(2,arguments);var t=Yt(e).getTime(),n=Sn(r);return new Date(t+n)}var _q={};function Co(){return _q}function bb(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()}var Oq=365.2425,Bq=Math.pow(10,8)*24*60*60*1e3,wb=6e4,Db=36e5;var aQ=-Bq;var Pq=3600;var sA=Pq*24,iQ=sA*7,Iq=sA*Oq,Rq=Iq/12,oQ=Rq*3;function Sb(e){return nt(1,arguments),e instanceof Date||_a(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Nb(e){if(nt(1,arguments),!Sb(e)&&typeof e!="number")return!1;var r=Yt(e);return!isNaN(Number(r))}function Ab(e,r){nt(2,arguments);var t=Sn(r);return xb(e,-t)}var qq=864e5;function Mb(e){nt(1,arguments);var r=Yt(e),t=r.getTime();r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0);var n=r.getTime(),a=t-n;return Math.floor(a/qq)+1}function Eo(e){nt(1,arguments);var r=1,t=Yt(e),n=t.getUTCDay(),a=(n=a.getTime()?t+1:r.getTime()>=s.getTime()?t:t-1}function Cb(e){nt(1,arguments);var r=hc(e),t=new Date(0);t.setUTCFullYear(r,0,4),t.setUTCHours(0,0,0,0);var n=Eo(t);return n}var kq=6048e5;function Eb(e){nt(1,arguments);var r=Yt(e),t=Eo(r).getTime()-Cb(r).getTime();return Math.round(t/kq)+1}function To(e,r){var t,n,a,i,s,l,c,o;nt(1,arguments);var u=Co(),m=Sn((t=(n=(a=(i=r?.weekStartsOn)!==null&&i!==void 0?i:r==null||(s=r.locale)===null||s===void 0||(l=s.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&a!==void 0?a:u.weekStartsOn)!==null&&n!==void 0?n:(c=u.locale)===null||c===void 0||(o=c.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&t!==void 0?t:0);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Yt(e),h=d.getUTCDay(),y=(h=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(m+1,0,h),y.setUTCHours(0,0,0,0);var v=To(y,r),x=new Date(0);x.setUTCFullYear(m,0,h),x.setUTCHours(0,0,0,0);var w=To(x,r);return u.getTime()>=v.getTime()?m+1:u.getTime()>=w.getTime()?m:m-1}function Tb(e,r){var t,n,a,i,s,l,c,o;nt(1,arguments);var u=Co(),m=Sn((t=(n=(a=(i=r?.firstWeekContainsDate)!==null&&i!==void 0?i:r==null||(s=r.locale)===null||s===void 0||(l=s.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&a!==void 0?a:u.firstWeekContainsDate)!==null&&n!==void 0?n:(c=u.locale)===null||c===void 0||(o=c.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&t!==void 0?t:1),d=vc(e,r),h=new Date(0);h.setUTCFullYear(d,0,m),h.setUTCHours(0,0,0,0);var y=To(h,r);return y}var Lq=6048e5;function Fb(e,r){nt(1,arguments);var t=Yt(e),n=To(t,r).getTime()-Tb(t,r).getTime();return Math.round(n/Lq)+1}function st(e,r){for(var t=e<0?"-":"",n=Math.abs(e).toString();n.length0?n:1-n;return st(t==="yy"?a%100:a,t.length)},M:function(r,t){var n=r.getUTCMonth();return t==="M"?String(n+1):st(n+1,2)},d:function(r,t){return st(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 st(r.getUTCHours()%12||12,t.length)},H:function(r,t){return st(r.getUTCHours(),t.length)},m:function(r,t){return st(r.getUTCMinutes(),t.length)},s:function(r,t){return st(r.getUTCSeconds(),t.length)},S:function(r,t){var n=t.length,a=r.getUTCMilliseconds(),i=Math.floor(a*Math.pow(10,n-3));return st(i,t.length)}},Xi=zq;var vu={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Uq={G:function(r,t,n){var a=r.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});case"GGGG":default:return n.era(a,{width:"wide"})}},y:function(r,t,n){if(t==="yo"){var a=r.getUTCFullYear(),i=a>0?a:1-a;return n.ordinalNumber(i,{unit:"year"})}return Xi.y(r,t)},Y:function(r,t,n,a){var i=vc(r,a),s=i>0?i:1-i;if(t==="YY"){var l=s%100;return st(l,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):st(s,t.length)},R:function(r,t){var n=hc(r);return st(n,t.length)},u:function(r,t){var n=r.getUTCFullYear();return st(n,t.length)},Q:function(r,t,n){var a=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return st(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(r,t,n){var a=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return st(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(r,t,n){var a=r.getUTCMonth();switch(t){case"M":case"MM":return Xi.M(r,t);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(r,t,n){var a=r.getUTCMonth();switch(t){case"L":return String(a+1);case"LL":return st(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(r,t,n,a){var i=Fb(r,a);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):st(i,t.length)},I:function(r,t,n){var a=Eb(r);return t==="Io"?n.ordinalNumber(a,{unit:"week"}):st(a,t.length)},d:function(r,t,n){return t==="do"?n.ordinalNumber(r.getUTCDate(),{unit:"date"}):Xi.d(r,t)},D:function(r,t,n){var a=Mb(r);return t==="Do"?n.ordinalNumber(a,{unit:"dayOfYear"}):st(a,t.length)},E:function(r,t,n){var a=r.getUTCDay();switch(t){case"E":case"EE":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"})}},e:function(r,t,n,a){var i=r.getUTCDay(),s=(i-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return st(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});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"})}},c:function(r,t,n,a){var i=r.getUTCDay(),s=(i-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return st(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(r,t,n){var a=r.getUTCDay(),i=a===0?7:a;switch(t){case"i":return String(i);case"ii":return st(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});case"iiii":default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(r,t,n){var a=r.getUTCHours(),i=a/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(r,t,n){var a=r.getUTCHours(),i;switch(a===12?i=vu.noon:a===0?i=vu.midnight:i=a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(r,t,n){var a=r.getUTCHours(),i;switch(a>=17?i=vu.evening:a>=12?i=vu.afternoon:a>=4?i=vu.morning:i=vu.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(r,t,n){if(t==="ho"){var a=r.getUTCHours()%12;return a===0&&(a=12),n.ordinalNumber(a,{unit:"hour"})}return Xi.h(r,t)},H:function(r,t,n){return t==="Ho"?n.ordinalNumber(r.getUTCHours(),{unit:"hour"}):Xi.H(r,t)},K:function(r,t,n){var a=r.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(a,{unit:"hour"}):st(a,t.length)},k:function(r,t,n){var a=r.getUTCHours();return a===0&&(a=24),t==="ko"?n.ordinalNumber(a,{unit:"hour"}):st(a,t.length)},m:function(r,t,n){return t==="mo"?n.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):Xi.m(r,t)},s:function(r,t,n){return t==="so"?n.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):Xi.s(r,t)},S:function(r,t){return Xi.S(r,t)},X:function(r,t,n,a){var i=a._originalDate||r,s=i.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return fA(s);case"XXXX":case"XX":return ys(s);case"XXXXX":case"XXX":default:return ys(s,":")}},x:function(r,t,n,a){var i=a._originalDate||r,s=i.getTimezoneOffset();switch(t){case"x":return fA(s);case"xxxx":case"xx":return ys(s);case"xxxxx":case"xxx":default:return ys(s,":")}},O:function(r,t,n,a){var i=a._originalDate||r,s=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+uA(s,":");case"OOOO":default:return"GMT"+ys(s,":")}},z:function(r,t,n,a){var i=a._originalDate||r,s=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+uA(s,":");case"zzzz":default:return"GMT"+ys(s,":")}},t:function(r,t,n,a){var i=a._originalDate||r,s=Math.floor(i.getTime()/1e3);return st(s,t.length)},T:function(r,t,n,a){var i=a._originalDate||r,s=i.getTime();return st(s,t.length)}};function uA(e,r){var t=e>0?"-":"+",n=Math.abs(e),a=Math.floor(n/60),i=n%60;if(i===0)return t+String(a);var s=r||"";return t+String(a)+s+st(i,2)}function fA(e,r){if(e%60===0){var t=e>0?"-":"+";return t+st(Math.abs(e)/60,2)}return ys(e,r)}function ys(e,r){var t=r||"",n=e>0?"-":"+",a=Math.abs(e),i=st(Math.floor(a/60),2),s=st(a%60,2);return n+i+t+s}var cA=Uq;var lA=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"})}},mA=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"})}},Wq=function(r,t){var n=r.match(/(P+)(p+)?/)||[],a=n[1],i=n[2];if(!i)return lA(r,t);var s;switch(a){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}}",lA(a,t)).replace("{{time}}",mA(i,t))},Yq={p:mA,P:Wq},pA=Yq;var Hq=["D","DD"],$q=["YY","YYYY"];function dA(e){return Hq.indexOf(e)!==-1}function hA(e){return $q.indexOf(e)!==-1}function _b(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 Gq={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"}},Vq=function(r,t,n){var a,i=Gq[r];return typeof i=="string"?a=i:t===1?a=i.one:a=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a},vA=Vq;function gc(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 Zq={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Qq={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Xq={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Jq={date:gc({formats:Zq,defaultWidth:"full"}),time:gc({formats:Qq,defaultWidth:"full"}),dateTime:gc({formats:Xq,defaultWidth:"full"})},gA=Jq;var Kq={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},jq=function(r,t,n,a){return Kq[r]},yA=jq;function xs(e){return function(r,t){var n=t!=null&&t.context?String(t.context):"standalone",a;if(n==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,s=t!=null&&t.width?String(t.width):i;a=e.formattingValues[s]||e.formattingValues[i]}else{var l=e.defaultWidth,c=t!=null&&t.width?String(t.width):e.defaultWidth;a=e.values[c]||e.values[l]}var o=e.argumentCallback?e.argumentCallback(r):r;return a[o]}}var ek={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},rk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},tk={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"]},nk={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"]},ak={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"}},ik={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"}},ok=function(r,t){var n=Number(r),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},sk={ordinalNumber:ok,era:xs({values:ek,defaultWidth:"wide"}),quarter:xs({values:rk,defaultWidth:"wide",argumentCallback:function(r){return r-1}}),month:xs({values:tk,defaultWidth:"wide"}),day:xs({values:nk,defaultWidth:"wide"}),dayPeriod:xs({values:ak,defaultWidth:"wide",formattingValues:ik,defaultFormattingWidth:"wide"})},xA=sk;function bs(e){return function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,a=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=r.match(a);if(!i)return null;var s=i[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?fk(l,function(m){return m.test(s)}):uk(l,function(m){return m.test(s)}),o;o=e.valueCallback?e.valueCallback(c):c,o=t.valueCallback?t.valueCallback(o):o;var u=r.slice(s.length);return{value:o,rest:u}}}function uk(e,r){for(var t in e)if(e.hasOwnProperty(t)&&r(e[t]))return t}function fk(e,r){for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:{},n=r.match(e.matchPattern);if(!n)return null;var a=n[0],i=r.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];s=t.valueCallback?t.valueCallback(s):s;var l=r.slice(a.length);return{value:s,rest:l}}}var ck=/^(\\d+)(th|st|nd|rd)?/i,lk=/\\d+/i,mk={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},pk={any:[/^b/i,/^(a|c)/i]},dk={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},hk={any:[/1/i,/2/i,/3/i,/4/i]},vk={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},gk={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]},yk={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},xk={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]},bk={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},wk={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}},Dk={ordinalNumber:Ob({matchPattern:ck,parsePattern:lk,valueCallback:function(r){return parseInt(r,10)}}),era:bs({matchPatterns:mk,defaultMatchWidth:"wide",parsePatterns:pk,defaultParseWidth:"any"}),quarter:bs({matchPatterns:dk,defaultMatchWidth:"wide",parsePatterns:hk,defaultParseWidth:"any",valueCallback:function(r){return r+1}}),month:bs({matchPatterns:vk,defaultMatchWidth:"wide",parsePatterns:gk,defaultParseWidth:"any"}),day:bs({matchPatterns:yk,defaultMatchWidth:"wide",parsePatterns:xk,defaultParseWidth:"any"}),dayPeriod:bs({matchPatterns:bk,defaultMatchWidth:"any",parsePatterns:wk,defaultParseWidth:"any"})},bA=Dk;var Sk={code:"en-US",formatDistance:vA,formatLong:gA,formatRelative:yA,localize:xA,match:bA,options:{weekStartsOn:0,firstWeekContainsDate:1}},wA=Sk;var DA=wA;var Nk=/[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g,Ak=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Mk=/^'([^]*?)'?$/,Ck=/''/g,Ek=/[a-zA-Z]/;function Ai(e,r,t){var n,a,i,s,l,c,o,u,m,d,h,y,v,x,w,C,b,N;nt(2,arguments);var M=String(r),S=Co(),O=(n=(a=t?.locale)!==null&&a!==void 0?a:S.locale)!==null&&n!==void 0?n:DA,_=Sn((i=(s=(l=(c=t?.firstWeekContainsDate)!==null&&c!==void 0?c: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:(m=S.locale)===null||m===void 0||(d=m.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(_>=1&&_<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=Sn((h=(y=(v=(x=t?.weekStartsOn)!==null&&x!==void 0?x: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&&y!==void 0?y:(b=S.locale)===null||b===void 0||(N=b.options)===null||N===void 0?void 0:N.weekStartsOn)!==null&&h!==void 0?h:0);if(!(E>=0&&E<=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 T=Yt(e);if(!Nb(T))throw new RangeError("Invalid time value");var R=bb(T),L=Ab(T,R),H={firstWeekContainsDate:_,weekStartsOn:E,locale:O,_originalDate:T},V=M.match(Ak).map(function(W){var k=W[0];if(k==="p"||k==="P"){var q=pA[k];return q(W,O.formatLong)}return W}).join("").match(Nk).map(function(W){if(W==="''")return"'";var k=W[0];if(k==="'")return Tk(W);var q=cA[k];if(q)return!(t!=null&&t.useAdditionalWeekYearTokens)&&hA(W)&&_b(W,r,String(e)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&dA(W)&&_b(W,r,String(e)),q(L,W,O.localize,H);if(k.match(Ek))throw new RangeError("Format string contains an unescaped latin alphabet character \`"+k+"\`");return W}).join("");return V}function Tk(e){var r=e.match(Mk);return r?r[1].replace(Ck,"'"):e}function Bb(e,r){if(_a(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(_a(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Pb(e){var r=Bb(e,"string");return _a(r)=="symbol"?r:r+""}function Hr(e,r,t){return r=Pb(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function om(e,r){var t;nt(1,arguments);var n=Sn((t=r?.additionalDigits)!==null&&t!==void 0?t:2);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var a=Bk(e),i;if(a.date){var s=Pk(a.date,n);i=Ik(s.restDateString,s.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);var l=i.getTime(),c=0,o;if(a.time&&(c=Rk(a.time),isNaN(c)))return new Date(NaN);if(a.timezone){if(o=qk(a.timezone),isNaN(o))return new Date(NaN)}else{var u=new Date(l+c),m=new Date(0);return m.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),m.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),m}return new Date(l+c+o)}var im={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Fk=/^-?(?:(\\d{3})|(\\d{2})(?:-?(\\d{2}))?|W(\\d{2})(?:-?(\\d{1}))?|)$/,_k=/^(\\d{2}(?:[.,]\\d*)?)(?::?(\\d{2}(?:[.,]\\d*)?))?(?::?(\\d{2}(?:[.,]\\d*)?))?$/,Ok=/^([+-])(\\d{2})(?::?(\\d{2}))?$/;function Bk(e){var r={},t=e.split(im.dateTimeDelimiter),n;if(t.length>2)return r;if(/:/.test(t[0])?n=t[0]:(r.date=t[0],n=t[1],im.timeZoneDelimiter.test(r.date)&&(r.date=e.split(im.timeZoneDelimiter)[0],n=e.substr(r.date.length,e.length))),n){var a=im.timezone.exec(n);a?(r.time=n.replace(a[1],""),r.timezone=a[1]):r.time=n}return r}function Pk(e,r){var t=new RegExp("^(?:(\\\\d{4}|[+-]\\\\d{"+(4+r)+"})|(\\\\d{2}|[+-]\\\\d{"+(2+r)+"})$)"),n=e.match(t);if(!n)return{year:NaN,restDateString:""};var a=n[1]?parseInt(n[1]):null,i=n[2]?parseInt(n[2]):null;return{year:i===null?a:i*100,restDateString:e.slice((n[1]||n[2]).length)}}function Ik(e,r){if(r===null)return new Date(NaN);var t=e.match(Fk);if(!t)return new Date(NaN);var n=!!t[4],a=yc(t[1]),i=yc(t[2])-1,s=yc(t[3]),l=yc(t[4]),c=yc(t[5])-1;if(n)return Wk(r,l,c)?kk(r,l,c):new Date(NaN);var o=new Date(0);return!zk(r,i,s)||!Uk(r,a)?new Date(NaN):(o.setUTCFullYear(r,i,Math.max(a,s)),o)}function yc(e){return e?parseInt(e):1}function Rk(e){var r=e.match(_k);if(!r)return NaN;var t=Ib(r[1]),n=Ib(r[2]),a=Ib(r[3]);return Yk(t,n,a)?t*Db+n*wb+a*1e3:NaN}function Ib(e){return e&&parseFloat(e.replace(",","."))||0}function qk(e){if(e==="Z")return 0;var r=e.match(Ok);if(!r)return 0;var t=r[1]==="+"?-1:1,n=parseInt(r[2]),a=r[3]&&parseInt(r[3])||0;return Hk(n,a)?t*(n*Db+a*wb):NaN}function kk(e,r,t){var n=new Date(0);n.setUTCFullYear(e,0,4);var a=n.getUTCDay()||7,i=(r-1)*7+t+1-a;return n.setUTCDate(n.getUTCDate()+i),n}var Lk=[31,null,31,30,31,30,31,31,30,31,30,31];function SA(e){return e%400===0||e%4===0&&e%100!==0}function zk(e,r,t){return r>=0&&r<=11&&t>=1&&t<=(Lk[r]||(SA(e)?29:28))}function Uk(e,r){return r>=1&&r<=(SA(e)?366:365)}function Wk(e,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function Yk(e,r,t){return e===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&e>=0&&e<25}function Hk(e,r){return r>=0&&r<=59}var pa=e=>[...new Set(e)];var NA=(e,r)=>e.sort(function(t,n){let a=r.indexOf(t),i=r.indexOf(n);return a>i?a!=-1&&i==-1?-1:1:i!=-1&&a==-1?1:-1});var Xn="File";function sm(e){return Array.isArray(e)?e:typeof e=="string"?[e]:[]}var AA=(e,r)=>r.indexOf(e)>0?r.indexOf(e):r.length;var xc=e=>"spaces://"+e;var MA=e=>e.charAt(0)=="/"?e.substring(1):e;var Rb=(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"tags-multi";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=gn(e)),r=="tag"||r=="tags")return"tags-multi";if(t.length==1&&Array.isArray(t[0])&&t[0].length==1&&typeof t[0][0]=="string")return"link";let n=pa(t.map(a=>Rb(a,r)));return n.length==1&&n[0]=="link"?"link-multi":n.some(a=>a=="object")?"object-multi":"option-multi"}else return e.isLuxonDateTime?"date":e.isLuxonDuration?"duration":e.type=="file"?"link":typeof e=="object"&&!Array.isArray(e)&&e!==null?"object":"unknown";else return"unknown"}return"text"};var qb=(e,r,t)=>e=="object"||e=="object-multi"?JSON.parse(r):e=="number"?parseFloat(r):e=="boolean"?r=="true":e.includes("-multi")?gn(r).map(n=>qb(e.replace("-multi",""),n,t)):(e.includes("link")||e.includes("context"))&&t?\`[[\${r}]]\`:r;var CA=e=>e.map(r=>r.replace(",","\\\\,")).join(", "),ws=e=>JSON.stringify(e);var gn=e=>e?.startsWith("[")?sm(bc(e)):$k(e),$k=e=>(e?.replace("\\\\,",",")?.match(/(\\\\.|[^,])+/g)??[]).map(r=>r.trim()),Ds=(e,r)=>{switch(Rb(r,e)){case"tags-multi":return r;case"object":case"object-multi":return JSON.stringify(r);case"number":return r.toString();case"boolean":return r?"true":"false";case"date":{if(r instanceof Date){let n=Ai(r,"yyyy-MM-dd");return typeof n=="string"?n:""}return typeof r!="string"?"":r}break;case"duration":return CA(Object.keys(r.values).reduce((n,a)=>[...n,...r.values[a]>0?[r.values[a]+" "+a]:[]],[]));case"option-multi":case"link-multi":return typeof r=="string"?wc(r):ws(r.map(n=>n?typeof n=="string"?wc(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"?wc(r):r.path;case"text":case"tag":case"image":return r}return""};var bc=e=>{let r;try{r=JSON.parse(e)}catch{}return r};var wc=e=>{if(!e)return"";let r=/\\[\\[(.*?)\\]\\]/g.exec(e),t=r?.length>1?r[1].substring(0,AA("|",r[1])):e;return t||e};var yu=ma(um());var kb=e=>(0,yu.isNumber)(e)?new Date(e):(0,yu.isString)(e)?om(e):(0,yu.isDate)(e)?e:new Date;var EA=(e,r,t)=>{let n=e[0];if(!n.isSymbolNode||e.length!==3)return"";let a=n.name,i=e[1];return r.evaluate(\`\${a} = \${i.toString()}\`,t),e[2].compile().evaluate(t)};EA.rawArgs=!0;var TA=(e,r,t)=>{if(e.length%2!==1)return"";for(let a=0;a{if(e.length!==1)return"";let n=e.map(function(i){return i.compile().evaluate(t)});return t.get("$paths").get(n[0])};FA.rawArgs=!0;var _A=(e,r,t)=>t?.get("$current");_A.rawArgs=!0;var OA=(e,r,t)=>t?.get("$index");OA.rawArgs=!0;var BA=(e,r,t)=>{if(e.length!==2)return"";let n=e[0].compile().evaluate?e[0].compile().evaluate(t):e[0];return Array.isArray(n)?n.find((a,i)=>{t.set("$current",a),t.set("$index",i),r.evaluate("current = _current(); index = _index()",t);let s=e[1].compile().evaluate?e[1].compile().evaluate(t):e[1];return a===s})??"":""};BA.rawArgs=!0;var PA=(e,r,t)=>{if(e.length!==2)return"";let n=e[0].compile().evaluate?e[0].compile().evaluate(t):e[0];return Array.isArray(n)?n.findIndex((a,i)=>{t.set("$current",a),t.set("$index",i),r.evaluate("current = _current(); index = _index()",t);let s=e[1].compile().evaluate?e[1].compile().evaluate(t):e[1];return a===s}):""};PA.rawArgs=!0;var IA=(e,r,t)=>{if(e.length!==2)return"";let n=e[0].compile().evaluate?e[0].compile().evaluate(t):e[0];return Array.isArray(n)?n.filter((a,i)=>(t.set("$current",a),t.set("$index",i),r.evaluate("current = _current(); index = _index()",t),e[1].compile().evaluate(t))):""};IA.rawArgs=!0;var RA=(e,r,t)=>{if(e.length!==2)return"";let n=e[0].compile().evaluate?e[0].compile().evaluate(t):e[0];return Array.isArray(n)?n.map((a,i)=>(t.set("$current",a),t.set("$index",i),r.evaluate("current = _current(); index = _index()",t),e[1].compile().evaluate(t))):[]};RA.rawArgs=!0;var qA=(e,r,t)=>{if(e.length!==2)return"";let n=e[0].compile().evaluate?e[0].compile().evaluate(t):e[0];return Array.isArray(n)?n.some((a,i)=>(t.set("$current",a),t.set("$index",i),r.evaluate("current = _current(); index = _index()",t),e[1].compile().evaluate(t))):""};qA.rawArgs=!0;var kA=(e,r,t)=>{if(e.length!==2)return"";let n=e[0].compile().evaluate?e[0].compile().evaluate(t):e[0];return Array.isArray(n)?n.every((a,i)=>(t.set("$current",a),t.set("$index",i),r.evaluate("current = _current(); index = _index()",t),e[1].compile().evaluate(t))):""};kA.rawArgs=!0;var LA=(e,r,t)=>{if(e.length!==1)return"";let n=e[0].compile().evaluate?e[0].compile().evaluate(t):e[0];return Array.isArray(n)?n.flat():""};LA.rawArgs=!0;var zA=(e,r,t)=>{if(e.length!==1)return"";let n=e.map(function(s){return s.compile().evaluate(t)}),a=t.get("$properties")?.[n[0]]?.type,i=qb(a,t.get(n[0]));return(a=="file"||a=="link"||a=="context")&&(a.includes("multi")?i=gn(i).map(s=>t.get("$paths").get(s)??s):i=t.get("$paths").get(i)??i),a=="date"&&(i=kb(i)),i??""};zA.rawArgs=!0;var UA=(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 a=e[1]?.compile().evaluate(t);return a?.length>0?Ai(n,a):Ai(n,t.get("$settings")?.dateFormat??"yyyy-MM-dd")};WA.rawArgs=!0;var kn=e=>typeof e=="string"||e instanceof String?e:e instanceof Date?Ai(e,"yyyy-MM-dd"):typeof e=="number"?e.toFixed(0):e?.path?e.path:"",Lb={prop:zA,_current:_A,_index:OA,slice:(e,r,t)=>(e=kn(e),e.slice(r,t)),if:(e,r,t)=>e===!0?r:t,ifs:UA,empty:e=>e.length!==1?"":Array.isArray(e[0])?e[0].length===0:e[0]===""?"true":"false",length:e=>e.length,values:e=>e.flat().length,uniques:e=>pa(e.flat()).length,substring:(e,r,t)=>(e=kn(e),t?e.substring(r,t):e.substring(r)),startsWith:(e,r)=>(e=kn(e),r=kn(r),e.startsWith(r)),contains:(e,r)=>(e=kn(e),r=kn(r),e.includes(r)),test:(e,r)=>(e=kn(e),new RegExp(r).test(e)),match:(e,r)=>(e=kn(e),e.match(new RegExp(r))),replace:(e,r,t)=>(e=kn(e),e.replace(new RegExp(r),t)),replaceAll:(e,r,t)=>(e=kn(e),r=kn(r),t=kn(t),e.replace(new RegExp(r,"g"),t)),lower:e=>(e=kn(e),e.toLowerCase()),upper:e=>(e=kn(e),e.toUpperCase()),repeat:(e,r)=>e.repeat(r),format:kn,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=>Ai(e,"w"),month:e=>e.getMonth()+1,year:e=>e.getFullYear(),pad:(e,r,t)=>e.padStart(r,t),range:e=>Math.max(...e)-Math.min(...e),latest:e=>new Date(Math.max(...e.map(r=>r.getTime()))),earliest:e=>new Date(Math.min(...e.map(r=>r.getTime()))),dateRange:(e,r)=>{let t=Math.abs(Math.max(...e.map(n=>n.getTime()))-Math.min(...e.map(n=>n.getTime())));return r.startsWith("day")?t/(1e3*60*60*24):r.startsWith("month")?t/(1e3*60*60*24*30):r.startsWith("year")?t/(1e3*60*60*24*365):r.startsWith("hour")?t/(1e3*60*60):r.startsWith("minute")?t/(1e3*60):r.startsWith("second")?t/1e3:r.startsWith("week")?t/(1e3*60*60*24*7):r.startsWith("quarter")?t/(1e3*60*60*24*30*3):t/(1e3*60*60*24)},dateAdd:(e,r,t)=>(t.startsWith("day")&&e.setDate(e.getDate()+r),t.startsWith("month")&&e.setMonth(e.getMonth()+r),t.startsWith("year")&&e.setFullYear(e.getFullYear()+r),t.startsWith("quarter")&&e.setMonth(e.getMonth()+r*3),t.startsWith("week")&&e.setDate(e.getDate()+r*7),t.startsWith("hour")&&e.setHours(e.getHours()+r),t.startsWith("minute")&&e.setMinutes(e.getMinutes()+r),t.startsWith("second")&&e.setSeconds(e.getSeconds()+r),e),dateSubtract:(e,r,t)=>(t.startsWith("day")&&e.setDate(e.getDate()-r),t.startsWith("month")&&e.setMonth(e.getMonth()-r),t.startsWith("year")&&e.setFullYear(e.getFullYear()-r),t.startsWith("quarter")&&e.setMonth(e.getMonth()-r*3),t.startsWith("week")&&e.setDate(e.getDate()-r*7),t.startsWith("hour")&&e.setHours(e.getHours()-r),t.startsWith("minute")&&e.setMinutes(e.getMinutes()-r),t.startsWith("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(),at:(e,r)=>e[r],first:e=>e[0],last:e=>e[e.length-1],concat:(e,r)=>e.concat(r),sort:e=>e.sort((r,t)=>t-r),reverse:e=>e.reverse(),join:(e,r)=>e.join(r),includes:(e,r)=>e.includes(r),split:(e,r)=>e.split(r),formatDate:WA,parseDate:e=>kb(e),find:BA,findIndex:PA,filter:IA,map:RA,some:qA,every:kA,flat:LA,path:FA,let:EA,lets:TA};function ht(){return ht=Object.assign?Object.assign.bind():function(e){for(var r=1;re[r])}var Dm=["Matrix","Array"],Sm=["number","BigNumber","Fraction"];function ZA(e,r){function t(n){if(n){var a=wu(e,ar);VA(n,"matrix",Dm),VA(n,"number",Sm),zb(e,n);var i=wu(e,ar),s=wu(n,ar);return r("config",i,a,s),i}else return wu(e,ar)}return t.MATRIX_OPTIONS=Dm,t.NUMBER_OPTIONS=Sm,Object.keys(Ss).forEach(n=>{Object.defineProperty(t,n,{get:()=>e[n],enumerable:!0,configurable:!0})}),t}function Gk(e,r){return e.indexOf(r)!==-1}function VA(e,r,t){e[r]!==void 0&&!Gk(t,e[r])&&console.warn('Warning: Unknown value "'+e[r]+'" for configuration option "'+r+'". Available options: '+t.map(n=>JSON.stringify(n)).join(", ")+".")}var Oe=function(r){if(r)throw new Error(\`The global config is readonly. Please create a mathjs instance if you want to change the default configuration. Example: import { create, all } from 'mathjs'; const mathjs = create(all); mathjs.config({ number: 'BigNumber' }); -\`);return Object.freeze(Ss)};ht(Oe,Ss,{MATRIX_OPTIONS:Dm,NUMBER_OPTIONS:Sm});var PD={};Tq(PD,{createAbs:()=>Np,createAccessorNode:()=>Dv,createAcos:()=>_h,createAcosh:()=>Oh,createAcot:()=>Bh,createAcoth:()=>Ph,createAcsc:()=>Ih,createAcsch:()=>Rh,createAdd:()=>mv,createAddScalar:()=>Mp,createAnd:()=>ju,createAndTransform:()=>zy,createApply:()=>Lo,createApplyTransform:()=>by,createArg:()=>Kp,createArrayNode:()=>Nv,createAsec:()=>qh,createAsech:()=>kh,createAsin:()=>Lh,createAsinh:()=>zh,createAssignmentNode:()=>Ev,createAtan:()=>Uh,createAtan2:()=>Wh,createAtanh:()=>Yh,createAtomicMass:()=>K0,createAvogadro:()=>j0,createBellNumbers:()=>$g,createBigNumberClass:()=>Ym,createBignumber:()=>dp,createBin:()=>Pd,createBitAnd:()=>ku,createBitAndTransform:()=>Wy,createBitNot:()=>Xp,createBitOr:()=>Lu,createBitOrTransform:()=>Yy,createBitXor:()=>Jp,createBlockNode:()=>Fv,createBohrMagneton:()=>O0,createBohrRadius:()=>k0,createBoltzmann:()=>ey,createBoolean:()=>pp,createCatalan:()=>Gg,createCbrt:()=>Ep,createCeil:()=>Tp,createChain:()=>hg,createChainClass:()=>pg,createClassicalElectronRadius:()=>L0,createClone:()=>Xm,createColumn:()=>Wu,createColumnTransform:()=>wy,createCombinations:()=>Og,createCombinationsWithRep:()=>Bg,createCompare:()=>nh,createCompareNatural:()=>ah,createCompareText:()=>ih,createCompile:()=>rg,createComplex:()=>hp,createComplexClass:()=>Hm,createComposition:()=>Vg,createConcat:()=>Uu,createConcatTransform:()=>Oy,createConditionalNode:()=>Ov,createConductanceQuantum:()=>B0,createConj:()=>jp,createConstantNode:()=>Rv,createCorr:()=>_g,createCos:()=>Hh,createCosh:()=>$h,createCot:()=>Gh,createCoth:()=>Vh,createCoulomb:()=>F0,createCount:()=>ad,createCreateUnit:()=>Fh,createCross:()=>id,createCsc:()=>Zh,createCsch:()=>Qh,createCtranspose:()=>Nd,createCube:()=>Fp,createCumSum:()=>af,createCumSumTransform:()=>qy,createDeepEqual:()=>gh,createDenseMatrixClass:()=>Qm,createDerivative:()=>e0,createDet:()=>vg,createDeuteronMass:()=>$0,createDiag:()=>od,createDiff:()=>Yu,createDiffTransform:()=>By,createDistance:()=>Mg,createDivide:()=>Ag,createDivideScalar:()=>Ud,createDot:()=>hv,createDotDivide:()=>Zd,createDotMultiply:()=>Zp,createDotPow:()=>Vd,createE:()=>p0,createEfimovFactor:()=>J0,createEigs:()=>xg,createElectricConstant:()=>E0,createElectronMass:()=>z0,createElementaryCharge:()=>_0,createEqual:()=>sh,createEqualScalar:()=>fp,createEqualText:()=>uh,createErf:()=>Td,createEvaluate:()=>tg,createExp:()=>_p,createExpm:()=>bg,createExpm1:()=>Op,createFactorial:()=>Rg,createFalse:()=>s0,createFaraday:()=>ry,createFermiCoupling:()=>U0,createFft:()=>Md,createFibonacciHeapClass:()=>Nh,createFilter:()=>sd,createFilterTransform:()=>Dy,createFineStructure:()=>W0,createFirstRadiation:()=>ty,createFix:()=>Bp,createFlatten:()=>ud,createFloor:()=>Pu,createForEach:()=>fd,createForEachTransform:()=>Sy,createFormat:()=>Bd,createFraction:()=>vp,createFractionClass:()=>$m,createFreqz:()=>n0,createFunctionAssignmentNode:()=>kv,createFunctionNode:()=>jv,createGamma:()=>Pg,createGasConstant:()=>ay,createGcd:()=>Pp,createGetMatrixDataType:()=>cd,createGravitationConstant:()=>N0,createGravity:()=>py,createHartreeEnergy:()=>Y0,createHasNumericValue:()=>np,createHelp:()=>dg,createHelpClass:()=>mg,createHex:()=>Rd,createHypot:()=>pv,createI:()=>w0,createIdentity:()=>ld,createIfft:()=>Cd,createIm:()=>ed,createImmutableDenseMatrixClass:()=>Dh,createIndex:()=>gv,createIndexClass:()=>Sh,createIndexNode:()=>zv,createIndexTransform:()=>Ny,createInfinity:()=>f0,createIntersect:()=>Cg,createInv:()=>gg,createInverseConductanceQuantum:()=>P0,createInvmod:()=>Gp,createIsInteger:()=>jm,createIsNaN:()=>op,createIsNegative:()=>rp,createIsNumeric:()=>tp,createIsPositive:()=>ap,createIsPrime:()=>Ld,createIsZero:()=>ip,createKldivergence:()=>qg,createKlitzing:()=>q0,createKron:()=>md,createLN10:()=>v0,createLN2:()=>h0,createLOG10E:()=>y0,createLOG2E:()=>g0,createLarger:()=>dh,createLargerEq:()=>vh,createLcm:()=>Ip,createLeafCount:()=>Zg,createLeftShift:()=>jd,createLgamma:()=>Ig,createLog:()=>Hd,createLog10:()=>Rp,createLog1p:()=>$d,createLog2:()=>qp,createLoschmidt:()=>ny,createLsolve:()=>Qd,createLsolveAll:()=>Jd,createLup:()=>ig,createLusolve:()=>cg,createLyap:()=>Ng,createMad:()=>Fg,createMagneticConstant:()=>C0,createMagneticFluxQuantum:()=>I0,createMap:()=>pd,createMapTransform:()=>Ay,createMatrix:()=>gp,createMatrixClass:()=>Vm,createMatrixFromColumns:()=>bp,createMatrixFromFunction:()=>yp,createMatrixFromRows:()=>xp,createMax:()=>ef,createMaxTransform:()=>My,createMean:()=>of,createMeanTransform:()=>Cy,createMedian:()=>Tg,createMin:()=>rf,createMinTransform:()=>Ey,createMod:()=>Iu,createMode:()=>_d,createMolarMass:()=>ly,createMolarMassC12:()=>my,createMolarPlanckConstant:()=>iy,createMolarVolume:()=>oy,createMultinomial:()=>kg,createMultiply:()=>Lp,createMultiplyScalar:()=>kp,createNaN:()=>c0,createNeutronMass:()=>G0,createNode:()=>xv,createNorm:()=>dv,createNot:()=>td,createNthRoot:()=>zp,createNthRoots:()=>Gd,createNuclearMagneton:()=>R0,createNull:()=>u0,createNumber:()=>lp,createNumeric:()=>zd,createObjectNode:()=>Wv,createOct:()=>Id,createOnes:()=>dd,createOperatorNode:()=>Hv,createOr:()=>zu,createOrTransform:()=>Uy,createParenthesisNode:()=>Gv,createParse:()=>eg,createParser:()=>ag,createParserClass:()=>ng,createPartitionSelect:()=>bh,createPermutations:()=>Lg,createPhi:()=>d0,createPi:()=>l0,createPickRandom:()=>Ug,createPinv:()=>yg,createPlanckCharge:()=>gy,createPlanckConstant:()=>A0,createPlanckLength:()=>dy,createPlanckMass:()=>hy,createPlanckTemperature:()=>yy,createPlanckTime:()=>vy,createPolynomialRoot:()=>lg,createPow:()=>Wd,createPrint:()=>Qu,createPrintTransform:()=>Ly,createProd:()=>Od,createProtonMass:()=>H0,createQr:()=>og,createQuantileSeq:()=>uf,createQuantileSeqTransform:()=>Ry,createQuantumOfCirculation:()=>V0,createRandom:()=>Wg,createRandomInt:()=>Yg,createRange:()=>$u,createRangeClass:()=>Gm,createRangeNode:()=>Zv,createRangeTransform:()=>Ty,createRationalize:()=>r0,createRe:()=>rd,createReducedPlanckConstant:()=>M0,createRelationalNode:()=>Xv,createReplacer:()=>i0,createReshape:()=>gd,createResize:()=>yd,createResolve:()=>Kg,createResultSet:()=>Im,createReviver:()=>a0,createRightArithShift:()=>eh,createRightLogShift:()=>rh,createRotate:()=>xd,createRotationMatrix:()=>bd,createRound:()=>Yd,createRow:()=>Gu,createRowTransform:()=>Fy,createRydberg:()=>Z0,createSQRT1_2:()=>x0,createSQRT2:()=>b0,createSackurTetrode:()=>sy,createSchur:()=>Sg,createSec:()=>Xh,createSech:()=>Jh,createSecondRadiation:()=>uy,createSetCartesian:()=>tv,createSetDifference:()=>nv,createSetDistinct:()=>av,createSetIntersect:()=>iv,createSetIsSubset:()=>ov,createSetMultiplicity:()=>sv,createSetPowerset:()=>uv,createSetSize:()=>fv,createSetSymDifference:()=>cv,createSetUnion:()=>lv,createSign:()=>Up,createSimplify:()=>Qg,createSimplifyConstant:()=>Xg,createSimplifyCore:()=>Jg,createSin:()=>Kh,createSinh:()=>jh,createSize:()=>wd,createSlu:()=>fg,createSmaller:()=>ch,createSmallerEq:()=>mh,createSolveODE:()=>Ed,createSort:()=>wh,createSpaClass:()=>Ah,createSparse:()=>Th,createSparseMatrixClass:()=>cp,createSpeedOfLight:()=>S0,createSplitUnit:()=>wp,createSqrt:()=>Wp,createSqrtm:()=>wg,createSquare:()=>Yp,createSqueeze:()=>Dd,createStd:()=>ff,createStdTransform:()=>Py,createStefanBoltzmann:()=>fy,createStirlingS2:()=>Hg,createString:()=>mp,createSubset:()=>Vu,createSubsetTransform:()=>_y,createSubtract:()=>Hp,createSubtractScalar:()=>Cp,createSum:()=>nf,createSumTransform:()=>Iy,createSylvester:()=>Dg,createSymbolNode:()=>Jv,createSymbolicEqual:()=>jg,createTan:()=>ev,createTanh:()=>rv,createTau:()=>m0,createThomsonCrossSection:()=>Q0,createTo:()=>kd,createTrace:()=>vv,createTranspose:()=>Sd,createTrue:()=>o0,createTypeOf:()=>sp,createTyped:()=>Pm,createUnaryMinus:()=>Dp,createUnaryPlus:()=>Sp,createUnequal:()=>xh,createUnitClass:()=>Ch,createUnitFunction:()=>Eh,createUppercaseE:()=>vP,createUppercasePi:()=>hP,createUsolve:()=>Xd,createUsolveAll:()=>Kd,createVacuumImpedance:()=>T0,createVariance:()=>sf,createVarianceTransform:()=>ky,createVersion:()=>D0,createWeakMixingAngle:()=>X0,createWienDisplacement:()=>cy,createXgcd:()=>$p,createXor:()=>nd,createZeros:()=>Ad,createZeta:()=>Fd,createZpk2tf:()=>t0});var aw=ma(Nm(),1);function Ze(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}var Ba=Math.sign||function(e){return e>0?1:e<0?-1:0},JA=Math.log2||function(r){return Math.log(r)/Math.LN2},KA=Math.log10||function(r){return Math.log(r)/Math.LN10},Am=Math.log1p||function(e){return Math.log(e+1)},jA=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},eM=Math.expm1||function(r){return r>=2e-4||r<=-2e-4?Math.exp(r)-1:r+r*r/2+r*r*r/6};function Hb(e,r,t){var n={2:"0b",8:"0o",16:"0x"},a=n[r],i="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!Ze(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(!Ze(e))throw new Error("Value must be an integer");e<0&&(e=e+2**t),i="i".concat(t)}var s="";return e<0&&(e=-e,s="-"),"".concat(s).concat(a).concat(e.toString(r)).concat(i)}function ai(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:a}=$b(r);switch(t){case"fixed":return Gb(e,n);case"exponential":return rM(e,n);case"engineering":return Vk(e,n);case"bin":return Hb(e,2,a);case"oct":return Hb(e,8,a);case"hex":return Hb(e,16,a);case"auto":return Zk(e,n,r).replace(/((\\.\\d*?)(0+))($|e)/,function(){var i=arguments[2],s=arguments[4];return i!=="."?i+s:s});default:throw new Error('Unknown notation "'+t+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function $b(e){var r="auto",t,n;if(e!==void 0)if(sr(e))t=e;else if(rr(e))t=e.toNumber();else if(Ci(e))e.precision!==void 0&&(t=QA(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=QA(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 Nu(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],a=parseFloat(r[4]||"0"),i=n.indexOf(".");a+=i!==-1?i-1:n.length-1;var s=n.replace(".","").replace(/^0*/,function(l){return a-=l.length,""}).replace(/0*$/,"").split("").map(function(l){return parseInt(l)});return s.length===0&&(s.push(0),a++),{sign:t,coefficients:s,exponent:a}}function Vk(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=Nu(e),n=Mm(t,r),a=n.exponent,i=n.coefficients,s=a%3===0?a:a<0?a-3-a%3:a-a%3;if(sr(r))for(;r>i.length||a-s+1>i.length;)i.push(0);else for(var l=Math.abs(a-s)-(i.length-1),c=0;c0;)u++,o--;var m=i.slice(u).join(""),d=sr(r)&&m.length||m.match(/[1-9]/)?"."+m:"",h=i.slice(0,u).join("")+d+"e"+(a>=0?"+":"")+s.toString();return n.sign+h}function Gb(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=Nu(e),n=typeof r=="number"?Mm(t,t.exponent+1+r):t,a=n.coefficients,i=n.exponent+1,s=i+(r||0);return a.length0?"."+a.join(""):"")+"e"+(i>=0?"+":"")+i}function Zk(e,r,t){if(isNaN(e)||!isFinite(e))return String(e);var n=XA(t?.lowerExp,-3),a=XA(t?.upperExp,5),i=Nu(e),s=r?Mm(i,r):i;if(s.exponent=a)return rM(e,r);var l=s.coefficients,c=s.exponent;l.length0?c:0;return or){var a=n.splice(r,n.length-r);if(a[0]>=5){var i=r-1;for(n[i]++;n[i]===10;)n.pop(),i===0&&(n.unshift(0),t.exponent++,i++),i--,n[i]++}}return t}function Su(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 QA(e,r){if(sr(e))return e;if(rr(e))return e.toNumber();r()}function XA(e,r){return sr(e)?e:rr(e)?e.toNumber():r}function Vb(e,r,t){var n=e.constructor,a=new n(2),i="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!Ze(t))throw new Error("size must be an integer");if(e.greaterThan(a.pow(t-1).sub(1))||e.lessThan(a.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(a.pow(t))),i="i".concat(t)}switch(r){case 2:return"".concat(e.toBinary()).concat(i);case 8:return"".concat(e.toOctal()).concat(i);case 16:return"".concat(e.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(r," not supported "))}}function cM(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:a}=$b(r);switch(t){case"fixed":return Jk(e,n);case"exponential":return uM(e,n);case"engineering":return Xk(e,n);case"bin":return Vb(e,2,a);case"oct":return Vb(e,8,a);case"hex":return Vb(e,16,a);case"auto":{var i=fM(r?.lowerExp,-3),s=fM(r?.upperExp,5);if(e.isZero())return"0";var l,c=e.toSignificantDigits(n),o=c.e;return o>=i&&o=0?"+":"")+n.toString()}function uM(e,r){return r!==void 0?e.toExponential(r-1):e.toExponential()}function Jk(e,r){return e.toFixed(r)}function fM(e,r){return sr(e)?e:rr(e)?e.toNumber():r}function mM(e,r){var t=e.length-r.length,n=e.length;return e.substring(t,n)===r}function lr(e,r){var t=Kk(e,r);return r&&typeof r=="object"&&"truncate"in r&&t.length>r.truncate?t.substring(0,r.truncate-3)+"...":t}function Kk(e,r){if(typeof e=="number")return ai(e,r);if(rr(e))return cM(e,r);if(jk(e))return!r||r.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return pM(e,r);if(St(e))return Ns(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=>Ns(n)+": "+lr(e[n],r));return"{"+t.join(", ")+"}"}return String(e)}function Ns(e){for(var r=String(e),t="",n=0;n/g,">"),r}function pM(e,r){if(Array.isArray(e)){for(var t="[",n=e.length,a=0;ar?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 tn(e,r,t){if(!(this instanceof tn))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}tn.prototype=new RangeError;tn.prototype.constructor=RangeError;tn.prototype.name="IndexError";tn.prototype.isIndexError=!0;function ur(e){for(var r=[];Array.isArray(e);)r.push(e.length),e=e[0];return r}function dM(e,r,t){var n,a=e.length;if(a!==r[t])throw new pr(a,r[t]);if(t")}function Qb(e,r){var t=r.length===0;if(t){if(Array.isArray(e))throw new pr(e.length,0)}else dM(e,r,0)}function Nc(e,r){var t=e.isMatrix?e._size:ur(e),n=r._sourceSize;n.forEach((a,i)=>{if(a!==null&&a!==t[i])throw new pr(a,t[i])})}function Kr(e,r){if(e!==void 0){if(!sr(e)||!Ze(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof r=="number"&&e>=r)throw new tn(e,r)}}function As(e){for(var r=0;r=0,c=r%t===0;if(l)if(c)n[i]=-r/t;else throw new Error("Could not replace wildcard, since "+r+" is no multiple of "+-t);return n}function hM(e){return e.reduce((r,t)=>r*t,1)}function eL(e,r){for(var t=e,n,a=r.length-1;a>0;a--){var i=r[a];n=[];for(var s=t.length/i,l=0;lr.test(t))}function Xb(e,r){return Array.prototype.join.call(e,r)}function Ki(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 yM(t,n,r,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function rL(){for(var e=arguments.length,r=new Array(e),t=0;td.length),a=Math.max(...n),i=new Array(a).fill(null),s=0;si[u]&&(i[u]=l[o])}for(var m=0;m1||e[a]>r[i])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[a]," to size ").concat(r[i]))}}function jb(e,r){var t=ur(e);if(ni(t,r))return e;Cc(t,r);var n=rL(t,r),a=n.length,i=[...Array(a-t.length).fill(1),...t],s=nL(e);t.length!iL(i)).every(i=>t[i]!==void 0);if(!n){var a=r.filter(i=>t[i]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(a.map(i=>'"'.concat(i,'"')).join(", "),"."))}}function iL(e){return e&&e[0]==="?"}function ew(e){return e&&e[0]==="?"?e.slice(1):e}function wt(e,r){if(DM(e)&&bM(e,r))return e[r];throw typeof e[r]=="function"&&Om(e,r)?new Error('Cannot access method "'+r+'" as a property'):new Error('No access to property "'+r+'"')}function Ti(e,r,t){if(DM(e)&&bM(e,r))return e[r]=t,t;throw new Error('No access to property "'+r+'"')}function xM(e,r){return r in e}function bM(e,r){return!e||typeof e!="object"?!1:Xe(oL,r)?!0:!(r in Object.prototype||r in Function.prototype)}function wM(e,r){if(!Om(e,r))throw new Error('No access to method "'+r+'"');return e[r]}function Om(e,r){return e==null||typeof e[r]!="function"||Xe(e,r)&&Object.getPrototypeOf&&r in Object.getPrototypeOf(e)?!1:Xe(sL,r)?!0:!(r in Object.prototype||r in Function.prototype)}function DM(e){return typeof e=="object"&&e&&e.constructor===Object}var oL={length:!0,name:!0},sL={toString:!0,valueOf:!0,toLocaleString:!0};var Cs=class{constructor(r){this.wrappedObject=r,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(r){return wt(this.wrappedObject,r)}set(r,t){return Ti(this.wrappedObject,r,t),this}has(r){return xM(this.wrappedObject,r)}entries(){return SM(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 SM(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 SM(e,r){return{next:()=>{var t=e.next();return t.done?t:{value:r(t.value),done:!1}}}}function Bo(){return new Map}function ji(e){if(!e)return Bo();if(rw(e))return e;if(Ci(e))return new Cs(e);throw new Error("createMap can create maps from objects or Maps")}function NM(e){if(e instanceof Cs)return e.wrappedObject;var r={};for(var t of e.keys()){var n=e.get(t);Ti(r,t,n)}return r}function rw(e){return e?e instanceof Map||e instanceof Cs||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var AM=function(){return AM=aw.default.create,aw.default},uL=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],Pm=F("typed",uL,function(r){var{BigNumber:t,Complex:n,DenseMatrix:a,Fraction:i}=r,s=AM();return s.clear(),s.addTypes([{name:"number",test:sr},{name:"Complex",test:Kt},{name:"BigNumber",test:rr},{name:"Fraction",test:da},{name:"Unit",test:Ht},{name:"identifier",test:l=>St&&/^(?:[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:St},{name:"Chain",test:bu},{name:"Array",test:Mr},{name:"Matrix",test:Qe},{name:"DenseMatrix",test:Ji},{name:"SparseMatrix",test:ha},{name:"Range",test:Fo},{name:"Index",test:Mi},{name:"boolean",test:fm},{name:"ResultSet",test:cm},{name:"Help",test:xu},{name:"function",test:lm},{name:"Date",test:mm},{name:"RegExp",test:pm},{name:"null",test:dm},{name:"undefined",test:hm},{name:"AccessorNode",test:Ln},{name:"ArrayNode",test:jt},{name:"AssignmentNode",test:vm},{name:"BlockNode",test:gm},{name:"ConditionalNode",test:ym},{name:"ConstantNode",test:xr},{name:"FunctionNode",test:yn},{name:"FunctionAssignmentNode",test:Oa},{name:"IndexNode",test:Jn},{name:"Node",test:Nr},{name:"ObjectNode",test:Ei},{name:"OperatorNode",test:ct},{name:"ParenthesisNode",test:en},{name:"RangeNode",test:xm},{name:"RelationalNode",test:bm},{name:"SymbolNode",test:at},{name:"Map",test:rw},{name:"Object",test:Ci}]),s.addConversions([{from:"number",to:"BigNumber",convert:function(c){if(t||tw(c),tM(c)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+c+"). Use function bignumber(x) to convert to BigNumber.");return new t(c)}},{from:"number",to:"Complex",convert:function(c){return n||Bm(c),new n(c,0)}},{from:"BigNumber",to:"Complex",convert:function(c){return n||Bm(c),new n(c.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(c){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(c){return n||Bm(c),new n(c.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(c){i||nw(c);var o=new i(c);if(o.valueOf()!==c)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+c+"). Use function fraction(x) to convert to Fraction.");return o}},{from:"string",to:"number",convert:function(c){var o=Number(c);if(isNaN(o))throw new Error('Cannot convert "'+c+'" to a number');return o}},{from:"string",to:"BigNumber",convert:function(c){t||tw(c);try{return new t(c)}catch{throw new Error('Cannot convert "'+c+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(c){i||nw(c);try{return new i(c)}catch{throw new Error('Cannot convert "'+c+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(c){n||Bm(c);try{return new n(c)}catch{throw new Error('Cannot convert "'+c+'" to Complex')}}},{from:"boolean",to:"number",convert:function(c){return+c}},{from:"boolean",to:"BigNumber",convert:function(c){return t||tw(c),new t(+c)}},{from:"boolean",to:"Fraction",convert:function(c){return i||nw(c),new i(+c)}},{from:"boolean",to:"string",convert:function(c){return String(c)}},{from:"Array",to:"Matrix",convert:function(c){return a||fL(),new a(c)}},{from:"Matrix",to:"Array",convert:function(c){return c.valueOf()}}]),s.onMismatch=(l,c,o)=>{var u=s.createError(l,c,o);if(["wrongType","mismatch"].includes(u.data.category)&&c.length===1&&Nt(c[0])&&o.some(d=>!d.params.includes(","))){var m=new TypeError("Function '".concat(l,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(l,")'."));throw m.data=u.data,m}throw u},s.onMismatch=(l,c,o)=>{var u=s.createError(l,c,o);if(["wrongType","mismatch"].includes(u.data.category)&&c.length===1&&Nt(c[0])&&o.some(d=>!d.params.includes(","))){var m=new TypeError("Function '".concat(l,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(l,")'."));throw m.data=u.data,m}throw u},s});function tw(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Bm(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function fL(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function nw(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var cL="ResultSet",lL=[],Im=F(cL,lL,()=>{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 Tu=9e15,qo=1e9,iw="0123456789abcdef",qm="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",km="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",ow={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Tu,maxE:Tu,crypto:!1},TM,eo,Cr=!0,zm="[DecimalError] ",Ro=zm+"Invalid argument: ",FM=zm+"Precision limit exceeded",_M=zm+"crypto unavailable",OM="[object Decimal]",Nn=Math.floor,nn=Math.pow,mL=/^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,pL=/^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,dL=/^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,BM=/^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,si=1e7,br=7,hL=9007199254740991,vL=qm.length-1,sw=km.length-1,Ue={toStringTag:OM};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,a=n.constructor;if(e=new a(e),r=new a(r),!e.s||!r.s)return new a(NaN);if(e.gt(r))throw Error(Ro+r);return t=n.cmp(e),t<0?e:n.cmp(r)>0?r:new a(n)};Ue.comparedTo=Ue.cmp=function(e){var r,t,n,a,i=this,s=i.d,l=(e=new i.constructor(e)).d,c=i.s,o=e.s;if(!s||!l)return!c||!o?NaN:c!==o?c:s===l?0:!s^c<0?1:-1;if(!s[0]||!l[0])return s[0]?c:l[0]?-o:0;if(c!==o)return c;if(i.e!==e.e)return i.e>e.e^c<0?1:-1;for(n=s.length,a=l.length,r=0,t=nl[r]^c<0?1:-1;return n===a?0:n>a^c<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=gL(n,kM(n,t)),n.precision=e,n.rounding=r,hr(eo==2||eo==3?t.neg():t,e,r,!0)):new n(1):new n(NaN)};Ue.cubeRoot=Ue.cbrt=function(){var e,r,t,n,a,i,s,l,c,o,u=this,m=u.constructor;if(!u.isFinite()||u.isZero())return new m(u);for(Cr=!1,i=u.s*nn(u.s*u,1/3),!i||Math.abs(i)==1/0?(t=xn(u.d),e=u.e,(i=(e-t.length+1)%3)&&(t+=i==1||i==-2?"0":"00"),i=nn(t,1/3),e=Nn((e+1)/3)-(e%3==(e<0?-1:2)),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new m(t),n.s=u.s):n=new m(i.toString()),s=(e=m.precision)+3;;)if(l=n,c=l.times(l).times(l),o=c.plus(u),n=Dt(o.plus(u).times(l),o.plus(c),s+2,1),xn(l.d).slice(0,s)===(t=xn(n.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!a&&t=="4999"){if(!a&&(hr(l,e+1,0),l.times(l).times(l).eq(u))){n=l;break}s+=4,a=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 Cr=!0,hr(n,e,m.rounding,r)};Ue.decimalPlaces=Ue.dp=function(){var e,r=this.d,t=NaN;if(r){if(e=r.length-1,t=(e-Nn(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 Dt(this,new this.constructor(e))};Ue.dividedToIntegerBy=Ue.divToInt=function(e){var r=this,t=r.constructor;return hr(Dt(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,a,i=this,s=i.constructor,l=new s(1);if(!i.isFinite())return new s(i.s?1/0:NaN);if(i.isZero())return l;t=s.precision,n=s.rounding,s.precision=t+Math.max(i.e,i.sd())+4,s.rounding=1,a=i.d.length,a<32?(e=Math.ceil(a/3),r=(1/Wm(4,e)).toString()):(e=16,r="2.3283064365386962890625e-10"),i=Fu(s,1,i.times(r),new s(1),!0);for(var c,o=e,u=new s(8);o--;)c=i.times(i),i=l.minus(c.times(u.minus(c.times(u))));return hr(i,s.precision=t,s.rounding=n,!0)};Ue.hyperbolicSine=Ue.sinh=function(){var e,r,t,n,a=this,i=a.constructor;if(!a.isFinite()||a.isZero())return new i(a);if(r=i.precision,t=i.rounding,i.precision=r+Math.max(a.e,a.sd())+4,i.rounding=1,n=a.d.length,n<3)a=Fu(i,2,a,a,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,a=a.times(1/Wm(5,e)),a=Fu(i,2,a,a,!0);for(var s,l=new i(5),c=new i(16),o=new i(20);e--;)s=a.times(a),a=a.times(l.plus(s.times(c.times(s).plus(o))))}return i.precision=r,i.rounding=t,hr(a,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,Dt(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),a=t.precision,i=t.rounding;return n!==-1?n===0?r.isNeg()?oi(t,a,i):new t(0):new t(NaN):r.isZero()?oi(t,a+4,i).times(.5):(t.precision=a+6,t.rounding=1,r=r.asin(),e=oi(t,a+4,i).times(.5),t.precision=a,t.rounding=i,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,Cr=!1,t=t.times(t).minus(1).sqrt().plus(t),Cr=!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,Cr=!1,t=t.times(t).plus(1).sqrt().plus(t),Cr=!0,n.precision=e,n.rounding=r,t.ln())};Ue.inverseHyperbolicTangent=Ue.atanh=function(){var e,r,t,n,a=this,i=a.constructor;return a.isFinite()?a.e>=0?new i(a.abs().eq(1)?a.s/0:a.isZero()?a:NaN):(e=i.precision,r=i.rounding,n=a.sd(),Math.max(n,e)<2*-a.e-1?hr(new i(a),e,r,!0):(i.precision=t=n-a.e,a=Dt(a.plus(1),new i(1).minus(a),t+e,1),i.precision=e+4,i.rounding=1,a=a.ln(),i.precision=e,i.rounding=r,a.times(.5))):new i(NaN)};Ue.inverseSine=Ue.asin=function(){var e,r,t,n,a=this,i=a.constructor;return a.isZero()?new i(a):(r=a.abs().cmp(1),t=i.precision,n=i.rounding,r!==-1?r===0?(e=oi(i,t+4,n).times(.5),e.s=a.s,e):new i(NaN):(i.precision=t+6,i.rounding=1,a=a.div(new i(1).minus(a.times(a)).sqrt().plus(1)).atan(),i.precision=t,i.rounding=n,a.times(2)))};Ue.inverseTangent=Ue.atan=function(){var e,r,t,n,a,i,s,l,c,o=this,u=o.constructor,m=u.precision,d=u.rounding;if(o.isFinite()){if(o.isZero())return new u(o);if(o.abs().eq(1)&&m+4<=sw)return s=oi(u,m+4,d).times(.25),s.s=o.s,s}else{if(!o.s)return new u(NaN);if(m+4<=sw)return s=oi(u,m+4,d).times(.5),s.s=o.s,s}for(u.precision=l=m+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(Cr=!1,r=Math.ceil(l/br),n=1,c=o.times(o),s=new u(o),a=o;e!==-1;)if(a=a.times(c),i=s.minus(a.div(n+=2)),a=a.times(c),s=i.plus(a.div(n+=2)),s.d[r]!==void 0)for(e=r;s.d[e]===i.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,a,i,s,l,c,o=this,u=o.constructor,m=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)i=!0;else{for(a=t[0];a%10===0;)a/=10;i=a!==1}if(Cr=!1,l=m+h,s=Io(o,l),n=r?Lm(u,l+10):Io(e,l),c=Dt(s,n,l,1),Ec(c.d,a=m,d))do if(l+=10,s=Io(o,l),n=r?Lm(u,l+10):Io(e,l),c=Dt(s,n,l,1),!i){+xn(c.d).slice(a+1,a+15)+1==1e14&&(c=hr(c,m+1,0));break}while(Ec(c.d,a+=10,d));return Cr=!0,hr(c,m,d)};Ue.minus=Ue.sub=function(e){var r,t,n,a,i,s,l,c,o,u,m,d,h=this,y=h.constructor;if(e=new y(e),!h.d||!e.d)return!h.s||!e.s?e=new y(NaN):h.d?e.s=-e.s:e=new y(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,l=y.precision,c=y.rounding,!o[0]||!d[0]){if(d[0])e.s=-e.s;else if(o[0])e=new y(h);else return new y(c===3?-0:0);return Cr?hr(e,l,c):e}if(t=Nn(e.e/br),u=Nn(h.e/br),o=o.slice(),i=u-t,i){for(m=i<0,m?(r=o,i=-i,s=d.length):(r=d,t=u,s=o.length),n=Math.max(Math.ceil(l/br),s)+2,i>n&&(i=n,r.length=1),r.reverse(),n=i;n--;)r.push(0);r.reverse()}else{for(n=o.length,s=d.length,m=n0;--n)o[s++]=0;for(n=d.length;n>i;){if(o[--n]s?i+1:s+1,a>s&&(a=s,t.length=1),t.reverse();a--;)t.push(0);t.reverse()}for(s=o.length,a=u.length,s-a<0&&(a=s,t=u,u=o,o=t),r=0;a;)r=(o[--a]=o[a]+u[a]+r)/si|0,o[a]%=si;for(r&&(o.unshift(r),++n),s=o.length;o[--s]==0;)o.pop();return e.d=o,e.e=Um(o,n),Cr?hr(e,l,c):e};Ue.precision=Ue.sd=function(e){var r,t=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ro+e);return t.d?(r=PM(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=xL(n,kM(n,t)),n.precision=e,n.rounding=r,hr(eo>2?t.neg():t,e,r,!0)):new n(NaN)};Ue.squareRoot=Ue.sqrt=function(){var e,r,t,n,a,i,s=this,l=s.d,c=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(Cr=!1,o=Math.sqrt(+s),o==0||o==1/0?(r=xn(l),(r.length+c)%2==0&&(r+="0"),o=Math.sqrt(r),c=Nn((c+1)/2)-(c<0||c%2),o==1/0?r="5e"+c:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+c),n=new u(r)):n=new u(o.toString()),t=(c=u.precision)+3;;)if(i=n,n=i.plus(Dt(s,i,t+2,1)).times(.5),xn(i.d).slice(0,t)===(r=xn(n.d)).slice(0,t))if(r=r.slice(t-3,t+1),r=="9999"||!a&&r=="4999"){if(!a&&(hr(i,c+1,0),i.times(i).eq(s))){n=i;break}t+=4,a=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(hr(n,c+1,1),e=!n.times(n).eq(s));break}return Cr=!0,hr(n,c,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=Dt(t,new n(1).minus(t.times(t)).sqrt(),e+10,0),n.precision=e,n.rounding=r,hr(eo==2||eo==4?t.neg():t,e,r,!0)):new n(NaN)};Ue.times=Ue.mul=function(e){var r,t,n,a,i,s,l,c,o,u=this,m=u.constructor,d=u.d,h=(e=new m(e)).d;if(e.s*=u.s,!d||!d[0]||!h||!h[0])return new m(!e.s||d&&!d[0]&&!h||h&&!h[0]&&!d?NaN:!d||!h?e.s/0:e.s*0);for(t=Nn(u.e/br)+Nn(e.e/br),c=d.length,o=h.length,c=0;){for(r=0,a=c+n;a>n;)l=i[a]+h[n]*d[a-n-1]+r,i[a--]=l%si|0,r=l/si|0;i[a]=(i[a]+r)%si|0}for(;!i[--s];)i.pop();return r?++t:i.shift(),e.d=i,e.e=Um(i,t),Cr?hr(e,m.precision,m.rounding):e};Ue.toBinary=function(e,r){return cw(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:(jn(e,0,qo),r===void 0?r=n.rounding:jn(r,0,8),hr(t,e+t.e+1,r))};Ue.toExponential=function(e,r){var t,n=this,a=n.constructor;return e===void 0?t=Fi(n,!0):(jn(e,0,qo),r===void 0?r=a.rounding:jn(r,0,8),n=hr(new a(n),e+1,r),t=Fi(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+t:t};Ue.toFixed=function(e,r){var t,n,a=this,i=a.constructor;return e===void 0?t=Fi(a):(jn(e,0,qo),r===void 0?r=i.rounding:jn(r,0,8),n=hr(new i(a),e+a.e+1,r),t=Fi(n,!1,e+n.e+1)),a.isNeg()&&!a.isZero()?"-"+t:t};Ue.toFraction=function(e){var r,t,n,a,i,s,l,c,o,u,m,d,h=this,y=h.d,v=h.constructor;if(!y)return new v(h);if(o=t=new v(1),n=c=new v(0),r=new v(n),i=r.e=PM(y)-h.e-1,s=i%br,r.d[0]=nn(10,s<0?br+s:s),e==null)e=i>0?r:o;else{if(l=new v(e),!l.isInt()||l.lt(o))throw Error(Ro+l);e=l.gt(r)?i>0?r:o:l}for(Cr=!1,l=new v(xn(y)),u=v.precision,v.precision=i=y.length*br*2;m=Dt(l,r,0,1,1),a=t.plus(m.times(n)),a.cmp(e)!=1;)t=n,n=a,a=o,o=c.plus(m.times(a)),c=a,a=r,r=l.minus(m.times(a)),l=a;return a=Dt(e.minus(t),n,0,1,1),c=c.plus(a.times(o)),t=t.plus(a.times(n)),c.s=o.s=h.s,d=Dt(o,n,i,1).minus(h).abs().cmp(Dt(c,t,i,1).minus(h).abs())<1?[o,n]:[c,t],v.precision=u,Cr=!0,d};Ue.toHexadecimal=Ue.toHex=function(e,r){return cw(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:jn(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]?(Cr=!1,t=Dt(t,e,0,r,1).times(e),Cr=!0,hr(t)):(e.s=t.s,t=e),t};Ue.toNumber=function(){return+this};Ue.toOctal=function(e,r){return cw(this,8,e,r)};Ue.toPower=Ue.pow=function(e){var r,t,n,a,i,s,l=this,c=l.constructor,o=+(e=new c(e));if(!l.d||!e.d||!l.d[0]||!e.d[0])return new c(nn(+l,o));if(l=new c(l),l.eq(1))return l;if(n=c.precision,i=c.rounding,e.eq(1))return hr(l,n,i);if(r=Nn(e.e/br),r>=e.d.length-1&&(t=o<0?-o:o)<=hL)return a=IM(c,l,t,n),e.s<0?new c(1).div(a):hr(a,n,i);if(s=l.s,s<0){if(rc.maxE+1||r0?s/0:0):(Cr=!1,c.rounding=l.s=1,t=Math.min(12,(r+"").length),a=uw(e.times(Io(l,n+t)),n),a.d&&(a=hr(a,n+5,1),Ec(a.d,n,i)&&(r=n+10,a=hr(uw(e.times(Io(l,r+t)),r),r+5,1),+xn(a.d).slice(n+1,n+15)+1==1e14&&(a=hr(a,n+1,0)))),a.s=s,Cr=!0,c.rounding=i,hr(a,n,i))};Ue.toPrecision=function(e,r){var t,n=this,a=n.constructor;return e===void 0?t=Fi(n,n.e<=a.toExpNeg||n.e>=a.toExpPos):(jn(e,1,qo),r===void 0?r=a.rounding:jn(r,0,8),n=hr(new a(n),e,r),t=Fi(n,e<=n.e||n.e<=a.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):(jn(e,1,qo),r===void 0?r=n.rounding:jn(r,0,8)),hr(new n(t),e,r)};Ue.toString=function(){var e=this,r=e.constructor,t=Fi(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=Fi(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()?"-"+t:t};function xn(e){var r,t,n,a=e.length-1,i="",s=e[0];if(a>0){for(i+=s,r=1;rt)throw Error(Ro+e)}function Ec(e,r,t,n){var a,i,s,l;for(i=e[0];i>=10;i/=10)--r;return--r<0?(r+=br,a=0):(a=Math.ceil((r+1)/br),r%=br),i=nn(10,br-r),l=e[a]%i|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==i||t>3&&l+1==i/2)&&(e[a+1]/i/100|0)==nn(10,r-2)-1||(l==i/2||l==0)&&(e[a+1]/i/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==i||!n&&t>3&&l+1==i/2)&&(e[a+1]/i/1e3|0)==nn(10,r-3)-1,s}function Rm(e,r,t){for(var n,a=[0],i,s=0,l=e.length;st-1&&(a[n+1]===void 0&&(a[n+1]=0),a[n+1]+=a[n]/t|0,a[n]%=t)}return a.reverse()}function gL(e,r){var t,n,a;if(r.isZero())return r;n=r.d.length,n<32?(t=Math.ceil(n/3),a=(1/Wm(4,t)).toString()):(t=16,a="2.3283064365386962890625e-10"),e.precision+=t,r=Fu(e,1,r.times(a),new e(1));for(var i=t;i--;){var s=r.times(r);r=s.times(s).minus(s).times(8).plus(1)}return e.precision-=t,r}var Dt=function(){function e(n,a,i){var s,l=0,c=n.length;for(n=n.slice();c--;)s=n[c]*a+l,n[c]=s%i|0,l=s/i|0;return l&&n.unshift(l),n}function r(n,a,i,s){var l,c;if(i!=s)c=i>s?1:-1;else for(l=c=0;la[l]?1:-1;break}return c}function t(n,a,i,s){for(var l=0;i--;)n[i]-=l,l=n[i]1;)n.shift()}return function(n,a,i,s,l,c){var o,u,m,d,h,y,v,x,w,C,b,N,M,S,O,_,E,T,R,L,H=n.constructor,V=n.s==a.s?1:-1,W=n.d,k=a.d;if(!W||!W[0]||!k||!k[0])return new H(!n.s||!a.s||(W?k&&W[0]==k[0]:!k)?NaN:W&&W[0]==0||!k?V*0:V/0);for(c?(h=1,u=n.e-a.e):(c=si,h=br,u=Nn(n.e/h)-Nn(a.e/h)),R=k.length,E=W.length,w=new H(V),C=w.d=[],m=0;k[m]==(W[m]||0);m++);if(k[m]>(W[m]||0)&&u--,i==null?(S=i=H.precision,s=H.rounding):l?S=i+(n.e-a.e)+1:S=i,S<0)C.push(1),y=!0;else{if(S=S/h+2|0,m=0,R==1){for(d=0,k=k[0],S++;(m1&&(k=e(k,d,c),W=e(W,d,c),R=k.length,E=W.length),_=R,b=W.slice(0,R),N=b.length;N=c/2&&++T;do d=0,o=r(k,b,R,N),o<0?(M=b[0],R!=N&&(M=M*c+(b[1]||0)),d=M/T|0,d>1?(d>=c&&(d=c-1),v=e(k,d,c),x=v.length,N=b.length,o=r(v,b,x,N),o==1&&(d--,t(v,R=10;d/=10)m++;w.e=m+u*h-1,hr(w,l?i+w.e+1:i,s,y)}return w}}();function hr(e,r,t,n){var a,i,s,l,c,o,u,m,d,h=e.constructor;e:if(r!=null){if(m=e.d,!m)return e;for(a=1,l=m[0];l>=10;l/=10)a++;if(i=r-a,i<0)i+=br,s=r,u=m[d=0],c=u/nn(10,a-s-1)%10|0;else if(d=Math.ceil((i+1)/br),l=m.length,d>=l)if(n){for(;l++<=d;)m.push(0);u=c=0,a=1,i%=br,s=i-br+1}else break e;else{for(u=l=m[d],a=1;l>=10;l/=10)a++;i%=br,s=i-br+a,c=s<0?0:u/nn(10,a-s-1)%10|0}if(n=n||r<0||m[d+1]!==void 0||(s<0?u:u%nn(10,a-s-1)),o=t<4?(c||n)&&(t==0||t==(e.s<0?3:2)):c>5||c==5&&(t==4||n||t==6&&(i>0?s>0?u/nn(10,a-s):0:m[d-1])%10&1||t==(e.s<0?8:7)),r<1||!m[0])return m.length=0,o?(r-=e.e+1,m[0]=nn(10,(br-r%br)%br),e.e=-r||0):m[0]=e.e=0,e;if(i==0?(m.length=d,l=1,d--):(m.length=d+1,l=nn(10,br-i),m[d]=s>0?(u/nn(10,a-s)%nn(10,s)|0)*l:0),o)for(;;)if(d==0){for(i=1,s=m[0];s>=10;s/=10)i++;for(s=m[0]+=l,l=1;s>=10;s/=10)l++;i!=l&&(e.e++,m[0]==si&&(m[0]=1));break}else{if(m[d]+=l,m[d]!=si)break;m[d--]=0,l=1}for(i=m.length;m[--i]===0;)m.pop()}return Cr&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e0?i=i.charAt(0)+"."+i.slice(1)+Po(n):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(e.e<0?"e":"e+")+e.e):a<0?(i="0."+Po(-a-1)+i,t&&(n=t-s)>0&&(i+=Po(n))):a>=s?(i+=Po(a+1-s),t&&(n=t-a-1)>0&&(i=i+"."+Po(n))):((n=a+1)0&&(a+1===s&&(i+="."),i+=Po(n))),i}function Um(e,r){var t=e[0];for(r*=br;t>=10;t/=10)r++;return r}function Lm(e,r,t){if(r>vL)throw Cr=!0,t&&(e.precision=t),Error(FM);return hr(new e(qm),r,1,!0)}function oi(e,r,t){if(r>sw)throw Error(FM);return hr(new e(km),r,t,!0)}function PM(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 Po(e){for(var r="";e--;)r+="0";return r}function IM(e,r,t,n){var a,i=new e(1),s=Math.ceil(n/br+4);for(Cr=!1;;){if(t%2&&(i=i.times(r),CM(i.d,s)&&(a=!0)),t=Nn(t/2),t===0){t=i.d.length-1,a&&i.d[t]===0&&++i.d[t];break}r=r.times(r),CM(r.d,s)}return Cr=!0,i}function MM(e){return e.d[e.d.length-1]&1}function RM(e,r,t){for(var n,a=new e(r[0]),i=0;++i17)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?(Cr=!1,c=y):c=r,l=new d(.03125);e.e>-2;)e=e.times(l),m+=5;for(n=Math.log(nn(2,m))/Math.LN10*2+5|0,c+=n,t=i=s=new d(1),d.precision=c;;){if(i=hr(i.times(e),c,1),t=t.times(++u),l=s.plus(Dt(i,t,c,1)),xn(l.d).slice(0,c)===xn(s.d).slice(0,c)){for(a=m;a--;)s=hr(s.times(s),c,1);if(r==null)if(o<3&&Ec(s.d,c-n,h,o))d.precision=c+=10,t=i=l=new d(1),u=0,o++;else return hr(s,d.precision=y,h,Cr=!0);else return d.precision=y,s}s=l}}function Io(e,r){var t,n,a,i,s,l,c,o,u,m,d,h=1,y=10,v=e,x=v.d,w=v.constructor,C=w.rounding,b=w.precision;if(v.s<0||!x||!x[0]||!v.e&&x[0]==1&&x.length==1)return new w(x&&!x[0]?-1/0:v.s!=1?NaN:x?0:v);if(r==null?(Cr=!1,u=b):u=r,w.precision=u+=y,t=xn(x),n=t.charAt(0),Math.abs(i=v.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)v=v.times(e),t=xn(v.d),n=t.charAt(0),h++;i=v.e,n>1?(v=new w("0."+t),i++):v=new w(n+"."+t.slice(1))}else return o=Lm(w,u+2,b).times(i+""),v=Io(new w(n+"."+t.slice(1)),u-y).plus(o),w.precision=b,r==null?hr(v,b,C,Cr=!0):v;for(m=v,c=s=v=Dt(v.minus(1),v.plus(1),u,1),d=hr(v.times(v),u,1),a=3;;){if(s=hr(s.times(d),u,1),o=c.plus(Dt(s,new w(a),u,1)),xn(o.d).slice(0,u)===xn(c.d).slice(0,u))if(c=c.times(2),i!==0&&(c=c.plus(Lm(w,u+2,b).times(i+""))),c=Dt(c,new w(h),u,1),r==null)if(Ec(c.d,u-y,C,l))w.precision=u+=y,o=s=v=Dt(m.minus(1),m.plus(1),u,1),d=hr(v.times(v),u,1),a=l=1;else return hr(c,w.precision=b,C,Cr=!0);else return w.precision=b,c;c=o,a+=2}}function qM(e){return String(e.s*e.s/0)}function fw(e,r){var t,n,a;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(a=r.length;r.charCodeAt(a-1)===48;--a);if(r=r.slice(n,a),r){if(a-=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"),BM.test(r))return fw(e,r)}else if(r==="Infinity"||r==="NaN")return+r||(e.s=NaN),e.e=NaN,e.d=null,e;if(pL.test(r))t=16,r=r.toLowerCase();else if(mL.test(r))t=2;else if(dL.test(r))t=8;else throw Error(Ro+r);for(i=r.search(/p/i),i>0?(c=+r.slice(i+1),r=r.substring(2,i)):r=r.slice(2),i=r.indexOf("."),s=i>=0,n=e.constructor,s&&(r=r.replace(".",""),l=r.length,i=l-i,a=IM(n,new n(t),i,i*2)),o=Rm(r,t,si),u=o.length-1,i=u;o[i]===0;--i)o.pop();return i<0?new n(e.s*0):(e.e=Um(o,u),e.d=o,Cr=!1,s&&(e=Dt(e,a,l*4)),c&&(e=e.times(Math.abs(c)<54?nn(2,c):Tc.pow(2,c))),Cr=!0,e)}function xL(e,r){var t,n=r.d.length;if(n<3)return r.isZero()?r:Fu(e,2,r,r);t=1.4*Math.sqrt(n),t=t>16?16:t|0,r=r.times(1/Wm(5,t)),r=Fu(e,2,r,r);for(var a,i=new e(5),s=new e(16),l=new e(20);t--;)a=r.times(r),r=r.times(i.plus(a.times(s.times(a).minus(l))));return r}function Fu(e,r,t,n,a){var i,s,l,c,o=1,u=e.precision,m=Math.ceil(u/br);for(Cr=!1,c=t.times(t),l=new e(n);;){if(s=Dt(l.times(c),new e(r++*r++),u,1),l=a?n.plus(s):n.minus(s),n=Dt(s.times(c),new e(r++*r++),u,1),s=l.plus(n),s.d[m]!==void 0){for(i=m;s.d[i]===l.d[i]&&i--;);if(i==-1)break}i=l,l=n,n=s,s=i,o++}return Cr=!0,s.d.length=m+1,s}function Wm(e,r){for(var t=e;--r;)t*=e;return t}function kM(e,r){var t,n=r.s<0,a=oi(e,e.precision,1),i=a.times(.5);if(r=r.abs(),r.lte(i))return eo=n?4:1,r;if(t=r.divToInt(a),t.isZero())eo=n?3:2;else{if(r=r.minus(t.times(a)),r.lte(i))return eo=MM(t)?n?2:3:n?4:1,r;eo=MM(t)?n?1:4:n?3:2}return r.minus(a).abs()}function cw(e,r,t,n){var a,i,s,l,c,o,u,m,d,h=e.constructor,y=t!==void 0;if(y?(jn(t,1,qo),n===void 0?n=h.rounding:jn(n,0,8)):(t=h.precision,n=h.rounding),!e.isFinite())u=qM(e);else{for(u=Fi(e),s=u.indexOf("."),y?(a=2,r==16?t=t*4-3:r==8&&(t=t*3-2)):a=r,s>=0&&(u=u.replace(".",""),d=new h(1),d.e=u.length-s,d.d=Rm(Fi(d),10,a),d.e=d.d.length),m=Rm(u,10,a),i=c=m.length;m[--c]==0;)m.pop();if(!m[0])u=y?"0p+0":"0";else{if(s<0?i--:(e=new h(e),e.d=m,e.e=i,e=Dt(e,d,t,n,0,a),m=e.d,i=e.e,o=TM),s=m[t],l=a/2,o=o||m[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&&m[t-1]&1||n===(e.s<0?8:7)),m.length=t,o)for(;++m[--t]>a-1;)m[t]=0,t||(++i,m.unshift(1));for(c=m.length;!m[c-1];--c);for(s=0,u="";s1)if(r==16||r==8){for(s=r==16?4:3,--c;c%s;c++)u+="0";for(m=Rm(u,a,r),c=m.length;!m[c-1];--c);for(s=1,u="1.";sc)for(i-=c;i--;)u+="0";else ir)return e.length=r,!0}function bL(e){return new this(e).abs()}function wL(e){return new this(e).acos()}function DL(e){return new this(e).acosh()}function SL(e,r){return new this(e).plus(r)}function NL(e){return new this(e).asin()}function AL(e){return new this(e).asinh()}function ML(e){return new this(e).atan()}function CL(e){return new this(e).atanh()}function EL(e,r){e=new this(e),r=new this(r);var t,n=this.precision,a=this.rounding,i=n+4;return!e.s||!r.s?t=new this(NaN):!e.d&&!r.d?(t=oi(this,i,1).times(r.s>0?.25:.75),t.s=e.s):!r.d||e.isZero()?(t=r.s<0?oi(this,n,a):new this(0),t.s=e.s):!e.d||r.isZero()?(t=oi(this,i,1).times(.5),t.s=e.s):r.s<0?(this.precision=i,this.rounding=1,t=this.atan(Dt(e,r,i,1)),r=oi(this,i,1),this.precision=n,this.rounding=a,t=e.s<0?t.minus(r):t.plus(r)):t=this.atan(Dt(e,r,i,1)),t}function TL(e){return new this(e).cbrt()}function FL(e){return hr(e=new this(e),e.e+1,2)}function _L(e,r,t){return new this(e).clamp(r,t)}function OL(e){if(!e||typeof e!="object")throw Error(zm+"Object expected");var r,t,n,a=e.defaults===!0,i=["precision",1,qo,"rounding",0,8,"toExpNeg",-Tu,0,"toExpPos",0,Tu,"maxE",0,Tu,"minE",-Tu,0,"modulo",0,9];for(r=0;r=i[r+1]&&n<=i[r+2])this[t]=n;else throw Error(Ro+t+": "+n);if(t="crypto",a&&(this[t]=ow[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(_M);else this[t]=!1;else throw Error(Ro+t+": "+n);return this}function BL(e){return new this(e).cos()}function PL(e){return new this(e).cosh()}function LM(e){var r,t,n;function a(i){var s,l,c,o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,EM(i)){o.s=i.s,Cr?!i.d||i.e>a.maxE?(o.e=NaN,o.d=null):i.e=10;l/=10)s++;Cr?s>a.maxE?(o.e=NaN,o.d=null):s=429e7?r[i]=crypto.getRandomValues(new Uint32Array(1))[0]:l[i++]=a%1e7;else if(crypto.randomBytes){for(r=crypto.randomBytes(n*=4);i=214e7?crypto.randomBytes(4).copy(r,i):(l.push(a%1e7),i+=4);i=n/4}else throw Error(_M);else for(;i=10;a/=10)n++;n{var{on:r,config:t}=e,n=Es.clone({precision:t.precision,modulo:Es.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(a){return new n(a.value)},r&&r("config",function(a,i){a.precision!==i.precision&&n.config({precision:a.precision})}),n},{isClass:!0});var fn=ma(UM(),1);var sz="Complex",uz=[],Hm=F(sz,uz,()=>(Object.defineProperty(fn.default,"name",{value:"Complex"}),fn.default.prototype.constructor=fn.default,fn.default.prototype.type="Complex",fn.default.prototype.isComplex=!0,fn.default.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},fn.default.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},fn.default.prototype.format=function(e){var r="",t=this.im,n=this.re,a=ai(this.re,e),i=ai(this.im,e),s=sr(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(_i.default,"name",{value:"Fraction"}),_i.default.prototype.constructor=_i.default,_i.default.prototype.type="Fraction",_i.default.prototype.isFraction=!0,_i.default.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},_i.default.fromJSON=function(e){return new _i.default(e)},_i.default),{isClass:!0});var lz="Range",mz=[],Gm=F(lz,mz,()=>{function e(r,t,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var a=r!=null,i=t!=null,s=n!=null;if(a){if(rr(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter start must be a number")}if(i){if(rr(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter end must be a number")}if(s){if(rr(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=a?parseFloat(r):0,this.end=i?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(i){return parseFloat(i)}),a=n.some(function(i){return isNaN(i)});if(a)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,a=this.end,i=a-t;return Ba(n)===Ba(i)?r=Math.ceil(i/n):i===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,a=this.end,i=0;if(n>0)for(;ta;)r(t,[i],this),t+=n,i++},e.prototype.map=function(r){var t=[];return this.forEach(function(n,a,i){t[a[0]]=r(n,a,i)}),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=ai(this.start,r);return this.step!==1&&(t+=":"+ai(this.step,r)),t+=":"+ai(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 pz="Matrix",dz=[],Vm=F(pz,dz,()=>{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 HM(e){var r=0,t=1,n=Object.create(null),a=Object.create(null),i=0,s=function(c){var o=a[c];if(!!o&&(delete n[o],delete a[c],--r,t===o)){if(!r){i=0,t=1;return}for(;!Object.prototype.hasOwnProperty.call(n,++t););}};return e=Math.abs(e),{hit:function(c){var o=a[c],u=++i;if(n[u]=c,a[c]=u,!o)return++r,r<=e?void 0:(c=n[t],s(c),c);if(delete n[o],t===o)for(;!Object.prototype.hasOwnProperty.call(n,++t););},delete:s,clear:function(){r=i=0,t=1,n=Object.create(null),a=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:HM(t||Number.POSITIVE_INFINITY)});for(var a=[],i=0;i{var{Matrix:r}=e;function t(u,m){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(m&&!St(m))throw new Error("Invalid datatype: "+m);if(Qe(u))u.type==="DenseMatrix"?(this._data=ar(u._data),this._size=ar(u._size),this._datatype=m||u._datatype):(this._data=u.toArray(),this._size=u.size(),this._datatype=m||u._datatype);else if(u&&Mr(u.data)&&Mr(u.size))this._data=u.data,this._size=u.size,Qb(this._data,this._size),this._datatype=m||u.datatype;else if(Mr(u))this._data=o(u),this._size=ur(this._data),Qb(this._data,this._size),this._datatype=m;else{if(u)throw new TypeError("Unsupported type of data ("+Tr(u)+")");this._data=[],this._size=[0],this._datatype=m}}t.prototype=new r,t.prototype.createDenseMatrix=function(u,m){return new t(u,m)},Object.defineProperty(t,"name",{value:"DenseMatrix"}),t.prototype.constructor=t,t.prototype.type="DenseMatrix",t.prototype.isDenseMatrix=!0,t.prototype.getDataType=function(){return Oo(this._data,Tr)},t.prototype.storage=function(){return"dense"},t.prototype.datatype=function(){return this._datatype},t.prototype.create=function(u,m){return new t(u,m)},t.prototype.subset=function(u,m,d){switch(arguments.length){case 1:return n(this,u);case 2:case 3:return i(this,u,m,d);default:throw new SyntaxError("Wrong number of arguments")}},t.prototype.get=function(u){if(!Mr(u))throw new TypeError("Array expected");if(u.length!==this._size.length)throw new pr(u.length,this._size.length);for(var m=0;m");var b=m.max().map(function(S){return S+1});c(u,b,h);var N=y.length,M=0;s(u._data,m,d,N,M)}return u}function s(u,m,d,h,y){var v=y===h-1,x=m.dimension(y);v?x.forEach(function(w,C){Kr(w),u[w]=d[C[0]]}):x.forEach(function(w,C){Kr(w),s(u[w],m,d[C[0]],h,y+1)})}t.prototype.resize=function(u,m,d){if(!Nt(u))throw new TypeError("Array or Matrix expected");var h=u.valueOf().map(v=>Array.isArray(v)&&v.length===1?v[0]:v),y=d?this.clone():this;return l(y,h,m)};function l(u,m,d){if(m.length===0){for(var h=u._data;Mr(h);)h=h[0];return h}return u._size=m.slice(0),u._data=ii(u._data,u._size,d),u}t.prototype.reshape=function(u,m){var d=m?this.clone():this;d._data=Ac(d._data,u);var h=d._size.reduce((y,v)=>y*v);return d._size=Mc(u,h),d};function c(u,m,d){for(var h=u._size.slice(0),y=!1;h.lengthh[v]&&(h[v]=m[v],y=!0);y&&l(u,h,d)}t.prototype.clone=function(){var u=new t({data:ar(this._data),size:ar(this._size),datatype:this._datatype});return u},t.prototype.size=function(){return this._size.slice(0)},t.prototype.map=function(u){var m=this,d=Zm(u),h=function x(w,C){return Mr(w)?w.map(function(b,N){return x(b,C.concat(N))}):d===1?u(w):d===2?u(w,C):u(w,C,m)},y=h(this._data,[]),v=this._datatype!==void 0?Oo(y,Tr):void 0;return new t(y,v)},t.prototype.forEach=function(u){var m=this,d=function h(y,v){Mr(y)?y.forEach(function(x,w){h(x,v.concat(w))}):u(y,v,m)};d(this._data,[])},t.prototype[Symbol.iterator]=function*(){var u=function*m(d,h){if(Mr(d))for(var y=0;y[b[w]]);m.push(new t(C,u._datatype))},v=0;v0?u:0,d=u<0?-u:0,h=this._size[0],y=this._size[1],v=Math.min(h-d,y-m),x=[],w=0;w0?d:0,v=d<0?-d:0,x=u[0],w=u[1],C=Math.min(x-v,w-y),b;if(Mr(m)){if(m.length!==C)throw new Error("Invalid value array length");b=function(_){return m[_]}}else if(Qe(m)){var N=m.size();if(N.length!==1||N[0]!==C)throw new Error("Invalid matrix length");b=function(_){return m.get([_])}}else b=function(){return m};h||(h=rr(b(0))?b(0).mul(0):0);var M=[];if(u.length>0){M=ii(M,u,h);for(var S=0;S{var{typed:r}=e;return r($M,{any:ar})});function Jm(e){var r=e.length,t=e[0].length,n,a,i=[];for(a=0;a=n.length)throw new tn(r,n.length);return Qe(e)?e.create(Km(e.valueOf(),r,t)):Km(e,r,t)}function Km(e,r,t){var n,a,i,s;if(r<=0)if(Array.isArray(e[0])){for(s=Jm(e),a=[],n=0;n{var{typed:r}=e;return r(GM,{number:Ze,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 ea="number",ro="number, number";function dw(e){return Math.abs(e)}dw.signature=ea;function hw(e,r){return e+r}hw.signature=ro;function vw(e,r){return e-r}vw.signature=ro;function gw(e,r){return e*r}gw.signature=ro;function xz(e,r){return e/r}xz.signature=ro;function yw(e){return-e}yw.signature=ea;function xw(e){return e}xw.signature=ea;function _u(e){return jA(e)}_u.signature=ea;function bw(e){return e*e*e}bw.signature=ea;function ww(e){return Math.exp(e)}ww.signature=ea;function Dw(e){return eM(e)}Dw.signature=ea;function bz(e,r){if(!Ze(e)||!Ze(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}bz.signature=ro;function Sw(e,r){if(!Ze(e)||!Ze(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)}Sw.signature=ro;function VM(e,r){return r?Math.log(e)/Math.log(r):Math.log(e)}function Nw(e){return KA(e)}Nw.signature=ea;function Aw(e){return JA(e)}Aw.signature=ea;function wz(e){return Am(e)}wz.signature=ea;function Dz(e,r){return r===0?e:e-r*Math.floor(e/r)}Dz.signature=ro;function Mw(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 ep(e){return Ba(e)}ep.signature=ea;function Sz(e){return Math.sqrt(e)}Sz.signature=ea;function Cw(e){return e*e}Cw.signature=ea;function Ew(e,r){var t,n,a,i=0,s=1,l=1,c=0;if(!Ze(e)||!Ze(r))throw new Error("Parameters in function xgcd must be integer numbers");for(;r;)n=Math.floor(e/r),a=e-n*r,t=i,i=s-n*i,s=t,t=l,l=c-n*l,c=t,e=r,r=a;var o;return e<0?o=[-e,-s,-c]:o=[e,e?s:0,c],o}Ew.signature=ro;function Tw(e,r){return e*e<1&&r===1/0||e*e>1&&r===-1/0?0:Math.pow(e,r)}Tw.signature=ro;function Ou(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!Ze(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(Gb(e,r))}function Nz(e){return Math.abs(e)}Nz.signature=ea;var Az="number",Bu="number, number";function Fw(e,r){if(!Ze(e)||!Ze(r))throw new Error("Integers expected in function bitAnd");return e&r}Fw.signature=Bu;function _w(e){if(!Ze(e))throw new Error("Integer expected in function bitNot");return~e}_w.signature=Az;function Ow(e,r){if(!Ze(e)||!Ze(r))throw new Error("Integers expected in function bitOr");return e|r}Ow.signature=Bu;function Bw(e,r){if(!Ze(e)||!Ze(r))throw new Error("Integers expected in function bitXor");return e^r}Bw.signature=Bu;function Pw(e,r){if(!Ze(e)||!Ze(r))throw new Error("Integers expected in function leftShift");return e<>r}Iw.signature=Bu;function Rw(e,r){if(!Ze(e)||!Ze(r))throw new Error("Integers expected in function rightLogShift");return e>>>r}Rw.signature=Bu;function va(e,r){if(r>1;return va(e,t)*va(t+1,r)}function qw(e,r){if(!Ze(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!Ze(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,a=r171?1/0:va(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*Fc(1-e));if(e>=171.35)return 1/0;if(e>85){var t=e*e,n=t*e,a=n*e,i=a*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*a)+163879/(209018880*i)+5246819/(75246796800*i*e))}--e,r=Fs[0];for(var s=1;s=1;n--)t+=KM[n]/(e+n);return Hw+(e+.5)*Math.log(r)-r+Math.log(t)}_c.signature="number";var Ct="number",Tz="number, number";function Fz(e){return Math.acos(e)}Fz.signature=Ct;function $w(e){return nM(e)}$w.signature=Ct;function Gw(e){return Math.atan(1/e)}Gw.signature=Ct;function Vw(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}Vw.signature=Ct;function Zw(e){return Math.asin(1/e)}Zw.signature=Ct;function Qw(e){var r=1/e;return Math.log(r+Math.sqrt(r*r+1))}Qw.signature=Ct;function Xw(e){return Math.acos(1/e)}Xw.signature=Ct;function Jw(e){var r=1/e,t=Math.sqrt(r*r-1);return Math.log(t+r)}Jw.signature=Ct;function _z(e){return Math.asin(e)}_z.signature=Ct;function Kw(e){return aM(e)}Kw.signature=Ct;function Oz(e){return Math.atan(e)}Oz.signature=Ct;function Bz(e,r){return Math.atan2(e,r)}Bz.signature=Tz;function jw(e){return iM(e)}jw.signature=Ct;function Pz(e){return Math.cos(e)}Pz.signature=Ct;function Iz(e){return Cm(e)}Iz.signature=Ct;function eD(e){return 1/Math.tan(e)}eD.signature=Ct;function rD(e){var r=Math.exp(2*e);return(r+1)/(r-1)}rD.signature=Ct;function tD(e){return 1/Math.sin(e)}tD.signature=Ct;function nD(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*Ba(e)}nD.signature=Ct;function aD(e){return 1/Math.cos(e)}aD.signature=Ct;function iD(e){return 2/(Math.exp(e)+Math.exp(-e))}iD.signature=Ct;function Rz(e){return Math.sin(e)}Rz.signature=Ct;function oD(e){return oM(e)}oD.signature=Ct;function qz(e){return Math.tan(e)}qz.signature=Ct;function kz(e){return Em(e)}kz.signature=Ct;var Oc="number";function Lz(e){return Ze(e)}Lz.signature=Oc;function sD(e){return e<0}sD.signature=Oc;function uD(e){return e>0}uD.signature=Oc;function fD(e){return e===0}fD.signature=Oc;function cD(e){return Number.isNaN(e)}cD.signature=Oc;var jM="isNegative",zz=["typed"],rp=F(jM,zz,e=>{var{typed:r}=e;return r(jM,{number:sD,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 e2="isNumeric",Uz=["typed"],tp=F(e2,Uz,e=>{var{typed:r}=e;return r(e2,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":r.referToSelf(t=>n=>je(n,t))})});var r2="hasNumericValue",Wz=["typed","isNumeric"],np=F(r2,Wz,e=>{var{typed:r,isNumeric:t}=e;return r(r2,{boolean:()=>!0,string:function(a){return a.trim().length>0&&!isNaN(Number(a))},any:function(a){return t(a)}})});var t2="isPositive",Yz=["typed"],ap=F(t2,Yz,e=>{var{typed:r}=e;return r(t2,{number:uD,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 n2="isZero",Hz=["typed"],ip=F(n2,Hz,e=>{var{typed:r}=e;return r(n2,{number:fD,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 a2="isNaN",$z=["typed"],op=F(a2,$z,e=>{var{typed:r}=e;return r(a2,{number:cD,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 i2="typeOf",Gz=["typed"],sp=F(i2,Gz,e=>{var{typed:r}=e;return r(i2,{any:Tr})});function $t(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 a=e.constructor.max(e.abs(),r.abs());return n.lte(a.times(t))}return!1}function o2(e,r,t){return At(e.re,r.re,t)&&At(e.im,r.im,t)}var Ia=F("compareUnits",["typed"],e=>{var{typed:r}=e;return{"Unit, Unit":r.referToSelf(t=>(n,a)=>{if(!n.equalBase(a))throw new Error("Cannot compare units with different base");return r.find(t,[n.valueType(),a.valueType()])(n.value,a.value)})}});var up="equalScalar",Vz=["typed","config"],fp=F(up,Vz,e=>{var{typed:r,config:t}=e,n=Ia({typed:r});return r(up,{"boolean, boolean":function(i,s){return i===s},"number, number":function(i,s){return At(i,s,t.epsilon)},"BigNumber, BigNumber":function(i,s){return i.eq(s)||$t(i,s,t.epsilon)},"Fraction, Fraction":function(i,s){return i.equals(s)},"Complex, Complex":function(i,s){return o2(i,s,t.epsilon)}},n)}),cee=F(up,["typed","config"],e=>{var{typed:r,config:t}=e;return r(up,{"number, number":function(a,i){return At(a,i,t.epsilon)}})});var Zz="SparseMatrix",Qz=["typed","equalScalar","Matrix"],cp=F(Zz,Qz,e=>{var{typed:r,equalScalar:t,Matrix:n}=e;function a(v,x){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if(x&&!St(x))throw new Error("Invalid datatype: "+x);if(Qe(v))i(this,v,x);else if(v&&Mr(v.index)&&Mr(v.ptr)&&Mr(v.size))this._values=v.values,this._index=v.index,this._ptr=v.ptr,this._size=v.size,this._datatype=x||v.datatype;else if(Mr(v))s(this,v,x);else{if(v)throw new TypeError("Unsupported type of data ("+Tr(v)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=x}}function i(v,x,w){x.type==="SparseMatrix"?(v._values=x._values?ar(x._values):void 0,v._index=ar(x._index),v._ptr=ar(x._ptr),v._size=ar(x._size),v._datatype=w||x._datatype):s(v,x.valueOf(),w||x._datatype)}function s(v,x,w){v._values=[],v._index=[],v._ptr=[],v._datatype=w;var C=x.length,b=0,N=t,M=0;if(St(w)&&(N=r.find(t,[w,w])||t,M=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 _=x.dimension(0);_.forEach(function(R,L){Kr(R),v.set([R,0],w[L[0]],C)})}else{var E=x.dimension(0),T=x.dimension(1);E.forEach(function(R,L){Kr(R),T.forEach(function(H,V){Kr(H),v.set([R,H],w[L[0]][V[0]],C)})})}}return v}a.prototype.get=function(v){if(!Mr(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 x=v[0],w=v[1];Kr(x,this._size[0]),Kr(w,this._size[1]);var C=o(x,this._ptr[w],this._ptr[w+1],this._index);return CN-1||b>M-1)&&(d(this,Math.max(C+1,N),Math.max(b+1,M),w),N=this._size[0],M=this._size[1]),Kr(C,N),Kr(b,M);var _=o(C,this._ptr[b],this._ptr[b+1],this._index);return _Array.isArray(N)&&N.length===1?N[0]:N);if(C.length!==2)throw new Error("Only two dimensions matrix are supported");C.forEach(function(N){if(!sr(N)||!Ze(N)||N<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],x)};function d(v,x,w,C){var b=C||0,N=t,M=0;St(v._datatype)&&(N=r.find(t,[v._datatype,v._datatype])||t,M=r.convert(0,v._datatype),b=r.convert(b,v._datatype));var S=!N(b,M),O=v._size[0],_=v._size[1],E,T,R;if(w>_){for(T=_;TO){if(S){var L=0;for(T=0;T<_;T++){v._ptr[T]=v._ptr[T]+L,R=v._ptr[T+1]+L;var H=0;for(E=O;Ex-1&&(v._values.splice(R,1),v._index.splice(R,1),V++)}v._ptr[T]=v._values.length}return v._size[0]=x,v._size[1]=w,v}a.prototype.reshape=function(v,x){if(!Mr(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(z){if(!sr(z)||!Ze(z)||z<=-2||z===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+lr(v)+")")});var w=this._size[0]*this._size[1];v=Mc(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=x?this.clone():this;if(this._size[0]===v[0]&&this._size[1]===v[1])return b;for(var N=[],M=0;M=x&&k<=w&&R(v._values[W],k-x,L-C)}else{for(var q={},K=H;KNp,createAccessorNode:()=>Dv,createAcos:()=>_h,createAcosh:()=>Oh,createAcot:()=>Bh,createAcoth:()=>Ph,createAcsc:()=>Ih,createAcsch:()=>Rh,createAdd:()=>mv,createAddScalar:()=>Mp,createAnd:()=>ju,createAndTransform:()=>zy,createApply:()=>Lo,createApplyTransform:()=>by,createArg:()=>Kp,createArrayNode:()=>Nv,createAsec:()=>qh,createAsech:()=>kh,createAsin:()=>Lh,createAsinh:()=>zh,createAssignmentNode:()=>Ev,createAtan:()=>Uh,createAtan2:()=>Wh,createAtanh:()=>Yh,createAtomicMass:()=>K0,createAvogadro:()=>j0,createBellNumbers:()=>$g,createBigNumberClass:()=>Ym,createBignumber:()=>dp,createBin:()=>Pd,createBitAnd:()=>ku,createBitAndTransform:()=>Wy,createBitNot:()=>Xp,createBitOr:()=>Lu,createBitOrTransform:()=>Yy,createBitXor:()=>Jp,createBlockNode:()=>Fv,createBohrMagneton:()=>O0,createBohrRadius:()=>k0,createBoltzmann:()=>ey,createBoolean:()=>pp,createCatalan:()=>Gg,createCbrt:()=>Ep,createCeil:()=>Tp,createChain:()=>hg,createChainClass:()=>pg,createClassicalElectronRadius:()=>L0,createClone:()=>Xm,createColumn:()=>Wu,createColumnTransform:()=>wy,createCombinations:()=>Og,createCombinationsWithRep:()=>Bg,createCompare:()=>nh,createCompareNatural:()=>ah,createCompareText:()=>ih,createCompile:()=>rg,createComplex:()=>hp,createComplexClass:()=>Hm,createComposition:()=>Vg,createConcat:()=>Uu,createConcatTransform:()=>Oy,createConditionalNode:()=>Ov,createConductanceQuantum:()=>B0,createConj:()=>jp,createConstantNode:()=>Rv,createCorr:()=>_g,createCos:()=>Hh,createCosh:()=>$h,createCot:()=>Gh,createCoth:()=>Vh,createCoulomb:()=>F0,createCount:()=>ad,createCreateUnit:()=>Fh,createCross:()=>id,createCsc:()=>Zh,createCsch:()=>Qh,createCtranspose:()=>Nd,createCube:()=>Fp,createCumSum:()=>af,createCumSumTransform:()=>qy,createDeepEqual:()=>gh,createDenseMatrixClass:()=>Qm,createDerivative:()=>e0,createDet:()=>vg,createDeuteronMass:()=>$0,createDiag:()=>od,createDiff:()=>Yu,createDiffTransform:()=>By,createDistance:()=>Mg,createDivide:()=>Ag,createDivideScalar:()=>Ud,createDot:()=>hv,createDotDivide:()=>Zd,createDotMultiply:()=>Zp,createDotPow:()=>Vd,createE:()=>p0,createEfimovFactor:()=>J0,createEigs:()=>xg,createElectricConstant:()=>E0,createElectronMass:()=>z0,createElementaryCharge:()=>_0,createEqual:()=>sh,createEqualScalar:()=>fp,createEqualText:()=>uh,createErf:()=>Td,createEvaluate:()=>tg,createExp:()=>_p,createExpm:()=>bg,createExpm1:()=>Op,createFactorial:()=>Rg,createFalse:()=>s0,createFaraday:()=>ry,createFermiCoupling:()=>U0,createFft:()=>Md,createFibonacciHeapClass:()=>Nh,createFilter:()=>sd,createFilterTransform:()=>Dy,createFineStructure:()=>W0,createFirstRadiation:()=>ty,createFix:()=>Bp,createFlatten:()=>ud,createFloor:()=>Pu,createForEach:()=>fd,createForEachTransform:()=>Sy,createFormat:()=>Bd,createFraction:()=>vp,createFractionClass:()=>$m,createFreqz:()=>n0,createFunctionAssignmentNode:()=>kv,createFunctionNode:()=>jv,createGamma:()=>Pg,createGasConstant:()=>ay,createGcd:()=>Pp,createGetMatrixDataType:()=>cd,createGravitationConstant:()=>N0,createGravity:()=>py,createHartreeEnergy:()=>Y0,createHasNumericValue:()=>np,createHelp:()=>dg,createHelpClass:()=>mg,createHex:()=>Rd,createHypot:()=>pv,createI:()=>w0,createIdentity:()=>ld,createIfft:()=>Cd,createIm:()=>ed,createImmutableDenseMatrixClass:()=>Dh,createIndex:()=>gv,createIndexClass:()=>Sh,createIndexNode:()=>zv,createIndexTransform:()=>Ny,createInfinity:()=>f0,createIntersect:()=>Cg,createInv:()=>gg,createInverseConductanceQuantum:()=>P0,createInvmod:()=>Gp,createIsInteger:()=>jm,createIsNaN:()=>op,createIsNegative:()=>rp,createIsNumeric:()=>tp,createIsPositive:()=>ap,createIsPrime:()=>Ld,createIsZero:()=>ip,createKldivergence:()=>qg,createKlitzing:()=>q0,createKron:()=>md,createLN10:()=>v0,createLN2:()=>h0,createLOG10E:()=>y0,createLOG2E:()=>g0,createLarger:()=>dh,createLargerEq:()=>vh,createLcm:()=>Ip,createLeafCount:()=>Zg,createLeftShift:()=>jd,createLgamma:()=>Ig,createLog:()=>Hd,createLog10:()=>Rp,createLog1p:()=>$d,createLog2:()=>qp,createLoschmidt:()=>ny,createLsolve:()=>Qd,createLsolveAll:()=>Jd,createLup:()=>ig,createLusolve:()=>cg,createLyap:()=>Ng,createMad:()=>Fg,createMagneticConstant:()=>C0,createMagneticFluxQuantum:()=>I0,createMap:()=>pd,createMapTransform:()=>Ay,createMatrix:()=>gp,createMatrixClass:()=>Vm,createMatrixFromColumns:()=>bp,createMatrixFromFunction:()=>yp,createMatrixFromRows:()=>xp,createMax:()=>ef,createMaxTransform:()=>My,createMean:()=>of,createMeanTransform:()=>Cy,createMedian:()=>Tg,createMin:()=>rf,createMinTransform:()=>Ey,createMod:()=>Iu,createMode:()=>_d,createMolarMass:()=>ly,createMolarMassC12:()=>my,createMolarPlanckConstant:()=>iy,createMolarVolume:()=>oy,createMultinomial:()=>kg,createMultiply:()=>Lp,createMultiplyScalar:()=>kp,createNaN:()=>c0,createNeutronMass:()=>G0,createNode:()=>xv,createNorm:()=>dv,createNot:()=>td,createNthRoot:()=>zp,createNthRoots:()=>Gd,createNuclearMagneton:()=>R0,createNull:()=>u0,createNumber:()=>lp,createNumeric:()=>zd,createObjectNode:()=>Wv,createOct:()=>Id,createOnes:()=>dd,createOperatorNode:()=>Hv,createOr:()=>zu,createOrTransform:()=>Uy,createParenthesisNode:()=>Gv,createParse:()=>eg,createParser:()=>ag,createParserClass:()=>ng,createPartitionSelect:()=>bh,createPermutations:()=>Lg,createPhi:()=>d0,createPi:()=>l0,createPickRandom:()=>Ug,createPinv:()=>yg,createPlanckCharge:()=>gy,createPlanckConstant:()=>A0,createPlanckLength:()=>dy,createPlanckMass:()=>hy,createPlanckTemperature:()=>yy,createPlanckTime:()=>vy,createPolynomialRoot:()=>lg,createPow:()=>Wd,createPrint:()=>Qu,createPrintTransform:()=>Ly,createProd:()=>Od,createProtonMass:()=>H0,createQr:()=>og,createQuantileSeq:()=>uf,createQuantileSeqTransform:()=>Ry,createQuantumOfCirculation:()=>V0,createRandom:()=>Wg,createRandomInt:()=>Yg,createRange:()=>$u,createRangeClass:()=>Gm,createRangeNode:()=>Zv,createRangeTransform:()=>Ty,createRationalize:()=>r0,createRe:()=>rd,createReducedPlanckConstant:()=>M0,createRelationalNode:()=>Xv,createReplacer:()=>i0,createReshape:()=>gd,createResize:()=>yd,createResolve:()=>Kg,createResultSet:()=>Im,createReviver:()=>a0,createRightArithShift:()=>eh,createRightLogShift:()=>rh,createRotate:()=>xd,createRotationMatrix:()=>bd,createRound:()=>Yd,createRow:()=>Gu,createRowTransform:()=>Fy,createRydberg:()=>Z0,createSQRT1_2:()=>x0,createSQRT2:()=>b0,createSackurTetrode:()=>sy,createSchur:()=>Sg,createSec:()=>Xh,createSech:()=>Jh,createSecondRadiation:()=>uy,createSetCartesian:()=>tv,createSetDifference:()=>nv,createSetDistinct:()=>av,createSetIntersect:()=>iv,createSetIsSubset:()=>ov,createSetMultiplicity:()=>sv,createSetPowerset:()=>uv,createSetSize:()=>fv,createSetSymDifference:()=>cv,createSetUnion:()=>lv,createSign:()=>Up,createSimplify:()=>Qg,createSimplifyConstant:()=>Xg,createSimplifyCore:()=>Jg,createSin:()=>Kh,createSinh:()=>jh,createSize:()=>wd,createSlu:()=>fg,createSmaller:()=>ch,createSmallerEq:()=>mh,createSolveODE:()=>Ed,createSort:()=>wh,createSpaClass:()=>Ah,createSparse:()=>Th,createSparseMatrixClass:()=>cp,createSpeedOfLight:()=>S0,createSplitUnit:()=>wp,createSqrt:()=>Wp,createSqrtm:()=>wg,createSquare:()=>Yp,createSqueeze:()=>Dd,createStd:()=>ff,createStdTransform:()=>Py,createStefanBoltzmann:()=>fy,createStirlingS2:()=>Hg,createString:()=>mp,createSubset:()=>Vu,createSubsetTransform:()=>_y,createSubtract:()=>Hp,createSubtractScalar:()=>Cp,createSum:()=>nf,createSumTransform:()=>Iy,createSylvester:()=>Dg,createSymbolNode:()=>Jv,createSymbolicEqual:()=>jg,createTan:()=>ev,createTanh:()=>rv,createTau:()=>m0,createThomsonCrossSection:()=>Q0,createTo:()=>kd,createTrace:()=>vv,createTranspose:()=>Sd,createTrue:()=>o0,createTypeOf:()=>sp,createTyped:()=>Pm,createUnaryMinus:()=>Dp,createUnaryPlus:()=>Sp,createUnequal:()=>xh,createUnitClass:()=>Ch,createUnitFunction:()=>Eh,createUppercaseE:()=>vP,createUppercasePi:()=>hP,createUsolve:()=>Xd,createUsolveAll:()=>Kd,createVacuumImpedance:()=>T0,createVariance:()=>sf,createVarianceTransform:()=>ky,createVersion:()=>D0,createWeakMixingAngle:()=>X0,createWienDisplacement:()=>cy,createXgcd:()=>$p,createXor:()=>nd,createZeros:()=>Ad,createZeta:()=>Fd,createZpk2tf:()=>t0});var aw=ma(Nm(),1);function Ze(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}var Ba=Math.sign||function(e){return e>0?1:e<0?-1:0},JA=Math.log2||function(r){return Math.log(r)/Math.LN2},KA=Math.log10||function(r){return Math.log(r)/Math.LN10},Am=Math.log1p||function(e){return Math.log(e+1)},jA=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},eM=Math.expm1||function(r){return r>=2e-4||r<=-2e-4?Math.exp(r)-1:r+r*r/2+r*r*r/6};function Hb(e,r,t){var n={2:"0b",8:"0o",16:"0x"},a=n[r],i="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!Ze(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(!Ze(e))throw new Error("Value must be an integer");e<0&&(e=e+2**t),i="i".concat(t)}var s="";return e<0&&(e=-e,s="-"),"".concat(s).concat(a).concat(e.toString(r)).concat(i)}function ai(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:a}=$b(r);switch(t){case"fixed":return Gb(e,n);case"exponential":return rM(e,n);case"engineering":return Vk(e,n);case"bin":return Hb(e,2,a);case"oct":return Hb(e,8,a);case"hex":return Hb(e,16,a);case"auto":return Zk(e,n,r).replace(/((\\.\\d*?)(0+))($|e)/,function(){var i=arguments[2],s=arguments[4];return i!=="."?i+s:s});default:throw new Error('Unknown notation "'+t+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function $b(e){var r="auto",t,n;if(e!==void 0)if(sr(e))t=e;else if(rr(e))t=e.toNumber();else if(Ci(e))e.precision!==void 0&&(t=QA(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=QA(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 Nu(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],a=parseFloat(r[4]||"0"),i=n.indexOf(".");a+=i!==-1?i-1:n.length-1;var s=n.replace(".","").replace(/^0*/,function(l){return a-=l.length,""}).replace(/0*$/,"").split("").map(function(l){return parseInt(l)});return s.length===0&&(s.push(0),a++),{sign:t,coefficients:s,exponent:a}}function Vk(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=Nu(e),n=Mm(t,r),a=n.exponent,i=n.coefficients,s=a%3===0?a:a<0?a-3-a%3:a-a%3;if(sr(r))for(;r>i.length||a-s+1>i.length;)i.push(0);else for(var l=Math.abs(a-s)-(i.length-1),c=0;c0;)u++,o--;var m=i.slice(u).join(""),d=sr(r)&&m.length||m.match(/[1-9]/)?"."+m:"",h=i.slice(0,u).join("")+d+"e"+(a>=0?"+":"")+s.toString();return n.sign+h}function Gb(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=Nu(e),n=typeof r=="number"?Mm(t,t.exponent+1+r):t,a=n.coefficients,i=n.exponent+1,s=i+(r||0);return a.length0?"."+a.join(""):"")+"e"+(i>=0?"+":"")+i}function Zk(e,r,t){if(isNaN(e)||!isFinite(e))return String(e);var n=XA(t?.lowerExp,-3),a=XA(t?.upperExp,5),i=Nu(e),s=r?Mm(i,r):i;if(s.exponent=a)return rM(e,r);var l=s.coefficients,c=s.exponent;l.length0?c:0;return or){var a=n.splice(r,n.length-r);if(a[0]>=5){var i=r-1;for(n[i]++;n[i]===10;)n.pop(),i===0&&(n.unshift(0),t.exponent++,i++),i--,n[i]++}}return t}function Su(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 QA(e,r){if(sr(e))return e;if(rr(e))return e.toNumber();r()}function XA(e,r){return sr(e)?e:rr(e)?e.toNumber():r}function Vb(e,r,t){var n=e.constructor,a=new n(2),i="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!Ze(t))throw new Error("size must be an integer");if(e.greaterThan(a.pow(t-1).sub(1))||e.lessThan(a.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(a.pow(t))),i="i".concat(t)}switch(r){case 2:return"".concat(e.toBinary()).concat(i);case 8:return"".concat(e.toOctal()).concat(i);case 16:return"".concat(e.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(r," not supported "))}}function cM(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:a}=$b(r);switch(t){case"fixed":return Jk(e,n);case"exponential":return uM(e,n);case"engineering":return Xk(e,n);case"bin":return Vb(e,2,a);case"oct":return Vb(e,8,a);case"hex":return Vb(e,16,a);case"auto":{var i=fM(r?.lowerExp,-3),s=fM(r?.upperExp,5);if(e.isZero())return"0";var l,c=e.toSignificantDigits(n),o=c.e;return o>=i&&o=0?"+":"")+n.toString()}function uM(e,r){return r!==void 0?e.toExponential(r-1):e.toExponential()}function Jk(e,r){return e.toFixed(r)}function fM(e,r){return sr(e)?e:rr(e)?e.toNumber():r}function mM(e,r){var t=e.length-r.length,n=e.length;return e.substring(t,n)===r}function lr(e,r){var t=Kk(e,r);return r&&typeof r=="object"&&"truncate"in r&&t.length>r.truncate?t.substring(0,r.truncate-3)+"...":t}function Kk(e,r){if(typeof e=="number")return ai(e,r);if(rr(e))return cM(e,r);if(jk(e))return!r||r.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return pM(e,r);if(St(e))return Ns(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=>Ns(n)+": "+lr(e[n],r));return"{"+t.join(", ")+"}"}return String(e)}function Ns(e){for(var r=String(e),t="",n=0;n/g,">"),r}function pM(e,r){if(Array.isArray(e)){for(var t="[",n=e.length,a=0;ar?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 tn(e,r,t){if(!(this instanceof tn))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}tn.prototype=new RangeError;tn.prototype.constructor=RangeError;tn.prototype.name="IndexError";tn.prototype.isIndexError=!0;function ur(e){for(var r=[];Array.isArray(e);)r.push(e.length),e=e[0];return r}function dM(e,r,t){var n,a=e.length;if(a!==r[t])throw new pr(a,r[t]);if(t")}function Qb(e,r){var t=r.length===0;if(t){if(Array.isArray(e))throw new pr(e.length,0)}else dM(e,r,0)}function Nc(e,r){var t=e.isMatrix?e._size:ur(e),n=r._sourceSize;n.forEach((a,i)=>{if(a!==null&&a!==t[i])throw new pr(a,t[i])})}function Kr(e,r){if(e!==void 0){if(!sr(e)||!Ze(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof r=="number"&&e>=r)throw new tn(e,r)}}function As(e){for(var r=0;r=0,c=r%t===0;if(l)if(c)n[i]=-r/t;else throw new Error("Could not replace wildcard, since "+r+" is no multiple of "+-t);return n}function hM(e){return e.reduce((r,t)=>r*t,1)}function eL(e,r){for(var t=e,n,a=r.length-1;a>0;a--){var i=r[a];n=[];for(var s=t.length/i,l=0;lr.test(t))}function Xb(e,r){return Array.prototype.join.call(e,r)}function Ki(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 yM(t,n,r,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function rL(){for(var e=arguments.length,r=new Array(e),t=0;td.length),a=Math.max(...n),i=new Array(a).fill(null),s=0;si[u]&&(i[u]=l[o])}for(var m=0;m1||e[a]>r[i])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[a]," to size ").concat(r[i]))}}function jb(e,r){var t=ur(e);if(ni(t,r))return e;Cc(t,r);var n=rL(t,r),a=n.length,i=[...Array(a-t.length).fill(1),...t],s=nL(e);t.length!iL(i)).every(i=>t[i]!==void 0);if(!n){var a=r.filter(i=>t[i]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(a.map(i=>'"'.concat(i,'"')).join(", "),"."))}}function iL(e){return e&&e[0]==="?"}function ew(e){return e&&e[0]==="?"?e.slice(1):e}function wt(e,r){if(DM(e)&&bM(e,r))return e[r];throw typeof e[r]=="function"&&Om(e,r)?new Error('Cannot access method "'+r+'" as a property'):new Error('No access to property "'+r+'"')}function Ti(e,r,t){if(DM(e)&&bM(e,r))return e[r]=t,t;throw new Error('No access to property "'+r+'"')}function xM(e,r){return r in e}function bM(e,r){return!e||typeof e!="object"?!1:Xe(oL,r)?!0:!(r in Object.prototype||r in Function.prototype)}function wM(e,r){if(!Om(e,r))throw new Error('No access to method "'+r+'"');return e[r]}function Om(e,r){return e==null||typeof e[r]!="function"||Xe(e,r)&&Object.getPrototypeOf&&r in Object.getPrototypeOf(e)?!1:Xe(sL,r)?!0:!(r in Object.prototype||r in Function.prototype)}function DM(e){return typeof e=="object"&&e&&e.constructor===Object}var oL={length:!0,name:!0},sL={toString:!0,valueOf:!0,toLocaleString:!0};var Cs=class{constructor(r){this.wrappedObject=r,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(r){return wt(this.wrappedObject,r)}set(r,t){return Ti(this.wrappedObject,r,t),this}has(r){return xM(this.wrappedObject,r)}entries(){return SM(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 SM(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 SM(e,r){return{next:()=>{var t=e.next();return t.done?t:{value:r(t.value),done:!1}}}}function Bo(){return new Map}function ji(e){if(!e)return Bo();if(rw(e))return e;if(Ci(e))return new Cs(e);throw new Error("createMap can create maps from objects or Maps")}function NM(e){if(e instanceof Cs)return e.wrappedObject;var r={};for(var t of e.keys()){var n=e.get(t);Ti(r,t,n)}return r}function rw(e){return e?e instanceof Map||e instanceof Cs||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var AM=function(){return AM=aw.default.create,aw.default},uL=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],Pm=F("typed",uL,function(r){var{BigNumber:t,Complex:n,DenseMatrix:a,Fraction:i}=r,s=AM();return s.clear(),s.addTypes([{name:"number",test:sr},{name:"Complex",test:Kt},{name:"BigNumber",test:rr},{name:"Fraction",test:da},{name:"Unit",test:Ht},{name:"identifier",test:l=>St&&/^(?:[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:St},{name:"Chain",test:bu},{name:"Array",test:Mr},{name:"Matrix",test:Qe},{name:"DenseMatrix",test:Ji},{name:"SparseMatrix",test:ha},{name:"Range",test:Fo},{name:"Index",test:Mi},{name:"boolean",test:fm},{name:"ResultSet",test:cm},{name:"Help",test:xu},{name:"function",test:lm},{name:"Date",test:mm},{name:"RegExp",test:pm},{name:"null",test:dm},{name:"undefined",test:hm},{name:"AccessorNode",test:Ln},{name:"ArrayNode",test:jt},{name:"AssignmentNode",test:vm},{name:"BlockNode",test:gm},{name:"ConditionalNode",test:ym},{name:"ConstantNode",test:xr},{name:"FunctionNode",test:yn},{name:"FunctionAssignmentNode",test:Oa},{name:"IndexNode",test:Jn},{name:"Node",test:Nr},{name:"ObjectNode",test:Ei},{name:"OperatorNode",test:ct},{name:"ParenthesisNode",test:en},{name:"RangeNode",test:xm},{name:"RelationalNode",test:bm},{name:"SymbolNode",test:at},{name:"Map",test:rw},{name:"Object",test:Ci}]),s.addConversions([{from:"number",to:"BigNumber",convert:function(c){if(t||tw(c),tM(c)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+c+"). Use function bignumber(x) to convert to BigNumber.");return new t(c)}},{from:"number",to:"Complex",convert:function(c){return n||Bm(c),new n(c,0)}},{from:"BigNumber",to:"Complex",convert:function(c){return n||Bm(c),new n(c.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(c){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(c){return n||Bm(c),new n(c.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(c){i||nw(c);var o=new i(c);if(o.valueOf()!==c)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+c+"). Use function fraction(x) to convert to Fraction.");return o}},{from:"string",to:"number",convert:function(c){var o=Number(c);if(isNaN(o))throw new Error('Cannot convert "'+c+'" to a number');return o}},{from:"string",to:"BigNumber",convert:function(c){t||tw(c);try{return new t(c)}catch{throw new Error('Cannot convert "'+c+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(c){i||nw(c);try{return new i(c)}catch{throw new Error('Cannot convert "'+c+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(c){n||Bm(c);try{return new n(c)}catch{throw new Error('Cannot convert "'+c+'" to Complex')}}},{from:"boolean",to:"number",convert:function(c){return+c}},{from:"boolean",to:"BigNumber",convert:function(c){return t||tw(c),new t(+c)}},{from:"boolean",to:"Fraction",convert:function(c){return i||nw(c),new i(+c)}},{from:"boolean",to:"string",convert:function(c){return String(c)}},{from:"Array",to:"Matrix",convert:function(c){return a||fL(),new a(c)}},{from:"Matrix",to:"Array",convert:function(c){return c.valueOf()}}]),s.onMismatch=(l,c,o)=>{var u=s.createError(l,c,o);if(["wrongType","mismatch"].includes(u.data.category)&&c.length===1&&Nt(c[0])&&o.some(d=>!d.params.includes(","))){var m=new TypeError("Function '".concat(l,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(l,")'."));throw m.data=u.data,m}throw u},s.onMismatch=(l,c,o)=>{var u=s.createError(l,c,o);if(["wrongType","mismatch"].includes(u.data.category)&&c.length===1&&Nt(c[0])&&o.some(d=>!d.params.includes(","))){var m=new TypeError("Function '".concat(l,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(l,")'."));throw m.data=u.data,m}throw u},s});function tw(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Bm(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function fL(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function nw(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var cL="ResultSet",lL=[],Im=F(cL,lL,()=>{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 Tu=9e15,qo=1e9,iw="0123456789abcdef",qm="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",km="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",ow={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Tu,maxE:Tu,crypto:!1},TM,eo,Cr=!0,zm="[DecimalError] ",Ro=zm+"Invalid argument: ",FM=zm+"Precision limit exceeded",_M=zm+"crypto unavailable",OM="[object Decimal]",Nn=Math.floor,nn=Math.pow,mL=/^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,pL=/^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,dL=/^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,BM=/^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,si=1e7,br=7,hL=9007199254740991,vL=qm.length-1,sw=km.length-1,Ue={toStringTag:OM};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,a=n.constructor;if(e=new a(e),r=new a(r),!e.s||!r.s)return new a(NaN);if(e.gt(r))throw Error(Ro+r);return t=n.cmp(e),t<0?e:n.cmp(r)>0?r:new a(n)};Ue.comparedTo=Ue.cmp=function(e){var r,t,n,a,i=this,s=i.d,l=(e=new i.constructor(e)).d,c=i.s,o=e.s;if(!s||!l)return!c||!o?NaN:c!==o?c:s===l?0:!s^c<0?1:-1;if(!s[0]||!l[0])return s[0]?c:l[0]?-o:0;if(c!==o)return c;if(i.e!==e.e)return i.e>e.e^c<0?1:-1;for(n=s.length,a=l.length,r=0,t=nl[r]^c<0?1:-1;return n===a?0:n>a^c<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=gL(n,kM(n,t)),n.precision=e,n.rounding=r,hr(eo==2||eo==3?t.neg():t,e,r,!0)):new n(1):new n(NaN)};Ue.cubeRoot=Ue.cbrt=function(){var e,r,t,n,a,i,s,l,c,o,u=this,m=u.constructor;if(!u.isFinite()||u.isZero())return new m(u);for(Cr=!1,i=u.s*nn(u.s*u,1/3),!i||Math.abs(i)==1/0?(t=xn(u.d),e=u.e,(i=(e-t.length+1)%3)&&(t+=i==1||i==-2?"0":"00"),i=nn(t,1/3),e=Nn((e+1)/3)-(e%3==(e<0?-1:2)),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new m(t),n.s=u.s):n=new m(i.toString()),s=(e=m.precision)+3;;)if(l=n,c=l.times(l).times(l),o=c.plus(u),n=Dt(o.plus(u).times(l),o.plus(c),s+2,1),xn(l.d).slice(0,s)===(t=xn(n.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!a&&t=="4999"){if(!a&&(hr(l,e+1,0),l.times(l).times(l).eq(u))){n=l;break}s+=4,a=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 Cr=!0,hr(n,e,m.rounding,r)};Ue.decimalPlaces=Ue.dp=function(){var e,r=this.d,t=NaN;if(r){if(e=r.length-1,t=(e-Nn(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 Dt(this,new this.constructor(e))};Ue.dividedToIntegerBy=Ue.divToInt=function(e){var r=this,t=r.constructor;return hr(Dt(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,a,i=this,s=i.constructor,l=new s(1);if(!i.isFinite())return new s(i.s?1/0:NaN);if(i.isZero())return l;t=s.precision,n=s.rounding,s.precision=t+Math.max(i.e,i.sd())+4,s.rounding=1,a=i.d.length,a<32?(e=Math.ceil(a/3),r=(1/Wm(4,e)).toString()):(e=16,r="2.3283064365386962890625e-10"),i=Fu(s,1,i.times(r),new s(1),!0);for(var c,o=e,u=new s(8);o--;)c=i.times(i),i=l.minus(c.times(u.minus(c.times(u))));return hr(i,s.precision=t,s.rounding=n,!0)};Ue.hyperbolicSine=Ue.sinh=function(){var e,r,t,n,a=this,i=a.constructor;if(!a.isFinite()||a.isZero())return new i(a);if(r=i.precision,t=i.rounding,i.precision=r+Math.max(a.e,a.sd())+4,i.rounding=1,n=a.d.length,n<3)a=Fu(i,2,a,a,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,a=a.times(1/Wm(5,e)),a=Fu(i,2,a,a,!0);for(var s,l=new i(5),c=new i(16),o=new i(20);e--;)s=a.times(a),a=a.times(l.plus(s.times(c.times(s).plus(o))))}return i.precision=r,i.rounding=t,hr(a,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,Dt(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),a=t.precision,i=t.rounding;return n!==-1?n===0?r.isNeg()?oi(t,a,i):new t(0):new t(NaN):r.isZero()?oi(t,a+4,i).times(.5):(t.precision=a+6,t.rounding=1,r=r.asin(),e=oi(t,a+4,i).times(.5),t.precision=a,t.rounding=i,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,Cr=!1,t=t.times(t).minus(1).sqrt().plus(t),Cr=!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,Cr=!1,t=t.times(t).plus(1).sqrt().plus(t),Cr=!0,n.precision=e,n.rounding=r,t.ln())};Ue.inverseHyperbolicTangent=Ue.atanh=function(){var e,r,t,n,a=this,i=a.constructor;return a.isFinite()?a.e>=0?new i(a.abs().eq(1)?a.s/0:a.isZero()?a:NaN):(e=i.precision,r=i.rounding,n=a.sd(),Math.max(n,e)<2*-a.e-1?hr(new i(a),e,r,!0):(i.precision=t=n-a.e,a=Dt(a.plus(1),new i(1).minus(a),t+e,1),i.precision=e+4,i.rounding=1,a=a.ln(),i.precision=e,i.rounding=r,a.times(.5))):new i(NaN)};Ue.inverseSine=Ue.asin=function(){var e,r,t,n,a=this,i=a.constructor;return a.isZero()?new i(a):(r=a.abs().cmp(1),t=i.precision,n=i.rounding,r!==-1?r===0?(e=oi(i,t+4,n).times(.5),e.s=a.s,e):new i(NaN):(i.precision=t+6,i.rounding=1,a=a.div(new i(1).minus(a.times(a)).sqrt().plus(1)).atan(),i.precision=t,i.rounding=n,a.times(2)))};Ue.inverseTangent=Ue.atan=function(){var e,r,t,n,a,i,s,l,c,o=this,u=o.constructor,m=u.precision,d=u.rounding;if(o.isFinite()){if(o.isZero())return new u(o);if(o.abs().eq(1)&&m+4<=sw)return s=oi(u,m+4,d).times(.25),s.s=o.s,s}else{if(!o.s)return new u(NaN);if(m+4<=sw)return s=oi(u,m+4,d).times(.5),s.s=o.s,s}for(u.precision=l=m+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(Cr=!1,r=Math.ceil(l/br),n=1,c=o.times(o),s=new u(o),a=o;e!==-1;)if(a=a.times(c),i=s.minus(a.div(n+=2)),a=a.times(c),s=i.plus(a.div(n+=2)),s.d[r]!==void 0)for(e=r;s.d[e]===i.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,a,i,s,l,c,o=this,u=o.constructor,m=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)i=!0;else{for(a=t[0];a%10===0;)a/=10;i=a!==1}if(Cr=!1,l=m+h,s=Io(o,l),n=r?Lm(u,l+10):Io(e,l),c=Dt(s,n,l,1),Ec(c.d,a=m,d))do if(l+=10,s=Io(o,l),n=r?Lm(u,l+10):Io(e,l),c=Dt(s,n,l,1),!i){+xn(c.d).slice(a+1,a+15)+1==1e14&&(c=hr(c,m+1,0));break}while(Ec(c.d,a+=10,d));return Cr=!0,hr(c,m,d)};Ue.minus=Ue.sub=function(e){var r,t,n,a,i,s,l,c,o,u,m,d,h=this,y=h.constructor;if(e=new y(e),!h.d||!e.d)return!h.s||!e.s?e=new y(NaN):h.d?e.s=-e.s:e=new y(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,l=y.precision,c=y.rounding,!o[0]||!d[0]){if(d[0])e.s=-e.s;else if(o[0])e=new y(h);else return new y(c===3?-0:0);return Cr?hr(e,l,c):e}if(t=Nn(e.e/br),u=Nn(h.e/br),o=o.slice(),i=u-t,i){for(m=i<0,m?(r=o,i=-i,s=d.length):(r=d,t=u,s=o.length),n=Math.max(Math.ceil(l/br),s)+2,i>n&&(i=n,r.length=1),r.reverse(),n=i;n--;)r.push(0);r.reverse()}else{for(n=o.length,s=d.length,m=n0;--n)o[s++]=0;for(n=d.length;n>i;){if(o[--n]s?i+1:s+1,a>s&&(a=s,t.length=1),t.reverse();a--;)t.push(0);t.reverse()}for(s=o.length,a=u.length,s-a<0&&(a=s,t=u,u=o,o=t),r=0;a;)r=(o[--a]=o[a]+u[a]+r)/si|0,o[a]%=si;for(r&&(o.unshift(r),++n),s=o.length;o[--s]==0;)o.pop();return e.d=o,e.e=Um(o,n),Cr?hr(e,l,c):e};Ue.precision=Ue.sd=function(e){var r,t=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ro+e);return t.d?(r=PM(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=xL(n,kM(n,t)),n.precision=e,n.rounding=r,hr(eo>2?t.neg():t,e,r,!0)):new n(NaN)};Ue.squareRoot=Ue.sqrt=function(){var e,r,t,n,a,i,s=this,l=s.d,c=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(Cr=!1,o=Math.sqrt(+s),o==0||o==1/0?(r=xn(l),(r.length+c)%2==0&&(r+="0"),o=Math.sqrt(r),c=Nn((c+1)/2)-(c<0||c%2),o==1/0?r="5e"+c:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+c),n=new u(r)):n=new u(o.toString()),t=(c=u.precision)+3;;)if(i=n,n=i.plus(Dt(s,i,t+2,1)).times(.5),xn(i.d).slice(0,t)===(r=xn(n.d)).slice(0,t))if(r=r.slice(t-3,t+1),r=="9999"||!a&&r=="4999"){if(!a&&(hr(i,c+1,0),i.times(i).eq(s))){n=i;break}t+=4,a=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(hr(n,c+1,1),e=!n.times(n).eq(s));break}return Cr=!0,hr(n,c,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=Dt(t,new n(1).minus(t.times(t)).sqrt(),e+10,0),n.precision=e,n.rounding=r,hr(eo==2||eo==4?t.neg():t,e,r,!0)):new n(NaN)};Ue.times=Ue.mul=function(e){var r,t,n,a,i,s,l,c,o,u=this,m=u.constructor,d=u.d,h=(e=new m(e)).d;if(e.s*=u.s,!d||!d[0]||!h||!h[0])return new m(!e.s||d&&!d[0]&&!h||h&&!h[0]&&!d?NaN:!d||!h?e.s/0:e.s*0);for(t=Nn(u.e/br)+Nn(e.e/br),c=d.length,o=h.length,c=0;){for(r=0,a=c+n;a>n;)l=i[a]+h[n]*d[a-n-1]+r,i[a--]=l%si|0,r=l/si|0;i[a]=(i[a]+r)%si|0}for(;!i[--s];)i.pop();return r?++t:i.shift(),e.d=i,e.e=Um(i,t),Cr?hr(e,m.precision,m.rounding):e};Ue.toBinary=function(e,r){return cw(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:(jn(e,0,qo),r===void 0?r=n.rounding:jn(r,0,8),hr(t,e+t.e+1,r))};Ue.toExponential=function(e,r){var t,n=this,a=n.constructor;return e===void 0?t=Fi(n,!0):(jn(e,0,qo),r===void 0?r=a.rounding:jn(r,0,8),n=hr(new a(n),e+1,r),t=Fi(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+t:t};Ue.toFixed=function(e,r){var t,n,a=this,i=a.constructor;return e===void 0?t=Fi(a):(jn(e,0,qo),r===void 0?r=i.rounding:jn(r,0,8),n=hr(new i(a),e+a.e+1,r),t=Fi(n,!1,e+n.e+1)),a.isNeg()&&!a.isZero()?"-"+t:t};Ue.toFraction=function(e){var r,t,n,a,i,s,l,c,o,u,m,d,h=this,y=h.d,v=h.constructor;if(!y)return new v(h);if(o=t=new v(1),n=c=new v(0),r=new v(n),i=r.e=PM(y)-h.e-1,s=i%br,r.d[0]=nn(10,s<0?br+s:s),e==null)e=i>0?r:o;else{if(l=new v(e),!l.isInt()||l.lt(o))throw Error(Ro+l);e=l.gt(r)?i>0?r:o:l}for(Cr=!1,l=new v(xn(y)),u=v.precision,v.precision=i=y.length*br*2;m=Dt(l,r,0,1,1),a=t.plus(m.times(n)),a.cmp(e)!=1;)t=n,n=a,a=o,o=c.plus(m.times(a)),c=a,a=r,r=l.minus(m.times(a)),l=a;return a=Dt(e.minus(t),n,0,1,1),c=c.plus(a.times(o)),t=t.plus(a.times(n)),c.s=o.s=h.s,d=Dt(o,n,i,1).minus(h).abs().cmp(Dt(c,t,i,1).minus(h).abs())<1?[o,n]:[c,t],v.precision=u,Cr=!0,d};Ue.toHexadecimal=Ue.toHex=function(e,r){return cw(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:jn(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]?(Cr=!1,t=Dt(t,e,0,r,1).times(e),Cr=!0,hr(t)):(e.s=t.s,t=e),t};Ue.toNumber=function(){return+this};Ue.toOctal=function(e,r){return cw(this,8,e,r)};Ue.toPower=Ue.pow=function(e){var r,t,n,a,i,s,l=this,c=l.constructor,o=+(e=new c(e));if(!l.d||!e.d||!l.d[0]||!e.d[0])return new c(nn(+l,o));if(l=new c(l),l.eq(1))return l;if(n=c.precision,i=c.rounding,e.eq(1))return hr(l,n,i);if(r=Nn(e.e/br),r>=e.d.length-1&&(t=o<0?-o:o)<=hL)return a=IM(c,l,t,n),e.s<0?new c(1).div(a):hr(a,n,i);if(s=l.s,s<0){if(rc.maxE+1||r0?s/0:0):(Cr=!1,c.rounding=l.s=1,t=Math.min(12,(r+"").length),a=uw(e.times(Io(l,n+t)),n),a.d&&(a=hr(a,n+5,1),Ec(a.d,n,i)&&(r=n+10,a=hr(uw(e.times(Io(l,r+t)),r),r+5,1),+xn(a.d).slice(n+1,n+15)+1==1e14&&(a=hr(a,n+1,0)))),a.s=s,Cr=!0,c.rounding=i,hr(a,n,i))};Ue.toPrecision=function(e,r){var t,n=this,a=n.constructor;return e===void 0?t=Fi(n,n.e<=a.toExpNeg||n.e>=a.toExpPos):(jn(e,1,qo),r===void 0?r=a.rounding:jn(r,0,8),n=hr(new a(n),e,r),t=Fi(n,e<=n.e||n.e<=a.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):(jn(e,1,qo),r===void 0?r=n.rounding:jn(r,0,8)),hr(new n(t),e,r)};Ue.toString=function(){var e=this,r=e.constructor,t=Fi(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=Fi(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()?"-"+t:t};function xn(e){var r,t,n,a=e.length-1,i="",s=e[0];if(a>0){for(i+=s,r=1;rt)throw Error(Ro+e)}function Ec(e,r,t,n){var a,i,s,l;for(i=e[0];i>=10;i/=10)--r;return--r<0?(r+=br,a=0):(a=Math.ceil((r+1)/br),r%=br),i=nn(10,br-r),l=e[a]%i|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==i||t>3&&l+1==i/2)&&(e[a+1]/i/100|0)==nn(10,r-2)-1||(l==i/2||l==0)&&(e[a+1]/i/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==i||!n&&t>3&&l+1==i/2)&&(e[a+1]/i/1e3|0)==nn(10,r-3)-1,s}function Rm(e,r,t){for(var n,a=[0],i,s=0,l=e.length;st-1&&(a[n+1]===void 0&&(a[n+1]=0),a[n+1]+=a[n]/t|0,a[n]%=t)}return a.reverse()}function gL(e,r){var t,n,a;if(r.isZero())return r;n=r.d.length,n<32?(t=Math.ceil(n/3),a=(1/Wm(4,t)).toString()):(t=16,a="2.3283064365386962890625e-10"),e.precision+=t,r=Fu(e,1,r.times(a),new e(1));for(var i=t;i--;){var s=r.times(r);r=s.times(s).minus(s).times(8).plus(1)}return e.precision-=t,r}var Dt=function(){function e(n,a,i){var s,l=0,c=n.length;for(n=n.slice();c--;)s=n[c]*a+l,n[c]=s%i|0,l=s/i|0;return l&&n.unshift(l),n}function r(n,a,i,s){var l,c;if(i!=s)c=i>s?1:-1;else for(l=c=0;la[l]?1:-1;break}return c}function t(n,a,i,s){for(var l=0;i--;)n[i]-=l,l=n[i]1;)n.shift()}return function(n,a,i,s,l,c){var o,u,m,d,h,y,v,x,w,C,b,N,M,S,O,_,E,T,R,L,H=n.constructor,V=n.s==a.s?1:-1,W=n.d,k=a.d;if(!W||!W[0]||!k||!k[0])return new H(!n.s||!a.s||(W?k&&W[0]==k[0]:!k)?NaN:W&&W[0]==0||!k?V*0:V/0);for(c?(h=1,u=n.e-a.e):(c=si,h=br,u=Nn(n.e/h)-Nn(a.e/h)),R=k.length,E=W.length,w=new H(V),C=w.d=[],m=0;k[m]==(W[m]||0);m++);if(k[m]>(W[m]||0)&&u--,i==null?(S=i=H.precision,s=H.rounding):l?S=i+(n.e-a.e)+1:S=i,S<0)C.push(1),y=!0;else{if(S=S/h+2|0,m=0,R==1){for(d=0,k=k[0],S++;(m1&&(k=e(k,d,c),W=e(W,d,c),R=k.length,E=W.length),_=R,b=W.slice(0,R),N=b.length;N=c/2&&++T;do d=0,o=r(k,b,R,N),o<0?(M=b[0],R!=N&&(M=M*c+(b[1]||0)),d=M/T|0,d>1?(d>=c&&(d=c-1),v=e(k,d,c),x=v.length,N=b.length,o=r(v,b,x,N),o==1&&(d--,t(v,R=10;d/=10)m++;w.e=m+u*h-1,hr(w,l?i+w.e+1:i,s,y)}return w}}();function hr(e,r,t,n){var a,i,s,l,c,o,u,m,d,h=e.constructor;e:if(r!=null){if(m=e.d,!m)return e;for(a=1,l=m[0];l>=10;l/=10)a++;if(i=r-a,i<0)i+=br,s=r,u=m[d=0],c=u/nn(10,a-s-1)%10|0;else if(d=Math.ceil((i+1)/br),l=m.length,d>=l)if(n){for(;l++<=d;)m.push(0);u=c=0,a=1,i%=br,s=i-br+1}else break e;else{for(u=l=m[d],a=1;l>=10;l/=10)a++;i%=br,s=i-br+a,c=s<0?0:u/nn(10,a-s-1)%10|0}if(n=n||r<0||m[d+1]!==void 0||(s<0?u:u%nn(10,a-s-1)),o=t<4?(c||n)&&(t==0||t==(e.s<0?3:2)):c>5||c==5&&(t==4||n||t==6&&(i>0?s>0?u/nn(10,a-s):0:m[d-1])%10&1||t==(e.s<0?8:7)),r<1||!m[0])return m.length=0,o?(r-=e.e+1,m[0]=nn(10,(br-r%br)%br),e.e=-r||0):m[0]=e.e=0,e;if(i==0?(m.length=d,l=1,d--):(m.length=d+1,l=nn(10,br-i),m[d]=s>0?(u/nn(10,a-s)%nn(10,s)|0)*l:0),o)for(;;)if(d==0){for(i=1,s=m[0];s>=10;s/=10)i++;for(s=m[0]+=l,l=1;s>=10;s/=10)l++;i!=l&&(e.e++,m[0]==si&&(m[0]=1));break}else{if(m[d]+=l,m[d]!=si)break;m[d--]=0,l=1}for(i=m.length;m[--i]===0;)m.pop()}return Cr&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e0?i=i.charAt(0)+"."+i.slice(1)+Po(n):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(e.e<0?"e":"e+")+e.e):a<0?(i="0."+Po(-a-1)+i,t&&(n=t-s)>0&&(i+=Po(n))):a>=s?(i+=Po(a+1-s),t&&(n=t-a-1)>0&&(i=i+"."+Po(n))):((n=a+1)0&&(a+1===s&&(i+="."),i+=Po(n))),i}function Um(e,r){var t=e[0];for(r*=br;t>=10;t/=10)r++;return r}function Lm(e,r,t){if(r>vL)throw Cr=!0,t&&(e.precision=t),Error(FM);return hr(new e(qm),r,1,!0)}function oi(e,r,t){if(r>sw)throw Error(FM);return hr(new e(km),r,t,!0)}function PM(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 Po(e){for(var r="";e--;)r+="0";return r}function IM(e,r,t,n){var a,i=new e(1),s=Math.ceil(n/br+4);for(Cr=!1;;){if(t%2&&(i=i.times(r),CM(i.d,s)&&(a=!0)),t=Nn(t/2),t===0){t=i.d.length-1,a&&i.d[t]===0&&++i.d[t];break}r=r.times(r),CM(r.d,s)}return Cr=!0,i}function MM(e){return e.d[e.d.length-1]&1}function RM(e,r,t){for(var n,a=new e(r[0]),i=0;++i17)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?(Cr=!1,c=y):c=r,l=new d(.03125);e.e>-2;)e=e.times(l),m+=5;for(n=Math.log(nn(2,m))/Math.LN10*2+5|0,c+=n,t=i=s=new d(1),d.precision=c;;){if(i=hr(i.times(e),c,1),t=t.times(++u),l=s.plus(Dt(i,t,c,1)),xn(l.d).slice(0,c)===xn(s.d).slice(0,c)){for(a=m;a--;)s=hr(s.times(s),c,1);if(r==null)if(o<3&&Ec(s.d,c-n,h,o))d.precision=c+=10,t=i=l=new d(1),u=0,o++;else return hr(s,d.precision=y,h,Cr=!0);else return d.precision=y,s}s=l}}function Io(e,r){var t,n,a,i,s,l,c,o,u,m,d,h=1,y=10,v=e,x=v.d,w=v.constructor,C=w.rounding,b=w.precision;if(v.s<0||!x||!x[0]||!v.e&&x[0]==1&&x.length==1)return new w(x&&!x[0]?-1/0:v.s!=1?NaN:x?0:v);if(r==null?(Cr=!1,u=b):u=r,w.precision=u+=y,t=xn(x),n=t.charAt(0),Math.abs(i=v.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)v=v.times(e),t=xn(v.d),n=t.charAt(0),h++;i=v.e,n>1?(v=new w("0."+t),i++):v=new w(n+"."+t.slice(1))}else return o=Lm(w,u+2,b).times(i+""),v=Io(new w(n+"."+t.slice(1)),u-y).plus(o),w.precision=b,r==null?hr(v,b,C,Cr=!0):v;for(m=v,c=s=v=Dt(v.minus(1),v.plus(1),u,1),d=hr(v.times(v),u,1),a=3;;){if(s=hr(s.times(d),u,1),o=c.plus(Dt(s,new w(a),u,1)),xn(o.d).slice(0,u)===xn(c.d).slice(0,u))if(c=c.times(2),i!==0&&(c=c.plus(Lm(w,u+2,b).times(i+""))),c=Dt(c,new w(h),u,1),r==null)if(Ec(c.d,u-y,C,l))w.precision=u+=y,o=s=v=Dt(m.minus(1),m.plus(1),u,1),d=hr(v.times(v),u,1),a=l=1;else return hr(c,w.precision=b,C,Cr=!0);else return w.precision=b,c;c=o,a+=2}}function qM(e){return String(e.s*e.s/0)}function fw(e,r){var t,n,a;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(a=r.length;r.charCodeAt(a-1)===48;--a);if(r=r.slice(n,a),r){if(a-=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"),BM.test(r))return fw(e,r)}else if(r==="Infinity"||r==="NaN")return+r||(e.s=NaN),e.e=NaN,e.d=null,e;if(pL.test(r))t=16,r=r.toLowerCase();else if(mL.test(r))t=2;else if(dL.test(r))t=8;else throw Error(Ro+r);for(i=r.search(/p/i),i>0?(c=+r.slice(i+1),r=r.substring(2,i)):r=r.slice(2),i=r.indexOf("."),s=i>=0,n=e.constructor,s&&(r=r.replace(".",""),l=r.length,i=l-i,a=IM(n,new n(t),i,i*2)),o=Rm(r,t,si),u=o.length-1,i=u;o[i]===0;--i)o.pop();return i<0?new n(e.s*0):(e.e=Um(o,u),e.d=o,Cr=!1,s&&(e=Dt(e,a,l*4)),c&&(e=e.times(Math.abs(c)<54?nn(2,c):Tc.pow(2,c))),Cr=!0,e)}function xL(e,r){var t,n=r.d.length;if(n<3)return r.isZero()?r:Fu(e,2,r,r);t=1.4*Math.sqrt(n),t=t>16?16:t|0,r=r.times(1/Wm(5,t)),r=Fu(e,2,r,r);for(var a,i=new e(5),s=new e(16),l=new e(20);t--;)a=r.times(r),r=r.times(i.plus(a.times(s.times(a).minus(l))));return r}function Fu(e,r,t,n,a){var i,s,l,c,o=1,u=e.precision,m=Math.ceil(u/br);for(Cr=!1,c=t.times(t),l=new e(n);;){if(s=Dt(l.times(c),new e(r++*r++),u,1),l=a?n.plus(s):n.minus(s),n=Dt(s.times(c),new e(r++*r++),u,1),s=l.plus(n),s.d[m]!==void 0){for(i=m;s.d[i]===l.d[i]&&i--;);if(i==-1)break}i=l,l=n,n=s,s=i,o++}return Cr=!0,s.d.length=m+1,s}function Wm(e,r){for(var t=e;--r;)t*=e;return t}function kM(e,r){var t,n=r.s<0,a=oi(e,e.precision,1),i=a.times(.5);if(r=r.abs(),r.lte(i))return eo=n?4:1,r;if(t=r.divToInt(a),t.isZero())eo=n?3:2;else{if(r=r.minus(t.times(a)),r.lte(i))return eo=MM(t)?n?2:3:n?4:1,r;eo=MM(t)?n?1:4:n?3:2}return r.minus(a).abs()}function cw(e,r,t,n){var a,i,s,l,c,o,u,m,d,h=e.constructor,y=t!==void 0;if(y?(jn(t,1,qo),n===void 0?n=h.rounding:jn(n,0,8)):(t=h.precision,n=h.rounding),!e.isFinite())u=qM(e);else{for(u=Fi(e),s=u.indexOf("."),y?(a=2,r==16?t=t*4-3:r==8&&(t=t*3-2)):a=r,s>=0&&(u=u.replace(".",""),d=new h(1),d.e=u.length-s,d.d=Rm(Fi(d),10,a),d.e=d.d.length),m=Rm(u,10,a),i=c=m.length;m[--c]==0;)m.pop();if(!m[0])u=y?"0p+0":"0";else{if(s<0?i--:(e=new h(e),e.d=m,e.e=i,e=Dt(e,d,t,n,0,a),m=e.d,i=e.e,o=TM),s=m[t],l=a/2,o=o||m[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&&m[t-1]&1||n===(e.s<0?8:7)),m.length=t,o)for(;++m[--t]>a-1;)m[t]=0,t||(++i,m.unshift(1));for(c=m.length;!m[c-1];--c);for(s=0,u="";s1)if(r==16||r==8){for(s=r==16?4:3,--c;c%s;c++)u+="0";for(m=Rm(u,a,r),c=m.length;!m[c-1];--c);for(s=1,u="1.";sc)for(i-=c;i--;)u+="0";else ir)return e.length=r,!0}function bL(e){return new this(e).abs()}function wL(e){return new this(e).acos()}function DL(e){return new this(e).acosh()}function SL(e,r){return new this(e).plus(r)}function NL(e){return new this(e).asin()}function AL(e){return new this(e).asinh()}function ML(e){return new this(e).atan()}function CL(e){return new this(e).atanh()}function EL(e,r){e=new this(e),r=new this(r);var t,n=this.precision,a=this.rounding,i=n+4;return!e.s||!r.s?t=new this(NaN):!e.d&&!r.d?(t=oi(this,i,1).times(r.s>0?.25:.75),t.s=e.s):!r.d||e.isZero()?(t=r.s<0?oi(this,n,a):new this(0),t.s=e.s):!e.d||r.isZero()?(t=oi(this,i,1).times(.5),t.s=e.s):r.s<0?(this.precision=i,this.rounding=1,t=this.atan(Dt(e,r,i,1)),r=oi(this,i,1),this.precision=n,this.rounding=a,t=e.s<0?t.minus(r):t.plus(r)):t=this.atan(Dt(e,r,i,1)),t}function TL(e){return new this(e).cbrt()}function FL(e){return hr(e=new this(e),e.e+1,2)}function _L(e,r,t){return new this(e).clamp(r,t)}function OL(e){if(!e||typeof e!="object")throw Error(zm+"Object expected");var r,t,n,a=e.defaults===!0,i=["precision",1,qo,"rounding",0,8,"toExpNeg",-Tu,0,"toExpPos",0,Tu,"maxE",0,Tu,"minE",-Tu,0,"modulo",0,9];for(r=0;r=i[r+1]&&n<=i[r+2])this[t]=n;else throw Error(Ro+t+": "+n);if(t="crypto",a&&(this[t]=ow[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(_M);else this[t]=!1;else throw Error(Ro+t+": "+n);return this}function BL(e){return new this(e).cos()}function PL(e){return new this(e).cosh()}function LM(e){var r,t,n;function a(i){var s,l,c,o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,EM(i)){o.s=i.s,Cr?!i.d||i.e>a.maxE?(o.e=NaN,o.d=null):i.e=10;l/=10)s++;Cr?s>a.maxE?(o.e=NaN,o.d=null):s=429e7?r[i]=crypto.getRandomValues(new Uint32Array(1))[0]:l[i++]=a%1e7;else if(crypto.randomBytes){for(r=crypto.randomBytes(n*=4);i=214e7?crypto.randomBytes(4).copy(r,i):(l.push(a%1e7),i+=4);i=n/4}else throw Error(_M);else for(;i=10;a/=10)n++;n{var{on:r,config:t}=e,n=Es.clone({precision:t.precision,modulo:Es.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(a){return new n(a.value)},r&&r("config",function(a,i){a.precision!==i.precision&&n.config({precision:a.precision})}),n},{isClass:!0});var fn=ma(UM(),1);var sz="Complex",uz=[],Hm=F(sz,uz,()=>(Object.defineProperty(fn.default,"name",{value:"Complex"}),fn.default.prototype.constructor=fn.default,fn.default.prototype.type="Complex",fn.default.prototype.isComplex=!0,fn.default.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},fn.default.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},fn.default.prototype.format=function(e){var r="",t=this.im,n=this.re,a=ai(this.re,e),i=ai(this.im,e),s=sr(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(_i.default,"name",{value:"Fraction"}),_i.default.prototype.constructor=_i.default,_i.default.prototype.type="Fraction",_i.default.prototype.isFraction=!0,_i.default.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},_i.default.fromJSON=function(e){return new _i.default(e)},_i.default),{isClass:!0});var lz="Range",mz=[],Gm=F(lz,mz,()=>{function e(r,t,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var a=r!=null,i=t!=null,s=n!=null;if(a){if(rr(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter start must be a number")}if(i){if(rr(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter end must be a number")}if(s){if(rr(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=a?parseFloat(r):0,this.end=i?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(i){return parseFloat(i)}),a=n.some(function(i){return isNaN(i)});if(a)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,a=this.end,i=a-t;return Ba(n)===Ba(i)?r=Math.ceil(i/n):i===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,a=this.end,i=0;if(n>0)for(;ta;)r(t,[i],this),t+=n,i++},e.prototype.map=function(r){var t=[];return this.forEach(function(n,a,i){t[a[0]]=r(n,a,i)}),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=ai(this.start,r);return this.step!==1&&(t+=":"+ai(this.step,r)),t+=":"+ai(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 pz="Matrix",dz=[],Vm=F(pz,dz,()=>{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 HM(e){var r=0,t=1,n=Object.create(null),a=Object.create(null),i=0,s=function(c){var o=a[c];if(!!o&&(delete n[o],delete a[c],--r,t===o)){if(!r){i=0,t=1;return}for(;!Object.prototype.hasOwnProperty.call(n,++t););}};return e=Math.abs(e),{hit:function(c){var o=a[c],u=++i;if(n[u]=c,a[c]=u,!o)return++r,r<=e?void 0:(c=n[t],s(c),c);if(delete n[o],t===o)for(;!Object.prototype.hasOwnProperty.call(n,++t););},delete:s,clear:function(){r=i=0,t=1,n=Object.create(null),a=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:HM(t||Number.POSITIVE_INFINITY)});for(var a=[],i=0;i{var{Matrix:r}=e;function t(u,m){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(m&&!St(m))throw new Error("Invalid datatype: "+m);if(Qe(u))u.type==="DenseMatrix"?(this._data=ar(u._data),this._size=ar(u._size),this._datatype=m||u._datatype):(this._data=u.toArray(),this._size=u.size(),this._datatype=m||u._datatype);else if(u&&Mr(u.data)&&Mr(u.size))this._data=u.data,this._size=u.size,Qb(this._data,this._size),this._datatype=m||u.datatype;else if(Mr(u))this._data=o(u),this._size=ur(this._data),Qb(this._data,this._size),this._datatype=m;else{if(u)throw new TypeError("Unsupported type of data ("+Tr(u)+")");this._data=[],this._size=[0],this._datatype=m}}t.prototype=new r,t.prototype.createDenseMatrix=function(u,m){return new t(u,m)},Object.defineProperty(t,"name",{value:"DenseMatrix"}),t.prototype.constructor=t,t.prototype.type="DenseMatrix",t.prototype.isDenseMatrix=!0,t.prototype.getDataType=function(){return Oo(this._data,Tr)},t.prototype.storage=function(){return"dense"},t.prototype.datatype=function(){return this._datatype},t.prototype.create=function(u,m){return new t(u,m)},t.prototype.subset=function(u,m,d){switch(arguments.length){case 1:return n(this,u);case 2:case 3:return i(this,u,m,d);default:throw new SyntaxError("Wrong number of arguments")}},t.prototype.get=function(u){if(!Mr(u))throw new TypeError("Array expected");if(u.length!==this._size.length)throw new pr(u.length,this._size.length);for(var m=0;m");var b=m.max().map(function(S){return S+1});c(u,b,h);var N=y.length,M=0;s(u._data,m,d,N,M)}return u}function s(u,m,d,h,y){var v=y===h-1,x=m.dimension(y);v?x.forEach(function(w,C){Kr(w),u[w]=d[C[0]]}):x.forEach(function(w,C){Kr(w),s(u[w],m,d[C[0]],h,y+1)})}t.prototype.resize=function(u,m,d){if(!Nt(u))throw new TypeError("Array or Matrix expected");var h=u.valueOf().map(v=>Array.isArray(v)&&v.length===1?v[0]:v),y=d?this.clone():this;return l(y,h,m)};function l(u,m,d){if(m.length===0){for(var h=u._data;Mr(h);)h=h[0];return h}return u._size=m.slice(0),u._data=ii(u._data,u._size,d),u}t.prototype.reshape=function(u,m){var d=m?this.clone():this;d._data=Ac(d._data,u);var h=d._size.reduce((y,v)=>y*v);return d._size=Mc(u,h),d};function c(u,m,d){for(var h=u._size.slice(0),y=!1;h.lengthh[v]&&(h[v]=m[v],y=!0);y&&l(u,h,d)}t.prototype.clone=function(){var u=new t({data:ar(this._data),size:ar(this._size),datatype:this._datatype});return u},t.prototype.size=function(){return this._size.slice(0)},t.prototype.map=function(u){var m=this,d=Zm(u),h=function x(w,C){return Mr(w)?w.map(function(b,N){return x(b,C.concat(N))}):d===1?u(w):d===2?u(w,C):u(w,C,m)},y=h(this._data,[]),v=this._datatype!==void 0?Oo(y,Tr):void 0;return new t(y,v)},t.prototype.forEach=function(u){var m=this,d=function h(y,v){Mr(y)?y.forEach(function(x,w){h(x,v.concat(w))}):u(y,v,m)};d(this._data,[])},t.prototype[Symbol.iterator]=function*(){var u=function*m(d,h){if(Mr(d))for(var y=0;y[b[w]]);m.push(new t(C,u._datatype))},v=0;v0?u:0,d=u<0?-u:0,h=this._size[0],y=this._size[1],v=Math.min(h-d,y-m),x=[],w=0;w0?d:0,v=d<0?-d:0,x=u[0],w=u[1],C=Math.min(x-v,w-y),b;if(Mr(m)){if(m.length!==C)throw new Error("Invalid value array length");b=function(_){return m[_]}}else if(Qe(m)){var N=m.size();if(N.length!==1||N[0]!==C)throw new Error("Invalid matrix length");b=function(_){return m.get([_])}}else b=function(){return m};h||(h=rr(b(0))?b(0).mul(0):0);var M=[];if(u.length>0){M=ii(M,u,h);for(var S=0;S{var{typed:r}=e;return r($M,{any:ar})});function Jm(e){var r=e.length,t=e[0].length,n,a,i=[];for(a=0;a=n.length)throw new tn(r,n.length);return Qe(e)?e.create(Km(e.valueOf(),r,t)):Km(e,r,t)}function Km(e,r,t){var n,a,i,s;if(r<=0)if(Array.isArray(e[0])){for(s=Jm(e),a=[],n=0;n{var{typed:r}=e;return r(GM,{number:Ze,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 ea="number",ro="number, number";function dw(e){return Math.abs(e)}dw.signature=ea;function hw(e,r){return e+r}hw.signature=ro;function vw(e,r){return e-r}vw.signature=ro;function gw(e,r){return e*r}gw.signature=ro;function xz(e,r){return e/r}xz.signature=ro;function yw(e){return-e}yw.signature=ea;function xw(e){return e}xw.signature=ea;function _u(e){return jA(e)}_u.signature=ea;function bw(e){return e*e*e}bw.signature=ea;function ww(e){return Math.exp(e)}ww.signature=ea;function Dw(e){return eM(e)}Dw.signature=ea;function bz(e,r){if(!Ze(e)||!Ze(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}bz.signature=ro;function Sw(e,r){if(!Ze(e)||!Ze(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)}Sw.signature=ro;function VM(e,r){return r?Math.log(e)/Math.log(r):Math.log(e)}function Nw(e){return KA(e)}Nw.signature=ea;function Aw(e){return JA(e)}Aw.signature=ea;function wz(e){return Am(e)}wz.signature=ea;function Dz(e,r){return r===0?e:e-r*Math.floor(e/r)}Dz.signature=ro;function Mw(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 ep(e){return Ba(e)}ep.signature=ea;function Sz(e){return Math.sqrt(e)}Sz.signature=ea;function Cw(e){return e*e}Cw.signature=ea;function Ew(e,r){var t,n,a,i=0,s=1,l=1,c=0;if(!Ze(e)||!Ze(r))throw new Error("Parameters in function xgcd must be integer numbers");for(;r;)n=Math.floor(e/r),a=e-n*r,t=i,i=s-n*i,s=t,t=l,l=c-n*l,c=t,e=r,r=a;var o;return e<0?o=[-e,-s,-c]:o=[e,e?s:0,c],o}Ew.signature=ro;function Tw(e,r){return e*e<1&&r===1/0||e*e>1&&r===-1/0?0:Math.pow(e,r)}Tw.signature=ro;function Ou(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!Ze(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(Gb(e,r))}function Nz(e){return Math.abs(e)}Nz.signature=ea;var Az="number",Bu="number, number";function Fw(e,r){if(!Ze(e)||!Ze(r))throw new Error("Integers expected in function bitAnd");return e&r}Fw.signature=Bu;function _w(e){if(!Ze(e))throw new Error("Integer expected in function bitNot");return~e}_w.signature=Az;function Ow(e,r){if(!Ze(e)||!Ze(r))throw new Error("Integers expected in function bitOr");return e|r}Ow.signature=Bu;function Bw(e,r){if(!Ze(e)||!Ze(r))throw new Error("Integers expected in function bitXor");return e^r}Bw.signature=Bu;function Pw(e,r){if(!Ze(e)||!Ze(r))throw new Error("Integers expected in function leftShift");return e<>r}Iw.signature=Bu;function Rw(e,r){if(!Ze(e)||!Ze(r))throw new Error("Integers expected in function rightLogShift");return e>>>r}Rw.signature=Bu;function va(e,r){if(r>1;return va(e,t)*va(t+1,r)}function qw(e,r){if(!Ze(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!Ze(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,a=r171?1/0:va(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*Fc(1-e));if(e>=171.35)return 1/0;if(e>85){var t=e*e,n=t*e,a=n*e,i=a*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*a)+163879/(209018880*i)+5246819/(75246796800*i*e))}--e,r=Fs[0];for(var s=1;s=1;n--)t+=KM[n]/(e+n);return Hw+(e+.5)*Math.log(r)-r+Math.log(t)}_c.signature="number";var Ct="number",Tz="number, number";function Fz(e){return Math.acos(e)}Fz.signature=Ct;function $w(e){return nM(e)}$w.signature=Ct;function Gw(e){return Math.atan(1/e)}Gw.signature=Ct;function Vw(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}Vw.signature=Ct;function Zw(e){return Math.asin(1/e)}Zw.signature=Ct;function Qw(e){var r=1/e;return Math.log(r+Math.sqrt(r*r+1))}Qw.signature=Ct;function Xw(e){return Math.acos(1/e)}Xw.signature=Ct;function Jw(e){var r=1/e,t=Math.sqrt(r*r-1);return Math.log(t+r)}Jw.signature=Ct;function _z(e){return Math.asin(e)}_z.signature=Ct;function Kw(e){return aM(e)}Kw.signature=Ct;function Oz(e){return Math.atan(e)}Oz.signature=Ct;function Bz(e,r){return Math.atan2(e,r)}Bz.signature=Tz;function jw(e){return iM(e)}jw.signature=Ct;function Pz(e){return Math.cos(e)}Pz.signature=Ct;function Iz(e){return Cm(e)}Iz.signature=Ct;function eD(e){return 1/Math.tan(e)}eD.signature=Ct;function rD(e){var r=Math.exp(2*e);return(r+1)/(r-1)}rD.signature=Ct;function tD(e){return 1/Math.sin(e)}tD.signature=Ct;function nD(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*Ba(e)}nD.signature=Ct;function aD(e){return 1/Math.cos(e)}aD.signature=Ct;function iD(e){return 2/(Math.exp(e)+Math.exp(-e))}iD.signature=Ct;function Rz(e){return Math.sin(e)}Rz.signature=Ct;function oD(e){return oM(e)}oD.signature=Ct;function qz(e){return Math.tan(e)}qz.signature=Ct;function kz(e){return Em(e)}kz.signature=Ct;var Oc="number";function Lz(e){return Ze(e)}Lz.signature=Oc;function sD(e){return e<0}sD.signature=Oc;function uD(e){return e>0}uD.signature=Oc;function fD(e){return e===0}fD.signature=Oc;function cD(e){return Number.isNaN(e)}cD.signature=Oc;var jM="isNegative",zz=["typed"],rp=F(jM,zz,e=>{var{typed:r}=e;return r(jM,{number:sD,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 e2="isNumeric",Uz=["typed"],tp=F(e2,Uz,e=>{var{typed:r}=e;return r(e2,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":r.referToSelf(t=>n=>je(n,t))})});var r2="hasNumericValue",Wz=["typed","isNumeric"],np=F(r2,Wz,e=>{var{typed:r,isNumeric:t}=e;return r(r2,{boolean:()=>!0,string:function(a){return a.trim().length>0&&!isNaN(Number(a))},any:function(a){return t(a)}})});var t2="isPositive",Yz=["typed"],ap=F(t2,Yz,e=>{var{typed:r}=e;return r(t2,{number:uD,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 n2="isZero",Hz=["typed"],ip=F(n2,Hz,e=>{var{typed:r}=e;return r(n2,{number:fD,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 a2="isNaN",$z=["typed"],op=F(a2,$z,e=>{var{typed:r}=e;return r(a2,{number:cD,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 i2="typeOf",Gz=["typed"],sp=F(i2,Gz,e=>{var{typed:r}=e;return r(i2,{any:Tr})});function $t(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 a=e.constructor.max(e.abs(),r.abs());return n.lte(a.times(t))}return!1}function o2(e,r,t){return At(e.re,r.re,t)&&At(e.im,r.im,t)}var Ia=F("compareUnits",["typed"],e=>{var{typed:r}=e;return{"Unit, Unit":r.referToSelf(t=>(n,a)=>{if(!n.equalBase(a))throw new Error("Cannot compare units with different base");return r.find(t,[n.valueType(),a.valueType()])(n.value,a.value)})}});var up="equalScalar",Vz=["typed","config"],fp=F(up,Vz,e=>{var{typed:r,config:t}=e,n=Ia({typed:r});return r(up,{"boolean, boolean":function(i,s){return i===s},"number, number":function(i,s){return At(i,s,t.epsilon)},"BigNumber, BigNumber":function(i,s){return i.eq(s)||$t(i,s,t.epsilon)},"Fraction, Fraction":function(i,s){return i.equals(s)},"Complex, Complex":function(i,s){return o2(i,s,t.epsilon)}},n)}),lee=F(up,["typed","config"],e=>{var{typed:r,config:t}=e;return r(up,{"number, number":function(a,i){return At(a,i,t.epsilon)}})});var Zz="SparseMatrix",Qz=["typed","equalScalar","Matrix"],cp=F(Zz,Qz,e=>{var{typed:r,equalScalar:t,Matrix:n}=e;function a(v,x){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if(x&&!St(x))throw new Error("Invalid datatype: "+x);if(Qe(v))i(this,v,x);else if(v&&Mr(v.index)&&Mr(v.ptr)&&Mr(v.size))this._values=v.values,this._index=v.index,this._ptr=v.ptr,this._size=v.size,this._datatype=x||v.datatype;else if(Mr(v))s(this,v,x);else{if(v)throw new TypeError("Unsupported type of data ("+Tr(v)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=x}}function i(v,x,w){x.type==="SparseMatrix"?(v._values=x._values?ar(x._values):void 0,v._index=ar(x._index),v._ptr=ar(x._ptr),v._size=ar(x._size),v._datatype=w||x._datatype):s(v,x.valueOf(),w||x._datatype)}function s(v,x,w){v._values=[],v._index=[],v._ptr=[],v._datatype=w;var C=x.length,b=0,N=t,M=0;if(St(w)&&(N=r.find(t,[w,w])||t,M=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 _=x.dimension(0);_.forEach(function(R,L){Kr(R),v.set([R,0],w[L[0]],C)})}else{var E=x.dimension(0),T=x.dimension(1);E.forEach(function(R,L){Kr(R),T.forEach(function(H,V){Kr(H),v.set([R,H],w[L[0]][V[0]],C)})})}}return v}a.prototype.get=function(v){if(!Mr(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 x=v[0],w=v[1];Kr(x,this._size[0]),Kr(w,this._size[1]);var C=o(x,this._ptr[w],this._ptr[w+1],this._index);return CN-1||b>M-1)&&(d(this,Math.max(C+1,N),Math.max(b+1,M),w),N=this._size[0],M=this._size[1]),Kr(C,N),Kr(b,M);var _=o(C,this._ptr[b],this._ptr[b+1],this._index);return _Array.isArray(N)&&N.length===1?N[0]:N);if(C.length!==2)throw new Error("Only two dimensions matrix are supported");C.forEach(function(N){if(!sr(N)||!Ze(N)||N<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],x)};function d(v,x,w,C){var b=C||0,N=t,M=0;St(v._datatype)&&(N=r.find(t,[v._datatype,v._datatype])||t,M=r.convert(0,v._datatype),b=r.convert(b,v._datatype));var S=!N(b,M),O=v._size[0],_=v._size[1],E,T,R;if(w>_){for(T=_;TO){if(S){var L=0;for(T=0;T<_;T++){v._ptr[T]=v._ptr[T]+L,R=v._ptr[T+1]+L;var H=0;for(E=O;Ex-1&&(v._values.splice(R,1),v._index.splice(R,1),V++)}v._ptr[T]=v._values.length}return v._size[0]=x,v._size[1]=w,v}a.prototype.reshape=function(v,x){if(!Mr(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(z){if(!sr(z)||!Ze(z)||z<=-2||z===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+lr(v)+")")});var w=this._size[0]*this._size[1];v=Mc(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=x?this.clone():this;if(this._size[0]===v[0]&&this._size[1]===v[1])return b;for(var N=[],M=0;M=x&&k<=w&&R(v._values[W],k-x,L-C)}else{for(var q={},K=H;K "+(this._values?lr(this._values[O],v):"X")}return b},a.prototype.toString=function(){return lr(this.toArray())},a.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},a.prototype.diagonal=function(v){if(v){if(rr(v)&&(v=v.toNumber()),!sr(v)||!Ze(v))throw new TypeError("The parameter k must be an integer number")}else v=0;var x=v>0?v:0,w=v<0?-v:0,C=this._size[0],b=this._size[1],N=Math.min(C-w,b-x),M=[],S=[],O=[];O[0]=0;for(var _=x;_0?w:0,O=w<0?-w:0,_=v[0],E=v[1],T=Math.min(_-O,E-S),R;if(Mr(x)){if(x.length!==T)throw new Error("Invalid value array length");R=function(oe){return x[oe]}}else if(Qe(x)){var L=x.size();if(L.length!==1||L[0]!==T)throw new Error("Invalid matrix length");R=function(oe){return x.get([oe])}}else R=function(){return x};for(var H=[],V=[],W=[],k=0;k=0&&q=O||b[E]!==x)){var R=C?C[_]:void 0;b.splice(E,0,x),C&&C.splice(E,0,R),b.splice(E<=_?_+1:_,1),C&&C.splice(E<=_?_+1:_,1);continue}if(E=O||b[_]!==v)){var L=C?C[E]:void 0;b.splice(_,0,v),C&&C.splice(_,0,L),b.splice(_<=E?E+1:E,1),C&&C.splice(_<=E?E+1:E,1)}}},a},{isClass:!0});var Xz="number",Jz=["typed"];function Kz(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],a=r[3];return{input:e,radix:t,integerPart:n,fractionalPart:a}}else return null}function jz(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(a){return a},string:function(a){if(a==="NaN")return NaN;var i=Kz(a);if(i)return jz(i);var s=0,l=a.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);l&&(s=Number(l[2]),a=l[1]);var c=Number(a);if(isNaN(c))throw new SyntaxError('String "'+a+'" is not a valid number');if(l){if(c>2**s-1)throw new SyntaxError('String "'.concat(a,'" is out of range'));c>=2**(s-1)&&(c=c-2**s)}return c},BigNumber:function(a){return a.toNumber()},Fraction:function(a){return a.valueOf()},Unit:r.referToSelf(n=>a=>{var i=a.clone();return i.value=n(a.value),i}),null:function(a){return 0},"Unit, string | Unit":function(a,i){return a.toNumber(i)},"Array | Matrix":r.referToSelf(n=>a=>je(a,n))});return t.fromJSON=function(n){return parseFloat(n.value)},t});var s2="string",eU=["typed"],mp=F(s2,eU,e=>{var{typed:r}=e;return r(s2,{"":function(){return""},number:ai,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 u2="boolean",rU=["typed"],pp=F(u2,rU,e=>{var{typed:r}=e;return r(u2,{"":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 a=n.toLowerCase();if(a==="true")return!0;if(a==="false")return!1;var i=Number(n);if(n!==""&&!isNaN(i))return!!i;throw new Error('Cannot convert "'+n+'" to a boolean')},"Array | Matrix":r.referToSelf(t=>n=>je(n,t))})});var tU="bignumber",nU=["typed","BigNumber"],dp=F(tU,nU,e=>{var{typed:r,BigNumber:t}=e;return r("bignumber",{"":function(){return new t(0)},number:function(a){return new t(a+"")},string:function(a){var i=a.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(i){var s=i[2],l=t(i[1]),c=new t(2).pow(Number(s));if(l.gt(c.sub(1)))throw new SyntaxError('String "'.concat(a,'" is out of range'));var o=new t(2).pow(Number(s)-1);return l.gte(o)?l.sub(c):l}return new t(a)},BigNumber:function(a){return a},Unit:r.referToSelf(n=>a=>{var i=a.clone();return i.value=n(a.value),i}),Fraction:function(a){return new t(a.n).div(a.d).times(a.s)},null:function(a){return new t(0)},"Array | Matrix":r.referToSelf(n=>a=>je(a,n))})});var aU="complex",iU=["typed","Complex"],hp=F(aU,iU,e=>{var{typed:r,Complex:t}=e;return r("complex",{"":function(){return t.ZERO},number:function(a){return new t(a,0)},"number, number":function(a,i){return new t(a,i)},"BigNumber, BigNumber":function(a,i){return new t(a.toNumber(),i.toNumber())},Fraction:function(a){return new t(a.valueOf(),0)},Complex:function(a){return a.clone()},string:function(a){return t(a)},null:function(a){return t(0)},Object:function(a){if("re"in a&&"im"in a)return new t(a.re,a.im);if("r"in a&&"phi"in a||"abs"in a&&"arg"in a)return new t(a);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":r.referToSelf(n=>a=>je(a,n))})});var oU="fraction",sU=["typed","Fraction"],vp=F(oU,sU,e=>{var{typed:r,Fraction:t}=e;return r("fraction",{number:function(a){if(!isFinite(a)||isNaN(a))throw new Error(a+" cannot be represented as a fraction");return new t(a)},string:function(a){return new t(a)},"number, number":function(a,i){return new t(a,i)},null:function(a){return new t(0)},BigNumber:function(a){return new t(a.toString())},Fraction:function(a){return a},Unit:r.referToSelf(n=>a=>{var i=a.clone();return i.value=n(a.value),i}),Object:function(a){return new t(a)},"Array | Matrix":r.referToSelf(n=>a=>je(a,n))})});var f2="matrix",uU=["typed","Matrix","DenseMatrix","SparseMatrix"],gp=F(f2,uU,e=>{var{typed:r,Matrix:t,DenseMatrix:n,SparseMatrix:a}=e;return r(f2,{"":function(){return i([])},string:function(l){return i([],l)},"string, string":function(l,c){return i([],l,c)},Array:function(l){return i(l)},Matrix:function(l){return i(l,l.storage())},"Array | Matrix, string":i,"Array | Matrix, string, string":i});function i(s,l,c){if(l==="dense"||l==="default"||l===void 0)return new n(s,c);if(l==="sparse")return new a(s,c);throw new TypeError("Unknown matrix type "+JSON.stringify(l)+".")}});var c2="matrixFromFunction",fU=["typed","matrix","isZero"],yp=F(c2,fU,e=>{var{typed:r,matrix:t,isZero:n}=e;return r(c2,{"Array | Matrix, function, string, string":function(s,l,c,o){return a(s,l,c,o)},"Array | Matrix, function, string":function(s,l,c){return a(s,l,c)},"Matrix, function":function(s,l){return a(s,l,"dense")},"Array, function":function(s,l){return a(s,l,"dense").toArray()},"Array | Matrix, string, function":function(s,l,c){return a(s,c,l)},"Array | Matrix, string, string, function":function(s,l,c,o){return a(s,o,l,c)}});function a(i,s,l,c){var o;return c!==void 0?o=t(l,c):o=t(l),o.resize(i),o.forEach(function(u,m){var d=s(m);n(d)||o.set(m,d)}),o}});var l2="matrixFromRows",cU=["typed","matrix","flatten","size"],xp=F(l2,cU,e=>{var{typed:r,matrix:t,flatten:n,size:a}=e;return r(l2,{"...Array":function(c){return i(c)},"...Matrix":function(c){return t(i(c.map(o=>o.toArray())))}});function i(l){if(l.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var c=s(l[0]),o=[];for(var u of l){var m=s(u);if(m!==c)throw new TypeError("The vectors had different length: "+(c|0)+" \\u2260 "+(m|0));o.push(n(u))}return o}function s(l){var c=a(l);if(c.length===1)return c[0];if(c.length===2){if(c[0]===1)return c[1];if(c[1]===1)return c[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 m2="matrixFromColumns",lU=["typed","matrix","flatten","size"],bp=F(m2,lU,e=>{var{typed:r,matrix:t,flatten:n,size:a}=e;return r(m2,{"...Array":function(c){return i(c)},"...Matrix":function(c){return t(i(c.map(o=>o.toArray())))}});function i(l){if(l.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var c=s(l[0]),o=[],u=0;u{var{typed:r}=e;return r(p2,{"Unit, Array":function(n,a){return n.splitUnit(a)}})});var d2="unaryMinus",pU=["typed"],Dp=F(d2,pU,e=>{var{typed:r}=e;return r(d2,{number:yw,"Complex | BigNumber | Fraction":t=>t.neg(),Unit:r.referToSelf(t=>n=>{var a=n.clone();return a.value=r.find(t,a.valueType())(n.value),a}),"Array | Matrix":r.referToSelf(t=>n=>je(n,t,!0))})});var h2="unaryPlus",dU=["typed","config","BigNumber"],Sp=F(h2,dU,e=>{var{typed:r,config:t,BigNumber:n}=e;return r(h2,{number:xw,Complex:function(i){return i},BigNumber:function(i){return i},Fraction:function(i){return i},Unit:function(i){return i.clone()},"Array | Matrix":r.referToSelf(a=>i=>je(i,a,!0)),"boolean | string":function(i){return t.number==="BigNumber"?new n(+i):+i}})});var v2="abs",hU=["typed"],Np=F(v2,hU,e=>{var{typed:r}=e;return r(v2,{number:dw,"Complex | BigNumber | Fraction | Unit":t=>t.abs(),"Array | Matrix":r.referToSelf(t=>n=>je(n,t,!0))})});var g2="apply",vU=["typed","isInteger"],Lo=F(g2,vU,e=>{var{typed:r,isInteger:t}=e;return r(g2,{"Array | Matrix, number | BigNumber, function":function(a,i,s){if(!t(i))throw new TypeError("Integer number expected for dimension");var l=Array.isArray(a)?ur(a):a.size();if(i<0||i>=l.length)throw new tn(i,l.length);return Qe(a)?a.create(Ap(a.valueOf(),i,s)):Ap(a,i,s)}})});function Ap(e,r,t){var n,a,i;if(r<=0)if(Array.isArray(e[0])){for(i=gU(e),a=[],n=0;n{var{typed:r}=e;return r(y2,{"number, number":hw,"Complex, Complex":function(n,a){return n.add(a)},"BigNumber, BigNumber":function(n,a){return n.plus(a)},"Fraction, Fraction":function(n,a){return n.add(a)},"Unit, Unit":r.referToSelf(t=>(n,a)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(a.value===null||a.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(a))throw new Error("Units do not match");var i=n.clone();return i.value=r.find(t,[i.valueType(),a.valueType()])(i.value,a.value),i.fixPrefix=!1,i})})});var x2="subtractScalar",xU=["typed"],Cp=F(x2,xU,e=>{var{typed:r}=e;return r(x2,{"number, number":vw,"Complex, Complex":function(n,a){return n.sub(a)},"BigNumber, BigNumber":function(n,a){return n.minus(a)},"Fraction, Fraction":function(n,a){return n.sub(a)},"Unit, Unit":r.referToSelf(t=>(n,a)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(a.value===null||a.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(a))throw new Error("Units do not match");var i=n.clone();return i.value=r.find(t,[i.valueType(),a.valueType()])(i.value,a.value),i.fixPrefix=!1,i})})});var b2="cbrt",bU=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],Ep=F(b2,bU,e=>{var{config:r,typed:t,isNegative:n,unaryMinus:a,matrix:i,Complex:s,BigNumber:l,Fraction:c}=e;return t(b2,{number:_u,Complex:o,"Complex, boolean":o,BigNumber:function(d){return d.cbrt()},Unit:u});function o(m,d){var h=m.arg()/3,y=m.abs(),v=new s(_u(y),0).mul(new s(0,h).exp());if(d){var x=[v,new s(_u(y),0).mul(new s(0,h+Math.PI*2/3).exp()),new s(_u(y),0).mul(new s(0,h-Math.PI*2/3).exp())];return r.matrix==="Array"?x:i(x)}else return v}function u(m){if(m.value&&Kt(m.value)){var d=m.clone();return d.value=1,d=d.pow(1/3),d.value=o(m.value),d}else{var h=n(m.value);h&&(m.value=a(m.value));var y;rr(m.value)?y=new l(1).div(3):da(m.value)?y=new c(1,3):y=1/3;var v=m.pow(y);return h&&(v.value=a(v.value)),v}}});var wU="matAlgo11xS0s",DU=["typed","equalScalar"],jr=F(wU,DU,e=>{var{typed:r,equalScalar:t}=e;return function(a,i,s,l){var c=a._values,o=a._index,u=a._ptr,m=a._size,d=a._datatype;if(!c)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=m[0],y=m[1],v,x=t,w=0,C=s;typeof d=="string"&&(v=d,x=r.find(t,[v,v]),w=r.convert(0,v),i=r.convert(i,v),C=r.find(s,[v,v]));for(var b=[],N=[],M=[],S=0;S{var{typed:r,DenseMatrix:t}=e;return function(a,i,s,l){var c=a._values,o=a._index,u=a._ptr,m=a._size,d=a._datatype;if(!c)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=m[0],y=m[1],v,x=s;typeof d=="string"&&(v=d,i=r.convert(i,v),x=r.find(s,[v,v]));for(var w=[],C=[],b=[],N=0;N{var{typed:r}=e;return function(a,i,s,l){var c=a._data,o=a._size,u=a._datatype,m,d=s;typeof u=="string"&&(m=u,i=r.convert(i,m),d=r.find(s,[m,m]));var h=o.length>0?t(d,0,o,o[0],c,i,l):[];return a.createDenseMatrix({data:h,size:ar(o),datatype:m})};function t(n,a,i,s,l,c,o){var u=[];if(a===i.length-1)for(var m=0;m{var{typed:r,config:t,round:n}=e;return r(lD,{number:function(i){return At(i,n(i),t.epsilon)?n(i):Math.ceil(i)},"number, number":function(i,s){if(At(i,n(i,s),t.epsilon))return n(i,s);var[l,c]="".concat(i,"e").split("e"),o=Math.ceil(Number("".concat(l,"e").concat(Number(c)+s)));return[l,c]="".concat(o,"e").split("e"),Number("".concat(l,"e").concat(Number(c)-s))}})}),Tp=F(lD,CU,e=>{var{typed:r,config:t,round:n,matrix:a,equalScalar:i,zeros:s,DenseMatrix:l}=e,c=jr({typed:r,equalScalar:i}),o=Wr({typed:r,DenseMatrix:l}),u=kt({typed:r}),m=EU({typed:r,config:t,round:n});return r("ceil",{number:m.signatures.number,"number,number":m.signatures["number,number"],Complex:function(h){return h.ceil()},"Complex, number":function(h,y){return h.ceil(y)},"Complex, BigNumber":function(h,y){return h.ceil(y.toNumber())},BigNumber:function(h){return $t(h,n(h),t.epsilon)?n(h):h.ceil()},"BigNumber, BigNumber":function(h,y){return $t(h,n(h,y),t.epsilon)?n(h,y):h.toDecimalPlaces(y.toNumber(),Es.ROUND_CEIL)},Fraction:function(h){return h.ceil()},"Fraction, number":function(h,y){return h.ceil(y)},"Fraction, BigNumber":function(h,y){return h.ceil(y.toNumber())},"Array | Matrix":r.referToSelf(d=>h=>je(h,d,!0)),"Array, number | BigNumber":r.referToSelf(d=>(h,y)=>je(h,v=>d(v,y),!0)),"SparseMatrix, number | BigNumber":r.referToSelf(d=>(h,y)=>c(h,y,d,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(d=>(h,y)=>u(h,y,d,!1)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(d=>(h,y)=>u(a(y),h,d,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(d=>(h,y)=>i(h,0)?s(y.size(),y.storage()):y.storage()==="dense"?u(y,h,d,!0):o(y,h,d,!0))})});var w2="cube",TU=["typed"],Fp=F(w2,TU,e=>{var{typed:r}=e;return r(w2,{number:bw,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 D2="exp",FU=["typed"],_p=F(D2,FU,e=>{var{typed:r}=e;return r(D2,{number:ww,Complex:function(n){return n.exp()},BigNumber:function(n){return n.exp()}})});var S2="expm1",_U=["typed","Complex"],Op=F(S2,_U,e=>{var{typed:r,Complex:t}=e;return r(S2,{number:Dw,Complex:function(a){var i=Math.exp(a.re);return new t(i*Math.cos(a.im)-1,i*Math.sin(a.im))},BigNumber:function(a){return a.exp().minus(1)}})});var mD="fix",OU=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],BU=F(mD,["typed","ceil","floor"],e=>{var{typed:r,ceil:t,floor:n}=e;return r(mD,{number:function(i){return i>0?n(i):t(i)},"number, number":function(i,s){return i>0?n(i,s):t(i,s)}})}),Bp=F(mD,OU,e=>{var{typed:r,Complex:t,matrix:n,ceil:a,floor:i,equalScalar:s,zeros:l,DenseMatrix:c}=e,o=Wr({typed:r,DenseMatrix:c}),u=kt({typed:r}),m=BU({typed:r,ceil:a,floor:i});return r("fix",{number:m.signatures.number,"number, number | BigNumber":m.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,y){return new t(h.re>0?i(h.re,y):a(h.re,y),h.im>0?i(h.im,y):a(h.im,y))},"Complex, BigNumber":function(h,y){var v=y.toNumber();return new t(h.re>0?i(h.re,v):a(h.re,v),h.im>0?i(h.im,v):a(h.im,v))},BigNumber:function(h){return h.isNegative()?a(h):i(h)},"BigNumber, number | BigNumber":function(h,y){return h.isNegative()?a(h,y):i(h,y)},Fraction:function(h){return h.s<0?h.ceil():h.floor()},"Fraction, number | BigNumber":function(h,y){return h.s<0?a(h,y):i(h,y)},"Array | Matrix":r.referToSelf(d=>h=>je(h,d,!0)),"Array | Matrix, number | BigNumber":r.referToSelf(d=>(h,y)=>je(h,v=>d(v,y),!0)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(d=>(h,y)=>u(n(y),h,d,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(d=>(h,y)=>s(h,0)?l(y.size(),y.storage()):y.storage()==="dense"?u(y,h,d,!0):o(y,h,d,!0))})});var pD="floor",PU=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],IU=F(pD,["typed","config","round"],e=>{var{typed:r,config:t,round:n}=e;return r(pD,{number:function(i){return At(i,n(i),t.epsilon)?n(i):Math.floor(i)},"number, number":function(i,s){if(At(i,n(i,s),t.epsilon))return n(i,s);var[l,c]="".concat(i,"e").split("e"),o=Math.floor(Number("".concat(l,"e").concat(Number(c)+s)));return[l,c]="".concat(o,"e").split("e"),Number("".concat(l,"e").concat(Number(c)-s))}})}),Pu=F(pD,PU,e=>{var{typed:r,config:t,round:n,matrix:a,equalScalar:i,zeros:s,DenseMatrix:l}=e,c=jr({typed:r,equalScalar:i}),o=Wr({typed:r,DenseMatrix:l}),u=kt({typed:r}),m=IU({typed:r,config:t,round:n});return r("floor",{number:m.signatures.number,"number,number":m.signatures["number,number"],Complex:function(h){return h.floor()},"Complex, number":function(h,y){return h.floor(y)},"Complex, BigNumber":function(h,y){return h.floor(y.toNumber())},BigNumber:function(h){return $t(h,n(h),t.epsilon)?n(h):h.floor()},"BigNumber, BigNumber":function(h,y){return $t(h,n(h,y),t.epsilon)?n(h,y):h.toDecimalPlaces(y.toNumber(),Es.ROUND_FLOOR)},Fraction:function(h){return h.floor()},"Fraction, number":function(h,y){return h.floor(y)},"Fraction, BigNumber":function(h,y){return h.floor(y.toNumber())},"Array | Matrix":r.referToSelf(d=>h=>je(h,d,!0)),"Array, number | BigNumber":r.referToSelf(d=>(h,y)=>je(h,v=>d(v,y),!0)),"SparseMatrix, number | BigNumber":r.referToSelf(d=>(h,y)=>c(h,y,d,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(d=>(h,y)=>u(h,y,d,!1)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(d=>(h,y)=>u(a(y),h,d,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(d=>(h,y)=>i(h,0)?s(y.size(),y.storage()):y.storage()==="dense"?u(y,h,d,!0):o(y,h,d,!0))})});var RU="matAlgo02xDS0",qU=["typed","equalScalar"],Lt=F(RU,qU,e=>{var{typed:r,equalScalar:t}=e;return function(a,i,s,l){var c=a._data,o=a._size,u=a._datatype||a.getDataType(),m=i._values,d=i._index,h=i._ptr,y=i._size,v=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(o.length!==y.length)throw new pr(o.length,y.length);if(o[0]!==y[0]||o[1]!==y[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+y+")");if(!m)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var x=o[0],w=o[1],C,b=t,N=0,M=s;typeof u=="string"&&u===v&&u!=="mixed"&&(C=u,b=r.find(t,[C,C]),N=r.convert(0,C),M=r.find(s,[C,C]));for(var S=[],O=[],_=[],E=0;E{var{typed:r}=e;return function(n,a,i,s){var l=n._data,c=n._size,o=n._datatype||n.getDataType(),u=a._values,m=a._index,d=a._ptr,h=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==h.length)throw new pr(c.length,h.length);if(c[0]!==h[0]||c[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+h+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var v=c[0],x=c[1],w,C=0,b=i;typeof o=="string"&&o===y&&o!=="mixed"&&(w=o,C=r.convert(0,w),b=r.find(i,[w,w]));for(var N=[],M=0;M{var{typed:r,equalScalar:t}=e;return function(a,i,s){var l=a._values,c=a._index,o=a._ptr,u=a._size,m=a._datatype||a._data===void 0?a._datatype:a.getDataType(),d=i._values,h=i._index,y=i._ptr,v=i._size,x=i._datatype||i._data===void 0?i._datatype:i.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,N=t,M=0,S=s;typeof m=="string"&&m===x&&m!=="mixed"&&(b=m,N=r.find(t,[b,b]),M=r.convert(0,b),S=r.find(s,[b,b]));var O=l&&d?[]:void 0,_=[],E=[],T=O?[]:void 0,R=O?[]:void 0,L=[],H=[],V,W,k,q;for(W=0;W{var{typed:r}=e;return function(a,i,s){var l=a._data,c=a._size,o=a._datatype,u=i._data,m=i._size,d=i._datatype,h=[];if(c.length!==m.length)throw new pr(c.length,m.length);for(var y=0;y0?t(x,0,h,h[0],l,u):[];return a.createDenseMatrix({data:w,size:h,datatype:v})};function t(n,a,i,s,l,c){var o=[];if(a===i.length-1)for(var u=0;u{var{concat:r}=e;return function(a,i){var s=Math.max(a._size.length,i._size.length);if(a._size.length===i._size.length&&a._size.every((y,v)=>y===i._size[v]))return[a,i];for(var l=t(a._size,s,0),c=t(i._size,s,0),o=[],u=0;u{var{typed:r,matrix:t,concat:n}=e,a=N2({typed:r}),i=kt({typed:r}),s=A2({concat:n});return function(c){var o=c.elop,u=c.SD||c.DS,m;o?(m={"DenseMatrix, DenseMatrix":(v,x)=>a(...s(v,x),o),"Array, Array":(v,x)=>a(...s(t(v),t(x)),o).valueOf(),"Array, DenseMatrix":(v,x)=>a(...s(t(v),x),o),"DenseMatrix, Array":(v,x)=>a(...s(v,t(x)),o)},c.SS&&(m["SparseMatrix, SparseMatrix"]=(v,x)=>c.SS(...s(v,x),o,!1)),c.DS&&(m["DenseMatrix, SparseMatrix"]=(v,x)=>c.DS(...s(v,x),o,!1),m["Array, SparseMatrix"]=(v,x)=>c.DS(...s(t(v),x),o,!1)),u&&(m["SparseMatrix, DenseMatrix"]=(v,x)=>u(...s(x,v),o,!0),m["SparseMatrix, Array"]=(v,x)=>u(...s(t(x),v),o,!0))):(m={"DenseMatrix, DenseMatrix":r.referToSelf(v=>(x,w)=>a(...s(x,w),v)),"Array, Array":r.referToSelf(v=>(x,w)=>a(...s(t(x),t(w)),v).valueOf()),"Array, DenseMatrix":r.referToSelf(v=>(x,w)=>a(...s(t(x),w),v)),"DenseMatrix, Array":r.referToSelf(v=>(x,w)=>a(...s(x,t(w)),v))},c.SS&&(m["SparseMatrix, SparseMatrix"]=r.referToSelf(v=>(x,w)=>c.SS(...s(x,w),v,!1))),c.DS&&(m["DenseMatrix, SparseMatrix"]=r.referToSelf(v=>(x,w)=>c.DS(...s(x,w),v,!1)),m["Array, SparseMatrix"]=r.referToSelf(v=>(x,w)=>c.DS(...s(t(x),w),v,!1))),u&&(m["SparseMatrix, DenseMatrix"]=r.referToSelf(v=>(x,w)=>u(...s(w,x),v,!0)),m["SparseMatrix, Array"]=r.referToSelf(v=>(x,w)=>u(...s(t(w),x),v,!0))));var d=c.scalar||"any",h=c.Ds||c.Ss;h&&(o?(m["DenseMatrix,"+d]=(v,x)=>i(v,x,o,!1),m[d+", DenseMatrix"]=(v,x)=>i(x,v,o,!0),m["Array,"+d]=(v,x)=>i(t(v),x,o,!1).valueOf(),m[d+", Array"]=(v,x)=>i(t(x),v,o,!0).valueOf()):(m["DenseMatrix,"+d]=r.referToSelf(v=>(x,w)=>i(x,w,v,!1)),m[d+", DenseMatrix"]=r.referToSelf(v=>(x,w)=>i(w,x,v,!0)),m["Array,"+d]=r.referToSelf(v=>(x,w)=>i(t(x),w,v,!1).valueOf()),m[d+", Array"]=r.referToSelf(v=>(x,w)=>i(t(w),x,v,!0).valueOf())));var y=c.sS!==void 0?c.sS:c.Ss;return o?(c.Ss&&(m["SparseMatrix,"+d]=(v,x)=>c.Ss(v,x,o,!1)),y&&(m[d+", SparseMatrix"]=(v,x)=>y(x,v,o,!0))):(c.Ss&&(m["SparseMatrix,"+d]=r.referToSelf(v=>(x,w)=>c.Ss(x,w,v,!1))),y&&(m[d+", SparseMatrix"]=r.referToSelf(v=>(x,w)=>y(w,x,v,!0)))),o&&o.signatures&&wm(m,o.signatures),m}});var M2="mod",ZU=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],Iu=F(M2,ZU,e=>{var{typed:r,config:t,round:n,matrix:a,equalScalar:i,zeros:s,DenseMatrix:l,concat:c}=e,o=Pu({typed:r,config:t,round:n,matrix:a,equalScalar:i,zeros:s,DenseMatrix:l}),u=Lt({typed:r,equalScalar:i}),m=lt({typed:r}),d=zo({typed:r,equalScalar:i}),h=jr({typed:r,equalScalar:i}),y=Wr({typed:r,DenseMatrix:l}),v=vr({typed:r,matrix:a,concat:c});return r(M2,{"number, number":x,"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:m,SD:u,Ss:h,sS:y}));function x(w,C){return C===0?w:w-C*o(w/C)}});var QU="matAlgo01xDSid",XU=["typed"],Mn=F(QU,XU,e=>{var{typed:r}=e;return function(n,a,i,s){var l=n._data,c=n._size,o=n._datatype||n.getDataType(),u=a._values,m=a._index,d=a._ptr,h=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==h.length)throw new pr(c.length,h.length);if(c[0]!==h[0]||c[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+h+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var v=c[0],x=c[1],w=typeof o=="string"&&o!=="mixed"&&o===y?o:void 0,C=w?r.find(i,[w,w]):i,b,N,M=[];for(b=0;b{var{typed:r,equalScalar:t}=e;return function(a,i,s){var l=a._values,c=a._index,o=a._ptr,u=a._size,m=a._datatype||a._data===void 0?a._datatype:a.getDataType(),d=i._values,h=i._index,y=i._ptr,v=i._size,x=i._datatype||i._data===void 0?i._datatype:i.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,N=t,M=0,S=s;typeof m=="string"&&m===x&&m!=="mixed"&&(b=m,N=r.find(t,[b,b]),M=r.convert(0,b),S=r.find(s,[b,b]));var O=l&&d?[]:void 0,_=[],E=[],T=l&&d?[]:void 0,R=l&&d?[]:void 0,L=[],H=[],V,W,k,q,K;for(W=0;W{var{typed:r,DenseMatrix:t}=e;return function(a,i,s,l){var c=a._values,o=a._index,u=a._ptr,m=a._size,d=a._datatype;if(!c)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=m[0],y=m[1],v,x=s;typeof d=="string"&&(v=d,i=r.convert(i,v),x=r.find(s,[v,v]));for(var w=[],C=[],b=[],N=0;NArray.isArray(r))}var Pp=F(C2,rW,e=>{var{typed:r,matrix:t,config:n,round:a,equalScalar:i,zeros:s,BigNumber:l,DenseMatrix:c,concat:o}=e,u=Iu({typed:r,config:n,round:a,matrix:t,equalScalar:i,zeros:s,DenseMatrix:c,concat:o}),m=Mn({typed:r}),d=Ru({typed:r,equalScalar:i}),h=ra({typed:r,DenseMatrix:c}),y=vr({typed:r,matrix:t,concat:o});return r(C2,{"number, number":v,"BigNumber, BigNumber":x,"Fraction, Fraction":(w,C)=>w.gcd(C)},y({SS:d,DS:m,Ss:h}),{[tW]:r.referToSelf(w=>(C,b,N)=>{for(var M=w(C,b),S=0;SC=>{if(C.length===1&&Array.isArray(C[0])&&E2(C[0]))return w(...C[0]);if(E2(C))return w(...C);throw new ga("gcd() supports only 1d matrices!")}),Matrix:r.referToSelf(w=>C=>w(C.toArray()))});function v(w,C){if(!Ze(w)||!Ze(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 x(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 N=u(w,C);w=C,C=N}return w.lt(b)?w.neg():w}});var nW="matAlgo06xS0S0",aW=["typed","equalScalar"],Uo=F(nW,aW,e=>{var{typed:r,equalScalar:t}=e;return function(a,i,s){var l=a._values,c=a._size,o=a._datatype||a._data===void 0?a._datatype:a.getDataType(),u=i._values,m=i._size,d=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(c.length!==m.length)throw new pr(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");var h=c[0],y=c[1],v,x=t,w=0,C=s;typeof o=="string"&&o===d&&o!=="mixed"&&(v=o,x=r.find(t,[v,v]),w=r.convert(0,v),C=r.find(s,[v,v]));for(var b=l&&u?[]:void 0,N=[],M=[],S=b?[]:void 0,O=[],_=[],E=0;E{var{typed:r,matrix:t,equalScalar:n,concat:a}=e,i=Lt({typed:r,equalScalar:n}),s=Uo({typed:r,equalScalar:n}),l=jr({typed:r,equalScalar:n}),c=vr({typed:r,matrix:t,concat:a}),o="number | BigNumber | Fraction | Matrix | Array",u={};return u["".concat(o,", ").concat(o,", ...").concat(o)]=r.referToSelf(d=>(h,y,v)=>{for(var x=d(h,y),w=0;wd.lcm(h)},c({SS:s,DS:i,Ss:l}),u);function m(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 y=d.times(h);!h.isZero();){var v=h;h=d.mod(v),d=v}return y.div(d).abs()}});var F2="log10",oW=["typed","config","Complex"],Rp=F(F2,oW,e=>{var{typed:r,config:t,Complex:n}=e;return r(F2,{number:function(i){return i>=0||t.predictable?Nw(i):new n(i,0).log().div(Math.LN10)},Complex:function(i){return new n(i).log().div(Math.LN10)},BigNumber:function(i){return!i.isNegative()||t.predictable?i.log():new n(i.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":r.referToSelf(a=>i=>je(i,a))})});var _2="log2",sW=["typed","config","Complex"],qp=F(_2,sW,e=>{var{typed:r,config:t,Complex:n}=e;return r(_2,{number:function(s){return s>=0||t.predictable?Aw(s):a(new n(s,0))},Complex:a,BigNumber:function(s){return!s.isNegative()||t.predictable?s.log(2):a(new n(s.toNumber(),0))},"Array | Matrix":r.referToSelf(i=>s=>je(s,i))});function a(i){var s=Math.sqrt(i.re*i.re+i.im*i.im);return new n(Math.log2?Math.log2(s):Math.log(s)/Math.LN2,Math.atan2(i.im,i.re)/Math.LN2)}});var uW="multiplyScalar",fW=["typed"],kp=F(uW,fW,e=>{var{typed:r}=e;return r("multiplyScalar",{"number, number":gw,"Complex, Complex":function(n,a){return n.mul(a)},"BigNumber, BigNumber":function(n,a){return n.times(a)},"Fraction, Fraction":function(n,a){return n.mul(a)},"number | Fraction | BigNumber | Complex, Unit":(t,n)=>n.multiply(t),"Unit, number | Fraction | BigNumber | Complex | Unit":(t,n)=>t.multiply(n)})});var O2="multiply",cW=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],Lp=F(O2,cW,e=>{var{typed:r,matrix:t,addScalar:n,multiplyScalar:a,equalScalar:i,dot:s}=e,l=jr({typed:r,equalScalar:i}),c=kt({typed:r});function o(M,S){switch(M.length){case 1:switch(S.length){case 1:if(M[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(M[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+M[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(M[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+M[1]+") must match Vector length ("+S[0]+")");break;case 2:if(M[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+M[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 "+M.length+" dimensions)")}}function u(M,S,O){if(O===0)throw new Error("Cannot multiply two empty vectors");return s(M,S)}function m(M,S){if(S.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return d(M,S)}function d(M,S){var O=M._data,_=M._size,E=M._datatype||M.getDataType(),T=S._data,R=S._size,L=S._datatype||S.getDataType(),H=_[0],V=R[1],W,k=n,q=a;E&&L&&E===L&&typeof E=="string"&&E!=="mixed"&&(W=E,k=r.find(n,[W,W]),q=r.find(a,[W,W]));for(var K=[],z=0;zge)for(var ye=0,be=0;be(S,O)=>{o(ur(S),ur(O));var _=M(t(S),t(O));return Qe(_)?_.valueOf():_}),"Matrix, Matrix":function(S,O){var _=S.size(),E=O.size();return o(_,E),_.length===1?E.length===1?u(S,O,_[0]):m(S,O):E.length===1?h(S,O):y(S,O)},"Matrix, Array":r.referTo("Matrix,Matrix",M=>(S,O)=>M(S,t(O))),"Array, Matrix":r.referToSelf(M=>(S,O)=>M(t(S,O.storage()),O)),"SparseMatrix, any":function(S,O){return l(S,O,a,!1)},"DenseMatrix, any":function(S,O){return c(S,O,a,!1)},"any, SparseMatrix":function(S,O){return l(O,S,a,!0)},"any, DenseMatrix":function(S,O){return c(O,S,a,!0)},"Array, any":function(S,O){return c(t(S),O,a,!1).valueOf()},"any, Array":function(S,O){return c(t(O),S,a,!0).valueOf()},"any, any":a,"any, any, ...any":r.referToSelf(M=>(S,O,_)=>{for(var E=M(S,O),T=0;T<_.length;T++)E=M(E,_[T]);return E})})});var B2="nthRoot",lW=["typed","matrix","equalScalar","BigNumber","concat"],zp=F(B2,lW,e=>{var{typed:r,matrix:t,equalScalar:n,BigNumber:a,concat:i}=e,s=Mn({typed:r}),l=Lt({typed:r,equalScalar:n}),c=Uo({typed:r,equalScalar:n}),o=jr({typed:r,equalScalar:n}),u=vr({typed:r,matrix:t,concat:i});function m(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return r(B2,{number:Mw,"number, number":Mw,BigNumber:h=>d(h,new a(2)),"BigNumber, BigNumber":d,Complex:m,"Complex, number":m,Array:r.referTo("DenseMatrix,number",h=>y=>h(t(y),2).valueOf()),DenseMatrix:r.referTo("DenseMatrix,number",h=>y=>h(y,2)),SparseMatrix:r.referTo("SparseMatrix,number",h=>y=>h(y,2)),"SparseMatrix, SparseMatrix":r.referToSelf(h=>(y,v)=>{if(v.density()===1)return c(y,v,h);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":r.referToSelf(h=>(y,v)=>{if(v.density()===1)return s(y,v,h,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":r.referTo("DenseMatrix,SparseMatrix",h=>(y,v)=>h(t(y),v)),"number | BigNumber, SparseMatrix":r.referToSelf(h=>(y,v)=>{if(v.density()===1)return o(v,y,h,!0);throw new Error("Root must be non-zero")})},u({scalar:"number | BigNumber",SD:l,Ss:o,sS:!1}));function d(h,y){var v=a.precision,x=a.clone({precision:v+2}),w=new a(0),C=new x(1),b=y.isNegative();if(b&&(y=y.neg()),y.isZero())throw new Error("Root must be non-zero");if(h.isNegative()&&!y.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(h.isZero())return b?new x(1/0):0;if(!h.isFinite())return b?w:h;var N=h.abs().pow(C.div(y));return N=h.isNeg()?N.neg():N,new a((b?C.div(N):N).toPrecision(v))}});var P2="sign",mW=["typed","BigNumber","Fraction","complex"],Up=F(P2,mW,e=>{var{typed:r,BigNumber:t,complex:n,Fraction:a}=e;return r(P2,{number:ep,Complex:function(s){return s.im===0?n(ep(s.re)):s.sign()},BigNumber:function(s){return new t(s.cmp(0))},Fraction:function(s){return new a(s.s,1)},"Array | Matrix":r.referToSelf(i=>s=>je(s,i,!0)),Unit:r.referToSelf(i=>s=>{if(!s._isDerived()&&s.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return r.find(i,s.valueType())(s.value)})})});var pW="sqrt",dW=["config","typed","Complex"],Wp=F(pW,dW,e=>{var{config:r,typed:t,Complex:n}=e;return t("sqrt",{number:a,Complex:function(s){return s.sqrt()},BigNumber:function(s){return!s.isNegative()||r.predictable?s.sqrt():a(s.toNumber())},Unit:function(s){return s.pow(.5)}});function a(i){return isNaN(i)?NaN:i>=0||r.predictable?Math.sqrt(i):new n(i,0).sqrt()}});var I2="square",hW=["typed"],Yp=F(I2,hW,e=>{var{typed:r}=e;return r(I2,{number:Cw,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 R2="subtract",vW=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],Hp=F(R2,vW,e=>{var{typed:r,matrix:t,equalScalar:n,subtractScalar:a,unaryMinus:i,DenseMatrix:s,concat:l}=e,c=Mn({typed:r}),o=lt({typed:r}),u=zo({typed:r,equalScalar:n}),m=ra({typed:r,DenseMatrix:s}),d=Wr({typed:r,DenseMatrix:s}),h=vr({typed:r,matrix:t,concat:l});return r(R2,{"any, any":a},h({elop:a,SS:u,DS:c,SD:o,Ss:d,sS:m}))});var q2="xgcd",gW=["typed","config","matrix","BigNumber"],$p=F(q2,gW,e=>{var{typed:r,config:t,matrix:n,BigNumber:a}=e;return r(q2,{"number, number":function(l,c){var o=Ew(l,c);return t.matrix==="Array"?o:n(o)},"BigNumber, BigNumber":i});function i(s,l){var c,o,u,m=new a(0),d=new a(1),h=m,y=d,v=d,x=m;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),c=h,h=y.minus(o.times(h)),y=c,c=v,v=x.minus(o.times(v)),x=c,s=l,l=u;var w;return s.lt(m)?w=[s.neg(),y.neg(),x.neg()]:w=[s,s.isZero()?0:y,x],t.matrix==="Array"?w:n(w)}});var k2="invmod",yW=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],Gp=F(k2,yW,e=>{var{typed:r,config:t,BigNumber:n,xgcd:a,equal:i,smaller:s,mod:l,add:c,isInteger:o}=e;return r(k2,{"number, number":u,"BigNumber, BigNumber":u});function u(m,d){if(!o(m)||!o(d))throw new Error("Parameters in function invmod must be integer numbers");if(m=l(m,d),i(d,0))throw new Error("Divisor must be non zero");var h=a(m,d);h=h.valueOf();var[y,v]=h;return i(y,n(1))?(v=l(v,d),s(v,n(0))&&(v=c(v,d)),v):NaN}});var xW="matAlgo09xS0Sf",bW=["typed","equalScalar"],Vp=F(xW,bW,e=>{var{typed:r,equalScalar:t}=e;return function(a,i,s){var l=a._values,c=a._index,o=a._ptr,u=a._size,m=a._datatype||a._data===void 0?a._datatype:a.getDataType(),d=i._values,h=i._index,y=i._ptr,v=i._size,x=i._datatype||i._data===void 0?i._datatype:i.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,N=t,M=0,S=s;typeof m=="string"&&m===x&&m!=="mixed"&&(b=m,N=r.find(t,[b,b]),M=r.convert(0,b),S=r.find(s,[b,b]));var O=l&&d?[]:void 0,_=[],E=[],T=O?[]:void 0,R=[],L,H,V,W,k;for(H=0;H{var{typed:r,matrix:t,equalScalar:n,multiplyScalar:a,concat:i}=e,s=Lt({typed:r,equalScalar:n}),l=Vp({typed:r,equalScalar:n}),c=jr({typed:r,equalScalar:n}),o=vr({typed:r,matrix:t,concat:i});return r(L2,o({elop:a,SS:l,DS:s,Ss:c}))});function z2(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 hD(e,r,function(n,a){return n&a})}function qu(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 U2(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:hD(e,r,function(a,i){return a|i})}function hD(e,r,t){var n=e.constructor,a,i,s=+(e.s<0),l=+(r.s<0);if(s){a=Qp(qu(e));for(var c=0;c0;)t(u[--h],m[--y])===v&&(x=x.plus(w)),w=w.times(C);for(;y>0;)t(d,m[--y])===v&&(x=x.plus(w)),w=w.times(C);return n.config({precision:b}),v===0&&(x.s=-x.s),x}function Qp(e){for(var r=e.d,t=r[0]+"",n=1;n0)if(++l>o)for(l-=o;l--;)c+="0";else l1&&((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 W2(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)?qu(r):r.eq(n)?qu(e):!e.isFinite()||!r.isFinite()?!e.isFinite()&&!r.isFinite()?n:new t(e.isNegative()===r.isNegative()?1/0:-1/0):hD(e,r,function(a,i){return a^i})}function Y2(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 H2(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 $2="bitAnd",DW=["typed","matrix","equalScalar","concat"],ku=F($2,DW,e=>{var{typed:r,matrix:t,equalScalar:n,concat:a}=e,i=Lt({typed:r,equalScalar:n}),s=Uo({typed:r,equalScalar:n}),l=jr({typed:r,equalScalar:n}),c=vr({typed:r,matrix:t,concat:a});return r($2,{"number, number":Fw,"BigNumber, BigNumber":z2},c({SS:s,DS:i,Ss:l}))});var G2="bitNot",SW=["typed"],Xp=F(G2,SW,e=>{var{typed:r}=e;return r(G2,{number:_w,BigNumber:qu,"Array | Matrix":r.referToSelf(t=>n=>je(n,t))})});var V2="bitOr",NW=["typed","matrix","equalScalar","DenseMatrix","concat"],Lu=F(V2,NW,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=e,s=Mn({typed:r}),l=Ru({typed:r,equalScalar:n}),c=ra({typed:r,DenseMatrix:a}),o=vr({typed:r,matrix:t,concat:i});return r(V2,{"number, number":Ow,"BigNumber, BigNumber":U2},o({SS:l,DS:s,Ss:c}))});var AW="matAlgo07xSSf",MW=["typed","DenseMatrix"],Zt=F(AW,MW,e=>{var{typed:r,DenseMatrix:t}=e;return function(i,s,l){var c=i._size,o=i._datatype||i._data===void 0?i._datatype:i.getDataType(),u=s._size,m=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(c.length!==u.length)throw new pr(c.length,u.length);if(c[0]!==u[0]||c[1]!==u[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+u+")");var d=c[0],h=c[1],y,v=0,x=l;typeof o=="string"&&o===m&&o!=="mixed"&&(y=o,v=r.convert(0,y),x=r.find(l,[y,y]));var w,C,b=[];for(w=0;w{var{typed:r,matrix:t,DenseMatrix:n,concat:a}=e,i=lt({typed:r}),s=Zt({typed:r,DenseMatrix:n}),l=Wr({typed:r,DenseMatrix:n}),c=vr({typed:r,matrix:t,concat:a});return r(Z2,{"number, number":Bw,"BigNumber, BigNumber":W2},c({SS:s,DS:i,Ss:l}))});var Q2="arg",EW=["typed"],Kp=F(Q2,EW,e=>{var{typed:r}=e;return r(Q2,{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 X2="conj",TW=["typed"],jp=F(X2,TW,e=>{var{typed:r}=e;return r(X2,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.conjugate(),"Array | Matrix":r.referToSelf(t=>n=>je(n,t))})});var J2="im",FW=["typed"],ed=F(J2,FW,e=>{var{typed:r}=e;return r(J2,{number:()=>0,"BigNumber | Fraction":t=>t.mul(0),Complex:t=>t.im,"Array | Matrix":r.referToSelf(t=>n=>je(n,t))})});var K2="re",_W=["typed"],rd=F(K2,_W,e=>{var{typed:r}=e;return r(K2,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.re,"Array | Matrix":r.referToSelf(t=>n=>je(n,t))})});var j2="not",OW=["typed"],td=F(j2,OW,e=>{var{typed:r}=e;return r(j2,{"null | undefined":()=>!0,number:Lw,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 eC="or",BW=["typed","matrix","equalScalar","DenseMatrix","concat"],zu=F(eC,BW,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=e,s=lt({typed:r}),l=zo({typed:r,equalScalar:n}),c=Wr({typed:r,DenseMatrix:a}),o=vr({typed:r,matrix:t,concat:i});return r(eC,{"number, number":zw,"Complex, Complex":function(m,d){return m.re!==0||m.im!==0||d.re!==0||d.im!==0},"BigNumber, BigNumber":function(m,d){return!m.isZero()&&!m.isNaN()||!d.isZero()&&!d.isNaN()},"Unit, Unit":r.referToSelf(u=>(m,d)=>u(m.value||0,d.value||0))},o({SS:l,DS:s,Ss:c}))});var rC="xor",PW=["typed","matrix","DenseMatrix","concat"],nd=F(rC,PW,e=>{var{typed:r,matrix:t,DenseMatrix:n,concat:a}=e,i=lt({typed:r}),s=Zt({typed:r,DenseMatrix:n}),l=Wr({typed:r,DenseMatrix:n}),c=vr({typed:r,matrix:t,concat:a});return r(rC,{"number, number":Uw,"Complex, Complex":function(u,m){return(u.re!==0||u.im!==0)!=(m.re!==0||m.im!==0)},"BigNumber, BigNumber":function(u,m){return(!u.isZero()&&!u.isNaN())!=(!m.isZero()&&!m.isNaN())},"Unit, Unit":r.referToSelf(o=>(u,m)=>o(u.value||0,m.value||0))},c({SS:s,DS:i,Ss:l}))});var tC="concat",IW=["typed","matrix","isInteger"],Uu=F(tC,IW,e=>{var{typed:r,matrix:t,isInteger:n}=e;return r(tC,{"...Array | Matrix | number | BigNumber":function(i){var s,l=i.length,c=-1,o,u=!1,m=[];for(s=0;s0&&c>o)throw new tn(c,o+1)}else{var h=ar(d).valueOf(),y=ur(h);if(m[s]=h,o=c,c=y.length-1,s>0&&c!==o)throw new pr(o+1,c+1)}}if(m.length===0)throw new SyntaxError("At least one matrix expected");for(var v=m.shift();m.length;)v=Kb(v,m.shift(),c);return u?t(v):v},"...string":function(i){return i.join("")}})});var nC="column",RW=["typed","Index","matrix","range"],Wu=F(nC,RW,e=>{var{typed:r,Index:t,matrix:n,range:a}=e;return r(nC,{"Matrix, number":i,"Array, number":function(l,c){return i(n(ar(l)),c).valueOf()}});function i(s,l){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");Kr(l,s.size()[1]);var c=a(0,s.size()[0]),o=new t(c,l),u=s.subset(o);return Qe(u)?u:n([[u]])}});var aC="count",qW=["typed","size","prod"],ad=F(aC,qW,e=>{var{typed:r,size:t,prod:n}=e;return r(aC,{string:function(i){return i.length},"Matrix | Array":function(i){return n(t(i))}})});var iC="cross",kW=["typed","matrix","subtract","multiply"],id=F(iC,kW,e=>{var{typed:r,matrix:t,subtract:n,multiply:a}=e;return r(iC,{"Matrix, Matrix":function(l,c){return t(i(l.toArray(),c.toArray()))},"Matrix, Array":function(l,c){return t(i(l.toArray(),c))},"Array, Matrix":function(l,c){return t(i(l,c.toArray()))},"Array, Array":i});function i(s,l){var c=Math.max(ur(s).length,ur(l).length);s=Au(s),l=Au(l);var o=ur(s),u=ur(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 m=[n(a(s[1],l[2]),a(s[2],l[1])),n(a(s[2],l[0]),a(s[0],l[2])),n(a(s[0],l[1]),a(s[1],l[0]))];return c>1?[m]:m}});var oC="diag",LW=["typed","matrix","DenseMatrix","SparseMatrix"],od=F(oC,LW,e=>{var{typed:r,matrix:t,DenseMatrix:n,SparseMatrix:a}=e;return r(oC,{Array:function(o){return i(o,0,ur(o),null)},"Array, number":function(o,u){return i(o,u,ur(o),null)},"Array, BigNumber":function(o,u){return i(o,u.toNumber(),ur(o),null)},"Array, string":function(o,u){return i(o,0,ur(o),u)},"Array, number, string":function(o,u,m){return i(o,u,ur(o),m)},"Array, BigNumber, string":function(o,u,m){return i(o,u.toNumber(),ur(o),m)},Matrix:function(o){return i(o,0,o.size(),o.storage())},"Matrix, number":function(o,u){return i(o,u,o.size(),o.storage())},"Matrix, BigNumber":function(o,u){return i(o,u.toNumber(),o.size(),o.storage())},"Matrix, string":function(o,u){return i(o,0,o.size(),u)},"Matrix, number, string":function(o,u,m){return i(o,u,o.size(),m)},"Matrix, BigNumber, string":function(o,u,m){return i(o,u.toNumber(),o.size(),m)}});function i(c,o,u,m){if(!Ze(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(c,o,m,u[0],h,d);case 2:return l(c,o,m,u,h,d)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function s(c,o,u,m,d,h){var y=[m+d,m+h];if(u&&u!=="sparse"&&u!=="dense")throw new TypeError("Unknown matrix type ".concat(u,'"'));var v=u==="sparse"?a.diagonal(y,c,o):n.diagonal(y,c,o);return u!==null?v:v.valueOf()}function l(c,o,u,m,d,h){if(Qe(c)){var y=c.diagonal(o);return u!==null?u!==y.storage()?t(y,u):y:y.valueOf()}for(var v=Math.min(m[0]-d,m[1]-h),x=[],w=0;w=2&&v.push("index: ".concat(Tr(t))),h.length>=3&&v.push("array: ".concat(Tr(n))),new TypeError("Function ".concat(a," cannot apply callback arguments ")+"".concat(e.name,"(").concat(v.join(", "),") at index ").concat(JSON.stringify(t)))}else throw new TypeError("Function ".concat(a," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(x.message))}}}var zW="filter",UW=["typed"],sd=F(zW,UW,e=>{var{typed:r}=e;return r("filter",{"Array, function":sC,"Matrix, function":function(n,a){return n.create(sC(n.toArray(),a))},"Array, RegExp":Mu,"Matrix, RegExp":function(n,a){return n.create(Mu(n.toArray(),a))}})});function sC(e,r){return _m(e,function(t,n,a){return Ra(r,t,[n],a,"filter")})}var uC="flatten",WW=["typed","matrix"],ud=F(uC,WW,e=>{var{typed:r,matrix:t}=e;return r(uC,{Array:function(a){return gr(a)},Matrix:function(a){var i=gr(a.toArray());return t(i)}})});var fC="forEach",YW=["typed"],fd=F(fC,YW,e=>{var{typed:r}=e;return r(fC,{"Array, function":HW,"Matrix, function":function(n,a){n.forEach(a)}})});function HW(e,r){var t=function n(a,i){if(Array.isArray(a))_o(a,function(s,l){n(s,i.concat(l))});else return Ra(r,a,i,e,"forEach")};t(e,[])}var cC="getMatrixDataType",$W=["typed"],cd=F(cC,$W,e=>{var{typed:r}=e;return r(cC,{Array:function(n){return Oo(n,Tr)},Matrix:function(n){return n.getDataType()}})});var lC="identity",GW=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],ld=F(lC,GW,e=>{var{typed:r,config:t,matrix:n,BigNumber:a,DenseMatrix:i,SparseMatrix:s}=e;return r(lC,{"":function(){return t.matrix==="Matrix"?n([]):[]},string:function(u){return n(u)},"number | BigNumber":function(u){return c(u,u,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(u,m){return c(u,u,m)},"number | BigNumber, number | BigNumber":function(u,m){return c(u,m,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(u,m,d){return c(u,m,d)},Array:function(u){return l(u)},"Array, string":function(u,m){return l(u,m)},Matrix:function(u){return l(u.valueOf(),u.storage())},"Matrix, string":function(u,m){return l(u.valueOf(),m)}});function l(o,u){switch(o.length){case 0:return u?n(u):[];case 1:return c(o[0],o[0],u);case 2:return c(o[0],o[1],u);default:throw new Error("Vector containing two values expected")}}function c(o,u,m){var d=rr(o)||rr(u)?a:null;if(rr(o)&&(o=o.toNumber()),rr(u)&&(u=u.toNumber()),!Ze(o)||o<1)throw new Error("Parameters in function identity must be positive integers");if(!Ze(u)||u<1)throw new Error("Parameters in function identity must be positive integers");var h=d?new a(1):1,y=d?new d(0):0,v=[o,u];if(m){if(m==="sparse")return s.diagonal(v,h,0,y);if(m==="dense")return i.diagonal(v,h,0,y);throw new TypeError('Unknown matrix type "'.concat(m,'"'))}for(var x=ii([],v,y),w=o{var{typed:r,matrix:t,multiplyScalar:n}=e;return r(mC,{"Matrix, Matrix":function(s,l){return t(a(s.toArray(),l.toArray()))},"Matrix, Array":function(s,l){return t(a(s.toArray(),l))},"Array, Matrix":function(s,l){return t(a(s,l.toArray()))},"Array, Array":a});function a(i,s){if(ur(i).length===1&&(i=[i]),ur(s).length===1&&(s=[s]),ur(i).length>2||ur(s).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(i.length)+", y = "+JSON.stringify(s.length)+")");var l=[],c=[];return i.map(function(o){return s.map(function(u){return c=[],l.push(c),o.map(function(m){return u.map(function(d){return c.push(n(m,d))})})})})&&l}});var pC="map",ZW=["typed"],pd=F(pC,ZW,e=>{var{typed:r}=e;return r(pC,{"Array, function":QW,"Matrix, function":function(n,a){return n.map(a)}})});function QW(e,r){var t=function n(a,i){return Array.isArray(a)?a.map(function(s,l){return n(s,i.concat(l))}):Ra(r,a,i,e,"map")};return t(e,[])}var dC="diff",XW=["typed","matrix","subtract","number"],Yu=F(dC,XW,e=>{var{typed:r,matrix:t,subtract:n,number:a}=e;return r(dC,{"Array | Matrix":function(u){return Qe(u)?t(s(u.toArray())):s(u)},"Array | Matrix, number":function(u,m){if(!Ze(m))throw new RangeError("Dimension must be a whole number");return Qe(u)?t(i(u.toArray(),m)):i(u,m)},"Array, BigNumber":r.referTo("Array,number",o=>(u,m)=>o(u,a(m))),"Matrix, BigNumber":r.referTo("Matrix,number",o=>(u,m)=>o(u,a(m)))});function i(o,u){if(Qe(o)&&(o=o.toArray()),!Array.isArray(o))throw RangeError("Array/Matrix does not have that many dimensions");if(u>0){var m=[];return o.forEach(d=>{m.push(i(d,u-1))}),m}else{if(u===0)return s(o);throw RangeError("Cannot have negative dimension")}}function s(o){for(var u=[],m=o.length,d=1;d{var{typed:r,config:t,matrix:n,BigNumber:a}=e;return r("ones",{"":function(){return t.matrix==="Array"?i([]):i([],"default")},"...number | BigNumber | string":function(o){var u=o[o.length-1];if(typeof u=="string"){var m=o.pop();return i(o,m)}else return t.matrix==="Array"?i(o):i(o,"default")},Array:i,Matrix:function(o){var u=o.storage();return i(o.valueOf(),u)},"Array | Matrix, string":function(o,u){return i(o.valueOf(),u)}});function i(c,o){var u=s(c),m=u?new a(1):1;if(l(c),o){var d=n(o);return c.length>0?d.resize(c,m):d}else{var h=[];return c.length>0?ii(h,c,m):h}}function s(c){var o=!1;return c.forEach(function(u,m,d){rr(u)&&(o=!0,d[m]=u.toNumber())}),o}function l(c){c.forEach(function(o){if(typeof o!="number"||!Ze(o)||o<0)throw new Error("Parameters in function ones must be positive integers")})}});function Hu(){throw new Error('No "bignumber" implementation available')}function hd(){throw new Error('No "fraction" implementation available')}function vd(){throw new Error('No "matrix" implementation available')}var hC="range",jW=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],$u=F(hC,jW,e=>{var{typed:r,config:t,matrix:n,bignumber:a,smaller:i,smallerEq:s,larger:l,largerEq:c,add:o,isPositive:u}=e;return r(hC,{string:d,"string, boolean":d,"number, number":function(x,w){return m(h(x,w,1,!1))},"number, number, number":function(x,w,C){return m(h(x,w,C,!1))},"number, number, boolean":function(x,w,C){return m(h(x,w,1,C))},"number, number, number, boolean":function(x,w,C,b){return m(h(x,w,C,b))},"BigNumber, BigNumber":function(x,w){var C=x.constructor;return m(h(x,w,new C(1),!1))},"BigNumber, BigNumber, BigNumber":function(x,w,C){return m(h(x,w,C,!1))},"BigNumber, BigNumber, boolean":function(x,w,C){var b=x.constructor;return m(h(x,w,new b(1),C))},"BigNumber, BigNumber, BigNumber, boolean":function(x,w,C,b){return m(h(x,w,C,b))},"Unit, Unit, Unit":function(x,w,C){return m(h(x,w,C,!1))},"Unit, Unit, Unit, boolean":function(x,w,C,b){return m(h(x,w,C,b))}});function m(v){return t.matrix==="Matrix"?n?n(v):vd():v}function d(v,x){var w=y(v);if(!w)throw new SyntaxError('String "'+v+'" is no valid range');return t.number==="BigNumber"?(a===void 0&&Hu(),m(h(a(w.start),a(w.end),a(w.step)),x)):m(h(w.start,w.end,w.step,x))}function h(v,x,w,C){for(var b=[],N=u(w)?C?s:i:C?c:l,M=v;N(M,x);)b.push(M),M=o(M,w);return b}function y(v){var x=v.split(":"),w=x.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 vC="reshape",eY=["typed","isInteger","matrix"],gd=F(vC,eY,e=>{var{typed:r,isInteger:t}=e;return r(vC,{"Matrix, Array":function(a,i){return a.reshape(i,!0)},"Array, Array":function(a,i){return i.forEach(function(s){if(!t(s))throw new TypeError("Invalid size for dimension: "+s)}),Ac(a,i)}})});var rY="resize",tY=["config","matrix"],yd=F(rY,tY,e=>{var{config:r,matrix:t}=e;return function(i,s,l){if(arguments.length!==2&&arguments.length!==3)throw new ga("resize",arguments.length,2,3);if(Qe(s)&&(s=s.valueOf()),rr(s[0])&&(s=s.map(function(u){return rr(u)?u.toNumber():u})),Qe(i))return i.resize(s,l,!0);if(typeof i=="string")return n(i,s,l);var c=Array.isArray(i)?!1:r.matrix!=="Array";if(s.length===0){for(;Array.isArray(i);)i=i[0];return ar(i)}else{Array.isArray(i)||(i=[i]),i=ar(i);var o=ii(i,s,l);return c?t(o):o}};function n(a,i,s){if(s!==void 0){if(typeof s!="string"||s.length!==1)throw new TypeError("Single character expected as defaultValue")}else s=" ";if(i.length!==1)throw new pr(i.length,1);var l=i[0];if(typeof l!="number"||!Ze(l))throw new TypeError("Invalid size, must contain positive integers (size: "+lr(i)+")");if(a.length>l)return a.substring(0,l);if(a.length{var{typed:r,multiply:t,rotationMatrix:n}=e;return r(gC,{"Array , number | BigNumber | Complex | Unit":function(s,l){a(s,2);var c=t(n(l),s);return c.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(s,l){return a(s,2),t(n(l),s)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(s,l,c){a(s,3);var o=t(n(l,c),s);return o},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(s,l,c){return a(s,3),t(n(l,c),s)}});function a(i,s){var l=Array.isArray(i)?ur(i):i.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 yC="rotationMatrix",aY=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],bd=F(yC,aY,e=>{var{typed:r,config:t,multiplyScalar:n,addScalar:a,unaryMinus:i,norm:s,BigNumber:l,matrix:c,DenseMatrix:o,SparseMatrix:u,cos:m,sin:d}=e;return r(yC,{"":function(){return t.matrix==="Matrix"?c([]):[]},string:function(b){return c(b)},"number | BigNumber | Complex | Unit":function(b){return h(b,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(b,N){return h(b,N)},"number | BigNumber | Complex | Unit, Array":function(b,N){var M=c(N);return y(M),w(b,M,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(b,N){y(N);var M=N.storage()||(t.matrix==="Matrix"?"dense":void 0);return w(b,N,M)},"number | BigNumber | Complex | Unit, Array, string":function(b,N,M){var S=c(N);return y(S),w(b,S,M)},"number | BigNumber | Complex | Unit, Matrix, string":function(b,N,M){return y(N),w(b,N,M)}});function h(C,b){var N=rr(C),M=N?new l(-1):-1,S=m(C),O=d(C),_=[[S,n(M,O)],[O,S]];return x(_,b)}function y(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,N)=>n(b,N))}function x(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,N){var M=s(b);if(M===0)throw new RangeError("Rotation around zero vector");var S=rr(C)?l:null,O=S?new S(1):1,_=S?new S(-1):-1,E=S?new S(b.get([0])/M):b.get([0])/M,T=S?new S(b.get([1])/M):b.get([1])/M,R=S?new S(b.get([2])/M):b.get([2])/M,L=m(C),H=a(O,i(L)),V=d(C),W=a(L,v([E,E,H])),k=a(v([E,T,H]),v([_,R,V])),q=a(v([E,R,H]),v([T,V])),K=a(v([E,T,H]),v([R,V])),z=a(L,v([T,T,H])),oe=a(v([T,R,H]),v([_,E,V])),le=a(v([E,R,H]),v([_,T,V])),ae=a(v([T,R,H]),v([E,V])),$=a(L,v([R,R,H])),me=[[W,k,q],[K,z,oe],[le,ae,$]];return x(me,N)}});var xC="row",iY=["typed","Index","matrix","range"],Gu=F(xC,iY,e=>{var{typed:r,Index:t,matrix:n,range:a}=e;return r(xC,{"Matrix, number":i,"Array, number":function(l,c){return i(n(ar(l)),c).valueOf()}});function i(s,l){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");Kr(l,s.size()[0]);var c=a(0,s.size()[1]),o=new t(l,c),u=s.subset(o);return Qe(u)?u:n([[u]])}});var bC="size",oY=["typed","config","?matrix"],wd=F(bC,oY,e=>{var{typed:r,config:t,matrix:n}=e;return r(bC,{Matrix:function(i){return i.create(i.size())},Array:ur,string:function(i){return t.matrix==="Array"?[i.length]:n([i.length])},"number | Complex | BigNumber | Unit | boolean | null":function(i){return t.matrix==="Array"?[]:n?n([]):vd()}})});var wC="squeeze",sY=["typed","matrix"],Dd=F(wC,sY,e=>{var{typed:r,matrix:t}=e;return r(wC,{Array:function(a){return Au(ar(a))},Matrix:function(a){var i=Au(a.toArray());return Array.isArray(i)?t(i):i},any:function(a){return ar(a)}})});var DC="subset",uY=["typed","matrix","zeros","add"],Vu=F(DC,uY,e=>{var{typed:r,matrix:t,zeros:n,add:a}=e;return r(DC,{"Matrix, Index":function(l,c){return As(c)?t():(Nc(l,c),l.subset(c))},"Array, Index":r.referTo("Matrix, Index",function(s){return function(l,c){var o=s(t(l),c);return c.isScalar()?o:o.valueOf()}}),"Object, Index":cY,"string, Index":fY,"Matrix, Index, any, any":function(l,c,o,u){return As(c)?l:(Nc(l,c),l.clone().subset(c,i(o,c),u))},"Array, Index, any, any":r.referTo("Matrix, Index, any, any",function(s){return function(l,c,o,u){var m=s(t(l),c,o,u);return m.isMatrix?m.valueOf():m}}),"Array, Index, any":r.referTo("Matrix, Index, any, any",function(s){return function(l,c,o){return s(t(l),c,o,void 0).valueOf()}}),"Matrix, Index, any":r.referTo("Matrix, Index, any, any",function(s){return function(l,c,o){return s(l,c,o,void 0)}}),"string, Index, string":SC,"string, Index, string, string":SC,"Object, Index, any":lY});function i(s,l){if(typeof s=="string")throw new Error("can't boradcast a string");if(l._isScalar)return s;var c=l.size();if(c.every(o=>o>0))try{return a(s,n(c))}catch{return s}else return s}});function fY(e,r){if(!Mi(r))throw new TypeError("Index expected");if(As(r))return"";if(Nc(Array.from(e),r),r.size().length!==1)throw new pr(r.size().length,1);var t=e.length;Kr(r.min()[0],t),Kr(r.max()[0],t);var n=r.dimension(0),a="";return n.forEach(function(i){a+=e.charAt(i)}),a}function SC(e,r,t,n){if(!r||r.isIndex!==!0)throw new TypeError("Index expected");if(As(r))return e;if(Nc(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 a=r.dimension(0),i=a.size()[0];if(i!==t.length)throw new pr(a.size()[0],t.length);var s=e.length;Kr(r.min()[0]),Kr(r.max()[0]);for(var l=[],c=0;cs)for(var o=s-1,u=l.length;o{var{typed:r,matrix:t}=e;return r(NC,{Array:s=>n(t(s)).valueOf(),Matrix:n,any:ar});function n(s){var l=s.size(),c;switch(l.length){case 1:c=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":c=a(s,o,u);break;case"sparse":c=i(s,o,u);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+lr(l)+")")}return c}function a(s,l,c){for(var o=s._data,u=[],m,d=0;d{var{typed:r,transpose:t,conj:n}=e;return r(AC,{any:function(i){return n(t(i))}})});var MC="zeros",dY=["typed","config","matrix","BigNumber"],Ad=F(MC,dY,e=>{var{typed:r,config:t,matrix:n,BigNumber:a}=e;return r(MC,{"":function(){return t.matrix==="Array"?i([]):i([],"default")},"...number | BigNumber | string":function(o){var u=o[o.length-1];if(typeof u=="string"){var m=o.pop();return i(o,m)}else return t.matrix==="Array"?i(o):i(o,"default")},Array:i,Matrix:function(o){var u=o.storage();return i(o.valueOf(),u)},"Array | Matrix, string":function(o,u){return i(o.valueOf(),u)}});function i(c,o){var u=s(c),m=u?new a(0):0;if(l(c),o){var d=n(o);return c.length>0?d.resize(c,m):d}else{var h=[];return c.length>0?ii(h,c,m):h}}function s(c){var o=!1;return c.forEach(function(u,m,d){rr(u)&&(o=!0,d[m]=u.toNumber())}),o}function l(c){c.forEach(function(o){if(typeof o!="number"||!Ze(o)||o<0)throw new Error("Parameters in function zeros must be positive integers")})}});var CC="fft",hY=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],Md=F(CC,hY,e=>{var{typed:r,matrix:t,addScalar:n,multiplyScalar:a,divideScalar:i,exp:s,tau:l,i:c,dotDivide:o,conj:u,pow:m,ceil:d,log2:h}=e;return r(CC,{Array:y,Matrix:function(b){return b.create(y(b.toArray()))}});function y(C){var b=ur(C);return b.length===1?w(C,b[0]):v(C.map(N=>y(N,b.slice(1))),0)}function v(C,b){var N=ur(C);if(b!==0)return new Array(N[0]).fill(0).map((S,O)=>v(C[O],b-1));if(N.length===1)return w(C);function M(S){var O=ur(S);return new Array(O[1]).fill(0).map((_,E)=>new Array(O[0]).fill(0).map((T,R)=>S[R][E]))}return M(v(M(C),1))}function x(C){for(var b=C.length,N=s(i(a(-1,a(c,l)),b)),M=[],S=1-b;Sa(C[q],M[b-1+q])),...new Array(O-b).fill(0)],E=[...new Array(b+b-1).fill(0).map((k,q)=>i(1,M[q])),...new Array(O-(b+b-1)).fill(0)],T=w(_),R=w(E),L=new Array(O).fill(0).map((k,q)=>a(T[q],R[q])),H=o(u(y(u(L))),O),V=[],W=b-1;WE%2===0),b/2),...w(C.filter((_,E)=>E%2===1),b/2)],M=0;M{var{typed:r,fft:t,dotDivide:n,conj:a}=e;return r(EC,{"Array | Matrix":function(s){var l=Qe(s)?s.size():ur(s);return n(a(t(a(s))),l.reduce((c,o)=>c*o,1))}})});function TC(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function gY(e){for(var r=1;r{var{typed:r,add:t,subtract:n,multiply:a,divide:i,max:s,map:l,abs:c,isPositive:o,isNegative:u,larger:m,smaller:d,matrix:h,bignumber:y,unaryMinus:v}=e;function x(_){return function(E,T,R,L){var H=!(T.length===2&&(T.every(S)||T.every(Ht)));if(H)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var V=T[0],W=T[1],k=m(W,V),q=L.firstStep;if(q!==void 0&&!o(q))throw new Error('"firstStep" must be positive');var K=L.maxStep;if(K!==void 0&&!o(K))throw new Error('"maxStep" must be positive');var z=L.minStep;if(z&&u(z))throw new Error('"minStep" must be positive or zero');var oe=[V,W,q,z,K].filter(Le=>Le!==void 0);if(!(oe.every(S)||oe.every(Ht)))throw new Error('Inconsistent type of "t" dependant variables');for(var le=1,ae=L.tol?L.tol:1e-4,$=L.minDelta?L.minDelta:.2,me=L.maxDelta?L.maxDelta:5,Ee=L.maxIter?L.maxIter:1e4,pe=[V,W,...R,K,z].some(rr),[ge,Se,ye,be]=pe?[y(_.a),y(_.c),y(_.b),y(_.bp)]:[_.a,_.c,_.b,_.bp],De=q?k?q:v(q):i(n(W,V),le),Ae=[V],We=[R],Je=n(ye,be),J=0,re=0,xe=N(k),j=M(k);xe(Ae[J],W);){var ne=[];De=j(Ae[J],W,De),ne.push(E(Ae[J],We[J]));for(var ue=1;ueHt(Le)?Le.value:Le)));Me1/4&&(Ae.push(t(Ae[J],De)),We.push(t(We[J],a(De,ye,ne))),J++);var Ce=.84*(ae/Me)**(1/5);if(d(Ce,$)?Ce=$:m(Ce,me)&&(Ce=me),Ce=pe?y(Ce):Ce,De=a(De,Ce),K&&m(c(De),K)?De=k?K:v(K):z&&d(c(De),z)&&(De=k?z:v(z)),re++,re>Ee)throw new Error("Maximum number of iterations reached, try changing options")}return{t:Ae,y:We}}}function w(_,E,T,R){var L=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],H=[null,1/2,3/4,1],V=[2/9,1/3,4/9,0],W=[7/24,1/4,1/3,1/8],k={a:L,c:H,b:V,bp:W};return x(k)(_,E,T,R)}function C(_,E,T,R){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]],H=[null,1/5,3/10,4/5,8/9,1,1],V=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],W=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],k={a:L,c:H,b:V,bp:W};return x(k)(_,E,T,R)}function b(_,E,T,R){var L=R.method?R.method:"RK45",H={RK23:w,RK45:C};if(L.toUpperCase()in H){var V=gY({},R);return delete V.method,H[L.toUpperCase()](_,E,T,V)}else{var W=Object.keys(H).map(q=>'"'.concat(q,'"')),k="".concat(W.slice(0,-1).join(", ")," and ").concat(W.slice(-1));throw new Error('Unavailable method "'.concat(L,'". Available methods are ').concat(k))}}function N(_){return _?d:m}function M(_){var E=_?m:d;return function(T,R,L){var H=t(T,L);return E(H,R)?n(R,T):L}}function S(_){return rr(_)||sr(_)}function O(_,E,T,R){var L=b(_,E.toArray(),T.toArray(),R);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":(_,E,T)=>b(_,E,T,{}),"function, Matrix, Matrix":(_,E,T)=>O(_,E,T,{}),"function, Array, number | BigNumber | Unit":(_,E,T)=>{var R=b(_,E,[T],{});return{t:R.t,y:R.y.map(L=>L[0])}},"function, Matrix, number | BigNumber | Unit":(_,E,T)=>{var R=b(_,E.toArray(),[T],{});return{t:h(R.t),y:h(R.y.map(L=>L[0]))}},"function, Array, number | BigNumber | Unit, Object":(_,E,T,R)=>{var L=b(_,E,[T],R);return{t:L.t,y:L.y.map(H=>H[0])}},"function, Matrix, number | BigNumber | Unit, Object":(_,E,T,R)=>{var L=b(_,E.toArray(),[T],R);return{t:h(L.t),y:h(L.y.map(H=>H[0]))}}})});var bY="erf",wY=["typed"],Td=F(bY,wY,e=>{var{typed:r}=e;return r("name",{number:function(s){var l=Math.abs(s);return l>=NY?Ba(s):l<=DY?Ba(s)*t(l):l<=4?Ba(s)*(1-n(l)):Ba(s)*(1-a(l))},"Array | Matrix":r.referToSelf(i=>s=>je(s,i))});function t(i){var s=i*i,l=to[0][4]*s,c=s,o;for(o=0;o<3;o+=1)l=(l+to[0][o])*s,c=(c+Zu[0][o])*s;return i*(l+to[0][3])/(c+Zu[0][3])}function n(i){var s=to[1][8]*i,l=i,c;for(c=0;c<7;c+=1)s=(s+to[1][c])*i,l=(l+Zu[1][c])*i;var o=(s+to[1][7])/(l+Zu[1][7]),u=parseInt(i*16)/16,m=(i-u)*(i+u);return Math.exp(-u*u)*Math.exp(-m)*o}function a(i){var s=1/(i*i),l=to[2][5]*s,c=s,o;for(o=0;o<4;o+=1)l=(l+to[2][o])*s,c=(c+Zu[2][o])*s;var u=s*(l+to[2][4])/(c+Zu[2][4]);u=(SY-u)/i,s=parseInt(i*16)/16;var m=(i-s)*(i+s);return Math.exp(-s*s)*Math.exp(-m)*u}}),DY=.46875,SY=.5641895835477563,to=[[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]],Zu=[[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]],NY=Math.pow(2,53);var FC="zeta",AY=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],Fd=F(FC,AY,e=>{var{typed:r,config:t,multiply:n,pow:a,divide:i,factorial:s,equal:l,smallerEq:c,isNegative:o,gamma:u,sin:m,subtract:d,add:h,Complex:y,BigNumber:v,pi:x}=e;return r(FC,{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,_){return l(S,0)?O(-.5):l(S,1)?O(NaN):isFinite(S)?b(S,O,_,E=>E):o(S)?O(NaN):O(1)}function C(S){return S.re===0&&S.im===0?new y(-.5):S.re===1?new y(NaN,NaN):S.re===1/0&&S.im===0?new y(1):S.im===1/0||S.re===-1/0?new y(NaN,NaN):b(S,O=>O,O=>Math.round(1.3*15+.9*Math.abs(O.im)),O=>O.re)}function b(S,O,_,E){var T=_(S);if(E(S)>-(T-1)/2)return M(S,O(T),O);var R=n(a(2,S),a(O(x),d(S,1)));return R=n(R,m(n(i(O(x),2),S))),R=n(R,u(d(1,S))),n(R,b(d(1,S),O,_,E))}function N(S,O){for(var _=S,E=S;c(E,O);E=h(E,1)){var T=i(n(s(h(O,d(E,1))),a(4,E)),n(s(d(O,E)),s(n(2,E))));_=h(_,T)}return n(O,_)}function M(S,O,_){for(var E=i(1,n(N(_(0),O),d(1,a(2,d(1,S))))),T=_(0),R=_(1);c(R,O);R=h(R,1))T=h(T,i(n((-1)**(R-1),N(R,O)),a(R,S)));return n(E,T)}});var _C="mode",MY=["typed","isNaN","isNumeric"],_d=F(_C,MY,e=>{var{typed:r,isNaN:t,isNumeric:n}=e;return r(_C,{"Array | Matrix":a,"...":function(s){return a(s)}});function a(i){i=gr(i.valueOf());var s=i.length;if(s===0)throw new Error("Cannot calculate mode of an empty array");for(var l={},c=[],o=0,u=0;uo&&(o=l[m],c=[m])}return c}});function Et(e,r,t){var n;return String(e).indexOf("Unexpected type")!==-1?(n=arguments.length>2?" (type: "+Tr(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: "+Tr(t)+", value: "+JSON.stringify(t)+")":"",new TypeError("Cannot calculate "+r+", no ordering relation is defined for complex numbers"+n)):e}var OC="prod",CY=["typed","config","multiplyScalar","numeric"],Od=F(OC,CY,e=>{var{typed:r,config:t,multiplyScalar:n,numeric:a}=e;return r(OC,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(l,c){throw new Error("prod(A, dim) is not yet supported")},"...":function(l){return i(l)}});function i(s){var l;if(An(s,function(c){try{l=l===void 0?c:n(l,c)}catch(o){throw Et(o,"prod",c)}}),typeof l=="string"&&(l=a(l,t.number)),l===void 0)throw new Error("Cannot calculate prod of an empty array");return l}});var BC="format",EY=["typed"],Bd=F(BC,EY,e=>{var{typed:r}=e;return r(BC,{any:lr,"any, Object | function | number | BigNumber":lr})});var PC="bin",TY=["typed","format"],Pd=F(PC,TY,e=>{var{typed:r,format:t}=e;return r(PC,{"number | BigNumber":function(a){return t(a,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(a,i){return t(a,{notation:"bin",wordSize:i})}})});var IC="oct",FY=["typed","format"],Id=F(IC,FY,e=>{var{typed:r,format:t}=e;return r(IC,{"number | BigNumber":function(a){return t(a,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(a,i){return t(a,{notation:"oct",wordSize:i})}})});var RC="hex",_Y=["typed","format"],Rd=F(RC,_Y,e=>{var{typed:r,format:t}=e;return r(RC,{"number | BigNumber":function(a){return t(a,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(a,i){return t(a,{notation:"hex",wordSize:i})}})});var qd=/\\$([\\w.]+)/g;var qC="print",OY=["typed"],Qu=F(qC,OY,e=>{var{typed:r}=e;return r(qC,{"string, Object | Array":kC,"string, Object | Array, number | Object":kC})});function kC(e,r,t){return e.replace(qd,function(n,a){var i=a.split("."),s=r[i.shift()];for(s!==void 0&&s.isMatrix&&(s=s.toArray());i.length&&s!==void 0;){var l=i.shift();s=l?s[l]:s+"."}return s!==void 0?St(s)?s:lr(s,t):n})}var LC="to",BY=["typed","matrix","concat"],kd=F(LC,BY,e=>{var{typed:r,matrix:t,concat:n}=e,a=vr({typed:r,matrix:t,concat:n});return r(LC,{"Unit, Unit | string":(i,s)=>i.to(s)},a({Ds:!0}))});var zC="isPrime",PY=["typed"],Ld=F(zC,PY,e=>{var{typed:r}=e;return r(zC,{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 a=5;a*a<=n;a+=6)if(n%a===0||n%(a+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 a=n.toNumber(),i=5;i*i<=a;i+=6)if(a%i===0||a%(i+2)===0)return!1;return!0}function s(C,b,N){for(var M=1;!b.eq(0);)b.mod(2).eq(0)?(b=b.div(2),C=C.mul(C).mod(N)):(b=b.sub(1),M=C.mul(M).mod(N));return M}var l=n.constructor.clone({precision:n.toFixed(0).length*2});n=new l(n);for(var c=0,o=n.sub(1);o.mod(2).eq(0);)o=o.div(2),c+=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 IY="numeric",RY=["number","?bignumber","?fraction"],zd=F(IY,RY,e=>{var{number:r,bignumber:t,fraction:n}=e,a={string:!0,number:!0,BigNumber:!0,Fraction:!0},i={number:s=>r(s),BigNumber:t?s=>t(s):Hu,Fraction:n?s=>n(s):hd};return function(l){var c=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=Tr(l);if(!(u in a))throw new TypeError("Cannot convert "+l+' of type "'+u+'"; valid input types are '+Object.keys(a).join(", "));if(!(c in i))throw new TypeError("Cannot convert "+l+' to type "'+c+'"; valid output types are '+Object.keys(i).join(", "));return c===u?l:i[c](l)}});var UC="divideScalar",qY=["typed","numeric"],Ud=F(UC,qY,e=>{var{typed:r,numeric:t}=e;return r(UC,{"number, number":function(a,i){return a/i},"Complex, Complex":function(a,i){return a.div(i)},"BigNumber, BigNumber":function(a,i){return a.div(i)},"Fraction, Fraction":function(a,i){return a.div(i)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,a)=>n.divide(a),"number | Fraction | Complex | BigNumber, Unit":(n,a)=>a.divideInto(n)})});var WC="pow",kY=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],Wd=F(WC,kY,e=>{var{typed:r,config:t,identity:n,multiply:a,matrix:i,inv:s,number:l,fraction:c,Complex:o}=e;return r(WC,{"number, number":u,"Complex, Complex":function(y,v){return y.pow(v)},"BigNumber, BigNumber":function(y,v){return v.isInteger()||y>=0||t.predictable?y.pow(v):new o(y.toNumber(),0).pow(v.toNumber(),0)},"Fraction, Fraction":function(y,v){var x=y.pow(v);if(x!=null)return x;if(t.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return u(y.valueOf(),v.valueOf())},"Array, number":m,"Array, BigNumber":function(y,v){return m(y,v.toNumber())},"Matrix, number":d,"Matrix, BigNumber":function(y,v){return d(y,v.toNumber())},"Unit, number | BigNumber":function(y,v){return y.pow(v)}});function u(h,y){if(t.predictable&&!Ze(y)&&h<0)try{var v=c(y),x=l(v);if((y===x||Math.abs((y-x)/y)<1e-14)&&v.d%2===1)return(v.n%2===0?1:-1)*Math.pow(-h,y)}catch{}return t.predictable&&(h<-1&&y===1/0||h>-1&&h<0&&y===-1/0)?NaN:Ze(y)||h>=0||t.predictable?Tw(h,y):h*h<1&&y===1/0||h*h>1&&y===-1/0?0:new o(h,0).pow(y,0)}function m(h,y){if(!Ze(y))throw new TypeError("For A^b, b must be an integer (value is "+y+")");var v=ur(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(y<0)try{return m(s(h),-y)}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 "+y+")"):C}for(var x=n(v[0]).valueOf(),w=h;y>=1;)(y&1)===1&&(x=a(w,x)),y>>=1,w=a(w,w);return x}function d(h,y){return i(m(h.valueOf(),y))}});var Xu="Number of decimals in function round must be an integer",YC="round",LY=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],Yd=F(YC,LY,e=>{var{typed:r,config:t,matrix:n,equalScalar:a,zeros:i,BigNumber:s,DenseMatrix:l}=e,c=jr({typed:r,equalScalar:a}),o=Wr({typed:r,DenseMatrix:l}),u=kt({typed:r});function m(d){return Math.abs(Nu(d).exponent)}return r(YC,{number:function(h){var y=Ou(h,m(t.epsilon)),v=At(h,y,t.epsilon)?y:h;return Ou(v)},"number, number":function(h,y){var v=m(t.epsilon);if(y>=v)return Ou(h,y);var x=Ou(h,v),w=At(h,x,t.epsilon)?x:h;return Ou(w,y)},"number, BigNumber":function(h,y){if(!y.isInteger())throw new TypeError(Xu);return new s(h).toDecimalPlaces(y.toNumber())},Complex:function(h){return h.round()},"Complex, number":function(h,y){if(y%1)throw new TypeError(Xu);return h.round(y)},"Complex, BigNumber":function(h,y){if(!y.isInteger())throw new TypeError(Xu);var v=y.toNumber();return h.round(v)},BigNumber:function(h){var y=new s(h).toDecimalPlaces(m(t.epsilon)),v=$t(h,y,t.epsilon)?y:h;return v.toDecimalPlaces(0)},"BigNumber, BigNumber":function(h,y){if(!y.isInteger())throw new TypeError(Xu);var v=m(t.epsilon);if(y>=v)return h.toDecimalPlaces(y.toNumber());var x=h.toDecimalPlaces(v),w=$t(h,x,t.epsilon)?x:h;return w.toDecimalPlaces(y.toNumber())},Fraction:function(h){return h.round()},"Fraction, number":function(h,y){if(y%1)throw new TypeError(Xu);return h.round(y)},"Fraction, BigNumber":function(h,y){if(!y.isInteger())throw new TypeError(Xu);return h.round(y.toNumber())},"Unit, number, Unit":r.referToSelf(d=>function(h,y,v){var x=h.toNumeric(v);return v.multiply(d(x,y))}),"Unit, BigNumber, Unit":r.referToSelf(d=>(h,y,v)=>d(h,y.toNumber(),v)),"Unit, Unit":r.referToSelf(d=>(h,y)=>d(h,0,y)),"Array | Matrix, number, Unit":r.referToSelf(d=>(h,y,v)=>je(h,x=>d(x,y,v),!0)),"Array | Matrix, BigNumber, Unit":r.referToSelf(d=>(h,y,v)=>d(h,y.toNumber(),v)),"Array | Matrix, Unit":r.referToSelf(d=>(h,y)=>d(h,0,y)),"Array | Matrix":r.referToSelf(d=>h=>je(h,d,!0)),"SparseMatrix, number | BigNumber":r.referToSelf(d=>(h,y)=>c(h,y,d,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(d=>(h,y)=>u(h,y,d,!1)),"Array, number | BigNumber":r.referToSelf(d=>(h,y)=>u(n(h),y,d,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":r.referToSelf(d=>(h,y)=>a(h,0)?i(y.size(),y.storage()):o(y,h,d,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":r.referToSelf(d=>(h,y)=>a(h,0)?i(y.size(),y.storage()):u(y,h,d,!0)),"number | Complex | BigNumber | Fraction, Array":r.referToSelf(d=>(h,y)=>u(n(y),h,d,!0).valueOf())})});var HC="log",zY=["config","typed","divideScalar","Complex"],Hd=F(HC,zY,e=>{var{typed:r,config:t,divideScalar:n,Complex:a}=e;return r(HC,{number:function(s){return s>=0||t.predictable?VM(s):new a(s,0).log()},Complex:function(s){return s.log()},BigNumber:function(s){return!s.isNegative()||t.predictable?s.ln():new a(s.toNumber(),0).log()},"any, any":r.referToSelf(i=>(s,l)=>n(i(s),i(l)))})});var $C="log1p",UY=["typed","config","divideScalar","log","Complex"],$d=F($C,UY,e=>{var{typed:r,config:t,divideScalar:n,log:a,Complex:i}=e;return r($C,{number:function(c){return c>=-1||t.predictable?Am(c):s(new i(c,0))},Complex:s,BigNumber:function(c){var o=c.plus(1);return!o.isNegative()||t.predictable?o.ln():s(new i(c.toNumber(),0))},"Array | Matrix":r.referToSelf(l=>c=>je(c,l)),"any, any":r.referToSelf(l=>(c,o)=>n(l(c),a(o)))});function s(l){var c=l.re+1;return new i(Math.log(Math.sqrt(c*c+l.im*l.im)),Math.atan2(l.im,c))}});var GC="nthRoots",WY=["config","typed","divideScalar","Complex"],Gd=F(GC,WY,e=>{var{typed:r,config:t,divideScalar:n,Complex:a}=e,i=[function(c){return new a(c,0)},function(c){return new a(0,c)},function(c){return new a(-c,0)},function(c){return new a(0,-c)}];function s(l,c){if(c<0)throw new Error("Root must be greater than zero");if(c===0)throw new Error("Root must be non-zero");if(c%1!==0)throw new Error("Root must be an integer");if(l===0||l.abs()===0)return[new a(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 m=l.arg(),d=l.abs(),h=[],y=Math.pow(d,1/c),v=0;v{var{typed:r,equalScalar:t,matrix:n,pow:a,DenseMatrix:i,concat:s}=e,l=lt({typed:r}),c=Zt({typed:r,DenseMatrix:i}),o=jr({typed:r,equalScalar:t}),u=Wr({typed:r,DenseMatrix:i}),m=vr({typed:r,matrix:n,concat:s}),d={};for(var h in a.signatures)Object.prototype.hasOwnProperty.call(a.signatures,h)&&!h.includes("Matrix")&&!h.includes("Array")&&(d[h]=a.signatures[h]);var y=r(d);return r(VC,m({elop:y,SS:c,DS:l,Ss:o,sS:u}))});var ZC="dotDivide",HY=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],Zd=F(ZC,HY,e=>{var{typed:r,matrix:t,equalScalar:n,divideScalar:a,DenseMatrix:i,concat:s}=e,l=Lt({typed:r,equalScalar:n}),c=lt({typed:r}),o=Zt({typed:r,DenseMatrix:i}),u=jr({typed:r,equalScalar:n}),m=Wr({typed:r,DenseMatrix:i}),d=vr({typed:r,matrix:t,concat:s});return r(ZC,d({elop:a,SS:o,DS:c,SD:l,Ss:u,sS:m}))});function Oi(e){var{DenseMatrix:r}=e;return function(n,a,i){var s=n.size();if(s.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+lr(s)+")");var l=s[0],c=s[1];if(l!==c)throw new RangeError("Matrix must be square (size: "+lr(s)+")");var o=[];if(Qe(a)){var u=a.size(),m=a._data;if(u.length===1){if(u[0]!==l)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var d=0;d{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:a,subtractScalar:i,equalScalar:s,DenseMatrix:l}=e,c=Oi({DenseMatrix:l});return r(QC,{"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 y=t(d),v=o(y,h);return v.valueOf()}});function o(m,d){d=c(m,d,!0);for(var h=d._data,y=m._size[0],v=m._size[1],x=[],w=m._data,C=0;CN&&(O.push(x[R]),_.push(L))}if(s(S,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var H=n(M,S),V=0,W=_.length;V{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:a,subtractScalar:i,equalScalar:s,DenseMatrix:l}=e,c=Oi({DenseMatrix:l});return r(XC,{"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 y=t(d),v=o(y,h);return v.valueOf()}});function o(m,d){d=c(m,d,!0);for(var h=d._data,y=m._size[0],v=m._size[1],x=[],w=m._data,C=v-1;C>=0;C--){var b=h[C][0]||0,N=void 0;if(s(b,0))N=0;else{var M=w[C][C];if(s(M,0))throw new Error("Linear system cannot be solved since matrix is singular");N=n(b,M);for(var S=C-1;S>=0;S--)h[S]=[i(h[S][0]||0,a(N,w[S][C]))]}x[C]=[N]}return new l({data:x,size:[y,1]})}function u(m,d){d=c(m,d,!0);for(var h=d._data,y=m._size[0],v=m._size[1],x=m._values,w=m._index,C=m._ptr,b=[],N=v-1;N>=0;N--){var M=h[N][0]||0;if(s(M,0))b[N]=[0];else{for(var S=0,O=[],_=[],E=C[N],T=C[N+1],R=T-1;R>=E;R--){var L=w[R];L===N?S=x[R]:L{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:a,subtractScalar:i,equalScalar:s,DenseMatrix:l}=e,c=Oi({DenseMatrix:l});return r(JC,{"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 y=t(d),v=o(y,h);return v.map(x=>x.valueOf())}});function o(m,d){for(var h=[c(m,d,!0)._data.map(_=>_[0])],y=m._data,v=m._size[0],x=m._size[1],w=0;wnew l({data:_.map(E=>[E]),size:[v,1]}))}function u(m,d){for(var h=[c(m,d,!0)._data.map(le=>le[0])],y=m._size[0],v=m._size[1],x=m._values,w=m._index,C=m._ptr,b=0;bb&&(O.push(x[L]),_.push(H))}if(s(R,0))if(s(S[b],0)){if(M===0){var q=[...S];q[b]=1;for(var K=0,z=_.length;Knew l({data:le.map(ae=>[ae]),size:[y,1]}))}});var KC="usolveAll",ZY=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],Kd=F(KC,ZY,e=>{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:a,subtractScalar:i,equalScalar:s,DenseMatrix:l}=e,c=Oi({DenseMatrix:l});return r(KC,{"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 y=t(d),v=o(y,h);return v.map(x=>x.valueOf())}});function o(m,d){for(var h=[c(m,d,!0)._data.map(_=>_[0])],y=m._data,v=m._size[0],x=m._size[1],w=x-1;w>=0;w--)for(var C=h.length,b=0;b=0;O--)S[O]=i(S[O],y[O][w]);h.push(S)}}else{if(b===0)return[];h.splice(b,1),b-=1,C-=1}else{N[w]=n(N[w],y[w][w]);for(var M=w-1;M>=0;M--)N[M]=i(N[M],a(N[w],y[M][w]))}}return h.map(_=>new l({data:_.map(E=>[E]),size:[v,1]}))}function u(m,d){for(var h=[c(m,d,!0)._data.map(le=>le[0])],y=m._size[0],v=m._size[1],x=m._values,w=m._index,C=m._ptr,b=v-1;b>=0;b--)for(var N=h.length,M=0;M=E;L--){var H=w[L];H===b?R=x[L]:Hnew l({data:le.map(ae=>[ae]),size:[y,1]}))}});var QY="matAlgo08xS0Sid",XY=["typed","equalScalar"],Ju=F(QY,XY,e=>{var{typed:r,equalScalar:t}=e;return function(a,i,s){var l=a._values,c=a._index,o=a._ptr,u=a._size,m=a._datatype||a._data===void 0?a._datatype:a.getDataType(),d=i._values,h=i._index,y=i._ptr,v=i._size,x=i._datatype||i._data===void 0?i._datatype:i.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||!d)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var w=u[0],C=u[1],b,N=t,M=0,S=s;typeof m=="string"&&m===x&&m!=="mixed"&&(b=m,N=r.find(t,[b,b]),M=r.convert(0,b),S=r.find(s,[b,b]));for(var O=[],_=[],E=[],T=[],R=[],L,H,V,W,k=0;k{var{typed:r,matrix:t}=e;return{"Array, number":r.referTo("DenseMatrix, number",n=>(a,i)=>n(t(a),i).valueOf()),"Array, BigNumber":r.referTo("DenseMatrix, BigNumber",n=>(a,i)=>n(t(a),i).valueOf()),"number, Array":r.referTo("number, DenseMatrix",n=>(a,i)=>n(a,t(i)).valueOf()),"BigNumber, Array":r.referTo("BigNumber, DenseMatrix",n=>(a,i)=>n(a,t(i)).valueOf())}});var jC="leftShift",JY=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],jd=F(jC,JY,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,DenseMatrix:i,concat:s}=e,l=Mn({typed:r}),c=Lt({typed:r,equalScalar:n}),o=Ju({typed:r,equalScalar:n}),u=ra({typed:r,DenseMatrix:i}),m=jr({typed:r,equalScalar:n}),d=kt({typed:r}),h=vr({typed:r,matrix:t,concat:s}),y=Ku({typed:r,matrix:t});return r(jC,{"number, number":Pw,"BigNumber, BigNumber":Y2,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(x,w)=>n(w,0)?x.clone():m(x,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(x,w)=>n(w,0)?x.clone():d(x,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(x,w)=>n(x,0)?a(w.size(),w.storage()):u(w,x,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(x,w)=>n(x,0)?a(w.size(),w.storage()):d(w,x,v,!0))},y,h({SS:o,DS:l,SD:c}))});var eE="rightArithShift",KY=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],eh=F(eE,KY,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,DenseMatrix:i,concat:s}=e,l=Mn({typed:r}),c=Lt({typed:r,equalScalar:n}),o=Ju({typed:r,equalScalar:n}),u=ra({typed:r,DenseMatrix:i}),m=jr({typed:r,equalScalar:n}),d=kt({typed:r}),h=vr({typed:r,matrix:t,concat:s}),y=Ku({typed:r,matrix:t});return r(eE,{"number, number":Iw,"BigNumber, BigNumber":H2,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(x,w)=>n(w,0)?x.clone():m(x,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(x,w)=>n(w,0)?x.clone():d(x,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(x,w)=>n(x,0)?a(w.size(),w.storage()):u(w,x,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(x,w)=>n(x,0)?a(w.size(),w.storage()):d(w,x,v,!0))},y,h({SS:o,DS:l,SD:c}))});var rE="rightLogShift",jY=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],rh=F(rE,jY,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,DenseMatrix:i,concat:s}=e,l=Mn({typed:r}),c=Lt({typed:r,equalScalar:n}),o=Ju({typed:r,equalScalar:n}),u=ra({typed:r,DenseMatrix:i}),m=jr({typed:r,equalScalar:n}),d=kt({typed:r}),h=vr({typed:r,matrix:t,concat:s}),y=Ku({typed:r,matrix:t});return r(rE,{"number, number":Rw,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(x,w)=>n(w,0)?x.clone():m(x,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(x,w)=>n(w,0)?x.clone():d(x,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(x,w)=>n(x,0)?a(w.size(),w.storage()):u(w,x,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(x,w)=>n(x,0)?a(w.size(),w.storage()):d(w,x,v,!0))},y,h({SS:o,DS:l,SD:c}))});var tE="and",eH=["typed","matrix","equalScalar","zeros","not","concat"],ju=F(tE,eH,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s}=e,l=Lt({typed:r,equalScalar:n}),c=Uo({typed:r,equalScalar:n}),o=jr({typed:r,equalScalar:n}),u=kt({typed:r}),m=vr({typed:r,matrix:t,concat:s});return r(tE,{"number, number":Ww,"Complex, Complex":function(h,y){return(h.re!==0||h.im!==0)&&(y.re!==0||y.im!==0)},"BigNumber, BigNumber":function(h,y){return!h.isZero()&&!y.isZero()&&!h.isNaN()&&!y.isNaN()},"Unit, Unit":r.referToSelf(d=>(h,y)=>d(h.value||0,y.value||0)),"SparseMatrix, any":r.referToSelf(d=>(h,y)=>i(y)?a(h.size(),h.storage()):o(h,y,d,!1)),"DenseMatrix, any":r.referToSelf(d=>(h,y)=>i(y)?a(h.size(),h.storage()):u(h,y,d,!1)),"any, SparseMatrix":r.referToSelf(d=>(h,y)=>i(h)?a(h.size(),h.storage()):o(y,h,d,!0)),"any, DenseMatrix":r.referToSelf(d=>(h,y)=>i(h)?a(h.size(),h.storage()):u(y,h,d,!0)),"Array, any":r.referToSelf(d=>(h,y)=>d(t(h),y).valueOf()),"any, Array":r.referToSelf(d=>(h,y)=>d(h,t(y)).valueOf())},m({SS:c,DS:l}))});var th="compare",rH=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],nh=F(th,rH,e=>{var{typed:r,config:t,equalScalar:n,matrix:a,BigNumber:i,Fraction:s,DenseMatrix:l,concat:c}=e,o=lt({typed:r}),u=zo({typed:r,equalScalar:n}),m=Wr({typed:r,DenseMatrix:l}),d=vr({typed:r,matrix:a,concat:c}),h=Ia({typed:r});return r(th,tH({typed:r,config:t}),{"boolean, boolean":function(v,x){return v===x?0:v>x?1:-1},"BigNumber, BigNumber":function(v,x){return $t(v,x,t.epsilon)?new i(0):new i(v.cmp(x))},"Fraction, Fraction":function(v,x){return new s(v.compare(x))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},h,d({SS:u,DS:o,Ss:m}))}),tH=F(th,["typed","config"],e=>{var{typed:r,config:t}=e;return r(th,{"number, number":function(a,i){return At(a,i,t.epsilon)?0:a>i?1:-1}})});var _s=ma(aE(),1);var iE="compareNatural",nH=["typed","compare"],ah=F(iE,nH,e=>{var{typed:r,compare:t}=e,n=t.signatures["boolean,boolean"];return r(iE,{"any, any":a});function a(c,o){var u=Tr(c),m=Tr(o),d;if((u==="number"||u==="BigNumber"||u==="Fraction")&&(m==="number"||m==="BigNumber"||m==="Fraction"))return d=t(c,o),d.toString()!=="0"?d>0?1:-1:(0,_s.default)(u,m);var h=["Array","DenseMatrix","SparseMatrix"];if(h.includes(u)||h.includes(m))return d=i(a,c,o),d!==0?d:(0,_s.default)(u,m);if(u!==m)return(0,_s.default)(u,m);if(u==="Complex")return aH(c,o);if(u==="Unit")return c.equalBase(o)?a(c.value,o.value):s(a,c.formatUnits(),o.formatUnits());if(u==="boolean")return n(c,o);if(u==="string")return(0,_s.default)(c,o);if(u==="Object")return l(a,c,o);if(u==="null"||u==="undefined")return 0;throw new TypeError('Unsupported type of value "'+u+'"')}function i(c,o,u){return ha(o)&&ha(u)?s(c,o.toJSON().values,u.toJSON().values):ha(o)?i(c,o.toArray(),u):ha(u)?i(c,o,u.toArray()):Ji(o)?i(c,o.toJSON().data,u):Ji(u)?i(c,o,u.toJSON().data):Array.isArray(o)?Array.isArray(u)?s(c,o,u):i(c,o,[u]):i(c,[o],u)}function s(c,o,u){for(var m=0,d=Math.min(o.length,u.length);mu.length?1:o.lengthr.re?1:e.rer.im?1:e.im{var{typed:r,matrix:t,concat:n}=e,a=vr({typed:r,matrix:t,concat:n});return r(oE,Tm,a({elop:Tm,Ds:!0}))});var oh="equal",oH=["typed","matrix","equalScalar","DenseMatrix","concat"],sh=F(oh,oH,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=e,s=lt({typed:r}),l=Zt({typed:r,DenseMatrix:a}),c=Wr({typed:r,DenseMatrix:a}),o=vr({typed:r,matrix:t,concat:i});return r(oh,sH({typed:r,equalScalar:n}),o({elop:n,SS:l,DS:s,Ss:c}))}),sH=F(oh,["typed","equalScalar"],e=>{var{typed:r,equalScalar:t}=e;return r(oh,{"any, any":function(a,i){return a===null?i===null:i===null?a===null:a===void 0?i===void 0:i===void 0?a===void 0:t(a,i)}})});var sE="equalText",uH=["typed","compareText","isZero"],uh=F(sE,uH,e=>{var{typed:r,compareText:t,isZero:n}=e;return r(sE,{"any, any":function(i,s){return n(t(i,s))}})});var fh="smaller",fH=["typed","config","matrix","DenseMatrix","concat"],ch=F(fh,fH,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:a,concat:i}=e,s=lt({typed:r}),l=Zt({typed:r,DenseMatrix:a}),c=Wr({typed:r,DenseMatrix:a}),o=vr({typed:r,matrix:n,concat:i}),u=Ia({typed:r});return r(fh,cH({typed:r,config:t}),{"boolean, boolean":(m,d)=>mm.compare(d)===-1,"Complex, Complex":function(d,h){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:l,DS:s,Ss:c}))}),cH=F(fh,["typed","config"],e=>{var{typed:r,config:t}=e;return r(fh,{"number, number":function(a,i){return a{var{typed:r,config:t,matrix:n,DenseMatrix:a,concat:i}=e,s=lt({typed:r}),l=Zt({typed:r,DenseMatrix:a}),c=Wr({typed:r,DenseMatrix:a}),o=vr({typed:r,matrix:n,concat:i}),u=Ia({typed:r});return r(lh,mH({typed:r,config:t}),{"boolean, boolean":(m,d)=>m<=d,"BigNumber, BigNumber":function(d,h){return d.lte(h)||$t(d,h,t.epsilon)},"Fraction, Fraction":(m,d)=>m.compare(d)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:l,DS:s,Ss:c}))}),mH=F(lh,["typed","config"],e=>{var{typed:r,config:t}=e;return r(lh,{"number, number":function(a,i){return a<=i||At(a,i,t.epsilon)}})});var ph="larger",pH=["typed","config","matrix","DenseMatrix","concat"],dh=F(ph,pH,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:a,concat:i}=e,s=lt({typed:r}),l=Zt({typed:r,DenseMatrix:a}),c=Wr({typed:r,DenseMatrix:a}),o=vr({typed:r,matrix:n,concat:i}),u=Ia({typed:r});return r(ph,dH({typed:r,config:t}),{"boolean, boolean":(m,d)=>m>d,"BigNumber, BigNumber":function(d,h){return d.gt(h)&&!$t(d,h,t.epsilon)},"Fraction, Fraction":(m,d)=>m.compare(d)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:l,DS:s,Ss:c}))}),dH=F(ph,["typed","config"],e=>{var{typed:r,config:t}=e;return r(ph,{"number, number":function(a,i){return a>i&&!At(a,i,t.epsilon)}})});var hh="largerEq",hH=["typed","config","matrix","DenseMatrix","concat"],vh=F(hh,hH,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:a,concat:i}=e,s=lt({typed:r}),l=Zt({typed:r,DenseMatrix:a}),c=Wr({typed:r,DenseMatrix:a}),o=vr({typed:r,matrix:n,concat:i}),u=Ia({typed:r});return r(hh,vH({typed:r,config:t}),{"boolean, boolean":(m,d)=>m>=d,"BigNumber, BigNumber":function(d,h){return d.gte(h)||$t(d,h,t.epsilon)},"Fraction, Fraction":(m,d)=>m.compare(d)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:l,DS:s,Ss:c}))}),vH=F(hh,["typed","config"],e=>{var{typed:r,config:t}=e;return r(hh,{"number, number":function(a,i){return a>=i||At(a,i,t.epsilon)}})});var uE="deepEqual",gH=["typed","equal"],gh=F(uE,gH,e=>{var{typed:r,equal:t}=e;return r(uE,{"any, any":function(i,s){return n(i.valueOf(),s.valueOf())}});function n(a,i){if(Array.isArray(a))if(Array.isArray(i)){var s=a.length;if(s!==i.length)return!1;for(var l=0;l{var{typed:r,config:t,equalScalar:n,matrix:a,DenseMatrix:i,concat:s}=e,l=lt({typed:r}),c=Zt({typed:r,DenseMatrix:i}),o=Wr({typed:r,DenseMatrix:i}),u=vr({typed:r,matrix:a,concat:s});return r(yh,xH({typed:r,equalScalar:n}),u({elop:m,SS:c,DS:l,Ss:o}));function m(d,h){return!n(d,h)}}),xH=F(yh,["typed","equalScalar"],e=>{var{typed:r,equalScalar:t}=e;return r(yh,{"any, any":function(a,i){return a===null?i!==null:i===null?a!==null:a===void 0?i!==void 0:i===void 0?a!==void 0:!t(a,i)}})});var fE="partitionSelect",bH=["typed","isNumeric","isNaN","compare"],bh=F(fE,bH,e=>{var{typed:r,isNumeric:t,isNaN:n,compare:a}=e,i=a,s=(o,u)=>-a(o,u);return r(fE,{"Array | Matrix, number":function(u,m){return l(u,m,i)},"Array | Matrix, number, string":function(u,m,d){if(d==="asc")return l(u,m,i);if(d==="desc")return l(u,m,s);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":l});function l(o,u,m){if(!Ze(u)||u<0)throw new Error("k must be a non-negative integer");if(Qe(o)){var d=o.size();if(d.length>1)throw new Error("Only one dimensional matrices supported");return c(o.valueOf(),u,m)}if(Array.isArray(o))return c(o,u,m)}function c(o,u,m){if(u>=o.length)throw new Error("k out of bounds");for(var d=0;d=0){var C=o[x];o[x]=o[v],o[v]=C,--x}else++v;m(o[v],w)>0&&--v,u<=v?y=v:h=v+1}return o[u]}});var cE="sort",wH=["typed","matrix","compare","compareNatural"],wh=F(cE,wH,e=>{var{typed:r,matrix:t,compare:n,compareNatural:a}=e,i=n,s=(u,m)=>-n(u,m);return r(cE,{Array:function(m){return c(m),m.sort(i)},Matrix:function(m){return o(m),t(m.toArray().sort(i),m.storage())},"Array, function":function(m,d){return c(m),m.sort(d)},"Matrix, function":function(m,d){return o(m),t(m.toArray().sort(d),m.storage())},"Array, string":function(m,d){return c(m),m.sort(l(d))},"Matrix, string":function(m,d){return o(m),t(m.toArray().sort(l(d)),m.storage())}});function l(u){if(u==="asc")return i;if(u==="desc")return s;if(u==="natural")return a;throw new Error('String "asc", "desc", or "natural" expected')}function c(u){if(ur(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 lE="max",DH=["typed","config","numeric","larger"],ef=F(lE,DH,e=>{var{typed:r,config:t,numeric:n,larger:a}=e;return r(lE,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(c,o){return ko(c,o.valueOf(),i)},"...":function(c){if(Pa(c))throw new TypeError("Scalar values expected in function max");return s(c)}});function i(l,c){try{return a(l,c)?l:c}catch(o){throw Et(o,"max",c)}}function s(l){var c;if(An(l,function(o){try{isNaN(o)&&typeof o=="number"?c=NaN:(c===void 0||a(o,c))&&(c=o)}catch(u){throw Et(u,"max",o)}}),c===void 0)throw new Error("Cannot calculate max of an empty array");return typeof c=="string"&&(c=n(c,t.number)),c}});var mE="min",SH=["typed","config","numeric","smaller"],rf=F(mE,SH,e=>{var{typed:r,config:t,numeric:n,smaller:a}=e;return r(mE,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(c,o){return ko(c,o.valueOf(),i)},"...":function(c){if(Pa(c))throw new TypeError("Scalar values expected in function min");return s(c)}});function i(l,c){try{return a(l,c)?l:c}catch(o){throw Et(o,"min",c)}}function s(l){var c;if(An(l,function(o){try{isNaN(o)&&typeof o=="number"?c=NaN:(c===void 0||a(o,c))&&(c=o)}catch(u){throw Et(u,"min",o)}}),c===void 0)throw new Error("Cannot calculate min of an empty array");return typeof c=="string"&&(c=n(c,t.number)),c}});var NH="ImmutableDenseMatrix",AH=["smaller","DenseMatrix"],Dh=F(NH,AH,e=>{var{smaller:r,DenseMatrix:t}=e;function n(a,i){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(i&&!St(i))throw new Error("Invalid datatype: "+i);if(Qe(a)||Mr(a)){var s=new t(a,i);this._data=s._data,this._size=s._size,this._datatype=s._datatype,this._min=null,this._max=null}else if(a&&Mr(a.data)&&Mr(a.size))this._data=a.data,this._size=a.size,this._datatype=a.datatype,this._min=typeof a.min<"u"?a.min:null,this._max=typeof a.max<"u"?a.max:null;else{if(a)throw new TypeError("Unsupported type of data ("+Tr(a)+")");this._data=[],this._size=[0],this._datatype=i,this._min=null,this._max=null}}return n.prototype=new t,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(a){switch(arguments.length){case 1:{var i=t.prototype.subset.call(this,a);return Qe(i)?new n({data:i._data,size:i._size,datatype:i._datatype}):i}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:ar(this._data),size:ar(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(a){return new n(a)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var a=null;this.forEach(function(i){(a===null||r(i,a))&&(a=i)}),this._min=a!==null?a:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var a=null;this.forEach(function(i){(a===null||r(a,i))&&(a=i)}),this._max=a!==null?a:void 0}return this._max},n},{isClass:!0});var MH="Index",CH=["ImmutableDenseMatrix","getMatrixDataType"],Sh=F(MH,CH,e=>{var{ImmutableDenseMatrix:r,getMatrixDataType:t}=e;function n(i){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 EH="FibonacciHeap",TH=["smaller","larger"],Nh=F(EH,TH,e=>{var{smaller:r,larger:t}=e,n=1/Math.log((1+Math.sqrt(5))/2);function a(){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}a.prototype.type="FibonacciHeap",a.prototype.isFibonacciHeap=!0,a.prototype.insert=function(u,m){var d={key:u,value:m,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},a.prototype.size=function(){return this._size},a.prototype.clear=function(){this._minimum=null,this._size=0},a.prototype.isEmpty=function(){return this._size===0},a.prototype.extractMinimum=function(){var u=this._minimum;if(u===null)return u;for(var m=this._minimum,d=u.degree,h=u.child;d>0;){var y=h.right;h.left.right=h.right,h.right.left=h.left,h.left=m,h.right=m.right,m.right=h,h.right.left=h,h.parent=null,h=y,d--}return u.left.right=u.right,u.right.left=u.left,u===u.right?m=null:(m=u.right,m=o(m,this._size)),this._size--,this._minimum=m,u},a.prototype.remove=function(u){this._minimum=i(this._minimum,u,-1),this.extractMinimum()};function i(u,m,d){m.key=d;var h=m.parent;return h&&r(m.key,h.key)&&(s(u,m,h),l(u,h)),r(m.key,u.key)&&(u=m),u}function s(u,m,d){m.left.right=m.right,m.right.left=m.left,d.degree--,d.child===m&&(d.child=m.right),d.degree===0&&(d.child=null),m.left=u,m.right=u.right,u.right=m,m.right.left=m,m.parent=null,m.mark=!1}function l(u,m){var d=m.parent;!d||(m.mark?(s(u,m,d),l(d)):m.mark=!0)}var c=function(m,d){m.left.right=m.right,m.right.left=m.left,m.parent=d,d.child?(m.left=d.child,m.right=d.child.right,d.child.right=m,m.right.left=m):(d.child=m,m.right=m,m.left=m),d.degree++,m.mark=!1};function o(u,m){var d=Math.floor(Math.log(m)*n)+1,h=new Array(d),y=0,v=u;if(v)for(y++,v=v.right;v!==u;)y++,v=v.right;for(var x;y>0;){for(var w=v.degree,C=v.right;x=h[w],!!x;){if(t(v.key,x.key)){var b=x;x=v,v=b}c(x,v),h[w]=null,w++}h[w]=v,v=C,y--}u=null;for(var N=0;N{var{addScalar:r,equalScalar:t,FibonacciHeap:n}=e;function a(){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return a.prototype.type="Spa",a.prototype.isSpa=!0,a.prototype.set=function(i,s){if(this._values[i])this._values[i].value=s;else{var l=this._heap.insert(i,s);this._values[i]=l}},a.prototype.get=function(i){var s=this._values[i];return s?s.value:0},a.prototype.accumulate=function(i,s){var l=this._values[i];l?l.value=r(l.value,s):(l=this._heap.insert(i,s),this._values[i]=l)},a.prototype.forEach=function(i,s,l){var c=this._heap,o=this._values,u=[],m=c.extractMinimum();for(m&&u.push(m);m&&m.key<=s;)m.key>=i&&(t(m.value,0)||l(m.key,m.value,this)),m=c.extractMinimum(),m&&u.push(m);for(var d=0;d{var{on:r,config:t,addScalar:n,subtractScalar:a,multiplyScalar:i,divideScalar:s,pow:l,abs:c,fix:o,round:u,equal:m,isNumeric:d,format:h,number:y,Complex:v,BigNumber:x,Fraction:w}=e,C=y;function b(J,re){if(!(this instanceof b))throw new Error("Constructor must be called with the new operator");if(!(J==null||d(J)||Kt(J)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,re===void 0)this.units=[],this.dimensions=K.map(j=>0);else if(typeof re=="string"){var xe=b.parse(re);this.units=xe.units,this.dimensions=xe.dimensions}else if(Ht(re)&&re.value===null)this.fixPrefix=re.fixPrefix,this.skipAutomaticSimplification=re.skipAutomaticSimplification,this.dimensions=re.dimensions.slice(0),this.units=re.units.map(j=>ht({},j));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(J)}Object.defineProperty(b,"name",{value:"Unit"}),b.prototype.constructor=b,b.prototype.type="Unit",b.prototype.isUnit=!0;var N,M,S;function O(){for(;S===" "||S===" ";)T()}function _(J){return J>="0"&&J<="9"||J==="."}function E(J){return J>="0"&&J<="9"}function T(){M++,S=N.charAt(M)}function R(J){M=J,S=N.charAt(M)}function L(){var J="",re=M;if(S==="+"?T():S==="-"&&(J+=S,T()),!_(S))return R(re),null;if(S==="."){if(J+=S,T(),!E(S))return R(re),null}else{for(;E(S);)J+=S,T();S==="."&&(J+=S,T())}for(;E(S);)J+=S,T();if(S==="E"||S==="e"){var xe="",j=M;if(xe+=S,T(),(S==="+"||S==="-")&&(xe+=S,T()),!E(S))return R(j),J;for(J=J+xe;E(S);)J+=S,T()}return J}function H(){for(var J="";E(S)||b.isValidAlpha(S);)J+=S,T();var re=J.charAt(0);return b.isValidAlpha(re)?J:null}function V(J){return S===J?(T(),J):null}b.parse=function(J,re){if(re=re||{},N=J,M=-1,S="",typeof N!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var xe=new b;xe.units=[];var j=1,ne=!1;T(),O();var ue=L(),Me=null;if(ue){if(t.number==="BigNumber")Me=new x(ue);else if(t.number==="Fraction")try{Me=new w(ue)}catch{Me=parseFloat(ue)}else Me=parseFloat(ue);O(),V("*")?(j=1,ne=!0):V("/")&&(j=-1,ne=!0)}for(var Ce=[],Le=1;;){for(O();S==="(";)Ce.push(j),Le*=j,j=1,T(),O();var Ie=void 0;if(S){var fr=S;if(Ie=H(),Ie===null)throw new SyntaxError('Unexpected "'+fr+'" in "'+N+'" at index '+M.toString())}else break;var or=W(Ie);if(or===null)throw new SyntaxError('Unit "'+Ie+'" not found.');var Ke=j*Le;if(O(),V("^")){O();var Pr=L();if(Pr===null)throw new SyntaxError('In "'+J+'", "^" must be followed by a floating-point number');Ke*=Pr}xe.units.push({unit:or.unit,prefix:or.prefix,power:Ke});for(var ee=0;ee1||Math.abs(this.units[0].power-1)>1e-15},b.prototype._normalize=function(J){if(J==null||this.units.length===0)return J;for(var re=J,xe=b._getNumberConverter(Tr(J)),j=0;j{if(Xe($,J)){var re=$[J],xe=re.prefixes[""];return{unit:re,prefix:xe}}for(var j in $)if(Xe($,j)&&mM(J,j)){var ne=$[j],ue=J.length-j.length,Me=J.substring(0,ue),Ce=Xe(ne.prefixes,Me)?ne.prefixes[Me]:void 0;if(Ce!==void 0)return{unit:ne,prefix:Ce}}return null},{hasher:J=>J[0],limit:100});b.isValuelessUnit=function(J){return W(J)!==null},b.prototype.hasBase=function(J){if(typeof J=="string"&&(J=z[J]),!J)return!1;for(var re=0;re1e-12)return!1;return!0},b.prototype.equalBase=function(J){for(var re=0;re1e-12)return!1;return!0},b.prototype.equals=function(J){return this.equalBase(J)&&m(this.value,J.value)},b.prototype.multiply=function(J){for(var re=this.clone(),xe=Ht(J)?J:new b(J),j=0;j1e-12&&(Xe(ge,Ce)?re.push({unit:ge[Ce].unit,prefix:ge[Ce].prefix,power:J.dimensions[Me]||0}):ue=!0)}re.length1e-12)if(Xe(pe.si,j))re.push({unit:pe.si[j].unit,prefix:pe.si[j].prefix,power:J.dimensions[xe]||0});else throw new Error("Cannot express custom unit "+j+" in SI units")}return J.units=re,J.fixPrefix=!0,J.skipAutomaticSimplification=!0,this.value!==null?(J.value=null,this.to(J)):J},b.prototype.formatUnits=function(){for(var J="",re="",xe=0,j=0,ne=0;ne0?(xe++,J+=" "+this.units[ne].prefix.name+this.units[ne].unit.name,Math.abs(this.units[ne].power-1)>1e-15&&(J+="^"+this.units[ne].power)):this.units[ne].power<0&&j++;if(j>0)for(var ue=0;ue0?(re+=" "+this.units[ue].prefix.name+this.units[ue].unit.name,Math.abs(this.units[ue].power+1)>1e-15&&(re+="^"+-this.units[ue].power)):(re+=" "+this.units[ue].prefix.name+this.units[ue].unit.name,re+="^"+this.units[ue].power));J=J.substr(1),re=re.substr(1),xe>1&&j>0&&(J="("+J+")"),j>1&&xe>0&&(re="("+re+")");var Me=J;return xe>0&&j>0&&(Me+=" / "),Me+=re,Me},b.prototype.format=function(J){var re=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),xe=!1;typeof re.value<"u"&&re.value!==null&&Kt(re.value)&&(xe=Math.abs(re.value.re)<1e-14);for(var j in re.units)Xe(re.units,j)&&re.units[j].unit&&(re.units[j].unit.name==="VA"&&xe?re.units[j].unit=$.VAR:re.units[j].unit.name==="VAR"&&!xe&&(re.units[j].unit=$.VA));re.units.length===1&&!re.fixPrefix&&Math.abs(re.units[0].power-Math.round(re.units[0].power))<1e-14&&(re.units[0].prefix=re._bestPrefix());var ne=re._denormalize(re.value),ue=re.value!==null?h(ne,J||{}):"",Me=re.formatUnits();return re.value&&Kt(re.value)&&(ue="("+ue+")"),Me.length>0&&ue.length>0&&(ue+=" "),ue+=Me,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 J=this.value!==null?c(this.value):0,re=c(this.units[0].unit.value),xe=this.units[0].prefix;if(J===0)return xe;var j=this.units[0].power,ne=Math.log(J/Math.pow(xe.value*re,j))/Math.LN10-1.2;if(ne>-2.200001&&ne<1.800001)return xe;ne=Math.abs(ne);var ue=this.units[0].unit.prefixes;for(var Me in ue)if(Xe(ue,Me)){var Ce=ue[Me];if(Ce.scientific){var Le=Math.abs(Math.log(J/Math.pow(Ce.value*re,j))/Math.LN10-1.2);(Le0)},$={meter:{name:"meter",base:z.LENGTH,prefixes:q.LONG,value:1,offset:0},inch:{name:"inch",base:z.LENGTH,prefixes:q.NONE,value:.0254,offset:0},foot:{name:"foot",base:z.LENGTH,prefixes:q.NONE,value:.3048,offset:0},yard:{name:"yard",base:z.LENGTH,prefixes:q.NONE,value:.9144,offset:0},mile:{name:"mile",base:z.LENGTH,prefixes:q.NONE,value:1609.344,offset:0},link:{name:"link",base:z.LENGTH,prefixes:q.NONE,value:.201168,offset:0},rod:{name:"rod",base:z.LENGTH,prefixes:q.NONE,value:5.0292,offset:0},chain:{name:"chain",base:z.LENGTH,prefixes:q.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:z.LENGTH,prefixes:q.NONE,value:1e-10,offset:0},m:{name:"m",base:z.LENGTH,prefixes:q.SHORT,value:1,offset:0},in:{name:"in",base:z.LENGTH,prefixes:q.NONE,value:.0254,offset:0},ft:{name:"ft",base:z.LENGTH,prefixes:q.NONE,value:.3048,offset:0},yd:{name:"yd",base:z.LENGTH,prefixes:q.NONE,value:.9144,offset:0},mi:{name:"mi",base:z.LENGTH,prefixes:q.NONE,value:1609.344,offset:0},li:{name:"li",base:z.LENGTH,prefixes:q.NONE,value:.201168,offset:0},rd:{name:"rd",base:z.LENGTH,prefixes:q.NONE,value:5.02921,offset:0},ch:{name:"ch",base:z.LENGTH,prefixes:q.NONE,value:20.1168,offset:0},mil:{name:"mil",base:z.LENGTH,prefixes:q.NONE,value:254e-7,offset:0},m2:{name:"m2",base:z.SURFACE,prefixes:q.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:z.SURFACE,prefixes:q.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:z.SURFACE,prefixes:q.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:z.SURFACE,prefixes:q.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:z.SURFACE,prefixes:q.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:z.SURFACE,prefixes:q.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:z.SURFACE,prefixes:q.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:z.SURFACE,prefixes:q.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:z.SURFACE,prefixes:q.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:z.SURFACE,prefixes:q.NONE,value:1e4,offset:0},m3:{name:"m3",base:z.VOLUME,prefixes:q.CUBIC,value:1,offset:0},L:{name:"L",base:z.VOLUME,prefixes:q.SHORT,value:.001,offset:0},l:{name:"l",base:z.VOLUME,prefixes:q.SHORT,value:.001,offset:0},litre:{name:"litre",base:z.VOLUME,prefixes:q.LONG,value:.001,offset:0},cuin:{name:"cuin",base:z.VOLUME,prefixes:q.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:z.VOLUME,prefixes:q.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:z.VOLUME,prefixes:q.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:z.VOLUME,prefixes:q.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:z.VOLUME,prefixes:q.NONE,value:15e-6,offset:0},drop:{name:"drop",base:z.VOLUME,prefixes:q.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:z.VOLUME,prefixes:q.NONE,value:5e-8,offset:0},minim:{name:"minim",base:z.VOLUME,prefixes:q.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:z.VOLUME,prefixes:q.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:z.VOLUME,prefixes:q.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:z.VOLUME,prefixes:q.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:z.VOLUME,prefixes:q.NONE,value:1e-6,offset:0},cup:{name:"cup",base:z.VOLUME,prefixes:q.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:z.VOLUME,prefixes:q.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:z.VOLUME,prefixes:q.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:z.VOLUME,prefixes:q.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:z.VOLUME,prefixes:q.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:z.VOLUME,prefixes:q.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:z.VOLUME,prefixes:q.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:z.VOLUME,prefixes:q.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:z.VOLUME,prefixes:q.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:z.VOLUME,prefixes:q.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:z.VOLUME,prefixes:q.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:z.VOLUME,prefixes:q.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:z.VOLUME,prefixes:q.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:z.VOLUME,prefixes:q.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:z.VOLUME,prefixes:q.NONE,value:.1173478,offset:0},obl:{name:"obl",base:z.VOLUME,prefixes:q.NONE,value:.1589873,offset:0},g:{name:"g",base:z.MASS,prefixes:q.SHORT,value:.001,offset:0},gram:{name:"gram",base:z.MASS,prefixes:q.LONG,value:.001,offset:0},ton:{name:"ton",base:z.MASS,prefixes:q.SHORT,value:907.18474,offset:0},t:{name:"t",base:z.MASS,prefixes:q.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:z.MASS,prefixes:q.LONG,value:1e3,offset:0},grain:{name:"grain",base:z.MASS,prefixes:q.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:z.MASS,prefixes:q.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:z.MASS,prefixes:q.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:z.MASS,prefixes:q.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:z.MASS,prefixes:q.NONE,value:45.359237,offset:0},stick:{name:"stick",base:z.MASS,prefixes:q.NONE,value:.115,offset:0},stone:{name:"stone",base:z.MASS,prefixes:q.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:z.MASS,prefixes:q.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:z.MASS,prefixes:q.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:z.MASS,prefixes:q.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:z.MASS,prefixes:q.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:z.MASS,prefixes:q.NONE,value:45.359237,offset:0},s:{name:"s",base:z.TIME,prefixes:q.SHORT,value:1,offset:0},min:{name:"min",base:z.TIME,prefixes:q.NONE,value:60,offset:0},h:{name:"h",base:z.TIME,prefixes:q.NONE,value:3600,offset:0},second:{name:"second",base:z.TIME,prefixes:q.LONG,value:1,offset:0},sec:{name:"sec",base:z.TIME,prefixes:q.LONG,value:1,offset:0},minute:{name:"minute",base:z.TIME,prefixes:q.NONE,value:60,offset:0},hour:{name:"hour",base:z.TIME,prefixes:q.NONE,value:3600,offset:0},day:{name:"day",base:z.TIME,prefixes:q.NONE,value:86400,offset:0},week:{name:"week",base:z.TIME,prefixes:q.NONE,value:7*86400,offset:0},month:{name:"month",base:z.TIME,prefixes:q.NONE,value:2629800,offset:0},year:{name:"year",base:z.TIME,prefixes:q.NONE,value:31557600,offset:0},decade:{name:"decade",base:z.TIME,prefixes:q.NONE,value:315576e3,offset:0},century:{name:"century",base:z.TIME,prefixes:q.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:z.TIME,prefixes:q.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:z.FREQUENCY,prefixes:q.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:z.FREQUENCY,prefixes:q.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:z.ANGLE,prefixes:q.SHORT,value:1,offset:0},radian:{name:"radian",base:z.ANGLE,prefixes:q.LONG,value:1,offset:0},deg:{name:"deg",base:z.ANGLE,prefixes:q.SHORT,value:null,offset:0},degree:{name:"degree",base:z.ANGLE,prefixes:q.LONG,value:null,offset:0},grad:{name:"grad",base:z.ANGLE,prefixes:q.SHORT,value:null,offset:0},gradian:{name:"gradian",base:z.ANGLE,prefixes:q.LONG,value:null,offset:0},cycle:{name:"cycle",base:z.ANGLE,prefixes:q.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:z.ANGLE,prefixes:q.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:z.ANGLE,prefixes:q.NONE,value:null,offset:0},A:{name:"A",base:z.CURRENT,prefixes:q.SHORT,value:1,offset:0},ampere:{name:"ampere",base:z.CURRENT,prefixes:q.LONG,value:1,offset:0},K:{name:"K",base:z.TEMPERATURE,prefixes:q.SHORT,value:1,offset:0},degC:{name:"degC",base:z.TEMPERATURE,prefixes:q.SHORT,value:1,offset:273.15},degF:{name:"degF",base:z.TEMPERATURE,prefixes:q.SHORT,value:new w(5,9),offset:459.67},degR:{name:"degR",base:z.TEMPERATURE,prefixes:q.SHORT,value:new w(5,9),offset:0},kelvin:{name:"kelvin",base:z.TEMPERATURE,prefixes:q.LONG,value:1,offset:0},celsius:{name:"celsius",base:z.TEMPERATURE,prefixes:q.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:z.TEMPERATURE,prefixes:q.LONG,value:new w(5,9),offset:459.67},rankine:{name:"rankine",base:z.TEMPERATURE,prefixes:q.LONG,value:new w(5,9),offset:0},mol:{name:"mol",base:z.AMOUNT_OF_SUBSTANCE,prefixes:q.SHORT,value:1,offset:0},mole:{name:"mole",base:z.AMOUNT_OF_SUBSTANCE,prefixes:q.LONG,value:1,offset:0},cd:{name:"cd",base:z.LUMINOUS_INTENSITY,prefixes:q.SHORT,value:1,offset:0},candela:{name:"candela",base:z.LUMINOUS_INTENSITY,prefixes:q.LONG,value:1,offset:0},N:{name:"N",base:z.FORCE,prefixes:q.SHORT,value:1,offset:0},newton:{name:"newton",base:z.FORCE,prefixes:q.LONG,value:1,offset:0},dyn:{name:"dyn",base:z.FORCE,prefixes:q.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:z.FORCE,prefixes:q.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:z.FORCE,prefixes:q.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:z.FORCE,prefixes:q.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:z.FORCE,prefixes:q.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:z.FORCE,prefixes:q.NONE,value:9.80665,offset:0},J:{name:"J",base:z.ENERGY,prefixes:q.SHORT,value:1,offset:0},joule:{name:"joule",base:z.ENERGY,prefixes:q.LONG,value:1,offset:0},erg:{name:"erg",base:z.ENERGY,prefixes:q.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:z.ENERGY,prefixes:q.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:z.ENERGY,prefixes:q.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:z.ENERGY,prefixes:q.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:z.ENERGY,prefixes:q.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:z.POWER,prefixes:q.SHORT,value:1,offset:0},watt:{name:"watt",base:z.POWER,prefixes:q.LONG,value:1,offset:0},hp:{name:"hp",base:z.POWER,prefixes:q.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:z.POWER,prefixes:q.SHORT,value:v.I,offset:0},VA:{name:"VA",base:z.POWER,prefixes:q.SHORT,value:1,offset:0},Pa:{name:"Pa",base:z.PRESSURE,prefixes:q.SHORT,value:1,offset:0},psi:{name:"psi",base:z.PRESSURE,prefixes:q.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:z.PRESSURE,prefixes:q.NONE,value:101325,offset:0},bar:{name:"bar",base:z.PRESSURE,prefixes:q.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:z.PRESSURE,prefixes:q.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:z.PRESSURE,prefixes:q.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:z.PRESSURE,prefixes:q.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:z.PRESSURE,prefixes:q.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:z.ELECTRIC_CHARGE,prefixes:q.LONG,value:1,offset:0},C:{name:"C",base:z.ELECTRIC_CHARGE,prefixes:q.SHORT,value:1,offset:0},farad:{name:"farad",base:z.ELECTRIC_CAPACITANCE,prefixes:q.LONG,value:1,offset:0},F:{name:"F",base:z.ELECTRIC_CAPACITANCE,prefixes:q.SHORT,value:1,offset:0},volt:{name:"volt",base:z.ELECTRIC_POTENTIAL,prefixes:q.LONG,value:1,offset:0},V:{name:"V",base:z.ELECTRIC_POTENTIAL,prefixes:q.SHORT,value:1,offset:0},ohm:{name:"ohm",base:z.ELECTRIC_RESISTANCE,prefixes:q.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:z.ELECTRIC_INDUCTANCE,prefixes:q.LONG,value:1,offset:0},H:{name:"H",base:z.ELECTRIC_INDUCTANCE,prefixes:q.SHORT,value:1,offset:0},siemens:{name:"siemens",base:z.ELECTRIC_CONDUCTANCE,prefixes:q.LONG,value:1,offset:0},S:{name:"S",base:z.ELECTRIC_CONDUCTANCE,prefixes:q.SHORT,value:1,offset:0},weber:{name:"weber",base:z.MAGNETIC_FLUX,prefixes:q.LONG,value:1,offset:0},Wb:{name:"Wb",base:z.MAGNETIC_FLUX,prefixes:q.SHORT,value:1,offset:0},tesla:{name:"tesla",base:z.MAGNETIC_FLUX_DENSITY,prefixes:q.LONG,value:1,offset:0},T:{name:"T",base:z.MAGNETIC_FLUX_DENSITY,prefixes:q.SHORT,value:1,offset:0},b:{name:"b",base:z.BIT,prefixes:q.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:z.BIT,prefixes:q.BINARY_LONG,value:1,offset:0},B:{name:"B",base:z.BIT,prefixes:q.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:z.BIT,prefixes:q.BINARY_LONG,value:8,offset:0}},me={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 Ee(J){if(J.number==="BigNumber"){var re=Pc(x);$.rad.value=new x(1),$.deg.value=re.div(180),$.grad.value=re.div(200),$.cycle.value=re.times(2),$.arcsec.value=re.div(648e3),$.arcmin.value=re.div(10800)}else $.rad.value=1,$.deg.value=Math.PI/180,$.grad.value=Math.PI/200,$.cycle.value=Math.PI*2,$.arcsec.value=Math.PI/648e3,$.arcmin.value=Math.PI/10800;$.radian.value=$.rad.value,$.degree.value=$.deg.value,$.gradian.value=$.grad.value}Ee(t),r&&r("config",function(J,re){J.number!==re.number&&Ee(J)});var pe={si:{NONE:{unit:ae,prefix:q.NONE[""]},LENGTH:{unit:$.m,prefix:q.SHORT[""]},MASS:{unit:$.g,prefix:q.SHORT.k},TIME:{unit:$.s,prefix:q.SHORT[""]},CURRENT:{unit:$.A,prefix:q.SHORT[""]},TEMPERATURE:{unit:$.K,prefix:q.SHORT[""]},LUMINOUS_INTENSITY:{unit:$.cd,prefix:q.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:$.mol,prefix:q.SHORT[""]},ANGLE:{unit:$.rad,prefix:q.SHORT[""]},BIT:{unit:$.bits,prefix:q.SHORT[""]},FORCE:{unit:$.N,prefix:q.SHORT[""]},ENERGY:{unit:$.J,prefix:q.SHORT[""]},POWER:{unit:$.W,prefix:q.SHORT[""]},PRESSURE:{unit:$.Pa,prefix:q.SHORT[""]},ELECTRIC_CHARGE:{unit:$.C,prefix:q.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:$.F,prefix:q.SHORT[""]},ELECTRIC_POTENTIAL:{unit:$.V,prefix:q.SHORT[""]},ELECTRIC_RESISTANCE:{unit:$.ohm,prefix:q.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:$.H,prefix:q.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:$.S,prefix:q.SHORT[""]},MAGNETIC_FLUX:{unit:$.Wb,prefix:q.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:$.T,prefix:q.SHORT[""]},FREQUENCY:{unit:$.Hz,prefix:q.SHORT[""]}}};pe.cgs=JSON.parse(JSON.stringify(pe.si)),pe.cgs.LENGTH={unit:$.m,prefix:q.SHORT.c},pe.cgs.MASS={unit:$.g,prefix:q.SHORT[""]},pe.cgs.FORCE={unit:$.dyn,prefix:q.SHORT[""]},pe.cgs.ENERGY={unit:$.erg,prefix:q.NONE[""]},pe.us=JSON.parse(JSON.stringify(pe.si)),pe.us.LENGTH={unit:$.ft,prefix:q.NONE[""]},pe.us.MASS={unit:$.lbm,prefix:q.NONE[""]},pe.us.TEMPERATURE={unit:$.degF,prefix:q.NONE[""]},pe.us.FORCE={unit:$.lbf,prefix:q.NONE[""]},pe.us.ENERGY={unit:$.BTU,prefix:q.BTU[""]},pe.us.POWER={unit:$.hp,prefix:q.NONE[""]},pe.us.PRESSURE={unit:$.psi,prefix:q.NONE[""]},pe.auto=JSON.parse(JSON.stringify(pe.si));var ge=pe.auto;b.setUnitSystem=function(J){if(Xe(pe,J))ge=pe[J];else throw new Error("Unit system "+J+" does not exist. Choices are: "+Object.keys(pe).join(", "))},b.getUnitSystem=function(){for(var J in pe)if(Xe(pe,J)&&pe[J]===ge)return J},b.typeConverters={BigNumber:function(re){return re!=null&&re.isFraction?new x(re.n).div(re.d).times(re.s):new x(re+"")},Fraction:function(re){return new w(re)},Complex:function(re){return re},number:function(re){return re!=null&&re.isFraction?y(re):re}},b.prototype._numberConverter=function(){var J=b.typeConverters[this.valueType()];if(J)return J;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},b._getNumberConverter=function(J){if(!b.typeConverters[J])throw new TypeError('Unsupported type "'+J+'"');return b.typeConverters[J]};for(var Se in $)if(Xe($,Se)){var ye=$[Se];ye.dimensions=ye.base.dimensions}for(var be in me)if(Xe(me,be)){var De=$[me[be]],Ae={};for(var We in De)Xe(De,We)&&(Ae[We]=De[We]);Ae.name=be,$[be]=Ae}b.isValidAlpha=function(re){return/^[a-zA-Z]$/.test(re)};function Je(J){for(var re=0;re0&&!(b.isValidAlpha(S)||E(S)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+J+'"')}}return b.createUnit=function(J,re){if(typeof J!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(re&&re.override){for(var xe in J)if(Xe(J,xe)&&b.deleteUnit(xe),J[xe].aliases)for(var j=0;j"u"||re===null)&&(re={}),typeof J!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(Xe($,J))throw new Error('Cannot create unit "'+J+'": a unit with that name already exists');Je(J);var xe=null,j=[],ne=0,ue,Me,Ce;if(re&&re.type==="Unit")xe=re.clone();else if(typeof re=="string")re!==""&&(ue=re);else if(typeof re=="object")ue=re.definition,Me=re.prefixes,ne=re.offset,Ce=re.baseName,re.aliases&&(j=re.aliases.valueOf());else throw new TypeError('Cannot create unit "'+J+'" from "'+re.toString()+'": expecting "string" or "Unit" or "Object"');if(j){for(var Le=0;Le1e-12){ce=!1;break}if(ce){Pr=!0,Ie.base=z[ee];break}}if(!Pr){Ce=Ce||J+"_STUFF";var Be={dimensions:xe.dimensions.slice(0)};Be.key=Ce,z[Ce]=Be,ge[Ce]={unit:Ie,prefix:q.NONE[""]},Ie.base=z[Ce]}}else{if(Ce=Ce||J+"_STUFF",K.indexOf(Ce)>=0)throw new Error('Cannot create new base unit "'+J+'": a base unit with that name already exists (and cannot be overridden)');K.push(Ce);for(var fr in z)Xe(z,fr)&&(z[fr].dimensions[K.length-1]=0);for(var or={dimensions:[]},Ke=0;Ke{var{typed:r,Unit:t}=e;return r(yE,{Unit:function(a){return a.clone()},string:function(a){return t.isValuelessUnit(a)?new t(null,a):t.parse(a,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(a,i){return new t(a,i)},"number | BigNumber | Fraction":function(a){return new t(a)},"Array | Matrix":r.referToSelf(n=>a=>je(a,n))})});var xE="sparse",IH=["typed","SparseMatrix"],Th=F(xE,IH,e=>{var{typed:r,SparseMatrix:t}=e;return r(xE,{"":function(){return new t([])},string:function(a){return new t([],a)},"Array | Matrix":function(a){return new t(a)},"Array | Matrix, string":function(a,i){return new t(a,i)}})});var bE="createUnit",RH=["typed","Unit"],Fh=F(bE,RH,e=>{var{typed:r,Unit:t}=e;return r(bE,{"Object, Object":function(a,i){return t.createUnit(a,i)},Object:function(a){return t.createUnit(a,{})},"string, Unit | string | Object, Object":function(a,i,s){var l={};return l[a]=i,t.createUnit(l,s)},"string, Unit | string | Object":function(a,i){var s={};return s[a]=i,t.createUnit(s,{})},string:function(a){var i={};return i[a]={},t.createUnit(i,{})}})});var wE="acos",qH=["typed","config","Complex"],_h=F(wE,qH,e=>{var{typed:r,config:t,Complex:n}=e;return r(wE,{number:function(i){return i>=-1&&i<=1||t.predictable?Math.acos(i):new n(i,0).acos()},Complex:function(i){return i.acos()},BigNumber:function(i){return i.acos()}})});var DE="acosh",kH=["typed","config","Complex"],Oh=F(DE,kH,e=>{var{typed:r,config:t,Complex:n}=e;return r(DE,{number:function(i){return i>=1||t.predictable?$w(i):i<=-1?new n(Math.log(Math.sqrt(i*i-1)-i),Math.PI):new n(i,0).acosh()},Complex:function(i){return i.acosh()},BigNumber:function(i){return i.acosh()}})});var SE="acot",LH=["typed","BigNumber"],Bh=F(SE,LH,e=>{var{typed:r,BigNumber:t}=e;return r(SE,{number:Gw,Complex:function(a){return a.acot()},BigNumber:function(a){return new t(1).div(a).atan()}})});var NE="acoth",zH=["typed","config","Complex","BigNumber"],Ph=F(NE,zH,e=>{var{typed:r,config:t,Complex:n,BigNumber:a}=e;return r(NE,{number:function(s){return s>=1||s<=-1||t.predictable?Vw(s):new n(s,0).acoth()},Complex:function(s){return s.acoth()},BigNumber:function(s){return new a(1).div(s).atanh()}})});var AE="acsc",UH=["typed","config","Complex","BigNumber"],Ih=F(AE,UH,e=>{var{typed:r,config:t,Complex:n,BigNumber:a}=e;return r(AE,{number:function(s){return s<=-1||s>=1||t.predictable?Zw(s):new n(s,0).acsc()},Complex:function(s){return s.acsc()},BigNumber:function(s){return new a(1).div(s).asin()}})});var ME="acsch",WH=["typed","BigNumber"],Rh=F(ME,WH,e=>{var{typed:r,BigNumber:t}=e;return r(ME,{number:Qw,Complex:function(a){return a.acsch()},BigNumber:function(a){return new t(1).div(a).asinh()}})});var CE="asec",YH=["typed","config","Complex","BigNumber"],qh=F(CE,YH,e=>{var{typed:r,config:t,Complex:n,BigNumber:a}=e;return r(CE,{number:function(s){return s<=-1||s>=1||t.predictable?Xw(s):new n(s,0).asec()},Complex:function(s){return s.asec()},BigNumber:function(s){return new a(1).div(s).acos()}})});var EE="asech",HH=["typed","config","Complex","BigNumber"],kh=F(EE,HH,e=>{var{typed:r,config:t,Complex:n,BigNumber:a}=e;return r(EE,{number:function(s){if(s<=1&&s>=-1||t.predictable){var l=1/s;if(l>0||t.predictable)return Jw(s);var c=Math.sqrt(l*l-1);return new n(Math.log(c-l),Math.PI)}return new n(s,0).asech()},Complex:function(s){return s.asech()},BigNumber:function(s){return new a(1).div(s).acosh()}})});var TE="asin",$H=["typed","config","Complex"],Lh=F(TE,$H,e=>{var{typed:r,config:t,Complex:n}=e;return r(TE,{number:function(i){return i>=-1&&i<=1||t.predictable?Math.asin(i):new n(i,0).asin()},Complex:function(i){return i.asin()},BigNumber:function(i){return i.asin()}})});var GH="asinh",VH=["typed"],zh=F(GH,VH,e=>{var{typed:r}=e;return r("asinh",{number:Kw,Complex:function(n){return n.asinh()},BigNumber:function(n){return n.asinh()}})});var ZH="atan",QH=["typed"],Uh=F(ZH,QH,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 FE="atan2",XH=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],Wh=F(FE,XH,e=>{var{typed:r,matrix:t,equalScalar:n,BigNumber:a,DenseMatrix:i,concat:s}=e,l=Lt({typed:r,equalScalar:n}),c=lt({typed:r}),o=Vp({typed:r,equalScalar:n}),u=jr({typed:r,equalScalar:n}),m=Wr({typed:r,DenseMatrix:i}),d=vr({typed:r,matrix:t,concat:s});return r(FE,{"number, number":Math.atan2,"BigNumber, BigNumber":(h,y)=>a.atan2(h,y)},d({scalar:"number | BigNumber",SS:o,DS:c,SD:l,Ss:u,sS:m}))});var _E="atanh",JH=["typed","config","Complex"],Yh=F(_E,JH,e=>{var{typed:r,config:t,Complex:n}=e;return r(_E,{number:function(i){return i<=1&&i>=-1||t.predictable?jw(i):new n(i,0).atanh()},Complex:function(i){return i.atanh()},BigNumber:function(i){return i.atanh()}})});var qa=F("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 OE="cos",KH=["typed"],Hh=F(OE,KH,e=>{var{typed:r}=e,t=qa({typed:r});return r(OE,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},t)});var BE="cosh",jH=["typed"],$h=F(BE,jH,e=>{var{typed:r}=e;return r(BE,{number:Cm,"Complex | BigNumber":t=>t.cosh()})});var PE="cot",e$=["typed","BigNumber"],Gh=F(PE,e$,e=>{var{typed:r,BigNumber:t}=e,n=qa({typed:r});return r(PE,{number:eD,Complex:a=>a.cot(),BigNumber:a=>new t(1).div(a.tan())},n)});var IE="coth",r$=["typed","BigNumber"],Vh=F(IE,r$,e=>{var{typed:r,BigNumber:t}=e;return r(IE,{number:rD,Complex:n=>n.coth(),BigNumber:n=>new t(1).div(n.tanh())})});var RE="csc",t$=["typed","BigNumber"],Zh=F(RE,t$,e=>{var{typed:r,BigNumber:t}=e,n=qa({typed:r});return r(RE,{number:tD,Complex:a=>a.csc(),BigNumber:a=>new t(1).div(a.sin())},n)});var qE="csch",n$=["typed","BigNumber"],Qh=F(qE,n$,e=>{var{typed:r,BigNumber:t}=e;return r(qE,{number:nD,Complex:n=>n.csch(),BigNumber:n=>new t(1).div(n.sinh())})});var kE="sec",a$=["typed","BigNumber"],Xh=F(kE,a$,e=>{var{typed:r,BigNumber:t}=e,n=qa({typed:r});return r(kE,{number:aD,Complex:a=>a.sec(),BigNumber:a=>new t(1).div(a.cos())},n)});var LE="sech",i$=["typed","BigNumber"],Jh=F(LE,i$,e=>{var{typed:r,BigNumber:t}=e;return r(LE,{number:iD,Complex:n=>n.sech(),BigNumber:n=>new t(1).div(n.cosh())})});var zE="sin",o$=["typed"],Kh=F(zE,o$,e=>{var{typed:r}=e,t=qa({typed:r});return r(zE,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},t)});var UE="sinh",s$=["typed"],jh=F(UE,s$,e=>{var{typed:r}=e;return r(UE,{number:oD,"Complex | BigNumber":t=>t.sinh()})});var WE="tan",u$=["typed"],ev=F(WE,u$,e=>{var{typed:r}=e,t=qa({typed:r});return r(WE,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},t)});var f$="tanh",c$=["typed"],rv=F(f$,c$,e=>{var{typed:r}=e;return r("tanh",{number:Em,"Complex | BigNumber":t=>t.tanh()})});var YE="setCartesian",l$=["typed","size","subset","compareNatural","Index","DenseMatrix"],tv=F(YE,l$,e=>{var{typed:r,size:t,subset:n,compareNatural:a,Index:i,DenseMatrix:s}=e;return r(YE,{"Array | Matrix, Array | Matrix":function(c,o){var u=[];if(n(t(c),new i(0))!==0&&n(t(o),new i(0))!==0){var m=gr(Array.isArray(c)?c:c.toArray()).sort(a),d=gr(Array.isArray(o)?o:o.toArray()).sort(a);u=[];for(var h=0;h{var{typed:r,size:t,subset:n,compareNatural:a,Index:i,DenseMatrix:s}=e;return r(HE,{"Array | Matrix, Array | Matrix":function(c,o){var u;if(n(t(c),new i(0))===0)u=[];else{if(n(t(o),new i(0))===0)return gr(c.toArray());var m=Ki(gr(Array.isArray(c)?c:c.toArray()).sort(a)),d=Ki(gr(Array.isArray(o)?o:o.toArray()).sort(a));u=[];for(var h,y=0;y{var{typed:r,size:t,subset:n,compareNatural:a,Index:i,DenseMatrix:s}=e;return r($E,{"Array | Matrix":function(c){var o;if(n(t(c),new i(0))===0)o=[];else{var u=gr(Array.isArray(c)?c:c.toArray()).sort(a);o=[],o.push(u[0]);for(var m=1;m{var{typed:r,size:t,subset:n,compareNatural:a,Index:i,DenseMatrix:s}=e;return r(GE,{"Array | Matrix, Array | Matrix":function(c,o){var u;if(n(t(c),new i(0))===0||n(t(o),new i(0))===0)u=[];else{var m=Ki(gr(Array.isArray(c)?c:c.toArray()).sort(a)),d=Ki(gr(Array.isArray(o)?o:o.toArray()).sort(a));u=[];for(var h=0;h{var{typed:r,size:t,subset:n,compareNatural:a,Index:i}=e;return r(VE,{"Array | Matrix, Array | Matrix":function(l,c){if(n(t(l),new i(0))===0)return!0;if(n(t(c),new i(0))===0)return!1;for(var o=Ki(gr(Array.isArray(l)?l:l.toArray()).sort(a)),u=Ki(gr(Array.isArray(c)?c:c.toArray()).sort(a)),m,d=0;d{var{typed:r,size:t,subset:n,compareNatural:a,Index:i}=e;return r(ZE,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(l,c){if(n(t(c),new i(0))===0)return 0;for(var o=gr(Array.isArray(c)?c:c.toArray()),u=0,m=0;m{var{typed:r,size:t,subset:n,compareNatural:a,Index:i}=e;return r(QE,{"Array | Matrix":function(o){if(n(t(o),new i(0))===0)return[];for(var u=gr(Array.isArray(o)?o:o.toArray()).sort(a),m=[],d=0;d.toString(2).length<=u.length;)m.push(s(u,d.toString(2).split("").reverse())),d++;return l(m)}});function s(c,o){for(var u=[],m=0;m0;u--)for(var m=0;mc[m+1].length&&(o=c[m],c[m]=c[m+1],c[m+1]=o);return c}});var XE="setSize",y$=["typed","compareNatural"],fv=F(XE,y$,e=>{var{typed:r,compareNatural:t}=e;return r(XE,{"Array | Matrix":function(a){return Array.isArray(a)?gr(a).length:gr(a.toArray()).length},"Array | Matrix, boolean":function(a,i){if(i===!1||a.length===0)return Array.isArray(a)?gr(a).length:gr(a.toArray()).length;for(var s=gr(Array.isArray(a)?a:a.toArray()).sort(t),l=1,c=1;c{var{typed:r,size:t,concat:n,subset:a,setDifference:i,Index:s}=e;return r(JE,{"Array | Matrix, Array | Matrix":function(c,o){if(a(t(c),new s(0))===0)return gr(o);if(a(t(o),new s(0))===0)return gr(c);var u=gr(c),m=gr(o);return n(i(u,m),i(m,u))}})});var KE="setUnion",b$=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],lv=F(KE,b$,e=>{var{typed:r,size:t,concat:n,subset:a,setIntersect:i,setSymDifference:s,Index:l}=e;return r(KE,{"Array | Matrix, Array | Matrix":function(o,u){if(a(t(o),new l(0))===0)return gr(u);if(a(t(u),new l(0))===0)return gr(o);var m=gr(o),d=gr(u);return n(s(m,d),i(m,d))}})});var jE="add",w$=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],mv=F(jE,w$,e=>{var{typed:r,matrix:t,addScalar:n,equalScalar:a,DenseMatrix:i,SparseMatrix:s,concat:l}=e,c=Mn({typed:r}),o=Ru({typed:r,equalScalar:a}),u=ra({typed:r,DenseMatrix:i}),m=vr({typed:r,matrix:t,concat:l});return r(jE,{"any, any":n,"any, any, ...any":r.referToSelf(d=>(h,y,v)=>{for(var x=d(h,y),w=0;w{var{typed:r,abs:t,addScalar:n,divideScalar:a,multiplyScalar:i,sqrt:s,smaller:l,isPositive:c}=e;return r(eT,{"... number | BigNumber":o,Array:o,Matrix:u=>o(gr(u.toArray()))});function o(u){for(var m=0,d=0,h=0;h{var{typed:r,abs:t,add:n,pow:a,conj:i,sqrt:s,multiply:l,equalScalar:c,larger:o,smaller:u,matrix:m,ctranspose:d,eigs:h}=e;return r(rT,{number:Math.abs,Complex:function(_){return _.abs()},BigNumber:function(_){return _.abs()},boolean:function(_){return Math.abs(_)},Array:function(_){return S(m(_),2)},Matrix:function(_){return S(_,2)},"Array, number | BigNumber | string":function(_,E){return S(m(_),E)},"Matrix, number | BigNumber | string":function(_,E){return S(_,E)}});function y(O){var _=0;return O.forEach(function(E){var T=t(E);o(T,_)&&(_=T)},!0),_}function v(O){var _;return O.forEach(function(E){var T=t(E);(!_||u(T,_))&&(_=T)},!0),_||0}function x(O,_){if(_===Number.POSITIVE_INFINITY||_==="inf")return y(O);if(_===Number.NEGATIVE_INFINITY||_==="-inf")return v(O);if(_==="fro")return S(O,2);if(typeof _=="number"&&!isNaN(_)){if(!c(_,0)){var E=0;return O.forEach(function(T){E=n(a(t(T),_),E)},!0),a(E,1/_)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function w(O){var _=0;return O.forEach(function(E,T){_=n(_,l(E,i(E)))}),t(s(_))}function C(O){var _=[],E=0;return O.forEach(function(T,R){var L=R[1],H=n(_[L]||0,t(T));o(H,E)&&(E=H),_[L]=H},!0),E}function b(O){var _=O.size();if(_[0]!==_[1])throw new RangeError("Invalid matrix dimensions");var E=d(O),T=l(E,O),R=h(T).values.toArray(),L=R[R.length-1];return t(s(L))}function N(O){var _=[],E=0;return O.forEach(function(T,R){var L=R[0],H=n(_[L]||0,t(T));o(H,E)&&(E=H),_[L]=H},!0),E}function M(O,_){if(_===1)return C(O);if(_===Number.POSITIVE_INFINITY||_==="inf")return N(O);if(_==="fro")return w(O);if(_===2)return b(O);throw new Error("Unsupported parameter value "+_)}function S(O,_){var E=O.size();if(E.length===1)return x(O,_);if(E.length===2){if(E[0]&&E[1])return M(O,_);throw new RangeError("Invalid matrix dimensions")}}});var tT="dot",N$=["typed","addScalar","multiplyScalar","conj","size"],hv=F(tT,N$,e=>{var{typed:r,addScalar:t,multiplyScalar:n,conj:a,size:i}=e;return r(tT,{"Array | DenseMatrix, Array | DenseMatrix":l,"SparseMatrix, SparseMatrix":c});function s(u,m){var d=o(u),h=o(m),y,v;if(d.length===1)y=d[0];else if(d.length===2&&d[1]===1)y=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(y!==v)throw new RangeError("Vectors must have equal length ("+y+" != "+v+")");if(y===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return y}function l(u,m){var d=s(u,m),h=Qe(u)?u._data:u,y=Qe(u)?u._datatype||u.getDataType():void 0,v=Qe(m)?m._data:m,x=Qe(m)?m._datatype||m.getDataType():void 0,w=o(u).length===2,C=o(m).length===2,b=t,N=n;if(y&&x&&y===x&&typeof y=="string"&&y!=="mixed"){var M=y;b=r.find(t,[M,M]),N=r.find(n,[M,M])}if(!w&&!C){for(var S=N(a(h[0]),v[0]),O=1;OS){N++;continue}M===S&&(x=w(x,C(h[b],v[N])),b++,N++)}return x}function o(u){return Qe(u)?u.size():i(u)}});var A$="trace",M$=["typed","matrix","add"],vv=F(A$,M$,e=>{var{typed:r,matrix:t,add:n}=e;return r("trace",{Array:function(l){return a(t(l))},SparseMatrix:i,DenseMatrix:a,any:ar});function a(s){var l=s._size,c=s._data;switch(l.length){case 1:if(l[0]===1)return ar(c[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 m=0,d=0;d0)for(var y=0;yy)break}return h}throw new RangeError("Matrix must be square (size: "+lr(u)+")")}});var nT="index",C$=["typed","Index"],gv=F(nT,C$,e=>{var{typed:r,Index:t}=e;return r(nT,{"...number | string | BigNumber | Range | Array | Matrix":function(a){var i=a.map(function(l){return rr(l)?l.toNumber():Mr(l)||Qe(l)?l.map(function(c){return rr(c)?c.toNumber():c}):l}),s=new t;return t.apply(s,i),s}})});var yv=new Set(["end"]);var E$="Node",T$=["mathWithTransform"],xv=F(E$,T$,e=>{var{mathWithTransform:r}=e;function t(a){for(var i of[...yv])if(a.has(i))throw new Error('Scope contains an illegal symbol, "'+i+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(i){return this.compile().evaluate(i)}compile(){var i=this._compile(r,{}),s={},l=null;function c(o){var u=ji(o);return t(u),i(u,s,l)}return{evaluate:c}}_compile(i,s){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(i){throw new Error("Cannot run forEach on a Node interface")}map(i){throw new Error("Cannot run map on a Node interface")}_ifNode(i){if(!Nr(i))throw new TypeError("Callback function must return a Node");return i}traverse(i){i(this,null,null);function s(l,c){l.forEach(function(o,u,m){c(o,u,m),s(o,c)})}s(this,i)}transform(i){function s(l,c,o){var u=i(l,c,o);return u!==l?u:l.map(s)}return s(this,null,null)}filter(i){var s=[];return this.traverse(function(l,c,o){i(l,c,o)&&s.push(l)}),s}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(i){return i.cloneDeep()})}equals(i){return i?this.type===i.type&&ni(this,i):!1}toString(i){var s=this._getCustomString(i);return typeof s<"u"?s:this._toString(i)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(i){var s=this._getCustomString(i);return typeof s<"u"?s:this._toHTML(i)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(i){var s=this._getCustomString(i);return typeof s<"u"?s:this._toTex(i)}_toTex(i){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(i){if(i&&typeof i=="object")switch(typeof i.handler){case"object":case"undefined":return;case"function":return i.handler(this,i);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});function mt(e){return e&&e.isIndexError?new tn(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function bv(e){var{subset:r}=e;return function(n,a){try{if(Array.isArray(n))return r(n,a);if(n&&typeof n.subset=="function")return n.subset(a);if(typeof n=="string")return r(n,a);if(typeof n=="object"){if(!a.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return wt(n,a.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(i){throw mt(i)}}}var wv="AccessorNode",F$=["subset","Node"],Dv=F(wv,F$,e=>{var{subset:r,Node:t}=e,n=bv({subset:r});function a(s){return!(Ln(s)||jt(s)||xr(s)||yn(s)||Ei(s)||en(s)||at(s))}class i extends t{constructor(l,c){if(super(),!Nr(l))throw new TypeError('Node expected for parameter "object"');if(!Jn(c))throw new TypeError('IndexNode expected for parameter "index"');this.object=l,this.index=c}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return wv}get isAccessorNode(){return!0}_compile(l,c){var o=this.object._compile(l,c),u=this.index._compile(l,c);if(this.index.isObjectProperty()){var m=this.index.getObjectProperty();return function(h,y,v){return wt(o(h,y,v),m)}}else return function(h,y,v){var x=o(h,y,v),w=u(h,y,x);return n(x,w)}}forEach(l){l(this.object,"object",this),l(this.index,"index",this)}map(l){return new i(this._ifNode(l(this.object,"object",this)),this._ifNode(l(this.index,"index",this)))}clone(){return new i(this.object,this.index)}_toString(l){var c=this.object.toString(l);return a(this.object)&&(c="("+c+")"),c+this.index.toString(l)}_toHTML(l){var c=this.object.toHTML(l);return a(this.object)&&(c='('+c+')'),c+this.index.toHTML(l)}_toTex(l){var c=this.object.toTex(l);return a(this.object)&&(c="\\\\left(' + object + '\\\\right)"),c+this.index.toTex(l)}toJSON(){return{mathjs:wv,object:this.object,index:this.index}}static fromJSON(l){return new i(l.object,l.index)}}return Hr(i,"name",wv),i},{isClass:!0,isNode:!0});var Sv="ArrayNode",_$=["Node"],Nv=F(Sv,_$,e=>{var{Node:r}=e;class t extends r{constructor(a){if(super(),this.items=a||[],!Array.isArray(this.items)||!this.items.every(Nr))throw new TypeError("Array containing Nodes expected")}get type(){return Sv}get isArrayNode(){return!0}_compile(a,i){var s=Kn(this.items,function(o){return o._compile(a,i)}),l=a.config.matrix!=="Array";if(l){var c=a.matrix;return function(u,m,d){return c(Kn(s,function(h){return h(u,m,d)}))}}else return function(u,m,d){return Kn(s,function(h){return h(u,m,d)})}}forEach(a){for(var i=0;i['+i.join(',')+']'}_toTex(a){function i(s,l){var c=s.some(jt)&&!s.every(jt),o=l||c,u=o?"&":"\\\\\\\\",m=s.map(function(d){return d.items?i(d.items,!l):d.toTex(a)}).join(u);return c||!o||o&&!l?"\\\\begin{bmatrix}"+m+"\\\\end{bmatrix}":m}return i(this.items,!1)}}return Hr(t,"name",Sv),t},{isClass:!0,isNode:!0});function aT(e){var{subset:r,matrix:t}=e;return function(a,i,s){try{if(Array.isArray(a)){var l=t(a).subset(i,s).valueOf();return l.forEach((c,o)=>{a[o]=c}),a}else{if(a&&typeof a.subset=="function")return a.subset(i,s);if(typeof a=="string")return r(a,i,s);if(typeof a=="object"){if(!i.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return Ti(a,i.getObjectProperty(),s),a}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(c){throw mt(c)}}}var ka=[{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 Av(e,r){if(!r||r!=="auto")return e;for(var t=e;en(t);)t=t.content;return t}function Qr(e,r,t,n){var a=e;r!=="keep"&&(a=e.getContent());for(var i=a.getIdentifier(),s=null,l=0;l{var{subset:r,matrix:t,Node:n}=e,a=bv({subset:r}),i=aT({subset:r,matrix:t});function s(c,o,u){o||(o="keep");var m=Qr(c,o,u),d=Qr(c.value,o,u);return o==="all"||d!==null&&d<=m}class l extends n{constructor(o,u,m){if(super(),this.object=o,this.index=m?u:null,this.value=m||u,!at(o)&&!Ln(o))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(at(o)&&o.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!Jn(this.index))throw new TypeError('IndexNode expected as "index"');if(!Nr(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 Cv}get isAssignmentNode(){return!0}_compile(o,u){var m=this.object._compile(o,u),d=this.index?this.index._compile(o,u):null,h=this.value._compile(o,u),y=this.object.name;if(this.index)if(this.index.isObjectProperty()){var v=this.index.getObjectProperty();return function(N,M,S){var O=m(N,M,S),_=h(N,M,S);return Ti(O,v,_),_}}else{if(at(this.object))return function(N,M,S){var O=m(N,M,S),_=h(N,M,S),E=d(N,M,O);return N.set(y,i(O,E,_)),_};var x=this.object.object._compile(o,u);if(this.object.index.isObjectProperty()){var w=this.object.index.getObjectProperty();return function(N,M,S){var O=x(N,M,S),_=wt(O,w),E=d(N,M,_),T=h(N,M,S);return Ti(O,w,i(_,E,T)),T}}else{var C=this.object.index._compile(o,u);return function(N,M,S){var O=x(N,M,S),_=C(N,M,O),E=a(O,_),T=d(N,M,E),R=h(N,M,S);return i(O,_,i(E,T,R)),R}}}else{if(!at(this.object))throw new TypeError("SymbolNode expected as object");return function(N,M,S){var O=h(N,M,S);return N.set(y,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)),m=this.index?this._ifNode(o(this.index,"index",this)):null,d=this._ifNode(o(this.value,"value",this));return new l(u,m,d)}clone(){return new l(this.object,this.index,this.value)}_toString(o){var u=this.object.toString(o),m=this.index?this.index.toString(o):"",d=this.value.toString(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(d="("+d+")"),u+m+" = "+d}toJSON(){return{mathjs:Cv,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),m=this.index?this.index.toHTML(o):"",d=this.value.toHTML(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(d='('+d+')'),u+m+'='+d}_toTex(o){var u=this.object.toTex(o),m=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+m+"="+d}}return Hr(l,"name",Cv),l},{isClass:!0,isNode:!0});var Tv="BlockNode",B$=["ResultSet","Node"],Fv=F(Tv,B$,e=>{var{ResultSet:r,Node:t}=e;class n extends t{constructor(i){if(super(),!Array.isArray(i))throw new Error("Array expected");this.blocks=i.map(function(s){var l=s&&s.node,c=s&&s.visible!==void 0?s.visible:!0;if(!Nr(l))throw new TypeError('Property "node" must be a Node');if(typeof c!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:l,visible:c}})}get type(){return Tv}get isBlockNode(){return!0}_compile(i,s){var l=Kn(this.blocks,function(c){return{evaluate:c.node._compile(i,s),visible:c.visible}});return function(o,u,m){var d=[];return _o(l,function(y){var v=y.evaluate(o,u,m);y.visible&&d.push(v)}),new r(d)}}forEach(i){for(var s=0;s;')}).join('
')}_toTex(i){return this.blocks.map(function(s){return s.node.toTex(i)+(s.visible?"":";")}).join(\`\\\\;\\\\; @@ -109730,7 +109781,7 @@ q: \`+this.q.toString():"")+\` \`),n.seealso&&n.seealso.length&&(a+="See also: "+n.seealso.join(", ")+\` \`),a},t.prototype.toJSON=function(){var n=ar(this.doc);return n.mathjs="Help",n},t.fromJSON=function(n){var a={};return Object.keys(n).filter(i=>i!=="mathjs").forEach(i=>{a[i]=n[i]}),new t(a)},t.prototype.valueOf=t.prototype.toString,t},{isClass:!0});var yG="Chain",xG=["?on","math","typed"],pg=F(yG,xG,e=>{var{on:r,math:t,typed:n}=e;function a(o){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");bu(o)?this.value=o.value:this.value=o}a.prototype.type="Chain",a.prototype.isChain=!0,a.prototype.done=function(){return this.value},a.prototype.valueOf=function(){return this.value},a.prototype.toString=function(){return lr(this.value)},a.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},a.fromJSON=function(o){return new a(o.value)};function i(o,u){typeof u=="function"&&(a.prototype[o]=l(u))}function s(o,u){Du(a.prototype,o,function(){var d=u();if(typeof d=="function")return l(d)})}function l(o){return function(){if(arguments.length===0)return new a(o(this.value));for(var u=[this.value],m=0;mo[y])};for(var d in o)m(d)}};var c={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return a.createProxy(t),r&&r("import",function(o,u,m){m||s(o,u)}),a},{isClass:!0});var DD={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 OT={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};var BT={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 PT={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 IT={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};var RT={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};var qT={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 kT={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 LT={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};var zT={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};var UT={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 SD={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 WT={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 YT={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]};var HT={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 $T={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]};var GT={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]};var VT={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 ZT={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 QT={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 XT={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 JT={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 KT={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 jT={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 eF={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 rF={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 tF={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 nF={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 aF={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 iF={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 oF={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 sF={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 uF={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 fF={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 cF={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 lF={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 mF={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 pF={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 dF={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 hF={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 vF={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 gF={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 yF={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 xF={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 bF={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 wF={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 DF={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 SF={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 NF={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 AF={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]};var MF={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 CF={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 EF={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 TF={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 FF={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 _F={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 OF={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 BF={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 PF={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 IF={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 RF={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 qF={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 kF={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 LF={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 zF={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 UF={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 WF={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 YF={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 HF={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 $F={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 GF={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 VF={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 ZF={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 QF={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 XF={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 JF={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 KF={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 jF={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 e_={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 r_={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 t_={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 n_={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 a_={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 i_={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 o_={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 s_={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 u_={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 f_={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]};var c_={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 l_={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 m_={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 p_={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 d_={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 h_={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 v_={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 g_={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 y_={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 x_={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 b_={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 w_={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 D_={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 S_={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 N_={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 A_={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 M_={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 C_={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 E_={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 T_={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 F_={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 __={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 O_={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 B_={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 P_={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 I_={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 R_={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 q_={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 k_={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 L_={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 z_={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 U_={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 W_={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 Y_={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 H_={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 $_={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 G_={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 V_={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 Z_={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 Q_={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 X_={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 J_={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 K_={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 j_={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 eO={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 rO={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 tO={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 nO={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 aO={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 iO={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 oO={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 sO={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 uO={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 fO={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 cO={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 lO={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 mO={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 pO={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 dO={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 hO={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 vO={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 gO={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]};var yO={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]};var xO={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 bO={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 wO={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 DO={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 SO={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 NO={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 AO={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 MO={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 CO={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 EO={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 TO={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 FO={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 _O={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 OO={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 BO={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 PO={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 IO={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 RO={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 qO={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 kO={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 LO={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 zO={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 UO={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 WO={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 YO={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 HO={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 $O={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 GO={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 VO={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 ZO={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 QO={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 XO={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 JO={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 KO={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 jO={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 e3={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 r3={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 t3={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 n3={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 a3={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 i3={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 o3={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 s3={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 u3={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 f3={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 c3={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 l3={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 m3={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 p3={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 d3={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 h3={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 v3={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 g3={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 y3={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 x3={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 b3={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 w3={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]};var D3={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 S3={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 N3={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 A3={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 M3={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 C3={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 E3={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 T3={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 F3={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 _3={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 O3={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 B3={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 P3={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 I3={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 R3={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]};var q3={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 k3={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 L3={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 z3={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]};var U3={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 W3={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 Y3={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 H3={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]};var $3={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 G3={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 V3={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 Z3={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 Q3={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 X3={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 J3={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 K3={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 j3={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]};var eB={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 rB={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 tB={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 nB={bignumber:VT,boolean:ZT,complex:QT,createUnit:XT,fraction:JT,index:KT,matrix:jT,number:eF,sparse:rF,splitUnit:tF,string:nF,unit:aF,e:DD,E:DD,false:OT,i:BT,Infinity:PT,LN2:RT,LN10:IT,LOG2E:kT,LOG10E:qT,NaN:LT,null:zT,pi:SD,PI:SD,phi:UT,SQRT1_2:WT,SQRT2:YT,tau:HT,true:$T,version:GT,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:uF,lsolve:cF,lsolveAll:lF,lup:mF,lusolve:pF,leafCount:fF,polynomialRoot:dF,resolve:gF,simplify:yF,simplifyConstant:xF,simplifyCore:bF,symbolicEqual:DF,rationalize:vF,slu:wF,usolve:SF,usolveAll:NF,qr:hF,abs:AF,add:MF,cbrt:CF,ceil:EF,cube:TF,divide:FF,dotDivide:_F,dotMultiply:OF,dotPow:BF,exp:PF,expm:IF,expm1:RF,fix:qF,floor:kF,gcd:LF,hypot:zF,lcm:WF,log:YF,log2:GF,log1p:$F,log10:HF,mod:VF,multiply:ZF,norm:QF,nthRoot:XF,nthRoots:JF,pow:KF,round:jF,sign:e_,sqrt:r_,sqrtm:t_,square:o_,subtract:s_,unaryMinus:u_,unaryPlus:f_,xgcd:c_,invmod:UF,bitAnd:l_,bitNot:m_,bitOr:p_,bitXor:d_,leftShift:h_,rightArithShift:v_,rightLogShift:g_,bellNumbers:y_,catalan:x_,composition:b_,stirlingS2:w_,config:iF,import:oF,typed:sF,arg:D_,conj:S_,re:A_,im:N_,evaluate:M_,help:C_,distance:E_,intersect:T_,and:F_,not:__,or:O_,xor:B_,concat:I_,count:R_,cross:q_,column:P_,ctranspose:k_,det:L_,diag:z_,diff:U_,dot:W_,getMatrixDataType:V_,identity:Z_,filter:H_,flatten:$_,forEach:G_,inv:Q_,pinv:X_,eigs:Y_,kron:J_,matrixFromFunction:eO,matrixFromRows:rO,matrixFromColumns:j_,map:K_,ones:tO,partitionSelect:nO,range:aO,resize:oO,reshape:iO,rotate:sO,rotationMatrix:uO,row:fO,size:cO,sort:lO,squeeze:mO,subset:pO,trace:dO,transpose:hO,zeros:vO,fft:gO,ifft:yO,sylvester:n_,schur:a_,lyap:i_,solveODE:tB,combinations:xO,combinationsWithRep:bO,factorial:wO,gamma:DO,kldivergence:NO,lgamma:SO,multinomial:AO,permutations:MO,pickRandom:CO,random:EO,randomInt:TO,compare:FO,compareNatural:_O,compareText:OO,deepEqual:BO,equal:PO,equalText:IO,larger:RO,largerEq:qO,smaller:kO,smallerEq:LO,unequal:zO,setCartesian:UO,setDifference:WO,setDistinct:YO,setIntersect:HO,setIsSubset:$O,setMultiplicity:GO,setPowerset:VO,setSize:ZO,setSymDifference:QO,setUnion:XO,zpk2tf:JO,freqz:KO,erf:jO,zeta:e3,cumsum:c3,mad:r3,max:t3,mean:n3,median:a3,min:i3,mode:o3,prod:s3,quantileSeq:u3,std:f3,sum:l3,variance:m3,corr:p3,acos:d3,acosh:h3,acot:v3,acoth:g3,acsc:y3,acsch:x3,asec:b3,asech:w3,asin:D3,asinh:S3,atan:N3,atanh:M3,atan2:A3,cos:C3,cosh:E3,cot:T3,coth:F3,csc:_3,csch:O3,sec:B3,sech:P3,sin:I3,sinh:R3,tan:q3,tanh:k3,to:L3,clone:U3,format:W3,bin:z3,oct:j3,hex:H3,isNaN:G3,isInteger:$3,isNegative:V3,isNumeric:Z3,hasNumericValue:Y3,isPositive:Q3,isPrime:X3,isZero:J3,print:eB,typeOf:rB,numeric:K3};var aB="help",bG=["typed","mathWithTransform","Help"],dg=F(aB,bG,e=>{var{typed:r,mathWithTransform:t,Help:n}=e;return r(aB,{any:function(i){var s,l=i;if(typeof i!="string"){for(s in t)if(Xe(t,s)&&i===t[s]){l=s;break}}var c=wt(nB,l);if(!c){var o=typeof l=="function"?l.name:l;throw new Error('No documentation found on "'+o+'"')}return new n(c)}})});var iB="chain",wG=["typed","Chain"],hg=F(iB,wG,e=>{var{typed:r,Chain:t}=e;return r(iB,{"":function(){return new t},any:function(a){return new t(a)}})});var oB="det",DG=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],vg=F(oB,DG,e=>{var{typed:r,matrix:t,subtractScalar:n,multiply:a,divideScalar:i,isZero:s,unaryMinus:l}=e;return r(oB,{any:function(u){return ar(u)},"Array | Matrix":function(u){var m;switch(Qe(u)?m=u.size():Array.isArray(u)?(u=t(u),m=u.size()):m=[],m.length){case 0:return ar(u);case 1:if(m[0]===1)return ar(u.valueOf()[0]);if(m[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(m)+")");case 2:{var d=m[0],h=m[1];if(d===h)return c(u.clone().valueOf(),d,h);if(h===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(m)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(m)+")")}}});function c(o,u,m){if(u===1)return ar(o[0][0]);if(u===2)return n(a(o[0][0],o[1][1]),a(o[1][0],o[0][1]));for(var d=!1,h=new Array(u).fill(0).map((O,_)=>_),y=0;y{var{typed:r,matrix:t,divideScalar:n,addScalar:a,multiply:i,unaryMinus:s,det:l,identity:c,abs:o}=e;return r(sB,{"Array | Matrix":function(d){var h=Qe(d)?d.size():ur(d);switch(h.length){case 1:if(h[0]===1)return Qe(d)?t([n(1,d.valueOf()[0])]):[n(1,d[0])];throw new RangeError("Matrix must be square (size: "+lr(h)+")");case 2:{var y=h[0],v=h[1];if(y===v)return Qe(d)?t(u(d.valueOf(),y,v),d.storage()):u(d,y,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(m,d,h){var y,v,x,w,C;if(d===1){if(w=m[0][0],w===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,w)]]}else if(d===2){var b=l(m);if(b===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(m[1][1],b),n(s(m[0][1]),b)],[n(s(m[1][0]),b),n(m[0][0],b)]]}else{var N=m.concat();for(y=0;yO&&(O=o(N[y][S]),_=y),y++;if(O===0)throw Error("Cannot calculate inverse, determinant is zero");y=_,y!==S&&(C=N[S],N[S]=N[y],N[y]=C,C=M[S],M[S]=M[y],M[y]=C);var E=N[S],T=M[S];for(y=0;y{var{typed:r,matrix:t,inv:n,deepEqual:a,equal:i,dotDivide:s,dot:l,ctranspose:c,divideScalar:o,multiply:u,add:m,Complex:d}=e;return r(uB,{"Array | Matrix":function(b){var N=Qe(b)?b.size():ur(b);switch(N.length){case 1:return w(b)?c(b):N[0]===1?n(b):s(c(b),l(b,b));case 2:{if(w(b))return c(b);var M=N[0],S=N[1];if(M===S)try{return n(b)}catch(O){if(!(O instanceof Error&&O.message.match(/Cannot calculate inverse, determinant is zero/)))throw O}return Qe(b)?t(h(b.valueOf(),M,S),b.storage()):h(b,M,S)}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(N)+")")}},any:function(b){return i(b,0)?ar(b):o(1,b)}});function h(C,b,N){var{C:M,F:S}=v(C,b,N),O=u(n(u(c(M),M)),c(M)),_=u(c(S),n(u(S,c(S))));return u(_,O)}function y(C,b,N){for(var M=ar(C),S=0,O=0;O_.filter((T,R)=>R!x(l(M[E],M[E])));return{C:S,F:O}}function x(C){return i(m(C,d(1,1)),m(0,d(1,1)))}function w(C){return a(m(C,d(1,1)),m(u(C,0),d(1,1)))}});function fB(e){var{addScalar:r,subtract:t,flatten:n,multiply:a,multiplyScalar:i,divideScalar:s,sqrt:l,abs:c,bignumber:o,diag:u,size:m,reshape:d,inv:h,qr:y,usolve:v,usolveAll:x,equal:w,complex:C,larger:b,smaller:N,matrixFromColumns:M,dot:S}=e;function O(ae,$,me,Ee){var pe=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ge=_(ae,$,me,Ee,pe);E(ae,$,me,Ee,pe,ge);var{values:Se,C:ye}=T(ae,$,me,Ee,pe);if(pe){var be=R(ae,$,ye,ge,Se,me,Ee);return{values:Se,eigenvectors:be}}return{values:Se}}function _(ae,$,me,Ee,pe){var ge=Ee==="BigNumber",Se=Ee==="Complex",ye=ge?o(0):0,be=ge?o(1):Se?C(1):1,De=ge?o(1):1,Ae=ge?o(10):2,We=i(Ae,Ae),Je;pe&&(Je=Array($).fill(be));for(var J=!1;!J;){J=!0;for(var re=0;re<$;re++){for(var xe=ye,j=ye,ne=0;ne<$;ne++)re!==ne&&(xe=r(xe,c(ae[ne][re])),j=r(j,c(ae[re][ne])));if(!w(xe,0)&&!w(j,0)){for(var ue=De,Me=xe,Ce=s(j,Ae),Le=i(j,Ae);N(Me,Ce);)Me=i(Me,We),ue=i(ue,Ae);for(;b(Me,Le);)Me=s(Me,We),ue=s(ue,Ae);var Ie=N(s(r(Me,j),ue),i(r(xe,j),.95));if(Ie){J=!1;for(var fr=s(1,ue),or=0;or<$;or++)re!==or&&(ae[re][or]=i(ae[re][or],fr),ae[or][re]=i(ae[or][re],ue));pe&&(Je[re]=i(Je[re],fr))}}}}return pe?u(Je):null}function E(ae,$,me,Ee,pe,ge){var Se=Ee==="BigNumber",ye=Ee==="Complex",be=Se?o(0):ye?C(0):0;Se&&(me=o(me));for(var De=0;De<$-2;De++){for(var Ae=0,We=be,Je=De+1;Je<$;Je++){var J=ae[Je][De];N(c(We),c(J))&&(We=J,Ae=Je)}if(!N(c(We),me)){if(Ae!==De+1){var re=ae[Ae];ae[Ae]=ae[De+1],ae[De+1]=re;for(var xe=0;xe<$;xe++){var j=ae[xe][Ae];ae[xe][Ae]=ae[xe][De+1],ae[xe][De+1]=j}if(pe){var ne=ge[Ae];ge[Ae]=ge[De+1],ge[De+1]=ne}}for(var ue=De+2;ue<$;ue++){var Me=s(ae[ue][De],We);if(Me!==0){for(var Ce=0;Ce<$;Ce++)ae[ue][Ce]=t(ae[ue][Ce],i(Me,ae[De+1][Ce]));for(var Le=0;Le<$;Le++)ae[Le][De+1]=r(ae[Le][De+1],i(Me,ae[Le][ue]));if(pe)for(var Ie=0;Ie<$;Ie++)ge[ue][Ie]=t(ge[ue][Ie],i(Me,ge[De+1][Ie]))}}}}return ge}function T(ae,$,me,Ee,pe){var ge=Ee==="BigNumber",Se=Ee==="Complex",ye=ge?o(1):Se?C(1):1;ge&&(me=o(me));for(var be=ar(ae),De=[],Ae=$,We=[],Je=pe?u(Array($).fill(ye)):void 0,J=pe?u(Array(Ae).fill(ye)):void 0,re=0;re<=100;){re+=1;for(var xe=be[Ae-1][Ae-1],j=0;j1&&(J=u(Array(Ae-1).fill(ye)))),Ae-=1,be.pop();for(var Ce=0;Ce2&&(J=u(Array(Ae-2).fill(ye)))),Ae-=2,be.pop(),be.pop();for(var Ie=0;Ie+t(c(Ke),c(Pr))),re>100){var fr=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+De.join(", "));throw fr.values=De,fr.vectors=[],fr}var or=pe?a(Je,W(We,$)):void 0;return{values:De,C:or}}function R(ae,$,me,Ee,pe,ge,Se){var ye=h(me),be=a(ye,ae,me),De=Se==="BigNumber",Ae=Se==="Complex",We=De?o(0):Ae?C(0):0,Je=De?o(1):Ae?C(1):1,J=[],re=[];for(var xe of pe){var j=k(J,xe,w);j===-1?(J.push(xe),re.push(1)):re[j]+=1}for(var ne=[],ue=J.length,Me=Array($).fill(We),Ce=u(Array($).fill(Je)),Le=function(){var or=J[Ie],Ke=t(be,a(or,Ce)),Pr=x(Ke,Me);for(Pr.shift();Pr.lengtha(ce,we)),ne.push(...Pr.map(we=>({value:or,vector:n(we)})))},Ie=0;Ie=5)return null;for(ye=0;;){var be=v(ae,Se);if(N(oe(z(Se,[be])),Ee))break;if(++ye>=10)return null;Se=le(be)}return Se}function K(ae,$,me){var Ee=me==="BigNumber",pe=me==="Complex",ge=Array(ae).fill(0).map(Se=>2*Math.random()-1);return Ee&&(ge=ge.map(Se=>o(Se))),pe&&(ge=ge.map(Se=>C(Se))),ge=z(ge,$),le(ge,me)}function z(ae,$){var me=m(ae);for(var Ee of $)Ee=d(Ee,me),ae=t(ae,a(s(S(Ee,ae),S(Ee,Ee)),Ee));return ae}function oe(ae){return c(l(S(ae,ae)))}function le(ae,$){var me=$==="BigNumber",Ee=$==="Complex",pe=me?o(1):Ee?C(1):1;return a(s(pe,oe(ae)),ae)}return O}function cB(e){var{config:r,addScalar:t,subtract:n,abs:a,atan:i,cos:s,sin:l,multiplyScalar:c,inv:o,bignumber:u,multiply:m,add:d}=e;function h(E,T){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.epsilon,L=arguments.length>3?arguments[3]:void 0,H=arguments.length>4?arguments[4]:void 0;if(L==="number")return y(E,R,H);if(L==="BigNumber")return v(E,R,H);throw TypeError("Unsupported data type: "+L)}function y(E,T,R){var L=E.length,H=Math.abs(T/L),V,W;if(R){W=new Array(L);for(var k=0;k=Math.abs(H);){var K=q[0][0],z=q[0][1];V=x(E[K][K],E[z][z],E[K][z]),E=M(E,V,K,z),R&&(W=C(W,V,K,z)),q=S(E)}for(var oe=Array(L).fill(0),le=0;le=a(H);){var K=q[0][0],z=q[0][1];V=w(E[K][K],E[z][z],E[K][z]),E=N(E,V,K,z),R&&(W=b(W,V,K,z)),q=O(E)}for(var oe=Array(L).fill(0),le=0;le({value:H[$],vector:ae}));return{values:H,eigenvectors:le}}return h}var AG="eigs",MG=["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"],xg=F(AG,MG,e=>{var{config:r,typed:t,matrix:n,addScalar:a,subtract:i,equal:s,abs:l,atan:c,cos:o,sin:u,multiplyScalar:m,divideScalar:d,inv:h,bignumber:y,multiply:v,add:x,larger:w,column:C,flatten:b,number:N,complex:M,sqrt:S,diag:O,size:_,reshape:E,qr:T,usolve:R,usolveAll:L,im:H,re:V,smaller:W,matrixFromColumns:k,dot:q}=e,K=cB({config:r,addScalar:a,subtract:i,column:C,flatten:b,equal:s,abs:l,atan:c,cos:o,sin:u,multiplyScalar:m,inv:h,bignumber:y,complex:M,multiply:v,add:x}),z=fB({config:r,addScalar:a,subtract:i,multiply:v,multiplyScalar:m,flatten:b,divideScalar:d,sqrt:S,abs:l,bignumber:y,diag:O,size:_,reshape:E,qr:T,inv:h,usolve:R,usolveAll:L,equal:s,complex:M,larger:w,smaller:W,matrixFromColumns:k,dot:q});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 ye={matricize:!0};return ht(ye,Se),oe(ge,ye)}});function oe(pe){var ge,Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ye="eigenvectors"in Se?Se.eigenvectors:!0,be=(ge=Se.precision)!==null&&ge!==void 0?ge:r.epsilon,De=le(pe,be,ye);return Se.matricize&&(De.values=n(De.values),ye&&(De.eigenvectors=De.eigenvectors.map(Ae=>{var{value:We,vector:Je}=Ae;return{value:We,vector:n(Je)}}))),ye&&Object.defineProperty(De,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),De}function le(pe,ge,Se){var ye=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($(ye,De,ge)&&(me(ye,De),ae(ye,De,ge))){var Ae=Ee(pe,ye,De);return K(ye,De,ge,Ae,Se)}var We=Ee(pe,ye,De);return z(ye,De,ge,We,Se)}function ae(pe,ge,Se){for(var ye=0;ye{var{typed:r,abs:t,add:n,identity:a,inv:i,multiply:s}=e;return r(lB,{Matrix:function(m){var d=m.size();if(d.length!==2||d[0]!==d[1])throw new RangeError("Matrix must be square (size: "+lr(d)+")");for(var h=d[0],y=1e-15,v=l(m),x=c(v,y),w=x.q,C=x.j,b=s(m,Math.pow(2,-C)),N=a(h),M=a(h),S=1,O=b,_=-1,E=1;E<=w;E++)E>1&&(O=s(O,b),_=-_),S=S*(w-E+1)/((2*w-E+1)*E),N=n(N,s(S,O)),M=n(M,s(S*_,O));for(var T=s(i(M),N),R=0;R{var{typed:r,abs:t,add:n,multiply:a,map:i,sqrt:s,subtract:l,inv:c,size:o,max:u,identity:m}=e,d=1e3,h=1e-6;function y(v){var x,w=0,C=v,b=m(o(v));do{var N=C;if(C=a(.5,n(N,c(b))),b=a(.5,n(b,c(N))),x=u(t(l(C,N))),x>h&&++w>d)throw new Error("computing square root of matrix: iterative method could not converge")}while(x>h);return C}return r(mB,{"Array | Matrix":function(x){var w=Qe(x)?x.size():ur(x);switch(w.length){case 1:if(w[0]===1)return i(x,s);throw new RangeError("Matrix must be square (size: "+lr(w)+")");case 2:{var C=w[0],b=w[1];if(C===b)return y(x);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 pB="sylvester",TG=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],Dg=F(pB,TG,e=>{var{typed:r,schur:t,matrixFromColumns:n,matrix:a,multiply:i,range:s,concat:l,transpose:c,index:o,subset:u,add:m,subtract:d,identity:h,lusolve:y,abs:v}=e;return r(pB,{"Matrix, Matrix, Matrix":x,"Array, Matrix, Matrix":function(C,b,N){return x(a(C),b,N)},"Array, Array, Matrix":function(C,b,N){return x(a(C),a(b),N)},"Array, Matrix, Array":function(C,b,N){return x(a(C),b,a(N))},"Matrix, Array, Matrix":function(C,b,N){return x(C,a(b),N)},"Matrix, Array, Array":function(C,b,N){return x(C,a(b),a(N))},"Matrix, Matrix, Array":function(C,b,N){return x(C,b,a(N))},"Array, Array, Array":function(C,b,N){return x(a(C),a(b),a(N)).toArray()}});function x(w,C,b){for(var N=C.size()[0],M=w.size()[0],S=t(w),O=S.T,_=S.U,E=t(i(-1,C)),T=E.T,R=E.U,L=i(i(c(_),b),R),H=s(0,M),V=[],W=(Ae,We)=>l(Ae,We,1),k=(Ae,We)=>l(Ae,We,0),q=0;q1e-5){for(var K=k(u(L,o(H,q)),u(L,o(H,q+1))),z=0;z{var{typed:r,matrix:t,identity:n,multiply:a,qr:i,norm:s,subtract:l}=e;return r(dB,{Array:function(u){var m=c(t(u));return{U:m.U.valueOf(),T:m.T.valueOf()}},Matrix:function(u){return c(u)}});function c(o){var u=o.size()[0],m=o,d=n(u),h=0,y;do{y=m;var v=i(m),x=v.Q,w=v.R;if(m=a(w,x),d=a(d,x),h++>100)break}while(s(l(m,y))>1e-4);return{U:d,T:m}}});var hB="lyap",_G=["typed","matrix","sylvester","multiply","transpose"],Ng=F(hB,_G,e=>{var{typed:r,matrix:t,sylvester:n,multiply:a,transpose:i}=e;return r(hB,{"Matrix, Matrix":function(l,c){return n(l,i(l),a(-1,c))},"Array, Matrix":function(l,c){return n(t(l),i(t(l)),a(-1,c))},"Matrix, Array":function(l,c){return n(l,i(t(l)),t(a(-1,c)))},"Array, Array":function(l,c){return n(t(l),i(t(l)),t(a(-1,c))).toArray()}})});var OG="divide",BG=["typed","matrix","multiply","equalScalar","divideScalar","inv"],Ag=F(OG,BG,e=>{var{typed:r,matrix:t,multiply:n,equalScalar:a,divideScalar:i,inv:s}=e,l=jr({typed:r,equalScalar:a}),c=kt({typed:r});return r("divide",wm({"Array | Matrix, Array | Matrix":function(u,m){return n(u,s(m))},"DenseMatrix, any":function(u,m){return c(u,m,i,!1)},"SparseMatrix, any":function(u,m){return l(u,m,i,!1)},"Array, any":function(u,m){return c(t(u),m,i,!1).valueOf()},"any, Array | Matrix":function(u,m){return n(u,s(m))}},i.signatures))});var vB="distance",PG=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],Mg=F(vB,PG,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:a,divideScalar:i,deepEqual:s,sqrt:l,abs:c}=e;return r(vB,{"Array, Array, Array":function(M,S,O){if(M.length===2&&S.length===2&&O.length===2){if(!u(M))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 _=n(O[1],S[1]),E=n(S[0],O[0]),T=n(a(O[0],S[1]),a(S[0],O[1]));return x(M[0],M[1],_,E,T)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(M,S,O){if(Object.keys(M).length===2&&Object.keys(S).length===2&&Object.keys(O).length===2){if(!u(M))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(y(S),y(O)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in M&&"pointY"in M&&"lineOnePtX"in S&&"lineOnePtY"in S&&"lineTwoPtX"in O&&"lineTwoPtY"in O){var _=n(O.lineTwoPtY,S.lineOnePtY),E=n(S.lineOnePtX,O.lineTwoPtX),T=n(a(O.lineTwoPtX,S.lineOnePtY),a(S.lineOnePtX,O.lineTwoPtY));return x(M.pointX,M.pointY,_,E,T)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(M,S){if(M.length===2&&S.length===3){if(!u(M))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!m(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return x(M[0],M[1],S[0],S[1],S[2])}else if(M.length===3&&S.length===6){if(!m(M))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(M[0],M[1],M[2],S[0],S[1],S[2],S[3],S[4],S[5])}else if(M.length===S.length&&M.length>0){if(!d(M))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(M,S)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(M,S){if(Object.keys(M).length===2&&Object.keys(S).length===3){if(!u(M))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!m(S))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in M&&"pointY"in M&&"xCoeffLine"in S&&"yCoeffLine"in S&&"constant"in S)return x(M.pointX,M.pointY,S.xCoeffLine,S.yCoeffLine,S.constant);throw new TypeError("Key names do not match")}else if(Object.keys(M).length===3&&Object.keys(S).length===6){if(!m(M))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 M&&"pointY"in M&&"x0"in S&&"y0"in S&&"z0"in S&&"a"in S&&"b"in S&&"c"in S)return w(M.pointX,M.pointY,M.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(M).length===2&&Object.keys(S).length===2){if(!u(M))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 M&&"pointOneY"in M&&"pointTwoX"in S&&"pointTwoY"in S)return C([M.pointOneX,M.pointOneY],[S.pointTwoX,S.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(M).length===3&&Object.keys(S).length===3){if(!m(M))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!m(S))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in M&&"pointOneY"in M&&"pointOneZ"in M&&"pointTwoX"in S&&"pointTwoY"in S&&"pointTwoZ"in S)return C([M.pointOneX,M.pointOneY,M.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(M){if(!v(M))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return b(M)}});function o(N){return typeof N=="number"||rr(N)}function u(N){return N.constructor!==Array&&(N=y(N)),o(N[0])&&o(N[1])}function m(N){return N.constructor!==Array&&(N=y(N)),o(N[0])&&o(N[1])&&o(N[2])}function d(N){return Array.isArray(N)||(N=y(N)),N.every(o)}function h(N){return N.constructor!==Array&&(N=y(N)),o(N[0])&&o(N[1])&&o(N[2])&&o(N[3])&&o(N[4])&&o(N[5])}function y(N){for(var M=Object.keys(N),S=[],O=0;OM.length!==2||!o(M[0])||!o(M[1])))return!1}else if(N[0].length===3&&o(N[0][0])&&o(N[0][1])&&o(N[0][2])){if(N.some(M=>M.length!==3||!o(M[0])||!o(M[1])||!o(M[2])))return!1}else return!1;return!0}function x(N,M,S,O,_){var E=c(t(t(a(S,N),a(O,M)),_)),T=l(t(a(S,S),a(O,O)));return i(E,T)}function w(N,M,S,O,_,E,T,R,L){var H=[n(a(n(_,M),L),a(n(E,S),R)),n(a(n(E,S),T),a(n(O,N),L)),n(a(n(O,N),R),a(n(_,M),T))];H=l(t(t(a(H[0],H[0]),a(H[1],H[1])),a(H[2],H[2])));var V=l(t(t(a(T,T),a(R,R)),a(L,L)));return i(H,V)}function C(N,M){for(var S=N.length,O=0,_=0,E=0;E{var{typed:r,config:t,abs:n,add:a,addScalar:i,matrix:s,multiply:l,multiplyScalar:c,divideScalar:o,subtract:u,smaller:m,equalScalar:d,flatten:h,isZero:y,isNumeric:v}=e;return r("intersect",{"Array, Array, Array":x,"Array, Array, Array, Array":w,"Matrix, Matrix, Matrix":function(R,L,H){var V=x(R.valueOf(),L.valueOf(),H.valueOf());return V===null?null:s(V)},"Matrix, Matrix, Matrix, Matrix":function(R,L,H,V){var W=w(R.valueOf(),L.valueOf(),H.valueOf(),V.valueOf());return W===null?null:s(W)}});function x(T,R,L){if(T=C(T),R=C(R),L=C(L),!N(T))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!N(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!M(L))throw new TypeError("Array with 4 numbers expected as third argument");return E(T[0],T[1],T[2],R[0],R[1],R[2],L[0],L[1],L[2],L[3])}function w(T,R,L,H){if(T=C(T),R=C(R),L=C(L),H=C(H),T.length===2){if(!b(T))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!b(R))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(H))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return S(T,R,L,H)}else if(T.length===3){if(!N(T))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!N(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!N(L))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!N(H))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return _(T[0],T[1],T[2],R[0],R[1],R[2],L[0],L[1],L[2],H[0],H[1],H[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function C(T){return T.length===1?T[0]:T.length>1&&Array.isArray(T[0])&&T.every(R=>Array.isArray(R)&&R.length===1)?h(T):T}function b(T){return T.length===2&&v(T[0])&&v(T[1])}function N(T){return T.length===3&&v(T[0])&&v(T[1])&&v(T[2])}function M(T){return T.length===4&&v(T[0])&&v(T[1])&&v(T[2])&&v(T[3])}function S(T,R,L,H){var V=T,W=L,k=u(V,R),q=u(W,H),K=u(c(k[0],q[1]),c(q[0],k[1]));if(y(K)||m(n(K),t.epsilon))return null;var z=c(q[0],V[1]),oe=c(q[1],V[0]),le=c(q[0],W[1]),ae=c(q[1],W[0]),$=o(i(u(u(z,oe),le),ae),K);return a(l(k,$),V)}function O(T,R,L,H,V,W,k,q,K,z,oe,le){var ae=c(u(T,R),u(L,H)),$=c(u(V,W),u(k,q)),me=c(u(K,z),u(oe,le));return i(i(ae,$),me)}function _(T,R,L,H,V,W,k,q,K,z,oe,le){var ae=O(T,k,z,k,R,q,oe,q,L,K,le,K),$=O(z,k,H,T,oe,q,V,R,le,K,W,L),me=O(T,k,H,T,R,q,V,R,L,K,W,L),Ee=O(z,k,z,k,oe,q,oe,q,le,K,le,K),pe=O(H,T,H,T,V,R,V,R,W,L,W,L),ge=u(c(ae,$),c(me,Ee)),Se=u(c(pe,Ee),c($,$));if(y(Se))return null;var ye=o(ge,Se),be=o(i(ae,c(ye,$)),Ee),De=i(T,c(ye,u(H,T))),Ae=i(R,c(ye,u(V,R))),We=i(L,c(ye,u(W,L))),Je=i(k,c(be,u(z,k))),J=i(q,c(be,u(oe,q))),re=i(K,c(be,u(le,K)));return d(De,Je)&&d(Ae,J)&&d(We,re)?[De,Ae,We]:null}function E(T,R,L,H,V,W,k,q,K,z){var oe=c(T,k),le=c(H,k),ae=c(R,q),$=c(V,q),me=c(L,K),Ee=c(W,K),pe=u(u(u(z,oe),ae),me),ge=u(u(u(i(i(le,$),Ee),oe),ae),me),Se=o(pe,ge),ye=i(T,c(Se,u(H,T))),be=i(R,c(Se,u(V,R))),De=i(L,c(Se,u(W,L)));return[ye,be,De]}});var gB="sum",qG=["typed","config","add","numeric"],nf=F(gB,qG,e=>{var{typed:r,config:t,add:n,numeric:a}=e;return r(gB,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":s,"...":function(c){if(Pa(c))throw new TypeError("Scalar values expected in function sum");return i(c)}});function i(l){var c;return An(l,function(o){try{c=c===void 0?o:n(c,o)}catch(u){throw Et(u,"sum",o)}}),c===void 0&&(c=a(0,t.number)),typeof c=="string"&&(c=a(c,t.number)),c}function s(l,c){try{var o=ko(l,c,n);return o}catch(u){throw Et(u,"sum")}}});var Eg="cumsum",kG=["typed","add","unaryPlus"],af=F(Eg,kG,e=>{var{typed:r,add:t,unaryPlus:n}=e;return r(Eg,{Array:a,Matrix:function(o){return o.create(a(o.valueOf()))},"Array, number | BigNumber":s,"Matrix, number | BigNumber":function(o,u){return o.create(s(o.valueOf(),u))},"...":function(o){if(Pa(o))throw new TypeError("All values expected to be scalar in function cumsum");return a(o)}});function a(c){try{return i(c)}catch(o){throw Et(o,Eg)}}function i(c){if(c.length===0)return[];for(var o=[n(c[0])],u=1;u=u.length)throw new tn(o,u.length);try{return l(c,o)}catch(m){throw Et(m,Eg)}}function l(c,o){var u,m,d;if(o<=0){var h=c[0][0];if(Array.isArray(h)){for(d=Jm(c),m=[],u=0;u{var{typed:r,add:t,divide:n}=e;return r(yB,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":a,"...":function(l){if(Pa(l))throw new TypeError("Scalar values expected in function mean");return i(l)}});function a(s,l){try{var c=ko(s,l,t),o=Array.isArray(s)?ur(s):s.size();return n(c,o[l])}catch(u){throw Et(u,"mean")}}function i(s){var l,c=0;if(An(s,function(o){try{l=l===void 0?o:t(l,o),c++}catch(u){throw Et(u,"mean",o)}}),c===0)throw new Error("Cannot calculate the mean of an empty array");return n(l,c)}});var xB="median",zG=["typed","add","divide","compare","partitionSelect"],Tg=F(xB,zG,e=>{var{typed:r,add:t,divide:n,compare:a,partitionSelect:i}=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 m=u/2-1,d=i(o,m+1),h=o[m],y=0;y0&&(h=o[y]);return c(h,d)}else{var v=i(o,(u-1)/2);return l(v)}}catch(x){throw Et(x,"median")}}var l=r({"number | BigNumber | Complex | Unit":function(u){return u}}),c=r({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(u,m){return n(t(u,m),2)}});return r(xB,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(u,m){throw new Error("median(A, dim) is not yet supported")},"...":function(u){if(Pa(u))throw new TypeError("Scalar values expected in function median");return s(u)}})});var bB="mad",UG=["typed","abs","map","median","subtract"],Fg=F(bB,UG,e=>{var{typed:r,abs:t,map:n,median:a,subtract:i}=e;return r(bB,{"Array | Matrix":s,"...":function(c){return s(c)}});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 c=a(l);return a(n(l,function(o){return t(i(o,c))}))}catch(o){throw o instanceof TypeError&&o.message.indexOf("median")!==-1?new TypeError(o.message.replace("median","mad")):Et(o,"mad")}}});var ND="unbiased",wB="variance",WG=["typed","add","subtract","multiply","divide","apply","isNaN"],sf=F(wB,WG,e=>{var{typed:r,add:t,subtract:n,multiply:a,divide:i,apply:s,isNaN:l}=e;return r(wB,{"Array | Matrix":function(m){return c(m,ND)},"Array | Matrix, string":c,"Array | Matrix, number | BigNumber":function(m,d){return o(m,d,ND)},"Array | Matrix, number | BigNumber, string":o,"...":function(m){return c(m,ND)}});function c(u,m){var d,h=0;if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(An(u,function(x){try{d=d===void 0?x:t(d,x),h++}catch(w){throw Et(w,"variance",x)}}),h===0)throw new Error("Cannot calculate variance of an empty array");var y=i(d,h);if(d=void 0,An(u,function(x){var w=n(x,y);d=d===void 0?a(w,w):t(d,a(w,w))}),l(d))return d;switch(m){case"uncorrected":return i(d,h);case"biased":return i(d,h+1);case"unbiased":{var v=rr(d)?d.mul(0):0;return h===1?v:i(d,h-1)}default:throw new Error('Unknown normalization "'+m+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function o(u,m,d){try{if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return s(u,m,h=>c(h,d))}catch(h){throw Et(h,"variance")}}});var DB="quantileSeq",YG=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],uf=F(DB,YG,e=>{var{typed:r,bignumber:t,add:n,subtract:a,divide:i,multiply:s,partitionSelect:l,compare:c,isInteger:o,smaller:u,smallerEq:m,larger:d}=e,h=Lo({typed:r,isInteger:o});return r(DB,{"Array | Matrix, number | BigNumber":(C,b)=>v(C,b,!1),"Array | Matrix, number | BigNumber, number":(C,b,N)=>y(C,b,!1,N,v),"Array | Matrix, number | BigNumber, boolean":v,"Array | Matrix, number | BigNumber, boolean, number":(C,b,N,M)=>y(C,b,N,M,v),"Array | Matrix, Array | Matrix":(C,b)=>x(C,b,!1),"Array | Matrix, Array | Matrix, number":(C,b,N)=>y(C,b,!1,N,x),"Array | Matrix, Array | Matrix, boolean":x,"Array | Matrix, Array | Matrix, boolean, number":(C,b,N,M)=>y(C,b,N,M,x)});function y(C,b,N,M,S){return h(C,M,O=>S(O,b,N))}function v(C,b,N){var M,S=C.valueOf();if(u(b,0))throw new Error("N/prob must be non-negative");if(m(b,1))return sr(b)?w(S,b,N):t(w(S,b,N));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);M=[];for(var _=0;u(_,b);_++){var E=i(_+1,O);M.push(w(S,E,N))}return sr(b)?M:t(M)}}function x(C,b,N){for(var M=C.valueOf(),S=b.valueOf(),O=[],_=0;_0&&(T=M[L])}return n(s(T,a(1,E)),s(R,E))}});var SB="std",HG=["typed","map","sqrt","variance"],ff=F(SB,HG,e=>{var{typed:r,map:t,sqrt:n,variance:a}=e;return r(SB,{"Array | Matrix":i,"Array | Matrix, string":i,"Array | Matrix, number | BigNumber":i,"Array | Matrix, number | BigNumber, string":i,"...":function(l){return i(l)}});function i(s,l){if(s.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var c=a.apply(null,arguments);return Nt(c)?t(c,n):n(c)}catch(o){throw o instanceof TypeError&&o.message.indexOf(" variance")!==-1?new TypeError(o.message.replace(" variance"," std")):o}}});var NB="corr",$G=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],_g=F(NB,$G,e=>{var{typed:r,matrix:t,sqrt:n,sum:a,add:i,subtract:s,multiply:l,pow:c,divide:o}=e;return r(NB,{"Array, Array":function(h,y){return u(h,y)},"Matrix, Matrix":function(h,y){var v=u(h.toArray(),y.toArray());return Array.isArray(v)?t(v):v}});function u(d,h){var y=[];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;vi(S,l(O,h[_])),0),C=a(d.map(S=>c(S,2))),b=a(h.map(S=>c(S,2))),N=s(l(y,w),l(v,x)),M=n(l(s(l(y,C),c(v,2)),s(l(y,b),c(x,2))));return o(N,M)}});var AB="combinations",GG=["typed"],Og=F(AB,GG,e=>{var{typed:r}=e;return r(AB,{"number, number":qw,"BigNumber, BigNumber":function(n,a){var i=n.constructor,s,l,c=n.minus(a),o=new i(1);if(!MB(n)||!MB(a))throw new TypeError("Positive integer value expected in function combinations");if(a.gt(n))throw new TypeError("k must be less than n in function combinations");if(s=o,a.lt(c))for(l=o;l.lte(c);l=l.plus(o))s=s.times(a.plus(l)).dividedBy(l);else for(l=o;l.lte(a);l=l.plus(o))s=s.times(c.plus(l)).dividedBy(l);return s}})});function MB(e){return e.isInteger()&&e.gte(0)}var CB="combinationsWithRep",VG=["typed"],Bg=F(CB,VG,e=>{var{typed:r}=e;return r(CB,{"number, number":function(n,a){if(!Ze(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Ze(a)||a<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(a{var{typed:r,config:t,multiplyScalar:n,pow:a,BigNumber:i,Complex:s}=e;function l(o){if(o.im===0)return Fc(o.re);if(o.re<.5){var u=new s(1-o.re,-o.im),m=new s(Math.PI*o.re,Math.PI*o.im);return new s(Math.PI).div(m.sin()).div(l(u))}o=new s(o.re-1,o.im);for(var d=new s(Fs[0],0),h=1;h2;)d-=2,y+=d,h=h.times(y);return new i(h.toPrecision(i.precision))}});var FB="lgamma",QG=["Complex","typed"],Ig=F(FB,QG,e=>{var{Complex:r,typed:t}=e,n=7,a=7,i=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(FB,{number:_c,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,m=1.1447298858494002,d=.1;if(o.isNaN())return new r(NaN,NaN);if(o.im===0)return new r(_c(o.re),0);if(o.re>=n||Math.abs(o.im)>=a)return l(o);if(o.re<=d){var h=sM(u,o.im)*Math.floor(.5*o.re+.25),y=o.mul(Math.PI).sin().log(),v=s(new r(1-o.re,-o.im));return new r(m,h).sub(y).sub(v)}else return o.im>=0?c(o):c(o.conjugate()).conjugate()}function l(o){for(var u=o.sub(.5).mul(o.log()).sub(o).add(Hw),m=new r(1,0).div(o),d=m.div(o),h=i[0],y=i[1],v=2*d.re,x=d.re*d.re+d.im*d.im,w=2;w<8;w++){var C=y;y=-x*h+i[w],h=v*h+C}var b=m.mul(d.mul(h).add(y));return u.add(b)}function c(o){var u=0,m=0,d=o;for(o=o.add(1);o.re<=n;){d=d.mul(o);var h=d.im<0?1:0;h!==0&&m===0&&u++,m=h,o=o.add(1)}return l(o).sub(d.log()).sub(new r(0,u*2*Math.PI*1))}});var _B="factorial",XG=["typed","gamma"],Rg=F(_B,XG,e=>{var{typed:r,gamma:t}=e;return r(_B,{number:function(a){if(a<0)throw new Error("Value must be non-negative");return t(a+1)},BigNumber:function(a){if(a.isNegative())throw new Error("Value must be non-negative");return t(a.plus(1))},"Array | Matrix":r.referToSelf(n=>a=>je(a,n))})});var OB="kldivergence",JG=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],qg=F(OB,JG,e=>{var{typed:r,matrix:t,divide:n,sum:a,multiply:i,map:s,dotDivide:l,log:c,isNumeric:o}=e;return r(OB,{"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(m,d){var h=d.size().length,y=m.size().length;if(h>1)throw new Error("first object must be one dimensional");if(y>1)throw new Error("second object must be one dimensional");if(h!==y)throw new Error("Length of two vectors must be equal");var v=a(m);if(v===0)throw new Error("Sum of elements in first object must be non zero");var x=a(d);if(x===0)throw new Error("Sum of elements in second object must be non zero");var w=n(m,a(m)),C=n(d,a(d)),b=a(i(w,s(l(w,C),N=>c(N))));return o(b)?b:Number.NaN}});var BB="multinomial",KG=["typed","add","divide","multiply","factorial","isInteger","isPositive"],kg=F(BB,KG,e=>{var{typed:r,add:t,divide:n,multiply:a,factorial:i,isInteger:s,isPositive:l}=e;return r(BB,{"Array | Matrix":function(o){var u=0,m=1;return An(o,function(d){if(!s(d)||!l(d))throw new TypeError("Positive integer value expected in function multinomial");u=t(u,d),m=a(m,i(d))}),n(i(u),m)}})});var PB="permutations",jG=["typed","factorial"],Lg=F(PB,jG,e=>{var{typed:r,factorial:t}=e;return r(PB,{"number | BigNumber":t,"number, number":function(a,i){if(!Ze(a)||a<0)throw new TypeError("Positive integer value expected in function permutations");if(!Ze(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(i>a)throw new TypeError("second argument k must be less than or equal to first argument n");return va(a-i+1,a)},"BigNumber, BigNumber":function(a,i){var s,l;if(!IB(a)||!IB(i))throw new TypeError("Positive integer value expected in function permutations");if(i.gt(a))throw new TypeError("second argument k must be less than or equal to first argument n");var c=a.mul(0).add(1);for(s=c,l=a.minus(i).plus(1);l.lte(a);l=l.plus(1))s=s.times(l);return s}})});function IB(e){return e.isInteger()&&e.gte(0)}var _D=ma(KB(),1),oV=(0,_D.default)(Date.now());function no(e){var r;function t(a){r=a===null?oV:(0,_D.default)(String(a))}t(e);function n(){return r()}return n}var jB="pickRandom",sV=["typed","config","?on"],Ug=F(jB,sV,e=>{var{typed:r,config:t,on:n}=e,a=no(t.randomSeed);return n&&n("config",function(s,l){s.randomSeed!==l.randomSeed&&(a=no(s.randomSeed))}),r(jB,{"Array | Matrix":function(l){return i(l,{})},"Array | Matrix, Object":function(l,c){return i(l,c)},"Array | Matrix, number":function(l,c){return i(l,{number:c})},"Array | Matrix, Array | Matrix":function(l,c){return i(l,{weights:c})},"Array | Matrix, Array | Matrix, number":function(l,c,o){return i(l,{number:o,weights:c})},"Array | Matrix, number, Array | Matrix":function(l,c,o){return i(l,{number:c,weights:o})}});function i(s,l){var{number:c,weights:o,elementWise:u=!0}=l,m=typeof c>"u";m&&(c=1);var d=Qe(s)?s.create:Qe(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 y=0,v=o.length;y"u")C=s[Math.floor(a()*x)];else for(var b=a()*h,N=0,M=s.length;N1)for(var n=0,a=e.shift();n{var{typed:r,config:t,on:n}=e,a=no(t.randomSeed);return n&&n("config",function(l,c){l.randomSeed!==c.randomSeed&&(a=no(l.randomSeed))}),r(eP,{"":()=>s(0,1),number:l=>s(0,l),"number, number":(l,c)=>s(l,c),"Array | Matrix":l=>i(l,0,1),"Array | Matrix, number":(l,c)=>i(l,0,c),"Array | Matrix, number, number":(l,c,o)=>i(l,c,o)});function i(l,c,o){var u=Rc(l.valueOf(),()=>s(c,o));return Qe(l)?l.create(u):u}function s(l,c){return l+a()*(c-l)}});var rP="randomInt",fV=["typed","config","?on"],Yg=F(rP,fV,e=>{var{typed:r,config:t,on:n}=e,a=no(t.randomSeed);return n&&n("config",function(l,c){l.randomSeed!==c.randomSeed&&(a=no(l.randomSeed))}),r(rP,{"":()=>s(0,1),number:l=>s(0,l),"number, number":(l,c)=>s(l,c),"Array | Matrix":l=>i(l,0,1),"Array | Matrix, number":(l,c)=>i(l,0,c),"Array | Matrix, number, number":(l,c,o)=>i(l,c,o)});function i(l,c,o){var u=Rc(l.valueOf(),()=>s(c,o));return Qe(l)?l.create(u):u}function s(l,c){return Math.floor(l+a()*(c-l))}});var tP="stirlingS2",cV=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],Hg=F(tP,cV,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:a,divideScalar:i,pow:s,factorial:l,combinations:c,isNegative:o,isInteger:u,number:m,bignumber:d,larger:h}=e,y=[],v=[];return r(tP,{"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=!(sr(w)&&sr(C)),N=b?v:y,M=b?d:m,S=m(w),O=m(C);if(N[S]&&N[S].length>O)return N[S][O];for(var _=0;_<=S;++_)if(N[_]||(N[_]=[M(_===0?1:0)]),_!==0)for(var E=N[_],T=N[_-1],R=E.length;R<=_&&R<=O;++R)R===_?E[R]=1:E[R]=t(a(M(R),T[R]),T[R-1]);return N[S][O]}})});var nP="bellNumbers",lV=["typed","addScalar","isNegative","isInteger","stirlingS2"],$g=F(nP,lV,e=>{var{typed:r,addScalar:t,isNegative:n,isInteger:a,stirlingS2:i}=e;return r(nP,{"number | BigNumber":function(l){if(!a(l)||n(l))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var c=0,o=0;o<=l;o++)c=t(c,i(l,o));return c}})});var aP="catalan",mV=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],Gg=F(aP,mV,e=>{var{typed:r,addScalar:t,divideScalar:n,multiplyScalar:a,combinations:i,isNegative:s,isInteger:l}=e;return r(aP,{"number | BigNumber":function(o){if(!l(o)||s(o))throw new TypeError("Non-negative integer value expected in function catalan");return n(i(a(o,2),o),t(o,1))}})});var iP="composition",pV=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],Vg=F(iP,pV,e=>{var{typed:r,addScalar:t,combinations:n,isPositive:a,isNegative:i,isInteger:s,larger:l}=e;return r(iP,{"number | BigNumber, number | BigNumber":function(o,u){if(!s(o)||!a(o)||!s(u)||!a(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 oP="leafCount",dV=["parse","typed"],Zg=F(oP,dV,e=>{var{parse:r,typed:t}=e;function n(a){var i=0;return a.forEach(s=>{i+=n(s)}),i||1}return t(oP,{Node:function(i){return n(i)}})});function OD(e){return xr(e)||ct(e)&&e.isUnary()&&xr(e.args[0])}function qc(e){return!!(xr(e)||(yn(e)||ct(e))&&e.args.every(qc)||en(e)&&qc(e.content))}function sP(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function BD(e){for(var r=1;r{var{FunctionNode:r,OperatorNode:t,SymbolNode:n}=e,a=!0,i=!1,s="defaultF",l={add:{trivial:a,total:a,commutative:a,associative:a},unaryPlus:{trivial:a,total:a,commutative:a,associative:a},subtract:{trivial:i,total:a,commutative:i,associative:i},multiply:{trivial:a,total:a,commutative:a,associative:a},divide:{trivial:i,total:a,commutative:i,associative:i},paren:{trivial:a,total:a,commutative:a,associative:i},defaultF:{trivial:i,total:a,commutative:i,associative:i}},c={divide:{total:i},log:{total:i}},o={subtract:{total:i},abs:{trivial:a},log:{total:a}};function u(b,N){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l,S=s;if(typeof b=="string"?S=b:ct(b)?S=b.fn.toString():yn(b)?S=b.name:en(b)&&(S="paren"),Xe(M,S)){var O=M[S];if(Xe(O,N))return O[N];if(Xe(l,S))return l[S][N]}if(Xe(M,s)){var _=M[s];return Xe(_,N)?_[N]:l[s][N]}if(Xe(l,S)){var E=l[S];if(Xe(E,N))return E[N]}return l[s][N]}function m(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return u(b,"commutative",N)}function d(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return u(b,"associative",N)}function h(b,N){var M=BD({},b);for(var S in N)Xe(b,S)?M[S]=BD(BD({},N[S]),b[S]):M[S]=N[S];return M}function y(b,N){if(!b.args||b.args.length===0)return b;b.args=v(b,N);for(var M=0;M2&&d(b,N)){for(var _=b.args.pop();b.args.length>0;)_=M([b.args.pop(),_]);b.args=_.args}}}function w(b,N){if(!(!b.args||b.args.length===0)){for(var M=C(b),S=b.args.length,O=0;O2&&d(b,N)){for(var _=b.args.shift();b.args.length>0;)_=M([_,b.args.shift()]);b.args=_.args}}}function C(b){return ct(b)?function(N){try{return new t(b.op,b.fn,N,b.implicit)}catch(M){return console.error(M),[]}}:function(N){return new r(new n(b.name),N)}}return{createMakeNodeFunction:C,hasProperty:u,isCommutative:m,isAssociative:d,mergeContext:h,flatten:y,allChildren:v,unflattenr:x,unflattenl:w,defaultContext:l,realContext:c,positiveContext:o}});var gV="simplify",yV=["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"],Qg=F(gV,yV,e=>{var{config:r,typed:t,parse:n,add:a,subtract:i,multiply:s,divide:l,pow:c,isZero:o,equal:u,resolve:m,simplifyConstant:d,simplifyCore:h,fraction:y,bignumber:v,mathWithTransform:x,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:N,FunctionNode:M,IndexNode:S,ObjectNode:O,OperatorNode:_,ParenthesisNode:E,SymbolNode:T}=e,{hasProperty:R,isCommutative:L,isAssociative:H,mergeContext:V,flatten:W,unflattenr:k,unflattenl:q,createMakeNodeFunction:K,defaultContext:z,realContext:oe,positiveContext:le}=cf({FunctionNode:M,OperatorNode:_,SymbolNode:T});t.addConversion({from:"Object",to:"Map",convert:ji});var ae=t("simplify",{Node:ye,"Node, Map":(j,ne)=>ye(j,!1,ne),"Node, Map, Object":(j,ne,ue)=>ye(j,!1,ne,ue),"Node, Array":ye,"Node, Array, Map":ye,"Node, Array, Map, Object":ye});t.removeConversion({from:"Object",to:"Map",convert:ji}),ae.defaultContext=z,ae.realContext=oe,ae.positiveContext=le;function $(j){return j.transform(function(ne,ue,Me){return en(ne)?$(ne.content):ne})}var me={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};ae.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 Ee(j,ne){var ue={};if(j.s){var Me=j.s.split("->");if(Me.length===2)ue.l=Me[0],ue.r=Me[1];else throw SyntaxError("Could not parse rule: "+j.s)}else ue.l=j.l,ue.r=j.r;ue.l=$(n(ue.l)),ue.r=$(n(ue.r));for(var Ce of["imposeContext","repeat","assuming"])Ce in j&&(ue[Ce]=j[Ce]);if(j.evaluate&&(ue.evaluate=n(j.evaluate)),H(ue.l,ne)){var Le=!L(ue.l,ne),Ie;Le&&(Ie=Se());var fr=K(ue.l),or=Se();ue.expanded={},ue.expanded.l=fr([ue.l,or]),W(ue.expanded.l,ne),k(ue.expanded.l,ne),ue.expanded.r=fr([ue.r,or]),Le&&(ue.expandedNC1={},ue.expandedNC1.l=fr([Ie,ue.l]),ue.expandedNC1.r=fr([Ie,ue.r]),ue.expandedNC2={},ue.expandedNC2.l=fr([Ie,ue.expanded.l]),ue.expandedNC2.r=fr([Ie,ue.expanded.r]))}return ue}function pe(j,ne){for(var ue=[],Me=0;Me2&&arguments[2]!==void 0?arguments[2]:Bo(),Me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Ce=Me.consoleDebug;ne=pe(ne||ae.rules,Me.context);var Le=m(j,ue);Le=$(Le);for(var Ie={},fr=Le.toString({parenthesis:"all"});!Ie[fr];){Ie[fr]=!0,ge=0;var or=fr;Ce&&console.log("Working on: ",fr);for(var Ke=0;Ke ").concat(ne[Ke].r.toString()))),Ce){var ee=Le.toString({parenthesis:"all"});ee!==or&&(console.log("Applying",Pr,"produced",ee),or=ee)}q(Le,Me.context)}fr=Le.toString({parenthesis:"all"})}return Le}function be(j,ne,ue){var Me=j;if(j)for(var Ce=0;Ce1&&(or=Le(j.args.slice(0,fr))),Ce=j.args.slice(fr),Me=Ce.length===1?Ce[0]:Le(Ce),ue.push(Le([or,Me]))}return ue}function We(j,ne){var ue={placeholders:{}};if(!j.placeholders&&!ne.placeholders)return ue;if(j.placeholders){if(!ne.placeholders)return j}else return ne;for(var Me in j.placeholders)if(Xe(j.placeholders,Me)&&(ue.placeholders[Me]=j.placeholders[Me],Xe(ne.placeholders,Me)&&!xe(j.placeholders[Me],ne.placeholders[Me])))return null;for(var Ce in ne.placeholders)Xe(ne.placeholders,Ce)&&(ue.placeholders[Ce]=ne.placeholders[Ce]);return ue}function Je(j,ne){var ue=[];if(j.length===0||ne.length===0)return ue;for(var Me,Ce=0;Ce2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var or=re(j.args[0],ne.args[1],ue);if(or.length===0)return[];var Ke=re(j.args[1],ne.args[0],ue);if(Ke.length===0)return[];Le=[or,Ke]}Ce=J(Le)}else if(ne.args.length>=2&&j.args.length===2){for(var Pr=Ae(ne,ue),ee=[],ce=0;ce2)throw Error("Unexpected non-binary associative function: "+j.toString());return[]}}else if(j instanceof T){if(j.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(me[j.name]){if(j.name!==ne.name)return[]}else switch(j.name[1]>="a"&&j.name[1]<="z"?j.name.substring(0,2):j.name[0]){case"n":case"_p":Ce[0].placeholders[j.name]=ne;break;case"c":case"cl":if(xr(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"v":if(!xr(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"vl":if(at(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"cd":if(OD(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"vd":if(!OD(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"ce":if(qc(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"ve":if(!qc(ne))Ce[0].placeholders[j.name]=ne;else return[];break;default:throw new Error("Invalid symbol in rule: "+j.name)}}else if(j instanceof N){if(!u(j.value,ne.value))return[]}else return[];return Ce}function xe(j,ne){if(j instanceof N&&ne instanceof N){if(!u(j.value,ne.value))return!1}else if(j instanceof T&&ne instanceof T){if(j.name!==ne.name)return!1}else if(j instanceof _&&ne instanceof _||j instanceof M&&ne instanceof M){if(j instanceof _){if(j.op!==ne.op||j.fn!==ne.fn)return!1}else if(j instanceof M&&j.name!==ne.name)return!1;if(j.args.length!==ne.args.length)return!1;for(var ue=0;ue{var{typed:r,config:t,mathWithTransform:n,matrix:a,fraction:i,bignumber:s,AccessorNode:l,ArrayNode:c,ConstantNode:o,FunctionNode:u,IndexNode:m,ObjectNode:d,OperatorNode:h,SymbolNode:y}=e,{isCommutative:v,isAssociative:x,allChildren:w,createMakeNodeFunction:C}=cf({FunctionNode:u,OperatorNode:h,SymbolNode:y}),b=r("simplifyConstant",{Node:W=>O(V(W,{})),"Node, Object":function(k,q){return O(V(k,q))}});function N(W){return da(W)?W.valueOf():W instanceof Array?W.map(N):Qe(W)?a(N(W.valueOf())):W}function M(W,k,q){try{return n[W].apply(null,k)}catch{return k=k.map(N),E(n[W].apply(null,k),q)}}var S=r({Fraction:R,number:function(k){return k<0?T(new o(-k)):new o(k)},BigNumber:function(k){return k<0?T(new o(-k)):new o(k)},Complex:function(k){throw new Error("Cannot convert Complex number to Node")},string:function(k){return new o(k)},Matrix:function(k){return new c(k.valueOf().map(q=>S(q)))}});function O(W){return Nr(W)?W:S(W)}function _(W,k){var q=k&&k.exactFractions!==!1;if(q&&isFinite(W)&&i){var K=i(W),z=k&&typeof k.fractionsLimit=="number"?k.fractionsLimit:1/0;if(K.valueOf()===W&&K.n0;)if(xr(K[0])&&typeof K[0].value!="string"){var z=E(K.shift().value,q);jt(W)?W=W.items[z-1]:(W=W.valueOf()[z-1],W instanceof Array&&(W=a(W)))}else if(K.length>1&&xr(K[1])&&typeof K[1].value!="string"){var oe=E(K[1].value,q),le=[],ae=jt(W)?W.items:W.valueOf();for(var $ of ae)if(jt($))le.push($.items[oe-1]);else if(Qe(W))le.push($[oe-1]);else break;if(le.length===ae.length)jt(W)?W=new c(le):W=a(le),K.splice(1,1);else break}else break;return K.length===k.dimensions.length?new l(O(W),k):K.length>0?(k=new m(K),new l(O(W),k)):W}if(Ei(W)&&k.dimensions.length===1&&xr(k.dimensions[0])){var me=k.dimensions[0].value;return me in W.properties?W.properties[me]:new o}return new l(O(W),k)}function H(W,k,q,K){var z=k.shift(),oe=k.reduce((le,ae)=>{if(!Nr(ae)){var $=le.pop();if(Nr($))return[$,ae];try{return le.push(M(W,[$,ae],K)),le}catch{le.push($)}}le.push(O(le.pop()));var me=le.length===1?le[0]:q(le);return[q([me,O(ae)])]},[z]);return oe.length===1?oe[0]:q([oe[0],S(oe[1])])}function V(W,k){switch(W.type){case"SymbolNode":return W;case"ConstantNode":switch(typeof W.value){case"number":return E(W.value,k);case"string":return W.value;default:if(!isNaN(W.value))return E(W.value,k)}return W;case"FunctionNode":if(n[W.name]&&n[W.name].rawArgs)return W;{var q=["add","multiply"];if(q.indexOf(W.name)===-1){var K=W.args.map(De=>V(De,k));if(!K.some(Nr))try{return M(W.name,K,k)}catch{}if(W.name==="size"&&K.length===1&&jt(K[0])){for(var z=[],oe=K[0];jt(oe);)z.push(oe.items.length),oe=oe.items[0];return a(z)}return new u(W.name,K.map(O))}}case"OperatorNode":{var le=W.fn.toString(),ae,$,me=C(W);if(ct(W)&&W.isUnary())ae=[V(W.args[0],k)],Nr(ae[0])?$=me(ae):$=M(le,ae,k);else if(x(W,k.context))if(ae=w(W,k.context),ae=ae.map(De=>V(De,k)),v(le,k.context)){for(var Ee=[],pe=[],ge=0;ge1?($=H(le,Ee,me,k),pe.unshift($),$=H(le,pe,me,k)):$=H(le,ae,me,k)}else $=H(le,ae,me,k);else ae=W.args.map(De=>V(De,k)),$=H(le,ae,me,k);return $}case"ParenthesisNode":return V(W.content,k);case"AccessorNode":return L(V(W.object,k),V(W.index,k),k);case"ArrayNode":{var Se=W.items.map(De=>V(De,k));return Se.some(Nr)?new c(Se.map(O)):a(Se)}case"IndexNode":return new m(W.dimensions.map(De=>b(De,k)));case"ObjectNode":{var ye={};for(var be in W.properties)ye[be]=b(W.properties[be],k);return new d(ye)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(W.type))}}return b});var uP="simplifyCore",wV=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Jg=F(uP,wV,e=>{var{typed:r,parse:t,equal:n,isZero:a,add:i,subtract:s,multiply:l,divide:c,pow:o,AccessorNode:u,ArrayNode:m,ConstantNode:d,FunctionNode:h,IndexNode:y,ObjectNode:v,OperatorNode:x,ParenthesisNode:w,SymbolNode:C}=e,b=new d(0),N=new d(1),M=new d(!0),S=new d(!1);function O(R){return ct(R)&&["and","not","or"].includes(R.op)}var{hasProperty:_,isCommutative:E}=cf({FunctionNode:h,OperatorNode:x,SymbolNode:C});function T(R){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H=L?L.context:void 0;if(_(R,"trivial",H)){if(yn(R)&&R.args.length===1)return T(R.args[0],L);var V=!1,W=0;if(R.forEach(pe=>{++W,W===1&&(V=T(pe,L))}),W===1)return V}var k=R;if(yn(k)){var q=iT(k.name);if(q){if(k.args.length>2&&_(k,"associative",H))for(;k.args.length>2;){var K=k.args.pop(),z=k.args.pop();k.args.push(new x(q,k.name,[K,z]))}k=new x(q,k.name,k.args)}else return new h(T(k.fn),k.args.map(pe=>T(pe,L)))}if(ct(k)&&k.isUnary()){var oe=T(k.args[0],L);if(k.op==="~"&&ct(oe)&&oe.isUnary()&&oe.op==="~"||k.op==="not"&&ct(oe)&&oe.isUnary()&&oe.op==="not"&&O(oe.args[0]))return oe.args[0];var le=!0;if(k.op==="-"&&ct(oe)&&(oe.isBinary()&&oe.fn==="subtract"&&(k=new x("-","subtract",[oe.args[1],oe.args[0]]),le=!1),oe.isUnary()&&oe.op==="-"))return oe.args[0];if(le)return new x(k.op,k.fn,[oe])}if(ct(k)&&k.isBinary()){var ae=T(k.args[0],L),$=T(k.args[1],L);if(k.op==="+"){if(xr(ae)&&a(ae.value))return $;if(xr($)&&a($.value))return ae;ct($)&&$.isUnary()&&$.op==="-"&&($=$.args[0],k=new x("-","subtract",[ae,$]))}if(k.op==="-")return ct($)&&$.isUnary()&&$.op==="-"?T(new x("+","add",[ae,$.args[0]]),L):xr(ae)&&a(ae.value)?T(new x("-","unaryMinus",[$])):xr($)&&a($.value)?ae:new x(k.op,k.fn,[ae,$]);if(k.op==="*"){if(xr(ae)){if(a(ae.value))return b;if(n(ae.value,1))return $}if(xr($)){if(a($.value))return b;if(n($.value,1))return ae;if(E(k,H))return new x(k.op,k.fn,[$,ae],k.implicit)}return new x(k.op,k.fn,[ae,$],k.implicit)}if(k.op==="/")return xr(ae)&&a(ae.value)?b:xr($)&&n($.value,1)?ae:new x(k.op,k.fn,[ae,$]);if(k.op==="^"&&xr($)){if(a($.value))return N;if(n($.value,1))return ae}if(k.op==="and"){if(xr(ae))if(ae.value){if(O($))return $;if(xr($))return $.value?M:S}else return S;if(xr($))if($.value){if(O(ae))return ae}else return S}if(k.op==="or"){if(xr(ae)){if(ae.value)return M;if(O($))return $}if(xr($)){if($.value)return M;if(O(ae))return ae}}return new x(k.op,k.fn,[ae,$])}if(ct(k))return new x(k.op,k.fn,k.args.map(pe=>T(pe,L)));if(jt(k))return new m(k.items.map(pe=>T(pe,L)));if(Ln(k))return new u(T(k.object,L),T(k.index,L));if(Jn(k))return new y(k.dimensions.map(pe=>T(pe,L)));if(Ei(k)){var me={};for(var Ee in k.properties)me[Ee]=T(k.properties[Ee],L);return new v(me)}return k}return r(uP,{Node:T,"Node,Object":T})});var DV="resolve",SV=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],Kg=F(DV,SV,e=>{var{typed:r,parse:t,ConstantNode:n,FunctionNode:a,OperatorNode:i,ParenthesisNode:s}=e;function l(c,o){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!o)return c;if(at(c)){if(u.has(c.name)){var m=Array.from(u).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(m,"}"))}var d=o.get(c.name);if(Nr(d)){var h=new Set(u);return h.add(c.name),l(d,o,h)}else return typeof d=="number"?t(String(d)):d!==void 0?new n(d):c}else if(ct(c)){var y=c.args.map(function(x){return l(x,o,u)});return new i(c.op,c.fn,y,c.implicit)}else{if(en(c))return new s(l(c.content,o,u));if(yn(c)){var v=c.args.map(function(x){return l(x,o,u)});return new a(c.name,v)}}return c.map(x=>l(x,o,u))}return r("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(c,o)=>l(c,ji(o)),"Array | Matrix":r.referToSelf(c=>o=>o.map(u=>c(u))),"Array | Matrix, null | undefined":r.referToSelf(c=>o=>o.map(u=>c(u))),"Array, Object":r.referTo("Array,Map",c=>(o,u)=>c(o,ji(u))),"Matrix, Object":r.referTo("Matrix,Map",c=>(o,u)=>c(o,ji(u))),"Array | Matrix, Map":r.referToSelf(c=>(o,u)=>o.map(m=>c(m,u)))})});var fP="symbolicEqual",NV=["parse","simplify","typed","OperatorNode"],jg=F(fP,NV,e=>{var{parse:r,simplify:t,typed:n,OperatorNode:a}=e;function i(s,l){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=new a("-","subtract",[s,l]),u=t(o,{},c);return xr(u)&&!u.value}return n(fP,{"Node, Node":i,"Node, Node, Object":i})});var cP="derivative",AV=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],e0=F(cP,AV,e=>{var{typed:r,config:t,parse:n,simplify:a,equal:i,isZero:s,numeric:l,ConstantNode:c,FunctionNode:o,OperatorNode:u,ParenthesisNode:m,SymbolNode:d}=e;function h(b,N){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},S={};x(S,b,N.name);var O=w(b,S);return M.simplify?a(O):O}r.addConversion({from:"identifier",to:"SymbolNode",convert:n});var y=r(cP,{"Node, SymbolNode":h,"Node, SymbolNode, Object":h});r.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),y._simplify=!0,y.toTex=function(b){return v.apply(null,b.args)};var v=r("_derivTex",{"Node, SymbolNode":function(N,M){return xr(N)&&Tr(N.value)==="string"?v(n(N.value).toString(),M.toString(),1):v(N.toTex(),M.toString(),1)},"Node, ConstantNode":function(N,M){if(Tr(M.value)==="string")return v(N,n(M.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(N,M,S){return v(N.toString(),M.name,S.value)},"string, string, number":function(N,M,S){var O;return S===1?O="{d\\\\over d"+M+"}":O="{d^{"+S+"}\\\\over d"+M+"^{"+S+"}}",O+"\\\\left[".concat(N,"\\\\right]")}}),x=r("constTag",{"Object, ConstantNode, string":function(N,M){return N[M]=!0,!0},"Object, SymbolNode, string":function(N,M,S){return M.name!==S?(N[M]=!0,!0):!1},"Object, ParenthesisNode, string":function(N,M,S){return x(N,M.content,S)},"Object, FunctionAssignmentNode, string":function(N,M,S){return M.params.indexOf(S)===-1?(N[M]=!0,!0):x(N,M.expr,S)},"Object, FunctionNode | OperatorNode, string":function(N,M,S){if(M.args.length>0){for(var O=x(N,M.args[0],S),_=1;_0){var O=N.args.filter(function(W){return M[W]===void 0}),_=O.length===1?O[0]:new u("*","multiply",O),E=S.concat(w(_,M));return new u("*","multiply",E)}return new u("+","add",N.args.map(function(W){return new u("*","multiply",N.args.map(function(k){return k===W?w(k,M):k.clone()}))}))}if(N.op==="/"&&N.isBinary()){var T=N.args[0],R=N.args[1];return M[R]!==void 0?new u("/","divide",[w(T,M),R]):M[T]!==void 0?new u("*","multiply",[new u("-","unaryMinus",[T]),new u("/","divide",[w(R,M),new u("^","pow",[R.clone(),C(2)])])]):new u("/","divide",[new u("-","subtract",[new u("*","multiply",[w(T,M),R.clone()]),new u("*","multiply",[T.clone(),w(R,M)])]),new u("^","pow",[R.clone(),C(2)])])}if(N.op==="^"&&N.isBinary()){var L=N.args[0],H=N.args[1];if(M[L]!==void 0)return xr(L)&&(s(L.value)||i(L.value,1))?C(0):new u("*","multiply",[N,new u("*","multiply",[new o("log",[L.clone()]),w(H.clone(),M)])]);if(M[H]!==void 0){if(xr(H)){if(s(H.value))return C(0);if(i(H.value,1))return w(L,M)}var V=new u("^","pow",[L.clone(),new u("-","subtract",[H,C(1)])]);return new u("*","multiply",[H.clone(),new u("*","multiply",[w(L,M),V])])}return new u("*","multiply",[new u("^","pow",[L.clone(),H.clone()]),new u("+","add",[new u("*","multiply",[w(L,M),new u("/","divide",[H.clone(),L.clone()])]),new u("*","multiply",[w(H,M),new o("log",[L.clone()])])])])}throw new Error('Cannot process operator "'+N.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function C(b,N){return new c(l(b,N||t.number))}return y});var lP="rationalize",MV=["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"],r0=F(lP,MV,e=>{var{config:r,typed:t,equal:n,isZero:a,add:i,subtract:s,multiply:l,divide:c,pow:o,parse:u,simplifyConstant:m,simplifyCore:d,simplify:h,fraction:y,bignumber:v,mathWithTransform:x,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:N,FunctionNode:M,IndexNode:S,ObjectNode:O,OperatorNode:_,SymbolNode:E,ParenthesisNode:T}=e;function R(k){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,z=H(),oe=L(k,q,!0,z.firstRules),le=oe.variables.length,ae={exactFractions:!1},$={exactFractions:!0};if(k=oe.expression,le>=1){k=V(k);var me,Ee,pe=!0,ge=!1;k=h(k,z.firstRules,{},ae);for(var Se;Ee=pe?z.distrDivRules:z.sucDivRules,k=h(k,Ee,{},$),pe=!pe,Se=k.toString(),Se!==me;)ge=!0,me=Se;ge&&(k=h(k,z.firstRulesAgain,{},ae)),k=h(k,z.finalRules,{},ae)}var ye=[],be={};return k.type==="OperatorNode"&&k.isBinary()&&k.op==="/"?(le===1&&(k.args[0]=W(k.args[0],ye),k.args[1]=W(k.args[1])),K&&(be.numerator=k.args[0],be.denominator=k.args[1])):(le===1&&(k=W(k,ye)),K&&(be.numerator=k,be.denominator=null)),K?(be.coefficients=ye,be.variables=oe.variables,be.expression=k,be):k}return t(lP,{Node:R,"Node, boolean":(k,q)=>R(k,{},q),"Node, Object":R,"Node, Object, boolean":R});function L(k,q,K,z){var oe=[],le=h(k,z,q,{exactFractions:!1});K=!!K;var ae="+-*"+(K?"/":"");me(le);var $={};return $.expression=le,$.variables=oe,$;function me(Ee){var pe=Ee.type;if(pe==="FunctionNode")throw new Error("There is an unsolved function call");if(pe==="OperatorNode")if(Ee.op==="^"){if(Ee.args[1].type!=="ConstantNode"||!Ze(parseFloat(Ee.args[1].value)))throw new Error("There is a non-integer exponent");me(Ee.args[0])}else{if(ae.indexOf(Ee.op)===-1)throw new Error("Operator "+Ee.op+" invalid in polynomial expression");for(var ge=0;ge1;if(z==="OperatorNode"&&k.isBinary()){var le=!1,ae;if(k.op==="^"&&(k.args[0].type==="ParenthesisNode"||k.args[0].type==="OperatorNode")&&k.args[1].type==="ConstantNode"&&(ae=parseFloat(k.args[1].value),le=ae>=2&&Ze(ae)),le){if(ae>2){var $=k.args[0],me=new _("^","pow",[k.args[0].cloneDeep(),new N(ae-1)]);k=new _("*","multiply",[$,me])}else k=new _("*","multiply",[k.args[0],k.args[0].cloneDeep()]);oe&&(K==="content"?q.content=k:q.args[K]=k)}}if(z==="ParenthesisNode")V(k.content,k,"content");else if(z!=="ConstantNode"&&z!=="SymbolNode")for(var Ee=0;Ee=0;$--)if(q[$]!==0){var me=new N(le?q[$]:Math.abs(q[$])),Ee=q[$]<0?"-":"+";if($>0){var pe=new E(oe);if($>1){var ge=new N($);pe=new _("^","pow",[pe,ge])}q[$]===-1&&le?me=new _("-","unaryMinus",[pe]):Math.abs(q[$])===1?me=pe:me=new _("*","multiply",[me,pe])}le?ae=me:Ee==="+"?ae=new _("+","add",[ae,me]):ae=new _("-","subtract",[ae,me]),le=!1}if(le)return new N(0);return ae;function Se(ye,be,De){var Ae=ye.type;if(Ae==="FunctionNode")throw new Error("There is an unsolved function call");if(Ae==="OperatorNode"){if("+-*^".indexOf(ye.op)===-1)throw new Error("Operator "+ye.op+" invalid");if(be!==null){if((ye.fn==="unaryMinus"||ye.fn==="pow")&&be.fn!=="add"&&be.fn!=="subtract"&&be.fn!=="multiply")throw new Error("Invalid "+ye.op+" placing");if((ye.fn==="subtract"||ye.fn==="add"||ye.fn==="multiply")&&be.fn!=="add"&&be.fn!=="subtract")throw new Error("Invalid "+ye.op+" placing");if((ye.fn==="subtract"||ye.fn==="add"||ye.fn==="unaryMinus")&&De.noFil!==0)throw new Error("Invalid "+ye.op+" placing")}(ye.op==="^"||ye.op==="*")&&(De.fire=ye.op);for(var We=0;Wez&&(q[Je]=0),q[Je]+=De.cte*(De.oper==="+"?1:-1),z=Math.max(Je,z);return}De.cte=Je,De.fire===""&&(q[0]+=De.cte*(De.oper==="+"?1:-1))}else throw new Error("Type "+Ae+" is not allowed")}}});var mP="zpk2tf",CV=["typed","add","multiply","Complex","number"],t0=F(mP,CV,e=>{var{typed:r,add:t,multiply:n,Complex:a,number:i}=e;return r(mP,{"Array,Array,number":function(o,u,m){return s(o,u,m)},"Array,Array":function(o,u){return s(o,u,1)},"Matrix,Matrix,number":function(o,u,m){return s(o.valueOf(),u.valueOf(),m)},"Matrix,Matrix":function(o,u){return s(o.valueOf(),u.valueOf(),1)}});function s(c,o,u){c.some(C=>C.type==="BigNumber")&&(c=c.map(C=>i(C))),o.some(C=>C.type==="BigNumber")&&(o=o.map(C=>i(C)));for(var m=[a(1,0)],d=[a(1,0)],h=0;h=0&&m-d{var{typed:r,add:t,multiply:n,Complex:a,divide:i,matrix:s}=e;return r(pP,{"Array, Array":function(u,m){var d=c(512);return l(u,m,d)},"Array, Array, Array":function(u,m,d){return l(u,m,d)},"Array, Array, number":function(u,m,d){if(d<0)throw new Error("w must be a positive number");var h=c(d);return l(u,m,h)},"Matrix, Matrix":function(u,m){var d=c(512),{w:h,h:y}=l(u.valueOf(),m.valueOf(),d);return{w:s(h),h:s(y)}},"Matrix, Matrix, Matrix":function(u,m,d){var{h}=l(u.valueOf(),m.valueOf(),d.valueOf());return{h:s(h),w:s(d)}},"Matrix, Matrix, number":function(u,m,d){if(d<0)throw new Error("w must be a positive number");var h=c(d),{h:y}=l(u.valueOf(),m.valueOf(),h);return{h:s(y),w:s(h)}}});function l(o,u,m){for(var d=[],h=[],y=0;y{var{classes:r}=e;return function(n,a){var i=r[a&&a.mathjs];return i&&typeof i.fromJSON=="function"?i.fromJSON(a):a}});var _V="replacer",OV=[],i0=F(_V,OV,()=>function(r,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:t});var dP="12.4.1";var o0=F("true",[],()=>!0),s0=F("false",[],()=>!1),u0=F("null",[],()=>null),f0=ya("Infinity",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1/0):1/0}),c0=ya("NaN",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(NaN):NaN}),l0=ya("pi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?Pc(t):ZM}),m0=ya("tau",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?vE(t):QM}),p0=ya("e",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?dE(t):XM}),d0=ya("phi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?hE(t):JM}),h0=ya("LN2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).ln():Math.LN2}),v0=ya("LN10",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(10).ln():Math.LN10}),g0=ya("LOG2E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(2).ln()):Math.LOG2E}),y0=ya("LOG10E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(10).ln()):Math.LOG10E}),x0=ya("SQRT1_2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t("0.5").sqrt():Math.SQRT1_2}),b0=ya("SQRT2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).sqrt():Math.SQRT2}),w0=ya("i",["Complex"],e=>{var{Complex:r}=e;return r.I}),hP=F("PI",["pi"],e=>{var{pi:r}=e;return r}),vP=F("E",["e"],e=>{var{e:r}=e;return r}),D0=F("version",[],()=>dP);function ya(e,r,t){return F(e,r,t,{recreateOnConfigChange:!0})}var S0=Er("speedOfLight","299792458","m s^-1"),N0=Er("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),A0=Er("planckConstant","6.62607015e-34","J s"),M0=Er("reducedPlanckConstant","1.0545718176461565e-34","J s"),C0=Er("magneticConstant","1.25663706212e-6","N A^-2"),E0=Er("electricConstant","8.8541878128e-12","F m^-1"),T0=Er("vacuumImpedance","376.730313667","ohm"),F0=Er("coulomb","8.987551792261171e9","N m^2 C^-2"),_0=Er("elementaryCharge","1.602176634e-19","C"),O0=Er("bohrMagneton","9.2740100783e-24","J T^-1"),B0=Er("conductanceQuantum","7.748091729863649e-5","S"),P0=Er("inverseConductanceQuantum","12906.403729652257","ohm"),I0=Er("magneticFluxQuantum","2.0678338484619295e-15","Wb"),R0=Er("nuclearMagneton","5.0507837461e-27","J T^-1"),q0=Er("klitzing","25812.807459304513","ohm");var k0=Er("bohrRadius","5.29177210903e-11","m"),L0=Er("classicalElectronRadius","2.8179403262e-15","m"),z0=Er("electronMass","9.1093837015e-31","kg"),U0=Er("fermiCoupling","1.1663787e-5","GeV^-2"),W0=xy("fineStructure",.0072973525693),Y0=Er("hartreeEnergy","4.3597447222071e-18","J"),H0=Er("protonMass","1.67262192369e-27","kg"),$0=Er("deuteronMass","3.3435830926e-27","kg"),G0=Er("neutronMass","1.6749271613e-27","kg"),V0=Er("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),Z0=Er("rydberg","10973731.568160","m^-1"),Q0=Er("thomsonCrossSection","6.6524587321e-29","m^2"),X0=xy("weakMixingAngle",.2229),J0=xy("efimovFactor",22.7),K0=Er("atomicMass","1.66053906660e-27","kg"),j0=Er("avogadro","6.02214076e23","mol^-1"),ey=Er("boltzmann","1.380649e-23","J K^-1"),ry=Er("faraday","96485.33212331001","C mol^-1"),ty=Er("firstRadiation","3.7417718521927573e-16","W m^2"),ny=Er("loschmidt","2.686780111798444e25","m^-3"),ay=Er("gasConstant","8.31446261815324","J K^-1 mol^-1"),iy=Er("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),oy=Er("molarVolume","0.022413969545014137","m^3 mol^-1"),sy=xy("sackurTetrode",-1.16487052358),uy=Er("secondRadiation","0.014387768775039337","m K"),fy=Er("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),cy=Er("wienDisplacement","2.897771955e-3","m K"),ly=Er("molarMass","0.99999999965e-3","kg mol^-1"),my=Er("molarMassC12","11.9999999958e-3","kg mol^-1"),py=Er("gravity","9.80665","m s^-2"),dy=Er("planckLength","1.616255e-35","m"),hy=Er("planckMass","2.176435e-8","kg"),vy=Er("planckTime","5.391245e-44","s"),gy=Er("planckCharge","1.87554603778e-18","C"),yy=Er("planckTemperature","1.416785e+32","K");function Er(e,r,t){var n=["config","Unit","BigNumber"];return F(e,n,a=>{var{config:i,Unit:s,BigNumber:l}=a,c=i.number==="BigNumber"?new l(r):parseFloat(r),o=new s(c,t);return o.fixPrefix=!0,o})}function xy(e,r){var t=["config","BigNumber"];return F(e,t,n=>{var{config:a,BigNumber:i}=n;return a.number==="BigNumber"?new i(r):r})}var BV="apply",PV=["typed","isInteger"],by=F(BV,PV,e=>{var{typed:r,isInteger:t}=e,n=Lo({typed:r,isInteger:t});return r("apply",{"...any":function(i){var s=i[1];sr(s)?i[1]=s-1:rr(s)&&(i[1]=s.minus(1));try{return n.apply(null,i)}catch(l){throw mt(l)}}})},{isTransformFunction:!0});var IV="column",RV=["typed","Index","matrix","range"],wy=F(IV,RV,e=>{var{typed:r,Index:t,matrix:n,range:a}=e,i=Wu({typed:r,Index:t,matrix:n,range:a});return r("column",{"...any":function(l){var c=l.length-1,o=l[c];sr(o)&&(l[c]=o-1);try{return i.apply(null,l)}catch(u){throw mt(u)}}})},{isTransformFunction:!0});function lf(e,r,t){var n=e.filter(function(c){return at(c)&&!(c.name in r)&&!t.has(c.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var a=n.name,i=new Map,s=new Eu(t,i,new Set([a])),l=e.compile();return function(o){return i.set(a,o),l.evaluate(s)}}var qV="filter",kV=["typed"],Dy=F(qV,kV,e=>{var{typed:r}=e;function t(a,i,s){var l,c;return a[0]&&(l=a[0].compile().evaluate(s)),a[1]&&(at(a[1])||Oa(a[1])?c=a[1].compile().evaluate(s):c=lf(a[1],i,s)),n(l,c)}t.rawArgs=!0;var n=r("filter",{"Array, function":gP,"Matrix, function":function(i,s){return i.create(gP(i.toArray(),s))},"Array, RegExp":Mu,"Matrix, RegExp":function(i,s){return i.create(Mu(i.toArray(),s))}});return t},{isTransformFunction:!0});function gP(e,r){return _m(e,function(t,n,a){return Ra(r,t,[n+1],a,"filter")})}var LV="forEach",zV=["typed"],Sy=F(LV,zV,e=>{var{typed:r}=e;function t(a,i,s){var l,c;return a[0]&&(l=a[0].compile().evaluate(s)),a[1]&&(at(a[1])||Oa(a[1])?c=a[1].compile().evaluate(s):c=lf(a[1],i,s)),n(l,c)}t.rawArgs=!0;var n=r("forEach",{"Array | Matrix, function":function(i,s){var l=function c(o,u){if(Array.isArray(o))_o(o,function(m,d){c(m,u.concat(d+1))});else return Ra(s,o,u,i,"forEach")};l(i.valueOf(),[])}});return t},{isTransformFunction:!0});var UV="index",WV=["Index","getMatrixDataType"],Ny=F(UV,WV,e=>{var{Index:r,getMatrixDataType:t}=e;return function(){for(var a=[],i=0,s=arguments.length;i0?0:2;else if(l&&l.isSet===!0)l=l.map(function(o){return o-1});else if(Mr(l)||Qe(l))t(l)!=="boolean"&&(l=l.map(function(o){return o-1}));else if(sr(l))l--;else if(rr(l))l=l.toNumber()-1;else if(typeof l!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");a[i]=l}var c=new r;return r.apply(c,a),c}},{isTransformFunction:!0});var YV="map",HV=["typed"],Ay=F(YV,HV,e=>{var{typed:r}=e;function t(a,i,s){var l,c;return a[0]&&(l=a[0].compile().evaluate(s)),a[1]&&(at(a[1])||Oa(a[1])?c=a[1].compile().evaluate(s):c=lf(a[1],i,s)),n(l,c)}t.rawArgs=!0;var n=r("map",{"Array, function":function(i,s){return yP(i,s,i)},"Matrix, function":function(i,s){return i.create(yP(i.valueOf(),s,i))}});return t},{isTransformFunction:!0});function yP(e,r,t){function n(a,i){return Array.isArray(a)?Kn(a,function(s,l){return n(s,i.concat(l+1))}):Ra(r,a,i,t,"map")}return n(e,[])}function Cn(e){if(e.length===2&&Nt(e[0])){e=e.slice();var r=e[1];sr(r)?e[1]=r-1:rr(r)&&(e[1]=r.minus(1))}return e}var $V="max",GV=["typed","config","numeric","larger"],My=F($V,GV,e=>{var{typed:r,config:t,numeric:n,larger:a}=e,i=ef({typed:r,config:t,numeric:n,larger:a});return r("max",{"...any":function(l){l=Cn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var VV="mean",ZV=["typed","add","divide"],Cy=F(VV,ZV,e=>{var{typed:r,add:t,divide:n}=e,a=of({typed:r,add:t,divide:n});return r("mean",{"...any":function(s){s=Cn(s);try{return a.apply(null,s)}catch(l){throw mt(l)}}})},{isTransformFunction:!0});var QV="min",XV=["typed","config","numeric","smaller"],Ey=F(QV,XV,e=>{var{typed:r,config:t,numeric:n,smaller:a}=e,i=rf({typed:r,config:t,numeric:n,smaller:a});return r("min",{"...any":function(l){l=Cn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var JV="range",KV=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Ty=F(JV,KV,e=>{var{typed:r,config:t,matrix:n,bignumber:a,smaller:i,smallerEq:s,larger:l,largerEq:c,add:o,isPositive:u}=e,m=$u({typed:r,config:t,matrix:n,bignumber:a,smaller:i,smallerEq:s,larger:l,largerEq:c,add:o,isPositive:u});return r("range",{"...any":function(h){var y=h.length-1,v=h[y];return typeof v!="boolean"&&h.push(!0),m.apply(null,h)}})},{isTransformFunction:!0});var jV="row",eZ=["typed","Index","matrix","range"],Fy=F(jV,eZ,e=>{var{typed:r,Index:t,matrix:n,range:a}=e,i=Gu({typed:r,Index:t,matrix:n,range:a});return r("row",{"...any":function(l){var c=l.length-1,o=l[c];sr(o)&&(l[c]=o-1);try{return i.apply(null,l)}catch(u){throw mt(u)}}})},{isTransformFunction:!0});var rZ="subset",tZ=["typed","matrix","zeros","add"],_y=F(rZ,tZ,e=>{var{typed:r,matrix:t,zeros:n,add:a}=e,i=Vu({typed:r,matrix:t,zeros:n,add:a});return r("subset",{"...any":function(l){try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var nZ="concat",aZ=["typed","matrix","isInteger"],Oy=F(nZ,aZ,e=>{var{typed:r,matrix:t,isInteger:n}=e,a=Uu({typed:r,matrix:t,isInteger:n});return r("concat",{"...any":function(s){var l=s.length-1,c=s[l];sr(c)?s[l]=c-1:rr(c)&&(s[l]=c.minus(1));try{return a.apply(null,s)}catch(o){throw mt(o)}}})},{isTransformFunction:!0});var xP="diff",iZ=["typed","matrix","subtract","number","bignumber"],By=F(xP,iZ,e=>{var{typed:r,matrix:t,subtract:n,number:a,bignumber:i}=e,s=Yu({typed:r,matrix:t,subtract:n,number:a,bignumber:i});return r(xP,{"...any":function(c){c=Cn(c);try{return s.apply(null,c)}catch(o){throw mt(o)}}})},{isTransformFunction:!0});var oZ="std",sZ=["typed","map","sqrt","variance"],Py=F(oZ,sZ,e=>{var{typed:r,map:t,sqrt:n,variance:a}=e,i=ff({typed:r,map:t,sqrt:n,variance:a});return r("std",{"...any":function(l){l=Cn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var bP="sum",uZ=["typed","config","add","numeric"],Iy=F(bP,uZ,e=>{var{typed:r,config:t,add:n,numeric:a}=e,i=nf({typed:r,config:t,add:n,numeric:a});return r(bP,{"...any":function(l){l=Cn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var fZ="quantileSeq",cZ=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Ry=F(fZ,cZ,e=>{var{typed:r,bignumber:t,add:n,subtract:a,divide:i,multiply:s,partitionSelect:l,compare:c,isInteger:o,smaller:u,smallerEq:m,larger:d}=e,h=uf({typed:r,bignumber:t,add:n,subtract:a,divide:i,multiply:s,partitionSelect:l,compare:c,isInteger:o,smaller:u,smallerEq:m,larger:d});return r("quantileSeq",{"Array | Matrix, number | BigNumber":h,"Array | Matrix, number | BigNumber, number":(v,x,w)=>h(v,x,y(w)),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(v,x,w,C)=>h(v,x,w,y(C)),"Array | Matrix, Array | Matrix":h,"Array | Matrix, Array | Matrix, number":(v,x,w)=>h(v,x,y(w)),"Array | Matrix, Array | Matrix, boolean":h,"Array | Matrix, Array | Matrix, boolean, number":(v,x,w,C)=>h(v,x,w,y(C))});function y(v){return Cn([[],v])[1]}},{isTransformFunction:!0});var wP="cumsum",lZ=["typed","add","unaryPlus"],qy=F(wP,lZ,e=>{var{typed:r,add:t,unaryPlus:n}=e,a=af({typed:r,add:t,unaryPlus:n});return r(wP,{"...any":function(s){if(s.length===2&&Nt(s[0])){var l=s[1];sr(l)?s[1]=l-1:rr(l)&&(s[1]=l.minus(1))}try{return a.apply(null,s)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var DP="variance",mZ=["typed","add","subtract","multiply","divide","apply","isNaN"],ky=F(DP,mZ,e=>{var{typed:r,add:t,subtract:n,multiply:a,divide:i,apply:s,isNaN:l}=e,c=sf({typed:r,add:t,subtract:n,multiply:a,divide:i,apply:s,isNaN:l});return r(DP,{"...any":function(u){u=Cn(u);try{return c.apply(null,u)}catch(m){throw mt(m)}}})},{isTransformFunction:!0});var SP="print",pZ=["typed","matrix","zeros","add"],Ly=F(SP,pZ,e=>{var{typed:r,matrix:t,zeros:n,add:a}=e,i=Qu({typed:r,matrix:t,zeros:n,add:a});return r(SP,{"string, Object | Array":function(c,o){return i(s(c),o)},"string, Object | Array, number | Object":function(c,o,u){return i(s(c),o,u)}});function s(l){return l.replace(qd,c=>{var o=c.slice(1).split("."),u=o.map(function(m){return!isNaN(m)&&m.length>0?parseInt(m)-1:m});return"$"+u.join(".")})}},{isTransformFunction:!0});var dZ="and",hZ=["typed","matrix","zeros","add","equalScalar","not","concat"],zy=F(dZ,hZ,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s}=e,l=ju({typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s});function c(o,u,m){var d=o[0].compile().evaluate(m);if(!Nt(d)&&!l(d,!0))return!1;var h=o[1].compile().evaluate(m);return l(d,h)}return c.rawArgs=!0,c},{isTransformFunction:!0});var vZ="or",gZ=["typed","matrix","equalScalar","DenseMatrix","concat"],Uy=F(vZ,gZ,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=e,s=zu({typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i});function l(c,o,u){var m=c[0].compile().evaluate(u);if(!Nt(m)&&s(m,!1))return!0;var d=c[1].compile().evaluate(u);return s(m,d)}return l.rawArgs=!0,l},{isTransformFunction:!0});var yZ="bitAnd",xZ=["typed","matrix","zeros","add","equalScalar","not","concat"],Wy=F(yZ,xZ,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s}=e,l=ku({typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s});function c(o,u,m){var d=o[0].compile().evaluate(m);if(!Nt(d)){if(isNaN(d))return NaN;if(d===0||d===!1)return 0}var h=o[1].compile().evaluate(m);return l(d,h)}return c.rawArgs=!0,c},{isTransformFunction:!0});var bZ="bitOr",wZ=["typed","matrix","equalScalar","DenseMatrix","concat"],Yy=F(bZ,wZ,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=e,s=Lu({typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i});function l(c,o,u){var m=c[0].compile().evaluate(u);if(!Nt(m)){if(isNaN(m))return NaN;if(m===-1)return-1;if(m===!0)return 1}var d=c[1].compile().evaluate(u);return s(m,d)}return l.rawArgs=!0,l},{isTransformFunction:!0});var Ge=Ym({config:Oe}),pt=Hm({}),ID=p0({BigNumber:Ge,config:Oe}),NP=s0({}),AP=W0({BigNumber:Ge,config:Oe}),Wo=$m({}),RD=w0({Complex:pt}),MP=f0({BigNumber:Ge,config:Oe}),CP=v0({BigNumber:Ge,config:Oe}),EP=y0({BigNumber:Ge,config:Oe}),kc=Vm({}),TP=c0({BigNumber:Ge,config:Oe}),FP=u0({}),_P=d0({BigNumber:Ge,config:Oe}),OP=Gm({}),qD=Im({}),BP=x0({BigNumber:Ge,config:Oe}),PP=sy({BigNumber:Ge,config:Oe}),kD=m0({BigNumber:Ge,config:Oe}),IP=o0({}),RP=D0({}),Fr=Qm({Matrix:kc}),qP=J0({BigNumber:Ge,config:Oe}),kP=h0({BigNumber:Ge,config:Oe}),Hy=l0({BigNumber:Ge,config:Oe}),LP=i0({}),zP=b0({BigNumber:Ge,config:Oe}),te=Pm({BigNumber:Ge,Complex:pt,DenseMatrix:Fr,Fraction:Wo}),$y=Sp({BigNumber:Ge,config:Oe,typed:te}),UP=X0({BigNumber:Ge,config:Oe}),En=Np({typed:te}),WP=_h({Complex:pt,config:Oe,typed:te}),YP=Bh({BigNumber:Ge,typed:te}),HP=Ih({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),Qt=Mp({typed:te}),$P=Kp({typed:te}),GP=kh({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),VP=zh({typed:te}),LD=Uh({typed:te}),ZP=Yh({Complex:pt,config:Oe,typed:te}),ta=dp({BigNumber:Ge,typed:te}),QP=Xp({typed:te}),XP=pp({typed:te}),JP=Xm({typed:te}),Lc=Og({typed:te}),zc=hp({Complex:pt,typed:te}),Yo=jp({typed:te}),Gy=Hh({typed:te}),KP=Gh({BigNumber:Ge,typed:te}),jP=Zh({BigNumber:Ge,typed:te}),eI=Fp({typed:te}),Ir=fp({config:Oe,typed:te}),rI=Td({typed:te}),zD=_p({typed:te}),tI=Op({Complex:pt,typed:te}),nI=sd({typed:te}),aI=fd({typed:te}),mf=Bd({typed:te}),Vy=cd({typed:te}),iI=Rd({format:mf,typed:te}),Zy=ed({typed:te}),zn=jm({typed:te}),ao=rp({typed:te}),Ho=ap({typed:te}),La=ip({typed:te}),oI=g0({BigNumber:Ge,config:Oe}),sI=Ig({Complex:pt,typed:te}),uI=Rp({Complex:pt,config:Oe,typed:te}),UD=qp({Complex:pt,config:Oe,typed:te}),$o=pd({typed:te}),Ot=kp({typed:te}),Uc=td({typed:te}),Bi=lp({typed:te}),fI=Id({format:mf,typed:te}),cI=Ug({config:Oe,typed:te}),lI=Qu({typed:te}),mI=Wg({config:Oe,typed:te}),Qy=rd({typed:te}),pI=Xh({BigNumber:Ge,typed:te}),WD=Up({BigNumber:Ge,Fraction:Wo,complex:zc,typed:te}),Wc=Kh({typed:te}),Pi=cp({Matrix:kc,equalScalar:Ir,typed:te}),dI=wp({typed:te}),hI=Yp({typed:te}),vI=mp({typed:te}),xa=Cp({typed:te}),gI=ev({typed:te}),YD=sp({typed:te}),yI=Oh({Complex:pt,config:Oe,typed:te}),xI=Rh({BigNumber:Ge,typed:te}),Xy=Lo({isInteger:zn,typed:te}),bI=qh({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),wI=Pd({format:mf,typed:te}),DI=Bg({typed:te}),SI=$h({typed:te}),NI=Qh({BigNumber:Ge,typed:te}),pf=op({typed:te}),AI=Ld({typed:te}),MI=Yg({config:Oe,typed:te}),CI=Jh({BigNumber:Ge,typed:te}),EI=jh({typed:te}),TI=Th({SparseMatrix:Pi,typed:te}),za=Wp({Complex:pt,config:Oe,typed:te}),FI=rv({typed:te}),fi=Dp({typed:te}),_I=Ph({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),OI=Vh({BigNumber:Ge,typed:te}),Ps=vp({Fraction:Wo,typed:te}),Go=tp({typed:te}),$e=gp({DenseMatrix:Fr,Matrix:kc,SparseMatrix:Pi,typed:te}),BI=yp({isZero:La,matrix:$e,typed:te}),PI=_d({isNaN:pf,isNumeric:Go,typed:te}),Ua=zd({bignumber:ta,fraction:Ps,number:Bi}),HD=Od({config:Oe,multiplyScalar:Ot,numeric:Ua,typed:te}),$D=gd({isInteger:zn,matrix:$e,typed:te}),cn=wd({matrix:$e,config:Oe,typed:te}),II=Dd({matrix:$e,typed:te}),df=Sd({matrix:$e,typed:te}),GD=$p({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),ln=Ad({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),RI=Lh({Complex:pt,config:Oe,typed:te}),VD=Ep({BigNumber:Ge,Complex:pt,Fraction:Wo,config:Oe,isNegative:ao,matrix:$e,typed:te,unaryMinus:fi}),Gr=Uu({isInteger:zn,matrix:$e,typed:te}),qI=ad({prod:HD,size:cn,typed:te}),Jy=Nd({conj:Yo,transpose:df,typed:te}),ZD=od({DenseMatrix:Fr,SparseMatrix:Pi,matrix:$e,typed:te}),Mt=Ud({numeric:Ua,typed:te}),hf=Zd({DenseMatrix:Fr,concat:Gr,divideScalar:Mt,equalScalar:Ir,matrix:$e,typed:te}),ba=sh({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),vf=ud({matrix:$e,typed:te}),kI=np({isNumeric:Go,typed:te}),io=ld({BigNumber:Ge,DenseMatrix:Fr,SparseMatrix:Pi,config:Oe,matrix:$e,typed:te}),LI=md({matrix:$e,multiplyScalar:Ot,typed:te}),Yc=vh({DenseMatrix:Fr,concat:Gr,config:Oe,matrix:$e,typed:te}),zI=jd({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),QD=Qd({DenseMatrix:Fr,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te}),Ky=bp({flatten:vf,matrix:$e,size:cn,typed:te}),UI=zp({BigNumber:Ge,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),WI=dd({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),jy=og({addScalar:Qt,complex:zc,conj:Yo,divideScalar:Mt,equal:ba,identity:io,isZero:La,matrix:$e,multiplyScalar:Ot,sign:WD,sqrt:za,subtractScalar:xa,typed:te,unaryMinus:fi,zeros:ln}),YI=yd({config:Oe,matrix:$e}),HI=eh({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),Is=Yd({BigNumber:Ge,DenseMatrix:Fr,config:Oe,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),Tn=ch({DenseMatrix:Fr,concat:Gr,config:Oe,matrix:$e,typed:te}),Bt=Hp({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,subtractScalar:xa,typed:te,unaryMinus:fi}),$I=kd({concat:Gr,matrix:$e,typed:te}),GI=xh({DenseMatrix:Fr,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,typed:te}),ex=Xd({DenseMatrix:Fr,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te}),VI=nd({DenseMatrix:Fr,concat:Gr,matrix:$e,typed:te}),Lr=mv({DenseMatrix:Fr,SparseMatrix:Pi,addScalar:Qt,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),ZI=Wh({BigNumber:Ge,DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),QI=ku({concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),XI=Lu({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),JI=Jp({DenseMatrix:Fr,concat:Gr,matrix:$e,typed:te}),KI=Gg({addScalar:Qt,combinations:Lc,divideScalar:Mt,isInteger:zn,isNegative:ao,multiplyScalar:Ot,typed:te}),Vo=nh({BigNumber:Ge,DenseMatrix:Fr,Fraction:Wo,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,typed:te}),XD=ih({concat:Gr,matrix:$e,typed:te}),jI=af({add:Lr,typed:te,unaryPlus:$y}),rx=gh({equal:ba,typed:te}),e4=Yu({matrix:$e,number:Bi,subtract:Bt,typed:te}),r4=Mg({abs:En,addScalar:Qt,deepEqual:rx,divideScalar:Mt,multiplyScalar:Ot,sqrt:za,subtractScalar:xa,typed:te}),Hc=hv({addScalar:Qt,conj:Yo,multiplyScalar:Ot,size:cn,typed:te}),t4=uh({compareText:XD,isZero:La,typed:te}),JD=Pu({DenseMatrix:Fr,config:Oe,equalScalar:Ir,matrix:$e,round:Is,typed:te,zeros:ln}),n4=Pp({BigNumber:Ge,DenseMatrix:Fr,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,round:Is,typed:te,zeros:ln}),a4=pv({abs:En,addScalar:Qt,divideScalar:Mt,isPositive:Ho,multiplyScalar:Ot,smaller:Tn,sqrt:za,typed:te}),KD=Dh({DenseMatrix:Fr,smaller:Tn}),bn=Sh({ImmutableDenseMatrix:KD,getMatrixDataType:Vy}),Fn=dh({DenseMatrix:Fr,concat:Gr,config:Oe,matrix:$e,typed:te}),tx=Hd({Complex:pt,config:Oe,divideScalar:Mt,typed:te}),i4=Jd({DenseMatrix:Fr,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te}),o4=xp({flatten:vf,matrix:$e,size:cn,typed:te}),s4=rf({config:Oe,numeric:Ua,smaller:Tn,typed:te}),jD=Iu({DenseMatrix:Fr,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,round:Is,typed:te,zeros:ln}),it=Lp({addScalar:Qt,dot:Hc,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,typed:te}),u4=Gd({Complex:pt,config:Oe,divideScalar:Mt,typed:te}),f4=zu({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),$c=bh({compare:Vo,isNaN:pf,isNumeric:Go,typed:te}),c4=rh({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),eS=fg({SparseMatrix:Pi,abs:En,add:Lr,divideScalar:Mt,larger:Fn,largerEq:Yc,multiply:it,subtract:Bt,transpose:df,typed:te}),na=Vu({add:Lr,matrix:$e,typed:te,zeros:ln}),nx=nf({add:Lr,config:Oe,numeric:Ua,typed:te}),l4=vv({add:Lr,matrix:$e,typed:te}),rS=Kd({DenseMatrix:Fr,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te}),m4=t0({Complex:pt,add:Lr,multiply:it,number:Bi,typed:te}),ax=Tp({DenseMatrix:Fr,config:Oe,equalScalar:Ir,matrix:$e,round:Is,typed:te,zeros:ln}),ci=ah({compare:Vo,typed:te}),p4=Vg({addScalar:Qt,combinations:Lc,isInteger:zn,isNegative:ao,isPositive:Ho,larger:Fn,typed:te}),d4=id({matrix:$e,multiply:it,subtract:Bt,typed:te}),tS=vg({divideScalar:Mt,isZero:La,matrix:$e,multiply:it,subtractScalar:xa,typed:te,unaryMinus:fi}),h4=Zp({concat:Gr,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,typed:te}),nS=Nh({larger:Fn,smaller:Tn}),aS=Bp({Complex:pt,DenseMatrix:Fr,ceil:ax,equalScalar:Ir,floor:JD,matrix:$e,typed:te,zeros:ln}),iS=gv({Index:bn,typed:te}),v4=Cg({abs:En,add:Lr,addScalar:Qt,config:Oe,divideScalar:Mt,equalScalar:Ir,flatten:vf,isNumeric:Go,isZero:La,matrix:$e,multiply:it,multiplyScalar:Ot,smaller:Tn,subtract:Bt,typed:te}),g4=Gp({BigNumber:Ge,add:Lr,config:Oe,equal:ba,isInteger:zn,mod:jD,smaller:Tn,typed:te,xgcd:GD}),y4=Ip({concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),x4=$d({Complex:pt,config:Oe,divideScalar:Mt,log:tx,typed:te}),ix=ef({config:Oe,larger:Fn,numeric:Ua,typed:te}),b4=tv({DenseMatrix:Fr,Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),w4=av({DenseMatrix:Fr,Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),D4=ov({Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),S4=uv({Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),Rs=mh({DenseMatrix:Fr,concat:Gr,config:Oe,matrix:$e,typed:te}),N4=wh({compare:Vo,compareNatural:ci,matrix:$e,typed:te}),A4=ju({concat:Gr,equalScalar:Ir,matrix:$e,not:Uc,typed:te,zeros:ln}),qs=$u({bignumber:ta,matrix:$e,add:Lr,config:Oe,isPositive:Ho,larger:Fn,largerEq:Yc,smaller:Tn,smallerEq:Rs,typed:te}),M4=Gu({Index:bn,matrix:$e,range:qs,typed:te}),oS=nv({DenseMatrix:Fr,Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),C4=sv({Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),sS=cv({Index:bn,concat:Gr,setDifference:oS,size:cn,subset:na,typed:te}),uS=Ah({FibonacciHeap:nS,addScalar:Qt,equalScalar:Ir}),fS=Wu({Index:bn,matrix:$e,range:qs,typed:te}),Zo=gg({abs:En,addScalar:Qt,det:tS,divideScalar:Mt,identity:io,matrix:$e,multiply:it,typed:te,unaryMinus:fi}),cS=ig({DenseMatrix:Fr,Spa:uS,SparseMatrix:Pi,abs:En,addScalar:Qt,divideScalar:Mt,equalScalar:Ir,larger:Fn,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te,unaryMinus:fi}),E4=yg({Complex:pt,add:Lr,ctranspose:Jy,deepEqual:rx,divideScalar:Mt,dot:Hc,dotDivide:hf,equal:ba,inv:Zo,matrix:$e,multiply:it,typed:te}),wa=Wd({Complex:pt,config:Oe,fraction:Ps,identity:io,inv:Zo,matrix:$e,multiply:it,number:Bi,typed:te}),lS=iv({DenseMatrix:Fr,Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),T4=lv({Index:bn,concat:Gr,setIntersect:lS,setSymDifference:sS,size:cn,subset:na,typed:te}),F4=wg({abs:En,add:Lr,identity:io,inv:Zo,map:$o,max:ix,multiply:it,size:cn,sqrt:za,subtract:Bt,typed:te}),wr=Ch({BigNumber:Ge,Complex:pt,Fraction:Wo,abs:En,addScalar:Qt,config:Oe,divideScalar:Mt,equal:ba,fix:aS,format:mf,isNumeric:Go,multiplyScalar:Ot,number:Bi,pow:wa,round:Is,subtractScalar:xa}),_4=T0({BigNumber:Ge,Unit:wr,config:Oe}),O4=cy({BigNumber:Ge,Unit:wr,config:Oe}),B4=K0({BigNumber:Ge,Unit:wr,config:Oe}),P4=O0({BigNumber:Ge,Unit:wr,config:Oe}),I4=ey({BigNumber:Ge,Unit:wr,config:Oe}),R4=B0({BigNumber:Ge,Unit:wr,config:Oe}),q4=F0({BigNumber:Ge,Unit:wr,config:Oe}),k4=$0({BigNumber:Ge,Unit:wr,config:Oe}),L4=Vd({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,pow:wa,typed:te}),z4=E0({BigNumber:Ge,Unit:wr,config:Oe}),U4=_0({BigNumber:Ge,Unit:wr,config:Oe}),W4=bg({abs:En,add:Lr,identity:io,inv:Zo,multiply:it,typed:te}),Y4=ry({BigNumber:Ge,Unit:wr,config:Oe}),mS=Md({addScalar:Qt,ceil:ax,conj:Yo,divideScalar:Mt,dotDivide:hf,exp:zD,i:RD,log2:UD,matrix:$e,multiplyScalar:Ot,pow:wa,tau:kD,typed:te}),ox=Pg({BigNumber:Ge,Complex:pt,config:Oe,multiplyScalar:Ot,pow:wa,typed:te}),H4=N0({BigNumber:Ge,Unit:wr,config:Oe}),$4=Y0({BigNumber:Ge,Unit:wr,config:Oe}),G4=Cd({conj:Yo,dotDivide:hf,fft:mS,typed:te}),V4=q0({BigNumber:Ge,Unit:wr,config:Oe}),Z4=ny({BigNumber:Ge,Unit:wr,config:Oe}),Q4=C0({BigNumber:Ge,Unit:wr,config:Oe}),X4=ly({BigNumber:Ge,Unit:wr,config:Oe}),J4=iy({BigNumber:Ge,Unit:wr,config:Oe}),K4=G0({BigNumber:Ge,Unit:wr,config:Oe}),j4=R0({BigNumber:Ge,Unit:wr,config:Oe}),eR=gy({BigNumber:Ge,Unit:wr,config:Oe}),rR=dy({BigNumber:Ge,Unit:wr,config:Oe}),tR=yy({BigNumber:Ge,Unit:wr,config:Oe}),nR=H0({BigNumber:Ge,Unit:wr,config:Oe}),aR=V0({BigNumber:Ge,Unit:wr,config:Oe}),iR=M0({BigNumber:Ge,Unit:wr,config:Oe}),oR=Z0({BigNumber:Ge,Unit:wr,config:Oe}),sR=uy({BigNumber:Ge,Unit:wr,config:Oe}),uR=S0({BigNumber:Ge,Unit:wr,config:Oe}),fR=fy({BigNumber:Ge,Unit:wr,config:Oe}),cR=Q0({BigNumber:Ge,Unit:wr,config:Oe}),lR=j0({BigNumber:Ge,Unit:wr,config:Oe}),mR=k0({BigNumber:Ge,Unit:wr,config:Oe}),pR=Fh({Unit:wr,typed:te}),an=Ag({divideScalar:Mt,equalScalar:Ir,inv:Zo,matrix:$e,multiply:it,typed:te}),dR=z0({BigNumber:Ge,Unit:wr,config:Oe}),gf=Rg({gamma:ox,typed:te}),hR=ty({BigNumber:Ge,Unit:wr,config:Oe}),vR=py({BigNumber:Ge,Unit:wr,config:Oe}),gR=P0({BigNumber:Ge,Unit:wr,config:Oe}),pS=cg({DenseMatrix:Fr,lsolve:QD,lup:cS,matrix:$e,slu:eS,typed:te,usolve:ex}),yR=I0({BigNumber:Ge,Unit:wr,config:Oe}),xR=my({BigNumber:Ge,Unit:wr,config:Oe}),bR=kg({add:Lr,divide:an,factorial:gf,isInteger:zn,isPositive:Ho,multiply:it,typed:te}),wR=Lg({factorial:gf,typed:te}),DR=hy({BigNumber:Ge,Unit:wr,config:Oe}),SR=lg({add:Lr,cbrt:VD,divide:an,equalScalar:Ir,im:Zy,isZero:La,multiply:it,re:Qy,sqrt:za,subtract:Bt,typeOf:YD,typed:te,unaryMinus:fi}),NR=fv({compareNatural:ci,typed:te}),AR=Ed({abs:En,add:Lr,bignumber:ta,divide:an,isNegative:ao,isPositive:Ho,larger:Fn,map:$o,matrix:$e,max:ix,multiply:it,smaller:Tn,subtract:Bt,typed:te,unaryMinus:fi}),dS=Hg({bignumber:ta,addScalar:Qt,combinations:Lc,divideScalar:Mt,factorial:gf,isInteger:zn,isNegative:ao,larger:Fn,multiplyScalar:Ot,number:Bi,pow:wa,subtractScalar:xa,typed:te}),MR=Eh({Unit:wr,typed:te}),CR=$g({addScalar:Qt,isInteger:zn,isNegative:ao,stirlingS2:dS,typed:te}),hS=xg({abs:En,add:Lr,addScalar:Qt,atan:LD,bignumber:ta,column:fS,complex:zc,config:Oe,cos:Gy,diag:ZD,divideScalar:Mt,dot:Hc,equal:ba,flatten:vf,im:Zy,inv:Zo,larger:Fn,matrix:$e,matrixFromColumns:Ky,multiply:it,multiplyScalar:Ot,number:Bi,qr:jy,re:Qy,reshape:$D,sin:Wc,size:cn,smaller:Tn,sqrt:za,subtract:Bt,typed:te,usolve:ex,usolveAll:rS}),ER=U0({BigNumber:Ge,Unit:wr,config:Oe}),TR=ay({BigNumber:Ge,Unit:wr,config:Oe}),FR=qg({divide:an,dotDivide:hf,isNumeric:Go,log:tx,map:$o,matrix:$e,multiply:it,sum:nx,typed:te}),vS=of({add:Lr,divide:an,typed:te}),_R=oy({BigNumber:Ge,Unit:wr,config:Oe}),OR=A0({BigNumber:Ge,Unit:wr,config:Oe}),BR=uf({bignumber:ta,add:Lr,compare:Vo,divide:an,isInteger:zn,larger:Fn,multiply:it,partitionSelect:$c,smaller:Tn,smallerEq:Rs,subtract:Bt,typed:te}),sx=sf({add:Lr,apply:Xy,divide:an,isNaN:pf,multiply:it,subtract:Bt,typed:te}),PR=L0({BigNumber:Ge,Unit:wr,config:Oe}),gS=Tg({add:Lr,compare:Vo,divide:an,partitionSelect:$c,typed:te}),IR=_g({add:Lr,divide:an,matrix:$e,mean:vS,multiply:it,pow:wa,sqrt:za,subtract:Bt,sum:nx,typed:te}),RR=n0({Complex:pt,add:Lr,divide:an,matrix:$e,multiply:it,typed:te}),qR=Fg({abs:En,map:$o,median:gS,subtract:Bt,typed:te}),kR=ff({map:$o,sqrt:za,typed:te,variance:sx}),LR=Fd({BigNumber:Ge,Complex:pt,add:Lr,config:Oe,divide:an,equal:ba,factorial:gf,gamma:ox,isNegative:ao,multiply:it,pi:Hy,pow:wa,sin:Wc,smallerEq:Rs,subtract:Bt,typed:te}),ux=dv({abs:En,add:Lr,conj:Yo,ctranspose:Jy,eigs:hS,equalScalar:Ir,larger:Fn,matrix:$e,multiply:it,pow:wa,smaller:Tn,sqrt:za,typed:te}),yS=bd({BigNumber:Ge,DenseMatrix:Fr,SparseMatrix:Pi,addScalar:Qt,config:Oe,cos:Gy,matrix:$e,multiplyScalar:Ot,norm:ux,sin:Wc,typed:te,unaryMinus:fi}),zR=vy({BigNumber:Ge,Unit:wr,config:Oe}),xS=Sg({identity:io,matrix:$e,multiply:it,norm:ux,qr:jy,subtract:Bt,typed:te}),UR=xd({multiply:it,rotationMatrix:yS,typed:te}),bS=Dg({abs:En,add:Lr,concat:Gr,identity:io,index:iS,lusolve:pS,matrix:$e,matrixFromColumns:Ky,multiply:it,range:qs,schur:xS,subset:na,subtract:Bt,transpose:df,typed:te}),WR=Ng({matrix:$e,multiply:it,sylvester:bS,transpose:df,typed:te});var yf={},xf={},YR={},_n=xv({mathWithTransform:xf}),bf=Wv({Node:_n}),oo=Hv({Node:_n}),ks=Gv({Node:_n}),HR=Xv({Node:_n}),wf=Nv({Node:_n}),$R=Fv({Node:_n,ResultSet:qD}),GR=Ov({Node:_n}),Qo=Rv({Node:_n}),VR=Zv({Node:_n}),DZ=a0({classes:YR}),wS=pg({math:yf,typed:te}),ZR=kv({Node:_n,typed:te}),SZ=hg({Chain:wS,typed:te}),Df=zv({Node:_n,size:cn}),Sf=Dv({Node:_n,subset:na}),QR=Ev({matrix:$e,Node:_n,subset:na}),Xo=Jv({Unit:wr,Node:_n,math:yf}),Jo=jv({Node:_n,SymbolNode:Xo,math:yf}),Wa=eg({AccessorNode:Sf,ArrayNode:wf,AssignmentNode:QR,BlockNode:$R,ConditionalNode:GR,ConstantNode:Qo,FunctionAssignmentNode:ZR,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,RangeNode:VR,RelationalNode:HR,SymbolNode:Xo,config:Oe,numeric:Ua,typed:te}),XR=Kg({ConstantNode:Qo,FunctionNode:Jo,OperatorNode:oo,ParenthesisNode:ks,parse:Wa,typed:te}),DS=Xg({bignumber:ta,fraction:Ps,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Qo,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,SymbolNode:Xo,config:Oe,mathWithTransform:xf,matrix:$e,typed:te}),NZ=rg({parse:Wa,typed:te}),SS=Jg({AccessorNode:Sf,ArrayNode:wf,ConstantNode:Qo,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,SymbolNode:Xo,add:Lr,divide:an,equal:ba,isZero:La,multiply:it,parse:Wa,pow:wa,subtract:Bt,typed:te}),NS=tg({parse:Wa,typed:te}),JR=mg({evaluate:NS}),KR=ng({evaluate:NS}),fx=Qg({bignumber:ta,fraction:Ps,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Qo,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,SymbolNode:Xo,add:Lr,config:Oe,divide:an,equal:ba,isZero:La,mathWithTransform:xf,matrix:$e,multiply:it,parse:Wa,pow:wa,resolve:XR,simplifyConstant:DS,simplifyCore:SS,subtract:Bt,typed:te}),AZ=jg({OperatorNode:oo,parse:Wa,simplify:fx,typed:te}),MZ=Zg({parse:Wa,typed:te}),CZ=ag({Parser:KR,typed:te}),EZ=r0({bignumber:ta,fraction:Ps,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Qo,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,SymbolNode:Xo,add:Lr,config:Oe,divide:an,equal:ba,isZero:La,mathWithTransform:xf,matrix:$e,multiply:it,parse:Wa,pow:wa,simplify:fx,simplifyConstant:DS,simplifyCore:SS,subtract:Bt,typed:te}),TZ=e0({ConstantNode:Qo,FunctionNode:Jo,OperatorNode:oo,ParenthesisNode:ks,SymbolNode:Xo,config:Oe,equal:ba,isZero:La,numeric:Ua,parse:Wa,simplify:fx,typed:te}),FZ=dg({Help:JR,mathWithTransform:xf,typed:te});ht(yf,{e:ID,false:NP,fineStructure:AP,i:RD,Infinity:MP,LN10:CP,LOG10E:EP,NaN:TP,null:FP,phi:_P,SQRT1_2:BP,sackurTetrode:PP,tau:kD,true:IP,E:ID,version:RP,efimovFactor:qP,LN2:kP,pi:Hy,replacer:LP,reviver:DZ,SQRT2:zP,typed:te,unaryPlus:$y,PI:Hy,weakMixingAngle:UP,abs:En,acos:WP,acot:YP,acsc:HP,addScalar:Qt,arg:$P,asech:GP,asinh:VP,atan:LD,atanh:ZP,bignumber:ta,bitNot:QP,boolean:XP,clone:JP,combinations:Lc,complex:zc,conj:Yo,cos:Gy,cot:KP,csc:jP,cube:eI,equalScalar:Ir,erf:rI,exp:zD,expm1:tI,filter:nI,forEach:aI,format:mf,getMatrixDataType:Vy,hex:iI,im:Zy,isInteger:zn,isNegative:ao,isPositive:Ho,isZero:La,LOG2E:oI,lgamma:sI,log10:uI,log2:UD,map:$o,multiplyScalar:Ot,not:Uc,number:Bi,oct:fI,pickRandom:cI,print:lI,random:mI,re:Qy,sec:pI,sign:WD,sin:Wc,splitUnit:dI,square:hI,string:vI,subtractScalar:xa,tan:gI,typeOf:YD,acosh:yI,acsch:xI,apply:Xy,asec:bI,bin:wI,chain:SZ,combinationsWithRep:DI,cosh:SI,csch:NI,isNaN:pf,isPrime:AI,randomInt:MI,sech:CI,sinh:EI,sparse:TI,sqrt:za,tanh:FI,unaryMinus:fi,acoth:_I,coth:OI,fraction:Ps,isNumeric:Go,matrix:$e,matrixFromFunction:BI,mode:PI,numeric:Ua,prod:HD,reshape:$D,size:cn,squeeze:II,transpose:df,xgcd:GD,zeros:ln,asin:RI,cbrt:VD,concat:Gr,count:qI,ctranspose:Jy,diag:ZD,divideScalar:Mt,dotDivide:hf,equal:ba,flatten:vf,hasNumericValue:kI,identity:io,kron:LI,largerEq:Yc,leftShift:zI,lsolve:QD,matrixFromColumns:Ky,nthRoot:UI,ones:WI,qr:jy,resize:YI,rightArithShift:HI,round:Is,smaller:Tn,subtract:Bt,to:$I,unequal:GI,usolve:ex,xor:VI,add:Lr,atan2:ZI,bitAnd:QI,bitOr:XI,bitXor:JI,catalan:KI,compare:Vo,compareText:XD,cumsum:jI,deepEqual:rx,diff:e4,distance:r4,dot:Hc,equalText:t4,floor:JD,gcd:n4,hypot:a4,larger:Fn,log:tx,lsolveAll:i4,matrixFromRows:o4,min:s4,mod:jD,multiply:it,nthRoots:u4,or:f4,partitionSelect:$c,rightLogShift:c4,slu:eS,subset:na,sum:nx,trace:l4,usolveAll:rS,zpk2tf:m4,ceil:ax,compareNatural:ci,composition:p4,cross:d4,det:tS,dotMultiply:h4,fix:aS,index:iS,intersect:v4,invmod:g4,lcm:y4,log1p:x4,max:ix,setCartesian:b4,setDistinct:w4,setIsSubset:D4,setPowerset:S4,smallerEq:Rs,sort:N4,and:A4,range:qs,row:M4,setDifference:oS,setMultiplicity:C4,setSymDifference:sS,column:fS,inv:Zo,lup:cS,pinv:E4,pow:wa,setIntersect:lS,setUnion:T4,sqrtm:F4,vacuumImpedance:_4,wienDisplacement:O4,atomicMass:B4,bohrMagneton:P4,boltzmann:I4,conductanceQuantum:R4,coulomb:q4,deuteronMass:k4,dotPow:L4,electricConstant:z4,elementaryCharge:U4,expm:W4,faraday:Y4,fft:mS,gamma:ox,gravitationConstant:H4,hartreeEnergy:$4,ifft:G4,klitzing:V4,loschmidt:Z4,magneticConstant:Q4,molarMass:X4,molarPlanckConstant:J4,neutronMass:K4,nuclearMagneton:j4,planckCharge:eR,planckLength:rR,planckTemperature:tR,protonMass:nR,quantumOfCirculation:aR,reducedPlanckConstant:iR,rydberg:oR,secondRadiation:sR,speedOfLight:uR,stefanBoltzmann:fR,thomsonCrossSection:cR,avogadro:lR,bohrRadius:mR,createUnit:pR,divide:an,electronMass:dR,factorial:gf,firstRadiation:hR,gravity:vR,inverseConductanceQuantum:gR,lusolve:pS,magneticFluxQuantum:yR,molarMassC12:xR,multinomial:bR,parse:Wa,permutations:wR,planckMass:DR,polynomialRoot:SR,resolve:XR,setSize:NR,simplifyConstant:DS,solveODE:AR,stirlingS2:dS,unit:MR,bellNumbers:CR,compile:NZ,eigs:hS,fermiCoupling:ER,gasConstant:TR,kldivergence:FR,mean:vS,molarVolume:_R,planckConstant:OR,quantileSeq:BR,simplifyCore:SS,variance:sx,classicalElectronRadius:PR,evaluate:NS,median:gS,simplify:fx,symbolicEqual:AZ,corr:IR,freqz:RR,leafCount:MZ,mad:qR,parser:CZ,rationalize:EZ,std:kR,zeta:LR,derivative:TZ,norm:ux,rotationMatrix:yS,help:FZ,planckTime:zR,schur:xS,rotate:UR,sylvester:bS,lyap:WR,config:Oe});ht(xf,yf,{filter:Dy({typed:te}),forEach:Sy({typed:te}),map:Ay({typed:te}),apply:by({isInteger:zn,typed:te}),or:Uy({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),and:zy({add:Lr,concat:Gr,equalScalar:Ir,matrix:$e,not:Uc,typed:te,zeros:ln}),concat:Oy({isInteger:zn,matrix:$e,typed:te}),max:My({config:Oe,larger:Fn,numeric:Ua,typed:te}),print:Ly({add:Lr,matrix:$e,typed:te,zeros:ln}),bitAnd:Wy({add:Lr,concat:Gr,equalScalar:Ir,matrix:$e,not:Uc,typed:te,zeros:ln}),diff:By({bignumber:ta,matrix:$e,number:Bi,subtract:Bt,typed:te}),min:Ey({config:Oe,numeric:Ua,smaller:Tn,typed:te}),subset:_y({add:Lr,matrix:$e,typed:te,zeros:ln}),bitOr:Yy({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),cumsum:qy({add:Lr,typed:te,unaryPlus:$y}),index:Ny({Index:bn,getMatrixDataType:Vy}),sum:Iy({add:Lr,config:Oe,numeric:Ua,typed:te}),range:Ty({bignumber:ta,matrix:$e,add:Lr,config:Oe,isPositive:Ho,larger:Fn,largerEq:Yc,smaller:Tn,smallerEq:Rs,typed:te}),row:Fy({Index:bn,matrix:$e,range:qs,typed:te}),column:wy({Index:bn,matrix:$e,range:qs,typed:te}),mean:Cy({add:Lr,divide:an,typed:te}),quantileSeq:Ry({add:Lr,bignumber:ta,compare:Vo,divide:an,isInteger:zn,larger:Fn,multiply:it,partitionSelect:$c,smaller:Tn,smallerEq:Rs,subtract:Bt,typed:te}),variance:ky({add:Lr,apply:Xy,divide:an,isNaN:pf,multiply:it,subtract:Bt,typed:te}),std:Py({map:$o,sqrt:za,typed:te,variance:sx})});ht(YR,{BigNumber:Ge,Complex:pt,Fraction:Wo,Matrix:kc,Node:_n,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,Range:OP,RelationalNode:HR,ResultSet:qD,ArrayNode:wf,BlockNode:$R,ConditionalNode:GR,ConstantNode:Qo,DenseMatrix:Fr,RangeNode:VR,Chain:wS,FunctionAssignmentNode:ZR,SparseMatrix:Pi,IndexNode:Df,ImmutableDenseMatrix:KD,Index:bn,AccessorNode:Sf,AssignmentNode:QR,FibonacciHeap:nS,Spa:uS,Unit:wr,SymbolNode:Xo,FunctionNode:Jo,Help:JR,Parser:KR});wS.createProxy(yf);var AS=PD;var n5=ma(Nm(),1);var e5=ma(jR(),1);function r5(e){var r=new e5.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 t5(e,r,t,n){function a(x,w){var C=arguments.length;if(C!==1&&C!==2)throw new ga("import",C,1,2);w||(w={});function b(O,_,E){if(Array.isArray(_))_.forEach(L=>b(O,L));else if(typeof _=="object")for(var T in _)Xe(_,T)&&b(O,_[T],T);else if(Ms(_)||E!==void 0){var R=Ms(_)?y(_)?_.fn+".transform":_.fn:E;if(Xe(O,R)&&O[R]!==_&&!w.silent)throw new Error('Cannot import "'+R+'" twice');O[R]=_}else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}var N={};b(N,x);for(var M in N)if(Xe(N,M)){var S=N[M];if(Ms(S))o(S,w);else if(u(S))i(M,S,w);else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}}function i(x,w,C){if(C.wrap&&typeof w=="function"&&(w=c(w)),m(w)&&(w=e(x,{[w.signature]:w})),e.isTypedFunction(t[x])&&e.isTypedFunction(w)){C.override?w=e(x,w.signatures):w=e(t[x],w),t[x]=w,delete n[x],s(x,w),t.emit("import",x,function(){return w});return}if(t[x]===void 0||C.override){t[x]=w,delete n[x],s(x,w),t.emit("import",x,function(){return w});return}if(!C.silent)throw new Error('Cannot import "'+x+'": already exists')}function s(x,w){w&&typeof w.transform=="function"?(t.expression.transform[x]=w.transform,d(x)&&(t.expression.mathWithTransform[x]=w.transform)):(delete t.expression.transform[x],d(x)&&(t.expression.mathWithTransform[x]=w))}function l(x){delete t.expression.transform[x],d(x)?t.expression.mathWithTransform[x]=t[x]:delete t.expression.mathWithTransform[x]}function c(x){var w=function(){for(var b=[],N=0,M=arguments.length;N2&&arguments[2]!==void 0?arguments[2]:x.fn;if(Jb(C,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(C));var b=y(x)?t.expression.transform:t,N=C in t.expression.transform,M=Xe(b,C)?b[C]:void 0,S=function(){var _={};x.dependencies.map(ew).forEach(T=>{if(Jb(T,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(T));T==="math"?_.math=t:T==="mathWithTransform"?_.mathWithTransform=t.expression.mathWithTransform:T==="classes"?_.classes=t:_[T]=t[T]});var E=x(_);if(E&&typeof E.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(M===void 0||w.override)return E;if(e.isTypedFunction(M)&&e.isTypedFunction(E))return e(M,E);if(w.silent)return M;throw new Error('Cannot import "'+C+'": already exists')};!x.meta||x.meta.lazy!==!1?(Du(b,C,S),M&&N?l(C):(y(x)||h(x))&&Du(t.expression.mathWithTransform,C,()=>b[C])):(b[C]=S(),M&&N?l(C):(y(x)||h(x))&&Du(t.expression.mathWithTransform,C,()=>b[C])),n[C]=x,t.emit("import",C,S)}function u(x){return typeof x=="function"||typeof x=="number"||typeof x=="string"||typeof x=="boolean"||x===null||Ht(x)||Kt(x)||rr(x)||da(x)||Qe(x)||Array.isArray(x)}function m(x){return typeof x=="function"&&typeof x.signature=="string"}function d(x){return!Xe(v,x)}function h(x){return x.fn.indexOf(".")===-1&&!Xe(v,x.fn)&&(!x.meta||!x.meta.isClass)}function y(x){return x!==void 0&&x.meta!==void 0&&x.meta.isTransformFunction===!0||!1}var v={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return a}function cx(e,r){var t=ht({},Ss,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=r5({isNumber:sr,isComplex:Kt,isBigNumber:rr,isFraction:da,isUnit:Ht,isString:St,isArray:Mr,isMatrix:Qe,isCollection:Nt,isDenseMatrix:Ji,isSparseMatrix:ha,isRange:Fo,isIndex:Mi,isBoolean:fm,isResultSet:cm,isHelp:xu,isFunction:lm,isDate:mm,isRegExp:pm,isObject:Ci,isNull:dm,isUndefined:hm,isAccessorNode:Ln,isArrayNode:jt,isAssignmentNode:vm,isBlockNode:gm,isConditionalNode:ym,isConstantNode:xr,isFunctionAssignmentNode:Oa,isFunctionNode:yn,isIndexNode:Jn,isNode:Nr,isObjectNode:Ei,isOperatorNode:ct,isParenthesisNode:en,isRangeNode:xm,isRelationalNode:bm,isSymbolNode:at,isChain:bu});n.config=ZA(t,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var a=[],i=[];function s(u){if(Ms(u))return u(n);var m=u[Object.keys(u)[0]];if(Ms(m))return m(n);if(!$A(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=a.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),a.push(u),i.push(h)):h=i[d],h}var l={};function c(){for(var u=arguments.length,m=new Array(u),d=0;d{Ub(l).forEach(u=>{u&&u.meta&&u.meta.recreateOnConfigChange&&o(u,{override:!0})})}),n.create=cx.bind(null,e),n.factory=F,n.import(Ub(YA(e))),n.ArgumentsError=ga,n.DimensionError=pr,n.IndexError=tn,n}var LS=ma(um());var i5=ma(a5()),TS=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",tabs:"Tabs",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",internal:"Link to Note",context:"Embed Existing Context",flow:"Embed Note or Space",board:"New Board",divider:"Divider",note:"Note Block",link:"Web Link",callout:"Callout",bookmark:"Bookmark",table:"New Table",codeblock:"Code Block",toggle:"Toggle",emoji:"Emoji",image:"Image",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",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:{layout:"Layout",enterFlowState:"Enter Flow State",exitFlowState:"Exit Flow State",newView:"New View",calendarView:"Calendar View",dayView:"Day 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",revealInExplorer:"Reveal in Explorer",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",sortBy:"Sort",filters:"Filters",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",editProperties:"Edit Properties",properties:"Properties",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)",fileNameSortNumericalAsc:"File Name (1 to 9)",fileNameSortNumericalDesc:"File Name (9 to 1)",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",insertAbove:"Insert Above",insertBelow:"Insert Below"},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",alias:"Alias",addFilter:"Add Filter",loadMore:"Load More",addCondition:"Add Condition",customize:"Customize",moreOptions:"More Options",saveProperty:"Save Property",newNote:"New Note",changeIcon:"Change Sticker",removeIcon:"Remove Sticker",addIcon:"Add Sticker",addCover:"Add Cover",addDisplay:"Display Name",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 Live Search",addItem:"Add Item",addProperty:"Add Property",editProperty:"Edit 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 From Note",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",contexts:"Contexts",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:"on or 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:"Live Searches",filesAndFolders:"Files and Folders"},labels:{duplicateTable:"Duplicate Table",pinned:"Pinned",live:"Pinned by Live Search",moveTable:"Move Table",editFormula:"Edit Formula",editObject:"Edit Object",properties:"Properties",newAction:"Action",newTable:"List",template:"Template",createFolder:"New Folder Name",rename:"Rename",createNew:"New",default:"Default",done:"Done",changeCoverShort:"Change",reposition:"Reposition",tables:"Tables",selectDateFormat:"Select/Type Date Format",renameSection:"Edit 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",notePlaceholder:"New Note for \${1}",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",contexts:"Contexts",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",spaceTemplates:"Create templates to quickly add items to your 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: ",tableDeleted:"Table removed from note, you can find the table in the folder 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:"Show Toggles to Open Flow Editor on Links",desc:"Turn on to toggle Flow Blocks directly in inline links"},internalLinkSticker:{name:"Show Stickers on Links",desc:"Turn on to toggle stickers shown directly by beside internal links"},syncContextToFrontmatter:{name:"Sync Context Fields to Frontmatter",desc:"Turn on to automatically save all context fields to frontmatter fields, not just existing frontmatter fields."},syncFormulaToFrontmatter:{name:"Sync Formula Fields to Frontmatter",desc:"Turn on to save calculated formula values to 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"},inlineContextProperties:{name:"Inline Context Properties",desc:"Show the properties in the inline context"},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"},folderNoteName:{name:"Folder Note Name",desc:"Name of the folder note, keep blank to use the same name as the folder"},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"},flowState:{name:"Flow State",desc:"Toggle the flow state"},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 29"},contextPagination:{name:"Table View Pagination",desc:"Number of items per page in table view"},coverHeight:{name:"Cover Height",desc:"The height for the cover of the note or space, default is 200"},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=i5.default.locale();["en"].includes(r)&&(this.lang=r)}get texts(){return this.all.en}},Br=new TS().texts;var FS=e=>e.lastIndexOf("/")!=-1?e.lastIndexOf(".")!=-1?MA(e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("."))):e.substring(e.lastIndexOf("/")+1):e.lastIndexOf(".")!=-1?e.substring(0,e.lastIndexOf(".")):e;var kZ=ma(um());var BZ=(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 o5=({field:e,value:r})=>r=="ctime"?{value:"parseDate(prop('File')['metadata']['ctime'])",type:"date"}:{value:"",type:"string"},lx=(e,r,t,n)=>{let a=bc(e);if(a)return r=="fileprop"&&a.field?o5(a):(r=="option"&&a.source?.length>0&&(a.source=="$commands"?a.options=t.cli.allCommands():a.source=="$links"?a.options=t.spaceManager.allPaths().map(i=>({name:i,value:i})):a.source=="$super"?a.options=BZ(t,n):a.source=="$properties"&&(a.options=t.contextsIndex.get(n)?.contextTable?.cols?.map(i=>({name:i.name,value:i.name}))??[])),[...s5(r).configKeys??[],"alias","default"].reduce((i,s)=>({...i,[s]:a[s]}),{}));if(!r)return{};if(!a)if(r=="context")e?.length>0?a={space:e}:a={};else if(r.startsWith("date"))e?.length>0?a={format:e}:a={};else if(r.startsWith("fileprop"))if(e?.length>0){let[i,s]=e.split(".");a=o5({field:i,value:s})}else a={};else r.startsWith("option")&&(e?.length>0?a={options:gn(e).map(s=>({name:s,value:s}))}:a={});return a??{}};var s5=(e,r)=>r==Xn?Af.find(t=>t.type=="file"):r=="tags"?Af.find(t=>t.type=="tags-multi"):r=="aliases"?Af.find(t=>t.type=="option-multi"):r=="sticker"?Af.find(t=>e=="icon"):Af.find(t=>e==t.type)||Af.find(t=>e==t.multiType),Af=[{type:"unknown",label:"",restricted:!0,icon:"ui//file-question"},{type:"any",label:"",restricted:!0,icon:"ui//wildcard",multi:!0,multiType:"any-multi"},{type:"text",label:Br.properties.text.label,metadata:!0,icon:"ui//text",primative:!0,description:Br.properties.text.description},{type:"number",label:Br.properties.number.label,metadata:!0,icon:"ui//binary",configKeys:["unit"],primative:!0,description:Br.properties.number.description},{type:"boolean",label:Br.properties.boolean.label,metadata:!0,icon:"ui//check-square",primative:!0,description:Br.properties.boolean.description},{type:"date",label:Br.properties.date.label,metadata:!0,icon:"ui//calendar",configKeys:["format"],primative:!0,description:Br.properties.date.description},{type:"option",label:Br.properties.option.label,multi:!0,multiType:"option-multi",icon:"ui//list",configKeys:["options","source"],description:Br.properties.option.description},{type:"tags-multi",label:Br.properties.tags.label,icon:"ui//tags",description:Br.properties.tags.description},{type:"file",label:Br.properties.file.label,restricted:!0,icon:"ui//mk-make-h3"},{type:"fileprop",label:Br.properties.fileProperty.label,icon:"ui//formula",configKeys:["field","value","type"],description:Br.properties.fileProperty.description},{type:"link",label:Br.properties.link.label,multi:!0,multiType:"link-multi",metadata:!0,icon:"ui//file-text",primative:!0,description:Br.properties.link.description},{type:"context",label:Br.properties.context.label,icon:"ui//mk-make-note",multi:!0,multiType:"context-multi",configKeys:["space"],description:Br.properties.context.description},{type:"object",label:Br.properties.object.label,multi:!0,multiType:"object-multi",metadata:!0,icon:"ui//list-tree",configKeys:["type","typeName"],description:Br.properties.object.description},{type:"icon",label:Br.properties.icon.label,multi:!0,multiType:"icon-multi",icon:"ui//gem",restricted:!0,primative:!0,description:Br.properties.icon.description},{type:"image",label:Br.properties.image.label,multi:!0,multiType:"image-multi",metadata:!0,icon:"ui//mk-make-image",primative:!0,description:Br.properties.image.description},{type:"color",label:Br.properties.color.label,icon:"ui//mk-make-image",restricted:!0,description:Br.properties.color.description},{type:"space",label:Br.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Br.properties.space.description},{type:"table",label:Br.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Br.properties.space.description},{type:"super",label:Br.properties.super.label,icon:"ui//zap",restricted:!0,configKeys:["dynamic","field"]},{type:"input",label:Br.properties.super.label,icon:"ui//input",restricted:!0}];var li="files",dx={id:li,name:"Items",type:"db",primary:"true"},PZ="filesView",IZ={id:PZ,name:"All",type:"view",def:JSON.stringify({db:li,icon:"ui//file-stack"})},RZ="main",qZ=e=>({id:e,name:e,type:"frame",def:"",predicate:"",primary:"true"}),C4e={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[qZ(RZ),IZ]},mx={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[dx]},u5={uniques:["name,schemaId"],cols:["name","schemaId","type","value","attrs","hidden","unique","primary"]},px={...u5,rows:[{name:Xn,schemaId:li,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""},{name:Br.properties.fileProperty.createdTime,schemaId:li,type:"fileprop",value:Xn+".ctime",hidden:"",unique:"",attrs:"",primary:"true"}]};var E4e=[{name:Br.properties.defaultField,schemaId:"",type:"text",primary:"true"}],_S={...u5,rows:[{name:Xn,schemaId:li,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""}]};var T4e={schema:dx,cols:px.rows,rows:[]},F4e={schema:dx,cols:px.rows,rows:[]},_4e={schema:dx,cols:_S.rows,rows:[]},f5=(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 O4e={m_schema:mx,m_fields:px,...f5(px.rows,mx.rows)},B4e={m_schema:mx,m_fields:_S,...f5(_S.rows,mx.rows)};var OS="spaces://$tags";var mRe={name:Br.menu.waypoints,readOnly:!1,path:"spaces://$waypoints",label:{name:Br.menu.waypoints,thumbnail:"",sticker:"ui//tags",color:""},type:"default"},pRe={name:Br.menu.tags,readOnly:!1,path:"spaces://$tags",label:{thumbnail:"",name:Br.menu.tags,sticker:"ui//tags",color:""},type:"default"},dRe={name:Br.menu.vault,readOnly:!1,path:"/",label:{thumbnail:"",name:Br.menu.vault,sticker:"ui//vault",color:""},type:"default"};var c5=(e,r,t,n,a,i,s)=>{if(!t)return"";let l=new Map;Object.keys(a).forEach(o=>l.set(o,a[o])),l.set("$properties",n),l.set("$paths",r),i&&l.set("$current",i);let c;try{e.evaluate("current = _current()",l),c=e.evaluate(t,l),c=Ds("",c)}catch(o){if(c="",s)throw o;console.log(i,t,o)}return c};var BS=e=>{let r=new Map;e.filter(s=>s.type=="fileprop"||s.name.startsWith("tags")).forEach(s=>{let{value:l}=lx(s.value,s.type),c=[];try{let u=Wa(l).filter(m=>m.type=="FunctionNode").filter(m=>m.fn.name=="prop"&&m.args[0].type=="ConstantNode").map(m=>m.args[0]?.value);c.push(...u)}catch{}let o=s.name;r.has(o)||r.set(o,new Set);for(let u of c){let m=u;m!==o&&r.get(o).add(m)}});let t=new Set,n=[],a=new Set,i=s=>{if(a.has(s))throw new Error("Circular dependency detected");if(!t.has(s)){a.add(s);let l=r.get(s)||new Set;for(let c of l)i(c);t.add(s),a.delete(s),n.push(s)}};for(let s of e)t.has(s.name)||i(s.name);return n},l5=(e,r,t,n,a,i)=>{if(!t)return{};let s=i??BS(n),l=r.get(t[Xn])?.metadata?.property??{},c=Object.keys(l).filter(m=>n.some(d=>d.name==m)).reduce((m,d)=>({...m,[d]:Ds(d,l[d])}),{}),o=s.map(m=>n.find(d=>d.name==m)).filter(m=>m&&(m.type=="fileprop"||m.name=="tags")),u=n.reduce((m,d)=>({...m,[d.name]:d}),{});return{...t,...c,...o.reduce((m,d)=>{let{value:h}=lx(d.value,d.type);return{...m,[d.name]:c5(e,r,h,u,{...t,...m},a)}},{})}};var m5=(e,r)=>{let t=e?gn(e):[],n=r?gn(r):[];return n.every(a=>t.some(i=>i==a))&&t.every(a=>n.some(i=>i==a))},Mf=(e,r)=>e==r,PS=(e,r)=>(e??"").length==0,IS=(e,r)=>(e??"").toLowerCase().includes((r??"").toLowerCase()),RS=(e,r)=>parseFloat(e)>parseFloat(r),qS=(e,r)=>parseInt(e){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()},d5=(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?gn(e):[],n=r?gn(r):[];return t.length==0?!1:n.some(a=>t.some(i=>i==a))},h5=(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()},v5=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 Cf={isNotEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(e,r)=>!PS(e,""),valueType:"none"},isEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(e,r)=>PS(e,""),valueType:"none"},include:{fn:(e,r)=>IS(e,r),type:["text","file","link","image"],valueType:"text"},notInclude:{type:["text","file","link","image"],fn:(e,r)=>!IS(e,r),valueType:"text"},is:{type:["text"],fn:(e,r)=>Mf(e,r),valueType:"text"},isNot:{type:["text"],fn:(e,r)=>!Mf(e,r),valueType:"text"},equal:{type:["number"],fn:(e,r)=>Mf(e,r),valueType:"number"},isLink:{type:["link","context"],fn:(e,r)=>Mf(e,r),valueType:"link"},isNotLink:{type:["link","context"],fn:(e,r)=>!Mf(e,r),valueType:"link"},isGreatThan:{type:["number"],fn:(e,r)=>RS(e,r),valueType:"number"},isLessThan:{type:["number"],fn:(e,r)=>qS(e,r),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(e,r)=>!RS(e,r),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(e,r)=>!qS(e,r),valueType:"number"},dateBefore:{type:["date"],fn:(e,r)=>d5(e,r),valueType:"date"},dateAfter:{type:["date"],fn:(e,r)=>p5(e,r),valueType:"date"},isSameDate:{type:["date"],fn:(e,r)=>h5(e,r),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(e,r)=>v5(e,r),valueType:"none"},isExactList:{type:["option","option-multi","link-multi","context-multi","tags-multi"],fn:(e,r)=>m5(e,r),valueType:"list"},isAnyInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi"],fn:(e,r)=>kS(e,r),valueType:"list"},isNoneInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi"],fn:(e,r)=>!kS(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 zZ=(e,r,t)=>r.reduce((a,i)=>{let[s,l]=a,c=i.type=="context"?g5(l,i,t):i.type=="path"?x5(l,i,t):i.type=="frontmatter"?y5(l,i,t):b5(l,i,t),o=l.filter(u=>!c.includes(u));return[[...s,...c],o]},[[],e])[0],UZ=(e,r,t)=>r.reduce((n,a)=>a.type=="context"?g5(n,a,t):a.type=="path"?x5(n,a,t):a.type=="frontmatter"?y5(n,a,t):b5(n,a,t),e),g5=(e,r,t)=>{let n=Cf[r.fn];return!n||n.valueType!="none"&&r.value.length==0?[]:e.filter(a=>{let[i,s]=r.field.split("."),l=a.metadata?.property;if(!a.spaces?.includes(i)||!l||!l[s])return!1;let c=!0;if(n){let o=r.fType=="property"?t[r.value]:r.value;c=n.fn(Ds(s,l[s]),o)}return c})},y5=(e,r,t)=>{let n=Cf[r.fn];return!n||n.valueType!="none"&&r.value.length==0?[]:e.filter(a=>{let i=a.metadata?.property;if(!i||i[r.field]===void 0)return!1;let s=!0;if(n){let l=r.fType=="property"?t[r.value]:r.value;s=n.fn(Ds(r.field,i[r.field]),l)}return s})},x5=(e,r,t)=>{let n=Cf[r.fn];return!n||n.valueType!="none"&&r.value.length==0?[]:e.filter(a=>{let i="";r.field=="outlinks"?i=ws(a.outlinks??[]):r.field=="inlinks"?i=ws(a.metadata?.inlinks??[]):r.field=="tags"&&(i=ws(a.tags??[]));let s=!0;if(n){let l=r.fType=="property"?t[r.value]:r.value;s=n.fn(i,l)}return s})},b5=(e,r,t)=>{let n=Cf[r.fn];return!n||n.valueType!="none"&&r.value.length==0?[]:e.filter(a=>{let i=!0;if(n){let s=r.fType=="property"?t[r.value]:r.value;i=n.fn(a.metadata?.[r.type]?.[r.field],s)}return i})},w5=(e,r,t)=>e.reduce((a,i)=>!a||i.filters.length==0?!1:i.type=="any"?zZ([r],i.filters,t).length>0:UZ([r],i.filters,t).length>0,!0);var D5=(e,r)=>e.hiddenExtensions.some(t=>r.endsWith(t))||r.startsWith(e.spacesFolder+"/#")||e.hiddenFiles.some(t=>t==r);var S5=(e,r,t,n,a,i)=>{let s={};if(!e)return{changed:!1,cache:null};if(!r)return{changed:!1,cache:{path:e.path,schemas:[],outlinks:[],contexts:[],paths:[],contextTable:null,spaceMap:s,dbExists:!1}};let l=Object.values(r).map(N=>N.schema),c=r[li]?.rows?.map(N=>N[Xn])??[],o=t.filter(N=>!c.includes(N)),u=[...NA(t??[],c),...o],m=BS(r[li].cols),d=[...r[li].rows.filter(N=>t.includes(N[Xn])),...o.map(N=>({[Xn]:N}))].map(N=>l5(i,a,N,r[li].cols,a.get(e.path),m)),h={...r[li],rows:d},y=h.cols?.filter(N=>N.type.startsWith("context"))??[],v=h.cols?.filter(N=>N.type.startsWith("link"))??[],x=pa(y.map(N=>N.value));y.forEach(N=>{s[N.name]={},h.rows.forEach(M=>{gn(M[N.name]).forEach(S=>s[N.name][S]=[...s[N.name][S]??[],M[Xn]])})});let w=pa(h.rows.reduce((N,M)=>pa([...N,...[...y,...v].flatMap(S=>gn(M[S.name]).map(O=>wc(O)))]),[])),C={contextTable:h,path:e.path,contexts:x,outlinks:w,paths:u,schemas:l,spaceMap:s,dbExists:n},b=!1;return LS.default.isEqual(h,r)||(b=!0),{changed:b,cache:C}},N5=(e,r,t,n)=>{let a={};for(let[i,s]of e){let l=r.enableFolderNote?t.get(i)?.space.notePath??i:i,c=e.get(l)??s;if(!s)continue;let o=s?.parent??"",u=s?.type??"",m=s?.subtype??"",d=c?.label,h=n?.get(i),{changed:y,cache:v}=zS(i,r,t,c,d,u,m,o,h);a[i]={changed:y,cache:v}}return a},zS=(e,r,t,n,a,i,s,l,c)=>{let o=(W,k,q)=>W?.length>0||W?.length>0?W:k=="space"?q=="Spaces/Home"?"ui//home":q=="/"?"ui//vault":q.startsWith("spaces://")?"ui//tags":"ui//folder":"ui//file",u={label:n?.label,path:e,name:FS(e),readOnly:n?.readOnly},m=[],d=n?.tags?.map(W=>W)??[],h=D5(r,e),y=(W,k,q=new Set)=>{let K=[];for(let z of k){let oe=W.get(z)?.contexts??[];for(let le of oe)q.has(le)||(K.push(le),q.add(le),K.push(...y(W,[xc(le)],q)))}return K};if(t.has(l))for(let W of t.get(l).contexts??[])m.push(W);m.push(...d);let v=a?.name,x=n?.property?sm(n.property[r.fmKeyAlias]):[],w=o(a?.sticker,i,e),C=a?.color??"",b=n?.resolvedLinks??[],N=!1,M,S={...u,name:v,tags:pa(m),type:i,subtype:s,parent:l,label:{name:r.spacesUseAlias&&x?.length>0?x[0]:v,sticker:w,color:C,thumbnail:a?.thumbnail??"",preview:a?.preview??""},metadata:{...n},outlinks:b},O=[],_=[],E=[];s=="tag"&&O.push(OS);for(let W of m)O.push(xc(W));let T=new Set,R=(W,k)=>{if(!T.has(W)){if(T.add(W),k.dependencies?.length>0)for(let q of k.dependencies)t.has(q)&&R(q,t.get(q));if(k.space.notePath==e&&k.path!=k.space.notePath&&(N=!0,M=k.path,h=!0),s!="tag"&&s!="default"&&k.space&&k.space.path==l){O.push(W);return}if(k.metadata?.filters?.length>0&&w5(k.metadata.filters,{...S,spaces:O},k.properties)){O.push(W),E.push(W);return}if(k.metadata?.links?.length>0&&(k.metadata?.links??[]).find(K=>K==S.path)){O.push(W),_.push(W);return}}};for(let[W,k]of t)R(W,k);let L=y(t,O);O.push(...L.map(W=>xc(W))),S.tags.push(...L),N&&(S.metadata.spacePath=M);let H=h?{...S,spaces:[],hidden:h}:{...S,spaces:pa(O),linkedSpaces:_,liveSpaces:E,hidden:h},V=!0;return c&&LS.default.isEqual(H,c)&&(V=!1),{changed:V,cache:H}};function A5(e){let{path:r,settings:t,spacesCache:n,pathMetadata:a,label:i,type:s,subtype:l,parent:c,oldMetadata:o}=e;return zS(r,t,n,a,i,s,l,c,o)}function US(e,r){let{space:t,mdb:n,paths:a,dbExists:i,pathsIndex:s}=e;return S5(t,n,a,i,s,r)}function M5(e,r){let{map:t,pathsIndex:n}=e,a=new Map;for(let[i,s]of t)a.set(i,US({...s,pathsIndex:n},r));return a}function C5(e){let{pathCache:r,settings:t,spacesCache:n,oldMetadata:a}=e;return N5(r,t,n,a)}var WZ=self,YZ={...AS,createAdd:F("add",[],()=>function(r,t){return r+t}),createEqual:F("equal",[],()=>function(r,t){return r==t}),createUnequal:F("unequal",[],()=>function(r,t){return r!=t})},WS=cx(YZ);WS.import(Lb,{override:!0});WZ.onmessage=async e=>{let{payload:r,job:t}=e.data,n;t.type=="path"?n=A5(r):t.type=="context"?n=US(r,WS):t.type=="contexts"?n=M5(r,WS):t.type=="paths"&&(n=C5(r));try{postMessage({job:t,result:n})}catch(a){console.log(a),postMessage({job:t,result:{$error:\`Failed to index \${t.type} \${t.path}: \${a}\`}})}}; +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 f3={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 c3={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 l3={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 m3={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 p3={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 d3={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 h3={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 v3={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 g3={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 y3={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 x3={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 b3={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 w3={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]};var D3={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 S3={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 N3={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 A3={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 M3={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 C3={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 E3={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 T3={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 F3={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 _3={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 O3={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 B3={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 P3={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 I3={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 R3={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]};var q3={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 k3={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 L3={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 z3={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]};var U3={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 W3={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 Y3={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 H3={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]};var $3={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 G3={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 V3={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 Z3={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 Q3={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 X3={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 J3={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 K3={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 j3={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]};var eB={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 rB={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 tB={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 nB={bignumber:VT,boolean:ZT,complex:QT,createUnit:XT,fraction:JT,index:KT,matrix:jT,number:eF,sparse:rF,splitUnit:tF,string:nF,unit:aF,e:DD,E:DD,false:OT,i:BT,Infinity:PT,LN2:RT,LN10:IT,LOG2E:kT,LOG10E:qT,NaN:LT,null:zT,pi:SD,PI:SD,phi:UT,SQRT1_2:WT,SQRT2:YT,tau:HT,true:$T,version:GT,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:uF,lsolve:cF,lsolveAll:lF,lup:mF,lusolve:pF,leafCount:fF,polynomialRoot:dF,resolve:gF,simplify:yF,simplifyConstant:xF,simplifyCore:bF,symbolicEqual:DF,rationalize:vF,slu:wF,usolve:SF,usolveAll:NF,qr:hF,abs:AF,add:MF,cbrt:CF,ceil:EF,cube:TF,divide:FF,dotDivide:_F,dotMultiply:OF,dotPow:BF,exp:PF,expm:IF,expm1:RF,fix:qF,floor:kF,gcd:LF,hypot:zF,lcm:WF,log:YF,log2:GF,log1p:$F,log10:HF,mod:VF,multiply:ZF,norm:QF,nthRoot:XF,nthRoots:JF,pow:KF,round:jF,sign:e_,sqrt:r_,sqrtm:t_,square:o_,subtract:s_,unaryMinus:u_,unaryPlus:f_,xgcd:c_,invmod:UF,bitAnd:l_,bitNot:m_,bitOr:p_,bitXor:d_,leftShift:h_,rightArithShift:v_,rightLogShift:g_,bellNumbers:y_,catalan:x_,composition:b_,stirlingS2:w_,config:iF,import:oF,typed:sF,arg:D_,conj:S_,re:A_,im:N_,evaluate:M_,help:C_,distance:E_,intersect:T_,and:F_,not:__,or:O_,xor:B_,concat:I_,count:R_,cross:q_,column:P_,ctranspose:k_,det:L_,diag:z_,diff:U_,dot:W_,getMatrixDataType:V_,identity:Z_,filter:H_,flatten:$_,forEach:G_,inv:Q_,pinv:X_,eigs:Y_,kron:J_,matrixFromFunction:eO,matrixFromRows:rO,matrixFromColumns:j_,map:K_,ones:tO,partitionSelect:nO,range:aO,resize:oO,reshape:iO,rotate:sO,rotationMatrix:uO,row:fO,size:cO,sort:lO,squeeze:mO,subset:pO,trace:dO,transpose:hO,zeros:vO,fft:gO,ifft:yO,sylvester:n_,schur:a_,lyap:i_,solveODE:tB,combinations:xO,combinationsWithRep:bO,factorial:wO,gamma:DO,kldivergence:NO,lgamma:SO,multinomial:AO,permutations:MO,pickRandom:CO,random:EO,randomInt:TO,compare:FO,compareNatural:_O,compareText:OO,deepEqual:BO,equal:PO,equalText:IO,larger:RO,largerEq:qO,smaller:kO,smallerEq:LO,unequal:zO,setCartesian:UO,setDifference:WO,setDistinct:YO,setIntersect:HO,setIsSubset:$O,setMultiplicity:GO,setPowerset:VO,setSize:ZO,setSymDifference:QO,setUnion:XO,zpk2tf:JO,freqz:KO,erf:jO,zeta:e3,cumsum:c3,mad:r3,max:t3,mean:n3,median:a3,min:i3,mode:o3,prod:s3,quantileSeq:u3,std:f3,sum:l3,variance:m3,corr:p3,acos:d3,acosh:h3,acot:v3,acoth:g3,acsc:y3,acsch:x3,asec:b3,asech:w3,asin:D3,asinh:S3,atan:N3,atanh:M3,atan2:A3,cos:C3,cosh:E3,cot:T3,coth:F3,csc:_3,csch:O3,sec:B3,sech:P3,sin:I3,sinh:R3,tan:q3,tanh:k3,to:L3,clone:U3,format:W3,bin:z3,oct:j3,hex:H3,isNaN:G3,isInteger:$3,isNegative:V3,isNumeric:Z3,hasNumericValue:Y3,isPositive:Q3,isPrime:X3,isZero:J3,print:eB,typeOf:rB,numeric:K3};var aB="help",bG=["typed","mathWithTransform","Help"],dg=F(aB,bG,e=>{var{typed:r,mathWithTransform:t,Help:n}=e;return r(aB,{any:function(i){var s,l=i;if(typeof i!="string"){for(s in t)if(Xe(t,s)&&i===t[s]){l=s;break}}var c=wt(nB,l);if(!c){var o=typeof l=="function"?l.name:l;throw new Error('No documentation found on "'+o+'"')}return new n(c)}})});var iB="chain",wG=["typed","Chain"],hg=F(iB,wG,e=>{var{typed:r,Chain:t}=e;return r(iB,{"":function(){return new t},any:function(a){return new t(a)}})});var oB="det",DG=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],vg=F(oB,DG,e=>{var{typed:r,matrix:t,subtractScalar:n,multiply:a,divideScalar:i,isZero:s,unaryMinus:l}=e;return r(oB,{any:function(u){return ar(u)},"Array | Matrix":function(u){var m;switch(Qe(u)?m=u.size():Array.isArray(u)?(u=t(u),m=u.size()):m=[],m.length){case 0:return ar(u);case 1:if(m[0]===1)return ar(u.valueOf()[0]);if(m[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(m)+")");case 2:{var d=m[0],h=m[1];if(d===h)return c(u.clone().valueOf(),d,h);if(h===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(m)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(m)+")")}}});function c(o,u,m){if(u===1)return ar(o[0][0]);if(u===2)return n(a(o[0][0],o[1][1]),a(o[1][0],o[0][1]));for(var d=!1,h=new Array(u).fill(0).map((O,_)=>_),y=0;y{var{typed:r,matrix:t,divideScalar:n,addScalar:a,multiply:i,unaryMinus:s,det:l,identity:c,abs:o}=e;return r(sB,{"Array | Matrix":function(d){var h=Qe(d)?d.size():ur(d);switch(h.length){case 1:if(h[0]===1)return Qe(d)?t([n(1,d.valueOf()[0])]):[n(1,d[0])];throw new RangeError("Matrix must be square (size: "+lr(h)+")");case 2:{var y=h[0],v=h[1];if(y===v)return Qe(d)?t(u(d.valueOf(),y,v),d.storage()):u(d,y,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(m,d,h){var y,v,x,w,C;if(d===1){if(w=m[0][0],w===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,w)]]}else if(d===2){var b=l(m);if(b===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(m[1][1],b),n(s(m[0][1]),b)],[n(s(m[1][0]),b),n(m[0][0],b)]]}else{var N=m.concat();for(y=0;yO&&(O=o(N[y][S]),_=y),y++;if(O===0)throw Error("Cannot calculate inverse, determinant is zero");y=_,y!==S&&(C=N[S],N[S]=N[y],N[y]=C,C=M[S],M[S]=M[y],M[y]=C);var E=N[S],T=M[S];for(y=0;y{var{typed:r,matrix:t,inv:n,deepEqual:a,equal:i,dotDivide:s,dot:l,ctranspose:c,divideScalar:o,multiply:u,add:m,Complex:d}=e;return r(uB,{"Array | Matrix":function(b){var N=Qe(b)?b.size():ur(b);switch(N.length){case 1:return w(b)?c(b):N[0]===1?n(b):s(c(b),l(b,b));case 2:{if(w(b))return c(b);var M=N[0],S=N[1];if(M===S)try{return n(b)}catch(O){if(!(O instanceof Error&&O.message.match(/Cannot calculate inverse, determinant is zero/)))throw O}return Qe(b)?t(h(b.valueOf(),M,S),b.storage()):h(b,M,S)}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(N)+")")}},any:function(b){return i(b,0)?ar(b):o(1,b)}});function h(C,b,N){var{C:M,F:S}=v(C,b,N),O=u(n(u(c(M),M)),c(M)),_=u(c(S),n(u(S,c(S))));return u(_,O)}function y(C,b,N){for(var M=ar(C),S=0,O=0;O_.filter((T,R)=>R!x(l(M[E],M[E])));return{C:S,F:O}}function x(C){return i(m(C,d(1,1)),m(0,d(1,1)))}function w(C){return a(m(C,d(1,1)),m(u(C,0),d(1,1)))}});function fB(e){var{addScalar:r,subtract:t,flatten:n,multiply:a,multiplyScalar:i,divideScalar:s,sqrt:l,abs:c,bignumber:o,diag:u,size:m,reshape:d,inv:h,qr:y,usolve:v,usolveAll:x,equal:w,complex:C,larger:b,smaller:N,matrixFromColumns:M,dot:S}=e;function O(ae,$,me,Ee){var pe=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ge=_(ae,$,me,Ee,pe);E(ae,$,me,Ee,pe,ge);var{values:Se,C:ye}=T(ae,$,me,Ee,pe);if(pe){var be=R(ae,$,ye,ge,Se,me,Ee);return{values:Se,eigenvectors:be}}return{values:Se}}function _(ae,$,me,Ee,pe){var ge=Ee==="BigNumber",Se=Ee==="Complex",ye=ge?o(0):0,be=ge?o(1):Se?C(1):1,De=ge?o(1):1,Ae=ge?o(10):2,We=i(Ae,Ae),Je;pe&&(Je=Array($).fill(be));for(var J=!1;!J;){J=!0;for(var re=0;re<$;re++){for(var xe=ye,j=ye,ne=0;ne<$;ne++)re!==ne&&(xe=r(xe,c(ae[ne][re])),j=r(j,c(ae[re][ne])));if(!w(xe,0)&&!w(j,0)){for(var ue=De,Me=xe,Ce=s(j,Ae),Le=i(j,Ae);N(Me,Ce);)Me=i(Me,We),ue=i(ue,Ae);for(;b(Me,Le);)Me=s(Me,We),ue=s(ue,Ae);var Ie=N(s(r(Me,j),ue),i(r(xe,j),.95));if(Ie){J=!1;for(var fr=s(1,ue),or=0;or<$;or++)re!==or&&(ae[re][or]=i(ae[re][or],fr),ae[or][re]=i(ae[or][re],ue));pe&&(Je[re]=i(Je[re],fr))}}}}return pe?u(Je):null}function E(ae,$,me,Ee,pe,ge){var Se=Ee==="BigNumber",ye=Ee==="Complex",be=Se?o(0):ye?C(0):0;Se&&(me=o(me));for(var De=0;De<$-2;De++){for(var Ae=0,We=be,Je=De+1;Je<$;Je++){var J=ae[Je][De];N(c(We),c(J))&&(We=J,Ae=Je)}if(!N(c(We),me)){if(Ae!==De+1){var re=ae[Ae];ae[Ae]=ae[De+1],ae[De+1]=re;for(var xe=0;xe<$;xe++){var j=ae[xe][Ae];ae[xe][Ae]=ae[xe][De+1],ae[xe][De+1]=j}if(pe){var ne=ge[Ae];ge[Ae]=ge[De+1],ge[De+1]=ne}}for(var ue=De+2;ue<$;ue++){var Me=s(ae[ue][De],We);if(Me!==0){for(var Ce=0;Ce<$;Ce++)ae[ue][Ce]=t(ae[ue][Ce],i(Me,ae[De+1][Ce]));for(var Le=0;Le<$;Le++)ae[Le][De+1]=r(ae[Le][De+1],i(Me,ae[Le][ue]));if(pe)for(var Ie=0;Ie<$;Ie++)ge[ue][Ie]=t(ge[ue][Ie],i(Me,ge[De+1][Ie]))}}}}return ge}function T(ae,$,me,Ee,pe){var ge=Ee==="BigNumber",Se=Ee==="Complex",ye=ge?o(1):Se?C(1):1;ge&&(me=o(me));for(var be=ar(ae),De=[],Ae=$,We=[],Je=pe?u(Array($).fill(ye)):void 0,J=pe?u(Array(Ae).fill(ye)):void 0,re=0;re<=100;){re+=1;for(var xe=be[Ae-1][Ae-1],j=0;j1&&(J=u(Array(Ae-1).fill(ye)))),Ae-=1,be.pop();for(var Ce=0;Ce2&&(J=u(Array(Ae-2).fill(ye)))),Ae-=2,be.pop(),be.pop();for(var Ie=0;Ie+t(c(Ke),c(Pr))),re>100){var fr=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+De.join(", "));throw fr.values=De,fr.vectors=[],fr}var or=pe?a(Je,W(We,$)):void 0;return{values:De,C:or}}function R(ae,$,me,Ee,pe,ge,Se){var ye=h(me),be=a(ye,ae,me),De=Se==="BigNumber",Ae=Se==="Complex",We=De?o(0):Ae?C(0):0,Je=De?o(1):Ae?C(1):1,J=[],re=[];for(var xe of pe){var j=k(J,xe,w);j===-1?(J.push(xe),re.push(1)):re[j]+=1}for(var ne=[],ue=J.length,Me=Array($).fill(We),Ce=u(Array($).fill(Je)),Le=function(){var or=J[Ie],Ke=t(be,a(or,Ce)),Pr=x(Ke,Me);for(Pr.shift();Pr.lengtha(ce,we)),ne.push(...Pr.map(we=>({value:or,vector:n(we)})))},Ie=0;Ie=5)return null;for(ye=0;;){var be=v(ae,Se);if(N(oe(z(Se,[be])),Ee))break;if(++ye>=10)return null;Se=le(be)}return Se}function K(ae,$,me){var Ee=me==="BigNumber",pe=me==="Complex",ge=Array(ae).fill(0).map(Se=>2*Math.random()-1);return Ee&&(ge=ge.map(Se=>o(Se))),pe&&(ge=ge.map(Se=>C(Se))),ge=z(ge,$),le(ge,me)}function z(ae,$){var me=m(ae);for(var Ee of $)Ee=d(Ee,me),ae=t(ae,a(s(S(Ee,ae),S(Ee,Ee)),Ee));return ae}function oe(ae){return c(l(S(ae,ae)))}function le(ae,$){var me=$==="BigNumber",Ee=$==="Complex",pe=me?o(1):Ee?C(1):1;return a(s(pe,oe(ae)),ae)}return O}function cB(e){var{config:r,addScalar:t,subtract:n,abs:a,atan:i,cos:s,sin:l,multiplyScalar:c,inv:o,bignumber:u,multiply:m,add:d}=e;function h(E,T){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.epsilon,L=arguments.length>3?arguments[3]:void 0,H=arguments.length>4?arguments[4]:void 0;if(L==="number")return y(E,R,H);if(L==="BigNumber")return v(E,R,H);throw TypeError("Unsupported data type: "+L)}function y(E,T,R){var L=E.length,H=Math.abs(T/L),V,W;if(R){W=new Array(L);for(var k=0;k=Math.abs(H);){var K=q[0][0],z=q[0][1];V=x(E[K][K],E[z][z],E[K][z]),E=M(E,V,K,z),R&&(W=C(W,V,K,z)),q=S(E)}for(var oe=Array(L).fill(0),le=0;le=a(H);){var K=q[0][0],z=q[0][1];V=w(E[K][K],E[z][z],E[K][z]),E=N(E,V,K,z),R&&(W=b(W,V,K,z)),q=O(E)}for(var oe=Array(L).fill(0),le=0;le({value:H[$],vector:ae}));return{values:H,eigenvectors:le}}return h}var AG="eigs",MG=["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"],xg=F(AG,MG,e=>{var{config:r,typed:t,matrix:n,addScalar:a,subtract:i,equal:s,abs:l,atan:c,cos:o,sin:u,multiplyScalar:m,divideScalar:d,inv:h,bignumber:y,multiply:v,add:x,larger:w,column:C,flatten:b,number:N,complex:M,sqrt:S,diag:O,size:_,reshape:E,qr:T,usolve:R,usolveAll:L,im:H,re:V,smaller:W,matrixFromColumns:k,dot:q}=e,K=cB({config:r,addScalar:a,subtract:i,column:C,flatten:b,equal:s,abs:l,atan:c,cos:o,sin:u,multiplyScalar:m,inv:h,bignumber:y,complex:M,multiply:v,add:x}),z=fB({config:r,addScalar:a,subtract:i,multiply:v,multiplyScalar:m,flatten:b,divideScalar:d,sqrt:S,abs:l,bignumber:y,diag:O,size:_,reshape:E,qr:T,inv:h,usolve:R,usolveAll:L,equal:s,complex:M,larger:w,smaller:W,matrixFromColumns:k,dot:q});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 ye={matricize:!0};return ht(ye,Se),oe(ge,ye)}});function oe(pe){var ge,Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ye="eigenvectors"in Se?Se.eigenvectors:!0,be=(ge=Se.precision)!==null&&ge!==void 0?ge:r.epsilon,De=le(pe,be,ye);return Se.matricize&&(De.values=n(De.values),ye&&(De.eigenvectors=De.eigenvectors.map(Ae=>{var{value:We,vector:Je}=Ae;return{value:We,vector:n(Je)}}))),ye&&Object.defineProperty(De,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),De}function le(pe,ge,Se){var ye=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($(ye,De,ge)&&(me(ye,De),ae(ye,De,ge))){var Ae=Ee(pe,ye,De);return K(ye,De,ge,Ae,Se)}var We=Ee(pe,ye,De);return z(ye,De,ge,We,Se)}function ae(pe,ge,Se){for(var ye=0;ye{var{typed:r,abs:t,add:n,identity:a,inv:i,multiply:s}=e;return r(lB,{Matrix:function(m){var d=m.size();if(d.length!==2||d[0]!==d[1])throw new RangeError("Matrix must be square (size: "+lr(d)+")");for(var h=d[0],y=1e-15,v=l(m),x=c(v,y),w=x.q,C=x.j,b=s(m,Math.pow(2,-C)),N=a(h),M=a(h),S=1,O=b,_=-1,E=1;E<=w;E++)E>1&&(O=s(O,b),_=-_),S=S*(w-E+1)/((2*w-E+1)*E),N=n(N,s(S,O)),M=n(M,s(S*_,O));for(var T=s(i(M),N),R=0;R{var{typed:r,abs:t,add:n,multiply:a,map:i,sqrt:s,subtract:l,inv:c,size:o,max:u,identity:m}=e,d=1e3,h=1e-6;function y(v){var x,w=0,C=v,b=m(o(v));do{var N=C;if(C=a(.5,n(N,c(b))),b=a(.5,n(b,c(N))),x=u(t(l(C,N))),x>h&&++w>d)throw new Error("computing square root of matrix: iterative method could not converge")}while(x>h);return C}return r(mB,{"Array | Matrix":function(x){var w=Qe(x)?x.size():ur(x);switch(w.length){case 1:if(w[0]===1)return i(x,s);throw new RangeError("Matrix must be square (size: "+lr(w)+")");case 2:{var C=w[0],b=w[1];if(C===b)return y(x);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 pB="sylvester",TG=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],Dg=F(pB,TG,e=>{var{typed:r,schur:t,matrixFromColumns:n,matrix:a,multiply:i,range:s,concat:l,transpose:c,index:o,subset:u,add:m,subtract:d,identity:h,lusolve:y,abs:v}=e;return r(pB,{"Matrix, Matrix, Matrix":x,"Array, Matrix, Matrix":function(C,b,N){return x(a(C),b,N)},"Array, Array, Matrix":function(C,b,N){return x(a(C),a(b),N)},"Array, Matrix, Array":function(C,b,N){return x(a(C),b,a(N))},"Matrix, Array, Matrix":function(C,b,N){return x(C,a(b),N)},"Matrix, Array, Array":function(C,b,N){return x(C,a(b),a(N))},"Matrix, Matrix, Array":function(C,b,N){return x(C,b,a(N))},"Array, Array, Array":function(C,b,N){return x(a(C),a(b),a(N)).toArray()}});function x(w,C,b){for(var N=C.size()[0],M=w.size()[0],S=t(w),O=S.T,_=S.U,E=t(i(-1,C)),T=E.T,R=E.U,L=i(i(c(_),b),R),H=s(0,M),V=[],W=(Ae,We)=>l(Ae,We,1),k=(Ae,We)=>l(Ae,We,0),q=0;q1e-5){for(var K=k(u(L,o(H,q)),u(L,o(H,q+1))),z=0;z{var{typed:r,matrix:t,identity:n,multiply:a,qr:i,norm:s,subtract:l}=e;return r(dB,{Array:function(u){var m=c(t(u));return{U:m.U.valueOf(),T:m.T.valueOf()}},Matrix:function(u){return c(u)}});function c(o){var u=o.size()[0],m=o,d=n(u),h=0,y;do{y=m;var v=i(m),x=v.Q,w=v.R;if(m=a(w,x),d=a(d,x),h++>100)break}while(s(l(m,y))>1e-4);return{U:d,T:m}}});var hB="lyap",_G=["typed","matrix","sylvester","multiply","transpose"],Ng=F(hB,_G,e=>{var{typed:r,matrix:t,sylvester:n,multiply:a,transpose:i}=e;return r(hB,{"Matrix, Matrix":function(l,c){return n(l,i(l),a(-1,c))},"Array, Matrix":function(l,c){return n(t(l),i(t(l)),a(-1,c))},"Matrix, Array":function(l,c){return n(l,i(t(l)),t(a(-1,c)))},"Array, Array":function(l,c){return n(t(l),i(t(l)),t(a(-1,c))).toArray()}})});var OG="divide",BG=["typed","matrix","multiply","equalScalar","divideScalar","inv"],Ag=F(OG,BG,e=>{var{typed:r,matrix:t,multiply:n,equalScalar:a,divideScalar:i,inv:s}=e,l=jr({typed:r,equalScalar:a}),c=kt({typed:r});return r("divide",wm({"Array | Matrix, Array | Matrix":function(u,m){return n(u,s(m))},"DenseMatrix, any":function(u,m){return c(u,m,i,!1)},"SparseMatrix, any":function(u,m){return l(u,m,i,!1)},"Array, any":function(u,m){return c(t(u),m,i,!1).valueOf()},"any, Array | Matrix":function(u,m){return n(u,s(m))}},i.signatures))});var vB="distance",PG=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],Mg=F(vB,PG,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:a,divideScalar:i,deepEqual:s,sqrt:l,abs:c}=e;return r(vB,{"Array, Array, Array":function(M,S,O){if(M.length===2&&S.length===2&&O.length===2){if(!u(M))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 _=n(O[1],S[1]),E=n(S[0],O[0]),T=n(a(O[0],S[1]),a(S[0],O[1]));return x(M[0],M[1],_,E,T)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(M,S,O){if(Object.keys(M).length===2&&Object.keys(S).length===2&&Object.keys(O).length===2){if(!u(M))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(y(S),y(O)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in M&&"pointY"in M&&"lineOnePtX"in S&&"lineOnePtY"in S&&"lineTwoPtX"in O&&"lineTwoPtY"in O){var _=n(O.lineTwoPtY,S.lineOnePtY),E=n(S.lineOnePtX,O.lineTwoPtX),T=n(a(O.lineTwoPtX,S.lineOnePtY),a(S.lineOnePtX,O.lineTwoPtY));return x(M.pointX,M.pointY,_,E,T)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(M,S){if(M.length===2&&S.length===3){if(!u(M))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!m(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return x(M[0],M[1],S[0],S[1],S[2])}else if(M.length===3&&S.length===6){if(!m(M))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(M[0],M[1],M[2],S[0],S[1],S[2],S[3],S[4],S[5])}else if(M.length===S.length&&M.length>0){if(!d(M))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(M,S)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(M,S){if(Object.keys(M).length===2&&Object.keys(S).length===3){if(!u(M))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!m(S))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in M&&"pointY"in M&&"xCoeffLine"in S&&"yCoeffLine"in S&&"constant"in S)return x(M.pointX,M.pointY,S.xCoeffLine,S.yCoeffLine,S.constant);throw new TypeError("Key names do not match")}else if(Object.keys(M).length===3&&Object.keys(S).length===6){if(!m(M))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 M&&"pointY"in M&&"x0"in S&&"y0"in S&&"z0"in S&&"a"in S&&"b"in S&&"c"in S)return w(M.pointX,M.pointY,M.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(M).length===2&&Object.keys(S).length===2){if(!u(M))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 M&&"pointOneY"in M&&"pointTwoX"in S&&"pointTwoY"in S)return C([M.pointOneX,M.pointOneY],[S.pointTwoX,S.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(M).length===3&&Object.keys(S).length===3){if(!m(M))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!m(S))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in M&&"pointOneY"in M&&"pointOneZ"in M&&"pointTwoX"in S&&"pointTwoY"in S&&"pointTwoZ"in S)return C([M.pointOneX,M.pointOneY,M.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(M){if(!v(M))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return b(M)}});function o(N){return typeof N=="number"||rr(N)}function u(N){return N.constructor!==Array&&(N=y(N)),o(N[0])&&o(N[1])}function m(N){return N.constructor!==Array&&(N=y(N)),o(N[0])&&o(N[1])&&o(N[2])}function d(N){return Array.isArray(N)||(N=y(N)),N.every(o)}function h(N){return N.constructor!==Array&&(N=y(N)),o(N[0])&&o(N[1])&&o(N[2])&&o(N[3])&&o(N[4])&&o(N[5])}function y(N){for(var M=Object.keys(N),S=[],O=0;OM.length!==2||!o(M[0])||!o(M[1])))return!1}else if(N[0].length===3&&o(N[0][0])&&o(N[0][1])&&o(N[0][2])){if(N.some(M=>M.length!==3||!o(M[0])||!o(M[1])||!o(M[2])))return!1}else return!1;return!0}function x(N,M,S,O,_){var E=c(t(t(a(S,N),a(O,M)),_)),T=l(t(a(S,S),a(O,O)));return i(E,T)}function w(N,M,S,O,_,E,T,R,L){var H=[n(a(n(_,M),L),a(n(E,S),R)),n(a(n(E,S),T),a(n(O,N),L)),n(a(n(O,N),R),a(n(_,M),T))];H=l(t(t(a(H[0],H[0]),a(H[1],H[1])),a(H[2],H[2])));var V=l(t(t(a(T,T),a(R,R)),a(L,L)));return i(H,V)}function C(N,M){for(var S=N.length,O=0,_=0,E=0;E{var{typed:r,config:t,abs:n,add:a,addScalar:i,matrix:s,multiply:l,multiplyScalar:c,divideScalar:o,subtract:u,smaller:m,equalScalar:d,flatten:h,isZero:y,isNumeric:v}=e;return r("intersect",{"Array, Array, Array":x,"Array, Array, Array, Array":w,"Matrix, Matrix, Matrix":function(R,L,H){var V=x(R.valueOf(),L.valueOf(),H.valueOf());return V===null?null:s(V)},"Matrix, Matrix, Matrix, Matrix":function(R,L,H,V){var W=w(R.valueOf(),L.valueOf(),H.valueOf(),V.valueOf());return W===null?null:s(W)}});function x(T,R,L){if(T=C(T),R=C(R),L=C(L),!N(T))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!N(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!M(L))throw new TypeError("Array with 4 numbers expected as third argument");return E(T[0],T[1],T[2],R[0],R[1],R[2],L[0],L[1],L[2],L[3])}function w(T,R,L,H){if(T=C(T),R=C(R),L=C(L),H=C(H),T.length===2){if(!b(T))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!b(R))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(H))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return S(T,R,L,H)}else if(T.length===3){if(!N(T))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!N(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!N(L))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!N(H))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return _(T[0],T[1],T[2],R[0],R[1],R[2],L[0],L[1],L[2],H[0],H[1],H[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function C(T){return T.length===1?T[0]:T.length>1&&Array.isArray(T[0])&&T.every(R=>Array.isArray(R)&&R.length===1)?h(T):T}function b(T){return T.length===2&&v(T[0])&&v(T[1])}function N(T){return T.length===3&&v(T[0])&&v(T[1])&&v(T[2])}function M(T){return T.length===4&&v(T[0])&&v(T[1])&&v(T[2])&&v(T[3])}function S(T,R,L,H){var V=T,W=L,k=u(V,R),q=u(W,H),K=u(c(k[0],q[1]),c(q[0],k[1]));if(y(K)||m(n(K),t.epsilon))return null;var z=c(q[0],V[1]),oe=c(q[1],V[0]),le=c(q[0],W[1]),ae=c(q[1],W[0]),$=o(i(u(u(z,oe),le),ae),K);return a(l(k,$),V)}function O(T,R,L,H,V,W,k,q,K,z,oe,le){var ae=c(u(T,R),u(L,H)),$=c(u(V,W),u(k,q)),me=c(u(K,z),u(oe,le));return i(i(ae,$),me)}function _(T,R,L,H,V,W,k,q,K,z,oe,le){var ae=O(T,k,z,k,R,q,oe,q,L,K,le,K),$=O(z,k,H,T,oe,q,V,R,le,K,W,L),me=O(T,k,H,T,R,q,V,R,L,K,W,L),Ee=O(z,k,z,k,oe,q,oe,q,le,K,le,K),pe=O(H,T,H,T,V,R,V,R,W,L,W,L),ge=u(c(ae,$),c(me,Ee)),Se=u(c(pe,Ee),c($,$));if(y(Se))return null;var ye=o(ge,Se),be=o(i(ae,c(ye,$)),Ee),De=i(T,c(ye,u(H,T))),Ae=i(R,c(ye,u(V,R))),We=i(L,c(ye,u(W,L))),Je=i(k,c(be,u(z,k))),J=i(q,c(be,u(oe,q))),re=i(K,c(be,u(le,K)));return d(De,Je)&&d(Ae,J)&&d(We,re)?[De,Ae,We]:null}function E(T,R,L,H,V,W,k,q,K,z){var oe=c(T,k),le=c(H,k),ae=c(R,q),$=c(V,q),me=c(L,K),Ee=c(W,K),pe=u(u(u(z,oe),ae),me),ge=u(u(u(i(i(le,$),Ee),oe),ae),me),Se=o(pe,ge),ye=i(T,c(Se,u(H,T))),be=i(R,c(Se,u(V,R))),De=i(L,c(Se,u(W,L)));return[ye,be,De]}});var gB="sum",qG=["typed","config","add","numeric"],nf=F(gB,qG,e=>{var{typed:r,config:t,add:n,numeric:a}=e;return r(gB,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":s,"...":function(c){if(Pa(c))throw new TypeError("Scalar values expected in function sum");return i(c)}});function i(l){var c;return An(l,function(o){try{c=c===void 0?o:n(c,o)}catch(u){throw Et(u,"sum",o)}}),c===void 0&&(c=a(0,t.number)),typeof c=="string"&&(c=a(c,t.number)),c}function s(l,c){try{var o=ko(l,c,n);return o}catch(u){throw Et(u,"sum")}}});var Eg="cumsum",kG=["typed","add","unaryPlus"],af=F(Eg,kG,e=>{var{typed:r,add:t,unaryPlus:n}=e;return r(Eg,{Array:a,Matrix:function(o){return o.create(a(o.valueOf()))},"Array, number | BigNumber":s,"Matrix, number | BigNumber":function(o,u){return o.create(s(o.valueOf(),u))},"...":function(o){if(Pa(o))throw new TypeError("All values expected to be scalar in function cumsum");return a(o)}});function a(c){try{return i(c)}catch(o){throw Et(o,Eg)}}function i(c){if(c.length===0)return[];for(var o=[n(c[0])],u=1;u=u.length)throw new tn(o,u.length);try{return l(c,o)}catch(m){throw Et(m,Eg)}}function l(c,o){var u,m,d;if(o<=0){var h=c[0][0];if(Array.isArray(h)){for(d=Jm(c),m=[],u=0;u{var{typed:r,add:t,divide:n}=e;return r(yB,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":a,"...":function(l){if(Pa(l))throw new TypeError("Scalar values expected in function mean");return i(l)}});function a(s,l){try{var c=ko(s,l,t),o=Array.isArray(s)?ur(s):s.size();return n(c,o[l])}catch(u){throw Et(u,"mean")}}function i(s){var l,c=0;if(An(s,function(o){try{l=l===void 0?o:t(l,o),c++}catch(u){throw Et(u,"mean",o)}}),c===0)throw new Error("Cannot calculate the mean of an empty array");return n(l,c)}});var xB="median",zG=["typed","add","divide","compare","partitionSelect"],Tg=F(xB,zG,e=>{var{typed:r,add:t,divide:n,compare:a,partitionSelect:i}=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 m=u/2-1,d=i(o,m+1),h=o[m],y=0;y0&&(h=o[y]);return c(h,d)}else{var v=i(o,(u-1)/2);return l(v)}}catch(x){throw Et(x,"median")}}var l=r({"number | BigNumber | Complex | Unit":function(u){return u}}),c=r({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(u,m){return n(t(u,m),2)}});return r(xB,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(u,m){throw new Error("median(A, dim) is not yet supported")},"...":function(u){if(Pa(u))throw new TypeError("Scalar values expected in function median");return s(u)}})});var bB="mad",UG=["typed","abs","map","median","subtract"],Fg=F(bB,UG,e=>{var{typed:r,abs:t,map:n,median:a,subtract:i}=e;return r(bB,{"Array | Matrix":s,"...":function(c){return s(c)}});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 c=a(l);return a(n(l,function(o){return t(i(o,c))}))}catch(o){throw o instanceof TypeError&&o.message.indexOf("median")!==-1?new TypeError(o.message.replace("median","mad")):Et(o,"mad")}}});var ND="unbiased",wB="variance",WG=["typed","add","subtract","multiply","divide","apply","isNaN"],sf=F(wB,WG,e=>{var{typed:r,add:t,subtract:n,multiply:a,divide:i,apply:s,isNaN:l}=e;return r(wB,{"Array | Matrix":function(m){return c(m,ND)},"Array | Matrix, string":c,"Array | Matrix, number | BigNumber":function(m,d){return o(m,d,ND)},"Array | Matrix, number | BigNumber, string":o,"...":function(m){return c(m,ND)}});function c(u,m){var d,h=0;if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(An(u,function(x){try{d=d===void 0?x:t(d,x),h++}catch(w){throw Et(w,"variance",x)}}),h===0)throw new Error("Cannot calculate variance of an empty array");var y=i(d,h);if(d=void 0,An(u,function(x){var w=n(x,y);d=d===void 0?a(w,w):t(d,a(w,w))}),l(d))return d;switch(m){case"uncorrected":return i(d,h);case"biased":return i(d,h+1);case"unbiased":{var v=rr(d)?d.mul(0):0;return h===1?v:i(d,h-1)}default:throw new Error('Unknown normalization "'+m+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function o(u,m,d){try{if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return s(u,m,h=>c(h,d))}catch(h){throw Et(h,"variance")}}});var DB="quantileSeq",YG=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],uf=F(DB,YG,e=>{var{typed:r,bignumber:t,add:n,subtract:a,divide:i,multiply:s,partitionSelect:l,compare:c,isInteger:o,smaller:u,smallerEq:m,larger:d}=e,h=Lo({typed:r,isInteger:o});return r(DB,{"Array | Matrix, number | BigNumber":(C,b)=>v(C,b,!1),"Array | Matrix, number | BigNumber, number":(C,b,N)=>y(C,b,!1,N,v),"Array | Matrix, number | BigNumber, boolean":v,"Array | Matrix, number | BigNumber, boolean, number":(C,b,N,M)=>y(C,b,N,M,v),"Array | Matrix, Array | Matrix":(C,b)=>x(C,b,!1),"Array | Matrix, Array | Matrix, number":(C,b,N)=>y(C,b,!1,N,x),"Array | Matrix, Array | Matrix, boolean":x,"Array | Matrix, Array | Matrix, boolean, number":(C,b,N,M)=>y(C,b,N,M,x)});function y(C,b,N,M,S){return h(C,M,O=>S(O,b,N))}function v(C,b,N){var M,S=C.valueOf();if(u(b,0))throw new Error("N/prob must be non-negative");if(m(b,1))return sr(b)?w(S,b,N):t(w(S,b,N));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);M=[];for(var _=0;u(_,b);_++){var E=i(_+1,O);M.push(w(S,E,N))}return sr(b)?M:t(M)}}function x(C,b,N){for(var M=C.valueOf(),S=b.valueOf(),O=[],_=0;_0&&(T=M[L])}return n(s(T,a(1,E)),s(R,E))}});var SB="std",HG=["typed","map","sqrt","variance"],ff=F(SB,HG,e=>{var{typed:r,map:t,sqrt:n,variance:a}=e;return r(SB,{"Array | Matrix":i,"Array | Matrix, string":i,"Array | Matrix, number | BigNumber":i,"Array | Matrix, number | BigNumber, string":i,"...":function(l){return i(l)}});function i(s,l){if(s.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var c=a.apply(null,arguments);return Nt(c)?t(c,n):n(c)}catch(o){throw o instanceof TypeError&&o.message.indexOf(" variance")!==-1?new TypeError(o.message.replace(" variance"," std")):o}}});var NB="corr",$G=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],_g=F(NB,$G,e=>{var{typed:r,matrix:t,sqrt:n,sum:a,add:i,subtract:s,multiply:l,pow:c,divide:o}=e;return r(NB,{"Array, Array":function(h,y){return u(h,y)},"Matrix, Matrix":function(h,y){var v=u(h.toArray(),y.toArray());return Array.isArray(v)?t(v):v}});function u(d,h){var y=[];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;vi(S,l(O,h[_])),0),C=a(d.map(S=>c(S,2))),b=a(h.map(S=>c(S,2))),N=s(l(y,w),l(v,x)),M=n(l(s(l(y,C),c(v,2)),s(l(y,b),c(x,2))));return o(N,M)}});var AB="combinations",GG=["typed"],Og=F(AB,GG,e=>{var{typed:r}=e;return r(AB,{"number, number":qw,"BigNumber, BigNumber":function(n,a){var i=n.constructor,s,l,c=n.minus(a),o=new i(1);if(!MB(n)||!MB(a))throw new TypeError("Positive integer value expected in function combinations");if(a.gt(n))throw new TypeError("k must be less than n in function combinations");if(s=o,a.lt(c))for(l=o;l.lte(c);l=l.plus(o))s=s.times(a.plus(l)).dividedBy(l);else for(l=o;l.lte(a);l=l.plus(o))s=s.times(c.plus(l)).dividedBy(l);return s}})});function MB(e){return e.isInteger()&&e.gte(0)}var CB="combinationsWithRep",VG=["typed"],Bg=F(CB,VG,e=>{var{typed:r}=e;return r(CB,{"number, number":function(n,a){if(!Ze(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Ze(a)||a<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(a{var{typed:r,config:t,multiplyScalar:n,pow:a,BigNumber:i,Complex:s}=e;function l(o){if(o.im===0)return Fc(o.re);if(o.re<.5){var u=new s(1-o.re,-o.im),m=new s(Math.PI*o.re,Math.PI*o.im);return new s(Math.PI).div(m.sin()).div(l(u))}o=new s(o.re-1,o.im);for(var d=new s(Fs[0],0),h=1;h2;)d-=2,y+=d,h=h.times(y);return new i(h.toPrecision(i.precision))}});var FB="lgamma",QG=["Complex","typed"],Ig=F(FB,QG,e=>{var{Complex:r,typed:t}=e,n=7,a=7,i=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(FB,{number:_c,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,m=1.1447298858494002,d=.1;if(o.isNaN())return new r(NaN,NaN);if(o.im===0)return new r(_c(o.re),0);if(o.re>=n||Math.abs(o.im)>=a)return l(o);if(o.re<=d){var h=sM(u,o.im)*Math.floor(.5*o.re+.25),y=o.mul(Math.PI).sin().log(),v=s(new r(1-o.re,-o.im));return new r(m,h).sub(y).sub(v)}else return o.im>=0?c(o):c(o.conjugate()).conjugate()}function l(o){for(var u=o.sub(.5).mul(o.log()).sub(o).add(Hw),m=new r(1,0).div(o),d=m.div(o),h=i[0],y=i[1],v=2*d.re,x=d.re*d.re+d.im*d.im,w=2;w<8;w++){var C=y;y=-x*h+i[w],h=v*h+C}var b=m.mul(d.mul(h).add(y));return u.add(b)}function c(o){var u=0,m=0,d=o;for(o=o.add(1);o.re<=n;){d=d.mul(o);var h=d.im<0?1:0;h!==0&&m===0&&u++,m=h,o=o.add(1)}return l(o).sub(d.log()).sub(new r(0,u*2*Math.PI*1))}});var _B="factorial",XG=["typed","gamma"],Rg=F(_B,XG,e=>{var{typed:r,gamma:t}=e;return r(_B,{number:function(a){if(a<0)throw new Error("Value must be non-negative");return t(a+1)},BigNumber:function(a){if(a.isNegative())throw new Error("Value must be non-negative");return t(a.plus(1))},"Array | Matrix":r.referToSelf(n=>a=>je(a,n))})});var OB="kldivergence",JG=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],qg=F(OB,JG,e=>{var{typed:r,matrix:t,divide:n,sum:a,multiply:i,map:s,dotDivide:l,log:c,isNumeric:o}=e;return r(OB,{"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(m,d){var h=d.size().length,y=m.size().length;if(h>1)throw new Error("first object must be one dimensional");if(y>1)throw new Error("second object must be one dimensional");if(h!==y)throw new Error("Length of two vectors must be equal");var v=a(m);if(v===0)throw new Error("Sum of elements in first object must be non zero");var x=a(d);if(x===0)throw new Error("Sum of elements in second object must be non zero");var w=n(m,a(m)),C=n(d,a(d)),b=a(i(w,s(l(w,C),N=>c(N))));return o(b)?b:Number.NaN}});var BB="multinomial",KG=["typed","add","divide","multiply","factorial","isInteger","isPositive"],kg=F(BB,KG,e=>{var{typed:r,add:t,divide:n,multiply:a,factorial:i,isInteger:s,isPositive:l}=e;return r(BB,{"Array | Matrix":function(o){var u=0,m=1;return An(o,function(d){if(!s(d)||!l(d))throw new TypeError("Positive integer value expected in function multinomial");u=t(u,d),m=a(m,i(d))}),n(i(u),m)}})});var PB="permutations",jG=["typed","factorial"],Lg=F(PB,jG,e=>{var{typed:r,factorial:t}=e;return r(PB,{"number | BigNumber":t,"number, number":function(a,i){if(!Ze(a)||a<0)throw new TypeError("Positive integer value expected in function permutations");if(!Ze(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(i>a)throw new TypeError("second argument k must be less than or equal to first argument n");return va(a-i+1,a)},"BigNumber, BigNumber":function(a,i){var s,l;if(!IB(a)||!IB(i))throw new TypeError("Positive integer value expected in function permutations");if(i.gt(a))throw new TypeError("second argument k must be less than or equal to first argument n");var c=a.mul(0).add(1);for(s=c,l=a.minus(i).plus(1);l.lte(a);l=l.plus(1))s=s.times(l);return s}})});function IB(e){return e.isInteger()&&e.gte(0)}var _D=ma(KB(),1),oV=(0,_D.default)(Date.now());function no(e){var r;function t(a){r=a===null?oV:(0,_D.default)(String(a))}t(e);function n(){return r()}return n}var jB="pickRandom",sV=["typed","config","?on"],Ug=F(jB,sV,e=>{var{typed:r,config:t,on:n}=e,a=no(t.randomSeed);return n&&n("config",function(s,l){s.randomSeed!==l.randomSeed&&(a=no(s.randomSeed))}),r(jB,{"Array | Matrix":function(l){return i(l,{})},"Array | Matrix, Object":function(l,c){return i(l,c)},"Array | Matrix, number":function(l,c){return i(l,{number:c})},"Array | Matrix, Array | Matrix":function(l,c){return i(l,{weights:c})},"Array | Matrix, Array | Matrix, number":function(l,c,o){return i(l,{number:o,weights:c})},"Array | Matrix, number, Array | Matrix":function(l,c,o){return i(l,{number:c,weights:o})}});function i(s,l){var{number:c,weights:o,elementWise:u=!0}=l,m=typeof c>"u";m&&(c=1);var d=Qe(s)?s.create:Qe(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 y=0,v=o.length;y"u")C=s[Math.floor(a()*x)];else for(var b=a()*h,N=0,M=s.length;N1)for(var n=0,a=e.shift();n{var{typed:r,config:t,on:n}=e,a=no(t.randomSeed);return n&&n("config",function(l,c){l.randomSeed!==c.randomSeed&&(a=no(l.randomSeed))}),r(eP,{"":()=>s(0,1),number:l=>s(0,l),"number, number":(l,c)=>s(l,c),"Array | Matrix":l=>i(l,0,1),"Array | Matrix, number":(l,c)=>i(l,0,c),"Array | Matrix, number, number":(l,c,o)=>i(l,c,o)});function i(l,c,o){var u=Rc(l.valueOf(),()=>s(c,o));return Qe(l)?l.create(u):u}function s(l,c){return l+a()*(c-l)}});var rP="randomInt",fV=["typed","config","?on"],Yg=F(rP,fV,e=>{var{typed:r,config:t,on:n}=e,a=no(t.randomSeed);return n&&n("config",function(l,c){l.randomSeed!==c.randomSeed&&(a=no(l.randomSeed))}),r(rP,{"":()=>s(0,1),number:l=>s(0,l),"number, number":(l,c)=>s(l,c),"Array | Matrix":l=>i(l,0,1),"Array | Matrix, number":(l,c)=>i(l,0,c),"Array | Matrix, number, number":(l,c,o)=>i(l,c,o)});function i(l,c,o){var u=Rc(l.valueOf(),()=>s(c,o));return Qe(l)?l.create(u):u}function s(l,c){return Math.floor(l+a()*(c-l))}});var tP="stirlingS2",cV=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],Hg=F(tP,cV,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:a,divideScalar:i,pow:s,factorial:l,combinations:c,isNegative:o,isInteger:u,number:m,bignumber:d,larger:h}=e,y=[],v=[];return r(tP,{"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=!(sr(w)&&sr(C)),N=b?v:y,M=b?d:m,S=m(w),O=m(C);if(N[S]&&N[S].length>O)return N[S][O];for(var _=0;_<=S;++_)if(N[_]||(N[_]=[M(_===0?1:0)]),_!==0)for(var E=N[_],T=N[_-1],R=E.length;R<=_&&R<=O;++R)R===_?E[R]=1:E[R]=t(a(M(R),T[R]),T[R-1]);return N[S][O]}})});var nP="bellNumbers",lV=["typed","addScalar","isNegative","isInteger","stirlingS2"],$g=F(nP,lV,e=>{var{typed:r,addScalar:t,isNegative:n,isInteger:a,stirlingS2:i}=e;return r(nP,{"number | BigNumber":function(l){if(!a(l)||n(l))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var c=0,o=0;o<=l;o++)c=t(c,i(l,o));return c}})});var aP="catalan",mV=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],Gg=F(aP,mV,e=>{var{typed:r,addScalar:t,divideScalar:n,multiplyScalar:a,combinations:i,isNegative:s,isInteger:l}=e;return r(aP,{"number | BigNumber":function(o){if(!l(o)||s(o))throw new TypeError("Non-negative integer value expected in function catalan");return n(i(a(o,2),o),t(o,1))}})});var iP="composition",pV=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],Vg=F(iP,pV,e=>{var{typed:r,addScalar:t,combinations:n,isPositive:a,isNegative:i,isInteger:s,larger:l}=e;return r(iP,{"number | BigNumber, number | BigNumber":function(o,u){if(!s(o)||!a(o)||!s(u)||!a(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 oP="leafCount",dV=["parse","typed"],Zg=F(oP,dV,e=>{var{parse:r,typed:t}=e;function n(a){var i=0;return a.forEach(s=>{i+=n(s)}),i||1}return t(oP,{Node:function(i){return n(i)}})});function OD(e){return xr(e)||ct(e)&&e.isUnary()&&xr(e.args[0])}function qc(e){return!!(xr(e)||(yn(e)||ct(e))&&e.args.every(qc)||en(e)&&qc(e.content))}function sP(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function BD(e){for(var r=1;r{var{FunctionNode:r,OperatorNode:t,SymbolNode:n}=e,a=!0,i=!1,s="defaultF",l={add:{trivial:a,total:a,commutative:a,associative:a},unaryPlus:{trivial:a,total:a,commutative:a,associative:a},subtract:{trivial:i,total:a,commutative:i,associative:i},multiply:{trivial:a,total:a,commutative:a,associative:a},divide:{trivial:i,total:a,commutative:i,associative:i},paren:{trivial:a,total:a,commutative:a,associative:i},defaultF:{trivial:i,total:a,commutative:i,associative:i}},c={divide:{total:i},log:{total:i}},o={subtract:{total:i},abs:{trivial:a},log:{total:a}};function u(b,N){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l,S=s;if(typeof b=="string"?S=b:ct(b)?S=b.fn.toString():yn(b)?S=b.name:en(b)&&(S="paren"),Xe(M,S)){var O=M[S];if(Xe(O,N))return O[N];if(Xe(l,S))return l[S][N]}if(Xe(M,s)){var _=M[s];return Xe(_,N)?_[N]:l[s][N]}if(Xe(l,S)){var E=l[S];if(Xe(E,N))return E[N]}return l[s][N]}function m(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return u(b,"commutative",N)}function d(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return u(b,"associative",N)}function h(b,N){var M=BD({},b);for(var S in N)Xe(b,S)?M[S]=BD(BD({},N[S]),b[S]):M[S]=N[S];return M}function y(b,N){if(!b.args||b.args.length===0)return b;b.args=v(b,N);for(var M=0;M2&&d(b,N)){for(var _=b.args.pop();b.args.length>0;)_=M([b.args.pop(),_]);b.args=_.args}}}function w(b,N){if(!(!b.args||b.args.length===0)){for(var M=C(b),S=b.args.length,O=0;O2&&d(b,N)){for(var _=b.args.shift();b.args.length>0;)_=M([_,b.args.shift()]);b.args=_.args}}}function C(b){return ct(b)?function(N){try{return new t(b.op,b.fn,N,b.implicit)}catch(M){return console.error(M),[]}}:function(N){return new r(new n(b.name),N)}}return{createMakeNodeFunction:C,hasProperty:u,isCommutative:m,isAssociative:d,mergeContext:h,flatten:y,allChildren:v,unflattenr:x,unflattenl:w,defaultContext:l,realContext:c,positiveContext:o}});var gV="simplify",yV=["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"],Qg=F(gV,yV,e=>{var{config:r,typed:t,parse:n,add:a,subtract:i,multiply:s,divide:l,pow:c,isZero:o,equal:u,resolve:m,simplifyConstant:d,simplifyCore:h,fraction:y,bignumber:v,mathWithTransform:x,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:N,FunctionNode:M,IndexNode:S,ObjectNode:O,OperatorNode:_,ParenthesisNode:E,SymbolNode:T}=e,{hasProperty:R,isCommutative:L,isAssociative:H,mergeContext:V,flatten:W,unflattenr:k,unflattenl:q,createMakeNodeFunction:K,defaultContext:z,realContext:oe,positiveContext:le}=cf({FunctionNode:M,OperatorNode:_,SymbolNode:T});t.addConversion({from:"Object",to:"Map",convert:ji});var ae=t("simplify",{Node:ye,"Node, Map":(j,ne)=>ye(j,!1,ne),"Node, Map, Object":(j,ne,ue)=>ye(j,!1,ne,ue),"Node, Array":ye,"Node, Array, Map":ye,"Node, Array, Map, Object":ye});t.removeConversion({from:"Object",to:"Map",convert:ji}),ae.defaultContext=z,ae.realContext=oe,ae.positiveContext=le;function $(j){return j.transform(function(ne,ue,Me){return en(ne)?$(ne.content):ne})}var me={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};ae.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 Ee(j,ne){var ue={};if(j.s){var Me=j.s.split("->");if(Me.length===2)ue.l=Me[0],ue.r=Me[1];else throw SyntaxError("Could not parse rule: "+j.s)}else ue.l=j.l,ue.r=j.r;ue.l=$(n(ue.l)),ue.r=$(n(ue.r));for(var Ce of["imposeContext","repeat","assuming"])Ce in j&&(ue[Ce]=j[Ce]);if(j.evaluate&&(ue.evaluate=n(j.evaluate)),H(ue.l,ne)){var Le=!L(ue.l,ne),Ie;Le&&(Ie=Se());var fr=K(ue.l),or=Se();ue.expanded={},ue.expanded.l=fr([ue.l,or]),W(ue.expanded.l,ne),k(ue.expanded.l,ne),ue.expanded.r=fr([ue.r,or]),Le&&(ue.expandedNC1={},ue.expandedNC1.l=fr([Ie,ue.l]),ue.expandedNC1.r=fr([Ie,ue.r]),ue.expandedNC2={},ue.expandedNC2.l=fr([Ie,ue.expanded.l]),ue.expandedNC2.r=fr([Ie,ue.expanded.r]))}return ue}function pe(j,ne){for(var ue=[],Me=0;Me2&&arguments[2]!==void 0?arguments[2]:Bo(),Me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Ce=Me.consoleDebug;ne=pe(ne||ae.rules,Me.context);var Le=m(j,ue);Le=$(Le);for(var Ie={},fr=Le.toString({parenthesis:"all"});!Ie[fr];){Ie[fr]=!0,ge=0;var or=fr;Ce&&console.log("Working on: ",fr);for(var Ke=0;Ke ").concat(ne[Ke].r.toString()))),Ce){var ee=Le.toString({parenthesis:"all"});ee!==or&&(console.log("Applying",Pr,"produced",ee),or=ee)}q(Le,Me.context)}fr=Le.toString({parenthesis:"all"})}return Le}function be(j,ne,ue){var Me=j;if(j)for(var Ce=0;Ce1&&(or=Le(j.args.slice(0,fr))),Ce=j.args.slice(fr),Me=Ce.length===1?Ce[0]:Le(Ce),ue.push(Le([or,Me]))}return ue}function We(j,ne){var ue={placeholders:{}};if(!j.placeholders&&!ne.placeholders)return ue;if(j.placeholders){if(!ne.placeholders)return j}else return ne;for(var Me in j.placeholders)if(Xe(j.placeholders,Me)&&(ue.placeholders[Me]=j.placeholders[Me],Xe(ne.placeholders,Me)&&!xe(j.placeholders[Me],ne.placeholders[Me])))return null;for(var Ce in ne.placeholders)Xe(ne.placeholders,Ce)&&(ue.placeholders[Ce]=ne.placeholders[Ce]);return ue}function Je(j,ne){var ue=[];if(j.length===0||ne.length===0)return ue;for(var Me,Ce=0;Ce2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var or=re(j.args[0],ne.args[1],ue);if(or.length===0)return[];var Ke=re(j.args[1],ne.args[0],ue);if(Ke.length===0)return[];Le=[or,Ke]}Ce=J(Le)}else if(ne.args.length>=2&&j.args.length===2){for(var Pr=Ae(ne,ue),ee=[],ce=0;ce2)throw Error("Unexpected non-binary associative function: "+j.toString());return[]}}else if(j instanceof T){if(j.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(me[j.name]){if(j.name!==ne.name)return[]}else switch(j.name[1]>="a"&&j.name[1]<="z"?j.name.substring(0,2):j.name[0]){case"n":case"_p":Ce[0].placeholders[j.name]=ne;break;case"c":case"cl":if(xr(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"v":if(!xr(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"vl":if(at(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"cd":if(OD(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"vd":if(!OD(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"ce":if(qc(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"ve":if(!qc(ne))Ce[0].placeholders[j.name]=ne;else return[];break;default:throw new Error("Invalid symbol in rule: "+j.name)}}else if(j instanceof N){if(!u(j.value,ne.value))return[]}else return[];return Ce}function xe(j,ne){if(j instanceof N&&ne instanceof N){if(!u(j.value,ne.value))return!1}else if(j instanceof T&&ne instanceof T){if(j.name!==ne.name)return!1}else if(j instanceof _&&ne instanceof _||j instanceof M&&ne instanceof M){if(j instanceof _){if(j.op!==ne.op||j.fn!==ne.fn)return!1}else if(j instanceof M&&j.name!==ne.name)return!1;if(j.args.length!==ne.args.length)return!1;for(var ue=0;ue{var{typed:r,config:t,mathWithTransform:n,matrix:a,fraction:i,bignumber:s,AccessorNode:l,ArrayNode:c,ConstantNode:o,FunctionNode:u,IndexNode:m,ObjectNode:d,OperatorNode:h,SymbolNode:y}=e,{isCommutative:v,isAssociative:x,allChildren:w,createMakeNodeFunction:C}=cf({FunctionNode:u,OperatorNode:h,SymbolNode:y}),b=r("simplifyConstant",{Node:W=>O(V(W,{})),"Node, Object":function(k,q){return O(V(k,q))}});function N(W){return da(W)?W.valueOf():W instanceof Array?W.map(N):Qe(W)?a(N(W.valueOf())):W}function M(W,k,q){try{return n[W].apply(null,k)}catch{return k=k.map(N),E(n[W].apply(null,k),q)}}var S=r({Fraction:R,number:function(k){return k<0?T(new o(-k)):new o(k)},BigNumber:function(k){return k<0?T(new o(-k)):new o(k)},Complex:function(k){throw new Error("Cannot convert Complex number to Node")},string:function(k){return new o(k)},Matrix:function(k){return new c(k.valueOf().map(q=>S(q)))}});function O(W){return Nr(W)?W:S(W)}function _(W,k){var q=k&&k.exactFractions!==!1;if(q&&isFinite(W)&&i){var K=i(W),z=k&&typeof k.fractionsLimit=="number"?k.fractionsLimit:1/0;if(K.valueOf()===W&&K.n0;)if(xr(K[0])&&typeof K[0].value!="string"){var z=E(K.shift().value,q);jt(W)?W=W.items[z-1]:(W=W.valueOf()[z-1],W instanceof Array&&(W=a(W)))}else if(K.length>1&&xr(K[1])&&typeof K[1].value!="string"){var oe=E(K[1].value,q),le=[],ae=jt(W)?W.items:W.valueOf();for(var $ of ae)if(jt($))le.push($.items[oe-1]);else if(Qe(W))le.push($[oe-1]);else break;if(le.length===ae.length)jt(W)?W=new c(le):W=a(le),K.splice(1,1);else break}else break;return K.length===k.dimensions.length?new l(O(W),k):K.length>0?(k=new m(K),new l(O(W),k)):W}if(Ei(W)&&k.dimensions.length===1&&xr(k.dimensions[0])){var me=k.dimensions[0].value;return me in W.properties?W.properties[me]:new o}return new l(O(W),k)}function H(W,k,q,K){var z=k.shift(),oe=k.reduce((le,ae)=>{if(!Nr(ae)){var $=le.pop();if(Nr($))return[$,ae];try{return le.push(M(W,[$,ae],K)),le}catch{le.push($)}}le.push(O(le.pop()));var me=le.length===1?le[0]:q(le);return[q([me,O(ae)])]},[z]);return oe.length===1?oe[0]:q([oe[0],S(oe[1])])}function V(W,k){switch(W.type){case"SymbolNode":return W;case"ConstantNode":switch(typeof W.value){case"number":return E(W.value,k);case"string":return W.value;default:if(!isNaN(W.value))return E(W.value,k)}return W;case"FunctionNode":if(n[W.name]&&n[W.name].rawArgs)return W;{var q=["add","multiply"];if(q.indexOf(W.name)===-1){var K=W.args.map(De=>V(De,k));if(!K.some(Nr))try{return M(W.name,K,k)}catch{}if(W.name==="size"&&K.length===1&&jt(K[0])){for(var z=[],oe=K[0];jt(oe);)z.push(oe.items.length),oe=oe.items[0];return a(z)}return new u(W.name,K.map(O))}}case"OperatorNode":{var le=W.fn.toString(),ae,$,me=C(W);if(ct(W)&&W.isUnary())ae=[V(W.args[0],k)],Nr(ae[0])?$=me(ae):$=M(le,ae,k);else if(x(W,k.context))if(ae=w(W,k.context),ae=ae.map(De=>V(De,k)),v(le,k.context)){for(var Ee=[],pe=[],ge=0;ge1?($=H(le,Ee,me,k),pe.unshift($),$=H(le,pe,me,k)):$=H(le,ae,me,k)}else $=H(le,ae,me,k);else ae=W.args.map(De=>V(De,k)),$=H(le,ae,me,k);return $}case"ParenthesisNode":return V(W.content,k);case"AccessorNode":return L(V(W.object,k),V(W.index,k),k);case"ArrayNode":{var Se=W.items.map(De=>V(De,k));return Se.some(Nr)?new c(Se.map(O)):a(Se)}case"IndexNode":return new m(W.dimensions.map(De=>b(De,k)));case"ObjectNode":{var ye={};for(var be in W.properties)ye[be]=b(W.properties[be],k);return new d(ye)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(W.type))}}return b});var uP="simplifyCore",wV=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Jg=F(uP,wV,e=>{var{typed:r,parse:t,equal:n,isZero:a,add:i,subtract:s,multiply:l,divide:c,pow:o,AccessorNode:u,ArrayNode:m,ConstantNode:d,FunctionNode:h,IndexNode:y,ObjectNode:v,OperatorNode:x,ParenthesisNode:w,SymbolNode:C}=e,b=new d(0),N=new d(1),M=new d(!0),S=new d(!1);function O(R){return ct(R)&&["and","not","or"].includes(R.op)}var{hasProperty:_,isCommutative:E}=cf({FunctionNode:h,OperatorNode:x,SymbolNode:C});function T(R){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H=L?L.context:void 0;if(_(R,"trivial",H)){if(yn(R)&&R.args.length===1)return T(R.args[0],L);var V=!1,W=0;if(R.forEach(pe=>{++W,W===1&&(V=T(pe,L))}),W===1)return V}var k=R;if(yn(k)){var q=iT(k.name);if(q){if(k.args.length>2&&_(k,"associative",H))for(;k.args.length>2;){var K=k.args.pop(),z=k.args.pop();k.args.push(new x(q,k.name,[K,z]))}k=new x(q,k.name,k.args)}else return new h(T(k.fn),k.args.map(pe=>T(pe,L)))}if(ct(k)&&k.isUnary()){var oe=T(k.args[0],L);if(k.op==="~"&&ct(oe)&&oe.isUnary()&&oe.op==="~"||k.op==="not"&&ct(oe)&&oe.isUnary()&&oe.op==="not"&&O(oe.args[0]))return oe.args[0];var le=!0;if(k.op==="-"&&ct(oe)&&(oe.isBinary()&&oe.fn==="subtract"&&(k=new x("-","subtract",[oe.args[1],oe.args[0]]),le=!1),oe.isUnary()&&oe.op==="-"))return oe.args[0];if(le)return new x(k.op,k.fn,[oe])}if(ct(k)&&k.isBinary()){var ae=T(k.args[0],L),$=T(k.args[1],L);if(k.op==="+"){if(xr(ae)&&a(ae.value))return $;if(xr($)&&a($.value))return ae;ct($)&&$.isUnary()&&$.op==="-"&&($=$.args[0],k=new x("-","subtract",[ae,$]))}if(k.op==="-")return ct($)&&$.isUnary()&&$.op==="-"?T(new x("+","add",[ae,$.args[0]]),L):xr(ae)&&a(ae.value)?T(new x("-","unaryMinus",[$])):xr($)&&a($.value)?ae:new x(k.op,k.fn,[ae,$]);if(k.op==="*"){if(xr(ae)){if(a(ae.value))return b;if(n(ae.value,1))return $}if(xr($)){if(a($.value))return b;if(n($.value,1))return ae;if(E(k,H))return new x(k.op,k.fn,[$,ae],k.implicit)}return new x(k.op,k.fn,[ae,$],k.implicit)}if(k.op==="/")return xr(ae)&&a(ae.value)?b:xr($)&&n($.value,1)?ae:new x(k.op,k.fn,[ae,$]);if(k.op==="^"&&xr($)){if(a($.value))return N;if(n($.value,1))return ae}if(k.op==="and"){if(xr(ae))if(ae.value){if(O($))return $;if(xr($))return $.value?M:S}else return S;if(xr($))if($.value){if(O(ae))return ae}else return S}if(k.op==="or"){if(xr(ae)){if(ae.value)return M;if(O($))return $}if(xr($)){if($.value)return M;if(O(ae))return ae}}return new x(k.op,k.fn,[ae,$])}if(ct(k))return new x(k.op,k.fn,k.args.map(pe=>T(pe,L)));if(jt(k))return new m(k.items.map(pe=>T(pe,L)));if(Ln(k))return new u(T(k.object,L),T(k.index,L));if(Jn(k))return new y(k.dimensions.map(pe=>T(pe,L)));if(Ei(k)){var me={};for(var Ee in k.properties)me[Ee]=T(k.properties[Ee],L);return new v(me)}return k}return r(uP,{Node:T,"Node,Object":T})});var DV="resolve",SV=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],Kg=F(DV,SV,e=>{var{typed:r,parse:t,ConstantNode:n,FunctionNode:a,OperatorNode:i,ParenthesisNode:s}=e;function l(c,o){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!o)return c;if(at(c)){if(u.has(c.name)){var m=Array.from(u).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(m,"}"))}var d=o.get(c.name);if(Nr(d)){var h=new Set(u);return h.add(c.name),l(d,o,h)}else return typeof d=="number"?t(String(d)):d!==void 0?new n(d):c}else if(ct(c)){var y=c.args.map(function(x){return l(x,o,u)});return new i(c.op,c.fn,y,c.implicit)}else{if(en(c))return new s(l(c.content,o,u));if(yn(c)){var v=c.args.map(function(x){return l(x,o,u)});return new a(c.name,v)}}return c.map(x=>l(x,o,u))}return r("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(c,o)=>l(c,ji(o)),"Array | Matrix":r.referToSelf(c=>o=>o.map(u=>c(u))),"Array | Matrix, null | undefined":r.referToSelf(c=>o=>o.map(u=>c(u))),"Array, Object":r.referTo("Array,Map",c=>(o,u)=>c(o,ji(u))),"Matrix, Object":r.referTo("Matrix,Map",c=>(o,u)=>c(o,ji(u))),"Array | Matrix, Map":r.referToSelf(c=>(o,u)=>o.map(m=>c(m,u)))})});var fP="symbolicEqual",NV=["parse","simplify","typed","OperatorNode"],jg=F(fP,NV,e=>{var{parse:r,simplify:t,typed:n,OperatorNode:a}=e;function i(s,l){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=new a("-","subtract",[s,l]),u=t(o,{},c);return xr(u)&&!u.value}return n(fP,{"Node, Node":i,"Node, Node, Object":i})});var cP="derivative",AV=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],e0=F(cP,AV,e=>{var{typed:r,config:t,parse:n,simplify:a,equal:i,isZero:s,numeric:l,ConstantNode:c,FunctionNode:o,OperatorNode:u,ParenthesisNode:m,SymbolNode:d}=e;function h(b,N){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},S={};x(S,b,N.name);var O=w(b,S);return M.simplify?a(O):O}r.addConversion({from:"identifier",to:"SymbolNode",convert:n});var y=r(cP,{"Node, SymbolNode":h,"Node, SymbolNode, Object":h});r.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),y._simplify=!0,y.toTex=function(b){return v.apply(null,b.args)};var v=r("_derivTex",{"Node, SymbolNode":function(N,M){return xr(N)&&Tr(N.value)==="string"?v(n(N.value).toString(),M.toString(),1):v(N.toTex(),M.toString(),1)},"Node, ConstantNode":function(N,M){if(Tr(M.value)==="string")return v(N,n(M.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(N,M,S){return v(N.toString(),M.name,S.value)},"string, string, number":function(N,M,S){var O;return S===1?O="{d\\\\over d"+M+"}":O="{d^{"+S+"}\\\\over d"+M+"^{"+S+"}}",O+"\\\\left[".concat(N,"\\\\right]")}}),x=r("constTag",{"Object, ConstantNode, string":function(N,M){return N[M]=!0,!0},"Object, SymbolNode, string":function(N,M,S){return M.name!==S?(N[M]=!0,!0):!1},"Object, ParenthesisNode, string":function(N,M,S){return x(N,M.content,S)},"Object, FunctionAssignmentNode, string":function(N,M,S){return M.params.indexOf(S)===-1?(N[M]=!0,!0):x(N,M.expr,S)},"Object, FunctionNode | OperatorNode, string":function(N,M,S){if(M.args.length>0){for(var O=x(N,M.args[0],S),_=1;_0){var O=N.args.filter(function(W){return M[W]===void 0}),_=O.length===1?O[0]:new u("*","multiply",O),E=S.concat(w(_,M));return new u("*","multiply",E)}return new u("+","add",N.args.map(function(W){return new u("*","multiply",N.args.map(function(k){return k===W?w(k,M):k.clone()}))}))}if(N.op==="/"&&N.isBinary()){var T=N.args[0],R=N.args[1];return M[R]!==void 0?new u("/","divide",[w(T,M),R]):M[T]!==void 0?new u("*","multiply",[new u("-","unaryMinus",[T]),new u("/","divide",[w(R,M),new u("^","pow",[R.clone(),C(2)])])]):new u("/","divide",[new u("-","subtract",[new u("*","multiply",[w(T,M),R.clone()]),new u("*","multiply",[T.clone(),w(R,M)])]),new u("^","pow",[R.clone(),C(2)])])}if(N.op==="^"&&N.isBinary()){var L=N.args[0],H=N.args[1];if(M[L]!==void 0)return xr(L)&&(s(L.value)||i(L.value,1))?C(0):new u("*","multiply",[N,new u("*","multiply",[new o("log",[L.clone()]),w(H.clone(),M)])]);if(M[H]!==void 0){if(xr(H)){if(s(H.value))return C(0);if(i(H.value,1))return w(L,M)}var V=new u("^","pow",[L.clone(),new u("-","subtract",[H,C(1)])]);return new u("*","multiply",[H.clone(),new u("*","multiply",[w(L,M),V])])}return new u("*","multiply",[new u("^","pow",[L.clone(),H.clone()]),new u("+","add",[new u("*","multiply",[w(L,M),new u("/","divide",[H.clone(),L.clone()])]),new u("*","multiply",[w(H,M),new o("log",[L.clone()])])])])}throw new Error('Cannot process operator "'+N.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function C(b,N){return new c(l(b,N||t.number))}return y});var lP="rationalize",MV=["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"],r0=F(lP,MV,e=>{var{config:r,typed:t,equal:n,isZero:a,add:i,subtract:s,multiply:l,divide:c,pow:o,parse:u,simplifyConstant:m,simplifyCore:d,simplify:h,fraction:y,bignumber:v,mathWithTransform:x,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:N,FunctionNode:M,IndexNode:S,ObjectNode:O,OperatorNode:_,SymbolNode:E,ParenthesisNode:T}=e;function R(k){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,z=H(),oe=L(k,q,!0,z.firstRules),le=oe.variables.length,ae={exactFractions:!1},$={exactFractions:!0};if(k=oe.expression,le>=1){k=V(k);var me,Ee,pe=!0,ge=!1;k=h(k,z.firstRules,{},ae);for(var Se;Ee=pe?z.distrDivRules:z.sucDivRules,k=h(k,Ee,{},$),pe=!pe,Se=k.toString(),Se!==me;)ge=!0,me=Se;ge&&(k=h(k,z.firstRulesAgain,{},ae)),k=h(k,z.finalRules,{},ae)}var ye=[],be={};return k.type==="OperatorNode"&&k.isBinary()&&k.op==="/"?(le===1&&(k.args[0]=W(k.args[0],ye),k.args[1]=W(k.args[1])),K&&(be.numerator=k.args[0],be.denominator=k.args[1])):(le===1&&(k=W(k,ye)),K&&(be.numerator=k,be.denominator=null)),K?(be.coefficients=ye,be.variables=oe.variables,be.expression=k,be):k}return t(lP,{Node:R,"Node, boolean":(k,q)=>R(k,{},q),"Node, Object":R,"Node, Object, boolean":R});function L(k,q,K,z){var oe=[],le=h(k,z,q,{exactFractions:!1});K=!!K;var ae="+-*"+(K?"/":"");me(le);var $={};return $.expression=le,$.variables=oe,$;function me(Ee){var pe=Ee.type;if(pe==="FunctionNode")throw new Error("There is an unsolved function call");if(pe==="OperatorNode")if(Ee.op==="^"){if(Ee.args[1].type!=="ConstantNode"||!Ze(parseFloat(Ee.args[1].value)))throw new Error("There is a non-integer exponent");me(Ee.args[0])}else{if(ae.indexOf(Ee.op)===-1)throw new Error("Operator "+Ee.op+" invalid in polynomial expression");for(var ge=0;ge1;if(z==="OperatorNode"&&k.isBinary()){var le=!1,ae;if(k.op==="^"&&(k.args[0].type==="ParenthesisNode"||k.args[0].type==="OperatorNode")&&k.args[1].type==="ConstantNode"&&(ae=parseFloat(k.args[1].value),le=ae>=2&&Ze(ae)),le){if(ae>2){var $=k.args[0],me=new _("^","pow",[k.args[0].cloneDeep(),new N(ae-1)]);k=new _("*","multiply",[$,me])}else k=new _("*","multiply",[k.args[0],k.args[0].cloneDeep()]);oe&&(K==="content"?q.content=k:q.args[K]=k)}}if(z==="ParenthesisNode")V(k.content,k,"content");else if(z!=="ConstantNode"&&z!=="SymbolNode")for(var Ee=0;Ee=0;$--)if(q[$]!==0){var me=new N(le?q[$]:Math.abs(q[$])),Ee=q[$]<0?"-":"+";if($>0){var pe=new E(oe);if($>1){var ge=new N($);pe=new _("^","pow",[pe,ge])}q[$]===-1&&le?me=new _("-","unaryMinus",[pe]):Math.abs(q[$])===1?me=pe:me=new _("*","multiply",[me,pe])}le?ae=me:Ee==="+"?ae=new _("+","add",[ae,me]):ae=new _("-","subtract",[ae,me]),le=!1}if(le)return new N(0);return ae;function Se(ye,be,De){var Ae=ye.type;if(Ae==="FunctionNode")throw new Error("There is an unsolved function call");if(Ae==="OperatorNode"){if("+-*^".indexOf(ye.op)===-1)throw new Error("Operator "+ye.op+" invalid");if(be!==null){if((ye.fn==="unaryMinus"||ye.fn==="pow")&&be.fn!=="add"&&be.fn!=="subtract"&&be.fn!=="multiply")throw new Error("Invalid "+ye.op+" placing");if((ye.fn==="subtract"||ye.fn==="add"||ye.fn==="multiply")&&be.fn!=="add"&&be.fn!=="subtract")throw new Error("Invalid "+ye.op+" placing");if((ye.fn==="subtract"||ye.fn==="add"||ye.fn==="unaryMinus")&&De.noFil!==0)throw new Error("Invalid "+ye.op+" placing")}(ye.op==="^"||ye.op==="*")&&(De.fire=ye.op);for(var We=0;Wez&&(q[Je]=0),q[Je]+=De.cte*(De.oper==="+"?1:-1),z=Math.max(Je,z);return}De.cte=Je,De.fire===""&&(q[0]+=De.cte*(De.oper==="+"?1:-1))}else throw new Error("Type "+Ae+" is not allowed")}}});var mP="zpk2tf",CV=["typed","add","multiply","Complex","number"],t0=F(mP,CV,e=>{var{typed:r,add:t,multiply:n,Complex:a,number:i}=e;return r(mP,{"Array,Array,number":function(o,u,m){return s(o,u,m)},"Array,Array":function(o,u){return s(o,u,1)},"Matrix,Matrix,number":function(o,u,m){return s(o.valueOf(),u.valueOf(),m)},"Matrix,Matrix":function(o,u){return s(o.valueOf(),u.valueOf(),1)}});function s(c,o,u){c.some(C=>C.type==="BigNumber")&&(c=c.map(C=>i(C))),o.some(C=>C.type==="BigNumber")&&(o=o.map(C=>i(C)));for(var m=[a(1,0)],d=[a(1,0)],h=0;h=0&&m-d{var{typed:r,add:t,multiply:n,Complex:a,divide:i,matrix:s}=e;return r(pP,{"Array, Array":function(u,m){var d=c(512);return l(u,m,d)},"Array, Array, Array":function(u,m,d){return l(u,m,d)},"Array, Array, number":function(u,m,d){if(d<0)throw new Error("w must be a positive number");var h=c(d);return l(u,m,h)},"Matrix, Matrix":function(u,m){var d=c(512),{w:h,h:y}=l(u.valueOf(),m.valueOf(),d);return{w:s(h),h:s(y)}},"Matrix, Matrix, Matrix":function(u,m,d){var{h}=l(u.valueOf(),m.valueOf(),d.valueOf());return{h:s(h),w:s(d)}},"Matrix, Matrix, number":function(u,m,d){if(d<0)throw new Error("w must be a positive number");var h=c(d),{h:y}=l(u.valueOf(),m.valueOf(),h);return{h:s(y),w:s(h)}}});function l(o,u,m){for(var d=[],h=[],y=0;y{var{classes:r}=e;return function(n,a){var i=r[a&&a.mathjs];return i&&typeof i.fromJSON=="function"?i.fromJSON(a):a}});var _V="replacer",OV=[],i0=F(_V,OV,()=>function(r,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:t});var dP="12.4.1";var o0=F("true",[],()=>!0),s0=F("false",[],()=>!1),u0=F("null",[],()=>null),f0=ya("Infinity",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1/0):1/0}),c0=ya("NaN",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(NaN):NaN}),l0=ya("pi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?Pc(t):ZM}),m0=ya("tau",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?vE(t):QM}),p0=ya("e",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?dE(t):XM}),d0=ya("phi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?hE(t):JM}),h0=ya("LN2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).ln():Math.LN2}),v0=ya("LN10",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(10).ln():Math.LN10}),g0=ya("LOG2E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(2).ln()):Math.LOG2E}),y0=ya("LOG10E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(10).ln()):Math.LOG10E}),x0=ya("SQRT1_2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t("0.5").sqrt():Math.SQRT1_2}),b0=ya("SQRT2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).sqrt():Math.SQRT2}),w0=ya("i",["Complex"],e=>{var{Complex:r}=e;return r.I}),hP=F("PI",["pi"],e=>{var{pi:r}=e;return r}),vP=F("E",["e"],e=>{var{e:r}=e;return r}),D0=F("version",[],()=>dP);function ya(e,r,t){return F(e,r,t,{recreateOnConfigChange:!0})}var S0=Er("speedOfLight","299792458","m s^-1"),N0=Er("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),A0=Er("planckConstant","6.62607015e-34","J s"),M0=Er("reducedPlanckConstant","1.0545718176461565e-34","J s"),C0=Er("magneticConstant","1.25663706212e-6","N A^-2"),E0=Er("electricConstant","8.8541878128e-12","F m^-1"),T0=Er("vacuumImpedance","376.730313667","ohm"),F0=Er("coulomb","8.987551792261171e9","N m^2 C^-2"),_0=Er("elementaryCharge","1.602176634e-19","C"),O0=Er("bohrMagneton","9.2740100783e-24","J T^-1"),B0=Er("conductanceQuantum","7.748091729863649e-5","S"),P0=Er("inverseConductanceQuantum","12906.403729652257","ohm"),I0=Er("magneticFluxQuantum","2.0678338484619295e-15","Wb"),R0=Er("nuclearMagneton","5.0507837461e-27","J T^-1"),q0=Er("klitzing","25812.807459304513","ohm");var k0=Er("bohrRadius","5.29177210903e-11","m"),L0=Er("classicalElectronRadius","2.8179403262e-15","m"),z0=Er("electronMass","9.1093837015e-31","kg"),U0=Er("fermiCoupling","1.1663787e-5","GeV^-2"),W0=xy("fineStructure",.0072973525693),Y0=Er("hartreeEnergy","4.3597447222071e-18","J"),H0=Er("protonMass","1.67262192369e-27","kg"),$0=Er("deuteronMass","3.3435830926e-27","kg"),G0=Er("neutronMass","1.6749271613e-27","kg"),V0=Er("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),Z0=Er("rydberg","10973731.568160","m^-1"),Q0=Er("thomsonCrossSection","6.6524587321e-29","m^2"),X0=xy("weakMixingAngle",.2229),J0=xy("efimovFactor",22.7),K0=Er("atomicMass","1.66053906660e-27","kg"),j0=Er("avogadro","6.02214076e23","mol^-1"),ey=Er("boltzmann","1.380649e-23","J K^-1"),ry=Er("faraday","96485.33212331001","C mol^-1"),ty=Er("firstRadiation","3.7417718521927573e-16","W m^2"),ny=Er("loschmidt","2.686780111798444e25","m^-3"),ay=Er("gasConstant","8.31446261815324","J K^-1 mol^-1"),iy=Er("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),oy=Er("molarVolume","0.022413969545014137","m^3 mol^-1"),sy=xy("sackurTetrode",-1.16487052358),uy=Er("secondRadiation","0.014387768775039337","m K"),fy=Er("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),cy=Er("wienDisplacement","2.897771955e-3","m K"),ly=Er("molarMass","0.99999999965e-3","kg mol^-1"),my=Er("molarMassC12","11.9999999958e-3","kg mol^-1"),py=Er("gravity","9.80665","m s^-2"),dy=Er("planckLength","1.616255e-35","m"),hy=Er("planckMass","2.176435e-8","kg"),vy=Er("planckTime","5.391245e-44","s"),gy=Er("planckCharge","1.87554603778e-18","C"),yy=Er("planckTemperature","1.416785e+32","K");function Er(e,r,t){var n=["config","Unit","BigNumber"];return F(e,n,a=>{var{config:i,Unit:s,BigNumber:l}=a,c=i.number==="BigNumber"?new l(r):parseFloat(r),o=new s(c,t);return o.fixPrefix=!0,o})}function xy(e,r){var t=["config","BigNumber"];return F(e,t,n=>{var{config:a,BigNumber:i}=n;return a.number==="BigNumber"?new i(r):r})}var BV="apply",PV=["typed","isInteger"],by=F(BV,PV,e=>{var{typed:r,isInteger:t}=e,n=Lo({typed:r,isInteger:t});return r("apply",{"...any":function(i){var s=i[1];sr(s)?i[1]=s-1:rr(s)&&(i[1]=s.minus(1));try{return n.apply(null,i)}catch(l){throw mt(l)}}})},{isTransformFunction:!0});var IV="column",RV=["typed","Index","matrix","range"],wy=F(IV,RV,e=>{var{typed:r,Index:t,matrix:n,range:a}=e,i=Wu({typed:r,Index:t,matrix:n,range:a});return r("column",{"...any":function(l){var c=l.length-1,o=l[c];sr(o)&&(l[c]=o-1);try{return i.apply(null,l)}catch(u){throw mt(u)}}})},{isTransformFunction:!0});function lf(e,r,t){var n=e.filter(function(c){return at(c)&&!(c.name in r)&&!t.has(c.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var a=n.name,i=new Map,s=new Eu(t,i,new Set([a])),l=e.compile();return function(o){return i.set(a,o),l.evaluate(s)}}var qV="filter",kV=["typed"],Dy=F(qV,kV,e=>{var{typed:r}=e;function t(a,i,s){var l,c;return a[0]&&(l=a[0].compile().evaluate(s)),a[1]&&(at(a[1])||Oa(a[1])?c=a[1].compile().evaluate(s):c=lf(a[1],i,s)),n(l,c)}t.rawArgs=!0;var n=r("filter",{"Array, function":gP,"Matrix, function":function(i,s){return i.create(gP(i.toArray(),s))},"Array, RegExp":Mu,"Matrix, RegExp":function(i,s){return i.create(Mu(i.toArray(),s))}});return t},{isTransformFunction:!0});function gP(e,r){return _m(e,function(t,n,a){return Ra(r,t,[n+1],a,"filter")})}var LV="forEach",zV=["typed"],Sy=F(LV,zV,e=>{var{typed:r}=e;function t(a,i,s){var l,c;return a[0]&&(l=a[0].compile().evaluate(s)),a[1]&&(at(a[1])||Oa(a[1])?c=a[1].compile().evaluate(s):c=lf(a[1],i,s)),n(l,c)}t.rawArgs=!0;var n=r("forEach",{"Array | Matrix, function":function(i,s){var l=function c(o,u){if(Array.isArray(o))_o(o,function(m,d){c(m,u.concat(d+1))});else return Ra(s,o,u,i,"forEach")};l(i.valueOf(),[])}});return t},{isTransformFunction:!0});var UV="index",WV=["Index","getMatrixDataType"],Ny=F(UV,WV,e=>{var{Index:r,getMatrixDataType:t}=e;return function(){for(var a=[],i=0,s=arguments.length;i0?0:2;else if(l&&l.isSet===!0)l=l.map(function(o){return o-1});else if(Mr(l)||Qe(l))t(l)!=="boolean"&&(l=l.map(function(o){return o-1}));else if(sr(l))l--;else if(rr(l))l=l.toNumber()-1;else if(typeof l!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");a[i]=l}var c=new r;return r.apply(c,a),c}},{isTransformFunction:!0});var YV="map",HV=["typed"],Ay=F(YV,HV,e=>{var{typed:r}=e;function t(a,i,s){var l,c;return a[0]&&(l=a[0].compile().evaluate(s)),a[1]&&(at(a[1])||Oa(a[1])?c=a[1].compile().evaluate(s):c=lf(a[1],i,s)),n(l,c)}t.rawArgs=!0;var n=r("map",{"Array, function":function(i,s){return yP(i,s,i)},"Matrix, function":function(i,s){return i.create(yP(i.valueOf(),s,i))}});return t},{isTransformFunction:!0});function yP(e,r,t){function n(a,i){return Array.isArray(a)?Kn(a,function(s,l){return n(s,i.concat(l+1))}):Ra(r,a,i,t,"map")}return n(e,[])}function Cn(e){if(e.length===2&&Nt(e[0])){e=e.slice();var r=e[1];sr(r)?e[1]=r-1:rr(r)&&(e[1]=r.minus(1))}return e}var $V="max",GV=["typed","config","numeric","larger"],My=F($V,GV,e=>{var{typed:r,config:t,numeric:n,larger:a}=e,i=ef({typed:r,config:t,numeric:n,larger:a});return r("max",{"...any":function(l){l=Cn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var VV="mean",ZV=["typed","add","divide"],Cy=F(VV,ZV,e=>{var{typed:r,add:t,divide:n}=e,a=of({typed:r,add:t,divide:n});return r("mean",{"...any":function(s){s=Cn(s);try{return a.apply(null,s)}catch(l){throw mt(l)}}})},{isTransformFunction:!0});var QV="min",XV=["typed","config","numeric","smaller"],Ey=F(QV,XV,e=>{var{typed:r,config:t,numeric:n,smaller:a}=e,i=rf({typed:r,config:t,numeric:n,smaller:a});return r("min",{"...any":function(l){l=Cn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var JV="range",KV=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Ty=F(JV,KV,e=>{var{typed:r,config:t,matrix:n,bignumber:a,smaller:i,smallerEq:s,larger:l,largerEq:c,add:o,isPositive:u}=e,m=$u({typed:r,config:t,matrix:n,bignumber:a,smaller:i,smallerEq:s,larger:l,largerEq:c,add:o,isPositive:u});return r("range",{"...any":function(h){var y=h.length-1,v=h[y];return typeof v!="boolean"&&h.push(!0),m.apply(null,h)}})},{isTransformFunction:!0});var jV="row",eZ=["typed","Index","matrix","range"],Fy=F(jV,eZ,e=>{var{typed:r,Index:t,matrix:n,range:a}=e,i=Gu({typed:r,Index:t,matrix:n,range:a});return r("row",{"...any":function(l){var c=l.length-1,o=l[c];sr(o)&&(l[c]=o-1);try{return i.apply(null,l)}catch(u){throw mt(u)}}})},{isTransformFunction:!0});var rZ="subset",tZ=["typed","matrix","zeros","add"],_y=F(rZ,tZ,e=>{var{typed:r,matrix:t,zeros:n,add:a}=e,i=Vu({typed:r,matrix:t,zeros:n,add:a});return r("subset",{"...any":function(l){try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var nZ="concat",aZ=["typed","matrix","isInteger"],Oy=F(nZ,aZ,e=>{var{typed:r,matrix:t,isInteger:n}=e,a=Uu({typed:r,matrix:t,isInteger:n});return r("concat",{"...any":function(s){var l=s.length-1,c=s[l];sr(c)?s[l]=c-1:rr(c)&&(s[l]=c.minus(1));try{return a.apply(null,s)}catch(o){throw mt(o)}}})},{isTransformFunction:!0});var xP="diff",iZ=["typed","matrix","subtract","number","bignumber"],By=F(xP,iZ,e=>{var{typed:r,matrix:t,subtract:n,number:a,bignumber:i}=e,s=Yu({typed:r,matrix:t,subtract:n,number:a,bignumber:i});return r(xP,{"...any":function(c){c=Cn(c);try{return s.apply(null,c)}catch(o){throw mt(o)}}})},{isTransformFunction:!0});var oZ="std",sZ=["typed","map","sqrt","variance"],Py=F(oZ,sZ,e=>{var{typed:r,map:t,sqrt:n,variance:a}=e,i=ff({typed:r,map:t,sqrt:n,variance:a});return r("std",{"...any":function(l){l=Cn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var bP="sum",uZ=["typed","config","add","numeric"],Iy=F(bP,uZ,e=>{var{typed:r,config:t,add:n,numeric:a}=e,i=nf({typed:r,config:t,add:n,numeric:a});return r(bP,{"...any":function(l){l=Cn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var fZ="quantileSeq",cZ=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Ry=F(fZ,cZ,e=>{var{typed:r,bignumber:t,add:n,subtract:a,divide:i,multiply:s,partitionSelect:l,compare:c,isInteger:o,smaller:u,smallerEq:m,larger:d}=e,h=uf({typed:r,bignumber:t,add:n,subtract:a,divide:i,multiply:s,partitionSelect:l,compare:c,isInteger:o,smaller:u,smallerEq:m,larger:d});return r("quantileSeq",{"Array | Matrix, number | BigNumber":h,"Array | Matrix, number | BigNumber, number":(v,x,w)=>h(v,x,y(w)),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(v,x,w,C)=>h(v,x,w,y(C)),"Array | Matrix, Array | Matrix":h,"Array | Matrix, Array | Matrix, number":(v,x,w)=>h(v,x,y(w)),"Array | Matrix, Array | Matrix, boolean":h,"Array | Matrix, Array | Matrix, boolean, number":(v,x,w,C)=>h(v,x,w,y(C))});function y(v){return Cn([[],v])[1]}},{isTransformFunction:!0});var wP="cumsum",lZ=["typed","add","unaryPlus"],qy=F(wP,lZ,e=>{var{typed:r,add:t,unaryPlus:n}=e,a=af({typed:r,add:t,unaryPlus:n});return r(wP,{"...any":function(s){if(s.length===2&&Nt(s[0])){var l=s[1];sr(l)?s[1]=l-1:rr(l)&&(s[1]=l.minus(1))}try{return a.apply(null,s)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var DP="variance",mZ=["typed","add","subtract","multiply","divide","apply","isNaN"],ky=F(DP,mZ,e=>{var{typed:r,add:t,subtract:n,multiply:a,divide:i,apply:s,isNaN:l}=e,c=sf({typed:r,add:t,subtract:n,multiply:a,divide:i,apply:s,isNaN:l});return r(DP,{"...any":function(u){u=Cn(u);try{return c.apply(null,u)}catch(m){throw mt(m)}}})},{isTransformFunction:!0});var SP="print",pZ=["typed","matrix","zeros","add"],Ly=F(SP,pZ,e=>{var{typed:r,matrix:t,zeros:n,add:a}=e,i=Qu({typed:r,matrix:t,zeros:n,add:a});return r(SP,{"string, Object | Array":function(c,o){return i(s(c),o)},"string, Object | Array, number | Object":function(c,o,u){return i(s(c),o,u)}});function s(l){return l.replace(qd,c=>{var o=c.slice(1).split("."),u=o.map(function(m){return!isNaN(m)&&m.length>0?parseInt(m)-1:m});return"$"+u.join(".")})}},{isTransformFunction:!0});var dZ="and",hZ=["typed","matrix","zeros","add","equalScalar","not","concat"],zy=F(dZ,hZ,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s}=e,l=ju({typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s});function c(o,u,m){var d=o[0].compile().evaluate(m);if(!Nt(d)&&!l(d,!0))return!1;var h=o[1].compile().evaluate(m);return l(d,h)}return c.rawArgs=!0,c},{isTransformFunction:!0});var vZ="or",gZ=["typed","matrix","equalScalar","DenseMatrix","concat"],Uy=F(vZ,gZ,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=e,s=zu({typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i});function l(c,o,u){var m=c[0].compile().evaluate(u);if(!Nt(m)&&s(m,!1))return!0;var d=c[1].compile().evaluate(u);return s(m,d)}return l.rawArgs=!0,l},{isTransformFunction:!0});var yZ="bitAnd",xZ=["typed","matrix","zeros","add","equalScalar","not","concat"],Wy=F(yZ,xZ,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s}=e,l=ku({typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:s});function c(o,u,m){var d=o[0].compile().evaluate(m);if(!Nt(d)){if(isNaN(d))return NaN;if(d===0||d===!1)return 0}var h=o[1].compile().evaluate(m);return l(d,h)}return c.rawArgs=!0,c},{isTransformFunction:!0});var bZ="bitOr",wZ=["typed","matrix","equalScalar","DenseMatrix","concat"],Yy=F(bZ,wZ,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=e,s=Lu({typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i});function l(c,o,u){var m=c[0].compile().evaluate(u);if(!Nt(m)){if(isNaN(m))return NaN;if(m===-1)return-1;if(m===!0)return 1}var d=c[1].compile().evaluate(u);return s(m,d)}return l.rawArgs=!0,l},{isTransformFunction:!0});var Ge=Ym({config:Oe}),pt=Hm({}),ID=p0({BigNumber:Ge,config:Oe}),NP=s0({}),AP=W0({BigNumber:Ge,config:Oe}),Wo=$m({}),RD=w0({Complex:pt}),MP=f0({BigNumber:Ge,config:Oe}),CP=v0({BigNumber:Ge,config:Oe}),EP=y0({BigNumber:Ge,config:Oe}),kc=Vm({}),TP=c0({BigNumber:Ge,config:Oe}),FP=u0({}),_P=d0({BigNumber:Ge,config:Oe}),OP=Gm({}),qD=Im({}),BP=x0({BigNumber:Ge,config:Oe}),PP=sy({BigNumber:Ge,config:Oe}),kD=m0({BigNumber:Ge,config:Oe}),IP=o0({}),RP=D0({}),Fr=Qm({Matrix:kc}),qP=J0({BigNumber:Ge,config:Oe}),kP=h0({BigNumber:Ge,config:Oe}),Hy=l0({BigNumber:Ge,config:Oe}),LP=i0({}),zP=b0({BigNumber:Ge,config:Oe}),te=Pm({BigNumber:Ge,Complex:pt,DenseMatrix:Fr,Fraction:Wo}),$y=Sp({BigNumber:Ge,config:Oe,typed:te}),UP=X0({BigNumber:Ge,config:Oe}),En=Np({typed:te}),WP=_h({Complex:pt,config:Oe,typed:te}),YP=Bh({BigNumber:Ge,typed:te}),HP=Ih({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),Qt=Mp({typed:te}),$P=Kp({typed:te}),GP=kh({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),VP=zh({typed:te}),LD=Uh({typed:te}),ZP=Yh({Complex:pt,config:Oe,typed:te}),ta=dp({BigNumber:Ge,typed:te}),QP=Xp({typed:te}),XP=pp({typed:te}),JP=Xm({typed:te}),Lc=Og({typed:te}),zc=hp({Complex:pt,typed:te}),Yo=jp({typed:te}),Gy=Hh({typed:te}),KP=Gh({BigNumber:Ge,typed:te}),jP=Zh({BigNumber:Ge,typed:te}),eI=Fp({typed:te}),Ir=fp({config:Oe,typed:te}),rI=Td({typed:te}),zD=_p({typed:te}),tI=Op({Complex:pt,typed:te}),nI=sd({typed:te}),aI=fd({typed:te}),mf=Bd({typed:te}),Vy=cd({typed:te}),iI=Rd({format:mf,typed:te}),Zy=ed({typed:te}),zn=jm({typed:te}),ao=rp({typed:te}),Ho=ap({typed:te}),La=ip({typed:te}),oI=g0({BigNumber:Ge,config:Oe}),sI=Ig({Complex:pt,typed:te}),uI=Rp({Complex:pt,config:Oe,typed:te}),UD=qp({Complex:pt,config:Oe,typed:te}),$o=pd({typed:te}),Ot=kp({typed:te}),Uc=td({typed:te}),Bi=lp({typed:te}),fI=Id({format:mf,typed:te}),cI=Ug({config:Oe,typed:te}),lI=Qu({typed:te}),mI=Wg({config:Oe,typed:te}),Qy=rd({typed:te}),pI=Xh({BigNumber:Ge,typed:te}),WD=Up({BigNumber:Ge,Fraction:Wo,complex:zc,typed:te}),Wc=Kh({typed:te}),Pi=cp({Matrix:kc,equalScalar:Ir,typed:te}),dI=wp({typed:te}),hI=Yp({typed:te}),vI=mp({typed:te}),xa=Cp({typed:te}),gI=ev({typed:te}),YD=sp({typed:te}),yI=Oh({Complex:pt,config:Oe,typed:te}),xI=Rh({BigNumber:Ge,typed:te}),Xy=Lo({isInteger:zn,typed:te}),bI=qh({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),wI=Pd({format:mf,typed:te}),DI=Bg({typed:te}),SI=$h({typed:te}),NI=Qh({BigNumber:Ge,typed:te}),pf=op({typed:te}),AI=Ld({typed:te}),MI=Yg({config:Oe,typed:te}),CI=Jh({BigNumber:Ge,typed:te}),EI=jh({typed:te}),TI=Th({SparseMatrix:Pi,typed:te}),za=Wp({Complex:pt,config:Oe,typed:te}),FI=rv({typed:te}),fi=Dp({typed:te}),_I=Ph({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),OI=Vh({BigNumber:Ge,typed:te}),Ps=vp({Fraction:Wo,typed:te}),Go=tp({typed:te}),$e=gp({DenseMatrix:Fr,Matrix:kc,SparseMatrix:Pi,typed:te}),BI=yp({isZero:La,matrix:$e,typed:te}),PI=_d({isNaN:pf,isNumeric:Go,typed:te}),Ua=zd({bignumber:ta,fraction:Ps,number:Bi}),HD=Od({config:Oe,multiplyScalar:Ot,numeric:Ua,typed:te}),$D=gd({isInteger:zn,matrix:$e,typed:te}),cn=wd({matrix:$e,config:Oe,typed:te}),II=Dd({matrix:$e,typed:te}),df=Sd({matrix:$e,typed:te}),GD=$p({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),ln=Ad({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),RI=Lh({Complex:pt,config:Oe,typed:te}),VD=Ep({BigNumber:Ge,Complex:pt,Fraction:Wo,config:Oe,isNegative:ao,matrix:$e,typed:te,unaryMinus:fi}),Gr=Uu({isInteger:zn,matrix:$e,typed:te}),qI=ad({prod:HD,size:cn,typed:te}),Jy=Nd({conj:Yo,transpose:df,typed:te}),ZD=od({DenseMatrix:Fr,SparseMatrix:Pi,matrix:$e,typed:te}),Mt=Ud({numeric:Ua,typed:te}),hf=Zd({DenseMatrix:Fr,concat:Gr,divideScalar:Mt,equalScalar:Ir,matrix:$e,typed:te}),ba=sh({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),vf=ud({matrix:$e,typed:te}),kI=np({isNumeric:Go,typed:te}),io=ld({BigNumber:Ge,DenseMatrix:Fr,SparseMatrix:Pi,config:Oe,matrix:$e,typed:te}),LI=md({matrix:$e,multiplyScalar:Ot,typed:te}),Yc=vh({DenseMatrix:Fr,concat:Gr,config:Oe,matrix:$e,typed:te}),zI=jd({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),QD=Qd({DenseMatrix:Fr,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te}),Ky=bp({flatten:vf,matrix:$e,size:cn,typed:te}),UI=zp({BigNumber:Ge,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),WI=dd({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),jy=og({addScalar:Qt,complex:zc,conj:Yo,divideScalar:Mt,equal:ba,identity:io,isZero:La,matrix:$e,multiplyScalar:Ot,sign:WD,sqrt:za,subtractScalar:xa,typed:te,unaryMinus:fi,zeros:ln}),YI=yd({config:Oe,matrix:$e}),HI=eh({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),Is=Yd({BigNumber:Ge,DenseMatrix:Fr,config:Oe,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),Tn=ch({DenseMatrix:Fr,concat:Gr,config:Oe,matrix:$e,typed:te}),Bt=Hp({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,subtractScalar:xa,typed:te,unaryMinus:fi}),$I=kd({concat:Gr,matrix:$e,typed:te}),GI=xh({DenseMatrix:Fr,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,typed:te}),ex=Xd({DenseMatrix:Fr,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te}),VI=nd({DenseMatrix:Fr,concat:Gr,matrix:$e,typed:te}),Lr=mv({DenseMatrix:Fr,SparseMatrix:Pi,addScalar:Qt,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),ZI=Wh({BigNumber:Ge,DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),QI=ku({concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),XI=Lu({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),JI=Jp({DenseMatrix:Fr,concat:Gr,matrix:$e,typed:te}),KI=Gg({addScalar:Qt,combinations:Lc,divideScalar:Mt,isInteger:zn,isNegative:ao,multiplyScalar:Ot,typed:te}),Vo=nh({BigNumber:Ge,DenseMatrix:Fr,Fraction:Wo,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,typed:te}),XD=ih({concat:Gr,matrix:$e,typed:te}),jI=af({add:Lr,typed:te,unaryPlus:$y}),rx=gh({equal:ba,typed:te}),e4=Yu({matrix:$e,number:Bi,subtract:Bt,typed:te}),r4=Mg({abs:En,addScalar:Qt,deepEqual:rx,divideScalar:Mt,multiplyScalar:Ot,sqrt:za,subtractScalar:xa,typed:te}),Hc=hv({addScalar:Qt,conj:Yo,multiplyScalar:Ot,size:cn,typed:te}),t4=uh({compareText:XD,isZero:La,typed:te}),JD=Pu({DenseMatrix:Fr,config:Oe,equalScalar:Ir,matrix:$e,round:Is,typed:te,zeros:ln}),n4=Pp({BigNumber:Ge,DenseMatrix:Fr,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,round:Is,typed:te,zeros:ln}),a4=pv({abs:En,addScalar:Qt,divideScalar:Mt,isPositive:Ho,multiplyScalar:Ot,smaller:Tn,sqrt:za,typed:te}),KD=Dh({DenseMatrix:Fr,smaller:Tn}),bn=Sh({ImmutableDenseMatrix:KD,getMatrixDataType:Vy}),Fn=dh({DenseMatrix:Fr,concat:Gr,config:Oe,matrix:$e,typed:te}),tx=Hd({Complex:pt,config:Oe,divideScalar:Mt,typed:te}),i4=Jd({DenseMatrix:Fr,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te}),o4=xp({flatten:vf,matrix:$e,size:cn,typed:te}),s4=rf({config:Oe,numeric:Ua,smaller:Tn,typed:te}),jD=Iu({DenseMatrix:Fr,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,round:Is,typed:te,zeros:ln}),it=Lp({addScalar:Qt,dot:Hc,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,typed:te}),u4=Gd({Complex:pt,config:Oe,divideScalar:Mt,typed:te}),f4=zu({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),$c=bh({compare:Vo,isNaN:pf,isNumeric:Go,typed:te}),c4=rh({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),eS=fg({SparseMatrix:Pi,abs:En,add:Lr,divideScalar:Mt,larger:Fn,largerEq:Yc,multiply:it,subtract:Bt,transpose:df,typed:te}),na=Vu({add:Lr,matrix:$e,typed:te,zeros:ln}),nx=nf({add:Lr,config:Oe,numeric:Ua,typed:te}),l4=vv({add:Lr,matrix:$e,typed:te}),rS=Kd({DenseMatrix:Fr,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te}),m4=t0({Complex:pt,add:Lr,multiply:it,number:Bi,typed:te}),ax=Tp({DenseMatrix:Fr,config:Oe,equalScalar:Ir,matrix:$e,round:Is,typed:te,zeros:ln}),ci=ah({compare:Vo,typed:te}),p4=Vg({addScalar:Qt,combinations:Lc,isInteger:zn,isNegative:ao,isPositive:Ho,larger:Fn,typed:te}),d4=id({matrix:$e,multiply:it,subtract:Bt,typed:te}),tS=vg({divideScalar:Mt,isZero:La,matrix:$e,multiply:it,subtractScalar:xa,typed:te,unaryMinus:fi}),h4=Zp({concat:Gr,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,typed:te}),nS=Nh({larger:Fn,smaller:Tn}),aS=Bp({Complex:pt,DenseMatrix:Fr,ceil:ax,equalScalar:Ir,floor:JD,matrix:$e,typed:te,zeros:ln}),iS=gv({Index:bn,typed:te}),v4=Cg({abs:En,add:Lr,addScalar:Qt,config:Oe,divideScalar:Mt,equalScalar:Ir,flatten:vf,isNumeric:Go,isZero:La,matrix:$e,multiply:it,multiplyScalar:Ot,smaller:Tn,subtract:Bt,typed:te}),g4=Gp({BigNumber:Ge,add:Lr,config:Oe,equal:ba,isInteger:zn,mod:jD,smaller:Tn,typed:te,xgcd:GD}),y4=Ip({concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),x4=$d({Complex:pt,config:Oe,divideScalar:Mt,log:tx,typed:te}),ix=ef({config:Oe,larger:Fn,numeric:Ua,typed:te}),b4=tv({DenseMatrix:Fr,Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),w4=av({DenseMatrix:Fr,Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),D4=ov({Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),S4=uv({Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),Rs=mh({DenseMatrix:Fr,concat:Gr,config:Oe,matrix:$e,typed:te}),N4=wh({compare:Vo,compareNatural:ci,matrix:$e,typed:te}),A4=ju({concat:Gr,equalScalar:Ir,matrix:$e,not:Uc,typed:te,zeros:ln}),qs=$u({bignumber:ta,matrix:$e,add:Lr,config:Oe,isPositive:Ho,larger:Fn,largerEq:Yc,smaller:Tn,smallerEq:Rs,typed:te}),M4=Gu({Index:bn,matrix:$e,range:qs,typed:te}),oS=nv({DenseMatrix:Fr,Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),C4=sv({Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),sS=cv({Index:bn,concat:Gr,setDifference:oS,size:cn,subset:na,typed:te}),uS=Ah({FibonacciHeap:nS,addScalar:Qt,equalScalar:Ir}),fS=Wu({Index:bn,matrix:$e,range:qs,typed:te}),Zo=gg({abs:En,addScalar:Qt,det:tS,divideScalar:Mt,identity:io,matrix:$e,multiply:it,typed:te,unaryMinus:fi}),cS=ig({DenseMatrix:Fr,Spa:uS,SparseMatrix:Pi,abs:En,addScalar:Qt,divideScalar:Mt,equalScalar:Ir,larger:Fn,matrix:$e,multiplyScalar:Ot,subtractScalar:xa,typed:te,unaryMinus:fi}),E4=yg({Complex:pt,add:Lr,ctranspose:Jy,deepEqual:rx,divideScalar:Mt,dot:Hc,dotDivide:hf,equal:ba,inv:Zo,matrix:$e,multiply:it,typed:te}),wa=Wd({Complex:pt,config:Oe,fraction:Ps,identity:io,inv:Zo,matrix:$e,multiply:it,number:Bi,typed:te}),lS=iv({DenseMatrix:Fr,Index:bn,compareNatural:ci,size:cn,subset:na,typed:te}),T4=lv({Index:bn,concat:Gr,setIntersect:lS,setSymDifference:sS,size:cn,subset:na,typed:te}),F4=wg({abs:En,add:Lr,identity:io,inv:Zo,map:$o,max:ix,multiply:it,size:cn,sqrt:za,subtract:Bt,typed:te}),wr=Ch({BigNumber:Ge,Complex:pt,Fraction:Wo,abs:En,addScalar:Qt,config:Oe,divideScalar:Mt,equal:ba,fix:aS,format:mf,isNumeric:Go,multiplyScalar:Ot,number:Bi,pow:wa,round:Is,subtractScalar:xa}),_4=T0({BigNumber:Ge,Unit:wr,config:Oe}),O4=cy({BigNumber:Ge,Unit:wr,config:Oe}),B4=K0({BigNumber:Ge,Unit:wr,config:Oe}),P4=O0({BigNumber:Ge,Unit:wr,config:Oe}),I4=ey({BigNumber:Ge,Unit:wr,config:Oe}),R4=B0({BigNumber:Ge,Unit:wr,config:Oe}),q4=F0({BigNumber:Ge,Unit:wr,config:Oe}),k4=$0({BigNumber:Ge,Unit:wr,config:Oe}),L4=Vd({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,pow:wa,typed:te}),z4=E0({BigNumber:Ge,Unit:wr,config:Oe}),U4=_0({BigNumber:Ge,Unit:wr,config:Oe}),W4=bg({abs:En,add:Lr,identity:io,inv:Zo,multiply:it,typed:te}),Y4=ry({BigNumber:Ge,Unit:wr,config:Oe}),mS=Md({addScalar:Qt,ceil:ax,conj:Yo,divideScalar:Mt,dotDivide:hf,exp:zD,i:RD,log2:UD,matrix:$e,multiplyScalar:Ot,pow:wa,tau:kD,typed:te}),ox=Pg({BigNumber:Ge,Complex:pt,config:Oe,multiplyScalar:Ot,pow:wa,typed:te}),H4=N0({BigNumber:Ge,Unit:wr,config:Oe}),$4=Y0({BigNumber:Ge,Unit:wr,config:Oe}),G4=Cd({conj:Yo,dotDivide:hf,fft:mS,typed:te}),V4=q0({BigNumber:Ge,Unit:wr,config:Oe}),Z4=ny({BigNumber:Ge,Unit:wr,config:Oe}),Q4=C0({BigNumber:Ge,Unit:wr,config:Oe}),X4=ly({BigNumber:Ge,Unit:wr,config:Oe}),J4=iy({BigNumber:Ge,Unit:wr,config:Oe}),K4=G0({BigNumber:Ge,Unit:wr,config:Oe}),j4=R0({BigNumber:Ge,Unit:wr,config:Oe}),eR=gy({BigNumber:Ge,Unit:wr,config:Oe}),rR=dy({BigNumber:Ge,Unit:wr,config:Oe}),tR=yy({BigNumber:Ge,Unit:wr,config:Oe}),nR=H0({BigNumber:Ge,Unit:wr,config:Oe}),aR=V0({BigNumber:Ge,Unit:wr,config:Oe}),iR=M0({BigNumber:Ge,Unit:wr,config:Oe}),oR=Z0({BigNumber:Ge,Unit:wr,config:Oe}),sR=uy({BigNumber:Ge,Unit:wr,config:Oe}),uR=S0({BigNumber:Ge,Unit:wr,config:Oe}),fR=fy({BigNumber:Ge,Unit:wr,config:Oe}),cR=Q0({BigNumber:Ge,Unit:wr,config:Oe}),lR=j0({BigNumber:Ge,Unit:wr,config:Oe}),mR=k0({BigNumber:Ge,Unit:wr,config:Oe}),pR=Fh({Unit:wr,typed:te}),an=Ag({divideScalar:Mt,equalScalar:Ir,inv:Zo,matrix:$e,multiply:it,typed:te}),dR=z0({BigNumber:Ge,Unit:wr,config:Oe}),gf=Rg({gamma:ox,typed:te}),hR=ty({BigNumber:Ge,Unit:wr,config:Oe}),vR=py({BigNumber:Ge,Unit:wr,config:Oe}),gR=P0({BigNumber:Ge,Unit:wr,config:Oe}),pS=cg({DenseMatrix:Fr,lsolve:QD,lup:cS,matrix:$e,slu:eS,typed:te,usolve:ex}),yR=I0({BigNumber:Ge,Unit:wr,config:Oe}),xR=my({BigNumber:Ge,Unit:wr,config:Oe}),bR=kg({add:Lr,divide:an,factorial:gf,isInteger:zn,isPositive:Ho,multiply:it,typed:te}),wR=Lg({factorial:gf,typed:te}),DR=hy({BigNumber:Ge,Unit:wr,config:Oe}),SR=lg({add:Lr,cbrt:VD,divide:an,equalScalar:Ir,im:Zy,isZero:La,multiply:it,re:Qy,sqrt:za,subtract:Bt,typeOf:YD,typed:te,unaryMinus:fi}),NR=fv({compareNatural:ci,typed:te}),AR=Ed({abs:En,add:Lr,bignumber:ta,divide:an,isNegative:ao,isPositive:Ho,larger:Fn,map:$o,matrix:$e,max:ix,multiply:it,smaller:Tn,subtract:Bt,typed:te,unaryMinus:fi}),dS=Hg({bignumber:ta,addScalar:Qt,combinations:Lc,divideScalar:Mt,factorial:gf,isInteger:zn,isNegative:ao,larger:Fn,multiplyScalar:Ot,number:Bi,pow:wa,subtractScalar:xa,typed:te}),MR=Eh({Unit:wr,typed:te}),CR=$g({addScalar:Qt,isInteger:zn,isNegative:ao,stirlingS2:dS,typed:te}),hS=xg({abs:En,add:Lr,addScalar:Qt,atan:LD,bignumber:ta,column:fS,complex:zc,config:Oe,cos:Gy,diag:ZD,divideScalar:Mt,dot:Hc,equal:ba,flatten:vf,im:Zy,inv:Zo,larger:Fn,matrix:$e,matrixFromColumns:Ky,multiply:it,multiplyScalar:Ot,number:Bi,qr:jy,re:Qy,reshape:$D,sin:Wc,size:cn,smaller:Tn,sqrt:za,subtract:Bt,typed:te,usolve:ex,usolveAll:rS}),ER=U0({BigNumber:Ge,Unit:wr,config:Oe}),TR=ay({BigNumber:Ge,Unit:wr,config:Oe}),FR=qg({divide:an,dotDivide:hf,isNumeric:Go,log:tx,map:$o,matrix:$e,multiply:it,sum:nx,typed:te}),vS=of({add:Lr,divide:an,typed:te}),_R=oy({BigNumber:Ge,Unit:wr,config:Oe}),OR=A0({BigNumber:Ge,Unit:wr,config:Oe}),BR=uf({bignumber:ta,add:Lr,compare:Vo,divide:an,isInteger:zn,larger:Fn,multiply:it,partitionSelect:$c,smaller:Tn,smallerEq:Rs,subtract:Bt,typed:te}),sx=sf({add:Lr,apply:Xy,divide:an,isNaN:pf,multiply:it,subtract:Bt,typed:te}),PR=L0({BigNumber:Ge,Unit:wr,config:Oe}),gS=Tg({add:Lr,compare:Vo,divide:an,partitionSelect:$c,typed:te}),IR=_g({add:Lr,divide:an,matrix:$e,mean:vS,multiply:it,pow:wa,sqrt:za,subtract:Bt,sum:nx,typed:te}),RR=n0({Complex:pt,add:Lr,divide:an,matrix:$e,multiply:it,typed:te}),qR=Fg({abs:En,map:$o,median:gS,subtract:Bt,typed:te}),kR=ff({map:$o,sqrt:za,typed:te,variance:sx}),LR=Fd({BigNumber:Ge,Complex:pt,add:Lr,config:Oe,divide:an,equal:ba,factorial:gf,gamma:ox,isNegative:ao,multiply:it,pi:Hy,pow:wa,sin:Wc,smallerEq:Rs,subtract:Bt,typed:te}),ux=dv({abs:En,add:Lr,conj:Yo,ctranspose:Jy,eigs:hS,equalScalar:Ir,larger:Fn,matrix:$e,multiply:it,pow:wa,smaller:Tn,sqrt:za,typed:te}),yS=bd({BigNumber:Ge,DenseMatrix:Fr,SparseMatrix:Pi,addScalar:Qt,config:Oe,cos:Gy,matrix:$e,multiplyScalar:Ot,norm:ux,sin:Wc,typed:te,unaryMinus:fi}),zR=vy({BigNumber:Ge,Unit:wr,config:Oe}),xS=Sg({identity:io,matrix:$e,multiply:it,norm:ux,qr:jy,subtract:Bt,typed:te}),UR=xd({multiply:it,rotationMatrix:yS,typed:te}),bS=Dg({abs:En,add:Lr,concat:Gr,identity:io,index:iS,lusolve:pS,matrix:$e,matrixFromColumns:Ky,multiply:it,range:qs,schur:xS,subset:na,subtract:Bt,transpose:df,typed:te}),WR=Ng({matrix:$e,multiply:it,sylvester:bS,transpose:df,typed:te});var yf={},xf={},YR={},_n=xv({mathWithTransform:xf}),bf=Wv({Node:_n}),oo=Hv({Node:_n}),ks=Gv({Node:_n}),HR=Xv({Node:_n}),wf=Nv({Node:_n}),$R=Fv({Node:_n,ResultSet:qD}),GR=Ov({Node:_n}),Qo=Rv({Node:_n}),VR=Zv({Node:_n}),DZ=a0({classes:YR}),wS=pg({math:yf,typed:te}),ZR=kv({Node:_n,typed:te}),SZ=hg({Chain:wS,typed:te}),Df=zv({Node:_n,size:cn}),Sf=Dv({Node:_n,subset:na}),QR=Ev({matrix:$e,Node:_n,subset:na}),Xo=Jv({Unit:wr,Node:_n,math:yf}),Jo=jv({Node:_n,SymbolNode:Xo,math:yf}),Wa=eg({AccessorNode:Sf,ArrayNode:wf,AssignmentNode:QR,BlockNode:$R,ConditionalNode:GR,ConstantNode:Qo,FunctionAssignmentNode:ZR,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,RangeNode:VR,RelationalNode:HR,SymbolNode:Xo,config:Oe,numeric:Ua,typed:te}),XR=Kg({ConstantNode:Qo,FunctionNode:Jo,OperatorNode:oo,ParenthesisNode:ks,parse:Wa,typed:te}),DS=Xg({bignumber:ta,fraction:Ps,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Qo,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,SymbolNode:Xo,config:Oe,mathWithTransform:xf,matrix:$e,typed:te}),NZ=rg({parse:Wa,typed:te}),SS=Jg({AccessorNode:Sf,ArrayNode:wf,ConstantNode:Qo,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,SymbolNode:Xo,add:Lr,divide:an,equal:ba,isZero:La,multiply:it,parse:Wa,pow:wa,subtract:Bt,typed:te}),NS=tg({parse:Wa,typed:te}),JR=mg({evaluate:NS}),KR=ng({evaluate:NS}),fx=Qg({bignumber:ta,fraction:Ps,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Qo,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,SymbolNode:Xo,add:Lr,config:Oe,divide:an,equal:ba,isZero:La,mathWithTransform:xf,matrix:$e,multiply:it,parse:Wa,pow:wa,resolve:XR,simplifyConstant:DS,simplifyCore:SS,subtract:Bt,typed:te}),AZ=jg({OperatorNode:oo,parse:Wa,simplify:fx,typed:te}),MZ=Zg({parse:Wa,typed:te}),CZ=ag({Parser:KR,typed:te}),EZ=r0({bignumber:ta,fraction:Ps,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Qo,FunctionNode:Jo,IndexNode:Df,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,SymbolNode:Xo,add:Lr,config:Oe,divide:an,equal:ba,isZero:La,mathWithTransform:xf,matrix:$e,multiply:it,parse:Wa,pow:wa,simplify:fx,simplifyConstant:DS,simplifyCore:SS,subtract:Bt,typed:te}),TZ=e0({ConstantNode:Qo,FunctionNode:Jo,OperatorNode:oo,ParenthesisNode:ks,SymbolNode:Xo,config:Oe,equal:ba,isZero:La,numeric:Ua,parse:Wa,simplify:fx,typed:te}),FZ=dg({Help:JR,mathWithTransform:xf,typed:te});ht(yf,{e:ID,false:NP,fineStructure:AP,i:RD,Infinity:MP,LN10:CP,LOG10E:EP,NaN:TP,null:FP,phi:_P,SQRT1_2:BP,sackurTetrode:PP,tau:kD,true:IP,E:ID,version:RP,efimovFactor:qP,LN2:kP,pi:Hy,replacer:LP,reviver:DZ,SQRT2:zP,typed:te,unaryPlus:$y,PI:Hy,weakMixingAngle:UP,abs:En,acos:WP,acot:YP,acsc:HP,addScalar:Qt,arg:$P,asech:GP,asinh:VP,atan:LD,atanh:ZP,bignumber:ta,bitNot:QP,boolean:XP,clone:JP,combinations:Lc,complex:zc,conj:Yo,cos:Gy,cot:KP,csc:jP,cube:eI,equalScalar:Ir,erf:rI,exp:zD,expm1:tI,filter:nI,forEach:aI,format:mf,getMatrixDataType:Vy,hex:iI,im:Zy,isInteger:zn,isNegative:ao,isPositive:Ho,isZero:La,LOG2E:oI,lgamma:sI,log10:uI,log2:UD,map:$o,multiplyScalar:Ot,not:Uc,number:Bi,oct:fI,pickRandom:cI,print:lI,random:mI,re:Qy,sec:pI,sign:WD,sin:Wc,splitUnit:dI,square:hI,string:vI,subtractScalar:xa,tan:gI,typeOf:YD,acosh:yI,acsch:xI,apply:Xy,asec:bI,bin:wI,chain:SZ,combinationsWithRep:DI,cosh:SI,csch:NI,isNaN:pf,isPrime:AI,randomInt:MI,sech:CI,sinh:EI,sparse:TI,sqrt:za,tanh:FI,unaryMinus:fi,acoth:_I,coth:OI,fraction:Ps,isNumeric:Go,matrix:$e,matrixFromFunction:BI,mode:PI,numeric:Ua,prod:HD,reshape:$D,size:cn,squeeze:II,transpose:df,xgcd:GD,zeros:ln,asin:RI,cbrt:VD,concat:Gr,count:qI,ctranspose:Jy,diag:ZD,divideScalar:Mt,dotDivide:hf,equal:ba,flatten:vf,hasNumericValue:kI,identity:io,kron:LI,largerEq:Yc,leftShift:zI,lsolve:QD,matrixFromColumns:Ky,nthRoot:UI,ones:WI,qr:jy,resize:YI,rightArithShift:HI,round:Is,smaller:Tn,subtract:Bt,to:$I,unequal:GI,usolve:ex,xor:VI,add:Lr,atan2:ZI,bitAnd:QI,bitOr:XI,bitXor:JI,catalan:KI,compare:Vo,compareText:XD,cumsum:jI,deepEqual:rx,diff:e4,distance:r4,dot:Hc,equalText:t4,floor:JD,gcd:n4,hypot:a4,larger:Fn,log:tx,lsolveAll:i4,matrixFromRows:o4,min:s4,mod:jD,multiply:it,nthRoots:u4,or:f4,partitionSelect:$c,rightLogShift:c4,slu:eS,subset:na,sum:nx,trace:l4,usolveAll:rS,zpk2tf:m4,ceil:ax,compareNatural:ci,composition:p4,cross:d4,det:tS,dotMultiply:h4,fix:aS,index:iS,intersect:v4,invmod:g4,lcm:y4,log1p:x4,max:ix,setCartesian:b4,setDistinct:w4,setIsSubset:D4,setPowerset:S4,smallerEq:Rs,sort:N4,and:A4,range:qs,row:M4,setDifference:oS,setMultiplicity:C4,setSymDifference:sS,column:fS,inv:Zo,lup:cS,pinv:E4,pow:wa,setIntersect:lS,setUnion:T4,sqrtm:F4,vacuumImpedance:_4,wienDisplacement:O4,atomicMass:B4,bohrMagneton:P4,boltzmann:I4,conductanceQuantum:R4,coulomb:q4,deuteronMass:k4,dotPow:L4,electricConstant:z4,elementaryCharge:U4,expm:W4,faraday:Y4,fft:mS,gamma:ox,gravitationConstant:H4,hartreeEnergy:$4,ifft:G4,klitzing:V4,loschmidt:Z4,magneticConstant:Q4,molarMass:X4,molarPlanckConstant:J4,neutronMass:K4,nuclearMagneton:j4,planckCharge:eR,planckLength:rR,planckTemperature:tR,protonMass:nR,quantumOfCirculation:aR,reducedPlanckConstant:iR,rydberg:oR,secondRadiation:sR,speedOfLight:uR,stefanBoltzmann:fR,thomsonCrossSection:cR,avogadro:lR,bohrRadius:mR,createUnit:pR,divide:an,electronMass:dR,factorial:gf,firstRadiation:hR,gravity:vR,inverseConductanceQuantum:gR,lusolve:pS,magneticFluxQuantum:yR,molarMassC12:xR,multinomial:bR,parse:Wa,permutations:wR,planckMass:DR,polynomialRoot:SR,resolve:XR,setSize:NR,simplifyConstant:DS,solveODE:AR,stirlingS2:dS,unit:MR,bellNumbers:CR,compile:NZ,eigs:hS,fermiCoupling:ER,gasConstant:TR,kldivergence:FR,mean:vS,molarVolume:_R,planckConstant:OR,quantileSeq:BR,simplifyCore:SS,variance:sx,classicalElectronRadius:PR,evaluate:NS,median:gS,simplify:fx,symbolicEqual:AZ,corr:IR,freqz:RR,leafCount:MZ,mad:qR,parser:CZ,rationalize:EZ,std:kR,zeta:LR,derivative:TZ,norm:ux,rotationMatrix:yS,help:FZ,planckTime:zR,schur:xS,rotate:UR,sylvester:bS,lyap:WR,config:Oe});ht(xf,yf,{filter:Dy({typed:te}),forEach:Sy({typed:te}),map:Ay({typed:te}),apply:by({isInteger:zn,typed:te}),or:Uy({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),and:zy({add:Lr,concat:Gr,equalScalar:Ir,matrix:$e,not:Uc,typed:te,zeros:ln}),concat:Oy({isInteger:zn,matrix:$e,typed:te}),max:My({config:Oe,larger:Fn,numeric:Ua,typed:te}),print:Ly({add:Lr,matrix:$e,typed:te,zeros:ln}),bitAnd:Wy({add:Lr,concat:Gr,equalScalar:Ir,matrix:$e,not:Uc,typed:te,zeros:ln}),diff:By({bignumber:ta,matrix:$e,number:Bi,subtract:Bt,typed:te}),min:Ey({config:Oe,numeric:Ua,smaller:Tn,typed:te}),subset:_y({add:Lr,matrix:$e,typed:te,zeros:ln}),bitOr:Yy({DenseMatrix:Fr,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),cumsum:qy({add:Lr,typed:te,unaryPlus:$y}),index:Ny({Index:bn,getMatrixDataType:Vy}),sum:Iy({add:Lr,config:Oe,numeric:Ua,typed:te}),range:Ty({bignumber:ta,matrix:$e,add:Lr,config:Oe,isPositive:Ho,larger:Fn,largerEq:Yc,smaller:Tn,smallerEq:Rs,typed:te}),row:Fy({Index:bn,matrix:$e,range:qs,typed:te}),column:wy({Index:bn,matrix:$e,range:qs,typed:te}),mean:Cy({add:Lr,divide:an,typed:te}),quantileSeq:Ry({add:Lr,bignumber:ta,compare:Vo,divide:an,isInteger:zn,larger:Fn,multiply:it,partitionSelect:$c,smaller:Tn,smallerEq:Rs,subtract:Bt,typed:te}),variance:ky({add:Lr,apply:Xy,divide:an,isNaN:pf,multiply:it,subtract:Bt,typed:te}),std:Py({map:$o,sqrt:za,typed:te,variance:sx})});ht(YR,{BigNumber:Ge,Complex:pt,Fraction:Wo,Matrix:kc,Node:_n,ObjectNode:bf,OperatorNode:oo,ParenthesisNode:ks,Range:OP,RelationalNode:HR,ResultSet:qD,ArrayNode:wf,BlockNode:$R,ConditionalNode:GR,ConstantNode:Qo,DenseMatrix:Fr,RangeNode:VR,Chain:wS,FunctionAssignmentNode:ZR,SparseMatrix:Pi,IndexNode:Df,ImmutableDenseMatrix:KD,Index:bn,AccessorNode:Sf,AssignmentNode:QR,FibonacciHeap:nS,Spa:uS,Unit:wr,SymbolNode:Xo,FunctionNode:Jo,Help:JR,Parser:KR});wS.createProxy(yf);var AS=PD;var n5=ma(Nm(),1);var e5=ma(jR(),1);function r5(e){var r=new e5.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 t5(e,r,t,n){function a(x,w){var C=arguments.length;if(C!==1&&C!==2)throw new ga("import",C,1,2);w||(w={});function b(O,_,E){if(Array.isArray(_))_.forEach(L=>b(O,L));else if(typeof _=="object")for(var T in _)Xe(_,T)&&b(O,_[T],T);else if(Ms(_)||E!==void 0){var R=Ms(_)?y(_)?_.fn+".transform":_.fn:E;if(Xe(O,R)&&O[R]!==_&&!w.silent)throw new Error('Cannot import "'+R+'" twice');O[R]=_}else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}var N={};b(N,x);for(var M in N)if(Xe(N,M)){var S=N[M];if(Ms(S))o(S,w);else if(u(S))i(M,S,w);else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}}function i(x,w,C){if(C.wrap&&typeof w=="function"&&(w=c(w)),m(w)&&(w=e(x,{[w.signature]:w})),e.isTypedFunction(t[x])&&e.isTypedFunction(w)){C.override?w=e(x,w.signatures):w=e(t[x],w),t[x]=w,delete n[x],s(x,w),t.emit("import",x,function(){return w});return}if(t[x]===void 0||C.override){t[x]=w,delete n[x],s(x,w),t.emit("import",x,function(){return w});return}if(!C.silent)throw new Error('Cannot import "'+x+'": already exists')}function s(x,w){w&&typeof w.transform=="function"?(t.expression.transform[x]=w.transform,d(x)&&(t.expression.mathWithTransform[x]=w.transform)):(delete t.expression.transform[x],d(x)&&(t.expression.mathWithTransform[x]=w))}function l(x){delete t.expression.transform[x],d(x)?t.expression.mathWithTransform[x]=t[x]:delete t.expression.mathWithTransform[x]}function c(x){var w=function(){for(var b=[],N=0,M=arguments.length;N2&&arguments[2]!==void 0?arguments[2]:x.fn;if(Jb(C,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(C));var b=y(x)?t.expression.transform:t,N=C in t.expression.transform,M=Xe(b,C)?b[C]:void 0,S=function(){var _={};x.dependencies.map(ew).forEach(T=>{if(Jb(T,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(T));T==="math"?_.math=t:T==="mathWithTransform"?_.mathWithTransform=t.expression.mathWithTransform:T==="classes"?_.classes=t:_[T]=t[T]});var E=x(_);if(E&&typeof E.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(M===void 0||w.override)return E;if(e.isTypedFunction(M)&&e.isTypedFunction(E))return e(M,E);if(w.silent)return M;throw new Error('Cannot import "'+C+'": already exists')};!x.meta||x.meta.lazy!==!1?(Du(b,C,S),M&&N?l(C):(y(x)||h(x))&&Du(t.expression.mathWithTransform,C,()=>b[C])):(b[C]=S(),M&&N?l(C):(y(x)||h(x))&&Du(t.expression.mathWithTransform,C,()=>b[C])),n[C]=x,t.emit("import",C,S)}function u(x){return typeof x=="function"||typeof x=="number"||typeof x=="string"||typeof x=="boolean"||x===null||Ht(x)||Kt(x)||rr(x)||da(x)||Qe(x)||Array.isArray(x)}function m(x){return typeof x=="function"&&typeof x.signature=="string"}function d(x){return!Xe(v,x)}function h(x){return x.fn.indexOf(".")===-1&&!Xe(v,x.fn)&&(!x.meta||!x.meta.isClass)}function y(x){return x!==void 0&&x.meta!==void 0&&x.meta.isTransformFunction===!0||!1}var v={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return a}function cx(e,r){var t=ht({},Ss,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=r5({isNumber:sr,isComplex:Kt,isBigNumber:rr,isFraction:da,isUnit:Ht,isString:St,isArray:Mr,isMatrix:Qe,isCollection:Nt,isDenseMatrix:Ji,isSparseMatrix:ha,isRange:Fo,isIndex:Mi,isBoolean:fm,isResultSet:cm,isHelp:xu,isFunction:lm,isDate:mm,isRegExp:pm,isObject:Ci,isNull:dm,isUndefined:hm,isAccessorNode:Ln,isArrayNode:jt,isAssignmentNode:vm,isBlockNode:gm,isConditionalNode:ym,isConstantNode:xr,isFunctionAssignmentNode:Oa,isFunctionNode:yn,isIndexNode:Jn,isNode:Nr,isObjectNode:Ei,isOperatorNode:ct,isParenthesisNode:en,isRangeNode:xm,isRelationalNode:bm,isSymbolNode:at,isChain:bu});n.config=ZA(t,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var a=[],i=[];function s(u){if(Ms(u))return u(n);var m=u[Object.keys(u)[0]];if(Ms(m))return m(n);if(!$A(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=a.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),a.push(u),i.push(h)):h=i[d],h}var l={};function c(){for(var u=arguments.length,m=new Array(u),d=0;d{Ub(l).forEach(u=>{u&&u.meta&&u.meta.recreateOnConfigChange&&o(u,{override:!0})})}),n.create=cx.bind(null,e),n.factory=F,n.import(Ub(YA(e))),n.ArgumentsError=ga,n.DimensionError=pr,n.IndexError=tn,n}var LS=ma(um());var i5=ma(a5()),TS=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",tabs:"Tabs",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",internal:"Link to Note",context:"Embed Existing Context",flow:"Embed Note or Space",board:"New Board",divider:"Divider",note:"Note Block",link:"Web Link",callout:"Callout",bookmark:"Bookmark",table:"New Table",codeblock:"Code Block",toggle:"Toggle",emoji:"Emoji",image:"Image",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",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:{layout:"Layout",enterFlowState:"Enter Flow State",exitFlowState:"Exit Flow State",newView:"New View",calendarView:"Calendar View",dayView:"Day 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",revealInExplorer:"Reveal in Explorer",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",sortBy:"Sort",filters:"Filters",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",editProperties:"Edit Properties",properties:"Properties",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)",fileNameSortNumericalAsc:"File Name (1 to 9)",fileNameSortNumericalDesc:"File Name (9 to 1)",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",insertAbove:"Insert Above",insertBelow:"Insert Below"},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",alias:"Alias",addFilter:"Add Filter",loadMore:"Load More",addCondition:"Add Condition",customize:"Customize",moreOptions:"More Options",saveProperty:"Save Property",newNote:"New Note",changeIcon:"Change Sticker",removeIcon:"Remove Sticker",addIcon:"Add Sticker",addCover:"Add Cover",addDisplay:"Display Name",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 Live Search",addItem:"Add Item",addProperty:"Add Property",editProperty:"Edit 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 From Note",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",contexts:"Contexts",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:"on or 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:"Live Searches",filesAndFolders:"Files and Folders"},labels:{duplicateTable:"Duplicate Table",pinned:"Pinned",live:"Pinned by Live Search",moveTable:"Move Table",editFormula:"Edit Formula",editObject:"Edit Object",properties:"Properties",newAction:"Action",newTable:"List",template:"Template",createFolder:"New Folder Name",rename:"Rename",createNew:"New",default:"Default",done:"Done",changeCoverShort:"Change",reposition:"Reposition",tables:"Tables",selectDateFormat:"Select/Type Date Format",renameSection:"Edit 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",notePlaceholder:"New Note for \${1}",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",existingFrontmatter:"Existing Property",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",contexts:"Contexts",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",spaceTemplates:"Create templates to quickly add items to your 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",noPropertiesFound:"No Properties Found",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: ",tableDeleted:"Table removed from note, you can find the table in the folder 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:"Show Toggles to Open Flow Editor on Links",desc:"Turn on to toggle Flow Blocks directly in inline links"},internalLinkSticker:{name:"Show Stickers on Links",desc:"Turn on to toggle stickers shown directly by beside internal links"},syncContextToFrontmatter:{name:"Sync Context Fields to Frontmatter",desc:"Turn on to automatically save all context fields to frontmatter fields, not just existing frontmatter fields."},syncFormulaToFrontmatter:{name:"Sync Formula Fields to Frontmatter",desc:"Turn on to save calculated formula values to 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"},inlineContextProperties:{name:"Inline Context Properties",desc:"Show the properties in the inline context"},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 Context Properties",desc:"Hide properties you have addeed in context from the Obsidian properties panel"},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"},folderNoteName:{name:"Folder Note Name",desc:"Name of the folder note, keep blank to use the same name as the folder"},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"},flowState:{name:"Flow State",desc:"Toggle the flow state"},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 29"},contextPagination:{name:"Table View Pagination",desc:"Number of items per page in table view"},coverHeight:{name:"Cover Height",desc:"The height for the cover of the note or space, default is 200"},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=i5.default.locale();["en"].includes(r)&&(this.lang=r)}get texts(){return this.all.en}},Br=new TS().texts;var FS=e=>e.lastIndexOf("/")!=-1?e.lastIndexOf(".")!=-1?MA(e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("."))):e.substring(e.lastIndexOf("/")+1):e.lastIndexOf(".")!=-1?e.substring(0,e.lastIndexOf(".")):e;var kZ=ma(um());var BZ=(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 o5=({field:e,value:r})=>r=="ctime"?{value:"parseDate(prop('File')['metadata']['ctime'])",type:"date"}:{value:"",type:"string"},lx=(e,r,t,n)=>{let a=bc(e);if(a)return r=="fileprop"&&a.field?o5(a):(r=="option"&&a.source?.length>0&&(a.source=="$commands"?a.options=t.cli.allCommands():a.source=="$links"?a.options=t.spaceManager.allPaths().map(i=>({name:i,value:i})):a.source=="$super"?a.options=BZ(t,n):a.source=="$properties"&&(a.options=t.contextsIndex.get(n)?.contextTable?.cols?.map(i=>({name:i.name,value:i.name}))??[])),[...s5(r).configKeys??[],"alias","default"].reduce((i,s)=>({...i,[s]:a[s]}),{}));if(!r)return{};if(!a)if(r=="context")e?.length>0?a={space:e}:a={};else if(r.startsWith("date"))e?.length>0?a={format:e}:a={};else if(r.startsWith("fileprop"))if(e?.length>0){let[i,s]=e.split(".");a=o5({field:i,value:s})}else a={};else r.startsWith("option")&&(e?.length>0?a={options:gn(e).map(s=>({name:s,value:s}))}:a={});return a??{}};var s5=(e,r)=>r==Xn?Af.find(t=>t.type=="file"):r=="tags"?Af.find(t=>t.type=="tags-multi"):r=="aliases"?Af.find(t=>t.type=="option-multi"):r=="sticker"?Af.find(t=>e=="icon"):Af.find(t=>e==t.type)||Af.find(t=>e==t.multiType),Af=[{type:"unknown",label:"",restricted:!0,icon:"ui//file-question"},{type:"any",label:"",restricted:!0,icon:"ui//wildcard",multi:!0,multiType:"any-multi"},{type:"text",label:Br.properties.text.label,metadata:!0,icon:"ui//text",primative:!0,description:Br.properties.text.description},{type:"number",label:Br.properties.number.label,metadata:!0,icon:"ui//binary",configKeys:["unit"],primative:!0,description:Br.properties.number.description},{type:"boolean",label:Br.properties.boolean.label,metadata:!0,icon:"ui//check-square",primative:!0,description:Br.properties.boolean.description},{type:"date",label:Br.properties.date.label,metadata:!0,icon:"ui//calendar",configKeys:["format"],primative:!0,description:Br.properties.date.description},{type:"option",label:Br.properties.option.label,multi:!0,multiType:"option-multi",icon:"ui//list",configKeys:["options","source"],description:Br.properties.option.description},{type:"tags-multi",label:Br.properties.tags.label,icon:"ui//tags",description:Br.properties.tags.description},{type:"file",label:Br.properties.file.label,restricted:!0,icon:"ui//mk-make-h3"},{type:"fileprop",label:Br.properties.fileProperty.label,icon:"ui//formula",configKeys:["field","value","type"],description:Br.properties.fileProperty.description},{type:"link",label:Br.properties.link.label,multi:!0,multiType:"link-multi",metadata:!0,icon:"ui//file-text",primative:!0,description:Br.properties.link.description},{type:"context",label:Br.properties.context.label,icon:"ui//mk-make-note",multi:!0,multiType:"context-multi",configKeys:["space"],description:Br.properties.context.description},{type:"object",label:Br.properties.object.label,multi:!0,multiType:"object-multi",metadata:!0,icon:"ui//list-tree",configKeys:["type","typeName"],description:Br.properties.object.description},{type:"icon",label:Br.properties.icon.label,multi:!0,multiType:"icon-multi",icon:"ui//gem",restricted:!0,primative:!0,description:Br.properties.icon.description},{type:"image",label:Br.properties.image.label,multi:!0,multiType:"image-multi",metadata:!0,icon:"ui//mk-make-image",primative:!0,description:Br.properties.image.description},{type:"color",label:Br.properties.color.label,icon:"ui//mk-make-image",restricted:!0,description:Br.properties.color.description},{type:"space",label:Br.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Br.properties.space.description},{type:"table",label:Br.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Br.properties.space.description},{type:"super",label:Br.properties.super.label,icon:"ui//zap",restricted:!0,configKeys:["dynamic","field"]},{type:"input",label:Br.properties.super.label,icon:"ui//input",restricted:!0}];var li="files",dx={id:li,name:"Items",type:"db",primary:"true"},PZ="filesView",IZ={id:PZ,name:"All",type:"view",def:JSON.stringify({db:li,icon:"ui//file-stack"})},RZ="main",qZ=e=>({id:e,name:e,type:"frame",def:"",predicate:"",primary:"true"}),E4e={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[qZ(RZ),IZ]},mx={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[dx]},u5={uniques:["name,schemaId"],cols:["name","schemaId","type","value","attrs","hidden","unique","primary"]},px={...u5,rows:[{name:Xn,schemaId:li,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""},{name:Br.properties.fileProperty.createdTime,schemaId:li,type:"fileprop",value:Xn+".ctime",hidden:"",unique:"",attrs:"",primary:"true"}]};var T4e=[{name:Br.properties.defaultField,schemaId:"",type:"text",primary:"true"}],_S={...u5,rows:[{name:Xn,schemaId:li,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""}]};var F4e={schema:dx,cols:px.rows,rows:[]},_4e={schema:dx,cols:px.rows,rows:[]},O4e={schema:dx,cols:_S.rows,rows:[]},f5=(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 B4e={m_schema:mx,m_fields:px,...f5(px.rows,mx.rows)},P4e={m_schema:mx,m_fields:_S,...f5(_S.rows,mx.rows)};var OS="spaces://$tags";var pRe={name:Br.menu.waypoints,readOnly:!1,path:"spaces://$waypoints",label:{name:Br.menu.waypoints,thumbnail:"",sticker:"ui//tags",color:""},type:"default"},dRe={name:Br.menu.tags,readOnly:!1,path:"spaces://$tags",label:{thumbnail:"",name:Br.menu.tags,sticker:"ui//tags",color:""},type:"default"},hRe={name:Br.menu.vault,readOnly:!1,path:"/",label:{thumbnail:"",name:Br.menu.vault,sticker:"ui//vault",color:""},type:"default"};var c5=(e,r,t,n,a,i,s)=>{if(!t)return"";let l=new Map;Object.keys(a).forEach(o=>l.set(o,a[o])),l.set("$properties",n),l.set("$paths",r),i&&l.set("$current",i);let c;try{e.evaluate("current = _current()",l),c=e.evaluate(t,l),c=Ds("",c)}catch(o){if(c="",s)throw o;console.log(i,t,o)}return c};var BS=e=>{let r=new Map;e.filter(s=>s.type=="fileprop"||s.name.startsWith("tags")).forEach(s=>{let{value:l}=lx(s.value,s.type),c=[];try{let u=Wa(l).filter(m=>m.type=="FunctionNode").filter(m=>m.fn.name=="prop"&&m.args[0].type=="ConstantNode").map(m=>m.args[0]?.value);c.push(...u)}catch{}let o=s.name;r.has(o)||r.set(o,new Set);for(let u of c){let m=u;m!==o&&r.get(o).add(m)}});let t=new Set,n=[],a=new Set,i=s=>{if(a.has(s))throw new Error("Circular dependency detected");if(!t.has(s)){a.add(s);let l=r.get(s)||new Set;for(let c of l)i(c);t.add(s),a.delete(s),n.push(s)}};for(let s of e)t.has(s.name)||i(s.name);return n},l5=(e,r,t,n,a,i)=>{if(!t)return{};let s=i??BS(n),l=r.get(t[Xn])?.metadata?.property??{},c=Object.keys(l).filter(m=>n.some(d=>d.name==m)).reduce((m,d)=>({...m,[d]:Ds(d,l[d])}),{}),o=s.map(m=>n.find(d=>d.name==m)).filter(m=>m&&(m.type=="fileprop"||m.name=="tags")),u=n.reduce((m,d)=>({...m,[d.name]:d}),{});return{...t,...c,...o.reduce((m,d)=>{let{value:h}=lx(d.value,d.type);return{...m,[d.name]:c5(e,r,h,u,{...t,...m},a)}},{})}};var m5=(e,r)=>{let t=e?gn(e):[],n=r?gn(r):[];return n.every(a=>t.some(i=>i==a))&&t.every(a=>n.some(i=>i==a))},Mf=(e,r)=>e==r,PS=(e,r)=>(e??"").length==0,IS=(e,r)=>(e??"").toLowerCase().includes((r??"").toLowerCase()),RS=(e,r)=>parseFloat(e)>parseFloat(r),qS=(e,r)=>parseInt(e){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()},d5=(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?gn(e):[],n=r?gn(r):[];return t.length==0?!1:n.some(a=>t.some(i=>i==a))},h5=(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()},v5=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 Cf={isNotEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(e,r)=>!PS(e,""),valueType:"none"},isEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(e,r)=>PS(e,""),valueType:"none"},include:{fn:(e,r)=>IS(e,r),type:["text","file","link","image"],valueType:"text"},notInclude:{type:["text","file","link","image"],fn:(e,r)=>!IS(e,r),valueType:"text"},is:{type:["text"],fn:(e,r)=>Mf(e,r),valueType:"text"},isNot:{type:["text"],fn:(e,r)=>!Mf(e,r),valueType:"text"},equal:{type:["number"],fn:(e,r)=>Mf(e,r),valueType:"number"},isLink:{type:["link","context"],fn:(e,r)=>Mf(e,r),valueType:"link"},isNotLink:{type:["link","context"],fn:(e,r)=>!Mf(e,r),valueType:"link"},isGreatThan:{type:["number"],fn:(e,r)=>RS(e,r),valueType:"number"},isLessThan:{type:["number"],fn:(e,r)=>qS(e,r),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(e,r)=>!RS(e,r),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(e,r)=>!qS(e,r),valueType:"number"},dateBefore:{type:["date"],fn:(e,r)=>d5(e,r),valueType:"date"},dateAfter:{type:["date"],fn:(e,r)=>p5(e,r),valueType:"date"},isSameDate:{type:["date"],fn:(e,r)=>h5(e,r),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(e,r)=>v5(e,r),valueType:"none"},isExactList:{type:["option","option-multi","link-multi","context-multi","tags-multi"],fn:(e,r)=>m5(e,r),valueType:"list"},isAnyInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi"],fn:(e,r)=>kS(e,r),valueType:"list"},isNoneInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi"],fn:(e,r)=>!kS(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 zZ=(e,r,t)=>r.reduce((a,i)=>{let[s,l]=a,c=i.type=="context"?g5(l,i,t):i.type=="path"?x5(l,i,t):i.type=="frontmatter"?y5(l,i,t):b5(l,i,t),o=l.filter(u=>!c.includes(u));return[[...s,...c],o]},[[],e])[0],UZ=(e,r,t)=>r.reduce((n,a)=>a.type=="context"?g5(n,a,t):a.type=="path"?x5(n,a,t):a.type=="frontmatter"?y5(n,a,t):b5(n,a,t),e),g5=(e,r,t)=>{let n=Cf[r.fn];return!n||n.valueType!="none"&&r.value.length==0?[]:e.filter(a=>{let[i,s]=r.field.split("."),l=a.metadata?.property;if(!a.spaces?.includes(i)||!l||!l[s])return!1;let c=!0;if(n){let o=r.fType=="property"?t[r.value]:r.value;c=n.fn(Ds(s,l[s]),o)}return c})},y5=(e,r,t)=>{let n=Cf[r.fn];return!n||n.valueType!="none"&&r.value.length==0?[]:e.filter(a=>{let i=a.metadata?.property;if(!i||i[r.field]===void 0)return!1;let s=!0;if(n){let l=r.fType=="property"?t[r.value]:r.value;s=n.fn(Ds(r.field,i[r.field]),l)}return s})},x5=(e,r,t)=>{let n=Cf[r.fn];return!n||n.valueType!="none"&&r.value.length==0?[]:e.filter(a=>{let i="";r.field=="outlinks"?i=ws(a.outlinks??[]):r.field=="inlinks"?i=ws(a.metadata?.inlinks??[]):r.field=="tags"&&(i=ws(a.tags??[]));let s=!0;if(n){let l=r.fType=="property"?t[r.value]:r.value;s=n.fn(i,l)}return s})},b5=(e,r,t)=>{let n=Cf[r.fn];return!n||n.valueType!="none"&&r.value.length==0?[]:e.filter(a=>{let i=!0;if(n){let s=r.fType=="property"?t[r.value]:r.value;i=n.fn(a.metadata?.[r.type]?.[r.field],s)}return i})},w5=(e,r,t)=>e.reduce((a,i)=>!a||i.filters.length==0?!1:i.type=="any"?zZ([r],i.filters,t).length>0:UZ([r],i.filters,t).length>0,!0);var D5=(e,r)=>e.hiddenExtensions.some(t=>r.endsWith(t))||r.startsWith(e.spacesFolder+"/#")||e.hiddenFiles.some(t=>t==r);var S5=(e,r,t,n,a,i)=>{let s={};if(!e)return{changed:!1,cache:null};if(!r)return{changed:!1,cache:{path:e.path,schemas:[],outlinks:[],contexts:[],paths:[],contextTable:null,spaceMap:s,dbExists:!1}};let l=Object.values(r).map(N=>N.schema),c=r[li]?.rows?.map(N=>N[Xn])??[],o=t.filter(N=>!c.includes(N)),u=[...NA(t??[],c),...o],m=BS(r[li].cols),d=[...r[li].rows.filter(N=>t.includes(N[Xn])),...o.map(N=>({[Xn]:N}))].map(N=>l5(i,a,N,r[li].cols,a.get(e.path),m)),h={...r[li],rows:d},y=h.cols?.filter(N=>N.type.startsWith("context"))??[],v=h.cols?.filter(N=>N.type.startsWith("link"))??[],x=pa(y.map(N=>N.value));y.forEach(N=>{s[N.name]={},h.rows.forEach(M=>{gn(M[N.name]).forEach(S=>s[N.name][S]=[...s[N.name][S]??[],M[Xn]])})});let w=pa(h.rows.reduce((N,M)=>pa([...N,...[...y,...v].flatMap(S=>gn(M[S.name]).map(O=>wc(O)))]),[])),C={contextTable:h,path:e.path,contexts:x,outlinks:w,paths:u,schemas:l,spaceMap:s,dbExists:n},b=!1;return LS.default.isEqual(h,r)||(b=!0),{changed:b,cache:C}},N5=(e,r,t,n)=>{let a={};for(let[i,s]of e){let l=r.enableFolderNote?t.get(i)?.space.notePath??i:i,c=e.get(l)??s;if(!s)continue;let o=s?.parent??"",u=s?.type??"",m=s?.subtype??"",d=c?.label,h=n?.get(i),{changed:y,cache:v}=zS(i,r,t,c,d,u,m,o,h);a[i]={changed:y,cache:v}}return a},zS=(e,r,t,n,a,i,s,l,c)=>{let o=(W,k,q)=>W?.length>0||W?.length>0?W:k=="space"?q=="Spaces/Home"?"ui//home":q=="/"?"ui//vault":q.startsWith("spaces://")?"ui//tags":"ui//folder":"ui//file",u={label:n?.label,path:e,name:FS(e),readOnly:n?.readOnly},m=[],d=n?.tags?.map(W=>W)??[],h=D5(r,e),y=(W,k,q=new Set)=>{let K=[];for(let z of k){let oe=W.get(z)?.contexts??[];for(let le of oe)q.has(le)||(K.push(le),q.add(le),K.push(...y(W,[xc(le)],q)))}return K};if(t.has(l))for(let W of t.get(l).contexts??[])m.push(W);m.push(...d);let v=a?.name,x=n?.property?sm(n.property[r.fmKeyAlias]):[],w=o(a?.sticker,i,e),C=a?.color??"",b=n?.resolvedLinks??[],N=!1,M,S={...u,name:v,tags:pa(m),type:i,subtype:s,parent:l,label:{name:r.spacesUseAlias&&x?.length>0?x[0]:v,sticker:w,color:C,thumbnail:a?.thumbnail??"",preview:a?.preview??""},metadata:{...n},outlinks:b},O=[],_=[],E=[];s=="tag"&&O.push(OS);for(let W of m)O.push(xc(W));let T=new Set,R=(W,k)=>{if(!T.has(W)){if(T.add(W),k.dependencies?.length>0)for(let q of k.dependencies)t.has(q)&&R(q,t.get(q));if(k.space.notePath==e&&k.path!=k.space.notePath&&(N=!0,M=k.path,h=!0),s!="tag"&&s!="default"&&k.space&&k.space.path==l){O.push(W);return}if(k.metadata?.filters?.length>0&&w5(k.metadata.filters,{...S,spaces:O},k.properties)){O.push(W),E.push(W);return}if(k.metadata?.links?.length>0&&(k.metadata?.links??[]).find(K=>K==S.path)){O.push(W),_.push(W);return}}};for(let[W,k]of t)R(W,k);let L=y(t,O);O.push(...L.map(W=>xc(W))),S.tags.push(...L),N&&(S.metadata.spacePath=M);let H=h?{...S,spaces:[],hidden:h}:{...S,spaces:pa(O),linkedSpaces:_,liveSpaces:E,hidden:h},V=!0;return c&&LS.default.isEqual(H,c)&&(V=!1),{changed:V,cache:H}};function A5(e){let{path:r,settings:t,spacesCache:n,pathMetadata:a,label:i,type:s,subtype:l,parent:c,oldMetadata:o}=e;return zS(r,t,n,a,i,s,l,c,o)}function US(e,r){let{space:t,mdb:n,paths:a,dbExists:i,pathsIndex:s}=e;return S5(t,n,a,i,s,r)}function M5(e,r){let{map:t,pathsIndex:n}=e,a=new Map;for(let[i,s]of t)a.set(i,US({...s,pathsIndex:n},r));return a}function C5(e){let{pathCache:r,settings:t,spacesCache:n,oldMetadata:a}=e;return N5(r,t,n,a)}var WZ=self,YZ={...AS,createAdd:F("add",[],()=>function(r,t){return r+t}),createEqual:F("equal",[],()=>function(r,t){return r==t}),createUnequal:F("unequal",[],()=>function(r,t){return r!=t})},HZ={matrix:"Array"},WS=cx(YZ,HZ);WS.import(Lb,{override:!0});WZ.onmessage=async e=>{let{payload:r,job:t}=e.data,n;t.type=="path"?n=A5(r):t.type=="context"?n=US(r,WS):t.type=="contexts"?n=M5(r,WS):t.type=="paths"&&(n=C5(r));try{postMessage({job:t,result:n})}catch(a){console.log(a),postMessage({job:t,result:{$error:\`Failed to index \${t.type} \${t.path}: \${a}\`}})}}; /*! * decimal.js v10.4.3 * An arbitrary-precision Decimal type for JavaScript. @@ -110071,7 +110122,10 @@ var Superstate6 = class { return a4 != b2; }) }; - const runContext = create(all2); + const config5 = { + matrix: "Array" + }; + const runContext = create(all2, config5); runContext.import(formulas, { override: true }); this.formulaContext = runContext; this.initialized = false; @@ -113873,7 +113927,7 @@ var PropertiesView = (props) => { newCols.filter((f2) => !props.excludeKeys?.some((g) => g == f2.name)) ); setExcludeKeys([ - ...columns.map((f2) => f2.name), + ...props.superstate.settings.hideFrontmatter ? columns.map((f2) => f2.name) : [], ...props.excludeKeys ?? [] ]); setValues( @@ -114078,7 +114132,6 @@ var PropertiesView = (props) => { selectType ); }; - const propertiessuperstate = props.superstate.settings.hideFrontmatter; return /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, props.compactMode ? cols.map((f2, i4) => /* @__PURE__ */ import_react65.default.createElement(DataPropertyView, { key: i4, path: pathState.path, @@ -114097,7 +114150,7 @@ var PropertiesView = (props) => { }), contextTable: {}, source: pathState.path - })) : !propertiessuperstate || props.force ? /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, cols.map((f2, i4) => /* @__PURE__ */ import_react65.default.createElement(DataPropertyView, { + })) : props.force ? cols.map((f2, i4) => /* @__PURE__ */ import_react65.default.createElement(DataPropertyView, { key: i4, path: pathState.path, propertyMenu: (e5) => showMenu2(e5, f2), @@ -114115,7 +114168,7 @@ var PropertiesView = (props) => { }), contextTable: {}, source: pathState.path - }))) : /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null), excludeKeys.length > 0 && /* @__PURE__ */ import_react65.default.createElement("style", null, `${excludeKeys.map((f2) => `.metadata-property[data-property-key="${f2}"]`).join(", ")} + })) : /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null), excludeKeys.length > 0 && /* @__PURE__ */ import_react65.default.createElement("style", null, `${excludeKeys.map((f2) => `.metadata-property[data-property-key="${f2}"]`).join(", ")} { display: none; }`)); @@ -134612,7 +134665,7 @@ var TreeItem = (props) => { const [pathState, setPathState] = (0, import_react147.useState)( superstate.pathsIndex.get(data2.item.path) ); - const pinType = pathState.linkedSpaces?.some((f2) => f2 == data2.space) ? 1 /* Linked */ : pathState.liveSpaces?.some((f2) => f2 == data2.space) ? 2 /* Live */ : 0 /* Default */; + const pinType = pathState?.linkedSpaces?.some((f2) => f2 == data2.space) ? 1 /* Linked */ : pathState.liveSpaces?.some((f2) => f2 == data2.space) ? 2 /* Live */ : 0 /* Default */; (0, import_react147.useEffect)( () => setPathState(superstate.pathsIndex.get(data2.item.path)), [data2.item.path] @@ -139248,7 +139301,8 @@ var uiIconSet = { "move": ``, "wildcard": ``, "replace": ``, - "alias": `` + "alias": ``, + "import": `` }; // src/core/react/components/System/IconsSet.tsx diff --git a/manifest.json b/manifest.json index 71f2e87..9e43694 100755 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "make-md", "name": "MAKE.md", - "version": "0.9.993", + "version": "0.9.994", "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/src/core/assets/icons.ts b/src/core/assets/icons.ts index c0a2847..11f7534 100644 --- a/src/core/assets/icons.ts +++ b/src/core/assets/icons.ts @@ -768,5 +768,6 @@ export const uiIconSet: Record = { 'move': ``, 'wildcard': ``, 'replace': ``, -'alias': `` +'alias': ``, +'import': `` }; \ No newline at end of file diff --git a/src/core/i18n.ts b/src/core/i18n.ts index 5bf500d..beb5b68 100644 --- a/src/core/i18n.ts +++ b/src/core/i18n.ts @@ -578,7 +578,7 @@ class T { propertyValueSpace: "Space", propertyValueProperty: "Property", propertyLookup: "Edit Formula", - + existingFrontmatter: "Existing Property", dateFormat: "Date Format", propertyFileProp: "Property", multiple: "Multiple", @@ -662,6 +662,7 @@ class T { fileExists: "File Already Exists", folderExists: "Folder Already Exists", noPropertyName: "Property Name is Required", + noPropertiesFound: "No Properties Found", duplicatePropertyName: "Duplicate Property Name", newSpaceName: "Enter a name for your space", duplicateSpaceName: "Space name already exists", @@ -772,8 +773,8 @@ class T { desc: "Layout for inline title and sticker in Inline Context", }, hideFrontmatter: { - name: "Hide Frontmatter Properties", - desc: "Hide the frontmatter properties in inline context", + name: "Hide Context Properties", + desc: "Hide properties you have addeed in context from the Obsidian properties panel", }, openFileContext: { name: "Auto Open Explorer", diff --git a/src/core/react/components/Explorer/PropertiesView.tsx b/src/core/react/components/Explorer/PropertiesView.tsx index fa24f62..85eb286 100644 --- a/src/core/react/components/Explorer/PropertiesView.tsx +++ b/src/core/react/components/Explorer/PropertiesView.tsx @@ -103,7 +103,9 @@ export const PropertiesView = (props: { newCols.filter((f) => !props.excludeKeys?.some((g) => g == f.name)) ); setExcludeKeys([ - ...columns.map((f) => f.name), + ...(props.superstate.settings.hideFrontmatter + ? columns.map((f) => f.name) + : []), ...(props.excludeKeys ?? []), ]); setValues( @@ -314,7 +316,7 @@ export const PropertiesView = (props: { selectType ); }; - const propertiessuperstate = props.superstate.settings.hideFrontmatter; + return ( <> {props.compactMode ? ( @@ -345,36 +347,34 @@ export const PropertiesView = (props: { source={pathState.path} > )) - ) : !propertiessuperstate || props.force ? ( - <> - {cols.map((f, i) => ( - showMenu(e, f)} - superstate={props.superstate} - initialValue={values[f.name]} - row={values} - compactMode={props.compactMode} - column={{ ...f, table: "" }} - columns={[]} - editMode={ - !props.editable - ? CellEditMode.EditModeView - : CellEditMode.EditModeAlways - } - updateValue={(value) => savePropertyValue(value, f)} - updateFieldValue={(fieldValue, value) => - savePropertyValue(value, { - ...f, - value: fieldValue, - }) - } - contextTable={{}} - source={pathState.path} - > - ))} - + ) : props.force ? ( + cols.map((f, i) => ( + showMenu(e, f)} + superstate={props.superstate} + initialValue={values[f.name]} + row={values} + compactMode={props.compactMode} + column={{ ...f, table: "" }} + columns={[]} + editMode={ + !props.editable + ? CellEditMode.EditModeView + : CellEditMode.EditModeAlways + } + updateValue={(value) => savePropertyValue(value, f)} + updateFieldValue={(fieldValue, value) => + savePropertyValue(value, { + ...f, + value: fieldValue, + }) + } + contextTable={{}} + source={pathState.path} + > + )) ) : ( <> )} diff --git a/src/core/react/components/Navigator/SpaceTree/SpaceTreeItem.tsx b/src/core/react/components/Navigator/SpaceTree/SpaceTreeItem.tsx index 86670f7..44e9def 100644 --- a/src/core/react/components/Navigator/SpaceTree/SpaceTreeItem.tsx +++ b/src/core/react/components/Navigator/SpaceTree/SpaceTreeItem.tsx @@ -107,7 +107,7 @@ export const TreeItem = (props: TreeItemProps) => { const [pathState, setPathState] = useState( superstate.pathsIndex.get(data.item.path) ); - const pinType = pathState.linkedSpaces?.some((f) => f == data.space) + const pinType = pathState?.linkedSpaces?.some((f) => f == data.space) ? PinType.Linked : pathState.liveSpaces?.some((f) => f == data.space) ? PinType.Live diff --git a/src/core/react/components/UI/Menus/contexts/PropertyValue.tsx b/src/core/react/components/UI/Menus/contexts/PropertyValue.tsx index 66bd7a4..7ce827e 100644 --- a/src/core/react/components/UI/Menus/contexts/PropertyValue.tsx +++ b/src/core/react/components/UI/Menus/contexts/PropertyValue.tsx @@ -1,9 +1,7 @@ import i18n from "core/i18n"; import { FormulaEditor } from "core/react/components/SpaceEditor/Actions/FormulaEditor"; -import { filePropTypes } from "core/react/components/SpaceView/Contexts/TableView/ColumnHeader"; import { parseFieldValue } from "core/schemas/parseFieldValue"; import { Superstate } from "core/superstate/superstate"; -import { allCacheTypesForPaths } from "core/utils/properties/allProperties"; import { spaceNameFromSpacePath } from "core/utils/strings"; import React, { useMemo } from "react"; import { @@ -139,31 +137,7 @@ export const PropertyValueComponent = (props: { })) ?? []; showOptions(e, null, properties, "field"); }; - const selectPathProp = (e: React.MouseEvent) => { - const property = props.fields.find((f) => f.name == parsedValue.field); - const allPaths = props.superstate.spaceManager.allPaths(); - const fileProps = property - ? property.type == "file" || property.type == "link" - ? filePropTypes.map((f) => ({ - name: f.name, - value: f.value, - })) - : props.superstate.contextsIndex - .get( - parseFieldValue(property.value, "context", props.superstate).space - ) - ?.contextTable?.cols.filter((f) => f.hidden != "true") - .map((f) => ({ - name: f.name, - value: f.name, - })) ?? [] - : []; - const cacheTypes = allCacheTypesForPaths(props.superstate, allPaths).map( - (f) => ({ name: f.name, value: f.name }) - ); - showOptions(e, null, [...fileProps, ...cacheTypes], "value"); - }; const editFormula = (e: React.MouseEvent) => { const _props = { superstate: props.superstate, diff --git a/src/core/react/components/UI/Menus/contexts/newSpacePropertyMenu.tsx b/src/core/react/components/UI/Menus/contexts/newSpacePropertyMenu.tsx index c2d849e..1ad4a14 100644 --- a/src/core/react/components/UI/Menus/contexts/newSpacePropertyMenu.tsx +++ b/src/core/react/components/UI/Menus/contexts/newSpacePropertyMenu.tsx @@ -1,12 +1,21 @@ import i18n from "core/i18n"; import { Superstate } from "core/superstate/superstate"; +import { FMSpaceKeys } from "core/superstate/utils/spaces"; +import { FMMetadataKeys } from "core/types/space"; +import { allPropertiesForPaths } from "core/utils/properties/allProperties"; import React, { useEffect, useMemo, useRef, useState } from "react"; -import { fieldTypeForType, fieldTypes } from "schemas/mdb"; -import { Rect } from "types/Pos"; +import { + defaultContextSchemaID, + fieldTypeForType, + fieldTypes, + stickerForField, +} from "schemas/mdb"; import { SpaceProperty, SpaceTableColumn } from "types/mdb"; +import { Rect } from "types/Pos"; import { windowFromDocument } from "utils/dom"; import { folderPathToString } from "utils/path"; +import { menuSeparator } from "../menu/SelectionMenu"; import { PropertyValueComponent } from "./PropertyValue"; export type NewPropertyMenuProps = { @@ -155,6 +164,76 @@ const NewPropertyMenuComponent = ( }, 50); }, []); const input = useRef(null); + const addExistingProperty = (e: React.MouseEvent) => { + const source = fieldSource == "" ? props.contextPath : fieldSource; + e.stopPropagation(); + const existingCols = + props.superstate.contextsIndex.get(source)?.contextTable?.cols ?? []; + const existingProps: SpaceProperty[] = allPropertiesForPaths( + props.superstate, + [...(props.superstate.spacesMap.getInverse(source) ?? [])] + ) + .filter( + (f) => + !existingCols.some((g) => g.name == f.name) && + ![ + ...FMMetadataKeys(props.superstate.settings), + "tags", + ...FMSpaceKeys(props.superstate.settings), + ].some((g) => g == f.name) + ) + .map((f) => ({ + name: f.name, + type: f.type, + value: "", + schemaId: props.schemaId, + })); + if (existingProps.length == 0) { + props.superstate.ui.notify(i18n.notice.noPropertiesFound); + return; + } + props.superstate.ui.openMenu( + (e.target as HTMLElement).getBoundingClientRect(), + { + ui: props.superstate.ui, + multi: false, + editable: false, + searchable: true, + saveOptions: (_: string[], value: any[]) => { + if (value[0] == "all") { + props.superstate.spaceManager + .readTable(source, defaultContextSchemaID) + .then((f) => + props.superstate.spaceManager.saveTable(source, { + ...f, + cols: [...f.cols, ...existingProps], + }) + ) + .then((f) => props.superstate.reloadContextByPath(source)); + props.hide(); + return; + } + const result = props.saveField(fieldSource, value[0]); + if (result) props.hide(); + }, + value: [], + showAll: true, + options: [ + { name: i18n.labels.all, value: "all", icon: "ui//plus" }, + menuSeparator, + ...existingProps.map((f, i) => ({ + id: i + 1, + name: f.name, + value: f, + icon: stickerForField(f), + })), + ], + placeholder: i18n.labels.existingFrontmatter, + }, + windowFromDocument(e.view.document) + ); + }; + return (
@@ -168,7 +247,18 @@ const NewPropertyMenuComponent = ( onMouseDown={(e) => e.stopPropagation()} value={fieldName} /> + {fieldSource != "$fm" && ( + + )}
+
{options.length > 1 && (
selectSource(e)}> @@ -179,14 +269,15 @@ const NewPropertyMenuComponent = ( {fieldSource == "$fm" ? "None" : fieldSource == "" - ? props.contextPath - : fieldSource} + ? props.superstate.spacesIndex.get(props.contextPath)?.name + : props.superstate.spacesIndex.get(fieldSource)?.name}
)} +
selectType(e)}>
- {i18n.labels.propertyValueProperty} + {i18n.labels.propertyType}
{type.label}
diff --git a/src/core/superstate/superstate.ts b/src/core/superstate/superstate.ts index 397a9fe..ea61c7e 100644 --- a/src/core/superstate/superstate.ts +++ b/src/core/superstate/superstate.ts @@ -161,7 +161,10 @@ public api: API; }) } - const runContext = math.create(all) + const config :math.ConfigOptions = { + matrix: "Array" + } + const runContext = math.create(all, config) runContext.import(formulas, { override: true }) this.formulaContext = runContext; //Initialize diff --git a/src/core/superstate/workers/indexer/indexer.worker.ts b/src/core/superstate/workers/indexer/indexer.worker.ts index 3b42328..6848cc9 100644 --- a/src/core/superstate/workers/indexer/indexer.worker.ts +++ b/src/core/superstate/workers/indexer/indexer.worker.ts @@ -16,7 +16,10 @@ const all = { }) } -const runContext = math.create(all) +const config :math.ConfigOptions = { + matrix: "Array" +} +const runContext = math.create(all, config) runContext.import(formulas, { override: true }) ctx.onmessage = async evt => { diff --git a/src/core/utils/formula/formulas.ts b/src/core/utils/formula/formulas.ts index 702891a..9212144 100644 --- a/src/core/utils/formula/formulas.ts +++ b/src/core/utils/formula/formulas.ts @@ -684,16 +684,16 @@ const map = (args: MathNode[], math: any, scope: Map) => { : args[0]; if (Array.isArray(arr)) { + return arr.map((f, i) => { scope.set("$current", f); scope.set("$index", i); math.evaluate("current = _current(); index = _index()", scope) const result = args[1].compile().evaluate(scope); - return result; }); } - return ""; + return []; } map.rawArgs = true; diff --git a/src/core/utils/formula/parser.ts b/src/core/utils/formula/parser.ts index 9b414c6..8b5fe5e 100644 --- a/src/core/utils/formula/parser.ts +++ b/src/core/utils/formula/parser.ts @@ -249,7 +249,10 @@ export const runFormulaNode = (node: FormulaNode, propMap: DBRow): string => { } - const runContext = math.create(all) + const config :math.ConfigOptions = { + matrix: "Array" + } + const runContext = math.create(all, config) runContext.import(formulas, { override: true }) if (node.type === "literal") { return node.value @@ -345,7 +348,10 @@ export const runFormula = (paths: Map, formula: string, prope }) } - const runContext = math.create(all) + const config :math.ConfigOptions = { + matrix: "Array" + } + const runContext = math.create(all, config) runContext.import(formulas, { override: true }) let value; try { diff --git a/src/core/utils/properties/allProperties.ts b/src/core/utils/properties/allProperties.ts index fd4f7bd..47cc38c 100644 --- a/src/core/utils/properties/allProperties.ts +++ b/src/core/utils/properties/allProperties.ts @@ -1,41 +1,20 @@ import { Superstate } from "core/superstate/superstate"; import { detectPropertyType } from "utils/properties"; -export type MetadataType = { +export type PropertyType = { name: string; type: string; }; -export const allCacheTypesForPaths = ( - superstate: Superstate, - paths: string[] -): MetadataType[] => { - if (!superstate.settings.experimental) return [];; - const properties: { [key: string]: string[] } = {}; - - for (const path of paths) { - const f = superstate.pathsIndex.get(path)?.metadata; - if (f) { - Object.keys(f).forEach((k) => { - const type = detectPropertyType(f[k], k); - if (type !='unknown' && type !='object') - properties[k] = [...(properties[k] ?? []), type]; - }); - } - } - return Object.keys(properties).reduce((p, c) => { - return [...p, { name: c, type: properties[c][0] }]; - }, [] as MetadataType[]); -}; export const allPropertiesForPaths = ( superstate: Superstate, paths: string[] -): MetadataType[] => { +): PropertyType[] => { const properties: { [key: string]: string[] } = {}; for (const path of paths) { - const f = superstate.pathsIndex.get(path)?.metadata?.properties; + const f = superstate.pathsIndex.get(path)?.metadata?.property; if (f) { Object.keys(f).forEach((k) => { properties[k] = [...(properties[k] ?? []), detectPropertyType(f[k], k)]; @@ -44,7 +23,7 @@ export const allPropertiesForPaths = ( } return Object.keys(properties).reduce((p, c) => { return [...p, { name: c, type: properties[c][0] }]; - }, [] as MetadataType[]); + }, [] as PropertyType[]); }; const metadatTypeFilterPredicate = (value: any, index: number, self: any[]) => {