@dxos/plugin-sheet 0.7.2 → 0.7.3-staging.971cd8d

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.
Files changed (128) hide show
  1. package/dist/lib/browser/{SheetContainer-YAMIOFC6.mjs → SheetContainer-KCLT6PEO.mjs} +8 -6
  2. package/dist/lib/browser/SheetContainer-KCLT6PEO.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-QHQFM7LV.mjs → chunk-E5WQ7U7G.mjs} +77 -78
  4. package/dist/lib/browser/chunk-E5WQ7U7G.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-VMSX6Z4X.mjs → chunk-F3HE6D3J.mjs} +76 -26
  6. package/dist/lib/browser/chunk-F3HE6D3J.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-BVUN7SHF.mjs → chunk-JXFPOYNA.mjs} +1 -1
  8. package/dist/lib/browser/chunk-JXFPOYNA.mjs.map +7 -0
  9. package/dist/lib/browser/{compute-graph-GGWUX644.mjs → compute-graph-SNUS7HOH.mjs} +3 -3
  10. package/dist/lib/browser/index.mjs +84 -32
  11. package/dist/lib/browser/index.mjs.map +3 -3
  12. package/dist/lib/browser/meta.json +1 -1
  13. package/dist/lib/browser/types.mjs +1 -1
  14. package/dist/lib/node/{SheetContainer-BSDHHYXE.cjs → SheetContainer-VVVRYTQG.cjs} +32 -31
  15. package/dist/lib/node/SheetContainer-VVVRYTQG.cjs.map +7 -0
  16. package/dist/lib/node/{chunk-J5ZFWMOD.cjs → chunk-45YW2DX2.cjs} +96 -101
  17. package/dist/lib/node/chunk-45YW2DX2.cjs.map +7 -0
  18. package/dist/lib/node/{chunk-O7XR4R7Y.cjs → chunk-KSEEI5VC.cjs} +87 -27
  19. package/dist/lib/node/chunk-KSEEI5VC.cjs.map +7 -0
  20. package/dist/lib/node/{chunk-AWKOWDMI.cjs → chunk-OWH2EUHZ.cjs} +4 -4
  21. package/dist/lib/node/chunk-OWH2EUHZ.cjs.map +7 -0
  22. package/dist/lib/node/{compute-graph-KGWA2QLE.cjs → compute-graph-WILPHO4A.cjs} +20 -20
  23. package/dist/lib/node/{compute-graph-KGWA2QLE.cjs.map → compute-graph-WILPHO4A.cjs.map} +2 -2
  24. package/dist/lib/node/index.cjs +101 -47
  25. package/dist/lib/node/index.cjs.map +3 -3
  26. package/dist/lib/node/meta.json +1 -1
  27. package/dist/lib/node/types.cjs +6 -6
  28. package/dist/lib/node/types.cjs.map +1 -1
  29. package/dist/lib/node-esm/{SheetContainer-T47T2NYJ.mjs → SheetContainer-LSBE6Q4X.mjs} +8 -6
  30. package/dist/lib/node-esm/SheetContainer-LSBE6Q4X.mjs.map +7 -0
  31. package/dist/lib/node-esm/{chunk-CR4K75EL.mjs → chunk-6JF2AHKO.mjs} +76 -26
  32. package/dist/lib/node-esm/chunk-6JF2AHKO.mjs.map +7 -0
  33. package/dist/lib/node-esm/{chunk-UIBWRHW7.mjs → chunk-BVS2IQRO.mjs} +1 -1
  34. package/dist/lib/node-esm/chunk-BVS2IQRO.mjs.map +7 -0
  35. package/dist/lib/node-esm/{chunk-6GSTEN7N.mjs → chunk-NYDNXI7L.mjs} +77 -78
  36. package/dist/lib/node-esm/chunk-NYDNXI7L.mjs.map +7 -0
  37. package/dist/lib/node-esm/{compute-graph-2SCZT7N5.mjs → compute-graph-S6CVN7RS.mjs} +3 -3
  38. package/dist/lib/node-esm/index.mjs +84 -32
  39. package/dist/lib/node-esm/index.mjs.map +3 -3
  40. package/dist/lib/node-esm/meta.json +1 -1
  41. package/dist/lib/node-esm/types.mjs +1 -1
  42. package/dist/types/src/SheetPlugin.d.ts.map +1 -1
  43. package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +1 -1
  44. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts +1 -0
  45. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +1 -1
  46. package/dist/types/src/components/GridSheet/util.d.ts +0 -2
  47. package/dist/types/src/components/GridSheet/util.d.ts.map +1 -1
  48. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts +2 -0
  49. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts.map +1 -1
  50. package/dist/types/src/components/SheetObjectSettings.d.ts +7 -0
  51. package/dist/types/src/components/SheetObjectSettings.d.ts.map +1 -0
  52. package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
  53. package/dist/types/src/components/index.d.ts +1 -0
  54. package/dist/types/src/components/index.d.ts.map +1 -1
  55. package/dist/types/src/defs/sheet-range-types.d.ts.map +1 -1
  56. package/dist/types/src/defs/types.d.ts +2 -4
  57. package/dist/types/src/defs/types.d.ts.map +1 -1
  58. package/dist/types/src/defs/util.d.ts +8 -0
  59. package/dist/types/src/defs/util.d.ts.map +1 -1
  60. package/dist/types/src/extensions/editor/extension.d.ts +2 -1
  61. package/dist/types/src/extensions/editor/extension.d.ts.map +1 -1
  62. package/dist/types/src/index.d.ts +1 -0
  63. package/dist/types/src/index.d.ts.map +1 -1
  64. package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
  65. package/dist/types/src/model/sheet-model.d.ts +0 -4
  66. package/dist/types/src/model/sheet-model.d.ts.map +1 -1
  67. package/dist/types/src/model/testing.d.ts +6 -0
  68. package/dist/types/src/model/testing.d.ts.map +1 -0
  69. package/dist/types/src/testing/data.d.ts +3 -0
  70. package/dist/types/src/testing/data.d.ts.map +1 -0
  71. package/dist/types/src/testing/index.d.ts +1 -0
  72. package/dist/types/src/testing/index.d.ts.map +1 -1
  73. package/dist/types/src/testing/playwright/playwright.config.d.ts +3 -0
  74. package/dist/types/src/testing/playwright/playwright.config.d.ts.map +1 -0
  75. package/dist/types/src/testing/playwright/sheet-manager.d.ts +24 -0
  76. package/dist/types/src/testing/playwright/sheet-manager.d.ts.map +1 -0
  77. package/dist/types/src/testing/playwright/sheet.spec.d.ts +2 -0
  78. package/dist/types/src/testing/playwright/sheet.spec.d.ts.map +1 -0
  79. package/dist/types/src/testing/testing.d.ts +1 -2
  80. package/dist/types/src/testing/testing.d.ts.map +1 -1
  81. package/dist/types/src/translations.d.ts +61 -0
  82. package/dist/types/src/translations.d.ts.map +1 -1
  83. package/dist/types/src/types.d.ts +2 -3
  84. package/dist/types/src/types.d.ts.map +1 -1
  85. package/package.json +40 -37
  86. package/src/SheetPlugin.tsx +9 -21
  87. package/src/components/FunctionEditor/FunctionEditor.tsx +2 -2
  88. package/src/components/GridSheet/GridSheet.stories.tsx +2 -0
  89. package/src/components/GridSheet/GridSheet.tsx +18 -8
  90. package/src/components/GridSheet/util.ts +1 -9
  91. package/src/components/SheetContainer/SheetContainer.stories.tsx +44 -2
  92. package/src/components/SheetObjectSettings.tsx +38 -0
  93. package/src/components/Toolbar/Toolbar.tsx +7 -1
  94. package/src/components/index.ts +1 -0
  95. package/src/compute-graph/compute-graph.stories.tsx +1 -1
  96. package/src/compute-graph/compute-graph.test.ts +1 -1
  97. package/src/defs/sheet-range-types.ts +3 -0
  98. package/src/defs/types.ts +3 -1
  99. package/src/defs/util.ts +32 -1
  100. package/src/extensions/editor/extension.ts +3 -3
  101. package/src/index.ts +3 -0
  102. package/src/integrations/thread-ranges.ts +2 -0
  103. package/src/model/sheet-model.test.ts +35 -1
  104. package/src/model/sheet-model.ts +5 -17
  105. package/src/model/testing.ts +35 -0
  106. package/src/sanity.test.ts +1 -1
  107. package/src/testing/data.ts +33 -0
  108. package/src/testing/index.ts +1 -0
  109. package/src/testing/playwright/playwright.config.ts +18 -0
  110. package/src/testing/playwright/sheet-manager.ts +91 -0
  111. package/src/testing/playwright/sheet.spec.ts +78 -0
  112. package/src/testing/testing.tsx +1 -31
  113. package/src/translations.ts +4 -0
  114. package/src/types.ts +1 -3
  115. package/dist/lib/browser/SheetContainer-YAMIOFC6.mjs.map +0 -7
  116. package/dist/lib/browser/chunk-BVUN7SHF.mjs.map +0 -7
  117. package/dist/lib/browser/chunk-QHQFM7LV.mjs.map +0 -7
  118. package/dist/lib/browser/chunk-VMSX6Z4X.mjs.map +0 -7
  119. package/dist/lib/node/SheetContainer-BSDHHYXE.cjs.map +0 -7
  120. package/dist/lib/node/chunk-AWKOWDMI.cjs.map +0 -7
  121. package/dist/lib/node/chunk-J5ZFWMOD.cjs.map +0 -7
  122. package/dist/lib/node/chunk-O7XR4R7Y.cjs.map +0 -7
  123. package/dist/lib/node-esm/SheetContainer-T47T2NYJ.mjs.map +0 -7
  124. package/dist/lib/node-esm/chunk-6GSTEN7N.mjs.map +0 -7
  125. package/dist/lib/node-esm/chunk-CR4K75EL.mjs.map +0 -7
  126. package/dist/lib/node-esm/chunk-UIBWRHW7.mjs.map +0 -7
  127. /package/dist/lib/browser/{compute-graph-GGWUX644.mjs.map → compute-graph-SNUS7HOH.mjs.map} +0 -0
  128. /package/dist/lib/node-esm/{compute-graph-2SCZT7N5.mjs.map → compute-graph-S6CVN7RS.mjs.map} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/compute-graph/compute-graph.ts", "../../../src/compute-graph/compute-node.ts", "../../../src/defs/sheet-range-types.ts", "../../../src/defs/types.ts", "../../../src/defs/util.ts", "../../../src/compute-graph/functions/async-function.ts", "../../../src/compute-graph/functions/edge-function.ts", "../../../src/compute-graph/functions/function-defs.ts", "../../../src/compute-graph/compute-graph-registry.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Listeners } from 'hyperformula/typings/Emitter';\n\nimport { Event } from '@dxos/async';\nimport { type Space, Filter, fullyQualifiedId } from '@dxos/client/echo';\nimport { FQ_ID_LENGTH } from '@dxos/client/echo';\nimport { Resource } from '@dxos/context';\nimport { getTypename } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { PublicKey } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { FunctionType } from '@dxos/plugin-script/types';\nimport { nonNullable } from '@dxos/util';\n\nimport { ExportedCellChange, type HyperFormula } from '#hyperformula';\nimport { ComputeNode } from './compute-node';\nimport {\n defaultFunctions,\n FunctionContext,\n type FunctionContextOptions,\n type FunctionDefinition,\n EDGE_FUNCTION_NAME,\n} from './functions';\n\n// TODO(burdon): Factor out compute-graph.\n\nconst UNKNOWN_BINDING = '__UNKNOWN__';\n\n// TODO(burdon): Factory.\n// export type ComputeNodeGenerator = <T>(obj: T) => ComputeNode;\n\ntype ObjectRef = { type: string; id: string };\n\n/**\n * Marker for sheets that are managed by an ECHO object.\n * Sheet ID: `dxos.org/type/SheetType@1234`\n */\nexport const createSheetName = ({ type, id }: ObjectRef) => `${type}@${id}`;\nexport const parseSheetName = (name: string): Partial<ObjectRef> => {\n const [type, id] = name.split('@');\n return id ? { type, id } : { id: type };\n};\n\nexport type ComputeGraphEvent = 'functionsUpdated' | 'valuesUpdated';\n\n/**\n * Per-space compute and dependency graph.\n * Consists of multiple ComputeNode (corresponding to a HyperFormula sheet).\n * Manages the set of custom functions.\n * HyperFormula manages the dependency graph.\n */\nexport class ComputeGraph extends Resource {\n public readonly id = `graph-${PublicKey.random().truncate()}`;\n\n // Map of nodes indexed by sheet number.\n private readonly _nodes = new Map<number, ComputeNode>();\n\n // Cached function objects.\n private _remoteFunctions: FunctionType[] = [];\n\n public readonly update = new Event<{ type: ComputeGraphEvent }>();\n\n // The context is passed to all functions.\n public readonly context: FunctionContext;\n\n constructor(\n private readonly _hf: HyperFormula,\n private readonly _space?: Space,\n private readonly _options?: Partial<FunctionContextOptions>,\n ) {\n super();\n\n const contextOptions = {\n ...this._options,\n onUpdate: (update) => {\n this._options?.onUpdate?.(update);\n this.update.emit({ type: 'valuesUpdated' });\n },\n } satisfies Partial<FunctionContextOptions>;\n this.context = new FunctionContext(this._hf, this._space, contextOptions);\n this._hf.updateConfig({ context: this.context });\n\n // TODO(burdon): If debounce then aggregate changes.\n const onValuesUpdate: Listeners['valuesUpdated'] = (changes) => {\n for (const change of changes) {\n if (change instanceof ExportedCellChange) {\n const { sheet } = change;\n const node = this._nodes.get(sheet);\n if (node) {\n node.update.emit({ type: 'valuesUpdated', change });\n }\n }\n }\n };\n\n this._hf.on('valuesUpdated', onValuesUpdate);\n this._ctx.onDispose(() => this._hf.off('valuesUpdated', onValuesUpdate));\n }\n\n get hf() {\n return this._hf;\n }\n\n getFunctions(\n { standard, echo }: { standard?: boolean; echo?: boolean } = { standard: true, echo: true },\n ): FunctionDefinition[] {\n return [\n ...(standard\n ? this._hf\n .getRegisteredFunctionNames()\n .map((name) => defaultFunctions.find((fn) => fn.name === name) ?? { name })\n : []),\n ...(echo ? this._remoteFunctions.map((fn) => ({ name: fn.binding! })) : []),\n ];\n }\n\n /**\n * Get or create cell representing a sheet.\n */\n // TODO(burdon): Async (open node).\n // The graph should be an extensible factory that plugins extend with model constructors.\n // This would enable on-the-fly instantiation of new models when then are referenced.\n // E.g., Cross-object reference would be stored as \"ObjectId!A1\"\n // The graph would then load the object and create a ComputeNode (model) of the appropriate type.\n getOrCreateNode(name: string): ComputeNode {\n invariant(name.length);\n if (!this._hf.doesSheetExist(name)) {\n log('created node', { space: this._space?.id, sheet: name });\n this._hf.addSheet(name);\n }\n\n const sheetId = this._hf.getSheetId(name);\n invariant(sheetId !== undefined);\n\n const node = new ComputeNode(this, sheetId);\n this._nodes.set(sheetId, node);\n return node;\n }\n\n /**\n * Map bound value to custom function invocation.\n * E.g., \"HELLO(...args)\" => \"DX(\"HELLO\", ...args)\".\n */\n mapFormulaToNative(formula: string): string {\n return (\n formula\n //\n // Map cross-sheet references by name onto sheet stored by ECHO object/model.\n // Example: \"Test Sheet\"!A0 => \"dxos.org/type/SheetType@1234\"!A0\n // https://hyperformula.handsontable.com/guide/cell-references.html#cell-references\n //\n .replace(/['\"]?([ \\w]+)['\"]?!/, (_match, name) => {\n if (name) {\n // TODO(burdon): Cache map.\n const objects = this._hf\n .getSheetNames()\n .map((name) => {\n const { type, id } = parseSheetName(name);\n return type && id ? this._space?.db.getObjectById(id) : undefined;\n })\n .filter(nonNullable);\n\n for (const obj of objects) {\n if (obj.name === name) {\n const type = getTypename(obj)!;\n // NOTE: Names must be single quoted.\n return `'${createSheetName({ type, id: obj.id })}'!`;\n }\n }\n }\n\n return `${name}!`;\n })\n\n //\n // Map remote function references (i.e., to remote DX function invocation).\n //\n .replace(/(\\w+)\\((.*)\\)/g, (match, binding, args) => {\n const fn = this._remoteFunctions.find((fn) => fn.binding === binding);\n if (!fn) {\n return match;\n }\n\n if (args.trim() === '') {\n return `${EDGE_FUNCTION_NAME}(\"${binding}\")`;\n } else {\n return `${EDGE_FUNCTION_NAME}(\"${binding}\", ${args})`;\n }\n })\n );\n }\n\n /**\n * Map from binding to fully qualified ECHO ID (to store).\n * E.g., HELLO() => spaceId:objectId()\n */\n mapFunctionBindingToId(formula: string) {\n return formula.replace(/(\\w+)\\((.*)\\)/g, (match, binding, args) => {\n if (binding === EDGE_FUNCTION_NAME || defaultFunctions.find((fn) => fn.name === binding)) {\n return match;\n }\n\n const fn = this._remoteFunctions.find((fn) => fn.binding === binding);\n if (fn) {\n const id = fullyQualifiedId(fn);\n return `${id}(${args})`;\n } else {\n return match;\n }\n });\n }\n\n /**\n * Map from fully qualified ECHO ID to binding (from store).\n * E.g., spaceId:objectId() => HELLO()\n */\n mapFunctionBindingFromId(formula: string) {\n const binding = formula.replace(/(\\w+):([a-zA-Z0-9]+)\\((.*)\\)/g, (match, spaceId, objectId, args) => {\n const id = `${spaceId}:${objectId}`;\n if (id.length !== FQ_ID_LENGTH) {\n return match;\n }\n\n const fn = this._remoteFunctions.find((fn) => fullyQualifiedId(fn) === id);\n if (fn?.binding) {\n return `${fn.binding}(${args})`;\n } else {\n return UNKNOWN_BINDING;\n }\n });\n\n if (binding.startsWith(`=${UNKNOWN_BINDING}`)) {\n return undefined;\n } else {\n return binding;\n }\n }\n\n protected override async _open() {\n if (this._space) {\n // Subscribe to remote function definitions.\n const query = this._space.db.query(Filter.schema(FunctionType));\n const unsubscribe = query.subscribe(({ objects }) => {\n this._remoteFunctions = objects.filter(({ binding }) => binding);\n this.update.emit({ type: 'functionsUpdated' });\n });\n\n this._ctx.onDispose(unsubscribe);\n }\n }\n\n protected override async _close() {\n for (const node of this._nodes.values()) {\n await node.close();\n }\n }\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Listeners } from 'hyperformula/typings/Emitter';\nimport { type ExportedCellChange } from 'hyperformula/typings/Exporter';\n\nimport { Event } from '@dxos/async';\nimport { Resource } from '@dxos/context';\n\nimport { DetailedCellError } from '#hyperformula';\nimport { type ComputeGraph } from './compute-graph';\nimport { type CellAddress, isFormula } from '../defs';\nimport { type CellScalarValue } from '../types';\n\nexport type ComputeNodeEvent = {\n type: keyof Listeners;\n change?: ExportedCellChange;\n};\n\n/**\n * Individual \"sheet\" (typically corresponds to an ECHO object).\n */\n// TODO(burdon): Factor out common HF wrapper from from SheetModel.\nexport class ComputeNode extends Resource {\n public readonly update = new Event<ComputeNodeEvent>();\n\n constructor(\n private readonly _graph: ComputeGraph,\n public readonly sheetId: number,\n ) {\n super();\n }\n\n get graph() {\n return this._graph;\n }\n\n clear() {\n this._graph.hf.clearSheet(this.sheetId);\n }\n\n getValue(cell: CellAddress): CellScalarValue {\n const value = this._graph.hf.getCellValue({ sheet: this.sheetId, row: cell.row, col: cell.col });\n if (value instanceof DetailedCellError) {\n return null;\n }\n\n return value;\n }\n\n setValue(cell: CellAddress, value: CellScalarValue) {\n const mappedValue = isFormula(value) ? this._graph.mapFormulaToNative(value) : value;\n this._graph.hf.setCellContents({ sheet: this.sheetId, row: cell.row, col: cell.col }, [[mappedValue]]);\n }\n\n // TODO(burdon): Load data into sheet.\n protected override async _open() {\n // const unsubscribe = this._graph.update.on(this.update.emit);\n // this._ctx.onDispose(unsubscribe);\n }\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type ClassNameValue } from '@dxos/react-ui';\n\nimport { type SheetType } from '../types';\n\nexport const alignKey = 'alignment';\nexport type AlignKey = typeof alignKey;\nexport type AlignValue = 'start' | 'center' | 'end' | 'unset';\n\nexport const commentKey = 'comment';\nexport type CommentKey = typeof commentKey;\nexport type CommentValue = string;\n\nexport const styleKey = 'style';\nexport type StyleKey = typeof styleKey;\nexport type StyleValue = 'highlight' | 'softwrap';\n\n// TODO(burdon): Reconcile with plugin-table.\nexport const cellClassNameForRange = ({ key, value }: SheetType['ranges'][number]): ClassNameValue => {\n switch (key) {\n case alignKey:\n switch (value) {\n case 'start':\n return 'text-start';\n case 'center':\n return 'text-center';\n case 'end':\n return 'text-end';\n default:\n return undefined;\n }\n\n case commentKey:\n return 'bg-gridComment';\n\n case styleKey:\n switch (value) {\n case 'highlight':\n return '!bg-gridHighlight';\n case 'softwrap':\n return '!whitespace-normal';\n default:\n return undefined;\n }\n\n default:\n return undefined;\n }\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { invariant } from '@dxos/invariant';\nimport { type DxGridPlanePosition } from '@dxos/react-ui-grid';\n\nexport const DEFAULT_ROWS = 50;\nexport const DEFAULT_COLUMNS = 26;\n\nexport const MAX_ROWS = 500;\nexport const MAX_COLUMNS = 26 * 2;\n\nexport type CellAddress = DxGridPlanePosition;\n\nexport type CellRange = { from: CellAddress; to?: CellAddress };\nexport type CompleteCellRange = { from: CellAddress; to: CellAddress };\n\nexport type CellIndex = string;\n\nexport type CellContentValue = number | string | boolean | null;\n\nexport const RANGE_NOTATION = /^[A-Z]+[0-9]+(:[A-Z]+[0-9]+)?$/;\n\nexport const isFormula = (value: any): value is string => typeof value === 'string' && value.charAt(0) === '=';\n\nexport const posEquals = (a: CellAddress | undefined, b: CellAddress | undefined) => {\n return a?.col === b?.col && a?.row === b?.row;\n};\n\nexport const columnLetter = (col: number): string => {\n invariant(col < MAX_COLUMNS, `Invalid column: ${col}`);\n return (\n (col >= 26 ? String.fromCharCode('A'.charCodeAt(0) + Math.floor(col / 26) - 1) : '') +\n String.fromCharCode('A'.charCodeAt(0) + (col % 26))\n );\n};\n\nexport const addressToA1Notation = ({ col, row }: CellAddress): string => {\n return `${columnLetter(col)}${row + 1}`;\n};\n\n// TODO(burdon): See (HF) simpleCellAddressFromString.\nexport const addressFromA1Notation = (ref: string): CellAddress => {\n const match = ref.match(/([A-Z]+)(\\d+)/);\n invariant(match, `Invalid notation: ${ref}`);\n return {\n row: parseInt(match[2], 10) - 1,\n col: match[1].split('').reduce((acc, c) => acc * 26 + c.charCodeAt(0) - 'A'.charCodeAt(0) + 1, 0) - 1,\n };\n};\n\nexport const rangeToA1Notation = (range: CellRange) => {\n return [range?.from && addressToA1Notation(range?.from), range?.to && addressToA1Notation(range?.to)]\n .filter(Boolean)\n .join(':');\n};\n\nexport const rangeFromA1Notation = (ref: string): CellRange => {\n const [from, to] = ref.split(':').map(addressFromA1Notation);\n return { from, to };\n};\n\nexport const inRange = (range: CellRange | undefined, cell: CellAddress): boolean => {\n if (!range) {\n return false;\n }\n\n const { from, to } = range;\n if ((from && posEquals(from, cell)) || (to && posEquals(to, cell))) {\n return true;\n }\n\n if (!from || !to) {\n return false;\n }\n\n const { col: c1, row: r1 } = from;\n const { col: c2, row: r2 } = to;\n\n const cMin = Math.min(c1, c2);\n const cMax = Math.max(c1, c2);\n const rMin = Math.min(r1, r2);\n const rMax = Math.max(r1, r2);\n\n const { col, row } = cell;\n return col >= cMin && col <= cMax && row >= rMin && row <= rMax;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { randomBytes } from '@dxos/crypto';\nimport { invariant } from '@dxos/invariant';\nimport { create } from '@dxos/live-object';\n\nimport {\n addressFromA1Notation,\n addressToA1Notation,\n isFormula,\n type CellAddress,\n type CellRange,\n type CompleteCellRange,\n DEFAULT_COLUMNS,\n DEFAULT_ROWS,\n MAX_COLUMNS,\n MAX_ROWS,\n} from './types';\nimport { type CreateSheetOptions, type SheetSize, SheetType } from '../types';\n\n// TODO(burdon): Factor out from dxos/protocols to new common package.\nexport class ApiError extends Error {}\n\nexport class ReadonlyException extends ApiError {}\n\nexport class RangeException extends ApiError {\n constructor(n: number) {\n super();\n }\n}\n\n// TODO(burdon): Factor out to types lib.\n\n/**\n * With a string length of 8, the chance of a collision is 0.02% for a sheet with 10,000 strings.\n */\nexport const createIndex = (length = 8): string => {\n const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const charactersLength = characters.length;\n const randomBuffer = randomBytes(length);\n return Array.from(randomBuffer, (byte) => characters[byte % charactersLength]).join('');\n};\n\nexport const createIndices = (length: number): string[] => Array.from({ length }).map(() => createIndex());\n\nexport const insertIndices = (indices: string[], i: number, n: number, max: number) => {\n if (i + n > max) {\n throw new RangeException(i + n);\n }\n\n const idx = createIndices(n);\n indices.splice(i, 0, ...idx);\n return idx;\n};\n\nexport const initialize = (\n sheet: SheetType,\n { rows = DEFAULT_ROWS, columns = DEFAULT_COLUMNS }: Partial<SheetSize> = {},\n) => {\n if (!sheet.rows.length) {\n insertIndices(sheet.rows, 0, rows, MAX_ROWS);\n }\n if (!sheet.columns.length) {\n insertIndices(sheet.columns, 0, columns, MAX_COLUMNS);\n }\n};\n\nexport const createSheet = ({ name, cells, ...size }: CreateSheetOptions = {}): SheetType => {\n const sheet = create(SheetType, {\n name,\n cells: {},\n rows: [],\n columns: [],\n rowMeta: {},\n columnMeta: {},\n ranges: [],\n threads: [],\n });\n\n initialize(sheet, size);\n\n if (cells) {\n Object.entries(cells).forEach(([key, { value }]) => {\n const idx = addressToIndex(sheet, addressFromA1Notation(key));\n if (isFormula(value)) {\n value = mapFormulaRefsToIndices(sheet, value);\n }\n\n sheet.cells[idx] = { value };\n });\n }\n\n return sheet;\n};\n\n/**\n * E.g., \"A1\" => \"CA2@CB3\".\n */\nexport const addressToIndex = (sheet: SheetType, cell: CellAddress): string => {\n return `${sheet.columns[cell.col]}@${sheet.rows[cell.row]}`;\n};\n\n/**\n * E.g., \"CA2@CB3\" => \"A1\".\n */\nexport const addressFromIndex = (sheet: SheetType, idx: string): CellAddress => {\n const [column, row] = idx.split('@');\n return {\n col: sheet.columns.indexOf(column),\n row: sheet.rows.indexOf(row),\n };\n};\n\n/**\n * E.g., \"A1:B2\" => \"CA2@CB3:CC4@CD5\".\n */\nexport const rangeToIndex = (sheet: SheetType, range: CellRange): string => {\n return [range.from, range.to ?? range.from].map((cell) => addressToIndex(sheet, cell)).join(':');\n};\n\n/**\n * E.g., \"CA2@CB3:CC4@CD5\" => \"A1:B2\".\n */\nexport const rangeFromIndex = (sheet: SheetType, idx: string): CompleteCellRange => {\n const [from, to] = idx.split(':').map((index) => addressFromIndex(sheet, index));\n return { from, to };\n};\n\n/**\n * Compares the positions of two cell indexes in a sheet.\n * Sorts primarily by row, then by column if rows are equal.\n */\nexport const compareIndexPositions = (sheet: SheetType, indexA: string, indexB: string): number => {\n const { row: rowA, col: columnA } = addressFromIndex(sheet, indexA);\n const { row: rowB, col: columnB } = addressFromIndex(sheet, indexB);\n\n // Sort by row first, then by column.\n if (rowA !== rowB) {\n return rowA - rowB;\n } else {\n return columnA - columnB;\n }\n};\n\n// TODO(burdon): Tests.\n\n/**\n * Map from A1 notation to indices.\n */\nexport const mapFormulaRefsToIndices = (sheet: SheetType, formula: string): string => {\n invariant(isFormula(formula));\n return formula.replace(/([a-zA-Z]+)([0-9]+)/g, (match) => {\n return addressToIndex(sheet, addressFromA1Notation(match));\n });\n};\n\n/**\n * Map from indices to A1 notation.\n */\nexport const mapFormulaIndicesToRefs = (sheet: SheetType, formula: string): string => {\n invariant(isFormula(formula));\n return formula.replace(/([a-zA-Z0-9]+)@([a-zA-Z0-9]+)/g, (idx) => {\n return addressToA1Notation(addressFromIndex(sheet, idx));\n });\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type SimpleCellAddress } from 'hyperformula/typings/Cell';\nimport { type InterpreterState } from 'hyperformula/typings/interpreter/InterpreterState';\nimport { type InterpreterValue } from 'hyperformula/typings/interpreter/InterpreterValue';\nimport { type ProcedureAst } from 'hyperformula/typings/parser';\nimport defaultsDeep from 'lodash.defaultsdeep';\n\nimport { debounce, type UnsubscribeCallback } from '@dxos/async';\nimport { type Space } from '@dxos/client/echo';\nimport { log } from '@dxos/log';\n\nimport { CellError, ErrorType, EmptyValue, FunctionPlugin, type HyperFormula } from '#hyperformula';\n\n// TODO(burdon): Create API gateways:\n// https://publicapis.io\n// https://api-ninjas.com/api/cryptoprice\n// https://developers.google.com/apis-explorer\n// https://publicapis.io/coin-desk-api\n\nexport type AsyncFunction = (...args: any) => Promise<InterpreterValue>;\n\nexport type FunctionUpdateEvent = {\n name: string;\n cell: SimpleCellAddress;\n};\n\nexport type FunctionOptions = {\n ttl?: number;\n};\n\nexport type FunctionContextOptions = {\n defaultTtl: number;\n debounceDelay: number;\n remoteFunctionUrl: string;\n onUpdate?: (update: FunctionUpdateEvent) => void;\n};\n\nexport const defaultFunctionContextOptions: FunctionContextOptions = {\n defaultTtl: 5_000,\n debounceDelay: 200,\n remoteFunctionUrl: 'https://edge.dxos.workers.dev/functions', // TODO(burdon): Config.\n};\n\n/**\n * The context singleton for the model is passed into custom functions.\n *\n * HyperFormula does not support async functions.\n * - https://hyperformula.handsontable.com/guide/custom-functions.html\n * - https://hyperformula.handsontable.com/guide/known-limitations.html#known-limitations\n * - https://github.com/handsontable/hyperformula/issues/892\n */\nexport class FunctionContext {\n // Mangle name with params.\n static createInvocationKey(name: string, ...args: any) {\n return JSON.stringify({ name, ...args });\n }\n\n // TODO(wittjosiah): Persist cached values.\n // Cached values for cell.\n private readonly _cache = new Map<string, { value: InterpreterValue; ts: number }>();\n\n // Active requests.\n private readonly _pending = new Map<string, number>();\n\n // Query subscriptions.\n private readonly _subscriptions = new Map<string, UnsubscribeCallback>();\n\n // Invocation count.\n private _invocations: Record<string, number> = {};\n\n private readonly _options: FunctionContextOptions;\n\n // Debounced update handler.\n private readonly _onUpdate: (update: FunctionUpdateEvent) => void;\n\n constructor(\n private readonly _hf: HyperFormula,\n private readonly _space: Space | undefined,\n _options?: Partial<FunctionContextOptions>,\n ) {\n this._options = defaultsDeep(_options ?? {}, defaultFunctionContextOptions);\n this._onUpdate = debounce((update) => {\n log('update', update);\n // TODO(burdon): Better way to trigger recalculation? (NOTE: rebuildAndRecalculate resets the undo history.)\n this._hf.resumeEvaluation();\n this._options.onUpdate?.(update);\n }, this._options.debounceDelay);\n }\n\n get space() {\n return this._space;\n }\n\n get remoteFunctionUrl() {\n return this._options.remoteFunctionUrl;\n }\n\n get info() {\n return { cache: this._cache.size, invocations: this._invocations };\n }\n\n flush() {\n this._cache.clear();\n this._invocations = {};\n this._subscriptions.forEach((unsubscribe) => unsubscribe());\n this._subscriptions.clear();\n }\n\n createSubscription(name: string, unsubscribe: UnsubscribeCallback) {\n this._subscriptions.get(name)?.();\n this._subscriptions.set(name, unsubscribe);\n }\n\n /**\n * Exec the function if TTL has expired.\n * Return the cached value.\n */\n invokeFunction(\n name: string,\n state: InterpreterState,\n args: any[],\n cb: AsyncFunction,\n options?: FunctionOptions,\n ): InterpreterValue | undefined {\n const ttl = options?.ttl ?? this._options.defaultTtl;\n\n const { formulaAddress: cell } = state;\n const invocationKey = FunctionContext.createInvocationKey(name, ...args);\n const { value = undefined, ts = 0 } = this._cache.get(invocationKey) ?? {};\n\n const now = Date.now();\n const delta = now - ts;\n if ((!ts || delta > ttl) && !this._pending.has(invocationKey)) {\n this._pending.set(invocationKey, now);\n setTimeout(async () => {\n this._invocations[name] = (this._invocations[name] ?? 0) + 1;\n try {\n // Exec function.\n const value = await cb(...args);\n this._cache.set(invocationKey, { value, ts: Date.now() });\n log('set', { cell, value });\n this._onUpdate({ name, cell });\n } catch (err) {\n // TODO(burdon): Show error to user.\n log.warn('failed', { cell, err });\n this._cache.set(invocationKey, { value: new CellError(ErrorType.ERROR, 'Function failed.'), ts: Date.now() });\n } finally {\n this._pending.delete(invocationKey);\n }\n });\n }\n\n log('invoke', { cell, name, args, cache: value });\n return value;\n }\n}\n\n/**\n * Base class for async functions.\n */\nexport class AsyncFunctionPlugin extends FunctionPlugin {\n get context() {\n return this.config.context as FunctionContext;\n }\n\n /**\n * Immediately returns cached value then runs the async function.\n */\n protected runAsyncFunction(ast: ProcedureAst, state: InterpreterState, cb: AsyncFunction, options?: FunctionOptions) {\n const { procedureName } = ast;\n const metadata = this.metadata(procedureName);\n return this.runFunction(ast.args, state, metadata, (...args: any) => {\n return this.context.invokeFunction(procedureName, state, args, cb, options) ?? EmptyValue;\n });\n }\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { effect } from '@preact/signals-core';\nimport { type InterpreterState } from 'hyperformula/typings/interpreter/InterpreterState';\nimport { type ProcedureAst } from 'hyperformula/typings/parser';\n\nimport { Filter, getMeta } from '@dxos/client/echo';\nimport { log } from '@dxos/log';\nimport { getUserFunctionUrlInMetadata } from '@dxos/plugin-script/edge';\nimport { FunctionType } from '@dxos/plugin-script/types';\nimport { nonNullable } from '@dxos/util';\n\nimport { CellError, ErrorType, FunctionArgumentType } from '#hyperformula';\nimport { type AsyncFunction, AsyncFunctionPlugin } from './async-function';\n\nexport const EDGE_FUNCTION_NAME = 'DX';\n\nconst FUNCTION_TTL = 10_000;\n\n/**\n * A hyperformula function plugin for calling remote (EDGE) functions.\n *\n * https://hyperformula.handsontable.com/guide/custom-functions.html#add-a-simple-custom-function\n */\nexport class EdgeFunctionPlugin extends AsyncFunctionPlugin {\n dx(ast: ProcedureAst, state: InterpreterState) {\n const handler =\n (subscribe = false): AsyncFunction =>\n async (binding: string, ...args: any) => {\n const space = this.context.space;\n if (!space) {\n return new CellError(ErrorType.REF, 'Missing space');\n }\n\n const {\n objects: [fn],\n } = await space.db.query(Filter.schema(FunctionType, { binding })).run();\n if (!fn) {\n log.info('Function not found', { binding });\n return new CellError(ErrorType.REF, 'Function not found');\n }\n\n if (subscribe) {\n const unsubscribe = effect(() => {\n log('function changed', { fn });\n const _ = fn?.version;\n\n // TODO(wittjosiah): `ttl` should be 0 to force a recalculation when a new version is deployed.\n // This needs a ttl to prevent a binding change from causing the function not to be found.\n this.runAsyncFunction(ast, state, handler(false), { ttl: FUNCTION_TTL });\n });\n\n this.context.createSubscription(ast.procedureName, unsubscribe);\n }\n\n const path = getUserFunctionUrlInMetadata(getMeta(fn));\n const response = await fetch(`${this.context.remoteFunctionUrl}${path}`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ args: args.filter(nonNullable) }),\n });\n const result = await response.text();\n log('function executed', { result });\n\n return result;\n };\n\n return this.runAsyncFunction(ast, state, handler(true), { ttl: FUNCTION_TTL });\n }\n}\n\nEdgeFunctionPlugin.implementedFunctions = {\n [EDGE_FUNCTION_NAME]: {\n method: 'dx',\n parameters: [\n // Binding\n { argumentType: FunctionArgumentType.STRING },\n\n // Remote function arguments (currently supporting up to 8).\n { argumentType: FunctionArgumentType.ANY, optionalArg: true },\n { argumentType: FunctionArgumentType.ANY, optionalArg: true },\n { argumentType: FunctionArgumentType.ANY, optionalArg: true },\n { argumentType: FunctionArgumentType.ANY, optionalArg: true },\n { argumentType: FunctionArgumentType.ANY, optionalArg: true },\n { argumentType: FunctionArgumentType.ANY, optionalArg: true },\n { argumentType: FunctionArgumentType.ANY, optionalArg: true },\n { argumentType: FunctionArgumentType.ANY, optionalArg: true },\n ],\n isVolatile: true,\n },\n};\n\nexport const EdgeFunctionPluginTranslations = {\n enGB: {\n [EDGE_FUNCTION_NAME]: 'Remote function',\n },\n enUS: {\n [EDGE_FUNCTION_NAME]: 'Remote function',\n },\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nexport type FunctionDefinition = {\n name: string;\n description?: string;\n syntax?: string;\n section?: string;\n};\n\n/**\n * nullDate {year: 1899, month: 12, day: 30}\n */\nexport const defaultFunctions: FunctionDefinition[] = [\n // Array\n\n {\n name: 'ARRAYFORMULA',\n description: 'Enables the array arithmetic mode for a single formula.',\n syntax: 'ARRAYFORMULA(Formula)',\n section: 'Array',\n },\n {\n name: 'FILTER',\n description: 'Filters an array, based on multiple conditions (boolean arrays).',\n syntax: 'FILTER(SourceArray, BoolArray1, BoolArray2, ...BoolArrayN)',\n section: 'Array',\n },\n {\n name: 'ARRAY_CONSTRAIN',\n description: 'Truncates an array to given dimensions.',\n syntax: 'ARRAY_CONSTRAIN(Array, Height, Width)',\n section: 'Array',\n },\n\n // Date and time\n\n {\n name: 'DATE',\n description: 'Returns the specified date as the number of full days since nullDate.',\n syntax: 'DATE(Year, Month, Day)',\n section: 'Date and time',\n },\n {\n name: 'DATEDIF',\n description: 'Calculates distance between two dates, in provided unit parameter.',\n syntax: 'DATEDIF(Date1, Date2, Units)',\n section: 'Date and time',\n },\n {\n name: 'DATEVALUE',\n description: 'Parses a date string and returns it as the number of full days since nullDate.',\n syntax: 'DATEVALUE(Datestring)',\n section: 'Date and time',\n },\n {\n name: 'DAY',\n description: 'Returns the day of the given date value.',\n syntax: 'DAY(Number)',\n section: 'Date and time',\n },\n {\n name: 'DAYS',\n description: 'Calculates the difference between two date values.',\n syntax: 'DAYS(Date2, Date1)',\n section: 'Date and time',\n },\n {\n name: 'DAYS360',\n description: 'Calculates the difference between two date values in days, in 360-day basis.',\n syntax: 'DAYS360(Date2, Date1[, Format])',\n section: 'Date and time',\n },\n {\n name: 'EDATE',\n description:\n 'Shifts the given startdate by given number of months and returns it as the number of full days since nullDate.',\n syntax: 'EDATE(Startdate, Months)',\n section: 'Date and time',\n },\n {\n name: 'EOMONTH',\n description: 'Returns the date of the last day of a month which falls months away from the start date.',\n syntax: 'EOMONTH(Startdate, Months)',\n section: 'Date and time',\n },\n {\n name: 'HOUR',\n description: 'Returns hour component of given time.',\n syntax: 'HOUR(Time)',\n section: 'Date and time',\n },\n {\n name: 'INTERVAL',\n description: 'Returns interval string from given number of seconds.',\n syntax: 'INTERVAL(Seconds)',\n section: 'Date and time',\n },\n {\n name: 'ISOWEEKNUM',\n description: 'Returns an ISO week number that corresponds to the week of year.',\n syntax: 'ISOWEEKNUM(Date)',\n section: 'Date and time',\n },\n {\n name: 'MINUTE',\n description: 'Returns minute component of given time.',\n syntax: 'MINUTE(Time)',\n section: 'Date and time',\n },\n {\n name: 'MONTH',\n description: 'Returns the month for the given date value.',\n syntax: 'MONTH(Number)',\n section: 'Date and time',\n },\n {\n name: 'NETWORKDAYS',\n description: 'Returns the number of working days between two given dates.',\n syntax: 'NETWORKDAYS(Date1, Date2[, Holidays])',\n section: 'Date and time',\n },\n {\n name: 'NETWORKDAYS.INTL',\n description: 'Returns the number of working days between two given dates.',\n syntax: 'NETWORKDAYS.INTL(Date1, Date2[, Mode [, Holidays]])',\n section: 'Date and time',\n },\n {\n name: 'NOW',\n description: 'Returns current date + time as a number of days since nullDate.',\n syntax: 'NOW()',\n section: 'Date and time',\n },\n {\n name: 'SECOND',\n description: 'Returns second component of given time.',\n syntax: 'SECOND(Time)',\n section: 'Date and time',\n },\n {\n name: 'TIME',\n description: 'Returns the number that represents a given time as a fraction of full day.',\n syntax: 'TIME(Hour, Minute, Second)',\n section: 'Date and time',\n },\n {\n name: 'TIMEVALUE',\n description: 'Parses a time string and returns a number that represents it as a fraction of a full day.',\n syntax: 'TIMEVALUE(Timestring)',\n section: 'Date and time',\n },\n {\n name: 'TODAY',\n description: 'Returns an integer representing the current date as the number of full days since nullDate.',\n syntax: 'TODAY()',\n section: 'Date and time',\n },\n {\n name: 'WEEKDAY',\n description: 'Computes a number between 1-7 representing the day of week.',\n syntax: 'WEEKDAY(Date, Type)',\n section: 'Date and time',\n },\n {\n name: 'WEEKNUM',\n description: 'Returns a week number that corresponds to the week of year.',\n syntax: 'WEEKNUM(Date, Type)',\n section: 'Date and time',\n },\n {\n name: 'WORKDAY',\n description: 'Returns the working day number of days from start day.',\n syntax: 'WORKDAY(Date, Shift[, Holidays])',\n section: 'Date and time',\n },\n {\n name: 'WORKDAY.INTL',\n description: 'Returns the working day number of days from start day.',\n syntax: 'WORKDAY.INTL(Date, Shift[, Mode[, Holidays]])',\n section: 'Date and time',\n },\n {\n name: 'YEAR',\n description: 'Returns the year as a number according to the internal calculation rules.',\n syntax: 'YEAR(Number)',\n section: 'Date and time',\n },\n {\n name: 'YEARFRAC',\n description: 'Computes the difference between two date values, in fraction of years.',\n syntax: 'YEARFRAC(Date2, Date1[, Format])',\n section: 'Date and time',\n },\n\n // Engineering\n\n {\n name: 'BIN2DEC',\n description: 'The result is the decimal number for the binary number entered.',\n syntax: 'BIN2DEC(Number)',\n section: 'Engineering',\n },\n {\n name: 'BIN2HEX',\n description: 'The result is the hexadecimal number for the binary number entered.',\n syntax: 'BIN2HEX(Number, Places)',\n section: 'Engineering',\n },\n {\n name: 'BIN2OCT',\n description: 'The result is the octal number for the binary number entered.',\n syntax: 'BIN2OCT(Number, Places)',\n section: 'Engineering',\n },\n {\n name: 'BITAND',\n description: \"Returns a bitwise logical 'and' of the parameters.\",\n syntax: 'BITAND(Number1, Number2)',\n section: 'Engineering',\n },\n {\n name: 'BITLSHIFT',\n description: 'Shifts a number left by n bits.',\n syntax: 'BITLSHIFT(Number, Shift)',\n section: 'Engineering',\n },\n {\n name: 'BITOR',\n description: \"Returns a bitwise logical 'or' of the parameters.\",\n syntax: 'BITOR(Number1, Number2)',\n section: 'Engineering',\n },\n {\n name: 'BITRSHIFT',\n description: 'Shifts a number right by n bits.',\n syntax: 'BITRSHIFT(Number, Shift)',\n section: 'Engineering',\n },\n {\n name: 'BITXOR',\n description: \"Returns a bitwise logical 'exclusive or' of the parameters.\",\n syntax: 'BITXOR(Number1, Number2)',\n section: 'Engineering',\n },\n {\n name: 'COMPLEX',\n description: 'Returns complex number from Re and Im parts.',\n syntax: 'COMPLEX(Re, Im[, Symbol])',\n section: 'Engineering',\n },\n {\n name: 'DEC2BIN',\n description: 'Returns the binary number for the decimal number entered between –512 and 511.',\n syntax: 'DEC2BIN(Number, Places)',\n section: 'Engineering',\n },\n {\n name: 'DEC2HEX',\n description: 'Returns the hexadecimal number for the decimal number entered.',\n syntax: 'DEC2HEX(Number, Places)',\n section: 'Engineering',\n },\n {\n name: 'DEC2OCT',\n description: 'Returns the octal number for the decimal number entered.',\n syntax: 'DEC2OCT(Number, Places)',\n section: 'Engineering',\n },\n {\n name: 'DELTA',\n description: 'Returns TRUE (1) if both numbers are equal, otherwise returns FALSE (0).',\n syntax: 'DELTA(Number_1, Number_2)',\n section: 'Engineering',\n },\n {\n name: 'ERF',\n description: 'Returns values of the Gaussian error integral.',\n syntax: 'ERF(Lower_Limit, Upper_Limit)',\n section: 'Engineering',\n },\n {\n name: 'ERFC',\n description: 'Returns complementary values of the Gaussian error integral between x and infinity.',\n syntax: 'ERFC(Lower_Limit)',\n section: 'Engineering',\n },\n {\n name: 'HEX2BIN',\n description: 'The result is the binary number for the hexadecimal number entered.',\n syntax: 'HEX2BIN(Number, Places)',\n section: 'Engineering',\n },\n {\n name: 'HEX2DEC',\n description: 'The result is the decimal number for the hexadecimal number entered.',\n syntax: 'HEX2DEC(Number)',\n section: 'Engineering',\n },\n {\n name: 'HEX2OCT',\n description: 'The result is the octal number for the hexadecimal number entered.',\n syntax: 'HEX2OCT(Number, Places)',\n section: 'Engineering',\n },\n {\n name: 'IMABS',\n description: 'Returns module of a complex number.',\n syntax: 'IMABS(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMAGINARY',\n description: 'Returns imaginary part of a complex number.',\n syntax: 'IMAGINARY(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMARGUMENT',\n description: 'Returns argument of a complex number.',\n syntax: 'IMARGUMENT(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMCONJUGATE',\n description: 'Returns conjugate of a complex number.',\n syntax: 'IMCONJUGATE(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMCOS',\n description: 'Returns cosine of a complex number.',\n syntax: 'IMCOS(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMCOSH',\n description: 'Returns hyperbolic cosine of a complex number.',\n syntax: 'IMCOSH(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMCOT',\n description: 'Returns cotangens of a complex number.',\n syntax: 'IMCOT(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMCSC',\n description: 'Returns cosecans of a complex number.',\n syntax: 'IMCSC(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMCSCH',\n description: 'Returns hyperbolic cosecans of a complex number.',\n syntax: 'IMCSCH(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMDIV',\n description: 'Divides two complex numbers.',\n syntax: 'IMDIV(Complex1, Complex2)',\n section: 'Engineering',\n },\n {\n name: 'IMEXP',\n description: 'Returns exponent of a complex number.',\n syntax: 'IMEXP(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMLN',\n description: 'Returns natural logarithm of a complex number.',\n syntax: 'IMLN(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMLOG2',\n description: 'Returns binary logarithm of a complex number.',\n syntax: 'IMLOG2(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMLOG10',\n description: 'Returns base-10 logarithm of a complex number.',\n syntax: 'IMLOG10(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMPOWER',\n description: 'Returns a complex number raised to a given power.',\n syntax: 'IMPOWER(Complex, Number)',\n section: 'Engineering',\n },\n {\n name: 'IMPRODUCT',\n description: 'Multiplies complex numbers.',\n syntax: 'IMPRODUCT(Complex1, Complex2, ...ComplexN)',\n section: 'Engineering',\n },\n {\n name: 'IMREAL',\n description: 'Returns real part of a complex number.',\n syntax: 'IMREAL(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMSEC',\n description: 'Returns the secant of a complex number.',\n syntax: 'IMSEC(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMSECH',\n description: 'Returns the hyperbolic secant of a complex number.',\n syntax: 'IMSECH(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMSIN',\n description: 'Returns sine of a complex number.',\n syntax: 'IMSIN(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMSINH',\n description: 'Returns hyperbolic sine of a complex number.',\n syntax: 'IMSINH(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMSQRT',\n description: 'Returns a square root of a complex number.',\n syntax: 'IMSQRT(Complex)',\n section: 'Engineering',\n },\n {\n name: 'IMSUB',\n description: 'Subtracts two complex numbers.',\n syntax: 'IMSUB(Complex1, Complex2)',\n section: 'Engineering',\n },\n {\n name: 'IMSUM',\n description: 'Adds complex numbers.',\n syntax: 'IMSUM(Complex1, Complex2, ..ComplexN)',\n section: 'Engineering',\n },\n {\n name: 'IMTAN',\n description: 'Returns the tangent of a complex number.',\n syntax: 'IMTAN(Complex)',\n section: 'Engineering',\n },\n {\n name: 'OCT2BIN',\n description: 'The result is the binary number for the octal number entered.',\n syntax: 'OCT2BIN(Number, Places)',\n section: 'Engineering',\n },\n {\n name: 'OCT2DEC',\n description: 'The result is the decimal number for the octal number entered.',\n syntax: 'OCT2DEC(Number)',\n section: 'Engineering',\n },\n {\n name: 'OCT2HEX',\n description: 'The result is the hexadecimal number for the octal number entered.',\n syntax: 'OCT2HEX(Number, Places)',\n section: 'Engineering',\n },\n\n // Information\n\n {\n name: 'ISBINARY',\n description: 'Returns TRUE if provided value is a valid binary number.',\n syntax: 'ISBINARY(Value)',\n section: 'Information',\n },\n {\n name: 'ISBLANK',\n description: 'Returns TRUE if the reference to a cell is blank.',\n syntax: 'ISBLANK(Value)',\n section: 'Information',\n },\n {\n name: 'ISERR',\n description: 'Returns TRUE if the value is error value except #N/A!.',\n syntax: 'ISERR(Value)',\n section: 'Information',\n },\n {\n name: 'ISERROR',\n description: 'Returns TRUE if the value is general error value.',\n syntax: 'ISERROR(Value)',\n section: 'Information',\n },\n {\n name: 'ISEVEN',\n description: 'Returns TRUE if the value is an even integer, or FALSE if the value is odd.',\n syntax: 'ISEVEN(Value)',\n section: 'Information',\n },\n {\n name: 'ISFORMULA',\n description: 'Checks whether referenced cell is a formula.',\n syntax: 'ISFORMULA(Value)',\n section: 'Information',\n },\n {\n name: 'ISLOGICAL',\n description: 'Tests for a logical value (TRUE or FALSE).',\n syntax: 'ISLOGICAL(Value)',\n section: 'Information',\n },\n {\n name: 'ISNA',\n description: 'Returns TRUE if the value is #N/A! error.',\n syntax: 'ISNA(Value)',\n section: 'Information',\n },\n {\n name: 'ISNONTEXT',\n description: 'Tests if the cell contents are text or numbers, and returns FALSE if the contents are text.',\n syntax: 'ISNONTEXT(Value)',\n section: 'Information',\n },\n {\n name: 'ISNUMBER',\n description: 'Returns TRUE if the value refers to a number.',\n syntax: 'ISNUMBER(Value)',\n section: 'Information',\n },\n {\n name: 'ISODD',\n description: 'Returns TRUE if the value is odd, or FALSE if the number is even.',\n syntax: 'ISODD(Value)',\n section: 'Information',\n },\n {\n name: 'ISREF',\n description: 'Returns TRUE if provided value is #REF! error.',\n syntax: 'ISREF(Value)',\n section: 'Information',\n },\n {\n name: 'ISTEXT',\n description: 'Returns TRUE if the cell contents reference text.',\n syntax: 'ISTEXT(Value)',\n section: 'Information',\n },\n {\n name: 'SHEET',\n description: 'Returns sheet number of a given value or a formula sheet number if no argument is provided.',\n syntax: 'SHEET([Value])',\n section: 'Information',\n },\n {\n name: 'SHEETS',\n description:\n 'Returns number of sheet of a given reference or number of all sheets in workbook when no argument is provided.',\n syntax: 'SHEETS([Value])',\n section: 'Information',\n },\n {\n name: 'NA',\n description: 'Returns #N/A! error value.',\n syntax: 'NA(Value)',\n section: 'Information',\n },\n\n // Financial\n\n {\n name: 'CUMIPMT',\n description: 'Returns the cumulative interest paid on a loan between a start period and an end period.',\n syntax: 'CUMIPMT(Rate, Nper, Pv, Start, End, type)',\n section: 'Financial',\n },\n {\n name: 'CUMPRINC',\n description: 'Returns the cumulative principal paid on a loan between a start period and an end period.',\n syntax: 'CUMPRINC(Rate, Nper, Pv, Start, End, Type)',\n section: 'Financial',\n },\n {\n name: 'DB',\n description: 'Returns the depreciation of an asset for a period using the fixed-declining balance method.',\n syntax: 'DB(Cost, Salvage, Life, Period[, Month])',\n section: 'Financial',\n },\n {\n name: 'DDB',\n description: 'Returns the depreciation of an asset for a period using the double-declining balance method.',\n syntax: 'DDB(Cost, Salvage, Life, Period[, Factor])',\n section: 'Financial',\n },\n {\n name: 'DOLLARDE',\n description: 'Converts a price entered with a special notation to a price displayed as a decimal number.',\n syntax: 'DOLLARDE(Price, Fraction)',\n section: 'Financial',\n },\n {\n name: 'DOLLARFR',\n description: 'Converts a price displayed as a decimal number to a price entered with a special notation.',\n syntax: 'DOLLARFR(Price, Fraction)',\n section: 'Financial',\n },\n {\n name: 'EFFECT',\n description:\n 'Calculates the effective annual interest rate from a nominal interest rate and the number of compounding periods per year.',\n syntax: 'EFFECT(Nominal_rate, Npery)',\n section: 'Financial',\n },\n {\n name: 'FV',\n description: 'Returns the future value of an investment.',\n syntax: 'FV(Rate, Nper, Pmt[, Pv,[ Type]])',\n section: 'Financial',\n },\n {\n name: 'FVSCHEDULE',\n description: 'Returns the future value of an investment based on a rate schedule.',\n syntax: 'FVSCHEDULE(Pv, Schedule)',\n section: 'Financial',\n },\n {\n name: 'IPMT',\n description: 'Returns the interest portion of a given loan payment in a given payment period.',\n syntax: 'IPMT(Rate, Per, Nper, Pv[, Fv[, Type]])',\n section: 'Financial',\n },\n {\n name: 'ISPMT',\n description: 'Returns the interest paid for a given period of an investment with equal principal payments.',\n syntax: 'ISPMT(Rate, Per, Nper, Value)',\n section: 'Financial',\n },\n {\n name: 'MIRR',\n description: 'Returns modified internal value for cashflows.',\n syntax: 'MIRR(Flows, FRate, RRate)',\n section: 'Financial',\n },\n {\n name: 'NOMINAL',\n description: 'Returns the nominal interest rate.',\n syntax: 'NOMINAL(Effect_rate, Npery)',\n section: 'Financial',\n },\n {\n name: 'NPER',\n description:\n 'Returns the number of periods for an investment assuming periodic, constant payments and a constant interest rate.',\n syntax: 'NPER(Rate, Pmt, Pv[, Fv[, Type]])',\n section: 'Financial',\n },\n {\n name: 'NPV',\n description: 'Returns net present value.',\n syntax: 'NPV(Rate, Value1, Value2, ...ValueN)',\n section: 'Financial',\n },\n {\n name: 'PDURATION',\n description: 'Returns number of periods to reach specific value.',\n syntax: 'PDURATION(Rate, Pv, Fv)',\n section: 'Financial',\n },\n {\n name: 'PMT',\n description: 'Returns the periodic payment for a loan.',\n syntax: 'PMT(Rate, Nper, Pv[, Fv[, Type]])',\n section: 'Financial',\n },\n {\n name: 'PPMT',\n description: 'Calculates the principal portion of a given loan payment.',\n syntax: 'PPMT(Rate, Per, Nper, Pv[, Fv[, Type]])',\n section: 'Financial',\n },\n {\n name: 'PV',\n description: 'Returns the present value of an investment.',\n syntax: 'PV(Rate, Nper, Pmt[, Fv[, Type]])',\n section: 'Financial',\n },\n {\n name: 'RATE',\n description: 'Returns the interest rate per period of an annuity.',\n syntax: 'RATE(Nper, Pmt, Pv[, Fv[, Type[, guess]]])',\n section: 'Financial',\n },\n {\n name: 'RRI',\n description: 'Returns an equivalent interest rate for the growth of an investment.',\n syntax: 'RRI(Nper, Pv, Fv)',\n section: 'Financial',\n },\n {\n name: 'SLN',\n description: 'Returns the depreciation of an asset for one period, based on a straight-line method.',\n syntax: 'SLN(Cost, Salvage, Life)',\n section: 'Financial',\n },\n {\n name: 'SYD',\n description: \"Returns the 'sum-of-years' depreciation for an asset in a period.\",\n syntax: 'SYD(Cost, Salvage, Life, Period)',\n section: 'Financial',\n },\n {\n name: 'TBILLEQ',\n description: 'Returns the bond-equivalent yield for a Treasury bill.',\n syntax: 'TBILLEQ(Settlement, Maturity, Discount)',\n section: 'Financial',\n },\n {\n name: 'TBILLPRICE',\n description: 'Returns the price per $100 face value for a Treasury bill.',\n syntax: 'TBILLPRICE(Settlement, Maturity, Discount)',\n section: 'Financial',\n },\n {\n name: 'TBILLYIELD',\n description: 'Returns the yield for a Treasury bill.',\n syntax: 'TBILLYIELD(Settlement, Maturity, Price)',\n section: 'Financial',\n },\n {\n name: 'XNPV',\n description: 'Returns net present value.',\n syntax: 'XNPV(Rate, Payments, Dates)',\n section: 'Financial',\n },\n\n // Logical\n\n {\n name: 'AND',\n description: 'Returns TRUE if all arguments are TRUE.',\n syntax: 'AND(Logical_value1, Logical_value2, ...Logical_valueN)',\n section: 'Logical',\n },\n {\n name: 'FALSE',\n description: 'Returns the logical value FALSE.',\n syntax: 'FALSE()',\n section: 'Logical',\n },\n {\n name: 'IF',\n description: 'Specifies a logical test to be performed.',\n syntax: 'IF(Test, Then_value, Otherwise_value)',\n section: 'Logical',\n },\n {\n name: 'IFS',\n description: 'Evaluates multiple logical tests and returns a value that corresponds to the first true condition.',\n syntax: 'IFS(Condition1, Value1 [, Condition2, Value2 [, ...ConditionN, ValueN]])',\n section: 'Logical',\n },\n {\n name: 'IFNA',\n description:\n 'Returns the value if the cell does not contains the #N/A (value not available) error value, or the alternative value if it does.',\n syntax: 'IFNA(Value, Alternate_value)',\n section: 'Logical',\n },\n {\n name: 'IFERROR',\n description: 'Returns the value if the cell does not contains an error value, or the alternative value if it does.',\n syntax: 'IFERROR(Value, Alternate_value)',\n section: 'Logical',\n },\n {\n name: 'NOT',\n description: 'Complements (inverts) a logical value.',\n syntax: 'NOT(Logicalvalue)',\n section: 'Logical',\n },\n {\n name: 'SWITCH',\n description: 'Evaluates a list of arguments, consisting of an expression followed by a value.',\n syntax: 'SWITCH(Expression1, Value1 [, Expression2, Value2 [, ...ExpressionN, ValueN]])',\n section: 'Logical',\n },\n {\n name: 'OR',\n description: 'Returns TRUE if at least one argument is TRUE.',\n syntax: 'OR(Logical_value1, Logical_value2, ...Logical_valueN)',\n section: 'Logical',\n },\n {\n name: 'TRUE',\n description: 'The logical value is set to TRUE.',\n syntax: 'TRUE()',\n section: 'Logical',\n },\n {\n name: 'XOR',\n description: 'Returns true if an odd number of arguments evaluates to TRUE.',\n syntax: 'XOR(Logical_value1, Logical_value2, ...Logical_valueN)',\n section: 'Logical',\n },\n\n // Lookup and reference\n\n {\n name: 'ADDRESS',\n description: 'Returns a cell reference as a string.',\n syntax: 'ADDRESS(Row, Column[, AbsoluteRelativeMode[, UseA1Notation[, Sheet]]])',\n section: 'Lookup and reference',\n },\n {\n name: 'CHOOSE',\n description: 'Uses an index to return a value from a list of values.',\n syntax: 'CHOOSE(Index, Value1, Value2, ...ValueN)',\n section: 'Lookup and reference',\n },\n {\n name: 'COLUMN',\n description: 'Returns column number of a given reference or formula reference if argument not provided.',\n syntax: 'COLUMNS([Reference])',\n section: 'Lookup and reference',\n },\n {\n name: 'COLUMNS',\n description: 'Returns the number of columns in the given reference.',\n syntax: 'COLUMNS(Array)',\n section: 'Lookup and reference',\n },\n {\n name: 'FORMULATEXT',\n description: 'Returns a formula in a given cell as a string.',\n syntax: 'FORMULATEXT(Reference)',\n section: 'Lookup and reference',\n },\n {\n name: 'HLOOKUP',\n description: 'Searches horizontally with reference to adjacent cells to the bottom.',\n syntax: 'HLOOKUP(Search_Criterion, Array, Index, Sort_Order)',\n section: 'Lookup and reference',\n },\n {\n name: 'HYPERLINK',\n description: \"Stores the url in the cell's metadata.\",\n syntax: 'HYPERLINK(Url[, LinkLabel])',\n section: 'Lookup and reference',\n },\n {\n name: 'INDEX',\n description:\n 'Returns the contents of a cell specified by row and column number. The column number is optional and defaults to 1.',\n syntax: 'INDEX(Range, Row [, Column])',\n section: 'Lookup and reference',\n },\n {\n name: 'MATCH',\n description: 'Returns the relative position of an item in an array that matches a specified value.',\n syntax: 'MATCH(Searchcriterion, Lookuparray [, MatchType])',\n section: 'Lookup and reference',\n },\n {\n name: 'OFFSET',\n description:\n 'Returns the value of a cell offset by a certain number of rows and columns from a given reference point.',\n syntax: 'OFFSET(Reference, Rows, Columns, Height, Width)',\n section: 'Lookup and reference',\n },\n {\n name: 'ROW',\n description: 'Returns row number of a given reference or formula reference if argument not provided.',\n syntax: 'ROW([Reference])',\n section: 'Lookup and reference',\n },\n {\n name: 'ROWS',\n description: 'Returns the number of rows in the given reference.',\n syntax: 'ROWS(Array)',\n section: 'Lookup and reference',\n },\n {\n name: 'VLOOKUP',\n description: 'Searches vertically with reference to adjacent cells to the right.',\n syntax: 'VLOOKUP(Search_Criterion, Array, Index, Sort_Order)',\n section: 'Lookup and reference',\n },\n\n // Math and trigonometry\n\n {\n name: 'ABS',\n description: 'Returns the absolute value of a number.',\n syntax: 'ABS(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'ACOS',\n description: 'Returns the inverse trigonometric cosine of a number.',\n syntax: 'ACOS(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'ACOSH',\n description: 'Returns the inverse hyperbolic cosine of a number.',\n syntax: 'ACOSH(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'ACOT',\n description: 'Returns the inverse trigonometric cotangent of a number.',\n syntax: 'ACOT(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'ACOTH',\n description: 'Returns the inverse hyperbolic cotangent of a number.',\n syntax: 'ACOTH(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'ARABIC',\n description: 'Converts number from roman form.',\n syntax: 'ARABIC(String)',\n section: 'Math and trigonometry',\n },\n {\n name: 'ASIN',\n description: 'Returns the inverse trigonometric sine of a number.',\n syntax: 'ASIN(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'ASINH',\n description: 'Returns the inverse hyperbolic sine of a number.',\n syntax: 'ASINH(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'ATAN',\n description: 'Returns the inverse trigonometric tangent of a number.',\n syntax: 'ATAN(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'ATAN2',\n description: 'Returns the inverse trigonometric tangent of the specified x and y coordinates.',\n syntax: 'ATAN2(Numberx, Numbery)',\n section: 'Math and trigonometry',\n },\n {\n name: 'ATANH',\n description: 'Returns the inverse hyperbolic tangent of a number.',\n syntax: 'ATANH(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'BASE',\n description: 'Converts a positive integer to a specified base into a text from the numbering system.',\n syntax: 'BASE(Number, Radix, [Minimumlength])',\n section: 'Math and trigonometry',\n },\n {\n name: 'CEILING',\n description: 'Rounds a number up to the nearest multiple of Significance.',\n syntax: 'CEILING(Number, Significance)',\n section: 'Math and trigonometry',\n },\n {\n name: 'CEILING.MATH',\n description: 'Rounds a number up to the nearest multiple of Significance.',\n syntax: 'CEILING.MATH(Number[, Significance[, Mode]])',\n section: 'Math and trigonometry',\n },\n {\n name: 'CEILING.PRECISE',\n description: 'Rounds a number up to the nearest multiple of Significance.',\n syntax: 'CEILING.PRECISE(Number[, Significance])',\n section: 'Math and trigonometry',\n },\n {\n name: 'COMBIN',\n description: 'Returns number of combinations (without repetitions).',\n syntax: 'COMBIN(Number, Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'COMBINA',\n description: 'Returns number of combinations (with repetitions).',\n syntax: 'COMBINA(Number, Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'COS',\n description: 'Returns the cosine of the given angle (in radians).',\n syntax: 'COS(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'COSH',\n description: 'Returns the hyperbolic cosine of the given value.',\n syntax: 'COSH(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'COT',\n description: 'Returns the cotangent of the given angle (in radians).',\n syntax: 'COT(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'COTH',\n description: 'Returns the hyperbolic cotangent of the given value.',\n syntax: 'COTH(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'COUNTUNIQUE',\n description: 'Counts the number of unique values in a list of specified values and ranges.',\n syntax: 'COUNTUNIQUE(Value1, Value2, ...ValueN)',\n section: 'Math and trigonometry',\n },\n {\n name: 'CSC',\n description: 'Returns the cosecans of the given angle (in radians).',\n syntax: 'CSC(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'CSCH',\n description: 'Returns the hyperbolic cosecant of the given value.',\n syntax: 'CSCH(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'DECIMAL',\n description: 'Converts text with characters from a number system to a positive integer in the base radix given.',\n syntax: 'DECIMAL(\"Text\", Radix)',\n section: 'Math and trigonometry',\n },\n {\n name: 'DEGREES',\n description: 'Converts radians into degrees.',\n syntax: 'DEGREES(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'EVEN',\n description:\n 'Rounds a positive number up to the next even integer and a negative number down to the next even integer.',\n syntax: 'EVEN(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'EXP',\n description: 'Returns constant e raised to the power of a number.',\n syntax: 'EXP(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'FACT',\n description: 'Returns a factorial of a number.',\n syntax: 'FACT(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'FACTDOUBLE',\n description: 'Returns a double factorial of a number.',\n syntax: 'FACTDOUBLE(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'FLOOR',\n description: 'Rounds a number down to the nearest multiple of Significance.',\n syntax: 'FLOOR(Number, Significance)',\n section: 'Math and trigonometry',\n },\n {\n name: 'FLOOR.MATH',\n description: 'Rounds a number down to the nearest multiple of Significance.',\n syntax: 'FLOOR.MATH(Number[, Significance[, Mode]])',\n section: 'Math and trigonometry',\n },\n {\n name: 'FLOOR.PRECISE',\n description: 'Rounds a number down to the nearest multiple of Significance.',\n syntax: 'FLOOR.PRECISE(Number[, Significance])',\n section: 'Math and trigonometry',\n },\n {\n name: 'GCD',\n description: 'Computes greatest common divisor of numbers.',\n syntax: 'GCD(Number1, Number2, ...NumberN)',\n section: 'Math and trigonometry',\n },\n {\n name: 'INT',\n description: 'Rounds a number down to the nearest integer.',\n syntax: 'INT(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'ISO.CEILING',\n description: 'Rounds a number up to the nearest multiple of Significance.',\n syntax: 'ISO.CEILING(Number[, Significance])',\n section: 'Math and trigonometry',\n },\n {\n name: 'LCM',\n description: 'Computes least common multiplicity of numbers.',\n syntax: 'LCM(Number1, Number2, ...NumberN)',\n section: 'Math and trigonometry',\n },\n {\n name: 'LN',\n description: 'Returns the natural logarithm based on the constant e of a number.',\n syntax: 'LN(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'LOG',\n description: 'Returns the logarithm of a number to the specified base.',\n syntax: 'LOG(Number, Base)',\n section: 'Math and trigonometry',\n },\n {\n name: 'LOG10',\n description: 'Returns the base-10 logarithm of a number.',\n syntax: 'LOG10(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'MOD',\n description: 'Returns the remainder when one integer is divided by another.',\n syntax: 'MOD(Dividend, Divisor)',\n section: 'Math and trigonometry',\n },\n {\n name: 'MROUND',\n description: 'Rounds number to the nearest multiplicity.',\n syntax: 'MROUND(Number, Base)',\n section: 'Math and trigonometry',\n },\n {\n name: 'MULTINOMIAL',\n description: 'Returns number of multiset combinations.',\n syntax: 'MULTINOMIAL(Number1, Number2, ...NumberN)',\n section: 'Math and trigonometry',\n },\n {\n name: 'ODD',\n description:\n 'Rounds a positive number up to the nearest odd integer and a negative number down to the nearest odd integer.',\n syntax: 'ODD(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'PI',\n description: 'Returns 3.14159265358979, the value of the mathematical constant PI to 14 decimal places.',\n syntax: 'PI()',\n section: 'Math and trigonometry',\n },\n {\n name: 'POWER',\n description: 'Returns a number raised to another number.',\n syntax: 'POWER(Base, Exponent)',\n section: 'Math and trigonometry',\n },\n {\n name: 'PRODUCT',\n description: 'Returns product of numbers.',\n syntax: 'PRODUCT(Number1, Number2, ...NumberN)',\n section: 'Math and trigonometry',\n },\n {\n name: 'QUOTIENT',\n description: 'Returns integer part of a division.',\n syntax: 'QUOTIENT(Dividend, Divisor)',\n section: 'Math and trigonometry',\n },\n {\n name: 'RADIANS',\n description: 'Converts degrees to radians.',\n syntax: 'RADIANS(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'RAND',\n description: 'Returns a random number between 0 and 1.',\n syntax: 'RAND()',\n section: 'Math and trigonometry',\n },\n {\n name: 'RANDBETWEEN',\n description: 'Returns a random integer between two numbers.',\n syntax: 'RAND(Lowerbound, Upperbound)',\n section: 'Math and trigonometry',\n },\n {\n name: 'ROMAN',\n description: 'Converts number to roman form.',\n syntax: 'ROMAN(Number[, Mode])',\n section: 'Math and trigonometry',\n },\n {\n name: 'ROUND',\n description: 'Rounds a number to a certain number of decimal places.',\n syntax: 'ROUND(Number, Count)',\n section: 'Math and trigonometry',\n },\n {\n name: 'ROUNDDOWN',\n description: 'Rounds a number down, toward zero, to a certain precision.',\n syntax: 'ROUNDDOWN(Number, Count)',\n section: 'Math and trigonometry',\n },\n {\n name: 'ROUNDUP',\n description: 'Rounds a number up, away from zero, to a certain precision.',\n syntax: 'ROUNDUP(Number, Count)',\n section: 'Math and trigonometry',\n },\n {\n name: 'SEC',\n description: 'Returns the secant of the given angle (in radians).',\n syntax: 'SEC(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'SECH',\n description: 'Returns the hyperbolic secant of the given angle (in radians).',\n syntax: 'SEC(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'SERIESSUM',\n description: 'Evaluates series at a point.',\n syntax: 'SERIESSUM(Number, Number, Number, Coefficients)',\n section: 'Math and trigonometry',\n },\n {\n name: 'SIN',\n description: 'Returns the sine of the given angle (in radians).',\n syntax: 'SIN(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'SINH',\n description: 'Returns the hyperbolic sine of the given value.',\n syntax: 'SINH(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'SIGN',\n description: 'Returns sign of a number.',\n syntax: 'SIGN(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'SQRT',\n description: 'Returns the positive square root of a number.',\n syntax: 'SQRT(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'SQRTPI',\n description: 'Returns sqrt of number times pi.',\n syntax: 'SQRTPI(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'SUBTOTAL',\n description: 'Computes aggregation using function specified by number.',\n syntax: 'SUBTOTAL(Function, Number1, Number2, ...NumberN)',\n section: 'Math and trigonometry',\n },\n {\n name: 'SUM',\n description: 'Sums up the values of the specified cells.',\n syntax: 'SUM(Number1, Number2, ...NumberN)',\n section: 'Math and trigonometry',\n },\n {\n name: 'SUMIF',\n description: 'Sums up the values of cells that belong to the specified range and meet the specified condition.',\n syntax: 'SUMIF(Range, Criteria, Sumrange)',\n section: 'Math and trigonometry',\n },\n {\n name: 'SUMIFS',\n description:\n 'Sums up the values of cells that belong to the specified range and meet the specified sets of conditions.',\n syntax:\n 'SUMIFS(Sum_Range, Criterion_range1, Criterion1 [, Criterion_range2, Criterion2 [, ...Criterion_rangeN, CriterionN]])',\n section: 'Math and trigonometry',\n },\n {\n name: 'SUMPRODUCT',\n description: 'Multiplies corresponding elements in the given arrays, and returns the sum of those products.',\n syntax: 'SUMPRODUCT(Array1, Array2, ...ArrayN)',\n section: 'Math and trigonometry',\n },\n {\n name: 'SUMSQ',\n description: 'Returns the sum of the squares of the arguments',\n syntax: 'SUMSQ(Number1, Number2, ...NumberN)',\n section: 'Math and trigonometry',\n },\n {\n name: 'SUMX2MY2',\n description: 'Returns the sum of the square differences.',\n syntax: 'SUMX2MY2(Range1, Range2)',\n section: 'Math and trigonometry',\n },\n {\n name: 'SUMX2PY2',\n description: 'Returns the sum of the square sums.',\n syntax: 'SUMX2PY2(Range1, Range2)',\n section: 'Math and trigonometry',\n },\n {\n name: 'SUMXMY2',\n description: 'Returns the sum of the square of differences.',\n syntax: 'SUMXMY2(Range1, Range2)',\n section: 'Math and trigonometry',\n },\n {\n name: 'TAN',\n description: 'Returns the tangent of the given angle (in radians).',\n syntax: 'TAN(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'TANH',\n description: 'Returns the hyperbolic tangent of the given value.',\n syntax: 'TANH(Number)',\n section: 'Math and trigonometry',\n },\n {\n name: 'TRUNC',\n description: 'Truncates a number by removing decimal places.',\n syntax: 'TRUNC(Number, Count)',\n section: 'Math and trigonometry',\n },\n\n // Matrix functions\n\n {\n name: 'MMULT',\n description: 'Calculates the array product of two arrays.',\n syntax: 'MMULT(Array, Array)',\n section: 'Matrix functions',\n },\n {\n name: 'MEDIANPOOL',\n description:\n 'Calculates a smaller range which is a median of a Window_size, in a given Range, for every Stride element.',\n syntax: 'MEDIANPOOL(Range, Window_size, Stride)',\n section: 'Matrix functions',\n },\n {\n name: 'MAXPOOL',\n description:\n 'Calculates a smaller range which is a maximum of a Window_size, in a given Range, for every Stride element.',\n syntax: 'MAXPOOL(Range, Window_size, Stride)',\n section: 'Matrix functions',\n },\n {\n name: 'TRANSPOSE',\n description: 'Transposes the rows and columns of an array.',\n syntax: 'TRANSPOSE(Array)',\n section: 'Matrix functions',\n },\n\n // Operator\n\n {\n name: 'HF.ADD',\n description: 'Adds two values.',\n syntax: 'HF.ADD(Number, Number)',\n section: 'Operator',\n },\n {\n name: 'HF.CONCAT',\n description: 'Concatenates two strings.',\n syntax: 'HF.CONCAT(String, String)',\n section: 'Operator',\n },\n {\n name: 'HF.DIVIDE',\n description: 'Divides two values.',\n syntax: 'HF.DIVIDE(Number, Number)',\n section: 'Operator',\n },\n {\n name: 'HF.EQ',\n description: 'Tests two values for equality.',\n syntax: 'HF.EQ(Value, Value)',\n section: 'Operator',\n },\n {\n name: 'HF.LTE',\n description: 'Tests two values for less-equal relation.',\n syntax: 'HF.LEQ(Value, Value)',\n section: 'Operator',\n },\n {\n name: 'HF.LT',\n description: 'Tests two values for less-than relation.',\n syntax: 'HF.LT(Value, Value)',\n section: 'Operator',\n },\n {\n name: 'HF.GTE',\n description: 'Tests two values for greater-equal relation.',\n syntax: 'HF.GEQ(Value, Value)',\n section: 'Operator',\n },\n {\n name: 'HF.GT',\n description: 'Tests two values for greater-than relation.',\n syntax: 'HF.GT(Value, Value)',\n section: 'Operator',\n },\n {\n name: 'HF.MINUS',\n description: 'Subtracts two values.',\n syntax: 'HF.MINUS(Number, Number)',\n section: 'Operator',\n },\n {\n name: 'HF.MULTIPLY',\n description: 'Multiplies two values.',\n syntax: 'HF.MULTIPLY(Number, Number)',\n section: 'Operator',\n },\n {\n name: 'HF.NE',\n description: 'Tests two values for inequality.',\n syntax: 'HF.NE(Value, Value)',\n section: 'Operator',\n },\n {\n name: 'HF.POW',\n description: 'Computes power of two values.',\n syntax: 'HF.POW(Number, Number)',\n section: 'Operator',\n },\n {\n name: 'HF.UMINUS',\n description: 'Negates the value.',\n syntax: 'HF.UMINUS(Number)',\n section: 'Operator',\n },\n {\n name: 'HF.UNARY_PERCENT',\n description: 'Applies percent operator.',\n syntax: 'HF.UNARY_PERCENT(Number)',\n section: 'Operator',\n },\n {\n name: 'HF.UPLUS',\n description: 'Applies unary plus.',\n syntax: 'HF.UPLUS(Number)',\n section: 'Operator',\n },\n\n // Statistical\n\n {\n name: 'AVEDEV',\n description: 'Returns the average deviation of the arguments.',\n syntax: 'AVEDEV(Number1, Number2, ...NumberN)',\n section: 'Statistical',\n },\n {\n name: 'AVERAGE',\n description: 'Returns the average of the arguments.',\n syntax: 'AVERAGE(Number1, Number2, ...NumberN)',\n section: 'Statistical',\n },\n {\n name: 'AVERAGEA',\n description: 'Returns the average of the arguments.',\n syntax: 'AVERAGEA(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'AVERAGEIF',\n description: 'Returns the arithmetic mean of all cells in a range that satisfy a given condition.',\n syntax: 'AVERAGEIF(Range, Criterion [, Average_Range ])',\n section: 'Statistical',\n },\n {\n name: 'BESSELI',\n description: 'Returns value of Bessel function.',\n syntax: 'BESSELI(x, n)',\n section: 'Statistical',\n },\n {\n name: 'BESSELJ',\n description: 'Returns value of Bessel function.',\n syntax: 'BESSELJ(x, n)',\n section: 'Statistical',\n },\n {\n name: 'BESSELK',\n description: 'Returns value of Bessel function.',\n syntax: 'BESSELK(x, n)',\n section: 'Statistical',\n },\n {\n name: 'BESSELY',\n description: 'Returns value of Bessel function.',\n syntax: 'BESSELY(x, n)',\n section: 'Statistical',\n },\n {\n name: 'BETA.DIST',\n description: 'Returns the density of Beta distribution.',\n syntax: 'BETA.DIST(Number1, Number2, Number3, Boolean[, Number4[, Number5]])',\n section: 'Statistical',\n },\n {\n name: 'BETADIST',\n description: 'Returns the density of Beta distribution.',\n syntax: 'BETADIST(Number1, Number2, Number3, Boolean[, Number4[, Number5]])',\n section: 'Statistical',\n },\n {\n name: 'BETA.INV',\n description: 'Returns the inverse Beta distribution value.',\n syntax: 'BETA.INV(Number1, Number2, Number3[, Number4[, Number5]])',\n section: 'Statistical',\n },\n {\n name: 'BETAINV',\n description: 'Returns the inverse of Beta distribution value.',\n syntax: 'BETAINV(Number1, Number2, Number3[, Number4[, Number5]])',\n section: 'Statistical',\n },\n {\n name: 'BINOM.DIST',\n description: 'Returns density of binomial distribution.',\n syntax: 'BINOM.DIST(Number1, Number2, Number3, Boolean)',\n section: 'Statistical',\n },\n {\n name: 'BINOMDIST',\n description: 'Returns density of binomial distribution.',\n syntax: 'BINOMDIST(Number1, Number2, Number3, Boolean)',\n section: 'Statistical',\n },\n {\n name: 'BINOM.INV',\n description: 'Returns inverse binomial distribution value.',\n syntax: 'BINOM.INV(Number1, Number2, Number3)',\n section: 'Statistical',\n },\n {\n name: 'CHIDIST',\n description: 'Returns probability of chi-square right-side distribution.',\n syntax: 'CHIDIST(X, Degrees)',\n section: 'Statistical',\n },\n {\n name: 'CHIINV',\n description: 'Returns inverse of chi-square right-side distribution.',\n syntax: 'CHIINV(P, Degrees)',\n section: 'Statistical',\n },\n {\n name: 'CHIINVRT',\n description: 'Returns inverse of chi-square right-side distribution.',\n syntax: 'CHIINVRT(P, Degrees)',\n section: 'Statistical',\n },\n {\n name: 'CHISQ.DIST',\n description: 'Returns value of chi-square distribution.',\n syntax: 'CHISQ.DIST(X, Degrees, Mode)',\n section: 'Statistical',\n },\n {\n name: 'CHIDISTRT',\n description: 'Returns probability of chi-square right-side distribution.',\n syntax: 'CHIDISTRT(X, Degrees)',\n section: 'Statistical',\n },\n {\n name: 'CHISQ.DIST.RT',\n description: 'Returns probability of chi-square right-side distribution.',\n syntax: 'CHISQ.DIST.RT(X, Degrees)',\n section: 'Statistical',\n },\n {\n name: 'CHISQ.INV',\n description: 'Returns inverse of chi-square distribution.',\n syntax: 'CHISQ.INV.RT(P, Degrees)',\n section: 'Statistical',\n },\n {\n name: 'CHISQ.INV.RT',\n description: 'Returns inverse of chi-square right-side distribution.',\n syntax: 'CHISQ.INV.RT(P, Degrees)',\n section: 'Statistical',\n },\n {\n name: 'CHISQ.TEST',\n description: 'Returns chi-squared-test value for a dataset.',\n syntax: 'CHISQ.TEST(Array1, Array2)',\n section: 'Statistical',\n },\n {\n name: 'CHITEST',\n description: 'Returns chi-squared-test value for a dataset.',\n syntax: 'CHITEST(Array1, Array2)',\n section: 'Statistical',\n },\n {\n name: 'CONFIDENCE',\n description: 'Returns upper confidence bound for normal distribution.',\n syntax: 'CONFIDENCE(Alpha, Stdev, Size)',\n section: 'Statistical',\n },\n {\n name: 'CONFIDENCE.NORM',\n description: 'Returns upper confidence bound for normal distribution.',\n syntax: 'CONFIDENCE.NORM(Alpha, Stdev, Size)',\n section: 'Statistical',\n },\n {\n name: 'CONFIDENCE.T',\n description: 'Returns upper confidence bound for T distribution.',\n syntax: 'CONFIDENCE.T(Alpha, Stdev, Size)',\n section: 'Statistical',\n },\n {\n name: 'CORREL',\n description: 'Returns the correlation coefficient between two data sets.',\n syntax: 'CORREL(Data1, Data2)',\n section: 'Statistical',\n },\n {\n name: 'COUNT',\n description: 'Counts how many numbers are in the list of arguments.',\n syntax: 'COUNT(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'COUNTA',\n description: 'Counts how many values are in the list of arguments.',\n syntax: 'COUNTA(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'COUNTBLANK',\n description: 'Returns the number of empty cells.',\n syntax: 'COUNTBLANK(Range)',\n section: 'Statistical',\n },\n {\n name: 'COUNTIF',\n description: 'Returns the number of cells that meet with certain criteria within a cell range.',\n syntax: 'COUNTIF(Range, Criteria)',\n section: 'Statistical',\n },\n {\n name: 'COUNTIFS',\n description: 'Returns the count of rows or columns that meet criteria in multiple ranges.',\n syntax: 'COUNTIFS(Range1, Criterion1 [, Range2, Criterion2 [, ...RangeN, CriterionN]])',\n section: 'Statistical',\n },\n {\n name: 'COVAR',\n description: 'Returns the covariance between two data sets, population normalized.',\n syntax: 'COVAR(Data1, Data2)',\n section: 'Statistical',\n },\n {\n name: 'COVARIANCE.P',\n description: 'Returns the covariance between two data sets, population normalized.',\n syntax: 'COVARIANCE.P(Data1, Data2)',\n section: 'Statistical',\n },\n {\n name: 'COVARIANCEP',\n description: 'Returns the covariance between two data sets, population normalized.',\n syntax: 'COVARIANCEP(Data1, Data2)',\n section: 'Statistical',\n },\n {\n name: 'COVARIANCE.S',\n description: 'Returns the covariance between two data sets, sample normalized.',\n syntax: 'COVARIANCE.S(Data1, Data2)',\n section: 'Statistical',\n },\n {\n name: 'COVARIANCES',\n description: 'Returns the covariance between two data sets, sample normalized.',\n syntax: 'COVARIANCES(Data1, Data2)',\n section: 'Statistical',\n },\n {\n name: 'CRITBINOM',\n description: 'Returns inverse binomial distribution value.',\n syntax: 'CRITBINOM(Number1, Number2, Number3)',\n section: 'Statistical',\n },\n {\n name: 'DEVSQ',\n description: 'Returns sum of squared deviations.',\n syntax: 'DEVSQ(Number1, Number2, ...NumberN)',\n section: 'Statistical',\n },\n {\n name: 'EXPON.DIST',\n description: 'Returns density of an exponential distribution.',\n syntax: 'EXPON.DIST(Number1, Number2, Boolean)',\n section: 'Statistical',\n },\n {\n name: 'EXPONDIST',\n description: 'Returns density of an exponential distribution.',\n syntax: 'EXPONDIST(Number1, Number2, Boolean)',\n section: 'Statistical',\n },\n {\n name: 'FDIST',\n description: 'Returns probability of F right-side distribution.',\n syntax: 'FDIST(X, Degree1, Degree2)',\n section: 'Statistical',\n },\n {\n name: 'FINV',\n description: 'Returns inverse of F right-side distribution.',\n syntax: 'FINV(P, Degree1, Degree2)',\n section: 'Statistical',\n },\n {\n name: 'F.DIST',\n description: 'Returns value of F distribution.',\n syntax: 'F.DIST(X, Degree1, Degree2, Mode)',\n section: 'Statistical',\n },\n {\n name: 'F.DIST.RT',\n description: 'Returns probability of F right-side distribution.',\n syntax: 'F.DIST.RT(X, Degree1, Degree2)',\n section: 'Statistical',\n },\n {\n name: 'FDISTRT',\n description: 'Returns probability of F right-side distribution.',\n syntax: 'FDISTRT(X, Degree1, Degree2)',\n section: 'Statistical',\n },\n {\n name: 'F.INV',\n description: 'Returns inverse of F distribution.',\n syntax: 'F.INV.RT(P, Degree1, Degree2)',\n section: 'Statistical',\n },\n {\n name: 'F.INV.RT',\n description: 'Returns inverse of F right-side distribution.',\n syntax: 'F.INV.RT(P, Degree1, Degree2)',\n section: 'Statistical',\n },\n {\n name: 'FINVRT',\n description: 'Returns inverse of F right-side distribution.',\n syntax: 'FINVRT(P, Degree1, Degree2)',\n section: 'Statistical',\n },\n {\n name: 'FISHER',\n description: 'Returns Fisher transformation value.',\n syntax: 'FISHER(Number)',\n section: 'Statistical',\n },\n {\n name: 'FISHERINV',\n description: 'Returns inverse Fisher transformation value.',\n syntax: 'FISHERINV(Number)',\n section: 'Statistical',\n },\n {\n name: 'F.TEST',\n description: 'Returns f-test value for a dataset.',\n syntax: 'Z.TEST(Array1, Array2)',\n section: 'Statistical',\n },\n {\n name: 'FTEST',\n description: 'Returns f-test value for a dataset.',\n syntax: 'ZTEST(Array1, Array2)',\n section: 'Statistical',\n },\n {\n name: 'GAMMA',\n description: 'Returns value of Gamma function.',\n syntax: 'GAMMA(Number)',\n section: 'Statistical',\n },\n {\n name: 'GAMMA.DIST',\n description: 'Returns density of Gamma distribution.',\n syntax: 'GAMMA.DIST(Number1, Number2, Number3, Boolean)',\n section: 'Statistical',\n },\n {\n name: 'GAMMADIST',\n description: 'Returns density of Gamma distribution.',\n syntax: 'GAMMADIST(Number1, Number2, Number3, Boolean)',\n section: 'Statistical',\n },\n {\n name: 'GAMMALN',\n description: 'Returns natural logarithm of Gamma function.',\n syntax: 'GAMMALN(Number)',\n section: 'Statistical',\n },\n {\n name: 'GAMMALN.PRECISE',\n description: 'Returns natural logarithm of Gamma function.',\n syntax: 'GAMMALN.PRECISE(Number)',\n section: 'Statistical',\n },\n {\n name: 'GAMMA.INV',\n description: 'Returns inverse Gamma distribution value.',\n syntax: 'GAMMA.INV(Number1, Number2, Number3)',\n section: 'Statistical',\n },\n {\n name: 'GAMMAINV',\n description: 'Returns inverse Gamma distribution value.',\n syntax: 'GAMMAINV(Number1, Number2, Number3)',\n section: 'Statistical',\n },\n {\n name: 'GAUSS',\n description:\n 'Returns the probability of gaussian variable fall more than this many times standard deviation from mean.',\n syntax: 'GAUSS(Number)',\n section: 'Statistical',\n },\n {\n name: 'GEOMEAN',\n description: 'Returns the geometric average.',\n syntax: 'GEOMEAN(Number1, Number2, ...NumberN)',\n section: 'Statistical',\n },\n {\n name: 'HARMEAN',\n description: 'Returns the harmonic average.',\n syntax: 'HARMEAN(Number1, Number2, ...NumberN)',\n section: 'Statistical',\n },\n {\n name: 'HYPGEOMDIST',\n description: 'Returns density of hypergeometric distribution.',\n syntax: 'HYPGEOMDIST(Number1, Number2, Number3, Number4, Boolean)',\n section: 'Statistical',\n },\n {\n name: 'HYPGEOM.DIST',\n description: 'Returns density of hypergeometric distribution.',\n syntax: 'HYPGEOM.DIST(Number1, Number2, Number3, Number4, Boolean)',\n section: 'Statistical',\n },\n {\n name: 'LARGE',\n description: 'Returns k-th largest value in a range.',\n syntax: 'LARGE(Range, K)',\n section: 'Statistical',\n },\n {\n name: 'LOGNORM.DIST',\n description: 'Returns density of lognormal distribution.',\n syntax: 'LOGNORM.DIST(X, Mean, Stddev, Mode)',\n section: 'Statistical',\n },\n {\n name: 'LOGNORMDIST',\n description: 'Returns density of lognormal distribution.',\n syntax: 'LOGNORMDIST(X, Mean, Stddev, Mode)',\n section: 'Statistical',\n },\n {\n name: 'LOGNORM.INV',\n description: 'Returns value of inverse lognormal distribution.',\n syntax: 'LOGNORM.INV(P, Mean, Stddev)',\n section: 'Statistical',\n },\n {\n name: 'LOGNORMINV',\n description: 'Returns value of inverse lognormal distribution.',\n syntax: 'LOGNORMINV(P, Mean, Stddev)',\n section: 'Statistical',\n },\n {\n name: 'LOGINV',\n description: 'Returns value of inverse lognormal distribution.',\n syntax: 'LOGINV(P, Mean, Stddev)',\n section: 'Statistical',\n },\n {\n name: 'MAX',\n description: 'Returns the maximum value in a list of arguments.',\n syntax: 'MAX(Number1, Number2, ...NumberN)',\n section: 'Statistical',\n },\n {\n name: 'MAXA',\n description: 'Returns the maximum value in a list of arguments.',\n syntax: 'MAXA(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'MAXIFS',\n description: 'Returns the maximum value of the cells in a range that meet a set of criteria.',\n syntax:\n 'MAXIFS(Max_Range, Criterion_range1, Criterion1 [, Criterion_range2, Criterion2 [, ...Criterion_rangeN, CriterionN]])',\n section: 'Statistical',\n },\n {\n name: 'MEDIAN',\n description: 'Returns the median of a set of numbers.',\n syntax: 'MEDIAN(Number1, Number2, ...NumberN)',\n section: 'Statistical',\n },\n {\n name: 'MIN',\n description: 'Returns the minimum value in a list of arguments.',\n syntax: 'MIN(Number1, Number2, ...NumberN)',\n section: 'Statistical',\n },\n {\n name: 'MINA',\n description: 'Returns the minimum value in a list of arguments.',\n syntax: 'MINA(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'MINIFS',\n description: 'Returns the minimum value of the cells in a range that meet a set of criteria.',\n syntax:\n 'MINIFS(Min_Range, Criterion_range1, Criterion1 [, Criterion_range2, Criterion2 [, ...Criterion_rangeN, CriterionN]])',\n section: 'Statistical',\n },\n {\n name: 'NEGBINOM.DIST',\n description: 'Returns density of negative binomial distribution.',\n syntax: 'NEGBINOM.DIST(Number1, Number2, Number3, Mode)',\n section: 'Statistical',\n },\n {\n name: 'NEGBINOMDIST',\n description: 'Returns density of negative binomial distribution.',\n syntax: 'NEGBINOMDIST(Number1, Number2, Number3, Mode)',\n section: 'Statistical',\n },\n {\n name: 'NORM.DIST',\n description: 'Returns density of normal distribution.',\n syntax: 'NORM.DIST(X, Mean, Stddev, Mode)',\n section: 'Statistical',\n },\n {\n name: 'NORMDIST',\n description: 'Returns density of normal distribution.',\n syntax: 'NORMDIST(X, Mean, Stddev, Mode)',\n section: 'Statistical',\n },\n {\n name: 'NORM.S.DIST',\n description: 'Returns density of normal distribution.',\n syntax: 'NORM.S.DIST(X, Mode)',\n section: 'Statistical',\n },\n {\n name: 'NORMDIST',\n description: 'Returns density of normal distribution.',\n syntax: 'NORMSDIST(X, Mode)',\n section: 'Statistical',\n },\n {\n name: 'NORM.INV',\n description: 'Returns value of inverse normal distribution.',\n syntax: 'NORM.INV(P, Mean, Stddev)',\n section: 'Statistical',\n },\n {\n name: 'NORMINV',\n description: 'Returns value of inverse normal distribution.',\n syntax: 'NORMINV(P, Mean, Stddev)',\n section: 'Statistical',\n },\n {\n name: 'NORM.S.INV',\n description: 'Returns value of inverse normal distribution.',\n syntax: 'NORM.S.INV(P)',\n section: 'Statistical',\n },\n {\n name: 'NORMSINV',\n description: 'Returns value of inverse normal distribution.',\n syntax: 'NORMSINV(P)',\n section: 'Statistical',\n },\n {\n name: 'PEARSON',\n description: 'Returns the correlation coefficient between two data sets.',\n syntax: 'PEARSON(Data1, Data2)',\n section: 'Statistical',\n },\n {\n name: 'PHI',\n description: 'Returns probability density of normal distribution.',\n syntax: 'PHI(X)',\n section: 'Statistical',\n },\n {\n name: 'POISSON',\n description: 'Returns density of Poisson distribution.',\n syntax: 'POISSON(X, Mean, Mode)',\n section: 'Statistical',\n },\n {\n name: 'POISSON.DIST',\n description: 'Returns density of Poisson distribution.',\n syntax: 'POISSON.DIST(X, Mean, Mode)',\n section: 'Statistical',\n },\n {\n name: 'POISSONDIST',\n description: 'Returns density of Poisson distribution.',\n syntax: 'POISSONDIST(X, Mean, Mode)',\n section: 'Statistical',\n },\n {\n name: 'RSQ',\n description: 'Returns the squared correlation coefficient between two data sets.',\n syntax: 'RSQ(Data1, Data2)',\n section: 'Statistical',\n },\n {\n name: 'SKEW',\n description: 'Returns skewness of a sample.',\n syntax: 'SKEW(Number1, Number2, ...NumberN)',\n section: 'Statistical',\n },\n {\n name: 'SKEW.P',\n description: 'Returns skewness of a population.',\n syntax: 'SKEW.P(Number1, Number2, ...NumberN)',\n section: 'Statistical',\n },\n {\n name: 'SKEWP',\n description: 'Returns skewness of a population.',\n syntax: 'SKEWP(Number1, Number2, ...NumberN)',\n section: 'Statistical',\n },\n {\n name: 'SLOPE',\n description: 'Returns the slope of a linear regression line.',\n syntax: 'SLOPE(Array1, Array2)',\n section: 'Statistical',\n },\n {\n name: 'SMALL',\n description: 'Returns k-th smallest value in a range.',\n syntax: 'SMALL(Range, K)',\n section: 'Statistical',\n },\n {\n name: 'STANDARDIZE',\n description: 'Returns normalized value with respect to expected value and standard deviation.',\n syntax: 'STANDARDIZE(X, Mean, Stddev)',\n section: 'Statistical',\n },\n {\n name: 'STDEV',\n description: 'Returns standard deviation of a sample.',\n syntax: 'STDEV(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'STDEVA',\n description: 'Returns standard deviation of a sample.',\n syntax: 'STDEVA(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'STDEVP',\n description: 'Returns standard deviation of a population.',\n syntax: 'STDEVP(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'STDEV.P',\n description: 'Returns standard deviation of a population.',\n syntax: 'STDEV.P(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'STDEVPA',\n description: 'Returns standard deviation of a population.',\n syntax: 'STDEVPA(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'STDEV.S',\n description: 'Returns standard deviation of a sample.',\n syntax: 'STDEV.S(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'STDEVS',\n description: 'Returns standard deviation of a sample.',\n syntax: 'STDEVS(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'STEYX',\n description: 'Returns standard error for predicted of the predicted y value for each x value.',\n syntax: 'STEYX(Array1, Array2)',\n section: 'Statistical',\n },\n {\n name: 'TDIST',\n description: 'Returns density of Student-t distribution, both-sided or right-tailed.',\n syntax: 'TDIST(X, Degrees, Mode)',\n section: 'Statistical',\n },\n {\n name: 'T.DIST',\n description: 'Returns density of Student-t distribution.',\n syntax: 'T.DIST(X, Degrees, Mode)',\n section: 'Statistical',\n },\n {\n name: 'T.DIST.2T',\n description: 'Returns density of Student-t distribution, both-sided.',\n syntax: 'T.DIST.2T(X, Degrees)',\n section: 'Statistical',\n },\n {\n name: 'TDIST2T',\n description: 'Returns density of Student-t distribution, both-sided.',\n syntax: 'TDIST2T(X, Degrees)',\n section: 'Statistical',\n },\n {\n name: 'T.DIST.RT',\n description: 'Returns density of Student-t distribution, right-tailed.',\n syntax: 'T.DIST.RT(X, Degrees)',\n section: 'Statistical',\n },\n {\n name: 'TDISTRT',\n description: 'Returns density of Student-t distribution, right-tailed.',\n syntax: 'TDISTRT(X, Degrees)',\n section: 'Statistical',\n },\n {\n name: 'TINV',\n description: 'Returns inverse Student-t distribution, both-sided.',\n syntax: 'TINV(P, Degrees)',\n section: 'Statistical',\n },\n {\n name: 'T.INV',\n description: 'Returns inverse Student-t distribution.',\n syntax: 'T.INV(P, Degrees)',\n section: 'Statistical',\n },\n {\n name: 'T.INV.2T',\n description: 'Returns inverse Student-t distribution, both-sided.',\n syntax: 'T.INV.2T(P, Degrees)',\n section: 'Statistical',\n },\n {\n name: 'TINV2T',\n description: 'Returns inverse Student-t distribution, both-sided.',\n syntax: 'TINV2T(P, Degrees)',\n section: 'Statistical',\n },\n {\n name: 'TTEST',\n description: 'Returns t-test value for a dataset.',\n syntax: 'TTEST(Array1, Array2)',\n section: 'Statistical',\n },\n {\n name: 'T.TEST',\n description: 'Returns t-test value for a dataset.',\n syntax: 'T.TEST(Array1, Array2)',\n section: 'Statistical',\n },\n {\n name: 'VAR',\n description: 'Returns variance of a sample.',\n syntax: 'VAR(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'VARA',\n description: 'Returns variance of a sample.',\n syntax: 'VARA(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'VARP',\n description: 'Returns variance of a population.',\n syntax: 'VARP(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'VAR.P',\n description: 'Returns variance of a population.',\n syntax: 'VAR.P(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'VARPA',\n description: 'Returns variance of a population.',\n syntax: 'VARPA(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'VAR.S',\n description: 'Returns variance of a sample.',\n syntax: 'VAR.S(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'VARS',\n description: 'Returns variance of a sample.',\n syntax: 'VARS(Value1, Value2, ...ValueN)',\n section: 'Statistical',\n },\n {\n name: 'WEIBULL',\n description: 'Returns density of Weibull distribution.',\n syntax: 'WEIBULL(Number1, Number2, Number3, Boolean)',\n section: 'Statistical',\n },\n {\n name: 'WEIBULL.DIST',\n description: 'Returns density of Weibull distribution.',\n syntax: 'WEIBULL.DIST(Number1, Number2, Number3, Boolean)',\n section: 'Statistical',\n },\n {\n name: 'WEIBULLDIST',\n description: 'Returns density of Weibull distribution.',\n syntax: 'WEIBULLDIST(Number1, Number2, Number3, Boolean)',\n section: 'Statistical',\n },\n {\n name: 'Z.TEST',\n description: 'Returns z-test value for a dataset.',\n syntax: 'Z.TEST(Array, X[, Sigma])',\n section: 'Statistical',\n },\n {\n name: 'ZTEST',\n description: 'Returns z-test value for a dataset.',\n syntax: 'ZTEST(Array, X[, Sigma])',\n section: 'Statistical',\n },\n\n // Text\n\n {\n name: 'CHAR',\n description: 'Converts a number into a character according to the current code table.',\n syntax: 'CHAR(Number)',\n section: 'Text',\n },\n {\n name: 'CLEAN',\n description: 'Returns text that has been \"cleaned\" of line breaks and other non-printable characters.',\n syntax: 'CLEAN(\"Text\")',\n section: 'Text',\n },\n {\n name: 'CODE',\n description: 'Returns a numeric code for the first character in a text string.',\n syntax: 'CODE(\"Text\")',\n section: 'Text',\n },\n {\n name: 'CONCATENATE',\n description: 'Combines several text strings into one string.',\n syntax: 'CONCATENATE(\"Text1\", \"Text2\", ...\"TextN\")',\n section: 'Text',\n },\n {\n name: 'EXACT',\n description: 'Returns TRUE if both text strings are exactly the same.',\n syntax: 'EXACT(Text, Text)',\n section: 'Text',\n },\n {\n name: 'FIND',\n description: 'Returns the location of one text string inside another.',\n syntax: 'FIND( \"Text1\", \"Text2\"[, Number])',\n section: 'Text',\n },\n {\n name: 'LEFT',\n description: 'Extracts a given number of characters from the left side of a text string.',\n syntax: 'LEFT(\"Text\", Number)',\n section: 'Text',\n },\n {\n name: 'LEN',\n description: 'Returns length of a given text.',\n syntax: 'LEN(\"Text\")',\n section: 'Text',\n },\n {\n name: 'LOWER',\n description: 'Returns text converted to lowercase.',\n syntax: 'LOWER(Text)',\n section: 'Text',\n },\n {\n name: 'MID',\n description: 'Returns substring of a given length starting from Start_position.',\n syntax: 'MID(Text, Start_position, Length)',\n section: 'Text',\n },\n {\n name: 'PROPER',\n description: 'Capitalizes words given text string.',\n syntax: 'PROPER(\"Text\")',\n section: 'Text',\n },\n {\n name: 'REPLACE',\n description: 'Replaces substring of a text of a given length that starts at given position.',\n syntax: 'REPLACE(Text, Start_position, Length, New_text)',\n section: 'Text',\n },\n {\n name: 'REPT',\n description: 'Repeats text a given number of times.',\n syntax: 'REPT(\"Text\", Number)',\n section: 'Text',\n },\n {\n name: 'RIGHT',\n description: 'Extracts a given number of characters from the right side of a text string.',\n syntax: 'RIGHT(\"Text\", Number)',\n section: 'Text',\n },\n {\n name: 'SEARCH',\n description: 'Returns the location of Search_string inside Text. Case-insensitive. Allows the use of wildcards.',\n syntax: 'SEARCH(Search_string, Text[, Start_position])',\n section: 'Text',\n },\n {\n name: 'SPLIT',\n description:\n 'Divides the provided text using the space character as a separator and returns the substring at the zero-based position specified by the second argument.',\n syntax: 'SPLIT(Text, Index)',\n section: 'Text',\n },\n {\n name: 'SUBSTITUTE',\n description:\n 'Returns string where occurrences of Old_text are replaced by New_text. Replaces only specific occurrence if last parameter is provided.',\n syntax: 'SUBSTITUTE(Text, Old_text, New_text, [Occurrence])',\n section: 'Text',\n },\n {\n name: 'T',\n description: 'Returns text if given value is text, empty string otherwise.',\n syntax: 'T(Value)',\n section: 'Text',\n },\n {\n name: 'TEXT',\n description: 'Converts a number into text according to a given format.',\n syntax: 'TEXT(Number, Format)',\n section: 'Text',\n },\n {\n name: 'TRIM',\n description: 'Strips extra spaces from text.',\n syntax: 'TRIM(\"Text\")',\n section: 'Text',\n },\n {\n name: 'UNICHAR',\n description: 'Returns the character created by using provided code point.',\n syntax: 'UNICHAR(Number)',\n section: 'Text',\n },\n {\n name: 'UNICODE',\n description: 'Returns the Unicode code point of a first character of a text.',\n syntax: 'UNICODE(Text)',\n section: 'Text',\n },\n {\n name: 'UPPER',\n description: 'Returns text converted to uppercase.',\n syntax: 'UPPER(Text)',\n section: 'Text',\n },\n];\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { FunctionPluginDefinition } from 'hyperformula';\nimport type { ConfigParams } from 'hyperformula/typings/ConfigParams';\nimport type { FunctionTranslationsPackage } from 'hyperformula/typings/interpreter';\nimport defaultsDeep from 'lodash.defaultsdeep';\n\nimport { type SpaceId, type Space } from '@dxos/client/echo';\nimport { Resource } from '@dxos/context';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\n\nimport { HyperFormula } from '#hyperformula';\nimport { ComputeGraph } from './compute-graph';\nimport { EdgeFunctionPlugin, EdgeFunctionPluginTranslations, type FunctionContextOptions } from './functions';\n\nexport type ComputeGraphPlugin = {\n plugin: FunctionPluginDefinition;\n translations: FunctionTranslationsPackage;\n};\n\nexport type ComputeGraphOptions = {\n plugins?: ComputeGraphPlugin[];\n} & Partial<FunctionContextOptions> &\n Partial<ConfigParams>;\n\nexport const defaultOptions: ComputeGraphOptions = {\n licenseKey: 'gpl-v3',\n};\n\nexport const defaultPlugins: ComputeGraphPlugin[] = [\n {\n plugin: EdgeFunctionPlugin,\n translations: EdgeFunctionPluginTranslations,\n },\n];\n\n/**\n * Manages a collection of ComputeGraph instances for each space.\n *\n * [ComputePlugin] => [ComputeGraphRegistry] => [ComputeGraph(Space)] => [ComputeNode(Object)]\n *\n * NOTE: The ComputeGraphRegistry manages the hierarchy of resources via its root Context.\n * NOTE: The package.json file defines the packaged #hyperformula module.\n */\n// TODO(burdon): Move graph into separate plugin; isolate HF deps.\nexport class ComputeGraphRegistry extends Resource {\n private readonly _graphs = new Map<SpaceId, ComputeGraph>();\n\n private readonly _options: ComputeGraphOptions;\n\n constructor(options: ComputeGraphOptions = { plugins: defaultPlugins }) {\n super();\n this._options = defaultsDeep({}, options, defaultOptions);\n this._options.plugins?.forEach(({ plugin, translations }) => {\n HyperFormula.registerFunctionPlugin(plugin, translations);\n });\n }\n\n getGraph(spaceId: SpaceId): ComputeGraph | undefined {\n return this._graphs.get(spaceId);\n }\n\n getOrCreateGraph(space: Space): ComputeGraph {\n let graph = this._graphs.get(space.id);\n if (!graph) {\n log('create graph', { space: space.id });\n graph = this.createGraph(space);\n }\n\n return graph;\n }\n\n createGraph(space: Space): ComputeGraph {\n invariant(!this._graphs.has(space.id), `ComputeGraph already exists for space: ${space.id}`);\n const hf = HyperFormula.buildEmpty(this._options);\n const graph = new ComputeGraph(hf, space, this._options);\n this._graphs.set(space.id, graph);\n return graph;\n }\n\n protected override async _close() {\n for (const graph of this._graphs.values()) {\n await graph.close();\n }\n this._graphs.clear();\n }\n}\n"],
5
+ "mappings": ";;;;;AAMA,SAASA,SAAAA,cAAa;AACtB,SAAqBC,UAAAA,SAAQC,wBAAwB;AACrD,SAASC,oBAAoB;AAC7B,SAASC,YAAAA,iBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,aAAAA,kBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,OAAAA,YAAW;AACpB,SAASC,gBAAAA,qBAAoB;AAC7B,SAASC,eAAAA,oBAAmB;AAE5B,SAASC,0BAA6C;;;ACVtD,SAASC,aAAa;AACtB,SAASC,gBAAgB;AAEzB,SAASC,yBAAyB;;;ACF3B,IAAMC,WAAW;AAIjB,IAAMC,aAAa;AA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EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;;EAIA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;;EAIA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aACE;IACFC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;;EAIA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aACE;IACFC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aACE;IACFC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;;EAIA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aACE;IACFC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;;EAIA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aACE;IACFC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aACE;IACFC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;;EAIA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aACE;IACFC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aACE;IACFC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aACE;IACFC,QACE;IACFC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;;EAIA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aACE;IACFC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aACE;IACFC,QAAQ;IACRC,SAAS;EAC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C,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aACE;IACFC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QACE;IACFC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QACE;IACFC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;;EAIA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aAAa;IACbC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aACE;IACFC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH,MAAM;IACNC,aACE;IACFC,QAAQ;IACRC,SAAS;EACX;EACA;IACEH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MAAK;EACpB;AACF;",
6
+ "names": ["Event", "Filter", "fullyQualifiedId", "FQ_ID_LENGTH", "Resource", "getTypename", "invariant", "PublicKey", "log", "FunctionType", "nonNullable", "ExportedCellChange", "Event", "Resource", "DetailedCellError", "alignKey", "commentKey", "styleKey", "cellClassNameForRange", "key", "value", "undefined", "invariant", "DEFAULT_ROWS", "DEFAULT_COLUMNS", "MAX_ROWS", "MAX_COLUMNS", "RANGE_NOTATION", "isFormula", "value", "charAt", "posEquals", "a", "b", "col", "row", "columnLetter", "String", "fromCharCode", "charCodeAt", "Math", "floor", "addressToA1Notation", "addressFromA1Notation", "ref", "match", "parseInt", "split", "reduce", "acc", "c", "rangeToA1Notation", "range", "from", "to", "filter", "Boolean", "join", "rangeFromA1Notation", "map", "inRange", "cell", "c1", "r1", "c2", "r2", "cMin", "min", "cMax", "max", "rMin", "rMax", "randomBytes", "invariant", "create", "ApiError", "Error", "ReadonlyException", "RangeException", "constructor", "n", "createIndex", "length", "characters", "charactersLength", "randomBuffer", "randomBytes", "Array", "from", "byte", "join", "createIndices", "map", "insertIndices", "indices", "i", "max", "idx", "splice", "initialize", "sheet", "rows", "DEFAULT_ROWS", "columns", "DEFAULT_COLUMNS", "MAX_ROWS", "MAX_COLUMNS", "createSheet", "name", "cells", "size", "create", "SheetType", "rowMeta", "columnMeta", "ranges", "threads", "Object", "entries", "forEach", "key", "value", "addressToIndex", "addressFromA1Notation", "isFormula", "mapFormulaRefsToIndices", "cell", "col", "row", "addressFromIndex", "column", "split", "indexOf", "rangeToIndex", "range", "to", "rangeFromIndex", "index", "compareIndexPositions", "indexA", "indexB", "rowA", "columnA", "rowB", "columnB", "formula", "invariant", "replace", "match", "mapFormulaIndicesToRefs", "addressToA1Notation", "ComputeNode", "Resource", "constructor", "_graph", "sheetId", "update", "Event", "graph", "clear", "hf", "clearSheet", "getValue", "cell", "value", "getCellValue", "sheet", "row", "col", "DetailedCellError", "setValue", "mappedValue", "isFormula", "mapFormulaToNative", "setCellContents", "_open", "defaultsDeep", "debounce", "log", "CellError", "ErrorType", "EmptyValue", "FunctionPlugin", "defaultFunctionContextOptions", "defaultTtl", "debounceDelay", "remoteFunctionUrl", "FunctionContext", "createInvocationKey", "name", "args", "JSON", "stringify", "constructor", "_hf", "_space", "_options", "_cache", "Map", "_pending", "_subscriptions", "_invocations", "_onUpdate", "update", "resumeEvaluation", "onUpdate", "space", "info", "cache", "size", "invocations", "flush", "clear", "forEach", "unsubscribe", "createSubscription", "get", "set", "invokeFunction", "state", "cb", "options", "ttl", "formulaAddress", "cell", "invocationKey", "value", "undefined", "ts", "now", "Date", "delta", "has", "setTimeout", "err", "warn", "ERROR", "delete", "AsyncFunctionPlugin", "context", "config", "runAsyncFunction", "ast", "procedureName", "metadata", "runFunction", "effect", "Filter", "getMeta", "log", "getUserFunctionUrlInMetadata", "FunctionType", "nonNullable", "CellError", "ErrorType", "FunctionArgumentType", "EDGE_FUNCTION_NAME", "FUNCTION_TTL", "EdgeFunctionPlugin", "AsyncFunctionPlugin", "dx", "ast", "state", "handler", "subscribe", "binding", "args", "space", "context", "CellError", "ErrorType", "REF", "objects", "fn", "db", "query", "Filter", "schema", "FunctionType", "run", "log", "info", "unsubscribe", "effect", "_", "version", "runAsyncFunction", "ttl", "createSubscription", "procedureName", "path", "getUserFunctionUrlInMetadata", "getMeta", "response", "fetch", "remoteFunctionUrl", "method", "headers", "body", "JSON", "stringify", "filter", "nonNullable", "result", "text", "implementedFunctions", "parameters", "argumentType", "FunctionArgumentType", "STRING", "ANY", "optionalArg", "isVolatile", "EdgeFunctionPluginTranslations", "enGB", "enUS", "defaultFunctions", "name", "description", "syntax", "section", "UNKNOWN_BINDING", "createSheetName", "type", "id", "parseSheetName", "name", "split", "ComputeGraph", "Resource", "constructor", "_hf", "_space", "_options", "PublicKey", "random", "truncate", "_nodes", "Map", "_remoteFunctions", "update", "Event", "contextOptions", "onUpdate", "emit", "context", "FunctionContext", "updateConfig", "onValuesUpdate", "changes", "change", "ExportedCellChange", "sheet", "node", "get", "on", "_ctx", "onDispose", "off", "hf", "getFunctions", "standard", "echo", "getRegisteredFunctionNames", "map", "defaultFunctions", "find", "fn", "binding", "getOrCreateNode", "invariant", "length", "doesSheetExist", "log", "space", "addSheet", "sheetId", "getSheetId", "undefined", "ComputeNode", "set", "mapFormulaToNative", "formula", "replace", "_match", "objects", "getSheetNames", "db", "getObjectById", "filter", "nonNullable", "obj", "getTypename", "match", "args", "trim", "EDGE_FUNCTION_NAME", "mapFunctionBindingToId", "fullyQualifiedId", "mapFunctionBindingFromId", "spaceId", "objectId", "FQ_ID_LENGTH", "startsWith", "_open", "query", "Filter", "schema", "FunctionType", "unsubscribe", "subscribe", "_close", "values", "close", "defaultsDeep", "Resource", "invariant", "log", "HyperFormula", "defaultOptions", "licenseKey", "defaultPlugins", "plugin", "EdgeFunctionPlugin", "translations", "EdgeFunctionPluginTranslations", "ComputeGraphRegistry", "Resource", "constructor", "options", "plugins", "_graphs", "Map", "_options", "defaultsDeep", "forEach", "HyperFormula", "registerFunctionPlugin", "getGraph", "spaceId", "get", "getOrCreateGraph", "space", "graph", "id", "log", "createGraph", "invariant", "has", "hf", "buildEmpty", "ComputeGraph", "set", "_close", "values", "close", "clear"]
7
+ }
@@ -64,4 +64,4 @@ export {
64
64
  RowColumnMeta,
65
65
  SheetType
66
66
  };
67
- //# sourceMappingURL=chunk-BVUN7SHF.mjs.map
67
+ //# sourceMappingURL=chunk-JXFPOYNA.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SurfaceProvides,\n TranslationsProvides,\n IntentData,\n} from '@dxos/app-framework';\nimport { ref, S, TypedObject } from '@dxos/echo-schema';\nimport { type MarkdownExtensionProvides } from '@dxos/plugin-markdown';\nimport { type SchemaProvides } from '@dxos/plugin-space';\nimport { ThreadType } from '@dxos/plugin-space/types';\nimport { type StackProvides } from '@dxos/plugin-stack';\nimport { type DxGridAxis } from '@dxos/react-ui-grid';\n\nimport { SHEET_PLUGIN } from './meta';\nimport { type SheetModel } from './model';\n\nconst SHEET_ACTION = `${SHEET_PLUGIN}/action`;\n\nexport enum SheetAction {\n CREATE = `${SHEET_ACTION}/create`,\n INSERT_AXIS = `${SHEET_ACTION}/axis-insert`,\n DROP_AXIS = `${SHEET_ACTION}/axis-drop`,\n}\n\nexport type RestoreAxis = {\n axis: DxGridAxis;\n axisIndex: string;\n index: number;\n axisMeta?: S.Schema.Type<typeof RowColumnMeta>;\n values: CellScalarValue[];\n};\n\nexport namespace SheetAction {\n export type Create = IntentData<{ sheet: SheetType }>;\n export type InsertAxis = IntentData<{ model: SheetModel; axis: DxGridAxis; index: number; count?: number }>;\n export type DropAxis = IntentData<{ model: SheetModel; axis: DxGridAxis; axisIndex: string }>;\n export type DropAxisRestore = IntentData<RestoreAxis & { model: SheetModel }>;\n}\n\n// TODO(Zan): Move this to the plugin-space plugin or another common location\n// when we implement comments in sheets.\n// This is currently duplicated in a few places.\ntype ThreadProvides<T> = {\n thread: {\n predicate: (obj: any) => obj is T;\n createSort: (obj: T) => (anchorA: string | undefined, anchorB: string | undefined) => number;\n };\n};\n\nexport type SheetPluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n MarkdownExtensionProvides &\n MetadataRecordsProvides &\n TranslationsProvides &\n SchemaProvides &\n StackProvides &\n ThreadProvides<SheetType>;\n\nexport type CellScalarValue = number | string | boolean | null;\n\nexport const CellValue = S.Struct({\n // TODO(burdon): How to store dates (datetime, date, time), percentages, etc.\n // Consider import/export; natural access for other plugins. Special handling for currency (precision).\n // TODO(burdon): Automerge (long string) or short string or number.\n value: S.Any,\n});\n\nexport type CellValue = S.Schema.Type<typeof CellValue>;\n\n// TODO(burdon): IMPORTANT: Reconcile with Field definition.\nexport const Range = S.Struct({\n range: S.String,\n key: S.String,\n value: S.String,\n});\n\nexport type Range = S.Schema.Type<typeof Range>;\n\n// TODO(burdon): Visibility, locked, frozen, etc.\nexport const RowColumnMeta = S.Struct({\n size: S.optional(S.Number),\n});\n\n// TODO(burdon): Index to all updates when rows/columns are inserted/deleted.\nexport class SheetType extends TypedObject({ typename: 'dxos.org/type/Sheet', version: '0.1.0' })({\n name: S.optional(S.String),\n\n // Sparse map of cells referenced by index.\n cells: S.mutable(S.Record({ key: S.String, value: S.mutable(CellValue) })),\n\n // Ordered row indices.\n rows: S.mutable(S.Array(S.String)),\n\n // Ordered column indices.\n columns: S.mutable(S.Array(S.String)),\n\n // Row metadata referenced by index.\n rowMeta: S.mutable(S.Record({ key: S.String, value: S.mutable(RowColumnMeta) })),\n\n // Column metadata referenced by index.\n columnMeta: S.mutable(S.Record({ key: S.String, value: S.mutable(RowColumnMeta) })),\n\n // Cell formatting referenced by indexed range.\n ranges: S.mutable(S.Array(Range)),\n\n // Threads associated with the sheet\n threads: S.optional(S.mutable(S.Array(ref(ThreadType)))),\n}) {}\n\nexport type SheetSize = {\n rows: number;\n columns: number;\n};\n\nexport type CreateSheetOptions = {\n name?: string;\n cells?: Record<string, CellValue>;\n} & Partial<SheetSize>;\n"],
5
+ "mappings": ";;;;;AAYA,SAASA,KAAKC,GAAGC,mBAAmB;AAGpC,SAASC,kBAAkB;AAO3B,IAAMC,eAAe,GAAGC,YAAAA;;UAEZC,cAAAA;wCACD,GAAGF,YAAAA,SAAqB,IAAA;6CACnB,GAAGA,YAAAA,cAA0B,IAAA;2CAC/B,GAAGA,YAAAA,YAAwB,IAAA;GAH7BE,gBAAAA,cAAAA,CAAAA,EAAAA;AA2CL,IAAMC,YAAYC,EAAEC,OAAO;;;;EAIhCC,OAAOF,EAAEG;AACX,CAAA;AAKO,IAAMC,QAAQJ,EAAEC,OAAO;EAC5BI,OAAOL,EAAEM;EACTC,KAAKP,EAAEM;EACPJ,OAAOF,EAAEM;AACX,CAAA;AAKO,IAAME,gBAAgBR,EAAEC,OAAO;EACpCQ,MAAMT,EAAEU,SAASV,EAAEW,MAAM;AAC3B,CAAA;AAGO,IAAMC,YAAN,cAAwBC,YAAY;EAAEC,UAAU;EAAuBC,SAAS;AAAQ,CAAA,EAAG;EAChGC,MAAMhB,EAAEU,SAASV,EAAEM,MAAM;;EAGzBW,OAAOjB,EAAEkB,QAAQlB,EAAEmB,OAAO;IAAEZ,KAAKP,EAAEM;IAAQJ,OAAOF,EAAEkB,QAAQnB,SAAAA;EAAW,CAAA,CAAA;;EAGvEqB,MAAMpB,EAAEkB,QAAQlB,EAAEqB,MAAMrB,EAAEM,MAAM,CAAA;;EAGhCgB,SAAStB,EAAEkB,QAAQlB,EAAEqB,MAAMrB,EAAEM,MAAM,CAAA;;EAGnCiB,SAASvB,EAAEkB,QAAQlB,EAAEmB,OAAO;IAAEZ,KAAKP,EAAEM;IAAQJ,OAAOF,EAAEkB,QAAQV,aAAAA;EAAe,CAAA,CAAA;;EAG7EgB,YAAYxB,EAAEkB,QAAQlB,EAAEmB,OAAO;IAAEZ,KAAKP,EAAEM;IAAQJ,OAAOF,EAAEkB,QAAQV,aAAAA;EAAe,CAAA,CAAA;;EAGhFiB,QAAQzB,EAAEkB,QAAQlB,EAAEqB,MAAMjB,KAAAA,CAAAA;;EAG1BsB,SAAS1B,EAAEU,SAASV,EAAEkB,QAAQlB,EAAEqB,MAAMM,IAAIC,UAAAA,CAAAA,CAAAA,CAAAA;AAC5C,CAAA,EAAA;AAAI;",
6
+ "names": ["ref", "S", "TypedObject", "ThreadType", "SHEET_ACTION", "SHEET_PLUGIN", "SheetAction", "CellValue", "S", "Struct", "value", "Any", "Range", "range", "String", "key", "RowColumnMeta", "size", "optional", "Number", "SheetType", "TypedObject", "typename", "version", "name", "cells", "mutable", "Record", "rows", "Array", "columns", "rowMeta", "columnMeta", "ranges", "threads", "ref", "ThreadType"]
7
+ }
@@ -13,8 +13,8 @@ import {
13
13
  defaultOptions,
14
14
  defaultPlugins,
15
15
  parseSheetName
16
- } from "./chunk-VMSX6Z4X.mjs";
17
- import "./chunk-BVUN7SHF.mjs";
16
+ } from "./chunk-F3HE6D3J.mjs";
17
+ import "./chunk-JXFPOYNA.mjs";
18
18
  import "./chunk-RABELMEQ.mjs";
19
19
  export {
20
20
  AsyncFunctionPlugin,
@@ -32,4 +32,4 @@ export {
32
32
  defaultPlugins,
33
33
  parseSheetName
34
34
  };
35
- //# sourceMappingURL=compute-graph-GGWUX644.mjs.map
35
+ //# sourceMappingURL=compute-graph-SNUS7HOH.mjs.map