handsontable
Version:
Handsontable is a JavaScript Data Grid available for React, Angular and Vue.
1,012 lines (973 loc) • 6 MB
JavaScript
/*!
* Copyright (c) HANDSONCODE sp. z o. o.
*
* HANDSONTABLE is a software distributed by HANDSONCODE sp. z o. o., a Polish corporation based in
* Gdynia, Poland, at Aleja Zwyciestwa 96-98, registered by the District Court in Gdansk under number
* 538651, EU tax ID number: PL5862294002, share capital: PLN 62,800.00.
*
* This software is protected by applicable copyright laws, including international treaties, and dual-
* licensed - depending on whether your use for commercial purposes, meaning intended for or
* resulting in commercial advantage or monetary compensation, or not.
*
* If your use is strictly personal or solely for evaluation purposes, meaning for the purposes of testing
* the suitability, performance, and usefulness of this software outside the production environment,
* you agree to be bound by the terms included in the "handsontable-non-commercial-license.pdf" file.
*
* Your use of this software for commercial purposes is subject to the terms included in an applicable
* license agreement.
*
* In any case, you must not make any such use of this software as to develop software which may be
* considered competitive with this software.
*
* UNLESS EXPRESSLY AGREED OTHERWISE, HANDSONCODE PROVIDES THIS SOFTWARE ON AN "AS IS"
* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, AND IN NO EVENT AND UNDER NO
* LEGAL THEORY, SHALL HANDSONCODE BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT,
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
* USE OR INABILITY TO USE THIS SOFTWARE.
*
* Version: 16.1.0
* Release date: 15/09/2025 (built at 15/09/2025 10:06:15)
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define("Handsontable", [], factory);
else if(typeof exports === 'object')
exports["Handsontable"] = factory();
else
root["Handsontable"] = factory();
})(typeof self !== 'undefined' ? self : this, () => {
return /******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ([
/* 0 */
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ AlwaysDense: () => (/* reexport safe */ _DependencyGraph_AddressMapping_ChooseAddressMappingPolicy_mjs__WEBPACK_IMPORTED_MODULE_4__.AlwaysDense),
/* harmony export */ AlwaysSparse: () => (/* reexport safe */ _DependencyGraph_AddressMapping_ChooseAddressMappingPolicy_mjs__WEBPACK_IMPORTED_MODULE_4__.AlwaysSparse),
/* harmony export */ ArraySize: () => (/* reexport safe */ _ArraySize_mjs__WEBPACK_IMPORTED_MODULE_0__.ArraySize),
/* harmony export */ CellError: () => (/* reexport safe */ _Cell_mjs__WEBPACK_IMPORTED_MODULE_1__.CellError),
/* harmony export */ CellType: () => (/* reexport safe */ _Cell_mjs__WEBPACK_IMPORTED_MODULE_1__.CellType),
/* harmony export */ CellValueDetailedType: () => (/* reexport safe */ _Cell_mjs__WEBPACK_IMPORTED_MODULE_1__.CellValueDetailedType),
/* harmony export */ CellValueType: () => (/* reexport safe */ _Cell_mjs__WEBPACK_IMPORTED_MODULE_1__.CellValueType),
/* harmony export */ ConfigValueTooBigError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.ConfigValueTooBigError),
/* harmony export */ ConfigValueTooSmallError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.ConfigValueTooSmallError),
/* harmony export */ DenseSparseChooseBasedOnThreshold: () => (/* reexport safe */ _DependencyGraph_AddressMapping_ChooseAddressMappingPolicy_mjs__WEBPACK_IMPORTED_MODULE_4__.DenseSparseChooseBasedOnThreshold),
/* harmony export */ DetailedCellError: () => (/* reexport safe */ _CellValue_mjs__WEBPACK_IMPORTED_MODULE_2__.DetailedCellError),
/* harmony export */ EmptyValue: () => (/* reexport safe */ _interpreter_index_mjs__WEBPACK_IMPORTED_MODULE_9__.EmptyValue),
/* harmony export */ ErrorType: () => (/* reexport safe */ _Cell_mjs__WEBPACK_IMPORTED_MODULE_1__.ErrorType),
/* harmony export */ EvaluationSuspendedError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.EvaluationSuspendedError),
/* harmony export */ ExpectedOneOfValuesError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.ExpectedOneOfValuesError),
/* harmony export */ ExpectedValueOfTypeError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.ExpectedValueOfTypeError),
/* harmony export */ ExportedCellChange: () => (/* reexport safe */ _Exporter_mjs__WEBPACK_IMPORTED_MODULE_6__.ExportedCellChange),
/* harmony export */ ExportedNamedExpressionChange: () => (/* reexport safe */ _Exporter_mjs__WEBPACK_IMPORTED_MODULE_6__.ExportedNamedExpressionChange),
/* harmony export */ FunctionArgumentType: () => (/* reexport safe */ _interpreter_index_mjs__WEBPACK_IMPORTED_MODULE_9__.FunctionArgumentType),
/* harmony export */ FunctionPlugin: () => (/* reexport safe */ _interpreter_index_mjs__WEBPACK_IMPORTED_MODULE_9__.FunctionPlugin),
/* harmony export */ FunctionPluginValidationError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.FunctionPluginValidationError),
/* harmony export */ HyperFormula: () => (/* reexport safe */ _HyperFormula_mjs__WEBPACK_IMPORTED_MODULE_7__.HyperFormula),
/* harmony export */ InvalidAddressError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.InvalidAddressError),
/* harmony export */ InvalidArgumentsError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.InvalidArgumentsError),
/* harmony export */ LanguageAlreadyRegisteredError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.LanguageAlreadyRegisteredError),
/* harmony export */ LanguageNotRegisteredError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.LanguageNotRegisteredError),
/* harmony export */ MissingTranslationError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.MissingTranslationError),
/* harmony export */ NamedExpressionDoesNotExistError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NamedExpressionDoesNotExistError),
/* harmony export */ NamedExpressionNameIsAlreadyTakenError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NamedExpressionNameIsAlreadyTakenError),
/* harmony export */ NamedExpressionNameIsInvalidError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NamedExpressionNameIsInvalidError),
/* harmony export */ NoOperationToRedoError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NoOperationToRedoError),
/* harmony export */ NoOperationToUndoError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NoOperationToUndoError),
/* harmony export */ NoRelativeAddressesAllowedError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NoRelativeAddressesAllowedError),
/* harmony export */ NoSheetWithIdError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NoSheetWithIdError),
/* harmony export */ NoSheetWithNameError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NoSheetWithNameError),
/* harmony export */ NotAFormulaError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NotAFormulaError),
/* harmony export */ NothingToPasteError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NothingToPasteError),
/* harmony export */ ProtectedFunctionTranslationError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.ProtectedFunctionTranslationError),
/* harmony export */ SheetNameAlreadyTakenError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.SheetNameAlreadyTakenError),
/* harmony export */ SheetSizeLimitExceededError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.SheetSizeLimitExceededError),
/* harmony export */ SimpleRangeValue: () => (/* reexport safe */ _SimpleRangeValue_mjs__WEBPACK_IMPORTED_MODULE_11__.SimpleRangeValue),
/* harmony export */ SourceLocationHasArrayError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.SourceLocationHasArrayError),
/* harmony export */ TargetLocationHasArrayError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.TargetLocationHasArrayError),
/* harmony export */ UnableToParseError: () => (/* reexport safe */ _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.UnableToParseError),
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _ArraySize_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
/* harmony import */ var _Cell_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
/* harmony import */ var _CellValue_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(100);
/* harmony import */ var _Config_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(101);
/* harmony import */ var _DependencyGraph_AddressMapping_ChooseAddressMappingPolicy_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(105);
/* harmony import */ var _errors_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(77);
/* harmony import */ var _Exporter_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(128);
/* harmony import */ var _HyperFormula_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(110);
/* harmony import */ var _i18n_languages_enGB_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(146);
/* harmony import */ var _interpreter_index_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(96);
/* harmony import */ var _interpreter_plugin_index_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(147);
/* harmony import */ var _SimpleRangeValue_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(69);
/* harmony import */ var hyperformula__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(0);
/**
* @license
* Copyright (c) 2025 Handsoncode. All rights reserved.
*/
/**
* Aggregate class for default export
*/
class HyperFormulaNS extends _HyperFormula_mjs__WEBPACK_IMPORTED_MODULE_7__.HyperFormula {}
HyperFormulaNS.HyperFormula = _HyperFormula_mjs__WEBPACK_IMPORTED_MODULE_7__.HyperFormula;
HyperFormulaNS.ErrorType = _Cell_mjs__WEBPACK_IMPORTED_MODULE_1__.ErrorType;
HyperFormulaNS.CellError = _Cell_mjs__WEBPACK_IMPORTED_MODULE_1__.CellError;
HyperFormulaNS.CellType = _Cell_mjs__WEBPACK_IMPORTED_MODULE_1__.CellType;
HyperFormulaNS.CellValueType = _Cell_mjs__WEBPACK_IMPORTED_MODULE_1__.CellValueType;
HyperFormulaNS.CellValueDetailedType = _Cell_mjs__WEBPACK_IMPORTED_MODULE_1__.CellValueDetailedType;
HyperFormulaNS.DetailedCellError = _CellValue_mjs__WEBPACK_IMPORTED_MODULE_2__.DetailedCellError;
HyperFormulaNS.ExportedCellChange = _Exporter_mjs__WEBPACK_IMPORTED_MODULE_6__.ExportedCellChange;
HyperFormulaNS.ExportedNamedExpressionChange = _Exporter_mjs__WEBPACK_IMPORTED_MODULE_6__.ExportedNamedExpressionChange;
HyperFormulaNS.ConfigValueTooBigError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.ConfigValueTooBigError;
HyperFormulaNS.ConfigValueTooSmallError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.ConfigValueTooSmallError;
HyperFormulaNS.EvaluationSuspendedError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.EvaluationSuspendedError;
HyperFormulaNS.ExpectedOneOfValuesError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.ExpectedOneOfValuesError;
HyperFormulaNS.ExpectedValueOfTypeError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.ExpectedValueOfTypeError;
HyperFormulaNS.ArraySize = _ArraySize_mjs__WEBPACK_IMPORTED_MODULE_0__.ArraySize;
HyperFormulaNS.SimpleRangeValue = _SimpleRangeValue_mjs__WEBPACK_IMPORTED_MODULE_11__.SimpleRangeValue;
HyperFormulaNS.EmptyValue = _interpreter_index_mjs__WEBPACK_IMPORTED_MODULE_9__.EmptyValue;
HyperFormulaNS.FunctionPlugin = _interpreter_index_mjs__WEBPACK_IMPORTED_MODULE_9__.FunctionPlugin;
HyperFormulaNS.FunctionArgumentType = _interpreter_index_mjs__WEBPACK_IMPORTED_MODULE_9__.FunctionArgumentType;
HyperFormulaNS.FunctionPluginValidationError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.FunctionPluginValidationError;
HyperFormulaNS.InvalidAddressError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.InvalidAddressError;
HyperFormulaNS.InvalidArgumentsError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.InvalidArgumentsError;
HyperFormulaNS.LanguageNotRegisteredError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.LanguageNotRegisteredError;
HyperFormulaNS.LanguageAlreadyRegisteredError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.LanguageAlreadyRegisteredError;
HyperFormulaNS.MissingTranslationError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.MissingTranslationError;
HyperFormulaNS.NamedExpressionDoesNotExistError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NamedExpressionDoesNotExistError;
HyperFormulaNS.NamedExpressionNameIsAlreadyTakenError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NamedExpressionNameIsAlreadyTakenError;
HyperFormulaNS.NamedExpressionNameIsInvalidError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NamedExpressionNameIsInvalidError;
HyperFormulaNS.NoOperationToRedoError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NoOperationToRedoError;
HyperFormulaNS.NoOperationToUndoError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NoOperationToUndoError;
HyperFormulaNS.NoRelativeAddressesAllowedError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NoRelativeAddressesAllowedError;
HyperFormulaNS.NoSheetWithIdError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NoSheetWithIdError;
HyperFormulaNS.NoSheetWithNameError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NoSheetWithNameError;
HyperFormulaNS.NotAFormulaError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NotAFormulaError;
HyperFormulaNS.NothingToPasteError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.NothingToPasteError;
HyperFormulaNS.ProtectedFunctionTranslationError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.ProtectedFunctionTranslationError;
HyperFormulaNS.SheetNameAlreadyTakenError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.SheetNameAlreadyTakenError;
HyperFormulaNS.SheetSizeLimitExceededError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.SheetSizeLimitExceededError;
HyperFormulaNS.SourceLocationHasArrayError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.SourceLocationHasArrayError;
HyperFormulaNS.TargetLocationHasArrayError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.TargetLocationHasArrayError;
HyperFormulaNS.UnableToParseError = _errors_mjs__WEBPACK_IMPORTED_MODULE_5__.UnableToParseError;
const defaultLanguage = _Config_mjs__WEBPACK_IMPORTED_MODULE_3__.Config.defaultConfig.language;
_HyperFormula_mjs__WEBPACK_IMPORTED_MODULE_7__.HyperFormula.registerLanguage(defaultLanguage, _i18n_languages_enGB_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]);
_HyperFormula_mjs__WEBPACK_IMPORTED_MODULE_7__.HyperFormula.languages[_i18n_languages_enGB_mjs__WEBPACK_IMPORTED_MODULE_8__["default"].langCode] = _i18n_languages_enGB_mjs__WEBPACK_IMPORTED_MODULE_8__["default"];
for (const pluginName of Object.getOwnPropertyNames(_interpreter_plugin_index_mjs__WEBPACK_IMPORTED_MODULE_10__)) {
if (!pluginName.startsWith('_')) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
_HyperFormula_mjs__WEBPACK_IMPORTED_MODULE_7__.HyperFormula.registerFunctionPlugin(_interpreter_plugin_index_mjs__WEBPACK_IMPORTED_MODULE_10__[pluginName]);
}
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HyperFormulaNS);
/*** EXPORTS FROM exports-to-window-loader-esm ***/
window['HyperFormula'] = hyperformula__WEBPACK_IMPORTED_MODULE_12__.HyperFormula;
/***/ }),
/* 1 */
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ ArraySize: () => (/* binding */ ArraySize),
/* harmony export */ ArraySizePredictor: () => (/* binding */ ArraySizePredictor)
/* harmony export */ });
/* harmony import */ var _AbsoluteCellRange_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
/* harmony import */ var _interpreter_InterpreterState_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95);
/* harmony import */ var _interpreter_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96);
/* harmony import */ var _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
/**
* @license
* Copyright (c) 2025 Handsoncode. All rights reserved.
*/
class ArraySize {
constructor(width, height, isRef = false) {
this.width = width;
this.height = height;
this.isRef = isRef;
}
static error() {
return new ArraySize(1, 1, true);
}
static scalar() {
return new ArraySize(1, 1, false);
}
isScalar() {
return this.width === 1 && this.height === 1 || this.isRef;
}
}
function arraySizeForBinaryOp(leftArraySize, rightArraySize) {
return new ArraySize(Math.max(leftArraySize.width, rightArraySize.width), Math.max(leftArraySize.height, rightArraySize.height));
}
function arraySizeForUnaryOp(arraySize) {
return new ArraySize(arraySize.width, arraySize.height);
}
class ArraySizePredictor {
constructor(config, functionRegistry) {
this.config = config;
this.functionRegistry = functionRegistry;
}
checkArraySize(ast, formulaAddress) {
return this.checkArraySizeForAst(ast, {
formulaAddress,
arraysFlag: this.config.useArrayArithmetic
});
}
checkArraySizeForAst(ast, state) {
switch (ast.type) {
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.FUNCTION_CALL:
{
return this.checkArraySizeForFunction(ast, state);
}
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.COLUMN_RANGE:
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.ROW_RANGE:
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.CELL_RANGE:
{
const range = _AbsoluteCellRange_mjs__WEBPACK_IMPORTED_MODULE_0__.AbsoluteCellRange.fromAstOrUndef(ast, state.formulaAddress);
if (range === undefined) {
return ArraySize.error();
} else {
return new ArraySize(range.width(), range.height(), true);
}
}
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.ARRAY:
{
const heights = [];
const widths = [];
for (const row of ast.args) {
const sizes = row.map(ast => this.checkArraySizeForAst(ast, state));
const h = Math.min(...sizes.map(size => size.height));
const w = sizes.reduce((total, size) => total + size.width, 0);
heights.push(h);
widths.push(w);
}
const height = heights.reduce((total, h) => total + h, 0);
const width = Math.min(...widths);
return new ArraySize(width, height);
}
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.STRING:
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.NUMBER:
return ArraySize.scalar();
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.CELL_REFERENCE:
return new ArraySize(1, 1, true);
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.DIV_OP:
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.CONCATENATE_OP:
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.EQUALS_OP:
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.GREATER_THAN_OP:
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.GREATER_THAN_OR_EQUAL_OP:
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.LESS_THAN_OP:
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.LESS_THAN_OR_EQUAL_OP:
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.MINUS_OP:
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.NOT_EQUAL_OP:
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.PLUS_OP:
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.POWER_OP:
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.TIMES_OP:
{
const left = this.checkArraySizeForAst(ast.left, state);
const right = this.checkArraySizeForAst(ast.right, state);
if (!state.arraysFlag && (left.height > 1 || left.width > 1 || right.height > 1 || right.width > 1)) {
return ArraySize.error();
}
return arraySizeForBinaryOp(left, right);
}
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.MINUS_UNARY_OP:
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.PLUS_UNARY_OP:
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.PERCENT_OP:
{
const val = this.checkArraySizeForAst(ast.value, state);
if (!state.arraysFlag && (val.height > 1 || val.width > 1)) {
return ArraySize.error();
}
return arraySizeForUnaryOp(val);
}
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.PARENTHESIS:
{
return this.checkArraySizeForAst(ast.expression, state);
}
case _parser_index_mjs__WEBPACK_IMPORTED_MODULE_3__.AstNodeType.EMPTY:
return ArraySize.error();
default:
return ArraySize.error();
}
}
checkArraySizeForFunction(ast, state) {
const pluginArraySizeFunction = this.functionRegistry.getArraySizeFunction(ast.procedureName);
if (pluginArraySizeFunction !== undefined) {
return pluginArraySizeFunction(ast, state);
}
const metadata = this.functionRegistry.getMetadata(ast.procedureName);
if (metadata === undefined || metadata.expandRanges || !state.arraysFlag || metadata.vectorizationForbidden || metadata.parameters === undefined) {
return new ArraySize(1, 1);
}
const subChecks = ast.args.map(arg => {
var _a;
return this.checkArraySizeForAst(arg, new _interpreter_InterpreterState_mjs__WEBPACK_IMPORTED_MODULE_1__.InterpreterState(state.formulaAddress, state.arraysFlag || ((_a = metadata === null || metadata === void 0 ? void 0 : metadata.arrayFunction) !== null && _a !== void 0 ? _a : false)));
});
const argumentDefinitions = [...metadata.parameters];
if (metadata.repeatLastArgs !== undefined && argumentDefinitions.length < subChecks.length && (subChecks.length - argumentDefinitions.length) % metadata.repeatLastArgs !== 0) {
return ArraySize.error();
}
while (argumentDefinitions.length < subChecks.length) {
if (metadata.repeatLastArgs === undefined) {
return ArraySize.error();
}
argumentDefinitions.push(...argumentDefinitions.slice(argumentDefinitions.length - metadata.repeatLastArgs));
}
let maxWidth = 1;
let maxHeight = 1;
for (let i = 0; i < subChecks.length; i++) {
if (argumentDefinitions[i].argumentType !== _interpreter_index_mjs__WEBPACK_IMPORTED_MODULE_2__.FunctionArgumentType.RANGE && argumentDefinitions[i].argumentType !== _interpreter_index_mjs__WEBPACK_IMPORTED_MODULE_2__.FunctionArgumentType.ANY) {
maxHeight = Math.max(maxHeight, subChecks[i].height);
maxWidth = Math.max(maxWidth, subChecks[i].width);
}
}
return new ArraySize(maxWidth, maxHeight);
}
}
/***/ }),
/* 2 */
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ AbsoluteCellRange: () => (/* binding */ AbsoluteCellRange),
/* harmony export */ AbsoluteColumnRange: () => (/* binding */ AbsoluteColumnRange),
/* harmony export */ AbsoluteRowRange: () => (/* binding */ AbsoluteRowRange),
/* harmony export */ WRONG_RANGE_SIZE: () => (/* binding */ WRONG_RANGE_SIZE),
/* harmony export */ isSimpleCellRange: () => (/* binding */ isSimpleCellRange),
/* harmony export */ simpleCellRange: () => (/* binding */ simpleCellRange)
/* harmony export */ });
/* harmony import */ var _Cell_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
/* harmony import */ var _errors_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(77);
/* harmony import */ var _parser_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
/* harmony import */ var _Span_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71);
/**
* @license
* Copyright (c) 2025 Handsoncode. All rights reserved.
*/
const WRONG_RANGE_SIZE = 'AbsoluteCellRange: Wrong range size';
function isSimpleCellRange(obj) {
if (obj && (typeof obj === 'object' || typeof obj === 'function')) {
return 'start' in obj && (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.isSimpleCellAddress)(obj.start) && 'end' in obj && (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.isSimpleCellAddress)(obj.end);
} else {
return false;
}
}
const simpleCellRange = (start, end) => ({
start,
end
});
class AbsoluteCellRange {
constructor(start, end) {
if (start.sheet !== end.sheet) {
throw new _errors_mjs__WEBPACK_IMPORTED_MODULE_1__.SheetsNotEqual(start.sheet, end.sheet);
}
this.start = (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(start.sheet, start.col, start.row);
this.end = (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(end.sheet, end.col, end.row);
}
get sheet() {
return this.start.sheet;
}
static fromSimpleCellAddresses(start, end) {
if (start.sheet !== end.sheet) {
throw new _errors_mjs__WEBPACK_IMPORTED_MODULE_1__.SheetsNotEqual(start.sheet, end.sheet);
}
const width = end.col - start.col;
const height = end.row - start.row;
if (Number.isFinite(height) && Number.isFinite(width)) {
return new AbsoluteCellRange(start, end);
}
if (Number.isFinite(height)) {
return new AbsoluteRowRange(start.sheet, start.row, end.row);
}
return new AbsoluteColumnRange(start.sheet, start.col, end.col);
}
static fromAst(ast, baseAddress) {
if (ast.type === _parser_index_mjs__WEBPACK_IMPORTED_MODULE_2__.AstNodeType.CELL_RANGE) {
return AbsoluteCellRange.fromCellRange(ast, baseAddress);
} else if (ast.type === _parser_index_mjs__WEBPACK_IMPORTED_MODULE_2__.AstNodeType.COLUMN_RANGE) {
return AbsoluteColumnRange.fromColumnRange(ast, baseAddress);
} else {
return AbsoluteRowRange.fromRowRangeAst(ast, baseAddress);
}
}
static fromAstOrUndef(ast, baseAddress) {
try {
return AbsoluteCellRange.fromAst(ast, baseAddress);
} catch (_e) {
return undefined;
}
}
static fromCellRange(x, baseAddress) {
return new AbsoluteCellRange(x.start.toSimpleCellAddress(baseAddress), x.end.toSimpleCellAddress(baseAddress));
}
static spanFrom(topLeftCorner, width, height) {
const ret = AbsoluteCellRange.spanFromOrUndef(topLeftCorner, width, height);
if (ret === undefined) {
throw new Error(WRONG_RANGE_SIZE);
}
return ret;
}
static spanFromOrUndef(topLeftCorner, width, height) {
if (!Number.isFinite(width) && Number.isFinite(height)) {
if (topLeftCorner.col !== 0) {
return undefined;
}
return new AbsoluteRowRange(topLeftCorner.sheet, topLeftCorner.row, topLeftCorner.row + height - 1);
} else if (!Number.isFinite(height) && Number.isFinite(width)) {
if (topLeftCorner.row !== 0) {
return undefined;
}
return new AbsoluteColumnRange(topLeftCorner.sheet, topLeftCorner.col, topLeftCorner.col + width - 1);
} else if (Number.isFinite(height) && Number.isFinite(width)) {
return new AbsoluteCellRange(topLeftCorner, (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(topLeftCorner.sheet, topLeftCorner.col + width - 1, topLeftCorner.row + height - 1));
}
return undefined;
}
static fromCoordinates(sheet, x1, y1, x2, y2) {
return new AbsoluteCellRange((0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(sheet, x1, y1), (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(sheet, x2, y2));
}
isFinite() {
return Number.isFinite(this.size());
}
doesOverlap(other) {
if (this.start.sheet != other.start.sheet) {
return false;
}
if (this.end.row < other.start.row || this.start.row > other.end.row) {
return false;
}
if (this.end.col < other.start.col || this.start.col > other.end.col) {
return false;
}
return true;
}
addressInRange(address) {
if (this.sheet !== address.sheet) {
return false;
}
return this.start.row <= address.row && this.end.row >= address.row && this.start.col <= address.col && this.end.col >= address.col;
}
columnInRange(address) {
if (this.sheet !== address.sheet) {
return false;
}
return this.start.col <= address.col && this.end.col >= address.col;
}
rowInRange(address) {
if (this.sheet !== address.sheet) {
return false;
}
return this.start.row <= address.row && this.end.row >= address.row;
}
containsRange(range) {
return this.addressInRange(range.start) && this.addressInRange(range.end);
}
intersectionWith(other) {
if (this.sheet !== other.start.sheet) {
return undefined;
}
const startRow = Math.max(this.start.row, other.start.row);
const endRow = Math.min(this.end.row, other.end.row);
const startCol = Math.max(this.start.col, other.start.col);
const endCol = Math.min(this.end.col, other.end.col);
if (startRow > endRow || startCol > endCol) {
return undefined;
}
return new AbsoluteCellRange((0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(this.sheet, startCol, startRow), (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(this.sheet, endCol, endRow));
}
includesRow(row) {
return this.start.row < row && this.end.row >= row;
}
includesColumn(column) {
return this.start.col < column && this.end.col >= column;
}
shiftByRows(numberOfRows) {
this.start.row += numberOfRows;
this.end.row += numberOfRows;
}
expandByRows(numberOfRows) {
this.end.row += numberOfRows;
}
shiftByColumns(numberOfColumns) {
this.start.col += numberOfColumns;
this.end.col += numberOfColumns;
}
shifted(byCols, byRows) {
return AbsoluteCellRange.spanFrom((0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(this.sheet, this.start.col + byCols, this.start.row + byRows), this.width(), this.height());
}
expandByColumns(numberOfColumns) {
this.end.col += numberOfColumns;
}
moveToSheet(toSheet) {
this.start.sheet = toSheet;
this.end.sheet = toSheet;
}
removeSpan(span) {
if (span instanceof _Span_mjs__WEBPACK_IMPORTED_MODULE_3__.RowsSpan) {
this.removeRows(span.start, span.end);
} else {
this.removeColumns(span.start, span.end);
}
}
shouldBeRemoved() {
return this.width() <= 0 || this.height() <= 0;
}
rangeWithSameWidth(startRow, numberOfRows) {
return AbsoluteCellRange.spanFrom((0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(this.sheet, this.start.col, startRow), this.width(), numberOfRows);
}
rangeWithSameHeight(startColumn, numberOfColumns) {
return AbsoluteCellRange.spanFrom((0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(this.sheet, startColumn, this.start.row), numberOfColumns, this.height());
}
toString() {
return `${this.start.sheet},${this.start.col},${this.start.row},${this.end.col},${this.end.row}`;
}
width() {
return this.end.col - this.start.col + 1;
}
height() {
return this.end.row - this.start.row + 1;
}
size() {
return this.height() * this.width();
}
arrayOfAddressesInRange() {
const result = [];
for (let y = 0; y < this.height(); ++y) {
result[y] = [];
for (let x = 0; x < this.width(); ++x) {
const value = (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(this.sheet, this.start.col + x, this.start.row + y);
result[y].push(value);
}
}
return result;
}
withStart(newStart) {
return new AbsoluteCellRange(newStart, this.end);
}
sameDimensionsAs(other) {
return this.width() === other.width() && this.height() === other.height();
}
sameAs(other) {
return (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.equalSimpleCellAddress)(this.start, other.start) && (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.equalSimpleCellAddress)(this.end, other.end);
}
addressesArrayMap(dependencyGraph, op) {
const ret = [];
let currentRow = this.start.row;
while (currentRow <= this.effectiveEndRow(dependencyGraph)) {
let currentColumn = this.start.col;
const tmp = [];
while (currentColumn <= this.effectiveEndColumn(dependencyGraph)) {
tmp.push(op((0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(this.start.sheet, currentColumn, currentRow)));
currentColumn++;
}
ret.push(tmp);
currentRow++;
}
return ret;
}
addresses(dependencyGraph) {
const ret = [];
let currentRow = this.start.row;
const limitRow = this.effectiveEndRow(dependencyGraph);
const limitColumn = this.effectiveEndColumn(dependencyGraph);
while (currentRow <= limitRow) {
let currentColumn = this.start.col;
while (currentColumn <= limitColumn) {
ret.push((0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(this.start.sheet, currentColumn, currentRow));
currentColumn++;
}
currentRow++;
}
return ret;
}
*addressesWithDirection(right, bottom, dependencyGraph) {
if (right > 0) {
if (bottom > 0) {
let currentRow = this.effectiveEndRow(dependencyGraph);
while (currentRow >= this.start.row) {
let currentColumn = this.effectiveEndColumn(dependencyGraph);
while (currentColumn >= this.start.col) {
yield (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(this.start.sheet, currentColumn, currentRow);
currentColumn -= 1;
}
currentRow -= 1;
}
} else {
let currentRow = this.start.row;
while (currentRow <= this.effectiveEndRow(dependencyGraph)) {
let currentColumn = this.effectiveEndColumn(dependencyGraph);
while (currentColumn >= this.start.col) {
yield (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(this.start.sheet, currentColumn, currentRow);
currentColumn -= 1;
}
currentRow += 1;
}
}
} else {
if (bottom > 0) {
let currentRow = this.effectiveEndRow(dependencyGraph);
while (currentRow >= this.start.row) {
let currentColumn = this.start.col;
while (currentColumn <= this.effectiveEndColumn(dependencyGraph)) {
yield (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(this.start.sheet, currentColumn, currentRow);
currentColumn += 1;
}
currentRow -= 1;
}
} else {
let currentRow = this.start.row;
while (currentRow <= this.effectiveEndRow(dependencyGraph)) {
let currentColumn = this.start.col;
while (currentColumn <= this.effectiveEndColumn(dependencyGraph)) {
yield (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(this.start.sheet, currentColumn, currentRow);
currentColumn += 1;
}
currentRow += 1;
}
}
}
}
getAddress(col, row) {
if (col < 0 || row < 0 || row > this.height() - 1 || col > this.width() - 1) {
throw Error('Index out of bound');
}
return (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(this.start.sheet, this.start.col + col, this.start.row + row);
}
exceedsSheetSizeLimits(maxColumns, maxRows) {
return this.end.col >= maxColumns || this.end.row >= maxRows;
}
effectiveEndColumn(_dependencyGraph) {
return this.end.col;
}
effectiveEndRow(_dependencyGraph) {
return this.end.row;
}
effectiveWidth(_dependencyGraph) {
return this.width();
}
effectiveHeight(_dependencyGraph) {
return this.height();
}
removeRows(rowStart, rowEnd) {
if (rowStart > this.end.row) {
return;
}
if (rowEnd < this.start.row) {
const numberOfRows = rowEnd - rowStart + 1;
return this.shiftByRows(-numberOfRows);
}
if (rowStart <= this.start.row) {
this.start.row = rowStart;
}
this.end.row -= Math.min(rowEnd, this.end.row) - rowStart + 1;
}
removeColumns(columnStart, columnEnd) {
if (columnStart > this.end.col) {
return;
}
if (columnEnd < this.start.col) {
const numberOfColumns = columnEnd - columnStart + 1;
return this.shiftByColumns(-numberOfColumns);
}
if (columnStart <= this.start.col) {
this.start.col = columnStart;
}
this.end.col -= Math.min(columnEnd, this.end.col) - columnStart + 1;
}
}
class AbsoluteColumnRange extends AbsoluteCellRange {
constructor(sheet, columnStart, columnEnd) {
super((0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(sheet, columnStart, 0), (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(sheet, columnEnd, Number.POSITIVE_INFINITY));
}
static fromColumnRange(x, baseAddress) {
const start = x.start.toSimpleColumnAddress(baseAddress);
const end = x.end.toSimpleColumnAddress(baseAddress);
if (start.sheet !== end.sheet) {
throw new _errors_mjs__WEBPACK_IMPORTED_MODULE_1__.SheetsNotEqual(start.sheet, end.sheet);
}
return new AbsoluteColumnRange(start.sheet, start.col, end.col);
}
shouldBeRemoved() {
return this.width() <= 0;
}
shiftByRows(_numberOfRows) {
return;
}
expandByRows(_numberOfRows) {
return;
}
shifted(byCols, _byRows) {
return new AbsoluteColumnRange(this.sheet, this.start.col + byCols, this.end.col + byCols);
}
rangeWithSameHeight(startColumn, numberOfColumns) {
return new AbsoluteColumnRange(this.sheet, startColumn, startColumn + numberOfColumns - 1);
}
exceedsSheetSizeLimits(maxColumns, _maxRows) {
return this.end.col >= maxColumns;
}
effectiveEndRow(dependencyGraph) {
return this.effectiveHeight(dependencyGraph) - 1;
}
effectiveHeight(dependencyGraph) {
return dependencyGraph.getSheetHeight(this.sheet);
}
removeRows(_rowStart, _rowEnd) {
return;
}
}
class AbsoluteRowRange extends AbsoluteCellRange {
constructor(sheet, rowStart, rowEnd) {
super((0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(sheet, 0, rowStart), (0,_Cell_mjs__WEBPACK_IMPORTED_MODULE_0__.simpleCellAddress)(sheet, Number.POSITIVE_INFINITY, rowEnd));
}
static fromRowRangeAst(x, baseAddress) {
const start = x.start.toSimpleRowAddress(baseAddress);
const end = x.end.toSimpleRowAddress(baseAddress);
if (start.sheet !== end.sheet) {
throw new _errors_mjs__WEBPACK_IMPORTED_MODULE_1__.SheetsNotEqual(start.sheet, end.sheet);
}
return new AbsoluteRowRange(start.sheet, start.row, end.row);
}
shouldBeRemoved() {
return this.height() <= 0;
}
shiftByColumns(_numberOfColumns) {
return;
}
expandByColumns(_numberOfColumns) {
return;
}
shifted(byCols, byRows) {
return new AbsoluteRowRange(this.sheet, this.start.row + byRows, this.end.row + byRows);
}
rangeWithSameWidth(startRow, numberOfRows) {
return new AbsoluteRowRange(this.sheet, startRow, startRow + numberOfRows - 1);
}
exceedsSheetSizeLimits(_maxColumns, maxRows) {
return this.end.row >= maxRows;
}
effectiveEndColumn(dependencyGraph) {
return this.effectiveWidth(dependencyGraph) - 1;
}
effectiveWidth(dependencyGraph) {
return dependencyGraph.getSheetWidth(this.sheet);
}
removeColumns(_columnStart, _columnEnd) {
return;
}
}
/***/ }),
/* 3 */
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ CellError: () => (/* binding */ CellError),
/* harmony export */ CellType: () => (/* binding */ CellType),
/* harmony export */ CellValueDetailedType: () => (/* binding */ CellValueDetailedType),
/* harmony export */ CellValueJustNumber: () => (/* binding */ CellValueJustNumber),
/* harmony export */ CellValueNoNumber: () => (/* binding */ CellValueNoNumber),
/* harmony export */ CellValueType: () => (/* binding */ CellValueType),
/* harmony export */ CellValueTypeOrd: () => (/* binding */ CellValueTypeOrd),
/* harmony export */ ErrorType: () => (/* binding */ ErrorType),
/* harmony export */ absoluteSheetReference: () => (/* binding */ absoluteSheetReference),
/* harmony export */ addressKey: () => (/* binding */ addressKey),
/* harmony export */ equalSimpleCellAddress: () => (/* binding */ equalSimpleCellAddress),
/* harmony export */ getCellType: () => (/* binding */ getCellType),
/* harmony export */ getCellValueDetailedType: () => (/* binding */ getCellValueDetailedType),
/* harmony export */ getCellValueFormat: () => (/* binding */ getCellValueFormat),
/* harmony export */ getCellValueType: () => (/* binding */ getCellValueType),
/* harmony export */ invalidSimpleCellAddress: () => (/* binding */ invalidSimpleCellAddress),
/* harmony export */ invalidSimpleColumnAddress: () => (/* binding */ invalidSimpleColumnAddress),
/* harmony export */ invalidSimpleRowAddress: () => (/* binding */ invalidSimpleRowAddress),
/* harmony export */ isSimpleCellAddress: () => (/* binding */ isSimpleCellAddress),
/* harmony export */ movedSimpleCellAddress: () => (/* binding */ movedSimpleCellAddress),
/* harmony export */ simpleCellAddress: () => (/* binding */ simpleCellAddress),
/* harmony export */ simpleColumnAddress: () => (/* binding */ simpleColumnAddress),
/* harmony export */ simpleRowAddress: () => (/* binding */ simpleRowAddress)
/* harmony export */ });
/* harmony import */ var _DependencyGraph_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
/* harmony import */ var _error_message_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61);
/* harmony import */ var _interpreter_InterpreterValue_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70);
/* harmony import */ var _SimpleRangeValue_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(69);
/**
* @license
* Copyright (c) 2025 Handsoncode. All rights reserved.
*/
/**
* Possible errors returned by our interpreter.
*/
var ErrorType;
(function (ErrorType) {
/** Division by zero. */
ErrorType["DIV_BY_ZERO"] = "DIV_BY_ZERO";
/** Unknown function name. */
ErrorType["NAME"] = "NAME";
ErrorType["VALUE"] = "VALUE";
ErrorType["NUM"] = "NUM";
ErrorType["NA"] = "NA";
/** Cyclic dependency. */
ErrorType["CYCLE"] = "CYCLE";
/** Wrong address reference. */
ErrorType["REF"] = "REF";
/** Array spill error. */
ErrorType["SPILL"] = "SPILL";
/** Invalid/missing licence error. */
ErrorType["LIC"] = "LIC";
/** Generic error */
ErrorType["ERROR"] = "ERROR";
})(ErrorType || (ErrorType = {}));
var CellType;
(function (CellType) {
CellType["FORMULA"] = "FORMULA";
CellType["VALUE"] = "VALUE";
CellType["ARRAY"] = "ARRAY";
CellType["EMPTY"] = "EMPTY";
CellType["ARRAYFORMULA"] = "ARRAYFORMULA";
})(CellType || (CellType = {}));
const getCellType = (vertex, address) => {
if (vertex instanceof _DependencyGraph_index_mjs__WEBPACK_IMPORTED_MODULE_0__.ArrayVertex) {
if (vertex.isLeftCorner(address)) {
return CellType.ARRAYFORMULA;
} else {
return CellType.ARRAY;
}
}
if (vertex instanceof _DependencyGraph_index_mjs__WEBPACK_IMPORTED_MODULE_0__.FormulaCellVertex || vertex instanceof _DependencyGraph_index_mjs__WEBPACK_IMPORTED_MODULE_0__.ParsingErrorVertex) {
return CellType.FORMULA;
}
if (vertex instanceof _DependencyGraph_index_mjs__WEBPACK_IMPORTED_MODULE_0__.ValueCellVertex) {
return CellType.VALUE;
}
return CellType.EMPTY;
};
var CellValueNoNumber;
(function (CellValueNoNumber) {
CellValueNoNumber["EMPTY"] = "EMPTY";
CellValueNoNumber["NUMBER"] = "NUMBER";
CellValueNoNumber["STRING"] = "STRING";
CellValueNoNumber["BOOLEAN"] = "BOOLEAN";
CellValueNoNumber["ERROR"] = "ERROR";
})(CellValueNoNumber || (CellValueNoNumber = {}));
var CellValueJustNumber;
(function (CellValueJustNumber) {
CellValueJustNumber["NUMBER"] = "NUMBER";
})(CellValueJustNumber || (CellValueJustNumber = {}));
const CellValueType = Object.assign(Object.assign({}, CellValueNoNumber), CellValueJustNumber);
const CellValueDetailedType = Object.assign(Object.assign({}, CellValueNoNumber), _interpreter_InterpreterValue_mjs__WEBPACK_IMPORTED_MODULE_2__.NumberType);
const CellValueTypeOrd = arg => {
switch (arg) {
case CellValueType.EMPTY:
return 0;
case CellValueType.NUMBER:
return 1;
case CellValueType.STRING:
return 2;
case CellValueType.BOOLEAN:
return 3;
case CellValueType.ERROR:
return 4;
}
throw new Error('Cell value not computed');
};
const getCellValueType = cellValue => {
if (cellValue === _interpreter_InterpreterValue_mjs__WEBPACK_IMPORTED_MODULE_2__.EmptyValue) {
return CellValueType.EMPTY;
}
if (cellValue instanceof CellError || cellValue instanceof _SimpleRangeValue_mjs__WEBPACK_IMPORTED_MODULE_3__.SimpleRangeValue) {
return CellValueType.ERROR;
}
if (typeof cellValue === 'string') {
return CellValueType.STRING;
} else if ((0,_interpreter_InterpreterValue_mjs__WEBPACK_IMPORTED_MODULE_2__.isExtendedNumber)(cellValue)) {
return CellValueType.NUMBER;
} else if (typeof cellValue === 'boolean') {
return CellValueType.BOOLEAN;
}
throw new Error('Cell value not computed');
};
const getCellValueDetailedType = cellValue => {
if ((0,_interpreter_InterpreterValue_mjs__WEBPACK_IMPORTED_MODULE_2__.isExtendedNumber)(cellValue)) {
return (0,_interpreter_InterpreterValue_mjs__WEBPACK_IMPORTED_MODULE_2__.getTypeOfExtendedNumber)(cellValue);
} else {
return getCellValueType(cellValue);
}
};
const getCellValueFormat = cellValue => {
if ((0,_interpreter_InterpreterValue_mjs__WEBPACK_IMPORTED_MODULE_2__.isExtendedNumber)(cellValue)) {
return (0,_interpreter_InterpreterValue_mjs__WEBPACK_IMPORTED_MODULE_2__.getFormatOfExtendedNumber)(cellValue);
} else {
return undefined;
}
};
class CellError {
constructor(type, message, root) {
this.type = type;
this.message = message;
this.root = root;
}
/**
* Returns a CellError with a given message.
* @param {string} detailedMessage - message to be displayed
*/
static parsingError(detailedMessage) {
return new CellError(ErrorType.ERROR, `${_error_message_mjs__WEBPACK_IMPORTED_MODULE_1__.ErrorMessage.ParseError}${detailedMessage ? ' ' + detailedMessage : ''}`);
}
attachRootVertex(vertex) {
if (this.root === undefined) {
return new CellError(this.type, this.message, vertex);
} else {
return this;
}
}
}
const simpleRowAddress = (sheet, row) => ({
sheet,
row
});
const invalidSimpleRowAddress = address => address.row < 0;
const simpleColumnAddress = (sheet, col) => ({
sheet,
col
});
const invalidSimpleColumnAddress = address => address.col < 0;
const simpleCellAddress = (sheet, col, row) => ({
sheet,
col,
row
});
const invalidSimpleCellAddress = address => address.col < 0 || address.row < 0;
const movedSimpleCellAddress = (address, toSheet, toRight, toBottom) => {
return simpleCellAddress(toSheet, address.col + toRight, address.row + toBottom);
};
const addressKey = address => `${address.sheet},${address.row},${address.col}`;
/**
* Checks if the object is a simple cell address.
*/
function isSimpleCellAddress(obj) {
var _a, _b, _c;
return obj && (typeof obj === 'object' || typeof obj === 'function') && typeof ((_a = obj) === null || _a === void 0 ? void 0 : _a.sheet) === 'number' && typeof ((_b = obj) === null || _b === void 0 ? void 0 : _b.col) === 'number' && typeof ((_c = obj) === null || _c === void 0 ? void 0 : _c.row) === 'number';
}
const absoluteSheetReference = (address, baseAddress) => {
var _a;
return (_a = address.sheet) !== null && _a !== void 0 ? _a : baseAddress.sheet;
};
const equalSimpleCellAddress = (left, right) => {
return left.sheet === right.sheet && left.col === right.col && left.row === right.row;
};
/***/ }),
/* 4 */
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ AddressMapping: () => (/* reexport safe */ _AddressMapping_AddressMapping_mjs__WEBPACK_IMPORTED_MODULE_1__.AddressMapping),
/* harmony export */ ArrayMapping: () => (/* reexport safe */ _ArrayMapping_mjs__WEBPACK_IMPORTED_MODULE_6__.ArrayMapping),
/* harmony export */ ArrayVertex: () => (/* reexport safe */ _FormulaCellVertex_mjs__WEBPACK_IMPORTED_MODULE_7__.ArrayVertex),
/* harmony export */ DenseStrategy: () => (/* reexport safe */ _AddressMapping_DenseStrategy_mjs__WEBPACK_IMPORTED_MODULE_13__.DenseStrategy),
/* harmony export */ DependencyGraph: () => (/* reexport safe */ _DependencyGraph_mjs__WEBPACK_IMPORTED_MODULE_0__.DependencyGraph),
/* harmony export */ EmptyCellVertex: () => (/* reexport safe */ _EmptyCellVertex_mjs__WEBPACK_IMPORTED_MODULE_8__.EmptyCellVertex),
/* harmony export */ FormulaCellVertex: () => (/* reexport safe */ _FormulaCellVertex_mjs__WEBPACK_IMPORTED_MODULE_7__.Formu