@odoo/o-spreadsheet 16.4.32 → 16.4.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14838,7 +14838,7 @@ const machine = {
|
|
|
14838
14838
|
function matchReference(tokens) {
|
|
14839
14839
|
let head = 0;
|
|
14840
14840
|
let transitions = machine[State.LeftRef];
|
|
14841
|
-
|
|
14841
|
+
let matchedTokens = "";
|
|
14842
14842
|
while (transitions !== undefined) {
|
|
14843
14843
|
const token = tokens[head++];
|
|
14844
14844
|
if (!token) {
|
|
@@ -14850,15 +14850,15 @@ function matchReference(tokens) {
|
|
|
14850
14850
|
case undefined:
|
|
14851
14851
|
return null;
|
|
14852
14852
|
case State.Found:
|
|
14853
|
-
matchedTokens.
|
|
14853
|
+
matchedTokens += token.value;
|
|
14854
14854
|
tokens.splice(0, head);
|
|
14855
14855
|
return {
|
|
14856
14856
|
type: "REFERENCE",
|
|
14857
|
-
value:
|
|
14857
|
+
value: matchedTokens,
|
|
14858
14858
|
};
|
|
14859
14859
|
default:
|
|
14860
14860
|
transitions = machine[nextState];
|
|
14861
|
-
matchedTokens.
|
|
14861
|
+
matchedTokens += token.value;
|
|
14862
14862
|
break;
|
|
14863
14863
|
}
|
|
14864
14864
|
}
|
|
@@ -52127,6 +52127,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
52127
52127
|
exports.tokenize = tokenize;
|
|
52128
52128
|
|
|
52129
52129
|
|
|
52130
|
-
__info__.version = '16.4.
|
|
52131
|
-
__info__.date = '2024-05-
|
|
52132
|
-
__info__.hash = '
|
|
52130
|
+
__info__.version = '16.4.33';
|
|
52131
|
+
__info__.date = '2024-05-15T09:17:20.683Z';
|
|
52132
|
+
__info__.hash = '53b07e5';
|
|
@@ -14834,7 +14834,7 @@ const machine = {
|
|
|
14834
14834
|
function matchReference(tokens) {
|
|
14835
14835
|
let head = 0;
|
|
14836
14836
|
let transitions = machine[State.LeftRef];
|
|
14837
|
-
|
|
14837
|
+
let matchedTokens = "";
|
|
14838
14838
|
while (transitions !== undefined) {
|
|
14839
14839
|
const token = tokens[head++];
|
|
14840
14840
|
if (!token) {
|
|
@@ -14846,15 +14846,15 @@ function matchReference(tokens) {
|
|
|
14846
14846
|
case undefined:
|
|
14847
14847
|
return null;
|
|
14848
14848
|
case State.Found:
|
|
14849
|
-
matchedTokens.
|
|
14849
|
+
matchedTokens += token.value;
|
|
14850
14850
|
tokens.splice(0, head);
|
|
14851
14851
|
return {
|
|
14852
14852
|
type: "REFERENCE",
|
|
14853
|
-
value:
|
|
14853
|
+
value: matchedTokens,
|
|
14854
14854
|
};
|
|
14855
14855
|
default:
|
|
14856
14856
|
transitions = machine[nextState];
|
|
14857
|
-
matchedTokens.
|
|
14857
|
+
matchedTokens += token.value;
|
|
14858
14858
|
break;
|
|
14859
14859
|
}
|
|
14860
14860
|
}
|
|
@@ -52091,6 +52091,6 @@ const constants = {
|
|
|
52091
52091
|
export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
|
|
52092
52092
|
|
|
52093
52093
|
|
|
52094
|
-
__info__.version = '16.4.
|
|
52095
|
-
__info__.date = '2024-05-
|
|
52096
|
-
__info__.hash = '
|
|
52094
|
+
__info__.version = '16.4.33';
|
|
52095
|
+
__info__.date = '2024-05-15T09:17:20.683Z';
|
|
52096
|
+
__info__.hash = '53b07e5';
|
|
@@ -14835,7 +14835,7 @@
|
|
|
14835
14835
|
function matchReference(tokens) {
|
|
14836
14836
|
let head = 0;
|
|
14837
14837
|
let transitions = machine[State.LeftRef];
|
|
14838
|
-
|
|
14838
|
+
let matchedTokens = "";
|
|
14839
14839
|
while (transitions !== undefined) {
|
|
14840
14840
|
const token = tokens[head++];
|
|
14841
14841
|
if (!token) {
|
|
@@ -14847,15 +14847,15 @@
|
|
|
14847
14847
|
case undefined:
|
|
14848
14848
|
return null;
|
|
14849
14849
|
case State.Found:
|
|
14850
|
-
matchedTokens.
|
|
14850
|
+
matchedTokens += token.value;
|
|
14851
14851
|
tokens.splice(0, head);
|
|
14852
14852
|
return {
|
|
14853
14853
|
type: "REFERENCE",
|
|
14854
|
-
value:
|
|
14854
|
+
value: matchedTokens,
|
|
14855
14855
|
};
|
|
14856
14856
|
default:
|
|
14857
14857
|
transitions = machine[nextState];
|
|
14858
|
-
matchedTokens.
|
|
14858
|
+
matchedTokens += token.value;
|
|
14859
14859
|
break;
|
|
14860
14860
|
}
|
|
14861
14861
|
}
|
|
@@ -52126,9 +52126,9 @@
|
|
|
52126
52126
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
52127
52127
|
|
|
52128
52128
|
|
|
52129
|
-
__info__.version = '16.4.
|
|
52130
|
-
__info__.date = '2024-05-
|
|
52131
|
-
__info__.hash = '
|
|
52129
|
+
__info__.version = '16.4.33';
|
|
52130
|
+
__info__.date = '2024-05-15T09:17:20.683Z';
|
|
52131
|
+
__info__.hash = '53b07e5';
|
|
52132
52132
|
|
|
52133
52133
|
|
|
52134
52134
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
cursor: pointer;
|
|
276
276
|
color: #000;
|
|
277
277
|
}
|
|
278
|
-
`;class Br extends t.Component{static components={Menu:Vr};static template="o-spreadsheet-LinkDisplay";get cell(){const{col:e,row:t}=this.props.cellPosition,o=this.env.model.getters.getActiveSheetId();return this.env.model.getters.getEvaluatedCell({sheetId:o,col:e,row:t})}get link(){if(this.cell.link)return this.cell.link;const{col:e,row:t}=this.props.cellPosition;throw new Error(`LinkDisplay Component can only be used with link cells. ${xt(e,t)} is not a link.`)}getUrlRepresentation(e){return rs(e,this.env.model.getters)}openLink(){ns(this.link,this.env)}edit(){const{col:e,row:t}=this.props.cellPosition;this.env.model.dispatch("OPEN_CELL_POPOVER",{col:e,row:t,popoverType:"LinkEditor"})}unlink(){const e=this.env.model.getters.getActiveSheetId(),{col:t,row:o}=this.props.cellPosition,i=this.env.model.getters.getCellComputedStyle({sheetId:e,col:t,row:o}),s=i?.textColor===R?void 0:i?.textColor;this.env.model.dispatch("UPDATE_CELL",{col:t,row:o,sheetId:e,content:this.link.label,style:{...i,textColor:s,underline:void 0}})}}const zr={onHover:(e,t)=>{const o=t.getEvaluatedCell(e);return!t.isDashboard()&&o.link&&t.isVisibleInViewport(e)?{isOpen:!0,Component:Br,props:{cellPosition:e},cellCorner:"BottomLeft"}:{isOpen:!1}}};Br.props={cellPosition:Object,onClosed:{type:Function,optional:!0}};const Hr=/(.*?)\((.*?)\)(.*)/,$r=["ANY","BOOLEAN","DATE","NUMBER","STRING","RANGE","RANGE<BOOLEAN>","RANGE<DATE>","RANGE<NUMBER>","RANGE<STRING>","META"];function Wr(e,t=""){return function(e,t){let o=e.match(Hr),i=o[1].trim();if(!i)throw new Error(`Function argument definition is missing a name: '${e}'.`);let s,r=[],n=!1,a=!1,l=!1;for(let e of o[2].split(",")){const t=e.trim().toUpperCase();let o=$r.find((e=>t===e));o?r.push(o):"RANGE<ANY>"===t?r.push("RANGE"):"OPTIONAL"===t?n=!0:"REPEATING"===t?a=!0:"LAZY"===t?l=!0:t.startsWith("DEFAULT=")&&(s=e.trim().slice(8))}const c={name:i,description:t,type:r};n&&(c.optional=!0);a&&(c.repeating=!0);l&&(c.lazy=!0);void 0!==s&&(c.default=!0,c.defaultValue=s);return c}(e,t)}function Gr(e){let t=0,o=0,i=0;for(let s of e.args)t++,s.optional||s.repeating||s.default||o++,s.repeating&&i++;const s=e;return s.minArgRequired=o,s.maxArgPossible=i?1/0:t,s.nbrArgRepeating=i,s.getArgToFocus=function(e,t){if(!t)return e=>e;if(1===t)return t=>Math.min(t,e);const o=e-t;return e=>{if(e<=o)return e;return o+((e-o)%t||t)}}(t,i),s.hidden=e.hidden||!1,s}function qr(e,t){xs((()=>1===t.length||1===t[0].length),e)}function Zr(e,...t){if(t.every(Ss)){const o=t[0].length,i=t[0][0].length;for(const s of t)xs((()=>s.length===o&&s[0].length===i),e)}else if(t.some((e=>Array.isArray(e)&&(1!==e.length||1!==e[0].length))))throw new Error(e)}function Yr(e,t){xs((()=>t>0),e)}function jr(e,t){xs((()=>t.length===t[0].length),e)}function Xr(e){return e.every((e=>e.every((e=>"number"==typeof e))))}function Kr(e){const t=Array(e);for(let o=0;o<e;o++)t[o]=Array(e).fill(0),t[o][o]=1;return t}function Qr(e){if(e.length!==e[0].length)throw new Error("Function [[FUNCTION_NAME]] invert matrix error, only square matrices are invertible");let t=1;const o=e.length,i=Kr(o),s=e.map((e=>e.slice()));for(let e=0;e<o;e++){let r=s[e][e];if(0===r){for(let r=e+1;r<o;r++)if(0!=s[e][r]){Jr(s,e,r),Jr(i,e,r),t*=-1;break}if(r=s[e][e],0===r)return{determinant:0}}for(let t=0;t<o;t++)s[t][e]=s[t][e]/r,i[t][e]=i[t][e]/r;t*=r;for(let t=0;t<o;t++){if(t===e)continue;const r=s[e][t];for(let n=0;n<o;n++)s[n][t]-=r*s[n][e],i[n][t]-=r*i[n][e]}}return{inverted:i,determinant:t}}function Jr(e,t,o){for(let i=0;i<e.length;i++){const s=e[i][t];e[i][t]=e[i][o],e[i][o]=s}}const en={description:r("Returns a result array constrained to a specific width and height."),args:[Wr("input_range (any, range<any>)",r("The range to constrain.")),Wr("rows (number)",r("The number of rows in the constrained array.")),Wr("columns (number)",r("The number of columns in the constrained array."))],returns:["RANGE<ANY>"],compute:function(e,t,o){const i=er(e),s=Ts(t,this.locale),n=Ts(o,this.locale);Yr(r("The rows argument (%s) must be strictly positive.",s.toString()),s),Yr(r("The columns argument (%s) must be strictly positive.",s.toString()),n);const a=Math.min(s,i[0].length),l=Math.min(n,i.length),c=Array(l);for(let e=0;e<l;e++){c[e]=Array(a);for(let t=0;t<a;t++)c[e][t]=Js(i[e][t])}return c},isExported:!1},tn={description:r("Creates a new array from the selected columns in the existing range."),args:[Wr("array (any, range<any>)",r("The array that contains the columns to be returned.")),Wr("col_num (number, range<number>)",r("The first column index of the columns to be returned.")),Wr("col_num2 (number, range<number>, repeating)",r("The columns indexes of the columns to be returned."))],returns:["RANGE<ANY>"],compute:function(e,...t){const o=er(e),i=tr(t,(e=>Ts(e,this.locale)));xs((()=>i.every((e=>e>0&&e<=o.length))),r("The columns arguments must be between 1 and %s (got %s).",o.length.toString(),(i.find((e=>e<=0||e>o.length))||0).toString()));const s=Array(i.length);for(let e=0;e<i.length;e++){const t=i[e]-1;s[e]=o[t]}return Qs(s)},isExported:!0},on={description:r("Creates a new array from the selected rows in the existing range."),args:[Wr("array (any, range<any>)",r("The array that contains the rows to be returned.")),Wr("row_num (number, range<number>)",r("The first row index of the rows to be returned.")),Wr("row_num2 (number, range<number>, repeating)",r("The rows indexes of the rows to be returned."))],returns:["RANGE<ANY>"],compute:function(e,...t){const o=er(e),i=tr(t,(e=>Ts(e,this.locale)));xs((()=>i.every((e=>e>0&&e<=o[0].length))),r("The rows arguments must be between 1 and %s (got %s).",o[0].length.toString(),(i.find((e=>e<=0||e>o[0].length))||0).toString()));const s=Array(o.length);for(let e=0;e<o.length;e++){s[e]=Array(i.length);for(let t=0;t<i.length;t++){const r=i[t]-1;s[e][t]=Js(o[e][r])}}return s},isExported:!0},sn={description:r("Expands or pads an array to specified row and column dimensions."),args:[Wr("array (any, range<any>)",r("The array to expand.")),Wr("rows (number)",r("The number of rows in the expanded array. If missing, rows will not be expanded.")),Wr("columns (number, optional)",r("The number of columns in the expanded array. If missing, columns will not be expanded.")),Wr("pad_with (any, default=0)",r("The value with which to pad."))],returns:["RANGE<ANY>"],compute:function(e,t,o,i=0){const s=er(e),n=Ts(t,this.locale),a=void 0!==o?Ts(o,this.locale):s.length,l=null!=i?i:0;xs((()=>n>=s[0].length),r("The rows arguments (%s) must be greater or equal than the number of rows of the array.",n.toString())),xs((()=>a>=s.length),r("The columns arguments (%s) must be greater or equal than the number of columns of the array.",a.toString()));const c=[];for(let e=0;e<a;e++){c[e]=[];for(let t=0;t<n;t++)e>=s.length||t>=s[e].length?c[e][t]=l:c[e][t]=s[e][t]??0}return c},isExported:!0},rn={description:r("Flattens all the values from one or more ranges into a single column."),args:[Wr("range (any, range<any>)",r("The first range to flatten.")),Wr("range2 (any, range<any>, repeating)",r("Additional ranges to flatten."))],returns:["RANGE<ANY>"],compute:function(...e){return[tr(e,Js)]},isExported:!1},nn={description:r("Calculates the frequency distribution of a range."),args:[Wr("data (range<number>)",r("The array of ranges containing the values to be counted.")),Wr("classes (number, range<number>)",r("The range containing the set of classes."))],returns:["RANGE<NUMBER>"],compute:function(e,t){const o=tr([e],(e=>e)).filter((e=>"number"==typeof e)),i=tr([t],(e=>e)).filter((e=>"number"==typeof e)).map(((e,t)=>({initialIndex:t,value:e,count:0}))).sort(((e,t)=>e.value-t.value));i.push({initialIndex:i.length,value:1/0,count:0});const s=o.sort(((e,t)=>e-t));let r=0;for(const e of s){for(;e>i[r].value&&r<i.length-1;)r++;i[r].count++}return[i.sort(((e,t)=>e.initialIndex-t.initialIndex)).map((e=>e.count))]},isExported:!0},an={description:r("Appends ranges horizontally and in sequence to return a larger array."),args:[Wr("range1 (any, range<any>)",r("The first range to be appended.")),Wr("range2 (any, range<any>, repeating)",r("Additional ranges to add to range1."))],returns:["RANGE<ANY>"],compute:function(...e){const t=e.map((e=>er(e))),o=Math.max(...t.map((e=>e[0].length))),i=[];for(const e of t)for(const t of e){const e=Array(o).fill(0);for(let o=0;o<t.length;o++)e[o]=Js(t[o]);i.push(e)}return i},isExported:!0},ln={description:r("Returns the matrix determinant of a square matrix."),args:[Wr("square_matrix (number, range<number>)",r("An range with an equal number of rows and columns representing a matrix whose determinant will be calculated."))],returns:["NUMBER"],compute:function(e){const t=er(e);if(jr(r("The argument square_matrix must have the same number of columns and rows."),t),!Xr(t))throw new Error(r("The argument square_matrix must be a matrix of numbers."));const{determinant:o}=Qr(t);return o},isExported:!0},cn={description:r("Returns the multiplicative inverse of a square matrix."),args:[Wr("square_matrix (number, range<number>)",r("An range with an equal number of rows and columns representing a matrix whose multiplicative inverse will be calculated."))],returns:["RANGE<NUMBER>"],compute:function(e){const t=er(e);if(jr(r("The argument square_matrix must have the same number of columns and rows."),t),!Xr(t))throw new Error(r("The argument square_matrix must be a matrix of numbers."));const{inverted:o}=Qr(t);if(!o)throw new Error(r("The matrix is not invertible."));return o},isExported:!0},hn={description:r("Calculates the matrix product of two matrices."),args:[Wr("matrix1 (number, range<number>)",r("The first matrix in the matrix multiplication operation.")),Wr("matrix2 (number, range<number>)",r("The second matrix in the matrix multiplication operation."))],returns:["RANGE<NUMBER>"],compute:function(e,t){const o=er(e),i=er(t);if(xs((()=>o.length===i[0].length),r("In [[FUNCTION_NAME]], the number of columns of the first matrix (%s) must be equal to the number of rows of the second matrix (%s).",o.length.toString(),i[0].length.toString())),!Xr(o)||!Xr(i))throw new Error(r("The arguments matrix1 and matrix2 must be matrices of numbers."));return function(e,t){if(e.length!==t[0].length)throw new Error(r("Cannot multiply matrices : incompatible matrices size."));const o=e[0].length,i=t.length,s=e.length,n=Array(i);for(let r=0;r<i;r++){n[r]=Array(o);for(let i=0;i<o;i++){let o=0;for(let n=0;n<s;n++)o+=e[n][i]*t[r][n];n[r][i]=o}}return n}(o,i)},isExported:!0},dn={description:r("Calculates the sum of the products of corresponding entries in equal-sized ranges."),args:[Wr("range1 (number, range<number>)",r("The first range whose entries will be multiplied with corresponding entries in the other ranges.")),Wr("range2 (number, range<number>, repeating)",r("The other range whose entries will be multiplied with corresponding entries in the other ranges."))],returns:["NUMBER"],compute:function(...e){Zr(r("All the ranges must have the same dimensions."),...e);const t=e.map(er);let o=0;for(let e=0;e<t[0].length;e++)for(let i=0;i<t[0][e].length;i++){if(!t.every((t=>"number"==typeof t[e][i])))continue;let s=1;for(const o of t)s*=Is(o[e][i],this.locale);o+=s}return o},isExported:!0};function un(e,t,o){Zr("The arguments array_x and array_y must have the same dimensions.",e,t);const i=er(e),s=er(t);let r=!1,n=0;for(const e in i)for(const t in i[e]){const a=i[e][t],l=s[e][t];"number"==typeof a&&"number"==typeof l&&(r=!0,n+=o(a,l))}if(!r)throw new Error("The arguments array_x and array_y must contain at least one pair of numbers.");return n}const gn={description:r("Calculates the sum of the difference of the squares of the values in two array."),args:[Wr("array_x (number, range<number>)",r("The array or range of values whose squares will be reduced by the squares of corresponding entries in array_y and added together.")),Wr("array_y (number, range<number>)",r("The array or range of values whose squares will be subtracted from the squares of corresponding entries in array_x and added together."))],returns:["NUMBER"],compute:function(e,t){return un(e,t,((e,t)=>e**2-t**2))},isExported:!0},pn={description:r("Calculates the sum of the sum of the squares of the values in two array."),args:[Wr("array_x (number, range<number>)",r("The array or range of values whose squares will be added to the squares of corresponding entries in array_y and added together.")),Wr("array_y (number, range<number>)",r("The array or range of values whose squares will be added to the squares of corresponding entries in array_x and added together."))],returns:["NUMBER"],compute:function(e,t){return un(e,t,((e,t)=>e**2+t**2))},isExported:!0},mn={description:r("Calculates the sum of squares of the differences of values in two array."),args:[Wr("array_x (number, range<number>)",r("The array or range of values that will be reduced by corresponding entries in array_y, squared, and added together.")),Wr("array_y (number, range<number>)",r("The array or range of values that will be subtracted from corresponding entries in array_x, the result squared, and all such results added together."))],returns:["NUMBER"],compute:function(e,t){return un(e,t,((e,t)=>(e-t)**2))},isExported:!0},fn=[Wr("array (any, range<any>)",r("The array which will be transformed.")),Wr("ignore (number, default=0)",r("The control to ignore blanks and errors. 0 (default) is to keep all values, 1 is to ignore blanks, 2 is to ignore errors, and 3 is to ignore blanks and errors.")),Wr("scan_by_column (number, default=false)",r("Whether the array should be scanned by column. True scans the array by column and false (default) scans the array by row."))],bn={description:r("Transforms a range of cells into a single column."),args:fn,returns:["RANGE<ANY>"],compute:function(e,t=0,o=false){const i=er(e),s=Ts(t,this.locale),n=Ds(o);xs((()=>s>=0&&s<=3),r("Argument ignore must be between 0 and 3"));const a=Bs([i],((e,t)=>1!==s&&3!==s||null!=t?(e.push(Js(t)),e):e),[],n?"colFirst":"rowFirst");if(0===a.length)throw new g(r("No results for the given arguments of TOCOL."));return[a]},isExported:!0},vn={description:r("Transforms a range of cells into a single row."),args:fn,returns:["RANGE<ANY>"],compute:function(e,t=0,o=false){const i=er(e),s=Ts(t,this.locale),n=Ds(o);xs((()=>s>=0&&s<=3),r("Argument ignore must be between 0 and 3"));const a=Bs([i],((e,t)=>1!==s&&3!==s||null!=t?(e.push([Js(t)]),e):e),[],n?"colFirst":"rowFirst");if(0===a.length||0===a[0].length)throw new g(r("No results for the given arguments of TOROW."));return a},isExported:!0},Sn={description:r("Transposes the rows and columns of a range."),args:[Wr("range (any, range<any>)",r("The range to be transposed."))],returns:["RANGE<ANY>"],computeFormat:e=>{if(e.format)return Ss(e.format)?Ze(e.format):e.format},compute:function(e){return Ze(er(e),Js)},isExported:!0},Cn={description:r("Appends ranges vertically and in sequence to return a larger array."),args:[Wr("range1 (any, range<any>)",r("The first range to be appended.")),Wr("range2 (any, range<any>, repeating)",r("Additional ranges to add to range1."))],returns:["RANGE<ANY>"],compute:function(...e){const t=e.map((e=>er(e))),o=Math.max(...t.map((e=>e.length))),i=t.reduce(((e,t)=>e+t[0].length),0),s=Array(o).fill([]).map((()=>Array(i).fill(0)));let r=0;for(const e of t){for(let t=0;t<e.length;t++)for(let o=0;o<e[t].length;o++)s[t][r+o]=Js(e[t][o]);r+=e[0].length}return s},isExported:!0},En={description:r("Wraps the provided row or column of cells by columns after a specified number of elements to form a new array."),args:[Wr("range (any, range<any>)",r("The range to wrap.")),Wr("wrap_count (number)",r("The maximum number of cells for each column, rounded down to the nearest whole number.")),Wr("pad_with (any, default=0)",r("The value with which to fill the extra cells in the range."))],returns:["RANGE<ANY>"],compute:function(e,t,o=0){const i=er(e),s=Ts(t,this.locale),n=null===o?0:o;qr(r("Argument range must be a single row or column."),i);const a=i.flat(),l=Math.ceil(a.length/s),c=Array(l);for(let e=0;e<l;e++){c[e]=Array(s).fill(n);for(let t=0;t<s;t++){const o=e*s+t;o<a.length&&(c[e][t]=Js(a[o]))}}return c},isExported:!0},wn={description:r("Wraps the provided row or column of cells by rows after a specified number of elements to form a new array."),args:[Wr("range (any, range<any>)",r("The range to wrap.")),Wr("wrap_count (number)",r("The maximum number of cells for each row, rounded down to the nearest whole number.")),Wr("pad_with (any, default=0)",r("The value with which to fill the extra cells in the range."))],returns:["RANGE<ANY>"],compute:function(e,t,o=0){const i=er(e),s=Ts(t,this.locale),n=null===o?0:o;qr(r("Argument range must be a single row or column."),i);const a=i.flat(),l=Math.ceil(a.length/s),c=Array(s).fill([]).map((()=>Array(l).fill(n)));for(let e=0;e<l;e++)for(let t=0;t<s;t++){const o=e*s+t;o<a.length&&(c[t][e]=Js(a[o]))}return c},isExported:!0};var xn=Object.freeze({__proto__:null,ARRAY_CONSTRAIN:en,CHOOSECOLS:tn,CHOOSEROWS:on,EXPAND:sn,FLATTEN:rn,FREQUENCY:nn,HSTACK:an,MDETERM:ln,MINVERSE:cn,MMULT:hn,SUMPRODUCT:dn,SUMX2MY2:gn,SUMX2PY2:pn,SUMXMY2:mn,TOCOL:bn,TOROW:vn,TRANSPOSE:Sn,VSTACK:Cn,WRAPCOLS:En,WRAPROWS:wn});const yn={description:r("Apply a large number format"),args:[Wr("value (number)",r("The number.")),Wr("unit (string, optional)",r("The formatting unit. Use 'k', 'm', or 'b' to force the unit"))],returns:["NUMBER"],computeFormat:function(e,t){const o=Math.abs(Is(e.value,this.locale)),i=e.format;if(void 0!==t){const e=t?.value;switch(e){case"k":return Do(i,1e3,"k",this.locale);case"m":return Do(i,1e6,"m",this.locale);case"b":return Do(i,1e9,"b",this.locale);default:throw new Error(r("The formatting unit should be 'k', 'm' or 'b'."))}}return o<1e5?Do(i,0,"",this.locale):o<1e8?Do(i,1e3,"k",this.locale):o<1e11?Do(i,1e6,"m",this.locale):Do(i,1e9,"b",this.locale)},compute:function(e){return Is(e,this.locale)}};var In=Object.freeze({__proto__:null,FORMAT_LARGE_NUMBER:yn});const Rn=/^-?[a-z0-9]+$/i,Tn={description:r("Absolute value of a number."),args:[Wr("value (number)",r("The number of which to return the absolute value."))],returns:["NUMBER"],compute:function(e){return Math.abs(Is(e,this.locale))},isExported:!0},An={description:r("Inverse cosine of a value, in radians."),args:[Wr("value (number)",r("The value for which to calculate the inverse cosine. Must be between -1 and 1, inclusive."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>Math.abs(t)<=1),r("The value (%s) must be between -1 and 1 inclusive.",t.toString())),Math.acos(t)},isExported:!0},On={description:r("Inverse hyperbolic cosine of a number."),args:[Wr("value (number)",r("The value for which to calculate the inverse hyperbolic cosine. Must be greater than or equal to 1."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>t>=1),r("The value (%s) must be greater than or equal to 1.",t.toString())),Math.acosh(t)},isExported:!0},Mn={description:r("Inverse cotangent of a value."),args:[Wr("value (number)",r("The value for which to calculate the inverse cotangent."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return(Math.sign(t)||1)*Math.PI/2-Math.atan(t)},isExported:!0},Nn={description:r("Inverse hyperbolic cotangent of a value."),args:[Wr("value (number)",r("The value for which to calculate the inverse hyperbolic cotangent. Must not be between -1 and 1, inclusive."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>Math.abs(t)>1),r("The value (%s) cannot be between -1 and 1 inclusive.",t.toString())),Math.log((t+1)/(t-1))/2},isExported:!0},_n={description:r("Inverse sine of a value, in radians."),args:[Wr("value (number)",r("The value for which to calculate the inverse sine. Must be between -1 and 1, inclusive."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>Math.abs(t)<=1),r("The value (%s) must be between -1 and 1 inclusive.",t.toString())),Math.asin(t)},isExported:!0},Fn={description:r("Inverse hyperbolic sine of a number."),args:[Wr("value (number)",r("The value for which to calculate the inverse hyperbolic sine."))],returns:["NUMBER"],compute:function(e){return Math.asinh(Is(e,this.locale))},isExported:!0},Dn={description:r("Inverse tangent of a value, in radians."),args:[Wr("value (number)",r("The value for which to calculate the inverse tangent."))],returns:["NUMBER"],compute:function(e){return Math.atan(Is(e,this.locale))},isExported:!0},Ln={description:r("Angle from the X axis to a point (x,y), in radians."),args:[Wr("x (number)",r("The x coordinate of the endpoint of the line segment for which to calculate the angle from the x-axis.")),Wr("y (number)",r("The y coordinate of the endpoint of the line segment for which to calculate the angle from the x-axis."))],returns:["NUMBER"],compute:function(e,t){const o=Is(e,this.locale),i=Is(t,this.locale);return xs((()=>0!==o||0!==i),r("Function [[FUNCTION_NAME]] caused a divide by zero error.")),Math.atan2(i,o)},isExported:!0},Pn={description:r("Inverse hyperbolic tangent of a number."),args:[Wr("value (number)",r("The value for which to calculate the inverse hyperbolic tangent. Must be between -1 and 1, exclusive."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>Math.abs(t)<1),r("The value (%s) must be between -1 and 1 exclusive.",t.toString())),Math.atanh(t)},isExported:!0},kn={description:r("Rounds number up to nearest multiple of factor."),args:[Wr("value (number)",r("The value to round up to the nearest integer multiple of factor.")),Wr("factor (number, default=1)",r("The number to whose multiples value will be rounded."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=1){const o=Is(e,this.locale),i=Is(t,this.locale);return xs((()=>i>=0||o<=0),r("The factor (%s) must be positive when the value (%s) is positive.",i.toString(),o.toString())),i?Math.ceil(o/i)*i:0},isExported:!0},Un={description:r("Rounds number up to nearest multiple of factor."),args:[Wr("number (number)",r("The value to round up to the nearest integer multiple of significance.")),Wr("significance (number, default=1)",r("The number to whose multiples number will be rounded. The sign of significance will be ignored.")),Wr("mode (number, default=0)",r("If number is negative, specifies the rounding direction. If 0 or blank, it is rounded towards zero. Otherwise, it is rounded away from zero."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=1,o=0){let i=Is(t,this.locale);if(0===i)return 0;const s=Is(e,this.locale);if(i=Math.abs(i),s>=0)return Math.ceil(s/i)*i;return 0===Is(o,this.locale)?-Math.floor(Math.abs(s)/i)*i:-Math.ceil(Math.abs(s)/i)*i},isExported:!0},Vn={description:r("Rounds number up to nearest multiple of factor."),args:[Wr("number (number)",r("The value to round up to the nearest integer multiple of significance.")),Wr("significance (number, default=1)",r("The number to whose multiples number will be rounded."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t){return Un.compute.bind(this)(e,t,0)},isExported:!0},Bn={description:r("Cosine of an angle provided in radians."),args:[Wr("angle (number)",r("The angle to find the cosine of, in radians."))],returns:["NUMBER"],compute:function(e){return Math.cos(Is(e,this.locale))},isExported:!0},zn={description:r("Hyperbolic cosine of any real number."),args:[Wr("value (number)",r("Any real value to calculate the hyperbolic cosine of."))],returns:["NUMBER"],compute:function(e){return Math.cosh(Is(e,this.locale))},isExported:!0},Hn={description:r("Cotangent of an angle provided in radians."),args:[Wr("angle (number)",r("The angle to find the cotangent of, in radians."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>0!==t),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),1/Math.tan(t)},isExported:!0},$n={description:r("Hyperbolic cotangent of any real number."),args:[Wr("value (number)",r("Any real value to calculate the hyperbolic cotangent of."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>0!==t),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),1/Math.tanh(t)},isExported:!0},Wn={description:r("Number of empty values."),args:[Wr("value1 (any, range)",r("The first value or range in which to count the number of blanks.")),Wr("value2 (any, range, repeating)",r("Additional values or ranges in which to count the number of blanks."))],returns:["NUMBER"],compute:function(...e){return Bs(e,((e,t)=>null==t||""===t?e+1:e),0)},isExported:!0},Gn={description:r("A conditional count across a range."),args:[Wr("range (range)",r("The range that is tested against criterion.")),Wr("criterion (string)",r("The pattern or test to apply to range."))],returns:["NUMBER"],compute:function(...e){let t=0;return qs(e,((e,o)=>{t+=1}),this.locale),t},isExported:!0},qn={description:r("Count values depending on multiple criteria."),args:[Wr("criteria_range1 (range)",r("The range to check against criterion1.")),Wr("criterion1 (string)",r("The pattern or test to apply to criteria_range1.")),Wr("criteria_range2 (any, range, repeating)",r("Additional ranges over which to evaluate the additional criteria. The filtered set will be the intersection of the sets produced by each criterion-range pair.")),Wr("criterion2 (string, repeating)",r("Additional criteria to check."))],returns:["NUMBER"],compute:function(...e){let t=0;return qs(e,((e,o)=>{t+=1}),this.locale),t},isExported:!0};function Zn(e){switch(e){case void 0:case"":case null:return!1;default:return!0}}const Yn={description:r("Counts number of unique values in a range."),args:[Wr("value1 (any, range)",r("The first value or range to consider for uniqueness.")),Wr("value2 (any, range, repeating)",r("Additional values or ranges to consider for uniqueness."))],returns:["NUMBER"],compute:function(...e){return Bs(e,((e,t)=>Zn(t)?e.add(t):e),new Set).size}},jn={description:r("Counts number of unique values in a range, filtered by a set of criteria."),args:[Wr("range (range)",r("The range of cells from which the number of unique values will be counted.")),Wr("criteria_range1 (range)",r("The range of cells over which to evaluate criterion1.")),Wr("criterion1 (string)",r("The pattern or test to apply to criteria_range1, such that each cell that evaluates to TRUE will be included in the filtered set.")),Wr("criteria_range2 (any, range, repeating)",r("Additional ranges over which to evaluate the additional criteria. The filtered set will be the intersection of the sets produced by each criterion-range pair.")),Wr("criterion2 (string, repeating)",r("The pattern or test to apply to criteria_range2."))],returns:["NUMBER"],compute:function(e,...t){let o=new Set;return qs(t,((t,i)=>{const s=e[t][i];Zn(s)&&o.add(s)}),this.locale),o.size}},Xn={description:r("Cosecant of an angle provided in radians."),args:[Wr("angle (number)",r("The angle to find the cosecant of, in radians."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>0!==t),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),1/Math.sin(t)},isExported:!0},Kn={description:r("Hyperbolic cosecant of any real number."),args:[Wr("value (number)",r("Any real value to calculate the hyperbolic cosecant of."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>0!==t),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),1/Math.sinh(t)},isExported:!0},Qn={description:r("Converts from another base to decimal."),args:[Wr("value (string)",r("The number to convert.")),Wr(",base (number)",r("The base to convert the value from."))],returns:["NUMBER"],compute:function(e,t){let o=Is(t,this.locale);o=Math.floor(o),xs((()=>2<=o&&o<=36),r("The base (%s) must be between 2 and 36 inclusive.",o.toString()));const i=Ms(e);if(""===i)return 0;xs((()=>!!Rn.test(i)),r("The value (%s) must be a valid base %s representation.",i,o.toString()));const s=parseInt(i,o);return xs((()=>!isNaN(s)),r("The value (%s) must be a valid base %s representation.",i,o.toString())),s},isExported:!0},Jn={description:r("Converts an angle value in radians to degrees."),args:[Wr("angle (number)",r("The angle to convert from radians to degrees."))],returns:["NUMBER"],compute:function(e){return 180*Is(e,this.locale)/Math.PI},isExported:!0},ea={description:r("Euler's number, e (~2.718) raised to a power."),args:[Wr("value (number)",r("The exponent to raise e."))],returns:["NUMBER"],compute:function(e){return Math.exp(Is(e,this.locale))},isExported:!0},ta={description:r("Rounds number down to nearest multiple of factor."),args:[Wr("value (number)",r("The value to round down to the nearest integer multiple of factor.")),Wr("factor (number, default=1)",r("The number to whose multiples value will be rounded."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=1){const o=Is(e,this.locale),i=Is(t,this.locale);return xs((()=>i>=0||o<=0),r("The factor (%s) must be positive when the value (%s) is positive.",i.toString(),o.toString())),i?Math.floor(o/i)*i:0},isExported:!0},oa={description:r("Rounds number down to nearest multiple of factor."),args:[Wr("number (number)",r("The value to round down to the nearest integer multiple of significance.")),Wr("significance (number, default=1)",r("The number to whose multiples number will be rounded. The sign of significance will be ignored.")),Wr("mode (number, default=0)",r("If number is negative, specifies the rounding direction. If 0 or blank, it is rounded away from zero. Otherwise, it is rounded towards zero."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=1,o=0){let i=Is(t,this.locale);if(0===i)return 0;const s=Is(e,this.locale);if(i=Math.abs(i),s>=0)return Math.floor(s/i)*i;return 0===Is(o,this.locale)?-Math.ceil(Math.abs(s)/i)*i:-Math.floor(Math.abs(s)/i)*i},isExported:!0},ia={description:r("Rounds number down to nearest multiple of factor."),args:[Wr("number (number)",r("The value to round down to the nearest integer multiple of significance.")),Wr("significance (number, default=1)",r("The number to whose multiples number will be rounded."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=1){return oa.compute.bind(this)(e,t,0)},isExported:!0},sa={description:r("Whether the provided value is even."),args:[Wr("value (number)",r("The value to be verified as even."))],returns:["BOOLEAN"],compute:function(e){const t=Rs(e,this.locale);return!(1&Math.floor(Math.abs(t)))},isExported:!0},ra={description:r("Rounds number up to nearest multiple of factor."),args:[Wr("number (number)",r("The value to round up to the nearest integer multiple of significance.")),Wr("significance (number, default=1)",r("The number to whose multiples number will be rounded."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=1){return Un.compute.bind(this)(e,t,0)},isExported:!0},na={description:r("Whether the provided value is even."),args:[Wr("value (number)",r("The value to be verified as even."))],returns:["BOOLEAN"],compute:function(e){const t=Rs(e,this.locale);return!!(1&Math.floor(Math.abs(t)))},isExported:!0},aa={description:r("The logarithm of a number, base e (euler's number)."),args:[Wr("value (number)",r("The value for which to calculate the logarithm, base e."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>t>0),r("The value (%s) must be strictly positive.",t.toString())),Math.log(t)},isExported:!0},la={description:r("Modulo (remainder) operator."),args:[Wr("dividend (number)",r("The number to be divided to find the remainder.")),Wr("divisor (number)",r("The number to divide by."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t){const o=Is(t,this.locale);xs((()=>0!==o),r("The divisor must be different from 0."));const i=Is(e,this.locale)%o;return i>0&&o<0||i<0&&o>0?i+o:i},isExported:!0},ca={description:r("Returns a n x n unit matrix, where n is the input dimension."),args:[Wr("dimension (number)",r("An integer specifying the dimension size of the unit matrix. It must be positive."))],returns:["RANGE<NUMBER>"],compute:function(e){const t=Ts(e,this.locale);return Yr(r("The argument dimension must be positive"),t),Kr(t)},isExported:!0},ha={description:r("Rounds a number up to the nearest odd integer."),args:[Wr("value (number)",r("The value to round to the next greatest odd number."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e){const t=Is(e,this.locale);let o=Math.ceil(Math.abs(t));return o=1&o?o:o+1,t<0?-o:o},isExported:!0},da={description:r("The number pi."),args:[],returns:["NUMBER"],compute:function(){return Math.PI},isExported:!0},ua={description:r("A number raised to a power."),args:[Wr("base (number)",r("The number to raise to the exponent power.")),Wr("exponent (number)",r("The exponent to raise base to."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t){const o=Is(e,this.locale),i=Is(t,this.locale);return xs((()=>o>=0||Number.isInteger(i)),r("The exponent (%s) must be an integer when the base is negative.",i.toString())),Math.pow(o,i)},isExported:!0},ga={description:r("Result of multiplying a series of numbers together."),args:[Wr("factor1 (number, range<number>)",r("The first number or range to calculate for the product.")),Wr("factor2 (number, range<number>, repeating)",r("More numbers or ranges to calculate for the product."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){let t=0,o=1;for(let i of e)if(Array.isArray(i))for(let e of i)for(let i of e)"number"==typeof i&&(o*=i,t+=1);else null!=i&&(o*=Rs(i,this.locale),t+=1);return 0===t?0:o},isExported:!0},pa={description:r("A random number between 0 inclusive and 1 exclusive."),args:[],returns:["NUMBER"],compute:function(){return Math.random()},isExported:!0},ma={description:r("Returns a grid of random numbers between 0 inclusive and 1 exclusive."),args:[Wr("rows (number, default=1)",r("The number of rows to be returned.")),Wr("columns (number, default=1)",r("The number of columns to be returned.")),Wr("min (number, default=0)",r("The minimum number you would like returned.")),Wr("max (number, default=1)",r("The maximum number you would like returned.")),Wr("whole_number (number, default=FALSE)",r("Return a whole number or a decimal value."))],returns:["RANGE<NUMBER>"],compute:function(e=1,t=1,o=0,i=1,s=!1){const n=Ts(t,this.locale),a=Ts(e,this.locale),l=Is(o,this.locale),c=Is(i,this.locale),h=Ds(s);Yr(r("The number columns (%s) must be positive.",n.toString()),n),Yr(r("The number rows (%s) must be positive.",a.toString()),a),xs((()=>l<=c),r("The maximum (%s) must be greater than or equal to the minimum (%s).",c.toString(),l.toString())),h&&xs((()=>Number.isInteger(l)&&Number.isInteger(c)),r("The maximum (%s) and minimum (%s) must be integers when whole_number is TRUE.",c.toString(),l.toString()));const d=Array(n);for(let e=0;e<n;e++){d[e]=Array(a);for(let t=0;t<a;t++)d[e][t]=h?Math.floor(Math.random()*(c-l+1)+l):l+Math.random()*(c-l)}return d},isExported:!0},fa={description:r("Random integer between two values, inclusive."),args:[Wr("low (number)",r("The low end of the random range.")),Wr("high (number)",r("The high end of the random range."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t){let o=Is(e,this.locale);Number.isInteger(o)||(o=Math.ceil(o));let i=Is(t,this.locale);return Number.isInteger(i)||(i=Math.floor(i)),xs((()=>o<=i),r("The high (%s) must be greater than or equal to the low (%s).",i.toString(),o.toString())),o+Math.ceil((i-o+1)*Math.random())-1},isExported:!0},ba={description:r("Rounds a number according to standard rules."),args:[Wr("value (number)",r("The value to round to places number of places.")),Wr("places (number, default=0)",r("The number of decimal places to which to round."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=0){const o=Is(e,this.locale);let i=Is(t,this.locale);const s=Math.abs(o);let r;return 0===i?r=Math.round(s):(Number.isInteger(i)||(i=Math.trunc(i)),r=Math.round(s*Math.pow(10,i))/Math.pow(10,i)),o>=0?r:-r},isExported:!0},va={description:r("Rounds down a number."),args:[Wr("value (number)",r("The value to round to places number of places, always rounding down.")),Wr("places (number, default=0)",r("The number of decimal places to which to round."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=0){const o=Is(e,this.locale);let i=Is(t,this.locale);const s=Math.abs(o);let r;return 0===i?r=Math.floor(s):(Number.isInteger(i)||(i=Math.trunc(i)),r=Math.floor(s*Math.pow(10,i))/Math.pow(10,i)),o>=0?r:-r},isExported:!0},Sa={description:r("Rounds up a number."),args:[Wr("value (number)",r("The value to round to places number of places, always rounding up.")),Wr("places (number, default=0)",r("The number of decimal places to which to round."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=0){const o=Is(e,this.locale);let i=Is(t,this.locale);const s=Math.abs(o);let r;return 0===i?r=Math.ceil(s):(Number.isInteger(i)||(i=Math.trunc(i)),r=Math.ceil(s*Math.pow(10,i))/Math.pow(10,i)),o>=0?r:-r},isExported:!0},Ca={description:r("Secant of an angle provided in radians."),args:[Wr("angle (number)",r("The angle to find the secant of, in radians."))],returns:["NUMBER"],compute:function(e){return 1/Math.cos(Is(e,this.locale))},isExported:!0},Ea={description:r("Hyperbolic secant of any real number."),args:[Wr("value (number)",r("Any real value to calculate the hyperbolic secant of."))],returns:["NUMBER"],compute:function(e){return 1/Math.cosh(Is(e,this.locale))},isExported:!0},wa={description:r("Sine of an angle provided in radians."),args:[Wr("angle (number)",r("The angle to find the sine of, in radians."))],returns:["NUMBER"],compute:function(e){return Math.sin(Is(e,this.locale))},isExported:!0},xa={description:r("Hyperbolic sine of any real number."),args:[Wr("value (number)",r("Any real value to calculate the hyperbolic sine of."))],returns:["NUMBER"],compute:function(e){return Math.sinh(Is(e,this.locale))},isExported:!0},ya={description:r("Positive square root of a positive number."),args:[Wr("value (number)",r("The number for which to calculate the positive square root."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e){const t=Is(e,this.locale);return xs((()=>t>=0),r("The value (%s) must be positive or null.",t.toString())),Math.sqrt(t)},isExported:!0},Ia={description:r("Sum of a series of numbers and/or cells."),args:[Wr("value1 (number, range<number>)",r("The first number or range to add together.")),Wr("value2 (number, range<number>, repeating)",r("Additional numbers or ranges to add to value1."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){return zs(e,((e,t)=>e+t),0,this.locale)},isExported:!0},Ra={description:r("A conditional sum across a range."),args:[Wr("criteria_range (range)",r("The range which is tested against criterion.")),Wr("criterion (string)",r("The pattern or test to apply to range.")),Wr("sum_range (range, default=criteria_range)",r("The range to be summed, if different from range."))],returns:["NUMBER"],compute:function(e,t,o){void 0===o&&(o=e);let i=0;return qs([e,t],((e,t)=>{const s=o[e][t];"number"==typeof s&&(i+=s)}),this.locale),i},isExported:!0},Ta={description:r("Sums a range depending on multiple criteria."),args:[Wr("sum_range (range)",r("The range to sum.")),Wr("criteria_range1 (range)",r("The range to check against criterion1.")),Wr("criterion1 (string)",r("The pattern or test to apply to criteria_range1.")),Wr("criteria_range2 (any, range, repeating)",r("Additional ranges to check.")),Wr("criterion2 (string, repeating)",r("Additional criteria to check."))],returns:["NUMBER"],compute:function(e,...t){let o=0;return qs(t,((t,i)=>{const s=e[t][i];"number"==typeof s&&(o+=s)}),this.locale),o},isExported:!0},Aa={description:r("Tangent of an angle provided in radians."),args:[Wr("angle (number)",r("The angle to find the tangent of, in radians."))],returns:["NUMBER"],compute:function(e){return Math.tan(Is(e,this.locale))},isExported:!0},Oa={description:r("Hyperbolic tangent of any real number."),args:[Wr("value (number)",r("Any real value to calculate the hyperbolic tangent of."))],returns:["NUMBER"],compute:function(e){return Math.tanh(Is(e,this.locale))},isExported:!0},Ma={description:r("Truncates a number."),args:[Wr("value (number)",r("The value to be truncated.")),Wr("places (number, default=0)",r("The number of significant digits to the right of the decimal point to retain."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=0){const o=Is(e,this.locale);let i=Is(t,this.locale);return 0===i?Math.trunc(o):(Number.isInteger(i)||(i=Math.trunc(i)),Math.trunc(o*Math.pow(10,i))/Math.pow(10,i))},isExported:!0};var Na=Object.freeze({__proto__:null,ABS:Tn,ACOS:An,ACOSH:On,ACOT:Mn,ACOTH:Nn,ASIN:_n,ASINH:Fn,ATAN:Dn,ATAN2:Ln,ATANH:Pn,CEILING:kn,CEILING_MATH:Un,CEILING_PRECISE:Vn,COS:Bn,COSH:zn,COT:Hn,COTH:$n,COUNTBLANK:Wn,COUNTIF:Gn,COUNTIFS:qn,COUNTUNIQUE:Yn,COUNTUNIQUEIFS:jn,CSC:Xn,CSCH:Kn,DECIMAL:Qn,DEGREES:Jn,EXP:ea,FLOOR:ta,FLOOR_MATH:oa,FLOOR_PRECISE:ia,ISEVEN:sa,ISO_CEILING:ra,ISODD:na,LN:aa,MOD:la,MUNIT:ca,ODD:ha,PI:da,POWER:ua,PRODUCT:ga,RAND:pa,RANDARRAY:ma,RANDBETWEEN:fa,ROUND:ba,ROUNDDOWN:va,ROUNDUP:Sa,SEC:Ca,SECH:Ea,SIN:wa,SINH:xa,SQRT:ya,SUM:Ia,SUMIF:Ra,SUMIFS:Ta,TAN:Aa,TANH:Oa,TRUNC:Ma});function _a(e,t,o){let i=[],s=[],n=0,a=0;ks([e],(e=>{i.push(e),n+=1})),ks([t],(e=>{s.push(e),a+=1})),xs((()=>n===a),r("[[FUNCTION_NAME]] has mismatched argument count %s vs %s.",n.toString(),a.toString()));let l=0,c=0,h=0;for(let e=0;e<n;e++){const t=i[e],o=s[e];"number"==typeof t&&"number"==typeof o&&(l+=1,c+=t,h+=o)}xs((()=>0!==l&&(!o||1!==l)),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error."));const d=c/l,u=h/l;let g=0;for(let e=0;e<n;e++){const t=i[e],o=s[e];"number"==typeof t&&"number"==typeof o&&(g+=(t-d)*(o-u))}return g/(l-(o?1:0))}function Fa(e,t,o,i){let s=0,n=0;const a=o?Hs:zs;n=a(e,((e,t)=>(s+=1,e+t)),0,i),xs((()=>0!==s&&(!t||1!==s)),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error."));const l=n/s;return a(e,((e,t)=>e+Math.pow(t-l,2)),0,i)/(s-(t?1:0))}function Da(e,t,o,i){const s=Is(t,i);xs((()=>o?0<=s&&s<=1:0<s&&s<1),r("Function [[FUNCTION_NAME]] parameter 2 value is out of range."));let n,a=[],l=0;return ks(e,(e=>{"number"==typeof e&&(n=js(a,e,"nextSmaller","asc",a.length,((e,t)=>e[t])),a.splice(n+1,0,e),l++)})),xs((()=>0!==l),r("[[FUNCTION_NAME]] has no valid input data.")),o||xs((()=>1/(l+1)<=s&&s<=l/(l+1)),r("Function [[FUNCTION_NAME]] parameter 2 value is out of range.")),no(a,s,o)}const La={description:r("Average magnitude of deviations from mean."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the sample.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the sample."))],returns:["NUMBER"],compute:function(...e){let t=0;const o=zs(e,((e,o)=>(t+=1,e+o)),0,this.locale);xs((()=>0!==t),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error."));const i=o/t;return zs(e,((e,t)=>e+Math.abs(i-t)),0,this.locale)/t},isExported:!0},Pa={description:r("Numerical average value in a dataset, ignoring text."),args:[Wr("value1 (number, range<number>)",r("The first value or range to consider when calculating the average value.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to consider when calculating the average value."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){let t=0;const o=zs(e,((e,o)=>(t+=1,e+o)),0,this.locale);return xs((()=>0!==t),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),o/t},isExported:!0},ka=r("[[FUNCTION_NAME]] has mismatched range sizes."),Ua=r("[[FUNCTION_NAME]] expects the weight to be positive or equal to 0."),Va={description:r("Weighted average."),args:[Wr("values (number, range<number>)",r("Values to average.")),Wr("weights (number, range<number>)",r("Weights for each corresponding value.")),Wr("additional_values (number, range<number>, repeating)",r("Additional values to average.")),Wr("additional_weights (number, range<number>, repeating)",r("Additional weights."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){let t,o,i=0,s=0;xs((()=>e.length%2==0),r("Wrong number of Argument[]. Expected an even number of Argument[]."));for(let n=0;n<e.length-1;n+=2)if(t=e[n],o=e[n+1],Array.isArray(t)){xs((()=>Array.isArray(o)),ka);let e=t.length,n=t[0].length;xs((()=>e===o.length&&n===o[0].length),ka);for(let a=0;a<e;a++)for(let e=0;e<n;e++){let n=t[a][e],l=o[a][e],c="number"==typeof n,h="number"==typeof l;xs((()=>c===h),r("[[FUNCTION_NAME]] expects number values.")),h&&(xs((()=>l>=0),Ua),i+=n*l,s+=l)}}else o=Is(o,this.locale),t=Is(t,this.locale),xs((()=>o>=0),Ua),i+=t*o,s+=o;return xs((()=>0!==s),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),i/s}},Ba={description:r("Numerical average value in a dataset."),args:[Wr("value1 (number, range<number>)",r("The first value or range to consider when calculating the average value.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to consider when calculating the average value."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){let t=0;const o=Hs(e,((e,o)=>(t+=1,e+o)),0,this.locale);return xs((()=>0!==t),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),o/t},isExported:!0},za={description:r("Average of values depending on criteria."),args:[Wr("criteria_range (range)",r("The range to check against criterion.")),Wr("criterion (string)",r("The pattern or test to apply to criteria_range.")),Wr("average_range (range, default=criteria_range)",r("The range to average. If not included, criteria_range is used for the average instead."))],returns:["NUMBER"],compute:function(e,t,o){null==o&&(o=e);let i=0,s=0;return qs([e,t],((t,r)=>{const n=(o||e)[t][r];"number"==typeof n&&(i+=1,s+=n)}),this.locale),xs((()=>0!==i),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),s/i},isExported:!0},Ha={description:r("Average of values depending on multiple criteria."),args:[Wr("average_range (range)",r("The range to average.")),Wr("criteria_range1 (range)",r("The range to check against criterion1.")),Wr("criterion1 (string)",r("The pattern or test to apply to criteria_range1.")),Wr("criteria_range2 (any, range, repeating)",r("Additional criteria_range and criterion to check.")),Wr("criterion2 (string, repeating)",r("The pattern or test to apply to criteria_range2."))],returns:["NUMBER"],compute:function(e,...t){let o=0,i=0;return qs(t,((t,s)=>{const r=e[t][s];"number"==typeof r&&(o+=1,i+=r)}),this.locale),xs((()=>0!==o),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),i/o},isExported:!0},$a={description:r("The number of numeric values in dataset."),args:[Wr("value1 (number, range<number>)",r("The first value or range to consider when counting.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to consider when counting."))],returns:["NUMBER"],compute:function(...e){let t=0;for(let o of e)if(Array.isArray(o))for(let e of o)for(let o of e)"number"==typeof o&&(t+=1);else("string"!=typeof o||io(o,this.locale)||Ut(o,this.locale))&&(t+=1);return t},isExported:!0},Wa={description:r("The number of values in a dataset."),args:[Wr("value1 (any, range)",r("The first value or range to consider when counting.")),Wr("value2 (any, range, repeating)",r("Additional values or ranges to consider when counting."))],returns:["NUMBER"],compute:function(...e){return Bs(e,((e,t)=>null!=t?e+1:e),0)},isExported:!0},Ga={description:r("The covariance of a dataset."),args:[Wr("data_y (any, range)",r("The range representing the array or matrix of dependent data.")),Wr("data_x (any, range)",r("The range representing the array or matrix of independent data."))],returns:["NUMBER"],compute:function(e,t){return _a(e,t,!1)},isExported:!0},qa={description:r("The covariance of a dataset."),args:[Wr("data_y (any, range)",r("The range representing the array or matrix of dependent data.")),Wr("data_x (any, range)",r("The range representing the array or matrix of independent data."))],returns:["NUMBER"],compute:function(e,t){return _a(e,t,!1)},isExported:!0},Za={description:r("The sample covariance of a dataset."),args:[Wr("data_y (any, range)",r("The range representing the array or matrix of dependent data.")),Wr("data_x (any, range)",r("The range representing the array or matrix of independent data."))],returns:["NUMBER"],compute:function(e,t){return _a(e,t,!0)},isExported:!0},Ya={description:r("Nth largest element from a data set."),args:[Wr("data (any, range)",r("Array or range containing the dataset to consider.")),Wr("n (number)",r("The rank from largest to smallest of the element to return."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(e,t){const o=Math.trunc(Is(t,this.locale));let i,s=[],n=0;ks([e],(e=>{"number"==typeof e&&(i=js(s,e,"nextSmaller","asc",s.length,((e,t)=>e[t])),s.splice(i+1,0,e),n++,n>o&&(s.shift(),n--))}));const a=s.shift();return xs((()=>void 0!==a),r("[[FUNCTION_NAME]] has no valid input data.")),xs((()=>n>=o),r("Function [[FUNCTION_NAME]] parameter 2 value (%s) is out of range.",o.toString())),a},isExported:!0},ja={description:r("Maximum value in a numeric dataset."),args:[Wr("value1 (number, range<number>)",r("The first value or range to consider when calculating the maximum value.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to consider when calculating the maximum value."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){const t=zs(e,((e,t)=>e<t?t:e),-1/0,this.locale);return t===-1/0?0:t},isExported:!0},Xa={description:r("Maximum numeric value in a dataset."),args:[Wr("value1 (any, range)",r("The first value or range to consider when calculating the maximum value.")),Wr("value2 (any, range, repeating)",r("Additional values or ranges to consider when calculating the maximum value."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){const t=Hs(e,((e,t)=>Math.max(t,e)),-1/0,this.locale);return t===-1/0?0:t},isExported:!0},Ka={description:r("Returns the maximum value in a range of cells, filtered by a set of criteria."),args:[Wr("range (range)",r("The range of cells from which the maximum will be determined.")),Wr("criteria_range1 (range)",r("The range of cells over which to evaluate criterion1.")),Wr("criterion1 (string)",r("The pattern or test to apply to criteria_range1, such that each cell that evaluates to TRUE will be included in the filtered set.")),Wr("criteria_range2 (any, range, repeating)",r("Additional ranges over which to evaluate the additional criteria. The filtered set will be the intersection of the sets produced by each criterion-range pair.")),Wr("criterion2 (string, repeating)",r("The pattern or test to apply to criteria_range2."))],returns:["NUMBER"],compute:function(e,...t){let o=-1/0;return qs(t,((t,i)=>{const s=e[t][i];"number"==typeof s&&(o=o<s?s:o)}),this.locale),o===-1/0?0:o},isExported:!0},Qa={description:r("Median value in a numeric dataset."),args:[Wr("value1 (any, range)",r("The first value or range to consider when calculating the median value.")),Wr("value2 (any, range, repeating)",r("Additional values or ranges to consider when calculating the median value."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){let t=[];return Us(e,(e=>{t.push(e)}),this.locale),Da(t,.5,!0,this.locale)},isExported:!0},Ja={description:r("Minimum value in a numeric dataset."),args:[Wr("value1 (number, range<number>)",r("The first value or range to consider when calculating the minimum value.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to consider when calculating the minimum value."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){const t=zs(e,((e,t)=>t<e?t:e),1/0,this.locale);return t===1/0?0:t},isExported:!0},el={description:r("Minimum numeric value in a dataset."),args:[Wr("value1 (number, range<number>)",r("The first value or range to consider when calculating the minimum value.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to consider when calculating the minimum value."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){const t=Hs(e,((e,t)=>Math.min(t,e)),1/0,this.locale);return t===1/0?0:t},isExported:!0},tl={description:r("Returns the minimum value in a range of cells, filtered by a set of criteria."),args:[Wr("range (range)",r("The range of cells from which the minimum will be determined.")),Wr("criteria_range1 (range)",r("The range of cells over which to evaluate criterion1.")),Wr("criterion1 (string)",r("The pattern or test to apply to criteria_range1, such that each cell that evaluates to TRUE will be included in the filtered set.")),Wr("criteria_range2 (any, range, repeating)",r("Additional ranges over which to evaluate the additional criteria. The filtered set will be the intersection of the sets produced by each criterion-range pair.")),Wr("criterion2 (string, repeating)",r("The pattern or test to apply to criteria_range2."))],returns:["NUMBER"],compute:function(e,...t){let o=1/0;return qs(t,((t,i)=>{const s=e[t][i];"number"==typeof s&&(o=o>s?s:o)}),this.locale),o===1/0?0:o},isExported:!0},ol={description:r("Value at a given percentile of a dataset."),args:[Wr("data (any, range)",r("The array or range containing the dataset to consider.")),Wr("percentile (number)",r("The percentile whose value within data will be calculated and returned."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(e,t){return sl.compute.bind(this)(e,t)},isExported:!0},il={description:r("Value at a given percentile of a dataset exclusive of 0 and 1."),args:[Wr("data (any, range)",r("The array or range containing the dataset to consider.")),Wr("percentile (number)",r("The percentile, exclusive of 0 and 1, whose value within 'data' will be calculated and returned."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(e,t){return Da([e],t,!1,this.locale)},isExported:!0},sl={description:r("Value at a given percentile of a dataset."),args:[Wr("data (any, range)",r("The array or range containing the dataset to consider.")),Wr("percentile (number)",r("The percentile whose value within data will be calculated and returned."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(e,t){return Da([e],t,!0,this.locale)},isExported:!0},rl={description:r("Value nearest to a specific quartile of a dataset."),args:[Wr("data (any, range)",r("The array or range containing the dataset to consider.")),Wr("quartile_number (number)",r("Which quartile value to return."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(e,t){return al.compute.bind(this)(e,t)},isExported:!0},nl={description:r("Value nearest to a specific quartile of a dataset exclusive of 0 and 4."),args:[Wr("data (any, range)",r("The array or range containing the dataset to consider.")),Wr("quartile_number (number)",r("Which quartile value, exclusive of 0 and 4, to return."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(e,t){return Da([e],.25*Math.trunc(Is(t,this.locale)),!1,this.locale)},isExported:!0},al={description:r("Value nearest to a specific quartile of a dataset."),args:[Wr("data (any, range)",r("The array or range containing the dataset to consider.")),Wr("quartile_number (number)",r("Which quartile value to return."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(e,t){return Da([e],.25*Math.trunc(Is(t,this.locale)),!0,this.locale)},isExported:!0},ll={description:r("Nth smallest element in a data set."),args:[Wr("data (any, range)",r("The array or range containing the dataset to consider.")),Wr("n (number)",r("The rank from smallest to largest of the element to return."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(e,t){const o=Math.trunc(Is(t,this.locale));let i,s=[],n=0;ks([e],(e=>{"number"==typeof e&&(i=js(s,e,"nextSmaller","asc",s.length,((e,t)=>e[t])),s.splice(i+1,0,e),n++,n>o&&(s.pop(),n--))}));const a=s.pop();return xs((()=>void 0!==a),r("[[FUNCTION_NAME]] has no valid input data.")),xs((()=>n>=o),r("Function [[FUNCTION_NAME]] parameter 2 value (%s) is out of range.",o.toString())),a},isExported:!0},cl={description:r("Standard deviation."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the sample.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the sample."))],returns:["NUMBER"],compute:function(...e){return Math.sqrt(ml.compute.bind(this)(...e))},isExported:!0},hl={description:r("Standard deviation of entire population."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the population.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the population."))],returns:["NUMBER"],compute:function(...e){return Math.sqrt(fl.compute.bind(this)(...e))},isExported:!0},dl={description:r("Standard deviation."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the sample.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the sample."))],returns:["NUMBER"],compute:function(...e){return Math.sqrt(bl.compute.bind(this)(...e))},isExported:!0},ul={description:r("Standard deviation of sample (text as 0)."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the sample.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the sample."))],returns:["NUMBER"],compute:function(...e){return Math.sqrt(vl.compute.bind(this)(...e))},isExported:!0},gl={description:r("Standard deviation of entire population."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the population.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the population."))],returns:["NUMBER"],compute:function(...e){return Math.sqrt(Sl.compute.bind(this)(...e))},isExported:!0},pl={description:r("Standard deviation of entire population (text as 0)."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the population.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the population."))],returns:["NUMBER"],compute:function(...e){return Math.sqrt(Cl.compute.bind(this)(...e))},isExported:!0},ml={description:r("Variance."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the sample.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the sample."))],returns:["NUMBER"],compute:function(...e){return Fa(e,!0,!1,this.locale)},isExported:!0},fl={description:r("Variance of entire population."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the population.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the population."))],returns:["NUMBER"],compute:function(...e){return Fa(e,!1,!1,this.locale)},isExported:!0},bl={description:r("Variance."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the sample.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the sample."))],returns:["NUMBER"],compute:function(...e){return Fa(e,!0,!1,this.locale)},isExported:!0},vl={description:r("Variance of sample (text as 0)."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the sample.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the sample."))],returns:["NUMBER"],compute:function(...e){return Fa(e,!0,!0,this.locale)},isExported:!0},Sl={description:r("Variance of entire population."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the population.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the population."))],returns:["NUMBER"],compute:function(...e){return Fa(e,!1,!1,this.locale)},isExported:!0},Cl={description:r("Variance of entire population (text as 0)."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the population.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the population."))],returns:["NUMBER"],compute:function(...e){return Fa(e,!1,!0,this.locale)},isExported:!0};var El=Object.freeze({__proto__:null,AVEDEV:La,AVERAGE:Pa,AVERAGE_WEIGHTED:Va,AVERAGEA:Ba,AVERAGEIF:za,AVERAGEIFS:Ha,COUNT:$a,COUNTA:Wa,COVAR:Ga,COVARIANCE_P:qa,COVARIANCE_S:Za,LARGE:Ya,MAX:ja,MAXA:Xa,MAXIFS:Ka,MEDIAN:Qa,MIN:Ja,MINA:el,MINIFS:tl,PERCENTILE:ol,PERCENTILE_EXC:il,PERCENTILE_INC:sl,QUARTILE:rl,QUARTILE_EXC:nl,QUARTILE_INC:al,SMALL:ll,STDEV:cl,STDEV_P:hl,STDEV_S:dl,STDEVA:ul,STDEVP:gl,STDEVPA:pl,VAR:ml,VAR_P:fl,VAR_S:bl,VARA:vl,VARP:Sl,VARPA:Cl});function wl(e,t,o,i){const s=new Map,n=e.length;for(let t=n-1;t>=0;t--)s.set(Ms(e[t][0]).toUpperCase(),t);if("number"!=typeof t&&"string"!=typeof t)throw new Error(r("The field must be a number or a string"));let a;if("number"==typeof t){if(a=Math.trunc(t)-1,a<0||n-1<a)throw new Error(r("The field (%s) must be one of %s or must be a number between 1 and %s inclusive.",t.toString(),n.toString()))}else{const e=Ms(t).toUpperCase();if(a=s.get(e)??-1,-1===a)throw new Error(r("The field (%s) must be one of %s.",Ms(t),[...s.keys()].toString()))}const l=o[0].length;if(l<2)throw new Error(r("The criteria range contains %s row, it must be at least 2 rows.",l.toString()));let c=new Set;const h=e[0].length;for(let t=1;t<l;t++){let r=[],n=!0;for(let i=0;i<o.length;i++){const a=Ms(o[i][0]).toUpperCase(),l=s.get(a),c=o[i][t];if(void 0!==c){if(void 0===l){n=!1;break}r.push([e[l].slice(1,h)]),r.push(c)}}if(n){if(!(r.length>0)){c=new Set(Array(h-1).keys());break}qs(r,((e,t)=>{c.add(t)}),i,!0)}}const d=e[a];return[...c].map((e=>d[e+1]))}const xl=[Wr("database (range)",r("The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.")),Wr("field (any)",r("Indicates which column in database contains the values to be extracted and operated on.")),Wr("criteria (range)",r("An array or range containing zero or more criteria to filter the database values by before operating."))],yl={description:r("Average of a set of values from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return Pa.compute.bind(this)([i])},isExported:!0},Il={description:r("Counts values from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return $a.compute.bind(this)([i])},isExported:!0},Rl={description:r("Counts values and text from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return Wa.compute.bind(this)([i])},isExported:!0},Tl={description:r("Single value from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return xs((()=>1===i.length),r("More than one match found in DGET evaluation.")),i[0]},isExported:!0},Al={description:r("Maximum of values from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return ja.compute.bind(this)([i])},isExported:!0},Ol={description:r("Minimum of values from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return Ja.compute.bind(this)([i])},isExported:!0},Ml={description:r("Product of values from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return ga.compute.bind(this)([i])},isExported:!0},Nl={description:r("Standard deviation of population sample from table."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return cl.compute.bind(this)([i])},isExported:!0},_l={description:r("Standard deviation of entire population from table."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return gl.compute.bind(this)([i])},isExported:!0},Fl={description:r("Sum of values from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return Ia.compute.bind(this)([i])},isExported:!0},Dl={description:r("Variance of population sample from table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return ml.compute.bind(this)([i])},isExported:!0},Ll={description:r("Variance of a population from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return Sl.compute.bind(this)([i])},isExported:!0};var Pl=Object.freeze({__proto__:null,DAVERAGE:yl,DCOUNT:Il,DCOUNTA:Rl,DGET:Tl,DMAX:Al,DMIN:Ol,DPRODUCT:Ml,DSTDEV:Nl,DSTDEVP:_l,DSUM:Fl,DVAR:Dl,DVARP:Ll});var kl;!function(e){e.WHOLE_YEARS="Y",e.WHOLE_MONTHS="M",e.WHOLE_DAYS="D",e.DAYS_WITHOUT_WHOLE_MONTHS="MD",e.MONTH_WITHOUT_WHOLE_YEARS="YM",e.DAYS_BETWEEN_NO_MORE_THAN_ONE_YEAR="YD"}(kl||(kl={}));const Ul={description:r("Converts year/month/day into a date."),args:[Wr("year (number)",r("The year component of the date.")),Wr("month (number)",r("The month component of the date.")),Wr("day (number)",r("The day component of the date."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e,t,o){let i=Math.trunc(Is(e,this.locale));const s=Math.trunc(Is(t,this.locale)),n=Math.trunc(Is(o,this.locale));xs((()=>0<=i&&i<=9999),r("The year (%s) must be between 0 and 9999 inclusive.",i.toString())),i<1900&&(i+=1900);const a=Bt(new yt(i,s-1,n));return xs((()=>a>=0),r("The function [[FUNCTION_NAME]] result must be greater than or equal 01/01/1900.")),a},isExported:!0},Vl={description:r("Calculates the number of days, months, or years between two dates."),args:[Wr("start_date (date)",r("The start date to consider in the calculation. Must be a reference to a cell containing a DATE, a function returning a DATE type, or a number.")),Wr("end_date (date)",r("The end date to consider in the calculation. Must be a reference to a cell containing a DATE, a function returning a DATE type, or a number.")),Wr("unit (string)",r('A text abbreviation for unit of time. Accepted values are "Y" (the number of whole years between start_date and end_date), "M" (the number of whole months between start_date and end_date), "D" (the number of days between start_date and end_date), "MD" (the number of days between start_date and end_date after subtracting whole months), "YM" (the number of whole months between start_date and end_date after subtracting whole years), "YD" (the number of days between start_date and end_date, assuming start_date and end_date were no more than one year apart).'))],returns:["NUMBER"],compute:function(e,t,o){const i=Ms(o).toUpperCase();xs((()=>Object.values(kl).includes(i)),((e,t)=>{const o=e.map((e=>`'${e}'`)).join(", ");return r("The function [[FUNCTION_NAME]] has an argument with value '%s'. It should be one of: %s.",t,o)})(Object.values(kl),Ms(o)));const s=Math.trunc(Is(e,this.locale)),n=Math.trunc(Is(t,this.locale)),a=Vt(s),l=Vt(n);switch(xs((()=>n>=s),r("start_date (%s) should be on or before end_date (%s).",a.toLocaleDateString(),l.toLocaleDateString())),i){case kl.WHOLE_YEARS:return Yt(a,l);case kl.WHOLE_MONTHS:return qt(a,l);case kl.WHOLE_DAYS:return Zt(a,l);case kl.MONTH_WITHOUT_WHOLE_YEARS:return qt(a,l)-12*Yt(a,l);case kl.DAYS_WITHOUT_WHOLE_MONTHS:let e=l.getDate()-a.getDate();if(e<0){e=zt(new yt(l.getFullYear(),l.getMonth()-1,1))-Math.abs(e)}return e;case kl.DAYS_BETWEEN_NO_MORE_THAN_ONE_YEAR:{if(function(e,t){return Gt(e,t,1)<1}(s,n))return Zt(a,l);const e=new yt(a.getFullYear(),l.getMonth(),l.getDate());let t=Zt(a,e);return t<0&&(e.setFullYear(a.getFullYear()+1),t=Zt(a,e)),t}}},isExported:!0},Bl={description:r("Converts a date string to a date value."),args:[Wr("date_string (string)",r("The string representing the date."))],returns:["NUMBER"],compute:function(e){const t=Ms(e),o=Ut(t,this.locale);return xs((()=>null!==o),r("The date_string (%s) cannot be parsed to date/time.",t.toString())),Math.trunc(o.value)},isExported:!0},zl={description:r("Day of the month that a specific date falls on."),args:[Wr("date (string)",r("The date from which to extract the day."))],returns:["NUMBER"],compute:function(e){return Ls(e,this.locale).getDate()},isExported:!0},Hl={description:r("Number of days between two dates."),args:[Wr("end_date (date)",r("The end of the date range.")),Wr("start_date (date)",r("The start of the date range."))],returns:["NUMBER"],compute:function(e,t){const o=Ls(e,this.locale),i=Ls(t,this.locale),s=o.getTime()-i.getTime();return Math.round(s/Rt)},isExported:!0},$l={description:r("Number of days between two dates on a 360-day year (months of 30 days)."),args:[Wr("start_date (date)",r("The start date to consider in the calculation.")),Wr("end_date (date)",r("The end date to consider in the calculation.")),Wr("method (number, default=0)",r("An indicator of what day count method to use. (0) US NASD method (1) European method"))],returns:["NUMBER"],compute:function(e,t,o=0){const i=Is(e,this.locale),s=Is(t,this.locale),r=Ds(o)?4:0,n=cc.compute.bind(this)(e,t,r);return Math.sign(s-i)*Math.round(360*n)},isExported:!0},Wl={description:r("Date a number of months before/after another date."),args:[Wr("start_date (date)",r("The date from which to calculate the result.")),Wr("months (number)",r("The number of months before (negative) or after (positive) 'start_date' to calculate."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e,t){return Bt($t(Ls(e,this.locale),Math.trunc(Is(t,this.locale)),!1))},isExported:!0},Gl={description:r("Last day of a month before or after a date."),args:[Wr("start_date (date)",r("The date from which to calculate the result.")),Wr("months (number)",r("The number of months before (negative) or after (positive) 'start_date' to consider."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e,t){const o=Ls(e,this.locale),i=Math.trunc(Is(t,this.locale)),s=o.getFullYear(),r=o.getMonth();return Bt(new yt(s,r+i+1,0))},isExported:!0},ql={description:r("Hour component of a specific time."),args:[Wr("time (date)",r("The time from which to calculate the hour component."))],returns:["NUMBER"],compute:function(e){return Ls(e,this.locale).getHours()},isExported:!0},Zl={description:r("ISO week number of the year."),args:[Wr("date (date)",r("The date for which to determine the ISO week number. Must be a reference to a cell containing a date, a function returning a date type, or a number."))],returns:["NUMBER"],compute:function(e){const t=Ls(e,this.locale),o=t.getFullYear();let i=1;for(;4!==new yt(o,0,i).getDay();)i+=1;const s=new yt(o,0,i-3);let r=31;for(;4!==new yt(o,11,r).getDay();)r-=1;const n=new yt(o,11,r+3);let a,l;switch(a=s.getTime()<=t.getTime()?t.getTime()<=n.getTime()?0:1:-1,a){case 0:l=s;break;case 1:l=new yt(o,11,r+3+1);break;case-1:let e=1;for(;4!==new yt(o-1,0,e).getDay();)e+=1;l=new yt(o-1,0,e-3)}const c=(t.getTime()-l.getTime())/Rt;return Math.floor(c/7)+1},isExported:!0},Yl={description:r("Minute component of a specific time."),args:[Wr("time (date)",r("The time from which to calculate the minute component."))],returns:["NUMBER"],compute:function(e){return Ls(e,this.locale).getMinutes()},isExported:!0},jl={description:r("Month of the year a specific date falls in"),args:[Wr("date (date)",r("The date from which to extract the month."))],returns:["NUMBER"],compute:function(e){return Ls(e,this.locale).getMonth()+1},isExported:!0},Xl={description:r("Net working days between two provided days."),args:[Wr("start_date (date)",r("The start date of the period from which to calculate the number of net working days.")),Wr("end_date (date)",r("The end date of the period from which to calculate the number of net working days.")),Wr("holidays (date, range<date>, optional)",r("A range or array constant containing the date serial numbers to consider holidays."))],returns:["NUMBER"],compute:function(e,t,o){return Ql.compute.bind(this)(e,t,1,o)},isExported:!0};function Kl(e){if("string"==typeof e){xs((()=>{if(7!==e.length)return!1;for(let t of e)if("0"!==t&&"1"!==t)return!1;return!0}),r('When weekend is a string (%s) it must be composed of "0" or "1".',e));let t=[];for(let o=0;o<7;o++)"1"===e[o]&&t.push((o+1)%7);return t}if("number"==typeof e)return xs((()=>1<=e&&e<=7||11<=e&&e<=17),r("The weekend (%s) must be a string or a number in the range 1-7 or 11-17.",e.toString())),e<=7?[e-2==-1?6:e-2,e-1]:[e-11];throw Error(r("The weekend must be a number or a string."))}const Ql={description:r("Net working days between two dates (specifying weekends)."),args:[Wr("start_date (date)",r("The start date of the period from which to calculate the number of net working days.")),Wr("end_date (date)",r("The end date of the period from which to calculate the number of net working days.")),Wr("weekend (any, default=1)",r("A number or string representing which days of the week are considered weekends.")),Wr("holidays (date, range<date>, optional)",r("A range or array constant containing the dates to consider as holidays."))],returns:["NUMBER"],compute:function(e,t,o=1,i){const s=Ls(e,this.locale),r=Ls(t,this.locale),n=Kl(o);let a=new Set;void 0!==i&&ks([i],(e=>{const t=Ls(e,this.locale);a.add(t.getTime())}));const l=s.getTime()>r.getTime(),c=yt.fromTimestamp((l?s:r).getTime());let h=yt.fromTimestamp((l?r:s).getTime());const d=c.getTime();let u=h.getTime(),g=0;for(;u<=d;)n.includes(h.getDay())||a.has(u)||(g+=1),h.setDate(h.getDate()+1),u=h.getTime();return l?-g:g},isExported:!0},Jl={description:r("Current date and time as a date value."),args:[],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat+" "+this.locale.timeFormat},compute:function(){let e=yt.now();const t=e.getTime()-It.getTime(),o=e.getHours()/24+e.getMinutes()/1440+e.getSeconds()/86400;return Math.floor(t/Rt)+o},isExported:!0},ec={description:r("Minute component of a specific time."),args:[Wr("time (date)",r("The time from which to calculate the second component."))],returns:["NUMBER"],compute:function(e){return Ls(e,this.locale).getSeconds()},isExported:!0},tc={description:r("Converts hour/minute/second into a time."),args:[Wr("hour (number)",r("The hour component of the time.")),Wr("minute (number)",r("The minute component of the time.")),Wr("second (number)",r("The second component of the time."))],returns:["DATE"],computeFormat:function(){return this.locale.timeFormat},compute:function(e,t,o){let i=Math.trunc(Is(e,this.locale)),s=Math.trunc(Is(t,this.locale)),n=Math.trunc(Is(o,this.locale));return s+=Math.floor(n/60),n=n%60+(n<0?60:0),i+=Math.floor(s/60),s=s%60+(s<0?60:0),i%=24,xs((()=>i>=0),r("The function [[FUNCTION_NAME]] result cannot be negative")),i/24+s/1440+n/86400},isExported:!0},oc={description:r("Converts a time string into its serial number representation."),args:[Wr("time_string (string)",r("The string that holds the time representation."))],returns:["NUMBER"],compute:function(e){const t=Ms(e),o=Ut(t,this.locale);xs((()=>null!==o),r("The time_string (%s) cannot be parsed to date/time.",t));const i=o.value-Math.trunc(o.value);return i<0?1+i:i},isExported:!0},ic={description:r("Current date as a date value."),args:[],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(){const e=yt.now();return Bt(new yt(e.getFullYear(),e.getMonth(),e.getDate()))},isExported:!0},sc={description:r("Day of the week of the date provided (as number)."),args:[Wr("date (date)",r("The date for which to determine the day of the week. Must be a reference to a cell containing a date, a function returning a date type, or a number.")),Wr("type (number, default=1)",r("A number indicating which numbering system to use to represent weekdays. By default, counts starting with Sunday = 1."))],returns:["NUMBER"],compute:function(e,t=1){const o=Ls(e,this.locale),i=Math.round(Is(t,this.locale)),s=o.getDay();return xs((()=>[1,2,3].includes(i)),r("The type (%s) must be 1, 2 or 3.",i.toString())),1===i?s+1:2===i?0===s?7:s:0===s?6:s-1},isExported:!0},rc={description:r("Week number of the year."),args:[Wr("date (date)",r("The date for which to determine the week number. Must be a reference to a cell containing a date, a function returning a date type, or a number.")),Wr("type (number, default=1)",r("A number representing the day that a week starts on. Sunday = 1."))],returns:["NUMBER"],compute:function(e,t=1){const o=Ls(e,this.locale),i=Math.round(Is(t,this.locale));if(xs((()=>1===i||2===i||11<=i&&i<=17||21===i),r("The type (%s) is out of range.",i.toString())),21===i)return Zl.compute.bind(this)(e);let s;s=1===i||2===i?i-1:i-10==7?0:i-10;const n=o.getFullYear();let a=1,l=new yt(n,0,a);for(;l.getDay()!==s;)a+=1,l=new yt(n,0,a);const c=(o.getTime()-l.getTime())/Rt;return c<0?1:Math.floor(c/7)+(1===a?1:2)},isExported:!0},nc={description:r("Date after a number of workdays."),args:[Wr("start_date (date)",r("The date from which to begin counting.")),Wr("num_days (number)",r("The number of working days to advance from start_date. If negative, counts backwards.")),Wr("holidays (date, range<date>, optional)",r("A range or array constant containing the dates to consider holidays."))],returns:["NUMBER"],computeFormat:function(){return this.locale.dateFormat},compute:function(e,t,o){return ac.compute.bind(this)(e,t,1,o)},isExported:!0},ac={description:r("Date after a number of workdays (specifying weekends)."),args:[Wr("start_date (date)",r("The date from which to begin counting.")),Wr("num_days (number)",r("The number of working days to advance from start_date. If negative, counts backwards.")),Wr("weekend (any, default=1)",r("A number or string representing which days of the week are considered weekends.")),Wr("holidays (date, range<date>, optional)",r("A range or array constant containing the dates to consider holidays."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e,t,o=1,i){let s=Ls(e,this.locale),n=Math.trunc(Is(t,this.locale));"string"==typeof o&&xs((()=>"1111111"!==o),r("The weekend (%s) must be different from '1111111'.",o));const a=Kl(o);let l=new Set;void 0!==i&&ks([i],(e=>{const t=Ls(e,this.locale);l.add(t.getTime())}));let c=yt.fromTimestamp(s.getTime()),h=c.getTime();const d=Math.sign(n);let u=Math.abs(n);for(;u>0;)c.setDate(c.getDate()+d),h=c.getTime(),a.includes(c.getDay())||l.has(h)||(u-=1);const g=h-It.getTime();return Math.round(g/Rt)},isExported:!0},lc={description:r("Year specified by a given date."),args:[Wr("date (date)",r("The date from which to extract the year."))],returns:["NUMBER"],compute:function(e){return Ls(e,this.locale).getFullYear()},isExported:!0},cc={description:r("Exact number of years between two dates."),args:[Wr("start_date (date)",r("The start date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number.")),Wr("end_date (date)",r("The end date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number.")),Wr("day_count_convention (number, default=0)",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o=0){let i=Math.trunc(Is(e,this.locale)),s=Math.trunc(Is(t,this.locale));const n=Math.trunc(Is(o,this.locale));return xs((()=>i>=0),r("The start_date (%s) must be positive or null.",i.toString())),xs((()=>s>=0),r("The end_date (%s) must be positive or null.",s.toString())),xs((()=>0<=n&&n<=4),r("The day_count_convention (%s) must be between 0 and 4 inclusive.",n.toString())),Gt(i,s,n)}},hc={description:r("First day of the month preceding a date."),args:[Wr("date (date)",r("The date from which to calculate the result."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e){const t=Ls(e,this.locale),o=t.getFullYear(),i=t.getMonth();return Bt(new yt(o,i,1))}},dc={description:r("Last day of the month following a date."),args:[Wr("date (date)",r("The date from which to calculate the result."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e){return Gl.compute.bind(this)(e,0)}},uc={description:r("Quarter of the year a specific date falls in"),args:[Wr("date (date)",r("The date from which to extract the quarter."))],returns:["NUMBER"],compute:function(e){return Math.ceil((Ls(e,this.locale).getMonth()+1)/3)}},gc={description:r("First day of the quarter of the year a specific date falls in."),args:[Wr("date (date)",r("The date from which to calculate the start of quarter."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e){const t=uc.compute.bind(this)(e),o=lc.compute.bind(this)(e);return Bt(new yt(o,3*(t-1),1))}},pc={description:r("Last day of the quarter of the year a specific date falls in."),args:[Wr("date (date)",r("The date from which to calculate the end of quarter."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e){const t=uc.compute.bind(this)(e),o=lc.compute.bind(this)(e);return Bt(new yt(o,3*t,0))}},mc={description:r("First day of the year a specific date falls in."),args:[Wr("date (date)",r("The date from which to calculate the start of the year."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e){const t=lc.compute.bind(this)(e);return Bt(new yt(t,0,1))}},fc={description:r("Last day of the year a specific date falls in."),args:[Wr("date (date)",r("The date from which to calculate the end of the year."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e){const t=lc.compute.bind(this)(e);return Bt(new yt(t+1,0,0))}};var bc=Object.freeze({__proto__:null,DATE:Ul,DATEDIF:Vl,DATEVALUE:Bl,DAY:zl,DAYS:Hl,DAYS360:$l,EDATE:Wl,EOMONTH:Gl,HOUR:ql,ISOWEEKNUM:Zl,MINUTE:Yl,MONTH:jl,NETWORKDAYS:Xl,NETWORKDAYS_INTL:Ql,NOW:Jl,SECOND:ec,TIME:tc,TIMEVALUE:oc,TODAY:ic,WEEKDAY:sc,WEEKNUM:rc,WORKDAY:nc,WORKDAY_INTL:ac,YEAR:lc,YEARFRAC:cc,MONTH_START:hc,MONTH_END:dc,QUARTER:uc,QUARTER_START:gc,QUARTER_END:pc,YEAR_START:mc,YEAR_END:fc});const vc={description:r("Compare two numeric values, returning 1 if they're equal."),args:[Wr("number1 (number)",r("The first number to compare.")),Wr("number2 (number, default=0)",r("The second number to compare."))],returns:["NUMBER"],compute:function(e,t=0){return Is(e,this.locale)===Is(t,this.locale)?1:0},isExported:!0};var Sc=Object.freeze({__proto__:null,DELTA:vc});const Cc={description:r("Returns a filtered version of the source range, returning only rows or columns that meet the specified conditions."),args:[Wr("range (any, range<any>)",r("The data to be filtered.")),Wr("condition1 (boolean, range<boolean>)",r("A column or row containing true or false values corresponding to the first column or row of range.")),Wr("condition2 (boolean, range<boolean>, repeating)",r("Additional column or row containing true or false values."))],returns:["RANGE<ANY>"],compute:function(e,...t){let o=er(e);const i=t.map((e=>er(e)));i.map((e=>qr(r("The arguments condition must be a single column or row."),e))),Zr(r("The arguments conditions must have the same dimensions."),...i);const s=i.map((e=>e.flat())),n=1===i[0].length?"row":"col";o="row"===n?Ze(o):o,xs((()=>s.every((e=>e.length===o.length))),r("FILTER has mismatched sizes on the range and conditions."));const a=[];for(let e=0;e<o.length;e++){const t=o[e];s.every((t=>t[e]))&&a.push(t)}if(!a.length)throw new g(r("No match found in FILTER evaluation"));return Qs("row"===n?Ze(a):a)},isExported:!0},Ec={description:r("Unique rows in the provided source range."),args:[Wr("range (any, range<any>)",r("The data to filter by unique entries.")),Wr("by_column (boolean, default=FALSE)",r("Whether to filter the data by columns or by rows.")),Wr("exactly_once (boolean, default=FALSE)",r("Whether to return only entries with no duplicates."))],returns:["RANGE<NUMBER>"],compute:function(e,t,o){if(!Ss(e))return Js(e);const i=Ds(t)||!1,s=Ds(o)||!1;i||(e=Ze(e));const n=new Map;for(const t of e){const e=JSON.stringify(t),o=n.get(e);o?o.count++:n.set(e,{val:t,count:1})}const a=s?[...n.values()].filter((e=>1===e.count)).map((e=>e.val)):[...n.values()].map((e=>e.val));if(!a.length)throw new Error(r("No unique values found"));return Qs(i?a:Ze(a))},isExported:!0};var wc=Object.freeze({__proto__:null,FILTER:Cc,UNIQUE:Ec});function xc(e,t){xs((()=>e<t),r("The maturity (%s) must be strictly greater than the settlement (%s).",t.toString(),e.toString()))}function yc(e,t){xs((()=>t<e),r("The settlement date (%s) must be strictly greater than the issue date (%s).",e.toString(),t.toString()))}function Ic(e){xs((()=>[1,2,4].includes(e)),r("The frequency (%s) must be one of %s",e.toString(),[1,2,4].toString()))}function Rc(e){xs((()=>0<=e&&e<=4),r("The day_count_convention (%s) must be between 0 and 4 inclusive.",e.toString()))}function Tc(e){xs((()=>e>0),r("The redemption (%s) must be strictly positive.",e.toString()))}function Ac(e){xs((()=>e>0),r("The price (%s) must be strictly positive.",e.toString()))}function Oc(e){xs((()=>e>0),r("The number_of_periods (%s) must be greater than 0.",e.toString()))}function Mc(e){xs((()=>e>0),r("The rate (%s) must be strictly positive.",e.toString()))}function Nc(e){xs((()=>e>0),r("The life (%s) must be strictly positive.",e.toString()))}function _c(e){xs((()=>e>=0),r("The cost (%s) must be positive or null.",e.toString()))}function Fc(e){xs((()=>e>0),r("The period (%s) must be strictly positive.",e.toString()))}function Dc(e){xs((()=>e>=0),r("The salvage (%s) must be positive or null.",e.toString()))}function Lc(e){xs((()=>e>0),r("The present value (%s) must be strictly positive.",e.toString()))}function Pc(e,t){xs((()=>e<=t),r("The period (%s) must be less than or equal life (%s).",e.toString(),t.toString()))}function kc(e){xs((()=>e>0),r("The investment (%s) must be strictly positive.",e.toString()))}function Uc(e){xs((()=>e>0),r("The discount (%s) must be strictly positive.",e.toString()))}function Vc(e){xs((()=>e<1),r("The discount (%s) must be smaller than 1.",e.toString()))}function Bc(e){xs((()=>e>0),r("The depreciation factor (%s) must be strictly positive.",e.toString()))}function zc(e,t,o){const i=Ls(e,o),s=Ls(t,o),n=Ls(e,o);n.setFullYear(i.getFullYear()+1),xs((()=>s.getTime()<=n.getTime()),r("The settlement date (%s) must at most one year after the maturity date (%s).",e.toString(),t.toString()))}function Hc(e,t,o){Oc(o),xs((()=>e>0),r("The first_period (%s) must be strictly positive.",e.toString())),xs((()=>t>0),r("The last_period (%s) must be strictly positive.",t.toString())),xs((()=>e<=t),r("The first_period (%s) must be smaller or equal to the last_period (%s).",e.toString(),t.toString())),xs((()=>t<=o),r("The last_period (%s) must be smaller or equal to the number_of_periods (%s).",e.toString(),o.toString()))}function $c(e){xs((()=>e>-1),r("The rate_guess (%s) must be strictly greater than -1.",e.toString()))}function Wc(e,t){xs((()=>e.length===t.length&&e[0].length===t[0].length),r("The cashflow_amounts and cashflow_dates ranges must have the same dimensions."))}function Gc(e){xs((()=>e.every((t=>t>=e[0]))),r("All the dates should be greater or equal to the first date in cashflow_dates (%s).",e[0].toString()))}const qc=[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("frequency (number)",r("The number of interest or coupon payments per year (1, 2, or 4).")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))];function Zc(e,t,o,i,s=1e-10,n){let a,l,c,h,d=o,u=!1,g=0;do{c=e(d),isNaN(c)?(xs((()=>g<i&&void 0!==n),r("Function [[FUNCTION_NAME]] didn't find any result.")),g++,d=n(h),h=d):(a=d-c/t(d),l=Math.abs(a-d),d=a,u=l<s||Math.abs(c)<s,xs((()=>g<i),r("Function [[FUNCTION_NAME]] didn't find any result.")),g++)}while(!u);return d}const Yc={description:r("Accrued interest of security paying at maturity."),args:[Wr("issue (date)",r("The date the security was initially issued.")),Wr("maturity (date)",r("The maturity date of the security.")),Wr("rate (number)",r("The annualized rate of interest.")),Wr("redemption (number)",r("The redemption amount per 100 face value, or par.")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s=0){s=s||0;const r=Math.trunc(Is(e,this.locale)),n=Math.trunc(Is(t,this.locale)),a=Is(i,this.locale),l=Is(o,this.locale),c=Math.trunc(Is(s,this.locale));yc(n,r),Rc(c),Tc(a),Mc(l);return a*l*cc.compute.bind(this)(r,n,s)},isExported:!0},jc={description:r("Depreciation for an accounting period."),args:[Wr("cost (number)",r("The initial cost of the asset.")),Wr("purchase_date (date)",r("The date the asset was purchased.")),Wr("first_period_end (date)",r("The date the first period ended.")),Wr("salvage (number)",r("The value of the asset at the end of depreciation.")),Wr("period (number)",r("The single period within life for which to calculate depreciation.")),Wr("rate (number)",r("The deprecation rate.")),Wr("day_count_convention (number, optional)",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s,n,a=0){a=a||0;const l=Is(e,this.locale),c=Math.trunc(Is(t,this.locale)),h=Math.trunc(Is(o,this.locale)),d=Is(i,this.locale),u=Is(s,this.locale),g=Is(n,this.locale),p=Math.trunc(Is(a,this.locale));!function(e){xs((()=>e>0),r("The cost (%s) must be strictly positive.",e.toString()))}(l),Dc(d),function(e,t){xs((()=>e<=t),r("The salvage (%s) must be smaller or equal than the cost (%s).",e.toString(),t.toString()))}(d,l),function(e){xs((()=>e>=0),r("The period (%s) must be positive or null.",e.toString()))}(u),Mc(g),Rc(p),xs((()=>c<=h),r("The purchase_date (%s) must be before the first_period_end (%s).",c.toString(),h.toString()));const m=u<1&&u>0?1:Math.trunc(u),f=l*g,b=cc.compute.bind(this)(c,h,p),v=c===h?f:f*b,S=l-v-f*m;return S>=d?0===m?v:f:d-S<f?f-(d-S):0},isExported:!0},Xc={description:r("Days in coupon period containing settlement date."),args:qc,returns:["NUMBER"],compute:function(e,t,o,i=0){i=i||0;const s=Math.trunc(Is(e,this.locale)),r=Math.trunc(Is(t,this.locale)),n=Math.trunc(Is(o,this.locale)),a=Math.trunc(Is(i,this.locale));if(xc(s,r),Ic(n),Rc(a),1===a){const s=th.compute.bind(this)(e,t,o,i);return Jc.compute.bind(this)(e,t,o,i)-s}return(3===a?365:360)/n},isExported:!0},Kc={description:r("Days from settlement until next coupon."),args:qc,returns:["NUMBER"],compute:function(e,t,o,i=0){i=i||0;const s=Math.trunc(Is(e,this.locale)),r=Math.trunc(Is(t,this.locale)),n=Math.trunc(Is(o,this.locale)),a=Math.trunc(Is(i,this.locale));xc(s,r),Ic(n),Rc(a);const l=th.compute.bind(this)(s,r,o,i);if([1,2,3].includes(a))return s-l;if(4===a){const e=Gt(l,s,a);return Math.round(360*e)}const c=Ls(s,this.locale),h=Ls(l,this.locale),d=h.getFullYear(),u=c.getFullYear(),g=h.getMonth()+1,p=c.getMonth()+1;let m=h.getDate(),f=c.getDate();return 2===g&&2===p&&Ht(h)&&Ht(c)&&(f=30),31!==f||30!==m&&31!==m||(f=30),2===g&&Ht(h)&&(m=30),31===m&&(m=30),360*(u-d)+30*(p-g)+(f-m)},isExported:!0},Qc={description:r("Days from settlement until next coupon."),args:qc,returns:["NUMBER"],compute:function(e,t,o,i=0){i=i||0;const s=Math.trunc(Is(e,this.locale)),r=Math.trunc(Is(t,this.locale)),n=Math.trunc(Is(o,this.locale)),a=Math.trunc(Is(i,this.locale));xc(s,r),Ic(n),Rc(a);const l=Jc.compute.bind(this)(s,r,o,i);if([1,2,3].includes(a))return l-s;if(4===a){const e=Gt(s,l,a);return Math.round(360*e)}const c=Kc.compute.bind(this)(e,t,o,a);return Xc.compute.bind(this)(e,t,o,a)-c},isExported:!0},Jc={description:r("Next coupon date after the settlement date."),args:qc,returns:["NUMBER"],computeFormat:function(){return this.locale.dateFormat},compute:function(e,t,o,i=0){i=i||0;const s=Math.trunc(Is(e,this.locale)),r=Math.trunc(Is(t,this.locale)),n=Math.trunc(Is(o,this.locale)),a=Math.trunc(Is(i,this.locale));xc(s,r),Ic(n),Rc(a);const l=12/n,c=eh.compute.bind(this)(e,t,o,i);return Bt($t(Ls(r,this.locale),-(c-1)*l,!0))},isExported:!0},eh={description:r("Number of coupons between settlement and maturity."),args:qc,returns:["NUMBER"],compute:function(e,t,o,i=0){i=i||0;const s=Math.trunc(Is(e,this.locale)),r=Math.trunc(Is(t,this.locale)),n=Math.trunc(Is(o,this.locale)),a=Math.trunc(Is(i,this.locale));xc(s,r),Ic(n),Rc(a);let l=1,c=r;const h=12/n;for(;c>s;)c=Bt($t(Ls(c,this.locale),-h,!1)),l++;return l-1},isExported:!0},th={description:r("Last coupon date prior to or on the settlement date."),args:qc,returns:["NUMBER"],computeFormat:function(){return this.locale.dateFormat},compute:function(e,t,o,i=0){i=i||0;const s=Math.trunc(Is(e,this.locale)),r=Math.trunc(Is(t,this.locale)),n=Math.trunc(Is(o,this.locale)),a=Math.trunc(Is(i,this.locale));xc(s,r),Ic(n),Rc(a);const l=12/n,c=eh.compute.bind(this)(e,t,o,i);return Bt($t(Ls(r,this.locale),-c*l,!0))},isExported:!0},oh={description:r("Cumulative interest paid over a set of periods."),args:[Wr("rate (number)",r("The interest rate.")),Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("present_value (number)",r("The current value of the annuity.")),Wr("first_period (number)",r("The number of the payment period to begin the cumulative calculation.")),Wr("last_period (number)",r("The number of the payment period to end the cumulative calculation.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period."))],returns:["NUMBER"],compute:function(e,t,o,i,s,r=0){const n=Is(i,this.locale),a=Is(s,this.locale),l=Is(e,this.locale),c=Is(o,this.locale),h=Is(t,this.locale);Hc(n,a,h),Mc(l),Lc(c);let d=0;for(let t=n;t<=a;t++){d+=ph.compute.bind(this)(e,t,h,o,0,r)}return d},isExported:!0},ih={description:r("Cumulative principal paid over a set of periods."),args:[Wr("rate (number)",r("The interest rate.")),Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("present_value (number)",r("The current value of the annuity.")),Wr("first_period (number)",r("The number of the payment period to begin the cumulative calculation.")),Wr("last_period (number)",r("The number of the payment period to end the cumulative calculation.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period."))],returns:["NUMBER"],compute:function(e,t,o,i,s,r=0){const n=Is(i,this.locale),a=Is(s,this.locale),l=Is(e,this.locale),c=Is(o,this.locale),h=Is(t,this.locale);Hc(n,a,h),Mc(l),Lc(c);let d=0;for(let t=n;t<=a;t++){d+=yh.compute.bind(this)(e,t,h,o,0,r)}return d},isExported:!0},sh={description:r("Depreciation via declining balance method."),args:[Wr("cost (number)",r("The initial cost of the asset.")),Wr("salvage (number)",r("The value of the asset at the end of depreciation.")),Wr("life (number)",r("The number of periods over which the asset is depreciated.")),Wr("period (number)",r("The single period within life for which to calculate depreciation.")),Wr("month (number, optional)",r("The number of months in the first year of depreciation."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o,i,...s){const n=Is(e,this.locale),a=Is(t,this.locale),l=Is(o,this.locale),c=Math.trunc(Is(i,this.locale)),h=s.length?Math.trunc(Is(s[0],this.locale)):12,d=l+(12===h?0:1);_c(n),Dc(a),Fc(c),Nc(l),xs((()=>1<=h&&h<=12),r("The month (%s) must be between 1 and 12 inclusive.",h.toString())),xs((()=>c<=d),r("The period (%s) must be less than or equal to %s.",c.toString(),d.toString()));const u=h/12;let g=1-Math.pow(a/n,1/l);g=Math.round(1e3*g)/1e3;let p=n,m=n*(1-g*u);for(let e=1;e<c;e++)p=m,m=p*(1-g),e===l&&(m=p*(1-g*(1-u)));return p-m},isExported:!0},rh={description:r("Depreciation via double-declining balance method."),args:[Wr("cost (number)",r("The initial cost of the asset.")),Wr("salvage (number)",r("The value of the asset at the end of depreciation.")),Wr("life (number)",r("The number of periods over which the asset is depreciated.")),Wr("period (number)",r("The single period within life for which to calculate depreciation.")),Wr("factor (number, default=2)",r("The factor by which depreciation decreases."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o,i,s=2){s=s||0;const r=Is(e,this.locale),n=Is(t,this.locale),a=Is(o,this.locale),l=Is(i,this.locale),c=Is(s,this.locale);if(_c(r),Dc(n),Fc(l),Nc(a),Pc(l,a),Bc(c),0===r||n>=r)return 0;const h=c/a;if(h>1)return 1===i?r-n:0;if(l<=1)return r*h;const d=r*Math.pow(1-h,l-1),u=r*Math.pow(1-h,l),g=u<n?d-n:d-u;return Math.max(g,0)},isExported:!0},nh={description:r("Discount rate of a security based on price."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("price (number)",r("The price at which the security is bought per 100 face value.")),Wr("redemption (number)",r("The redemption amount per 100 face value, or par.")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s=0){s=s||0;const r=Math.trunc(Is(e,this.locale)),n=Math.trunc(Is(t,this.locale)),a=Is(o,this.locale),l=Is(i,this.locale),c=Math.trunc(Is(s,this.locale));xc(r,n),Rc(c),Ac(a),Tc(l);return(l-a)/l/cc.compute.bind(this)(r,n,c)},isExported:!0},ah={description:r("Convert a decimal fraction to decimal value."),args:[Wr("fractional_price (number)",r("The price quotation given using fractional decimal conventions.")),Wr("unit (number)",r("The units of the fraction, e.g. 8 for 1/8ths or 32 for 1/32nds."))],returns:["NUMBER"],compute:function(e,t){const o=Is(e,this.locale),i=Math.trunc(Is(t,this.locale));xs((()=>i>0),r("The unit (%s) must be strictly positive.",i.toString()));const s=Math.trunc(o);return s+(o-s)*(10**Math.ceil(Math.log10(i))/i)},isExported:!0},lh={description:r("Convert a decimal value to decimal fraction."),args:[Wr("decimal_price (number)",r("The price quotation given as a decimal value.")),Wr("unit (number)",r("The units of the desired fraction, e.g. 8 for 1/8ths or 32 for 1/32nds."))],returns:["NUMBER"],compute:function(e,t){const o=Is(e,this.locale),i=Math.trunc(Is(t,this.locale));xs((()=>i>0),r("The unit (%s) must be strictly positive.",i.toString()));const s=Math.trunc(o);return s+(o-s)*(i/10**Math.ceil(Math.log10(i)))},isExported:!0},ch={description:r("Number of periods for an investment to reach a value."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("rate (number)",r("The annualized rate of interest.")),Wr("yield (number)",r("The expected annual yield of the security.")),Wr("frequency (number)",r("The number of interest or coupon payments per year (1, 2, or 4).")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s,n=0){n=n||0;const a=Math.trunc(Is(e,this.locale)),l=Math.trunc(Is(t,this.locale)),c=Is(o,this.locale),h=Is(i,this.locale),d=Math.trunc(Is(s,this.locale)),u=Math.trunc(Is(n,this.locale));xc(a,l),Ic(d),Rc(u),xs((()=>c>=0),r("The rate (%s) must be positive or null.",c.toString())),xs((()=>h>=0),r("The yield (%s) must be positive or null.",h.toString()));const g=cc.compute.bind(this)(a,l,u),p=g-Math.trunc(g)||1/d,m=Math.ceil(g*d),f=c/d,b=h/d;let v=0,S=0;for(let e=1;e<=m;e++){const t=(f+(e===m?1:0))/(1+b)**e;S+=(p+(e-1)/d)*t,v+=t}return 0===v?0:S/v},isExported:!0},hh={description:r("Annual effective interest rate."),args:[Wr("nominal_rate (number)",r("The nominal interest rate per year.")),Wr("periods_per_year (number)",r("The number of compounding periods per year."))],returns:["NUMBER"],compute:function(e,t){const o=Is(e,this.locale),i=Math.trunc(Is(t,this.locale));return xs((()=>o>0),r("The nominal rate (%s) must be strictly greater than 0.",o.toString())),xs((()=>i>0),r("The number of periods by year (%s) must strictly greater than 0.",i.toString())),Math.pow(1+o/i,i)-1},isExported:!0},dh={description:r("Future value of an annuity investment."),args:[Wr("rate (number)",r("The interest rate.")),Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("payment_amount (number)",r("The amount per period to be paid.")),Wr("present_value (number, default=0)",r("The current value of the annuity.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o,i=0,s=0){i=i||0,s=s||0;const r=Is(e,this.locale),n=Is(t,this.locale),a=Is(o,this.locale),l=Is(i,this.locale),c=Ds(s)?1:0;return r?-l*(1+r)**n-a*(1+r*c)*((1+r)**n-1)/r:-(l+a*n)},isExported:!0},uh={description:r("Future value of principal from series of rates."),args:[Wr("principal (number)",r("The amount of initial capital or value to compound against.")),Wr("rate_schedule (number, range<number>)",r("A series of interest rates to compound against the principal."))],returns:["NUMBER"],compute:function(e,t){return Bs([t],((e,t)=>e*(1+Is(t,this.locale))),Is(e,this.locale))},isExported:!0},gh={description:r("Calculates effective interest rate."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("investment (number)",r("The amount invested in the security.")),Wr("redemption (number)",r("The amount to be received at maturity.")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s=0){const r=Math.trunc(Is(e,this.locale)),n=Math.trunc(Is(t,this.locale)),a=Is(i,this.locale),l=Is(o,this.locale);xc(r,n),kc(l),Tc(a);return(a-l)/l/cc.compute.bind(this)(r,n,s)},isExported:!0},ph={description:r("Payment on the principal of an investment."),args:[Wr("rate (number)",r("The annualized rate of interest.")),Wr("period (number)",r("The amortization period, in terms of number of periods.")),Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("present_value (number)",r("The current value of the annuity.")),Wr("future_value (number, default=0)",r("The future value remaining after the final payment has been made.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o,i,s=0,r=0){return xh.compute.bind(this)(e,o,i,s,r)-yh.compute.bind(this)(e,t,o,i,s,r)},isExported:!0},mh={description:r("Internal rate of return given periodic cashflows."),args:[Wr("cashflow_amounts (number, range<number>)",r("An array or range containing the income or payments associated with the investment.")),Wr("rate_guess (number, default=0.1)",r("An estimate for what the internal rate of return will be."))],returns:["NUMBER"],computeFormat:()=>"0%",compute:function(e,t=.1){const o=Is(t,this.locale);$c(o);let i=!1,s=!1,n=[];Us([e],(e=>{e>0&&(i=!0),e<0&&(s=!0),n.push(e)}),this.locale),xs((()=>i&&s),r("The cashflow_amounts must include negative and positive values."));const a=n.shift();return Zc((function(e){return function(e,t,o){const i=o.length;let s=0;return o.reduce(((t,o)=>(s++,t+o*e**(i-s))),t*e**i)}(e,a,n)}),(function(e){return function(e,t,o){const i=o.length;let s=0;return o.reduce(((t,o)=>(s++,t+o*(i-s)*e**(i-s-1))),t*i*e**(i-1))}(e,a,n)}),o+1,20,1e-5)-1},isExported:!0},fh={description:r("Returns the interest paid at a particular period of an investment."),args:[Wr("rate (number)",r("The interest rate.")),Wr("period (number)",r("The period for which you want to view the interest payment.")),Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("present_value (number)",r("The current value of the annuity."))],returns:["NUMBER"],compute:function(e,t,o,i){const s=Is(e,this.locale),n=Is(t,this.locale),a=Is(o,this.locale),l=Is(i,this.locale);xs((()=>0!==a),r("The number of periods must be different than 0.",a.toString()));return-1*(l-l*(n/a))*s},isExported:!0},bh={description:r("Modified Macaulay duration."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("rate (number)",r("The annualized rate of interest.")),Wr("yield (number)",r("The expected annual yield of the security.")),Wr("frequency (number)",r("The number of interest or coupon payments per year (1, 2, or 4).")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s,r=0){return ch.compute.bind(this)(e,t,o,i,s,r)/(1+Is(i,this.locale)/Math.trunc(Is(s,this.locale)))},isExported:!0},vh={description:r("Modified internal rate of return."),args:[Wr("cashflow_amounts (range<number>)",r("A range containing the income or payments associated with the investment. The array should contain bot payments and incomes.")),Wr("financing_rate (number)",r("The interest rate paid on funds invested.")),Wr("reinvestment_return_rate (number)",r("The return (as a percentage) earned on reinvestment of income received from the investment."))],returns:["NUMBER"],compute:function(e,t,o){const i=Is(t,this.locale),s=Is(o,this.locale),n=Ze(e).flat().filter(ke).map((e=>Is(e,this.locale))),a=n.length;let l=0,c=0;for(const e of ye(0,a)){const t=n[e];t>=0?l+=t*(s+1)**(a-e-1):c+=t/(i+1)**e}xs((()=>0!==c&&0!==l),r("There must be both positive and negative values in cashflow_amounts."));return(-l/c)**(1/(a-1))-1},isExported:!0},Sh={description:r("Annual nominal interest rate."),args:[Wr("effective_rate (number)",r("The effective interest rate per year.")),Wr("periods_per_year (number)",r("The number of compounding periods per year."))],returns:["NUMBER"],compute:function(e,t){const o=Is(e,this.locale),i=Math.trunc(Is(t,this.locale));return xs((()=>o>0),r("The effective rate (%s) must must strictly greater than 0.",o.toString())),xs((()=>i>0),r("The number of periods by year (%s) must strictly greater than 0.",i.toString())),(Math.pow(o+1,1/i)-1)*i},isExported:!0},Ch={description:r("Number of payment periods for an investment."),args:[Wr("rate (number)",r("The interest rate.")),Wr("payment_amount (number)",r("The amount of each payment made.")),Wr("present_value (number)",r("The current value of the annuity.")),Wr("future_value (number, default=0)",r("The future value remaining after the final payment has been made.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period."))],returns:["NUMBER"],compute:function(e,t,o,i=0,s=0){i=i||0,s=s||0;const r=Is(e,this.locale),n=Is(t,this.locale),a=Is(o,this.locale),l=Is(i,this.locale),c=Ds(s)?1:0;if(0===r)return-(l+a)/n;const h=n*(1+r*c)/r;return Math.log((h-l)/(a+h))/Math.log(1+r)},isExported:!0};const Eh={description:r("The net present value of an investment based on a series of periodic cash flows and a discount rate."),args:[Wr("discount (number)",r("The discount rate of the investment over one period.")),Wr("cashflow1 (number, range<number>)",r("The first future cash flow.")),Wr("cashflow2 (number, range<number>, repeating)",r("Additional future cash flows."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,...t){const o=Is(e,this.locale);return xs((()=>-1!==o),r("The discount (%s) must be different from -1.",o.toString())),function(e,t,o,i){let s=0;return zs(o,((t,o)=>(s++,t+o/(1+e)**s)),t,i)}(o,0,t,this.locale)},isExported:!0},wh={description:r("Computes the number of periods needed for an investment to reach a value."),args:[Wr("rate (number)",r("The rate at which the investment grows each period.")),Wr("present_value (number)",r("The investment's current value.")),Wr("future_value (number)",r("The investment's desired future value."))],returns:["NUMBER"],compute:function(e,t,o){const i=Is(e,this.locale),s=Is(t,this.locale),n=Is(o,this.locale);return Mc(i),xs((()=>s>0),r("The present_value (%s) must be strictly positive.",s.toString())),xs((()=>n>0),r("The future_value (%s) must be strictly positive.",n.toString())),(Math.log(n)-Math.log(s))/Math.log(1+i)},isExported:!0},xh={description:r("Periodic payment for an annuity investment."),args:[Wr("rate (number)",r("The annualized rate of interest.")),Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("present_value (number)",r("The current value of the annuity.")),Wr("future_value (number, default=0)",r("The future value remaining after the final payment has been made.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o,i=0,s=0){i=i||0,s=s||0;const r=Is(t,this.locale),n=Is(e,this.locale),a=Ds(s)?1:0;let l=Is(i,this.locale),c=Is(o,this.locale);if(Oc(r),0===n)return-(l+c)/r;let h=-(c*(1+n)**r+l);return h=h*n/((1+n*a)*((1+n)**r-1)),h},isExported:!0},yh={description:r("Payment on the principal of an investment."),args:[Wr("rate (number)",r("The annualized rate of interest.")),Wr("period (number)",r("The amortization period, in terms of number of periods.")),Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("present_value (number)",r("The current value of the annuity.")),Wr("future_value (number, default=0)",r("The future value remaining after the final payment has been made.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o,i,s=0,n=0){s=s||0,n=n||0;const a=Is(o,this.locale),l=Is(e,this.locale),c=Is(t,this.locale),h=Ds(n)?1:0,d=Is(s,this.locale),u=Is(i,this.locale);Oc(a),xs((()=>c>0&&c<=a),r("The period must be between 1 and number_of_periods",a.toString()));const g=xh.compute.bind(this)(l,a,u,d,n);if(1===h&&1===c)return g;const p=0===h?c-1:c-2,m=u+g*h;return g+-dh.compute.bind(this)(l,p,g,m,0)*l},isExported:!0},Ih={description:r("Present value of an annuity investment."),args:[Wr("rate (number)",r("The interest rate.")),Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("payment_amount (number)",r("The amount per period to be paid.")),Wr("future_value (number, default=0)",r("The future value remaining after the final payment has been made.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o,i=0,s=0){i=i||0,s=s||0;const r=Is(e,this.locale),n=Is(t,this.locale),a=Is(o,this.locale),l=Is(i,this.locale),c=Ds(s)?1:0;return r?-(a*(1+r*c)*((1+r)**n-1)/r+l)/(1+r)**n:-(l+a*n)},isExported:!0},Rh={description:r("Price of a security paying periodic interest."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("rate (number)",r("The annualized rate of interest.")),Wr("yield (number)",r("The expected annual yield of the security.")),Wr("redemption (number)",r("The redemption amount per 100 face value, or par.")),Wr("frequency (number)",r("The number of interest or coupon payments per year (1, 2, or 4).")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s,n,a=0){a=a||0;const l=Math.trunc(Is(e,this.locale)),c=Math.trunc(Is(t,this.locale)),h=Is(o,this.locale),d=Is(i,this.locale),u=Is(s,this.locale),g=Math.trunc(Is(n,this.locale)),p=Math.trunc(Is(a,this.locale));xc(l,c),Ic(g),Rc(p),xs((()=>h>=0),r("The rate (%s) must be positive or null.",h.toString())),xs((()=>d>=0),r("The yield (%s) must be positive or null.",d.toString())),Tc(u);const m=cc.compute.bind(this)(l,c,p)*g,f=Math.ceil(m),b=m-Math.floor(m)||1,v=1+d/g,S=100*h/g;if(1===f)return(S+u)/(b*d/g+1)-S*(1-b);let C=0;for(let e=1;e<=f;e++)C+=S/v**(e-1+b);return u/v**(f-1+b)+C-S*(1-b)},isExported:!0},Th={description:r("Price of a discount security."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("discount (number)",r("The discount rate of the security at time of purchase.")),Wr("redemption (number)",r("The redemption amount per 100 face value, or par.")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s=0){s=s||0;const r=Math.trunc(Is(e,this.locale)),n=Math.trunc(Is(t,this.locale)),a=Is(o,this.locale),l=Is(i,this.locale),c=Math.trunc(Is(s,this.locale));xc(r,n),Rc(c),Uc(a),Tc(l);return l-a*l*cc.compute.bind(this)(r,n,c)},isExported:!0},Ah={description:r("Calculates the price of a security paying interest at maturity, based on expected yield."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("issue (date)",r("The date the security was initially issued.")),Wr("rate (number)",r("The annualized rate of interest.")),Wr("yield (number)",r("The expected annual yield of the security.")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s,n=0){n=n||0;const a=Math.trunc(Is(e,this.locale)),l=Math.trunc(Is(t,this.locale)),c=Math.trunc(Is(o,this.locale)),h=Is(i,this.locale),d=Is(s,this.locale),u=Math.trunc(Is(n,this.locale));yc(a,c),xc(a,l),Rc(u),xs((()=>h>=0),r("The rate (%s) must be positive or null.",h.toString())),xs((()=>d>=0),r("The yield (%s) must be positive or null.",d.toString()));const g=cc.compute.bind(this)(a,l,u),p=cc.compute.bind(this)(a,c,u);return(100+cc.compute.bind(this)(c,l,u)*h*100)/(1+g*d)-p*h*100},isExported:!0},Oh=.1,Mh={description:r("Interest rate of an annuity investment."),args:[Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("payment_per_period (number)",r("The amount per period to be paid.")),Wr("present_value (number)",r("The current value of the annuity.")),Wr("future_value (number, default=0)",r("The future value remaining after the final payment has been made.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period.")),Wr("rate_guess (number, default=0.1)",r("An estimate for what the interest rate will be."))],returns:["NUMBER"],computeFormat:()=>"0%",compute:function(e,t,o,i=0,s=0,n=.1){i=i||0,s=s||0,n=n||Oh;const a=Is(e,this.locale),l=Is(t,this.locale),c=Ds(s)?1:0,h=Is(n,this.locale);let d=Is(i,this.locale),u=Is(o,this.locale);Oc(a),xs((()=>[l,u,d].some((e=>e>0))&&[l,u,d].some((e=>e<0))),r("There must be both positive and negative values in [payment_amount, present_value, future_value].",a.toString())),$c(h),d-=l*c,u+=l*c;return Zc((e=>{const t=Math.pow(1+e,a);return d+u*t+l*((t-1)/e)}),(e=>{const t=Math.pow(1+e,a-1),o=Math.pow(1+e,a);return u*a*t+l*(a*t/e-(o-1)/e/e)}),h,40,1e-5)},isExported:!0},Nh={description:r("Amount received at maturity for a security."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("investment (number)",r("The amount invested (irrespective of face value of each security).")),Wr("discount (number)",r("The discount rate of the security invested in.")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s=0){s=s||0;const r=Math.trunc(Is(e,this.locale)),n=Math.trunc(Is(t,this.locale)),a=Is(o,this.locale),l=Is(i,this.locale),c=Math.trunc(Is(s,this.locale));xc(r,n),Rc(c),kc(a),Uc(l);return a/(1-l*cc.compute.bind(this)(r,n,c))},isExported:!0},_h={description:r("Computes the rate needed for an investment to reach a specific value within a specific number of periods."),args:[Wr("number_of_periods (number)",r("The number of periods.")),Wr("present_value (number)",r("The present value of the investment.")),Wr("future_value (number)",r("The future value of the investment."))],returns:["NUMBER"],compute:function(e,t,o){const i=Is(e,this.locale),s=Is(t,this.locale),r=Is(o,this.locale);return Oc(i),(r/s)**(1/i)-1},isExported:!0},Fh={description:r("Depreciation of an asset using the straight-line method."),args:[Wr("cost (number)",r("The initial cost of the asset.")),Wr("salvage (number)",r("The value of the asset at the end of depreciation.")),Wr("life (number)",r("The number of periods over which the asset is depreciated."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o){return(Is(e,this.locale)-Is(t,this.locale))/Is(o,this.locale)},isExported:!0},Dh={description:r("Depreciation via sum of years digit method."),args:[Wr("cost (number)",r("The initial cost of the asset.")),Wr("salvage (number)",r("The value of the asset at the end of depreciation.")),Wr("life (number)",r("The number of periods over which the asset is depreciated.")),Wr("period (number)",r("The single period within life for which to calculate depreciation."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o,i){const s=Is(e,this.locale),r=Is(t,this.locale),n=Is(o,this.locale),a=Is(i,this.locale);Fc(a),Nc(n),Pc(a,n);return(n-a+1)/(n*(n+1)/2)*(s-r)},isExported:!0},Lh={description:r("Price of a US Treasury bill."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("discount (number)",r("The discount rate of the bill at time of purchase."))],returns:["NUMBER"],compute:function(e,t,o){const i=Math.trunc(Is(e,this.locale)),s=Math.trunc(Is(t,this.locale)),r=Is(o,this.locale);xc(i,s),zc(i,s,this.locale),Uc(r),Vc(r);return 100*(1-r*cc.compute.bind(this)(i,s,2))},isExported:!0},Ph={description:r("Equivalent rate of return for a US Treasury bill."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("discount (number)",r("The discount rate of the bill at time of purchase."))],returns:["NUMBER"],compute:function(e,t,o){const i=Math.trunc(Is(e,this.locale)),s=Math.trunc(Is(t,this.locale)),r=Is(o,this.locale);xc(i,s),zc(i,s,this.locale),Uc(r),Vc(r);const n=Hl.compute.bind(this)(s,i);if(n<=182)return 365*r/(360-r*n);const a=Lh.compute.bind(this)(i,s,r)/100,l=n/(366===n?366:365);return(-2*l+2*Math.sqrt(l**2-(2*l-1)*(1-1/a)))/(2*l-1)},isExported:!0},kh={description:r("The yield of a US Treasury bill based on price."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("price (number)",r("The price at which the security is bought per 100 face value."))],returns:["NUMBER"],compute:function(e,t,o){const i=Math.trunc(Is(e,this.locale)),s=Math.trunc(Is(t,this.locale)),r=Is(o,this.locale);xc(i,s),zc(i,s,this.locale),Ac(r);return(100-r)/r*(1/cc.compute.bind(this)(i,s,2))},isExported:!0},Uh={description:r("Variable declining balance. WARNING : does not handle decimal periods."),args:[Wr("cost (number)",r("The initial cost of the asset.")),Wr("salvage (number)",r("The value of the asset at the end of depreciation.")),Wr("life (number)",r("The number of periods over which the asset is depreciated.")),Wr("start (number)",r("Starting period to calculate depreciation.")),Wr("end (number)",r("Ending period to calculate depreciation.")),Wr("factor (number, default=2)",r("The number of months in the first year of depreciation.")),Wr("no_switch (number, default=false)",r("Whether to switch to straight-line depreciation when the depreciation is greater than the declining balance calculation."))],returns:["NUMBER"],compute:function(e,t,o,i,s,n=2,a=false){n=n||0;const l=Is(e,this.locale),c=Is(t,this.locale),h=Is(o,this.locale),d=Math.trunc(Is(i,this.locale)),u=Math.trunc(Is(s,this.locale)),g=Is(n,this.locale),p=Ds(a);if(_c(l),Dc(c),function(e,t,o){Nc(o),xs((()=>e>=0),r("The start_period (%s) must be greater or equal than 0.",e.toString())),xs((()=>t>=0),r("The end_period (%s) must be greater or equal than 0.",t.toString())),xs((()=>e<=t),r("The start_period (%s) must be smaller or equal to the end_period (%s).",e.toString(),t.toString())),xs((()=>t<=o),r("The end_period (%s) must be smaller or equal to the life (%s).",e.toString(),o.toString()))}(d,u,h),Bc(g),0===l)return 0;if(c>=l)return d<1?l-c:0;const m=g/h;if(m>=1)return d<1?l-c:0;let f=l,b=0,v=0,S=!1;for(let e=0;e<u;e++){if(!S||p){const t=f*m,o=(f-c)/(h-e);!p&&o>t?(S=!0,b=o):b=t}const t=Math.max(f-b,c);e>=d&&(v+=f-t),f=t}return v},isExported:!0},Vh={description:r("Internal rate of return given non-periodic cash flows."),args:[Wr("cashflow_amounts (range<number>)",r("An range containing the income or payments associated with the investment.")),Wr("cashflow_dates (range<number>)",r("An range with dates corresponding to the cash flows in cashflow_amounts.")),Wr("rate_guess (number, default=0.1)",r("An estimate for what the internal rate of return will be."))],returns:["NUMBER"],compute:function(e,t,o=.1){const i=Is(o=o||0,this.locale),s=e.flat().map((e=>Is(e,this.locale))),n=t.flat().map((e=>Is(e,this.locale)));var a;Wc(e,t),a=s,xs((()=>a.some((e=>e>0))&&a.some((e=>e<0))),r("There must be both positive and negative values in cashflow_amounts.")),Gc(n),$c(i);const l=new Map;for(const e of ye(0,n.length)){const t=n[e];l.has(t)?l.set(t,l.get(t)+s[e]):l.set(t,s[e])}const c=Array.from(l.keys()),h=c.map((e=>l.get(e)));return Zc((e=>{let t=h[0];for(const o of ye(1,h.length)){const i=(c[0]-c[o])/365;t+=h[o]*(1+e)**i}return t}),(e=>{let t=0;for(const o of ye(1,h.length)){const i=(c[0]-c[o])/365;t+=i*h[o]*(1+e)**(i-1)}return t}),i,40,1e-5,(e=>e?e/10-.9:-.9))},isExported:!0},Bh={description:r("Net present value given to non-periodic cash flows.."),args:[Wr("discount (number)",r("The discount rate of the investment over one period.")),Wr("cashflow_amounts (number, range<number>)",r("An range containing the income or payments associated with the investment.")),Wr("cashflow_dates (number, range<number>)",r("An range with dates corresponding to the cash flows in cashflow_amounts."))],returns:["NUMBER"],compute:function(e,t,o){const i=Is(e,this.locale),s=Array.isArray(t)?t.flat().map((e=>Rs(e,this.locale))):[Rs(t,this.locale)],n=Array.isArray(o)?o.flat().map((e=>Rs(e,this.locale))):[Rs(o,this.locale)];if(Array.isArray(o)&&Array.isArray(t)?Wc(t,o):xs((()=>s.length===n.length),r("There must be the same number of values in cashflow_amounts and cashflow_dates.")),Gc(n),Mc(i),1===s.length)return s[0];const a=new Map;for(const e of ye(0,n.length)){const t=n[e];a.has(t)?a.set(t,a.get(t)+s[e]):a.set(t,s[e])}const l=Array.from(a.keys()),c=l.map((e=>a.get(e)));let h=c[0];for(const e of ye(1,c.length)){const t=(l[0]-l[e])/365;h+=c[e]*(1+i)**t}return h},isExported:!0},zh={description:r("Annual yield of a security paying periodic interest."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("rate (number)",r("The annualized rate of interest.")),Wr("price (number)",r("The price at which the security is bought per 100 face value.")),Wr("redemption (number)",r("The redemption amount per 100 face value, or par.")),Wr("frequency (number)",r("The number of interest or coupon payments per year (1, 2, or 4).")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s,n,a=0){a=a||0;const l=Math.trunc(Is(e,this.locale)),c=Math.trunc(Is(t,this.locale)),h=Is(o,this.locale),d=Is(i,this.locale),u=Is(s,this.locale),g=Math.trunc(Is(n,this.locale)),p=Math.trunc(Is(a,this.locale));xc(l,c),Ic(g),Rc(p),xs((()=>h>=0),r("The rate (%s) must be positive or null.",h.toString())),Ac(d),Tc(u);const m=cc.compute.bind(this)(l,c,p)*g,f=Math.ceil(m),b=m-Math.floor(m)||1,v=100*h/g;if(1===f){const e=d+v*(1-b);return(u+v-e)*g*(1/b)/e}const S=Zc((function(e){return function(e,t,o,i,s,r){let n=r-(e+s*(1-t))*i**(o-1+t);for(let e=1;e<=o;e++)n+=s*i**(e-1);return n}(d,b,f,e,v,u)}),(function(e){return function(e,t,o,i,s){let r=-(e+s*(1-t))*(o-1+t)*i**(o-2+t);for(let e=1;e<=o;e++)r+=s*(e-1)*i**(e-2);return r}(d,b,f,e,v)}),1+(h+1)/g,100,1e-5);return(S-1)*g},isExported:!0},Hh={description:r("Annual yield of a discount security."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("price (number)",r("The price at which the security is bought per 100 face value.")),Wr("redemption (number)",r("The redemption amount per 100 face value, or par.")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s=0){s=s||0;const r=Math.trunc(Is(e,this.locale)),n=Math.trunc(Is(t,this.locale)),a=Is(o,this.locale),l=Is(i,this.locale),c=Math.trunc(Is(s,this.locale));xc(r,n),Rc(c),Ac(a),Tc(l);return(l/a-1)/cc.compute.bind(this)(e,t,s)},isExported:!0},$h={description:r("Annual yield of a security paying interest at maturity."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("issue (date)",r("The date the security was initially issued.")),Wr("rate (number)",r("The annualized rate of interest.")),Wr("price (number)",r("The price at which the security is bought.")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s,n=0){n=n||0;const a=Math.trunc(Is(e,this.locale)),l=Math.trunc(Is(t,this.locale)),c=Math.trunc(Is(o,this.locale)),h=Is(i,this.locale),d=Is(s,this.locale),u=Math.trunc(Is(n,this.locale));xc(a,l),Rc(u),xs((()=>a>=c),r("The settlement (%s) must be greater than or equal to the issue (%s).",a.toString(),c.toString())),xs((()=>h>=0),r("The rate (%s) must be positive or null.",h.toString())),Ac(d);const g=cc.compute.bind(this)(c,l,u),p=cc.compute.bind(this)(c,a,u),m=cc.compute.bind(this)(a,l,u);return(100*(1+h*g)/(d+100*h*p)-1)/m},isExported:!0};var Wh=Object.freeze({__proto__:null,ACCRINTM:Yc,AMORLINC:jc,COUPDAYS:Xc,COUPDAYBS:Kc,COUPDAYSNC:Qc,COUPNCD:Jc,COUPNUM:eh,COUPPCD:th,CUMIPMT:oh,CUMPRINC:ih,DB:sh,DDB:rh,DISC:nh,DOLLARDE:ah,DOLLARFR:lh,DURATION:ch,EFFECT:hh,FV:dh,FVSCHEDULE:uh,INTRATE:gh,IPMT:ph,IRR:mh,ISPMT:fh,MDURATION:bh,MIRR:vh,NOMINAL:Sh,NPER:Ch,NPV:Eh,PDURATION:wh,PMT:xh,PPMT:yh,PV:Ih,PRICE:Rh,PRICEDISC:Th,PRICEMAT:Ah,RATE:Mh,RECEIVED:Nh,RRI:_h,SLN:Fh,SYD:Dh,TBILLPRICE:Lh,TBILLEQ:Ph,TBILLYIELD:kh,VDB:Uh,XIRR:Vh,XNPV:Bh,YIELD:zh,YIELDDISC:Hh,YIELDMAT:$h});const Gh={description:r("Whether a value is an error other than #N/A."),args:[Wr("value (any, lazy)",r("The value to be verified as an error type."))],returns:["BOOLEAN"],compute:function(e){try{return e(),!1}catch(e){return e?.errorType!=a.NotAvailable}},isExported:!0},qh={description:r("Whether a value is an error."),args:[Wr("value (any, lazy)",r("The value to be verified as an error type."))],returns:["BOOLEAN"],compute:function(e){try{return e(),!1}catch(e){return!0}},isExported:!0},Zh={description:r("Whether a value is `true` or `false`."),args:[Wr("value (any, lazy)",r("The value to be verified as a logical TRUE or FALSE."))],returns:["BOOLEAN"],compute:function(e){try{return"boolean"==typeof e()}catch(e){return!1}},isExported:!0},Yh={description:r("Whether a value is the error #N/A."),args:[Wr("value (any, lazy)",r("The value to be verified as an error type."))],returns:["BOOLEAN"],compute:function(e){try{return e(),!1}catch(e){return e?.errorType===a.NotAvailable}},isExported:!0},jh={description:r("Whether a value is non-textual."),args:[Wr("value (any, lazy)",r("The value to be checked."))],returns:["BOOLEAN"],compute:function(e){try{return"string"!=typeof e()}catch(e){return!0}},isExported:!0},Xh={description:r("Whether a value is a number."),args:[Wr("value (any, lazy)",r("The value to be verified as a number."))],returns:["BOOLEAN"],compute:function(e){try{return"number"==typeof e()}catch(e){return!1}},isExported:!0},Kh={description:r("Whether a value is text."),args:[Wr("value (any, lazy)",r("The value to be verified as text."))],returns:["BOOLEAN"],compute:function(e){try{return"string"==typeof e()}catch(e){return!1}},isExported:!0},Qh={description:r("Whether the referenced cell is empty"),args:[Wr("value (any, lazy)",r("Reference to the cell that will be checked for emptiness."))],returns:["BOOLEAN"],compute:function(e){try{return null===e()}catch(e){return!1}},isExported:!0},Jh={description:r("Returns the error value #N/A."),args:[],returns:["BOOLEAN"],compute:function(e){throw new g},isExported:!0};var ed=Object.freeze({__proto__:null,ISERR:Gh,ISERROR:qh,ISLOGICAL:Zh,ISNA:Yh,ISNONTEXT:jh,ISNUMBER:Xh,ISTEXT:Kh,ISBLANK:Qh,NA:Jh});const td={description:r("Logical `and` operator."),args:[Wr("logical_expression1 (boolean, range<boolean>)",r("An expression or reference to a cell containing an expression that represents some logical value, i.e. TRUE or FALSE, or an expression that can be coerced to a logical value.")),Wr("logical_expression2 (boolean, range<boolean>, repeating)",r("More expressions that represent logical values."))],returns:["BOOLEAN"],compute:function(...e){let t=!1,o=!0;return $s(e,(e=>(t=!0,o=o&&e,o))),xs((()=>t),r("[[FUNCTION_NAME]] has no valid input data.")),o},isExported:!0},od={description:r("Logical value `false`."),args:[],returns:["BOOLEAN"],compute:function(){return!1},isExported:!0},id={description:r("Returns value depending on logical expression."),args:[Wr("logical_expression (boolean)",r("An expression or reference to a cell containing an expression that represents some logical value, i.e. TRUE or FALSE.")),Wr("value_if_true (any, lazy)",r("The value the function returns if logical_expression is TRUE.")),Wr("value_if_false (any, lazy, default=FALSE)",r("The value the function returns if logical_expression is FALSE."))],returns:["ANY"],compute:function(e,t,o=(()=>!1)){const i=Ds(e)?t():o();return null==i?"":i},isExported:!0},sd={description:r("Value if it is not an error, otherwise 2nd argument."),args:[Wr("value (any, lazy)",r("The value to return if value itself is not an error.")),Wr('value_if_error (any, lazy, default="empty")',r("The value the function returns if value is an error."))],returns:["ANY"],computeFormat:(e,t=(()=>({value:""})))=>{try{return e().format}catch(e){return t()?.format}},compute:function(e,t=(()=>"")){let o;try{o=e()}catch(e){o=t()}return null==o?"":o},isExported:!0},rd={description:r("Value if it is not an #N/A error, otherwise 2nd argument."),args:[Wr("value (any, lazy)",r("The value to return if value itself is not #N/A an error.")),Wr('value_if_error (any, lazy, default="empty")',r("The value the function returns if value is an #N/A error."))],returns:["ANY"],compute:function(e,t=(()=>"")){let o;try{o=e()}catch(i){o=i.errorType===a.NotAvailable?t():e()}return null==o?"":o},isExported:!0},nd={description:r("Returns a value depending on multiple logical expressions."),args:[Wr("condition1 (boolean, lazy)",r("The first condition to be evaluated. This can be a boolean, a number, an array, or a reference to any of those.")),Wr("value1 (any, lazy)",r("The returned value if condition1 is TRUE.")),Wr("condition2 (boolean, lazy, repeating)",r("Additional conditions to be evaluated if the previous ones are FALSE.")),Wr("value2 (any, lazy, repeating)",r("Additional values to be returned if their corresponding conditions are TRUE."))],returns:["ANY"],compute:function(...e){xs((()=>e.length%2==0),r("Wrong number of arguments. Expected an even number of arguments."));for(let t=0;t<e.length-1;t+=2)if(Ds(e[t]())){const o=e[t+1]();return null!==o?o:""}throw new Error(r("No match."))},isExported:!0},ad={description:r("Returns opposite of provided logical value."),args:[Wr("logical_expression (boolean)",r("An expression or reference to a cell holding an expression that represents some logical value."))],returns:["BOOLEAN"],compute:function(e){return!Ds(e)},isExported:!0},ld={description:r("Logical `or` operator."),args:[Wr("logical_expression1 (boolean, range<boolean>)",r("An expression or reference to a cell containing an expression that represents some logical value, i.e. TRUE or FALSE, or an expression that can be coerced to a logical value.")),Wr("logical_expression2 (boolean, range<boolean>, repeating)",r("More expressions that evaluate to logical values."))],returns:["BOOLEAN"],compute:function(...e){let t=!1,o=!1;return $s(e,(e=>(t=!0,o=o||e,!o))),xs((()=>t),r("[[FUNCTION_NAME]] has no valid input data.")),o},isExported:!0},cd={description:r("Logical value `true`."),args:[],returns:["BOOLEAN"],compute:function(){return!0},isExported:!0},hd={description:r("Logical `xor` operator."),args:[Wr("logical_expression1 (boolean, range<boolean>)",r("An expression or reference to a cell containing an expression that represents some logical value, i.e. TRUE or FALSE, or an expression that can be coerced to a logical value.")),Wr("logical_expression2 (boolean, range<boolean>, repeating)",r("More expressions that evaluate to logical values."))],returns:["BOOLEAN"],compute:function(...e){let t=!1,o=!1;return $s(e,(e=>(t=!0,o=o?!e:e,!0))),xs((()=>t),r("[[FUNCTION_NAME]] has no valid input data.")),o},isExported:!0};var dd=Object.freeze({__proto__:null,AND:td,FALSE:od,IF:id,IFERROR:sd,IFNA:rd,IFS:nd,NOT:ad,OR:ld,TRUE:cd,XOR:hd});function ud(e,t){if(void 0===e)throw new g(r("Did not find value '%s' in [[FUNCTION_NAME]] evaluation.",Ms(t)))}const gd={description:r("Returns a cell reference as a string. "),args:[Wr("row (number)",r("The row number of the cell reference. ")),Wr("column (number)",r("The column number (not name) of the cell reference. A is column number 1. ")),Wr("absolute_relative_mode (number, default=1)",r("An indicator of whether the reference is row/column absolute. 1 is row and column absolute (e.g. $A$1), 2 is row absolute and column relative (e.g. A$1), 3 is row relative and column absolute (e.g. $A1), and 4 is row and column relative (e.g. A1).")),Wr("use_a1_notation (boolean, default=TRUE)",r("A boolean indicating whether to use A1 style notation (TRUE) or R1C1 style notation (FALSE).")),Wr("sheet (string, optional)",r("A string indicating the name of the sheet into which the address points."))],returns:["STRING"],compute:function(e,t,o=1,i=!0,s){const n=As(e,this.locale),a=As(t,this.locale);Os(n),Os(a);const l=As(o,this.locale);var c,h;xs((()=>[1,2,3,4].includes(l)),(c=4,h=l,r("The function [[FUNCTION_NAME]] expects a number value between %s and %s inclusive, but receives %s.",1..toString(),c.toString(),h.toString())));let d;if(Ds(i)){d=xt(a-1,n-1,{rowFixed:!![1,2].includes(l),colFixed:!![1,3].includes(l)})}else{d=([1,2].includes(l)?`R${n}`:`R[${n}]`)+([1,3].includes(l)?`C${a}`:`C[${a}]`)}return void 0!==s?`${we(Ms(s))}!${d}`:d},isExported:!0},pd={description:r("Column number of a specified cell."),args:[Wr("cell_reference (meta, default='this cell')",r("The cell whose column number will be returned. Column A corresponds to 1. By default, the function use the cell in which the formula is entered."))],returns:["NUMBER"],compute:function(e){const t=e||this.__originCellXC?.();xs((()=>!!t),"In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");return ti(t).left+1},isExported:!0},md={description:r("Number of columns in a specified array or range."),args:[Wr("range (meta)",r("The range whose column count will be returned."))],returns:["NUMBER"],compute:function(e){const t=ti(e);return t.right-t.left+1},isExported:!0},fd={description:r("Horizontal lookup"),args:[Wr("search_key (any)",r("The value to search for. For example, 42, 'Cats', or I24.")),Wr("range (range)",r("The range to consider for the search. The first row in the range is searched for the key specified in search_key.")),Wr("index (number)",r("The row index of the value to be returned, where the first row in range is numbered 1.")),Wr("is_sorted (boolean, default=true)",r("Indicates whether the row to be searched (the first row of the specified range) is sorted, in which case the closest match for search_key will be returned."))],returns:["ANY"],compute:function(e,t,o,i=true){const s=Math.trunc(Is(o,this.locale)),n=_s(e);xs((()=>1<=s&&s<=t[0].length),r("[[FUNCTION_NAME]] evaluates to an out of bounds range."));let a;a=Ds(i)?js(t,n,"nextSmaller","asc",t.length,Ys):Xs(t,n,"strict",t.length,Ys);const l=t[a];return ud(l,e),l[s-1]},isExported:!0},bd={description:r("Returns the content of a cell, specified by row and column offset."),args:[Wr("reference (any, range)",r("The range of cells from which the values are returned.")),Wr("row (number)",r("The index of the row to be returned from within the reference range of cells.")),Wr("column (number)",r("The index of the column to be returned from within the reference range of cells."))],returns:["ANY"],computeFormat:function(e,t,o){const i=Is(t.value,this.locale),s=Is(o.value,this.locale);return e.format[s-1][i-1]},compute:function(e,t,o){const i=Ss(e)?e:[[e]],s=Is(t,this.locale),n=Is(o,this.locale);return xs((()=>n>=0&&n-1<i.length&&s>=0&&s-1<i[0].length),r("Index out of range.")),xs((()=>0!==t&&0!==o),r("This function can only return a single cell value, not an array. Provide valid row and column indices.")),i[n-1][s-1]},isExported:!0},vd={description:r("Look up a value."),args:[Wr("search_key (any)",r("The value to search for. For example, 42, 'Cats', or I24.")),Wr("search_array (range)",r("One method of using this function is to provide a single sorted row or column search_array to look through for the search_key with a second argument result_range. The other way is to combine these two arguments into one search_array where the first row or column is searched and a value is returned from the last row or column in the array. If search_key is not found, a non-exact match may be returned.")),Wr("result_range (range, optional)",r("The range from which to return a result. The value returned corresponds to the location where search_key is found in search_range. This range must be only a single row or column and should not be used if using the search_result_array method."))],returns:["ANY"],compute:function(e,t,o){let i=t.length,s=t[0].length;const n=_s(e),a=s>=i,l=js(t,n,"nextSmaller","asc",a?s:i,a?Zs:Ys);return-1===l&&ud(void 0,e),ud(a?t[0][l]:t[l][s-1],e),void 0===o?a?t[i-1][l]:t[l][s-1]:(i=o.length,s=o[0].length,xs((()=>1===i||1===s),r("The result_range must be a single row or a single column.")),i>1?(xs((()=>l<=i-1),r("[[FUNCTION_NAME]] evaluates to an out of range row value %s.",(l+1).toString())),o[l][0]):(xs((()=>l<=s-1),r("[[FUNCTION_NAME]] evaluates to an out of range column value %s.",(l+1).toString())),o[0][l]))},isExported:!0},Sd={description:r("Position of item in range that matches value."),args:[Wr("search_key (any)",r("The value to search for. For example, 42, 'Cats', or I24.")),Wr("range (any, range)",r("The one-dimensional array to be searched.")),Wr("search_type (number, default=1)",r("The search method. 1 (default) finds the largest value less than or equal to search_key when range is sorted in ascending order. 0 finds the exact value when range is unsorted. -1 finds the smallest value greater than or equal to search_key when range is sorted in descending order."))],returns:["NUMBER"],compute:function(e,t,o=1){let i=Is(o,this.locale);const s=_s(e),n=t.length,a=t[0].length;xs((()=>1===n||1===a),r("The range must be a single row or a single column."));let l=-1;const c=1===n?Zs:Ys,h=1===n?t[0].length:t.length;switch(i=Math.sign(i),i){case 1:l=js(t,s,"nextSmaller","asc",h,c);break;case 0:l=Xs(t,s,"strict",h,c);break;case-1:l=js(t,s,"nextGreater","desc",h,c)}return ud(1===n?t[0][l]:t[l],e),l+1},isExported:!0},Cd={description:r("Row number of a specified cell."),args:[Wr("cell_reference (meta, default='this cell')",r("The cell whose row number will be returned. By default, this function uses the cell in which the formula is entered."))],returns:["NUMBER"],compute:function(e){e=e||this.__originCellXC?.(),xs((()=>!!e),"In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");return ti(e).top+1},isExported:!0},Ed={description:r("Number of rows in a specified array or range."),args:[Wr("range (meta)",r("The range whose row count will be returned."))],returns:["NUMBER"],compute:function(e){const t=ti(e);return t.bottom-t.top+1},isExported:!0},wd={description:r("Vertical lookup."),args:[Wr("search_key (any)",r("The value to search for. For example, 42, 'Cats', or I24.")),Wr("range (any, range)",r("The range to consider for the search. The first column in the range is searched for the key specified in search_key.")),Wr("index (number)",r("The column index of the value to be returned, where the first column in range is numbered 1.")),Wr("is_sorted (boolean, default=true)",r("Indicates whether the column to be searched (the first column of the specified range) is sorted, in which case the closest match for search_key will be returned."))],returns:["ANY"],compute:function(e,t,o,i=true){const s=Math.trunc(Is(o,this.locale)),n=_s(e);xs((()=>1<=s&&s<=t.length),r("[[FUNCTION_NAME]] evaluates to an out of bounds range."));let a;a=Ds(i)?js(t,n,"nextSmaller","asc",t[0].length,Zs):Xs(t,n,"strict",t[0].length,Zs);const l=t[s-1][a];return ud(l,e),l},isExported:!0},xd={description:r("Search a range for a match and return the corresponding item from a second range."),args:[Wr("search_key (any)",r("The value to search for.")),Wr("lookup_range (any, range)",r("The range to consider for the search. Should be a single column or a single row.")),Wr("return_range (any, range)",r("The range containing the return value. Should have the same dimensions as lookup_range.")),Wr("if_not_found (any, lazy, optional)",r("If a valid match is not found, return this value.")),Wr("match_mode (any, default=0)",r("(0) Exact match. (-1) Return next smaller item if no match. (1) Return next greater item if no match.")),Wr("search_mode (any, default=1)",r("(1) Search starting at first item. (-1) Search starting at last item. (2) Perform a binary search that relies on lookup_array being sorted in ascending order. If not sorted, invalid results will be returned. (-2) Perform a binary search that relies on lookup_array being sorted in descending order. If not sorted, invalid results will be returned. "))],returns:["ANY"],compute:function(e,t,o,i,s=0,n=1){const a=Math.trunc(Is(s,this.locale)),l=Math.trunc(Is(n,this.locale)),c=_s(e);xs((()=>1===t.length||1===t[0].length),r("lookup_range should be either a single row or single column.")),xs((()=>[-1,1,-2,2].includes(l)),r("searchMode should be a value in [-1, 1, -2, 2].")),xs((()=>[-1,0,1].includes(a)),r("matchMode should be a value in [-1, 0, 1]."));const h=1===t.length?"col":"row";xs((()=>"col"===h?o[0].length===t[0].length:o.length===t.length),r("return_range should have the same dimensions as lookup_range."));const d="col"===h?Zs:Ys,u="col"===h?t[0].length:t.length,g=0===a?"strict":1===a?"nextGreater":"nextSmaller",p=-1===l;let m;if(2===l||-2===l){m=js(t,c,g,2===l?"asc":"desc",u,d)}else m=Xs(t,c,g,u,d,p);if(-1!==m)return Qs("col"===h?o.map((e=>[e[m]])):[o[m]]);const f=i?.();return ud(f,e),f},isExported:!0};var yd=Object.freeze({__proto__:null,ADDRESS:gd,COLUMN:pd,COLUMNS:md,HLOOKUP:fd,INDEX:bd,LOOKUP:vd,MATCH:Sd,ROW:Cd,ROWS:Ed,VLOOKUP:wd,XLOOKUP:xd});const Id={description:r("Sum of two numbers."),args:[Wr("value1 (number)",r("The first addend.")),Wr("value2 (number)",r("The second addend."))],returns:["NUMBER"],computeFormat:(e,t)=>e?.format||t?.format,compute:function(e,t){return Is(e,this.locale)+Is(t,this.locale)}},Rd={description:r("Concatenation of two values."),args:[Wr("value1 (string)",r("The value to which value2 will be appended.")),Wr("value2 (string)",r("The value to append to value1."))],returns:["STRING"],compute:function(e,t){return Ms(e)+Ms(t)},isExported:!0},Td={description:r("One number divided by another."),args:[Wr("dividend (number)",r("The number to be divided.")),Wr("divisor (number)",r("The number to divide by."))],returns:["NUMBER"],computeFormat:(e,t)=>e?.format||t?.format,compute:function(e,t){const o=Is(t,this.locale);return xs((()=>0!==o),r("The divisor must be different from zero.")),Is(e,this.locale)/o}};function Ad(e){return null==e}const Od={number:0,string:"",boolean:!1},Md={description:r("Equal."),args:[Wr("value1 (any)",r("The first value.")),Wr("value2 (any)",r("The value to test against value1 for equality."))],returns:["BOOLEAN"],compute:function(e,t){return e=Ad(e)?Od[typeof t]:e,t=Ad(t)?Od[typeof e]:t,"string"==typeof e&&(e=e.toUpperCase()),"string"==typeof t&&(t=t.toUpperCase()),e===t}};function Nd(e,t,o){e=Ad(e)?Od[typeof t]:e,t=Ad(t)?Od[typeof e]:t,"number"!=typeof e&&(e=Ms(e).toUpperCase()),"number"!=typeof t&&(t=Ms(t).toUpperCase());const i=typeof e,s=typeof t;return"string"===i&&"number"===s||("string"!==s||"number"!==i)&&o(e,t)}const _d={description:r("Strictly greater than."),args:[Wr("value1 (any)",r("The value to test as being greater than value2.")),Wr("value2 (any)",r("The second value."))],returns:["BOOLEAN"],compute:function(e,t){return Nd(e,t,((e,t)=>e>t))}},Fd={description:r("Greater than or equal to."),args:[Wr("value1 (any)",r("The value to test as being greater than or equal to value2.")),Wr("value2 (any)",r("The second value."))],returns:["BOOLEAN"],compute:function(e,t){return Nd(e,t,((e,t)=>e>=t))}},Dd={description:r("Less than."),args:[Wr("value1 (any)",r("The value to test as being less than value2.")),Wr("value2 (any)",r("The second value."))],returns:["BOOLEAN"],compute:function(e,t){return!Fd.compute.bind(this)(e,t)}},Ld={description:r("Less than or equal to."),args:[Wr("value1 (any)",r("The value to test as being less than or equal to value2.")),Wr("value2 (any)",r("The second value."))],returns:["BOOLEAN"],compute:function(e,t){return!_d.compute.bind(this)(e,t)}},Pd={description:r("Difference of two numbers."),args:[Wr("value1 (number)",r("The minuend, or number to be subtracted from.")),Wr("value2 (number)",r("The subtrahend, or number to subtract from value1."))],returns:["NUMBER"],computeFormat:(e,t)=>e?.format||t?.format,compute:function(e,t){return Is(e,this.locale)-Is(t,this.locale)}},kd={description:r("Product of two numbers"),args:[Wr("factor1 (number)",r("The first multiplicand.")),Wr("factor2 (number)",r("The second multiplicand."))],returns:["NUMBER"],computeFormat:(e,t)=>e?.format||t?.format,compute:function(e,t){return Is(e,this.locale)*Is(t,this.locale)}},Ud={description:r("Not equal."),args:[Wr("value1 (any)",r("The first value.")),Wr("value2 (any)",r("The value to test against value1 for inequality."))],returns:["BOOLEAN"],compute:function(e,t){return!Md.compute.bind(this)(e,t)}},Vd={description:r("A number raised to a power."),args:[Wr("base (number)",r("The number to raise to the exponent power.")),Wr("exponent (number)",r("The exponent to raise base to."))],returns:["NUMBER"],compute:function(e,t){return ua.compute.bind(this)(e,t)}},Bd={description:r("A number with the sign reversed."),args:[Wr("value (number)",r("The number to have its sign reversed. Equivalently, the number to multiply by -1."))],computeFormat:e=>e?.format,returns:["NUMBER"],compute:function(e){return-Is(e,this.locale)}},zd={description:r("Value interpreted as a percentage."),args:[Wr("percentage (number)",r("The value to interpret as a percentage."))],returns:["NUMBER"],compute:function(e){return Is(e,this.locale)/100}},Hd={description:r("A specified number, unchanged."),args:[Wr("value (any)",r("The number to return."))],returns:["ANY"],computeFormat:e=>e?.format,compute:function(e){return null===e?"":e}};var $d=Object.freeze({__proto__:null,ADD:Id,CONCAT:Rd,DIVIDE:Td,EQ:Md,GT:_d,GTE:Fd,LT:Dd,LTE:Ld,MINUS:Pd,MULTIPLY:kd,NE:Ud,POW:Vd,UMINUS:Bd,UNARY_PERCENT:zd,UPLUS:Hd});const Wd=/[A-Za-zÀ-ÖØ-öø-ÿ]+/g,Gd={description:r("Gets character associated with number."),args:[Wr("table_number (number)",r("The number of the character to look up from the current Unicode table in decimal format."))],returns:["STRING"],compute:function(e){const t=Math.trunc(Is(e,this.locale));return xs((()=>t>=1),r("The table_number (%s) is out of range.",t.toString())),String.fromCharCode(t)},isExported:!0},qd={description:r("Remove non-printable characters from a piece of text."),args:[Wr("text (string)",r("The text whose non-printable characters are to be removed."))],returns:["STRING"],compute:function(e){const t=Ms(e);let o="";for(const e of t)e&&e.charCodeAt(0)>31&&(o+=e);return o},isExported:!0},Zd={description:r("Appends strings to one another."),args:[Wr("string1 (string, range<string>)",r("The initial string.")),Wr("string2 (string, range<string>, repeating)",r("More strings to append in sequence."))],returns:["STRING"],compute:function(...e){return Bs(e,((e,t)=>e+Ms(t)),"")},isExported:!0},Yd={description:r("Tests whether two strings are identical."),args:[Wr("string1 (string)",r("The first string to compare.")),Wr("string2 (string)",r("The second string to compare."))],returns:["BOOLEAN"],compute:function(e,t){return Ms(e)===Ms(t)},isExported:!0},jd={description:r("First position of string found in text, case-sensitive."),args:[Wr("search_for (string)",r("The string to look for within text_to_search.")),Wr("text_to_search (string)",r("The text to search for the first occurrence of search_for.")),Wr("starting_at (number, default=1)",r("The character within text_to_search at which to start the search."))],returns:["NUMBER"],compute:function(e,t,o=1){const i=Ms(e),s=Ms(t),n=Is(o,this.locale);xs((()=>""!==s),r("The text_to_search must be non-empty.")),xs((()=>n>=1),r("The starting_at (%s) must be greater than or equal to 1.",n.toString()));const a=s.indexOf(i,n-1);return xs((()=>a>=0),r("In [[FUNCTION_NAME]] evaluation, cannot find '%s' within '%s'.",i.toString(),s)),a+1},isExported:!0},Xd={description:r("Concatenates elements of arrays with delimiter."),args:[Wr("delimiter (string)",r("The character or string to place between each concatenated value.")),Wr("value_or_array1 (string, range<string>)",r("The value or values to be appended using delimiter.")),Wr("value_or_array2 (string, range<string>, repeating)",r("More values to be appended using delimiter."))],returns:["STRING"],compute:function(e,...t){const o=Ms(e);return Bs(t,((e,t)=>(e?e+o:"")+Ms(t)),"")}},Kd={description:r("Substring from beginning of specified string."),args:[Wr("text (string)",r("The string from which the left portion will be returned.")),Wr("number_of_characters (number, optional)",r("The number of characters to return from the left side of string."))],returns:["STRING"],compute:function(e,...t){const o=t.length?Is(t[0],this.locale):1;return xs((()=>o>=0),r("The number_of_characters (%s) must be positive or null.",o.toString())),Ms(e).substring(0,o)},isExported:!0},Qd={description:r("Length of a string."),args:[Wr("text (string)",r("The string whose length will be returned."))],returns:["NUMBER"],compute:function(e){return Ms(e).length},isExported:!0},Jd={description:r("Converts a specified string to lowercase."),args:[Wr("text (string)",r("The string to convert to lowercase."))],returns:["STRING"],compute:function(e){return Ms(e).toLowerCase()},isExported:!0},eu={description:r("A segment of a string."),args:[Wr("text (string)",r("The string to extract a segment from.")),Wr("starting_at (number)",r("The index from the left of string from which to begin extracting. The first character in string has the index 1.")),Wr("extract_length (number)",r("The length of the segment to extract."))],returns:["STRING"],compute:function(e,t,o){const i=Ms(e),s=Is(t,this.locale),n=Is(o,this.locale);return xs((()=>s>=1),r("The starting_at argument (%s) must be positive greater than one.",s.toString())),xs((()=>n>=0),r("The extract_length argument (%s) must be positive or null.",n.toString())),i.slice(s-1,s+n-1)},isExported:!0},tu={description:r("Capitalizes each word in a specified string."),args:[Wr("text_to_capitalize (string)",r("The text which will be returned with the first letter of each word in uppercase and all other letters in lowercase."))],returns:["STRING"],compute:function(e){return Ms(e).replace(Wd,(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()))},isExported:!0},ou={description:r("Replaces part of a text string with different text."),args:[Wr("text (string)",r("The text, a part of which will be replaced.")),Wr("position (number)",r("The position where the replacement will begin (starting from 1).")),Wr("length (number)",r("The number of characters in the text to be replaced.")),Wr("new_text (string)",r("The text which will be inserted into the original text."))],returns:["STRING"],compute:function(e,t,o,i){const s=Is(t,this.locale);xs((()=>s>=1),r("The position (%s) must be greater than or equal to 1.",s.toString()));const n=Ms(e),a=Is(o,this.locale),l=Ms(i);return n.substring(0,s-1)+l+n.substring(s-1+a)},isExported:!0},iu={description:r("A substring from the end of a specified string."),args:[Wr("text (string)",r("The string from which the right portion will be returned.")),Wr("number_of_characters (number, optional)",r("The number of characters to return from the right side of string."))],returns:["STRING"],compute:function(e,...t){const o=t.length?Is(t[0],this.locale):1;xs((()=>o>=0),r("The number_of_characters (%s) must be positive or null.",o.toString()));const i=Ms(e),s=i.length;return i.substring(s-o,s)},isExported:!0},su={description:r("First position of string found in text, ignoring case."),args:[Wr("search_for (string)",r("The string to look for within text_to_search.")),Wr("text_to_search (string)",r("The text to search for the first occurrence of search_for.")),Wr("starting_at (number, default=1)",r("The character within text_to_search at which to start the search."))],returns:["NUMBER"],compute:function(e,t,o=1){const i=Ms(e).toLowerCase(),s=Ms(t).toLowerCase(),n=Is(o,this.locale);xs((()=>""!==s),r("The text_to_search must be non-empty.")),xs((()=>n>=1),r("The starting_at (%s) must be greater than or equal to 1.",n.toString()));const a=s.indexOf(i,n-1);return xs((()=>a>=0),r("In [[FUNCTION_NAME]] evaluation, cannot find '%s' within '%s'.",i,s)),a+1},isExported:!0},ru={description:r("Split text by specific character delimiter(s)."),args:[Wr("text (string)",r("The text to divide.")),Wr("delimiter (string)",r("The character or characters to use to split text.")),Wr("split_by_each (boolean, default=true})",r("Whether or not to divide text around each character contained in delimiter.")),Wr("remove_empty_text (boolean, default=true)",r("Whether or not to remove empty text messages from the split results. The default behavior is to treat consecutive delimiters as one (if TRUE). If FALSE, empty cells values are added between consecutive delimiters."))],returns:["RANGE<STRING>"],compute:function(e,t,o=true,i=true){const s=Ms(e),n=Se(Ms(t)),a=Ds(o),l=Ds(i);xs((()=>n.length>0),r("The _delimiter (%s) must be not be empty.",n));const c=a?new RegExp(`[${n}]`,"g"):new RegExp(n,"g");let h=s.split(c);return l&&(h=h.filter((e=>""!==e))),Ze([h])},isExported:!0},nu={description:r("Replaces existing text with new text in a string."),args:[Wr("text_to_search (string)",r("The text within which to search and replace.")),Wr("search_for (string)",r("The string to search for within text_to_search.")),Wr("replace_with (string)",r("The string that will replace search_for.")),Wr("occurrence_number (number, optional)",r("The instance of search_for within text_to_search to replace with replace_with. By default, all occurrences of search_for are replaced; however, if occurrence_number is specified, only the indicated instance of search_for is replaced."))],returns:["NUMBER"],compute:function(e,t,o,i){const s=Is(i,this.locale);xs((()=>s>=0),r("The occurrenceNumber (%s) must be positive or null.",s.toString()));const n=Ms(e),a=Ms(t);if(""===a)return n;const l=Ms(o),c=new RegExp(Se(a),"g");if(0===s)return n.replace(c,l);let h=0;return n.replace(c,(e=>++h===s?l:e))},isExported:!0},au={description:r("Combines text from multiple strings and/or arrays."),args:[Wr("delimiter (string)",r(" A string, possible empty, or a reference to a valid string. If empty, the text will be simply concatenated.")),Wr("ignore_empty (boolean)",r("A boolean; if TRUE, empty cells selected in the text arguments won't be included in the result.")),Wr("text1 (string, range<string>)",r("Any text item. This could be a string, or an array of strings in a range.")),Wr("text2 (string, range<string>, repeating)",r("Additional text item(s)."))],returns:["STRING"],compute:function(e,t,...o){const i=Ms(e),s=Ds(t);let r=0;return Bs(o,((e,t)=>s&&""===Ms(t)?e:(r++?e+i:"")+Ms(t)),"")},isExported:!0},lu={description:r("Removes space characters."),args:[Wr("text (string)",r("The text or reference to a cell containing text to be trimmed."))],returns:["STRING"],compute:function(e){return Ms(e).trim()},isExported:!0},cu={description:r("Converts a specified string to uppercase."),args:[Wr("text (string)",r("The string to convert to uppercase."))],returns:["STRING"],compute:function(e){return Ms(e).toUpperCase()},isExported:!0},hu={description:r("Converts a number to text according to a specified format."),args:[Wr("number (number)",r("The number, date or time to format.")),Wr("format (string)",r("The pattern by which to format the number, enclosed in quotation marks."))],returns:["STRING"],compute:function(e,t){return fo(Is(e,this.locale),{format:Ms(t),locale:this.locale})},isExported:!0};var du=Object.freeze({__proto__:null,CHAR:Gd,CLEAN:qd,CONCATENATE:Zd,EXACT:Yd,FIND:jd,JOIN:Xd,LEFT:Kd,LEN:Qd,LOWER:Jd,MID:eu,PROPER:tu,REPLACE:ou,RIGHT:iu,SEARCH:su,SPLIT:ru,SUBSTITUTE:nu,TEXTJOIN:au,TRIM:lu,UPPER:cu,TEXT:hu});const uu={description:r("Creates a hyperlink in a cell."),args:[Wr("url (string)",r("The full URL of the link enclosed in quotation marks.")),Wr("link_label (string, optional)",r("The text to display in the cell, enclosed in quotation marks."))],returns:["STRING"],compute:function(e,t){const o=Ms(e).trim(),i=Ms(t)||o;return""===o?i:Ne(i,o)},isExported:!0};var gu=Object.freeze({__proto__:null,HYPERLINK:uu});const pu=[{name:r("Array"),functions:xn},{name:r("Database"),functions:Pl},{name:r("Date"),functions:bc},{name:r("Filter"),functions:wc},{name:r("Financial"),functions:Wh},{name:r("Info"),functions:ed},{name:r("Lookup"),functions:yd},{name:r("Logical"),functions:dd},{name:r("Math"),functions:Na},{name:r("Misc"),functions:In},{name:r("Operator"),functions:$d},{name:r("Statistical"),functions:El},{name:r("Text"),functions:du},{name:r("Engineering"),functions:Sc},{name:r("Web"),functions:gu}],mu=/^[A-Z0-9\_\.]+$/;const fu=new class extends Ji{mapping={};add(e,t){if(e=e.toUpperCase(),!mu.test(e))throw new Error(r("Invalid function name %s. Function names can exclusively contain alphanumerical values separated by dots (.) or underscore (_)",e));const o=Gr(t);return function(e){let t=!1,o=!1,i=!1;for(let s of e){if(s.type.includes("META")&&s.type.length>1)throw new Error(r("Function ${name} has an argument that has been declared with more than one type whose type 'META'. The 'META' type can only be declared alone."));if(t&&!s.repeating)throw new Error(r("Function ${name} has no-repeatable arguments declared after repeatable ones. All repeatable arguments must be declared last."));const e=o||t||i,n=!(s.optional||s.repeating||s.default);if(e&&n)throw new Error(r("Function ${name} has at mandatory arguments declared after optional ones. All optional arguments must be after all mandatory arguments."));t=s.repeating,o=s.optional,i=s.default}}(o.args),this.mapping[e]=function(...e){const t=o.compute.bind(this),i=o.computeFormat?o.computeFormat.bind(this):()=>{},s=t(...function(e){return e.map((e=>{if(void 0!==e)return"function"==typeof e?()=>e()?.value:e.value}))}(e)),r=i(...e);if(Ss(s))return{value:s,format:r};if(!Ss(r))return{value:s,format:r};throw new Error("A format matrix should never be associated with a scalar value")},super.add(e,o),this}};for(let e of pu){const t=e.functions;for(let o in t){const i=t[o];i.category=i.category||e.name,o=o.replace(/_/g,"."),fu.add(o,{isExported:!1,...i})}}class bu{scope;code="";constructor(e=new Su){this.scope=e}append(...e){this.code+=e.map((e=>e.toString())).join("\n")+"\n"}return(e){return new vu(this.scope,this.code,e)}toString(){return Cu(this.code)}}class vu{scope;returnExpression;code;constructor(e,t,o){this.scope=e,this.returnExpression=o,this.code=Cu(t)}toString(){return this.code}wrapInClosure(){const e=this.scope.nextVariableName(),t=new bu(this.scope);return t.append(`const ${e} = () => {`),t.append(this.code),t.append(`return ${this.returnExpression};`),t.append("}"),t.return(e)}assignResultToVariable(){if(this.scope.isAlreadyDeclared(this.returnExpression))return this;const e=this.scope.nextVariableName(),t=new bu(this.scope);return t.append(this.code),t.append(`const ${e} = ${this.returnExpression};`),t.return(e)}}class Su{nextId=1;declaredVariables=new Set;nextVariableName(){const e="_"+this.nextId++;return this.declaredVariables.add(e),e}isAlreadyDeclared(e){return this.declaredVariables.has(e)}}function Cu(e){let t="",o=0;const i=e.split("\n").map((e=>e.trim())).filter((e=>""!==e));for(const e of i)e.startsWith("}")&&o--,t+="\t".repeat(o)+e+"\n",e.endsWith("{")&&o++;return t.trim()}const Eu=["%"],wu="+,-,*,/,:,=,<>,>=,>,<=,<,^,&".split(",").concat(Eu);function xu(e,t=eo){e=Xe(e);const o=new Lu(e),i=[];for(;!o.isOver();){let e=Fu(o)||Tu(o,t)||Ru(o)||Au(o)||Mu(o)||yu(o)||Du(o)||Ou(o,t)||_u(o);e||(e={type:"UNKNOWN",value:o.shift()}),i.push(e)}return i}function yu(e){return"?"===e.current?(e.shift(),{type:"DEBUGGER",value:"?"}):null}const Iu={"(":"LEFT_PAREN",")":"RIGHT_PAREN"};function Ru(e){if(e.current in Iu){const t=e.shift();return{type:Iu[t],value:t}}return null}function Tu(e,t){if(e.current===t.formulaArgSeparator){return{type:"ARG_SEPARATOR",value:e.shift()}}return null}function Au(e){for(let t of wu)if(e.currentStartsWith(t))return e.advanceBy(t.length),{type:"OPERATOR",value:t};return null}function Ou(e,t){const o=e.remaining().match(to(t.decimalSeparator));return o?(e.advanceBy(o[0].length),{type:"NUMBER",value:o[0]}):null}function Mu(e){if('"'===e.current){const t=e.shift();let o=t;for(;e.current&&(e.current!==t||"\\"===o[o.length-1]);)o+=e.shift();return'"'===e.current&&(o+=e.shift()),{type:"STRING",value:o}}return null}const Nu=/\w|\.|!|\$/;function _u(e){let t="";if("'"===e.current){let o=e.shift();for(t+=o;e.current;)if(o=e.shift(),t+=o,"'"===o){if(!e.current||"'"!==e.current)break;o=e.shift(),t+=o}if("'"!==o)return{type:"UNKNOWN",value:t}}for(;e.current&&Nu.test(e.current);)t+=e.shift();if(t.length){const e=t;return Zo.test(e)?{type:"REFERENCE",value:e}:{type:"SYMBOL",value:e}}return null}function Fu(e){let t=0;for(;e.current===fe;)t++,e.shift();if(t)return{type:"SPACE",value:fe.repeat(t)};for(;" "===e.current;)t++,e.shift();return t?{type:"SPACE",value:" ".repeat(t)}:null}function Du(e){return e.currentStartsWith(ee)?(e.advanceBy(ee.length),{type:"INVALID_REFERENCE",value:ee}):null}class Lu{text;currentIndex=0;current;constructor(e){this.text=e,this.current=e[0]}shift(){const e=this.current,t=this.text[++this.currentIndex];return this.current=t,e}advanceBy(e){this.currentIndex+=e,this.current=this.text[this.currentIndex]}isOver(){return this.currentIndex>=this.text.length}remaining(){return this.text.substring(this.currentIndex)}currentStartsWith(e){for(let t=0;t<e.length;t++)if(this.text[this.currentIndex+t]!==e[t])return!1;return!0}}const Pu=/[a-zA-Z0-9\_]+(\.[a-zA-Z0-9\_]+)*/,ku=["-","+"],Uu=["%"],Vu=["*","+","&"],Bu={"^":30,"%":30,"*":20,"/":20,"+":15,"-":15,"&":13,">":10,"<>":10,">=":10,"<":10,"<=":10,"=":10};function zu(e){const t=e.shift();if(!t)throw new h(ue);switch(t.type){case"DEBUGGER":const o=Wu(e,1e3);return o.debug=!0,o;case"NUMBER":return{type:"NUMBER",value:ro(t.value,eo)};case"STRING":return{type:"STRING",value:ve(t.value)};case"INVALID_REFERENCE":throw new u;case"REFERENCE":if(":"===e[0]?.value&&"REFERENCE"===e[1]?.type){e.shift();const o=e.shift();return{type:"REFERENCE",value:`${t.value}:${o?.value}`}}return{type:"REFERENCE",value:t.value};case"SYMBOL":const i=t.value;if("LEFT_PAREN"===e[0]?.type&&Pu.test(t.value)){const t=function(e){$u(e,"LEFT_PAREN",r("Missing opening parenthesis"));const t=e[0];if("RIGHT_PAREN"===t?.type)return $u(e,"RIGHT_PAREN"),[];const o=[];o.push(Hu(e));for(;"RIGHT_PAREN"!==e[0]?.type;)$u(e,"ARG_SEPARATOR",r("Wrong function call")),o.push(Hu(e));return $u(e,"RIGHT_PAREN"),o}(e);return{type:"FUNCALL",value:i,args:t}}const s=i.toUpperCase();if("TRUE"===s||"FALSE"===s)return{type:"BOOLEAN",value:"TRUE"===s};throw new h(r("Invalid formula"));case"LEFT_PAREN":const n=Wu(e);return $u(e,"RIGHT_PAREN",r("Missing closing parenthesis")),n;case"OPERATOR":const a=t.value;if(ku.includes(a))return{type:"UNARY_OPERATION",value:a,operand:Wu(e,Bu[a])};throw new h(r("Unexpected token: %s",t.value));default:throw new h(r("Unexpected token: %s",t.value))}}function Hu(e){const t=e[0];return"ARG_SEPARATOR"===t?.type||"RIGHT_PAREN"===t?.type?{type:"EMPTY",value:""}:Wu(e)}function $u(e,t,o=ue){const i=e.shift();if(!i||i.type!==t)throw new h(o)}function Wu(e,t=0){if(0===e.length)throw new h(ue);let o=zu(e);for(;"OPERATOR"===e[0]?.type&&Bu[e[0].value]>t;){const t=e.shift().value;if(Uu.includes(t))o={type:"UNARY_OPERATION",value:t,operand:o,postfix:!0};else{o={type:"BIN_OPERATION",value:t,left:o,right:Wu(e,Bu[t])}}}return o}function Gu(e){return qu(xu(e))}function qu(e){"="===(e=e.filter((e=>"SPACE"!==e.type)))[0].value&&e.splice(0,1);const t=Wu(e);if(e.length)throw new h(ue);return t}function Zu(e,t,o){return Xu(e,(e=>e.type===t?o(e):e))}function Yu(e){return Array.from(ju(e))}function*ju(e){switch(yield e,e.type){case"FUNCALL":for(const t of e.args)yield*ju(t);break;case"UNARY_OPERATION":yield*ju(e.operand);break;case"BIN_OPERATION":yield*ju(e.left),yield*ju(e.right)}}function Xu(e,t){switch((e=t(e)).type){case"FUNCALL":return{...e,args:e.args.map((e=>Xu(e,t)))};case"UNARY_OPERATION":return{...e,operand:Xu(e.operand,t)};case"BIN_OPERATION":return{...e,right:Xu(e.right,t),left:Xu(e.left,t)};default:return e}}function Ku(e){switch(e.type){case"FUNCALL":const t=e.args.map((e=>Ku(e)));return`${e.value}(${t.join(",")})`;case"NUMBER":return e.value.toString();case"REFERENCE":default:return e.value;case"STRING":return`"${e.value}"`;case"BOOLEAN":return e.value?"TRUE":"FALSE";case"UNARY_OPERATION":return e.postfix?Qu(e)+e.value:e.value+Ju(e);case"BIN_OPERATION":return Qu(e)+e.value+Ju(e)}}function Qu(e){const t=e.value,o="left"in e?e.left:e.operand,i=o.value;return"BIN_OPERATION"===o.type&&Bu[i]<Bu[t]?`(${Ku(o)})`:Ku(o)}function Ju(e){const t=e.value,o="right"in e?e.right:e.operand,i=Bu[o.value],s=Bu[t];let r=!1;return"BIN_OPERATION"!==o.type?r=!1:i<s?r=!0:i!==s||Vu.includes(t)||(r=!0),r?`(${Ku(o)})`:Ku(o)}var eg;!function(e){e[e.LeftRef=0]="LeftRef",e[e.RightRef=1]="RightRef",e[e.Separator=2]="Separator",e[e.FullColumnSeparator=3]="FullColumnSeparator",e[e.FullRowSeparator=4]="FullRowSeparator",e[e.RightColumnRef=5]="RightColumnRef",e[e.RightRowRef=6]="RightRowRef",e[e.Found=7]="Found"}(eg||(eg={}));const tg=(e,t=(()=>!0))=>[{goTo:e,guard:t}],og=(e,t=(()=>!0))=>({goTo:e,guard:t}),ig={[eg.LeftRef]:{REFERENCE:tg(eg.Separator),NUMBER:tg(eg.FullRowSeparator),SYMBOL:[og(eg.FullColumnSeparator,(e=>Yo(e.value))),og(eg.FullRowSeparator,(e=>jo(e.value)))]},[eg.FullColumnSeparator]:{SPACE:tg(eg.FullColumnSeparator),OPERATOR:tg(eg.RightColumnRef,(e=>":"===e.value))},[eg.FullRowSeparator]:{SPACE:tg(eg.FullRowSeparator),OPERATOR:tg(eg.RightRowRef,(e=>":"===e.value))},[eg.Separator]:{SPACE:tg(eg.Separator),OPERATOR:tg(eg.RightRef,(e=>":"===e.value))},[eg.RightRef]:{SPACE:tg(eg.RightRef),NUMBER:tg(eg.Found),REFERENCE:tg(eg.Found,(e=>Qo(e.value))),SYMBOL:tg(eg.Found,(e=>Xo(e.value)||Ko(e.value)))},[eg.RightColumnRef]:{SPACE:tg(eg.RightColumnRef),SYMBOL:tg(eg.Found,(e=>Xo(e.value))),REFERENCE:tg(eg.Found,(e=>Qo(e.value)))},[eg.RightRowRef]:{SPACE:tg(eg.RightRowRef),NUMBER:tg(eg.Found),REFERENCE:tg(eg.Found,(e=>Qo(e.value))),SYMBOL:tg(eg.Found,(e=>Ko(e.value)))},[eg.Found]:{}};function sg(e){let t=0,o=ig[eg.LeftRef];const i=[];for(;void 0!==o;){const s=e[t++];if(!s)return null;const r=o[s.type]?.find((e=>e.guard(s))),n=r?r.goTo:void 0;switch(n){case void 0:return null;case eg.Found:return i.push(s),e.splice(0,t),{type:"REFERENCE",value:Be(i.map((e=>e.value)))};default:o=ig[n],i.push(s)}}return null}function rg(e,t=eo){const o=xu(e,t),i=[];for(;o.length;)i.push(sg(o)||o.shift());return i}const ng=fu.content,ag={"=":"EQ","+":"ADD","-":"MINUS","*":"MULTIPLY","/":"DIVIDE",">=":"GTE","<>":"NE",">":"GT","<=":"LTE","<":"LT","^":"POWER","&":"CONCATENATE"},lg={"-":"UMINUS","+":"UPLUS","%":"UNARY.PERCENT"},cg={};function hg(e){const t=rg(e),{dependencies:o,constantValues:i}=function(e){const t={numbers:[],strings:[]},o=[];for(const i of e)switch(i.type){case"INVALID_REFERENCE":case"REFERENCE":o.push(i.value);break;case"STRING":const e=ve(i.value);t.strings.includes(e)||t.strings.push(e);break;case"NUMBER":{const e=ro(i.value,eo);t.numbers.includes(e)||t.numbers.push(e);break}}return{dependencies:o,constantValues:t}}(t),s=function(e,t,o){return Be(e.map((e=>{switch(e.type){case"STRING":const i=ve(e.value);return`|S${o.strings.indexOf(i)}|`;case"NUMBER":return`|N${o.numbers.indexOf(ro(e.value,eo))}|`;case"REFERENCE":case"INVALID_REFERENCE":return`|${t.indexOf(e.value)}|`;case"SPACE":return"";default:return e.value}})))}(t,o,i);if(!cg[s]){const n=qu([...t]),a=new Su;if("BIN_OPERATION"===n.type&&":"===n.value)throw new h(r("Invalid formula"));if("EMPTY"===n.type)throw new h(r("Invalid formula"));const l=g(n),c=new bu;c.append(`// ${s}`),c.append(l),c.append(`return ${l.returnExpression};`);let d=new Function("deps","ref","range","ctx",c.toString());function u(e){const{args:t}=e,o=e.value.toUpperCase(),i=ng[o];if(!i)throw new p(e.value);!function(e){const t=e.args.length,o=e.value.toUpperCase(),i=ng[o];if(t<i.minArgRequired)throw new h(r("Invalid number of arguments for the %s function. Expected %s minimum, but got %s instead.",o,i.minArgRequired.toString(),t.toString()));if(t>i.maxArgPossible)throw new h(r("Invalid number of arguments for the %s function. Expected %s maximum, but got %s instead.",o,i.maxArgPossible.toString(),t.toString()));const s=i.nbrArgRepeating;if(s>1){const e=i.args.length-s;if((t-e)%s!=0)throw new h(r("Invalid number of arguments for the %s function. Expected all arguments after position %s to be supplied by groups of %s arguments",o,e.toString(),s.toString()))}}(e);const s=[];for(let e=0;e<t.length;e++){const n=i.getArgToFocus(e+1)-1,a=i.args[n],l=t[e],c=a.type||[],d=c.includes("META"),u=a.lazy,p=c.some((e=>dg(e))),m=c.every((e=>dg(e)));if(m&&!ug(l))throw new h(r("Function %s expects the parameter %s to be reference to a cell or range, not a %s.",o,(e+1).toString(),l.type.toLowerCase()));const f=g(l,d,p,{functionName:o,paramIndex:e+1});s.push(u?f.wrapInClosure():f)}return s}function g(e,t=!1,s=!1,n={}){const l=new bu(a);if("REFERENCE"!==e.type&&("BIN_OPERATION"!==e.type||":"!==e.value)&&t)throw new h(r("Argument must be a reference to a cell or range."));switch(e.debug&&l.append("debugger;"),e.type){case"BOOLEAN":return l.return(`{ value: ${e.value} }`);case"NUMBER":return l.return(`{ value: this.constantValues.numbers[${i.numbers.indexOf(e.value)}] }`);case"STRING":return l.return(`{ value: this.constantValues.strings[${i.strings.indexOf(e.value)}] }`);case"REFERENCE":const r=o.indexOf(e.value);return s?l.return(`range(deps[${r}])`):l.return(`ref(deps[${r}], ${t?"true":"false"}, "${n.functionName||ag["="]}", ${n.paramIndex})`);case"FUNCALL":const a=u(e).map((e=>e.assignResultToVariable()));l.append(...a);const c=e.value.toUpperCase();return l.append(`ctx.__lastFnCalled = '${c}';`),l.return(`ctx['${c}'](${a.map((e=>e.returnExpression))})`);case"UNARY_OPERATION":{const t=lg[e.value],o=g(e.operand,!1,!1,{functionName:t}).assignResultToVariable();return l.append(o),l.append(`ctx.__lastFnCalled = '${t}';`),l.return(`ctx['${t}'](${o.returnExpression})`)}case"BIN_OPERATION":{const t=ag[e.value],o=g(e.left,!1,!1,{functionName:t}).assignResultToVariable(),i=g(e.right,!1,!1,{functionName:t}).assignResultToVariable();return l.append(o),l.append(i),l.append(`ctx.__lastFnCalled = '${t}';`),l.return(`ctx['${t}'](${o.returnExpression}, ${i.returnExpression})`)}case"EMPTY":return l.return("undefined")}}cg[s]={execute:d}}return{execute:cg[s].execute,dependencies:o,constantValues:i,tokens:t}}function dg(e){return e.startsWith("RANGE")}function ug(e){if("REFERENCE"===e.type)return!0;if("FUNCALL"===e.type){const t=ng[e.value.toUpperCase()];return t&&dg(t.returns[0])}return!1}function gg(e,t){return function(e){let t=[],o="";return e.map(((e,i)=>{switch(["SPACE","LEFT_PAREN"].includes(e.type)||(o=""),e.type){case"SYMBOL":o=e.value;break;case"LEFT_PAREN":t.push({parent:o,argPosition:0}),o="";break;case"RIGHT_PAREN":t.pop();break;case"ARG_SEPARATOR":t.length&&t[t.length-1].argPosition++}if(t.length){const o=t[t.length-1];o.parent&&(e.functionContext=Object.assign({},o))}return e}))}(function(e){let t=1;const o=[];return e.map((e=>("LEFT_PAREN"===e.type?(o.push(t),e.parenIndex=t,t++):"RIGHT_PAREN"===e.type&&(e.parenIndex=o.pop()),e)))}(function(e){let t=0;return e.map((e=>{const o=e.value.toString().length,i=Object.assign({},e,{start:t,end:t+o,length:o});return t=i.end,i}))}(rg(e,t))))}const pg=fu.content;function mg(e){try{return 0===Yu(qu(e)).filter((e=>"FUNCALL"===e.type&&!pg[e.value.toUpperCase()]?.isExported)).length}catch(e){return!1}}function fg(e){if(!e||"object"!=typeof e||"string"!=typeof e.name||"string"!=typeof e.code||"string"!=typeof e.thousandsSeparator||"string"!=typeof e.decimalSeparator||"string"!=typeof e.dateFormat||"string"!=typeof e.timeFormat||"string"!=typeof e.formulaArgSeparator)return!1;if(!Object.values(e).every((e=>e)))return!1;if(e.formulaArgSeparator===e.decimalSeparator)return!1;if(e.thousandsSeparator===e.decimalSeparator)return!1;try{fo(1,{locale:e,format:"#,##0.00"}),fo(1,{locale:e,format:e.dateFormat}),fo(1,{locale:e,format:e.timeFormat})}catch{return!1}return!0}function bg(e,t){return e.startsWith("=")?Cg(e,t):xg(e,t)}function vg(e,t){return e.startsWith("=")?Cg(e,t):function(e,t){if(Pt(e,t)){const o=Is(e,t);let i=eo.dateFormat;return Number.isInteger(o)||(i+=" "+eo.timeFormat),fo(o,{locale:eo,format:i})}return xg(e,t)}(e,t)}function Sg(e,t){return e.startsWith("=")?Eg(e,t):function(e,t){if(Pt(e,eo)){const o=Is(e,eo);let i=t.dateFormat;return Number.isInteger(o)||(i+=" "+t.timeFormat),fo(o,{locale:t,format:i})}return function(e,t){if("."===t.decimalSeparator||!io(e,eo))return e;const o=Ao(eo),i=e.replace(o,(e=>e.replace(".",t.decimalSeparator)));return i}(e,t)}(e,t)}function Cg(e,t){return wg(e,t,eo)}function Eg(e,t){return wg(e,eo,t)}function wg(e,t,o){if(t.formulaArgSeparator===o.formulaArgSeparator&&t.decimalSeparator===o.decimalSeparator)return e;const i=xu(e,t);let s="";for(const e of i)"NUMBER"===e.type?s+=e.value.replace(t.decimalSeparator,o.decimalSeparator):"ARG_SEPARATOR"===e.type?s+=o.formulaArgSeparator:s+=e.value;return s}function xg(e,t){return"."!==t.decimalSeparator&&io(e,t)?e.replace(t.thousandsSeparator,"").replace(t.decimalSeparator,"."):e}function yg(e,t){return Rg(e,(e=>vg(e,t)))}function Ig(e,t){return Rg(e,(e=>Sg(e,t)))}function Rg(e,t){switch((e=Ce(e)).type){case"CellIsRule":switch(e.operator){case"Between":case"NotBetween":case"Equal":case"NotEqual":case"GreaterThan":case"GreaterThanOrEqual":case"LessThan":case"LessThanOrEqual":return e.values=e.values.map((e=>t(e))),e;case"BeginsWith":case"ContainsText":case"EndsWith":case"NotContains":case"IsEmpty":case"IsNotEmpty":return e}break;case"ColorScaleRule":return e.minimum=Tg(e.minimum,t),e.maximum=Tg(e.maximum,t),e.midpoint&&(e.midpoint=Tg(e.midpoint,t)),e;case"IconSetRule":return e.lowerInflectionPoint.value=t(e.lowerInflectionPoint.value),e.upperInflectionPoint.value=t(e.upperInflectionPoint.value),e}}function Tg(e,t){if(!e?.value)return e;const o=t("formula"===e.type?"="+e.value:e.value),i="formula"===e.type?o.slice(1):o;return{...e,value:i}}const Ag={name:r("Link sheet"),children:[e=>e.model.getters.getSheetIds().map((t=>e.model.getters.getSheet(t))).map((e=>({id:e.id,name:e.name,execute:()=>Ne(e.name,Le(e.id))})))]},Og={name:r("Delete"),isVisible:e=>e.model.getters.getSheetIds().length>1,execute:e=>e.askConfirmation(r("Are you sure you want to delete this sheet?"),(()=>{e.model.dispatch("DELETE_SHEET",{sheetId:e.model.getters.getActiveSheetId()})}))},Mg={name:r("Duplicate"),execute:e=>{const t=e.model.getters.getActiveSheetId(),o=e.model.uuidGenerator.uuidv4();e.model.dispatch("DUPLICATE_SHEET",{sheetId:t,sheetIdTo:o}),e.model.dispatch("ACTIVATE_SHEET",{sheetIdFrom:t,sheetIdTo:o})}},Ng=e=>({name:r("Rename"),execute:e.renameSheetCallback}),_g={name:r("Move right"),isVisible:e=>{const t=e.model.getters.getActiveSheetId(),o=e.model.getters.getVisibleSheetIds();return o.indexOf(t)!==o.length-1},execute:e=>e.model.dispatch("MOVE_SHEET",{sheetId:e.model.getters.getActiveSheetId(),delta:1})},Fg={name:r("Move left"),isVisible:e=>{const t=e.model.getters.getActiveSheetId();return e.model.getters.getVisibleSheetIds()[0]!==t},execute:e=>e.model.dispatch("MOVE_SHEET",{sheetId:e.model.getters.getActiveSheetId(),delta:-1})},Dg={name:r("Hide sheet"),isVisible:e=>1!==e.model.getters.getVisibleSheetIds().length,execute:e=>e.model.dispatch("HIDE_SHEET",{sheetId:e.model.getters.getActiveSheetId()})};function Lg(e){return e.map(kg).sort(((e,t)=>e.sequence-t.sequence))}const Pg=new Bi;function kg(e){const t=e.name,o=e.children,i=e.description,s=e.icon;return{id:e.id||Pg.uuidv4(),name:"function"==typeof t?t:()=>t,isVisible:e.isVisible?e.isVisible:()=>!0,isEnabled:e.isEnabled?e.isEnabled:()=>!0,isActive:e.isActive,execute:e.execute,children:o?e=>o.map((t=>"function"==typeof t?t(e):t)).flat().map(kg):()=>[],isReadonlyAllowed:e.isReadonlyAllowed||!1,separator:e.separator||!1,icon:"function"==typeof s?s:()=>s||"",description:"function"==typeof i?i:()=>i||"",textColor:e.textColor,sequence:e.sequence||0}}class Ug extends Ji{add(e,t){return void 0===t.id&&(t.id=e),this.content[e]=t,this}addChild(e,t,o){"function"!=typeof o&&void 0===o.id&&(o.id=e);const i=t.splice(0,1)[0];let s=this.content[i];if(!s)throw new Error(`Path ${i+":"+t.join(":")} not found`);for(let e of t){const o=s.children;if(!o||"function"==typeof o)throw new Error(`${e} is either not a node or it's dynamically computed`);if(s=o.find((t=>t.id===e)),!s)throw new Error(`Path ${i+":"+t.join(":")} not found`)}return s.children||(s.children=[]),s.children.push(o),this}getMenuItems(){return Lg(this.getAll())}}const Vg=new Ug;Vg.add("sheet",{...Ag,sequence:10});Wi`
|
|
278
|
+
`;class Br extends t.Component{static components={Menu:Vr};static template="o-spreadsheet-LinkDisplay";get cell(){const{col:e,row:t}=this.props.cellPosition,o=this.env.model.getters.getActiveSheetId();return this.env.model.getters.getEvaluatedCell({sheetId:o,col:e,row:t})}get link(){if(this.cell.link)return this.cell.link;const{col:e,row:t}=this.props.cellPosition;throw new Error(`LinkDisplay Component can only be used with link cells. ${xt(e,t)} is not a link.`)}getUrlRepresentation(e){return rs(e,this.env.model.getters)}openLink(){ns(this.link,this.env)}edit(){const{col:e,row:t}=this.props.cellPosition;this.env.model.dispatch("OPEN_CELL_POPOVER",{col:e,row:t,popoverType:"LinkEditor"})}unlink(){const e=this.env.model.getters.getActiveSheetId(),{col:t,row:o}=this.props.cellPosition,i=this.env.model.getters.getCellComputedStyle({sheetId:e,col:t,row:o}),s=i?.textColor===R?void 0:i?.textColor;this.env.model.dispatch("UPDATE_CELL",{col:t,row:o,sheetId:e,content:this.link.label,style:{...i,textColor:s,underline:void 0}})}}const zr={onHover:(e,t)=>{const o=t.getEvaluatedCell(e);return!t.isDashboard()&&o.link&&t.isVisibleInViewport(e)?{isOpen:!0,Component:Br,props:{cellPosition:e},cellCorner:"BottomLeft"}:{isOpen:!1}}};Br.props={cellPosition:Object,onClosed:{type:Function,optional:!0}};const Hr=/(.*?)\((.*?)\)(.*)/,$r=["ANY","BOOLEAN","DATE","NUMBER","STRING","RANGE","RANGE<BOOLEAN>","RANGE<DATE>","RANGE<NUMBER>","RANGE<STRING>","META"];function Wr(e,t=""){return function(e,t){let o=e.match(Hr),i=o[1].trim();if(!i)throw new Error(`Function argument definition is missing a name: '${e}'.`);let s,r=[],n=!1,a=!1,l=!1;for(let e of o[2].split(",")){const t=e.trim().toUpperCase();let o=$r.find((e=>t===e));o?r.push(o):"RANGE<ANY>"===t?r.push("RANGE"):"OPTIONAL"===t?n=!0:"REPEATING"===t?a=!0:"LAZY"===t?l=!0:t.startsWith("DEFAULT=")&&(s=e.trim().slice(8))}const c={name:i,description:t,type:r};n&&(c.optional=!0);a&&(c.repeating=!0);l&&(c.lazy=!0);void 0!==s&&(c.default=!0,c.defaultValue=s);return c}(e,t)}function Gr(e){let t=0,o=0,i=0;for(let s of e.args)t++,s.optional||s.repeating||s.default||o++,s.repeating&&i++;const s=e;return s.minArgRequired=o,s.maxArgPossible=i?1/0:t,s.nbrArgRepeating=i,s.getArgToFocus=function(e,t){if(!t)return e=>e;if(1===t)return t=>Math.min(t,e);const o=e-t;return e=>{if(e<=o)return e;return o+((e-o)%t||t)}}(t,i),s.hidden=e.hidden||!1,s}function qr(e,t){xs((()=>1===t.length||1===t[0].length),e)}function Zr(e,...t){if(t.every(Ss)){const o=t[0].length,i=t[0][0].length;for(const s of t)xs((()=>s.length===o&&s[0].length===i),e)}else if(t.some((e=>Array.isArray(e)&&(1!==e.length||1!==e[0].length))))throw new Error(e)}function Yr(e,t){xs((()=>t>0),e)}function jr(e,t){xs((()=>t.length===t[0].length),e)}function Xr(e){return e.every((e=>e.every((e=>"number"==typeof e))))}function Kr(e){const t=Array(e);for(let o=0;o<e;o++)t[o]=Array(e).fill(0),t[o][o]=1;return t}function Qr(e){if(e.length!==e[0].length)throw new Error("Function [[FUNCTION_NAME]] invert matrix error, only square matrices are invertible");let t=1;const o=e.length,i=Kr(o),s=e.map((e=>e.slice()));for(let e=0;e<o;e++){let r=s[e][e];if(0===r){for(let r=e+1;r<o;r++)if(0!=s[e][r]){Jr(s,e,r),Jr(i,e,r),t*=-1;break}if(r=s[e][e],0===r)return{determinant:0}}for(let t=0;t<o;t++)s[t][e]=s[t][e]/r,i[t][e]=i[t][e]/r;t*=r;for(let t=0;t<o;t++){if(t===e)continue;const r=s[e][t];for(let n=0;n<o;n++)s[n][t]-=r*s[n][e],i[n][t]-=r*i[n][e]}}return{inverted:i,determinant:t}}function Jr(e,t,o){for(let i=0;i<e.length;i++){const s=e[i][t];e[i][t]=e[i][o],e[i][o]=s}}const en={description:r("Returns a result array constrained to a specific width and height."),args:[Wr("input_range (any, range<any>)",r("The range to constrain.")),Wr("rows (number)",r("The number of rows in the constrained array.")),Wr("columns (number)",r("The number of columns in the constrained array."))],returns:["RANGE<ANY>"],compute:function(e,t,o){const i=er(e),s=Ts(t,this.locale),n=Ts(o,this.locale);Yr(r("The rows argument (%s) must be strictly positive.",s.toString()),s),Yr(r("The columns argument (%s) must be strictly positive.",s.toString()),n);const a=Math.min(s,i[0].length),l=Math.min(n,i.length),c=Array(l);for(let e=0;e<l;e++){c[e]=Array(a);for(let t=0;t<a;t++)c[e][t]=Js(i[e][t])}return c},isExported:!1},tn={description:r("Creates a new array from the selected columns in the existing range."),args:[Wr("array (any, range<any>)",r("The array that contains the columns to be returned.")),Wr("col_num (number, range<number>)",r("The first column index of the columns to be returned.")),Wr("col_num2 (number, range<number>, repeating)",r("The columns indexes of the columns to be returned."))],returns:["RANGE<ANY>"],compute:function(e,...t){const o=er(e),i=tr(t,(e=>Ts(e,this.locale)));xs((()=>i.every((e=>e>0&&e<=o.length))),r("The columns arguments must be between 1 and %s (got %s).",o.length.toString(),(i.find((e=>e<=0||e>o.length))||0).toString()));const s=Array(i.length);for(let e=0;e<i.length;e++){const t=i[e]-1;s[e]=o[t]}return Qs(s)},isExported:!0},on={description:r("Creates a new array from the selected rows in the existing range."),args:[Wr("array (any, range<any>)",r("The array that contains the rows to be returned.")),Wr("row_num (number, range<number>)",r("The first row index of the rows to be returned.")),Wr("row_num2 (number, range<number>, repeating)",r("The rows indexes of the rows to be returned."))],returns:["RANGE<ANY>"],compute:function(e,...t){const o=er(e),i=tr(t,(e=>Ts(e,this.locale)));xs((()=>i.every((e=>e>0&&e<=o[0].length))),r("The rows arguments must be between 1 and %s (got %s).",o[0].length.toString(),(i.find((e=>e<=0||e>o[0].length))||0).toString()));const s=Array(o.length);for(let e=0;e<o.length;e++){s[e]=Array(i.length);for(let t=0;t<i.length;t++){const r=i[t]-1;s[e][t]=Js(o[e][r])}}return s},isExported:!0},sn={description:r("Expands or pads an array to specified row and column dimensions."),args:[Wr("array (any, range<any>)",r("The array to expand.")),Wr("rows (number)",r("The number of rows in the expanded array. If missing, rows will not be expanded.")),Wr("columns (number, optional)",r("The number of columns in the expanded array. If missing, columns will not be expanded.")),Wr("pad_with (any, default=0)",r("The value with which to pad."))],returns:["RANGE<ANY>"],compute:function(e,t,o,i=0){const s=er(e),n=Ts(t,this.locale),a=void 0!==o?Ts(o,this.locale):s.length,l=null!=i?i:0;xs((()=>n>=s[0].length),r("The rows arguments (%s) must be greater or equal than the number of rows of the array.",n.toString())),xs((()=>a>=s.length),r("The columns arguments (%s) must be greater or equal than the number of columns of the array.",a.toString()));const c=[];for(let e=0;e<a;e++){c[e]=[];for(let t=0;t<n;t++)e>=s.length||t>=s[e].length?c[e][t]=l:c[e][t]=s[e][t]??0}return c},isExported:!0},rn={description:r("Flattens all the values from one or more ranges into a single column."),args:[Wr("range (any, range<any>)",r("The first range to flatten.")),Wr("range2 (any, range<any>, repeating)",r("Additional ranges to flatten."))],returns:["RANGE<ANY>"],compute:function(...e){return[tr(e,Js)]},isExported:!1},nn={description:r("Calculates the frequency distribution of a range."),args:[Wr("data (range<number>)",r("The array of ranges containing the values to be counted.")),Wr("classes (number, range<number>)",r("The range containing the set of classes."))],returns:["RANGE<NUMBER>"],compute:function(e,t){const o=tr([e],(e=>e)).filter((e=>"number"==typeof e)),i=tr([t],(e=>e)).filter((e=>"number"==typeof e)).map(((e,t)=>({initialIndex:t,value:e,count:0}))).sort(((e,t)=>e.value-t.value));i.push({initialIndex:i.length,value:1/0,count:0});const s=o.sort(((e,t)=>e-t));let r=0;for(const e of s){for(;e>i[r].value&&r<i.length-1;)r++;i[r].count++}return[i.sort(((e,t)=>e.initialIndex-t.initialIndex)).map((e=>e.count))]},isExported:!0},an={description:r("Appends ranges horizontally and in sequence to return a larger array."),args:[Wr("range1 (any, range<any>)",r("The first range to be appended.")),Wr("range2 (any, range<any>, repeating)",r("Additional ranges to add to range1."))],returns:["RANGE<ANY>"],compute:function(...e){const t=e.map((e=>er(e))),o=Math.max(...t.map((e=>e[0].length))),i=[];for(const e of t)for(const t of e){const e=Array(o).fill(0);for(let o=0;o<t.length;o++)e[o]=Js(t[o]);i.push(e)}return i},isExported:!0},ln={description:r("Returns the matrix determinant of a square matrix."),args:[Wr("square_matrix (number, range<number>)",r("An range with an equal number of rows and columns representing a matrix whose determinant will be calculated."))],returns:["NUMBER"],compute:function(e){const t=er(e);if(jr(r("The argument square_matrix must have the same number of columns and rows."),t),!Xr(t))throw new Error(r("The argument square_matrix must be a matrix of numbers."));const{determinant:o}=Qr(t);return o},isExported:!0},cn={description:r("Returns the multiplicative inverse of a square matrix."),args:[Wr("square_matrix (number, range<number>)",r("An range with an equal number of rows and columns representing a matrix whose multiplicative inverse will be calculated."))],returns:["RANGE<NUMBER>"],compute:function(e){const t=er(e);if(jr(r("The argument square_matrix must have the same number of columns and rows."),t),!Xr(t))throw new Error(r("The argument square_matrix must be a matrix of numbers."));const{inverted:o}=Qr(t);if(!o)throw new Error(r("The matrix is not invertible."));return o},isExported:!0},hn={description:r("Calculates the matrix product of two matrices."),args:[Wr("matrix1 (number, range<number>)",r("The first matrix in the matrix multiplication operation.")),Wr("matrix2 (number, range<number>)",r("The second matrix in the matrix multiplication operation."))],returns:["RANGE<NUMBER>"],compute:function(e,t){const o=er(e),i=er(t);if(xs((()=>o.length===i[0].length),r("In [[FUNCTION_NAME]], the number of columns of the first matrix (%s) must be equal to the number of rows of the second matrix (%s).",o.length.toString(),i[0].length.toString())),!Xr(o)||!Xr(i))throw new Error(r("The arguments matrix1 and matrix2 must be matrices of numbers."));return function(e,t){if(e.length!==t[0].length)throw new Error(r("Cannot multiply matrices : incompatible matrices size."));const o=e[0].length,i=t.length,s=e.length,n=Array(i);for(let r=0;r<i;r++){n[r]=Array(o);for(let i=0;i<o;i++){let o=0;for(let n=0;n<s;n++)o+=e[n][i]*t[r][n];n[r][i]=o}}return n}(o,i)},isExported:!0},dn={description:r("Calculates the sum of the products of corresponding entries in equal-sized ranges."),args:[Wr("range1 (number, range<number>)",r("The first range whose entries will be multiplied with corresponding entries in the other ranges.")),Wr("range2 (number, range<number>, repeating)",r("The other range whose entries will be multiplied with corresponding entries in the other ranges."))],returns:["NUMBER"],compute:function(...e){Zr(r("All the ranges must have the same dimensions."),...e);const t=e.map(er);let o=0;for(let e=0;e<t[0].length;e++)for(let i=0;i<t[0][e].length;i++){if(!t.every((t=>"number"==typeof t[e][i])))continue;let s=1;for(const o of t)s*=Is(o[e][i],this.locale);o+=s}return o},isExported:!0};function un(e,t,o){Zr("The arguments array_x and array_y must have the same dimensions.",e,t);const i=er(e),s=er(t);let r=!1,n=0;for(const e in i)for(const t in i[e]){const a=i[e][t],l=s[e][t];"number"==typeof a&&"number"==typeof l&&(r=!0,n+=o(a,l))}if(!r)throw new Error("The arguments array_x and array_y must contain at least one pair of numbers.");return n}const gn={description:r("Calculates the sum of the difference of the squares of the values in two array."),args:[Wr("array_x (number, range<number>)",r("The array or range of values whose squares will be reduced by the squares of corresponding entries in array_y and added together.")),Wr("array_y (number, range<number>)",r("The array or range of values whose squares will be subtracted from the squares of corresponding entries in array_x and added together."))],returns:["NUMBER"],compute:function(e,t){return un(e,t,((e,t)=>e**2-t**2))},isExported:!0},pn={description:r("Calculates the sum of the sum of the squares of the values in two array."),args:[Wr("array_x (number, range<number>)",r("The array or range of values whose squares will be added to the squares of corresponding entries in array_y and added together.")),Wr("array_y (number, range<number>)",r("The array or range of values whose squares will be added to the squares of corresponding entries in array_x and added together."))],returns:["NUMBER"],compute:function(e,t){return un(e,t,((e,t)=>e**2+t**2))},isExported:!0},mn={description:r("Calculates the sum of squares of the differences of values in two array."),args:[Wr("array_x (number, range<number>)",r("The array or range of values that will be reduced by corresponding entries in array_y, squared, and added together.")),Wr("array_y (number, range<number>)",r("The array or range of values that will be subtracted from corresponding entries in array_x, the result squared, and all such results added together."))],returns:["NUMBER"],compute:function(e,t){return un(e,t,((e,t)=>(e-t)**2))},isExported:!0},fn=[Wr("array (any, range<any>)",r("The array which will be transformed.")),Wr("ignore (number, default=0)",r("The control to ignore blanks and errors. 0 (default) is to keep all values, 1 is to ignore blanks, 2 is to ignore errors, and 3 is to ignore blanks and errors.")),Wr("scan_by_column (number, default=false)",r("Whether the array should be scanned by column. True scans the array by column and false (default) scans the array by row."))],bn={description:r("Transforms a range of cells into a single column."),args:fn,returns:["RANGE<ANY>"],compute:function(e,t=0,o=false){const i=er(e),s=Ts(t,this.locale),n=Ds(o);xs((()=>s>=0&&s<=3),r("Argument ignore must be between 0 and 3"));const a=Bs([i],((e,t)=>1!==s&&3!==s||null!=t?(e.push(Js(t)),e):e),[],n?"colFirst":"rowFirst");if(0===a.length)throw new g(r("No results for the given arguments of TOCOL."));return[a]},isExported:!0},vn={description:r("Transforms a range of cells into a single row."),args:fn,returns:["RANGE<ANY>"],compute:function(e,t=0,o=false){const i=er(e),s=Ts(t,this.locale),n=Ds(o);xs((()=>s>=0&&s<=3),r("Argument ignore must be between 0 and 3"));const a=Bs([i],((e,t)=>1!==s&&3!==s||null!=t?(e.push([Js(t)]),e):e),[],n?"colFirst":"rowFirst");if(0===a.length||0===a[0].length)throw new g(r("No results for the given arguments of TOROW."));return a},isExported:!0},Sn={description:r("Transposes the rows and columns of a range."),args:[Wr("range (any, range<any>)",r("The range to be transposed."))],returns:["RANGE<ANY>"],computeFormat:e=>{if(e.format)return Ss(e.format)?Ze(e.format):e.format},compute:function(e){return Ze(er(e),Js)},isExported:!0},Cn={description:r("Appends ranges vertically and in sequence to return a larger array."),args:[Wr("range1 (any, range<any>)",r("The first range to be appended.")),Wr("range2 (any, range<any>, repeating)",r("Additional ranges to add to range1."))],returns:["RANGE<ANY>"],compute:function(...e){const t=e.map((e=>er(e))),o=Math.max(...t.map((e=>e.length))),i=t.reduce(((e,t)=>e+t[0].length),0),s=Array(o).fill([]).map((()=>Array(i).fill(0)));let r=0;for(const e of t){for(let t=0;t<e.length;t++)for(let o=0;o<e[t].length;o++)s[t][r+o]=Js(e[t][o]);r+=e[0].length}return s},isExported:!0},En={description:r("Wraps the provided row or column of cells by columns after a specified number of elements to form a new array."),args:[Wr("range (any, range<any>)",r("The range to wrap.")),Wr("wrap_count (number)",r("The maximum number of cells for each column, rounded down to the nearest whole number.")),Wr("pad_with (any, default=0)",r("The value with which to fill the extra cells in the range."))],returns:["RANGE<ANY>"],compute:function(e,t,o=0){const i=er(e),s=Ts(t,this.locale),n=null===o?0:o;qr(r("Argument range must be a single row or column."),i);const a=i.flat(),l=Math.ceil(a.length/s),c=Array(l);for(let e=0;e<l;e++){c[e]=Array(s).fill(n);for(let t=0;t<s;t++){const o=e*s+t;o<a.length&&(c[e][t]=Js(a[o]))}}return c},isExported:!0},wn={description:r("Wraps the provided row or column of cells by rows after a specified number of elements to form a new array."),args:[Wr("range (any, range<any>)",r("The range to wrap.")),Wr("wrap_count (number)",r("The maximum number of cells for each row, rounded down to the nearest whole number.")),Wr("pad_with (any, default=0)",r("The value with which to fill the extra cells in the range."))],returns:["RANGE<ANY>"],compute:function(e,t,o=0){const i=er(e),s=Ts(t,this.locale),n=null===o?0:o;qr(r("Argument range must be a single row or column."),i);const a=i.flat(),l=Math.ceil(a.length/s),c=Array(s).fill([]).map((()=>Array(l).fill(n)));for(let e=0;e<l;e++)for(let t=0;t<s;t++){const o=e*s+t;o<a.length&&(c[t][e]=Js(a[o]))}return c},isExported:!0};var xn=Object.freeze({__proto__:null,ARRAY_CONSTRAIN:en,CHOOSECOLS:tn,CHOOSEROWS:on,EXPAND:sn,FLATTEN:rn,FREQUENCY:nn,HSTACK:an,MDETERM:ln,MINVERSE:cn,MMULT:hn,SUMPRODUCT:dn,SUMX2MY2:gn,SUMX2PY2:pn,SUMXMY2:mn,TOCOL:bn,TOROW:vn,TRANSPOSE:Sn,VSTACK:Cn,WRAPCOLS:En,WRAPROWS:wn});const yn={description:r("Apply a large number format"),args:[Wr("value (number)",r("The number.")),Wr("unit (string, optional)",r("The formatting unit. Use 'k', 'm', or 'b' to force the unit"))],returns:["NUMBER"],computeFormat:function(e,t){const o=Math.abs(Is(e.value,this.locale)),i=e.format;if(void 0!==t){const e=t?.value;switch(e){case"k":return Do(i,1e3,"k",this.locale);case"m":return Do(i,1e6,"m",this.locale);case"b":return Do(i,1e9,"b",this.locale);default:throw new Error(r("The formatting unit should be 'k', 'm' or 'b'."))}}return o<1e5?Do(i,0,"",this.locale):o<1e8?Do(i,1e3,"k",this.locale):o<1e11?Do(i,1e6,"m",this.locale):Do(i,1e9,"b",this.locale)},compute:function(e){return Is(e,this.locale)}};var In=Object.freeze({__proto__:null,FORMAT_LARGE_NUMBER:yn});const Rn=/^-?[a-z0-9]+$/i,Tn={description:r("Absolute value of a number."),args:[Wr("value (number)",r("The number of which to return the absolute value."))],returns:["NUMBER"],compute:function(e){return Math.abs(Is(e,this.locale))},isExported:!0},An={description:r("Inverse cosine of a value, in radians."),args:[Wr("value (number)",r("The value for which to calculate the inverse cosine. Must be between -1 and 1, inclusive."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>Math.abs(t)<=1),r("The value (%s) must be between -1 and 1 inclusive.",t.toString())),Math.acos(t)},isExported:!0},On={description:r("Inverse hyperbolic cosine of a number."),args:[Wr("value (number)",r("The value for which to calculate the inverse hyperbolic cosine. Must be greater than or equal to 1."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>t>=1),r("The value (%s) must be greater than or equal to 1.",t.toString())),Math.acosh(t)},isExported:!0},Mn={description:r("Inverse cotangent of a value."),args:[Wr("value (number)",r("The value for which to calculate the inverse cotangent."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return(Math.sign(t)||1)*Math.PI/2-Math.atan(t)},isExported:!0},Nn={description:r("Inverse hyperbolic cotangent of a value."),args:[Wr("value (number)",r("The value for which to calculate the inverse hyperbolic cotangent. Must not be between -1 and 1, inclusive."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>Math.abs(t)>1),r("The value (%s) cannot be between -1 and 1 inclusive.",t.toString())),Math.log((t+1)/(t-1))/2},isExported:!0},_n={description:r("Inverse sine of a value, in radians."),args:[Wr("value (number)",r("The value for which to calculate the inverse sine. Must be between -1 and 1, inclusive."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>Math.abs(t)<=1),r("The value (%s) must be between -1 and 1 inclusive.",t.toString())),Math.asin(t)},isExported:!0},Fn={description:r("Inverse hyperbolic sine of a number."),args:[Wr("value (number)",r("The value for which to calculate the inverse hyperbolic sine."))],returns:["NUMBER"],compute:function(e){return Math.asinh(Is(e,this.locale))},isExported:!0},Dn={description:r("Inverse tangent of a value, in radians."),args:[Wr("value (number)",r("The value for which to calculate the inverse tangent."))],returns:["NUMBER"],compute:function(e){return Math.atan(Is(e,this.locale))},isExported:!0},Ln={description:r("Angle from the X axis to a point (x,y), in radians."),args:[Wr("x (number)",r("The x coordinate of the endpoint of the line segment for which to calculate the angle from the x-axis.")),Wr("y (number)",r("The y coordinate of the endpoint of the line segment for which to calculate the angle from the x-axis."))],returns:["NUMBER"],compute:function(e,t){const o=Is(e,this.locale),i=Is(t,this.locale);return xs((()=>0!==o||0!==i),r("Function [[FUNCTION_NAME]] caused a divide by zero error.")),Math.atan2(i,o)},isExported:!0},Pn={description:r("Inverse hyperbolic tangent of a number."),args:[Wr("value (number)",r("The value for which to calculate the inverse hyperbolic tangent. Must be between -1 and 1, exclusive."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>Math.abs(t)<1),r("The value (%s) must be between -1 and 1 exclusive.",t.toString())),Math.atanh(t)},isExported:!0},kn={description:r("Rounds number up to nearest multiple of factor."),args:[Wr("value (number)",r("The value to round up to the nearest integer multiple of factor.")),Wr("factor (number, default=1)",r("The number to whose multiples value will be rounded."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=1){const o=Is(e,this.locale),i=Is(t,this.locale);return xs((()=>i>=0||o<=0),r("The factor (%s) must be positive when the value (%s) is positive.",i.toString(),o.toString())),i?Math.ceil(o/i)*i:0},isExported:!0},Un={description:r("Rounds number up to nearest multiple of factor."),args:[Wr("number (number)",r("The value to round up to the nearest integer multiple of significance.")),Wr("significance (number, default=1)",r("The number to whose multiples number will be rounded. The sign of significance will be ignored.")),Wr("mode (number, default=0)",r("If number is negative, specifies the rounding direction. If 0 or blank, it is rounded towards zero. Otherwise, it is rounded away from zero."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=1,o=0){let i=Is(t,this.locale);if(0===i)return 0;const s=Is(e,this.locale);if(i=Math.abs(i),s>=0)return Math.ceil(s/i)*i;return 0===Is(o,this.locale)?-Math.floor(Math.abs(s)/i)*i:-Math.ceil(Math.abs(s)/i)*i},isExported:!0},Vn={description:r("Rounds number up to nearest multiple of factor."),args:[Wr("number (number)",r("The value to round up to the nearest integer multiple of significance.")),Wr("significance (number, default=1)",r("The number to whose multiples number will be rounded."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t){return Un.compute.bind(this)(e,t,0)},isExported:!0},Bn={description:r("Cosine of an angle provided in radians."),args:[Wr("angle (number)",r("The angle to find the cosine of, in radians."))],returns:["NUMBER"],compute:function(e){return Math.cos(Is(e,this.locale))},isExported:!0},zn={description:r("Hyperbolic cosine of any real number."),args:[Wr("value (number)",r("Any real value to calculate the hyperbolic cosine of."))],returns:["NUMBER"],compute:function(e){return Math.cosh(Is(e,this.locale))},isExported:!0},Hn={description:r("Cotangent of an angle provided in radians."),args:[Wr("angle (number)",r("The angle to find the cotangent of, in radians."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>0!==t),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),1/Math.tan(t)},isExported:!0},$n={description:r("Hyperbolic cotangent of any real number."),args:[Wr("value (number)",r("Any real value to calculate the hyperbolic cotangent of."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>0!==t),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),1/Math.tanh(t)},isExported:!0},Wn={description:r("Number of empty values."),args:[Wr("value1 (any, range)",r("The first value or range in which to count the number of blanks.")),Wr("value2 (any, range, repeating)",r("Additional values or ranges in which to count the number of blanks."))],returns:["NUMBER"],compute:function(...e){return Bs(e,((e,t)=>null==t||""===t?e+1:e),0)},isExported:!0},Gn={description:r("A conditional count across a range."),args:[Wr("range (range)",r("The range that is tested against criterion.")),Wr("criterion (string)",r("The pattern or test to apply to range."))],returns:["NUMBER"],compute:function(...e){let t=0;return qs(e,((e,o)=>{t+=1}),this.locale),t},isExported:!0},qn={description:r("Count values depending on multiple criteria."),args:[Wr("criteria_range1 (range)",r("The range to check against criterion1.")),Wr("criterion1 (string)",r("The pattern or test to apply to criteria_range1.")),Wr("criteria_range2 (any, range, repeating)",r("Additional ranges over which to evaluate the additional criteria. The filtered set will be the intersection of the sets produced by each criterion-range pair.")),Wr("criterion2 (string, repeating)",r("Additional criteria to check."))],returns:["NUMBER"],compute:function(...e){let t=0;return qs(e,((e,o)=>{t+=1}),this.locale),t},isExported:!0};function Zn(e){switch(e){case void 0:case"":case null:return!1;default:return!0}}const Yn={description:r("Counts number of unique values in a range."),args:[Wr("value1 (any, range)",r("The first value or range to consider for uniqueness.")),Wr("value2 (any, range, repeating)",r("Additional values or ranges to consider for uniqueness."))],returns:["NUMBER"],compute:function(...e){return Bs(e,((e,t)=>Zn(t)?e.add(t):e),new Set).size}},jn={description:r("Counts number of unique values in a range, filtered by a set of criteria."),args:[Wr("range (range)",r("The range of cells from which the number of unique values will be counted.")),Wr("criteria_range1 (range)",r("The range of cells over which to evaluate criterion1.")),Wr("criterion1 (string)",r("The pattern or test to apply to criteria_range1, such that each cell that evaluates to TRUE will be included in the filtered set.")),Wr("criteria_range2 (any, range, repeating)",r("Additional ranges over which to evaluate the additional criteria. The filtered set will be the intersection of the sets produced by each criterion-range pair.")),Wr("criterion2 (string, repeating)",r("The pattern or test to apply to criteria_range2."))],returns:["NUMBER"],compute:function(e,...t){let o=new Set;return qs(t,((t,i)=>{const s=e[t][i];Zn(s)&&o.add(s)}),this.locale),o.size}},Xn={description:r("Cosecant of an angle provided in radians."),args:[Wr("angle (number)",r("The angle to find the cosecant of, in radians."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>0!==t),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),1/Math.sin(t)},isExported:!0},Kn={description:r("Hyperbolic cosecant of any real number."),args:[Wr("value (number)",r("Any real value to calculate the hyperbolic cosecant of."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>0!==t),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),1/Math.sinh(t)},isExported:!0},Qn={description:r("Converts from another base to decimal."),args:[Wr("value (string)",r("The number to convert.")),Wr(",base (number)",r("The base to convert the value from."))],returns:["NUMBER"],compute:function(e,t){let o=Is(t,this.locale);o=Math.floor(o),xs((()=>2<=o&&o<=36),r("The base (%s) must be between 2 and 36 inclusive.",o.toString()));const i=Ms(e);if(""===i)return 0;xs((()=>!!Rn.test(i)),r("The value (%s) must be a valid base %s representation.",i,o.toString()));const s=parseInt(i,o);return xs((()=>!isNaN(s)),r("The value (%s) must be a valid base %s representation.",i,o.toString())),s},isExported:!0},Jn={description:r("Converts an angle value in radians to degrees."),args:[Wr("angle (number)",r("The angle to convert from radians to degrees."))],returns:["NUMBER"],compute:function(e){return 180*Is(e,this.locale)/Math.PI},isExported:!0},ea={description:r("Euler's number, e (~2.718) raised to a power."),args:[Wr("value (number)",r("The exponent to raise e."))],returns:["NUMBER"],compute:function(e){return Math.exp(Is(e,this.locale))},isExported:!0},ta={description:r("Rounds number down to nearest multiple of factor."),args:[Wr("value (number)",r("The value to round down to the nearest integer multiple of factor.")),Wr("factor (number, default=1)",r("The number to whose multiples value will be rounded."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=1){const o=Is(e,this.locale),i=Is(t,this.locale);return xs((()=>i>=0||o<=0),r("The factor (%s) must be positive when the value (%s) is positive.",i.toString(),o.toString())),i?Math.floor(o/i)*i:0},isExported:!0},oa={description:r("Rounds number down to nearest multiple of factor."),args:[Wr("number (number)",r("The value to round down to the nearest integer multiple of significance.")),Wr("significance (number, default=1)",r("The number to whose multiples number will be rounded. The sign of significance will be ignored.")),Wr("mode (number, default=0)",r("If number is negative, specifies the rounding direction. If 0 or blank, it is rounded away from zero. Otherwise, it is rounded towards zero."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=1,o=0){let i=Is(t,this.locale);if(0===i)return 0;const s=Is(e,this.locale);if(i=Math.abs(i),s>=0)return Math.floor(s/i)*i;return 0===Is(o,this.locale)?-Math.ceil(Math.abs(s)/i)*i:-Math.floor(Math.abs(s)/i)*i},isExported:!0},ia={description:r("Rounds number down to nearest multiple of factor."),args:[Wr("number (number)",r("The value to round down to the nearest integer multiple of significance.")),Wr("significance (number, default=1)",r("The number to whose multiples number will be rounded."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=1){return oa.compute.bind(this)(e,t,0)},isExported:!0},sa={description:r("Whether the provided value is even."),args:[Wr("value (number)",r("The value to be verified as even."))],returns:["BOOLEAN"],compute:function(e){const t=Rs(e,this.locale);return!(1&Math.floor(Math.abs(t)))},isExported:!0},ra={description:r("Rounds number up to nearest multiple of factor."),args:[Wr("number (number)",r("The value to round up to the nearest integer multiple of significance.")),Wr("significance (number, default=1)",r("The number to whose multiples number will be rounded."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=1){return Un.compute.bind(this)(e,t,0)},isExported:!0},na={description:r("Whether the provided value is even."),args:[Wr("value (number)",r("The value to be verified as even."))],returns:["BOOLEAN"],compute:function(e){const t=Rs(e,this.locale);return!!(1&Math.floor(Math.abs(t)))},isExported:!0},aa={description:r("The logarithm of a number, base e (euler's number)."),args:[Wr("value (number)",r("The value for which to calculate the logarithm, base e."))],returns:["NUMBER"],compute:function(e){const t=Is(e,this.locale);return xs((()=>t>0),r("The value (%s) must be strictly positive.",t.toString())),Math.log(t)},isExported:!0},la={description:r("Modulo (remainder) operator."),args:[Wr("dividend (number)",r("The number to be divided to find the remainder.")),Wr("divisor (number)",r("The number to divide by."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t){const o=Is(t,this.locale);xs((()=>0!==o),r("The divisor must be different from 0."));const i=Is(e,this.locale)%o;return i>0&&o<0||i<0&&o>0?i+o:i},isExported:!0},ca={description:r("Returns a n x n unit matrix, where n is the input dimension."),args:[Wr("dimension (number)",r("An integer specifying the dimension size of the unit matrix. It must be positive."))],returns:["RANGE<NUMBER>"],compute:function(e){const t=Ts(e,this.locale);return Yr(r("The argument dimension must be positive"),t),Kr(t)},isExported:!0},ha={description:r("Rounds a number up to the nearest odd integer."),args:[Wr("value (number)",r("The value to round to the next greatest odd number."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e){const t=Is(e,this.locale);let o=Math.ceil(Math.abs(t));return o=1&o?o:o+1,t<0?-o:o},isExported:!0},da={description:r("The number pi."),args:[],returns:["NUMBER"],compute:function(){return Math.PI},isExported:!0},ua={description:r("A number raised to a power."),args:[Wr("base (number)",r("The number to raise to the exponent power.")),Wr("exponent (number)",r("The exponent to raise base to."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t){const o=Is(e,this.locale),i=Is(t,this.locale);return xs((()=>o>=0||Number.isInteger(i)),r("The exponent (%s) must be an integer when the base is negative.",i.toString())),Math.pow(o,i)},isExported:!0},ga={description:r("Result of multiplying a series of numbers together."),args:[Wr("factor1 (number, range<number>)",r("The first number or range to calculate for the product.")),Wr("factor2 (number, range<number>, repeating)",r("More numbers or ranges to calculate for the product."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){let t=0,o=1;for(let i of e)if(Array.isArray(i))for(let e of i)for(let i of e)"number"==typeof i&&(o*=i,t+=1);else null!=i&&(o*=Rs(i,this.locale),t+=1);return 0===t?0:o},isExported:!0},pa={description:r("A random number between 0 inclusive and 1 exclusive."),args:[],returns:["NUMBER"],compute:function(){return Math.random()},isExported:!0},ma={description:r("Returns a grid of random numbers between 0 inclusive and 1 exclusive."),args:[Wr("rows (number, default=1)",r("The number of rows to be returned.")),Wr("columns (number, default=1)",r("The number of columns to be returned.")),Wr("min (number, default=0)",r("The minimum number you would like returned.")),Wr("max (number, default=1)",r("The maximum number you would like returned.")),Wr("whole_number (number, default=FALSE)",r("Return a whole number or a decimal value."))],returns:["RANGE<NUMBER>"],compute:function(e=1,t=1,o=0,i=1,s=!1){const n=Ts(t,this.locale),a=Ts(e,this.locale),l=Is(o,this.locale),c=Is(i,this.locale),h=Ds(s);Yr(r("The number columns (%s) must be positive.",n.toString()),n),Yr(r("The number rows (%s) must be positive.",a.toString()),a),xs((()=>l<=c),r("The maximum (%s) must be greater than or equal to the minimum (%s).",c.toString(),l.toString())),h&&xs((()=>Number.isInteger(l)&&Number.isInteger(c)),r("The maximum (%s) and minimum (%s) must be integers when whole_number is TRUE.",c.toString(),l.toString()));const d=Array(n);for(let e=0;e<n;e++){d[e]=Array(a);for(let t=0;t<a;t++)d[e][t]=h?Math.floor(Math.random()*(c-l+1)+l):l+Math.random()*(c-l)}return d},isExported:!0},fa={description:r("Random integer between two values, inclusive."),args:[Wr("low (number)",r("The low end of the random range.")),Wr("high (number)",r("The high end of the random range."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t){let o=Is(e,this.locale);Number.isInteger(o)||(o=Math.ceil(o));let i=Is(t,this.locale);return Number.isInteger(i)||(i=Math.floor(i)),xs((()=>o<=i),r("The high (%s) must be greater than or equal to the low (%s).",i.toString(),o.toString())),o+Math.ceil((i-o+1)*Math.random())-1},isExported:!0},ba={description:r("Rounds a number according to standard rules."),args:[Wr("value (number)",r("The value to round to places number of places.")),Wr("places (number, default=0)",r("The number of decimal places to which to round."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=0){const o=Is(e,this.locale);let i=Is(t,this.locale);const s=Math.abs(o);let r;return 0===i?r=Math.round(s):(Number.isInteger(i)||(i=Math.trunc(i)),r=Math.round(s*Math.pow(10,i))/Math.pow(10,i)),o>=0?r:-r},isExported:!0},va={description:r("Rounds down a number."),args:[Wr("value (number)",r("The value to round to places number of places, always rounding down.")),Wr("places (number, default=0)",r("The number of decimal places to which to round."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=0){const o=Is(e,this.locale);let i=Is(t,this.locale);const s=Math.abs(o);let r;return 0===i?r=Math.floor(s):(Number.isInteger(i)||(i=Math.trunc(i)),r=Math.floor(s*Math.pow(10,i))/Math.pow(10,i)),o>=0?r:-r},isExported:!0},Sa={description:r("Rounds up a number."),args:[Wr("value (number)",r("The value to round to places number of places, always rounding up.")),Wr("places (number, default=0)",r("The number of decimal places to which to round."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=0){const o=Is(e,this.locale);let i=Is(t,this.locale);const s=Math.abs(o);let r;return 0===i?r=Math.ceil(s):(Number.isInteger(i)||(i=Math.trunc(i)),r=Math.ceil(s*Math.pow(10,i))/Math.pow(10,i)),o>=0?r:-r},isExported:!0},Ca={description:r("Secant of an angle provided in radians."),args:[Wr("angle (number)",r("The angle to find the secant of, in radians."))],returns:["NUMBER"],compute:function(e){return 1/Math.cos(Is(e,this.locale))},isExported:!0},Ea={description:r("Hyperbolic secant of any real number."),args:[Wr("value (number)",r("Any real value to calculate the hyperbolic secant of."))],returns:["NUMBER"],compute:function(e){return 1/Math.cosh(Is(e,this.locale))},isExported:!0},wa={description:r("Sine of an angle provided in radians."),args:[Wr("angle (number)",r("The angle to find the sine of, in radians."))],returns:["NUMBER"],compute:function(e){return Math.sin(Is(e,this.locale))},isExported:!0},xa={description:r("Hyperbolic sine of any real number."),args:[Wr("value (number)",r("Any real value to calculate the hyperbolic sine of."))],returns:["NUMBER"],compute:function(e){return Math.sinh(Is(e,this.locale))},isExported:!0},ya={description:r("Positive square root of a positive number."),args:[Wr("value (number)",r("The number for which to calculate the positive square root."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e){const t=Is(e,this.locale);return xs((()=>t>=0),r("The value (%s) must be positive or null.",t.toString())),Math.sqrt(t)},isExported:!0},Ia={description:r("Sum of a series of numbers and/or cells."),args:[Wr("value1 (number, range<number>)",r("The first number or range to add together.")),Wr("value2 (number, range<number>, repeating)",r("Additional numbers or ranges to add to value1."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){return zs(e,((e,t)=>e+t),0,this.locale)},isExported:!0},Ra={description:r("A conditional sum across a range."),args:[Wr("criteria_range (range)",r("The range which is tested against criterion.")),Wr("criterion (string)",r("The pattern or test to apply to range.")),Wr("sum_range (range, default=criteria_range)",r("The range to be summed, if different from range."))],returns:["NUMBER"],compute:function(e,t,o){void 0===o&&(o=e);let i=0;return qs([e,t],((e,t)=>{const s=o[e][t];"number"==typeof s&&(i+=s)}),this.locale),i},isExported:!0},Ta={description:r("Sums a range depending on multiple criteria."),args:[Wr("sum_range (range)",r("The range to sum.")),Wr("criteria_range1 (range)",r("The range to check against criterion1.")),Wr("criterion1 (string)",r("The pattern or test to apply to criteria_range1.")),Wr("criteria_range2 (any, range, repeating)",r("Additional ranges to check.")),Wr("criterion2 (string, repeating)",r("Additional criteria to check."))],returns:["NUMBER"],compute:function(e,...t){let o=0;return qs(t,((t,i)=>{const s=e[t][i];"number"==typeof s&&(o+=s)}),this.locale),o},isExported:!0},Aa={description:r("Tangent of an angle provided in radians."),args:[Wr("angle (number)",r("The angle to find the tangent of, in radians."))],returns:["NUMBER"],compute:function(e){return Math.tan(Is(e,this.locale))},isExported:!0},Oa={description:r("Hyperbolic tangent of any real number."),args:[Wr("value (number)",r("Any real value to calculate the hyperbolic tangent of."))],returns:["NUMBER"],compute:function(e){return Math.tanh(Is(e,this.locale))},isExported:!0},Ma={description:r("Truncates a number."),args:[Wr("value (number)",r("The value to be truncated.")),Wr("places (number, default=0)",r("The number of significant digits to the right of the decimal point to retain."))],returns:["NUMBER"],computeFormat:e=>e?.format,compute:function(e,t=0){const o=Is(e,this.locale);let i=Is(t,this.locale);return 0===i?Math.trunc(o):(Number.isInteger(i)||(i=Math.trunc(i)),Math.trunc(o*Math.pow(10,i))/Math.pow(10,i))},isExported:!0};var Na=Object.freeze({__proto__:null,ABS:Tn,ACOS:An,ACOSH:On,ACOT:Mn,ACOTH:Nn,ASIN:_n,ASINH:Fn,ATAN:Dn,ATAN2:Ln,ATANH:Pn,CEILING:kn,CEILING_MATH:Un,CEILING_PRECISE:Vn,COS:Bn,COSH:zn,COT:Hn,COTH:$n,COUNTBLANK:Wn,COUNTIF:Gn,COUNTIFS:qn,COUNTUNIQUE:Yn,COUNTUNIQUEIFS:jn,CSC:Xn,CSCH:Kn,DECIMAL:Qn,DEGREES:Jn,EXP:ea,FLOOR:ta,FLOOR_MATH:oa,FLOOR_PRECISE:ia,ISEVEN:sa,ISO_CEILING:ra,ISODD:na,LN:aa,MOD:la,MUNIT:ca,ODD:ha,PI:da,POWER:ua,PRODUCT:ga,RAND:pa,RANDARRAY:ma,RANDBETWEEN:fa,ROUND:ba,ROUNDDOWN:va,ROUNDUP:Sa,SEC:Ca,SECH:Ea,SIN:wa,SINH:xa,SQRT:ya,SUM:Ia,SUMIF:Ra,SUMIFS:Ta,TAN:Aa,TANH:Oa,TRUNC:Ma});function _a(e,t,o){let i=[],s=[],n=0,a=0;ks([e],(e=>{i.push(e),n+=1})),ks([t],(e=>{s.push(e),a+=1})),xs((()=>n===a),r("[[FUNCTION_NAME]] has mismatched argument count %s vs %s.",n.toString(),a.toString()));let l=0,c=0,h=0;for(let e=0;e<n;e++){const t=i[e],o=s[e];"number"==typeof t&&"number"==typeof o&&(l+=1,c+=t,h+=o)}xs((()=>0!==l&&(!o||1!==l)),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error."));const d=c/l,u=h/l;let g=0;for(let e=0;e<n;e++){const t=i[e],o=s[e];"number"==typeof t&&"number"==typeof o&&(g+=(t-d)*(o-u))}return g/(l-(o?1:0))}function Fa(e,t,o,i){let s=0,n=0;const a=o?Hs:zs;n=a(e,((e,t)=>(s+=1,e+t)),0,i),xs((()=>0!==s&&(!t||1!==s)),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error."));const l=n/s;return a(e,((e,t)=>e+Math.pow(t-l,2)),0,i)/(s-(t?1:0))}function Da(e,t,o,i){const s=Is(t,i);xs((()=>o?0<=s&&s<=1:0<s&&s<1),r("Function [[FUNCTION_NAME]] parameter 2 value is out of range."));let n,a=[],l=0;return ks(e,(e=>{"number"==typeof e&&(n=js(a,e,"nextSmaller","asc",a.length,((e,t)=>e[t])),a.splice(n+1,0,e),l++)})),xs((()=>0!==l),r("[[FUNCTION_NAME]] has no valid input data.")),o||xs((()=>1/(l+1)<=s&&s<=l/(l+1)),r("Function [[FUNCTION_NAME]] parameter 2 value is out of range.")),no(a,s,o)}const La={description:r("Average magnitude of deviations from mean."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the sample.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the sample."))],returns:["NUMBER"],compute:function(...e){let t=0;const o=zs(e,((e,o)=>(t+=1,e+o)),0,this.locale);xs((()=>0!==t),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error."));const i=o/t;return zs(e,((e,t)=>e+Math.abs(i-t)),0,this.locale)/t},isExported:!0},Pa={description:r("Numerical average value in a dataset, ignoring text."),args:[Wr("value1 (number, range<number>)",r("The first value or range to consider when calculating the average value.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to consider when calculating the average value."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){let t=0;const o=zs(e,((e,o)=>(t+=1,e+o)),0,this.locale);return xs((()=>0!==t),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),o/t},isExported:!0},ka=r("[[FUNCTION_NAME]] has mismatched range sizes."),Ua=r("[[FUNCTION_NAME]] expects the weight to be positive or equal to 0."),Va={description:r("Weighted average."),args:[Wr("values (number, range<number>)",r("Values to average.")),Wr("weights (number, range<number>)",r("Weights for each corresponding value.")),Wr("additional_values (number, range<number>, repeating)",r("Additional values to average.")),Wr("additional_weights (number, range<number>, repeating)",r("Additional weights."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){let t,o,i=0,s=0;xs((()=>e.length%2==0),r("Wrong number of Argument[]. Expected an even number of Argument[]."));for(let n=0;n<e.length-1;n+=2)if(t=e[n],o=e[n+1],Array.isArray(t)){xs((()=>Array.isArray(o)),ka);let e=t.length,n=t[0].length;xs((()=>e===o.length&&n===o[0].length),ka);for(let a=0;a<e;a++)for(let e=0;e<n;e++){let n=t[a][e],l=o[a][e],c="number"==typeof n,h="number"==typeof l;xs((()=>c===h),r("[[FUNCTION_NAME]] expects number values.")),h&&(xs((()=>l>=0),Ua),i+=n*l,s+=l)}}else o=Is(o,this.locale),t=Is(t,this.locale),xs((()=>o>=0),Ua),i+=t*o,s+=o;return xs((()=>0!==s),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),i/s}},Ba={description:r("Numerical average value in a dataset."),args:[Wr("value1 (number, range<number>)",r("The first value or range to consider when calculating the average value.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to consider when calculating the average value."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){let t=0;const o=Hs(e,((e,o)=>(t+=1,e+o)),0,this.locale);return xs((()=>0!==t),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),o/t},isExported:!0},za={description:r("Average of values depending on criteria."),args:[Wr("criteria_range (range)",r("The range to check against criterion.")),Wr("criterion (string)",r("The pattern or test to apply to criteria_range.")),Wr("average_range (range, default=criteria_range)",r("The range to average. If not included, criteria_range is used for the average instead."))],returns:["NUMBER"],compute:function(e,t,o){null==o&&(o=e);let i=0,s=0;return qs([e,t],((t,r)=>{const n=(o||e)[t][r];"number"==typeof n&&(i+=1,s+=n)}),this.locale),xs((()=>0!==i),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),s/i},isExported:!0},Ha={description:r("Average of values depending on multiple criteria."),args:[Wr("average_range (range)",r("The range to average.")),Wr("criteria_range1 (range)",r("The range to check against criterion1.")),Wr("criterion1 (string)",r("The pattern or test to apply to criteria_range1.")),Wr("criteria_range2 (any, range, repeating)",r("Additional criteria_range and criterion to check.")),Wr("criterion2 (string, repeating)",r("The pattern or test to apply to criteria_range2."))],returns:["NUMBER"],compute:function(e,...t){let o=0,i=0;return qs(t,((t,s)=>{const r=e[t][s];"number"==typeof r&&(o+=1,i+=r)}),this.locale),xs((()=>0!==o),r("Evaluation of function [[FUNCTION_NAME]] caused a divide by zero error.")),i/o},isExported:!0},$a={description:r("The number of numeric values in dataset."),args:[Wr("value1 (number, range<number>)",r("The first value or range to consider when counting.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to consider when counting."))],returns:["NUMBER"],compute:function(...e){let t=0;for(let o of e)if(Array.isArray(o))for(let e of o)for(let o of e)"number"==typeof o&&(t+=1);else("string"!=typeof o||io(o,this.locale)||Ut(o,this.locale))&&(t+=1);return t},isExported:!0},Wa={description:r("The number of values in a dataset."),args:[Wr("value1 (any, range)",r("The first value or range to consider when counting.")),Wr("value2 (any, range, repeating)",r("Additional values or ranges to consider when counting."))],returns:["NUMBER"],compute:function(...e){return Bs(e,((e,t)=>null!=t?e+1:e),0)},isExported:!0},Ga={description:r("The covariance of a dataset."),args:[Wr("data_y (any, range)",r("The range representing the array or matrix of dependent data.")),Wr("data_x (any, range)",r("The range representing the array or matrix of independent data."))],returns:["NUMBER"],compute:function(e,t){return _a(e,t,!1)},isExported:!0},qa={description:r("The covariance of a dataset."),args:[Wr("data_y (any, range)",r("The range representing the array or matrix of dependent data.")),Wr("data_x (any, range)",r("The range representing the array or matrix of independent data."))],returns:["NUMBER"],compute:function(e,t){return _a(e,t,!1)},isExported:!0},Za={description:r("The sample covariance of a dataset."),args:[Wr("data_y (any, range)",r("The range representing the array or matrix of dependent data.")),Wr("data_x (any, range)",r("The range representing the array or matrix of independent data."))],returns:["NUMBER"],compute:function(e,t){return _a(e,t,!0)},isExported:!0},Ya={description:r("Nth largest element from a data set."),args:[Wr("data (any, range)",r("Array or range containing the dataset to consider.")),Wr("n (number)",r("The rank from largest to smallest of the element to return."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(e,t){const o=Math.trunc(Is(t,this.locale));let i,s=[],n=0;ks([e],(e=>{"number"==typeof e&&(i=js(s,e,"nextSmaller","asc",s.length,((e,t)=>e[t])),s.splice(i+1,0,e),n++,n>o&&(s.shift(),n--))}));const a=s.shift();return xs((()=>void 0!==a),r("[[FUNCTION_NAME]] has no valid input data.")),xs((()=>n>=o),r("Function [[FUNCTION_NAME]] parameter 2 value (%s) is out of range.",o.toString())),a},isExported:!0},ja={description:r("Maximum value in a numeric dataset."),args:[Wr("value1 (number, range<number>)",r("The first value or range to consider when calculating the maximum value.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to consider when calculating the maximum value."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){const t=zs(e,((e,t)=>e<t?t:e),-1/0,this.locale);return t===-1/0?0:t},isExported:!0},Xa={description:r("Maximum numeric value in a dataset."),args:[Wr("value1 (any, range)",r("The first value or range to consider when calculating the maximum value.")),Wr("value2 (any, range, repeating)",r("Additional values or ranges to consider when calculating the maximum value."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){const t=Hs(e,((e,t)=>Math.max(t,e)),-1/0,this.locale);return t===-1/0?0:t},isExported:!0},Ka={description:r("Returns the maximum value in a range of cells, filtered by a set of criteria."),args:[Wr("range (range)",r("The range of cells from which the maximum will be determined.")),Wr("criteria_range1 (range)",r("The range of cells over which to evaluate criterion1.")),Wr("criterion1 (string)",r("The pattern or test to apply to criteria_range1, such that each cell that evaluates to TRUE will be included in the filtered set.")),Wr("criteria_range2 (any, range, repeating)",r("Additional ranges over which to evaluate the additional criteria. The filtered set will be the intersection of the sets produced by each criterion-range pair.")),Wr("criterion2 (string, repeating)",r("The pattern or test to apply to criteria_range2."))],returns:["NUMBER"],compute:function(e,...t){let o=-1/0;return qs(t,((t,i)=>{const s=e[t][i];"number"==typeof s&&(o=o<s?s:o)}),this.locale),o===-1/0?0:o},isExported:!0},Qa={description:r("Median value in a numeric dataset."),args:[Wr("value1 (any, range)",r("The first value or range to consider when calculating the median value.")),Wr("value2 (any, range, repeating)",r("Additional values or ranges to consider when calculating the median value."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){let t=[];return Us(e,(e=>{t.push(e)}),this.locale),Da(t,.5,!0,this.locale)},isExported:!0},Ja={description:r("Minimum value in a numeric dataset."),args:[Wr("value1 (number, range<number>)",r("The first value or range to consider when calculating the minimum value.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to consider when calculating the minimum value."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){const t=zs(e,((e,t)=>t<e?t:e),1/0,this.locale);return t===1/0?0:t},isExported:!0},el={description:r("Minimum numeric value in a dataset."),args:[Wr("value1 (number, range<number>)",r("The first value or range to consider when calculating the minimum value.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to consider when calculating the minimum value."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(...e){const t=Hs(e,((e,t)=>Math.min(t,e)),1/0,this.locale);return t===1/0?0:t},isExported:!0},tl={description:r("Returns the minimum value in a range of cells, filtered by a set of criteria."),args:[Wr("range (range)",r("The range of cells from which the minimum will be determined.")),Wr("criteria_range1 (range)",r("The range of cells over which to evaluate criterion1.")),Wr("criterion1 (string)",r("The pattern or test to apply to criteria_range1, such that each cell that evaluates to TRUE will be included in the filtered set.")),Wr("criteria_range2 (any, range, repeating)",r("Additional ranges over which to evaluate the additional criteria. The filtered set will be the intersection of the sets produced by each criterion-range pair.")),Wr("criterion2 (string, repeating)",r("The pattern or test to apply to criteria_range2."))],returns:["NUMBER"],compute:function(e,...t){let o=1/0;return qs(t,((t,i)=>{const s=e[t][i];"number"==typeof s&&(o=o>s?s:o)}),this.locale),o===1/0?0:o},isExported:!0},ol={description:r("Value at a given percentile of a dataset."),args:[Wr("data (any, range)",r("The array or range containing the dataset to consider.")),Wr("percentile (number)",r("The percentile whose value within data will be calculated and returned."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(e,t){return sl.compute.bind(this)(e,t)},isExported:!0},il={description:r("Value at a given percentile of a dataset exclusive of 0 and 1."),args:[Wr("data (any, range)",r("The array or range containing the dataset to consider.")),Wr("percentile (number)",r("The percentile, exclusive of 0 and 1, whose value within 'data' will be calculated and returned."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(e,t){return Da([e],t,!1,this.locale)},isExported:!0},sl={description:r("Value at a given percentile of a dataset."),args:[Wr("data (any, range)",r("The array or range containing the dataset to consider.")),Wr("percentile (number)",r("The percentile whose value within data will be calculated and returned."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(e,t){return Da([e],t,!0,this.locale)},isExported:!0},rl={description:r("Value nearest to a specific quartile of a dataset."),args:[Wr("data (any, range)",r("The array or range containing the dataset to consider.")),Wr("quartile_number (number)",r("Which quartile value to return."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(e,t){return al.compute.bind(this)(e,t)},isExported:!0},nl={description:r("Value nearest to a specific quartile of a dataset exclusive of 0 and 4."),args:[Wr("data (any, range)",r("The array or range containing the dataset to consider.")),Wr("quartile_number (number)",r("Which quartile value, exclusive of 0 and 4, to return."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(e,t){return Da([e],.25*Math.trunc(Is(t,this.locale)),!1,this.locale)},isExported:!0},al={description:r("Value nearest to a specific quartile of a dataset."),args:[Wr("data (any, range)",r("The array or range containing the dataset to consider.")),Wr("quartile_number (number)",r("Which quartile value to return."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(e,t){return Da([e],.25*Math.trunc(Is(t,this.locale)),!0,this.locale)},isExported:!0},ll={description:r("Nth smallest element in a data set."),args:[Wr("data (any, range)",r("The array or range containing the dataset to consider.")),Wr("n (number)",r("The rank from smallest to largest of the element to return."))],returns:["NUMBER"],computeFormat:e=>Array.isArray(e?.format)?e.format[0][0]:e?.format,compute:function(e,t){const o=Math.trunc(Is(t,this.locale));let i,s=[],n=0;ks([e],(e=>{"number"==typeof e&&(i=js(s,e,"nextSmaller","asc",s.length,((e,t)=>e[t])),s.splice(i+1,0,e),n++,n>o&&(s.pop(),n--))}));const a=s.pop();return xs((()=>void 0!==a),r("[[FUNCTION_NAME]] has no valid input data.")),xs((()=>n>=o),r("Function [[FUNCTION_NAME]] parameter 2 value (%s) is out of range.",o.toString())),a},isExported:!0},cl={description:r("Standard deviation."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the sample.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the sample."))],returns:["NUMBER"],compute:function(...e){return Math.sqrt(ml.compute.bind(this)(...e))},isExported:!0},hl={description:r("Standard deviation of entire population."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the population.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the population."))],returns:["NUMBER"],compute:function(...e){return Math.sqrt(fl.compute.bind(this)(...e))},isExported:!0},dl={description:r("Standard deviation."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the sample.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the sample."))],returns:["NUMBER"],compute:function(...e){return Math.sqrt(bl.compute.bind(this)(...e))},isExported:!0},ul={description:r("Standard deviation of sample (text as 0)."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the sample.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the sample."))],returns:["NUMBER"],compute:function(...e){return Math.sqrt(vl.compute.bind(this)(...e))},isExported:!0},gl={description:r("Standard deviation of entire population."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the population.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the population."))],returns:["NUMBER"],compute:function(...e){return Math.sqrt(Sl.compute.bind(this)(...e))},isExported:!0},pl={description:r("Standard deviation of entire population (text as 0)."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the population.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the population."))],returns:["NUMBER"],compute:function(...e){return Math.sqrt(Cl.compute.bind(this)(...e))},isExported:!0},ml={description:r("Variance."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the sample.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the sample."))],returns:["NUMBER"],compute:function(...e){return Fa(e,!0,!1,this.locale)},isExported:!0},fl={description:r("Variance of entire population."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the population.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the population."))],returns:["NUMBER"],compute:function(...e){return Fa(e,!1,!1,this.locale)},isExported:!0},bl={description:r("Variance."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the sample.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the sample."))],returns:["NUMBER"],compute:function(...e){return Fa(e,!0,!1,this.locale)},isExported:!0},vl={description:r("Variance of sample (text as 0)."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the sample.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the sample."))],returns:["NUMBER"],compute:function(...e){return Fa(e,!0,!0,this.locale)},isExported:!0},Sl={description:r("Variance of entire population."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the population.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the population."))],returns:["NUMBER"],compute:function(...e){return Fa(e,!1,!1,this.locale)},isExported:!0},Cl={description:r("Variance of entire population (text as 0)."),args:[Wr("value1 (number, range<number>)",r("The first value or range of the population.")),Wr("value2 (number, range<number>, repeating)",r("Additional values or ranges to include in the population."))],returns:["NUMBER"],compute:function(...e){return Fa(e,!1,!0,this.locale)},isExported:!0};var El=Object.freeze({__proto__:null,AVEDEV:La,AVERAGE:Pa,AVERAGE_WEIGHTED:Va,AVERAGEA:Ba,AVERAGEIF:za,AVERAGEIFS:Ha,COUNT:$a,COUNTA:Wa,COVAR:Ga,COVARIANCE_P:qa,COVARIANCE_S:Za,LARGE:Ya,MAX:ja,MAXA:Xa,MAXIFS:Ka,MEDIAN:Qa,MIN:Ja,MINA:el,MINIFS:tl,PERCENTILE:ol,PERCENTILE_EXC:il,PERCENTILE_INC:sl,QUARTILE:rl,QUARTILE_EXC:nl,QUARTILE_INC:al,SMALL:ll,STDEV:cl,STDEV_P:hl,STDEV_S:dl,STDEVA:ul,STDEVP:gl,STDEVPA:pl,VAR:ml,VAR_P:fl,VAR_S:bl,VARA:vl,VARP:Sl,VARPA:Cl});function wl(e,t,o,i){const s=new Map,n=e.length;for(let t=n-1;t>=0;t--)s.set(Ms(e[t][0]).toUpperCase(),t);if("number"!=typeof t&&"string"!=typeof t)throw new Error(r("The field must be a number or a string"));let a;if("number"==typeof t){if(a=Math.trunc(t)-1,a<0||n-1<a)throw new Error(r("The field (%s) must be one of %s or must be a number between 1 and %s inclusive.",t.toString(),n.toString()))}else{const e=Ms(t).toUpperCase();if(a=s.get(e)??-1,-1===a)throw new Error(r("The field (%s) must be one of %s.",Ms(t),[...s.keys()].toString()))}const l=o[0].length;if(l<2)throw new Error(r("The criteria range contains %s row, it must be at least 2 rows.",l.toString()));let c=new Set;const h=e[0].length;for(let t=1;t<l;t++){let r=[],n=!0;for(let i=0;i<o.length;i++){const a=Ms(o[i][0]).toUpperCase(),l=s.get(a),c=o[i][t];if(void 0!==c){if(void 0===l){n=!1;break}r.push([e[l].slice(1,h)]),r.push(c)}}if(n){if(!(r.length>0)){c=new Set(Array(h-1).keys());break}qs(r,((e,t)=>{c.add(t)}),i,!0)}}const d=e[a];return[...c].map((e=>d[e+1]))}const xl=[Wr("database (range)",r("The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.")),Wr("field (any)",r("Indicates which column in database contains the values to be extracted and operated on.")),Wr("criteria (range)",r("An array or range containing zero or more criteria to filter the database values by before operating."))],yl={description:r("Average of a set of values from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return Pa.compute.bind(this)([i])},isExported:!0},Il={description:r("Counts values from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return $a.compute.bind(this)([i])},isExported:!0},Rl={description:r("Counts values and text from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return Wa.compute.bind(this)([i])},isExported:!0},Tl={description:r("Single value from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return xs((()=>1===i.length),r("More than one match found in DGET evaluation.")),i[0]},isExported:!0},Al={description:r("Maximum of values from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return ja.compute.bind(this)([i])},isExported:!0},Ol={description:r("Minimum of values from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return Ja.compute.bind(this)([i])},isExported:!0},Ml={description:r("Product of values from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return ga.compute.bind(this)([i])},isExported:!0},Nl={description:r("Standard deviation of population sample from table."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return cl.compute.bind(this)([i])},isExported:!0},_l={description:r("Standard deviation of entire population from table."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return gl.compute.bind(this)([i])},isExported:!0},Fl={description:r("Sum of values from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return Ia.compute.bind(this)([i])},isExported:!0},Dl={description:r("Variance of population sample from table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return ml.compute.bind(this)([i])},isExported:!0},Ll={description:r("Variance of a population from a table-like range."),args:xl,returns:["NUMBER"],compute:function(e,t,o){const i=wl(e,t,o,this.locale);return Sl.compute.bind(this)([i])},isExported:!0};var Pl=Object.freeze({__proto__:null,DAVERAGE:yl,DCOUNT:Il,DCOUNTA:Rl,DGET:Tl,DMAX:Al,DMIN:Ol,DPRODUCT:Ml,DSTDEV:Nl,DSTDEVP:_l,DSUM:Fl,DVAR:Dl,DVARP:Ll});var kl;!function(e){e.WHOLE_YEARS="Y",e.WHOLE_MONTHS="M",e.WHOLE_DAYS="D",e.DAYS_WITHOUT_WHOLE_MONTHS="MD",e.MONTH_WITHOUT_WHOLE_YEARS="YM",e.DAYS_BETWEEN_NO_MORE_THAN_ONE_YEAR="YD"}(kl||(kl={}));const Ul={description:r("Converts year/month/day into a date."),args:[Wr("year (number)",r("The year component of the date.")),Wr("month (number)",r("The month component of the date.")),Wr("day (number)",r("The day component of the date."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e,t,o){let i=Math.trunc(Is(e,this.locale));const s=Math.trunc(Is(t,this.locale)),n=Math.trunc(Is(o,this.locale));xs((()=>0<=i&&i<=9999),r("The year (%s) must be between 0 and 9999 inclusive.",i.toString())),i<1900&&(i+=1900);const a=Bt(new yt(i,s-1,n));return xs((()=>a>=0),r("The function [[FUNCTION_NAME]] result must be greater than or equal 01/01/1900.")),a},isExported:!0},Vl={description:r("Calculates the number of days, months, or years between two dates."),args:[Wr("start_date (date)",r("The start date to consider in the calculation. Must be a reference to a cell containing a DATE, a function returning a DATE type, or a number.")),Wr("end_date (date)",r("The end date to consider in the calculation. Must be a reference to a cell containing a DATE, a function returning a DATE type, or a number.")),Wr("unit (string)",r('A text abbreviation for unit of time. Accepted values are "Y" (the number of whole years between start_date and end_date), "M" (the number of whole months between start_date and end_date), "D" (the number of days between start_date and end_date), "MD" (the number of days between start_date and end_date after subtracting whole months), "YM" (the number of whole months between start_date and end_date after subtracting whole years), "YD" (the number of days between start_date and end_date, assuming start_date and end_date were no more than one year apart).'))],returns:["NUMBER"],compute:function(e,t,o){const i=Ms(o).toUpperCase();xs((()=>Object.values(kl).includes(i)),((e,t)=>{const o=e.map((e=>`'${e}'`)).join(", ");return r("The function [[FUNCTION_NAME]] has an argument with value '%s'. It should be one of: %s.",t,o)})(Object.values(kl),Ms(o)));const s=Math.trunc(Is(e,this.locale)),n=Math.trunc(Is(t,this.locale)),a=Vt(s),l=Vt(n);switch(xs((()=>n>=s),r("start_date (%s) should be on or before end_date (%s).",a.toLocaleDateString(),l.toLocaleDateString())),i){case kl.WHOLE_YEARS:return Yt(a,l);case kl.WHOLE_MONTHS:return qt(a,l);case kl.WHOLE_DAYS:return Zt(a,l);case kl.MONTH_WITHOUT_WHOLE_YEARS:return qt(a,l)-12*Yt(a,l);case kl.DAYS_WITHOUT_WHOLE_MONTHS:let e=l.getDate()-a.getDate();if(e<0){e=zt(new yt(l.getFullYear(),l.getMonth()-1,1))-Math.abs(e)}return e;case kl.DAYS_BETWEEN_NO_MORE_THAN_ONE_YEAR:{if(function(e,t){return Gt(e,t,1)<1}(s,n))return Zt(a,l);const e=new yt(a.getFullYear(),l.getMonth(),l.getDate());let t=Zt(a,e);return t<0&&(e.setFullYear(a.getFullYear()+1),t=Zt(a,e)),t}}},isExported:!0},Bl={description:r("Converts a date string to a date value."),args:[Wr("date_string (string)",r("The string representing the date."))],returns:["NUMBER"],compute:function(e){const t=Ms(e),o=Ut(t,this.locale);return xs((()=>null!==o),r("The date_string (%s) cannot be parsed to date/time.",t.toString())),Math.trunc(o.value)},isExported:!0},zl={description:r("Day of the month that a specific date falls on."),args:[Wr("date (string)",r("The date from which to extract the day."))],returns:["NUMBER"],compute:function(e){return Ls(e,this.locale).getDate()},isExported:!0},Hl={description:r("Number of days between two dates."),args:[Wr("end_date (date)",r("The end of the date range.")),Wr("start_date (date)",r("The start of the date range."))],returns:["NUMBER"],compute:function(e,t){const o=Ls(e,this.locale),i=Ls(t,this.locale),s=o.getTime()-i.getTime();return Math.round(s/Rt)},isExported:!0},$l={description:r("Number of days between two dates on a 360-day year (months of 30 days)."),args:[Wr("start_date (date)",r("The start date to consider in the calculation.")),Wr("end_date (date)",r("The end date to consider in the calculation.")),Wr("method (number, default=0)",r("An indicator of what day count method to use. (0) US NASD method (1) European method"))],returns:["NUMBER"],compute:function(e,t,o=0){const i=Is(e,this.locale),s=Is(t,this.locale),r=Ds(o)?4:0,n=cc.compute.bind(this)(e,t,r);return Math.sign(s-i)*Math.round(360*n)},isExported:!0},Wl={description:r("Date a number of months before/after another date."),args:[Wr("start_date (date)",r("The date from which to calculate the result.")),Wr("months (number)",r("The number of months before (negative) or after (positive) 'start_date' to calculate."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e,t){return Bt($t(Ls(e,this.locale),Math.trunc(Is(t,this.locale)),!1))},isExported:!0},Gl={description:r("Last day of a month before or after a date."),args:[Wr("start_date (date)",r("The date from which to calculate the result.")),Wr("months (number)",r("The number of months before (negative) or after (positive) 'start_date' to consider."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e,t){const o=Ls(e,this.locale),i=Math.trunc(Is(t,this.locale)),s=o.getFullYear(),r=o.getMonth();return Bt(new yt(s,r+i+1,0))},isExported:!0},ql={description:r("Hour component of a specific time."),args:[Wr("time (date)",r("The time from which to calculate the hour component."))],returns:["NUMBER"],compute:function(e){return Ls(e,this.locale).getHours()},isExported:!0},Zl={description:r("ISO week number of the year."),args:[Wr("date (date)",r("The date for which to determine the ISO week number. Must be a reference to a cell containing a date, a function returning a date type, or a number."))],returns:["NUMBER"],compute:function(e){const t=Ls(e,this.locale),o=t.getFullYear();let i=1;for(;4!==new yt(o,0,i).getDay();)i+=1;const s=new yt(o,0,i-3);let r=31;for(;4!==new yt(o,11,r).getDay();)r-=1;const n=new yt(o,11,r+3);let a,l;switch(a=s.getTime()<=t.getTime()?t.getTime()<=n.getTime()?0:1:-1,a){case 0:l=s;break;case 1:l=new yt(o,11,r+3+1);break;case-1:let e=1;for(;4!==new yt(o-1,0,e).getDay();)e+=1;l=new yt(o-1,0,e-3)}const c=(t.getTime()-l.getTime())/Rt;return Math.floor(c/7)+1},isExported:!0},Yl={description:r("Minute component of a specific time."),args:[Wr("time (date)",r("The time from which to calculate the minute component."))],returns:["NUMBER"],compute:function(e){return Ls(e,this.locale).getMinutes()},isExported:!0},jl={description:r("Month of the year a specific date falls in"),args:[Wr("date (date)",r("The date from which to extract the month."))],returns:["NUMBER"],compute:function(e){return Ls(e,this.locale).getMonth()+1},isExported:!0},Xl={description:r("Net working days between two provided days."),args:[Wr("start_date (date)",r("The start date of the period from which to calculate the number of net working days.")),Wr("end_date (date)",r("The end date of the period from which to calculate the number of net working days.")),Wr("holidays (date, range<date>, optional)",r("A range or array constant containing the date serial numbers to consider holidays."))],returns:["NUMBER"],compute:function(e,t,o){return Ql.compute.bind(this)(e,t,1,o)},isExported:!0};function Kl(e){if("string"==typeof e){xs((()=>{if(7!==e.length)return!1;for(let t of e)if("0"!==t&&"1"!==t)return!1;return!0}),r('When weekend is a string (%s) it must be composed of "0" or "1".',e));let t=[];for(let o=0;o<7;o++)"1"===e[o]&&t.push((o+1)%7);return t}if("number"==typeof e)return xs((()=>1<=e&&e<=7||11<=e&&e<=17),r("The weekend (%s) must be a string or a number in the range 1-7 or 11-17.",e.toString())),e<=7?[e-2==-1?6:e-2,e-1]:[e-11];throw Error(r("The weekend must be a number or a string."))}const Ql={description:r("Net working days between two dates (specifying weekends)."),args:[Wr("start_date (date)",r("The start date of the period from which to calculate the number of net working days.")),Wr("end_date (date)",r("The end date of the period from which to calculate the number of net working days.")),Wr("weekend (any, default=1)",r("A number or string representing which days of the week are considered weekends.")),Wr("holidays (date, range<date>, optional)",r("A range or array constant containing the dates to consider as holidays."))],returns:["NUMBER"],compute:function(e,t,o=1,i){const s=Ls(e,this.locale),r=Ls(t,this.locale),n=Kl(o);let a=new Set;void 0!==i&&ks([i],(e=>{const t=Ls(e,this.locale);a.add(t.getTime())}));const l=s.getTime()>r.getTime(),c=yt.fromTimestamp((l?s:r).getTime());let h=yt.fromTimestamp((l?r:s).getTime());const d=c.getTime();let u=h.getTime(),g=0;for(;u<=d;)n.includes(h.getDay())||a.has(u)||(g+=1),h.setDate(h.getDate()+1),u=h.getTime();return l?-g:g},isExported:!0},Jl={description:r("Current date and time as a date value."),args:[],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat+" "+this.locale.timeFormat},compute:function(){let e=yt.now();const t=e.getTime()-It.getTime(),o=e.getHours()/24+e.getMinutes()/1440+e.getSeconds()/86400;return Math.floor(t/Rt)+o},isExported:!0},ec={description:r("Minute component of a specific time."),args:[Wr("time (date)",r("The time from which to calculate the second component."))],returns:["NUMBER"],compute:function(e){return Ls(e,this.locale).getSeconds()},isExported:!0},tc={description:r("Converts hour/minute/second into a time."),args:[Wr("hour (number)",r("The hour component of the time.")),Wr("minute (number)",r("The minute component of the time.")),Wr("second (number)",r("The second component of the time."))],returns:["DATE"],computeFormat:function(){return this.locale.timeFormat},compute:function(e,t,o){let i=Math.trunc(Is(e,this.locale)),s=Math.trunc(Is(t,this.locale)),n=Math.trunc(Is(o,this.locale));return s+=Math.floor(n/60),n=n%60+(n<0?60:0),i+=Math.floor(s/60),s=s%60+(s<0?60:0),i%=24,xs((()=>i>=0),r("The function [[FUNCTION_NAME]] result cannot be negative")),i/24+s/1440+n/86400},isExported:!0},oc={description:r("Converts a time string into its serial number representation."),args:[Wr("time_string (string)",r("The string that holds the time representation."))],returns:["NUMBER"],compute:function(e){const t=Ms(e),o=Ut(t,this.locale);xs((()=>null!==o),r("The time_string (%s) cannot be parsed to date/time.",t));const i=o.value-Math.trunc(o.value);return i<0?1+i:i},isExported:!0},ic={description:r("Current date as a date value."),args:[],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(){const e=yt.now();return Bt(new yt(e.getFullYear(),e.getMonth(),e.getDate()))},isExported:!0},sc={description:r("Day of the week of the date provided (as number)."),args:[Wr("date (date)",r("The date for which to determine the day of the week. Must be a reference to a cell containing a date, a function returning a date type, or a number.")),Wr("type (number, default=1)",r("A number indicating which numbering system to use to represent weekdays. By default, counts starting with Sunday = 1."))],returns:["NUMBER"],compute:function(e,t=1){const o=Ls(e,this.locale),i=Math.round(Is(t,this.locale)),s=o.getDay();return xs((()=>[1,2,3].includes(i)),r("The type (%s) must be 1, 2 or 3.",i.toString())),1===i?s+1:2===i?0===s?7:s:0===s?6:s-1},isExported:!0},rc={description:r("Week number of the year."),args:[Wr("date (date)",r("The date for which to determine the week number. Must be a reference to a cell containing a date, a function returning a date type, or a number.")),Wr("type (number, default=1)",r("A number representing the day that a week starts on. Sunday = 1."))],returns:["NUMBER"],compute:function(e,t=1){const o=Ls(e,this.locale),i=Math.round(Is(t,this.locale));if(xs((()=>1===i||2===i||11<=i&&i<=17||21===i),r("The type (%s) is out of range.",i.toString())),21===i)return Zl.compute.bind(this)(e);let s;s=1===i||2===i?i-1:i-10==7?0:i-10;const n=o.getFullYear();let a=1,l=new yt(n,0,a);for(;l.getDay()!==s;)a+=1,l=new yt(n,0,a);const c=(o.getTime()-l.getTime())/Rt;return c<0?1:Math.floor(c/7)+(1===a?1:2)},isExported:!0},nc={description:r("Date after a number of workdays."),args:[Wr("start_date (date)",r("The date from which to begin counting.")),Wr("num_days (number)",r("The number of working days to advance from start_date. If negative, counts backwards.")),Wr("holidays (date, range<date>, optional)",r("A range or array constant containing the dates to consider holidays."))],returns:["NUMBER"],computeFormat:function(){return this.locale.dateFormat},compute:function(e,t,o){return ac.compute.bind(this)(e,t,1,o)},isExported:!0},ac={description:r("Date after a number of workdays (specifying weekends)."),args:[Wr("start_date (date)",r("The date from which to begin counting.")),Wr("num_days (number)",r("The number of working days to advance from start_date. If negative, counts backwards.")),Wr("weekend (any, default=1)",r("A number or string representing which days of the week are considered weekends.")),Wr("holidays (date, range<date>, optional)",r("A range or array constant containing the dates to consider holidays."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e,t,o=1,i){let s=Ls(e,this.locale),n=Math.trunc(Is(t,this.locale));"string"==typeof o&&xs((()=>"1111111"!==o),r("The weekend (%s) must be different from '1111111'.",o));const a=Kl(o);let l=new Set;void 0!==i&&ks([i],(e=>{const t=Ls(e,this.locale);l.add(t.getTime())}));let c=yt.fromTimestamp(s.getTime()),h=c.getTime();const d=Math.sign(n);let u=Math.abs(n);for(;u>0;)c.setDate(c.getDate()+d),h=c.getTime(),a.includes(c.getDay())||l.has(h)||(u-=1);const g=h-It.getTime();return Math.round(g/Rt)},isExported:!0},lc={description:r("Year specified by a given date."),args:[Wr("date (date)",r("The date from which to extract the year."))],returns:["NUMBER"],compute:function(e){return Ls(e,this.locale).getFullYear()},isExported:!0},cc={description:r("Exact number of years between two dates."),args:[Wr("start_date (date)",r("The start date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number.")),Wr("end_date (date)",r("The end date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number.")),Wr("day_count_convention (number, default=0)",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o=0){let i=Math.trunc(Is(e,this.locale)),s=Math.trunc(Is(t,this.locale));const n=Math.trunc(Is(o,this.locale));return xs((()=>i>=0),r("The start_date (%s) must be positive or null.",i.toString())),xs((()=>s>=0),r("The end_date (%s) must be positive or null.",s.toString())),xs((()=>0<=n&&n<=4),r("The day_count_convention (%s) must be between 0 and 4 inclusive.",n.toString())),Gt(i,s,n)}},hc={description:r("First day of the month preceding a date."),args:[Wr("date (date)",r("The date from which to calculate the result."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e){const t=Ls(e,this.locale),o=t.getFullYear(),i=t.getMonth();return Bt(new yt(o,i,1))}},dc={description:r("Last day of the month following a date."),args:[Wr("date (date)",r("The date from which to calculate the result."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e){return Gl.compute.bind(this)(e,0)}},uc={description:r("Quarter of the year a specific date falls in"),args:[Wr("date (date)",r("The date from which to extract the quarter."))],returns:["NUMBER"],compute:function(e){return Math.ceil((Ls(e,this.locale).getMonth()+1)/3)}},gc={description:r("First day of the quarter of the year a specific date falls in."),args:[Wr("date (date)",r("The date from which to calculate the start of quarter."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e){const t=uc.compute.bind(this)(e),o=lc.compute.bind(this)(e);return Bt(new yt(o,3*(t-1),1))}},pc={description:r("Last day of the quarter of the year a specific date falls in."),args:[Wr("date (date)",r("The date from which to calculate the end of quarter."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e){const t=uc.compute.bind(this)(e),o=lc.compute.bind(this)(e);return Bt(new yt(o,3*t,0))}},mc={description:r("First day of the year a specific date falls in."),args:[Wr("date (date)",r("The date from which to calculate the start of the year."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e){const t=lc.compute.bind(this)(e);return Bt(new yt(t,0,1))}},fc={description:r("Last day of the year a specific date falls in."),args:[Wr("date (date)",r("The date from which to calculate the end of the year."))],returns:["DATE"],computeFormat:function(){return this.locale.dateFormat},compute:function(e){const t=lc.compute.bind(this)(e);return Bt(new yt(t+1,0,0))}};var bc=Object.freeze({__proto__:null,DATE:Ul,DATEDIF:Vl,DATEVALUE:Bl,DAY:zl,DAYS:Hl,DAYS360:$l,EDATE:Wl,EOMONTH:Gl,HOUR:ql,ISOWEEKNUM:Zl,MINUTE:Yl,MONTH:jl,NETWORKDAYS:Xl,NETWORKDAYS_INTL:Ql,NOW:Jl,SECOND:ec,TIME:tc,TIMEVALUE:oc,TODAY:ic,WEEKDAY:sc,WEEKNUM:rc,WORKDAY:nc,WORKDAY_INTL:ac,YEAR:lc,YEARFRAC:cc,MONTH_START:hc,MONTH_END:dc,QUARTER:uc,QUARTER_START:gc,QUARTER_END:pc,YEAR_START:mc,YEAR_END:fc});const vc={description:r("Compare two numeric values, returning 1 if they're equal."),args:[Wr("number1 (number)",r("The first number to compare.")),Wr("number2 (number, default=0)",r("The second number to compare."))],returns:["NUMBER"],compute:function(e,t=0){return Is(e,this.locale)===Is(t,this.locale)?1:0},isExported:!0};var Sc=Object.freeze({__proto__:null,DELTA:vc});const Cc={description:r("Returns a filtered version of the source range, returning only rows or columns that meet the specified conditions."),args:[Wr("range (any, range<any>)",r("The data to be filtered.")),Wr("condition1 (boolean, range<boolean>)",r("A column or row containing true or false values corresponding to the first column or row of range.")),Wr("condition2 (boolean, range<boolean>, repeating)",r("Additional column or row containing true or false values."))],returns:["RANGE<ANY>"],compute:function(e,...t){let o=er(e);const i=t.map((e=>er(e)));i.map((e=>qr(r("The arguments condition must be a single column or row."),e))),Zr(r("The arguments conditions must have the same dimensions."),...i);const s=i.map((e=>e.flat())),n=1===i[0].length?"row":"col";o="row"===n?Ze(o):o,xs((()=>s.every((e=>e.length===o.length))),r("FILTER has mismatched sizes on the range and conditions."));const a=[];for(let e=0;e<o.length;e++){const t=o[e];s.every((t=>t[e]))&&a.push(t)}if(!a.length)throw new g(r("No match found in FILTER evaluation"));return Qs("row"===n?Ze(a):a)},isExported:!0},Ec={description:r("Unique rows in the provided source range."),args:[Wr("range (any, range<any>)",r("The data to filter by unique entries.")),Wr("by_column (boolean, default=FALSE)",r("Whether to filter the data by columns or by rows.")),Wr("exactly_once (boolean, default=FALSE)",r("Whether to return only entries with no duplicates."))],returns:["RANGE<NUMBER>"],compute:function(e,t,o){if(!Ss(e))return Js(e);const i=Ds(t)||!1,s=Ds(o)||!1;i||(e=Ze(e));const n=new Map;for(const t of e){const e=JSON.stringify(t),o=n.get(e);o?o.count++:n.set(e,{val:t,count:1})}const a=s?[...n.values()].filter((e=>1===e.count)).map((e=>e.val)):[...n.values()].map((e=>e.val));if(!a.length)throw new Error(r("No unique values found"));return Qs(i?a:Ze(a))},isExported:!0};var wc=Object.freeze({__proto__:null,FILTER:Cc,UNIQUE:Ec});function xc(e,t){xs((()=>e<t),r("The maturity (%s) must be strictly greater than the settlement (%s).",t.toString(),e.toString()))}function yc(e,t){xs((()=>t<e),r("The settlement date (%s) must be strictly greater than the issue date (%s).",e.toString(),t.toString()))}function Ic(e){xs((()=>[1,2,4].includes(e)),r("The frequency (%s) must be one of %s",e.toString(),[1,2,4].toString()))}function Rc(e){xs((()=>0<=e&&e<=4),r("The day_count_convention (%s) must be between 0 and 4 inclusive.",e.toString()))}function Tc(e){xs((()=>e>0),r("The redemption (%s) must be strictly positive.",e.toString()))}function Ac(e){xs((()=>e>0),r("The price (%s) must be strictly positive.",e.toString()))}function Oc(e){xs((()=>e>0),r("The number_of_periods (%s) must be greater than 0.",e.toString()))}function Mc(e){xs((()=>e>0),r("The rate (%s) must be strictly positive.",e.toString()))}function Nc(e){xs((()=>e>0),r("The life (%s) must be strictly positive.",e.toString()))}function _c(e){xs((()=>e>=0),r("The cost (%s) must be positive or null.",e.toString()))}function Fc(e){xs((()=>e>0),r("The period (%s) must be strictly positive.",e.toString()))}function Dc(e){xs((()=>e>=0),r("The salvage (%s) must be positive or null.",e.toString()))}function Lc(e){xs((()=>e>0),r("The present value (%s) must be strictly positive.",e.toString()))}function Pc(e,t){xs((()=>e<=t),r("The period (%s) must be less than or equal life (%s).",e.toString(),t.toString()))}function kc(e){xs((()=>e>0),r("The investment (%s) must be strictly positive.",e.toString()))}function Uc(e){xs((()=>e>0),r("The discount (%s) must be strictly positive.",e.toString()))}function Vc(e){xs((()=>e<1),r("The discount (%s) must be smaller than 1.",e.toString()))}function Bc(e){xs((()=>e>0),r("The depreciation factor (%s) must be strictly positive.",e.toString()))}function zc(e,t,o){const i=Ls(e,o),s=Ls(t,o),n=Ls(e,o);n.setFullYear(i.getFullYear()+1),xs((()=>s.getTime()<=n.getTime()),r("The settlement date (%s) must at most one year after the maturity date (%s).",e.toString(),t.toString()))}function Hc(e,t,o){Oc(o),xs((()=>e>0),r("The first_period (%s) must be strictly positive.",e.toString())),xs((()=>t>0),r("The last_period (%s) must be strictly positive.",t.toString())),xs((()=>e<=t),r("The first_period (%s) must be smaller or equal to the last_period (%s).",e.toString(),t.toString())),xs((()=>t<=o),r("The last_period (%s) must be smaller or equal to the number_of_periods (%s).",e.toString(),o.toString()))}function $c(e){xs((()=>e>-1),r("The rate_guess (%s) must be strictly greater than -1.",e.toString()))}function Wc(e,t){xs((()=>e.length===t.length&&e[0].length===t[0].length),r("The cashflow_amounts and cashflow_dates ranges must have the same dimensions."))}function Gc(e){xs((()=>e.every((t=>t>=e[0]))),r("All the dates should be greater or equal to the first date in cashflow_dates (%s).",e[0].toString()))}const qc=[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("frequency (number)",r("The number of interest or coupon payments per year (1, 2, or 4).")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))];function Zc(e,t,o,i,s=1e-10,n){let a,l,c,h,d=o,u=!1,g=0;do{c=e(d),isNaN(c)?(xs((()=>g<i&&void 0!==n),r("Function [[FUNCTION_NAME]] didn't find any result.")),g++,d=n(h),h=d):(a=d-c/t(d),l=Math.abs(a-d),d=a,u=l<s||Math.abs(c)<s,xs((()=>g<i),r("Function [[FUNCTION_NAME]] didn't find any result.")),g++)}while(!u);return d}const Yc={description:r("Accrued interest of security paying at maturity."),args:[Wr("issue (date)",r("The date the security was initially issued.")),Wr("maturity (date)",r("The maturity date of the security.")),Wr("rate (number)",r("The annualized rate of interest.")),Wr("redemption (number)",r("The redemption amount per 100 face value, or par.")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s=0){s=s||0;const r=Math.trunc(Is(e,this.locale)),n=Math.trunc(Is(t,this.locale)),a=Is(i,this.locale),l=Is(o,this.locale),c=Math.trunc(Is(s,this.locale));yc(n,r),Rc(c),Tc(a),Mc(l);return a*l*cc.compute.bind(this)(r,n,s)},isExported:!0},jc={description:r("Depreciation for an accounting period."),args:[Wr("cost (number)",r("The initial cost of the asset.")),Wr("purchase_date (date)",r("The date the asset was purchased.")),Wr("first_period_end (date)",r("The date the first period ended.")),Wr("salvage (number)",r("The value of the asset at the end of depreciation.")),Wr("period (number)",r("The single period within life for which to calculate depreciation.")),Wr("rate (number)",r("The deprecation rate.")),Wr("day_count_convention (number, optional)",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s,n,a=0){a=a||0;const l=Is(e,this.locale),c=Math.trunc(Is(t,this.locale)),h=Math.trunc(Is(o,this.locale)),d=Is(i,this.locale),u=Is(s,this.locale),g=Is(n,this.locale),p=Math.trunc(Is(a,this.locale));!function(e){xs((()=>e>0),r("The cost (%s) must be strictly positive.",e.toString()))}(l),Dc(d),function(e,t){xs((()=>e<=t),r("The salvage (%s) must be smaller or equal than the cost (%s).",e.toString(),t.toString()))}(d,l),function(e){xs((()=>e>=0),r("The period (%s) must be positive or null.",e.toString()))}(u),Mc(g),Rc(p),xs((()=>c<=h),r("The purchase_date (%s) must be before the first_period_end (%s).",c.toString(),h.toString()));const m=u<1&&u>0?1:Math.trunc(u),f=l*g,b=cc.compute.bind(this)(c,h,p),v=c===h?f:f*b,S=l-v-f*m;return S>=d?0===m?v:f:d-S<f?f-(d-S):0},isExported:!0},Xc={description:r("Days in coupon period containing settlement date."),args:qc,returns:["NUMBER"],compute:function(e,t,o,i=0){i=i||0;const s=Math.trunc(Is(e,this.locale)),r=Math.trunc(Is(t,this.locale)),n=Math.trunc(Is(o,this.locale)),a=Math.trunc(Is(i,this.locale));if(xc(s,r),Ic(n),Rc(a),1===a){const s=th.compute.bind(this)(e,t,o,i);return Jc.compute.bind(this)(e,t,o,i)-s}return(3===a?365:360)/n},isExported:!0},Kc={description:r("Days from settlement until next coupon."),args:qc,returns:["NUMBER"],compute:function(e,t,o,i=0){i=i||0;const s=Math.trunc(Is(e,this.locale)),r=Math.trunc(Is(t,this.locale)),n=Math.trunc(Is(o,this.locale)),a=Math.trunc(Is(i,this.locale));xc(s,r),Ic(n),Rc(a);const l=th.compute.bind(this)(s,r,o,i);if([1,2,3].includes(a))return s-l;if(4===a){const e=Gt(l,s,a);return Math.round(360*e)}const c=Ls(s,this.locale),h=Ls(l,this.locale),d=h.getFullYear(),u=c.getFullYear(),g=h.getMonth()+1,p=c.getMonth()+1;let m=h.getDate(),f=c.getDate();return 2===g&&2===p&&Ht(h)&&Ht(c)&&(f=30),31!==f||30!==m&&31!==m||(f=30),2===g&&Ht(h)&&(m=30),31===m&&(m=30),360*(u-d)+30*(p-g)+(f-m)},isExported:!0},Qc={description:r("Days from settlement until next coupon."),args:qc,returns:["NUMBER"],compute:function(e,t,o,i=0){i=i||0;const s=Math.trunc(Is(e,this.locale)),r=Math.trunc(Is(t,this.locale)),n=Math.trunc(Is(o,this.locale)),a=Math.trunc(Is(i,this.locale));xc(s,r),Ic(n),Rc(a);const l=Jc.compute.bind(this)(s,r,o,i);if([1,2,3].includes(a))return l-s;if(4===a){const e=Gt(s,l,a);return Math.round(360*e)}const c=Kc.compute.bind(this)(e,t,o,a);return Xc.compute.bind(this)(e,t,o,a)-c},isExported:!0},Jc={description:r("Next coupon date after the settlement date."),args:qc,returns:["NUMBER"],computeFormat:function(){return this.locale.dateFormat},compute:function(e,t,o,i=0){i=i||0;const s=Math.trunc(Is(e,this.locale)),r=Math.trunc(Is(t,this.locale)),n=Math.trunc(Is(o,this.locale)),a=Math.trunc(Is(i,this.locale));xc(s,r),Ic(n),Rc(a);const l=12/n,c=eh.compute.bind(this)(e,t,o,i);return Bt($t(Ls(r,this.locale),-(c-1)*l,!0))},isExported:!0},eh={description:r("Number of coupons between settlement and maturity."),args:qc,returns:["NUMBER"],compute:function(e,t,o,i=0){i=i||0;const s=Math.trunc(Is(e,this.locale)),r=Math.trunc(Is(t,this.locale)),n=Math.trunc(Is(o,this.locale)),a=Math.trunc(Is(i,this.locale));xc(s,r),Ic(n),Rc(a);let l=1,c=r;const h=12/n;for(;c>s;)c=Bt($t(Ls(c,this.locale),-h,!1)),l++;return l-1},isExported:!0},th={description:r("Last coupon date prior to or on the settlement date."),args:qc,returns:["NUMBER"],computeFormat:function(){return this.locale.dateFormat},compute:function(e,t,o,i=0){i=i||0;const s=Math.trunc(Is(e,this.locale)),r=Math.trunc(Is(t,this.locale)),n=Math.trunc(Is(o,this.locale)),a=Math.trunc(Is(i,this.locale));xc(s,r),Ic(n),Rc(a);const l=12/n,c=eh.compute.bind(this)(e,t,o,i);return Bt($t(Ls(r,this.locale),-c*l,!0))},isExported:!0},oh={description:r("Cumulative interest paid over a set of periods."),args:[Wr("rate (number)",r("The interest rate.")),Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("present_value (number)",r("The current value of the annuity.")),Wr("first_period (number)",r("The number of the payment period to begin the cumulative calculation.")),Wr("last_period (number)",r("The number of the payment period to end the cumulative calculation.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period."))],returns:["NUMBER"],compute:function(e,t,o,i,s,r=0){const n=Is(i,this.locale),a=Is(s,this.locale),l=Is(e,this.locale),c=Is(o,this.locale),h=Is(t,this.locale);Hc(n,a,h),Mc(l),Lc(c);let d=0;for(let t=n;t<=a;t++){d+=ph.compute.bind(this)(e,t,h,o,0,r)}return d},isExported:!0},ih={description:r("Cumulative principal paid over a set of periods."),args:[Wr("rate (number)",r("The interest rate.")),Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("present_value (number)",r("The current value of the annuity.")),Wr("first_period (number)",r("The number of the payment period to begin the cumulative calculation.")),Wr("last_period (number)",r("The number of the payment period to end the cumulative calculation.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period."))],returns:["NUMBER"],compute:function(e,t,o,i,s,r=0){const n=Is(i,this.locale),a=Is(s,this.locale),l=Is(e,this.locale),c=Is(o,this.locale),h=Is(t,this.locale);Hc(n,a,h),Mc(l),Lc(c);let d=0;for(let t=n;t<=a;t++){d+=yh.compute.bind(this)(e,t,h,o,0,r)}return d},isExported:!0},sh={description:r("Depreciation via declining balance method."),args:[Wr("cost (number)",r("The initial cost of the asset.")),Wr("salvage (number)",r("The value of the asset at the end of depreciation.")),Wr("life (number)",r("The number of periods over which the asset is depreciated.")),Wr("period (number)",r("The single period within life for which to calculate depreciation.")),Wr("month (number, optional)",r("The number of months in the first year of depreciation."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o,i,...s){const n=Is(e,this.locale),a=Is(t,this.locale),l=Is(o,this.locale),c=Math.trunc(Is(i,this.locale)),h=s.length?Math.trunc(Is(s[0],this.locale)):12,d=l+(12===h?0:1);_c(n),Dc(a),Fc(c),Nc(l),xs((()=>1<=h&&h<=12),r("The month (%s) must be between 1 and 12 inclusive.",h.toString())),xs((()=>c<=d),r("The period (%s) must be less than or equal to %s.",c.toString(),d.toString()));const u=h/12;let g=1-Math.pow(a/n,1/l);g=Math.round(1e3*g)/1e3;let p=n,m=n*(1-g*u);for(let e=1;e<c;e++)p=m,m=p*(1-g),e===l&&(m=p*(1-g*(1-u)));return p-m},isExported:!0},rh={description:r("Depreciation via double-declining balance method."),args:[Wr("cost (number)",r("The initial cost of the asset.")),Wr("salvage (number)",r("The value of the asset at the end of depreciation.")),Wr("life (number)",r("The number of periods over which the asset is depreciated.")),Wr("period (number)",r("The single period within life for which to calculate depreciation.")),Wr("factor (number, default=2)",r("The factor by which depreciation decreases."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o,i,s=2){s=s||0;const r=Is(e,this.locale),n=Is(t,this.locale),a=Is(o,this.locale),l=Is(i,this.locale),c=Is(s,this.locale);if(_c(r),Dc(n),Fc(l),Nc(a),Pc(l,a),Bc(c),0===r||n>=r)return 0;const h=c/a;if(h>1)return 1===i?r-n:0;if(l<=1)return r*h;const d=r*Math.pow(1-h,l-1),u=r*Math.pow(1-h,l),g=u<n?d-n:d-u;return Math.max(g,0)},isExported:!0},nh={description:r("Discount rate of a security based on price."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("price (number)",r("The price at which the security is bought per 100 face value.")),Wr("redemption (number)",r("The redemption amount per 100 face value, or par.")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s=0){s=s||0;const r=Math.trunc(Is(e,this.locale)),n=Math.trunc(Is(t,this.locale)),a=Is(o,this.locale),l=Is(i,this.locale),c=Math.trunc(Is(s,this.locale));xc(r,n),Rc(c),Ac(a),Tc(l);return(l-a)/l/cc.compute.bind(this)(r,n,c)},isExported:!0},ah={description:r("Convert a decimal fraction to decimal value."),args:[Wr("fractional_price (number)",r("The price quotation given using fractional decimal conventions.")),Wr("unit (number)",r("The units of the fraction, e.g. 8 for 1/8ths or 32 for 1/32nds."))],returns:["NUMBER"],compute:function(e,t){const o=Is(e,this.locale),i=Math.trunc(Is(t,this.locale));xs((()=>i>0),r("The unit (%s) must be strictly positive.",i.toString()));const s=Math.trunc(o);return s+(o-s)*(10**Math.ceil(Math.log10(i))/i)},isExported:!0},lh={description:r("Convert a decimal value to decimal fraction."),args:[Wr("decimal_price (number)",r("The price quotation given as a decimal value.")),Wr("unit (number)",r("The units of the desired fraction, e.g. 8 for 1/8ths or 32 for 1/32nds."))],returns:["NUMBER"],compute:function(e,t){const o=Is(e,this.locale),i=Math.trunc(Is(t,this.locale));xs((()=>i>0),r("The unit (%s) must be strictly positive.",i.toString()));const s=Math.trunc(o);return s+(o-s)*(i/10**Math.ceil(Math.log10(i)))},isExported:!0},ch={description:r("Number of periods for an investment to reach a value."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("rate (number)",r("The annualized rate of interest.")),Wr("yield (number)",r("The expected annual yield of the security.")),Wr("frequency (number)",r("The number of interest or coupon payments per year (1, 2, or 4).")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s,n=0){n=n||0;const a=Math.trunc(Is(e,this.locale)),l=Math.trunc(Is(t,this.locale)),c=Is(o,this.locale),h=Is(i,this.locale),d=Math.trunc(Is(s,this.locale)),u=Math.trunc(Is(n,this.locale));xc(a,l),Ic(d),Rc(u),xs((()=>c>=0),r("The rate (%s) must be positive or null.",c.toString())),xs((()=>h>=0),r("The yield (%s) must be positive or null.",h.toString()));const g=cc.compute.bind(this)(a,l,u),p=g-Math.trunc(g)||1/d,m=Math.ceil(g*d),f=c/d,b=h/d;let v=0,S=0;for(let e=1;e<=m;e++){const t=(f+(e===m?1:0))/(1+b)**e;S+=(p+(e-1)/d)*t,v+=t}return 0===v?0:S/v},isExported:!0},hh={description:r("Annual effective interest rate."),args:[Wr("nominal_rate (number)",r("The nominal interest rate per year.")),Wr("periods_per_year (number)",r("The number of compounding periods per year."))],returns:["NUMBER"],compute:function(e,t){const o=Is(e,this.locale),i=Math.trunc(Is(t,this.locale));return xs((()=>o>0),r("The nominal rate (%s) must be strictly greater than 0.",o.toString())),xs((()=>i>0),r("The number of periods by year (%s) must strictly greater than 0.",i.toString())),Math.pow(1+o/i,i)-1},isExported:!0},dh={description:r("Future value of an annuity investment."),args:[Wr("rate (number)",r("The interest rate.")),Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("payment_amount (number)",r("The amount per period to be paid.")),Wr("present_value (number, default=0)",r("The current value of the annuity.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o,i=0,s=0){i=i||0,s=s||0;const r=Is(e,this.locale),n=Is(t,this.locale),a=Is(o,this.locale),l=Is(i,this.locale),c=Ds(s)?1:0;return r?-l*(1+r)**n-a*(1+r*c)*((1+r)**n-1)/r:-(l+a*n)},isExported:!0},uh={description:r("Future value of principal from series of rates."),args:[Wr("principal (number)",r("The amount of initial capital or value to compound against.")),Wr("rate_schedule (number, range<number>)",r("A series of interest rates to compound against the principal."))],returns:["NUMBER"],compute:function(e,t){return Bs([t],((e,t)=>e*(1+Is(t,this.locale))),Is(e,this.locale))},isExported:!0},gh={description:r("Calculates effective interest rate."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("investment (number)",r("The amount invested in the security.")),Wr("redemption (number)",r("The amount to be received at maturity.")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s=0){const r=Math.trunc(Is(e,this.locale)),n=Math.trunc(Is(t,this.locale)),a=Is(i,this.locale),l=Is(o,this.locale);xc(r,n),kc(l),Tc(a);return(a-l)/l/cc.compute.bind(this)(r,n,s)},isExported:!0},ph={description:r("Payment on the principal of an investment."),args:[Wr("rate (number)",r("The annualized rate of interest.")),Wr("period (number)",r("The amortization period, in terms of number of periods.")),Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("present_value (number)",r("The current value of the annuity.")),Wr("future_value (number, default=0)",r("The future value remaining after the final payment has been made.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o,i,s=0,r=0){return xh.compute.bind(this)(e,o,i,s,r)-yh.compute.bind(this)(e,t,o,i,s,r)},isExported:!0},mh={description:r("Internal rate of return given periodic cashflows."),args:[Wr("cashflow_amounts (number, range<number>)",r("An array or range containing the income or payments associated with the investment.")),Wr("rate_guess (number, default=0.1)",r("An estimate for what the internal rate of return will be."))],returns:["NUMBER"],computeFormat:()=>"0%",compute:function(e,t=.1){const o=Is(t,this.locale);$c(o);let i=!1,s=!1,n=[];Us([e],(e=>{e>0&&(i=!0),e<0&&(s=!0),n.push(e)}),this.locale),xs((()=>i&&s),r("The cashflow_amounts must include negative and positive values."));const a=n.shift();return Zc((function(e){return function(e,t,o){const i=o.length;let s=0;return o.reduce(((t,o)=>(s++,t+o*e**(i-s))),t*e**i)}(e,a,n)}),(function(e){return function(e,t,o){const i=o.length;let s=0;return o.reduce(((t,o)=>(s++,t+o*(i-s)*e**(i-s-1))),t*i*e**(i-1))}(e,a,n)}),o+1,20,1e-5)-1},isExported:!0},fh={description:r("Returns the interest paid at a particular period of an investment."),args:[Wr("rate (number)",r("The interest rate.")),Wr("period (number)",r("The period for which you want to view the interest payment.")),Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("present_value (number)",r("The current value of the annuity."))],returns:["NUMBER"],compute:function(e,t,o,i){const s=Is(e,this.locale),n=Is(t,this.locale),a=Is(o,this.locale),l=Is(i,this.locale);xs((()=>0!==a),r("The number of periods must be different than 0.",a.toString()));return-1*(l-l*(n/a))*s},isExported:!0},bh={description:r("Modified Macaulay duration."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("rate (number)",r("The annualized rate of interest.")),Wr("yield (number)",r("The expected annual yield of the security.")),Wr("frequency (number)",r("The number of interest or coupon payments per year (1, 2, or 4).")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s,r=0){return ch.compute.bind(this)(e,t,o,i,s,r)/(1+Is(i,this.locale)/Math.trunc(Is(s,this.locale)))},isExported:!0},vh={description:r("Modified internal rate of return."),args:[Wr("cashflow_amounts (range<number>)",r("A range containing the income or payments associated with the investment. The array should contain bot payments and incomes.")),Wr("financing_rate (number)",r("The interest rate paid on funds invested.")),Wr("reinvestment_return_rate (number)",r("The return (as a percentage) earned on reinvestment of income received from the investment."))],returns:["NUMBER"],compute:function(e,t,o){const i=Is(t,this.locale),s=Is(o,this.locale),n=Ze(e).flat().filter(ke).map((e=>Is(e,this.locale))),a=n.length;let l=0,c=0;for(const e of ye(0,a)){const t=n[e];t>=0?l+=t*(s+1)**(a-e-1):c+=t/(i+1)**e}xs((()=>0!==c&&0!==l),r("There must be both positive and negative values in cashflow_amounts."));return(-l/c)**(1/(a-1))-1},isExported:!0},Sh={description:r("Annual nominal interest rate."),args:[Wr("effective_rate (number)",r("The effective interest rate per year.")),Wr("periods_per_year (number)",r("The number of compounding periods per year."))],returns:["NUMBER"],compute:function(e,t){const o=Is(e,this.locale),i=Math.trunc(Is(t,this.locale));return xs((()=>o>0),r("The effective rate (%s) must must strictly greater than 0.",o.toString())),xs((()=>i>0),r("The number of periods by year (%s) must strictly greater than 0.",i.toString())),(Math.pow(o+1,1/i)-1)*i},isExported:!0},Ch={description:r("Number of payment periods for an investment."),args:[Wr("rate (number)",r("The interest rate.")),Wr("payment_amount (number)",r("The amount of each payment made.")),Wr("present_value (number)",r("The current value of the annuity.")),Wr("future_value (number, default=0)",r("The future value remaining after the final payment has been made.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period."))],returns:["NUMBER"],compute:function(e,t,o,i=0,s=0){i=i||0,s=s||0;const r=Is(e,this.locale),n=Is(t,this.locale),a=Is(o,this.locale),l=Is(i,this.locale),c=Ds(s)?1:0;if(0===r)return-(l+a)/n;const h=n*(1+r*c)/r;return Math.log((h-l)/(a+h))/Math.log(1+r)},isExported:!0};const Eh={description:r("The net present value of an investment based on a series of periodic cash flows and a discount rate."),args:[Wr("discount (number)",r("The discount rate of the investment over one period.")),Wr("cashflow1 (number, range<number>)",r("The first future cash flow.")),Wr("cashflow2 (number, range<number>, repeating)",r("Additional future cash flows."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,...t){const o=Is(e,this.locale);return xs((()=>-1!==o),r("The discount (%s) must be different from -1.",o.toString())),function(e,t,o,i){let s=0;return zs(o,((t,o)=>(s++,t+o/(1+e)**s)),t,i)}(o,0,t,this.locale)},isExported:!0},wh={description:r("Computes the number of periods needed for an investment to reach a value."),args:[Wr("rate (number)",r("The rate at which the investment grows each period.")),Wr("present_value (number)",r("The investment's current value.")),Wr("future_value (number)",r("The investment's desired future value."))],returns:["NUMBER"],compute:function(e,t,o){const i=Is(e,this.locale),s=Is(t,this.locale),n=Is(o,this.locale);return Mc(i),xs((()=>s>0),r("The present_value (%s) must be strictly positive.",s.toString())),xs((()=>n>0),r("The future_value (%s) must be strictly positive.",n.toString())),(Math.log(n)-Math.log(s))/Math.log(1+i)},isExported:!0},xh={description:r("Periodic payment for an annuity investment."),args:[Wr("rate (number)",r("The annualized rate of interest.")),Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("present_value (number)",r("The current value of the annuity.")),Wr("future_value (number, default=0)",r("The future value remaining after the final payment has been made.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o,i=0,s=0){i=i||0,s=s||0;const r=Is(t,this.locale),n=Is(e,this.locale),a=Ds(s)?1:0;let l=Is(i,this.locale),c=Is(o,this.locale);if(Oc(r),0===n)return-(l+c)/r;let h=-(c*(1+n)**r+l);return h=h*n/((1+n*a)*((1+n)**r-1)),h},isExported:!0},yh={description:r("Payment on the principal of an investment."),args:[Wr("rate (number)",r("The annualized rate of interest.")),Wr("period (number)",r("The amortization period, in terms of number of periods.")),Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("present_value (number)",r("The current value of the annuity.")),Wr("future_value (number, default=0)",r("The future value remaining after the final payment has been made.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o,i,s=0,n=0){s=s||0,n=n||0;const a=Is(o,this.locale),l=Is(e,this.locale),c=Is(t,this.locale),h=Ds(n)?1:0,d=Is(s,this.locale),u=Is(i,this.locale);Oc(a),xs((()=>c>0&&c<=a),r("The period must be between 1 and number_of_periods",a.toString()));const g=xh.compute.bind(this)(l,a,u,d,n);if(1===h&&1===c)return g;const p=0===h?c-1:c-2,m=u+g*h;return g+-dh.compute.bind(this)(l,p,g,m,0)*l},isExported:!0},Ih={description:r("Present value of an annuity investment."),args:[Wr("rate (number)",r("The interest rate.")),Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("payment_amount (number)",r("The amount per period to be paid.")),Wr("future_value (number, default=0)",r("The future value remaining after the final payment has been made.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o,i=0,s=0){i=i||0,s=s||0;const r=Is(e,this.locale),n=Is(t,this.locale),a=Is(o,this.locale),l=Is(i,this.locale),c=Ds(s)?1:0;return r?-(a*(1+r*c)*((1+r)**n-1)/r+l)/(1+r)**n:-(l+a*n)},isExported:!0},Rh={description:r("Price of a security paying periodic interest."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("rate (number)",r("The annualized rate of interest.")),Wr("yield (number)",r("The expected annual yield of the security.")),Wr("redemption (number)",r("The redemption amount per 100 face value, or par.")),Wr("frequency (number)",r("The number of interest or coupon payments per year (1, 2, or 4).")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s,n,a=0){a=a||0;const l=Math.trunc(Is(e,this.locale)),c=Math.trunc(Is(t,this.locale)),h=Is(o,this.locale),d=Is(i,this.locale),u=Is(s,this.locale),g=Math.trunc(Is(n,this.locale)),p=Math.trunc(Is(a,this.locale));xc(l,c),Ic(g),Rc(p),xs((()=>h>=0),r("The rate (%s) must be positive or null.",h.toString())),xs((()=>d>=0),r("The yield (%s) must be positive or null.",d.toString())),Tc(u);const m=cc.compute.bind(this)(l,c,p)*g,f=Math.ceil(m),b=m-Math.floor(m)||1,v=1+d/g,S=100*h/g;if(1===f)return(S+u)/(b*d/g+1)-S*(1-b);let C=0;for(let e=1;e<=f;e++)C+=S/v**(e-1+b);return u/v**(f-1+b)+C-S*(1-b)},isExported:!0},Th={description:r("Price of a discount security."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("discount (number)",r("The discount rate of the security at time of purchase.")),Wr("redemption (number)",r("The redemption amount per 100 face value, or par.")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s=0){s=s||0;const r=Math.trunc(Is(e,this.locale)),n=Math.trunc(Is(t,this.locale)),a=Is(o,this.locale),l=Is(i,this.locale),c=Math.trunc(Is(s,this.locale));xc(r,n),Rc(c),Uc(a),Tc(l);return l-a*l*cc.compute.bind(this)(r,n,c)},isExported:!0},Ah={description:r("Calculates the price of a security paying interest at maturity, based on expected yield."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("issue (date)",r("The date the security was initially issued.")),Wr("rate (number)",r("The annualized rate of interest.")),Wr("yield (number)",r("The expected annual yield of the security.")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s,n=0){n=n||0;const a=Math.trunc(Is(e,this.locale)),l=Math.trunc(Is(t,this.locale)),c=Math.trunc(Is(o,this.locale)),h=Is(i,this.locale),d=Is(s,this.locale),u=Math.trunc(Is(n,this.locale));yc(a,c),xc(a,l),Rc(u),xs((()=>h>=0),r("The rate (%s) must be positive or null.",h.toString())),xs((()=>d>=0),r("The yield (%s) must be positive or null.",d.toString()));const g=cc.compute.bind(this)(a,l,u),p=cc.compute.bind(this)(a,c,u);return(100+cc.compute.bind(this)(c,l,u)*h*100)/(1+g*d)-p*h*100},isExported:!0},Oh=.1,Mh={description:r("Interest rate of an annuity investment."),args:[Wr("number_of_periods (number)",r("The number of payments to be made.")),Wr("payment_per_period (number)",r("The amount per period to be paid.")),Wr("present_value (number)",r("The current value of the annuity.")),Wr("future_value (number, default=0)",r("The future value remaining after the final payment has been made.")),Wr("end_or_beginning (number, default=0)",r("Whether payments are due at the end (0) or beginning (1) of each period.")),Wr("rate_guess (number, default=0.1)",r("An estimate for what the interest rate will be."))],returns:["NUMBER"],computeFormat:()=>"0%",compute:function(e,t,o,i=0,s=0,n=.1){i=i||0,s=s||0,n=n||Oh;const a=Is(e,this.locale),l=Is(t,this.locale),c=Ds(s)?1:0,h=Is(n,this.locale);let d=Is(i,this.locale),u=Is(o,this.locale);Oc(a),xs((()=>[l,u,d].some((e=>e>0))&&[l,u,d].some((e=>e<0))),r("There must be both positive and negative values in [payment_amount, present_value, future_value].",a.toString())),$c(h),d-=l*c,u+=l*c;return Zc((e=>{const t=Math.pow(1+e,a);return d+u*t+l*((t-1)/e)}),(e=>{const t=Math.pow(1+e,a-1),o=Math.pow(1+e,a);return u*a*t+l*(a*t/e-(o-1)/e/e)}),h,40,1e-5)},isExported:!0},Nh={description:r("Amount received at maturity for a security."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("investment (number)",r("The amount invested (irrespective of face value of each security).")),Wr("discount (number)",r("The discount rate of the security invested in.")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s=0){s=s||0;const r=Math.trunc(Is(e,this.locale)),n=Math.trunc(Is(t,this.locale)),a=Is(o,this.locale),l=Is(i,this.locale),c=Math.trunc(Is(s,this.locale));xc(r,n),Rc(c),kc(a),Uc(l);return a/(1-l*cc.compute.bind(this)(r,n,c))},isExported:!0},_h={description:r("Computes the rate needed for an investment to reach a specific value within a specific number of periods."),args:[Wr("number_of_periods (number)",r("The number of periods.")),Wr("present_value (number)",r("The present value of the investment.")),Wr("future_value (number)",r("The future value of the investment."))],returns:["NUMBER"],compute:function(e,t,o){const i=Is(e,this.locale),s=Is(t,this.locale),r=Is(o,this.locale);return Oc(i),(r/s)**(1/i)-1},isExported:!0},Fh={description:r("Depreciation of an asset using the straight-line method."),args:[Wr("cost (number)",r("The initial cost of the asset.")),Wr("salvage (number)",r("The value of the asset at the end of depreciation.")),Wr("life (number)",r("The number of periods over which the asset is depreciated."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o){return(Is(e,this.locale)-Is(t,this.locale))/Is(o,this.locale)},isExported:!0},Dh={description:r("Depreciation via sum of years digit method."),args:[Wr("cost (number)",r("The initial cost of the asset.")),Wr("salvage (number)",r("The value of the asset at the end of depreciation.")),Wr("life (number)",r("The number of periods over which the asset is depreciated.")),Wr("period (number)",r("The single period within life for which to calculate depreciation."))],returns:["NUMBER"],computeFormat:()=>"#,##0.00",compute:function(e,t,o,i){const s=Is(e,this.locale),r=Is(t,this.locale),n=Is(o,this.locale),a=Is(i,this.locale);Fc(a),Nc(n),Pc(a,n);return(n-a+1)/(n*(n+1)/2)*(s-r)},isExported:!0},Lh={description:r("Price of a US Treasury bill."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("discount (number)",r("The discount rate of the bill at time of purchase."))],returns:["NUMBER"],compute:function(e,t,o){const i=Math.trunc(Is(e,this.locale)),s=Math.trunc(Is(t,this.locale)),r=Is(o,this.locale);xc(i,s),zc(i,s,this.locale),Uc(r),Vc(r);return 100*(1-r*cc.compute.bind(this)(i,s,2))},isExported:!0},Ph={description:r("Equivalent rate of return for a US Treasury bill."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("discount (number)",r("The discount rate of the bill at time of purchase."))],returns:["NUMBER"],compute:function(e,t,o){const i=Math.trunc(Is(e,this.locale)),s=Math.trunc(Is(t,this.locale)),r=Is(o,this.locale);xc(i,s),zc(i,s,this.locale),Uc(r),Vc(r);const n=Hl.compute.bind(this)(s,i);if(n<=182)return 365*r/(360-r*n);const a=Lh.compute.bind(this)(i,s,r)/100,l=n/(366===n?366:365);return(-2*l+2*Math.sqrt(l**2-(2*l-1)*(1-1/a)))/(2*l-1)},isExported:!0},kh={description:r("The yield of a US Treasury bill based on price."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("price (number)",r("The price at which the security is bought per 100 face value."))],returns:["NUMBER"],compute:function(e,t,o){const i=Math.trunc(Is(e,this.locale)),s=Math.trunc(Is(t,this.locale)),r=Is(o,this.locale);xc(i,s),zc(i,s,this.locale),Ac(r);return(100-r)/r*(1/cc.compute.bind(this)(i,s,2))},isExported:!0},Uh={description:r("Variable declining balance. WARNING : does not handle decimal periods."),args:[Wr("cost (number)",r("The initial cost of the asset.")),Wr("salvage (number)",r("The value of the asset at the end of depreciation.")),Wr("life (number)",r("The number of periods over which the asset is depreciated.")),Wr("start (number)",r("Starting period to calculate depreciation.")),Wr("end (number)",r("Ending period to calculate depreciation.")),Wr("factor (number, default=2)",r("The number of months in the first year of depreciation.")),Wr("no_switch (number, default=false)",r("Whether to switch to straight-line depreciation when the depreciation is greater than the declining balance calculation."))],returns:["NUMBER"],compute:function(e,t,o,i,s,n=2,a=false){n=n||0;const l=Is(e,this.locale),c=Is(t,this.locale),h=Is(o,this.locale),d=Math.trunc(Is(i,this.locale)),u=Math.trunc(Is(s,this.locale)),g=Is(n,this.locale),p=Ds(a);if(_c(l),Dc(c),function(e,t,o){Nc(o),xs((()=>e>=0),r("The start_period (%s) must be greater or equal than 0.",e.toString())),xs((()=>t>=0),r("The end_period (%s) must be greater or equal than 0.",t.toString())),xs((()=>e<=t),r("The start_period (%s) must be smaller or equal to the end_period (%s).",e.toString(),t.toString())),xs((()=>t<=o),r("The end_period (%s) must be smaller or equal to the life (%s).",e.toString(),o.toString()))}(d,u,h),Bc(g),0===l)return 0;if(c>=l)return d<1?l-c:0;const m=g/h;if(m>=1)return d<1?l-c:0;let f=l,b=0,v=0,S=!1;for(let e=0;e<u;e++){if(!S||p){const t=f*m,o=(f-c)/(h-e);!p&&o>t?(S=!0,b=o):b=t}const t=Math.max(f-b,c);e>=d&&(v+=f-t),f=t}return v},isExported:!0},Vh={description:r("Internal rate of return given non-periodic cash flows."),args:[Wr("cashflow_amounts (range<number>)",r("An range containing the income or payments associated with the investment.")),Wr("cashflow_dates (range<number>)",r("An range with dates corresponding to the cash flows in cashflow_amounts.")),Wr("rate_guess (number, default=0.1)",r("An estimate for what the internal rate of return will be."))],returns:["NUMBER"],compute:function(e,t,o=.1){const i=Is(o=o||0,this.locale),s=e.flat().map((e=>Is(e,this.locale))),n=t.flat().map((e=>Is(e,this.locale)));var a;Wc(e,t),a=s,xs((()=>a.some((e=>e>0))&&a.some((e=>e<0))),r("There must be both positive and negative values in cashflow_amounts.")),Gc(n),$c(i);const l=new Map;for(const e of ye(0,n.length)){const t=n[e];l.has(t)?l.set(t,l.get(t)+s[e]):l.set(t,s[e])}const c=Array.from(l.keys()),h=c.map((e=>l.get(e)));return Zc((e=>{let t=h[0];for(const o of ye(1,h.length)){const i=(c[0]-c[o])/365;t+=h[o]*(1+e)**i}return t}),(e=>{let t=0;for(const o of ye(1,h.length)){const i=(c[0]-c[o])/365;t+=i*h[o]*(1+e)**(i-1)}return t}),i,40,1e-5,(e=>e?e/10-.9:-.9))},isExported:!0},Bh={description:r("Net present value given to non-periodic cash flows.."),args:[Wr("discount (number)",r("The discount rate of the investment over one period.")),Wr("cashflow_amounts (number, range<number>)",r("An range containing the income or payments associated with the investment.")),Wr("cashflow_dates (number, range<number>)",r("An range with dates corresponding to the cash flows in cashflow_amounts."))],returns:["NUMBER"],compute:function(e,t,o){const i=Is(e,this.locale),s=Array.isArray(t)?t.flat().map((e=>Rs(e,this.locale))):[Rs(t,this.locale)],n=Array.isArray(o)?o.flat().map((e=>Rs(e,this.locale))):[Rs(o,this.locale)];if(Array.isArray(o)&&Array.isArray(t)?Wc(t,o):xs((()=>s.length===n.length),r("There must be the same number of values in cashflow_amounts and cashflow_dates.")),Gc(n),Mc(i),1===s.length)return s[0];const a=new Map;for(const e of ye(0,n.length)){const t=n[e];a.has(t)?a.set(t,a.get(t)+s[e]):a.set(t,s[e])}const l=Array.from(a.keys()),c=l.map((e=>a.get(e)));let h=c[0];for(const e of ye(1,c.length)){const t=(l[0]-l[e])/365;h+=c[e]*(1+i)**t}return h},isExported:!0},zh={description:r("Annual yield of a security paying periodic interest."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("rate (number)",r("The annualized rate of interest.")),Wr("price (number)",r("The price at which the security is bought per 100 face value.")),Wr("redemption (number)",r("The redemption amount per 100 face value, or par.")),Wr("frequency (number)",r("The number of interest or coupon payments per year (1, 2, or 4).")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s,n,a=0){a=a||0;const l=Math.trunc(Is(e,this.locale)),c=Math.trunc(Is(t,this.locale)),h=Is(o,this.locale),d=Is(i,this.locale),u=Is(s,this.locale),g=Math.trunc(Is(n,this.locale)),p=Math.trunc(Is(a,this.locale));xc(l,c),Ic(g),Rc(p),xs((()=>h>=0),r("The rate (%s) must be positive or null.",h.toString())),Ac(d),Tc(u);const m=cc.compute.bind(this)(l,c,p)*g,f=Math.ceil(m),b=m-Math.floor(m)||1,v=100*h/g;if(1===f){const e=d+v*(1-b);return(u+v-e)*g*(1/b)/e}const S=Zc((function(e){return function(e,t,o,i,s,r){let n=r-(e+s*(1-t))*i**(o-1+t);for(let e=1;e<=o;e++)n+=s*i**(e-1);return n}(d,b,f,e,v,u)}),(function(e){return function(e,t,o,i,s){let r=-(e+s*(1-t))*(o-1+t)*i**(o-2+t);for(let e=1;e<=o;e++)r+=s*(e-1)*i**(e-2);return r}(d,b,f,e,v)}),1+(h+1)/g,100,1e-5);return(S-1)*g},isExported:!0},Hh={description:r("Annual yield of a discount security."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("price (number)",r("The price at which the security is bought per 100 face value.")),Wr("redemption (number)",r("The redemption amount per 100 face value, or par.")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s=0){s=s||0;const r=Math.trunc(Is(e,this.locale)),n=Math.trunc(Is(t,this.locale)),a=Is(o,this.locale),l=Is(i,this.locale),c=Math.trunc(Is(s,this.locale));xc(r,n),Rc(c),Ac(a),Tc(l);return(l/a-1)/cc.compute.bind(this)(e,t,s)},isExported:!0},$h={description:r("Annual yield of a security paying interest at maturity."),args:[Wr("settlement (date)",r("The settlement date of the security, the date after issuance when the security is delivered to the buyer.")),Wr("maturity (date)",r("The maturity or end date of the security, when it can be redeemed at face, or par value.")),Wr("issue (date)",r("The date the security was initially issued.")),Wr("rate (number)",r("The annualized rate of interest.")),Wr("price (number)",r("The price at which the security is bought.")),Wr("day_count_convention (number, default=0 )",r("An indicator of what day count method to use."))],returns:["NUMBER"],compute:function(e,t,o,i,s,n=0){n=n||0;const a=Math.trunc(Is(e,this.locale)),l=Math.trunc(Is(t,this.locale)),c=Math.trunc(Is(o,this.locale)),h=Is(i,this.locale),d=Is(s,this.locale),u=Math.trunc(Is(n,this.locale));xc(a,l),Rc(u),xs((()=>a>=c),r("The settlement (%s) must be greater than or equal to the issue (%s).",a.toString(),c.toString())),xs((()=>h>=0),r("The rate (%s) must be positive or null.",h.toString())),Ac(d);const g=cc.compute.bind(this)(c,l,u),p=cc.compute.bind(this)(c,a,u),m=cc.compute.bind(this)(a,l,u);return(100*(1+h*g)/(d+100*h*p)-1)/m},isExported:!0};var Wh=Object.freeze({__proto__:null,ACCRINTM:Yc,AMORLINC:jc,COUPDAYS:Xc,COUPDAYBS:Kc,COUPDAYSNC:Qc,COUPNCD:Jc,COUPNUM:eh,COUPPCD:th,CUMIPMT:oh,CUMPRINC:ih,DB:sh,DDB:rh,DISC:nh,DOLLARDE:ah,DOLLARFR:lh,DURATION:ch,EFFECT:hh,FV:dh,FVSCHEDULE:uh,INTRATE:gh,IPMT:ph,IRR:mh,ISPMT:fh,MDURATION:bh,MIRR:vh,NOMINAL:Sh,NPER:Ch,NPV:Eh,PDURATION:wh,PMT:xh,PPMT:yh,PV:Ih,PRICE:Rh,PRICEDISC:Th,PRICEMAT:Ah,RATE:Mh,RECEIVED:Nh,RRI:_h,SLN:Fh,SYD:Dh,TBILLPRICE:Lh,TBILLEQ:Ph,TBILLYIELD:kh,VDB:Uh,XIRR:Vh,XNPV:Bh,YIELD:zh,YIELDDISC:Hh,YIELDMAT:$h});const Gh={description:r("Whether a value is an error other than #N/A."),args:[Wr("value (any, lazy)",r("The value to be verified as an error type."))],returns:["BOOLEAN"],compute:function(e){try{return e(),!1}catch(e){return e?.errorType!=a.NotAvailable}},isExported:!0},qh={description:r("Whether a value is an error."),args:[Wr("value (any, lazy)",r("The value to be verified as an error type."))],returns:["BOOLEAN"],compute:function(e){try{return e(),!1}catch(e){return!0}},isExported:!0},Zh={description:r("Whether a value is `true` or `false`."),args:[Wr("value (any, lazy)",r("The value to be verified as a logical TRUE or FALSE."))],returns:["BOOLEAN"],compute:function(e){try{return"boolean"==typeof e()}catch(e){return!1}},isExported:!0},Yh={description:r("Whether a value is the error #N/A."),args:[Wr("value (any, lazy)",r("The value to be verified as an error type."))],returns:["BOOLEAN"],compute:function(e){try{return e(),!1}catch(e){return e?.errorType===a.NotAvailable}},isExported:!0},jh={description:r("Whether a value is non-textual."),args:[Wr("value (any, lazy)",r("The value to be checked."))],returns:["BOOLEAN"],compute:function(e){try{return"string"!=typeof e()}catch(e){return!0}},isExported:!0},Xh={description:r("Whether a value is a number."),args:[Wr("value (any, lazy)",r("The value to be verified as a number."))],returns:["BOOLEAN"],compute:function(e){try{return"number"==typeof e()}catch(e){return!1}},isExported:!0},Kh={description:r("Whether a value is text."),args:[Wr("value (any, lazy)",r("The value to be verified as text."))],returns:["BOOLEAN"],compute:function(e){try{return"string"==typeof e()}catch(e){return!1}},isExported:!0},Qh={description:r("Whether the referenced cell is empty"),args:[Wr("value (any, lazy)",r("Reference to the cell that will be checked for emptiness."))],returns:["BOOLEAN"],compute:function(e){try{return null===e()}catch(e){return!1}},isExported:!0},Jh={description:r("Returns the error value #N/A."),args:[],returns:["BOOLEAN"],compute:function(e){throw new g},isExported:!0};var ed=Object.freeze({__proto__:null,ISERR:Gh,ISERROR:qh,ISLOGICAL:Zh,ISNA:Yh,ISNONTEXT:jh,ISNUMBER:Xh,ISTEXT:Kh,ISBLANK:Qh,NA:Jh});const td={description:r("Logical `and` operator."),args:[Wr("logical_expression1 (boolean, range<boolean>)",r("An expression or reference to a cell containing an expression that represents some logical value, i.e. TRUE or FALSE, or an expression that can be coerced to a logical value.")),Wr("logical_expression2 (boolean, range<boolean>, repeating)",r("More expressions that represent logical values."))],returns:["BOOLEAN"],compute:function(...e){let t=!1,o=!0;return $s(e,(e=>(t=!0,o=o&&e,o))),xs((()=>t),r("[[FUNCTION_NAME]] has no valid input data.")),o},isExported:!0},od={description:r("Logical value `false`."),args:[],returns:["BOOLEAN"],compute:function(){return!1},isExported:!0},id={description:r("Returns value depending on logical expression."),args:[Wr("logical_expression (boolean)",r("An expression or reference to a cell containing an expression that represents some logical value, i.e. TRUE or FALSE.")),Wr("value_if_true (any, lazy)",r("The value the function returns if logical_expression is TRUE.")),Wr("value_if_false (any, lazy, default=FALSE)",r("The value the function returns if logical_expression is FALSE."))],returns:["ANY"],compute:function(e,t,o=(()=>!1)){const i=Ds(e)?t():o();return null==i?"":i},isExported:!0},sd={description:r("Value if it is not an error, otherwise 2nd argument."),args:[Wr("value (any, lazy)",r("The value to return if value itself is not an error.")),Wr('value_if_error (any, lazy, default="empty")',r("The value the function returns if value is an error."))],returns:["ANY"],computeFormat:(e,t=(()=>({value:""})))=>{try{return e().format}catch(e){return t()?.format}},compute:function(e,t=(()=>"")){let o;try{o=e()}catch(e){o=t()}return null==o?"":o},isExported:!0},rd={description:r("Value if it is not an #N/A error, otherwise 2nd argument."),args:[Wr("value (any, lazy)",r("The value to return if value itself is not #N/A an error.")),Wr('value_if_error (any, lazy, default="empty")',r("The value the function returns if value is an #N/A error."))],returns:["ANY"],compute:function(e,t=(()=>"")){let o;try{o=e()}catch(i){o=i.errorType===a.NotAvailable?t():e()}return null==o?"":o},isExported:!0},nd={description:r("Returns a value depending on multiple logical expressions."),args:[Wr("condition1 (boolean, lazy)",r("The first condition to be evaluated. This can be a boolean, a number, an array, or a reference to any of those.")),Wr("value1 (any, lazy)",r("The returned value if condition1 is TRUE.")),Wr("condition2 (boolean, lazy, repeating)",r("Additional conditions to be evaluated if the previous ones are FALSE.")),Wr("value2 (any, lazy, repeating)",r("Additional values to be returned if their corresponding conditions are TRUE."))],returns:["ANY"],compute:function(...e){xs((()=>e.length%2==0),r("Wrong number of arguments. Expected an even number of arguments."));for(let t=0;t<e.length-1;t+=2)if(Ds(e[t]())){const o=e[t+1]();return null!==o?o:""}throw new Error(r("No match."))},isExported:!0},ad={description:r("Returns opposite of provided logical value."),args:[Wr("logical_expression (boolean)",r("An expression or reference to a cell holding an expression that represents some logical value."))],returns:["BOOLEAN"],compute:function(e){return!Ds(e)},isExported:!0},ld={description:r("Logical `or` operator."),args:[Wr("logical_expression1 (boolean, range<boolean>)",r("An expression or reference to a cell containing an expression that represents some logical value, i.e. TRUE or FALSE, or an expression that can be coerced to a logical value.")),Wr("logical_expression2 (boolean, range<boolean>, repeating)",r("More expressions that evaluate to logical values."))],returns:["BOOLEAN"],compute:function(...e){let t=!1,o=!1;return $s(e,(e=>(t=!0,o=o||e,!o))),xs((()=>t),r("[[FUNCTION_NAME]] has no valid input data.")),o},isExported:!0},cd={description:r("Logical value `true`."),args:[],returns:["BOOLEAN"],compute:function(){return!0},isExported:!0},hd={description:r("Logical `xor` operator."),args:[Wr("logical_expression1 (boolean, range<boolean>)",r("An expression or reference to a cell containing an expression that represents some logical value, i.e. TRUE or FALSE, or an expression that can be coerced to a logical value.")),Wr("logical_expression2 (boolean, range<boolean>, repeating)",r("More expressions that evaluate to logical values."))],returns:["BOOLEAN"],compute:function(...e){let t=!1,o=!1;return $s(e,(e=>(t=!0,o=o?!e:e,!0))),xs((()=>t),r("[[FUNCTION_NAME]] has no valid input data.")),o},isExported:!0};var dd=Object.freeze({__proto__:null,AND:td,FALSE:od,IF:id,IFERROR:sd,IFNA:rd,IFS:nd,NOT:ad,OR:ld,TRUE:cd,XOR:hd});function ud(e,t){if(void 0===e)throw new g(r("Did not find value '%s' in [[FUNCTION_NAME]] evaluation.",Ms(t)))}const gd={description:r("Returns a cell reference as a string. "),args:[Wr("row (number)",r("The row number of the cell reference. ")),Wr("column (number)",r("The column number (not name) of the cell reference. A is column number 1. ")),Wr("absolute_relative_mode (number, default=1)",r("An indicator of whether the reference is row/column absolute. 1 is row and column absolute (e.g. $A$1), 2 is row absolute and column relative (e.g. A$1), 3 is row relative and column absolute (e.g. $A1), and 4 is row and column relative (e.g. A1).")),Wr("use_a1_notation (boolean, default=TRUE)",r("A boolean indicating whether to use A1 style notation (TRUE) or R1C1 style notation (FALSE).")),Wr("sheet (string, optional)",r("A string indicating the name of the sheet into which the address points."))],returns:["STRING"],compute:function(e,t,o=1,i=!0,s){const n=As(e,this.locale),a=As(t,this.locale);Os(n),Os(a);const l=As(o,this.locale);var c,h;xs((()=>[1,2,3,4].includes(l)),(c=4,h=l,r("The function [[FUNCTION_NAME]] expects a number value between %s and %s inclusive, but receives %s.",1..toString(),c.toString(),h.toString())));let d;if(Ds(i)){d=xt(a-1,n-1,{rowFixed:!![1,2].includes(l),colFixed:!![1,3].includes(l)})}else{d=([1,2].includes(l)?`R${n}`:`R[${n}]`)+([1,3].includes(l)?`C${a}`:`C[${a}]`)}return void 0!==s?`${we(Ms(s))}!${d}`:d},isExported:!0},pd={description:r("Column number of a specified cell."),args:[Wr("cell_reference (meta, default='this cell')",r("The cell whose column number will be returned. Column A corresponds to 1. By default, the function use the cell in which the formula is entered."))],returns:["NUMBER"],compute:function(e){const t=e||this.__originCellXC?.();xs((()=>!!t),"In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");return ti(t).left+1},isExported:!0},md={description:r("Number of columns in a specified array or range."),args:[Wr("range (meta)",r("The range whose column count will be returned."))],returns:["NUMBER"],compute:function(e){const t=ti(e);return t.right-t.left+1},isExported:!0},fd={description:r("Horizontal lookup"),args:[Wr("search_key (any)",r("The value to search for. For example, 42, 'Cats', or I24.")),Wr("range (range)",r("The range to consider for the search. The first row in the range is searched for the key specified in search_key.")),Wr("index (number)",r("The row index of the value to be returned, where the first row in range is numbered 1.")),Wr("is_sorted (boolean, default=true)",r("Indicates whether the row to be searched (the first row of the specified range) is sorted, in which case the closest match for search_key will be returned."))],returns:["ANY"],compute:function(e,t,o,i=true){const s=Math.trunc(Is(o,this.locale)),n=_s(e);xs((()=>1<=s&&s<=t[0].length),r("[[FUNCTION_NAME]] evaluates to an out of bounds range."));let a;a=Ds(i)?js(t,n,"nextSmaller","asc",t.length,Ys):Xs(t,n,"strict",t.length,Ys);const l=t[a];return ud(l,e),l[s-1]},isExported:!0},bd={description:r("Returns the content of a cell, specified by row and column offset."),args:[Wr("reference (any, range)",r("The range of cells from which the values are returned.")),Wr("row (number)",r("The index of the row to be returned from within the reference range of cells.")),Wr("column (number)",r("The index of the column to be returned from within the reference range of cells."))],returns:["ANY"],computeFormat:function(e,t,o){const i=Is(t.value,this.locale),s=Is(o.value,this.locale);return e.format[s-1][i-1]},compute:function(e,t,o){const i=Ss(e)?e:[[e]],s=Is(t,this.locale),n=Is(o,this.locale);return xs((()=>n>=0&&n-1<i.length&&s>=0&&s-1<i[0].length),r("Index out of range.")),xs((()=>0!==t&&0!==o),r("This function can only return a single cell value, not an array. Provide valid row and column indices.")),i[n-1][s-1]},isExported:!0},vd={description:r("Look up a value."),args:[Wr("search_key (any)",r("The value to search for. For example, 42, 'Cats', or I24.")),Wr("search_array (range)",r("One method of using this function is to provide a single sorted row or column search_array to look through for the search_key with a second argument result_range. The other way is to combine these two arguments into one search_array where the first row or column is searched and a value is returned from the last row or column in the array. If search_key is not found, a non-exact match may be returned.")),Wr("result_range (range, optional)",r("The range from which to return a result. The value returned corresponds to the location where search_key is found in search_range. This range must be only a single row or column and should not be used if using the search_result_array method."))],returns:["ANY"],compute:function(e,t,o){let i=t.length,s=t[0].length;const n=_s(e),a=s>=i,l=js(t,n,"nextSmaller","asc",a?s:i,a?Zs:Ys);return-1===l&&ud(void 0,e),ud(a?t[0][l]:t[l][s-1],e),void 0===o?a?t[i-1][l]:t[l][s-1]:(i=o.length,s=o[0].length,xs((()=>1===i||1===s),r("The result_range must be a single row or a single column.")),i>1?(xs((()=>l<=i-1),r("[[FUNCTION_NAME]] evaluates to an out of range row value %s.",(l+1).toString())),o[l][0]):(xs((()=>l<=s-1),r("[[FUNCTION_NAME]] evaluates to an out of range column value %s.",(l+1).toString())),o[0][l]))},isExported:!0},Sd={description:r("Position of item in range that matches value."),args:[Wr("search_key (any)",r("The value to search for. For example, 42, 'Cats', or I24.")),Wr("range (any, range)",r("The one-dimensional array to be searched.")),Wr("search_type (number, default=1)",r("The search method. 1 (default) finds the largest value less than or equal to search_key when range is sorted in ascending order. 0 finds the exact value when range is unsorted. -1 finds the smallest value greater than or equal to search_key when range is sorted in descending order."))],returns:["NUMBER"],compute:function(e,t,o=1){let i=Is(o,this.locale);const s=_s(e),n=t.length,a=t[0].length;xs((()=>1===n||1===a),r("The range must be a single row or a single column."));let l=-1;const c=1===n?Zs:Ys,h=1===n?t[0].length:t.length;switch(i=Math.sign(i),i){case 1:l=js(t,s,"nextSmaller","asc",h,c);break;case 0:l=Xs(t,s,"strict",h,c);break;case-1:l=js(t,s,"nextGreater","desc",h,c)}return ud(1===n?t[0][l]:t[l],e),l+1},isExported:!0},Cd={description:r("Row number of a specified cell."),args:[Wr("cell_reference (meta, default='this cell')",r("The cell whose row number will be returned. By default, this function uses the cell in which the formula is entered."))],returns:["NUMBER"],compute:function(e){e=e||this.__originCellXC?.(),xs((()=>!!e),"In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");return ti(e).top+1},isExported:!0},Ed={description:r("Number of rows in a specified array or range."),args:[Wr("range (meta)",r("The range whose row count will be returned."))],returns:["NUMBER"],compute:function(e){const t=ti(e);return t.bottom-t.top+1},isExported:!0},wd={description:r("Vertical lookup."),args:[Wr("search_key (any)",r("The value to search for. For example, 42, 'Cats', or I24.")),Wr("range (any, range)",r("The range to consider for the search. The first column in the range is searched for the key specified in search_key.")),Wr("index (number)",r("The column index of the value to be returned, where the first column in range is numbered 1.")),Wr("is_sorted (boolean, default=true)",r("Indicates whether the column to be searched (the first column of the specified range) is sorted, in which case the closest match for search_key will be returned."))],returns:["ANY"],compute:function(e,t,o,i=true){const s=Math.trunc(Is(o,this.locale)),n=_s(e);xs((()=>1<=s&&s<=t.length),r("[[FUNCTION_NAME]] evaluates to an out of bounds range."));let a;a=Ds(i)?js(t,n,"nextSmaller","asc",t[0].length,Zs):Xs(t,n,"strict",t[0].length,Zs);const l=t[s-1][a];return ud(l,e),l},isExported:!0},xd={description:r("Search a range for a match and return the corresponding item from a second range."),args:[Wr("search_key (any)",r("The value to search for.")),Wr("lookup_range (any, range)",r("The range to consider for the search. Should be a single column or a single row.")),Wr("return_range (any, range)",r("The range containing the return value. Should have the same dimensions as lookup_range.")),Wr("if_not_found (any, lazy, optional)",r("If a valid match is not found, return this value.")),Wr("match_mode (any, default=0)",r("(0) Exact match. (-1) Return next smaller item if no match. (1) Return next greater item if no match.")),Wr("search_mode (any, default=1)",r("(1) Search starting at first item. (-1) Search starting at last item. (2) Perform a binary search that relies on lookup_array being sorted in ascending order. If not sorted, invalid results will be returned. (-2) Perform a binary search that relies on lookup_array being sorted in descending order. If not sorted, invalid results will be returned. "))],returns:["ANY"],compute:function(e,t,o,i,s=0,n=1){const a=Math.trunc(Is(s,this.locale)),l=Math.trunc(Is(n,this.locale)),c=_s(e);xs((()=>1===t.length||1===t[0].length),r("lookup_range should be either a single row or single column.")),xs((()=>[-1,1,-2,2].includes(l)),r("searchMode should be a value in [-1, 1, -2, 2].")),xs((()=>[-1,0,1].includes(a)),r("matchMode should be a value in [-1, 0, 1]."));const h=1===t.length?"col":"row";xs((()=>"col"===h?o[0].length===t[0].length:o.length===t.length),r("return_range should have the same dimensions as lookup_range."));const d="col"===h?Zs:Ys,u="col"===h?t[0].length:t.length,g=0===a?"strict":1===a?"nextGreater":"nextSmaller",p=-1===l;let m;if(2===l||-2===l){m=js(t,c,g,2===l?"asc":"desc",u,d)}else m=Xs(t,c,g,u,d,p);if(-1!==m)return Qs("col"===h?o.map((e=>[e[m]])):[o[m]]);const f=i?.();return ud(f,e),f},isExported:!0};var yd=Object.freeze({__proto__:null,ADDRESS:gd,COLUMN:pd,COLUMNS:md,HLOOKUP:fd,INDEX:bd,LOOKUP:vd,MATCH:Sd,ROW:Cd,ROWS:Ed,VLOOKUP:wd,XLOOKUP:xd});const Id={description:r("Sum of two numbers."),args:[Wr("value1 (number)",r("The first addend.")),Wr("value2 (number)",r("The second addend."))],returns:["NUMBER"],computeFormat:(e,t)=>e?.format||t?.format,compute:function(e,t){return Is(e,this.locale)+Is(t,this.locale)}},Rd={description:r("Concatenation of two values."),args:[Wr("value1 (string)",r("The value to which value2 will be appended.")),Wr("value2 (string)",r("The value to append to value1."))],returns:["STRING"],compute:function(e,t){return Ms(e)+Ms(t)},isExported:!0},Td={description:r("One number divided by another."),args:[Wr("dividend (number)",r("The number to be divided.")),Wr("divisor (number)",r("The number to divide by."))],returns:["NUMBER"],computeFormat:(e,t)=>e?.format||t?.format,compute:function(e,t){const o=Is(t,this.locale);return xs((()=>0!==o),r("The divisor must be different from zero.")),Is(e,this.locale)/o}};function Ad(e){return null==e}const Od={number:0,string:"",boolean:!1},Md={description:r("Equal."),args:[Wr("value1 (any)",r("The first value.")),Wr("value2 (any)",r("The value to test against value1 for equality."))],returns:["BOOLEAN"],compute:function(e,t){return e=Ad(e)?Od[typeof t]:e,t=Ad(t)?Od[typeof e]:t,"string"==typeof e&&(e=e.toUpperCase()),"string"==typeof t&&(t=t.toUpperCase()),e===t}};function Nd(e,t,o){e=Ad(e)?Od[typeof t]:e,t=Ad(t)?Od[typeof e]:t,"number"!=typeof e&&(e=Ms(e).toUpperCase()),"number"!=typeof t&&(t=Ms(t).toUpperCase());const i=typeof e,s=typeof t;return"string"===i&&"number"===s||("string"!==s||"number"!==i)&&o(e,t)}const _d={description:r("Strictly greater than."),args:[Wr("value1 (any)",r("The value to test as being greater than value2.")),Wr("value2 (any)",r("The second value."))],returns:["BOOLEAN"],compute:function(e,t){return Nd(e,t,((e,t)=>e>t))}},Fd={description:r("Greater than or equal to."),args:[Wr("value1 (any)",r("The value to test as being greater than or equal to value2.")),Wr("value2 (any)",r("The second value."))],returns:["BOOLEAN"],compute:function(e,t){return Nd(e,t,((e,t)=>e>=t))}},Dd={description:r("Less than."),args:[Wr("value1 (any)",r("The value to test as being less than value2.")),Wr("value2 (any)",r("The second value."))],returns:["BOOLEAN"],compute:function(e,t){return!Fd.compute.bind(this)(e,t)}},Ld={description:r("Less than or equal to."),args:[Wr("value1 (any)",r("The value to test as being less than or equal to value2.")),Wr("value2 (any)",r("The second value."))],returns:["BOOLEAN"],compute:function(e,t){return!_d.compute.bind(this)(e,t)}},Pd={description:r("Difference of two numbers."),args:[Wr("value1 (number)",r("The minuend, or number to be subtracted from.")),Wr("value2 (number)",r("The subtrahend, or number to subtract from value1."))],returns:["NUMBER"],computeFormat:(e,t)=>e?.format||t?.format,compute:function(e,t){return Is(e,this.locale)-Is(t,this.locale)}},kd={description:r("Product of two numbers"),args:[Wr("factor1 (number)",r("The first multiplicand.")),Wr("factor2 (number)",r("The second multiplicand."))],returns:["NUMBER"],computeFormat:(e,t)=>e?.format||t?.format,compute:function(e,t){return Is(e,this.locale)*Is(t,this.locale)}},Ud={description:r("Not equal."),args:[Wr("value1 (any)",r("The first value.")),Wr("value2 (any)",r("The value to test against value1 for inequality."))],returns:["BOOLEAN"],compute:function(e,t){return!Md.compute.bind(this)(e,t)}},Vd={description:r("A number raised to a power."),args:[Wr("base (number)",r("The number to raise to the exponent power.")),Wr("exponent (number)",r("The exponent to raise base to."))],returns:["NUMBER"],compute:function(e,t){return ua.compute.bind(this)(e,t)}},Bd={description:r("A number with the sign reversed."),args:[Wr("value (number)",r("The number to have its sign reversed. Equivalently, the number to multiply by -1."))],computeFormat:e=>e?.format,returns:["NUMBER"],compute:function(e){return-Is(e,this.locale)}},zd={description:r("Value interpreted as a percentage."),args:[Wr("percentage (number)",r("The value to interpret as a percentage."))],returns:["NUMBER"],compute:function(e){return Is(e,this.locale)/100}},Hd={description:r("A specified number, unchanged."),args:[Wr("value (any)",r("The number to return."))],returns:["ANY"],computeFormat:e=>e?.format,compute:function(e){return null===e?"":e}};var $d=Object.freeze({__proto__:null,ADD:Id,CONCAT:Rd,DIVIDE:Td,EQ:Md,GT:_d,GTE:Fd,LT:Dd,LTE:Ld,MINUS:Pd,MULTIPLY:kd,NE:Ud,POW:Vd,UMINUS:Bd,UNARY_PERCENT:zd,UPLUS:Hd});const Wd=/[A-Za-zÀ-ÖØ-öø-ÿ]+/g,Gd={description:r("Gets character associated with number."),args:[Wr("table_number (number)",r("The number of the character to look up from the current Unicode table in decimal format."))],returns:["STRING"],compute:function(e){const t=Math.trunc(Is(e,this.locale));return xs((()=>t>=1),r("The table_number (%s) is out of range.",t.toString())),String.fromCharCode(t)},isExported:!0},qd={description:r("Remove non-printable characters from a piece of text."),args:[Wr("text (string)",r("The text whose non-printable characters are to be removed."))],returns:["STRING"],compute:function(e){const t=Ms(e);let o="";for(const e of t)e&&e.charCodeAt(0)>31&&(o+=e);return o},isExported:!0},Zd={description:r("Appends strings to one another."),args:[Wr("string1 (string, range<string>)",r("The initial string.")),Wr("string2 (string, range<string>, repeating)",r("More strings to append in sequence."))],returns:["STRING"],compute:function(...e){return Bs(e,((e,t)=>e+Ms(t)),"")},isExported:!0},Yd={description:r("Tests whether two strings are identical."),args:[Wr("string1 (string)",r("The first string to compare.")),Wr("string2 (string)",r("The second string to compare."))],returns:["BOOLEAN"],compute:function(e,t){return Ms(e)===Ms(t)},isExported:!0},jd={description:r("First position of string found in text, case-sensitive."),args:[Wr("search_for (string)",r("The string to look for within text_to_search.")),Wr("text_to_search (string)",r("The text to search for the first occurrence of search_for.")),Wr("starting_at (number, default=1)",r("The character within text_to_search at which to start the search."))],returns:["NUMBER"],compute:function(e,t,o=1){const i=Ms(e),s=Ms(t),n=Is(o,this.locale);xs((()=>""!==s),r("The text_to_search must be non-empty.")),xs((()=>n>=1),r("The starting_at (%s) must be greater than or equal to 1.",n.toString()));const a=s.indexOf(i,n-1);return xs((()=>a>=0),r("In [[FUNCTION_NAME]] evaluation, cannot find '%s' within '%s'.",i.toString(),s)),a+1},isExported:!0},Xd={description:r("Concatenates elements of arrays with delimiter."),args:[Wr("delimiter (string)",r("The character or string to place between each concatenated value.")),Wr("value_or_array1 (string, range<string>)",r("The value or values to be appended using delimiter.")),Wr("value_or_array2 (string, range<string>, repeating)",r("More values to be appended using delimiter."))],returns:["STRING"],compute:function(e,...t){const o=Ms(e);return Bs(t,((e,t)=>(e?e+o:"")+Ms(t)),"")}},Kd={description:r("Substring from beginning of specified string."),args:[Wr("text (string)",r("The string from which the left portion will be returned.")),Wr("number_of_characters (number, optional)",r("The number of characters to return from the left side of string."))],returns:["STRING"],compute:function(e,...t){const o=t.length?Is(t[0],this.locale):1;return xs((()=>o>=0),r("The number_of_characters (%s) must be positive or null.",o.toString())),Ms(e).substring(0,o)},isExported:!0},Qd={description:r("Length of a string."),args:[Wr("text (string)",r("The string whose length will be returned."))],returns:["NUMBER"],compute:function(e){return Ms(e).length},isExported:!0},Jd={description:r("Converts a specified string to lowercase."),args:[Wr("text (string)",r("The string to convert to lowercase."))],returns:["STRING"],compute:function(e){return Ms(e).toLowerCase()},isExported:!0},eu={description:r("A segment of a string."),args:[Wr("text (string)",r("The string to extract a segment from.")),Wr("starting_at (number)",r("The index from the left of string from which to begin extracting. The first character in string has the index 1.")),Wr("extract_length (number)",r("The length of the segment to extract."))],returns:["STRING"],compute:function(e,t,o){const i=Ms(e),s=Is(t,this.locale),n=Is(o,this.locale);return xs((()=>s>=1),r("The starting_at argument (%s) must be positive greater than one.",s.toString())),xs((()=>n>=0),r("The extract_length argument (%s) must be positive or null.",n.toString())),i.slice(s-1,s+n-1)},isExported:!0},tu={description:r("Capitalizes each word in a specified string."),args:[Wr("text_to_capitalize (string)",r("The text which will be returned with the first letter of each word in uppercase and all other letters in lowercase."))],returns:["STRING"],compute:function(e){return Ms(e).replace(Wd,(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()))},isExported:!0},ou={description:r("Replaces part of a text string with different text."),args:[Wr("text (string)",r("The text, a part of which will be replaced.")),Wr("position (number)",r("The position where the replacement will begin (starting from 1).")),Wr("length (number)",r("The number of characters in the text to be replaced.")),Wr("new_text (string)",r("The text which will be inserted into the original text."))],returns:["STRING"],compute:function(e,t,o,i){const s=Is(t,this.locale);xs((()=>s>=1),r("The position (%s) must be greater than or equal to 1.",s.toString()));const n=Ms(e),a=Is(o,this.locale),l=Ms(i);return n.substring(0,s-1)+l+n.substring(s-1+a)},isExported:!0},iu={description:r("A substring from the end of a specified string."),args:[Wr("text (string)",r("The string from which the right portion will be returned.")),Wr("number_of_characters (number, optional)",r("The number of characters to return from the right side of string."))],returns:["STRING"],compute:function(e,...t){const o=t.length?Is(t[0],this.locale):1;xs((()=>o>=0),r("The number_of_characters (%s) must be positive or null.",o.toString()));const i=Ms(e),s=i.length;return i.substring(s-o,s)},isExported:!0},su={description:r("First position of string found in text, ignoring case."),args:[Wr("search_for (string)",r("The string to look for within text_to_search.")),Wr("text_to_search (string)",r("The text to search for the first occurrence of search_for.")),Wr("starting_at (number, default=1)",r("The character within text_to_search at which to start the search."))],returns:["NUMBER"],compute:function(e,t,o=1){const i=Ms(e).toLowerCase(),s=Ms(t).toLowerCase(),n=Is(o,this.locale);xs((()=>""!==s),r("The text_to_search must be non-empty.")),xs((()=>n>=1),r("The starting_at (%s) must be greater than or equal to 1.",n.toString()));const a=s.indexOf(i,n-1);return xs((()=>a>=0),r("In [[FUNCTION_NAME]] evaluation, cannot find '%s' within '%s'.",i,s)),a+1},isExported:!0},ru={description:r("Split text by specific character delimiter(s)."),args:[Wr("text (string)",r("The text to divide.")),Wr("delimiter (string)",r("The character or characters to use to split text.")),Wr("split_by_each (boolean, default=true})",r("Whether or not to divide text around each character contained in delimiter.")),Wr("remove_empty_text (boolean, default=true)",r("Whether or not to remove empty text messages from the split results. The default behavior is to treat consecutive delimiters as one (if TRUE). If FALSE, empty cells values are added between consecutive delimiters."))],returns:["RANGE<STRING>"],compute:function(e,t,o=true,i=true){const s=Ms(e),n=Se(Ms(t)),a=Ds(o),l=Ds(i);xs((()=>n.length>0),r("The _delimiter (%s) must be not be empty.",n));const c=a?new RegExp(`[${n}]`,"g"):new RegExp(n,"g");let h=s.split(c);return l&&(h=h.filter((e=>""!==e))),Ze([h])},isExported:!0},nu={description:r("Replaces existing text with new text in a string."),args:[Wr("text_to_search (string)",r("The text within which to search and replace.")),Wr("search_for (string)",r("The string to search for within text_to_search.")),Wr("replace_with (string)",r("The string that will replace search_for.")),Wr("occurrence_number (number, optional)",r("The instance of search_for within text_to_search to replace with replace_with. By default, all occurrences of search_for are replaced; however, if occurrence_number is specified, only the indicated instance of search_for is replaced."))],returns:["NUMBER"],compute:function(e,t,o,i){const s=Is(i,this.locale);xs((()=>s>=0),r("The occurrenceNumber (%s) must be positive or null.",s.toString()));const n=Ms(e),a=Ms(t);if(""===a)return n;const l=Ms(o),c=new RegExp(Se(a),"g");if(0===s)return n.replace(c,l);let h=0;return n.replace(c,(e=>++h===s?l:e))},isExported:!0},au={description:r("Combines text from multiple strings and/or arrays."),args:[Wr("delimiter (string)",r(" A string, possible empty, or a reference to a valid string. If empty, the text will be simply concatenated.")),Wr("ignore_empty (boolean)",r("A boolean; if TRUE, empty cells selected in the text arguments won't be included in the result.")),Wr("text1 (string, range<string>)",r("Any text item. This could be a string, or an array of strings in a range.")),Wr("text2 (string, range<string>, repeating)",r("Additional text item(s)."))],returns:["STRING"],compute:function(e,t,...o){const i=Ms(e),s=Ds(t);let r=0;return Bs(o,((e,t)=>s&&""===Ms(t)?e:(r++?e+i:"")+Ms(t)),"")},isExported:!0},lu={description:r("Removes space characters."),args:[Wr("text (string)",r("The text or reference to a cell containing text to be trimmed."))],returns:["STRING"],compute:function(e){return Ms(e).trim()},isExported:!0},cu={description:r("Converts a specified string to uppercase."),args:[Wr("text (string)",r("The string to convert to uppercase."))],returns:["STRING"],compute:function(e){return Ms(e).toUpperCase()},isExported:!0},hu={description:r("Converts a number to text according to a specified format."),args:[Wr("number (number)",r("The number, date or time to format.")),Wr("format (string)",r("The pattern by which to format the number, enclosed in quotation marks."))],returns:["STRING"],compute:function(e,t){return fo(Is(e,this.locale),{format:Ms(t),locale:this.locale})},isExported:!0};var du=Object.freeze({__proto__:null,CHAR:Gd,CLEAN:qd,CONCATENATE:Zd,EXACT:Yd,FIND:jd,JOIN:Xd,LEFT:Kd,LEN:Qd,LOWER:Jd,MID:eu,PROPER:tu,REPLACE:ou,RIGHT:iu,SEARCH:su,SPLIT:ru,SUBSTITUTE:nu,TEXTJOIN:au,TRIM:lu,UPPER:cu,TEXT:hu});const uu={description:r("Creates a hyperlink in a cell."),args:[Wr("url (string)",r("The full URL of the link enclosed in quotation marks.")),Wr("link_label (string, optional)",r("The text to display in the cell, enclosed in quotation marks."))],returns:["STRING"],compute:function(e,t){const o=Ms(e).trim(),i=Ms(t)||o;return""===o?i:Ne(i,o)},isExported:!0};var gu=Object.freeze({__proto__:null,HYPERLINK:uu});const pu=[{name:r("Array"),functions:xn},{name:r("Database"),functions:Pl},{name:r("Date"),functions:bc},{name:r("Filter"),functions:wc},{name:r("Financial"),functions:Wh},{name:r("Info"),functions:ed},{name:r("Lookup"),functions:yd},{name:r("Logical"),functions:dd},{name:r("Math"),functions:Na},{name:r("Misc"),functions:In},{name:r("Operator"),functions:$d},{name:r("Statistical"),functions:El},{name:r("Text"),functions:du},{name:r("Engineering"),functions:Sc},{name:r("Web"),functions:gu}],mu=/^[A-Z0-9\_\.]+$/;const fu=new class extends Ji{mapping={};add(e,t){if(e=e.toUpperCase(),!mu.test(e))throw new Error(r("Invalid function name %s. Function names can exclusively contain alphanumerical values separated by dots (.) or underscore (_)",e));const o=Gr(t);return function(e){let t=!1,o=!1,i=!1;for(let s of e){if(s.type.includes("META")&&s.type.length>1)throw new Error(r("Function ${name} has an argument that has been declared with more than one type whose type 'META'. The 'META' type can only be declared alone."));if(t&&!s.repeating)throw new Error(r("Function ${name} has no-repeatable arguments declared after repeatable ones. All repeatable arguments must be declared last."));const e=o||t||i,n=!(s.optional||s.repeating||s.default);if(e&&n)throw new Error(r("Function ${name} has at mandatory arguments declared after optional ones. All optional arguments must be after all mandatory arguments."));t=s.repeating,o=s.optional,i=s.default}}(o.args),this.mapping[e]=function(...e){const t=o.compute.bind(this),i=o.computeFormat?o.computeFormat.bind(this):()=>{},s=t(...function(e){return e.map((e=>{if(void 0!==e)return"function"==typeof e?()=>e()?.value:e.value}))}(e)),r=i(...e);if(Ss(s))return{value:s,format:r};if(!Ss(r))return{value:s,format:r};throw new Error("A format matrix should never be associated with a scalar value")},super.add(e,o),this}};for(let e of pu){const t=e.functions;for(let o in t){const i=t[o];i.category=i.category||e.name,o=o.replace(/_/g,"."),fu.add(o,{isExported:!1,...i})}}class bu{scope;code="";constructor(e=new Su){this.scope=e}append(...e){this.code+=e.map((e=>e.toString())).join("\n")+"\n"}return(e){return new vu(this.scope,this.code,e)}toString(){return Cu(this.code)}}class vu{scope;returnExpression;code;constructor(e,t,o){this.scope=e,this.returnExpression=o,this.code=Cu(t)}toString(){return this.code}wrapInClosure(){const e=this.scope.nextVariableName(),t=new bu(this.scope);return t.append(`const ${e} = () => {`),t.append(this.code),t.append(`return ${this.returnExpression};`),t.append("}"),t.return(e)}assignResultToVariable(){if(this.scope.isAlreadyDeclared(this.returnExpression))return this;const e=this.scope.nextVariableName(),t=new bu(this.scope);return t.append(this.code),t.append(`const ${e} = ${this.returnExpression};`),t.return(e)}}class Su{nextId=1;declaredVariables=new Set;nextVariableName(){const e="_"+this.nextId++;return this.declaredVariables.add(e),e}isAlreadyDeclared(e){return this.declaredVariables.has(e)}}function Cu(e){let t="",o=0;const i=e.split("\n").map((e=>e.trim())).filter((e=>""!==e));for(const e of i)e.startsWith("}")&&o--,t+="\t".repeat(o)+e+"\n",e.endsWith("{")&&o++;return t.trim()}const Eu=["%"],wu="+,-,*,/,:,=,<>,>=,>,<=,<,^,&".split(",").concat(Eu);function xu(e,t=eo){e=Xe(e);const o=new Lu(e),i=[];for(;!o.isOver();){let e=Fu(o)||Tu(o,t)||Ru(o)||Au(o)||Mu(o)||yu(o)||Du(o)||Ou(o,t)||_u(o);e||(e={type:"UNKNOWN",value:o.shift()}),i.push(e)}return i}function yu(e){return"?"===e.current?(e.shift(),{type:"DEBUGGER",value:"?"}):null}const Iu={"(":"LEFT_PAREN",")":"RIGHT_PAREN"};function Ru(e){if(e.current in Iu){const t=e.shift();return{type:Iu[t],value:t}}return null}function Tu(e,t){if(e.current===t.formulaArgSeparator){return{type:"ARG_SEPARATOR",value:e.shift()}}return null}function Au(e){for(let t of wu)if(e.currentStartsWith(t))return e.advanceBy(t.length),{type:"OPERATOR",value:t};return null}function Ou(e,t){const o=e.remaining().match(to(t.decimalSeparator));return o?(e.advanceBy(o[0].length),{type:"NUMBER",value:o[0]}):null}function Mu(e){if('"'===e.current){const t=e.shift();let o=t;for(;e.current&&(e.current!==t||"\\"===o[o.length-1]);)o+=e.shift();return'"'===e.current&&(o+=e.shift()),{type:"STRING",value:o}}return null}const Nu=/\w|\.|!|\$/;function _u(e){let t="";if("'"===e.current){let o=e.shift();for(t+=o;e.current;)if(o=e.shift(),t+=o,"'"===o){if(!e.current||"'"!==e.current)break;o=e.shift(),t+=o}if("'"!==o)return{type:"UNKNOWN",value:t}}for(;e.current&&Nu.test(e.current);)t+=e.shift();if(t.length){const e=t;return Zo.test(e)?{type:"REFERENCE",value:e}:{type:"SYMBOL",value:e}}return null}function Fu(e){let t=0;for(;e.current===fe;)t++,e.shift();if(t)return{type:"SPACE",value:fe.repeat(t)};for(;" "===e.current;)t++,e.shift();return t?{type:"SPACE",value:" ".repeat(t)}:null}function Du(e){return e.currentStartsWith(ee)?(e.advanceBy(ee.length),{type:"INVALID_REFERENCE",value:ee}):null}class Lu{text;currentIndex=0;current;constructor(e){this.text=e,this.current=e[0]}shift(){const e=this.current,t=this.text[++this.currentIndex];return this.current=t,e}advanceBy(e){this.currentIndex+=e,this.current=this.text[this.currentIndex]}isOver(){return this.currentIndex>=this.text.length}remaining(){return this.text.substring(this.currentIndex)}currentStartsWith(e){for(let t=0;t<e.length;t++)if(this.text[this.currentIndex+t]!==e[t])return!1;return!0}}const Pu=/[a-zA-Z0-9\_]+(\.[a-zA-Z0-9\_]+)*/,ku=["-","+"],Uu=["%"],Vu=["*","+","&"],Bu={"^":30,"%":30,"*":20,"/":20,"+":15,"-":15,"&":13,">":10,"<>":10,">=":10,"<":10,"<=":10,"=":10};function zu(e){const t=e.shift();if(!t)throw new h(ue);switch(t.type){case"DEBUGGER":const o=Wu(e,1e3);return o.debug=!0,o;case"NUMBER":return{type:"NUMBER",value:ro(t.value,eo)};case"STRING":return{type:"STRING",value:ve(t.value)};case"INVALID_REFERENCE":throw new u;case"REFERENCE":if(":"===e[0]?.value&&"REFERENCE"===e[1]?.type){e.shift();const o=e.shift();return{type:"REFERENCE",value:`${t.value}:${o?.value}`}}return{type:"REFERENCE",value:t.value};case"SYMBOL":const i=t.value;if("LEFT_PAREN"===e[0]?.type&&Pu.test(t.value)){const t=function(e){$u(e,"LEFT_PAREN",r("Missing opening parenthesis"));const t=e[0];if("RIGHT_PAREN"===t?.type)return $u(e,"RIGHT_PAREN"),[];const o=[];o.push(Hu(e));for(;"RIGHT_PAREN"!==e[0]?.type;)$u(e,"ARG_SEPARATOR",r("Wrong function call")),o.push(Hu(e));return $u(e,"RIGHT_PAREN"),o}(e);return{type:"FUNCALL",value:i,args:t}}const s=i.toUpperCase();if("TRUE"===s||"FALSE"===s)return{type:"BOOLEAN",value:"TRUE"===s};throw new h(r("Invalid formula"));case"LEFT_PAREN":const n=Wu(e);return $u(e,"RIGHT_PAREN",r("Missing closing parenthesis")),n;case"OPERATOR":const a=t.value;if(ku.includes(a))return{type:"UNARY_OPERATION",value:a,operand:Wu(e,Bu[a])};throw new h(r("Unexpected token: %s",t.value));default:throw new h(r("Unexpected token: %s",t.value))}}function Hu(e){const t=e[0];return"ARG_SEPARATOR"===t?.type||"RIGHT_PAREN"===t?.type?{type:"EMPTY",value:""}:Wu(e)}function $u(e,t,o=ue){const i=e.shift();if(!i||i.type!==t)throw new h(o)}function Wu(e,t=0){if(0===e.length)throw new h(ue);let o=zu(e);for(;"OPERATOR"===e[0]?.type&&Bu[e[0].value]>t;){const t=e.shift().value;if(Uu.includes(t))o={type:"UNARY_OPERATION",value:t,operand:o,postfix:!0};else{o={type:"BIN_OPERATION",value:t,left:o,right:Wu(e,Bu[t])}}}return o}function Gu(e){return qu(xu(e))}function qu(e){"="===(e=e.filter((e=>"SPACE"!==e.type)))[0].value&&e.splice(0,1);const t=Wu(e);if(e.length)throw new h(ue);return t}function Zu(e,t,o){return Xu(e,(e=>e.type===t?o(e):e))}function Yu(e){return Array.from(ju(e))}function*ju(e){switch(yield e,e.type){case"FUNCALL":for(const t of e.args)yield*ju(t);break;case"UNARY_OPERATION":yield*ju(e.operand);break;case"BIN_OPERATION":yield*ju(e.left),yield*ju(e.right)}}function Xu(e,t){switch((e=t(e)).type){case"FUNCALL":return{...e,args:e.args.map((e=>Xu(e,t)))};case"UNARY_OPERATION":return{...e,operand:Xu(e.operand,t)};case"BIN_OPERATION":return{...e,right:Xu(e.right,t),left:Xu(e.left,t)};default:return e}}function Ku(e){switch(e.type){case"FUNCALL":const t=e.args.map((e=>Ku(e)));return`${e.value}(${t.join(",")})`;case"NUMBER":return e.value.toString();case"REFERENCE":default:return e.value;case"STRING":return`"${e.value}"`;case"BOOLEAN":return e.value?"TRUE":"FALSE";case"UNARY_OPERATION":return e.postfix?Qu(e)+e.value:e.value+Ju(e);case"BIN_OPERATION":return Qu(e)+e.value+Ju(e)}}function Qu(e){const t=e.value,o="left"in e?e.left:e.operand,i=o.value;return"BIN_OPERATION"===o.type&&Bu[i]<Bu[t]?`(${Ku(o)})`:Ku(o)}function Ju(e){const t=e.value,o="right"in e?e.right:e.operand,i=Bu[o.value],s=Bu[t];let r=!1;return"BIN_OPERATION"!==o.type?r=!1:i<s?r=!0:i!==s||Vu.includes(t)||(r=!0),r?`(${Ku(o)})`:Ku(o)}var eg;!function(e){e[e.LeftRef=0]="LeftRef",e[e.RightRef=1]="RightRef",e[e.Separator=2]="Separator",e[e.FullColumnSeparator=3]="FullColumnSeparator",e[e.FullRowSeparator=4]="FullRowSeparator",e[e.RightColumnRef=5]="RightColumnRef",e[e.RightRowRef=6]="RightRowRef",e[e.Found=7]="Found"}(eg||(eg={}));const tg=(e,t=(()=>!0))=>[{goTo:e,guard:t}],og=(e,t=(()=>!0))=>({goTo:e,guard:t}),ig={[eg.LeftRef]:{REFERENCE:tg(eg.Separator),NUMBER:tg(eg.FullRowSeparator),SYMBOL:[og(eg.FullColumnSeparator,(e=>Yo(e.value))),og(eg.FullRowSeparator,(e=>jo(e.value)))]},[eg.FullColumnSeparator]:{SPACE:tg(eg.FullColumnSeparator),OPERATOR:tg(eg.RightColumnRef,(e=>":"===e.value))},[eg.FullRowSeparator]:{SPACE:tg(eg.FullRowSeparator),OPERATOR:tg(eg.RightRowRef,(e=>":"===e.value))},[eg.Separator]:{SPACE:tg(eg.Separator),OPERATOR:tg(eg.RightRef,(e=>":"===e.value))},[eg.RightRef]:{SPACE:tg(eg.RightRef),NUMBER:tg(eg.Found),REFERENCE:tg(eg.Found,(e=>Qo(e.value))),SYMBOL:tg(eg.Found,(e=>Xo(e.value)||Ko(e.value)))},[eg.RightColumnRef]:{SPACE:tg(eg.RightColumnRef),SYMBOL:tg(eg.Found,(e=>Xo(e.value))),REFERENCE:tg(eg.Found,(e=>Qo(e.value)))},[eg.RightRowRef]:{SPACE:tg(eg.RightRowRef),NUMBER:tg(eg.Found),REFERENCE:tg(eg.Found,(e=>Qo(e.value))),SYMBOL:tg(eg.Found,(e=>Ko(e.value)))},[eg.Found]:{}};function sg(e){let t=0,o=ig[eg.LeftRef],i="";for(;void 0!==o;){const s=e[t++];if(!s)return null;const r=o[s.type]?.find((e=>e.guard(s))),n=r?r.goTo:void 0;switch(n){case void 0:return null;case eg.Found:return i+=s.value,e.splice(0,t),{type:"REFERENCE",value:i};default:o=ig[n],i+=s.value}}return null}function rg(e,t=eo){const o=xu(e,t),i=[];for(;o.length;)i.push(sg(o)||o.shift());return i}const ng=fu.content,ag={"=":"EQ","+":"ADD","-":"MINUS","*":"MULTIPLY","/":"DIVIDE",">=":"GTE","<>":"NE",">":"GT","<=":"LTE","<":"LT","^":"POWER","&":"CONCATENATE"},lg={"-":"UMINUS","+":"UPLUS","%":"UNARY.PERCENT"},cg={};function hg(e){const t=rg(e),{dependencies:o,constantValues:i}=function(e){const t={numbers:[],strings:[]},o=[];for(const i of e)switch(i.type){case"INVALID_REFERENCE":case"REFERENCE":o.push(i.value);break;case"STRING":const e=ve(i.value);t.strings.includes(e)||t.strings.push(e);break;case"NUMBER":{const e=ro(i.value,eo);t.numbers.includes(e)||t.numbers.push(e);break}}return{dependencies:o,constantValues:t}}(t),s=function(e,t,o){return Be(e.map((e=>{switch(e.type){case"STRING":const i=ve(e.value);return`|S${o.strings.indexOf(i)}|`;case"NUMBER":return`|N${o.numbers.indexOf(ro(e.value,eo))}|`;case"REFERENCE":case"INVALID_REFERENCE":return`|${t.indexOf(e.value)}|`;case"SPACE":return"";default:return e.value}})))}(t,o,i);if(!cg[s]){const n=qu([...t]),a=new Su;if("BIN_OPERATION"===n.type&&":"===n.value)throw new h(r("Invalid formula"));if("EMPTY"===n.type)throw new h(r("Invalid formula"));const l=g(n),c=new bu;c.append(`// ${s}`),c.append(l),c.append(`return ${l.returnExpression};`);let d=new Function("deps","ref","range","ctx",c.toString());function u(e){const{args:t}=e,o=e.value.toUpperCase(),i=ng[o];if(!i)throw new p(e.value);!function(e){const t=e.args.length,o=e.value.toUpperCase(),i=ng[o];if(t<i.minArgRequired)throw new h(r("Invalid number of arguments for the %s function. Expected %s minimum, but got %s instead.",o,i.minArgRequired.toString(),t.toString()));if(t>i.maxArgPossible)throw new h(r("Invalid number of arguments for the %s function. Expected %s maximum, but got %s instead.",o,i.maxArgPossible.toString(),t.toString()));const s=i.nbrArgRepeating;if(s>1){const e=i.args.length-s;if((t-e)%s!=0)throw new h(r("Invalid number of arguments for the %s function. Expected all arguments after position %s to be supplied by groups of %s arguments",o,e.toString(),s.toString()))}}(e);const s=[];for(let e=0;e<t.length;e++){const n=i.getArgToFocus(e+1)-1,a=i.args[n],l=t[e],c=a.type||[],d=c.includes("META"),u=a.lazy,p=c.some((e=>dg(e))),m=c.every((e=>dg(e)));if(m&&!ug(l))throw new h(r("Function %s expects the parameter %s to be reference to a cell or range, not a %s.",o,(e+1).toString(),l.type.toLowerCase()));const f=g(l,d,p,{functionName:o,paramIndex:e+1});s.push(u?f.wrapInClosure():f)}return s}function g(e,t=!1,s=!1,n={}){const l=new bu(a);if("REFERENCE"!==e.type&&("BIN_OPERATION"!==e.type||":"!==e.value)&&t)throw new h(r("Argument must be a reference to a cell or range."));switch(e.debug&&l.append("debugger;"),e.type){case"BOOLEAN":return l.return(`{ value: ${e.value} }`);case"NUMBER":return l.return(`{ value: this.constantValues.numbers[${i.numbers.indexOf(e.value)}] }`);case"STRING":return l.return(`{ value: this.constantValues.strings[${i.strings.indexOf(e.value)}] }`);case"REFERENCE":const r=o.indexOf(e.value);return s?l.return(`range(deps[${r}])`):l.return(`ref(deps[${r}], ${t?"true":"false"}, "${n.functionName||ag["="]}", ${n.paramIndex})`);case"FUNCALL":const a=u(e).map((e=>e.assignResultToVariable()));l.append(...a);const c=e.value.toUpperCase();return l.append(`ctx.__lastFnCalled = '${c}';`),l.return(`ctx['${c}'](${a.map((e=>e.returnExpression))})`);case"UNARY_OPERATION":{const t=lg[e.value],o=g(e.operand,!1,!1,{functionName:t}).assignResultToVariable();return l.append(o),l.append(`ctx.__lastFnCalled = '${t}';`),l.return(`ctx['${t}'](${o.returnExpression})`)}case"BIN_OPERATION":{const t=ag[e.value],o=g(e.left,!1,!1,{functionName:t}).assignResultToVariable(),i=g(e.right,!1,!1,{functionName:t}).assignResultToVariable();return l.append(o),l.append(i),l.append(`ctx.__lastFnCalled = '${t}';`),l.return(`ctx['${t}'](${o.returnExpression}, ${i.returnExpression})`)}case"EMPTY":return l.return("undefined")}}cg[s]={execute:d}}return{execute:cg[s].execute,dependencies:o,constantValues:i,tokens:t}}function dg(e){return e.startsWith("RANGE")}function ug(e){if("REFERENCE"===e.type)return!0;if("FUNCALL"===e.type){const t=ng[e.value.toUpperCase()];return t&&dg(t.returns[0])}return!1}function gg(e,t){return function(e){let t=[],o="";return e.map(((e,i)=>{switch(["SPACE","LEFT_PAREN"].includes(e.type)||(o=""),e.type){case"SYMBOL":o=e.value;break;case"LEFT_PAREN":t.push({parent:o,argPosition:0}),o="";break;case"RIGHT_PAREN":t.pop();break;case"ARG_SEPARATOR":t.length&&t[t.length-1].argPosition++}if(t.length){const o=t[t.length-1];o.parent&&(e.functionContext=Object.assign({},o))}return e}))}(function(e){let t=1;const o=[];return e.map((e=>("LEFT_PAREN"===e.type?(o.push(t),e.parenIndex=t,t++):"RIGHT_PAREN"===e.type&&(e.parenIndex=o.pop()),e)))}(function(e){let t=0;return e.map((e=>{const o=e.value.toString().length,i=Object.assign({},e,{start:t,end:t+o,length:o});return t=i.end,i}))}(rg(e,t))))}const pg=fu.content;function mg(e){try{return 0===Yu(qu(e)).filter((e=>"FUNCALL"===e.type&&!pg[e.value.toUpperCase()]?.isExported)).length}catch(e){return!1}}function fg(e){if(!e||"object"!=typeof e||"string"!=typeof e.name||"string"!=typeof e.code||"string"!=typeof e.thousandsSeparator||"string"!=typeof e.decimalSeparator||"string"!=typeof e.dateFormat||"string"!=typeof e.timeFormat||"string"!=typeof e.formulaArgSeparator)return!1;if(!Object.values(e).every((e=>e)))return!1;if(e.formulaArgSeparator===e.decimalSeparator)return!1;if(e.thousandsSeparator===e.decimalSeparator)return!1;try{fo(1,{locale:e,format:"#,##0.00"}),fo(1,{locale:e,format:e.dateFormat}),fo(1,{locale:e,format:e.timeFormat})}catch{return!1}return!0}function bg(e,t){return e.startsWith("=")?Cg(e,t):xg(e,t)}function vg(e,t){return e.startsWith("=")?Cg(e,t):function(e,t){if(Pt(e,t)){const o=Is(e,t);let i=eo.dateFormat;return Number.isInteger(o)||(i+=" "+eo.timeFormat),fo(o,{locale:eo,format:i})}return xg(e,t)}(e,t)}function Sg(e,t){return e.startsWith("=")?Eg(e,t):function(e,t){if(Pt(e,eo)){const o=Is(e,eo);let i=t.dateFormat;return Number.isInteger(o)||(i+=" "+t.timeFormat),fo(o,{locale:t,format:i})}return function(e,t){if("."===t.decimalSeparator||!io(e,eo))return e;const o=Ao(eo),i=e.replace(o,(e=>e.replace(".",t.decimalSeparator)));return i}(e,t)}(e,t)}function Cg(e,t){return wg(e,t,eo)}function Eg(e,t){return wg(e,eo,t)}function wg(e,t,o){if(t.formulaArgSeparator===o.formulaArgSeparator&&t.decimalSeparator===o.decimalSeparator)return e;const i=xu(e,t);let s="";for(const e of i)"NUMBER"===e.type?s+=e.value.replace(t.decimalSeparator,o.decimalSeparator):"ARG_SEPARATOR"===e.type?s+=o.formulaArgSeparator:s+=e.value;return s}function xg(e,t){return"."!==t.decimalSeparator&&io(e,t)?e.replace(t.thousandsSeparator,"").replace(t.decimalSeparator,"."):e}function yg(e,t){return Rg(e,(e=>vg(e,t)))}function Ig(e,t){return Rg(e,(e=>Sg(e,t)))}function Rg(e,t){switch((e=Ce(e)).type){case"CellIsRule":switch(e.operator){case"Between":case"NotBetween":case"Equal":case"NotEqual":case"GreaterThan":case"GreaterThanOrEqual":case"LessThan":case"LessThanOrEqual":return e.values=e.values.map((e=>t(e))),e;case"BeginsWith":case"ContainsText":case"EndsWith":case"NotContains":case"IsEmpty":case"IsNotEmpty":return e}break;case"ColorScaleRule":return e.minimum=Tg(e.minimum,t),e.maximum=Tg(e.maximum,t),e.midpoint&&(e.midpoint=Tg(e.midpoint,t)),e;case"IconSetRule":return e.lowerInflectionPoint.value=t(e.lowerInflectionPoint.value),e.upperInflectionPoint.value=t(e.upperInflectionPoint.value),e}}function Tg(e,t){if(!e?.value)return e;const o=t("formula"===e.type?"="+e.value:e.value),i="formula"===e.type?o.slice(1):o;return{...e,value:i}}const Ag={name:r("Link sheet"),children:[e=>e.model.getters.getSheetIds().map((t=>e.model.getters.getSheet(t))).map((e=>({id:e.id,name:e.name,execute:()=>Ne(e.name,Le(e.id))})))]},Og={name:r("Delete"),isVisible:e=>e.model.getters.getSheetIds().length>1,execute:e=>e.askConfirmation(r("Are you sure you want to delete this sheet?"),(()=>{e.model.dispatch("DELETE_SHEET",{sheetId:e.model.getters.getActiveSheetId()})}))},Mg={name:r("Duplicate"),execute:e=>{const t=e.model.getters.getActiveSheetId(),o=e.model.uuidGenerator.uuidv4();e.model.dispatch("DUPLICATE_SHEET",{sheetId:t,sheetIdTo:o}),e.model.dispatch("ACTIVATE_SHEET",{sheetIdFrom:t,sheetIdTo:o})}},Ng=e=>({name:r("Rename"),execute:e.renameSheetCallback}),_g={name:r("Move right"),isVisible:e=>{const t=e.model.getters.getActiveSheetId(),o=e.model.getters.getVisibleSheetIds();return o.indexOf(t)!==o.length-1},execute:e=>e.model.dispatch("MOVE_SHEET",{sheetId:e.model.getters.getActiveSheetId(),delta:1})},Fg={name:r("Move left"),isVisible:e=>{const t=e.model.getters.getActiveSheetId();return e.model.getters.getVisibleSheetIds()[0]!==t},execute:e=>e.model.dispatch("MOVE_SHEET",{sheetId:e.model.getters.getActiveSheetId(),delta:-1})},Dg={name:r("Hide sheet"),isVisible:e=>1!==e.model.getters.getVisibleSheetIds().length,execute:e=>e.model.dispatch("HIDE_SHEET",{sheetId:e.model.getters.getActiveSheetId()})};function Lg(e){return e.map(kg).sort(((e,t)=>e.sequence-t.sequence))}const Pg=new Bi;function kg(e){const t=e.name,o=e.children,i=e.description,s=e.icon;return{id:e.id||Pg.uuidv4(),name:"function"==typeof t?t:()=>t,isVisible:e.isVisible?e.isVisible:()=>!0,isEnabled:e.isEnabled?e.isEnabled:()=>!0,isActive:e.isActive,execute:e.execute,children:o?e=>o.map((t=>"function"==typeof t?t(e):t)).flat().map(kg):()=>[],isReadonlyAllowed:e.isReadonlyAllowed||!1,separator:e.separator||!1,icon:"function"==typeof s?s:()=>s||"",description:"function"==typeof i?i:()=>i||"",textColor:e.textColor,sequence:e.sequence||0}}class Ug extends Ji{add(e,t){return void 0===t.id&&(t.id=e),this.content[e]=t,this}addChild(e,t,o){"function"!=typeof o&&void 0===o.id&&(o.id=e);const i=t.splice(0,1)[0];let s=this.content[i];if(!s)throw new Error(`Path ${i+":"+t.join(":")} not found`);for(let e of t){const o=s.children;if(!o||"function"==typeof o)throw new Error(`${e} is either not a node or it's dynamically computed`);if(s=o.find((t=>t.id===e)),!s)throw new Error(`Path ${i+":"+t.join(":")} not found`)}return s.children||(s.children=[]),s.children.push(o),this}getMenuItems(){return Lg(this.getAll())}}const Vg=new Ug;Vg.add("sheet",{...Ag,sequence:10});Wi`
|
|
279
279
|
.o-link-editor {
|
|
280
280
|
font-size: 13px;
|
|
281
281
|
background-color: white;
|
|
@@ -2538,4 +2538,4 @@
|
|
|
2538
2538
|
<tableParts count="${e.filterTables.length}">
|
|
2539
2539
|
${CE(a)}
|
|
2540
2540
|
</tableParts>
|
|
2541
|
-
`}var tI;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(tI||(tI={}));function oI(e,t={}){const o=Ce(t);return o.type=e,o}const iI={},sI={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:F,HEADER_WIDTH:D,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:L,DEFAULT_CELL_HEIGHT:P,SCROLLBAR_WIDTH:k},rI={autofillModifiersRegistry:hr,autofillRulesRegistry:dr,cellMenuRegistry:yf,colMenuRegistry:Wb,linkMenuRegistry:Vg,functionRegistry:fu,featurePluginRegistry:Tx,statefulUIPluginRegistry:Ax,coreViewsPluginRegistry:Ox,corePluginRegistry:Rx,rowMenuRegistry:Zb,sidePanelRegistry:Av,figureRegistry:Qp,chartSidePanelComponentRegistry:mv,chartComponentRegistry:Zp,chartRegistry:qp,topbarMenuRegistry:Yb,topbarComponentRegistry:Ov,clickableCellRegistry:Mx,otRegistry:jb,inverseCommandRegistry:om,urlRegistry:ts,cellPopoverRegistry:Hg,numberFormatMenuRegistry:Gb,repeatLocalCommandTransformRegistry:cx,repeatCommandTransformRegistry:lx},nI={arg:Wr,toBoolean:Ds,toJsDate:Ls,toNumber:Is,toString:Ms,toXC:xt,toZone:ti,toCartesian:wt,numberToLetters:bt,UuidGenerator:Bi,formatValue:fo,createCurrencyFormat:_o,computeTextWidth:Fi,createEmptyWorkbookData:ZE,createEmptySheet:qE,createEmptyExcelSheet:YE,getDefaultChartJsRuntime:Cp,chartFontColor:ip,ChartColors:op,EvaluationError:c,CellErrorLevel:l,getFillingMode:yp,rgbaToHex:dt,colorToRGBA:ut,positionToZone:wi,isDefined:ke,lazy:ze,genericRepeat:hx},aI={isMarkdownLink:Oe,parseMarkdownLink:_e,markdownLink:Ne,openLink:ns,urlRepresentation:rs},lI={ChartPanel:fv,ChartFigure:jp,ChartJsComponent:zi,Grid:yS,GridOverlay:lS,ScorecardChart:Xi,LineConfigPanel:uv,LineBarPieDesignPanel:cv,BarConfigPanel:ov,LineBarPieConfigPanel:tv,GaugeChartConfigPanel:hv,GaugeChartDesignPanel:dv,ScorecardChartConfigPanel:gv,ScorecardChartDesignPanel:pv,FigureComponent:Mv};const cI={DEFAULT_LOCALE:eo};e.AbstractChart=Wg,e.CorePlugin=XE,e.DispatchResult=fs,e.EvaluationError=c,e.Model=class extends $w{corePlugins=[];featurePlugins=[];statefulUIPlugins=[];coreViewsPlugins=[];range;session;isReplayingCommand=!1;renderers=[];status=0;config;corePluginConfig;uiPluginConfig;state;selection;getters;coreGetters;uuidGenerator;handlers=[];uiHandlers=[];coreHandlers=[];constructor(e={},o={},i=[],s=new Bi,r=!0){super(),i=$E(e,i);const n=zE(e,r);this.state=new gy,this.uuidGenerator=s,this.config=this.setupConfig(o),this.session=this.setupSession(n.revisionId),this.coreGetters={},this.range=new iw(this.coreGetters),this.coreGetters.getRangeString=this.range.getRangeString.bind(this.range),this.coreGetters.getRangeFromSheetXC=this.range.getRangeFromSheetXC.bind(this.range),this.coreGetters.createAdaptedRanges=this.range.createAdaptedRanges.bind(this.range),this.coreGetters.getRangeDataFromXc=this.range.getRangeDataFromXc.bind(this.range),this.coreGetters.getRangeDataFromZone=this.range.getRangeDataFromZone.bind(this.range),this.coreGetters.getRangeFromRangeData=this.range.getRangeFromRangeData.bind(this.range),this.coreGetters.getRangeFromZone=this.range.getRangeFromZone.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new uy(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of Rx.getAll())this.setupCorePlugin(e,n);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(i);for(let e of Ox.getAll()){const t=this.setupUiPlugin(e);this.coreViewsPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t),this.coreHandlers.push(t)}for(let e of Ax.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of Tx.getAll()){const t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}this.uuidGenerator.setIsFastStrategy(!1),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.joinSession(),o.snapshotRequested&&(this.session.snapshot(this.exportData()),this.garbageCollectExternalResources()),t.markRaw(this)}joinSession(){this.session.join(this.config.client)}leaveSession(){this.session.leave()}setupUiPlugin(e){const t=new e(this.uiPluginConfig);for(let o of e.getters){if(!(o in t))throw new Error(`Invalid getter name: ${o} for plugin ${t.constructor}`);if(o in this.getters)throw new Error(`Getter "${o}" is already defined.`);this.getters[o]=t[o].bind(t)}const o=e.layers.map((e=>[t,e]));return this.renderers.push(...o),this.renderers.sort(((e,t)=>e[1]-t[1])),t}setupCorePlugin(e,t){const o=new e(this.corePluginConfig);for(let t of e.getters){if(!(t in o))throw new Error(`Invalid getter name: ${t} for plugin ${o.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=o[t].bind(o)}o.import(t),this.corePlugins.push(o),this.coreHandlers.push(o),this.handlers.push(o)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.statefulUIPlugins,t),this.status=e}this.finalize()}setupSession(e){return new Qw(cy({initialRevisionId:e,recordChanges:this.state.recordChanges.bind(this.state),dispatch:e=>{this.checkDispatchAllowed(e).isSuccessful&&(this.isReplayingCommand=!0,this.dispatchToHandlers(this.coreHandlers,e),this.isReplayingCommand=!1)}}),this.config.transportService,e)}setupSessionEvents(){this.session.on("remote-revision-received",this,this.onRemoteRevisionReceived),this.session.on("revision-undone",this,(({commands:e})=>{this.dispatchFromCorePlugin("UNDO",{commands:e}),this.finalize()})),this.session.on("revision-redone",this,(({commands:e})=>{this.dispatchFromCorePlugin("REDO",{commands:e}),this.finalize()})),this.session.on("unexpected-revision-id",this,(()=>this.trigger("unexpected-revision-id"))),this.session.on("collaborative-event-received",this,(()=>{this.trigger("update")}))}setupConfig(e){const t=e.client||{id:this.uuidGenerator.uuidv4(),name:r("Anonymous").toString()},o=e.transportService||new ey;return{...e,mode:e.mode||"normal",custom:e.custom||{},defaultCurrencyFormat:e.defaultCurrencyFormat||"[$$]#,##0.00",external:this.setupExternalConfig(e.external||{}),transportService:o,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e)}}setupExternalConfig(e){const t=e.loadLocales||(()=>Promise.resolve(Jt));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,uuidGenerator:this.uuidGenerator,custom:this.config.custom,external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,session:this.session}}checkDispatchAllowed(e){const t=ms(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>0!==e))?new fs(t.flat()):fs.Success}checkDispatchAllowedCoreCommand(e){const t=this.corePlugins.map((t=>t.allowDispatch(e)));return t.push(this.range.allowDispatch(e)),t}checkDispatchAllowedLocalCommand(e){return this.uiHandlers.map((t=>t.allowDispatch(e)))}finalize(){this.status=3;for(const e of this.handlers)e.finalize();this.status=0}canDispatch=(e,t)=>this.checkDispatchAllowed(oI(e,t));dispatch=(e,t)=>{const o=oI(e,t);let i=this.status;if(this.getters.isReadonly()&&(s=o,!gs.has(s.type)))return new fs(70);var s;if(!this.session.canApplyOptimisticUpdate())return new fs(67);switch(i){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return t;this.status=1;const{changes:i,commands:s}=this.state.recordChanges((()=>{ms(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize()}));this.session.save(o,s,i),this.status=0,this.trigger("update");break;case 1:if(ms(o)){const e=this.checkDispatchAllowed(o);if(!e.isSuccessful)return e;this.state.addCommand(o)}this.dispatchToHandlers(this.handlers,o);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(ms(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return fs.Success};dispatchFromCorePlugin=(e,t)=>{const o=oI(e,t),i=this.status;this.status=2;const s=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(s,o),this.status=i,fs.Success};dispatchToHandlers(e,t){for(const o of e)o.beforeHandle(t);for(const o of e)o.handle(t)}drawGrid(e){for(let[t,o]of this.renderers)e.ctx.save(),t.drawGrid(e,o),e.ctx.restore()}exportData(){let e=ZE();for(let t of this.handlers)t instanceof XE&&t.export(e);return e.revisionId=this.session.getRevisionId()||te,e=Ce(e),e}updateMode(e){"normal"!==e&&this.dispatch("STOP_EDITION",{cancel:!0}),this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...ZE(),sheets:[YE(BE,"Sheet1")]};for(let t of this.handlers)t instanceof jE&&t.exportForExcel(e);return e=Ce(e),Jy(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.Registry=Ji,e.Revision=Xw,e.SPREADSHEET_DIMENSIONS=sI,e.Spreadsheet=Jx,e.UIPlugin=sw,e.__info__=iI,e.addFunction=function(e,t){fu.add(e,t)},e.astToFormula=Ku,e.compile=hg,e.components=lI,e.constants=cI,e.convertAstNodes=Zu,e.coreTypes=ps,e.findCellInNewZone=Ci,e.functionCache=cg,e.helpers=nI,e.invalidateCFEvaluationCommands=us,e.invalidateDependenciesCommands=ds,e.invalidateEvaluationCommands=hs,e.iterateAstNodes=Yu,e.links=aI,e.load=zE,e.parse=Gu,e.readonlyAllowedCommands=gs,e.registries=rI,e.setDefaultSheetViewSize=function(e){pe=e},e.setTranslationMethod=function(e){o=e},e.tokenize=xu,Object.defineProperty(e,"__esModule",{value:!0}),iI.version="16.4.32",iI.date="2024-05-07T10:38:24.733Z",iI.hash="314d75d"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
|
|
2541
|
+
`}var tI;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(tI||(tI={}));function oI(e,t={}){const o=Ce(t);return o.type=e,o}const iI={},sI={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:F,HEADER_WIDTH:D,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:L,DEFAULT_CELL_HEIGHT:P,SCROLLBAR_WIDTH:k},rI={autofillModifiersRegistry:hr,autofillRulesRegistry:dr,cellMenuRegistry:yf,colMenuRegistry:Wb,linkMenuRegistry:Vg,functionRegistry:fu,featurePluginRegistry:Tx,statefulUIPluginRegistry:Ax,coreViewsPluginRegistry:Ox,corePluginRegistry:Rx,rowMenuRegistry:Zb,sidePanelRegistry:Av,figureRegistry:Qp,chartSidePanelComponentRegistry:mv,chartComponentRegistry:Zp,chartRegistry:qp,topbarMenuRegistry:Yb,topbarComponentRegistry:Ov,clickableCellRegistry:Mx,otRegistry:jb,inverseCommandRegistry:om,urlRegistry:ts,cellPopoverRegistry:Hg,numberFormatMenuRegistry:Gb,repeatLocalCommandTransformRegistry:cx,repeatCommandTransformRegistry:lx},nI={arg:Wr,toBoolean:Ds,toJsDate:Ls,toNumber:Is,toString:Ms,toXC:xt,toZone:ti,toCartesian:wt,numberToLetters:bt,UuidGenerator:Bi,formatValue:fo,createCurrencyFormat:_o,computeTextWidth:Fi,createEmptyWorkbookData:ZE,createEmptySheet:qE,createEmptyExcelSheet:YE,getDefaultChartJsRuntime:Cp,chartFontColor:ip,ChartColors:op,EvaluationError:c,CellErrorLevel:l,getFillingMode:yp,rgbaToHex:dt,colorToRGBA:ut,positionToZone:wi,isDefined:ke,lazy:ze,genericRepeat:hx},aI={isMarkdownLink:Oe,parseMarkdownLink:_e,markdownLink:Ne,openLink:ns,urlRepresentation:rs},lI={ChartPanel:fv,ChartFigure:jp,ChartJsComponent:zi,Grid:yS,GridOverlay:lS,ScorecardChart:Xi,LineConfigPanel:uv,LineBarPieDesignPanel:cv,BarConfigPanel:ov,LineBarPieConfigPanel:tv,GaugeChartConfigPanel:hv,GaugeChartDesignPanel:dv,ScorecardChartConfigPanel:gv,ScorecardChartDesignPanel:pv,FigureComponent:Mv};const cI={DEFAULT_LOCALE:eo};e.AbstractChart=Wg,e.CorePlugin=XE,e.DispatchResult=fs,e.EvaluationError=c,e.Model=class extends $w{corePlugins=[];featurePlugins=[];statefulUIPlugins=[];coreViewsPlugins=[];range;session;isReplayingCommand=!1;renderers=[];status=0;config;corePluginConfig;uiPluginConfig;state;selection;getters;coreGetters;uuidGenerator;handlers=[];uiHandlers=[];coreHandlers=[];constructor(e={},o={},i=[],s=new Bi,r=!0){super(),i=$E(e,i);const n=zE(e,r);this.state=new gy,this.uuidGenerator=s,this.config=this.setupConfig(o),this.session=this.setupSession(n.revisionId),this.coreGetters={},this.range=new iw(this.coreGetters),this.coreGetters.getRangeString=this.range.getRangeString.bind(this.range),this.coreGetters.getRangeFromSheetXC=this.range.getRangeFromSheetXC.bind(this.range),this.coreGetters.createAdaptedRanges=this.range.createAdaptedRanges.bind(this.range),this.coreGetters.getRangeDataFromXc=this.range.getRangeDataFromXc.bind(this.range),this.coreGetters.getRangeDataFromZone=this.range.getRangeDataFromZone.bind(this.range),this.coreGetters.getRangeFromRangeData=this.range.getRangeFromRangeData.bind(this.range),this.coreGetters.getRangeFromZone=this.range.getRangeFromZone.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new uy(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of Rx.getAll())this.setupCorePlugin(e,n);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(i);for(let e of Ox.getAll()){const t=this.setupUiPlugin(e);this.coreViewsPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t),this.coreHandlers.push(t)}for(let e of Ax.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of Tx.getAll()){const t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}this.uuidGenerator.setIsFastStrategy(!1),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.joinSession(),o.snapshotRequested&&(this.session.snapshot(this.exportData()),this.garbageCollectExternalResources()),t.markRaw(this)}joinSession(){this.session.join(this.config.client)}leaveSession(){this.session.leave()}setupUiPlugin(e){const t=new e(this.uiPluginConfig);for(let o of e.getters){if(!(o in t))throw new Error(`Invalid getter name: ${o} for plugin ${t.constructor}`);if(o in this.getters)throw new Error(`Getter "${o}" is already defined.`);this.getters[o]=t[o].bind(t)}const o=e.layers.map((e=>[t,e]));return this.renderers.push(...o),this.renderers.sort(((e,t)=>e[1]-t[1])),t}setupCorePlugin(e,t){const o=new e(this.corePluginConfig);for(let t of e.getters){if(!(t in o))throw new Error(`Invalid getter name: ${t} for plugin ${o.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=o[t].bind(o)}o.import(t),this.corePlugins.push(o),this.coreHandlers.push(o),this.handlers.push(o)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.statefulUIPlugins,t),this.status=e}this.finalize()}setupSession(e){return new Qw(cy({initialRevisionId:e,recordChanges:this.state.recordChanges.bind(this.state),dispatch:e=>{this.checkDispatchAllowed(e).isSuccessful&&(this.isReplayingCommand=!0,this.dispatchToHandlers(this.coreHandlers,e),this.isReplayingCommand=!1)}}),this.config.transportService,e)}setupSessionEvents(){this.session.on("remote-revision-received",this,this.onRemoteRevisionReceived),this.session.on("revision-undone",this,(({commands:e})=>{this.dispatchFromCorePlugin("UNDO",{commands:e}),this.finalize()})),this.session.on("revision-redone",this,(({commands:e})=>{this.dispatchFromCorePlugin("REDO",{commands:e}),this.finalize()})),this.session.on("unexpected-revision-id",this,(()=>this.trigger("unexpected-revision-id"))),this.session.on("collaborative-event-received",this,(()=>{this.trigger("update")}))}setupConfig(e){const t=e.client||{id:this.uuidGenerator.uuidv4(),name:r("Anonymous").toString()},o=e.transportService||new ey;return{...e,mode:e.mode||"normal",custom:e.custom||{},defaultCurrencyFormat:e.defaultCurrencyFormat||"[$$]#,##0.00",external:this.setupExternalConfig(e.external||{}),transportService:o,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e)}}setupExternalConfig(e){const t=e.loadLocales||(()=>Promise.resolve(Jt));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,uuidGenerator:this.uuidGenerator,custom:this.config.custom,external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,session:this.session}}checkDispatchAllowed(e){const t=ms(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>0!==e))?new fs(t.flat()):fs.Success}checkDispatchAllowedCoreCommand(e){const t=this.corePlugins.map((t=>t.allowDispatch(e)));return t.push(this.range.allowDispatch(e)),t}checkDispatchAllowedLocalCommand(e){return this.uiHandlers.map((t=>t.allowDispatch(e)))}finalize(){this.status=3;for(const e of this.handlers)e.finalize();this.status=0}canDispatch=(e,t)=>this.checkDispatchAllowed(oI(e,t));dispatch=(e,t)=>{const o=oI(e,t);let i=this.status;if(this.getters.isReadonly()&&(s=o,!gs.has(s.type)))return new fs(70);var s;if(!this.session.canApplyOptimisticUpdate())return new fs(67);switch(i){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return t;this.status=1;const{changes:i,commands:s}=this.state.recordChanges((()=>{ms(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize()}));this.session.save(o,s,i),this.status=0,this.trigger("update");break;case 1:if(ms(o)){const e=this.checkDispatchAllowed(o);if(!e.isSuccessful)return e;this.state.addCommand(o)}this.dispatchToHandlers(this.handlers,o);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(ms(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return fs.Success};dispatchFromCorePlugin=(e,t)=>{const o=oI(e,t),i=this.status;this.status=2;const s=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(s,o),this.status=i,fs.Success};dispatchToHandlers(e,t){for(const o of e)o.beforeHandle(t);for(const o of e)o.handle(t)}drawGrid(e){for(let[t,o]of this.renderers)e.ctx.save(),t.drawGrid(e,o),e.ctx.restore()}exportData(){let e=ZE();for(let t of this.handlers)t instanceof XE&&t.export(e);return e.revisionId=this.session.getRevisionId()||te,e=Ce(e),e}updateMode(e){"normal"!==e&&this.dispatch("STOP_EDITION",{cancel:!0}),this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...ZE(),sheets:[YE(BE,"Sheet1")]};for(let t of this.handlers)t instanceof jE&&t.exportForExcel(e);return e=Ce(e),Jy(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.Registry=Ji,e.Revision=Xw,e.SPREADSHEET_DIMENSIONS=sI,e.Spreadsheet=Jx,e.UIPlugin=sw,e.__info__=iI,e.addFunction=function(e,t){fu.add(e,t)},e.astToFormula=Ku,e.compile=hg,e.components=lI,e.constants=cI,e.convertAstNodes=Zu,e.coreTypes=ps,e.findCellInNewZone=Ci,e.functionCache=cg,e.helpers=nI,e.invalidateCFEvaluationCommands=us,e.invalidateDependenciesCommands=ds,e.invalidateEvaluationCommands=hs,e.iterateAstNodes=Yu,e.links=aI,e.load=zE,e.parse=Gu,e.readonlyAllowedCommands=gs,e.registries=rI,e.setDefaultSheetViewSize=function(e){pe=e},e.setTranslationMethod=function(e){o=e},e.tokenize=xu,Object.defineProperty(e,"__esModule",{value:!0}),iI.version="16.4.33",iI.date="2024-05-15T09:17:20.683Z",iI.hash="53b07e5"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
|
package/dist/o_spreadsheet.xml
CHANGED
|
@@ -3958,7 +3958,7 @@ https://fontawesome.com/license -->
|
|
|
3958
3958
|
</t>
|
|
3959
3959
|
</odoo>
|
|
3960
3960
|
<!--
|
|
3961
|
-
__info__.version = '16.4.
|
|
3962
|
-
__info__.date = '2024-05-
|
|
3963
|
-
__info__.hash = '
|
|
3961
|
+
__info__.version = '16.4.33';
|
|
3962
|
+
__info__.date = '2024-05-15T09:17:47.341Z';
|
|
3963
|
+
__info__.hash = '53b07e5';
|
|
3964
3964
|
-->
|