{"version":3,"file":"formatters-DUqAOyc7.js","sources":["../../../app/javascript/shared/components/importer/validators.ts","../../../node_modules/@silevis/reactgrid/src/lib/Model/Range.ts","../../../node_modules/@silevis/reactgrid/src/lib/Model/CellMatrix.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/areLocationsEqual.ts","../../../node_modules/@silevis/reactgrid/src/lib/Model/AbstractPointerEventsController.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/internetExplorer.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/microsoftEdge.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/newLocation.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/selectRange.ts","../../../node_modules/@silevis/reactgrid/src/lib/Model/Behavior.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/getCompatibleCellAndTemplate.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/tryAppendChange.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/keyCodes.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/focusLocation.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/scrollHelpers.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/operatingSystem.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/elementSizeHelpers.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/getLocationFromClient.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/handleContextMenu.ts","../../../node_modules/@silevis/reactgrid/src/lib/Behaviors/CellSelectionBehavior.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/getActiveSelectedRange.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/emptyCell.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/wipeSelectedRanges.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/scrollIntoView.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/focuses.ts","../../../node_modules/@silevis/reactgrid/src/lib/Components/ResizeHint.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Behaviors/ResizeColumnBehavior.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Functions/componentDidUpdate.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/handleKeyDown.ts","../../../node_modules/@silevis/reactgrid/src/lib/Behaviors/ColumnSelectionBehavior.ts","../../../node_modules/@silevis/reactgrid/src/lib/Behaviors/RowSelectionBehavior.ts","../../../node_modules/@silevis/reactgrid/src/lib/Components/PartialArea.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Functions/isRangeIntersectsWith.ts","../../../node_modules/@silevis/reactgrid/src/lib/Behaviors/FillHandleBehavior.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Behaviors/ColumnReorderBehavior.ts","../../../node_modules/@silevis/reactgrid/src/lib/Behaviors/RowReorderBehavior.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/getDataToCopy.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/safari.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/handleCopy.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/tryAppendChangeHavingGroupId.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/pasteData.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/getNavigatorLanguage.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/parseLocaleNumber.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/handlePaste.ts","../../../node_modules/@silevis/reactgrid/src/lib/Behaviors/DefaultBehavior.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/getCellProperty.ts","../../../node_modules/@silevis/reactgrid/src/lib/CellTemplates/CheckboxCellTemplate.tsx","../../../node_modules/@silevis/reactgrid/src/lib/CellTemplates/keyCodeCheckings.ts","../../../node_modules/@silevis/reactgrid/src/lib/CellTemplates/timeUtils.ts","../../../node_modules/@silevis/reactgrid/src/lib/CellTemplates/getCharFromKeyCode.ts","../../../node_modules/@silevis/reactgrid/src/lib/CellTemplates/DateCellTemplate.tsx","../../../node_modules/@silevis/reactgrid/src/lib/CellTemplates/EmailCellTemplate.tsx","../../../node_modules/@silevis/reactgrid/src/lib/CellTemplates/ChevronCellTemplate.tsx","../../../node_modules/@silevis/reactgrid/src/lib/CellTemplates/HeaderCellTemplate.tsx","../../../node_modules/@silevis/reactgrid/src/lib/CellTemplates/NumberCellTemplate.tsx","../../../node_modules/@silevis/reactgrid/src/lib/CellTemplates/TextCellTemplate.tsx","../../../node_modules/@silevis/reactgrid/src/lib/CellTemplates/TimeCellTemplate.tsx","../../../node_modules/@silevis/reactgrid/src/lib/CellTemplates/DropdownCellTemplate.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Functions/defaultCellTemplates.ts","../../../node_modules/@silevis/reactgrid/src/lib/Model/State.ts","../../../node_modules/@silevis/reactgrid/src/lib/Model/CellMatrixBuilder.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/recalcVisibleRange.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/updateResponsiveSticky.ts","../../../node_modules/@silevis/reactgrid/src/lib/Model/EventHandlers.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/cellEditorCalculator.ts","../../../node_modules/@silevis/reactgrid/src/lib/Components/StateProvider.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Components/CellEditor.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Components/HiddenElement.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Components/ErrorBoundary.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Functions/firefox.ts","../../../node_modules/@silevis/reactgrid/src/lib/Components/GridRenderer.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Functions/i18n.ts","../../../node_modules/@silevis/reactgrid/src/lib/Components/LegacyBrowserGridRenderer.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Functions/excludeObjectProperties.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/isMobileDevice.ts","../../../node_modules/@silevis/reactgrid/src/lib/Components/ResizeHandle.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Components/CellRenderer.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Components/CellFocus.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Components/RowRenderer.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Components/FillHandleRangeSelection.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Components/FillHandle.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Components/FillHandleRenderer.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Components/SelectedRanges.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Components/Pane.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Functions/paneRendererPredicates.ts","../../../node_modules/@silevis/reactgrid/src/lib/Components/PanesRenderer.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Components/PaneShadow.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Functions/updateState.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/getDerivedStateFromProps.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/isSelectionKey.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/handleDoubleClick.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/handleKeyUp.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/handleCompositionEndOnCellTemplate.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/handleCompositionEnd.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/handleKeyDownOnCellTemplate.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/rangeSlicer.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/handleStateUpdate.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/isOnClickableArea.ts","../../../node_modules/@silevis/reactgrid/src/lib/Model/PointerEventsController.ts","../../../node_modules/@silevis/reactgrid/src/lib/Components/Line.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Components/Shadow.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Functions/copySelectedRangeToClipboard.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/getSelectedLocations.ts","../../../node_modules/@silevis/reactgrid/src/lib/Functions/getRowsFromClipboard.ts","../../../node_modules/@silevis/reactgrid/src/lib/Components/ContextMenu.tsx","../../../node_modules/@silevis/reactgrid/src/lib/Components/ReactGrid.tsx","../../../app/javascript/shared/components/grid_editor/constants.ts","../../../app/javascript/shared/components/grid_editor/cell_utils.ts","../../../app/javascript/shared/components/grid_editor/utils.ts","../../../app/javascript/shared/components/grid_editor/hooks/useGridColumnsMetaData.ts","../../../app/javascript/shared/components/grid_editor/components/EditModeCellWrap.tsx","../../../app/javascript/shared/components/grid_editor/components/DropdownInput.tsx","../../../app/javascript/shared/components/grid_editor/components/DropdownCellTemplate.tsx","../../../app/javascript/shared/components/grid_editor/components/MultiSelectCellTemplate.tsx","../../../app/javascript/shared/components/grid_editor/components/TextCellTemplate.tsx","../../../app/javascript/shared/components/grid_editor/components/NumberCellTemplate.tsx","../../../app/javascript/shared/components/grid_editor/components/DateCellTemplate.tsx","../../../app/javascript/shared/components/grid_editor/components/HeaderCellTemplate.tsx","../../../app/javascript/shared/components/grid_editor/components/NonEditableCellTemplate.tsx","../../../app/javascript/shared/components/grid_editor/components/MoneyInputCellTemplate.tsx","../../../app/javascript/shared/components/grid_editor/components/RowActionCellTemplate.tsx","../../../app/javascript/shared/components/grid_editor/hooks/useRowActionsMenuItems.ts","../../../app/javascript/shared/components/grid_editor/components/DataEditor.tsx","../../../app/javascript/shared/components/grid_editor/components/GridEditorFilters.tsx","../../../app/javascript/shared/components/grid_editor/components/TopActionBar.tsx","../../../app/javascript/shared/components/grid_editor/index.tsx","../../../app/javascript/shared/components/importer/hooks/useGridMaxHeight.ts","../../../app/javascript/shared/hooks/useAdaptToast.tsx","../../../app/javascript/css/icons/Link.jsx","../../../app/javascript/dashboards/components/common/UnitsColumn.tsx","../../../app/javascript/dashboards/components/health_checks/mutations/UpdateHealthCheck.ts","../../../app/javascript/dashboards/components/health_checks/hooks/useUpdateHealthCheck.ts","../../../app/javascript/dashboards/components/health_checks/components/HealthCheckRowActions.tsx","../../../app/javascript/dashboards/helpers/address/countries.ts","../../../app/javascript/dashboards/helpers/locations.ts","../../../app/javascript/dashboards/components/share_certificates/constant.ts","../../../app/javascript/dashboards/components/equity_transactions/constant.ts","../../../app/javascript/dashboards/components/surrender/fragments/esopGrantFragment.jsx","../../../app/javascript/dashboards/components/surrender/queries/grantSurrenderQuery.ts","../../../app/javascript/dashboards/components/surrender/hooks/useGrantSurrender.ts","../../../app/javascript/css/icons/Show.jsx","../../../app/javascript/dashboards/components/equity_transactions/queries/allEquityTransactionsQuery.ts","../../../app/javascript/dashboards/components/esop_grants/mutations/updateExerciseMutation.ts","../../../app/javascript/dashboards/components/share_certificates/fragments/ShareCertificateSummaryFragment.ts","../../../app/javascript/dashboards/components/share_certificates/queries/allCertificatesQuery.ts","../../../app/javascript/dashboards/components/esop_grants/hooks/useUpdateEsopExercise.ts","../../../app/javascript/dashboards/components/share_certificates/hooks/useCertificatesOptionsList.ts","../../../app/javascript/dashboards/components/esop_grants/queries/ExerciseStatsQuery.ts","../../../app/javascript/dashboards/components/esop_grants/hooks/useExerciseStats.ts","../../../app/javascript/dashboards/components/esop_grants/PriorExercises/ExerciseForm.tsx","../../../app/javascript/dashboards/components/esop_grants/PriorExercises/EditExerciseModal.tsx","../../../app/javascript/dashboards/components/esop_grants/PriorExercises/ExerciseRowActions.tsx","../../../app/javascript/dashboards/components/grants/constants.ts","../../../app/javascript/dashboards/components/esop_grants/utils.tsx","../../../app/javascript/dashboards/components/surrender/SurrenderDetailPane.tsx","../../../app/javascript/dashboards/components/equity_transactions/queries/RepurchaseEventQuery.ts","../../../app/javascript/dashboards/components/equity_transactions/hooks/useRepurchaseEvent.ts","../../../app/javascript/dashboards/components/common/AdaptDeleteDialog.tsx","../../../app/javascript/dashboards/components/common/mutations/deleteAttachmentMutation.ts","../../../app/javascript/dashboards/components/common/hooks/useDeleteAttachment.ts","../../../app/javascript/dashboards/components/common/adapt-documents/FileView.tsx","../../../app/javascript/dashboards/components/common/adapt-documents/AttachmentList.tsx","../../../app/javascript/dashboards/components/common/adapt-documents/AttachmentListLoader.tsx","../../../app/javascript/dashboards/components/common/adapt-documents/UploadModal.tsx","../../../app/javascript/dashboards/components/common/mutations/uploadFileMutation.ts","../../../app/javascript/dashboards/components/common/hooks/useUploadFiles.ts","../../../app/javascript/dashboards/components/common/adapt-documents/FileUploadModal.tsx","../../../app/javascript/dashboards/components/common/adapt-documents/DocumentsCard.tsx","../../../app/javascript/dashboards/components/equity_transactions/components/ShareRepurchaseDetailPane.tsx","../../../app/javascript/dashboards/components/convertibles/constant.ts","../../../app/javascript/dashboards/components/convertibles/utils.tsx","../../../app/javascript/dashboards/components/grant_issuance_actions/utils.ts","../../../app/javascript/dashboards/components/grants/utils.tsx","../../../app/javascript/dashboards/components/rsu_grants/utils.tsx","../../../app/javascript/dashboards/components/common/StackTable/constants.tsx","../../../app/javascript/dashboards/components/security_drafts/share_certificates/utils.tsx","../../../app/javascript/dashboards/components/security_drafts/utils.ts","../../../app/javascript/dashboards/components/equity_transactions/utils.tsx","../../../app/javascript/dashboards/components/constants/index.ts","../../../app/javascript/dashboards/components/share_certificates/utils.tsx","../../../app/javascript/dashboards/components/health_checks/utils.tsx","../../../app/javascript/dashboards/components/employees/constants.ts","../../../app/javascript/dashboards/components/health_checks/components/BulkFixHealthCheckModal.tsx","../../../app/javascript/dashboards/components/health_checks/mutations/BulkFixEmployeeHealthChecks.ts","../../../app/javascript/dashboards/components/health_checks/queries/HealthCheckStatusesQuery.ts","../../../app/javascript/dashboards/components/health_checks/hooks/useFixBulkEmployeeHealthChecks.ts","../../../app/javascript/dashboards/components/health_checks/components/BulkFixEmploymentTypeModal.tsx","../../../app/javascript/dashboards/components/health_checks/components/BulkFixEmployeeHealthCheckButton.tsx","../../../app/javascript/dashboards/components/health_checks/components/BulkEnableExerciseCheckButton/BulkFixGridEditor.tsx","../../../app/javascript/dashboards/components/share_classes/utils.ts","../../../app/javascript/dashboards/components/health_checks/mutations/BulkEnableEsopGrantExerciseMutation.ts","../../../app/javascript/dashboards/components/health_checks/hooks/useBulkEnableExercise.ts","../../../app/javascript/dashboards/components/valuations/fragments/OutgoingStockSplitEventFragment.ts","../../../app/javascript/dashboards/components/valuations/queries/allValuationsQuery.ts","../../../app/javascript/dashboards/components/valuations/hooks/useValuations.ts","../../../app/javascript/dashboards/components/esop_grants/hooks/useGrantValuations.ts","../../../app/javascript/dashboards/components/grant_document_set/queries/AllGrantDocumentSetsQuery.ts","../../../app/javascript/dashboards/components/grant_document_set/hooks/useGrantDocumentSets.ts","../../../app/javascript/dashboards/components/health_checks/components/BulkEnableExerciseCheckButton/BulkEnableExerciseModal.tsx","../../../app/javascript/dashboards/components/health_checks/components/BulkEnableExerciseCheckButton/index.tsx","../../../app/javascript/dashboards/components/health_checks/constant.ts","../../../app/javascript/dashboards/components/health_checks/components/HealthCheckTooltip.tsx","../../../app/javascript/dashboards/components/health_checks/HealthCheckDot.tsx","../../../app/javascript/dashboards/components/common/LoadingStatusTag.jsx","../../../app/javascript/dashboards/helpers/formatters.jsx"],"sourcesContent":["export const EMAIL_REGEX = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,12}$/i;\nexport const EXERCISE_PERIOD_REGEX = /^(\\d+\\s+([dD]ays?|[yY]ears?|[wW]eeks?|[mM]onths?|[qQ]uarters?)|[uU]nlimited)$/i;\n\nexport const requiredDataValidator = (value: string, _row: any) => {\n if (!value) {\n return 'Missing data';\n }\n return true;\n};\n\nexport const requiredNumberDataValidator = (value: number, _row: any) => {\n if (!value && value !== 0) {\n return 'Missing data';\n }\n return true;\n};\n\nexport const emailValidator = (value: string, _row: any) => {\n if (value && EMAIL_REGEX.test(value) === false) {\n return 'Invalid email format';\n }\n return true;\n};\n\nexport const exercisePeriodValidator = (value: string, _row: any) => {\n if (value && EXERCISE_PERIOD_REGEX.test(value) === false) {\n return 'Invalid exercise period value.\\n Please enter a value like 2 days / 1 week / 2 quarters / 3 months / 1 years / unlimited';\n }\n return true;\n};\n","import { GridColumn, GridRow, Location } from './InternalModel';\n\nexport type SliceDirection = 'columns' | 'rows' | 'both';\n\nexport class Range {\n readonly width: number;\n readonly height: number;\n readonly first: Location;\n readonly last: Location;\n\n constructor(public readonly rows: GridRow[], public readonly columns: GridColumn[]) {\n this.first = { row: this.rows[0], column: this.columns[0] };\n this.last = { row: this.rows[this.rows.length - 1], column: this.columns[this.columns.length - 1] };\n this.height = this.rows.reduce((a, b) => a + b.height, 0);\n this.width = this.columns.reduce((a, b) => a + b.width, 0);\n }\n\n contains(location: Location): boolean {\n return location.column?.idx >= this.first.column?.idx &&\n location.column?.idx <= this.last.column?.idx &&\n location.row?.idx >= this.first.row?.idx &&\n location.row?.idx <= this.last.row?.idx;\n }\n\n slice(range: Range, direction: SliceDirection): Range {\n const firstRow = direction === 'rows' && range ? range.first.row : this.first.row;\n const firstColumn = direction === 'columns' && range ? range.first.column : this.first.column;\n const lastRow = direction === 'rows' && range ? range.last.row : this.last.row;\n const lastColumn = direction === 'columns' && range ? range.last.column : this.last.column;\n const slicedRows = this.rows.slice(firstRow.idx - this.first.row.idx, lastRow.idx - this.first.row.idx + 1);\n const slicedColumns = this.columns.slice(firstColumn.idx - this.first.column.idx, lastColumn.idx - this.first.column.idx + 1);\n return new Range(slicedRows, slicedColumns);\n }\n}\n","import { GridColumn, GridRow, Location } from './InternalModel';\nimport { Cell, Column, Id, Row } from './PublicModel';\nimport { Range } from './Range';\n\n\nexport interface IndexLookup {\n [id: string]: number;\n}\n\n// INTERNAL\nexport interface CellMatrixProps {\n columns: Column[];\n rows: Row[];\n stickyTopRows?: number;\n stickyLeftColumns?: number;\n stickyRightColumns?: number;\n stickyBottomRows?: number;\n minColumnWidth?: number;\n}\n\nexport interface StickyRanges {\n stickyTopRange: Range;\n stickyLeftRange: Range;\n stickyRightRange: Range;\n stickyBottomRange: Range;\n}\n\nexport interface SpanLookup {\n range?: Range;\n}\n\n// INTERNAL\nexport class CellMatrix {\n\n static DEFAULT_ROW_HEIGHT = 25;\n static DEFAULT_COLUMN_WIDTH = 150;\n static MIN_COLUMN_WIDTH = 40;\n\n props!: CellMatrixProps;\n scrollableRange!: Range;\n width = 0;\n height = 0;\n\n columns!: GridColumn[];\n rows!: GridRow[];\n first!: Location;\n last!: Location;\n\n rowIndexLookup: IndexLookup = {};\n columnIndexLookup: IndexLookup = {};\n\n spanCellLookup: { [location: string]: SpanLookup } = {};\n\n rangesToRender: { [location: string]: SpanLookup } = {};\n\n constructor(public ranges: StickyRanges) { }\n\n getRange(start: Location, end: Location): Range {\n const cols = this.columns.slice(\n Math.min(start.column.idx, end.column.idx), \n Math.max(start.column.idx, end.column.idx) + 1\n );\n const rows = this.rows.slice(\n Math.min(start.row.idx, end.row.idx),\n Math.max(start.row.idx, end.row.idx) + 1\n );\n\n return new Range(rows, cols);\n }\n\n getLocation(rowIdx: number, columnIdx: number): Location {\n return { row: this.rows[rowIdx], column: this.columns[columnIdx] };\n }\n\n getLocationById(rowId: Id, columnId: Id): Location {\n try {\n const row = this.rows[this.rowIndexLookup[rowId]];\n const column = this.columns[this.columnIndexLookup[columnId]];\n return this.validateLocation({ row, column });\n } catch (error) {\n throw new RangeError(`column: '${columnId}', row: '${rowId}'`)\n }\n }\n\n validateLocation(location: Location): Location {\n const colIdx = this.columnIndexLookup[location.column.columnId] ?? Math.min(location.column.idx, this.last.column.idx);\n const rowIdx = this.rowIndexLookup[location.row.rowId] ?? Math.min(location.row.idx, this.last.row.idx);\n return this.getLocation(rowIdx, colIdx);\n }\n\n validateRange(range: Range): Range {\n return this.getRange(this.validateLocation(range.first), this.validateLocation(range.last));\n }\n\n getCell(location: Location): Cell {\n return this.rows[location.row.idx].cells[location.column.idx];\n }\n\n}\n\nexport function translateLocationIdxToLookupKey(idx: number, idy: number): string {\n return `${idx}, ${idy}`;\n}\n","import { Location } from '../Model/InternalModel';\n\nexport function areLocationsEqual(location1: Location, location2?: Location): boolean {\n return location1.column.columnId === location2?.column.columnId\n && location1.row.rowId === location2?.row.rowId;\n}\n","import { areLocationsEqual } from '../Functions/areLocationsEqual';\nimport { PointerLocation, Location } from './InternalModel';\nimport { State, StateUpdater } from './State';\nimport { PointerEvent } from './domEventsTypes';\n\n\nexport abstract class AbstractPointerEventsController {\n\n constructor(readonly updateState: StateUpdater) { }\n\n eventTimestamps: [number, number] = [0, 0];\n eventLocations: Array = [undefined, undefined];\n currentIndex = 0;\n pointerDownLocation?: Location;\n\n abstract handlePointerDown: (event: PointerEvent, state: State) => State;\n\n protected handlePointerDownInternal(event: PointerEvent, currentLocation: PointerLocation, state: State): State {\n this.pointerDownLocation = currentLocation;\n const previousLocation = this.eventLocations[this.currentIndex];\n this.currentIndex = 1 - this.currentIndex;\n this.eventTimestamps[this.currentIndex] = new Date().valueOf();\n this.eventLocations[this.currentIndex] = currentLocation;\n const isFirstRowOrColumn = currentLocation.row.idx === 0 || currentLocation.column.idx === 0;\n if (event.pointerType === 'mouse' || isFirstRowOrColumn || areLocationsEqual(currentLocation, previousLocation)) {\n state = state.currentBehavior.handlePointerDown(event, currentLocation, state);\n }\n return state;\n }\n\n protected shouldHandleDoubleClick(currentLocation: PointerLocation, currentTimestamp: number, secondLastTimestamp: number): boolean {\n return currentTimestamp - secondLastTimestamp < 500\n && areLocationsEqual(currentLocation, this.eventLocations[0])\n && areLocationsEqual(currentLocation, this.eventLocations[1]);\n }\n\n protected shouldHandleCellSelectionOnMobile(event: PointerEvent, currentLocation: PointerLocation, currentTimestamp: number): boolean {\n // prevent from cell selection on first click on mobile devices\n return event.pointerType !== 'mouse' &&\n areLocationsEqual(currentLocation, this.pointerDownLocation) &&\n event.pointerType !== undefined && // !== undefined only for cypress tests\n currentTimestamp - this.eventTimestamps[this.currentIndex] < 500 &&\n (currentLocation.row.idx > 0 && currentLocation.column.idx > 0)\n }\n\n}\n\n// TODO think about create as saparate function\nexport function isReadyToHandleEvent(event: PointerEvent): boolean {\n if ((event.button !== 0 && event.button !== undefined) ||\n ((event.target as HTMLDivElement).className === 'reactgrid-content' && event.pointerType !== undefined)) {\n return false;\n }\n return true;\n}\n\n// TODO think about create as saparate function\nexport function isOnClickableArea(event: PointerEvent, state: State): boolean {\n if (!state.reactGridElement) {\n return false;\n }\n const { left } = state.reactGridElement.getBoundingClientRect();\n const viewportX = event.clientX - left;\n if (viewportX > state.cellMatrix.width) {\n return false;\n }\n return true;\n}\n","export function isBrowserIE(): boolean {\n if (typeof window !== 'undefined') { // condition needed for circle ci compiler\n return window.navigator.userAgent.indexOf('Trident') > 0;\n } else {\n return false;\n }\n}\n","export function isBrowserEdge(): boolean {\n if (typeof window !== 'undefined') { // condition needed for circle ci compiler\n return window.navigator.userAgent.indexOf('Edge/') > 0;\n } else {\n return false;\n }\n}\n","import { Location, GridColumn, GridRow } from \"../../core\";\n\n// just a helper, much quicker than newLocation()!\nexport const newLocation = (row: GridRow, column: GridColumn): Location => ({\n row,\n column,\n});\n","import { Location, GridColumn, Range, GridRow, Id } from \"../../core\";\nimport { State } from \"../Model/State\";\nimport { newLocation } from \"./newLocation\";\n\nexport function resetSelection(state: State, location: Location): State {\n const newRange = state.cellMatrix.getRange(location, location);\n\n state?.props?.onSelectionChanged && state.props.onSelectionChanged([newRange]);\n \n return {\n ...state,\n activeSelectedRangeIdx: 0,\n selectedRanges: [newRange],\n selectedIndexes: [],\n selectedIds: [],\n selectionMode: \"range\",\n };\n}\n\nexport function selectRange(\n state: State,\n range: Range,\n incremental: boolean\n): State {\n return {\n ...state,\n selectionMode: \"range\",\n selectedRanges: (incremental && state.selectionMode === \"range\"\n ? state.selectedRanges\n : []\n ).concat([range]),\n selectedIndexes: [],\n selectedIds: [],\n activeSelectedRangeIdx:\n incremental && state.selectionMode === \"range\"\n ? state.selectedRanges.length\n : 0,\n };\n}\n\nexport function updateActiveSelectedRange(\n state: State,\n range: Range\n): State {\n return {\n ...state,\n selectionMode: \"range\",\n // replace active selected range in selectedRanges\n selectedRanges: Object.assign([], state.selectedRanges, {\n [state.activeSelectedRangeIdx]: range,\n }),\n selectedIndexes: [],\n selectedIds: [],\n };\n}\n\nexport function selectOneColumn(\n state: State,\n col: GridColumn,\n incremental: boolean\n): State {\n return {\n ...state,\n selectionMode: \"column\",\n selectedIndexes: (incremental && state.selectionMode === \"column\"\n ? state.selectedIndexes\n : []\n ).concat(col.idx),\n selectedIds: (incremental && state.selectionMode === \"column\"\n ? state.selectedIds\n : []\n ).concat(col.columnId),\n };\n}\n\nexport function unSelectOneColumn(state: State, col: GridColumn): State {\n const updatedIndexes = state.selectedIndexes.filter(\n (idx: number) => idx !== col.idx\n );\n const updatedIds = state.selectedIds.filter((id: Id) => id !== col.columnId);\n\n return {\n ...state,\n selectionMode: \"column\",\n selectedIndexes: updatedIndexes,\n selectedIds: updatedIds,\n };\n}\n\nexport function selectMultipleColumns(\n state: State,\n firstCol: GridColumn,\n lastCol: GridColumn,\n incremental?: boolean\n): State {\n const firstRow = state.cellMatrix.first.row;\n const lastRow = state.cellMatrix.last.row;\n const range = state.cellMatrix.getRange(\n newLocation(firstRow, firstCol),\n newLocation(lastRow, lastCol)\n );\n\n return {\n ...state,\n selectionMode: \"column\",\n selectedIndexes: incremental\n ? state.selectedIndexes.concat(range.columns.map((col) => col.idx))\n : range.columns.map((col) => col.idx),\n selectedIds: incremental\n ? state.selectedIds.concat(range.columns.map((col) => col.columnId))\n : range.columns.map((col) => col.columnId),\n };\n}\n\nexport function selectOneRow(\n state: State,\n row: GridRow,\n incremental: boolean\n): State {\n return {\n ...state,\n selectionMode: \"row\",\n selectedIndexes: (incremental && state.selectionMode === \"row\"\n ? state.selectedIndexes\n : []\n ).concat(row.idx),\n selectedIds: (incremental && state.selectionMode === \"row\"\n ? state.selectedIds\n : []\n ).concat(row.rowId),\n };\n}\n\nexport function unSelectOneRow(state: State, row: GridRow): State {\n const updatedIndexes = state.selectedIndexes.filter(\n (idx: number) => idx !== row.idx\n );\n const updatedIds = state.selectedIds.filter((id: Id) => id !== row.rowId);\n\n return {\n ...state,\n selectionMode: \"row\",\n selectedIndexes: updatedIndexes,\n selectedIds: updatedIds,\n };\n}\n\nexport function selectMultipleRows(\n state: State,\n firstRow: GridRow,\n lastRow: GridRow,\n incremental?: boolean\n): State {\n const firstCol = state.cellMatrix.first.column;\n const lastCol = state.cellMatrix.last.column;\n const range = state.cellMatrix.getRange(\n newLocation(firstRow, firstCol),\n newLocation(lastRow, lastCol)\n );\n\n return {\n ...state,\n selectionMode: \"row\",\n selectedIndexes: incremental\n ? state.selectedIndexes.concat(range.rows.map((row) => row.idx))\n : range.rows.map((row) => row.idx),\n selectedIds: incremental\n ? state.selectedIds.concat(range.rows.map((row) => row.rowId))\n : range.rows.map((row) => row.rowId),\n };\n}\n","import { Direction, PointerLocation } from './InternalModel';\nimport { KeyboardEvent, ClipboardEvent, PointerEvent } from './domEventsTypes';\nimport { State } from './State';\nimport { Range } from './Range';\n\n\n// ASK ARCHITECT BEFORE INTRODUCING ANY CHANGE!\nexport abstract class Behavior {\n\n handleKeyDown(event: KeyboardEvent, state: State): State {\n return state;\n }\n handlePointerUp(event: PointerUpEvent, location: PointerLocation, state: State): State {\n return state;\n }\n handleKeyUp(event: KeyboardEvent, state: State): State {\n return state;\n }\n handleCompositionEnd(event: CompositionEvent, state: State): State {\n return state;\n }\n handleCopy(event: ClipboardEvent, state: State): State {\n return state;\n }\n handlePaste(event: ClipboardEvent, state: State): State {\n return state;\n }\n handleCut(event: ClipboardEvent, state: State): State {\n return state;\n }\n handlePointerDown(event: PointerEvent, location: PointerLocation, state: State): State {\n return state;\n }\n handleDoubleClick(event: PointerEvent, location: PointerLocation, state: State): State {\n return state;\n }\n\n handlePointerMove(\n event: PointerEvent,\n location: PointerLocation,\n state: State\n ): State {\n return state;\n }\n \n handlePointerEnter(\n event: PointerEvent,\n location: PointerLocation,\n state: State\n ): State {\n return state;\n }\n \n handleContextMenu(\n event: PointerEvent | MouseEvent,\n state: State\n ): State {\n return state;\n }\n \n renderPanePart(state: State, pane: Range): React.ReactNode {\n return undefined;\n }\n \n autoScrollDirection: Direction = \"both\";\n} \n","import { Cell, CellTemplate, Compatible } from '../Model/PublicModel';\nimport { State } from '../Model/State';\nimport { Location } from '../Model/InternalModel';\n\nexport function getCompatibleCellAndTemplate(state: State, location: Location): { cell: Compatible, cellTemplate: CellTemplate } {\n try {\n const rawCell = state.cellMatrix.getCell(location);\n if (!rawCell) throw new TypeError(`Cell doesn't exists at location`);\n if (!rawCell.type) throw new Error('Cell is missing type property');\n const cellTemplate = state.cellTemplates[rawCell.type];\n if (!cellTemplate) throw new Error(`CellTemplate missing for type '${rawCell.type}'`);\n const cell = cellTemplate.getCompatibleCell({ ...rawCell, type: rawCell.type });\n if (!cell) throw new Error('Cell validation failed');\n return { cell, cellTemplate };\n } catch (e) {\n throw new Error(`${(e as Error).message} (rowId: '${location.row.rowId}', columnId: '${location.column.columnId}')`);\n }\n}\n","import { Cell, CellChange, Compatible } from '../Model/PublicModel';\nimport { Location } from '../Model/InternalModel';\nimport { State } from '../Model/State';\nimport { getCompatibleCellAndTemplate } from './getCompatibleCellAndTemplate';\n\nexport function tryAppendChange(state: State, location: Location, cell: Compatible): State {\n\n const { cell: previousCell, cellTemplate } = getCompatibleCellAndTemplate(state, location);\n if (previousCell === cell || JSON.stringify(previousCell) === JSON.stringify(cell) || cellTemplate.update === undefined)\n return state;\n const newCell = cellTemplate.update(previousCell, cell);\n if ((newCell !== previousCell || JSON.stringify(newCell) !== JSON.stringify(previousCell)) && !newCell.nonEditable)\n state.queuedCellChanges.push({\n previousCell,\n newCell,\n type: newCell.type,\n rowId: location.row.rowId,\n columnId: location.column.columnId\n } as CellChange);\n return { ...state };\n}","/**\n * Set of key codes.\n * `POINTER` is a ReactGrid addon\n * \n * @enum {number}\n */\nexport enum keyCodes {\n POINTER = 1, // a react-grid addon :)\n BACKSPACE = 8,\n TAB = 9,\n ENTER = 13,\n SHIFT = 16,\n CTRL = 17,\n ALT = 18,\n PAUSE = 19,\n CAPS_LOCK = 20,\n ESCAPE = 27,\n SPACE = 32,\n PAGE_UP = 33,\n PAGE_DOWN = 34,\n END = 35,\n HOME = 36,\n LEFT_ARROW = 37,\n UP_ARROW = 38,\n RIGHT_ARROW = 39,\n DOWN_ARROW = 40,\n INSERT = 45,\n DELETE = 46,\n KEY_0 = 48,\n KEY_1 = 49,\n KEY_2 = 50,\n KEY_3 = 51,\n KEY_4 = 52,\n KEY_5 = 53,\n KEY_6 = 54,\n KEY_7 = 55,\n KEY_8 = 56,\n KEY_9 = 57,\n KEY_A = 65,\n KEY_B = 66,\n KEY_C = 67,\n KEY_D = 68,\n KEY_E = 69,\n KEY_F = 70,\n KEY_G = 71,\n KEY_H = 72,\n KEY_I = 73,\n KEY_J = 74,\n KEY_K = 75,\n KEY_L = 76,\n KEY_M = 77,\n KEY_N = 78,\n KEY_O = 79,\n KEY_P = 80,\n KEY_Q = 81,\n KEY_R = 82,\n KEY_S = 83,\n KEY_T = 84,\n KEY_U = 85,\n KEY_V = 86,\n KEY_W = 87,\n KEY_X = 88,\n KEY_Y = 89,\n KEY_Z = 90,\n LEFT_META = 91,\n RIGHT_META = 92,\n SELECT = 93,\n NUMPAD_0 = 96,\n NUMPAD_1 = 97,\n NUMPAD_2 = 98,\n NUMPAD_3 = 99,\n NUMPAD_4 = 100,\n NUMPAD_5 = 101,\n NUMPAD_6 = 102,\n NUMPAD_7 = 103,\n NUMPAD_8 = 104,\n NUMPAD_9 = 105,\n MULTIPLY = 106,\n ADD = 107,\n SUBTRACT = 109,\n DECIMAL = 110,\n DIVIDE = 111,\n F1 = 112,\n F2 = 113,\n F3 = 114,\n F4 = 115,\n F5 = 116,\n F6 = 117,\n F7 = 118,\n F8 = 119,\n F9 = 120,\n F10 = 121,\n F11 = 122,\n F12 = 123,\n NUM_LOCK = 144,\n SCROLL_LOCK = 145,\n FIREFOX_DASH = 173,\n SEMICOLON = 186,\n EQUALS = 187,\n COMMA = 188,\n DASH = 189,\n PERIOD = 190,\n FORWARD_SLASH = 191,\n GRAVE_ACCENT = 192,\n OPEN_BRACKET = 219,\n BACK_SLASH = 220,\n CLOSE_BRACKET = 221,\n SINGLE_QUOTE = 222\n}\n","import { State, } from '../Model/State';\nimport { Location } from '../Model/InternalModel';\nimport { tryAppendChange } from './tryAppendChange';\nimport { getCompatibleCellAndTemplate } from './getCompatibleCellAndTemplate';\nimport { areLocationsEqual } from './areLocationsEqual';\nimport { resetSelection } from './selectRange';\nimport { keyCodes } from './keyCodes';\n\n\nexport function focusLocation(state: State, location: Location, applyResetSelection = true, keyCode?: keyCodes): State {\n // Need to determine if there is an edited cell &&The cell gets focus &&did not press Enter\n if (\n state.focusedLocation &&\n state.currentlyEditedCell &&\n keyCode !== keyCodes.ENTER\n ) {\n state = tryAppendChange(\n state,\n state.focusedLocation,\n state.currentlyEditedCell\n );\n }\n\n if (!state.props) {\n throw new Error(`\"props\" field on \"state\" object should be initiated before possible location focus`);\n }\n \n \n const { onFocusLocationChanged, onFocusLocationChanging, focusLocation } = state.props;\n\n const { cell, cellTemplate } = getCompatibleCellAndTemplate(state, location);\n const cellLocation = { rowId: location.row.rowId, columnId: location.column.columnId };\n\n const isChangeAllowedByUser = !onFocusLocationChanging || onFocusLocationChanging(cellLocation);\n\n const isCellTemplateFocusable = !cellTemplate.isFocusable || cellTemplate.isFocusable(cell);\n\n const forcedLocation = focusLocation\n ? state.cellMatrix.getLocationById(focusLocation.rowId, focusLocation.columnId)\n : undefined;\n\n const isLocationAcceptable = areLocationsEqual(location, state.focusedLocation)\n || (forcedLocation ? areLocationsEqual(location, forcedLocation) : true);\n\n if (!isCellTemplateFocusable || !isChangeAllowedByUser || !isLocationAcceptable) {\n return state;\n }\n\n if (onFocusLocationChanged) {\n onFocusLocationChanged(cellLocation);\n }\n\n const validatedFocusLocation = state.cellMatrix.validateLocation(location);\n\n if (applyResetSelection) {\n // TODO is `location` really needed\n state = resetSelection(\n state,\n validatedFocusLocation\n );\n }\n\n\n return {\n ...state,\n focusedLocation: validatedFocusLocation,\n contextMenuPosition: { top: -1, left: -1 },\n currentlyEditedCell: undefined // TODO disable in derived state from props\n };\n}\n","type ScrollableElement = HTMLElement | ReturnType | undefined;\n\nexport function getScrollableParent(element: HTMLElement, includeHidden: boolean): ScrollableElement {\n let style = getComputedStyle(element);\n const excludeStaticParent = style.position === 'absolute';\n const overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/;\n if (style.position === 'fixed') return document.documentElement;\n for (let parent = element; ((parent as HTMLElement | null) = parent.parentElement);) {\n style = getComputedStyle(parent);\n if (excludeStaticParent && style.position === 'static')\n continue;\n if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX))\n return parent;\n }\n return getTopScrollableElement();\n}\n\nexport function getScrollOfScrollableElement(element: ScrollableElement): { scrollLeft: number, scrollTop: number } {\n const scrollLeft = element !== undefined ? ((element as HTMLElement).scrollLeft ?? getTopScrollableElement().scrollX) - ((element as HTMLElement).clientLeft || 0) : 0;\n const scrollTop = element !== undefined ? ((element as HTMLElement).scrollTop ?? getTopScrollableElement().scrollY) - ((element as HTMLElement).clientTop || 0) : 0;\n return { scrollLeft, scrollTop };\n}\n\nexport function getTopScrollableElement(): Window & typeof globalThis {\n return window;\n}\n","export function isMacOs(): boolean {\n if (typeof window !== 'undefined') { // condition needed for CI/CD\n return window.navigator.appVersion.indexOf('Mac') !== -1;\n }\n return false;\n}\n\nexport function isIOS(): boolean {\n if (typeof window !== 'undefined') { // condition needed for CI/CD\n if (/iPad|iPhone|iPod/.test(window.navigator.platform)) {\n return true;\n } else {\n return isIpadOS();\n }\n }\n return false;\n}\n\nexport function isIpadOS(): boolean {\n if (typeof window !== 'undefined') { // condition needed for CI/CD\n return window.navigator.maxTouchPoints > 2 && /MacIntel/.test(window.navigator.platform);\n }\n return false;\n}\n","import { State } from '../Model/State';\nimport { getScrollOfScrollableElement, getTopScrollableElement } from './scrollHelpers';\nimport { isIOS } from './operatingSystem';\n\n// TODO replace any with exact type: HTMLElement | (Window & typeof globalThis)\nexport function getSizeOfElement(element: HTMLElement | (Window & typeof globalThis) | undefined): { width: number, height: number } {\n if (!element) {\n return { width: 0, height: 0 };\n }\n const width = element instanceof HTMLElement\n ? element.clientWidth\n : isIOS() ? window.innerWidth : document.documentElement.clientWidth; // TODO check other mobile devices\n const height = element instanceof HTMLElement\n ? element.clientHeight\n : isIOS() ? window.innerHeight : document.documentElement.clientHeight;\n return { width, height };\n}\n\nexport function getReactGridOffsets(state: State): { left: number, top: number } {\n const { scrollLeft, scrollTop } = getScrollOfScrollableElement(state.scrollableElement);\n if (!state.reactGridElement) {\n throw new Error(`\"state.reactGridElement\" field should be initiated before calling \"getBoundingClientRect()\"`);\n }\n const { left: leftReactGrid, top: topReactGrid } = state.reactGridElement.getBoundingClientRect();\n let left = leftReactGrid + scrollLeft,\n top = topReactGrid + scrollTop;\n if (state.scrollableElement !== undefined && state.scrollableElement !== getTopScrollableElement()) {\n const { left: leftScrollable, top: topScrollable } = (state.scrollableElement as HTMLElement).getBoundingClientRect();\n left -= leftScrollable;\n top -= topScrollable;\n }\n return { left, top };\n}\n\nexport function getVisibleSizeOfReactGrid(state: State): { width: number, height: number, visibleOffsetRight: number, visibleOffsetBottom: number } {\n const { scrollLeft, scrollTop } = getScrollOfScrollableElement(state.scrollableElement);\n const { width: widthOfScrollableElement, height: heightOfScrollableElement } = getSizeOfElement(state.scrollableElement);\n const { left, top } = getReactGridOffsets(state);\n\n const scrollBottom = scrollTop + heightOfScrollableElement,\n reactGridBottom = top + state.cellMatrix.height,\n visibleTop = top < scrollTop ? scrollTop : top,\n visibleBottom = reactGridBottom > scrollBottom ? scrollBottom : reactGridBottom;\n\n const scrollRight = scrollLeft + widthOfScrollableElement,\n reactGridRight = left + state.cellMatrix.width,\n visibleLeft = left < scrollLeft ? scrollLeft : left,\n visibleRight = reactGridRight > scrollRight ? scrollRight : reactGridRight;\n\n const width = Math.max(visibleRight - visibleLeft, 0),\n height = Math.max(visibleBottom - visibleTop, 0);\n const visibleOffsetRight = scrollRight - visibleRight,\n visibleOffsetBottom = scrollBottom - visibleBottom;\n return { width, height, visibleOffsetRight, visibleOffsetBottom };\n}\n\nexport const getStickyOffset = (scroll: number, offset: number): number => scroll > offset ? scroll - offset : 0;\n","import { Direction, GridColumn, GridRow, PointerLocation } from '../Model/InternalModel';\nimport { getScrollOfScrollableElement } from './scrollHelpers';\nimport { getReactGridOffsets, getSizeOfElement, getStickyOffset, getVisibleSizeOfReactGrid } from './elementSizeHelpers';\nimport { State } from '../Model/State';\n\n// TODO: rewrite without division\nexport function getLocationFromClient(\n state: State,\n clientX: number,\n clientY: number,\n favorScrollableContent?: Direction\n ): PointerLocation {\n if (!state.reactGridElement) {\n throw new Error(\n `\"state.reactGridElement\" field should be initiated before calling the \"getBoundingClientRect()\"`\n );\n }\n const { left, top } = state.reactGridElement.getBoundingClientRect();\n const viewportX = clientX - left;\n const viewportY = clientY - top;\n \n const { cellY, row } = getRow(\n state,\n viewportY,\n favorScrollableContent === \"vertical\" || favorScrollableContent === \"both\"\n );\n const { cellX, column } = getColumn(\n state,\n viewportX,\n favorScrollableContent === \"horizontal\" || favorScrollableContent === \"both\"\n );\n return { row, column, viewportX, viewportY, cellX, cellY };\n }\n \n function getRow(\n state: State,\n viewportY: number,\n favorScrollableContent: boolean\n ): { cellY: number; row: GridRow } {\n return (\n getStickyTopRow(state, viewportY, favorScrollableContent) ||\n getStickyBottomRow(state, viewportY, favorScrollableContent) ||\n getRowOnNonSticky(state, viewportY)\n );\n }\n \n function getColumn(\n state: State,\n viewportX: number,\n favorScrollableContent: boolean\n ): { cellX: number; column: GridColumn } {\n return (\n getLeftStickyColumn(state, viewportX, favorScrollableContent) ||\n getRightStickyColumn(state, viewportX, favorScrollableContent) ||\n getColumnOnNonSticky(state, viewportX)\n );\n }\n \n function getRowOnNonSticky(\n state: State,\n viewportY: number\n ): { cellY: number; row: GridRow } {\n if (state.cellMatrix.scrollableRange.rows.length < 1) {\n const sticky =\n viewportY >= state.cellMatrix.height\n ? state.cellMatrix.last\n : state.cellMatrix.first;\n return {\n cellY: sticky.row.height,\n row: sticky.row,\n };\n }\n return getScrollableContentRow(state, viewportY);\n }\n \n function getColumnOnNonSticky(\n state: State,\n viewportX: number\n ): { cellX: number; column: GridColumn } {\n if (state.cellMatrix.scrollableRange.columns.length < 1) {\n const sticky =\n viewportX >= state.cellMatrix.width\n ? state.cellMatrix.last\n : state.cellMatrix.first;\n return {\n cellX: sticky.column.width,\n column: sticky.column,\n };\n }\n return getScrollableContentColumn(state, viewportX);\n }\n \n // PRO\n function getStickyBottomRow(\n state: State,\n viewportY: number,\n favorScrollableContent: boolean\n ): { cellY: number; row: GridRow } | undefined {\n const cellMatrix = state.cellMatrix;\n const { scrollTop } = getScrollOfScrollableElement(state.scrollableElement);\n const { top } = getReactGridOffsets(state);\n const { height } = getSizeOfElement(state.scrollableElement);\n const topStickyOffset = getStickyOffset(scrollTop, top);\n const maxScrollTop = Math.max(cellMatrix.height - height + top, 0);\n const bottomStickyOffset =\n getVisibleSizeOfReactGrid(state).height +\n topStickyOffset -\n cellMatrix.ranges.stickyBottomRange.height;\n if (\n cellMatrix.ranges.stickyBottomRange.rows.length > 0 &&\n viewportY >= bottomStickyOffset &&\n !(favorScrollableContent && scrollTop + 1 < maxScrollTop)\n ) {\n const row =\n cellMatrix.ranges.stickyBottomRange.rows.find(\n (row) => row.bottom > viewportY - bottomStickyOffset\n ) || cellMatrix.last.row;\n const cellY = viewportY - bottomStickyOffset - row.top;\n return { cellY, row };\n }\n }\n \n export function getRightStickyColumn(\n state: State,\n viewportX: number,\n favorScrollableContent: boolean\n ): { cellX: number; column: GridColumn } | undefined {\n const cellMatrix = state.cellMatrix;\n const { scrollLeft } = getScrollOfScrollableElement(state.scrollableElement);\n const { left } = getReactGridOffsets(state);\n const { width } = getSizeOfElement(state.scrollableElement);\n const leftStickyOffset = getStickyOffset(scrollLeft, left);\n const maxScrollLeft = Math.max(cellMatrix.width - width + left, 0);\n const rightStickyOffset =\n getVisibleSizeOfReactGrid(state).width +\n leftStickyOffset -\n cellMatrix.ranges.stickyRightRange.width;\n if (\n cellMatrix.ranges.stickyRightRange.columns.length > 0 &&\n viewportX >= rightStickyOffset &&\n !(favorScrollableContent && scrollLeft + 1 < maxScrollLeft)\n ) {\n const column =\n cellMatrix.ranges.stickyRightRange.columns.find(\n (column) => column.right > viewportX - rightStickyOffset\n ) || cellMatrix.last.column;\n const cellX = viewportX - rightStickyOffset - column.left;\n return { cellX, column };\n }\n }\n\nexport function getStickyTopRow(state: State, viewportY: number, favorScrollableContent: boolean): { cellY: number, row: GridRow } | undefined {\n const cellMatrix = state.cellMatrix;\n const { scrollTop } = getScrollOfScrollableElement(state.scrollableElement);\n const { top } = getReactGridOffsets(state);\n const topStickyOffset = getStickyOffset(scrollTop, top);\n if (cellMatrix.ranges.stickyTopRange.rows.find(row => row.bottom > viewportY - topStickyOffset) && viewportY < cellMatrix.ranges.stickyTopRange.height + topStickyOffset && !(favorScrollableContent && scrollTop > top)) {\n const row = cellMatrix.ranges.stickyTopRange.rows.find(row => row.bottom > viewportY - topStickyOffset) || cellMatrix.ranges.stickyTopRange.first.row;\n const cellY = viewportY - row.top;\n return { cellY, row };\n }\n}\n\nexport function getLeftStickyColumn(state: State, viewportX: number, favorScrollableContent: boolean): { cellX: number, column: GridColumn } | undefined {\n const cellMatrix = state.cellMatrix;\n const { scrollLeft } = getScrollOfScrollableElement(state.scrollableElement);\n const { left } = getReactGridOffsets(state);\n const leftStickyOffset = getStickyOffset(scrollLeft, left);\n if (cellMatrix.ranges.stickyLeftRange.columns.find(column => column.right > viewportX - leftStickyOffset) && viewportX < cellMatrix.ranges.stickyLeftRange.width + leftStickyOffset && !(favorScrollableContent && scrollLeft > left)) {\n const column = cellMatrix.ranges.stickyLeftRange.columns.find(column => column.right > viewportX - leftStickyOffset) || cellMatrix.ranges.stickyLeftRange.first.column;\n const cellX = viewportX - column.left;\n return { cellX, column };\n }\n}\n\nexport function getScrollableContentRow(state: State, viewportY: number): { cellY: number, row: GridRow } {\n const cellMatrix = state.cellMatrix;\n const scrollableContentY = viewportY - cellMatrix.ranges.stickyTopRange.height;\n const row = cellMatrix.scrollableRange.rows.find(row => row.bottom >= scrollableContentY) || cellMatrix.scrollableRange.last.row;\n const cellY = scrollableContentY - row.top;\n return { cellY, row };\n}\n\nexport function getScrollableContentColumn(state: State, viewportX: number): { cellX: number, column: GridColumn } {\n const cellMatrix = state.cellMatrix;\n const scrollableContentX = viewportX - cellMatrix.ranges.stickyLeftRange.width;\n const column = cellMatrix.scrollableRange.columns.find(column => column.right >= scrollableContentX) || cellMatrix.scrollableRange.last.column;\n const cellX = scrollableContentX - column.left;\n return { cellX, column };\n} \n","import { PointerEvent } from '../Model/domEventsTypes';\nimport { getLocationFromClient } from './getLocationFromClient';\nimport { State } from '../Model/State';\nimport { focusLocation } from './focusLocation';\n\n\nexport function handleContextMenu(event: PointerEvent, state: State): State {\n event.preventDefault();\n const clickX = event.clientX;\n const clickY = event.clientY;\n const contextMenuPosition = state.contextMenuPosition;\n contextMenuPosition.top = clickY;\n contextMenuPosition.left = clickX;\n const focusedLocation = getLocationFromClient(state, clickX, clickY);\n if (!state.selectedRanges.find(range => range.contains(focusedLocation))) {\n state = focusLocation(state, focusedLocation)\n }\n return {\n ...state,\n contextMenuPosition\n }\n}\n","import {\n Location,\n isSelectionKey,\n isOnClickableArea,\n getCompatibleCellAndTemplate,\n CellMatrix,\n PointerLocation,\n} from \"../../core\";\nimport { PointerEvent } from \"../Model/domEventsTypes\";\nimport {\n updateActiveSelectedRange,\n selectRange,\n} from \"../Functions/selectRange\";\nimport { Behavior } from \"../Model/Behavior\";\nimport { State } from \"../Model/State\";\nimport { focusLocation } from \"../Functions/focusLocation\";\nimport { handleContextMenu } from \"../Functions/handleContextMenu\";\n\nexport class CellSelectionBehavior extends Behavior {\n handlePointerDown(\n event: PointerEvent,\n location: Location,\n state: State\n ): State {\n if ((event.target as HTMLDivElement).className === \"reactgrid-content\")\n return state;\n if (state.enableRangeSelection && event.shiftKey && state.focusedLocation) {\n const range = state.cellMatrix.getRange(state.focusedLocation, location);\n if (isSelectionKey(event) && state.selectionMode === \"range\") {\n return updateActiveSelectedRange(state, range);\n } else {\n return selectRange(state, range, false);\n }\n } else if (state.enableRangeSelection && isSelectionKey(event)) {\n const pointedRangeIdx = state.selectedRanges.findIndex((range) =>\n range.contains(location)\n );\n const pointedRange = state.selectedRanges[pointedRangeIdx];\n const { cellTemplate } = getCompatibleCellAndTemplate(state, location);\n if (pointedRange) {\n state = focusLocation(state, location, false);\n state = { ...state, activeSelectedRangeIdx: pointedRangeIdx };\n } else if (!cellTemplate.isFocusable) {\n const range = state.cellMatrix.getRange(location, location);\n state = selectRange(state, range, true);\n state = focusLocation(state, location, false);\n }\n } else {\n state = focusLocation(state, location);\n }\n return state;\n }\n\n handlePointerEnter(\n event: PointerEvent,\n location: Location,\n state: State\n ): State {\n if (\n !state.enableRangeSelection ||\n !state.focusedLocation ||\n (event.target as HTMLDivElement).className === \"reactgrid-content\"\n ) {\n // fix for FF scroll issue\n return state;\n }\n const range = state.cellMatrix.getRange(state.focusedLocation, location);\n if (state.selectionMode === \"range\" && isOnClickableArea(event, state)) {\n return updateActiveSelectedRange(state, range);\n } else {\n return selectRange(state, range, false);\n }\n }\n\n handlePointerUp(event: MouseEvent | PointerEvent, location: PointerLocation, state: State>): State> {\n if (state.props?.onSelectionChanging && !state.props.onSelectionChanging(state.selectedRanges)) {\n // Cancel the latest selection\n const filteredRanges = [\n ...state.selectedRanges,\n ].filter((_, index) => index !== state.activeSelectedRangeIdx);\n\n return {\n ...state,\n selectedRanges: filteredRanges,\n activeSelectedRangeIdx: filteredRanges.length - 1,\n };\n }\n\n state.props?.onSelectionChanged && state.props.onSelectionChanged(state.selectedRanges);\n\n return state;\n }\n\n handleContextMenu(event: PointerEvent, state: State): State {\n return handleContextMenu(event, state);\n }\n}\n","import { State } from '../Model/State';\nimport { Range } from '../Model/Range';\n\nexport function getActiveSelectedRange(state: State): Range {\n return state.selectedRanges[state.activeSelectedRangeIdx];\n}\n","import { Compatible, Cell } from '../Model/PublicModel';\n\nexport const emptyCell: Compatible = { type: '', text: '', value: NaN }","import { State } from '../Model/State';\nimport { emptyCell } from './emptyCell';\nimport { tryAppendChange } from './tryAppendChange';\n\nexport function wipeSelectedRanges(state: State): State {\n state.selectedRanges.forEach((range) =>\n range.rows.forEach((row) =>\n range.columns.forEach(\n (column) =>\n (state = tryAppendChange(\n state,\n { row, column },\n emptyCell\n ) as State)\n )\n )\n );\n return state;\n}","import { Location } from '../Model/InternalModel';\nimport { State } from '../Model/State';\nimport { getScrollOfScrollableElement } from './scrollHelpers';\nimport { getVisibleSizeOfReactGrid, getReactGridOffsets, getStickyOffset } from './elementSizeHelpers';\n\nexport function scrollIntoView(state: State, top: number, left: number): void {\n const scrollableElement = state.scrollableElement as HTMLElement;\n scrollableElement.scrollTop !== undefined ? scrollableElement.scrollTop = top : scrollableElement.scrollTo({ top });\n scrollableElement.scrollLeft !== undefined ? scrollableElement.scrollLeft = left : scrollableElement.scrollTo({ left });\n}\n\nexport function getVisibleScrollAreaHeight(state: State, wholeStickyHeight: number): number {\n const visibleContentHeight = getVisibleSizeOfReactGrid(state).height;\n return visibleContentHeight - wholeStickyHeight;\n}\n\nexport function getCalculatedScrollTopValueToBottom(location: Location, visibleScrollAreaHeight: number, scrollTop: number, topStickyOffset: number): number {\n return scrollTop + location.row.bottom - visibleScrollAreaHeight - topStickyOffset;\n}\n\nexport function getCalculatedScrollTopValueToTop(location: Location, scrollTop: number, topStickyOffset: number): number {\n return scrollTop - topStickyOffset + location.row.top - 1;\n}\n\nexport function isBottomCellAllVisible(state: State, location: Location, visibleScrollAreaHeight: number): boolean {\n const { scrollTop } = getScrollOfScrollableElement(state.scrollableElement);\n const { top } = getReactGridOffsets(state);\n const topStickyOffset = getStickyOffset(scrollTop, top);\n return visibleScrollAreaHeight < location.row.bottom - topStickyOffset;\n}\n\nexport function isTopCellAllVisible(state: State, location: Location): boolean {\n const { scrollTop } = getScrollOfScrollableElement(state.scrollableElement);\n const { top } = getReactGridOffsets(state);\n const topStickyOffset = getStickyOffset(scrollTop, top);\n return location.row.top < topStickyOffset;\n}\n\nexport function isFocusLocationOnTopSticky(state: State, location: Location): boolean {\n const { stickyTopRange } = state.cellMatrix.ranges;\n const row = location.row;\n return stickyTopRange.rows.length > 0 && row.idx <= stickyTopRange.last.row.idx;\n}\n\nexport function getVisibleScrollAreaWidth(state: State, wholeStickyWidth: number): number {\n const visibleContentWidth = getVisibleSizeOfReactGrid(state).width;\n return visibleContentWidth - wholeStickyWidth;\n}\n\nexport function getCalculatedScrollLeftValueToRight(location: Location, visibleScrollAreaWidth: number, scrollLeft: number, leftStickyOffset: number): number {\n return scrollLeft + location.column.right - visibleScrollAreaWidth - leftStickyOffset;\n}\n\nexport function getCalculatedScrollLeftValueToLeft(location: Location, scrollLeft: number, leftStickyOffset: number): number {\n return scrollLeft - leftStickyOffset + location.column.left - 1;\n}\n\nexport function isRightCellAllVisible(state: State, location: Location, visibleScrollAreaWidth: number): boolean {\n const { scrollLeft } = getScrollOfScrollableElement(state.scrollableElement);\n const { left } = getReactGridOffsets(state);\n const leftStickyOffset = getStickyOffset(scrollLeft, left);\n return visibleScrollAreaWidth < location.column.right - leftStickyOffset\n}\n\nexport function isLeftCellAllVisible(state: State, location: Location): boolean {\n const { scrollLeft } = getScrollOfScrollableElement(state.scrollableElement);\n const { left } = getReactGridOffsets(state);\n const leftStickyOffset = getStickyOffset(scrollLeft, left);\n return location.column.left < leftStickyOffset;\n}\n\nexport function isFocusLocationOnLeftSticky(state: State, location: Location): boolean {\n const { stickyLeftRange } = state.cellMatrix.ranges;\n const column = location.column;\n return stickyLeftRange.columns.length > 0 && column.idx <= stickyLeftRange.last.column.idx;\n}\n","import { Location } from '../Model/InternalModel';\nimport { State } from '../Model/State';\nimport { focusLocation } from './focusLocation';\nimport { getCompatibleCellAndTemplate } from './getCompatibleCellAndTemplate';\nimport { keyCodes } from './keyCodes';\nimport { getVisibleScrollAreaHeight, isFocusLocationOnTopSticky } from './scrollIntoView';\n\n// TODO: rewrite and simplify if possible\nexport type FocusLocationFn = (state: State, location: Location, applyResetSelection: boolean , keyCode?: keyCodes) => State;\nexport type FocusCellFn = (colIdx: number, rowIdx: number, state: State, keyCode?: keyCodes) => State;\nexport type RowCalcFn = (state: State, location: Location) => number;\n\nexport const focusCell = withFocusLocation(focusLocation as any);\nexport type ProFocusCellFn = (\n colIdx: number,\n rowIdx: number,\n state: State\n) => State;\n\nexport const moveFocusHome = withMoveFocusHome(focusCell);\nexport const moveFocusEnd = withMoveFocusEnd(focusCell);\nexport const moveFocusLeft = withMoveFocusLeft(focusCell);\nexport const moveFocusRight = withMoveFocusRight(focusCell);\nexport const moveFocusUp = withMoveFocusUp(focusCell);\nexport const moveFocusDown = withMoveFocusDown(focusCell);\n\nexport const moveFocusPage = withMoveFocusPage(focusCell);\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const moveFocusPageUp = moveFocusPage(pageUpRowCalc as any);\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const moveFocusPageDown = moveFocusPage(pageDownRowCalc as any);\n\n\nexport function withFocusLocation(focusLocation: FocusLocationFn) {\n return (colIdx: number, rowIdx: number, state: State, keyCode?: keyCodes): State => {\n return focusLocation(state, state.cellMatrix.getLocation(rowIdx, colIdx), true, keyCode);\n }\n}\n\nexport function withMoveFocusEnd(fc: FocusCellFn) {\n return (state: State): State => {\n if (state.focusedLocation) {\n const nextFocusableLocation = getNextFocusableLocation(state, state.focusedLocation.row.idx, state.cellMatrix.columns.length - 1)\n if (!nextFocusableLocation) {\n const nextLocation = state.cellMatrix.getLocation(state.focusedLocation.row.idx, state.cellMatrix.columns.length - 1);\n const focusLocation = getFocusLocationToLeft(state, nextLocation);\n return focusLocation ? fc(focusLocation.column.idx, focusLocation.row.idx, state) : state;\n }\n return fc(nextFocusableLocation.column.idx, nextFocusableLocation.row.idx, state);\n }\n return state;\n }\n}\n\nexport function withMoveFocusHome(fc: FocusCellFn) {\n return (state: State): State => {\n if (state.focusedLocation) {\n const nextFocusableLocation = getNextFocusableLocation(state, state.focusedLocation.row.idx, 0)\n if (!nextFocusableLocation) {\n const nextLocation = state.cellMatrix.getLocation(state.focusedLocation.row.idx, 0);\n const focusLocation = getFocusLocationToRight(state, nextLocation);\n return focusLocation ? fc(focusLocation.column.idx, focusLocation.row.idx, state) : state;\n }\n return fc(nextFocusableLocation.column.idx, nextFocusableLocation.row.idx, state);\n }\n return state;\n }\n}\nexport function withMoveFocusLeft(fc: FocusCellFn) {\n return (state: State): State => {\n const focusLocation = getFocusLocationToLeft(state, state.focusedLocation);\n return (focusLocation) ? fc(focusLocation.column.idx, focusLocation.row.idx, state) : state;\n }\n}\n\nexport function getNextFocusableLocation(state: State, rowIdx: number, colIdx: number): Location | undefined {\n const location = state.cellMatrix.getLocation(rowIdx, colIdx);\n const { cell, cellTemplate } = getCompatibleCellAndTemplate(state, location);\n if (!state.props) {\n throw new Error(`\"props\" field on \"state\" object should be initiated before possible location focus`);\n }\n const { onFocusLocationChanging } = state.props;\n const cellLocation = { rowId: location.row.rowId, columnId: location.column.columnId };\n const wasChangePrevented = !onFocusLocationChanging || onFocusLocationChanging(cellLocation);\n const isFocusable = (!cellTemplate.isFocusable || cellTemplate.isFocusable(cell)) && wasChangePrevented;\n return isFocusable ? location : undefined;\n}\n\nexport function getFocusLocationToLeft(state: State, location: Location | undefined): Location | undefined {\n if (location) {\n for (let colIdx = location.column.idx - 1; colIdx >= state.cellMatrix.first.column.idx; --colIdx) {\n const nextFocusableLocation = getNextFocusableLocation(state, location.row.idx, colIdx)\n if (nextFocusableLocation) {\n return nextFocusableLocation;\n }\n }\n }\n return undefined;\n}\n\nexport function withMoveFocusRight(fc: FocusCellFn) {\n return (state: State, keyCode?: keyCodes): State => {\n const focusLocation = getFocusLocationToRight(state, state.focusedLocation);\n return (focusLocation) ? fc(focusLocation.column.idx, focusLocation.row.idx, state, keyCode) : state;\n }\n}\n\nexport function getFocusLocationToRight(state: State, location: Location | undefined): Location | undefined {\n if (location) {\n for (let colIdx = location.column.idx + 1; colIdx <= state.cellMatrix.last.column.idx; ++colIdx) {\n const nextFocusableLocation = getNextFocusableLocation(state, location.row.idx, colIdx)\n if (nextFocusableLocation) {\n return nextFocusableLocation;\n }\n }\n }\n return undefined;\n}\n\nexport function withMoveFocusUp(fc: FocusCellFn) {\n return (state: State): State => {\n const focusLocation = getFocusLocationToUp(state, state.focusedLocation);\n return (focusLocation) ? fc(focusLocation.column.idx, focusLocation.row.idx, state) : state;\n }\n}\n\nexport function getFocusLocationToUp(state: State, location: Location | undefined): Location | undefined {\n if (location) {\n for (let rowIdx = location.row.idx - 1; rowIdx >= state.cellMatrix.first.row.idx; --rowIdx) {\n const nextFocusableLocation = getNextFocusableLocation(state, rowIdx, location.column.idx)\n if (nextFocusableLocation) {\n return nextFocusableLocation;\n }\n }\n }\n return undefined;\n}\n\nexport function withMoveFocusDown(fc: FocusCellFn) {\n return (state: State, keyCode?: keyCodes): State => {\n const focusLocation = getFocusLocationToDown(state, state.focusedLocation);\n return focusLocation ? fc(focusLocation.column.idx, focusLocation.row.idx, state, keyCode) : state;\n }\n}\n\nexport function getFocusLocationToDown(state: State, location: Location | undefined): Location | undefined {\n if (location) {\n for (let rowIdx = location.row.idx + 1; rowIdx <= state.cellMatrix.last.row.idx; ++rowIdx) {\n const nextFocusableLocation = getNextFocusableLocation(state, rowIdx, location.column.idx)\n if (nextFocusableLocation) {\n return nextFocusableLocation;\n }\n }\n }\n return undefined;\n}\n\nexport function withMoveFocusPage(fc: FocusCellFn) {\n return (rowCalculator: RowCalcFn) => {\n return (state: State): State => {\n const location = state.focusedLocation;\n if (!location)\n return state;\n const rowIdx = rowCalculator(state, location);\n return fc(location.column.idx, rowIdx, state);\n }\n }\n}\n\nexport function getVisibleHeight(state: State, stickyHeight: number): number {\n return getVisibleScrollAreaHeight(state, stickyHeight);\n}\n\n\n\nfunction pageDownRowCalc(state: State, location: Location): number {\n const hasTopSticky = state.cellMatrix.ranges.stickyTopRange.rows.length > 0;\n const isOnTopSticky =\n hasTopSticky && isFocusLocationOnTopSticky(state, location);\n const isOnLastRowOnTopSticky =\n hasTopSticky &&\n location.row.idx === state.cellMatrix.ranges?.stickyTopRange.last.row.idx;\n const hasScrollableRange = state.cellMatrix.scrollableRange.rows.length > 0;\n const isOnScrollableRange =\n hasScrollableRange &&\n location.row.idx >= state.cellMatrix.scrollableRange.first.row.idx &&\n location.row.idx < state.cellMatrix.scrollableRange.last.row.idx;\n const isOnLastRowOfScrollableRange =\n hasScrollableRange &&\n location.row.idx === state.cellMatrix.scrollableRange.last.row.idx;\n const hasBottomSticky =\n state.cellMatrix.ranges.stickyBottomRange.rows.length > 0;\n const isOnBottomSticky =\n hasBottomSticky &&\n location.row.idx >= state.cellMatrix.ranges.stickyBottomRange.first.row.idx;\n const visibleScrollAreaHeight = getVisibleHeight(\n state,\n state.cellMatrix.ranges.stickyTopRange.height +\n state.cellMatrix.ranges.stickyBottomRange.height\n );\n const rowsOnScreen = state.cellMatrix.scrollableRange.rows.filter(\n (row) => row.top + row.height < visibleScrollAreaHeight\n );\n let rowIdx = 0;\n if (isOnTopSticky) {\n if (isOnTopSticky && !isOnLastRowOnTopSticky) {\n rowIdx = state.cellMatrix.ranges.stickyTopRange.last.row.idx;\n } else if (hasScrollableRange) {\n rowIdx = state.cellMatrix.scrollableRange.first.row.idx;\n } else if (hasBottomSticky) {\n rowIdx = state.cellMatrix.ranges.stickyBottomRange.first.row.idx;\n } else {\n rowIdx = state.cellMatrix.ranges.stickyTopRange.last.row.idx;\n }\n } else if (isOnScrollableRange) {\n rowIdx =\n location.row.idx + rowsOnScreen.length <\n state.cellMatrix.scrollableRange.rows.length\n ? location.row.idx + rowsOnScreen.length\n : state.cellMatrix.scrollableRange.last.row.idx;\n } else if (isOnLastRowOfScrollableRange) {\n hasBottomSticky\n ? (rowIdx = state.cellMatrix.ranges.stickyBottomRange.first.row.idx)\n : (rowIdx = state.cellMatrix.scrollableRange.last.row.idx);\n } else if (isOnBottomSticky) {\n rowIdx = state.cellMatrix.ranges.stickyBottomRange.last.row.idx;\n }\n const nextFocusableLocation = getNextFocusableLocation(\n state,\n rowIdx,\n location.column.idx\n );\n if (!nextFocusableLocation) {\n const nextLocation = state.cellMatrix.getLocation(\n rowIdx,\n location.column.idx\n );\n const focusLocation = getFocusLocationToUp(state, nextLocation);\n return focusLocation ? focusLocation.row.idx : location.row.idx;\n }\n return rowIdx;\n}\n\nfunction pageUpRowCalc(state: State, location: Location): number {\n const visibleScrollAreaHeight = getVisibleHeight(\n state,\n state.cellMatrix.ranges.stickyTopRange.height +\n state.cellMatrix.ranges.stickyBottomRange.height\n );\n const hasTopSticky = state.cellMatrix.ranges.stickyTopRange.rows.length > 0;\n const isOnTopSticky =\n hasTopSticky && isFocusLocationOnTopSticky(state, location);\n const hasScrollableRange = state.cellMatrix.scrollableRange.rows.length > 0;\n const isOnScrollableRange =\n hasScrollableRange &&\n location.row.idx > state.cellMatrix.scrollableRange.first.row.idx &&\n location.row.idx <= state.cellMatrix.scrollableRange.last.row.idx;\n const isOnFirstElementOnScrollableRange =\n hasScrollableRange &&\n location.row.idx === state.cellMatrix.scrollableRange.first.row.idx;\n const hasBottomSticky =\n state.cellMatrix.ranges.stickyBottomRange.rows.length > 0;\n const isOnBottomSticky =\n hasBottomSticky &&\n location.row.idx >= state.cellMatrix.ranges.stickyBottomRange.first.row.idx;\n const isOnFirstRowOnBottomSticky =\n hasBottomSticky &&\n location?.row.idx ===\n state.cellMatrix.ranges?.stickyBottomRange.first.row.idx;\n\n const rowsOnScreen = state.cellMatrix.scrollableRange.rows.filter(\n (row) => row.top + row.height < visibleScrollAreaHeight\n );\n let rowIdx = 0;\n\n if (isOnBottomSticky) {\n if (isOnBottomSticky && !isOnFirstRowOnBottomSticky) {\n rowIdx = state.cellMatrix.ranges.stickyBottomRange.first.row.idx;\n } else if (hasScrollableRange) {\n rowIdx = state.cellMatrix.scrollableRange.last.row.idx;\n } else if (hasTopSticky) {\n rowIdx = state.cellMatrix.ranges.stickyTopRange.last.row.idx;\n } else {\n rowIdx = state.cellMatrix.ranges.stickyBottomRange.first.row.idx;\n }\n } else if (isOnScrollableRange) {\n rowIdx =\n location.row.idx - rowsOnScreen.length <\n state.cellMatrix.scrollableRange.first.row.idx\n ? state.cellMatrix.scrollableRange.first.row.idx\n : location.row.idx - rowsOnScreen.length;\n } else if (isOnFirstElementOnScrollableRange) {\n hasTopSticky\n ? (rowIdx = state.cellMatrix.ranges.stickyTopRange.last.row.idx)\n : (rowIdx = state.cellMatrix.scrollableRange.first.row.idx);\n } else if (isOnTopSticky) {\n rowIdx = state.cellMatrix.ranges.stickyTopRange.first.row.idx;\n }\n const nextFocusableLocation = getNextFocusableLocation(\n state,\n rowIdx,\n location.column.idx\n );\n if (!nextFocusableLocation) {\n const nextLocation = state.cellMatrix.getLocation(\n rowIdx,\n location.column.idx\n );\n const focusLocation = getFocusLocationToDown(state, nextLocation);\n return focusLocation ? focusLocation.row.idx : location.row.idx;\n }\n return rowIdx;\n}\n","import * as React from 'react';\n\ninterface HintProps {\n linePosition: number;\n left: number;\n offset: number;\n}\n\n// TODO these component props should be calculated directly by behaviour (only integers) \nexport const ResizeHint: React.FC = ({ left, linePosition, offset }) => {\n return (\n <>\n {linePosition !== -1 &&\n \n Width: {Math.floor(linePosition - left - offset)}px\n \n }\n \n )\n}\n","import React from \"react\";\nimport {\n Direction,\n GridColumn,\n PointerLocation,\n Range,\n getScrollOfScrollableElement,\n getReactGridOffsets,\n getStickyOffset,\n getVisibleSizeOfReactGrid,\n CellMatrix,\n} from \"../../core\";\nimport { PointerEvent } from \"../Model/domEventsTypes\";\nimport { State } from \"../Model/State\";\nimport { Behavior } from \"../Model/Behavior\";\nimport { ResizeHint } from \"../Components/ResizeHint\";\n\nexport class ResizeColumnBehavior extends Behavior {\n // TODO min / max column with on column object\n private resizedColumn!: GridColumn;\n private initialLocation!: PointerLocation;\n autoScrollDirection: Direction = \"horizontal\";\n isInScrollableRange!: boolean;\n\n handlePointerDown(\n event: PointerEvent,\n location: PointerLocation,\n state: State\n ): State {\n this.initialLocation = location;\n this.resizedColumn = location.column;\n this.isInScrollableRange = state.cellMatrix.scrollableRange.columns.some(\n (c) => c.idx === this.resizedColumn.idx\n );\n return state;\n }\n handlePointerMove(\n event: PointerEvent,\n location: PointerLocation,\n state: State\n ): State {\n let linePosition = location.viewportX;\n if (\n !(\n (location.column.idx === this.resizedColumn.idx &&\n location.cellX > (state.props?.minColumnWidth ?? CellMatrix.MIN_COLUMN_WIDTH)) ||\n location.column.idx > this.resizedColumn.idx\n )\n ) {\n const offset = this.getLinePositionOffset(state);\n linePosition =\n (state.props?.minColumnWidth ?? CellMatrix.MIN_COLUMN_WIDTH) + this.resizedColumn.left + offset;\n }\n return { ...state, linePosition, lineOrientation: \"vertical\" };\n }\n\n handlePointerUp(\n event: PointerEvent,\n location: PointerLocation,\n state: State\n ): State {\n const newWidth =\n this.resizedColumn.width +\n location.viewportX -\n this.initialLocation.viewportX;\n if (state.props?.onColumnResized) {\n const newColWidth =\n newWidth >= (state.props?.minColumnWidth ?? CellMatrix.MIN_COLUMN_WIDTH)\n ? newWidth\n : (state.props?.minColumnWidth ?? CellMatrix.MIN_COLUMN_WIDTH);\n state.props.onColumnResized(\n this.resizedColumn.columnId,\n newColWidth,\n state.selectedIds\n );\n }\n let focusedLocation = state.focusedLocation;\n if (\n focusedLocation !== undefined &&\n this.resizedColumn.columnId === focusedLocation.column.idx\n ) {\n const column = { ...focusedLocation.column, width: newWidth };\n focusedLocation = { ...focusedLocation, column };\n }\n return { ...state, linePosition: -1, focusedLocation };\n }\n\n //should render ResizeHint on pane which has got the highest priority\n renderPanePart(state: State, pane: Range): React.ReactNode {\n const offset = this.getLinePositionOffset(state);\n return (\n pane.contains(this.initialLocation) && (\n \n )\n );\n }\n\n getLinePositionOffset(state: State): number {\n const { scrollLeft } = getScrollOfScrollableElement(\n state.scrollableElement\n );\n const { left } = getReactGridOffsets(state);\n const leftStickyOffset = getStickyOffset(scrollLeft, left);\n const rightStickyOffset =\n getVisibleSizeOfReactGrid(state).width +\n leftStickyOffset -\n state.cellMatrix.ranges.stickyRightRange.width;\n let offset = 0;\n if (\n state.cellMatrix.scrollableRange.columns.some(\n (c) => c.idx === this.resizedColumn.idx\n )\n ) {\n offset = state.cellMatrix.ranges.stickyLeftRange.width;\n } else if (\n state.cellMatrix.ranges.stickyRightRange.columns.some(\n (c) => c.idx === this.resizedColumn.idx\n )\n ) {\n offset = rightStickyOffset;\n } else {\n offset = scrollLeft;\n }\n return offset;\n }\n}\n","import { Direction, Location } from './../Model/InternalModel';\nimport { State } from './../Model/State';\nimport { ReactGridProps } from './../Model/PublicModel';\nimport { areLocationsEqual } from './areLocationsEqual';\nimport { getReactGridOffsets, getStickyOffset } from './elementSizeHelpers';\nimport { getScrollOfScrollableElement, getTopScrollableElement } from './scrollHelpers';\nimport {\n getCalculatedScrollLeftValueToLeft, getCalculatedScrollLeftValueToRight, getCalculatedScrollTopValueToBottom,\n getCalculatedScrollTopValueToTop, getVisibleScrollAreaHeight, getVisibleScrollAreaWidth, isBottomCellAllVisible,\n isFocusLocationOnLeftSticky, isFocusLocationOnTopSticky, isLeftCellAllVisible, isRightCellAllVisible,\n isTopCellAllVisible, scrollIntoView\n} from './scrollIntoView';\nimport { ResizeColumnBehavior } from '../Behaviors/ResizeColumnBehavior';\n\n//TODO what about initialFocusLocation and focusLocation set by props\nexport function componentDidUpdate(\n prevProps: ReactGridProps,\n prevState: State,\n state: State\n ): void {\n const location = state.focusedLocation;\n if (location) {\n const shouldChangeScroll =\n !areLocationsEqual(location, prevState.focusedLocation) &&\n !(state.currentBehavior instanceof ResizeColumnBehavior);\n const wasCellEditorOpened =\n state.currentlyEditedCell !== undefined &&\n state.currentlyEditedCell !== prevState.currentlyEditedCell;\n if (shouldChangeScroll || wasCellEditorOpened) {\n const { left, top } = scrollCalculator(state, location);\n scrollIntoView(state, top, left);\n }\n //TODO Try to change scroll after selected range is changing\n // const activeSelectedRange = getProActiveSelectedRange(prevState);\n // if (activeSelectedRange) {\n // const shouldChangeScrollForActiveSelectedRangeChange = areRangeIsChanging(state, prevState);\n // if (shouldChangeScrollForActiveSelectedRangeChange && (state.selectedRanges[0].rows.length !== 1 || state.selectedRanges[0].columns.length !== 1)) {\n \n // }\n // }\n }\n }\n \n export function scrollCalculator(\n state: State,\n location: Location,\n direction: Direction = \"both\"\n ): { top: number; left: number } {\n const top = getScrollTop(state, location, direction === \"horizontal\");\n const left = getScrollLeft(state, location, direction === \"vertical\");\n return { top, left };\n }\n \n export function getScrollTop(\n state: State,\n location: Location,\n dontChange: boolean\n ): number {\n const { stickyTopRange, stickyBottomRange } = state.cellMatrix.ranges;\n const { scrollTop } = getScrollOfScrollableElement(state.scrollableElement);\n const wholeStickyHeight = stickyTopRange.height + stickyBottomRange.height;\n const visibleScrollAreaHeight = getVisibleScrollAreaHeight(\n state,\n wholeStickyHeight\n );\n const { top } = getReactGridOffsets(state);\n const topStickyOffset = getStickyOffset(scrollTop, top);\n const row = location.row;\n if (dontChange || !row) {\n return scrollTop;\n }\n const additionalPixelOnScrollingOnBody = isLocationOnScrollableBody(\n state,\n location\n )\n ? 1\n : 0;\n if (\n isFocusLocationOnTopSticky(state, location) ||\n isFocusLocationOnBottomSticky(state, location)\n ) {\n return scrollTop;\n } else if (\n isBottomCellAllVisible(\n state,\n location,\n visibleScrollAreaHeight + additionalPixelOnScrollingOnBody\n )\n ) {\n return getCalculatedScrollTopValueToBottom(\n location,\n visibleScrollAreaHeight - 1 - additionalPixelOnScrollingOnBody,\n scrollTop,\n topStickyOffset\n );\n } else if (isTopCellAllVisible(state, location)) {\n return getCalculatedScrollTopValueToTop(\n location,\n scrollTop,\n topStickyOffset\n );\n }\n return scrollTop;\n }\n \n export function getScrollLeft(\n state: State,\n location: Location,\n dontChange: boolean\n ): number {\n const { stickyLeftRange, stickyRightRange } = state.cellMatrix.ranges;\n const { scrollLeft } = getScrollOfScrollableElement(state.scrollableElement);\n const wholeStickyWidth = stickyLeftRange.width + stickyRightRange.width;\n const visibleScrollAreaWidth = getVisibleScrollAreaWidth(\n state,\n wholeStickyWidth\n );\n const { left } = getReactGridOffsets(state);\n const leftStickyOffset = getStickyOffset(scrollLeft, left);\n const column = location.column;\n if (dontChange || !column) {\n return scrollLeft;\n }\n const additionalPixelOnScrollingOnBody = isLocationOnScrollableBody(\n state,\n location\n )\n ? 1\n : 0;\n if (\n isFocusLocationOnLeftSticky(state, location) ||\n isFocusLocationOnRightSticky(state, location)\n ) {\n return scrollLeft;\n } else if (\n isRightCellAllVisible(\n state,\n location,\n visibleScrollAreaWidth + additionalPixelOnScrollingOnBody\n )\n ) {\n return getCalculatedScrollLeftValueToRight(\n location,\n visibleScrollAreaWidth - 1 - additionalPixelOnScrollingOnBody,\n scrollLeft,\n leftStickyOffset\n );\n } else if (isLeftCellAllVisible(state, location)) {\n return getCalculatedScrollLeftValueToLeft(\n location,\n scrollLeft,\n leftStickyOffset\n );\n }\n return scrollLeft;\n }\n \n function isFocusLocationOnRightSticky(state: State, location: Location) {\n const { stickyRightRange } = state.cellMatrix.ranges;\n const column = location.column;\n return (\n stickyRightRange.columns.length > 0 &&\n column.idx >= stickyRightRange.first.column.idx\n );\n }\n \n function isFocusLocationOnBottomSticky(state: State, location: Location) {\n const { stickyBottomRange } = state.cellMatrix.ranges;\n const row = location.row;\n return (\n stickyBottomRange.rows.length > 0 &&\n row.idx >= stickyBottomRange.first.row.idx\n );\n }\n \n function isLocationOnScrollableBody(state: State, location: Location) {\n return (\n state.cellMatrix.scrollableRange.contains(location) &&\n state.scrollableElement === getTopScrollableElement()\n );\n }\n ","import { keyCodes } from \"../../lib\";\nimport {\n handleKeyDownOnCellTemplate,\n areLocationsEqual,\n isMacOs,\n isSelectionKey,\n Range,\n Location,\n scrollIntoView,\n getVisibleScrollAreaHeight,\n} from \"../../core\";\nimport { KeyboardEvent } from \"../Model/domEventsTypes\";\nimport { getActiveSelectedRange } from \"./getActiveSelectedRange\";\nimport { State } from \"../Model/State\";\nimport { focusLocation } from \"./focusLocation\";\nimport { wipeSelectedRanges } from \"./wipeSelectedRanges\";\nimport {\n moveFocusLeft,\n moveFocusUp,\n moveFocusDown,\n moveFocusRight,\n moveFocusPageDown,\n moveFocusPageUp,\n moveFocusHome,\n moveFocusEnd,\n} from \"./focuses\";\nimport { scrollCalculator } from \"./componentDidUpdate\";\nimport { resetSelection } from \"./selectRange\";\nimport { newLocation } from \"./newLocation\";\n\nexport function handleKeyDown(state: State, event: KeyboardEvent): State {\n const newState = handleKeyDownInternal(state, event);\n if (newState !== state) {\n event.stopPropagation();\n event.preventDefault();\n }\n return newState;\n}\n\n// TODO: rewrite/simplify if possible\nfunction handleKeyDownInternal(\n state: State,\n event: KeyboardEvent\n): State {\n const location = state.focusedLocation;\n if (!location) {\n return state;\n }\n\n const asr = getActiveSelectedRange(state) ?? state.cellMatrix.getRange(location, location);\n\n if (event.ctrlKey && isMacOs()) {\n switch (event.keyCode) {\n case keyCodes.SPACE:\n return resizeSelection(\n state,\n asr.first.column.idx,\n asr.last.column.idx,\n 0,\n state.cellMatrix.last.row.idx\n );\n }\n }\n\n const isSingleCellSelected =\n state.selectedRanges.length === 1 && areLocationsEqual(asr.first, asr.last);\n const newState = handleKeyDownOnCellTemplate(state, event) as State;\n if (newState !== state) {\n if (!isSingleCellSelected && event.keyCode === keyCodes.ENTER) {\n const direction = event.shiftKey\n ? \"up\"\n : state.props?.moveRightOnEnter\n ? \"right\"\n : \"down\";\n state.hiddenFocusElement?.focus();\n return moveFocusInsideSelectedRange(\n state,\n direction,\n asr,\n location\n ) as State;\n }\n return newState;\n }\n\n if (event.altKey) return state;\n\n if (isSelectionKey(event) && event.shiftKey) {\n switch (event.keyCode) {\n case keyCodes.HOME:\n return resizeSelection(\n state,\n asr.first.column.idx,\n asr.last.column.idx,\n 0,\n asr.last.row.idx\n );\n case keyCodes.END:\n return resizeSelection(\n state,\n asr.first.column.idx,\n asr.last.column.idx,\n asr.first.row.idx,\n state.cellMatrix.last.row.idx\n );\n }\n } else if (isSelectionKey(event)) {\n const cm = state.cellMatrix;\n switch (event.keyCode) {\n case keyCodes.KEY_A: {\n if (\n state.selectedRanges.length === 1 &&\n areLocationsEqual(state.selectedRanges[0].first, cm.first) &&\n areLocationsEqual(state.selectedRanges[0].last, cm.last)\n ) {\n return resetSelection(state, location);\n }\n\n const newRange = cm.getRange(cm.first, cm.last);\n\n if (state.props?.onSelectionChanging && !state.props.onSelectionChanging([newRange])) { \n return state;\n }\n\n return {\n ...state,\n selectedRanges: [newRange],\n selectionMode: \"range\",\n activeSelectedRangeIdx: 0,\n };\n }\n case keyCodes.HOME:\n return focusLocation(state, state.cellMatrix.first);\n case keyCodes.END:\n return focusLocation(state, state.cellMatrix.last);\n case keyCodes.SPACE:\n return resizeSelection(\n state,\n asr.first.column.idx,\n asr.last.column.idx,\n 0,\n state.cellMatrix.last.row.idx\n );\n }\n } else if (event.shiftKey) {\n switch (event.keyCode) {\n case keyCodes.UP_ARROW:\n return resizeSelectionUp(state, asr, location);\n case keyCodes.DOWN_ARROW:\n return resizeSelectionDown(state, asr, location);\n case keyCodes.LEFT_ARROW:\n return resizeSelectionLeft(state, asr, location);\n case keyCodes.RIGHT_ARROW:\n return resizeSelectionRight(state, asr, location);\n case keyCodes.TAB:\n event.preventDefault(); // prevent from leaving HFE\n return (\n isSingleCellSelected\n ? moveFocusLeft(state)\n : moveFocusInsideSelectedRange(state, \"left\", asr, location)\n ) as State;\n case keyCodes.ENTER:\n state.hiddenFocusElement?.focus();\n return (\n isSingleCellSelected\n ? moveFocusUp(state)\n : moveFocusInsideSelectedRange(state, \"up\", asr, location)\n ) as State;\n case keyCodes.SPACE:\n return resizeSelection(\n state,\n 0,\n state.cellMatrix.last.column.idx,\n asr.first.row.idx,\n asr.last.row.idx\n );\n case keyCodes.HOME:\n return resizeSelection(\n state,\n 0,\n asr.last.column.idx,\n asr.first.row.idx,\n asr.last.row.idx\n );\n case keyCodes.END:\n return resizeSelection(\n state,\n asr.first.column.idx,\n state.cellMatrix.last.column.idx,\n asr.first.row.idx,\n asr.last.row.idx\n );\n case keyCodes.PAGE_UP:\n return resizeSelectionPageUp(state, asr, location);\n case keyCodes.PAGE_DOWN:\n return resizeSelectionPageDown(state, asr, location);\n }\n } else {\n // === NO SHIFT OR CONTROL ===\n switch (event.keyCode) {\n case keyCodes.DELETE:\n case keyCodes.BACKSPACE:\n state.hiddenFocusElement?.focus();\n return wipeSelectedRanges(state) as State;\n case keyCodes.UP_ARROW:\n state.hiddenFocusElement?.focus();\n return moveFocusUp(state) as State;\n case keyCodes.DOWN_ARROW:\n state.hiddenFocusElement?.focus();\n return moveFocusDown(state) as State;\n case keyCodes.LEFT_ARROW:\n state.hiddenFocusElement?.focus();\n return moveFocusLeft(state) as State;\n case keyCodes.RIGHT_ARROW:\n state.hiddenFocusElement?.focus();\n return moveFocusRight(state) as State;\n case keyCodes.TAB:\n state.hiddenFocusElement?.focus();\n event.preventDefault(); // prevent from leaving HFE\n return (\n isSingleCellSelected\n ? moveFocusRight(state)\n : moveFocusInsideSelectedRange(state, \"right\", asr, location)\n ) as State;\n case keyCodes.HOME:\n state.hiddenFocusElement?.focus();\n return moveFocusHome(state) as State;\n case keyCodes.END:\n state.hiddenFocusElement?.focus();\n return moveFocusEnd(state) as State;\n case keyCodes.PAGE_UP:\n state.hiddenFocusElement?.focus();\n return moveFocusPageUp(state) as State;\n case keyCodes.PAGE_DOWN:\n state.hiddenFocusElement?.focus();\n return moveFocusPageDown(state) as State;\n case keyCodes.ENTER: {\n const isMoveRightEnable = state.props?.moveRightOnEnter\n ? { ...moveFocusRight(state, event.keyCode), currentlyEditedCell: undefined }\n : { ...moveFocusDown(state, event.keyCode), currentlyEditedCell: undefined };\n state.hiddenFocusElement?.focus();\n return (\n isSingleCellSelected\n ? isMoveRightEnable\n : moveFocusInsideSelectedRange(state, \"right\", asr, location)\n ) as State;\n }\n case keyCodes.ESCAPE:\n event.preventDefault();\n state.hiddenFocusElement?.focus();\n return state.currentlyEditedCell\n ? { ...state, currentlyEditedCell: undefined }\n : state;\n }\n }\n\n return state;\n}\n\nfunction moveFocusInsideSelectedRange(\n state: State,\n direction: \"left\" | \"right\" | \"up\" | \"down\",\n asr: Range,\n location: Location\n): State {\n const selectedRangeIdx = state.activeSelectedRangeIdx;\n const colCount = asr ? asr.columns.length : 0;\n const rowCount = asr ? asr.rows.length : 0;\n const delta = direction === \"up\" || direction === \"left\" ? -1 : 1;\n\n const currentPosInRange =\n direction === \"up\" || direction === \"down\"\n ? location.row.idx -\n asr.first.row.idx +\n (location.column.idx - asr.first.column.idx) * rowCount\n : (location.row.idx - asr.first.row.idx) * colCount +\n (location.column.idx - asr.first.column.idx);\n\n const newPosInRange =\n (currentPosInRange + delta) % (asr.rows.length * asr.columns.length);\n\n const onShiftAndTabKeys =\n (newPosInRange < 0 && currentPosInRange === 0) ||\n (rowCount === 1 && colCount === 1 && delta === -1);\n const onTabKey =\n (newPosInRange === 0 &&\n currentPosInRange === asr.rows.length * asr.columns.length - 1 &&\n ((rowCount >= 3 && colCount >= 1) || (rowCount >= 1 && colCount >= 3))) ||\n (newPosInRange === 0 &&\n currentPosInRange === asr.rows.length * asr.columns.length - 1 &&\n ((rowCount === 2 && colCount >= 1) ||\n (rowCount >= 1 && colCount === 2)) &&\n delta === 1) ||\n (newPosInRange < 0 && currentPosInRange === 0) ||\n (rowCount === 1 && colCount === 1 && delta === 1); // must be so complicated\n\n if (onShiftAndTabKeys) {\n // shift + tab/enter and first cell focused in active range\n const nextSelectionRangeIdx =\n selectedRangeIdx === 0\n ? state.selectedRanges.length - 1\n : (selectedRangeIdx - 1) % state.selectedRanges.length;\n const nextSelection = state.selectedRanges[nextSelectionRangeIdx];\n state = focusLocation(\n state,\n newLocation(nextSelection.last.row, nextSelection.last.column),\n false\n );\n return { ...state, activeSelectedRangeIdx: nextSelectionRangeIdx };\n } else if (onTabKey) {\n // tab/enter and last cell focused in active range\n const nextSelectionRangeIdx =\n (selectedRangeIdx + 1) % state.selectedRanges.length;\n const nextSelection = state.selectedRanges[nextSelectionRangeIdx];\n state = focusLocation(\n state,\n newLocation(nextSelection.first.row, nextSelection.first.column),\n false\n );\n return { ...state, activeSelectedRangeIdx: nextSelectionRangeIdx };\n } else {\n // tab/enter and all cells inside active range except last cell && shift + tab/enter and all cells inside active range except first cell\n const focusedCellColIdxInRange =\n direction === \"up\" || direction === \"down\"\n ? Math.floor(newPosInRange / rowCount)\n : newPosInRange % colCount;\n const focusedCellRowIdxInRange =\n direction === \"up\" || direction === \"down\"\n ? newPosInRange % rowCount\n : Math.floor(newPosInRange / colCount);\n const focusedCellColIdx = asr.first.column.idx + focusedCellColIdxInRange;\n const focusedCellRowIdx = asr.first.row.idx + focusedCellRowIdxInRange;\n state = focusLocation(\n state,\n state.cellMatrix.getLocation(focusedCellRowIdx, focusedCellColIdx),\n asr\n ? asr.columns.length > 1 || asr.rows.length > 1\n ? false\n : true\n : true\n );\n return state;\n }\n}\n\nfunction getVisibleHeight(state: State): number {\n const { stickyBottomRange, stickyTopRange } = state.cellMatrix.ranges;\n const wholeStickyHeight = stickyBottomRange.height + stickyTopRange.height;\n const visibleScrollAreaHeight = getVisibleScrollAreaHeight(\n state,\n wholeStickyHeight\n );\n return visibleScrollAreaHeight;\n}\n\nfunction resizeSelectionPageDown(\n state: State,\n asr: Range,\n location: Location\n): State {\n const visibleScrollAreaHeight = getVisibleHeight(state);\n\n const isLastRowOnTopSticky =\n state.cellMatrix.ranges.stickyTopRange.rows.length > 0 &&\n asr.last.row.idx < state.cellMatrix.ranges.stickyTopRange.last.row.idx;\n const isFirstRowOnTopSticky =\n state.cellMatrix.ranges.stickyTopRange.rows.length > 0 &&\n asr.first.row.idx < state.cellMatrix.ranges.stickyTopRange.last.row.idx;\n const isOnLastRowOnTopSticky =\n state.cellMatrix.ranges.stickyTopRange.rows.length > 0 &&\n asr.last.row.idx === state.cellMatrix.ranges.stickyTopRange.last.row.idx;\n const isOnFirstRowOnTopSticky =\n state.cellMatrix.ranges.stickyTopRange.rows.length > 0 &&\n asr.first.row.idx === state.cellMatrix.ranges.stickyTopRange.last.row.idx;\n const isOnLastRowOnScrollableRange =\n state.cellMatrix.scrollableRange.rows.length > 0 &&\n state.cellMatrix.ranges.stickyBottomRange.rows.length > 0 &&\n asr.last.row.idx === state.cellMatrix.scrollableRange.last.row.idx;\n const isOnFirstRowOnScrollableRange =\n state.cellMatrix.scrollableRange.rows.length > 0 &&\n state.cellMatrix.ranges.stickyBottomRange.rows.length > 0 &&\n asr.first.row.idx === state.cellMatrix.scrollableRange.last.row.idx;\n const isLastRowOnBottomSticky =\n state.cellMatrix.ranges.stickyBottomRange.rows.length > 0 &&\n asr.last.row.idx >= state.cellMatrix.ranges.stickyBottomRange.first.row.idx;\n const isFirstRowOnBottomSticky =\n state.cellMatrix.ranges.stickyBottomRange.rows.length > 0 &&\n asr.first.row.idx >=\n state.cellMatrix.ranges.stickyBottomRange.first.row.idx;\n\n const rowsOnScreen = state.cellMatrix.scrollableRange.rows.filter(\n (row) => row.top + row.height < visibleScrollAreaHeight\n );\n return asr.last.row.idx <= state.cellMatrix.last.row.idx\n ? asr.first.row.idx < location.row.idx\n ? resizeSelection(\n state,\n asr.last.column.idx,\n asr.first.column.idx,\n asr.last.row.idx,\n isFirstRowOnTopSticky\n ? state.cellMatrix.ranges.stickyTopRange.last.row.idx\n : isOnFirstRowOnTopSticky\n ? state.cellMatrix.scrollableRange.rows.length > 0\n ? state.cellMatrix.scrollableRange.first.row.idx\n : state.cellMatrix.ranges.stickyBottomRange.first.row.idx\n : isOnFirstRowOnScrollableRange\n ? state.cellMatrix.ranges.stickyBottomRange.first.row.idx\n : isFirstRowOnBottomSticky\n ? state.cellMatrix.ranges.stickyBottomRange.last.row.idx\n : asr.first.row.idx + rowsOnScreen.length >=\n state.cellMatrix.scrollableRange.last.row.idx\n ? state.cellMatrix.scrollableRange.last.row.idx\n : asr.first.row.idx + rowsOnScreen.length,\n \"vertical\"\n )\n : resizeSelection(\n state,\n asr.first.column.idx,\n asr.last.column.idx,\n asr.first.row.idx,\n isLastRowOnBottomSticky\n ? state.cellMatrix.ranges.stickyBottomRange.last.row.idx\n : isOnLastRowOnTopSticky\n ? state.cellMatrix.scrollableRange.rows.length > 0\n ? state.cellMatrix.scrollableRange.first.row.idx\n : state.cellMatrix.ranges.stickyBottomRange.rows.length > 0\n ? state.cellMatrix.ranges.stickyBottomRange.first.row.idx\n : state.cellMatrix.ranges.stickyTopRange.last.row.idx\n : isOnLastRowOnScrollableRange\n ? state.cellMatrix.ranges.stickyBottomRange.first.row.idx\n : isLastRowOnTopSticky\n ? state.cellMatrix.ranges.stickyTopRange.last.row.idx\n : asr.last.row.idx + rowsOnScreen.length >=\n state.cellMatrix.scrollableRange.last.row.idx\n ? state.cellMatrix.scrollableRange.last.row.idx\n : asr.last.row.idx + rowsOnScreen.length,\n \"vertical\"\n )\n : state;\n}\n\nfunction resizeSelectionPageUp(\n state: State,\n asr: Range,\n location: Location\n): State {\n const visibleScrollAreaHeight = getVisibleHeight(state);\n\n const isFirstRowOnBottomSticky =\n state.cellMatrix.ranges.stickyBottomRange.rows.length > 0 &&\n asr.first.row.idx > state.cellMatrix.ranges.stickyBottomRange.first.row.idx;\n const isLastRowOnBottomSticky =\n state.cellMatrix.ranges.stickyBottomRange.rows.length > 0 &&\n asr.last.row.idx === state.cellMatrix.ranges.stickyBottomRange.last.row.idx;\n const isOnLastRowOnBottomSticky =\n state.cellMatrix.ranges.stickyBottomRange.rows.length > 0 &&\n asr.last.row.idx ===\n state.cellMatrix.ranges.stickyBottomRange.first.row.idx;\n const isOnFirstRowOnBottomSticky =\n state.cellMatrix.ranges.stickyBottomRange.rows.length > 0 &&\n asr.first.row.idx ===\n state.cellMatrix.ranges.stickyBottomRange.first.row.idx;\n const isOnLastRowOnTopSticky =\n state.cellMatrix.ranges.stickyTopRange.rows.length > 0 &&\n asr.last.row.idx === state.cellMatrix.ranges.stickyTopRange.last.row.idx;\n const isOnFirstRowOnScrollableRange =\n state.cellMatrix.scrollableRange.rows.length > 0 &&\n state.cellMatrix.ranges.stickyTopRange.rows.length > 0 &&\n asr.first.row.idx === state.cellMatrix.scrollableRange.first.row.idx;\n const isOnLastRowOnScrollableRange =\n state.cellMatrix.scrollableRange.rows.length > 0 &&\n state.cellMatrix.ranges.stickyTopRange.rows.length > 0 &&\n asr.last.row.idx === state.cellMatrix.scrollableRange.first.row.idx;\n const isOnTopSticky =\n state.cellMatrix.ranges.stickyTopRange.rows.length > 0 &&\n asr.first.row.idx <= state.cellMatrix.ranges.stickyTopRange.last.row.idx;\n\n const rowsOnScreen = state.cellMatrix.scrollableRange.rows.filter(\n (row) => row.top + row.height < visibleScrollAreaHeight\n );\n\n return asr.first.row.idx >= 0\n ? asr.last.row.idx > location.row.idx\n ? resizeSelection(\n state,\n asr.first.column.idx,\n asr.last.column.idx,\n asr.first.row.idx,\n isLastRowOnBottomSticky\n ? state.cellMatrix.ranges.stickyBottomRange.first.row.idx\n : isOnLastRowOnBottomSticky\n ? state.cellMatrix.scrollableRange.rows.length > 0\n ? state.cellMatrix.scrollableRange.last.row.idx\n : state.cellMatrix.ranges.stickyTopRange.first.row.idx\n : isOnLastRowOnScrollableRange\n ? state.cellMatrix.ranges.stickyTopRange.last.row.idx\n : isOnLastRowOnTopSticky\n ? state.cellMatrix.ranges.stickyTopRange.first.row.idx\n : asr.last.row.idx - rowsOnScreen.length >\n state.cellMatrix.scrollableRange.first.row.idx\n ? asr.last.row.idx - rowsOnScreen.length\n : state.cellMatrix.scrollableRange.first.row.idx,\n \"vertical\"\n )\n : resizeSelection(\n state,\n asr.last.column.idx,\n asr.first.column.idx,\n asr.last.row.idx,\n isFirstRowOnBottomSticky\n ? state.cellMatrix.ranges.stickyBottomRange.first.row.idx\n : isOnFirstRowOnBottomSticky\n ? state.cellMatrix.scrollableRange.rows.length > 0\n ? state.cellMatrix.scrollableRange.last.row.idx\n : state.cellMatrix.ranges.stickyTopRange.rows.length > 0\n ? state.cellMatrix.ranges.stickyTopRange.first.row.idx\n : state.cellMatrix.ranges.stickyBottomRange.first.row.idx\n : isOnFirstRowOnScrollableRange\n ? state.cellMatrix.ranges.stickyTopRange.last.row.idx\n : isOnTopSticky\n ? state.cellMatrix.ranges.stickyTopRange.first.row.idx\n : isFirstRowOnBottomSticky\n ? state.cellMatrix.ranges.stickyBottomRange.first.row.idx\n : asr.first.row.idx - rowsOnScreen.length >\n state.cellMatrix.scrollableRange.first.row.idx\n ? asr.first.row.idx - rowsOnScreen.length\n : state.cellMatrix.scrollableRange.first.row.idx,\n \"vertical\"\n )\n : state;\n}\n\nfunction resizeSelectionUp(\n state: State,\n asr: Range,\n location: Location\n): State {\n return asr.first.row.idx >= 0\n ? asr.last.row.idx > location.row.idx\n ? resizeSelection(\n state,\n asr.first.column.idx,\n asr.last.column.idx,\n asr.first.row.idx,\n asr.last.row.idx > 0 ? asr.last.row.idx - 1 : 0,\n \"vertical\"\n )\n : resizeSelection(\n state,\n asr.last.column.idx,\n asr.first.column.idx,\n asr.last.row.idx,\n asr.first.row.idx > 0 ? asr.first.row.idx - 1 : 0,\n \"vertical\"\n )\n : state;\n}\n\nfunction resizeSelectionDown(\n state: State,\n asr: Range,\n location: Location\n): State {\n return asr.last.row.idx <= state.cellMatrix.last.row.idx\n ? asr.first.row.idx < location.row.idx\n ? resizeSelection(\n state,\n asr.last.column.idx,\n asr.first.column.idx,\n asr.last.row.idx,\n asr.first.row.idx >= state.cellMatrix.last.row.idx\n ? state.cellMatrix.last.row.idx\n : asr.first.row.idx + 1,\n \"vertical\"\n )\n : resizeSelection(\n state,\n asr.first.column.idx,\n asr.last.column.idx,\n asr.first.row.idx,\n asr.last.row.idx >= state.cellMatrix.last.row.idx\n ? state.cellMatrix.last.row.idx\n : asr.last.row.idx + 1,\n \"vertical\"\n )\n : state;\n}\n\nfunction resizeSelectionLeft(\n state: State,\n asr: Range,\n location: Location\n): State {\n return asr.first.column.idx >= 0\n ? asr.last.column.idx > location.column.idx\n ? resizeSelection(\n state,\n asr.first.column.idx,\n asr.last.column.idx > 0 ? asr.last.column.idx - 1 : 0,\n asr.first.row.idx,\n asr.last.row.idx,\n \"horizontal\"\n )\n : resizeSelection(\n state,\n asr.last.column.idx,\n asr.first.column.idx > 0 ? asr.first.column.idx - 1 : 0,\n asr.last.row.idx,\n asr.first.row.idx,\n \"horizontal\"\n )\n : state;\n}\n\nfunction resizeSelectionRight(\n state: State,\n asr: Range,\n location: Location\n): State {\n return asr.last.column.idx <= state.cellMatrix.last.column.idx\n ? asr.first.column.idx < location.column.idx\n ? resizeSelection(\n state,\n asr.last.column.idx,\n asr.first.column.idx >= state.cellMatrix.last.column.idx\n ? state.cellMatrix.last.column.idx\n : asr.first.column.idx + 1,\n asr.last.row.idx,\n asr.first.row.idx,\n \"horizontal\"\n )\n : resizeSelection(\n state,\n asr.first.column.idx,\n asr.last.column.idx >= state.cellMatrix.last.column.idx\n ? state.cellMatrix.last.column.idx\n : asr.last.column.idx + 1,\n asr.first.row.idx,\n asr.last.row.idx,\n \"horizontal\"\n )\n : state;\n}\n\nfunction resizeSelection(\n state: State,\n firstColIdx: number,\n lastColIdx: number,\n firstRowIdx: number,\n lastRowIdx: number,\n scrollDirection?: \"vertical\" | \"horizontal\"\n): State {\n if (!state.enableRangeSelection) return state;\n const start = state.cellMatrix.getLocation(firstRowIdx, firstColIdx);\n const end = state.cellMatrix.getLocation(lastRowIdx, lastColIdx);\n const selectedRanges = state.selectedRanges.slice();\n selectedRanges[state.activeSelectedRangeIdx] = state.cellMatrix.getRange(\n start,\n end\n );\n if (scrollDirection) {\n const location = state.focusedLocation;\n if (!location) {\n return state;\n }\n let scrollToRowIdx = 0,\n scrollToColIdx = 0;\n let axis: \"vertical\" | \"horizontal\";\n switch (scrollDirection) {\n case \"horizontal\":\n scrollToRowIdx = location.row.idx;\n scrollToColIdx =\n location.column.idx !== firstColIdx ? firstColIdx : lastColIdx;\n break;\n case \"vertical\":\n scrollToRowIdx =\n location.row.idx !== firstRowIdx ? firstRowIdx : lastRowIdx;\n scrollToColIdx = location.column.idx;\n break;\n default:\n break;\n }\n const { left, top } = scrollCalculator(\n state,\n state.cellMatrix.getLocation(scrollToRowIdx, scrollToColIdx),\n scrollDirection\n );\n scrollIntoView(state, top, left);\n }\n\n if (state.props?.onSelectionChanging && !state.props.onSelectionChanging(selectedRanges)) {\n // If selection change is canceled we can just return the state here\n // TODO: We could try to find the \"best possible selection\", but I've not yet found a use case for this and - as I discovered - it isn't trivial\n // TODO: Also, we could add a external way to change the selection so the users could implement this themselves\n return state;\n }\n\n state.props?.onSelectionChanged?.(selectedRanges);\n\n return { ...state, selectedRanges };\n}\n","import { GridColumn, Location, isSelectionKey, Direction } from \"../../core\";\nimport { PointerEvent } from \"../Model/domEventsTypes\";\nimport { Behavior } from \"../Model/Behavior\";\nimport { State } from \"../Model/State\";\nimport {\n unSelectOneColumn,\n selectMultipleColumns,\n selectOneColumn,\n} from \"../Functions/selectRange\";\nimport { focusLocation } from \"../Functions/focusLocation\";\nimport { handleContextMenu } from \"../Functions/handleContextMenu\";\n\nexport class ColumnSelectionBehavior extends Behavior {\n autoScrollDirection: Direction = \"horizontal\";\n initialColumn!: GridColumn;\n\n handlePointerDown(\n event: PointerEvent,\n location: Location,\n state: State\n ): State {\n this.initialColumn = location.column;\n if (\n isSelectionKey(event) &&\n state.selectionMode === \"column\" &&\n state.selectedIds.some((id) => id === location.column.columnId)\n ) {\n state = unSelectOneColumn(state, location.column);\n } else if (event.shiftKey && state.focusedLocation) {\n state = selectMultipleColumns(\n state,\n state.focusedLocation.column,\n location.column,\n isSelectionKey(event)\n );\n } else {\n state = focusLocation(state, location, false);\n state = selectOneColumn(state, location.column, isSelectionKey(event));\n }\n return state;\n }\n\n handlePointerEnter(\n event: PointerEvent,\n location: Location,\n state: State\n ): State {\n return selectMultipleColumns(\n state,\n this.initialColumn,\n location.column,\n isSelectionKey(event)\n );\n }\n\n handlePointerUp(\n event: MouseEvent | PointerEvent,\n location: Location,\n state: State\n ): State {\n if (\n state.props?.onSelectionChanging &&\n !state.props.onSelectionChanging(state.selectedRanges)\n ) {\n // Cancel the latest selection\n const filteredRanges = [...state.selectedRanges].filter(\n (_, index) => index !== state.activeSelectedRangeIdx\n );\n\n return {\n ...state,\n selectedRanges: filteredRanges,\n activeSelectedRangeIdx: filteredRanges.length - 1,\n };\n }\n\n state.props?.onSelectionChanged &&\n state.props.onSelectionChanged(state.selectedRanges);\n\n return state;\n }\n\n handleContextMenu(event: PointerEvent, state: State): State {\n return handleContextMenu(event, state);\n }\n}\n","import { Location, isSelectionKey, Direction, GridRow, PointerLocation, CellMatrix } from \"../../core\";\nimport { Behavior } from \"../Model/Behavior\";\nimport { State } from \"../Model/State\";\nimport {\n unSelectOneRow,\n selectMultipleRows,\n selectOneRow,\n} from \"../Functions/selectRange\";\nimport { focusLocation } from \"../Functions/focusLocation\";\nimport { handleContextMenu } from \"../Functions/handleContextMenu\";\nimport { PointerEvent } from \"../Model/domEventsTypes\";\n\nexport class RowSelectionBehavior extends Behavior {\n autoScrollDirection: Direction = \"vertical\";\n initialRow!: GridRow;\n\n handlePointerDown(\n event: PointerEvent,\n location: Location,\n state: State\n ): State {\n this.initialRow = location.row;\n if (\n isSelectionKey(event) &&\n state.selectionMode === \"row\" &&\n state.selectedIds.some((id) => id === location.row.rowId)\n ) {\n state = unSelectOneRow(state, location.row);\n } else if (event.shiftKey && state.focusedLocation) {\n state = selectMultipleRows(\n state,\n state.focusedLocation.row,\n location.row,\n isSelectionKey(event)\n );\n } else {\n state = focusLocation(state, location, false);\n state = selectOneRow(state, location.row, isSelectionKey(event));\n }\n return state;\n }\n\n handlePointerEnter(\n event: PointerEvent,\n location: Location,\n state: State\n ): State {\n return selectMultipleRows(\n state,\n this.initialRow,\n location.row,\n isSelectionKey(event)\n );\n }\n\n handlePointerUp(\n event: MouseEvent | PointerEvent,\n location: PointerLocation,\n state: State>\n ): State> {\n if (\n state.props?.onSelectionChanging &&\n !state.props.onSelectionChanging(state.selectedRanges)\n ) {\n // Cancel the latest selection\n const filteredRanges = [...state.selectedRanges].filter(\n (_, index) => index !== state.activeSelectedRangeIdx\n );\n\n return {\n ...state,\n selectedRanges: filteredRanges,\n activeSelectedRangeIdx: filteredRanges.length - 1,\n };\n }\n\n state.props?.onSelectionChanged &&\n state.props.onSelectionChanged(state.selectedRanges);\n\n return state;\n }\n\n handleContextMenu(event: PointerEvent, state: State): State {\n return handleContextMenu(event, state);\n }\n}\n","import * as React from \"react\";\nimport { Range } from \"../../core\";\n\nexport interface PartialAreaProps {\n range: Range;\n pane: Range;\n style: React.CSSProperties;\n className?: string;\n}\n\nexport const PartialArea: React.FC = ({\n range,\n pane,\n style,\n className,\n}) => {\n const top =\n range.first.row.idx <= pane.first.row.idx\n ? pane.first.row.top\n : range.first.row.top;\n const left =\n range.first.column.idx <= pane.first.column.idx\n ? pane.first.column.left\n : range.first.column.left;\n const width =\n (range.last.column.idx > pane.last.column.idx\n ? pane.last.column.right\n : range.last.column.right) - left;\n const height =\n (range.last.row.idx > pane.last.row.idx\n ? pane.last.row.bottom\n : range.last.row.bottom) - top;\n const hasTopBorder = range.first.row.idx >= pane.first.row.idx;\n const hasBottomBorder = range.last.row.idx <= pane.last.row.idx;\n const hasRightBorder = range.last.column.idx <= pane.last.column.idx;\n const hasLeftBorder = range.first.column.idx >= pane.first.column.idx;\n return (\n \n );\n};\n","import { Range } from \"../../core\";\n\nexport function isRangeIntersects(range1: Range, range2: Range): boolean {\n return (\n range2.first.column.idx <= range1.last.column.idx &&\n range2.first.row.idx <= range1.last.row.idx &&\n range2.last.column.idx >= range1.first.column.idx &&\n range2.last.row.idx >= range1.first.row.idx\n );\n}\n","import React from \"react\";\nimport {\n Location,\n Compatible,\n Cell,\n Range,\n GridRow,\n GridColumn,\n getCompatibleCellAndTemplate,\n CellMatrix,\n tryAppendChangeHavingGroupId,\n isMacOs,\n} from \"../../core\";\nimport { PointerEvent } from \"../Model/domEventsTypes\";\nimport { State } from \"../Model/State\";\nimport { Behavior } from \"../Model/Behavior\";\nimport { getActiveSelectedRange } from \"../Functions/getActiveSelectedRange\";\nimport { PartialArea } from \"../Components/PartialArea\";\nimport { isRangeIntersects } from \"../Functions/isRangeIntersectsWith\";\nimport { newLocation } from \"../Functions/newLocation\";\n\ntype Direction = \"\" | \"left\" | \"right\" | \"up\" | \"down\";\n\nexport class FillHandleBehavior extends Behavior {\n private fillDirection: Direction = \"\";\n private fillRange?: Range;\n\n handlePointerEnter(\n event: PointerEvent,\n location: Location,\n state: State\n ): State {\n const selectedRange = getActiveSelectedRange(state);\n this.fillDirection = this.getFillDirection(selectedRange, location);\n this.fillRange = this.getFillRange(\n state.cellMatrix,\n selectedRange,\n location,\n this.fillDirection\n );\n return { ...state };\n }\n\n handlePointerUp(\n event: PointerEvent,\n location: Location,\n state: State\n ): State {\n const activeSelectedRange = getActiveSelectedRange(state);\n const cellMatrix = state.cellMatrix;\n if (!activeSelectedRange || this.fillRange === undefined) {\n return state;\n }\n const isKeyPressed = isMacOs() ? event.altKey : event.ctrlKey;\n this.fillRange = state.cellMatrix.validateRange(this.fillRange);\n const getCompatibleCell = (location: Location) =>\n getCompatibleCellAndTemplate(state, location);\n\n const fillCellsWithPredictedValues = (\n selectedCells: Compatible[],\n cellsToFill: Compatible[]\n ): Compatible[] => {\n const numbers = selectedCells.map((cell) => cell.value);\n const parameters = this.findRegressionFunction(\n numbers,\n Array.from({ length: numbers.length }, (_, index) => index + 1)\n );\n const areParametersNaNs = isNaN(parameters.a) && isNaN(parameters.b);\n return cellsToFill.map((cell, i) => {\n const x = this.calculateXForRegressionFunction(\n i + numbers.length + 1,\n parameters.a,\n parameters.b\n );\n const selectedCell = selectedCells[i % selectedCells.length];\n return {\n ...cell,\n // ! Patch for checkbox cell template\n // TODO: look for better solution\n ...(cell.type === \"checkbox\" && { checked: \"checked\" in selectedCell ? selectedCell.checked : !!selectedCell.value }),\n text:\n areParametersNaNs || isKeyPressed\n ? selectedCell.text\n : x.toString(),\n groupId: selectedCell.groupId,\n value: areParametersNaNs || isKeyPressed ? selectedCell.value : x,\n };\n });\n };\n\n const fillVertically = (\n state: State,\n activeSelectedRange: Range,\n direction: \"up\" | \"down\"\n ): State => {\n activeSelectedRange.columns.forEach((column) => {\n let selectedCells = activeSelectedRange.rows.map(\n (row) => getCompatibleCell(newLocation(row, column)).cell\n );\n selectedCells =\n direction === \"up\" ? selectedCells.reverse() : selectedCells;\n if (this.fillRange) {\n let cellsToFill = this.fillRange.rows.map(\n (row) => getCompatibleCell(newLocation(row, column)).cell\n );\n cellsToFill = fillCellsWithPredictedValues(\n selectedCells,\n cellsToFill\n );\n cellsToFill =\n direction === \"up\" ? cellsToFill.reverse() : cellsToFill;\n state = this.fillColumn(state, column, cellsToFill);\n }\n });\n return state;\n };\n\n const fillHorizontally = (\n state: State,\n activeSelectedRange: Range,\n direction: \"left\" | \"right\"\n ): State => {\n activeSelectedRange.rows.forEach((row) => {\n let selectedCells = activeSelectedRange.columns.map(\n (column) => getCompatibleCell(newLocation(row, column)).cell\n );\n selectedCells =\n direction === \"left\" ? selectedCells.reverse() : selectedCells;\n if (this.fillRange) {\n let cellsToFill = this.fillRange.columns.map(\n (column) => getCompatibleCell(newLocation(row, column)).cell\n );\n cellsToFill = fillCellsWithPredictedValues(\n selectedCells,\n cellsToFill\n );\n cellsToFill =\n direction === \"left\" ? cellsToFill.reverse() : cellsToFill;\n state = this.fillRow(state, row, cellsToFill);\n }\n });\n return state;\n };\n\n switch (this.fillDirection) {\n case \"right\": {\n const newRange = cellMatrix.getRange(\n activeSelectedRange.first,\n newLocation(activeSelectedRange.last.row, location.column)\n );\n\n state = fillHorizontally(state, activeSelectedRange, \"right\");\n\n if (state?.props?.onSelectionChanging && !state.props.onSelectionChanging([newRange])) {\n return state;\n }\n\n state = {\n ...state,\n selectedRanges: [newRange],\n selectedIds: [\n ...activeSelectedRange.columns.map((col) => col.columnId),\n ...this.fillRange.columns.map((col) => col.columnId),\n ],\n };\n\n state.props?.onSelectionChanged && state.props.onSelectionChanged(state.selectedRanges);\n \n break;\n }\n case \"left\": {\n const newRange = cellMatrix.getRange(\n activeSelectedRange.last,\n newLocation(activeSelectedRange.first.row, location.column)\n );\n\n state = fillHorizontally(state, activeSelectedRange, \"left\");\n\n if (state?.props?.onSelectionChanging && !state.props.onSelectionChanging([newRange])) {\n return state;\n }\n\n state = {\n ...state,\n selectedRanges: [newRange],\n selectedIds: [\n ...activeSelectedRange.columns.map((col) => col.columnId),\n ...this.fillRange.columns.map((col) => col.columnId),\n ],\n };\n\n state.props?.onSelectionChanged && state.props.onSelectionChanged(state.selectedRanges);\n\n break;\n }\n case \"up\": {\n const newRange = cellMatrix.getRange(activeSelectedRange.last, {\n row: location.row,\n column: activeSelectedRange.first.column,\n });\n\n state = fillVertically(state, activeSelectedRange, \"up\");\n\n if (state?.props?.onSelectionChanging && !state.props.onSelectionChanging([newRange])) {\n return state;\n }\n\n state = {\n ...state,\n selectedRanges: [newRange],\n selectedIds: [\n ...activeSelectedRange.rows.map((row) => row.rowId),\n ...this.fillRange.rows.map((row) => row.rowId),\n ],\n };\n\n state.props?.onSelectionChanged && state.props.onSelectionChanged(state.selectedRanges);\n\n break;\n }\n case \"down\": {\n const newRange = cellMatrix.getRange(\n activeSelectedRange.first,\n newLocation(location.row, activeSelectedRange.last.column)\n );\n\n state = fillVertically(state, activeSelectedRange, \"down\");\n\n if (state?.props?.onSelectionChanging && !state.props.onSelectionChanging([newRange])) {\n return state;\n }\n\n state = {\n ...state,\n selectedRanges: [newRange],\n selectedIds: [\n ...activeSelectedRange.rows.map((row) => row.rowId),\n ...this.fillRange.rows.map((row) => row.rowId),\n ],\n };\n\n state.props?.onSelectionChanged && state.props.onSelectionChanged(state.selectedRanges);\n\n break;\n }\n }\n\n return state;\n }\n\n calculateXForRegressionFunction(y: number, a: number, b: number): number {\n return Math.round(((y - a) / b) * 1e5) / 1e5;\n }\n\n findRegressionFunction(\n valuesX: number[],\n valuesY: number[]\n ): { a: number; b: number } {\n const sumX = this.sumArray(valuesX);\n const sumY = this.sumArray(valuesY);\n const sumXY = this.sumArray(this.multipleArrays(valuesX, valuesY));\n const sumPowX = this.sumArray(this.powerArray(valuesX, 2));\n const n = valuesX.length;\n const upValue = Math.fround(n * sumXY - sumX * sumY);\n const downValue = Math.fround(n * sumPowX - Math.pow(sumX, 2));\n const b = upValue / downValue;\n const a = sumY / n - b * (sumX / n);\n return { a, b };\n }\n\n sumArray(arr: number[]): number {\n return arr.reduce((a, b) => a + b);\n }\n\n multipleArrays(first: number[], second: number[]): number[] {\n const result = [];\n const stopCondition =\n first.length <= second.length ? first.length : second.length;\n for (let i = 0; i < stopCondition; ++i) {\n result.push(first[i] * second[i]);\n }\n return result;\n }\n\n powerArray(arr: number[], power: number): number[] {\n return arr.map((x) => Math.pow(x, power));\n }\n\n renderPanePart(state: State, pane: Range): React.ReactNode {\n return (\n this.fillDirection &&\n this.fillRange &&\n isRangeIntersects(pane, this.fillRange) && (\n \n )\n );\n }\n\n private getFillDirection(selectedRange: Range, pointerLocation: Location) {\n // active selection\n const differences: { direction: Direction; value: number }[] = [];\n differences.push({ direction: \"\", value: 0 });\n differences.push({\n direction: \"up\",\n value:\n pointerLocation.row.idx < selectedRange.first.row.idx\n ? selectedRange.first.row.idx - pointerLocation.row.idx\n : 0,\n });\n differences.push({\n direction: \"down\",\n value:\n pointerLocation.row.idx > selectedRange.last.row.idx\n ? pointerLocation.row.idx - selectedRange.last.row.idx\n : 0,\n });\n differences.push({\n direction: \"left\",\n value:\n pointerLocation.column.idx < selectedRange.first.column.idx\n ? selectedRange.first.column.idx - pointerLocation.column.idx\n : 0,\n });\n differences.push({\n direction: \"right\",\n value:\n pointerLocation.column.idx > selectedRange.last.column.idx\n ? pointerLocation.column.idx - selectedRange.last.column.idx\n : 0,\n });\n return differences.reduce((prev, current) =>\n prev.value >= current.value ? prev : current\n ).direction;\n }\n\n private getFillRange(\n cellMatrix: CellMatrix,\n selectedRange: Range,\n location: Location,\n fillDirection: Direction\n ) {\n switch (fillDirection) {\n case \"right\":\n return cellMatrix.getRange(\n cellMatrix.getLocation(\n selectedRange.first.row.idx,\n cellMatrix.last.column.idx < selectedRange.last.column.idx + 1\n ? cellMatrix.last.column.idx\n : selectedRange.last.column.idx + 1\n ),\n newLocation(selectedRange.last.row, location.column)\n );\n case \"left\":\n return cellMatrix.getRange(\n newLocation(selectedRange.first.row, location.column),\n cellMatrix.getLocation(\n selectedRange.last.row.idx,\n cellMatrix.first.column.idx > selectedRange.first.column.idx - 1\n ? cellMatrix.first.column.idx\n : selectedRange.first.column.idx - 1\n )\n );\n case \"up\":\n return cellMatrix.getRange(\n newLocation(location.row, selectedRange.first.column),\n cellMatrix.getLocation(\n cellMatrix.first.row.idx > selectedRange.first.row.idx - 1\n ? cellMatrix.first.row.idx\n : selectedRange.first.row.idx - 1,\n selectedRange.last.column.idx\n )\n );\n case \"down\":\n return cellMatrix.getRange(\n cellMatrix.getLocation(\n cellMatrix.last.row.idx < selectedRange.last.row.idx + 1\n ? cellMatrix.last.row.idx\n : selectedRange.last.row.idx + 1,\n selectedRange.first.column.idx\n ),\n newLocation(location.row, selectedRange.last.column)\n );\n }\n return undefined;\n }\n\n private fillRow(\n state: State,\n row: GridRow,\n values: Compatible[]\n ): State {\n this.fillRange?.columns.forEach((col, i) => {\n state = tryAppendChangeHavingGroupId(\n state,\n newLocation(row, col),\n values[i]\n ) as State;\n });\n return state;\n }\n\n private fillColumn(\n state: State,\n column: GridColumn,\n values: Compatible[]\n ): State {\n this.fillRange?.rows.forEach((row, i) => {\n state = tryAppendChangeHavingGroupId(\n state,\n newLocation(row, column),\n values[i]\n ) as State;\n });\n return state;\n }\n}\n","import {\n Direction, PointerLocation, getScrollOfScrollableElement,\n} from '../../core';\nimport { PointerEvent } from '../Model/domEventsTypes';\nimport { handleContextMenu } from '../Functions/handleContextMenu';\nimport { Behavior } from '../Model/Behavior';\nimport { State } from '../Model/State';\n\nexport class ColumnReorderBehavior extends Behavior {\n private initialColumnIdx!: number;\n private lastPossibleDropLocation?: PointerLocation;\n private pointerOffset!: number;\n private selectedIdxs!: number[];\n autoScrollDirection: Direction = 'horizontal';\n\n handlePointerDown(event: PointerEvent, location: PointerLocation, state: State): State {\n this.initialColumnIdx = location.column.idx;\n this.lastPossibleDropLocation = location;\n this.selectedIdxs = state.selectedIndexes.sort();\n const columns = this.selectedIdxs.map(i => state.cellMatrix.columns[i]);\n const leftIndexes = this.selectedIdxs.filter(i => i < location.column.idx);\n const leftColumns = leftIndexes.map(i => state.cellMatrix.columns[i]);\n const leftColumnsWidth = leftColumns.reduce((sum, col) => sum + col.width, 0);\n this.pointerOffset = leftColumnsWidth + location.cellX;\n return {\n ...state,\n lineOrientation: 'vertical',\n shadowSize: columns.reduce((sum, col) => sum + col.width, 0),\n shadowPosition: this.getShadowPosition(location, state)\n }\n }\n\n handlePointerMove(event: PointerEvent, location: PointerLocation, state: State): State {\n return {\n ...state,\n shadowPosition: this.getShadowPosition(location, state)\n }\n }\n\n getShadowPosition(location: PointerLocation, state: State): number {\n const x = location.viewportX - this.pointerOffset;\n const max = state.cellMatrix.width - state.shadowSize;\n if (x < 0) {\n return 0;\n } else if (x > max) {\n return max;\n }\n return x;\n }\n\n handlePointerEnter(event: PointerEvent, location: PointerLocation, state: State): State {\n const dropLocation = this.getLastPossibleDropLocation(location, state);\n const { scrollLeft } = getScrollOfScrollableElement(state.scrollableElement);\n if (!dropLocation) return state;\n const drawRight = dropLocation.column.idx > this.initialColumnIdx;\n const linePosition = Math.min(dropLocation.viewportX - dropLocation.cellX + (drawRight ? dropLocation.column.width : 0),\n (state.visibleRange?.width || 0) + state.cellMatrix.ranges.stickyLeftRange.width + state.cellMatrix.ranges.stickyRightRange.width + scrollLeft\n )\n this.lastPossibleDropLocation = dropLocation;\n return {\n ...state,\n linePosition\n }\n }\n\n getLastPossibleDropLocation(currentLocation: PointerLocation, state: State): PointerLocation | undefined {\n const position = currentLocation.column.idx <= this.initialColumnIdx ? 'before' : 'after';\n const columnIds = this.selectedIdxs.map(i => state.cellMatrix.columns[i].columnId);\n if (!state.props?.canReorderColumns || state.props.canReorderColumns(currentLocation.column.columnId, columnIds, position)) {\n return currentLocation;\n }\n return this.lastPossibleDropLocation;\n }\n\n handlePointerUp(event: PointerEvent, location: PointerLocation, state: State): State {\n if (location.column.idx !== this.initialColumnIdx && this.lastPossibleDropLocation && state.props?.onColumnsReordered) {\n const isBefore = this.lastPossibleDropLocation.column.idx <= this.initialColumnIdx;\n const columnIds = this.selectedIdxs.map(i => state.cellMatrix.columns[i].columnId);\n state.props?.onColumnsReordered(this.lastPossibleDropLocation.column.columnId, columnIds, isBefore ? 'before' : 'after');\n }\n return {\n ...state,\n linePosition: -1,\n shadowPosition: -1,\n shadowCursor: 'default'\n };\n }\n\n handleContextMenu(event: PointerEvent, state: State): State {\n return handleContextMenu(event, state);\n }\n\n}\n","import { Behavior } from \"../Model/Behavior\";\nimport { State } from \"../Model/State\";\nimport {\n PointerLocation,\n getScrollOfScrollableElement,\n Id,\n DropPosition,\n Direction,\n} from \"../../core\";\nimport { PointerEvent } from \"../Model/domEventsTypes\";\nimport { handleContextMenu } from \"../Functions/handleContextMenu\";\n\n// TODO do a total rewrite here\nexport class RowReorderBehavior extends Behavior {\n // TODO dont use internal state. Always fresh recalculation based on input data!\n private initialRowIdx!: number;\n private lastPossibleDropLocation?: PointerLocation;\n private pointerOffset!: number;\n private selectedIds!: Id[];\n private position!: DropPosition;\n autoScrollDirection: Direction = \"vertical\";\n\n handlePointerDown(\n event: PointerEvent,\n location: PointerLocation,\n state: State\n ): State {\n this.initialRowIdx = location.row.idx;\n this.lastPossibleDropLocation = location;\n const indexes = state.selectedIndexes.sort();\n const rows = indexes.map((i) => state.cellMatrix.rows[i]);\n const upperIndexes = indexes.filter((i) => i < location.row.idx);\n const upperRows = upperIndexes.map((i) => state.cellMatrix.rows[i]);\n const upperRowsHeight = upperRows.reduce((sum, row) => sum + row.height, 0);\n this.pointerOffset = upperRowsHeight + location.cellY;\n this.selectedIds = rows.map((r) => r.rowId);\n return {\n ...state,\n lineOrientation: \"horizontal\",\n shadowSize: rows.reduce((sum, col) => sum + col.height, 0),\n shadowPosition: this.getShadowPosition(location, state),\n };\n }\n\n handlePointerMove(\n event: PointerEvent,\n location: PointerLocation,\n state: State\n ): State {\n const shadowPosition = this.getShadowPosition(location, state);\n let shadowCursor = \"-webkit-grabbing\";\n let linePosition = state.linePosition;\n const { scrollTop } = getScrollOfScrollableElement(state.scrollableElement);\n const pointerLocation = location.viewportY + 0;\n this.lastPossibleDropLocation = this.getLastPossibleDropLocation(\n state,\n location\n );\n if (\n this.lastPossibleDropLocation &&\n this.lastPossibleDropLocation.row.idx !== this.initialRowIdx\n ) {\n const drawDown =\n this.lastPossibleDropLocation.row.idx > this.initialRowIdx;\n linePosition = Math.min(\n this.lastPossibleDropLocation.viewportY -\n this.lastPossibleDropLocation.cellY +\n (drawDown ? this.lastPossibleDropLocation.row.height : 0),\n (state.visibleRange?.height || 0) +\n state.cellMatrix.ranges.stickyTopRange.height +\n state.cellMatrix.ranges.stickyBottomRange.height +\n scrollTop\n );\n if (!state.props?.canReorderRows) {\n this.position = drawDown ? \"after\" : \"before\";\n } else {\n if (\n state.props.canReorderRows &&\n state.props.canReorderRows(\n this.lastPossibleDropLocation.row.rowId,\n this.selectedIds,\n this.position\n )\n ) {\n if (drawDown) {\n if (\n pointerLocation >\n location.row.top +\n state.cellMatrix.ranges.stickyTopRange.height &&\n pointerLocation <\n location.row.top +\n state.cellMatrix.ranges.stickyTopRange.height +\n location.row.height / 2\n ) {\n this.position = \"on\";\n shadowCursor = \"move\";\n linePosition = -1;\n } else {\n this.position = \"after\";\n }\n } else {\n if (\n pointerLocation >\n location.row.top +\n state.cellMatrix.ranges.stickyTopRange.height +\n location.row.height / 2 &&\n pointerLocation <\n location.row.top +\n state.cellMatrix.ranges.stickyTopRange.height +\n location.row.height\n ) {\n this.position = \"on\";\n shadowCursor = \"move\";\n linePosition = -1;\n } else {\n this.position = \"before\";\n }\n }\n } else {\n linePosition = -1;\n }\n }\n }\n\n return {\n ...state,\n shadowPosition,\n linePosition,\n shadowCursor,\n };\n }\n\n getShadowPosition(location: PointerLocation, state: State): number {\n const y = location.viewportY - this.pointerOffset;\n const max = state.cellMatrix.height - state.shadowSize;\n if (y < 0) {\n return 0;\n } else if (y > max) {\n return max;\n }\n return y;\n }\n\n getLastPossibleDropLocation(\n state: State,\n currentLocation: PointerLocation\n ): PointerLocation | undefined {\n if (\n !state.props?.canReorderRows ||\n state.props.canReorderRows(\n currentLocation.row.rowId,\n this.selectedIds,\n this.position\n )\n ) {\n return currentLocation;\n }\n return this.lastPossibleDropLocation;\n }\n\n handlePointerUp(\n event: PointerEvent,\n location: PointerLocation,\n state: State\n ): State {\n if (\n location.row.idx !== this.initialRowIdx &&\n this.lastPossibleDropLocation &&\n state.props?.onRowsReordered\n ) {\n state.props?.onRowsReordered(\n this.lastPossibleDropLocation.row.rowId,\n this.selectedIds,\n this.position\n );\n }\n return {\n ...state,\n linePosition: -1,\n shadowPosition: -1,\n shadowCursor: \"default\",\n };\n }\n\n handleContextMenu(event: PointerEvent, state: State): State {\n return handleContextMenu(event, state);\n }\n}\n","import { State } from '../Model/State';\nimport { Range } from '../Model/Range';\nimport { Location } from '../Model/InternalModel';\nimport { emptyCell } from './emptyCell';\nimport { getCompatibleCellAndTemplate } from './getCompatibleCellAndTemplate';\nimport { tryAppendChange } from './tryAppendChange';\nimport { Id } from '../Model/PublicModel';\n\nexport function getDataToCopy(\n state: State,\n activeSelectedRange: Range,\n removeValues = false\n ): { div: HTMLDivElement; text: string } {\n const { div, table, location } = createHTMLElements(activeSelectedRange);\n const text = copyElements(\n state,\n location,\n activeSelectedRange,\n table,\n removeValues\n );\n setStyles(div, table);\n return { div, text };\n }\n \n function copyElements(\n state: State,\n location: Location,\n activeSelectedRange: Range,\n table: HTMLTableElement,\n removeValues: boolean\n ): string {\n let text = \"\";\n let prevId: Id = \"\";\n activeSelectedRange.rows.forEach((row) => {\n const tableRow = table.insertRow();\n activeSelectedRange.columns.forEach((column) => {\n const tableCell = tableRow.insertCell();\n const { cell } = getCompatibleCellAndTemplate(state, { row, column });\n const validatedText = cell.text || \" \";\n tableCell.textContent = validatedText;\n text =\n prevId === \"\"\n ? cell.text\n : text + (prevId === row.rowId ? \"\\t\" : \"\\n\") + validatedText;\n prevId = row.rowId;\n tableCell.setAttribute(\"data-reactgrid\", JSON.stringify(cell));\n tableCell.style.color = \"initial\";\n tableCell.style.border = \"initial\";\n tableCell.style.fontSize = \"initial\";\n tableCell.style.backgroundColor = \"initial\";\n clearCell(state as State, { row, column }, removeValues);\n });\n });\n \n return text;\n }\n\n// ? unused?\nexport function processSingleCell(tableRow: HTMLTableRowElement, state: State, location: Location): void {\n const tableCell: HTMLTableDataCellElement = tableRow.insertCell();\n const { cell } = getCompatibleCellAndTemplate(state, location);\n tableCell.textContent = cell.text ? cell.text : ' ';\n tableCell.setAttribute('data-reactgrid', JSON.stringify(cell));\n tableCell.style.border = 'initial';\n}\n\nexport function createHTMLElements(activeSelectedRange: Range): { div: HTMLDivElement, table: HTMLTableElement, location: Location } {\n const div = document.createElement('div');\n const table = document.createElement('table');\n table.setAttribute('empty-cells', 'show');\n table.setAttribute('data-reactgrid', 'reactgrid-content');\n const location = { row: activeSelectedRange.first.row, column: activeSelectedRange.first.column };\n return { div, table, location };\n}\n\nexport function setStyles(div: HTMLDivElement, table: HTMLTableElement): void {\n div.classList.add('rg-copy-container');\n div.setAttribute('contenteditable', 'true');\n div.style.position = 'fixed';\n div.style.top = '50%';\n div.style.left = '50%';\n div.appendChild(table);\n}\n\nexport function clearCell(state: State, location: Location, removeValues: boolean): void {\n if (removeValues) {\n state = tryAppendChange(state, location, emptyCell);\n }\n}","export function isBrowserSafari(): boolean {\n if (typeof window !== 'undefined') { // condition needed for circle ci compiler\n return window.navigator.userAgent.indexOf('Safari') !== -1\n && navigator.userAgent.indexOf('Chrome') === -1;\n }\n return false;\n}\n","import { ClipboardEvent } from '../Model/domEventsTypes';\nimport { State } from '../Model/State';\nimport { getDataToCopy } from './getDataToCopy';\nimport { getActiveSelectedRange } from './getActiveSelectedRange';\nimport { isBrowserSafari } from './safari';\n\nexport function handleCopy(event: ClipboardEvent, state: State, removeValues = false): State {\n const activeSelectedRange = getActiveSelectedRange(state);\n if (!activeSelectedRange) {\n return state;\n }\n const { div } = getDataToCopy(state, activeSelectedRange, removeValues);\n copyDataCommands(event, state, div);\n return { ...state, copyRange: activeSelectedRange };\n}\n\nexport function copyDataCommands(event: ClipboardEvent, state: State, div: HTMLDivElement): void {\n if (isBrowserSafari()) {\n event.clipboardData.setData('text/html', div.innerHTML);\n } else {\n document.body.appendChild(div);\n div.focus();\n document.execCommand('selectAll', false);\n document.execCommand('copy');\n document.body.removeChild(div);\n }\n\n state.hiddenFocusElement?.focus({ preventScroll: true });\n event.preventDefault();\n}","import { getCompatibleCellAndTemplate } from './getCompatibleCellAndTemplate';\nimport { Location } from '../Model/InternalModel';\nimport { State } from '../Model/State';\nimport { Cell, Compatible } from '../Model/PublicModel';\nimport { tryAppendChange } from './tryAppendChange';\n\nexport function tryAppendChangeHavingGroupId(state: State, location: Location, cell: Compatible): State {\n const { cell: cellInLocation } = getCompatibleCellAndTemplate(state, location);\n if (cellInLocation.groupId === cell.groupId) {\n return tryAppendChange(state, location, cell);\n } else {\n console.warn(`New cells data can't be appended into location: ('${location.column.columnId}', '${location.row.rowId}'). Cell's 'groupId' field doesn't match!`);\n }\n return state;\n}","import { Cell, Compatible } from \"../Model/PublicModel\";\nimport { State } from \"../Model/State\";\nimport { Location } from \"../Model/InternalModel\";\nimport { tryAppendChangeHavingGroupId } from \"./tryAppendChangeHavingGroupId\";\nimport { getActiveSelectedRange } from \"./getActiveSelectedRange\";\nimport { newLocation } from \"./newLocation\";\n\nexport function pasteData(state: State, rows: Compatible[][]): State {\n const activeSelectedRange = getActiveSelectedRange(state);\n if (rows.length === 1 && rows[0].length === 1) {\n // pasting single cell on active selected range\n activeSelectedRange.rows.forEach((row) =>\n activeSelectedRange.columns.forEach((column) => {\n state = tryAppendChangeHavingGroupId(\n state, \n newLocation(row, column),\n rows[0][0]\n ) as State;\n })\n );\n } else {\n let lastLocation: Location | undefined;\n const cellMatrix = state.cellMatrix;\n rows.forEach((row, ri) =>\n row.forEach((cell, ci) => {\n const rowIdx = activeSelectedRange.first.row.idx + ri;\n const columnIdx = activeSelectedRange.first.column.idx + ci;\n if (\n rowIdx <= cellMatrix.last.row.idx &&\n columnIdx <= cellMatrix.last.column.idx\n ) {\n lastLocation = cellMatrix.getLocation(rowIdx, columnIdx);\n state = tryAppendChangeHavingGroupId(\n state,\n lastLocation,\n cell\n ) as State;\n }\n })\n );\n if (!lastLocation) {\n return state;\n }\n\n const newRange = cellMatrix.getRange(activeSelectedRange.first, lastLocation);\n\n if (state?.props?.onSelectionChanging && !state.props.onSelectionChanging([newRange])) {\n return state;\n }\n\n state?.props?.onSelectionChanged && state.props.onSelectionChanged([newRange]);\n\n return {\n ...state,\n selectedRanges: [\n cellMatrix.getRange(activeSelectedRange.first, lastLocation),\n ],\n activeSelectedRangeIdx: 0,\n };\n }\n return state;\n}\n","export const getNavigatorLanguage = (): string => navigator.language || \"en-US\";\n","import { getNavigatorLanguage } from \"./getNavigatorLanguage\";\n\n// ! Won't work with locales using characters different than Arabic numerals (e.g. *Eastern* Arabic numerals: ١٢٣٬٤٥٦٫٧٨٩)\n// TODO: If possible add support for locales using characters different than Arabic numerals\nfunction getLocaleSeparators(locale: string) {\n const testNumber = 123456.789;\n const localeFormattedNumber = Intl.NumberFormat(locale).format(testNumber);\n\n // Get the thousands separator of the locale\n const thousandsSeparator = localeFormattedNumber.split(\"123\")[1][0];\n\n // Get the decimal separator of the locale\n const decimalSeparator = localeFormattedNumber.split(\"123\")[1][4];\n return { thousandsSeparator, decimalSeparator };\n}\n\nexport function parseLocaleNumber(stringNumber: string, locale = getNavigatorLanguage()): number {\n if (!stringNumber.trim()) return NaN;\n const { thousandsSeparator, decimalSeparator } = getLocaleSeparators(locale);\n const normalizedStringNumber = stringNumber.replace(/\\u00A0/g, \" \"); // Replace non-breaking space with normal space\n const numberString = normalizedStringNumber\n .replace(new RegExp(`[${thousandsSeparator}\\\\s]`, \"g\"), \"\") // Replace thousands separator and white-space\n .replace(new RegExp(`\\\\${decimalSeparator}`, \"g\"), \".\"); // Replace decimal separator\n\n const trimmedNumberString = numberString.replace(/^(?!-)\\D+|\\D+$/g, \"\"); // Remove characters before first and after last number, but keep negative sign\n if (trimmedNumberString === null || trimmedNumberString.trim().length === 0) {\n return NaN;\n }\n return Number(trimmedNumberString);\n}\n","import { State } from '../Model/State';\nimport { Compatible, Cell } from '../Model/PublicModel';\nimport { ClipboardEvent } from '../Model/domEventsTypes';\nimport { getActiveSelectedRange } from './getActiveSelectedRange';\nimport { pasteData } from './pasteData';\nimport { parseLocaleNumber } from './parseLocaleNumber';\n\nexport function handlePaste(event: ClipboardEvent, state: State): State {\n const activeSelectedRange = getActiveSelectedRange(state);\n if (!activeSelectedRange) {\n return state;\n }\n let pastedRows: Compatible[][] = [];\n const htmlData = event.clipboardData.getData(\"text/html\");\n const document = new DOMParser().parseFromString(htmlData, \"text/html\");\n // TODO Do we need selection mode here ?\n //const selectionMode = parsedData.body.firstElementChild && parsedData.body.firstElementChild.getAttribute('data-selection') as SelectionMode;\n // TODO quite insecure! maybe do some checks ?\n const hasReactGridAttribute =\n document.body.firstElementChild?.getAttribute(\"data-reactgrid\") ===\n \"reactgrid-content\";\n if (\n hasReactGridAttribute &&\n document.body.firstElementChild?.firstElementChild\n ) {\n const tableRows =\n document.body.firstElementChild.firstElementChild.children;\n for (let ri = 0; ri < tableRows.length; ri++) {\n const row: Compatible[] = [];\n for (let ci = 0; ci < tableRows[ri].children.length; ci++) {\n const rawData =\n tableRows[ri].children[ci].getAttribute(\"data-reactgrid\");\n const data = rawData && JSON.parse(rawData);\n const text = tableRows[ri].children[ci].innerHTML;\n row.push(data ? data : { type: \"text\", text, value: parseLocaleNumber(text) });\n }\n pastedRows.push(row);\n }\n } else {\n pastedRows = event.clipboardData\n .getData(\"text/plain\")\n .replace(/(\\r\\n)$/, '')\n .split(\"\\n\")\n .map((line: string) => line.split(\"\\t\").map((t) => ({ type: \"text\", text: t, value: parseLocaleNumber(t) })));\n }\n event.preventDefault();\n return { ...pasteData(state, pastedRows) };\n }\n ","import {\n PointerLocation,\n Location,\n handleKeyUp,\n handleCompositionEnd,\n handleDoubleClick,\n getScrollOfScrollableElement,\n isSelectionKey,\n} from \"../../core\";\nimport {\n KeyboardEvent,\n ClipboardEvent,\n PointerEvent,\n} from \"../Model/domEventsTypes\";\nimport { CellSelectionBehavior } from \"./CellSelectionBehavior\";\nimport { Behavior } from \"../Model/Behavior\";\nimport { handleKeyDown } from \"../Functions/handleKeyDown\";\nimport { State } from \"../Model/State\";\nimport { ColumnSelectionBehavior } from \"./ColumnSelectionBehavior\";\nimport { RowSelectionBehavior } from \"./RowSelectionBehavior\";\nimport { FillHandleBehavior } from \"./FillHandleBehavior\";\nimport { handleContextMenu } from \"../Functions/handleContextMenu\";\nimport { ResizeColumnBehavior } from \"./ResizeColumnBehavior\";\nimport { ColumnReorderBehavior } from \"./ColumnReorderBehavior\";\nimport { RowReorderBehavior } from \"./RowReorderBehavior\";\nimport { handleCopy } from \"../Functions/handleCopy\";\nimport { handlePaste } from \"../Functions/handlePaste\";\n\nexport class DefaultBehavior extends Behavior {\n handlePointerDown(\n event: PointerEvent,\n location: PointerLocation,\n state: State\n ): State {\n state = {\n ...state,\n currentBehavior: this.getNewBehavior(event, location, state),\n contextMenuPosition: { top: -1, left: -1 },\n };\n return state.currentBehavior.handlePointerDown(\n event,\n location,\n state\n ) as State;\n }\n\n private getNewBehavior(\n event: PointerEvent,\n location: PointerLocation,\n state: State\n ): Behavior {\n // changing behavior will disable all keyboard event handlers\n const target = event.target as HTMLDivElement;\n if (\n ((event.pointerType === \"mouse\" &&\n target.className === \"rg-resize-handle\") ||\n (event.pointerType === \"touch\" &&\n (target.className === \"rg-touch-resize-handle\" ||\n target.className === \"rg-resize-handle\"))) &&\n location.row.idx === 0 &&\n location.column.resizable &&\n location.cellX >\n location.column.width -\n (state.reactGridElement?.querySelector(\".rg-resize-handle\")\n ?.clientWidth || 0) -\n getScrollOfScrollableElement(state.scrollableElement).scrollLeft\n ) {\n return new ResizeColumnBehavior();\n } else if (\n state.enableColumnSelection &&\n location.row.idx === 0 &&\n state.selectedIds.includes(location.column.columnId) &&\n !isSelectionKey(event) &&\n state.selectionMode === \"column\" &&\n location.column.reorderable\n ) {\n return new ColumnReorderBehavior();\n } else if (\n state.enableColumnSelection &&\n location.row.idx === 0 &&\n target.className !== \"rg-fill-handle\" &&\n target.className !== \"rg-touch-fill-handle\"\n ) {\n return new ColumnSelectionBehavior();\n } else if (\n state.enableRowSelection &&\n location.column.idx === 0 &&\n state.selectedIds.includes(location.row.rowId) &&\n !isSelectionKey(event) &&\n state.selectionMode === \"row\" &&\n location.row.reorderable\n ) {\n return new RowReorderBehavior();\n } else if (\n state.enableRowSelection &&\n location.column.idx === 0 &&\n target.className !== \"rg-fill-handle\" &&\n target.className !== \"rg-touch-fill-handle\"\n ) {\n return new RowSelectionBehavior();\n } else if (\n ((event.pointerType === \"mouse\" &&\n target.className === \"rg-fill-handle\") ||\n (event.pointerType === \"touch\" &&\n (target.className === \"rg-touch-fill-handle\" ||\n target.className === \"rg-fill-handle\"))) &&\n state.enableFillHandle\n ) {\n return new FillHandleBehavior();\n } else {\n return new CellSelectionBehavior();\n }\n }\n\n handleContextMenu(event: PointerEvent, state: State): State {\n return handleContextMenu(event, state);\n }\n\n handleDoubleClick(\n event: PointerEvent,\n location: Location,\n state: State\n ): State {\n return handleDoubleClick(event, location, state) as State;\n }\n\n handleKeyDown(event: KeyboardEvent, state: State): State {\n return handleKeyDown(state as State, event);\n }\n\n handleKeyUp(event: KeyboardEvent, state: State): State {\n return handleKeyUp(event, state) as State;\n }\n\n handleCompositionEnd(event: CompositionEvent, state: State): State {\n return handleCompositionEnd(event, state) as State;\n }\n\n handleCopy(event: ClipboardEvent, state: State): State {\n return handleCopy(event, state);\n }\n\n handlePaste(event: ClipboardEvent, state: State): State {\n return handlePaste(event, state);\n }\n\n handleCut(event: ClipboardEvent, state: State): State {\n return handleCopy(event, state, true);\n }\n}\n","import { Cell, Uncertain } from '../Model/PublicModel';\n\n// TODO: simplify if possible\n\n/**\n * Gets property cell's value\n * \n * @param uncertainCell Cell to extract its property\n * @param propName Property name to extract\n * @param expectedType Expected `typeof` of extracted property from \"uncertain\" cell \n * @returns Value of property of given cell\n * \n * @see https://reactgrid.com/docs/3.1/7-api/2-functions/\n */\nexport const getCellProperty = (\n uncertainCell: Uncertain,\n propName: TKey,\n expectedType: 'string' | 'number' | 'boolean' | 'undefined' | 'function' | 'object' | 'symbol' | 'bigint'\n) : any => {\n const prop = uncertainCell[propName];\n if (typeof prop === 'undefined' || prop === null)\n throw new Error(`Cell is missing property '${String(propName)}'`);\n if (typeof prop !== expectedType)\n throw new Error(`Property '${String(propName)}' expected to be of type '${expectedType}' but is '${typeof prop}'`);\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return prop!; // TODO is '!' necessary ?\n}","import * as React from \"react\";\n\n// NOTE: all modules imported below may be imported from '@silevis/reactgrid'\nimport { getCellProperty } from \"../Functions/getCellProperty\";\nimport { keyCodes } from \"../Functions/keyCodes\";\nimport { Cell, CellTemplate, Compatible, Uncertain, UncertainCompatible } from \"../Model/PublicModel\";\n\nexport interface CheckboxCell extends Cell {\n type: \"checkbox\";\n checked: boolean;\n checkedText?: string;\n uncheckedText?: string;\n}\n\nexport class CheckboxCellTemplate implements CellTemplate {\n getCompatibleCell(uncertainCell: Uncertain): Compatible {\n const checked = getCellProperty(uncertainCell, \"checked\", \"boolean\");\n const text = checked\n ? uncertainCell.checkedText\n ? uncertainCell.checkedText\n : \"1\"\n : uncertainCell.uncheckedText\n ? uncertainCell.uncheckedText\n : \"\";\n return { ...uncertainCell, checked: !!checked, value: checked ? 1 : NaN, text };\n }\n\n handleKeyDown(\n cell: Compatible,\n keyCode: number,\n ctrl: boolean,\n shift: boolean,\n alt: boolean\n ): { cell: Compatible; enableEditMode: boolean } {\n if (!shift && (keyCode === keyCodes.SPACE || keyCode === keyCodes.ENTER))\n return { cell: this.getCompatibleCell(this.toggleCheckboxCell(cell)), enableEditMode: false };\n return { cell, enableEditMode: false };\n }\n\n private toggleCheckboxCell(cell: Compatible): Compatible {\n return this.getCompatibleCell({ ...cell, checked: !cell.checked });\n }\n\n update(cell: Compatible, cellToMerge: UncertainCompatible): Compatible {\n const checked = cellToMerge.type === \"checkbox\" ? cellToMerge.checked : !!cellToMerge.value;\n return this.getCompatibleCell({ ...cell, checked });\n }\n\n getClassName(cell: Compatible): string {\n return cell.className ? cell.className : \"\";\n }\n\n render(\n cell: Compatible,\n isInEditMode: boolean,\n onCellChanged: (cell: Compatible, commit: boolean) => void\n ): React.ReactNode {\n return (\n \n );\n }\n}\n","import { keyCodes } from '../Functions/keyCodes';\n\n/**\n * Checks that the pressed key's `keyCode` is one of alphanumeric keys \n * \n * @param {number} keyCode `keyCode` field from `KeyboardEvent` interface \n * @returns {boolean} Returns `true` if `keyCode` is one of alpha numeric keys\n * \n * @see https://reactgrid.com/docs/3.1/7-api/2-functions/\n */\nexport const isAlphaNumericKey = (keyCode: number): boolean =>\n (keyCode >= keyCodes.KEY_0 && keyCode <= keyCodes.KEY_Z) ||\n isNumpadNumericKey(keyCode) ||\n (keyCode >= keyCodes.MULTIPLY && keyCode <= keyCodes.DIVIDE) ||\n (keyCode >= keyCodes.SEMICOLON && keyCode <= keyCodes.SINGLE_QUOTE) ||\n keyCode === keyCodes.SPACE;\n\n/**\n * Similar to {@link isAlphaNumericKey} - checks that the provided `char` is one of alphanumeric characters\n * \n * @param {string} char character produced by `KeyboardEvent.key` field\n * @returns {boolean} Returns `true` if `char` is one of alphanumeric characters\n */\nexport const isCharAlphaNumeric = (char: string): boolean => char.match(/^[a-zA-Z0-9]$/) !== null;\n\n/**\n * Helper function to check that the provided `key` produces printable character\n * @param key field from `KeyboardEvent` interface\n * @returns Returns `true` if `key` is one of printable characters\n */\nexport const isKeyPrintable = (key: string): boolean => key.length === 1;\n\n/**\n * Checks that the pressed key's `keyCode` is one of numeric keys\n * \n * @param {number} keyCode `keyCode` field from `KeyboardEvent` interface \n * @returns {boolean} Returns `true` if `keyCode` is one of numeric keys\n * \n * @see https://reactgrid.com/docs/3.1/7-api/2-functions/\n */\nexport const inNumericKey = (keyCode: number): boolean =>\n (keyCode >= keyCodes.KEY_0 && keyCode <= keyCodes.KEY_9) || isNumpadNumericKey(keyCode);\n\n/**\n * Checks that the pressed key's `keyCode` is one of numpad keys\n * \n * @param {number} keyCode `keyCode` field from `KeyboardEvent` interface \n * @returns {boolean} Returns `true` if `keyCode` is one of numpad keys\n * \n * @see https://reactgrid.com/docs/3.1/7-api/2-functions/\n */\nexport const isNumpadNumericKey = (keyCode: number): boolean => (keyCode >= keyCodes.NUMPAD_0 && keyCode <= keyCodes.NUMPAD_9);\n\n/**\n * Checks that the pressed key's `keyCode` is allow while typing numeric value e.g. `-3.14`\n * \n * @param {number} keyCode `keyCode` field from `KeyboardEvent` interface\n * @returns {boolean} Returns `true` if `keyCode` is one of allowed on typing numeric value\n * \n * @see https://reactgrid.com/docs/3.1/7-api/2-functions/\n */\nexport const isAllowedOnNumberTypingKey = (keyCode: number): boolean =>\n (keyCode >= keyCodes.COMMA && keyCode <= keyCodes.PERIOD)\n || keyCode === keyCodes.DECIMAL || keyCode === keyCodes.SUBTRACT || keyCode === keyCodes.FIREFOX_DASH;\n\n/**\n * Similar to {@link isAllowedOnNumberTypingKey} - checks that the provided `char` is allowed while typing numeric value e.g. `-3.14`\n * \n * @param {string} char character produced by `KeyboardEvent.key` field\n * @returns {boolean} Returns `true` if `char` is one of allowed while typing numeric value\n */\nexport const isCharAllowedOnNumberInput = (char: string): boolean => char.match(/[\\d.,+-]/) !== null;\n\n/**\n * Checks that the pressed key's `keyCode` is one of navigation keys \n * \n * @param {number} keyCode `keyCode` field from `KeyboardEvent` interface\n * @returns {boolean} Returns `true` if `keyCode` is one of navigation keys\n * \n * @see https://reactgrid.com/docs/3.1/7-api/2-functions/\n */\nexport const isNavigationKey = (keyCode: number): boolean =>\n keyCode === keyCodes.LEFT_ARROW || keyCode === keyCodes.RIGHT_ARROW ||\n keyCode === keyCodes.UP_ARROW || keyCode === keyCodes.DOWN_ARROW ||\n keyCode === keyCodes.END || keyCode === keyCodes.HOME ||\n keyCode === keyCodes.BACKSPACE || keyCode === keyCodes.DELETE;\n\n/**\n * Checks that the pressed key's `keyCode` is one of function keys\n * \n * @param {number} keyCode `keyCode` field from `KeyboardEvent` interface\n * @returns {boolean} Returns `true` if `keyCode` is one of function keys\n * \n * @see https://reactgrid.com/docs/3.1/7-api/2-functions/\n * */\nexport const isFunctionKey = (keyCode: number): boolean =>\n (keyCode >= keyCodes.F1 && keyCode <= keyCodes.F12);","import { isIOS, isIpadOS } from '../Functions/operatingSystem';\n\nexport const getTimestamp = (time: string, defaultDate?: string): number => {\n if (defaultDate !== '') {\n defaultDate = getDefaultDate();\n }\n const textDate = `${defaultDate && `${defaultDate} `}${time}`;\n return Date.parse(textDate);\n};\n\nexport const getFormattedTimeUnit = (timeUnit: number): string => timeUnit.toString().padStart(2, '0');\n\nexport const getDefaultDate = (): string => isIOS() || isIpadOS() ? '1970/01/01' : '1970-01-01';\n","const characterMapShift: string[] = [];\ncharacterMapShift[8] = \"\";\ncharacterMapShift[9] = \"\";\ncharacterMapShift[13] = \"\\n\";\ncharacterMapShift[16] = \"\";\ncharacterMapShift[17] = \"\";\ncharacterMapShift[18] = \"\";\ncharacterMapShift[19] = \"\";\ncharacterMapShift[20] = \"\";\ncharacterMapShift[27] = \"\";\ncharacterMapShift[32] = \" \";\ncharacterMapShift[33] = \"\";\ncharacterMapShift[34] = \"\";\ncharacterMapShift[35] = \"\";\ncharacterMapShift[36] = \"\";\ncharacterMapShift[37] = \"\";\ncharacterMapShift[38] = \"\";\ncharacterMapShift[39] = \"\";\ncharacterMapShift[40] = \"\";\ncharacterMapShift[45] = \"\";\ncharacterMapShift[46] = \"\";\ncharacterMapShift[48] = \")\";\ncharacterMapShift[49] = \"!\";\ncharacterMapShift[50] = \"@\";\ncharacterMapShift[51] = \"#\";\ncharacterMapShift[52] = \"$\";\ncharacterMapShift[53] = \"%\";\ncharacterMapShift[54] = \"^\";\ncharacterMapShift[55] = \"&\";\ncharacterMapShift[56] = \"*\";\ncharacterMapShift[57] = \"(\";\ncharacterMapShift[59] = \":\";\ncharacterMapShift[61] = \"+\";\ncharacterMapShift[65] = \"A\";\ncharacterMapShift[66] = \"B\";\ncharacterMapShift[67] = \"C\";\ncharacterMapShift[68] = \"D\";\ncharacterMapShift[69] = \"E\";\ncharacterMapShift[70] = \"F\";\ncharacterMapShift[71] = \"G\";\ncharacterMapShift[72] = \"H\";\ncharacterMapShift[73] = \"I\";\ncharacterMapShift[74] = \"J\";\ncharacterMapShift[75] = \"K\";\ncharacterMapShift[76] = \"L\";\ncharacterMapShift[77] = \"M\";\ncharacterMapShift[78] = \"N\";\ncharacterMapShift[79] = \"O\";\ncharacterMapShift[80] = \"P\";\ncharacterMapShift[81] = \"Q\";\ncharacterMapShift[82] = \"R\";\ncharacterMapShift[83] = \"S\";\ncharacterMapShift[84] = \"T\";\ncharacterMapShift[85] = \"U\";\ncharacterMapShift[86] = \"V\";\ncharacterMapShift[87] = \"W\";\ncharacterMapShift[88] = \"X\";\ncharacterMapShift[89] = \"Y\";\ncharacterMapShift[90] = \"Z\";\ncharacterMapShift[91] = \"\";\ncharacterMapShift[92] = \"\";\ncharacterMapShift[93] = \"\";\ncharacterMapShift[96] = \"0\";\ncharacterMapShift[97] = \"1\";\ncharacterMapShift[98] = \"2\";\ncharacterMapShift[99] = \"3\";\ncharacterMapShift[100] = \"4\";\ncharacterMapShift[101] = \"5\";\ncharacterMapShift[102] = \"6\";\ncharacterMapShift[103] = \"7\";\ncharacterMapShift[104] = \"8\";\ncharacterMapShift[105] = \"9\";\ncharacterMapShift[106] = \"*\";\ncharacterMapShift[107] = \"+\";\ncharacterMapShift[109] = \"_\";\ncharacterMapShift[107] = \"+\";\ncharacterMapShift[111] = \"/\";\ncharacterMapShift[112] = \"\";\ncharacterMapShift[113] = \"\";\ncharacterMapShift[114] = \"\";\ncharacterMapShift[115] = \"\";\ncharacterMapShift[116] = \"\";\ncharacterMapShift[117] = \"\";\ncharacterMapShift[118] = \"\";\ncharacterMapShift[119] = \"\";\ncharacterMapShift[120] = \"\";\ncharacterMapShift[121] = \"\";\ncharacterMapShift[122] = \"\";\ncharacterMapShift[123] = \"\";\ncharacterMapShift[144] = \"\";\ncharacterMapShift[145] = \"\";\ncharacterMapShift[186] = \":\";\ncharacterMapShift[187] = \"+\";\ncharacterMapShift[188] = \"<\";\ncharacterMapShift[189] = \"_\";\ncharacterMapShift[190] = \">\";\ncharacterMapShift[191] = \"?\";\ncharacterMapShift[192] = \"~\";\ncharacterMapShift[219] = \"{\";\ncharacterMapShift[220] = \"|\";\ncharacterMapShift[221] = \"}\";\ncharacterMapShift[222] = \"\\\"\";\n\nconst characterMap: string[] = [];\ncharacterMap[8] = \"\";\ncharacterMap[9] = \"\";\ncharacterMap[13] = \"\\n\";\ncharacterMap[16] = \"\";\ncharacterMap[17] = \"\";\ncharacterMap[18] = \"\";\ncharacterMap[19] = \"\";\ncharacterMap[20] = \"\";\ncharacterMap[27] = \"\";\ncharacterMap[32] = \" \";\ncharacterMap[33] = \"\";\ncharacterMap[34] = \"\";\ncharacterMap[35] = \"\";\ncharacterMap[36] = \"\";\ncharacterMap[37] = \"\";\ncharacterMap[38] = \"\";\ncharacterMap[39] = \"\";\ncharacterMap[40] = \"\";\ncharacterMap[45] = \"\";\ncharacterMap[46] = \"\";\ncharacterMap[48] = \"0\";\ncharacterMap[49] = \"1\";\ncharacterMap[50] = \"2\";\ncharacterMap[51] = \"3\";\ncharacterMap[52] = \"4\";\ncharacterMap[53] = \"5\";\ncharacterMap[54] = \"6\";\ncharacterMap[55] = \"7\";\ncharacterMap[56] = \"8\";\ncharacterMap[57] = \"9\";\ncharacterMap[59] = \";\";\ncharacterMap[61] = \"=\";\ncharacterMap[65] = \"a\";\ncharacterMap[66] = \"b\";\ncharacterMap[67] = \"c\";\ncharacterMap[68] = \"d\";\ncharacterMap[69] = \"e\";\ncharacterMap[70] = \"f\";\ncharacterMap[71] = \"g\";\ncharacterMap[72] = \"h\";\ncharacterMap[73] = \"i\";\ncharacterMap[74] = \"j\";\ncharacterMap[75] = \"k\";\ncharacterMap[76] = \"l\";\ncharacterMap[77] = \"m\";\ncharacterMap[78] = \"n\";\ncharacterMap[79] = \"o\";\ncharacterMap[80] = \"p\";\ncharacterMap[81] = \"q\";\ncharacterMap[82] = \"r\";\ncharacterMap[83] = \"s\";\ncharacterMap[84] = \"t\";\ncharacterMap[85] = \"u\";\ncharacterMap[86] = \"v\";\ncharacterMap[87] = \"w\";\ncharacterMap[88] = \"x\";\ncharacterMap[89] = \"y\";\ncharacterMap[90] = \"z\";\ncharacterMap[91] = \"\";\ncharacterMap[92] = \"\";\ncharacterMap[93] = \"\";\ncharacterMap[96] = \"0\";\ncharacterMap[97] = \"1\";\ncharacterMap[98] = \"2\";\ncharacterMap[99] = \"3\";\ncharacterMap[100] = \"4\";\ncharacterMap[101] = \"5\";\ncharacterMap[102] = \"6\";\ncharacterMap[103] = \"7\";\ncharacterMap[104] = \"8\";\ncharacterMap[105] = \"9\";\ncharacterMap[106] = \"*\";\ncharacterMap[107] = \"+\";\ncharacterMap[109] = \"_\";\ncharacterMap[107] = \"+\";\ncharacterMap[111] = \"/\";\ncharacterMap[112] = \"\";\ncharacterMap[113] = \"\";\ncharacterMap[114] = \"\";\ncharacterMap[115] = \"\";\ncharacterMap[116] = \"\";\ncharacterMap[117] = \"\";\ncharacterMap[118] = \"\";\ncharacterMap[119] = \"\";\ncharacterMap[120] = \"\";\ncharacterMap[121] = \"\";\ncharacterMap[122] = \"\";\ncharacterMap[123] = \"\";\ncharacterMap[144] = \"\";\ncharacterMap[145] = \"\";\ncharacterMap[186] = \";\";\ncharacterMap[187] = \"=\";\ncharacterMap[188] = \",\";\ncharacterMap[189] = \"-\";\ncharacterMap[190] = \".\";\ncharacterMap[191] = \"/\";\ncharacterMap[192] = \"`\";\ncharacterMap[219] = \"[\";\ncharacterMap[220] = \"\\\\\";\ncharacterMap[221] = \"]\";\ncharacterMap[222] = \"'\";\n\nexport const getCharFromKeyCode = (keyCode: number, isShiftKey = false): string => {\n return isShiftKey ? characterMapShift[keyCode] : characterMap[keyCode];\n}\n\nexport const getCharFromKey = (key: string, isShiftKey = false, isCapsLock = false): string => {\n const language = navigator.language || \"en-US\";\n return !(isShiftKey || isCapsLock)\n ? key.toLocaleLowerCase(language)\n : key.toLocaleUpperCase(language);\n};\n","import * as React from \"react\";\n\n// NOTE: all modules imported below may be imported from '@silevis/reactgrid'\nimport { getCellProperty } from \"../Functions/getCellProperty\";\nimport { Cell, CellTemplate, Compatible, Uncertain, UncertainCompatible } from \"../Model/PublicModel\";\nimport { keyCodes } from \"../Functions/keyCodes\";\nimport { inNumericKey, isNavigationKey, isCharAlphaNumeric, isFunctionKey } from \"./keyCodeCheckings\";\nimport { getFormattedTimeUnit } from \"./timeUtils\";\nimport { getCharFromKey } from \"./getCharFromKeyCode\";\n\nexport interface DateCell extends Cell {\n type: \"date\";\n date?: Date;\n format?: Intl.DateTimeFormat;\n}\n\nexport class DateCellTemplate implements CellTemplate {\n private wasEscKeyPressed = false;\n\n getCompatibleCell(uncertainCell: Uncertain): Compatible {\n const date = uncertainCell.date ? getCellProperty(uncertainCell, \"date\", \"object\") : new Date(NaN);\n const dateFormat = uncertainCell.format || new Intl.DateTimeFormat(window.navigator.language);\n const value = date.getTime();\n const text = !Number.isNaN(value) ? dateFormat.format(date) : \"\";\n return { ...uncertainCell, date, value, text };\n }\n\n handleKeyDown(\n cell: Compatible,\n keyCode: number,\n ctrl: boolean,\n shift: boolean,\n alt: boolean,\n key: string,\n capsLock: boolean\n ): { cell: Compatible; enableEditMode: boolean } {\n if (isFunctionKey(keyCode)) {\n if (keyCode === keyCodes.F2) return { cell, enableEditMode: true };\n return { cell, enableEditMode: false };\n }\n\n if (!ctrl && isCharAlphaNumeric(getCharFromKey(key)))\n return { cell: this.getCompatibleCell({ ...cell }), enableEditMode: true };\n return { cell, enableEditMode: keyCode === keyCodes.POINTER || keyCode === keyCodes.ENTER };\n }\n\n update(cell: Compatible, cellToMerge: UncertainCompatible): Compatible {\n return this.getCompatibleCell({ ...cell, date: new Date(cellToMerge.value) });\n }\n\n getClassName(cell: Compatible, isInEditMode: boolean): string {\n return cell.className ? cell.className : \"\";\n }\n\n render(\n cell: Compatible,\n isInEditMode: boolean,\n onCellChanged: (cell: Compatible, commit: boolean) => void\n ): React.ReactNode {\n if (!isInEditMode) {\n return cell.text;\n }\n\n if (!cell.date) {\n return `\"cell.date\" is not initialized with a date value`;\n }\n\n const year = getFormattedTimeUnit(cell.date.getFullYear());\n const month = getFormattedTimeUnit(cell.date.getMonth() + 1);\n const day = getFormattedTimeUnit(cell.date.getDate());\n\n return (\n {\n if (input) input.focus();\n }}\n type=\"date\"\n defaultValue={`${year}-${month}-${day}`}\n onChange={(e) => {\n if (e.currentTarget.value) {\n const [year, month, day] = e.currentTarget.value.split(\"-\").map((v) => parseInt(v));\n onCellChanged(this.getCompatibleCell({ ...cell, date: new Date(year, month - 1, day) }), false);\n }\n }}\n onBlur={(e) => {\n if (e.currentTarget.value) {\n const [year, month, day] = e.currentTarget.value.split(\"-\").map((v) => parseInt(v));\n onCellChanged(\n this.getCompatibleCell({ ...cell, date: new Date(year, month - 1, day) }),\n !this.wasEscKeyPressed\n );\n this.wasEscKeyPressed = false;\n }\n }}\n onKeyDown={(e) => {\n if (\n inNumericKey(e.keyCode) ||\n isNavigationKey(e.keyCode) ||\n e.keyCode === keyCodes.COMMA ||\n e.keyCode === keyCodes.PERIOD ||\n ((e.ctrlKey || e.metaKey) && e.keyCode === keyCodes.KEY_A)\n )\n e.stopPropagation();\n if (\n !inNumericKey(e.keyCode) &&\n !isNavigationKey(e.keyCode) &&\n e.keyCode !== keyCodes.COMMA &&\n e.keyCode !== keyCodes.PERIOD\n )\n e.preventDefault();\n if (e.keyCode === keyCodes.ESCAPE) this.wasEscKeyPressed = true;\n }}\n onCopy={(e) => e.stopPropagation()}\n onCut={(e) => e.stopPropagation()}\n onPaste={(e) => e.stopPropagation()}\n onPointerDown={(e) => e.stopPropagation()}\n />\n );\n }\n}\n","import * as React from \"react\";\n\n// NOTE: all modules imported below may be imported from '@silevis/reactgrid'\nimport { isAlphaNumericKey, isFunctionKey, isNavigationKey } from \"./keyCodeCheckings\";\nimport { getCellProperty } from \"../Functions/getCellProperty\";\nimport { keyCodes } from \"../Functions/keyCodes\";\nimport { Cell, CellTemplate, Compatible, Uncertain, UncertainCompatible } from \"../Model/PublicModel\";\nimport { getCharFromKey } from \"./getCharFromKeyCode\";\n\nexport interface EmailCell extends Cell {\n type: \"email\";\n text: string;\n validator?: (text: string) => boolean;\n renderer?: (text: string) => React.ReactNode;\n errorMessage?: string;\n}\n\nexport class EmailCellTemplate implements CellTemplate {\n private wasEscKeyPressed = false;\n\n getCompatibleCell(uncertainCell: Uncertain): Compatible {\n const text = getCellProperty(uncertainCell, \"text\", \"string\");\n const value = parseFloat(text);\n return { ...uncertainCell, text, value };\n }\n\n handleKeyDown(\n cell: Compatible,\n keyCode: number,\n ctrl: boolean,\n shift: boolean,\n alt: boolean,\n key: string,\n capsLock: boolean\n ): { cell: Compatible; enableEditMode: boolean } {\n if (isFunctionKey(keyCode)) {\n if (keyCode === keyCodes.F2) return { cell, enableEditMode: true };\n return { cell, enableEditMode: false };\n }\n\n const char = getCharFromKey(key, shift, capsLock);\n\n if (!ctrl && !alt && isAlphaNumericKey(keyCode) && !(shift && keyCode === keyCodes.SPACE))\n return { cell: { ...cell, text: char }, enableEditMode: true };\n\n return {\n cell,\n enableEditMode: keyCode === keyCodes.POINTER || keyCode === keyCodes.ENTER,\n };\n }\n\n handleCompositionEnd(\n cell: Compatible,\n eventData: any\n ): { cell: Compatible; enableEditMode: boolean } {\n return { cell: { ...cell, text: eventData }, enableEditMode: true };\n }\n\n update(cell: Compatible, cellToMerge: UncertainCompatible): Compatible {\n return this.getCompatibleCell({ ...cell, text: cellToMerge.text });\n }\n\n getClassName(cell: Compatible, isInEditMode: boolean): string {\n const isValid = cell.validator ? cell.validator(cell.text) : true;\n return isValid ? \"valid\" : \"rg-invalid\";\n }\n\n render(\n cell: Compatible,\n isInEditMode: boolean,\n onCellChanged: (cell: Compatible, commit: boolean) => void\n ): React.ReactNode {\n if (!isInEditMode) {\n const isValid = cell.validator ? cell.validator(cell.text) : true;\n const textToDisplay = !isValid && cell.errorMessage ? cell.errorMessage : cell.text;\n return cell.renderer ? cell.renderer(textToDisplay) : textToDisplay;\n }\n\n return (\n {\n if (input) input.focus();\n }}\n onChange={(e) => onCellChanged(this.getCompatibleCell({ ...cell, text: e.currentTarget.value }), false)}\n onBlur={(e) => {\n onCellChanged(this.getCompatibleCell({ ...cell, text: e.currentTarget.value }), !this.wasEscKeyPressed);\n this.wasEscKeyPressed = false;\n }}\n onKeyDown={(e) => {\n if (isAlphaNumericKey(e.keyCode) || isNavigationKey(e.keyCode)) e.stopPropagation();\n if (e.keyCode === keyCodes.ESCAPE) this.wasEscKeyPressed = true;\n }}\n defaultValue={cell.text}\n onCopy={(e) => e.stopPropagation()}\n onCut={(e) => e.stopPropagation()}\n onPaste={(e) => e.stopPropagation()}\n onPointerDown={(e) => e.stopPropagation()}\n />\n );\n }\n}\n","import * as React from \"react\";\n\n// NOTE: all modules imported below may be imported from '@silevis/reactgrid'\nimport { getCellProperty } from \"../Functions/getCellProperty\";\nimport { keyCodes } from \"../Functions/keyCodes\";\nimport { Cell, CellStyle, CellTemplate, Compatible, Id, Uncertain, UncertainCompatible } from \"../Model/PublicModel\";\nimport { isNavigationKey, isAlphaNumericKey, isFunctionKey } from \"./keyCodeCheckings\";\nimport { getCharFromKey } from \"./getCharFromKeyCode\";\n\nexport interface ChevronCell extends Cell {\n type: \"chevron\";\n text: string;\n isExpanded?: boolean;\n hasChildren?: boolean;\n parentId?: Id;\n indent?: number;\n}\n\nexport class ChevronCellTemplate implements CellTemplate {\n private wasEscKeyPressed = false;\n\n getCompatibleCell(uncertainCell: Uncertain): Compatible {\n const text = getCellProperty(uncertainCell, \"text\", \"string\");\n let isExpanded = false;\n try {\n isExpanded = getCellProperty(uncertainCell, \"isExpanded\", \"boolean\");\n } catch {\n isExpanded = true;\n }\n let indent = -1;\n try {\n indent = getCellProperty(uncertainCell, \"indent\", \"number\");\n } catch {\n indent = 0;\n }\n let hasChildren = false;\n try {\n hasChildren = getCellProperty(uncertainCell, \"hasChildren\", \"boolean\");\n } catch {\n hasChildren = false;\n }\n const value = parseFloat(text);\n return { ...uncertainCell, text, value, isExpanded, indent, hasChildren };\n }\n\n update(cell: Compatible, cellToMerge: UncertainCompatible): Compatible {\n return this.getCompatibleCell({ ...cell, isExpanded: cellToMerge.isExpanded, text: cellToMerge.text });\n }\n\n handleKeyDown(\n cell: Compatible,\n keyCode: number,\n ctrl: boolean,\n shift: boolean,\n alt: boolean,\n key: string,\n capsLock: boolean\n ): { cell: Compatible; enableEditMode: boolean } {\n if (isFunctionKey(keyCode)) {\n if (keyCode === keyCodes.F2) return { cell, enableEditMode: true };\n return { cell, enableEditMode: false };\n }\n\n let enableEditMode = keyCode === keyCodes.POINTER || keyCode === keyCodes.ENTER;\n const cellCopy = { ...cell };\n\n const char = getCharFromKey(key, shift, capsLock);\n\n if (keyCode === keyCodes.SPACE && cellCopy.isExpanded !== undefined && !shift) {\n cellCopy.isExpanded = !cellCopy.isExpanded;\n } else if (!ctrl && !alt && isAlphaNumericKey(keyCode) && !(shift && keyCode === keyCodes.SPACE)) {\n cellCopy.text = char;\n enableEditMode = true;\n }\n return { cell: cellCopy, enableEditMode };\n }\n\n handleCompositionEnd(\n cell: Compatible,\n eventData: any\n ): { cell: Compatible; enableEditMode: boolean } {\n return { cell: { ...cell, text: eventData }, enableEditMode: true };\n }\n\n getClassName(cell: Compatible, isInEditMode: boolean): string {\n const isExpanded = cell.hasChildren ? (cell.isExpanded ? \"expanded\" : \"collapsed\") : \"\";\n const className = cell.className ?? \"\";\n return `${isExpanded} ${className}`;\n }\n\n getStyle(cell: Compatible, isInEditMode: boolean): CellStyle {\n const indent = cell.indent ?? 0;\n const elementMarginMultiplier = indent * 1.4;\n return { paddingLeft: `calc(${elementMarginMultiplier}em + 2px)` };\n }\n\n render(\n cell: Compatible,\n isInEditMode: boolean,\n onCellChanged: (cell: Compatible, commit: boolean) => void\n ): React.ReactNode {\n return !isInEditMode ? (\n <>\n {cell.hasChildren ? (\n {\n e.stopPropagation();\n onCellChanged(this.getCompatibleCell({ ...cell, isExpanded: !cell.isExpanded }), true);\n }}\n >\n \n \n ) : (\n
\n )}\n {cell.text}\n \n ) : (\n {\n if (input) {\n input.focus();\n input.setSelectionRange(input.value.length, input.value.length);\n }\n }}\n defaultValue={cell.text}\n onChange={(e) => onCellChanged(this.getCompatibleCell({ ...cell, text: e.currentTarget.value }), false)}\n onBlur={(e) => {\n onCellChanged(this.getCompatibleCell({ ...cell, text: e.currentTarget.value }), !this.wasEscKeyPressed);\n this.wasEscKeyPressed = false;\n }}\n onCopy={(e) => e.stopPropagation()}\n onCut={(e) => e.stopPropagation()}\n onPaste={(e) => e.stopPropagation()}\n onPointerDown={(e) => e.stopPropagation()}\n onKeyDown={(e) => {\n if (isAlphaNumericKey(e.keyCode) || isNavigationKey(e.keyCode)) e.stopPropagation();\n if (e.keyCode === keyCodes.ESCAPE) this.wasEscKeyPressed = true;\n }}\n />\n );\n }\n}\n","import * as React from 'react';\n\n// NOTE: all modules imported below may be imported from '@silevis/reactgrid'\nimport { getCellProperty } from '../Functions/getCellProperty';\nimport { Cell, CellStyle, CellTemplate, Compatible, Span, Uncertain } from '../Model/PublicModel';\n\n\nexport interface HeaderCell extends Cell, Span {\n type: 'header';\n text: string;\n}\n\nexport class HeaderCellTemplate implements CellTemplate {\n\n getCompatibleCell(uncertainCell: Uncertain): Compatible {\n const text = getCellProperty(uncertainCell, 'text', 'string');\n const value = parseFloat(text);\n return { ...uncertainCell, text, value };\n }\n\n render(cell: Compatible, isInEditMode: boolean, onCellChanged: (cell: Compatible, commit: boolean) => void): React.ReactNode {\n return cell.text;\n }\n\n isFocusable = (cell: Compatible): boolean => false;\n\n getClassName(cell: Compatible, isInEditMode: boolean): string {\n return cell.className ? cell.className : '';\n }\n\n getStyle = (cell: Compatible): CellStyle => ({ background: 'rgba(128, 128, 128, 0.1)' })\n}\n","import * as React from \"react\";\n\n// NOTE: all modules imported below may be imported from '@silevis/reactgrid'\nimport { getCellProperty } from \"../Functions/getCellProperty\";\nimport { keyCodes } from \"../Functions/keyCodes\";\nimport { Cell, CellTemplate, Compatible, Uncertain, UncertainCompatible } from \"../Model/PublicModel\";\nimport {\n inNumericKey,\n isNavigationKey,\n isNumpadNumericKey,\n isAllowedOnNumberTypingKey,\n isCharAllowedOnNumberInput,\n isFunctionKey,\n} from \"./keyCodeCheckings\";\nimport { getCharFromKey } from \"./getCharFromKeyCode\";\nimport { parseLocaleNumber } from \"../Functions/parseLocaleNumber\";\n\nexport interface NumberCell extends Cell {\n type: \"number\";\n value: number;\n format?: Intl.NumberFormat;\n validator?: (value: number) => boolean;\n nanToZero?: boolean;\n hideZero?: boolean;\n errorMessage?: string;\n}\n\nexport class NumberCellTemplate implements CellTemplate {\n private wasEscKeyPressed = false;\n\n getCompatibleCell(uncertainCell: Uncertain): Compatible {\n let value: number;\n try {\n value = getCellProperty(uncertainCell, \"value\", \"number\");\n } catch (error) {\n value = NaN;\n }\n const numberFormat = uncertainCell.format || new Intl.NumberFormat(window.navigator.language);\n const displayValue = uncertainCell.nanToZero && Number.isNaN(value) ? 0 : value;\n const text =\n Number.isNaN(displayValue) || (uncertainCell.hideZero && displayValue === 0)\n ? \"\"\n : numberFormat.format(displayValue);\n return { ...uncertainCell, value: displayValue, text };\n }\n\n handleKeyDown(\n cell: Compatible,\n keyCode: number,\n ctrl: boolean,\n shift: boolean,\n alt: boolean,\n key: string,\n capsLock: boolean\n ): { cell: Compatible; enableEditMode: boolean } {\n if (isNumpadNumericKey(keyCode)) keyCode -= 48;\n if (isFunctionKey(keyCode)) {\n if (keyCode === keyCodes.F2) return { cell, enableEditMode: true };\n return { cell, enableEditMode: false };\n }\n\n const char = getCharFromKey(key);\n\n if (!ctrl && isCharAllowedOnNumberInput(char)) {\n const value = Number(char);\n\n if (Number.isNaN(value) && isCharAllowedOnNumberInput(char))\n return { cell: { ...this.getCompatibleCell({ ...cell, value }), text: char }, enableEditMode: true };\n return { cell: this.getCompatibleCell({ ...cell, value }), enableEditMode: true };\n }\n\n return {\n cell,\n enableEditMode: keyCode === keyCodes.POINTER || keyCode === keyCodes.ENTER,\n };\n }\n\n update(cell: Compatible, cellToMerge: UncertainCompatible): Compatible {\n return this.getCompatibleCell({ ...cell, value: cellToMerge.value });\n }\n\n private getTextFromCharCode = (cellText: string): string => {\n switch (cellText.charCodeAt(0)) {\n case keyCodes.DASH:\n case keyCodes.FIREFOX_DASH:\n case keyCodes.SUBTRACT:\n return \"-\";\n case keyCodes.COMMA:\n return \",\";\n case keyCodes.PERIOD:\n case keyCodes.DECIMAL:\n return \".\";\n default:\n return cellText;\n }\n };\n\n getClassName(cell: Compatible, isInEditMode: boolean): string {\n const isValid = cell.validator?.(cell.value) ?? true;\n const className = cell.className || \"\";\n return `${!isValid ? \"rg-invalid\" : \"\"} ${className}`;\n }\n\n render(\n cell: Compatible,\n isInEditMode: boolean,\n onCellChanged: (cell: Compatible, commit: boolean) => void\n ): React.ReactNode {\n if (!isInEditMode) {\n const isValid = cell.validator?.(cell.value) ?? true;\n const textToDisplay = !isValid && cell.errorMessage ? cell.errorMessage : cell.text;\n return textToDisplay;\n }\n\n const locale = cell.format ? cell.format.resolvedOptions().locale : window.navigator.languages[0];\n const format = new Intl.NumberFormat(locale, { useGrouping: false, maximumFractionDigits: 20 });\n\n return (\n {\n if (input) {\n input.focus();\n input.setSelectionRange(input.value.length, input.value.length);\n }\n }}\n defaultValue={Number.isNaN(cell.value) ? this.getTextFromCharCode(cell.text) : format.format(cell.value)}\n onChange={(e) =>\n onCellChanged(this.getCompatibleCell({ ...cell, value: parseLocaleNumber(e.currentTarget.value) }), false)\n }\n onBlur={(e) => {\n onCellChanged(\n this.getCompatibleCell({ ...cell, value: parseLocaleNumber(e.currentTarget.value) }),\n !this.wasEscKeyPressed\n );\n this.wasEscKeyPressed = false;\n }}\n onKeyDown={(e) => {\n if (\n inNumericKey(e.keyCode) ||\n isNavigationKey(e.keyCode) ||\n isAllowedOnNumberTypingKey(e.keyCode) ||\n ((e.ctrlKey || e.metaKey) && e.keyCode === keyCodes.KEY_A)\n )\n e.stopPropagation();\n if (\n !inNumericKey(e.keyCode) &&\n !isNavigationKey(e.keyCode) &&\n !isCharAllowedOnNumberInput(getCharFromKey(e.key))\n )\n e.preventDefault();\n if (e.keyCode === keyCodes.ESCAPE) this.wasEscKeyPressed = true;\n }}\n onCopy={(e) => e.stopPropagation()}\n onCut={(e) => e.stopPropagation()}\n onPaste={(e) => e.stopPropagation()}\n onPointerDown={(e) => e.stopPropagation()}\n />\n );\n }\n}\n","import * as React from \"react\";\n\n// NOTE: all modules imported below may be imported from '@silevis/reactgrid'\nimport { isAlphaNumericKey, isFunctionKey, isNavigationKey } from \"./keyCodeCheckings\";\nimport { getCellProperty } from \"../Functions/getCellProperty\";\nimport { keyCodes } from \"../Functions/keyCodes\";\nimport { Cell, CellTemplate, Compatible, Uncertain, UncertainCompatible } from \"../Model/PublicModel\";\nimport { getCharFromKey } from \"./getCharFromKeyCode\";\n\nexport interface TextCell extends Cell {\n type: \"text\";\n text: string;\n placeholder?: string;\n validator?: (text: string) => boolean;\n renderer?: (text: string) => React.ReactNode;\n errorMessage?: string;\n}\n\nexport class TextCellTemplate implements CellTemplate {\n private wasEscKeyPressed = false;\n\n getCompatibleCell(uncertainCell: Uncertain): Compatible {\n const text = getCellProperty(uncertainCell, \"text\", \"string\");\n let placeholder: string | undefined;\n try {\n placeholder = getCellProperty(uncertainCell, \"placeholder\", \"string\");\n } catch {\n placeholder = \"\";\n }\n const value = parseFloat(text); // TODO more advanced parsing for all text based cells\n return { ...uncertainCell, text, value, placeholder };\n }\n\n update(cell: Compatible, cellToMerge: UncertainCompatible): Compatible {\n return this.getCompatibleCell({ ...cell, text: cellToMerge.text, placeholder: cellToMerge.placeholder });\n }\n\n handleKeyDown(\n cell: Compatible,\n keyCode: number,\n ctrl: boolean,\n shift: boolean,\n alt: boolean,\n key: string,\n capsLock: boolean\n ): { cell: Compatible; enableEditMode: boolean } {\n if (isFunctionKey(keyCode)) {\n if (keyCode === keyCodes.F2) return { cell, enableEditMode: true };\n return { cell, enableEditMode: false };\n }\n\n const char = getCharFromKey(key, shift, capsLock);\n\n if (!ctrl && !alt && isAlphaNumericKey(keyCode) && !(shift && keyCode === keyCodes.SPACE))\n return { cell: this.getCompatibleCell({ ...cell, text: char }), enableEditMode: true };\n return {\n cell,\n enableEditMode: keyCode === keyCodes.POINTER || keyCode === keyCodes.ENTER,\n };\n }\n\n handleCompositionEnd(\n cell: Compatible,\n eventData: any\n ): { cell: Compatible; enableEditMode: boolean } {\n return { cell: { ...cell, text: eventData }, enableEditMode: true };\n }\n\n getClassName(cell: Compatible, isInEditMode: boolean): string {\n const isValid = cell.validator ? cell.validator(cell.text) : true;\n const className = cell.className ? cell.className : \"\";\n return `${isValid ? \"valid\" : \"rg-invalid\"} ${\n cell.placeholder && cell.text === \"\" ? \"placeholder\" : \"\"\n } ${className}`;\n }\n\n render(\n cell: Compatible,\n isInEditMode: boolean,\n onCellChanged: (cell: Compatible, commit: boolean) => void\n ): React.ReactNode {\n if (!isInEditMode) {\n const isValid = cell.validator ? cell.validator(cell.text) : true;\n const cellText = cell.text || cell.placeholder || \"\";\n const textToDisplay = !isValid && cell.errorMessage ? cell.errorMessage : cellText;\n return cell.renderer ? cell.renderer(textToDisplay) : textToDisplay;\n }\n\n return (\n {\n if (input) {\n input.focus();\n input.setSelectionRange(input.value.length, input.value.length);\n }\n }}\n defaultValue={cell.text}\n onChange={(e) => onCellChanged(this.getCompatibleCell({ ...cell, text: e.currentTarget.value }), false)}\n onBlur={(e) => {\n onCellChanged(this.getCompatibleCell({ ...cell, text: e.currentTarget.value }), !this.wasEscKeyPressed);\n this.wasEscKeyPressed = false;\n }}\n onCopy={(e) => e.stopPropagation()}\n onCut={(e) => e.stopPropagation()}\n onPaste={(e) => e.stopPropagation()}\n onPointerDown={(e) => e.stopPropagation()}\n placeholder={cell.placeholder}\n onKeyDown={(e) => {\n if (isAlphaNumericKey(e.keyCode) || isNavigationKey(e.keyCode)) e.stopPropagation();\n if (e.keyCode === keyCodes.ESCAPE) this.wasEscKeyPressed = true;\n }}\n />\n );\n }\n}\n","import * as React from \"react\";\n\n// NOTE: all modules imported below may be imported from '@silevis/reactgrid'\nimport { getCellProperty } from \"../Functions/getCellProperty\";\nimport { keyCodes } from \"../Functions/keyCodes\";\nimport { Cell, CellTemplate, Compatible, Uncertain, UncertainCompatible } from \"../Model/PublicModel\";\nimport { inNumericKey, isNavigationKey, isCharAllowedOnNumberInput, isFunctionKey } from \"./keyCodeCheckings\";\nimport { getTimestamp, getFormattedTimeUnit, getDefaultDate } from \"./timeUtils\";\nimport { getCharFromKey } from \"./getCharFromKeyCode\";\n\nexport interface TimeCell extends Cell {\n type: \"time\";\n time?: Date;\n format?: Intl.DateTimeFormat;\n}\n\nexport class TimeCellTemplate implements CellTemplate {\n static dayInMillis = 86400000;\n static defaultDate: string = getDefaultDate();\n private wasEscKeyPressed = false;\n\n getCompatibleCell(uncertainCell: Uncertain): Compatible {\n const time = uncertainCell.time ? getCellProperty(uncertainCell, \"time\", \"object\") : new Date(NaN);\n const timeFormat = uncertainCell.format || new Intl.DateTimeFormat(window.navigator.language);\n const value = time.getTime() % TimeCellTemplate.dayInMillis; // each day has 86400000 millis\n const text = !Number.isNaN(value) ? timeFormat.format(time) : \"\";\n return { ...uncertainCell, time, value, text };\n }\n\n handleKeyDown(\n cell: Compatible,\n keyCode: number,\n ctrl: boolean,\n shift: boolean,\n alt: boolean,\n key: string\n ): { cell: Compatible; enableEditMode: boolean } {\n if (isFunctionKey(keyCode)) {\n if (keyCode === keyCodes.F2) return { cell, enableEditMode: true };\n return { cell, enableEditMode: false };\n }\n\n if (!ctrl && isCharAllowedOnNumberInput(getCharFromKey(key)))\n return { cell: this.getCompatibleCell({ ...cell }), enableEditMode: true };\n return { cell, enableEditMode: keyCode === keyCodes.POINTER || keyCode === keyCodes.ENTER };\n }\n\n update(cell: Compatible, cellToMerge: UncertainCompatible): Compatible {\n const timestamp = getTimestamp(cellToMerge.text);\n if (cellToMerge.text !== \"\" && !Number.isNaN(timestamp))\n return this.getCompatibleCell({ ...cell, time: new Date(timestamp) });\n return this.getCompatibleCell({ ...cell, time: new Date(cellToMerge.value) });\n }\n\n getClassName(cell: Compatible, isInEditMode: boolean): string {\n return cell.className ? cell.className : \"\";\n }\n\n render(\n cell: Compatible,\n isInEditMode: boolean,\n onCellChanged: (cell: Compatible, commit: boolean) => void\n ): React.ReactNode {\n if (!isInEditMode) {\n return cell.text;\n }\n\n if (!cell.time) {\n return `\"cell.time\" is not initialized with a time value`;\n }\n\n const hours = getFormattedTimeUnit(cell.time.getHours());\n const minutes = getFormattedTimeUnit(cell.time.getMinutes());\n\n return (\n {\n if (input) input.focus();\n }}\n type=\"time\"\n defaultValue={`${hours}:${minutes}`}\n onChange={(e) => {\n const timestamp = getTimestamp(e.currentTarget.value);\n if (!Number.isNaN(timestamp))\n onCellChanged(this.getCompatibleCell({ ...cell, time: new Date(timestamp) }), false);\n }}\n onBlur={(e) => {\n const timestamp = getTimestamp(e.currentTarget.value);\n if (!Number.isNaN(timestamp)) {\n onCellChanged(this.getCompatibleCell({ ...cell, time: new Date(timestamp) }), !this.wasEscKeyPressed);\n this.wasEscKeyPressed = false;\n }\n }}\n onKeyDown={(e) => {\n if (\n inNumericKey(e.keyCode) ||\n isNavigationKey(e.keyCode) ||\n e.keyCode === keyCodes.COMMA ||\n e.keyCode === keyCodes.PERIOD ||\n ((e.ctrlKey || e.metaKey) && e.keyCode === keyCodes.KEY_A)\n )\n e.stopPropagation();\n if (\n !inNumericKey(e.keyCode) &&\n !isNavigationKey(e.keyCode) &&\n e.keyCode !== keyCodes.COMMA &&\n e.keyCode !== keyCodes.PERIOD\n )\n e.preventDefault();\n if (e.keyCode === keyCodes.ESCAPE) this.wasEscKeyPressed = true;\n }}\n onCopy={(e) => e.stopPropagation()}\n onCut={(e) => e.stopPropagation()}\n onPaste={(e) => e.stopPropagation()}\n onPointerDown={(e) => e.stopPropagation()}\n />\n );\n }\n}\n","import * as React from 'react';\n\n// NOTE: all modules imported below may be imported from '@silevis/reactgrid'\nimport { getCellProperty } from '../Functions/getCellProperty';\nimport { getCharFromKey } from './getCharFromKeyCode';\nimport { isAlphaNumericKey } from './keyCodeCheckings';\nimport { Cell, CellTemplate, Compatible, Uncertain, UncertainCompatible } from '../Model/PublicModel';\nimport { keyCodes } from '../Functions/keyCodes';\n\nimport Select, { OptionProps, MenuProps, CSSObjectWithLabel } from 'react-select';\nimport { FC } from 'react';\n\nexport type OptionType = {\n label: string;\n value: string;\n isDisabled?: boolean;\n}\n\nexport interface DropdownCell extends Cell {\n type: 'dropdown';\n selectedValue?: string;\n values: OptionType[];\n isDisabled?: boolean;\n isOpen?: boolean;\n inputValue?: string;\n styles?: {\n container?: CSSObjectWithLabel;\n control?: CSSObjectWithLabel;\n indicatorsContainer?: CSSObjectWithLabel;\n dropdownIndicator?: CSSObjectWithLabel;\n singleValue?: CSSObjectWithLabel;\n indicatorSeparator?: CSSObjectWithLabel;\n input?: CSSObjectWithLabel;\n valueContainer?: CSSObjectWithLabel;\n }\n}\n\nexport class DropdownCellTemplate implements CellTemplate {\n\n getCompatibleCell(uncertainCell: Uncertain): Compatible {\n let selectedValue: string | undefined;\n\n try {\n selectedValue = getCellProperty(uncertainCell, 'selectedValue', 'string')\n } catch {\n selectedValue = undefined;\n }\n\n const values = getCellProperty(uncertainCell, 'values', 'object');\n const value = selectedValue ? parseFloat(selectedValue) : NaN;\n\n let isDisabled = true;\n try {\n isDisabled = getCellProperty(uncertainCell, 'isDisabled', 'boolean');\n } catch {\n isDisabled = false;\n }\n\n let inputValue: string | undefined;\n try {\n inputValue = getCellProperty(uncertainCell, 'inputValue', 'string');\n } catch {\n inputValue = undefined;\n }\n\n let isOpen: boolean;\n try {\n isOpen = getCellProperty(uncertainCell, 'isOpen', 'boolean');\n } catch {\n isOpen = false;\n }\n\n const text = selectedValue || '';\n\n return { ...uncertainCell, selectedValue, text, value, values, isDisabled, isOpen, inputValue };\n }\n\n update(cell: Compatible, cellToMerge: UncertainCompatible): Compatible {\n // I use the text property as a selectedValue property because behaviors don't know about the selectedValue property\n // and instead throw an error when we try to access it.\n // Before merging, we also need to check if the incoming value is in the target values array, otherwise we set it to undefined.\n const selectedValueFromText = cell.values.some((val: any) => val.value === cellToMerge.text) ? cellToMerge.text : undefined;\n\n return this.getCompatibleCell({ ...cell, selectedValue: selectedValueFromText, isOpen: cellToMerge.isOpen, inputValue: cellToMerge.inputValue });\n }\n\n getClassName(cell: Compatible, isInEditMode: boolean): string {\n const isOpen = cell.isOpen ? 'open' : 'closed';\n return `${cell.className ? cell.className : ''}${isOpen}`;\n }\n\n handleKeyDown(cell: Compatible, keyCode: number, ctrl: boolean, shift: boolean, alt: boolean, key: string, capsLock: boolean): { cell: Compatible, enableEditMode: boolean } {\n if ((keyCode === keyCodes.SPACE || keyCode === keyCodes.ENTER) && !shift) {\n return { cell: this.getCompatibleCell({ ...cell, isOpen: !cell.isOpen }), enableEditMode: false };\n }\n\n const char = getCharFromKey(key, shift, capsLock);\n\n if (!ctrl && !alt && isAlphaNumericKey(keyCode) && !(shift && keyCode === keyCodes.SPACE))\n return { cell: this.getCompatibleCell({ ...cell, inputValue: char, isOpen: !cell.isOpen }), enableEditMode: false }\n\n return { cell, enableEditMode: false };\n }\n\n handleCompositionEnd(cell: Compatible, eventData: any): { cell: Compatible, enableEditMode: boolean } {\n return { cell: { ...cell, inputValue: eventData, isOpen: !cell.isOpen }, enableEditMode: false }\n }\n\n render(\n cell: Compatible,\n isInEditMode: boolean,\n onCellChanged: (cell: Compatible, commit: boolean) => void\n ): React.ReactNode {\n return (\n onCellChanged(this.getCompatibleCell(cell), true)} cell={cell} />\n );\n }\n}\n\ninterface DIProps {\n onCellChanged: (...args: any[]) => void;\n cell: Record;\n\n}\n\nconst DropdownInput: FC = ({ onCellChanged, cell }) => {\n\n const selectRef = React.useRef(null);\n\n const [inputValue, setInputValue] = React.useState(cell.inputValue);\n const selectedValue = React.useMemo(() => cell.values.find((val: any) => val.value === cell.text), [cell.text, cell.values]);\n\n React.useEffect(() => {\n if (cell.isOpen && selectRef.current) {\n selectRef.current.focus();\n setInputValue(cell.inputValue);\n }\n }, [cell.isOpen, cell.inputValue]);\n\n return onCellChanged({ ...cell, isOpen: true })}\n >\n setInputValue(e),\n })}\n isSearchable={true}\n ref={selectRef}\n {...(cell.isOpen !== undefined && { menuIsOpen: cell.isOpen })}\n onMenuClose={() => onCellChanged({ ...cell, isOpen: !cell.isOpen, inputValue: undefined })}\n onMenuOpen={() => onCellChanged({ ...cell, isOpen: true })}\n onChange={(e) => onCellChanged({ ...cell, selectedValue: (e as OptionType).value, isOpen: false, inputValue: undefined })}\n blurInputOnSelect={true}\n defaultValue={selectedValue}\n value={selectedValue !== undefined ? selectedValue : null}\n isDisabled={cell.isDisabled}\n options={cell.values}\n onKeyDown={e => {\n e.stopPropagation(); \n\n if (e.key === \"Escape\") {\n selectRef.current.blur();\n return onCellChanged({ ...cell, isOpen: false, inputValue: undefined })\n }\n }}\n components={{\n Option: CustomOption,\n Menu: CustomMenu,\n }}\n styles={{\n container: (provided) => ({\n ...provided,\n width: '100%',\n height: '100%',\n ...cell.styles?.container,\n }),\n control: (provided) => ({\n ...provided,\n border: 'none',\n borderColor: 'transparent',\n minHeight: '25px',\n background: 'transparent',\n boxShadow: 'none',\n ...cell.styles?.control,\n }),\n indicatorsContainer: (provided) => ({\n ...provided,\n paddingTop: '0px',\n ...cell.styles?.indicatorsContainer\n }),\n dropdownIndicator: (provided) => ({\n ...provided,\n padding: '0px 4px',\n ...cell.styles?.dropdownIndicator\n }),\n singleValue: (provided) => ({\n ...provided,\n color: 'inherit',\n ...cell.styles?.singleValue\n }),\n indicatorSeparator: (provided) => ({\n ...provided,\n marginTop: '4px',\n marginBottom: '4px',\n ...cell.styles?.indicatorSeparator\n }),\n input: (provided) => ({\n ...provided,\n padding: 0,\n ...cell.styles?.input\n }),\n valueContainer: (provided) => ({\n ...provided,\n padding: '0 8px',\n ...cell.styles?.valueContainer\n }),\n }}\n />\n
\n}\n\nconst CustomOption: React.FC> = ({ innerProps, label, isSelected, isFocused, isDisabled }) => (\n e.stopPropagation()}\n className={`rg-dropdown-option${isSelected ? ' selected' : ''}${isFocused ? ' focused' : ''}${isDisabled ? ' disabled' : ''}`}\n >\n {label}\n \n);\n\nconst CustomMenu: React.FC> = ({ innerProps, children }) => (\n
e.stopPropagation()}>{children}
\n);\n","import {\n ChevronCellTemplate, TimeCellTemplate, EmailCellTemplate, DateCellTemplate, CheckboxCellTemplate,\n HeaderCellTemplate, NumberCellTemplate, TextCellTemplate, DropdownCellTemplate\n} from '../CellTemplates';\nimport { CellTemplates } from '../Model/PublicModel';\n\nexport const defaultCellTemplates: CellTemplates = {\n text: new TextCellTemplate(),\n number: new NumberCellTemplate(),\n header: new HeaderCellTemplate(),\n checkbox: new CheckboxCellTemplate(),\n date: new DateCellTemplate(),\n email: new EmailCellTemplate(),\n time: new TimeCellTemplate(),\n chevron: new ChevronCellTemplate(),\n dropdown: new DropdownCellTemplate()\n};\n","import { CellTemplates, Cell, ReactGridProps, Compatible, Highlight, CellChange, Id, SelectionMode } from './PublicModel';\nimport { isBrowserIE } from '../Functions/internetExplorer';\nimport { isBrowserEdge } from '../Functions/microsoftEdge';\nimport { DefaultBehavior } from '../Behaviors/DefaultBehavior';\nimport { CellMatrix } from './CellMatrix';\nimport { Behavior } from './Behavior';\nimport { Location, Orientation, } from './InternalModel';\nimport { Range } from './Range';\nimport { defaultCellTemplates } from '../Functions/defaultCellTemplates';\n\nexport type StateModifier = (state: TState) => TState;\nexport type StateUpdater = (modifier: StateModifier) => void;\n\n\nexport interface State {\n update: StateUpdater;\n readonly props?: ReactGridProps;\n readonly legacyBrowserMode: boolean;\n readonly cellMatrix: TCellMatrix;\n readonly currentBehavior: TBehavior;\n readonly focusedLocation?: Location;\n\n readonly cellTemplates: CellTemplates;\n hiddenFocusElement?: HTMLDivElement; // updated without setState\n readonly reactGridElement?: HTMLDivElement;\n readonly scrollableElement?: HTMLElement | (Window & typeof globalThis);\n\n readonly queuedCellChanges: CellChange[];\n currentlyEditedCell?: Compatible;\n\n readonly highlightLocations: Highlight[];\n\n // VISIBLE RANGE\n readonly visibleRange?: Range;\n\n // STICKY\n readonly leftStickyColumns?: number;\n readonly topStickyRows?: number;\n\n // SCROLLS\n readonly topScrollBoudary: number;\n readonly bottomScrollBoudary: number;\n readonly leftScrollBoudary: number;\n readonly rightScrollBoudary: number;\n\n readonly enableGroupIdRender: boolean;\n\n readonly enableFillHandle: boolean;\n readonly enableRangeSelection: boolean;\n readonly enableColumnSelection: boolean;\n readonly enableRowSelection: boolean;\n readonly disableVirtualScrolling: boolean;\n readonly contextMenuPosition: { top: number; left: number };\n readonly lineOrientation: Orientation;\n readonly linePosition: number;\n readonly shadowSize: number;\n readonly shadowPosition: number;\n readonly shadowCursor: string;\n readonly selectionMode: SelectionMode;\n readonly selectedRanges: Range[];\n readonly selectedIndexes: number[];\n readonly selectedIds: Id[];\n readonly activeSelectedRangeIdx: number;\n readonly copyRange?: Range;\n readonly rightStickyColumns: number | undefined;\n readonly bottomStickyRows: number | undefined;\n}\n\nexport const defaultStateFields = {\n legacyBrowserMode: isBrowserIE() || isBrowserEdge(),\n focusedLocation: undefined,\n currentBehavior: new DefaultBehavior(),\n cellTemplates: defaultCellTemplates,\n hiddenFocusElement: undefined,\n reactGridElement: undefined,\n scrollableElement: undefined,\n queuedCellChanges: [],\n currentlyEditedCell: undefined,\n highlightLocations: [],\n visibleRange: undefined,\n topScrollBoudary: -1,\n bottomScrollBoudary: -1,\n leftScrollBoudary: -1,\n rightScrollBoudary: -1,\n enableGroupIdRender: false,\n leftStickyColumns: undefined,\n topStickyRows: undefined,\n enableFillHandle: false,\n enableRangeSelection: true,\n enableColumnSelection: false,\n enableRowSelection: false,\n contextMenuPosition: { top: -1, left: -1 },\n lineOrientation: \"horizontal\" as Orientation,\n linePosition: -1,\n shadowSize: 0,\n shadowPosition: -1,\n shadowCursor: \"default\",\n selectionMode: \"range\" as SelectionMode,\n selectedRanges: [],\n selectedIndexes: [],\n selectedIds: [],\n activeSelectedRangeIdx: 0,\n copyRange: undefined,\n rightStickyColumns: undefined,\n bottomStickyRows: undefined,\n disableVirtualScrolling: false,\n}\n","import { CellMatrix, CellMatrixProps, StickyRanges, translateLocationIdxToLookupKey } from './CellMatrix';\nimport { GridColumn, GridRow } from './InternalModel';\nimport { Range } from './Range';\n\n\nexport interface StickyEdges {\n leftStickyColumns: number;\n topStickyRows: number;\n rightStickyColumns: number;\n bottomStickyRows: number;\n}\nexport interface ICellMatrixBuilder {\n setProps(props: CellMatrixProps): TCellMatrixBuilder;\n fillRowsAndCols(edges: TStickyEdges): TCellMatrixBuilder;\n fillSticky(edges: TStickyEdges): TCellMatrixBuilder;\n fillScrollableRange(edges: TStickyEdges): TCellMatrixBuilder;\n setEdgeLocations(): TCellMatrixBuilder;\n}\n\nexport class CellMatrixBuilder implements ICellMatrixBuilder {\n private cellMatrix!: CellMatrix;\n\n constructor() {\n this.reset();\n }\n \n private reset(): CellMatrixBuilder {\n this.cellMatrix = new CellMatrix({} as StickyRanges);\n return this;\n }\n \n setProps(props: CellMatrixProps): CellMatrixBuilder {\n this.cellMatrix.props = props;\n return this;\n }\n \n fillRowsAndCols(\n edges: StickyEdges = {\n leftStickyColumns: 0,\n topStickyRows: 0,\n rightStickyColumns: 0,\n bottomStickyRows: 0,\n }\n ): CellMatrixBuilder {\n const {\n leftStickyColumns,\n topStickyRows,\n rightStickyColumns,\n bottomStickyRows,\n } = edges;\n if (!Array.isArray(this.cellMatrix.props.rows)) {\n throw new TypeError('Feeded ReactGrids \"rows\" property is not an array!');\n }\n if (!Array.isArray(this.cellMatrix.props.columns)) {\n throw new TypeError(\n 'Feeded ReactGrids \"columns\" property is not an array!'\n );\n }\n this.cellMatrix.rows = this.cellMatrix.props.rows.reduce(\n (rows, row, idx) => {\n const top = this.getTop(idx, topStickyRows, bottomStickyRows, rows);\n const height = row.height || CellMatrix.DEFAULT_ROW_HEIGHT;\n rows.push({\n ...row,\n top,\n height,\n idx,\n bottom: top + height,\n } as GridRow);\n this.cellMatrix.height += height;\n \n // TODO what with rowIndexLookup?\n this.cellMatrix.rowIndexLookup[row.rowId] = idx;\n return rows;\n },\n []\n );\n this.cellMatrix.columns = this.cellMatrix.props.columns.reduce<\n GridColumn[]\n >((cols, column, idx) => {\n const left = this.getLeft(\n idx,\n leftStickyColumns,\n rightStickyColumns,\n cols\n );\n const width = column.width\n ? column.width < (this.cellMatrix.props?.minColumnWidth ?? CellMatrix.MIN_COLUMN_WIDTH)\n ? (this.cellMatrix.props?.minColumnWidth ?? CellMatrix.MIN_COLUMN_WIDTH)\n : column.width\n : CellMatrix.DEFAULT_COLUMN_WIDTH;\n cols.push({ ...column, idx, left, width, right: left + width });\n this.cellMatrix.width += width;\n // TODO what with columnIndexLookup?\n this.cellMatrix.columnIndexLookup[column.columnId] = idx;\n return cols;\n }, []);\n return this;\n }\n \n setRangesToRenderLookup(): CellMatrixBuilder {\n let rangesToExclude: Range[] = [];\n this.cellMatrix.rows.forEach((row, idy) => {\n row.cells.forEach((cell, idx) => {\n const rowspan = (\"rowspan\" in cell && cell.rowspan) || 0;\n const colspan = (\"colspan\" in cell && cell.colspan) || 0;\n const rows = rowspan\n ? this.cellMatrix.rows.slice(idy, idy + rowspan)\n : [this.cellMatrix.rows[idy]];\n const columns = colspan\n ? this.cellMatrix.columns.slice(idx, idx + colspan)\n : [this.cellMatrix.columns[idx]];\n const range = new Range(rows, columns);\n rangesToExclude = [\n ...rangesToExclude,\n ...this.getRangesToRender(range),\n ];\n this.cellMatrix.spanCellLookup[\n translateLocationIdxToLookupKey(idx, idy)\n ] = { range };\n });\n });\n // TODO try to optimize by using only lookup\n const keys = rangesToExclude.map((range) =>\n translateLocationIdxToLookupKey(\n range.first.column.idx,\n range.first.row.idx\n )\n );\n Object.keys(this.cellMatrix.spanCellLookup).forEach((key) => {\n if (!keys.includes(key)) {\n this.cellMatrix.rangesToRender[key] =\n this.cellMatrix.spanCellLookup[key];\n }\n });\n return this;\n }\n \n getRangesToRender(range: Range): Range[] {\n const result = range.rows.flatMap((row) =>\n range.columns.map((column) => new Range([row], [column]))\n );\n result.shift();\n return result;\n }\n \n fillSticky(\n edges: StickyEdges = {\n leftStickyColumns: 0,\n topStickyRows: 0,\n rightStickyColumns: 0,\n bottomStickyRows: 0,\n }\n ): CellMatrixBuilder {\n const {\n leftStickyColumns,\n topStickyRows,\n rightStickyColumns,\n bottomStickyRows,\n } = edges;\n this.cellMatrix.ranges.stickyLeftRange = new Range(\n this.cellMatrix.rows,\n this.cellMatrix.columns.slice(0, leftStickyColumns || 0)\n );\n this.cellMatrix.ranges.stickyTopRange = new Range(\n this.cellMatrix.rows.slice(0, topStickyRows || 0),\n this.cellMatrix.columns\n );\n this.cellMatrix.ranges.stickyRightRange = new Range(\n this.cellMatrix.rows,\n this.cellMatrix.columns.slice(\n this.getStickyRightFirstIdx(leftStickyColumns, rightStickyColumns),\n this.cellMatrix.columns.length\n )\n );\n this.cellMatrix.ranges.stickyBottomRange = new Range(\n this.cellMatrix.rows.slice(\n this.getStickyBottomFirstIdx(topStickyRows, bottomStickyRows),\n this.cellMatrix.rows.length\n ),\n this.cellMatrix.columns\n );\n return this;\n }\n \n fillScrollableRange(\n edges: StickyEdges = {\n leftStickyColumns: 0,\n topStickyRows: 0,\n rightStickyColumns: 0,\n bottomStickyRows: 0,\n }\n ): CellMatrixBuilder {\n const {\n leftStickyColumns,\n topStickyRows,\n rightStickyColumns,\n bottomStickyRows,\n } = edges;\n this.cellMatrix.scrollableRange = this.getScrollableRange(\n leftStickyColumns,\n topStickyRows,\n rightStickyColumns,\n bottomStickyRows\n );\n return this;\n }\n \n setEdgeLocations(): CellMatrixBuilder {\n this.cellMatrix.first = this.cellMatrix.getLocation(0, 0);\n this.cellMatrix.last = this.cellMatrix.getLocation(\n this.cellMatrix.rows.length - 1,\n this.cellMatrix.columns.length - 1\n );\n return this;\n }\n \n private getTop(\n idx: number,\n topRowsSticky: number | undefined,\n bottomRowsSticky: number | undefined,\n rows: GridRow[]\n ): number {\n return idx === 0 ||\n idx === topRowsSticky ||\n idx ===\n this.getStickyBottomFirstIdx(topRowsSticky || 0, bottomRowsSticky || 0)\n ? 0\n : rows[idx - 1].top + rows[idx - 1].height;\n }\n \n private getLeft(\n idx: number,\n leftColumnsSticky: number | undefined,\n rightColumnsSticky: number | undefined,\n cols: GridColumn[]\n ): number {\n return idx === 0 ||\n idx === leftColumnsSticky ||\n idx ===\n this.getStickyRightFirstIdx(\n leftColumnsSticky || 0,\n rightColumnsSticky || 0\n )\n ? 0\n : cols[idx - 1].left + cols[idx - 1].width;\n }\n \n private getScrollableRange(\n leftColumnsSticky: number,\n topRowsSticky: number,\n rightColumnsSticky: number,\n bottomRowsSticky: number\n ): Range {\n return new Range(\n this.cellMatrix.rows.slice(\n topRowsSticky || 0,\n this.getStickyBottomFirstIdx(topRowsSticky, bottomRowsSticky)\n ),\n this.cellMatrix.columns.slice(\n leftColumnsSticky || 0,\n this.getStickyRightFirstIdx(leftColumnsSticky, rightColumnsSticky)\n )\n );\n }\n \n private getStickyBottomFirstIdx(\n topRowsSticky: number,\n bottomRowsSticky: number\n ): number {\n const stickyBottomRows = bottomRowsSticky || 0;\n const stickyTopRows = topRowsSticky || 0;\n const rows = this.cellMatrix.props.rows.length;\n return (\n rows - (stickyBottomRows + stickyTopRows > rows ? 0 : stickyBottomRows)\n );\n }\n \n private getStickyRightFirstIdx(\n stickyColumnsLeft: number,\n stickyColumnsRight: number\n ): number {\n const stickyRightColumns = stickyColumnsRight || 0;\n const stickyLeftColumns = stickyColumnsLeft || 0;\n const columns = this.cellMatrix.props.columns.length;\n return (\n columns -\n (stickyRightColumns + stickyLeftColumns > columns\n ? 0\n : stickyRightColumns)\n );\n }\n \n getCellMatrix(): CellMatrix {\n const result = this.cellMatrix;\n this.reset();\n return result;\n }\n}\n","import { Range } from '../Model/Range';\nimport { State } from '../Model/State';\nimport { GridColumn, GridRow } from '../Model/InternalModel';\nimport { getScrollOfScrollableElement } from './scrollHelpers';\nimport { getVisibleSizeOfReactGrid, getReactGridOffsets, getStickyOffset } from './elementSizeHelpers';\n\nexport const VS_PAGE_HEIGHT = 400;\nexport const VS_PAGE_WIDTH = 300;\nconst ADDITONAL_INDEX = 1; // is needed for getting last element in array\n\nexport function recalcVisibleRange(state: State): State {\n if(state.disableVirtualScrolling){\n const {rows, columns} = state.cellMatrix.scrollableRange;\n const visibleRange = new Range(rows, columns);\n return {\n ...state,\n visibleRange\n };\n }\n const { scrollTop, scrollLeft } = getScrollOfScrollableElement(state.scrollableElement);\n const { width, height } = getVisibleScrollableSize(state,\n [-state.cellMatrix.ranges.stickyTopRange.height], [-state.cellMatrix.ranges.stickyLeftRange.width]);\n const visibleColumns = getVisibleColumns(state, width);\n const visibleRows = getVisibleRows(state, height);\n const visibleRange = new Range(visibleRows, visibleColumns);\n return {\n ...state,\n leftScrollBoudary: visibleRange.columns.length > 0 ? scrollLeft - VS_PAGE_WIDTH : 0,\n rightScrollBoudary: visibleRange.last.column === undefined ? 0 : VS_PAGE_WIDTH + scrollLeft,\n topScrollBoudary: visibleRange.columns.length > 0 ? scrollTop - VS_PAGE_HEIGHT : 0,\n bottomScrollBoudary: visibleRange.last.row === undefined ? 0 : VS_PAGE_HEIGHT + scrollTop,\n visibleRange\n };\n}\n\n\nexport function getVisibleScrollableSize(state: State, heights: number[], widths: number[]): { height: number, width: number } {\n const { height, width } = getVisibleSizeOfReactGrid(state);\n const sum = (a: number, b: number) => a + b;\n return {\n height: Math.max(heights.reduce(sum, height), 0),\n width: Math.max(widths.reduce(sum, width), 0)\n }\n}\n\nexport function getVisibleColumns(state: State, scrollableWidth: number): GridColumn[] {\n const { columns } = state.cellMatrix.scrollableRange;\n const { left } = getReactGridOffsets(state);\n const { scrollLeft } = getScrollOfScrollableElement(state.scrollableElement);\n const firstIndex = Math.max(colBinarySearch(columns, scrollLeft - left - VS_PAGE_WIDTH) - ADDITONAL_INDEX - 1, 0);\n const lastIndex = colBinarySearch(columns, scrollableWidth + getStickyOffset(scrollLeft, left) + VS_PAGE_WIDTH, firstIndex);\n return columns.slice(firstIndex, lastIndex + ADDITONAL_INDEX);\n}\n\nexport function getVisibleRows(state: State, scrollableHeight: number): GridRow[] {\n const { rows } = state.cellMatrix.scrollableRange;\n const { top } = getReactGridOffsets(state);\n const { scrollTop } = getScrollOfScrollableElement(state.scrollableElement);\n const firstIndex = Math.max(rowBinarySearch(rows, scrollTop - top - VS_PAGE_HEIGHT) - ADDITONAL_INDEX - 1, 0);\n const lastIndex = rowBinarySearch(rows, scrollableHeight + getStickyOffset(scrollTop, top) + VS_PAGE_HEIGHT, firstIndex);\n return rows.slice(firstIndex, lastIndex + ADDITONAL_INDEX);\n}\n\nfunction rowBinarySearch(arr: GridRow[], val: number, start = 0, end = arr.length - 1): number {\n const mid = (start + end) >> 1;\n if (mid < 0)\n return 0;\n if (start >= end)\n return mid;\n return val < arr[mid].top\n ? rowBinarySearch(arr, val, start, mid)\n : rowBinarySearch(arr, val, mid + 1, end);\n}\n\nfunction colBinarySearch(arr: GridColumn[], val: number, start = 0, end = arr.length - 1): number {\n const mid = (start + end) >> 1;\n if (mid < 0)\n return 0;\n if (start >= end)\n return mid;\n return val < arr[mid].left\n ? colBinarySearch(arr, val, start, mid)\n : colBinarySearch(arr, val, mid + 1, end);\n}\n","import { State } from '../Model/State';\nimport { ReactGridProps } from '../Model/PublicModel';\nimport { getSizeOfElement } from './elementSizeHelpers';\nimport { CellMatrix } from '../Model/CellMatrix';\n\nconst DEFAULT_BREAKPOINT = 50;\n\nexport function updateResponsiveSticky(props: ReactGridProps, state: State): State {\n const {\n horizontalStickyBreakpoint = DEFAULT_BREAKPOINT,\n verticalStickyBreakpoint = DEFAULT_BREAKPOINT,\n } = props;\n let leftStickyColumns = props.stickyLeftColumns || 0;\n let topStickyRows = props.stickyTopRows || 0;\n let rightStickyColumns = props.stickyRightColumns || 0;\n let bottomStickyRows = props.stickyBottomRows || 0;\n if (\n props.stickyTopRows ||\n props.stickyLeftColumns ||\n props.stickyRightColumns ||\n props.stickyBottomRows\n ) {\n const {\n width: widthOfScrollableElement,\n height: heightOfScrollableElement,\n } = getSizeOfElement(state.scrollableElement);\n if (props.stickyLeftColumns || props.stickyRightColumns) {\n const predictedLeftRangeWidth = props.columns\n .slice(0, leftStickyColumns)\n .reduce((acc, column) => {\n return acc + (column.width || CellMatrix.DEFAULT_COLUMN_WIDTH);\n }, 0);\n let predictedRightRangeWidth = 0;\n if (rightStickyColumns > 0) {\n predictedRightRangeWidth = props.columns\n .slice(-rightStickyColumns)\n .reduce((acc, column) => {\n return acc + (column.width || CellMatrix.DEFAULT_COLUMN_WIDTH);\n }, 0);\n }\n const shouldDisableStickyHorizontally =\n predictedLeftRangeWidth + predictedRightRangeWidth >\n (horizontalStickyBreakpoint * widthOfScrollableElement) / 100;\n leftStickyColumns = shouldDisableStickyHorizontally\n ? 0\n : leftStickyColumns;\n rightStickyColumns = shouldDisableStickyHorizontally\n ? 0\n : rightStickyColumns;\n }\n if (props.stickyTopRows || props.stickyBottomRows) {\n const predictedTopRangeHeight = props.rows\n .slice(0, topStickyRows)\n .reduce((acc, column) => {\n return acc + (column.height || CellMatrix.DEFAULT_ROW_HEIGHT);\n }, 0);\n let predictedBottomRangeHeight = 0;\n if (bottomStickyRows > 0) {\n predictedBottomRangeHeight = props.rows\n .slice(-bottomStickyRows)\n .reduce((prev, column) => {\n return prev + (column.height || CellMatrix.DEFAULT_ROW_HEIGHT);\n }, 0);\n }\n const shouldDisableStickyVertically =\n predictedTopRangeHeight + predictedBottomRangeHeight >\n (verticalStickyBreakpoint * heightOfScrollableElement) / 100;\n topStickyRows = shouldDisableStickyVertically ? 0 : topStickyRows;\n bottomStickyRows = shouldDisableStickyVertically ? 0 : bottomStickyRows;\n }\n }\n return {\n ...state,\n leftStickyColumns,\n topStickyRows,\n rightStickyColumns,\n bottomStickyRows,\n };\n}\n","import { recalcVisibleRange } from '../Functions/recalcVisibleRange';\nimport { getScrollableParent, getScrollOfScrollableElement } from '../Functions/scrollHelpers';\nimport { getVisibleSizeOfReactGrid } from '../Functions/elementSizeHelpers';\nimport { AbstractPointerEventsController } from './AbstractPointerEventsController';\nimport { StateModifier, StateUpdater } from './State';\nimport { PointerEvent, KeyboardEvent, ClipboardEvent, FocusEvent } from './domEventsTypes';\nimport { updateResponsiveSticky } from '../Functions/updateResponsiveSticky';\n\nexport class EventHandlers {\n\n constructor(public updateState: StateUpdater, public pointerEventsController: AbstractPointerEventsController) { }\n\n pointerDownHandler = (event: PointerEvent): void => this.updateState(state => this.pointerEventsController.handlePointerDown(event, state));\n keyDownHandler = (event: KeyboardEvent): void => this.updateState(state => state.currentBehavior.handleKeyDown(event, state));\n keyUpHandler = (event: KeyboardEvent): void => this.updateState(state => state.currentBehavior.handleKeyUp(event, state));\n compositionEndHandler = (event: CompositionEvent): void => this.updateState(state => state.currentBehavior.handleCompositionEnd(event, state));\n copyHandler = (event: ClipboardEvent): void => this.updateState(state => state.currentBehavior.handleCopy(event, state));\n pasteHandler = (event: ClipboardEvent): void => this.updateState(state => state.currentBehavior.handlePaste(event, state));\n cutHandler = (event: ClipboardEvent): void => this.updateState(state => state.currentBehavior.handleCut(event, state));\n blurHandler = (event: FocusEvent): void => this.updateState(state => {\n if ((event.target as HTMLInputElement)?.id?.startsWith('react-select-')) { // give back focus on react-select dropdown blur\n state.hiddenFocusElement?.focus({ preventScroll: true });\n }\n return state;\n });\n windowResizeHandler = (): void => this.updateState(recalcVisibleRange);\n reactgridRefHandler = (reactGridElement: HTMLDivElement): void => this.assignElementsRefs(reactGridElement, recalcVisibleRange);\n hiddenElementRefHandler = (hiddenFocusElement: HTMLInputElement): void => this.updateState(state => {\n if (state.props?.initialFocusLocation && hiddenFocusElement) {\n hiddenFocusElement.focus({ preventScroll: true });\n }\n state.hiddenFocusElement = hiddenFocusElement;\n return state;\n });\n\n pasteCaptureHandler = (event: ClipboardEvent): void => {\n const htmlData = event.clipboardData.getData('text/html');\n const parsedData = new DOMParser().parseFromString(htmlData, 'text/html');\n if (htmlData && parsedData.body.firstElementChild?.getAttribute('data-reactgrid') === 'reactgrid-content') {\n event.bubbles = false;\n }\n };\n\n protected scrollHandlerInternal = (visibleRangeCalculator: StateModifier): void => {\n try {\n return this.updateOnScrollChange(visibleRangeCalculator);\n } catch (error) {\n console.error(error);\n }\n };\n\n scrollHandler: () => void = () => this.scrollHandlerInternal(recalcVisibleRange);\n\n protected assignElementsRefs = (reactGridElement: HTMLDivElement, visibleRangeCalculator: StateModifier): void => {\n if (reactGridElement) {\n this.updateState(state => {\n const scrollableElement = getScrollableParent(reactGridElement, true);\n if (state.props) {\n state = updateResponsiveSticky(state.props, state);\n }\n return visibleRangeCalculator({ ...state, reactGridElement, scrollableElement });\n });\n }\n }\n\n protected updateOnScrollChange = (visibleRangeCalculator: StateModifier): void => {\n this.updateState(state => {\n if(state.disableVirtualScrolling) return state \n const PAGE_UPDATE_OFFSET = 200;\n const { scrollTop, scrollLeft } = getScrollOfScrollableElement(state.scrollableElement);\n const { width, height } = getVisibleSizeOfReactGrid(state);\n const shouldBeVisibleRangeRecalc = width > 0 && height > 0 && (\n scrollTop >= state.bottomScrollBoudary - PAGE_UPDATE_OFFSET || scrollTop <= state.topScrollBoudary + PAGE_UPDATE_OFFSET ||\n scrollLeft >= state.rightScrollBoudary - PAGE_UPDATE_OFFSET || scrollLeft <= state.leftScrollBoudary + PAGE_UPDATE_OFFSET\n );\n return shouldBeVisibleRangeRecalc ? visibleRangeCalculator(state) : state;\n });\n }\n}\n","import {\n PositionState,\n Location,\n getScrollOfScrollableElement,\n getReactGridOffsets,\n getTopScrollableElement,\n getStickyLeftRangeWidth,\n getLeftStickyOffset,\n getStickyTopRangeWidth,\n getTopStickyOffset,\n getStickyOffset,\n getVisibleSizeOfReactGrid,\n CellEditorOffset,\n} from \"../../core\";\nimport { State } from \"../Model/State\";\nimport { CellMatrix } from \"../Model/CellMatrix\";\n\nconst calculatedXAxisOffset = (location: Location, state: State) => {\n const cellMatrix = state.cellMatrix;\n const offset: number | undefined = getRightStickyOffset(cellMatrix, location, state)\n || getStickyLeftRangeWidth(cellMatrix, location) || getLeftStickyOffset(cellMatrix, location, state);\n if (offset) {\n return offset;\n }\n return 0;\n}\n\nfunction getRightStickyOffset(cellMatrix: CellMatrix, location: Location, state: State): number | undefined {\n if (cellMatrix.ranges.stickyRightRange.first.column && location.column.idx >= cellMatrix.ranges.stickyRightRange.first.column.idx) {\n const { scrollLeft } = getScrollOfScrollableElement(state.scrollableElement);\n const { left } = getReactGridOffsets(state);\n const leftStickyOffset = getStickyOffset(scrollLeft, left);\n const rightStickyOffset = getVisibleSizeOfReactGrid(state).width + leftStickyOffset - cellMatrix.ranges.stickyRightRange.width;\n return rightStickyOffset;\n }\n}\n\nfunction getBottomStickyOffset(cellMatrix: CellMatrix, location: Location, state: State): number | undefined {\n if (cellMatrix.ranges.stickyBottomRange.first.row && location.row.idx >= cellMatrix.ranges.stickyBottomRange.first.row.idx) {\n const { scrollTop } = getScrollOfScrollableElement(state.scrollableElement);\n const { top } = getReactGridOffsets(state);\n const topStickyOffset = getStickyOffset(scrollTop, top);\n const bottomStickyOffset = getVisibleSizeOfReactGrid(state).height + topStickyOffset - cellMatrix.ranges.stickyBottomRange.height;\n return bottomStickyOffset;\n }\n}\n\nconst calculatedYAxisOffset = (location: Location, state: State): number => {\n const cellMatrix = state.cellMatrix;\n const offset: number | undefined = getBottomStickyOffset(cellMatrix, location, state)\n || getStickyTopRangeWidth(cellMatrix, location) || getTopStickyOffset(cellMatrix, location, state);\n if (offset) {\n return offset;\n }\n return 0;\n}\n\nexport const calculateCellEditorPosition = (positionState: PositionState): CellEditorOffset => {\n const { state, location } = positionState;\n const { scrollTop, scrollLeft } = getScrollOfScrollableElement(state.scrollableElement);\n const { top, left } = getReactGridOffsets(state);\n let offsetLeft = 0,\n offsetTop = 0;\n if (state.scrollableElement !== getTopScrollableElement()) {\n const { left, top } = (state.scrollableElement as HTMLElement).getBoundingClientRect();\n offsetLeft = left;\n offsetTop = top;\n }\n\n // React StrictMode calls reducer two times to eliminate any side-effects\n // this function is a reducer so we need to add the state and location to positionState\n // in order to get them in the second call\n return {\n state,\n location,\n left: location.column.left + calculatedXAxisOffset(location, state as State)\n + offsetLeft\n + left\n - scrollLeft,\n top: location.row.top + calculatedYAxisOffset(location, state as State)\n + offsetTop\n + top\n - scrollTop\n };\n}","import React, { createContext, FC } from \"react\";\nimport { State } from \"../Model/State\";\n\nconst StateContext = createContext({} as State);\n\nexport const StateProvider: FC<{ state: State }> = ({ children, state }) => (\n {children}\n);\n\nexport const useReactGridState = (): State => React.useContext(StateContext);\n","import * as React from 'react';\nimport { getReactGridOffsets, getStickyOffset } from '../Functions/elementSizeHelpers';\nimport { getScrollOfScrollableElement, getTopScrollableElement } from '../Functions/scrollHelpers';\nimport { tryAppendChange } from '../Functions/tryAppendChange';\nimport { Location } from '../Model/InternalModel';\nimport { CellMatrix } from '../Model/CellMatrix';\nimport { Compatible, Cell } from '../Model/PublicModel';\nimport { State } from '../Model/State';\nimport { calculateCellEditorPosition } from '../Functions/cellEditorCalculator';\nimport { useReactGridState } from './StateProvider';\n\nexport interface CellEditorOffset {\n top: number;\n left: number;\n state: TState;\n location: Location;\n}\n\ninterface CellEditorProps {\n cellType: string;\n style: React.CSSProperties;\n}\n\nexport interface PositionState {\n state: TState;\n location: Location;\n}\n\nexport const CellEditorRenderer: React.FC = () => {\n const state = useReactGridState();\n const { currentlyEditedCell, focusedLocation: location } = state;\n\n const renders = React.useRef(0);\n\n const [position, dispatch] = React.useReducer(calculateCellEditorPosition as (options: PositionState) => any, {state, location}); // used to lock cell editor position\n\n React.useEffect(() => {\n renders.current += 1;\n dispatch();\n }, []);\n\n if (!currentlyEditedCell || !location || renders.current === 0) { // prevents to unexpectly opening cell editor on cypress\n return null;\n }\n\n const cellTemplate = state.cellTemplates[currentlyEditedCell.type];\n return \n {cellTemplate.render(currentlyEditedCell, true, (cell: Compatible, commit: boolean) => {\n state.currentlyEditedCell = commit ? undefined : cell;\n if (commit) state.update(s => tryAppendChange(s, location, cell));\n })}\n \n};\n\nconst CellEditor: React.FC = ({ style, cellType, children }) => {\n return (\n \n {children}\n \n )\n}\n\nconst calculatedXAxisOffset = (location: Location, state: State) => {\n const cellMatrix = state.cellMatrix;\n const offset: number | undefined = getStickyLeftRangeWidth(cellMatrix, location) || getLeftStickyOffset(cellMatrix, location, state);\n if (offset) {\n return offset;\n }\n return 0;\n}\n\nconst calculatedYAxisOffset = (location: Location, state: State): number => {\n const cellMatrix = state.cellMatrix;\n const offset: number | undefined = getStickyTopRangeWidth(cellMatrix, location) || getTopStickyOffset(cellMatrix, location, state);\n if (offset) {\n return offset;\n }\n return 0;\n}\n\nexport function getStickyLeftRangeWidth(cellMatrix: CellMatrix, location: Location): number | undefined {\n if (location.column.idx > (cellMatrix.ranges.stickyLeftRange.last.column ? cellMatrix.ranges.stickyLeftRange.last.column.idx : cellMatrix.first.column.idx)\n || (location.column.idx === cellMatrix.last.column.idx && location.column.idx !== cellMatrix.ranges.stickyLeftRange.last.column?.idx)\n ) {\n return cellMatrix.ranges.stickyLeftRange.width;\n }\n}\n\nexport function getStickyTopRangeWidth(cellMatrix: CellMatrix, location: Location): number | undefined {\n if (location.row.idx > (cellMatrix.ranges.stickyTopRange.last.row ? cellMatrix.ranges.stickyTopRange.last.row.idx : cellMatrix.first.row.idx)\n || (location.row.idx === cellMatrix.last.row.idx && location.row.idx !== cellMatrix.ranges.stickyTopRange.last.row?.idx)\n ) {\n return cellMatrix.ranges.stickyTopRange.height;\n }\n}\n\nexport function getLeftStickyOffset(cellMatrix: CellMatrix, location: Location, state: State): number | undefined {\n if (cellMatrix.ranges.stickyLeftRange.first.column && location.column.idx >= cellMatrix.ranges.stickyLeftRange.first.column.idx\n && location.column.idx <= cellMatrix.ranges.stickyLeftRange.last.column.idx\n ) {\n const { scrollLeft } = getScrollOfScrollableElement(state.scrollableElement);\n const { left } = getReactGridOffsets(state);\n const leftStickyOffset = getStickyOffset(scrollLeft, left);\n return leftStickyOffset;\n }\n}\n\nexport function getTopStickyOffset(cellMatrix: CellMatrix, location: Location, state: State): number | undefined {\n if (cellMatrix.ranges.stickyTopRange.first.row && location.row.idx >= cellMatrix.ranges.stickyTopRange.first.row.idx\n && location.row.idx <= cellMatrix.ranges.stickyTopRange.last.row.idx\n ) {\n const { scrollTop } = getScrollOfScrollableElement(state.scrollableElement);\n const { top } = getReactGridOffsets(state);\n const topStickyOffset = getStickyOffset(scrollTop, top);\n return topStickyOffset;\n }\n}\n\nexport const cellEditorCalculator = (options: PositionState): CellEditorOffset => {\n const { state, location } = options;\n const { scrollTop, scrollLeft } = getScrollOfScrollableElement(state.scrollableElement);\n const { top, left } = getReactGridOffsets(state);\n let offsetLeft = 0,\n offsetTop = 0;\n if (state.scrollableElement !== getTopScrollableElement()) {\n const { left, top } = (state.scrollableElement as HTMLElement).getBoundingClientRect();\n offsetLeft = left;\n offsetTop = top;\n }\n\n // React StrictMode calls reducer two times to eliminate any side-effects\n // this function is a reducer so we need to add the state and location to positionState\n // in order to get them in the second call\n return {\n state,\n location,\n left: location.column.left + calculatedXAxisOffset(location, state)\n + offsetLeft\n + left\n - scrollLeft,\n top: location.row.top + calculatedYAxisOffset(location, state)\n + offsetTop\n + top\n - scrollTop\n };\n}\n","import * as React from \"react\";\nimport { useReactGridState } from \"./StateProvider\";\ninterface HiddenElementProps {\n hiddenElementRefHandler: (hiddenFocusElement: HTMLInputElement) => void;\n}\n\nexport const HiddenElement: React.FC = ({ hiddenElementRefHandler }) => {\n const { hiddenFocusElement } = useReactGridState();\n return (\n {\n if (!e.relatedTarget) {\n // prevents from losing focus on hidden element on mobile devices\n hiddenFocusElement?.focus({ preventScroll: true });\n }\n }}\n />\n );\n};\n","import React, { Component, ErrorInfo } from 'react';\n\ninterface ErrorBoundaryState {\n error?: Error;\n errorInfo?: React.ErrorInfo;\n hasError: boolean;\n}\n\nexport class ErrorBoundary extends Component, ErrorBoundaryState> {\n\n state: ErrorBoundaryState = {\n hasError: false,\n };\n\n static getDerivedStateFromError(error: ErrorBoundaryState): { hasError: boolean, error: ErrorBoundaryState } {\n return { hasError: true, error };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n this.setState({ errorInfo });\n }\n\n render(): React.ReactNode {\n const { hasError, errorInfo, error } = this.state;\n\n if (hasError) {\n return (<>\n

{error?.message}



\n
\n {error?.stack}\n {errorInfo?.componentStack}\n
\n )\n } else {\n return this.props.children;\n }\n }\n\n}\n","export function isBrowserFirefox(): boolean {\n if (typeof window !== 'undefined') { // condition needed for circle ci compiler\n return navigator.userAgent.includes('Firefox');\n }\n return false;\n}\n","import * as React from 'react';\nimport { GridRendererProps } from '../Model/InternalModel';\nimport { HiddenElement } from './HiddenElement';\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { useReactGridState } from './StateProvider';\nimport { isBrowserFirefox } from '../Functions/firefox';\n\nexport const GridRenderer: React.FC = ({ eventHandlers, children }) => {\n const { cellMatrix, props } = useReactGridState();\n const sharedStyles = {\n width: props?.enableFullWidthHeader ? '100%' : cellMatrix.width,\n height: cellMatrix.height,\n };\n return (\n \n \n \n {children}\n \n \n \n \n );\n};\n","import { TextLabels } from '../Model/PublicModel'\nimport { State } from '../Model/State'\n\nconst defultTranslations: Required = {\n legacyBrowserHeader: 'Please update to a modern browser.',\n legacyBrowserText: 'Your current browser cannot run our content, please make sure you browser is fully updated or try adifferent browser. We highly recommend using the most recent release of Google Chrome, Microsoft Edge, Firefox, Safari, and Opera browser',\n copyLabel: 'Copy',\n cutLabel: 'Cut',\n pasteLabel: 'Paste',\n appleMobileDeviceContextMenuPasteAlert: 'Use ⌘ + c for copy, ⌘ + x for cut and ⌘ + v for paste.',\n otherBrowsersContextMenuPasteAlert: ' Use ctrl + c for copy, ctrl + x for cut and ctrl + v for paste.',\n actionNotSupported: 'This action is not supported in this browser.'\n}\n\nexport function i18n(state: State): Required {\n return {\n ...defultTranslations,\n ...state.props?.labels\n }\n}","import * as React from \"react\";\nimport { i18n } from \"../Functions/i18n\";\nimport { GridRendererProps } from \"../Model/InternalModel\";\nimport { useReactGridState } from \"./StateProvider\";\n\nexport const LegacyBrowserGridRenderer: React.FC = () => {\n const state = useReactGridState();\n return (\n <>\n

{i18n(state).legacyBrowserHeader}

\n

{i18n(state).legacyBrowserText}

\n \n );\n};\n","import { CellStyle } from \"../Model/PublicModel\";\n\nexport const noBorder = ({ border, ...rest }: CellStyle): Omit => rest;\n","export function isMobileDevice(): boolean {\n if (typeof window !== 'undefined') { // condition needed for circle ci compiler\n return (typeof window.orientation !== 'undefined') || (navigator.userAgent.indexOf('IEMobile') !== -1);\n }\n return false;\n}\n","import * as React from 'react';\n\nexport const ResizeHandle: React.FC = () => {\n return (\n
\n
\n
\n );\n};\n","import * as React from 'react';\nimport { areLocationsEqual } from '../Functions/areLocationsEqual';\nimport { noBorder } from '../Functions/excludeObjectProperties';\nimport { getCompatibleCellAndTemplate } from '../Functions/getCompatibleCellAndTemplate';\nimport { tryAppendChange } from '../Functions/tryAppendChange';\nimport { Borders, Location } from '../Model/InternalModel';\nimport { Range } from '../Model/Range';\nimport { BorderProps, Cell, Compatible } from '../Model/PublicModel';\nimport { State } from '../Model/State';\nimport { isMobileDevice } from '../Functions/isMobileDevice';\nimport { ResizeHandle } from './ResizeHandle';\n\nexport interface CellRendererProps {\n state: State;\n location: Location;\n borders: Borders;\n range: Range;\n update: State['update'];\n currentlyEditedCell: State['currentlyEditedCell'];\n children?: React.ReactNode;\n}\n\nexport interface CellRendererChildProps {\n location?: Location;\n cell?: Compatible;\n state?: TState;\n}\n\nconst unset = 'unset';\n\nfunction storeBorderAndCell(borders: Borders, cell: Compatible) {\n return (property: keyof BorderProps, defaultProp: string) => {\n return (borderEdge: keyof Borders) => {\n if (borders[borderEdge]) {\n return cell.style?.border?.[borderEdge]?.[property]\n ? cell.style.border[borderEdge]?.[property]\n : defaultProp;\n } else if (cell.style?.border?.[borderEdge]?.[property]) {\n return cell.style.border[borderEdge]?.[property];\n }\n return unset;\n };\n };\n}\n\nfunction getBorderProperties(getPropertyOnBorderFn: (borderEdge: keyof Borders) => string | undefined) {\n return {\n left: getPropertyOnBorderFn('left'),\n right: getPropertyOnBorderFn('right'),\n top: getPropertyOnBorderFn('top'),\n bottom: getPropertyOnBorderFn('bottom'),\n };\n}\n\nexport const CellRenderer: React.FC = ({\n state,\n location,\n range,\n borders,\n update,\n currentlyEditedCell,\n}) => {\n const { cell, cellTemplate } = getCompatibleCellAndTemplate(state, location);\n const isFocused = state.focusedLocation !== undefined && areLocationsEqual(state.focusedLocation, location);\n const customClass = (cellTemplate.getClassName && cellTemplate.getClassName(cell, false)) ?? '';\n\n const currentlyEditedCellRef = React.useRef(currentlyEditedCell);\n\n const storePropertyAndDefaultValue = storeBorderAndCell(borders, cell);\n const bordersWidth = getBorderProperties(storePropertyAndDefaultValue('width', '1px')),\n bordersStyle = getBorderProperties(storePropertyAndDefaultValue('style', 'solid')),\n bordersColor = getBorderProperties(storePropertyAndDefaultValue('color', '#e8e8e8'));\n\n const bordersProps = {\n borderLeftWidth: bordersWidth.left,\n borderLeftStyle: bordersStyle.left,\n borderLeftColor: bordersColor.left,\n borderRightWidth: bordersWidth.right,\n borderRightStyle: bordersStyle.right,\n borderRightColor: bordersColor.right,\n borderTopWidth: bordersWidth.top,\n borderTopStyle: bordersStyle.top,\n borderTopColor: bordersColor.top,\n borderBottomWidth: bordersWidth.bottom,\n borderBottomStyle: bordersStyle.bottom,\n borderBottomColor: bordersColor.bottom\n };\n\n const isMobile = isMobileDevice();\n const isFirstRowOrColumnWithSelection =\n (state.props?.enableRowSelection && location.row.idx === 0) ||\n (state.props?.enableColumnSelection && location.column.idx === 0);\n const style = {\n ...(cellTemplate.getStyle && (cellTemplate.getStyle(cell, false) || {})),\n ...(cell.style && noBorder(cell.style)),\n left: location.column.left,\n top: location.row.top,\n width: range.width,\n height: range.height,\n ...(!(isFocused && currentlyEditedCellRef.current) && bordersProps),\n ...((isFocused || cell.type === 'header' || isFirstRowOrColumnWithSelection) && { touchAction: 'none' }), // prevent scrolling\n } as React.CSSProperties;\n\n const isInEditMode = isFocused && !!currentlyEditedCellRef.current;\n\n const groupIdClassName = cell.groupId ? ` rg-groupId-${cell.groupId}` : '';\n const nonEditableClassName = cell.nonEditable ? ' rg-cell-nonEditable' : '';\n const cellClassNames =\n isInEditMode && isMobile ? ` rg-celleditor rg-${cell.type}-celleditor` : ` rg-${cell.type}-cell`;\n const classNames = `rg-cell${cellClassNames}${groupIdClassName}${nonEditableClassName} ${customClass}`;\n const cellToRender =\n isFocused && currentlyEditedCellRef.current && isMobile ? currentlyEditedCellRef.current : cell;\n\n const onCellChanged = React.useCallback(\n (cell: Compatible, commit: boolean) => {\n if (isInEditMode) {\n currentlyEditedCellRef.current = commit ? undefined : cell;\n if (commit) update((state) => tryAppendChange(state, location, cell));\n } else {\n if (!commit) throw new Error('commit should be set to true in this case.');\n update((state) => tryAppendChange(state, location, cell));\n }\n },\n [isInEditMode, location, update, currentlyEditedCellRef]\n );\n\n return (\n \n {cellTemplate.render(cellToRender, isMobile ? isInEditMode : false, onCellChanged)}\n {location.row.idx === 0 && location.column.resizable && }\n {state.enableGroupIdRender && cell?.groupId !== undefined && !(isInEditMode && isMobile) && (\n {cell.groupId}\n )}\n
\n );\n};\n","import * as React from 'react';\nimport { translateLocationIdxToLookupKey } from '../Model/CellMatrix';\nimport { Location } from '../Model/InternalModel';\nimport { State } from '../Model/State';\n\n\ninterface FeaturedCellProps {\n location: Location;\n state?: State;\n borderColor?: string;\n className?: string;\n}\n\nexport const CellHighlight: React.FC = ({ borderColor, location, className, state }) => {\n const { idx: colIdx } = location.column;\n const { idx: rowIdx } = location.row;\n const range = state?.cellMatrix.rangesToRender[translateLocationIdxToLookupKey(colIdx, rowIdx)]?.range;\n if (!range) {\n return null;\n }\n return (\n \n );\n}\n\nexport const CellFocus: React.FC = ({ borderColor, location, className }) => {\n return \n}\n\nconst FeaturedCell: React.FC =\n ({ className, location, borderColor, height, width }) => {\n return (\n \n )\n }\n","import * as React from 'react';\nimport { translateLocationIdxToLookupKey } from '../Model/CellMatrix';\nimport { GridRow, GridColumn, Borders, Location } from '../Model/InternalModel';\nimport { State } from '../Model/State';\nimport { CellRendererProps } from './CellRenderer';\n\nexport interface RowRendererProps {\n state: State;\n row: GridRow;\n columns: GridColumn[];\n forceUpdate: boolean;\n borders: Borders;\n cellRenderer: React.FC;\n}\n\nfunction shouldMemoRowRenderer(prevProps: RowRendererProps, nextProps: RowRendererProps): boolean {\n const { columns: prevCols } = prevProps;\n const { columns: nextCols, forceUpdate } = nextProps;\n return !(\n // key for improving rendering speed - eg. chacksum for each col/row/cell\n forceUpdate ||\n nextCols[0].idx !== prevCols[0].idx || nextCols.length !== prevCols.length\n || nextCols[nextCols.length - 1].idx !== prevCols[prevCols.length - 1].idx);\n}\n\nconst MappedColumns: React.FC = ({ columns, row, cellRenderer, borders, state }) => {\n const lastColIdx = columns[columns.length - 1].idx;\n const CellRenderer = cellRenderer;\n return (\n <>\n {columns.map(column => {\n const range = state.cellMatrix.rangesToRender[translateLocationIdxToLookupKey(column.idx, row.idx)]?.range;\n if (!range) {\n return null;\n }\n const location: Location = { row, column };\n return \n })}\n \n );\n};\n\nexport const RowRenderer: React.NamedExoticComponent = React.memo(MappedColumns, shouldMemoRowRenderer);\n\nRowRenderer.displayName = 'RowRenderer';\n","import * as React from 'react';\nimport { PaneContentChild } from '../Model/InternalModel';\n\nexport const FillHandleRangeSelection: React.FC = ({ state, calculatedRange }) => {\n return <>\n {state.currentBehavior.renderPanePart(state, calculatedRange)}\n \n}\n","import React, { useRef, useLayoutEffect, useState } from \"react\";\nimport { Location } from \"../../core\";\nimport { State } from \"../Model/State\";\nimport { FillHandleBehavior } from \"../Behaviors/FillHandleBehavior\";\n\ninterface FillHandleProps {\n state: State;\n location: Location;\n}\n\nexport const FillHandle: React.FC = ({ state, location }) => {\n const targetRef = useRef(null);\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 });\n\n useLayoutEffect(() => {\n if (targetRef.current) {\n setDimensions({\n width: targetRef.current.offsetWidth,\n height: targetRef.current.offsetHeight,\n });\n }\n }, []);\n\n return (\n {\n if (event.pointerType !== \"mouse\") {\n // !== undefined (disabled this event for cypress tests)\n state.update((state) => ({\n ...state,\n currentBehavior: new FillHandleBehavior(),\n }));\n }\n }}\n >\n
\n
\n );\n};\n","import * as React from \"react\";\nimport { PaneContentChild, Range } from \"../../core\";\nimport { CellSelectionBehavior } from \"../Behaviors/CellSelectionBehavior\";\nimport { FillHandle } from \"./FillHandle\";\n\nexport const FillHandleRenderer: React.FC = ({\n state,\n calculatedRange,\n}) => {\n return (\n <>\n {state.selectedRanges[state.activeSelectedRangeIdx] &&\n calculatedRange instanceof Range &&\n calculatedRange.contains(\n state.selectedRanges[state.activeSelectedRangeIdx].last\n ) &&\n state.enableFillHandle &&\n !state.currentlyEditedCell &&\n !(state.currentBehavior instanceof CellSelectionBehavior) && (\n \n )}\n \n );\n};\n","import * as React from \"react\";\nimport { PaneContentChild, Range } from \"../../core\";\nimport { PartialArea } from \"./PartialArea\";\nimport { isRangeIntersects } from \"../Functions/isRangeIntersectsWith\";\n\nexport const SelectedRanges: React.FC = ({\n state,\n calculatedRange,\n}) => {\n return (\n <>\n {state.selectedRanges.map(\n (range: Range, i: number) =>\n !(\n state.focusedLocation &&\n range.contains(state.focusedLocation) &&\n range.columns.length === 1 &&\n range.rows.length === 1\n ) &&\n calculatedRange &&\n isRangeIntersects(calculatedRange, range) && (\n \n )\n )}\n \n );\n};\n","import * as React from 'react';\nimport { Range } from '../Model/Range';\nimport { State } from '../Model/State';\nimport { Borders } from '../Model/InternalModel';\nimport { Highlight } from '../Model/PublicModel';\nimport { CellFocus, CellHighlight } from './CellFocus';\nimport { RowRenderer } from './RowRenderer';\nimport { CellRendererProps } from './CellRenderer';\nimport { isMobileDevice } from '../Functions/isMobileDevice';\nimport { FillHandleRangeSelection } from './FillHandleRangeSelection';\nimport { FillHandleRenderer } from './FillHandleRenderer';\nimport { SelectedRanges } from './SelectedRanges';\n\nexport interface PaneProps {\n renderChildren: boolean;\n style: React.CSSProperties;\n className: string;\n}\n\nexport interface RowsProps {\n state: State;\n range: Range;\n borders: Borders;\n cellRenderer: React.FC;\n}\n\nexport interface PaneContentProps {\n state: TState;\n range: () => Range;\n borders: Borders;\n cellRenderer: React.FC;\n children?: (state: TState, range: Range) => React.ReactNode;\n}\n\nfunction shouldMemoPaneGridContent(prevProps: RowsProps, nextProps: RowsProps): boolean {\n const { state: prevState } = prevProps;\n const { state: nextState } = nextProps;\n if (prevState.focusedLocation && nextState.focusedLocation\n && prevState.currentlyEditedCell === nextState.currentlyEditedCell // used for opening cell editor in cell\n ) {\n if (prevState.focusedLocation.column.columnId !== nextState.focusedLocation.column.columnId\n || prevState.focusedLocation.row.rowId !== nextState.focusedLocation.row.rowId)\n return false;\n } else {\n return false; // needed when select range by touch after first focus\n }\n return !(prevState.visibleRange !== nextState.visibleRange || prevState.cellMatrix.props !== nextState.cellMatrix.props);\n}\n\nexport const PaneGridContent: React.NamedExoticComponent = React.memo(({ range, state, borders, cellRenderer }) => <>\n {range.rows.map(row => \n )}\n, shouldMemoPaneGridContent);\n\nPaneGridContent.displayName = 'PaneGridContent';\n\nfunction renderHighlights(state: State, range: Range) {\n return state.highlightLocations.map((highlight: Highlight, id: number) => {\n try {\n const location = state.cellMatrix.getLocationById(highlight.rowId, highlight.columnId);\n return location && range.contains(location) &&\n ;\n } catch (error) {\n console.error(`Cell location fot found while rendering highlights at: ${(error as Error).message}`);\n return null;\n }\n });\n}\n\nexport const Pane: React.FC = ({ className, style, renderChildren, children }) => {\n if (!style.width || !style.height) {\n return null;\n } else {\n return {renderChildren && children} \n }\n};\n\nexport const PaneContent: React.FC> = (props) => {\n const { state, range, borders, cellRenderer } = props;\n\n const calculatedRange = range();\n\n return (\n <>\n \n {renderHighlights(state, calculatedRange)}\n {state.focusedLocation && !(state.currentlyEditedCell && isMobileDevice()) && calculatedRange.contains(state.focusedLocation) &&\n }\n \n \n \n \n )\n}\n\nconst PaneContentWrapper: React.FC<{ className: string, style: React.CSSProperties }> = props => {\n return
{props.children}
\n}\n","import { State } from '../Model/State';\n\nexport function shouldRenderTopSticky(state: State): boolean {\n return state.cellMatrix.ranges.stickyTopRange.height > 0;\n}\n\nexport function shouldRenderLeftSticky(state: State): boolean {\n return state.cellMatrix.ranges.stickyLeftRange.width > 0;\n}\n\nexport function shouldRenderCenterRange(state: State): boolean {\n return !!(state.visibleRange && state.visibleRange.width > 0); // TODO rewrite without !!\n}\n\nexport function shouldRenderMiddleRange(state: State): boolean {\n return !!(state.cellMatrix.scrollableRange.height > 0 && state.cellMatrix.scrollableRange.first.column &&\n state.cellMatrix.scrollableRange.first.row && state.cellMatrix.scrollableRange.last.row &&\n state.visibleRange && state.visibleRange.height > 0); // TODO rewrite without !!\n}\n\nexport function shouldRenderBottomSticky(state: State): boolean {\n return !!(state.cellMatrix.ranges.stickyBottomRange.height > 0 && state.cellMatrix.rows.length > 0);\n}\n\nexport function shouldRenderRightSticky(state: State): boolean {\n return !!(state.cellMatrix.ranges.stickyRightRange.width > 0);\n}","import * as React from \"react\";\nimport {\n Pane,\n isBrowserFirefox,\n shouldRenderTopSticky,\n shouldRenderMiddleRange,\n shouldRenderLeftSticky,\n shouldRenderCenterRange,\n columnsSlicer,\n rowsSlicer,\n Range,\n PaneContent,\n PaneShadow,\n CellRendererProps,\n} from \"../../core\";\nimport {\n shouldRenderBottomSticky,\n shouldRenderRightSticky,\n} from \"../Functions/paneRendererPredicates\";\nimport { useReactGridState } from \"./StateProvider\";\n\nexport interface PanesProps {\n cellRenderer: React.FC;\n}\n\nexport const PanesRenderer: React.FC = ({ cellRenderer }) => {\n const state = useReactGridState()\n \n const cellMatrix = state.cellMatrix;\n const renderTopSticky = shouldRenderTopSticky(state),\n renderMiddleRange = shouldRenderMiddleRange(state),\n renderLeftSticky = shouldRenderLeftSticky(state),\n renderCenterRange = shouldRenderCenterRange(state),\n renderBottomSticky = shouldRenderBottomSticky(state),\n renderRightSticky = shouldRenderRightSticky(state)\n\n if (!renderTopSticky && !renderMiddleRange && !renderLeftSticky && !renderCenterRange) {\n return null;\n }\n\n let visibleScrollableRange: Range | undefined = undefined;\n const visibleRange = state.visibleRange as Range;\n if (renderMiddleRange) {\n visibleScrollableRange = cellMatrix.scrollableRange.slice(visibleRange, 'rows');\n }\n\n const marginTop = cellMatrix.ranges.stickyTopRange.height ? -cellMatrix.ranges.stickyBottomRange.height : 0;\n const marginLeft = cellMatrix.ranges.stickyLeftRange.width ? -cellMatrix.ranges.stickyRightRange.width : 0;\n const marginRight = cellMatrix.ranges.stickyRightRange.width ? -cellMatrix.ranges.stickyLeftRange.width : 0;\n const marginBottom = cellMatrix.ranges.stickyBottomRange.height ? -cellMatrix.ranges.stickyTopRange.height : 0;\n\n const marginTopOnScrollable = cellMatrix.scrollableRange.rows.length !== 0 ? cellMatrix.ranges.stickyTopRange.height : 0;\n const marginLeftOnScrollable = cellMatrix.scrollableRange.columns.length !== 0 ? cellMatrix.ranges.stickyLeftRange.width : 0;\n const marginBottomOnScrollable = cellMatrix.scrollableRange.rows.length !== 0 ? cellMatrix.ranges.stickyBottomRange.height : 0;\n const marginRightOnScrollable = cellMatrix.scrollableRange.columns.length !== 0 ? cellMatrix.ranges.stickyRightRange.width : 0;\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )\n}","import * as React from 'react';\nimport { isBrowserFirefox } from '../Functions/firefox';\n\ninterface PaneShadowProps {\n renderCondition: boolean;\n className: string;\n style: React.CSSProperties;\n zIndex?: number;\n}\n\nexport const PaneShadow: React.FC = ({ renderCondition, className, style, zIndex, children }) => {\n if (renderCondition) {\n return (\n
\n {children}\n
\n )\n }\n return null;\n}\n","import { GridRow, GridColumn } from \"../../core\";\nimport { State } from \"../Model/State\";\nimport { newLocation } from \"./newLocation\";\n\nexport function updateSelectedRows(state: State): State {\n const firstCol = state.cellMatrix.first.column;\n const lastCol = state.cellMatrix.last.column;\n // TODO this filter is very inefficient for big tables\n const updatedRows = state.cellMatrix.rows\n .filter((r) => state.selectedIds.includes(r.rowId))\n .sort((a, b) => a.idx - b.idx);\n const rows = groupedRows(updatedRows);\n const ranges = rows.map((row) =>\n state.cellMatrix.getRange(\n newLocation(row[0], firstCol),\n newLocation(row[row.length - 1], lastCol)\n )\n );\n let activeSelectedRangeIdx = state.selectedRanges.length - 1;\n\n if (state.focusedLocation) {\n ranges.forEach((range, idx) => {\n range.rows.forEach((row) => {\n if (state.focusedLocation?.row.rowId === row.rowId) {\n activeSelectedRangeIdx = idx;\n }\n });\n });\n }\n\n return {\n ...state,\n selectionMode: \"row\",\n activeSelectedRangeIdx,\n selectedRanges: [...ranges],\n selectedIndexes: updatedRows.map((row) => row.idx),\n selectedIds: updatedRows.map((row) => row.rowId),\n };\n}\n\nexport function updateSelectedColumns(state: State): State {\n const firstRow = state.cellMatrix.first.row;\n const lastRow = state.cellMatrix.last.row;\n // TODO this filter is very inefficient for big tables\n const updatedColumns = state.cellMatrix.columns\n .filter((r) => state.selectedIds.includes(r.columnId))\n .sort((a, b) => a.idx - b.idx);\n const columns = groupedColumns(updatedColumns);\n const ranges = columns.map((arr) =>\n state.cellMatrix.getRange(\n newLocation(firstRow, arr[0]),\n newLocation(lastRow, arr[arr.length - 1])\n )\n );\n let activeSelectedRangeIdx = state.selectedRanges.length - 1;\n\n if (state.focusedLocation) {\n ranges.forEach((range, idx) => {\n range.columns.forEach((col) => {\n if (state.focusedLocation?.column.columnId === col.columnId) {\n activeSelectedRangeIdx = idx;\n }\n });\n });\n }\n\n return {\n ...state,\n selectionMode: \"column\",\n activeSelectedRangeIdx,\n selectedRanges: [...ranges],\n selectedIndexes: updatedColumns.map((col) => col.idx),\n selectedIds: updatedColumns.map((col) => col.columnId),\n };\n}\n\nconst groupedRows = (array: GridRow[]) => {\n const grouped: GridRow[][] = [];\n let sortIndex = 0;\n array.forEach((current: GridRow, index) => {\n if (!array[index - 1]) {\n grouped.push([current]);\n return;\n }\n const prev: GridRow = array[index - 1];\n if (current.idx - prev.idx === 1) {\n if (!grouped[sortIndex]) {\n grouped.push([prev, current]);\n } else {\n grouped[sortIndex].push(current);\n }\n } else {\n grouped.push([current]);\n sortIndex += 1;\n }\n });\n return grouped;\n};\n\nconst groupedColumns = (array: GridColumn[]) => {\n const grouped: GridColumn[][] = [];\n let sortIndex = 0;\n array.forEach((current: GridColumn, index) => {\n if (!array[index - 1]) {\n grouped.push([current]);\n return;\n }\n const prev: GridColumn = array[index - 1];\n if (current.idx - prev.idx === 1) {\n if (!grouped[sortIndex]) {\n grouped.push([prev, current]);\n } else {\n grouped[sortIndex].push(current);\n }\n } else {\n grouped.push([current]);\n sortIndex += 1;\n }\n });\n return grouped;\n};\n","import { State } from '../Model/State';\nimport { ReactGridProps, CellLocation } from '../Model/PublicModel';\nimport { CellMatrixBuilder } from '../Model/CellMatrixBuilder';\nimport { defaultCellTemplates } from './defaultCellTemplates';\nimport { focusLocation } from './focusLocation';\nimport { recalcVisibleRange } from './recalcVisibleRange';\nimport { updateResponsiveSticky } from './updateResponsiveSticky';\nimport { updateSelectedColumns, updateSelectedRows } from './updateState';\nimport { resetSelection } from './selectRange';\n\n// TODO: rewrite without division\nexport function getDerivedStateFromProps(\n props: ReactGridProps,\n state: State\n ): State {\n const stateDeriverWithProps = stateDeriver(props);\n \n const hasHighlightsChanged = highlightsHasChanged(props, state);\n \n if (hasHighlightsChanged) {\n state = stateDeriverWithProps(state)(appendHighlights);\n }\n state = stateDeriverWithProps(state)(updateStateProps);\n \n state = stateDeriverWithProps(state)(appendCellTemplates);\n\n state = stateDeriverWithProps(state)(appendGroupIdRender);\n \n const hasChanged = dataHasChanged(props, state);\n \n state = stateDeriverWithProps(state)(updateResponsiveSticky)\n \n state = stateDeriverWithProps(state)(disableVirtualScrolling)\n \n if (hasChanged) {\n state = stateDeriverWithProps(state)(updateCellMatrix);\n }\n \n state = stateDeriverWithProps(state)(updateSelections);\n \n state = stateDeriverWithProps(state)(updateFocusedLocation);\n \n if (hasChanged) {\n state = stateDeriverWithProps(state)(updateVisibleRange);\n }\n\n state = stateDeriverWithProps(state)(setInitialFocusLocation);\n \n if (areFocusesDiff(props, state)) {\n state = stateDeriverWithProps(state)(setFocusLocation);\n }\n \n state = stateDeriverWithProps(state)(appendStateFields);\n \n return state;\n}\n\nfunction updateSelections(props: ReactGridProps, state: State): State {\n if (state.selectionMode === \"row\" && state.selectedIds.length > 0) {\n state = updateSelectedRows(state);\n } else if (state.selectionMode === \"column\" && state.selectedIds.length > 0) {\n state = updateSelectedColumns(state);\n } else {\n state = {\n ...state,\n selectedRanges: [...state.selectedRanges].map((range) =>\n state.cellMatrix.validateRange(range)\n ),\n };\n }\n return state;\n }\n\nfunction appendStateFields(\n props: ReactGridProps,\n state: State\n ): State {\n return {\n ...state,\n enableFillHandle: !!props.enableFillHandle,\n enableRangeSelection: !!props.enableRangeSelection,\n enableColumnSelection: !!props.enableColumnSelection,\n enableRowSelection: !!props.enableRowSelection,\n };\n }\n \n\nexport const areFocusesDiff = (props: ReactGridProps, state: State): boolean => {\n return props.focusLocation?.columnId !== state.focusedLocation?.column.columnId\n || props.focusLocation?.rowId !== state.focusedLocation?.row.rowId\n || (props.stickyRightColumns !== undefined && props.stickyRightColumns !== state.rightStickyColumns) \n || (props.stickyBottomRows !== undefined && props.stickyBottomRows !== state.bottomStickyRows);\n}\n\nexport const stateDeriver = (props: ReactGridProps) => (state: State) => (fn: (props: ReactGridProps, state: State) => State): State => fn(props, state);\n\nexport const dataHasChanged = (props: ReactGridProps, state: State): boolean => !state.cellMatrix || props !== state.cellMatrix.props\n || (props.stickyLeftColumns !== undefined && props.stickyLeftColumns !== state.leftStickyColumns)\n || (props.stickyTopRows !== undefined && props.stickyTopRows !== state.topStickyRows)\n || (props.stickyBottomRows !== undefined && props.stickyBottomRows !== state.bottomStickyRows)\n || (props.stickyRightColumns !== undefined && props.stickyRightColumns !== state.rightStickyColumns);\n\nexport const highlightsHasChanged = (props: ReactGridProps, state: State): boolean => props.highlights !== state.props?.highlights;\n\nexport function updateStateProps(props: ReactGridProps, state: State): State {\n if (state.props !== props) {\n state = { ...state, props };\n }\n return state;\n}\n\nfunction updateCellMatrix(props: ReactGridProps, state: State): State {\n const builder = new CellMatrixBuilder();\n return {\n ...state,\n cellMatrix: builder\n .setProps(props)\n .fillRowsAndCols({\n leftStickyColumns: state.leftStickyColumns || 0,\n topStickyRows: state.topStickyRows || 0,\n rightStickyColumns: state.rightStickyColumns || 0,\n bottomStickyRows: state.bottomStickyRows || 0,\n })\n .setRangesToRenderLookup()\n .fillSticky({\n leftStickyColumns: state.leftStickyColumns || 0,\n topStickyRows: state.topStickyRows || 0,\n rightStickyColumns: state.rightStickyColumns || 0,\n bottomStickyRows: state.bottomStickyRows || 0,\n })\n .fillScrollableRange({\n leftStickyColumns: state.leftStickyColumns || 0,\n topStickyRows: state.topStickyRows || 0,\n rightStickyColumns: state.rightStickyColumns || 0,\n bottomStickyRows: state.bottomStickyRows || 0,\n })\n .setEdgeLocations()\n .getCellMatrix(),\n };\n}\n\nexport function updateFocusedLocation(props: ReactGridProps, state: State): State {\n if (state.cellMatrix.columns.length > 0 && state.focusedLocation && !state.currentlyEditedCell) {\n state = { ...state, focusedLocation: state.cellMatrix.validateLocation(state.focusedLocation) };\n }\n return state;\n}\n\nfunction updateVisibleRange(props: ReactGridProps, state: State): State {\n if (state.visibleRange) {\n state = recalcVisibleRange(state);\n }\n return state;\n}\n\nexport function appendCellTemplates(props: ReactGridProps, state: State): State {\n return {\n ...state,\n cellTemplates: { ...defaultCellTemplates, ...props.customCellTemplates }\n }\n}\n\nexport function appendGroupIdRender(props: ReactGridProps, state: State): State {\n return {\n ...state,\n enableGroupIdRender: !!props.enableGroupIdRender\n }\n}\n\nfunction disableVirtualScrolling(props: ReactGridProps, state: State): State {\n return {\n ...state,\n disableVirtualScrolling: !!props.disableVirtualScrolling\n }\n}\n\nexport function appendHighlights(props: ReactGridProps, state: State): State {\n const highlights = props.highlights?.filter(highlight => state.cellMatrix.rowIndexLookup[highlight.rowId] !== undefined &&\n state.cellMatrix.columnIndexLookup[highlight.columnId] !== undefined\n );\n if (highlights?.length !== props.highlights?.length) {\n console.error('Data inconsistency in ReactGrid \"highlights\" prop');\n }\n return {\n ...state,\n highlightLocations: highlights || [],\n }\n}\n\nexport function setInitialFocusLocation(props: ReactGridProps, state: State): State {\n const locationToFocus = props.initialFocusLocation;\n const wasFocused = !!state.focusedLocation;\n\n if (locationToFocus && !state.focusedLocation) {\n if (isLocationToFocusCorrect(state, locationToFocus)) {\n console.error('Data inconsistency in ReactGrid \"initialFocusLocation\" prop');\n } else {\n const location = state.cellMatrix.getLocationById(locationToFocus.rowId, locationToFocus.columnId);\n state = focusLocation(state, location);\n }\n }\n\n const location = state.focusedLocation;\n\n if (!wasFocused && location) {\n state = resetSelection(state, location);\n }\n\n return state;\n}\n\nexport function setFocusLocation(props: ReactGridProps, state: State): State {\n const locationToFocus = props.focusLocation;\n const wasFocused = !!state.focusedLocation;\n\n if (locationToFocus) {\n if (isLocationToFocusCorrect(state, locationToFocus)) {\n console.error('Data inconsistency in ReactGrid \"focusLocation\" prop');\n } else {\n const location = state.cellMatrix.getLocationById(locationToFocus.rowId, locationToFocus.columnId);\n state = focusLocation(state, location)\n }\n }\n\n const location = state.focusedLocation;\n\n if (!wasFocused && location && props.focusLocation && state.selectedRanges.length <= 1) {\n state = resetSelection(state, location);\n }\n \n return state;\n}\n\nfunction isLocationToFocusCorrect(state: State, location: CellLocation) {\n return !(state.cellMatrix.columnIndexLookup[location.columnId] !== undefined)\n || !(state.cellMatrix.rowIndexLookup[location.rowId] !== undefined)\n}\n","import { isMacOs } from './operatingSystem';\nimport { PointerEvent, KeyboardEvent } from '../Model/domEventsTypes';\n\nexport function isSelectionKey(event: PointerEvent | KeyboardEvent): boolean {\n return (!isMacOs() && event.ctrlKey) || event.metaKey;\n}","import { Location } from '../Model/InternalModel';\nimport { PointerEvent } from '../Model/domEventsTypes';\nimport { State } from '../Model/State';\nimport { areLocationsEqual } from './areLocationsEqual';\nimport { getCompatibleCellAndTemplate } from './getCompatibleCellAndTemplate';\nimport { isSelectionKey } from './isSelectionKey';\n\nexport function handleDoubleClick(event: PointerEvent, location: Location, state: State): State {\n if (areLocationsEqual(location, state.focusedLocation)) {\n const { cell, cellTemplate } = getCompatibleCellAndTemplate(state, location);\n if (cellTemplate.handleKeyDown) {\n const { cell: newCell, enableEditMode } = cellTemplate.handleKeyDown(cell, 1, isSelectionKey(event), event.shiftKey, event.altKey, \"DoubleClick\");\n if (enableEditMode && !cell.nonEditable) {\n return { ...state, currentlyEditedCell: newCell };\n }\n }\n }\n return state;\n}","import { KeyboardEvent } from '../Model/domEventsTypes';\nimport { State } from '../Model/State';\nimport { keyCodes } from './keyCodes';\n\nexport function handleKeyUp(event: KeyboardEvent, state: State): State {\n if (event.keyCode === keyCodes.TAB || event.keyCode === keyCodes.ENTER) {\n event.preventDefault();\n event.stopPropagation();\n }\n return state;\n}","import { KeyboardEvent } from '../Model/domEventsTypes';\nimport { State } from '../Model/State';\nimport { getCompatibleCellAndTemplate } from './getCompatibleCellAndTemplate';\nimport { tryAppendChange } from './tryAppendChange';\n\nexport function handleCompositionEndOnCellTemplate(state: State, event: CompositionEvent): State {\n const { focusedLocation: location } = state;\n if (!location) {\n return state;\n }\n const { cell, cellTemplate } = getCompatibleCellAndTemplate(state, location);\n if (cellTemplate.handleCompositionEnd && !state.currentlyEditedCell) { // TODO need add !(event.shiftKey && event.keyCode === keyCodes.SPACE) to working keycodes (shift + space) in a lower condition\n const { cell: newCell, enableEditMode } = cellTemplate.handleCompositionEnd(cell, event.data);\n if (JSON.stringify(newCell) !== JSON.stringify(cell) || enableEditMode) {\n if (enableEditMode && !cell.nonEditable) {\n return { ...state, currentlyEditedCell: newCell }\n } else {\n return tryAppendChange(state, location, newCell);\n }\n }\n }\n return state;\n}\n","import { KeyboardEvent } from '../Model/domEventsTypes';\nimport { State } from '../Model/State';\nimport { handleCompositionEndOnCellTemplate } from \"./handleCompositionEndOnCellTemplate\";\n\n\nexport function handleCompositionEnd(event: CompositionEvent, state: State): State {\n const newState = handleCompositionEndOnCellTemplate(state, event);\n if (newState !== state) {\n event.stopPropagation();\n event.preventDefault();\n }\n return newState;\n}","import { KeyboardEvent } from '../Model/domEventsTypes';\nimport { State } from '../Model/State';\nimport { getCompatibleCellAndTemplate } from './getCompatibleCellAndTemplate';\nimport { isSelectionKey } from './isSelectionKey';\nimport { tryAppendChange } from './tryAppendChange';\n\nexport function handleKeyDownOnCellTemplate(state: State, event: KeyboardEvent): State {\n const { focusedLocation: location } = state;\n if (!location) {\n return state;\n }\n const { cell, cellTemplate } = getCompatibleCellAndTemplate(state, location);\n if (cellTemplate.handleKeyDown && !state.currentlyEditedCell) { // TODO need add !(event.shiftKey && event.keyCode === keyCodes.SPACE) to working keycodes (shift + space) in a lower condition\n const { cell: newCell, enableEditMode } = cellTemplate.handleKeyDown(cell, event.keyCode, isSelectionKey(event), event.shiftKey, event.altKey, event.key, event.getModifierState(\"CapsLock\"));\n if (JSON.stringify(newCell) !== JSON.stringify(cell) || enableEditMode) {\n if (enableEditMode && !cell.nonEditable) {\n return { ...state, currentlyEditedCell: newCell }\n } else {\n return tryAppendChange(state, location, newCell);\n }\n }\n }\n return state;\n}\n","import { SliceDirection, Range } from '../Model/Range';\n\n\nconst rangeSlicer = (direction: SliceDirection) => (range: Range) => (rangeToSlice: Range) => (): Range => range.slice(rangeToSlice, direction);\n\nexport const columnsSlicer = rangeSlicer('columns');\nexport const rowsSlicer = rangeSlicer('rows');","import { ReactGridProps } from '../Model/PublicModel';\nimport { State } from '../Model/State';\n\n\nexport function handleStateUpdate(newState: TState, state: TState, props: ReactGridProps, setState: (state: TState) => void): void {\n const changes = [...newState.queuedCellChanges];\n if (changes.length > 0) {\n if (props.onCellsChanged) {\n props.onCellsChanged([...changes]);\n }\n changes.forEach(() => newState.queuedCellChanges.pop());\n }\n if (newState !== state) {\n setState(newState);\n }\n}\n","import { State } from '../Model/State';\nimport { PointerEvent } from '../Model/domEventsTypes';\n\nexport function isOnClickableArea(event: PointerEvent, state: State): boolean {\n if (!state.reactGridElement) {\n throw new Error(`\"state.reactGridElement\" field should be initiated before calling the \"getBoundingClientRect()\"`);\n }\n const { left, right } = state.reactGridElement.getBoundingClientRect();\n const scrollableContentX = event.clientX - left;\n const rightPaneWidth = state.cellMatrix.ranges.stickyRightRange.width;\n if (scrollableContentX >= state.cellMatrix.width - rightPaneWidth && !(event.clientX >= right - rightPaneWidth)) {\n return false;\n }\n return true;\n}\n","import { PointerEvent } from './domEventsTypes';\nimport { getLocationFromClient } from '../Functions/getLocationFromClient';\nimport { AbstractPointerEventsController, isReadyToHandleEvent } from './AbstractPointerEventsController';\nimport { State } from './State';\nimport { DefaultBehavior } from '../Behaviors/DefaultBehavior';\nimport { Behavior } from './Behavior';\nimport { ResizeColumnBehavior } from '../Behaviors/ResizeColumnBehavior';\nimport { ColumnReorderBehavior } from '../Behaviors/ColumnReorderBehavior';\nimport { isOnClickableArea } from '../Functions/isOnClickableArea';\nimport { scrollCalculator } from '../Functions/componentDidUpdate';\nimport { scrollIntoView } from '../Functions/scrollIntoView';\nimport { areLocationsEqual } from '../Functions/areLocationsEqual';\n\n\nexport class PointerEventsController extends AbstractPointerEventsController {\n // private isPointerDown?: boolean;\n private isFromLeftToRightScroll?: boolean;\n private isFromRightToLeftScroll?: boolean;\n private isInLeftSticky?: boolean;\n private isInRightSticky?: boolean;\n private isFromTopToBottomScroll?: boolean;\n private isInTopSticky?: boolean;\n private isFromBottomToTopScroll?: boolean;\n private isInBottomSticky?: boolean;\n \n // TODO Handle PointerCancel\n // TODO use State, make generic AbstractPointerEventsController\n public handlePointerDown = (event: PointerEvent, state: State): State => {\n this.isInLeftSticky = false;\n this.isInRightSticky = false;\n this.isInTopSticky = false;\n this.isInBottomSticky = false;\n const onClickableAreaOnPro = isOnClickableArea(\n event,\n state as State\n );\n if (state.props?.onContextMenu && onClickableAreaOnPro) {\n window.addEventListener(\"contextmenu\", this.handleContextMenu, true);\n }\n if (!onClickableAreaOnPro) {\n return {\n ...state,\n contextMenuPosition: { top: -1, left: -1 },\n } as State;\n }\n if (!isReadyToHandleEvent(event)) {\n return state;\n }\n \n window.addEventListener(\"pointermove\", this.handlePointerMove);\n window.addEventListener(\"pointerup\", this.handlePointerUp);\n const currentLocation = getLocationFromClient(\n state as State,\n event.clientX,\n event.clientY\n );\n return this.handlePointerDownInternal(event, currentLocation, state);\n };\n \n private handleHideContextMenu = (event: PointerEvent): void => {\n window.removeEventListener(\"pointerdown\", this.handleHideContextMenu);\n this.updateState((state) => {\n if (event instanceof MouseEvent && this.isContainElement(event, state)) {\n return state;\n }\n return {\n ...state,\n contextMenuPosition: { top: -1, left: -1 },\n } as State;\n });\n };\n \n private isContainElement = (event: PointerEvent | MouseEvent, state: State) =>\n state.reactGridElement?.contains(event.target as Element);\n \n private handleContextMenu = (event: PointerEvent | MouseEvent): void => {\n window.removeEventListener(\"pointerup\", this.handlePointerUp);\n window.removeEventListener(\"pointermove\", this.handlePointerMove);\n window.removeEventListener(\"contextmenu\", this.handleContextMenu, true);\n window.addEventListener(\"pointerdown\", this.handleHideContextMenu);\n this.updateState((state) => {\n if (this.isContainElement(event, state)) {\n const currentLocation = getLocationFromClient(\n state as State,\n event.clientX,\n event.clientY\n );\n if (currentLocation.row?.rowId === 'header') {\n return state;\n }\n state = (state.currentBehavior as Behavior).handlePointerUp(\n event,\n currentLocation,\n state\n );\n state = (state.currentBehavior as Behavior).handleContextMenu(\n event,\n state as State\n );\n state.hiddenFocusElement?.focus();\n }\n return state;\n });\n };\n \n private handlePointerMove = (event: PointerEvent): void => {\n this.updateState((state) => {\n const autoScrollDirection = (state.currentBehavior as Behavior)\n .autoScrollDirection;\n const stickyLocation = getLocationFromClient(\n state as State,\n event.clientX,\n event.clientY,\n undefined\n );\n const underStickyLocation = getLocationFromClient(\n state as State,\n event.clientX,\n event.clientY,\n autoScrollDirection\n );\n let currentLocation = underStickyLocation;\n if (\n stickyLocation.column.idx < currentLocation.column.idx &&\n !this.isFromLeftToRightScroll &&\n !this.isInLeftSticky\n ) {\n currentLocation = stickyLocation;\n } else if (\n stickyLocation.column.idx > currentLocation.column.idx &&\n !this.isFromRightToLeftScroll &&\n !this.isInRightSticky\n ) {\n this.isFromRightToLeftScroll = false;\n currentLocation = stickyLocation;\n } else if (\n stickyLocation.row.idx < currentLocation.row.idx &&\n !this.isFromTopToBottomScroll &&\n !this.isInTopSticky\n ) {\n this.isFromTopToBottomScroll = false;\n currentLocation = stickyLocation;\n } else if (\n stickyLocation.row.idx > currentLocation.row.idx &&\n !this.isFromBottomToTopScroll &&\n !this.isInBottomSticky\n ) {\n this.isFromBottomToTopScroll = false;\n currentLocation = stickyLocation;\n } else {\n this.isInLeftSticky = true;\n this.isInRightSticky = true;\n this.isInTopSticky = true;\n this.isInBottomSticky = true;\n }\n if (\n ((event.target as HTMLDivElement).className !== \"reactgrid-content\" &&\n !(state.currentBehavior instanceof ResizeColumnBehavior) &&\n state.props?.enableRangeSelection) ||\n state.currentBehavior instanceof ColumnReorderBehavior\n ) {\n const { left, top } = scrollCalculator(\n state as State,\n currentLocation\n );\n scrollIntoView(state, top, left); // TODO Make PRO\n }\n state = (state.currentBehavior as Behavior).handlePointerMove(\n event,\n currentLocation,\n state as State\n );\n const previousLocation = this.eventLocations[this.currentIndex];\n this.eventLocations[this.currentIndex] = currentLocation;\n if (!areLocationsEqual(currentLocation, previousLocation)) {\n state = (state.currentBehavior as Behavior).handlePointerEnter(\n event,\n currentLocation,\n state as State\n );\n }\n return state;\n });\n };\n \n private handlePointerUp = (event: PointerEvent): void => {\n if (event.button !== 0 && event.button !== undefined) return;\n window.removeEventListener(\"pointerup\", this.handlePointerUp);\n window.removeEventListener(\"pointermove\", this.handlePointerMove);\n window.removeEventListener(\"contextmenu\", this.handleContextMenu, true);\n this.updateState((state) => {\n const currentLocation = getLocationFromClient(\n state as State,\n event.clientX,\n event.clientY\n );\n const currentTimestamp = new Date().valueOf();\n const secondLastTimestamp = this.eventTimestamps[1 - this.currentIndex];\n state = state.currentBehavior.handlePointerUp(\n event,\n currentLocation,\n state\n );\n if (\n this.shouldHandleCellSelectionOnMobile(\n event,\n currentLocation,\n currentTimestamp\n )\n ) {\n state = state.currentBehavior.handlePointerDown(\n event,\n currentLocation,\n state\n );\n }\n state = { ...state, currentBehavior: new DefaultBehavior() };\n if (\n this.shouldHandleDoubleClick(\n currentLocation,\n currentTimestamp,\n secondLastTimestamp\n )\n ) {\n state = state.currentBehavior.handleDoubleClick(\n event,\n currentLocation,\n state\n );\n }\n state.hiddenFocusElement?.focus();\n\n return state;\n });\n };\n }","import * as React from \"react\";\nimport { useReactGridState } from \"./StateProvider\";\n\nexport const Line: React.FC = () => {\n const { linePosition, lineOrientation, cellMatrix } = useReactGridState();\n\n const isVertical = lineOrientation === \"vertical\";\n\n const lineStyles = Object.assign(\n {},\n isVertical\n ? { left: linePosition, height: cellMatrix.height }\n : { top: linePosition, width: cellMatrix.width }\n );\n\n if (linePosition === -1) return null;\n\n return (\n \n );\n};\n","import React from \"react\";\nimport { useReactGridState } from \"./StateProvider\";\n\nexport const Shadow: React.FC = () => {\n const {\n lineOrientation,\n shadowSize,\n shadowPosition,\n shadowCursor,\n cellMatrix,\n } = useReactGridState();\n\n const isVertical = lineOrientation === \"vertical\";\n\n if (shadowPosition === -1) return null;\n\n return (\n \n );\n};\n","import { State } from '../Model/State';\nimport { getActiveSelectedRange } from './getActiveSelectedRange';\nimport { getDataToCopy } from './getDataToCopy';\n\nexport function copySelectedRangeToClipboard(state: State, removeValues = false): void {\n const activeSelectedRange = getActiveSelectedRange(state);\n if (!activeSelectedRange) {\n return;\n }\n const { div } = getDataToCopy(state, activeSelectedRange, removeValues);\n document.body.appendChild(div);\n div.focus();\n document.execCommand('selectAll', false, undefined);\n document.execCommand('copy');\n document.body.removeChild(div);\n state.hiddenFocusElement?.focus();\n}\n","import { State } from \"../Model/State\";\nimport { CellLocation } from \"../../core\";\n\n// TODO: simplify/optimize if possible\nexport function getSelectedLocations(state: State): Array {\n return state.selectedRanges.map((selectedRange) => {\n return selectedRange.rows.flatMap((row) => {\n return selectedRange.columns.map((col) => ({\n columnId: col.columnId,\n rowId: row.rowId,\n }));\n });\n });\n}\n","import { Cell, Compatible } from \"../Model/PublicModel\";\nimport { parseLocaleNumber } from \"./parseLocaleNumber\";\n\nasync function getCellsFromClipboardPlainText(): Promise[][]> {\n const text = await navigator.clipboard.readText().catch(() => {\n throw new Error(\"Failed to read textual data from clipboard!\");\n });\n\n return text.split(\"\\n\").map((line) =>\n line.split(\"\\t\").map((textValue) => ({\n type: \"text\",\n text: textValue,\n value: parseLocaleNumber(textValue),\n }))\n );\n}\n\nasync function getDocumentFromHTMLClipboardItem(HTMLItem: ClipboardItem): Promise {\n const HTMLBlob = await HTMLItem.getType(\"text/html\").catch(() => {\n throw new Error(\"Failed to get HTML Blob data from clipboard!\");\n });\n const HTMLString = await HTMLBlob.text().catch(() => {\n throw new Error(\"Failed to parse HTML Blob to text!\");\n });\n\n try {\n const document = new DOMParser().parseFromString(HTMLString, \"text/html\");\n\n return document;\n } catch (e) {\n throw new Error(\"Failed to parse HTML string to DOM!\");\n }\n}\n\nasync function getCellsFromDocumentBody(documentBody: HTMLElement): Promise[][]> {\n const pastedRows: Compatible[][] = [];\n\n if (!documentBody.firstElementChild?.firstElementChild) {\n return await getCellsFromClipboardPlainText();\n }\n\n const tableRows = documentBody.firstElementChild.firstElementChild.children;\n\n for (let rowIdx = 0; rowIdx < tableRows.length; rowIdx++) {\n const row: Compatible[] = [];\n\n for (let colIdx = 0; colIdx < tableRows[rowIdx].children.length; colIdx++) {\n const rawData = tableRows[rowIdx].children[colIdx].getAttribute(\"data-reactgrid\");\n const data = rawData && JSON.parse(rawData);\n const text = tableRows[rowIdx].children[colIdx].textContent ?? \"\";\n\n row.push(data ? data : { type: \"text\", text, value: parseLocaleNumber(text) });\n }\n\n pastedRows.push(row);\n }\n\n return pastedRows;\n}\n\nexport default async (): Promise[][]> => {\n const clipboardItems = await navigator.clipboard.read();\n\n // TODO: Support multiple clipboard items\n // Find the first clipboard item that has HTML data\n const HTMLItem = clipboardItems.find((item) => item.types.includes(\"text/html\"));\n\n // If the clipboard item with HTML data is found, try to parse it...\n const document = HTMLItem ? await getDocumentFromHTMLClipboardItem(HTMLItem) : null;\n const hasReactGridContent = document?.body.firstElementChild?.getAttribute(\"data-reactgrid\") === \"reactgrid-content\";\n\n // If the parsed document has ReactGrid content, get the cells from the document body\n if (hasReactGridContent) {\n return getCellsFromDocumentBody(document.body);\n }\n\n // ...otherwise, get the cells from the clipboard's textual data\n return await getCellsFromClipboardPlainText();\n};\n","import * as React from \"react\";\nimport { State } from \"../Model/State\";\nimport {\n MenuOption,\n isBrowserFirefox,\n i18n,\n isIOS,\n isIpadOS,\n getCompatibleCellAndTemplate,\n isMacOs,\n Compatible,\n Cell,\n} from \"../../core\";\nimport { copySelectedRangeToClipboard } from \"../Functions/copySelectedRangeToClipboard\";\nimport { pasteData } from \"../Functions/pasteData\";\nimport { getActiveSelectedRange } from \"../Functions/getActiveSelectedRange\";\nimport { getSelectedLocations } from \"../Functions/getSelectedLocations\";\nimport { useReactGridState } from \"./StateProvider\";\nimport getRowsFromClipboard from \"../Functions/getRowsFromClipboard\";\n\nexport const ContextMenu: React.FC = () => {\n const contextMenuElRef = React.useRef(null);\n const state = useReactGridState();\n const { contextMenuPosition, selectedIds, selectionMode } = state;\n\n const clickPositionX = contextMenuPosition.left;\n const clickPositionY = contextMenuPosition.top;\n\n if (clickPositionY !== -1 && clickPositionX !== -1 && contextMenuElRef.current) {\n const screenWidth = window.innerWidth;\n const screenHeight = window.innerHeight;\n const menuWidth = contextMenuElRef.current.offsetWidth;\n const menuHeight = contextMenuElRef.current.offsetHeight;\n const SAFETY_OFFSET = 20;\n\n // Check to see if it's near the bottom\n if (screenHeight - clickPositionY < menuHeight) {\n contextMenuPosition.top = screenHeight - menuHeight - SAFETY_OFFSET;\n } else {\n contextMenuPosition.top = clickPositionY;\n }\n\n // Check to see if it's close to the right\n if (screenWidth - clickPositionX < menuWidth) {\n contextMenuPosition.left = screenWidth - menuWidth - SAFETY_OFFSET;\n } else {\n contextMenuPosition.left = clickPositionX;\n }\n }\n\n let contextMenuOptions = customContextMenuOptions(state);\n\n const onContextMenu = (menuOptions: MenuOption[]) =>\n state.props?.onContextMenu?.(\n state.selectionMode === \"row\" ? state.selectedIds : [],\n state.selectionMode === \"column\" ? state.selectedIds : [],\n state.selectionMode,\n menuOptions,\n getSelectedLocations(state)\n ) ?? [];\n\n const options = onContextMenu(contextMenuOptions);\n\n if (options.length >= 0) contextMenuOptions = options;\n\n return (\n \n {contextMenuOptions.map(({ handler, id, label }, idx) => (\n e.stopPropagation()}\n onClick={() => {\n handler(\n selectionMode === \"row\" ? selectedIds : [],\n selectionMode === \"column\" ? selectedIds : [],\n selectionMode,\n getSelectedLocations(state)\n );\n state.update((state) => ({\n ...state,\n contextMenuPosition: { top: -1, left: -1 },\n ...((id === \"copy\" || id === \"cut\") && {\n copyRange: getActiveSelectedRange(state as State),\n }),\n }));\n }}\n >\n {label}\n \n ))}\n \n );\n};\n\nfunction customContextMenuOptions(state: State): MenuOption[] {\n const { copyLabel, cutLabel, pasteLabel } = i18n(state);\n return [\n {\n id: \"copy\",\n label: copyLabel,\n handler: () => handleContextMenuCopy(state, false),\n },\n {\n id: \"cut\",\n label: cutLabel,\n handler: () => handleContextMenuCopy(state, true),\n },\n {\n id: \"paste\",\n label: pasteLabel,\n handler: () => handleContextMenuPaste(state),\n },\n ];\n}\n\nfunction handleContextMenuCopy(state: State, removeValues = false): void {\n copySelectedRangeToClipboard(state, removeValues);\n}\n\nfunction handleContextMenuPaste(state: State) {\n const isAppleMobileDevice = isIOS() || isIpadOS();\n if (isBrowserFirefox() || isAppleMobileDevice) {\n const { appleMobileDeviceContextMenuPasteAlert, otherBrowsersContextMenuPasteAlert, actionNotSupported } =\n i18n(state);\n alert(\n `${actionNotSupported} ${\n isAppleMobileDevice ? appleMobileDeviceContextMenuPasteAlert : otherBrowsersContextMenuPasteAlert\n }`\n );\n } else {\n // ? This works only in Chrome, and other browsers that fully support Clipboard API\n getRowsFromClipboard().then((rows) => {\n state.update((state) => pasteData(state as State, rows));\n });\n }\n}","import * as React from \"react\";\nimport { CellRenderer, ReactGridProps } from \"../../core\";\nimport {\n GridRenderer,\n LegacyBrowserGridRenderer,\n StateModifier,\n CellEditorRenderer,\n handleStateUpdate,\n focusLocation,\n getLocationFromClient,\n} from \"../../core\";\nimport { PointerEventsController } from \"../Model/PointerEventsController\";\nimport { EventHandlers } from \"../Model/EventHandlers\";\nimport { getDerivedStateFromProps } from \"../Functions/getDerivedStateFromProps\";\nimport { PanesRenderer } from \"./PanesRenderer\";\nimport { DefaultBehavior } from \"../Behaviors/DefaultBehavior\";\nimport { CellMatrixBuilder } from \"../Model/CellMatrixBuilder\";\nimport { defaultStateFields, State } from \"../Model/State\";\nimport { Line } from \"./Line\";\nimport { Shadow } from \"./Shadow\";\nimport { ContextMenu } from \"./ContextMenu\";\nimport { componentDidUpdate } from \"../Functions/componentDidUpdate\";\nimport { StateProvider } from \"./StateProvider\";\n\nexport class ReactGrid extends React.Component {\n private updateState = (state: State) => this.setState(state);\n private stateUpdater = (modifier: StateModifier) =>\n handleStateUpdate(\n modifier(this.state) as State,\n this.state,\n this.props,\n this.updateState\n );\n private pointerEventsController = new PointerEventsController(\n this.stateUpdater\n );\n private eventHandlers = new EventHandlers(\n this.stateUpdater,\n this.pointerEventsController\n );\n private cellMatrixBuilder = new CellMatrixBuilder();\n state: State = {\n update: this.stateUpdater,\n ...defaultStateFields,\n currentBehavior: new DefaultBehavior(),\n cellMatrix: this.cellMatrixBuilder\n .setProps(this.props)\n .fillRowsAndCols()\n .setRangesToRenderLookup()\n .fillSticky()\n .fillScrollableRange()\n .setEdgeLocations()\n .getCellMatrix(),\n };\n\n static getDerivedStateFromProps(\n props: ReactGridProps,\n state: State\n ): State | null {\n try {\n return getDerivedStateFromProps(props, state);\n } catch (error) {\n console.error(error);\n return null;\n }\n }\n\n public clearSelections = (): void => {\n this.setState((prevState) => {\n if (\n prevState.selectedIds.length === 0 &&\n prevState.selectedIndexes.length === 0 &&\n prevState.selectedRanges.length === 0\n ) {\n return null;\n }\n return {\n selectedIds: [],\n selectedIndexes: [],\n selectedRanges: [],\n };\n });\n };\n\n public focusOnCell = (e: PointerEvent) => {\n const focusedLocation = getLocationFromClient(\n this.state,\n e.clientX,\n e.clientY,\n );\n const newState = focusLocation(this.state, focusedLocation);\n this.setState(newState);\n };\n \n componentDidUpdate(prevProps: ReactGridProps, prevState: State): void {\n if (!prevState.reactGridElement && this.state.reactGridElement) {\n this.state.scrollableElement?.addEventListener(\n \"scroll\",\n this.eventHandlers.scrollHandler\n );\n }\n componentDidUpdate(prevProps, prevState, this.state);\n }\n\n componentDidMount(): void {\n window.addEventListener(\"resize\", this.eventHandlers.windowResizeHandler);\n }\n\n componentWillUnmount(): void {\n window.removeEventListener(\n \"resize\",\n this.eventHandlers.windowResizeHandler\n );\n this.state.scrollableElement?.removeEventListener(\n \"scroll\",\n this.eventHandlers.scrollHandler\n );\n this.setState({\n contextMenuPosition: { top: -1, left: -1 }\n });\n }\n\n render(): React.ReactNode {\n const { state, eventHandlers } = this;\n\n if (state.legacyBrowserMode) {\n return (\n \n \n \n );\n }\n\n return (\n \n \n \n\n \n\n \n\n \n\n {state.currentlyEditedCell && }\n \n \n );\n }\n}\n","export const HEADER_HEIGHT = 40;\nexport const ROW_HEIGHT = 56;\nexport const MAX_ALLOWED_DECIMALS = 8;\n\nexport const ROW_STATES = {\n CLEAN: 'clean',\n ISSUES: 'issues',\n};\n\nexport const FILTER_ITEMS = [\n {\n key: 'all',\n value: 'all',\n label: 'All',\n },\n {\n key: ROW_STATES.CLEAN,\n value: ROW_STATES.CLEAN,\n label: 'Clean',\n },\n {\n key: ROW_STATES.ISSUES,\n value: ROW_STATES.ISSUES,\n label: 'Issues',\n },\n];\n\nexport const DEFAULT_FILTER_VALUES = {\n searchText: '',\n state: FILTER_ITEMS[0].value,\n isFilterApplied: false,\n};\n\nexport const MULTI_SELECT_SEPARATOR = ', ';\n","import { formatValue } from 'react-currency-input-field';\nimport {\n GridColumnType,\n GridRowType,\n GridRowValue,\n RowOptions,\n GridSelectOptionType,\n} from './types';\nimport { StringOrNumber } from '../../../types';\nimport { validateColumn } from './utils';\nimport { formatNumberWithPrecision, getCurrencySign } from '../../utils/number';\nimport { MAX_ALLOWED_DECIMALS, MULTI_SELECT_SEPARATOR } from './constants';\nimport { formatDateInMDY, isInvalidDate } from '../../utils/date';\n\nexport const getPastedDate = (text: string, value: Date | string | number) => {\n let date: Date | undefined;\n if (text !== '' && !Number.isNaN(text)) {\n date = new Date(text);\n } else if (value !== '' && !Number.isNaN(value)) {\n date = new Date(value);\n }\n\n if (date && date instanceof Date && !isInvalidDate(date)) {\n return date;\n }\n return undefined;\n};\n\nexport const sanitizeValue = (value: any) => {\n if (typeof value === 'string') {\n return value?.replace(/[\\n\\r\\t]+/g, ' ')?.trim();\n }\n return value;\n};\n\nexport const getDropdownSelectedOption = (\n value: string | number,\n items: GridSelectOptionType[],\n) => {\n const lowerCellValue = sanitizeValue(value)?.toLowerCase();\n\n return items.find(\n (item) =>\n item.label.toString().toLowerCase() === lowerCellValue ||\n String(item.value).toLowerCase() === lowerCellValue,\n );\n};\n\nexport const getMultiSelectSelectedOptions = (\n value: string,\n items: GridSelectOptionType[],\n) => {\n const lowerCellValues: string[] =\n sanitizeValue(value)\n ?.toLowerCase()\n ?.split(MULTI_SELECT_SEPARATOR) || [];\n\n return lowerCellValues\n .map((lowerCellValue: string) =>\n items.find(\n (item) =>\n item.label.toString().toLowerCase() === lowerCellValue ||\n String(item.value).toLowerCase() === lowerCellValue,\n ),\n )\n .filter((x) => !!x);\n};\n\nexport const getDropdownText = (value: string | number, cell: any) =>\n getDropdownSelectedOption(value, cell.values)?.label;\n\nexport const getMultiSelectText = (ids: string[], cell: any) =>\n ids?.length\n ? cell.values\n .filter((item: GridSelectOptionType) => ids.includes(item.value))\n .map((item: GridSelectOptionType) => item.label)\n .join(MULTI_SELECT_SEPARATOR)\n : '';\n\nexport const getDateText = (date: Date | undefined) => {\n const value = date?.getTime();\n return Number.isNaN(value) || !value ? '' : formatDateInMDY(date);\n};\n\nexport const getNumberText = (value: number | undefined, cell: any) =>\n Number.isNaN(value) ||\n (cell.hideZero && value === 0) ||\n value === undefined ||\n (!value && value !== 0)\n ? ''\n : `${cell.prefix || ''}${formatNumberWithPrecision(\n value,\n cell.decimalsLimit ?? MAX_ALLOWED_DECIMALS,\n )}${cell.suffix || ''}`;\n\nexport const getMoneyText = (value: number | undefined, cell: any) => {\n const currencySign = cell.currency ? getCurrencySign(cell.currency) : '';\n return Number.isNaN(value) ||\n (cell.hideZero && value === 0) ||\n value === undefined ||\n (!value && value !== 0)\n ? ''\n : formatValue({\n value: Number(value).toString(),\n groupSeparator: ',',\n decimalSeparator: '.',\n prefix: currencySign,\n });\n};\n\nconst getValidCellProps = (\n column: GridColumnType,\n row: any,\n val: string | number | string[],\n rowOptions?: RowOptions,\n) => {\n const { isDirtyRow } = rowOptions;\n if (isDirtyRow && column?.validators?.length) {\n const errorMessage = validateColumn(column?.validators, val, row);\n return {\n isInvalidCell: typeof errorMessage === 'string',\n errorMessage,\n };\n }\n\n return {\n isInvalidCell: false,\n errorMessage: '',\n };\n};\n\nconst getRowNumberCell = (column: GridColumnType, rowOptions: RowOptions) => ({\n type: 'nonEditable',\n text: `${rowOptions.rowIndex + 1}`,\n className: `${column.className} rg-rowNumber-cell`,\n});\n\nconst getRowActionCell = (\n column: GridColumnType,\n row: GridRowType,\n rowOptions: RowOptions,\n) => {\n const { rowId, getRowActionMenuItems, isDirtyRow, rowIndex } = rowOptions;\n\n return {\n type: 'rowAction',\n columnId: column.key,\n rowId,\n actionMenuItems: getRowActionMenuItems(row, {\n rowId,\n isDirtyRow,\n rowIndex,\n }),\n className: `${column.className} rg-rowAction-cell`,\n };\n};\n\nconst getDropdownCell = (\n column: GridColumnType,\n row: GridRowType,\n rowOptions: RowOptions,\n) => {\n const value = row[column.key] as StringOrNumber;\n const validateProps = getValidCellProps(column, row, value, rowOptions);\n const { activeSelectData, rowId } = rowOptions;\n const isActive =\n activeSelectData.rowId === rowOptions.rowId &&\n activeSelectData.columnId === column.key;\n\n const cell = {\n type: 'dropdown',\n selectedValue: value || '',\n values: column.items || [],\n isActive,\n isDisabled: column.isDisabled ? column.isDisabled(value, row) : false,\n getModifiedRow: column.getModifiedRow,\n className: column.className,\n columnId: column.key,\n maxLength: column.maxLength,\n rowId,\n inputValue: isActive ? activeSelectData.inputValue || '' : '',\n filterText: '',\n ...validateProps,\n };\n cell.filterText = getDropdownText(cell.selectedValue, cell);\n return cell;\n};\n\nconst getMultiSelectCell = (\n column: GridColumnType,\n row: GridRowType,\n rowOptions: RowOptions,\n) => {\n const value = row[column.key] as string[];\n const validateProps = getValidCellProps(column, row, value, rowOptions);\n const { activeSelectData, rowId } = rowOptions;\n const isActive =\n activeSelectData.rowId === rowOptions.rowId &&\n activeSelectData.columnId === column.key;\n\n const cell = {\n type: 'multiSelect',\n selectedValue: value || [],\n values: column.items || [],\n isActive,\n isDisabled: column.isDisabled ? column.isDisabled(value, row) : false,\n getModifiedRow: column.getModifiedRow,\n className: column.className,\n columnId: column.key,\n maxLength: column.maxLength,\n rowId,\n inputValue: isActive ? activeSelectData.inputValue || '' : '',\n filterText: '',\n ...validateProps,\n };\n cell.filterText = getMultiSelectText(cell.selectedValue, cell);\n return cell;\n};\n\nconst getDateCell = (\n column: GridColumnType,\n row: GridRowType,\n rowOptions: RowOptions,\n) => {\n const value = row[column.key] as string | undefined;\n const validateProps = getValidCellProps(column, row, value, rowOptions);\n const [year1, month1, day1] = value\n ? value.split('-').map((v) => Number.parseInt(v, 10))\n : [undefined, undefined, undefined];\n\n const cell = {\n type: 'date',\n date: value ? new Date(year1, month1 - 1, day1) : undefined,\n className: column.className,\n columnId: column.key,\n rowId: rowOptions.rowId,\n ...validateProps,\n isDisabled: column.isDisabled ? column.isDisabled(value, row) : false,\n getModifiedRow: column.getModifiedRow,\n filterText: '',\n };\n cell.filterText = getDateText(cell.date);\n\n return cell;\n};\n\nconst getCheckboxCell = (column: GridColumnType, row: GridRowType) => {\n const value = row[column.key] as boolean | undefined;\n\n return {\n type: 'checkbox',\n checked: !!value,\n className: column.className,\n checkedText: column.checkedText,\n uncheckedText: column.uncheckedText,\n };\n};\n\nconst getNumberCell = (\n column: GridColumnType,\n row: GridRowType,\n rowOptions: RowOptions,\n) => {\n const value = row[column.key] as number | undefined;\n const validateProps = getValidCellProps(column, row, value, rowOptions);\n const cell = {\n type: 'number',\n value,\n format: column.format,\n nanToZero: column.nanToZero,\n hideZero: column.hideZero,\n className: column.className,\n columnId: column.key,\n allowNegative: column.allowNegative,\n allowLeadingZeros: column.allowLeadingZeros,\n maxLength: column.maxLength,\n decimalsLimit: column.decimalsLimit,\n prefix: column.prefix,\n suffix: column.suffix,\n rowId: rowOptions.rowId,\n filterText: '',\n isDisabled: column.isDisabled ? column.isDisabled(value, row) : false,\n getModifiedRow: column.getModifiedRow,\n ...validateProps,\n };\n cell.filterText = getNumberText(value, cell);\n\n return cell;\n};\n\nconst getMoneyCell = (\n column: GridColumnType,\n row: GridRowType,\n rowOptions: RowOptions,\n) => {\n const value = row[column.key] as number | undefined;\n const currency = column.currencyKeyField\n ? row[column.currencyKeyField] || column.currency\n : column.currency;\n const validateProps = getValidCellProps(column, row, value, rowOptions);\n\n const cell = {\n type: 'money',\n value,\n className: column.className,\n columnId: column.key,\n decimalsLimit: column.decimalsLimit,\n currency,\n rowId: rowOptions.rowId,\n hideZero: column.hideZero,\n filterText: '',\n isDisabled: column.isDisabled ? column.isDisabled(value, row) : false,\n getModifiedRow: column.getModifiedRow,\n ...validateProps,\n };\n\n cell.filterText = getMoneyText(value, cell);\n\n return cell;\n};\n\nconst getDefaultCell = (\n column: GridColumnType,\n row: GridRowType,\n rowOptions: RowOptions,\n) => {\n const value = row[column.key] as string;\n const validateProps = getValidCellProps(column, row, value, rowOptions);\n const text = value ? value.toString() : '';\n\n return {\n type: column.type || 'text',\n columnId: column.key,\n className: column.className,\n rowId: rowOptions.rowId,\n filterText: text,\n text,\n isDisabled: column.isDisabled ? column.isDisabled(value, row) : false,\n getModifiedRow: column.getModifiedRow,\n ...validateProps,\n };\n};\n\nexport const getCells = (\n columns: GridColumnType[],\n row: any,\n rowOptions: RowOptions,\n) =>\n columns.map((column: GridColumnType) => {\n if (column.type === 'dropdown') {\n return getDropdownCell(column, row, rowOptions);\n }\n if (column.type === 'multiSelect') {\n return getMultiSelectCell(column, row, rowOptions);\n }\n if (column.type === 'date') {\n return getDateCell(column, row, rowOptions);\n }\n if (column.type === 'checkbox') {\n return getCheckboxCell(column, row);\n }\n if (column.type === 'number') {\n return getNumberCell(column, row, rowOptions);\n }\n if (column.type === 'money') {\n return getMoneyCell(column, row, rowOptions);\n }\n if (column.type === 'rowNumber') {\n return getRowNumberCell(column, rowOptions);\n }\n if (column.type === 'rowAction') {\n return getRowActionCell(column, row, rowOptions);\n }\n\n return getDefaultCell(column, row, rowOptions);\n });\n\nexport const getEmptyCellValue = (column: GridColumnType): GridRowValue => {\n if (column.type === 'checkbox') {\n return false;\n }\n if (column.type === 'money' || column.type === 'number') {\n return undefined;\n }\n if (column.type === 'dropdown') {\n return '';\n }\n if (column.type === 'multiSelect') {\n return [];\n }\n return '';\n};\n","import { formatServerDate, isInvalidDate } from '../../utils/date';\nimport {\n ActiveDropdownType,\n GridColumnType,\n GridFilterValueType,\n GridRowType,\n GridRowValue,\n InvalidColumnType,\n InvalidRowType,\n ReactGridColumn,\n ReactGridRow,\n RowConfigType,\n RowOptions,\n ValidatorFunc,\n} from './types';\nimport { HEADER_HEIGHT, ROW_HEIGHT, ROW_STATES } from './constants';\nimport { getCells, getEmptyCellValue } from './cell_utils';\n\nexport const formatRowValues = (row: GridRowType) => {\n const extractedRow: { [key: string]: GridRowValue } = {};\n Object.keys(row).forEach((key) => {\n extractedRow[key] = row[key] as GridRowValue;\n });\n return extractedRow;\n};\n\nconst filterNonEmptyValues = (row: GridRowType) =>\n Object.values(row).filter((x) => {\n if (x instanceof Array) {\n return x.length > 0;\n }\n if (typeof x === 'number' && x === 0) {\n return true;\n }\n return x;\n });\n\nconst isRowEmpty = (row: GridRowType) => filterNonEmptyValues(row).length === 0;\n\nexport const isGridRowTouched = (row: GridRowType) =>\n !isRowEmpty(formatRowValues(row));\n\nexport const getHeaderRow = (columns: GridColumnType[]): ReactGridRow => ({\n rowId: 'header',\n height: HEADER_HEIGHT,\n cells: columns.map((column) => ({\n type: 'header',\n text: column.label,\n description: column.description,\n className: column.className,\n })),\n});\n\nexport const getGridColumns = (columns: GridColumnType[]): ReactGridColumn[] =>\n columns.map((column) => ({\n columnId: column.key,\n width: column.width,\n reorderable: column.allowsSorting ?? false,\n resizable: column.isResizable ?? true,\n className: column.className,\n }));\n\nexport const validateColumn = (\n validators: ValidatorFunc[],\n value: string | number | string[],\n row: any,\n) => {\n if (validators.length === 0) {\n return true;\n }\n let isValid: string | boolean = true;\n validators.forEach((validator) => {\n if (isValid === true) {\n isValid = validator(value, formatRowValues(row));\n }\n });\n return isValid;\n};\n\nexport const getFilteredRow = (\n row: GridRowType,\n columns: GridColumnType[],\n rowOptions: RowOptions,\n gridFilters: GridFilterValueType,\n) => {\n const { rowId, isDirtyRow } = rowOptions;\n const cells = getCells(columns, row, rowOptions);\n let showRow = true;\n if (gridFilters.isFilterApplied) {\n const filterText = cells\n .map((cell: any) => cell.filterText || '')\n .filter((x) => x)\n .join(' ')\n .toLowerCase();\n const hasInvalidCell = cells.some((cell: any) => cell.isInvalidCell);\n const isCleanState = gridFilters.state === ROW_STATES.CLEAN;\n const isIssuesState = gridFilters.state === ROW_STATES.ISSUES;\n if (gridFilters.searchText) {\n const searchText = gridFilters.searchText.toLowerCase();\n if (!filterText.includes(searchText)) {\n showRow = false;\n }\n }\n if (\n (isCleanState && !isDirtyRow) ||\n (isCleanState && hasInvalidCell) ||\n (isIssuesState && !hasInvalidCell)\n ) {\n showRow = false;\n }\n }\n\n if (showRow) {\n return {\n rowId,\n height: ROW_HEIGHT,\n cells,\n };\n }\n return null;\n};\n\nexport const getFilteredRows = (\n rows: any[],\n columns: GridColumnType[],\n gridFilters: GridFilterValueType,\n rowConfig: RowConfigType,\n) => {\n const filteredRows: any[] = [];\n\n rows.forEach((row, rowIndex) => {\n const rowId = rowIndex;\n const rowOptions = {\n isDirtyRow: isGridRowTouched(row),\n rowId,\n rowIndex,\n ...rowConfig,\n };\n const filteredRow = getFilteredRow(row, columns, rowOptions, gridFilters);\n if (filteredRow) {\n filteredRows.push(filteredRow);\n }\n });\n\n return filteredRows;\n};\n\nexport const getDefaultEmptyRow = (columns: GridColumnType[]) =>\n columns.reduce(\n (acc, column) => ({\n ...acc,\n [column.key]: getEmptyCellValue(column),\n }),\n {},\n );\n\nexport const getChangedRows = (\n rows: GridRowType[],\n changes: any[],\n usePreviousCell: boolean = false,\n) => {\n const activeDropdown: ActiveDropdownType = {\n rowId: -1,\n columnId: '',\n inputValue: '',\n };\n const newRows = [...rows];\n changes.forEach((change) => {\n const { type, rowId, columnId, newCell, previousCell } = change;\n const rowIndex = rowId as number;\n let newRow: GridRowType = {\n ...newRows[rowIndex],\n };\n const cellToUse = usePreviousCell ? previousCell : newCell;\n\n if (type === 'text') {\n newRow[columnId] = cellToUse.text;\n } else if (type === 'dropdown' || type === 'multiSelect') {\n const shouldForceCloseDropdown = changes.length > 1 || usePreviousCell;\n if (!shouldForceCloseDropdown && cellToUse.inputValue) {\n activeDropdown.rowId = rowId;\n activeDropdown.columnId = columnId;\n activeDropdown.inputValue = cellToUse.inputValue;\n }\n newRow[columnId] = cellToUse.selectedValue || cellToUse.text;\n } else if (type === 'date') {\n newRow[columnId] = isInvalidDate(cellToUse.date)\n ? ''\n : formatServerDate(cellToUse.date);\n } else if (type === 'checkbox') {\n newRow[columnId] = cellToUse.checked;\n } else if (type === 'number' || type === 'money') {\n const cellValue =\n Number.isNaN(cellToUse.value) ||\n (!cellToUse.value && cellToUse.value !== 0)\n ? undefined\n : cellToUse.value;\n newRow[columnId] = cellValue;\n } else {\n newRow[columnId] = cellToUse.text || cellToUse.value;\n }\n\n if (cellToUse.getModifiedRow) {\n newRow = cellToUse.getModifiedRow(newRow[columnId], newRow);\n }\n // eslint-disable-next-line no-param-reassign\n newRows[rowIndex] = newRow;\n });\n\n return {\n changedRows: newRows,\n activeDropdown,\n };\n};\n\nexport const isUnsavedRowsPresent = (rows: GridRowType[]) =>\n rows.some((row) => isGridRowTouched(row));\n\nexport const validateAndFormatRows = (rows: GridRowType[], columns: any[]) => {\n const invalidRows: InvalidRowType[] = [];\n const formattedRows: GridRowType[] = [];\n rows.forEach((row, rowIndex) => {\n const inValidColumns: InvalidColumnType[] = [];\n const formattedRow = formatRowValues(row);\n const isDirtyRow = !isRowEmpty(formattedRow);\n\n if (isDirtyRow) {\n columns.forEach((column) => {\n if (column.validators?.length) {\n const value: any = row[column.key];\n const isValid = validateColumn(column?.validators, value, row);\n if (typeof isValid === 'string') {\n inValidColumns.push({\n columnId: column.key,\n columnName: column.label,\n message: isValid,\n });\n }\n }\n });\n if (inValidColumns.length) {\n invalidRows.push({\n rowIndex,\n errors: inValidColumns,\n });\n }\n formattedRows.push(formattedRow);\n }\n });\n return { invalidRows, formattedRows };\n};\n","import React, { useLayoutEffect, useRef } from 'react';\nimport { Id, Column } from '../reactgrid';\nimport { GridColumnType } from '../types';\nimport { getGridColumns } from '../utils';\n\nconst useGridColumnsMetaData = (columns: GridColumnType[]) => {\n const containerRef = useRef();\n const [gridColumns, setGridColumns] = React.useState(\n getGridColumns(columns),\n );\n\n useLayoutEffect(() => {\n function updateWidth() {\n const containerWidth = containerRef?.current?.offsetWidth;\n if (containerWidth) {\n const defaultWidth = 150;\n let totalFixedWidth = 0;\n let totalInitialResizableWidth = 0;\n\n gridColumns.forEach((column, index) => {\n const originalColumn = columns[index];\n const colWidth = originalColumn.width || defaultWidth;\n if (column.resizable) {\n totalInitialResizableWidth += colWidth;\n } else {\n totalFixedWidth += colWidth;\n }\n });\n const totalResizableWidth = containerWidth - totalFixedWidth;\n\n if (totalInitialResizableWidth && totalResizableWidth > 0) {\n const newColumns = gridColumns.map((column, index) => {\n const originalColumn = columns[index];\n const colWidth = originalColumn.width || defaultWidth;\n const newWidth = column.resizable\n ? Math.max(\n (colWidth / totalInitialResizableWidth) * totalResizableWidth,\n colWidth,\n defaultWidth,\n )\n : colWidth;\n\n return {\n ...column,\n width: newWidth,\n };\n });\n setGridColumns(newColumns);\n }\n }\n }\n window.addEventListener('resize', updateWidth);\n updateWidth();\n return () => window.removeEventListener('resize', updateWidth);\n }, [containerRef]);\n\n const onColumnResize = (ci: Id, width: number) => {\n setGridColumns((prevColumns) => {\n const defaultMinWidth = 100;\n const columnIndex = prevColumns.findIndex((el) => el.columnId === ci);\n const resizedColumn = prevColumns[columnIndex];\n const updatedColumn = {\n ...resizedColumn,\n width: Math.max(width, defaultMinWidth),\n };\n // eslint-disable-next-line no-param-reassign\n prevColumns[columnIndex] = updatedColumn;\n return [...prevColumns];\n });\n };\n\n return {\n containerRef,\n gridColumns,\n onColumnResize,\n };\n};\n\nexport default useGridColumnsMetaData;\n","import { Box } from '@angellist/adapt';\nimport React, { ReactNode } from 'react';\nimport { UncontrolledTooltip } from 'reactstrap';\n\ntype Props = {\n children: ReactNode | string;\n cellValue: string | number | string[];\n cellId: string;\n isInvalidCell?: boolean;\n errorMessage?: string;\n};\n\nconst EditModeCellWrap = (props: Props) => {\n const { children, isInvalidCell, errorMessage, cellValue, cellId } = props;\n if (isInvalidCell) {\n let errorClass = '';\n let tooltipClass = '';\n if (\n cellValue === '' ||\n cellValue === null ||\n cellValue === undefined ||\n (cellValue instanceof Array && cellValue.length === 0) ||\n !(cellValue && cellValue !== 0)\n ) {\n errorClass = 'rg-cell-missing-data-corner';\n tooltipClass = 'rg-cell-tooltip-missing-data';\n } else {\n errorClass = 'rg-cell-error-corner';\n tooltipClass = 'rg-cell-tooltip-error';\n }\n const elementId = `rg-cell-error-${cellId}`;\n return (\n \n {children}\n \n \n {errorMessage}\n \n \n );\n }\n return <>{children};\n};\n\nexport default EditModeCellWrap;\n","import * as React from 'react';\nimport { FC } from 'react';\nimport Select, { OptionProps, MenuProps } from 'react-select';\n\nimport {\n getDropdownSelectedOption,\n getMultiSelectSelectedOptions,\n} from '../cell_utils';\nimport { GridSelectOptionType } from '../types';\n\nconst CustomOption: React.FC> = ({\n innerProps,\n label,\n isSelected,\n isFocused,\n isDisabled,\n}) => (\n e.stopPropagation()}\n className={`rg-dropdown-option${isSelected ? ' selected' : ''}${\n isFocused ? ' focused' : ''\n }${isDisabled ? ' disabled' : ''}`}\n >\n {label}\n \n);\n\nconst CustomMenu: React.FC> = ({\n innerProps,\n children,\n}: any) => (\n e.stopPropagation()}\n >\n {children}\n \n);\n\nconst DropdownInput: FC = (props) => {\n const { onCellChanged, cell, isMultiSelect } = props;\n const selectRef = React.useRef(null);\n\n const [inputValue, setInputValue] = React.useState(\n cell.inputValue,\n );\n\n const defaultValue = React.useMemo<\n GridSelectOptionType | GridSelectOptionType[] | undefined\n >(() => {\n if (isMultiSelect) {\n return getMultiSelectSelectedOptions(cell.text, cell.values);\n }\n return getDropdownSelectedOption(cell.text, cell.values);\n }, [cell.text, cell.values]);\n\n React.useEffect(() => {\n if (cell.isActive && selectRef.current) {\n selectRef.current.focus();\n setInputValue(cell.inputValue);\n }\n }, [cell.isActive, cell.inputValue]);\n\n return (\n // @ts-ignore\n setInputValue(e),\n })}\n key={`select-${cell.rowId}-${cell.columnId}-${cell.text || 'none'}`}\n isSearchable\n isMulti={isMultiSelect}\n isClearable={false}\n ref={selectRef}\n onChange={(selectedOption) => {\n onCellChanged({\n ...cell,\n selectedValue: isMultiSelect\n ? (selectedOption as GridSelectOptionType[])?.map((s) => s.value)\n : (selectedOption as GridSelectOptionType)?.value,\n isActive: false,\n inputValue: undefined,\n });\n }}\n placeholder=\"Select\"\n blurInputOnSelect\n defaultValue={defaultValue}\n value={defaultValue}\n isDisabled={cell.isDisabled}\n options={cell.values}\n onKeyDown={(e: any) => {\n e.stopPropagation();\n\n if (e.key === 'Escape') {\n selectRef.current.blur();\n return onCellChanged({\n ...cell,\n isActive: false,\n inputValue: undefined,\n });\n }\n\n return null;\n }}\n components={{\n Option: CustomOption,\n Menu: CustomMenu,\n }}\n styles={{\n container: (provided) => ({\n ...provided,\n width: '100%',\n height: '100%',\n }),\n control: (provided) => ({\n ...provided,\n border: 'none',\n borderColor: 'transparent',\n minHeight: '25px',\n background: 'transparent',\n boxShadow: 'none',\n height: '100%',\n }),\n indicatorsContainer: (provided) => ({\n ...provided,\n paddingTop: '0px',\n }),\n dropdownIndicator: (provided) => ({\n ...provided,\n padding: '0px 4px',\n }),\n singleValue: (provided) => ({\n ...provided,\n color: 'inherit',\n }),\n indicatorSeparator: (provided) => ({\n ...provided,\n marginTop: '4px',\n marginBottom: '4px',\n display: 'none',\n }),\n input: (provided) => ({\n ...provided,\n padding: 0,\n }),\n valueContainer: (provided) => ({\n ...provided,\n padding: '0 8px',\n flexWrap: isMultiSelect ? 'nowrap' : 'wrap',\n }),\n }}\n />\n );\n};\n\ninterface DIProps {\n onCellChanged: (...args: any[]) => void;\n cell: Record;\n isMultiSelect?: boolean;\n}\n\nexport default DropdownInput;\n","/* eslint-disable class-methods-use-this */\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport {\n Cell,\n CellTemplate,\n Compatible,\n getCellProperty,\n DropdownCellTemplate as GridDropdownCellTemplate,\n Uncertain,\n UncertainCompatible,\n} from '../reactgrid';\n\nimport EditModeCellWrap from './EditModeCellWrap';\nimport { getDropdownSelectedOption, getDropdownText } from '../cell_utils';\nimport DropdownInput from './DropdownInput';\nimport { GetModifiedRowFunc, GridSelectOptionType } from '../types';\n\n// THIS FILE IS A extended from ORIGINAL FILE DropdownCellTemplate.tsx with selection logic fix\n\nexport interface DropdownCell extends Cell {\n columnId: string;\n rowId: number;\n type: 'dropdown';\n selectedValue?: string;\n filterText?: string;\n values: GridSelectOptionType[];\n isDisabled?: boolean;\n getModifiedRow?: GetModifiedRowFunc;\n isActive?: boolean;\n inputValue?: string;\n isInvalidCell?: boolean;\n errorMessage?: string;\n}\n\ntype Props = {\n gridRef: any;\n};\n\n// @ts-ignore\nclass DropdownCellTemplate extends GridDropdownCellTemplate\n implements CellTemplate {\n private gridRef: any;\n\n constructor(props: Props) {\n super();\n this.gridRef = props.gridRef;\n }\n\n getCompatibleCell(\n uncertainCell: Uncertain,\n ): Compatible {\n let selectedValue: string | undefined;\n let columnId: string | undefined;\n let rowId: number | undefined;\n\n try {\n selectedValue = getCellProperty(uncertainCell, 'selectedValue', 'string');\n } catch {\n selectedValue = undefined;\n }\n\n const values = getCellProperty(uncertainCell, 'values', 'object');\n const value = selectedValue ? parseFloat(selectedValue) : NaN;\n\n let inputValue: string | undefined;\n try {\n inputValue = getCellProperty(uncertainCell, 'inputValue', 'string');\n } catch {\n inputValue = undefined;\n }\n\n let isActive: boolean;\n try {\n isActive = getCellProperty(uncertainCell, 'isActive', 'boolean');\n } catch {\n isActive = false;\n }\n\n try {\n columnId = getCellProperty(uncertainCell, 'columnId', 'string');\n } catch {\n columnId = '';\n }\n try {\n rowId = getCellProperty(uncertainCell, 'rowId', 'number');\n } catch {\n rowId = 0;\n }\n\n const text = getDropdownText(selectedValue || '', uncertainCell);\n\n return {\n ...uncertainCell,\n selectedValue,\n text,\n value,\n values,\n isActive,\n columnId,\n rowId,\n inputValue,\n };\n }\n\n update(\n cell: Compatible,\n cellToMerge: UncertainCompatible,\n ): Compatible {\n if (cell.isDisabled) {\n return this.getCompatibleCell({ ...cell });\n }\n const selectedOption = getDropdownSelectedOption(\n cellToMerge.text,\n cell.values,\n );\n\n return this.getCompatibleCell({\n ...cell,\n selectedValue: selectedOption?.value,\n inputValue: cellToMerge.inputValue,\n });\n }\n\n getClassName(cell: Compatible, _isInEditMode: boolean): string {\n const cellValue = cell.selectedValue || '';\n const className = cell.className ? cell.className : '';\n const isMissingData = cellValue === '';\n\n return classNames(className, {\n 'rg-disabled': cell.isDisabled,\n 'rg-invalid': cell.isInvalidCell,\n 'rg-invalid-missing-data': isMissingData,\n valid: !cell.isInvalidCell,\n });\n }\n\n render(\n cell: Compatible,\n _isInEditMode: boolean,\n onCellChanged: (cell: Compatible, commit: boolean) => void,\n ): React.ReactNode {\n const cellId = `${cell.rowId}-${cell.columnId}`;\n return (\n \n {\n e.stopPropagation();\n if (this.gridRef?.current) {\n this.gridRef.current.focusOnCell(e);\n }\n }}\n >\n ) =>\n onCellChanged(this.getCompatibleCell(newCell), true)\n }\n cell={cell}\n />\n \n \n );\n }\n}\n\nexport default DropdownCellTemplate;\n","/* eslint-disable class-methods-use-this */\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport {\n Cell,\n CellTemplate,\n Compatible,\n getCellProperty,\n getCharFromKey,\n isAlphaNumericKey,\n keyCodes,\n Uncertain,\n UncertainCompatible,\n} from '../reactgrid';\n\nimport EditModeCellWrap from './EditModeCellWrap';\nimport {\n getMultiSelectSelectedOptions,\n getMultiSelectText,\n} from '../cell_utils';\nimport DropdownInput from './DropdownInput';\nimport { GetModifiedRowFunc, GridSelectOptionType } from '../types';\nimport { MULTI_SELECT_SEPARATOR } from '../constants';\n\nexport interface MultiSelectCell extends Cell {\n columnId: string;\n rowId: number;\n type: 'multiSelect';\n selectedValue?: string[];\n filterText?: string;\n values: GridSelectOptionType[];\n isDisabled?: boolean;\n getModifiedRow?: GetModifiedRowFunc;\n isActive?: boolean;\n inputValue?: string;\n isInvalidCell?: boolean;\n errorMessage?: string;\n}\n\ntype Props = {\n gridRef: any;\n};\n\nclass MultiSelectCellTemplate implements CellTemplate {\n private gridRef: any;\n\n constructor(props: Props) {\n this.gridRef = props.gridRef;\n }\n\n getCompatibleCell(\n uncertainCell: Uncertain,\n ): Compatible {\n let selectedValue: string[] | undefined;\n let columnId: string | undefined;\n let rowId: number | undefined;\n\n try {\n selectedValue = getCellProperty(uncertainCell, 'selectedValue', 'object');\n } catch {\n selectedValue = [];\n }\n\n const values = getCellProperty(uncertainCell, 'values', 'object');\n const value = selectedValue\n ? parseFloat(selectedValue?.join(MULTI_SELECT_SEPARATOR))\n : NaN;\n\n let inputValue: string | undefined;\n try {\n inputValue = getCellProperty(uncertainCell, 'inputValue', 'string');\n } catch {\n inputValue = undefined;\n }\n\n let isActive: boolean;\n try {\n isActive = getCellProperty(uncertainCell, 'isActive', 'boolean');\n } catch {\n isActive = false;\n }\n\n try {\n columnId = getCellProperty(uncertainCell, 'columnId', 'string');\n } catch {\n columnId = '';\n }\n try {\n rowId = getCellProperty(uncertainCell, 'rowId', 'number');\n } catch {\n rowId = 0;\n }\n\n const text = getMultiSelectText(selectedValue, uncertainCell);\n\n return {\n ...uncertainCell,\n selectedValue,\n text,\n value,\n values,\n isActive,\n columnId,\n rowId,\n inputValue,\n };\n }\n\n update(\n cell: Compatible,\n cellToMerge: UncertainCompatible,\n ): Compatible {\n if (cell.isDisabled) {\n return this.getCompatibleCell({ ...cell });\n }\n const selectedOptions = getMultiSelectSelectedOptions(\n cellToMerge.text,\n cell.values,\n );\n\n return this.getCompatibleCell({\n ...cell,\n selectedValue: selectedOptions.map((x) => x.value),\n inputValue: cellToMerge.inputValue,\n });\n }\n\n getClassName(\n cell: Compatible,\n _isInEditMode: boolean,\n ): string {\n const cellValue = cell.selectedValue || '';\n const className = cell.className ? cell.className : '';\n const isMissingData = cellValue === '';\n\n return classNames(className, {\n 'rg-disabled': cell.isDisabled,\n 'rg-invalid': cell.isInvalidCell,\n 'rg-invalid-missing-data': isMissingData,\n valid: !cell.isInvalidCell,\n });\n }\n\n handleKeyDown(\n cell: Compatible,\n keyCode: number,\n ctrl: boolean,\n shift: boolean,\n alt: boolean,\n key: string,\n capsLock: boolean,\n ): { cell: Compatible; enableEditMode: boolean } {\n if ((keyCode === keyCodes.SPACE || keyCode === keyCodes.ENTER) && !shift) {\n return {\n cell: this.getCompatibleCell({ ...cell }),\n enableEditMode: false,\n };\n }\n\n const char = getCharFromKey(key, shift, capsLock);\n\n if (\n !ctrl &&\n !alt &&\n isAlphaNumericKey(keyCode) &&\n !(shift && keyCode === keyCodes.SPACE)\n )\n return {\n cell: this.getCompatibleCell({\n ...cell,\n inputValue: char,\n }),\n enableEditMode: false,\n };\n\n return { cell, enableEditMode: false };\n }\n\n handleCompositionEnd(\n cell: Compatible,\n eventData: any,\n ): { cell: Compatible; enableEditMode: boolean } {\n return {\n cell: { ...cell, inputValue: eventData },\n enableEditMode: false,\n };\n }\n\n render(\n cell: Compatible,\n _isInEditMode: boolean,\n onCellChanged: (cell: Compatible, commit: boolean) => void,\n ): React.ReactNode {\n const cellId = `${cell.rowId}-${cell.columnId}`;\n return (\n \n {\n e.stopPropagation();\n if (this.gridRef?.current) {\n this.gridRef.current.focusOnCell(e);\n }\n }}\n >\n ) => {\n onCellChanged(this.getCompatibleCell(newCell), true);\n }}\n cell={cell}\n isMultiSelect\n />\n \n \n );\n }\n}\n\nexport default MultiSelectCellTemplate;\n","/* eslint-disable class-methods-use-this */\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport {\n isAlphaNumericKey,\n isNavigationKey,\n keyCodes,\n Cell,\n Compatible,\n TextCellTemplate as GridTextCellTemplate,\n CellTemplate,\n getCellProperty,\n Uncertain,\n UncertainCompatible,\n} from '../reactgrid';\nimport EditModeCellWrap from './EditModeCellWrap';\nimport { sanitizeValue } from '../cell_utils';\nimport { GetModifiedRowFunc } from '../types';\n\n// THIS FILE IS A extended from ORIGINAL FILE TextCellTemplate.tsx with our custom validation logic\n\nexport interface TextCell extends Cell {\n columnId: string;\n rowId: number;\n type: 'text';\n text: string;\n filterText?: string;\n placeholder?: string;\n maxLength?: number;\n renderer?: (text: string) => React.ReactNode;\n isInvalidCell?: boolean;\n errorMessage?: string;\n isDisabled?: boolean;\n getModifiedRow?: GetModifiedRowFunc;\n}\n\n// @ts-ignore\nclass TextCellTemplate extends GridTextCellTemplate\n implements CellTemplate {\n private wasEscKeyPressed = false;\n\n getCompatibleCell(uncertainCell: Uncertain): Compatible {\n const text = getCellProperty(uncertainCell, 'text', 'string');\n let placeholder: string | undefined;\n let columnId: string | undefined;\n let rowId: number | undefined;\n try {\n placeholder = getCellProperty(uncertainCell, 'placeholder', 'string');\n } catch {\n placeholder = '';\n }\n try {\n columnId = getCellProperty(uncertainCell, 'columnId', 'string');\n } catch {\n columnId = '';\n }\n try {\n rowId = getCellProperty(uncertainCell, 'rowId', 'number');\n } catch {\n rowId = 0;\n }\n const value = parseFloat(text); // TODO more advanced parsing for all text based cells\n return { ...uncertainCell, text, columnId, rowId, value, placeholder };\n }\n\n update(\n cell: Compatible,\n cellToMerge: UncertainCompatible,\n ): Compatible {\n if (cell.isDisabled) {\n return this.getCompatibleCell({ ...cell });\n }\n return this.getCompatibleCell({\n ...cell,\n text: sanitizeValue(cellToMerge.text),\n placeholder: cellToMerge.placeholder,\n });\n }\n\n getClassName(cell: Compatible, _isInEditMode: boolean): string {\n const className = cell.className ? cell.className : '';\n const isMissingData = cell.text === '';\n\n return classNames(className, {\n 'rg-disabled': cell.isDisabled,\n 'rg-invalid': cell.isInvalidCell,\n 'rg-invalid-missing-data': isMissingData,\n valid: !cell.isInvalidCell,\n placeholder: cell.placeholder && isMissingData,\n });\n }\n\n render(\n cell: Compatible,\n isInEditMode: boolean,\n onCellChanged: (cell: Compatible, commit: boolean) => void,\n ): React.ReactNode {\n if (!isInEditMode) {\n const cellText = cell.text || cell.placeholder || '';\n const textToDisplay = cell.renderer ? cell.renderer(cellText) : cellText;\n return (\n \n {textToDisplay}\n \n );\n }\n\n return (\n {\n if (input) {\n input.focus();\n input.setSelectionRange(input.value.length, input.value.length);\n }\n }}\n defaultValue={cell.text}\n disabled={cell.isDisabled}\n onChange={(e) =>\n onCellChanged(\n this.getCompatibleCell({ ...cell, text: e.currentTarget.value }),\n false,\n )\n }\n onBlur={(e) => {\n onCellChanged(\n this.getCompatibleCell({ ...cell, text: e.currentTarget.value }),\n !this.wasEscKeyPressed,\n );\n this.wasEscKeyPressed = false;\n }}\n onCopy={(e) => e.stopPropagation()}\n onCut={(e) => e.stopPropagation()}\n onPaste={(e) => e.stopPropagation()}\n onPointerDown={(e) => e.stopPropagation()}\n placeholder={cell.placeholder}\n maxLength={cell.maxLength}\n onKeyDown={(e) => {\n if (isAlphaNumericKey(e.keyCode) || isNavigationKey(e.keyCode))\n e.stopPropagation();\n if (e.keyCode === keyCodes.ESCAPE) this.wasEscKeyPressed = true;\n }}\n />\n );\n }\n}\n\nexport default TextCellTemplate;\n","/* eslint-disable class-methods-use-this */\nimport * as React from 'react';\nimport NumberFormat from 'react-number-format';\nimport classNames from 'classnames';\nimport {\n getCellProperty,\n keyCodes,\n Cell,\n CellTemplate,\n Compatible,\n Uncertain,\n getCharFromKey,\n inNumericKey,\n isNavigationKey,\n isAllowedOnNumberTypingKey,\n isCharAllowedOnNumberInput,\n NumberCellTemplate as GridNumberCellTemplate,\n UncertainCompatible,\n} from '../reactgrid';\nimport EditModeCellWrap from './EditModeCellWrap';\nimport { getNumberText } from '../cell_utils';\nimport { MAX_ALLOWED_DECIMALS } from '../constants';\nimport { GetModifiedRowFunc } from '../types';\n\nexport interface NumberCell extends Cell {\n columnId: string;\n rowId: number;\n type: 'number';\n value: number;\n nanToZero?: boolean;\n hideZero?: boolean;\n isInvalidCell?: boolean;\n errorMessage?: string;\n filterText?: string | number;\n allowNegative?: boolean;\n allowLeadingZeros?: boolean;\n maxLength?: number;\n decimalsLimit?: number;\n prefix?: string;\n suffix?: string;\n isDisabled?: boolean;\n getModifiedRow?: GetModifiedRowFunc;\n}\n\nfunction parseLocaleNumber(stringNumber: string): number {\n if (!stringNumber.trim()) return NaN;\n const thousandsSeparator = ',';\n const decimalSeparator = '.';\n const normalizedStringNumber = stringNumber.replace(/\\u00A0/g, ' '); // Replace non-breaking space with normal space\n const numberString = normalizedStringNumber\n .replace(new RegExp(`[${thousandsSeparator}\\\\s]`, 'g'), '') // Replace thousands separator and white-space\n .replace(new RegExp(`\\\\${decimalSeparator}`, 'g'), '.'); // Replace decimal separator\n\n const trimmedNumberString = numberString.replace(/^(?!-)\\D+|\\D+$/g, ''); // Remove characters before first and after last number, but keep negative sign\n if (trimmedNumberString === null || trimmedNumberString.trim().length === 0) {\n return NaN;\n }\n return Number(trimmedNumberString);\n}\n\n// THIS FILE IS A extended from ORIGINAL FILE NumberCellTemplate.tsx with our custom validation logic\n\n// @ts-ignore\nclass NumberCellTemplate extends GridNumberCellTemplate\n implements CellTemplate {\n private wasEscKeyPressed = false;\n\n getCompatibleCell(\n uncertainCell: Uncertain,\n ): Compatible {\n let value: number;\n try {\n value = getCellProperty(uncertainCell, 'value', 'number');\n } catch (error) {\n value = NaN;\n }\n let columnId: string | undefined;\n let rowId: number | undefined;\n try {\n columnId = getCellProperty(uncertainCell, 'columnId', 'string');\n } catch {\n columnId = '';\n }\n try {\n rowId = getCellProperty(uncertainCell, 'rowId', 'number');\n } catch {\n rowId = 0;\n }\n const displayValue =\n uncertainCell.nanToZero && Number.isNaN(value) ? 0 : value;\n const text = getNumberText(displayValue, uncertainCell);\n return { ...uncertainCell, value: displayValue, text, columnId, rowId };\n }\n\n update(\n cell: Compatible,\n cellToMerge: UncertainCompatible,\n ): Compatible {\n if (cell.isDisabled) {\n return this.getCompatibleCell({ ...cell });\n }\n return this.getCompatibleCell({ ...cell, value: cellToMerge.value });\n }\n\n getClassName(cell: Compatible, _isInEditMode: boolean): string {\n const className = cell.className ? cell.className : '';\n const isMissingData = !(cell.value && cell.value !== 0);\n return classNames(className, {\n 'rg-disabled': cell.isDisabled,\n 'rg-invalid': cell.isInvalidCell,\n 'rg-invalid-missing-data': isMissingData,\n valid: !cell.isInvalidCell,\n });\n }\n\n render(\n cell: Compatible,\n isInEditMode: boolean,\n onCellChanged: (cell: Compatible, commit: boolean) => void,\n ): React.ReactNode {\n if (!isInEditMode) {\n const cellValue = Number.isNaN(cell.value) ? cell.text : cell.value;\n return (\n \n {cell.text}\n \n );\n }\n\n return (\n {\n if (input) {\n input.focus();\n input.setSelectionRange(input.value.length, input.value.length);\n }\n }}\n defaultValue={cell.value}\n disabled={cell.isDisabled}\n onValueChange={(values) => {\n onCellChanged(\n this.getCompatibleCell({\n ...cell,\n value: values.floatValue,\n }),\n false,\n );\n }}\n onBlur={(e: React.FocusEvent) => {\n onCellChanged(\n this.getCompatibleCell({\n ...cell,\n value: parseLocaleNumber(e.target.value),\n }),\n !this.wasEscKeyPressed,\n );\n this.wasEscKeyPressed = false;\n }}\n onKeyDown={(e: React.KeyboardEvent) => {\n const isPasteKey =\n (e.ctrlKey || e.metaKey) && e.keyCode === keyCodes.KEY_V;\n const isSelectAllKey =\n (e.ctrlKey || e.metaKey) && e.keyCode === keyCodes.KEY_A;\n\n if (\n inNumericKey(e.keyCode) ||\n isNavigationKey(e.keyCode) ||\n isAllowedOnNumberTypingKey(e.keyCode) ||\n isSelectAllKey\n )\n e.stopPropagation();\n if (\n !inNumericKey(e.keyCode) &&\n !isNavigationKey(e.keyCode) &&\n !isCharAllowedOnNumberInput(getCharFromKey(e.key)) &&\n !isPasteKey\n )\n e.preventDefault();\n if (e.keyCode === keyCodes.ESCAPE) this.wasEscKeyPressed = true;\n }}\n onCopy={(e: React.ClipboardEvent) => e.stopPropagation()}\n onCut={(e: React.ClipboardEvent) => e.stopPropagation()}\n onPaste={(e: React.ClipboardEvent) => e.stopPropagation()}\n onPointerDown={(e: React.PointerEvent) => e.stopPropagation()}\n maxLength={cell.maxLength}\n allowNegative={cell.allowNegative}\n allowLeadingZeros={cell.allowLeadingZeros}\n decimalScale={cell.decimalsLimit ?? MAX_ALLOWED_DECIMALS}\n prefix={cell.prefix}\n suffix={cell.suffix}\n />\n );\n }\n}\n\nexport default NumberCellTemplate;\n","/* eslint-disable class-methods-use-this */\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport {\n getCellProperty,\n Cell,\n CellTemplate,\n Compatible,\n Uncertain,\n inNumericKey,\n isNavigationKey,\n keyCodes,\n DateCellTemplate as GridDateCellTemplate,\n UncertainCompatible,\n} from '../reactgrid';\nimport EditModeCellWrap from './EditModeCellWrap';\nimport { getDateText, getPastedDate, sanitizeValue } from '../cell_utils';\nimport { GetModifiedRowFunc } from '../types';\n\nconst getFormattedTimeUnit = (timeUnit: number): string =>\n timeUnit.toString().padStart(2, '0');\n\nexport interface DateCell extends Cell {\n columnId: string;\n rowId: number;\n type: 'date';\n date?: Date;\n isInvalidCell?: boolean;\n errorMessage?: string;\n filterText?: string;\n isDisabled?: boolean;\n getModifiedRow?: GetModifiedRowFunc;\n}\n\n// THIS FILE IS A extended from ORIGINAL FILE DateCellTemplate.tsx with our custom validation logic\n\n// @ts-ignore\nclass DateCellTemplate extends GridDateCellTemplate\n implements CellTemplate {\n private wasEscKeyPressed = false;\n\n getCompatibleCell(uncertainCell: Uncertain): Compatible {\n const date = uncertainCell.date\n ? getCellProperty(uncertainCell, 'date', 'object')\n : new Date(NaN);\n\n let columnId: string | undefined;\n let rowId: number | undefined;\n try {\n columnId = getCellProperty(uncertainCell, 'columnId', 'string');\n } catch {\n columnId = '';\n }\n try {\n rowId = getCellProperty(uncertainCell, 'rowId', 'number');\n } catch {\n rowId = 0;\n }\n const value = date && date instanceof Date ? date?.getTime() : undefined;\n const text = getDateText(date);\n return { ...uncertainCell, date, value, text, columnId, rowId };\n }\n\n update(\n cell: Compatible,\n cellToMerge: UncertainCompatible,\n ): Compatible {\n if (cell.isDisabled) {\n return this.getCompatibleCell({ ...cell });\n }\n const date = getPastedDate(\n sanitizeValue(cellToMerge.text),\n sanitizeValue(cellToMerge.value),\n );\n return this.getCompatibleCell({\n ...cell,\n date,\n });\n }\n\n getClassName(cell: Compatible, _isInEditMode: boolean): string {\n const className = cell.className ? cell.className : '';\n const isMissingData = cell.text === '';\n return classNames(className, {\n 'rg-disabled': cell.isDisabled,\n 'rg-invalid': cell.isInvalidCell,\n 'rg-invalid-missing-data': isMissingData,\n valid: !cell.isInvalidCell,\n });\n }\n\n render(\n cell: Compatible,\n isInEditMode: boolean,\n onCellChanged: (cell: Compatible, commit: boolean) => void,\n ): React.ReactNode {\n if (!isInEditMode) {\n return (\n \n {cell.text}\n \n );\n }\n\n if (!cell.date) {\n return `\"cell.date\" is not initialized with a date value`;\n }\n\n const year = getFormattedTimeUnit(cell.date.getFullYear());\n const month = getFormattedTimeUnit(cell.date.getMonth() + 1);\n const day = getFormattedTimeUnit(cell.date.getDate());\n\n return (\n {\n if (input) input.focus();\n }}\n type=\"date\"\n defaultValue={`${year}-${month}-${day}`}\n disabled={cell.isDisabled}\n onChange={(e) => {\n if (e.currentTarget.value) {\n const [year1, month1, day1] = e.currentTarget.value\n .split('-')\n .map((v) => Number.parseInt(v, 10));\n onCellChanged(\n this.getCompatibleCell({\n ...cell,\n date: new Date(year1, month1 - 1, day1),\n }),\n false,\n );\n }\n }}\n onBlur={(e) => {\n if (e.currentTarget.value) {\n const [year1, month1, day1] = e.currentTarget.value\n .split('-')\n .map((v) => Number.parseInt(v, 10));\n onCellChanged(\n this.getCompatibleCell({\n ...cell,\n date: new Date(year1, month1 - 1, day1),\n }),\n !this.wasEscKeyPressed,\n );\n this.wasEscKeyPressed = false;\n }\n }}\n onKeyDown={(e) => {\n if (\n inNumericKey(e.keyCode) ||\n isNavigationKey(e.keyCode) ||\n e.keyCode === keyCodes.COMMA ||\n e.keyCode === keyCodes.PERIOD ||\n ((e.ctrlKey || e.metaKey) && e.keyCode === keyCodes.KEY_A)\n )\n e.stopPropagation();\n if (\n !inNumericKey(e.keyCode) &&\n !isNavigationKey(e.keyCode) &&\n e.keyCode !== keyCodes.COMMA &&\n e.keyCode !== keyCodes.PERIOD\n )\n e.preventDefault();\n if (e.keyCode === keyCodes.ESCAPE) this.wasEscKeyPressed = true;\n }}\n onCopy={(e) => e.stopPropagation()}\n onCut={(e) => e.stopPropagation()}\n onPaste={(e) => e.stopPropagation()}\n onPointerDown={(e) => e.stopPropagation()}\n />\n );\n }\n}\n\nexport default DateCellTemplate;\n","/* eslint-disable class-methods-use-this */\nimport * as React from 'react';\nimport { Stack, Text, Tooltip } from '@angellist/adapt';\n\nimport {\n Cell,\n CellTemplate,\n Compatible,\n Span,\n HeaderCellTemplate as GridHeaderCellTemplate,\n} from '../reactgrid';\n\nexport interface HeaderCell extends Cell, Span {\n type: 'header';\n description?: string | React.ReactNode;\n text: string;\n}\n\n// THIS FILE IS is extended from ORIGINAL FILE HeaderCellTemplate.tsx with our custom header logic\n\nclass HeaderCellTemplate extends GridHeaderCellTemplate\n implements CellTemplate {\n render(cell: Compatible): React.ReactNode {\n if (cell.description) {\n return (\n \n {cell.text}\n \n \n );\n }\n\n return {cell.text};\n }\n}\n\nexport default HeaderCellTemplate;\n","/* eslint-disable class-methods-use-this */\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport {\n Cell,\n CellTemplate,\n Compatible,\n Span,\n Uncertain,\n getCellProperty,\n} from '../reactgrid';\n\nexport interface NonEditableCell extends Cell, Span {\n type: 'nonEditable';\n text: string;\n renderer?: (text: string) => React.ReactNode;\n isDisabled?: boolean;\n}\n\nclass NonEditableCellTemplate implements CellTemplate {\n getCompatibleCell(\n uncertainCell: Uncertain,\n ): Compatible {\n const text = getCellProperty(uncertainCell, 'text', 'string');\n const value = parseFloat(text);\n return { ...uncertainCell, text, value };\n }\n\n render(cell: Compatible): React.ReactNode {\n const cellText = cell.text || '';\n return cell.renderer ? cell.renderer(cellText) : cellText;\n }\n\n isFocusable = (): boolean => false;\n\n getClassName(cell: Compatible): string {\n const className = cell.className ? cell.className : '';\n return classNames(className, {\n 'rg-disabled': cell.isDisabled,\n });\n }\n}\n\nexport default NonEditableCellTemplate;\n","/* eslint-disable class-methods-use-this */\nimport * as React from 'react';\nimport CurrencyInput from 'react-currency-input-field';\nimport classNames from 'classnames';\nimport {\n getCellProperty,\n keyCodes,\n Cell,\n CellTemplate,\n Compatible,\n Uncertain,\n getCharFromKey,\n inNumericKey,\n isNavigationKey,\n isAllowedOnNumberTypingKey,\n isCharAllowedOnNumberInput,\n NumberCellTemplate as GridNumberCellTemplate,\n UncertainCompatible,\n} from '../reactgrid';\nimport EditModeCellWrap from './EditModeCellWrap';\nimport { getCurrencySign } from '../../../utils/number';\nimport { getMoneyText } from '../cell_utils';\nimport { GetModifiedRowFunc } from '../types';\n\nexport interface MoneyInputCell extends Cell {\n columnId: string;\n rowId: number;\n type: 'number';\n value: number;\n currency?: string;\n currencyKeyField?: string;\n isInvalidCell?: boolean;\n errorMessage?: string;\n decimalsLimit?: number;\n hideZero?: boolean;\n isDisabled?: boolean;\n getModifiedRow?: GetModifiedRowFunc;\n}\n\nfunction parseLocaleNumber(stringNumber: string): number {\n if (!stringNumber.trim()) return NaN;\n const thousandsSeparator = ',';\n const decimalSeparator = '.';\n const normalizedStringNumber = stringNumber.replace(/\\u00A0/g, ' '); // Replace non-breaking space with normal space\n const numberString = normalizedStringNumber\n .replace(new RegExp(`[${thousandsSeparator}\\\\s]`, 'g'), '') // Replace thousands separator and white-space\n .replace(new RegExp(`\\\\${decimalSeparator}`, 'g'), '.'); // Replace decimal separator\n\n const trimmedNumberString = numberString.replace(/^(?!-)\\D+|\\D+$/g, ''); // Remove characters before first and after last number, but keep negative sign\n if (trimmedNumberString === null || trimmedNumberString.trim().length === 0) {\n return NaN;\n }\n return Number(trimmedNumberString);\n}\n\n// THIS FILE IS A extended from ORIGINAL FILE NumberCellTemplate.tsx with our custom validation logic\n\n// @ts-ignore\nclass MoneyInputCellTemplate extends GridNumberCellTemplate\n implements CellTemplate {\n private wasEscKeyPressed = false;\n\n getCompatibleCell(\n uncertainCell: Uncertain,\n ): Compatible {\n let value: number;\n try {\n value = getCellProperty(uncertainCell, 'value', 'number');\n } catch (error) {\n value = NaN;\n }\n let columnId: string | undefined;\n let rowId: number | undefined;\n try {\n columnId = getCellProperty(uncertainCell, 'columnId', 'string');\n } catch {\n columnId = '';\n }\n try {\n rowId = getCellProperty(uncertainCell, 'rowId', 'number');\n } catch {\n rowId = 0;\n }\n let currency: string | undefined;\n try {\n currency = getCellProperty(uncertainCell, 'currency', 'string');\n } catch {\n currency = 'USD';\n }\n let currencyKeyField: string | undefined;\n try {\n currencyKeyField = getCellProperty(\n uncertainCell,\n 'currencyKeyField',\n 'string',\n );\n } catch {\n currencyKeyField = undefined;\n }\n let decimalsLimit: number | undefined;\n try {\n decimalsLimit = getCellProperty(uncertainCell, 'decimalsLimit', 'number');\n } catch {\n decimalsLimit = 2;\n }\n const displayValue = Number.isNaN(value) ? undefined : value;\n const text = getMoneyText(displayValue, uncertainCell);\n return {\n ...uncertainCell,\n value: displayValue,\n text,\n columnId,\n rowId,\n currency,\n currencyKeyField,\n decimalsLimit,\n };\n }\n\n update(\n cell: Compatible,\n cellToMerge: UncertainCompatible,\n ): Compatible {\n if (cell.isDisabled) {\n return this.getCompatibleCell({ ...cell });\n }\n return this.getCompatibleCell({ ...cell, value: cellToMerge.value });\n }\n\n getClassName(\n cell: Compatible,\n _isInEditMode: boolean,\n ): string {\n const className = cell.className ? cell.className : '';\n const isMissingData = !(cell.value && cell.value !== 0);\n return classNames(className, {\n 'rg-disabled': cell.isDisabled,\n 'rg-invalid': cell.isInvalidCell,\n 'rg-invalid-missing-data': isMissingData,\n valid: !cell.isInvalidCell,\n });\n }\n\n render(\n cell: Compatible,\n isInEditMode: boolean,\n onCellChanged: (cell: Compatible, commit: boolean) => void,\n ): React.ReactNode {\n const currencySign = cell.currency ? getCurrencySign(cell.currency) : '';\n if (!isInEditMode) {\n return (\n \n {cell.text}\n \n );\n }\n\n return (\n {\n if (input) {\n input.focus();\n input.setSelectionRange(input.value.length, input.value.length);\n }\n }}\n defaultValue={cell.value}\n onValueChange={(newValue) => {\n onCellChanged(\n this.getCompatibleCell({\n ...cell,\n value: newValue ? parseLocaleNumber(newValue) : undefined,\n }),\n false,\n );\n }}\n onBlur={(e) => {\n onCellChanged(\n this.getCompatibleCell({\n ...cell,\n value: e.currentTarget.value\n ? parseLocaleNumber(e.currentTarget.value)\n : undefined,\n }),\n !this.wasEscKeyPressed,\n );\n this.wasEscKeyPressed = false;\n }}\n onKeyDown={(e: React.KeyboardEvent) => {\n const isPasteKey =\n (e.ctrlKey || e.metaKey) && e.keyCode === keyCodes.KEY_V;\n const isSelectAllKey =\n (e.ctrlKey || e.metaKey) && e.keyCode === keyCodes.KEY_A;\n\n if (\n inNumericKey(e.keyCode) ||\n isNavigationKey(e.keyCode) ||\n isAllowedOnNumberTypingKey(e.keyCode) ||\n isSelectAllKey\n )\n e.stopPropagation();\n if (\n !inNumericKey(e.keyCode) &&\n !isNavigationKey(e.keyCode) &&\n !isCharAllowedOnNumberInput(getCharFromKey(e.key)) &&\n !isPasteKey\n )\n e.preventDefault();\n if (e.keyCode === keyCodes.ESCAPE) this.wasEscKeyPressed = true;\n }}\n onCopy={(e: React.ClipboardEvent) => e.stopPropagation()}\n onCut={(e: React.ClipboardEvent) => e.stopPropagation()}\n onPaste={(e: React.ClipboardEvent) => e.stopPropagation()}\n onPointerDown={(e: React.PointerEvent) => e.stopPropagation()}\n />\n );\n }\n}\n\nexport default MoneyInputCellTemplate;\n","/* eslint-disable class-methods-use-this */\nimport * as React from 'react';\nimport { Button, Menu } from '@angellist/adapt';\n\nimport {\n Cell,\n CellTemplate,\n Compatible,\n Span,\n Uncertain,\n getCellProperty,\n} from '../reactgrid';\nimport { RowActionMenuItem } from '../types';\n\nexport interface RowActionCell extends Cell, Span {\n columnId: string;\n rowId: number;\n type: 'RowAction';\n actionMenuItems: RowActionMenuItem[];\n}\n\nclass RowActionCellTemplate implements CellTemplate {\n getCompatibleCell(\n uncertainCell: Uncertain,\n ): Compatible {\n let columnId: string | undefined;\n let rowId: number | undefined;\n try {\n columnId = getCellProperty(uncertainCell, 'columnId', 'string');\n } catch {\n columnId = '';\n }\n try {\n rowId = getCellProperty(uncertainCell, 'rowId', 'number');\n } catch {\n rowId = 0;\n }\n\n const actionMenuItems = getCellProperty(\n uncertainCell,\n 'actionMenuItems',\n 'object',\n );\n\n return {\n ...uncertainCell,\n columnId,\n actionMenuItems,\n rowId,\n text: rowId.toString(),\n value: rowId,\n };\n }\n\n render(cell: Compatible): React.ReactNode {\n const { actionMenuItems } = cell;\n\n const handleMenuAction = (key: string) => {\n const menuItem = actionMenuItems.find((item) => item.key === key);\n if (menuItem) {\n menuItem.onPress();\n }\n };\n\n return (\n \n }\n placement=\"bottom end\"\n onAction={handleMenuAction}\n >\n {actionMenuItems.map((item) => (\n {item.label}\n ))}\n \n );\n }\n\n isFocusable = (): boolean => false;\n\n getClassName(cell: Compatible): string {\n return cell.className ? cell.className : '';\n }\n}\n\nexport default RowActionCellTemplate;\n","import { RowActionMenuFunc, SetDataFunc } from '../types';\n\nconst useRowActionsMenu = (\n getRowActionMenuItems: RowActionMenuFunc,\n setData: SetDataFunc,\n): RowActionMenuFunc => {\n if (!getRowActionMenuItems) {\n return (_row, rowOptions) => [\n {\n key: 'deleteRow',\n label: 'Delete',\n onPress: () => {\n setData((prevData) =>\n prevData.filter((_item, index) => index !== rowOptions.rowIndex),\n );\n },\n },\n ];\n }\n\n return getRowActionMenuItems;\n};\n\nexport default useRowActionsMenu;\n","import React, { useEffect, useMemo, useRef, useState } from 'react';\nimport { Box, NullState } from '@angellist/adapt';\nimport {\n ReactGrid,\n CellChange,\n MenuOption,\n CellLocation,\n Id,\n SelectionMode,\n} from '../reactgrid';\nimport '../styles/styles.scss';\nimport {\n ActiveDropdownType,\n DataEditorProps,\n GridColumnType,\n GridFilterValueType,\n GridRowType,\n} from '../types';\nimport {\n getChangedRows,\n getDefaultEmptyRow,\n getHeaderRow,\n getFilteredRows,\n isGridRowTouched,\n} from '../utils';\nimport useGridColumnsMetaData from '../hooks/useGridColumnsMetaData';\nimport DropdownCellTemplate from './DropdownCellTemplate';\nimport MultiSelectCellTemplate from './MultiSelectCellTemplate';\nimport TextCellTemplate from './TextCellTemplate';\nimport NumberCellTemplate from './NumberCellTemplate';\nimport DateCellTemplate from './DateCellTemplate';\nimport HeaderCellTemplate from './HeaderCellTemplate';\nimport NonEditableCellTemplate from './NonEditableCellTemplate';\nimport MoneyInputCellTemplate from './MoneyInputCellTemplate';\nimport RowActionCellTemplate from './RowActionCellTemplate';\nimport useRowActionsMenuItems from '../hooks/useRowActionsMenuItems';\n\ntype Props = {\n gridFilters: GridFilterValueType;\n} & DataEditorProps;\n\nconst DataEditor = (props: Props) => {\n const {\n data,\n setData,\n columns,\n hideContextMenu,\n enableFillHandle = true,\n enableRangeSelection = true,\n autoAppendRows = true,\n appendRowsCount = 10,\n showRowNumbers,\n showRowActions,\n getRowActionMenuItems,\n maxHeight,\n minHeight,\n gridFilters,\n isLoading,\n noDataProps,\n setIsDirty,\n } = props;\n const gridRef = useRef();\n\n const [activeSelectData, setActiveSelectData] = useState({\n rowId: -1,\n columnId: '',\n inputValue: '',\n });\n const [cellChangesIndex, setCellChangesIndex] = useState(-1);\n const [cellChanges, setCellChanges] = useState([]);\n\n const getActionMenuItems = useRowActionsMenuItems(\n getRowActionMenuItems,\n setData,\n );\n const showActionColumn = !!(showRowActions && getActionMenuItems);\n\n const tableColumns = useMemo(() => {\n const allColumns: GridColumnType[] = [];\n if (showRowNumbers) {\n allColumns.push({\n label: '#',\n text: '',\n key: '',\n type: 'rowNumber' as 'rowNumber',\n className: 'custom-row-number-cell',\n width: 80,\n isResizable: false,\n });\n }\n allColumns.push(...columns);\n if (showActionColumn) {\n allColumns.push({\n label: '',\n text: '',\n key: 'actions',\n type: 'rowAction' as 'rowAction',\n className: 'custom-row-action-cell',\n width: 80,\n isResizable: false,\n });\n }\n return allColumns;\n }, [isLoading]);\n\n const { containerRef, gridColumns, onColumnResize } = useGridColumnsMetaData(\n tableColumns,\n );\n\n // React state for rows\n const filteredRows = getFilteredRows(data, tableColumns, gridFilters, {\n activeSelectData,\n getRowActionMenuItems: getActionMenuItems,\n });\n\n const rows = [getHeaderRow(tableColumns), ...filteredRows];\n\n useEffect(() => {\n // Grid editor is not able to show some rows when the height is not set\n // This is a workaround to trigger a resize event when the data is loaded\n window.dispatchEvent(new Event('resize'));\n }, [isLoading]);\n\n const applyChangesToData = (\n changes: CellChange[],\n prevData: GridRowType[],\n ): { changedRows: GridRowType[]; activeDropdown: ActiveDropdownType } => {\n const { changedRows, activeDropdown } = getChangedRows(prevData, changes);\n\n if (autoAppendRows && appendRowsCount) {\n const lastRow = changedRows[changedRows.length - 1];\n if (isGridRowTouched(lastRow)) {\n const defaultEmptyRow = getDefaultEmptyRow(columns);\n for (let i = 0; i < appendRowsCount; i += 1) {\n changedRows.push({ ...defaultEmptyRow });\n }\n }\n }\n\n return {\n changedRows,\n activeDropdown,\n };\n };\n\n const handleChanges = (changes: CellChange[]) => {\n setData((prevData) => {\n const { changedRows, activeDropdown } = applyChangesToData(\n changes,\n prevData,\n );\n setActiveSelectData(activeDropdown);\n setCellChanges([...cellChanges.slice(0, cellChangesIndex + 1), changes]);\n setCellChangesIndex(cellChangesIndex + 1);\n return changedRows;\n });\n };\n\n const onContextMenu = (\n _selectedRowIds: Id[],\n _selectedColIds: Id[],\n _selectionMode: SelectionMode,\n menuOptions: MenuOption[],\n _selectedRanges: Array,\n ): MenuOption[] => menuOptions;\n\n const isMacOs =\n (navigator.platform?.toUpperCase()?.indexOf('MAC') || -1) >= 0;\n\n const handleUndoChanges = () => {\n if (cellChangesIndex >= 0) {\n setData((prevData) => {\n const changes = cellChanges[cellChangesIndex];\n const { changedRows, activeDropdown } = getChangedRows(\n prevData,\n changes,\n true,\n ); // Use previousCell instead of newCell\n setActiveSelectData(activeDropdown);\n setCellChangesIndex(cellChangesIndex - 1);\n return changedRows;\n });\n }\n };\n\n const handleRedoChanges = () => {\n if (cellChangesIndex + 1 <= cellChanges.length - 1) {\n setData((prevData) => {\n const changes = cellChanges[cellChangesIndex + 1];\n const { changedRows, activeDropdown } = applyChangesToData(\n changes,\n prevData,\n );\n setActiveSelectData(activeDropdown);\n setCellChangesIndex(cellChangesIndex + 1);\n return changedRows;\n });\n }\n };\n\n useEffect(() => {\n if (setIsDirty) {\n setIsDirty(cellChangesIndex >= 0);\n }\n }, [cellChangesIndex]);\n\n return (\n {\n if (\n (isMacOs && e.ctrlKey) ||\n e.ctrlKey ||\n e.metaKey ||\n (isMacOs && e.ctrlKey && e.shiftKey)\n ) {\n if (e.key === 'z') {\n handleUndoChanges();\n } else if (e.key === 'y') {\n handleRedoChanges();\n }\n }\n }}\n style={{ maxHeight, minHeight, overscrollBehaviorX: 'none' }}\n >\n \n {isLoading && (\n \n \n \n )}\n {!isLoading && data.length === 0 && (\n \n \n \n )}\n {!isLoading &&\n !!data.length &&\n filteredRows.length === 0 &&\n gridFilters.isFilterApplied && (\n \n \n \n )}\n \n );\n};\n\nexport default DataEditor;\n","import { Filters } from '@angellist/adapt';\nimport React from 'react';\nimport { DEFAULT_FILTER_VALUES, FILTER_ITEMS } from '../constants';\nimport { FilterChangeFunc } from '../types';\n\ntype Props = {\n onFilterChange: FilterChangeFunc;\n};\n\nconst GridEditorFilters = (props: Props) => {\n const { onFilterChange } = props;\n const defaultSelection = DEFAULT_FILTER_VALUES.state;\n const filtersOptions: any[] = [\n { key: 'search', kind: 'search' as 'search', label: 'Search' },\n {\n key: 'state',\n kind: 'selection' as 'selection',\n variant: 'segmented',\n selectionMode: 'single',\n items: FILTER_ITEMS,\n },\n ];\n\n const processAppliedValues = (values: any) => {\n if (!values) {\n return DEFAULT_FILTER_VALUES;\n }\n let filteredState = defaultSelection;\n const { state, search } = values;\n if (state) {\n filteredState = state.selectedKey;\n }\n const searchText = search?.value?.trim();\n return {\n searchText,\n state: filteredState,\n isFilterApplied: !!(searchText || filteredState !== defaultSelection),\n };\n };\n\n const handleOnChange = (values: any) => {\n onFilterChange(processAppliedValues(values));\n };\n\n return (\n \n );\n};\n\nexport default GridEditorFilters;\n","import { Box, Button, Stack } from '@angellist/adapt';\nimport React, { ReactNode } from 'react';\nimport GridEditorFilters from './GridEditorFilters';\nimport { FilterChangeFunc } from '../types';\n\ntype Props = {\n addRowsCount?: number;\n onAddRowsClick: (numRows?: number) => void;\n onFilterChange: FilterChangeFunc;\n canAddRows: boolean;\n buttons?: Array;\n isLoading?: boolean;\n};\n\nconst TopActionBar = (props: Props) => {\n const {\n onAddRowsClick,\n onFilterChange,\n addRowsCount = 10,\n canAddRows,\n buttons = [],\n isLoading = false,\n } = props;\n\n return (\n \n \n \n {canAddRows && (\n 1 ? 'Add rows' : 'Add row'}\n prefix={'plus' as 'plus'}\n variant=\"secondary\"\n onPress={() => onAddRowsClick(addRowsCount)}\n isDisabled={isLoading}\n />\n )}\n {buttons}\n \n \n );\n};\n\nexport default TopActionBar;\n","import React, { useEffect } from 'react';\nimport './styles/styles.scss';\nimport { Box } from '@angellist/adapt';\nimport DataEditor from './components/DataEditor';\nimport { GridEditorProps, GridFilterValueType } from './types';\nimport { getDefaultEmptyRow } from './utils';\nimport TopActionBar from './components/TopActionBar';\nimport { DEFAULT_FILTER_VALUES } from './constants';\n\ntype Props = {} & GridEditorProps;\n\nconst getGridHeight = (ht: number, showTopActionBar: boolean) => {\n let gridHeight = ht;\n if (ht && showTopActionBar) {\n gridHeight = ht - 65;\n }\n if (gridHeight) {\n gridHeight = Math.max(gridHeight, 200);\n }\n\n return gridHeight;\n};\n\nconst GridEditor = (props: Props) => {\n const {\n columns,\n data,\n setData,\n initialEmptyRowCount = 10,\n showTopActionBar = true,\n topActionButtons,\n maxHeight,\n minHeight,\n addRowsCount = 10,\n canAddRows = true,\n isLoading = false,\n ...dataEditorProps\n } = props;\n\n const [gridFilters, setGridFilters] = React.useState(\n DEFAULT_FILTER_VALUES,\n );\n\n const handleOnFilterChange = (values: GridFilterValueType) => {\n setGridFilters(values);\n };\n\n useEffect(() => {\n if (data.length < initialEmptyRowCount) {\n const defaultEmptyRow = getDefaultEmptyRow(columns);\n const emptyRowCount = Math.abs(initialEmptyRowCount - data.length);\n const initialRowData = new Array(emptyRowCount)\n .fill(0)\n .map(() => ({ ...defaultEmptyRow }));\n setData([...data, ...initialRowData]);\n }\n }, []);\n\n const handleAddRowClick = (numberRows: number = addRowsCount) => {\n const defaultEmptyRow = getDefaultEmptyRow(columns);\n const defaultEmptyRows = new Array(numberRows)\n .fill(0)\n .map(() => ({ ...defaultEmptyRow }));\n\n setData([...data, ...defaultEmptyRows]);\n };\n\n const gridMaxHeight = getGridHeight(maxHeight, showTopActionBar);\n const gridMinHeight = getGridHeight(minHeight, showTopActionBar);\n\n return (\n \n {showTopActionBar && (\n \n )}\n \n \n );\n};\n\nexport default GridEditor;\n","import { useLayoutEffect, useState } from 'react';\n\nconst useGridMaxHeight = (gutterSpace = 200, minHeight = 300) => {\n const [maxHeight, setMaxHeight] = useState(null);\n\n useLayoutEffect(() => {\n const handleResize = () => {\n const maxHt = Math.max(window.innerHeight - gutterSpace, minHeight);\n setMaxHeight(maxHt);\n };\n\n handleResize();\n\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n\n return maxHeight;\n};\n\nexport default useGridMaxHeight;\n","import React from 'react';\nimport { Box, Text, useToast } from '@angellist/adapt';\nimport { ErrorType } from '../utils/error';\nimport { BRANDING } from '../utils/branding';\n\ntype ToastOptions = {\n title?: string;\n description?: string;\n durationMS?: number;\n after?: {\n kind: 'button';\n variant: 'secondary' | 'primary';\n label: string;\n onPress: () => void;\n }[];\n};\n\nconst GraphqlErrors = ({ graphQLErrors }: { graphQLErrors: any }) => {\n const hasError = graphQLErrors && graphQLErrors.length;\n if (hasError) {\n return (\n \n {graphQLErrors.length > 1\n ? graphQLErrors.map((e: ErrorType, index: number) => (\n \n {index + 1}) {e.message}\n \n ))\n : graphQLErrors.map((e: ErrorType, index: number) => (\n \n {e.message}\n \n ))}\n \n );\n }\n\n return (\n \n There was an error. Either try again or contact{' '}\n {BRANDING.supportEmail}\n \n );\n};\n\nconst useAdaptToast = () => {\n const { addToast } = useToast();\n\n const showSuccessToast = (title: string, options?: ToastOptions) =>\n addToast({\n title,\n prefix: {\n kind: 'icon',\n named: 'successFill',\n color: 'successFill',\n },\n ...(options || {}),\n });\n\n const showErrorToast = (title: string, options?: ToastOptions) =>\n addToast({\n title,\n prefix: {\n kind: 'icon',\n named: 'dangerCircleFill',\n color: 'dangerFill',\n },\n ...(options || {}),\n });\n\n const showWarningToast = (title: string, options?: ToastOptions) =>\n addToast({\n title,\n prefix: {\n kind: 'icon',\n named: 'warningFill',\n color: 'warningFill',\n },\n ...(options || {}),\n });\n\n const showGraphQLErrorToast = (graphQLErrors: any, options?: ToastOptions) =>\n addToast({\n title: 'Something went wrong',\n // @ts-ignore\n description: ,\n prefix: {\n kind: 'icon',\n named: 'dangerCircleFill',\n color: 'dangerFill',\n },\n ...(options || {}),\n });\n\n return {\n showSuccessToast,\n showErrorToast,\n showWarningToast,\n showGraphQLErrorToast,\n };\n};\n\nexport default useAdaptToast;\n","import * as React from 'react';\n\nfunction SvgLink(props) {\n return (\n \n \n \n \n );\n}\n\nexport default SvgLink;\n","import { Stack, Text, Progress, Box } from '@angellist/adapt';\nimport React from 'react';\nimport { formatNumber } from '../../helpers/utils';\n\ntype Props = {\n numerator?: number;\n denominator?: number;\n numeratorText?: string | number;\n denominatorText?: string | number;\n suffixText?: string;\n hideProgress?: boolean;\n};\n\nconst UnitsColumn = (props: Props) => {\n const {\n denominator,\n denominatorText,\n numerator,\n numeratorText,\n suffixText,\n hideProgress,\n } = props;\n\n const percentage = Number(\n (((numerator || 0) / (denominator || 1)) * 100).toFixed(2),\n );\n\n return (\n \n \n {numeratorText || formatNumber(numerator || 0)}\n \n  / \n {denominatorText || formatNumber(denominator || 0)} {suffixText}\n \n \n {!hideProgress && }\n \n );\n};\n\nexport default UnitsColumn;\n","import { gql } from '@apollo/client';\n\nconst UPDATE_HEALTH_CHECK = gql`\n mutation UpdateHealthCheck($id: ID!, $status: String!) {\n updateHealthCheck(id: $id, status: $status) {\n id\n title\n displayDescription\n status\n degree\n category\n ownerName\n ownerType\n ownerId\n createdAt\n checkType\n source\n parsedData {\n page\n text\n filename\n }\n enteredValue\n }\n }\n`;\n\nexport default UPDATE_HEALTH_CHECK;\n","import { useAlert } from 'react-alert';\nimport { useMutation } from '@apollo/client';\n\nimport { showGraphQLError } from '../../../helpers/utils';\n\nimport UPDATE_HEALTH_CHECK from '../mutations/UpdateHealthCheck';\n\nconst useUpdateHealthCheck = (id: string) => {\n const alert = useAlert();\n\n const [\n updateHealthCheck,\n { loading: mutationLoading, error: mutationError, called },\n ] = useMutation(UPDATE_HEALTH_CHECK, {\n onCompleted() {\n alert.success('Health check updated successfully');\n },\n onError: ({ graphQLErrors }) => {\n showGraphQLError(alert, graphQLErrors);\n },\n });\n\n const onUpdate = async (status: string) =>\n updateHealthCheck({\n variables: {\n id,\n status,\n },\n });\n\n return { submitting: mutationLoading && called, mutationError, onUpdate };\n};\n\nexport default useUpdateHealthCheck;\n","/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { Menu } from '@angellist/adapt';\nimport { useHistory } from 'react-router-dom';\n\nimport { healthCheckFixPath } from '../utils';\n\nimport useUpdateHealthCheck from '../hooks/useUpdateHealthCheck';\n\nimport { HealthCheck } from '../../../../graphql';\nimport { VoidFunc } from '../../../../types';\nimport { useCompanyContext } from '../../../context/CompanyContext';\n\ntype Props = {\n healthCheck: HealthCheck;\n hideFixPath?: boolean;\n refetch?: VoidFunc;\n placement?: string;\n fixPath?: string;\n};\n\nconst HealthCheckRowActions = ({\n healthCheck,\n refetch,\n fixPath = null,\n placement = null,\n hideFixPath = false,\n}: Props) => {\n const { id, status } = healthCheck;\n const { submitting, onUpdate } = useUpdateHealthCheck(id);\n const history = useHistory();\n const { securityDraftsEnabled } = useCompanyContext();\n\n const handleDeleteClick = async () => {\n await onUpdate('deleted');\n if (refetch) {\n refetch();\n }\n };\n\n const handleResolveClick = async () => {\n await onUpdate('resolved');\n if (refetch) {\n refetch();\n }\n };\n\n const onSelection = (key: string) => {\n if (key === 'resolve') {\n handleResolveClick();\n } else if (key === 'ignore') {\n handleDeleteClick();\n } else if (key === 'fix') {\n history.push(\n fixPath || healthCheckFixPath(healthCheck, securityDraftsEnabled),\n );\n }\n };\n\n return (\n \n Ignore\n {status !== 'resolved' && (\n Mark as resolved\n )}\n {!hideFixPath && Take me to fix}\n \n );\n};\n\nexport default HealthCheckRowActions;\n","// Keep in sync with app/lib/geography.rb\n\nexport const COUNTRY_NAMES_BY_CODE = {\n AF: 'Afghanistan',\n AL: 'Albania',\n DZ: 'Algeria',\n AS: 'American Samoa',\n AD: 'Andorra',\n AO: 'Angola',\n AI: 'Anguilla',\n AQ: 'Antarctica',\n AG: 'Antigua and Barbuda',\n AR: 'Argentina',\n AM: 'Armenia',\n AW: 'Aruba',\n AU: 'Australia',\n AT: 'Austria',\n AZ: 'Azerbaijan',\n BS: 'Bahamas',\n BH: 'Bahrain',\n BD: 'Bangladesh',\n BB: 'Barbados',\n BY: 'Belarus',\n BE: 'Belgium',\n BZ: 'Belize',\n BJ: 'Benin',\n BM: 'Bermuda',\n BT: 'Bhutan',\n BO: 'Bolivia',\n BQ: 'Bonaire, Sint Eustatius and Saba',\n BA: 'Bosnia and Herzegovina',\n BW: 'Botswana',\n BV: 'Bouvet Island',\n BR: 'Brazil',\n IO: 'British Indian Ocean Territory',\n BN: 'Brunei Darussalam',\n BG: 'Bulgaria',\n BF: 'Burkina Faso',\n BI: 'Burundi',\n CV: 'Cabo Verde',\n KH: 'Cambodia',\n CM: 'Cameroon',\n CA: 'Canada',\n KY: 'Cayman Islands',\n CF: 'Central African Republic',\n TD: 'Chad',\n CL: 'Chile',\n CN: 'China',\n CX: 'Christmas Island',\n CC: 'Cocos (Keeling) Islands',\n CO: 'Colombia',\n KM: 'Comoros',\n CD: 'Democratic Republic of the Congo',\n CG: 'Congo',\n CK: 'Cook Islands',\n CR: 'Costa Rica',\n HR: 'Croatia',\n CU: 'Cuba',\n CW: 'Curaçao',\n CY: 'Cyprus',\n CZ: 'Czechia',\n CI: \"Côte d'Ivoire\",\n DK: 'Denmark',\n DJ: 'Djibouti',\n DM: 'Dominica',\n DO: 'Dominican Republic',\n EC: 'Ecuador',\n EG: 'Egypt',\n SV: 'El Salvador',\n GQ: 'Equatorial Guinea',\n ER: 'Eritrea',\n EE: 'Estonia',\n SZ: 'Eswatini',\n ET: 'Ethiopia',\n FK: 'Falkland Islands (Malvinas)',\n FO: 'Faroe Islands',\n FJ: 'Fiji',\n FI: 'Finland',\n FR: 'France',\n GF: 'French Guiana',\n PF: 'French Polynesia',\n TF: 'French Southern Territories',\n GA: 'Gabon',\n GM: 'Gambia',\n GE: 'Georgia',\n DE: 'Germany',\n GH: 'Ghana',\n GI: 'Gibraltar',\n GR: 'Greece',\n GL: 'Greenland',\n GD: 'Grenada',\n GP: 'Guadeloupe',\n GU: 'Guam',\n GT: 'Guatemala',\n GG: 'Guernsey',\n GN: 'Guinea',\n GW: 'Guinea-Bissau',\n GY: 'Guyana',\n HT: 'Haiti',\n HM: 'Heard Island and McDonald Islands',\n VA: 'Vatican (Holy See)',\n HN: 'Honduras',\n HK: 'Hong Kong',\n HU: 'Hungary',\n IS: 'Iceland',\n IN: 'India',\n ID: 'Indonesia',\n IR: 'Iran',\n IQ: 'Iraq',\n IE: 'Ireland',\n IM: 'Isle of Man',\n IL: 'Israel',\n IT: 'Italy',\n JM: 'Jamaica',\n JP: 'Japan',\n JE: 'Jersey',\n JO: 'Jordan',\n KZ: 'Kazakhstan',\n KE: 'Kenya',\n KI: 'Kiribati',\n KP: \"Korea (the Democratic People's Republic of)\",\n KR: 'Korea (the Republic of)',\n KW: 'Kuwait',\n KG: 'Kyrgyzstan',\n LA: \"Lao People's Democratic Republic\",\n LV: 'Latvia',\n LB: 'Lebanon',\n LS: 'Lesotho',\n LR: 'Liberia',\n LY: 'Libya',\n LI: 'Liechtenstein',\n LT: 'Lithuania',\n LU: 'Luxembourg',\n MO: 'Macao',\n MG: 'Madagascar',\n MW: 'Malawi',\n MY: 'Malaysia',\n MV: 'Maldives',\n ML: 'Mali',\n MT: 'Malta',\n MH: 'Marshall Islands',\n MQ: 'Martinique',\n MR: 'Mauritania',\n MU: 'Mauritius',\n YT: 'Mayotte',\n MX: 'Mexico',\n FM: 'Micronesia (Federated States of)',\n MD: 'Moldova (the Republic of)',\n MC: 'Monaco',\n MN: 'Mongolia',\n ME: 'Montenegro',\n MS: 'Montserrat',\n MA: 'Morocco',\n MZ: 'Mozambique',\n MM: 'Myanmar',\n NA: 'Namibia',\n NR: 'Nauru',\n NP: 'Nepal',\n NL: 'Netherlands',\n NC: 'New Caledonia',\n NZ: 'New Zealand',\n NI: 'Nicaragua',\n NE: 'Niger',\n NG: 'Nigeria',\n NU: 'Niue',\n NF: 'Norfolk Island',\n MP: 'Northern Mariana Islands',\n NO: 'Norway',\n OM: 'Oman',\n PK: 'Pakistan',\n PW: 'Palau',\n PS: 'Palestine',\n PA: 'Panama',\n PG: 'Papua New Guinea',\n PY: 'Paraguay',\n PE: 'Peru',\n PH: 'Philippines',\n PN: 'Pitcairn',\n PL: 'Poland',\n PT: 'Portugal',\n PR: 'Puerto Rico',\n QA: 'Qatar',\n MK: 'Republic of North Macedonia',\n RO: 'Romania',\n RU: 'Russian Federation',\n RW: 'Rwanda',\n RE: 'Réunion',\n BL: 'Saint Barthélemy',\n SH: 'Saint Helena, Ascension and Tristan da Cunha',\n KN: 'Saint Kitts and Nevis',\n LC: 'Saint Lucia',\n MF: 'Saint Martin (French part)',\n PM: 'Saint Pierre and Miquelon',\n VC: 'Saint Vincent and the Grenadines',\n WS: 'Samoa',\n SM: 'San Marino',\n ST: 'Sao Tome and Principe',\n SA: 'Saudi Arabia',\n SN: 'Senegal',\n RS: 'Serbia',\n SC: 'Seychelles',\n SL: 'Sierra Leone',\n SG: 'Singapore',\n SX: 'Sint Maarten (Dutch part)',\n SK: 'Slovakia',\n SI: 'Slovenia',\n SB: 'Solomon Islands',\n SO: 'Somalia',\n ZA: 'South Africa',\n GS: 'South Georgia and the South Sandwich Islands',\n SS: 'South Sudan',\n ES: 'Spain',\n LK: 'Sri Lanka',\n SD: 'Sudan',\n SR: 'Suriname',\n SJ: 'Svalbard and Jan Mayen',\n SE: 'Sweden',\n CH: 'Switzerland',\n SY: 'Syrian Arab Republic',\n TW: 'Taiwan',\n TJ: 'Tajikistan',\n TZ: 'Tanzania, United Republic of',\n TH: 'Thailand',\n TL: 'Timor-Leste',\n TG: 'Togo',\n TK: 'Tokelau',\n TO: 'Tonga',\n TT: 'Trinidad and Tobago',\n TN: 'Tunisia',\n TR: 'Turkey',\n TM: 'Turkmenistan',\n TC: 'Turks and Caicos Islands',\n TV: 'Tuvalu',\n UG: 'Uganda',\n UA: 'Ukraine',\n AE: 'United Arab Emirates',\n GB: 'United Kingdom',\n UM: 'United States Minor Outlying Islands',\n US: 'United States',\n UY: 'Uruguay',\n UZ: 'Uzbekistan',\n VU: 'Vanuatu',\n VE: 'Venezuela',\n VN: 'Viet Nam',\n VG: 'Virgin Islands (British)',\n VI: 'Virgin Islands (U.S.)',\n WF: 'Wallis and Futuna',\n EH: 'Western Sahara',\n YE: 'Yemen',\n ZM: 'Zambia',\n ZW: 'Zimbabwe',\n AX: 'Åland Islands',\n};\n\nexport const COUNTRY_OPTIONS = Object.entries(\n COUNTRY_NAMES_BY_CODE,\n).map(([value, label]) => ({ value, label }));\n","import { COUNTRY_NAMES_BY_CODE } from './address/countries';\nimport { STATES } from './address/states';\n\n// Parses a location, converting country and state codes to their respective names\nexport const parseLocation = ({\n city,\n stateNameOrCode,\n countryCode,\n}: {\n city?: string;\n stateNameOrCode?: string;\n countryCode?: keyof typeof COUNTRY_NAMES_BY_CODE;\n}) => {\n const stateNamesByCode = STATES[countryCode as keyof typeof STATES] ?? {};\n\n const base = {\n city: city?.trim(),\n state:\n stateNamesByCode[stateNameOrCode as keyof typeof stateNamesByCode] ??\n stateNameOrCode?.trim(),\n country: COUNTRY_NAMES_BY_CODE[countryCode],\n };\n\n return {\n ...base,\n parts: [base.city, base.state, base.country].filter(Boolean),\n };\n};\n","import { ObjectType } from '../../../types';\nimport paths from '../../paths';\n\nexport const STATUS = {\n DRAFT: 'draft',\n ACTIVE: 'active',\n CANCELLED: 'cancelled',\n REPURCHASED: 'repurchased',\n CONVERTED: 'converted',\n TRANSFERRED: 'transferred',\n FULL_TRANSFER: 'full_transfer',\n PARTIAL_TRANSFER: 'partial_transfer',\n PENDING_ACCEPTANCE: 'pending_acceptance',\n};\n\nexport const STATUS_SORT_ORDER = {\n [STATUS.DRAFT]: 0,\n [STATUS.PENDING_ACCEPTANCE]: 1,\n [STATUS.ACTIVE]: 2,\n [STATUS.CONVERTED]: 3,\n [STATUS.CANCELLED]: 4,\n [STATUS.REPURCHASED]: 5,\n [STATUS.TRANSFERRED]: 6,\n [STATUS.FULL_TRANSFER]: 7,\n [STATUS.PARTIAL_TRANSFER]: 8,\n};\n\nexport const STATUS_GROUPS = [\n [STATUS.DRAFT, [STATUS.DRAFT]],\n [STATUS.ACTIVE, [STATUS.ACTIVE, null]],\n [STATUS.TRANSFERRED, [STATUS.FULL_TRANSFER, STATUS.PARTIAL_TRANSFER]],\n [STATUS.REPURCHASED, [STATUS.REPURCHASED]],\n [STATUS.CONVERTED, [STATUS.CONVERTED]],\n [STATUS.CANCELLED, [STATUS.CANCELLED]],\n];\n\nexport const STATUS_GROUP_MAP = STATUS_GROUPS.reduce((acc, value) => {\n const [status, stautsGroup]: any = value;\n acc[status] = stautsGroup;\n return acc;\n}, {} as ObjectType);\n\nexport const CERTIFICATE_TYPES = {\n RSA: 'rsa',\n CERTIFICATE: 'certificate',\n};\n\nexport const SHARE_TYPE_OPTIONS = [\n {\n key: CERTIFICATE_TYPES.CERTIFICATE,\n label: 'Certificate',\n value: CERTIFICATE_TYPES.CERTIFICATE,\n },\n {\n key: CERTIFICATE_TYPES.RSA,\n label: 'Shares From Equity Plan',\n value: CERTIFICATE_TYPES.RSA,\n },\n];\n\nexport const OUTSTANDING_STATUS = {\n DRAFT: 'draft',\n OUTSTANDING: 'outstanding',\n CANCELLED: 'cancelled',\n};\n\nexport const OUTSTANDING_STATUS_OPTIONS = [\n {\n key: OUTSTANDING_STATUS.DRAFT,\n label: 'Draft',\n value: OUTSTANDING_STATUS.DRAFT,\n },\n {\n key: OUTSTANDING_STATUS.OUTSTANDING,\n label: 'Outstanding',\n value: OUTSTANDING_STATUS.OUTSTANDING,\n },\n {\n key: OUTSTANDING_STATUS.CANCELLED,\n label: 'Cancelled',\n value: OUTSTANDING_STATUS.CANCELLED,\n },\n];\n\nexport const STATUS_OPTIONS = [\n {\n key: STATUS.DRAFT,\n label: 'Draft',\n value: STATUS.DRAFT,\n },\n {\n key: STATUS.TRANSFERRED,\n label: 'Transferred',\n value: STATUS.TRANSFERRED,\n },\n {\n key: STATUS.ACTIVE,\n label: 'Active',\n value: STATUS.ACTIVE,\n },\n {\n key: STATUS.CANCELLED,\n label: 'Cancelled',\n value: STATUS.CANCELLED,\n },\n {\n key: STATUS.REPURCHASED,\n label: 'Repurchased',\n value: STATUS.REPURCHASED,\n },\n {\n key: STATUS.CONVERTED,\n label: 'Converted',\n value: STATUS.CONVERTED,\n },\n];\n\nexport const STATUS_FILTER_MAP: any = {\n drafts: [STATUS.DRAFT],\n issued: [\n STATUS.ACTIVE,\n STATUS.CANCELLED,\n STATUS.CONVERTED,\n STATUS.REPURCHASED,\n STATUS.TRANSFERRED,\n STATUS.FULL_TRANSFER,\n STATUS.PARTIAL_TRANSFER,\n ],\n};\n\nexport const FILTER_ITEMS = [\n {\n key: 'all',\n value: 'all',\n label: 'All',\n },\n {\n key: 'drafts',\n value: 'drafts',\n label: 'Drafts',\n },\n {\n key: 'issued',\n value: 'issued',\n label: 'Issued',\n },\n];\n\nexport const AllShareCertificateDraftsBreadcrumbs = [\n {\n title: 'Shares',\n link: paths.equity.drafts.shares.all,\n },\n];\n\nexport const ShareCertificateBreadcrumbs = [\n {\n title: 'Shares',\n link: paths.equity.shareCertificates,\n },\n];\n\nexport const ShareCertificateSecurityBreadcrumbs = [\n {\n title: 'Securities',\n link: paths.equity.securities.all,\n },\n {\n title: 'Shares',\n link: paths.equity.securities.shares.all,\n },\n];\n","import { getOptionsNameMap } from '../../helpers/utils';\nimport paths from '../../paths';\n\nexport const STATUS = {\n PENDING_APPROVAL: 'pending_approval',\n PENDING_PAYMENT: 'pending_payment',\n EXECUTED: 'executed',\n CANCELLED: 'cancelled',\n};\n\nexport const EXERCISE_STATUS_MAP = {\n [STATUS.PENDING_APPROVAL]: 'Pending Approval',\n [STATUS.PENDING_PAYMENT]: 'Pending Payment',\n [STATUS.EXECUTED]: 'Completed',\n [STATUS.CANCELLED]: 'Cancelled',\n};\n\nexport const AMENDMENT_STATUS = {\n AMENDMENT_COMPLETE: 'amendment_complete',\n};\n\nexport const AMENDMENT_STATUS_MAP = {\n [AMENDMENT_STATUS.AMENDMENT_COMPLETE]: 'Completed',\n};\nexport const TRANSACTION_TYPES = {\n OPTION_EXERCISE: 'option_exercise',\n ORIGINAL_ISSUANCE: 'original_issuance',\n\n SHARE_REPURCHASED: 'share_repurchase',\n BALANCE_TRANSFER: 'balance_transfer',\n TRANSFER: 'transfer',\n CONVERSION: 'conversion_event',\n AMENDMENT: 'amendment_event',\n STOCK_SPLIT: 'stock_split',\n OTHER_CANCELLATION_EVENT: 'other_cancellation_event',\n};\n\nexport const TRANSACTION_TYPE_OPTIONS = [\n {\n key: TRANSACTION_TYPES.OPTION_EXERCISE,\n label: 'Option Exercise',\n value: TRANSACTION_TYPES.OPTION_EXERCISE,\n },\n {\n key: TRANSACTION_TYPES.ORIGINAL_ISSUANCE,\n label: 'Original Issuance',\n value: TRANSACTION_TYPES.ORIGINAL_ISSUANCE,\n },\n {\n key: TRANSACTION_TYPES.SHARE_REPURCHASED,\n label: 'Repurchase',\n value: TRANSACTION_TYPES.SHARE_REPURCHASED,\n },\n {\n key: TRANSACTION_TYPES.BALANCE_TRANSFER,\n label: 'Balance Transfer',\n value: TRANSACTION_TYPES.BALANCE_TRANSFER,\n },\n {\n key: TRANSACTION_TYPES.TRANSFER,\n label: 'Transfer',\n value: TRANSACTION_TYPES.TRANSFER,\n },\n {\n key: TRANSACTION_TYPES.CONVERSION,\n label: 'Conversion',\n value: TRANSACTION_TYPES.CONVERSION,\n },\n {\n key: TRANSACTION_TYPES.AMENDMENT,\n label: 'Amendment',\n value: TRANSACTION_TYPES.AMENDMENT,\n },\n {\n key: TRANSACTION_TYPES.STOCK_SPLIT,\n label: 'Stock Split',\n value: TRANSACTION_TYPES.STOCK_SPLIT,\n },\n {\n key: TRANSACTION_TYPES.OTHER_CANCELLATION_EVENT,\n label: 'Other cancellation',\n value: TRANSACTION_TYPES.OTHER_CANCELLATION_EVENT,\n },\n];\n\nexport const TRANSACTION_TYPE_NAME_MAP = getOptionsNameMap(\n TRANSACTION_TYPE_OPTIONS,\n);\n\nexport const getTransactionTypeValue = (transactionType: string) =>\n TRANSACTION_TYPE_NAME_MAP[transactionType];\n\nexport const transactionsBreadcrumbs = [\n {\n title: 'Transactions',\n link: paths.equity.transactions,\n },\n];\n","import { gql } from '@apollo/client';\n\nconst ESOP_GRANT_FRAGMENT = gql`\n fragment EsopGrantFragment on EsopGrant {\n id\n name\n currency\n employee {\n id\n user {\n id\n name\n }\n }\n }\n`;\n\nexport default ESOP_GRANT_FRAGMENT;\n","import { gql } from '@apollo/client';\nimport ESOP_GRANT_FRAGMENT from '../fragments/esopGrantFragment';\n\nconst GRANT_SURRENDER_QUERY = gql`\n query GrantSurrender($id: ID!) {\n grantSurrender(id: $id) {\n id\n state\n numUnits\n surrenderType\n surrenderedAt\n grantType\n createdAt\n reason\n adminNotes\n surrenderedAt\n paymentMode\n price {\n fractional\n dollars\n currency\n betterFormat\n }\n buybackEligibility {\n validFrom\n description\n maxBuybackShares\n maxBuybackPercentOfVested\n buyback {\n id\n name\n }\n priceOfferedPerShare {\n fractional\n betterFormat\n }\n }\n company {\n currency\n }\n grant {\n ...EsopGrantFragment\n }\n }\n }\n ${ESOP_GRANT_FRAGMENT}\n`;\n\nexport default GRANT_SURRENDER_QUERY;\n","import { useQuery } from '@apollo/client';\nimport GRANT_SURRENDER_QUERY from '../queries/grantSurrenderQuery';\nimport { cloneObject } from '../../../utils';\n\nconst useGrantSurrender = (id: string) => {\n const { loading, error, data } = useQuery(GRANT_SURRENDER_QUERY, {\n variables: { id },\n });\n\n if (error) {\n throw error;\n }\n\n const grantSurrender = cloneObject(data?.grantSurrender);\n\n return [loading, grantSurrender];\n};\n\nexport default useGrantSurrender;\n","import * as React from 'react';\n\nfunction SvgShow(props) {\n return (\n \n \n \n );\n}\n\nexport default SvgShow;\n","import { gql } from '@apollo/client';\n\nconst ALL_EQUITY_TRANSACTIONS_QUERY = gql`\n query AllEquityTransactions($companyId: ID!) {\n allEquityTransactions(companyId: $companyId) {\n id\n state\n numUnits\n createdAt\n instrumentType\n transactionDate\n transactionType\n instrumentId\n instrumentName\n stakeholder {\n id\n name\n }\n }\n }\n`;\n\nexport default ALL_EQUITY_TRANSACTIONS_QUERY;\n","import { gql } from '@apollo/client';\n\nconst UPDATE_ESOP_EXERCISE_MUTATION = gql`\n mutation UpdateEsopGrantExercise(\n $id: ID!\n $esopExerciseAttributes: EsopExerciseAttributes!\n ) {\n updateEsopGrantExercise(\n id: $id\n esopExerciseAttributes: $esopExerciseAttributes\n ) {\n id\n numExercise\n exerciseAt\n employeeNote\n adminNote\n state\n pricePaid {\n fractional\n currency\n betterFormat\n }\n }\n }\n`;\n\nexport default UPDATE_ESOP_EXERCISE_MUTATION;\n","import { gql } from '@apollo/client';\n\nconst SHARE_CERTIFICATE_SUMMARY_FRAGMENT = gql`\n fragment ShareCertificateSummaryFragment on ShareCertificate {\n id\n certificateId\n notes\n numShares\n outstandingShares\n state\n isActive\n issueDate\n boardApprovalDate\n vestingStartBackdate\n unitsVested\n createdAt\n status\n outstandingStatus\n awardPending\n certificatePending\n noticePending\n fieldsMissingForPublish {\n field\n required\n }\n equityPlan {\n id\n name\n }\n vestingTemplate {\n id\n }\n accelerationTemplate {\n id\n }\n rsaGrant {\n id\n name\n filledOut\n fieldsMissingForPublish {\n field\n required\n }\n grantState\n grantDocumentSet {\n id\n hasMissingSignatureBlockFields\n }\n groupingGrantStatus\n transactionStatus\n grantedAt\n equityPlan {\n id\n name\n }\n shareCertificate {\n id\n unitsVested\n numShares\n certificateId\n }\n stakeholder {\n id\n entityName\n entityType\n role\n }\n grantIssuance {\n id\n completedAt\n }\n }\n pricePerShare {\n dollars\n fractional\n currency\n betterFormat\n }\n capitalContribution {\n dollars\n fractional\n currency\n betterFormat\n }\n valueOfIpContribution {\n fractional\n dollars\n currency\n }\n valueOfDebtCancelled {\n fractional\n dollars\n currency\n }\n valueOfOtherConsideration {\n fractional\n dollars\n currency\n }\n esopScheme {\n id\n name\n }\n shareClass {\n name\n id\n preferenceLevel\n }\n shareholder {\n id\n entityName\n entityType\n role\n user {\n id\n email\n }\n stakeholder {\n id\n name\n }\n }\n securityInvite {\n id\n issuanceMethod\n status\n sentAt\n recipientEmail\n certificateIssuance {\n id\n }\n }\n convertedAt\n convertedToId\n conversionNotes\n converted\n }\n`;\n\nexport default SHARE_CERTIFICATE_SUMMARY_FRAGMENT;\n","import { gql } from '@apollo/client';\nimport SHARE_CERTIFICATE_SUMMARY_FRAGMENT from '../fragments/ShareCertificateSummaryFragment';\n\nconst ALL_CERTIFICATES_QUERY = gql`\n query allCertificatesQuery($id: ID!, $rsasOnly: Boolean) {\n allCertificates(companyId: $id, rsasOnly: $rsasOnly) {\n ...ShareCertificateSummaryFragment\n }\n }\n ${SHARE_CERTIFICATE_SUMMARY_FRAGMENT}\n`;\n\nexport default ALL_CERTIFICATES_QUERY;\n","import { useMutation } from '@apollo/client';\nimport { VoidFunc } from '../../../../types';\nimport { useCompanyContext } from '../../../context/CompanyContext';\nimport ALL_EQUITY_TRANSACTIONS_QUERY from '../../equity_transactions/queries/allEquityTransactionsQuery';\nimport UPDATE_ESOP_EXERCISE_MUTATION from '../mutations/updateExerciseMutation';\nimport ALL_CERTIFICATES_QUERY from '../../share_certificates/queries/allCertificatesQuery';\n\nconst useUpdateEsopExercise = (\n id: string,\n addNewShareCertificate: boolean,\n afterUpdate: VoidFunc,\n) => {\n const { id: companyId } = useCompanyContext();\n\n const refetchQueries: any = [\n {\n query: ALL_EQUITY_TRANSACTIONS_QUERY,\n variables: { companyId },\n },\n ];\n\n if (addNewShareCertificate) {\n refetchQueries.push({\n query: ALL_CERTIFICATES_QUERY,\n variables: { id: companyId },\n });\n }\n\n const [\n updateExercise,\n { loading: mutationLoading, error: mutationError, called },\n ] = useMutation(UPDATE_ESOP_EXERCISE_MUTATION, {\n onCompleted() {\n afterUpdate();\n },\n refetchQueries,\n context: {\n hasUpload: true,\n },\n });\n\n const onUpdate = (formData: any) => {\n const {\n pricePaid,\n shareCertificateName,\n pricePerShare,\n ...restFormData\n } = formData;\n const esopExerciseAttributes = {\n pricePaidCents: pricePaid?.fractional,\n pricePaidCurrency: pricePaid?.currency,\n ...restFormData,\n };\n\n if (shareCertificateName) {\n esopExerciseAttributes.shareCertificateName = shareCertificateName;\n esopExerciseAttributes.pricePerShareCents = pricePerShare?.fractional;\n esopExerciseAttributes.pricePerShareCurrency = pricePerShare?.currency;\n }\n\n updateExercise({\n variables: {\n id,\n esopExerciseAttributes,\n },\n });\n };\n\n return {\n submitting: mutationLoading && called,\n mutationError,\n onUpdate,\n };\n};\n\nexport default useUpdateEsopExercise;\n","import { gql, useQuery } from '@apollo/client';\nimport { useCompanyContext } from '../../../context/Context';\nimport { OptionType } from '../../../../types';\nimport { ShareCertificate } from '../../../../graphql';\n\nconst SHARE_CERTICATE_OPTIONS_QUERY = gql`\n query shareCertifiacteOptions($companyId: ID!) {\n allCertificates(companyId: $companyId) {\n id\n certificateId\n shareholder {\n id\n entityName\n }\n }\n }\n`;\n\nconst useCertificatesOptionsList = (shareCertificateId?: string) => {\n const { id: companyId } = useCompanyContext();\n\n const { loading, data } = useQuery(SHARE_CERTICATE_OPTIONS_QUERY, {\n variables: { companyId },\n });\n\n const defaultData: any = { allCertificates: [] };\n\n const { allCertificates } = data || defaultData;\n\n const shareCertificateOptions: OptionType[] = [];\n allCertificates.forEach((shareCert: ShareCertificate) => {\n if (shareCertificateId !== shareCert.id) {\n shareCertificateOptions.push({\n value: shareCert.id,\n label: `${shareCert.certificateId}: ${shareCert.shareholder.entityName}`,\n });\n }\n });\n\n return [loading, shareCertificateOptions];\n};\n\nexport default useCertificatesOptionsList;\n","import { gql } from '@apollo/client';\n\nconst EXERCISE_STATS_QUERY = gql`\n query grantQuery($id: ID!, $asOf: Date) {\n esopGrant(id: $id) {\n id\n optionsVested(asOf: $asOf)\n optionsUnvested(asOf: $asOf)\n }\n }\n`;\n\nexport default EXERCISE_STATS_QUERY;\n","import { useQuery } from '@apollo/client';\nimport EXERCISE_STATS_QUERY from '../queries/ExerciseStatsQuery';\nimport { cloneObject } from '../../../utils';\n\nconst useExerciseStats = (esopGrantId: string, asOf: string) => {\n const { loading, error, data } = useQuery(EXERCISE_STATS_QUERY, {\n variables: { id: esopGrantId, asOf },\n skip: !asOf,\n });\n\n if (error) {\n throw error;\n }\n const stats = cloneObject(\n data?.esopGrant || {\n optionsVested: 0,\n optionsUnvested: 0,\n },\n );\n\n return [loading, stats];\n};\n\nexport default useExerciseStats;\n","import React from 'react';\nimport { useFormContext } from 'react-hook-form';\n\nimport { Stack, Heading, Box, TextButton, Callout } from '@angellist/adapt';\n\nimport {\n DECIMAL_LIMIT,\n formatNumber,\n getDate,\n getObjectValue,\n processError,\n} from '../../../helpers/utils';\nimport ErrorAlert from '../../common/ErrorAlert';\nimport { EsopExercise, EsopGrant } from '../../../../graphql';\nimport {\n DateInput,\n NumberInput,\n Textarea,\n FileUpload,\n AdaptMoneyInput,\n Select,\n Input,\n Row,\n} from '../../common/adapt-form';\nimport { useCompanyContext } from '../../../context/CompanyContext';\nimport useCertificatesOptionsList from '../../share_certificates/hooks/useCertificatesOptionsList';\nimport { DateType, OptionType } from '../../../../types';\nimport useExerciseStats from '../hooks/useExerciseStats';\nimport { formatDateInMDY } from '../../../utils/date';\n\ntype Props = {\n esopGrant: EsopGrant;\n mutationError: any;\n esopExercise?: EsopExercise;\n addNewShareCertificate: boolean;\n setAddNewShareCertificate: (value: boolean) => void;\n};\n\nconst ExerciseForm = (props: Props) => {\n const {\n esopGrant,\n mutationError,\n esopExercise,\n addNewShareCertificate,\n setAddNewShareCertificate,\n } = props;\n const { errors, control, watch } = useFormContext();\n const { currency: defaultCurrency } = useCompanyContext();\n const [optionLoading, shareCertificateOptions] = useCertificatesOptionsList();\n const watchExerciseAt = watch('exerciseAt', esopExercise?.exerciseAt);\n const watchIsEarlyExercise = watch(\n 'isEarlyExercise',\n esopExercise?.isEarlyExercise,\n );\n\n const defaultValue = esopExercise?.pricePaid?.fractional;\n const defaultCurrencyValue = getObjectValue(\n esopExercise?.pricePaid,\n 'currency',\n defaultCurrency,\n );\n\n const { grantedAt } = esopGrant;\n\n const [statsLoading, exerciseStats] = useExerciseStats(\n esopGrant.id,\n watchExerciseAt,\n );\n\n const maxAllowedNumExercise = watchIsEarlyExercise\n ? exerciseStats?.optionsUnvested\n : exerciseStats?.optionsVested;\n\n let maxRule;\n if (!watchExerciseAt) {\n maxRule = {\n value: 0,\n message: 'Please select an exercise date to see the available options',\n };\n } else if (maxAllowedNumExercise) {\n maxRule = {\n value: maxAllowedNumExercise,\n message: `Number of shares exercised must be less than or equal to ${formatNumber(\n maxAllowedNumExercise,\n )}`,\n };\n } else if (maxAllowedNumExercise <= 0) {\n maxRule = {\n value: 0,\n message: 'No unexercised options available for exercise',\n };\n }\n\n return (\n \n \n \n {\n if (grantedAt && getDate(date) < getDate(grantedAt)) {\n return `You cannot set the exercise date to be before the grant date (${formatDateInMDY(\n grantedAt,\n )}).`;\n }\n return true;\n },\n },\n }}\n defaultValue={esopExercise ? esopExercise.exerciseAt : null}\n error={processError(errors.exerciseAt, 'Exercise date')}\n shouldUnregister\n />\n \n \n \n \n \n \n Share Certificate Details\n \n This share will be linked to the equity plan associated with the\n option being exercised.\n \n {addNewShareCertificate ? (\n <>\n \n \n \n \n \n setAddNewShareCertificate(false)}\n />\n \n \n \n ) : (\n \n \n \n setAddNewShareCertificate(true)}\n />\n \n \n )}\n \n \n Documents & Notes\n \n \n \n \n );\n};\n\nexport default ExerciseForm;\n","import React, { useState } from 'react';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport { Form } from 'reactstrap';\nimport { Modal } from '@angellist/adapt';\n\nimport { ModalActions, VoidFunc } from '../../../../types';\nimport useUpdateEsopExercise from '../hooks/useUpdateEsopExercise';\nimport ExerciseForm from './ExerciseForm';\nimport { EsopExercise, EsopGrant } from '../../../../graphql';\n\ntype Props = {\n esopGrant: EsopGrant;\n esopExercise: EsopExercise;\n refetchExercises: VoidFunc;\n} & Pick;\n\nconst EditExerciseModal = (props: Props) => {\n const {\n esopGrant,\n esopExercise,\n refetchExercises,\n modal,\n closeModal,\n } = props;\n const formProps = useForm();\n const [addNewShareCertificate, setAddNewShareCertificate] = useState(false);\n\n const { submitting, mutationError, onUpdate } = useUpdateEsopExercise(\n esopExercise.id,\n addNewShareCertificate,\n () => {\n closeModal();\n refetchExercises();\n },\n );\n\n return (\n {\n formProps.handleSubmit(onUpdate)(e);\n },\n },\n ],\n }}\n onClose={closeModal}\n isOpen={modal}\n >\n \n
\n \n \n
\n \n );\n};\n\nexport default EditExerciseModal;\n","import React from 'react';\nimport { Link } from 'react-router-dom';\n\nimport ShowIcon from '../../../../css/icons/Show';\nimport EditSvg from '../../../../css/icons/Edit';\nimport ActionMenu from '../../common/ActionMenu';\nimport ActionButton from '../../common/ActionButton';\n\nimport useModal from '../../common/hooks/useModal';\nimport paths from '../../../paths';\nimport EditExerciseModal from './EditExerciseModal';\nimport { EsopExercise, EsopGrant } from '../../../../graphql';\nimport { VoidFunc } from '../../../../types';\n\ntype Props = {\n esopGrant: EsopGrant;\n esopExercise: EsopExercise;\n refetchExercises: VoidFunc;\n};\n\nconst ExerciseRowActions = (props: Props) => {\n const { esopGrant, esopExercise, refetchExercises } = props;\n const editActions = useModal();\n\n return (\n <>\n \n }\n />\n }\n onClick={() => editActions.openModal()}\n />\n \n {editActions.modal && (\n \n )}\n \n );\n};\n\nexport default ExerciseRowActions;\n","import { compact } from 'lodash';\nimport { BRANDING } from '../../context/BrandingContext';\n\nexport const STATUS = {\n DRAFT: 'draft',\n PENDING_EMPLOYEE_SIGNATURE: 'pending_employee_signature',\n PENDING_COMPANY_SIGNATURE: 'pending_company_signature',\n PENDING_SPOUSE_SIGNATURE: 'pending_spouse_signature',\n AWAITING_BOARD_CONSENT: 'awaiting_board_consent',\n BOARD_APPROVED: 'board_approved',\n CANCELLED: 'cancelled',\n REPURCHASED: 'repurchased',\n ACTIVE: 'active',\n CONVERTED: 'converted',\n GRANTED: 'granted',\n FULLY_EXERCISED: 'fully_exercised',\n OUTSTANDING: 'outstanding',\n PENDING_ISSUANCE: 'pending_issuance',\n FORFEITED: 'forfeited',\n PARTIALLY_EXERCISED: 'partially_exercised',\n EXPIRED: 'expired',\n};\n\nexport const STATUS_SORT_ORDER = {\n [STATUS.DRAFT]: 0,\n [STATUS.PENDING_ISSUANCE]: 1,\n [STATUS.OUTSTANDING]: 2,\n [STATUS.CONVERTED]: 3,\n [STATUS.CANCELLED]: 4,\n [STATUS.FORFEITED]: 5,\n [STATUS.REPURCHASED]: 6,\n [STATUS.FULLY_EXERCISED]: 7,\n [STATUS.PARTIALLY_EXERCISED]: 8,\n};\n\nexport const STATUS_OPTIONS = [\n {\n key: STATUS.DRAFT,\n label: 'Draft',\n value: STATUS.DRAFT,\n },\n {\n key: STATUS.PENDING_ISSUANCE,\n label: 'Pending Issuance',\n value: STATUS.PENDING_ISSUANCE,\n },\n {\n key: STATUS.OUTSTANDING,\n label: 'Outstanding',\n value: STATUS.OUTSTANDING,\n },\n {\n key: STATUS.CONVERTED,\n label: 'Converted',\n value: STATUS.CONVERTED,\n },\n {\n key: STATUS.CANCELLED,\n label: 'Cancelled',\n value: STATUS.CANCELLED,\n },\n {\n key: STATUS.FORFEITED,\n label: 'Forfeited',\n value: STATUS.FORFEITED,\n },\n {\n key: STATUS.REPURCHASED,\n label: 'Repurchased',\n value: STATUS.REPURCHASED,\n },\n {\n key: STATUS.FULLY_EXERCISED,\n label: 'Fully Exercised',\n value: STATUS.FULLY_EXERCISED,\n },\n {\n key: STATUS.PARTIALLY_EXERCISED,\n label: 'Partially Exercised',\n value: STATUS.PARTIALLY_EXERCISED,\n },\n];\n\nexport const STATUS_FILTER_MAP: any = {\n drafts: [\n STATUS.AWAITING_BOARD_CONSENT,\n STATUS.BOARD_APPROVED,\n STATUS.DRAFT,\n STATUS.PENDING_EMPLOYEE_SIGNATURE,\n STATUS.PENDING_COMPANY_SIGNATURE,\n STATUS.PENDING_SPOUSE_SIGNATURE,\n STATUS.PENDING_ISSUANCE,\n ],\n issued: [\n STATUS.GRANTED,\n STATUS.OUTSTANDING,\n STATUS.CANCELLED,\n STATUS.CONVERTED,\n STATUS.REPURCHASED,\n STATUS.FULLY_EXERCISED,\n STATUS.FORFEITED,\n ],\n};\n\nexport const ISSUED_STATUS_OPTIONS = STATUS_OPTIONS.filter(\n (option) => !STATUS_FILTER_MAP.drafts.includes(option.key),\n);\n\nexport const DRAFT_STATUS_OPTIONS = STATUS_OPTIONS.filter((option) =>\n STATUS_FILTER_MAP.drafts.includes(option.key),\n);\n\nexport const NON_EXERCISABLE_STATUSES = [\n STATUS.CANCELLED,\n STATUS.FULLY_EXERCISED,\n STATUS.EXPIRED,\n STATUS.PENDING_ISSUANCE,\n];\n\nexport const FILTER_ITEMS = [\n {\n key: 'all',\n value: 'all',\n label: 'All',\n },\n {\n key: 'drafts',\n value: 'drafts',\n label: 'Drafts',\n },\n {\n key: 'issued',\n value: 'issued',\n label: 'Issued',\n },\n];\n\nexport const GRANT_TYPES = {\n ESOP_GRANT: 'esop_grant',\n RSA_GRANT: 'rsa_grant',\n};\n\nexport const ESOP_GRANT_SUB_TYPES = {\n ESOP_GRANT_ISO: 'ISO',\n ESOP_GRANT_NSO: 'NSO',\n ESOP_GRANT_RSU: 'RSU',\n ESOP_GRANT_INTL: 'INTL',\n ESOP_GRANT_EMI: 'EMI',\n ESOP_GRANT_SAR: 'SAR',\n ESOP_GRANT_OTHER: 'OTHER',\n};\n\nexport const ALL_ESOP_GRANT_TYPES = [\n GRANT_TYPES.ESOP_GRANT,\n ...(Object.values(ESOP_GRANT_SUB_TYPES) as string[]),\n];\n\nexport const getAllGrantTypeOptions = ({\n showOldRsus,\n showOtherGrantType,\n}: {\n showOldRsus: boolean;\n showOtherGrantType: boolean;\n}) =>\n compact([\n {\n key: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_ISO,\n label: 'Option (ISO)',\n value: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_ISO,\n },\n {\n key: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_NSO,\n label: 'Option (NSO)',\n value: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_NSO,\n },\n {\n key: GRANT_TYPES.ESOP_GRANT,\n label: 'Option',\n value: GRANT_TYPES.ESOP_GRANT,\n },\n showOldRsus\n ? {\n key: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_RSU,\n label: 'RSU',\n value: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_RSU,\n }\n : null,\n {\n key: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_SAR,\n label: 'SAR',\n value: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_SAR,\n },\n {\n key: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_INTL,\n label: 'Option (INTL)',\n value: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_INTL,\n },\n {\n key: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_EMI,\n label: 'Option (EMI)',\n value: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_EMI,\n },\n showOtherGrantType\n ? {\n key: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_OTHER,\n label: 'Option (Other)',\n value: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_OTHER,\n }\n : null,\n ]);\n\nexport const DELETE_GRANT_FAQ = [\n {\n question: 'Why I am not able to delete the executed grants?',\n answer: `A grant moves to executed state when the E-Sign for grant letter is completed by both parties(company and employee). Deleting the grant would mean to nullify the existing agreement and ${BRANDING.name} do not have the power to do so without approval from the company admins.`,\n },\n {\n question: 'What should I do to delete an executed grant?',\n answer: `Please contact ${BRANDING.name} at ${BRANDING.supportEmail} with details of executed grants you want to delete.`,\n },\n {\n question: 'What will happen when I delete grant',\n answer:\n 'It will immediately and permanently delete all grant documents and data associated with this grant.',\n },\n];\n\nexport const SEND_EMPLOYEE_EMAIL_INVITE_FAQ = [\n {\n question: 'Why I cannot send employee invite to the executed grants?',\n answer: `Employee do not need to re-sign the grant letter for executed grants. Instead use \"send employee invite without E-sign\" feature to invite the employee to ${BRANDING.name} or send a welcome invite email from Employee details page.`,\n },\n {\n question:\n 'Why do I need to generate a grant letter before sending invite email?',\n answer: `The grant letter acts as a agreement between company and the employee and is mandatory for freshly issued grants to complete the process before inviting employees to sign the letter and use ${BRANDING.name}.`,\n },\n {\n question: 'Why do I need to configure grant letter for E-sign?',\n answer: `${BRANDING.name} uses SignEasy to digital sign a grant letter. Grant letter needs to be configured for E-sign before the invite email is sent to the employee.`,\n },\n {\n question: `How do I invite to employee to ${BRANDING.name} without sending an grant invite email?`,\n answer:\n 'You can send a employee invite email from the employee details page.',\n },\n];\n\nexport const getNewGrantTypeOptions = ({\n showOldRsus,\n showOtherGrantType,\n hideRSA,\n}: {\n showOldRsus: boolean;\n showOtherGrantType: boolean;\n hideRSA?: boolean;\n}) =>\n compact([\n {\n label: 'Option (ISO)',\n value: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_ISO,\n },\n {\n label: 'Option (NSO)',\n value: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_NSO,\n },\n {\n label: 'Option (EMI)',\n value: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_EMI,\n },\n {\n label: 'Option (INTL)',\n value: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_INTL,\n },\n hideRSA\n ? null\n : {\n label: 'RSA',\n value: GRANT_TYPES.RSA_GRANT,\n },\n {\n label: 'SAR',\n value: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_SAR,\n },\n showOldRsus\n ? {\n label: 'RSU',\n value: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_RSU,\n }\n : null,\n showOtherGrantType\n ? {\n label: 'Other',\n value: ESOP_GRANT_SUB_TYPES.ESOP_GRANT_OTHER,\n }\n : null,\n ]);\n","import React from 'react';\nimport { EquityTransaction, EsopGrant, ExercisePeriod } from '../../../graphql';\nimport { ObjectType, VoidFunc } from '../../../types';\nimport { COLUMN_ATTRIBUTES } from '../../utils/column';\nimport {\n IdFormatter,\n getTransactionTypeValue,\n granttransactionStatusFormatter,\n} from '../equity_transactions/utils';\nimport ExerciseRowActions from './PriorExercises/ExerciseRowActions';\nimport {\n DECIMAL_LIMIT,\n formatNumberWithPrecision,\n formatToNumber,\n} from '../../helpers/utils';\nimport { TRANSACTION_TYPES } from '../equity_transactions/constant';\nimport paths from '../../paths';\nimport { STATUS } from '../grants/constants';\nimport { EXERCISE_PERIOD_REGEX } from '../../../shared/components/importer/validators';\n\ninterface TransactionRow {\n transactionType: string;\n numUnits: number;\n [key: string]: any;\n}\n\nconst quantityFormatter = (num: number, row: TransactionRow): string =>\n row.transactionType === TRANSACTION_TYPES.AMENDMENT\n ? '—'\n : formatNumberWithPrecision(num, DECIMAL_LIMIT.NUM_EXERCISE);\n\nexport const formatGrantType = (grantType?: string, isIsoNso?: boolean) => {\n if (isIsoNso) {\n return 'Option (ISO/NSO)';\n }\n\n if (grantType === 'NSO') {\n return 'Option (NSO)';\n }\n if (grantType === 'ISO') {\n return 'Option (ISO)';\n }\n if (grantType === 'RSU') {\n return 'RSU Award';\n }\n if (grantType === 'SAR') {\n return 'SAR';\n }\n if (grantType === 'INTL') {\n return 'Option (INTL)';\n }\n if (grantType === 'EMI') {\n return 'Option (EMI)';\n }\n if (grantType === 'OTHER') {\n return 'Option (Other)';\n }\n return 'Option';\n};\n\nexport const getDurationValue = (duration: number, interval: string) => {\n if (interval === 'unlimited') {\n return 'Unlimited';\n }\n if (duration || duration === 0) {\n const intervalText = duration <= 1 ? interval : `${interval}s`;\n return `${duration} ${intervalText}`;\n }\n\n return '—';\n};\n\nexport const getExercisePeriodOptions = (exercisePeriod: ExercisePeriod) => [\n {\n label: 'Voluntary Termination',\n value: getDurationValue(\n exercisePeriod?.voluntaryTerminationDuration,\n exercisePeriod?.voluntaryTerminationInterval,\n ),\n },\n {\n label: 'Involuntary Termination',\n value: getDurationValue(\n exercisePeriod?.involuntaryTerminationDuration,\n exercisePeriod?.involuntaryTerminationInterval,\n ),\n },\n {\n label: 'Termination For Cause',\n value: getDurationValue(\n exercisePeriod?.terminationForCauseDuration,\n exercisePeriod?.terminationForCauseInterval,\n ),\n },\n {\n label: 'Death',\n value: getDurationValue(\n exercisePeriod?.deathDuration,\n exercisePeriod?.deathInterval,\n ),\n },\n {\n label: 'Disability',\n value: getDurationValue(\n exercisePeriod?.disabilityDuration,\n exercisePeriod?.disabilityInterval,\n ),\n },\n {\n label: 'Retirement',\n value: getDurationValue(\n exercisePeriod?.retirementDuration,\n exercisePeriod?.retirementInterval,\n ),\n },\n];\n\nexport const shouldRegenerateGrant = (data: any, esopGrant: EsopGrant) => {\n const {\n grantDetailAttributes: {\n numOptions,\n exercisePrice,\n expiryDate,\n grantType,\n grantedAt,\n name,\n stakeholderId,\n },\n vestingAttributes: {\n vestingStartBackdate = null,\n vestingTemplateId = null,\n allowEarlyExercise = false,\n accelerationTemplateId = null,\n acceleratedVestingDescription = null,\n },\n grantDocumentAttributes: { usedGrantDocumentSetId },\n } = data;\n\n const regenFields = [];\n if (numOptions !== esopGrant.grantTerms.numOptions) {\n regenFields.push('Number of options');\n }\n if (\n exercisePrice.fractional !== esopGrant.grantTerms.exercisePrice.fractional\n ) {\n regenFields.push('Exercise price');\n }\n if (expiryDate !== esopGrant.grantTerms.expiryDate) {\n regenFields.push('Expiry date');\n }\n if (vestingStartBackdate !== esopGrant.grantTerms.vestingStartBackdate) {\n regenFields.push('Vesting start backdate');\n }\n if (vestingTemplateId !== (esopGrant.vestingTemplate?.id || null)) {\n regenFields.push('Vesting template');\n }\n if (!!vestingTemplateId && esopGrant.vestingEvents.length === 0) {\n regenFields.push('Vesting schedule (template set but no events)');\n }\n if (usedGrantDocumentSetId !== esopGrant.usedGrantDocumentSetId) {\n regenFields.push('Grant document template');\n }\n if (grantType !== esopGrant.grantType) {\n regenFields.push('Grant type');\n }\n if (grantedAt !== esopGrant.grantTerms.grantedAt) {\n regenFields.push('Grant date');\n }\n if (name !== esopGrant.name) {\n regenFields.push('Grant name');\n }\n if (stakeholderId !== esopGrant.stakeholder?.id) {\n regenFields.push('Grant holder');\n }\n if (allowEarlyExercise !== esopGrant.allowEarlyExercise) {\n regenFields.push('Allow early exercise');\n }\n if (accelerationTemplateId !== (esopGrant.accelerationTemplate?.id || null)) {\n regenFields.push('Acceleration template');\n }\n if (\n acceleratedVestingDescription !== esopGrant.acceleratedVestingDescription\n ) {\n regenFields.push('Acceleration description');\n }\n\n return regenFields;\n};\n\nexport const TRANSACTION_COLUMNS = (\n esopGrant: EsopGrant,\n refetchGrant: VoidFunc,\n) => [\n {\n ...COLUMN_ATTRIBUTES.DATE,\n dataField: 'transactionDate',\n text: 'Transaction Date',\n formatter: (_: string, equityTransaction: EquityTransaction) => (\n \n ),\n },\n {\n dataField: 'transactionType',\n text: 'Transaction Type',\n formatter: getTransactionTypeValue,\n searchValue: getTransactionTypeValue,\n sort: true,\n headerStyle: { minWidth: 120 },\n },\n {\n ...COLUMN_ATTRIBUTES.NUMBER,\n dataField: 'numUnits',\n text: 'Quantity',\n formatter: quantityFormatter,\n },\n {\n dataField: 'state',\n text: 'Status',\n formatter: granttransactionStatusFormatter,\n },\n {\n ...COLUMN_ATTRIBUTES.ADAPT_ACTION,\n formatter: (_: any, transaction: EquityTransaction) => {\n // eslint-disable-next-line no-underscore-dangle\n if (transaction.transactionEvent.__typename === 'EsopExercise') {\n return (\n \n );\n }\n\n return null;\n },\n },\n];\n\nexport const formatExercisePeriodAttaributes = (\n exercisePeriodAttributes: any,\n): any => {\n if (exercisePeriodAttributes) {\n const attrs: any = {};\n Object.keys(exercisePeriodAttributes).forEach((periodKey: string) => {\n const period = exercisePeriodAttributes[periodKey];\n attrs[`${periodKey}Duration`] = formatToNumber(period?.duration);\n attrs[`${periodKey}Interval`] = period?.interval;\n });\n return attrs;\n }\n\n return null;\n};\n\nexport const formatUpdateArgs = (formData: any) => {\n const {\n exercisePrice,\n fairMarketValue,\n valuationId,\n ...restGrantDetailAttributes\n } = formData.grantDetailAttributes;\n\n const fmvAttributes: { [key: string]: any } = {};\n if (valuationId === 'custom') {\n fmvAttributes.fairMarketValueCurrency = fairMarketValue?.currency;\n fmvAttributes.fairMarketValueCents = fairMarketValue?.fractional;\n } else {\n fmvAttributes.valuationId = valuationId;\n }\n\n const newGrantDetailAttributes = {\n exercisePriceCurrency: exercisePrice?.currency,\n exercisePriceCents: exercisePrice?.fractional,\n ...fmvAttributes,\n ...restGrantDetailAttributes,\n };\n\n const newFormData = {\n ...newGrantDetailAttributes,\n ...formData.boardConsentAttributes,\n ...formData.documentsAndNotesAttributes,\n ...formData.grantDocumentAttributes,\n ...formData.securitiesComplianceAttributes,\n ...formData.vestingAttributes,\n exercisePeriodAttributes: formatExercisePeriodAttaributes(\n formData.exercisePeriodAttributes,\n ),\n };\n\n return newFormData;\n};\n\nexport const getEsopGrantPath = (\n esopGrant: EsopGrant,\n tab?: string,\n securityDraftsEnabled: boolean = false,\n) => {\n if (!esopGrant) return null;\n if (securityDraftsEnabled) {\n if (esopGrant.transactionStatus === STATUS.DRAFT) {\n return paths.equity.drafts.options.show(esopGrant.id, tab);\n }\n return paths.equity.securities.options.show(esopGrant.id, tab);\n }\n\n return paths.equity.grants.esopGrant(esopGrant.id, tab);\n};\n\nconst INTERVAL_MAP: ObjectType = {\n days: 'day',\n weeks: 'week',\n months: 'month',\n quarters: 'quarter',\n years: 'year',\n};\n\nconst extractExercisePeriodValue = (\n exercisePeriod: string,\n periodKey: string,\n) => {\n const match = exercisePeriod.match(EXERCISE_PERIOD_REGEX);\n if (match) {\n const duration = match[1] ? parseInt(match[1], 10) : null;\n const interval = (match[2] || match[0])?.toLowerCase();\n return {\n [`${periodKey}Duration`]: formatToNumber(duration),\n [`${periodKey}Interval`]: INTERVAL_MAP[interval] || interval,\n };\n }\n return {};\n};\n\nexport const processBulkUpsertGrants = (grants: any[]) =>\n grants.map((grant) => {\n const {\n voluntaryTermination,\n involuntaryTermination,\n terminationForCause,\n death,\n disability,\n retirement,\n ...restAttributes\n } = grant;\n\n const exercisePeriodAttributes = {\n ...extractExercisePeriodValue(\n voluntaryTermination,\n 'voluntaryTermination',\n ),\n ...extractExercisePeriodValue(\n involuntaryTermination,\n 'involuntaryTermination',\n ),\n ...extractExercisePeriodValue(terminationForCause, 'terminationForCause'),\n ...extractExercisePeriodValue(death, 'death'),\n ...extractExercisePeriodValue(disability, 'disability'),\n ...extractExercisePeriodValue(retirement, 'retirement'),\n };\n\n return {\n ...restAttributes,\n exercisePeriodAttributes: Object.keys(exercisePeriodAttributes).length\n ? exercisePeriodAttributes\n : undefined,\n };\n });\n\nexport const hasRequiredExerciseInfo = (esopGrant: EsopGrant) => {\n const {\n grantTerms,\n exerciseLetterTemplateDocument,\n requiresHtmlConverter,\n hasExerciseLetterHtmlTemplate,\n } = esopGrant;\n const { fairMarketValue } = grantTerms || {};\n\n const hasExerciseTemplate = requiresHtmlConverter\n ? hasExerciseLetterHtmlTemplate\n : exerciseLetterTemplateDocument;\n const isMissingFairMarketValue = !fairMarketValue;\n const isMissingExerciseAgreement = !hasExerciseTemplate;\n const isMissingEmployeeType = !esopGrant?.employee?.employeeType;\n const isMissingRequiredInfo =\n isMissingFairMarketValue ||\n isMissingExerciseAgreement ||\n isMissingEmployeeType;\n\n return !isMissingRequiredInfo;\n};\n","import { Box, Heading, Stack } from '@angellist/adapt';\nimport { useHistory } from 'react-router-dom';\nimport React from 'react';\n\nimport { formatDate } from '../../utils/date';\nimport SlidingPane from '../common/SlidingPane';\nimport { AdaptRowList } from '../common/AdaptRowItem';\nimport StatusTag from '../common/StatusTag';\nimport useGrantSurrender from './hooks/useGrantSurrender';\nimport { LazyText } from '../common/RowLoader';\nimport {\n BuybackEligibility,\n EsopGrant,\n GrantSurrender,\n} from '../../../graphql';\nimport paths from '../../paths';\nimport {\n betterMoneyObjectFormat,\n formatMoneyObject,\n formatNumber,\n formatTitle,\n getEmployeeName,\n} from '../../helpers/utils';\nimport { useCompanyContext } from '../../context/CompanyContext';\nimport { getEsopGrantPath } from '../esop_grants/utils';\n\ninterface Props {\n id: string;\n isOpen: boolean;\n onClose: () => void;\n}\n\nconst getGrantSurrenderDetails = (\n grantSurrender: GrantSurrender,\n loading: boolean,\n push: any,\n securityDraftsEnabled: boolean,\n) => {\n const { grant } = grantSurrender as { grant: EsopGrant };\n const employeeName = getEmployeeName(grant?.employee);\n const grantName = grant?.name ?? '—';\n\n const handleGrantClick = () => {\n if (grantName) {\n push(getEsopGrantPath(grant, undefined, securityDraftsEnabled));\n }\n };\n\n return [\n {\n label: 'Grant',\n suffix: {\n kind: grantName ? 'textButton' : 'text',\n label: grantName,\n onPress: handleGrantClick,\n },\n loading,\n },\n {\n label: 'Surrender Type',\n suffix: { label: formatTitle(grantSurrender.surrenderType) },\n loading,\n },\n {\n label: 'Option Holder',\n suffix: {\n kind: employeeName ? 'textButton' : 'text',\n label: employeeName,\n onPress: employeeName\n ? () => window.open(`/employee/${grant.employee.id}`)\n : null,\n },\n loading,\n },\n {\n label: 'Number of Options',\n suffix: { label: formatNumber(grantSurrender.numUnits) },\n loading,\n },\n {\n label: 'Price Paid',\n suffix: { label: formatMoneyObject(grantSurrender.price) },\n loading,\n },\n {\n label: 'Surrendered Date',\n suffix: { label: formatDate(grantSurrender.surrenderedAt, '—') },\n loading,\n },\n {\n label: 'Filed On',\n suffix: { label: formatDate(grantSurrender.createdAt, '—') },\n loading,\n },\n {\n label: 'Surrender Reason',\n suffix: { label: grantSurrender.reason || '—' },\n loading,\n },\n {\n label: 'Admin Notes',\n suffix: { label: grantSurrender.adminNotes || '—' },\n loading,\n },\n ];\n};\n\nconst getBuybackDetails = (\n buybackEligibility: BuybackEligibility,\n paymentMode: string,\n push: any,\n) => {\n if (buybackEligibility) {\n const {\n priceOfferedPerShare = {},\n maxBuybackShares,\n maxBuybackPercentOfVested,\n buyback,\n } = buybackEligibility;\n\n const handleBuyBackNameClick = () => {\n if (buyback?.id) {\n push(paths.equity.buyBack.show(buyback?.id));\n }\n };\n\n return [\n {\n label: 'Buyback Program',\n suffix: {\n kind: buyback?.name ? 'textButton' : 'text',\n label: buyback?.name,\n onPress: handleBuyBackNameClick,\n },\n },\n {\n label: 'Price offered per share unit',\n suffix: { label: betterMoneyObjectFormat(priceOfferedPerShare) },\n },\n {\n label: 'Max shares eligible',\n suffix: { label: formatNumber(maxBuybackShares) },\n },\n {\n label: 'Maximum shares percent allowed to exercise',\n suffix: { label: `${maxBuybackPercentOfVested}%` },\n },\n {\n label: 'Expected payment mode',\n suffix: { label: paymentMode },\n },\n ];\n }\n\n return [];\n};\n\nconst SurrenderDetailPane = (props: Props) => {\n const { isOpen, onClose, id } = props;\n const [loading, grantSurrender] = useGrantSurrender(id);\n const { state, grant, buybackEligibility, paymentMode } = grantSurrender;\n const { securityDraftsEnabled } = useCompanyContext();\n\n const { push } = useHistory();\n const items = getGrantSurrenderDetails(\n grantSurrender,\n loading,\n push,\n securityDraftsEnabled,\n );\n const buyBackItems = getBuybackDetails(buybackEligibility, paymentMode, push);\n\n return (\n \n \n \n \n \n \n {!!state && }\n \n \n {!!buybackEligibility && (\n \n Buyback Details:\n \n \n )}\n \n \n );\n};\n\nexport default SurrenderDetailPane;\n","import { gql } from '@apollo/client';\n\nconst REPURCHASE_EVENT_QUERY = gql`\n query RepurchaseEvent($id: ID!) {\n repurchaseEvent(id: $id) {\n id\n numUnits\n reason\n effectiveAt\n paidAt\n payout {\n fractional\n dollars\n currency\n }\n adminNotes\n instrumentTo {\n id\n certificateId\n }\n instrument {\n id\n certificateId\n }\n documents {\n id\n documentName\n documentPath\n createdAt\n }\n }\n }\n`;\n\nexport default REPURCHASE_EVENT_QUERY;\n","import { useQuery } from '@apollo/client';\n\nimport REPURCHASE_EVENT_QUERY from '../queries/RepurchaseEventQuery';\nimport { cloneObject } from '../../../utils';\n\nconst useRepurchaseEvent = (id: string) => {\n const { loading, error, data } = useQuery(REPURCHASE_EVENT_QUERY, {\n variables: { id },\n });\n\n if (error) {\n throw error;\n }\n\n const repurchaseEvent = cloneObject(data?.repurchaseEvent);\n return [loading, repurchaseEvent];\n};\n\nexport default useRepurchaseEvent;\n","import { Box, Dialog, Stack, Text } from '@angellist/adapt';\nimport { ApolloError } from '@apollo/client';\nimport React, { ReactNode } from 'react';\nimport ErrorAlert from './ErrorAlert';\n\ninterface Props {\n isOpen: boolean;\n onDelete: () => void;\n onCancel: () => void;\n headerText?: string;\n confirmText?: string | ReactNode;\n isDeleting?: boolean;\n deleteError?: string | ApolloError;\n actionButtonLabel?: string;\n actionButtonVariant?: 'primary' | 'secondary' | 'danger';\n}\n\nconst AdaptDeleteDialog = (props: Props) => {\n const {\n isOpen,\n onDelete,\n onCancel,\n headerText,\n confirmText,\n isDeleting,\n deleteError,\n actionButtonLabel,\n actionButtonVariant,\n } = props;\n\n return (\n {headerText}}\n isOpen={isOpen}\n onClose={onCancel}\n actionButtons={[\n {\n label: actionButtonLabel,\n key: 'delete',\n variant: actionButtonVariant,\n isDisabled: isDeleting,\n isLoading: isDeleting,\n onPress: onDelete,\n },\n ]}\n >\n \n {confirmText}\n {deleteError && }\n \n \n );\n};\n\nAdaptDeleteDialog.defaultProps = {\n headerText: 'Are you sure?',\n confirmText: 'Are you sure you want to delete this?',\n actionButtonVariant: 'danger',\n actionButtonLabel: 'Delete',\n};\n\nexport default AdaptDeleteDialog;\n","import { gql } from '@apollo/client';\n\nconst DELETE_ATTACHMENT_MUTATION = gql`\n mutation DeleteAttachmentMutation($id: String!) {\n deleteAttachment(id: $id)\n }\n`;\n\nexport default DELETE_ATTACHMENT_MUTATION;\n","import { useAlert } from 'react-alert';\nimport { useMutation } from '@apollo/client';\nimport { showGraphQLError } from '../../../helpers/utils';\nimport DELETE_ATTACHMENT_MUTATION from '../mutations/deleteAttachmentMutation';\n\nconst useDeleteAttachment = (afterRemove?: () => void) => {\n const alert = useAlert();\n const [\n removeAttachment,\n { loading: mutationLoading, called, error: deleteError },\n ] = useMutation(DELETE_ATTACHMENT_MUTATION, {\n onCompleted() {\n if (afterRemove) {\n afterRemove();\n }\n },\n onError({ graphQLErrors }) {\n showGraphQLError(alert, graphQLErrors);\n },\n });\n\n const onDelete = (id: string) => {\n removeAttachment({ variables: { id } });\n };\n\n return {\n onDelete,\n deleting: mutationLoading && called,\n deleteError,\n };\n};\n\nexport default useDeleteAttachment;\n","import React from 'react';\nimport { Box, FileType } from '@angellist/adapt';\n\nimport AdaptDeleteDialog from '../AdaptDeleteDialog';\nimport useDeleteAttachment from '../hooks/useDeleteAttachment';\nimport useModal from '../hooks/useModal';\nimport { FileViewProps } from './index.types';\nimport AdaptFilePreview from './AdaptFilePreview';\n\nconst FileView = (props: FileViewProps) => {\n const { modal, openModal, closeModal } = useModal();\n const {\n id,\n documentName,\n createdAt,\n canDownload,\n canRemove,\n afterRemove,\n documentPath,\n deleteConfirmTitle,\n deleteConfirmText,\n onRowClick,\n description,\n rowClickAllowedFileTypes,\n ...previewProps\n } = props;\n\n const names = documentName.split('.');\n const fileType = names[names.length - 1] || '';\n\n let canRowClick = !!onRowClick;\n if (canRowClick && rowClickAllowedFileTypes) {\n canRowClick = rowClickAllowedFileTypes.includes(fileType);\n }\n\n const handleRowClick = () => {\n if (canRowClick) {\n onRowClick({ id, documentName });\n }\n };\n\n const { onDelete, deleting, deleteError } = useDeleteAttachment(() => {\n if (afterRemove) {\n afterRemove();\n }\n closeModal();\n });\n\n return (\n <>\n \n openModal() : null}\n {...previewProps}\n />\n \n {canRemove && (\n onDelete(id)}\n onCancel={closeModal}\n isDeleting={deleting}\n deleteError={deleteError}\n headerText={deleteConfirmTitle || `Delete ${documentName}`}\n confirmText={deleteConfirmText}\n />\n )}\n \n );\n};\n\nexport default FileView;\n","import { Box, Text } from '@angellist/adapt';\nimport React from 'react';\nimport FileView from './FileView';\nimport { AttachmentListProps } from './index.types';\n\nconst AttachmentList = (props: AttachmentListProps) => {\n const {\n documents,\n canDownload,\n canRemove,\n afterRemove,\n emptyDocumentText,\n deleteConfirmTitle,\n deleteConfirmText,\n onRowClick,\n rowClickAllowedFileTypes,\n } = props;\n\n if (documents.length) {\n return (\n \n {documents.map((document, index) => (\n \n ))}\n \n );\n }\n\n return (\n \n {emptyDocumentText}\n \n );\n};\n\nAttachmentList.defaultProps = {\n canDownload: true,\n canRemove: false,\n documents: [],\n emptyDocumentText: 'No documents available.',\n};\n\nexport default AttachmentList;\n","import { Box, Icon, Stack } from '@angellist/adapt';\nimport React from 'react';\n\nimport RowLoader from '../RowLoader';\n\ntype Props = {\n numLoadingRows?: number;\n boxProps?: any;\n};\n\nconst AttachmentListLoader = (props: Props) => {\n const {\n numLoadingRows = 3,\n boxProps = {\n borderRadius: 'container',\n borderColor: 'border10',\n borderWidth: 'default',\n },\n } = props;\n const rows = Array(numLoadingRows).fill('');\n\n return (\n \n {rows.map((_, index) => (\n \n \n \n \n \n \n \n ))}\n \n );\n};\n\nexport default AttachmentListLoader;\n","import React from 'react';\nimport { useForm } from 'react-hook-form';\nimport { Form } from 'reactstrap';\nimport { FileType, Modal, Stack } from '@angellist/adapt';\nimport { ApolloError } from '@apollo/client';\n\nimport ErrorAlert from '../ErrorAlert';\nimport { FileUpload } from '../adapt-form';\nimport { processError } from '../../../helpers/utils';\nimport { ModalActions } from '../../../../types';\n\ntype Props = {\n name?: string;\n uploadError?: ApolloError;\n onUpload: (formData: object) => void;\n isUploading?: boolean;\n headerText?: string;\n isRequired?: boolean;\n multiple?: boolean;\n supportedFileTypes?: FileType[];\n} & Pick;\n\nconst UploadModal = (props: Props) => {\n const {\n closeModal,\n modal,\n onUpload,\n uploadError,\n isUploading,\n headerText,\n name,\n isRequired,\n multiple,\n ...restProps\n } = props;\n const { control, handleSubmit, errors } = useForm();\n const uploadState = isUploading ? 'in-progress' : undefined;\n\n return (\n {\n handleSubmit(onUpload)(e);\n },\n },\n ],\n }}\n onClose={closeModal}\n isOpen={modal}\n >\n
\n \n \n \n \n
\n \n );\n};\n\nUploadModal.defaultProps = {\n name: 'documents',\n isUploading: false,\n isRequired: true,\n multiple: true,\n headerText: 'Upload Document',\n};\n\nexport default UploadModal;\n","import { gql } from '@apollo/client';\n\nconst UPLOAD_FILE_MUTATION = gql`\n mutation UploadFileMutation(\n $companyId: String!\n $ownerObjectType: String!\n $ownerObjectId: String!\n $ownerObjectField: String!\n $documents: [File!]!\n ) {\n uploadFile(\n companyId: $companyId\n ownerObjectType: $ownerObjectType\n ownerObjectId: $ownerObjectId\n ownerObjectField: $ownerObjectField\n documents: $documents\n ) {\n id\n documentName\n documentPath\n createdAt\n }\n }\n`;\n\nexport default UPLOAD_FILE_MUTATION;\n","import { useMutation } from '@apollo/client';\nimport { useAlert } from 'react-alert';\n\nimport { useCompanyContext } from '../../../context/Context';\nimport { showGraphQLError } from '../../../helpers/utils';\nimport UPLOAD_FILE_MUTATION from '../mutations/uploadFileMutation';\n\nconst useUploadFiles = (afterComplete: (data: object) => void) => {\n const { id: companyId } = useCompanyContext();\n const alert = useAlert();\n\n const [\n uploadFile,\n { loading: mutationLoading, called, error: mutationError },\n ] = useMutation(UPLOAD_FILE_MUTATION, {\n onCompleted(data) {\n afterComplete(data.uploadFile);\n },\n onError({ graphQLErrors }) {\n showGraphQLError(alert, graphQLErrors);\n },\n context: {\n hasUpload: true,\n },\n });\n\n const onUpload = (formData: object) => {\n uploadFile({\n variables: {\n companyId,\n ...formData,\n },\n });\n };\n\n return {\n submitting: called && mutationLoading,\n mutationError,\n onUpload,\n };\n};\n\nexport default useUploadFiles;\n","import React from 'react';\n\nimport UploadModal from './UploadModal';\nimport useUploadFiles from '../hooks/useUploadFiles';\nimport { FileUploadProps } from './index.types';\nimport useModal from '../hooks/useModal';\nimport AdaptModalButton from '../AdaptModalButton';\n\ntype Props = {\n afterUpload: (formData: any) => void;\n} & FileUploadProps;\n\nconst FileUploadModal = (props: Props) => {\n const modalActions = useModal();\n const {\n ownerObjectType,\n ownerObjectId,\n ownerObjectField,\n afterUpload,\n buttonText = 'Add document',\n buttonType,\n buttonProps = {},\n ...rest\n } = props;\n\n const { submitting, onUpload, mutationError } = useUploadFiles((data) => {\n afterUpload(data);\n modalActions.closeModal();\n });\n\n const uploadFiles = ({ documents }: { documents: File[] }) => {\n onUpload({\n ownerObjectType,\n ownerObjectId,\n ownerObjectField,\n documents,\n });\n };\n\n return (\n \n );\n};\n\nexport default FileUploadModal;\n","import React from 'react';\nimport { Header, Stack } from '@angellist/adapt';\n\nimport { DocumentsCardProps } from './index.types';\nimport AttachmentList from './AttachmentList';\nimport FileUploadModal from './FileUploadModal';\nimport AttachmentListLoader from './AttachmentListLoader';\n\nconst DocumentsCard = (props: DocumentsCardProps) => {\n const {\n headerText,\n description,\n documents,\n emptyDocumentText,\n canRemove,\n canUpload,\n canDownload,\n afterRemove,\n afterUpload,\n loading,\n deleteConfirmTitle,\n deleteConfirmText,\n suffixHeaderActions,\n numLoadingRows = 3,\n onRowClick,\n rowClickAllowedFileTypes,\n ...restModalProps\n } = props;\n return (\n \n \n
\n {headerText}\n
\n \n {!loading && canUpload && (\n \n )}\n {suffixHeaderActions}\n \n
\n {loading ? (\n \n ) : (\n \n )}\n
\n );\n};\n\nDocumentsCard.defaultProps = {\n headerText: 'Documents',\n ownerObjectField: 'documents',\n};\n\nexport default DocumentsCard;\n","import React from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { Box, Heading, Stack } from '@angellist/adapt';\n\nimport SlidingPane from '../../common/SlidingPane';\nimport StatusTag from '../../common/StatusTag';\nimport { formatDate } from '../../../utils/date';\nimport { LazyText } from '../../common/RowLoader';\nimport { AdaptRowList } from '../../common/AdaptRowItem';\nimport {\n formatMoneyObject,\n formatNumber,\n formatTitle,\n formatToNumber,\n} from '../../../helpers/utils';\n\nimport useRepurchaseEvent from '../hooks/useRepurchaseEvent';\n\nimport { RepurchaseEvent } from '../../../../graphql';\nimport { AttachmentList } from '../../common/adapt-documents';\nimport { useCompanyContext } from '../../../context/CompanyContext';\nimport { getShareCertificatePath } from '../../share_certificates/utils';\n\ninterface Props {\n id: string;\n isOpen: boolean;\n onClose: () => void;\n}\n\nconst getShareRepurchaseDetails = (\n repurchaseEvent: RepurchaseEvent,\n loading: boolean,\n push: any,\n securityDraftsEnabled: boolean,\n) => [\n {\n label: 'Repurchased From',\n suffix: {\n kind: 'textButton',\n label: repurchaseEvent?.instrument?.certificateId,\n onPress: () =>\n push(\n getShareCertificatePath(\n repurchaseEvent?.instrument,\n undefined,\n securityDraftsEnabled,\n ),\n ),\n },\n loading,\n },\n {\n label: 'Balance Re-issued To',\n suffix: {\n kind: 'textButton',\n label: repurchaseEvent?.instrumentTo?.certificateId,\n onPress: () =>\n push(\n getShareCertificatePath(\n repurchaseEvent?.instrumentTo,\n undefined,\n securityDraftsEnabled,\n ),\n ),\n },\n loading,\n },\n {\n label: 'Number of Shares',\n suffix: { label: formatNumber(formatToNumber(repurchaseEvent.numUnits)) },\n loading,\n },\n {\n label: 'Repurchase Date',\n suffix: { label: formatDate(repurchaseEvent.effectiveAt, '—') },\n loading,\n },\n {\n label: 'Price Paid',\n suffix: { label: formatMoneyObject(repurchaseEvent.payout) },\n loading,\n },\n\n {\n label: 'Payment Completion Date',\n suffix: { label: formatDate(repurchaseEvent.paidAt, '—') },\n loading,\n },\n {\n label: 'Repurchase Reason',\n suffix: { label: formatTitle(repurchaseEvent.reason) || '—' },\n loading,\n },\n {\n label: 'Admin Notes',\n suffix: { label: repurchaseEvent.adminNotes || '—' },\n loading,\n },\n];\n\nconst ShareRepurchaseDetailPane = (props: Props) => {\n const { isOpen, onClose, id } = props;\n const [loading, repurchaseEvent] = useRepurchaseEvent(id);\n const { documents } = repurchaseEvent;\n\n const { push } = useHistory();\n const { securityDraftsEnabled } = useCompanyContext();\n const items = getShareRepurchaseDetails(\n repurchaseEvent,\n loading,\n push,\n securityDraftsEnabled,\n );\n\n return (\n \n \n \n \n \n \n {!!repurchaseEvent && }\n \n \n {!!documents?.length && (\n \n Documents\n \n \n )}\n \n \n );\n};\n\nexport default ShareRepurchaseDetailPane;\n","import { getOptionsNameMap } from '../../helpers/utils';\n\nexport const STATUS = {\n DRAFT: 'draft',\n ACTIVE: 'active',\n CANCELLED: 'cancelled',\n REPURCHASED: 'repurchased',\n CONVERTED: 'converted',\n PARTIALLY_TRANSFERRED: 'partially_transferred',\n FULLY_TRANSFERRED: 'fully_transferred',\n};\n\nexport const STATUS_SORT_ORDER = {\n [STATUS.DRAFT]: 0,\n [STATUS.ACTIVE]: 1,\n [STATUS.CANCELLED]: 2,\n [STATUS.REPURCHASED]: 3,\n [STATUS.CONVERTED]: 4,\n [STATUS.PARTIALLY_TRANSFERRED]: 5,\n [STATUS.FULLY_TRANSFERRED]: 6,\n};\n\nexport const STATUS_OPTIONS = [\n {\n key: STATUS.DRAFT,\n label: 'Draft',\n value: STATUS.DRAFT,\n },\n {\n key: STATUS.ACTIVE,\n label: 'Active',\n value: STATUS.ACTIVE,\n },\n {\n key: STATUS.CONVERTED,\n label: 'Converted',\n value: STATUS.CONVERTED,\n },\n {\n key: STATUS.CANCELLED,\n label: 'Cancelled',\n value: STATUS.CANCELLED,\n },\n {\n key: STATUS.REPURCHASED,\n label: 'Repurchased',\n value: STATUS.REPURCHASED,\n },\n {\n key: STATUS.PARTIALLY_TRANSFERRED,\n label: 'Partially Transferred',\n value: STATUS.PARTIALLY_TRANSFERRED,\n },\n {\n key: STATUS.FULLY_TRANSFERRED,\n label: 'Fully Transferred',\n value: STATUS.FULLY_TRANSFERRED,\n },\n];\n\nexport const STATUS_FILTER_MAP: any = {\n drafts: [STATUS.DRAFT],\n issued: [\n STATUS.ACTIVE,\n STATUS.CANCELLED,\n STATUS.CONVERTED,\n STATUS.REPURCHASED,\n ],\n};\n\nexport const FILTER_ITEMS = [\n {\n key: 'all',\n value: 'all',\n label: 'All',\n },\n {\n key: 'drafts',\n value: 'drafts',\n label: 'Drafts',\n },\n {\n key: 'issued',\n value: 'issued',\n label: 'Issued',\n },\n];\n\nexport const CONVERTIBLE_TYPES = {\n CONVERTIBLE_SAFE: 'ConvertibleSafe',\n CONVERTIBLE_DEBT: 'ConvertibleDebt',\n WARRANT_CERTIFICATE: 'WarrantCertificate',\n TOKEN_WARRANT: 'TokenWarrant',\n SAFT: 'Saft',\n};\n\nexport const CONVERTIBLE_GQL_SQL_TYPE_MAP = {\n ConvertibleSafe: 'ConvertibleSafeInstrument',\n ConvertibleDebt: 'ConvertibleDebt',\n WarrantCertificate: 'WarrantCertificate',\n TokenWarrant: 'CryptoInstrument::TokenWarrant',\n Saft: 'CryptoInstrument::Saft',\n};\n\nexport const CONVERTIBLE_TYPES_LIST = Object.values(CONVERTIBLE_TYPES);\n\nexport const CONVERTIBLE_DEBT_CONVERTIBLE_TYPE_NAME_MAP = {\n convertible_note: 'Convertible Note',\n ccd: 'CCD',\n ocd: 'OCD',\n};\nexport const CONVERTIBLE_TYPE_OPTIONS = [\n {\n key: CONVERTIBLE_TYPES.CONVERTIBLE_SAFE,\n label: 'SAFE',\n value: CONVERTIBLE_TYPES.CONVERTIBLE_SAFE,\n },\n {\n key: CONVERTIBLE_TYPES.CONVERTIBLE_DEBT,\n label: 'Convertible Note',\n value: CONVERTIBLE_TYPES.CONVERTIBLE_DEBT,\n },\n {\n key: CONVERTIBLE_TYPES.WARRANT_CERTIFICATE,\n label: 'Warrant',\n value: CONVERTIBLE_TYPES.WARRANT_CERTIFICATE,\n },\n {\n key: CONVERTIBLE_TYPES.TOKEN_WARRANT,\n label: 'Token Warrant',\n value: CONVERTIBLE_TYPES.TOKEN_WARRANT,\n },\n {\n key: CONVERTIBLE_TYPES.SAFT,\n label: 'SAFT',\n value: CONVERTIBLE_TYPES.SAFT,\n },\n];\n\nexport const CONVERTIBLE_TYPE_NAME_MAP = getOptionsNameMap(\n CONVERTIBLE_TYPE_OPTIONS,\n);\n\nexport const CAPITAL_CONTRIBUTION_FIELD_FOR_SECURITY = {\n ConvertibleSafe: 'capitalContributionForCompany',\n ConvertibleDebt: 'capitalContributionForCompany',\n WarrantCertificate: 'capitalContribution',\n Saft: 'purchaseAmount',\n TokenWarrant: 'purchasePrice',\n};\n","import React from 'react';\nimport {\n Convertible,\n ConvertibleDebt,\n ConvertibleSafe,\n HealthCheck,\n Saft,\n TokenWarrant,\n WarrantCertificate,\n} from '../../../graphql';\nimport {\n CAPITAL_CONTRIBUTION_FIELD_FOR_SECURITY,\n CONVERTIBLE_DEBT_CONVERTIBLE_TYPE_NAME_MAP,\n CONVERTIBLE_TYPE_NAME_MAP,\n STATUS,\n} from './constant';\nimport { NameColumn } from '../../helpers/formatters';\nimport { formatDate, formatMoneyObject } from '../../helpers/utils';\nimport paths from '../../paths';\nimport { BreadcrumbItem } from '../../../types';\n\nconst aiHealthChecks = (convertible: Convertible) => {\n if (convertible.__typename === 'ConvertibleSafe') {\n return convertible.aiHealthChecks?.filter(\n (hc) => !hc.source || hc.status === 'active',\n );\n }\n\n return [];\n};\n\nexport const getConvertibleName = (convertible: Convertible) => {\n if (convertible.__typename === 'ConvertibleSafe') {\n return convertible.name;\n }\n if (convertible.__typename === 'ConvertibleDebt') {\n return convertible.certificateId;\n }\n if (convertible.__typename === 'WarrantCertificate') {\n return convertible.name;\n }\n if (convertible.__typename === 'Saft') {\n return convertible.name;\n }\n if (convertible.__typename === 'TokenWarrant') {\n return convertible.name;\n }\n\n return null;\n};\n\nexport const nameFormatter = (_: string, convertible: Convertible) => {\n let convertibleName = getConvertibleName(convertible);\n if (!convertibleName) {\n convertibleName = '—';\n }\n\n const healthChecks =\n aiHealthChecks(convertible)?.reduce(\n (acc: { [key: string]: HealthCheck }, curr) => {\n if (!curr.source) acc[curr.title] = curr;\n if (curr.source && curr.status === 'active') acc[curr.title] = curr;\n return acc;\n },\n {},\n ) || {};\n\n return (\n \n );\n};\n\nexport const issueDate = (convertible: Convertible) => {\n if (convertible.__typename === 'ConvertibleSafe') {\n return convertible.issueDate;\n }\n if (convertible.__typename === 'ConvertibleDebt') {\n return convertible.issueDate;\n }\n if (convertible.__typename === 'WarrantCertificate') {\n return convertible.grantDate;\n }\n if (convertible.__typename === 'Saft') {\n return convertible.issueDate;\n }\n if (convertible.__typename === 'TokenWarrant') {\n return convertible.issueDate;\n }\n\n return null;\n};\n\nexport const issueDateFormatter = (\n _: string,\n convertible: Convertible,\n emptyString = '—',\n) => formatDate(issueDate(convertible), emptyString);\n\nexport const capitalContribution = (convertible: Convertible) => {\n const field = CAPITAL_CONTRIBUTION_FIELD_FOR_SECURITY[convertible.__typename];\n if (field) {\n // @ts-ignore\n return convertible[field];\n }\n return null;\n};\n\nexport const capitalContributionFormatter = (\n _: string,\n convertible: Convertible,\n) => formatMoneyObject(capitalContribution(convertible));\n\nexport const capitalContributionSortSearchFormat = (\n _: string,\n convertible: Convertible,\n) => {\n const cc = capitalContribution(convertible);\n if (cc) {\n return Number(cc.dollars);\n }\n return 0;\n};\n\nexport const capitalContributionCsvFormat = (\n _: string,\n convertible: Convertible,\n) => {\n const cc = capitalContribution(convertible);\n if (cc) {\n return Number(cc.dollars);\n }\n return '';\n};\n\nexport const convertibleType = (convertible: Convertible) => {\n if (convertible.__typename === 'ConvertibleDebt') {\n // @ts-ignore\n return CONVERTIBLE_DEBT_CONVERTIBLE_TYPE_NAME_MAP[\n convertible.convertibleType\n ];\n }\n return CONVERTIBLE_TYPE_NAME_MAP[convertible.__typename];\n};\n\nexport const convertibleTypeFormatter = (_: string, convertible: Convertible) =>\n convertibleType(convertible);\n\nexport const getSafePath = (\n convertibleSafe: ConvertibleSafe,\n tab?: string,\n securityDraftsEnabled = false,\n) => {\n if (!convertibleSafe) return null;\n if (securityDraftsEnabled) {\n if (convertibleSafe.status === STATUS.DRAFT) {\n return paths.equity.drafts.convertibles.safe(convertibleSafe.id, tab);\n }\n return paths.equity.securities.convertibles.safe(convertibleSafe.id, tab);\n }\n return paths.equity.safe(convertibleSafe.id, tab);\n};\n\nexport const getDebtPath = (\n convertibleDebt: ConvertibleDebt,\n tab?: string,\n securityDraftsEnabled = false,\n) => {\n if (!convertibleDebt) return null;\n if (securityDraftsEnabled) {\n if (convertibleDebt.groupingStatus === STATUS.DRAFT) {\n return paths.equity.drafts.convertibles.debt(convertibleDebt.id, tab);\n }\n return paths.equity.securities.convertibles.debt(convertibleDebt.id, tab);\n }\n return paths.equity.convertibleDebt(convertibleDebt.id, tab);\n};\n\nexport const getWarrantPath = (\n warrant: WarrantCertificate,\n securityDraftsEnabled = false,\n) => {\n if (!warrant) return null;\n if (securityDraftsEnabled) {\n if (warrant.status === STATUS.DRAFT) {\n return paths.equity.drafts.convertibles.warrant(warrant.id);\n }\n return paths.equity.securities.convertibles.warrant(warrant.id);\n }\n return paths.equity.warrant(warrant.id);\n};\n\nexport const getTokenWarrantPath = (\n tokenWarrant: TokenWarrant,\n securityDraftsEnabled = false,\n) => {\n if (!tokenWarrant) return null;\n if (securityDraftsEnabled) {\n if (tokenWarrant.status === STATUS.DRAFT) {\n return paths.equity.drafts.convertibles.tokenWarrant(tokenWarrant.id);\n }\n return paths.equity.securities.convertibles.tokenWarrant(tokenWarrant.id);\n }\n return paths.equity.tokenWarrant(tokenWarrant.id);\n};\n\nexport const getSaftPath = (saft: Saft, securityDraftsEnabled = false) => {\n if (!saft) return null;\n if (securityDraftsEnabled) {\n if (saft.status === STATUS.DRAFT) {\n return paths.equity.drafts.convertibles.saft(saft.id);\n }\n return paths.equity.securities.convertibles.saft(saft.id);\n }\n return paths.equity.saft(saft.id);\n};\n\nexport const getConvertibleLink = (\n convertible: Convertible,\n securityDraftsEnabled = false,\n) => {\n const { __typename } = convertible;\n if (__typename === 'ConvertibleSafe') {\n return getSafePath(convertible, undefined, securityDraftsEnabled);\n }\n if (__typename === 'ConvertibleDebt') {\n return getDebtPath(convertible, undefined, securityDraftsEnabled);\n }\n if (__typename === 'WarrantCertificate') {\n return getWarrantPath(convertible, securityDraftsEnabled);\n }\n if (__typename === 'Saft') {\n return getSaftPath(convertible, securityDraftsEnabled);\n }\n if (__typename === 'TokenWarrant') {\n return getTokenWarrantPath(convertible, securityDraftsEnabled);\n }\n return null;\n};\n\nexport const convertibleBreadcrumbs = (\n isDraft?: Boolean,\n securityDraftsEnabled = false,\n): Array => {\n if (securityDraftsEnabled) {\n if (isDraft) {\n return [\n {\n title: 'Drafts',\n link: paths.equity.drafts.all,\n },\n {\n title: 'Convertibles',\n link: paths.equity.drafts.convertibles.all,\n },\n ];\n }\n return [\n {\n title: 'Securities',\n link: paths.equity.securities.all,\n },\n {\n title: 'Convertibles',\n link: paths.equity.securities.convertibles.all,\n },\n ];\n }\n // REMOVE below once enabled securityDraftsEnabled\n return [\n {\n title: 'Convertibles',\n link: paths.equity.convertibles,\n },\n ];\n};\n","import { GrantIssuance } from '../../../graphql';\n\nexport const getIssuanceSigners = (grantIssuance?: GrantIssuance) => {\n const grantIssuanceSigners = grantIssuance?.grantIssuanceSigners || [];\n const companyGrantIssuanceSigner = grantIssuanceSigners.find(\n ({ role }) => role === 'company',\n );\n const employeeGrantIssuanceSigner = grantIssuanceSigners.find(\n ({ role }) => role === 'recipient',\n );\n const spouseGrantIssuanceSigner = grantIssuanceSigners.find(\n ({ role }) => role === 'spouse',\n );\n\n return {\n companyGrantIssuanceSigner,\n employeeGrantIssuanceSigner,\n spouseGrantIssuanceSigner,\n };\n};\n\nexport const getIssuanceSignersFlags = (grantIssuance: GrantIssuance) => {\n const {\n companyGrantIssuanceSigner,\n employeeGrantIssuanceSigner,\n spouseGrantIssuanceSigner,\n } = getIssuanceSigners(grantIssuance);\n\n const isCompanySigned = !!companyGrantIssuanceSigner?.signedAt;\n\n const employeeSigned = employeeGrantIssuanceSigner\n ? !!employeeGrantIssuanceSigner?.signedAt\n : false;\n\n const spouseSigned = spouseGrantIssuanceSigner\n ? !!spouseGrantIssuanceSigner?.signedAt\n : true;\n\n const pendingSpouseEsign =\n spouseGrantIssuanceSigner && !spouseGrantIssuanceSigner.signedAt;\n\n return {\n isCompanySigned,\n isStakeholderSigned: employeeSigned && spouseSigned,\n showSpouseSignAction: employeeSigned,\n canRemindEmployeeInvite:\n !!employeeGrantIssuanceSigner?.inviteSentAt && !employeeSigned,\n pendingSpouseEsign,\n };\n};\n","import React from 'react';\nimport {\n EsopGrant,\n HealthCheck,\n NewStakeholder,\n RsaGrant,\n RsuGrant,\n} from '../../../graphql';\nimport { formatNumber, getEmployeeName } from '../../helpers/utils';\nimport paths from '../../paths';\nimport UnitsColumn from '../common/UnitsColumn';\nimport { ALL_ESOP_GRANT_TYPES, GRANT_TYPES, STATUS } from './constants';\nimport { NameColumn } from '../../helpers/formatters';\nimport { getIssuanceSigners } from '../grant_issuance_actions/utils';\nimport { formatGrantType } from '../esop_grants/utils';\n\nexport const isEsopGrant = (type: string) =>\n ALL_ESOP_GRANT_TYPES.includes(type);\n\nexport const isRsaGrant = (type: string) => type === GRANT_TYPES.RSA_GRANT;\n\nexport const grantTypeFormatter = (type: string) => formatGrantType(type);\n\nexport const canAllowEditGrant = (state: string) =>\n [\n STATUS.DRAFT,\n STATUS.BOARD_APPROVED,\n STATUS.AWAITING_BOARD_CONSENT,\n STATUS.PENDING_COMPANY_SIGNATURE,\n STATUS.PENDING_EMPLOYEE_SIGNATURE,\n STATUS.PENDING_ISSUANCE,\n ].includes(state);\n\nexport const canAllowModifyGrant = (state: string) => !canAllowEditGrant(state);\n\nexport const getStakeholderName = (grant: EsopGrant, emptyString = '') => {\n const { employee } = grant;\n if (employee) {\n return (\n employee?.stakeholder?.name || getEmployeeName(employee, emptyString)\n );\n }\n return emptyString;\n};\n\nexport const getOptionHolderValue = (\n _: never,\n grant: EsopGrant,\n emptyString = '',\n) => getStakeholderName(grant, emptyString);\n\nexport const nameFormatter = (name: string, grant: EsopGrant) => {\n const healthChecks =\n grant.healthChecks?.reduce((acc: { [key: string]: HealthCheck }, curr) => {\n if (!curr.source) acc[curr.title] = curr;\n if (curr.source && curr.status === 'active') acc[curr.title] = curr;\n return acc;\n }, {}) || {};\n\n return (\n \n );\n};\n\nexport const unitsColumnFormatter = (_: never, grant: EsopGrant) => {\n const { unitsVested, totalUnits } = grant;\n if (totalUnits) {\n return (\n \n );\n }\n return null;\n};\n\nexport const filterCompanySignedRows = (row: any) =>\n !!getIssuanceSigners(row?.grantIssuance)?.companyGrantIssuanceSigner\n ?.signedAt;\n\nexport const sharesColumnFormatter = (_: never, grant: RsaGrant) => {\n const { shareCertificate } = grant;\n if (shareCertificate?.numShares) {\n return (\n \n );\n }\n return null;\n};\n\nexport const unitsCsvFormatter = (_: never, grant: EsopGrant) => {\n const { unitsVested, totalUnits } = grant;\n if (totalUnits) {\n return `${unitsVested}/${totalUnits}`;\n }\n return null;\n};\n\nexport const unitsSearchValue = (_: never, grant: EsopGrant) => {\n const { unitsVested, totalUnits } = grant;\n\n return `${unitsVested}_${totalUnits}_${formatNumber(\n unitsVested,\n )}_${formatNumber(totalUnits)}`;\n};\n\nexport const getSelectedGrantRows = (\n getUpdatedRows: Function | Array,\n selectedRows: Array,\n alert: any,\n) => {\n if (Array.isArray(getUpdatedRows)) {\n return getUpdatedRows?.filter(filterCompanySignedRows);\n }\n const difference = getUpdatedRows(selectedRows).find(\n (row: RsuGrant) => !selectedRows.includes(row),\n );\n if (\n difference &&\n !getIssuanceSigners(difference?.grantIssuance)?.companyGrantIssuanceSigner\n ?.signedAt\n ) {\n alert.error(\n 'You cannot invite this stakeholder until the company signatory has signed the grant. They will receive an email notification once the company signatory has signed.',\n );\n }\n return getUpdatedRows(selectedRows)?.filter(filterCompanySignedRows);\n};\n\nexport const notEligibleForIso = (grantHolderDetail: NewStakeholder) =>\n (grantHolderDetail?.employee?.employeeType &&\n [\n 'contractor',\n 'freelance',\n 'advisor',\n 'other_service_provider',\n 'other',\n ].includes(grantHolderDetail?.employee?.employeeType)) ||\n (grantHolderDetail?.shareholder?.role &&\n ['angel', 'investor', 'advisor', 'consultant'].includes(\n grantHolderDetail?.shareholder?.role,\n ));\n\nexport const esopGrantBreadcrumbs = (\n isDraft: boolean,\n breadCrumbLabel: string,\n securityDraftsEnabled: boolean,\n) => {\n if (securityDraftsEnabled) {\n if (isDraft) {\n return [\n {\n title: 'Drafts',\n link: paths.equity.drafts.all,\n },\n {\n title: breadCrumbLabel,\n link: paths.equity.drafts.options.all,\n },\n ];\n }\n return [\n {\n title: 'Securities',\n link: paths.equity.securities.all,\n },\n {\n title: breadCrumbLabel,\n link: paths.equity.securities.options.all,\n },\n ];\n }\n return [\n {\n title: breadCrumbLabel,\n link: paths.equity.grants.base,\n },\n ];\n};\n","import React from 'react';\n\nimport { HealthCheck, RsuGrant } from '../../../graphql';\nimport {\n DECIMAL_LIMIT,\n formatNumber,\n formatNumberWithPrecision,\n getEmployeeName,\n} from '../../helpers/utils';\nimport UnitsColumn from '../common/UnitsColumn';\nimport { STATUS } from '../grants/constants';\nimport { NameColumn } from '../../helpers/formatters';\nimport paths from '../../paths';\n\nexport const getStakeholderName = (grant: RsuGrant, emptyString = '') => {\n const { employee } = grant;\n if (employee) {\n return employee?.stakeholder?.name || getEmployeeName(employee, '');\n }\n return emptyString;\n};\n\nexport const getOptionHolderValue = (\n _: never,\n grant: RsuGrant,\n emptyString = '',\n) => getStakeholderName(grant, emptyString);\n\nexport const nameFormatter = (name: string, grant: RsuGrant) => {\n const healthChecks =\n grant.healthChecks?.reduce((acc: { [key: string]: HealthCheck }, curr) => {\n if (!curr.source) acc[curr.title] = curr;\n if (curr.source && curr.status === 'active') acc[curr.title] = curr;\n return acc;\n }, {}) || {};\n\n return (\n \n );\n};\n\nexport const unitsColumnFormatter = (_: never, grant: RsuGrant) => {\n const { unitsVested, grantTerms } = grant;\n const { numOptions } = grantTerms || {};\n if (numOptions) {\n return (\n \n );\n }\n return null;\n};\n\nexport const unitsCsvFormatter = (_: never, grant: RsuGrant) => {\n const { unitsVested, grantTerms } = grant;\n const { numOptions } = grantTerms || {};\n if (numOptions) {\n return `${unitsVested}/${formatNumberWithPrecision(\n numOptions,\n DECIMAL_LIMIT.NUM_OPTIONS,\n )}`;\n }\n return null;\n};\n\nexport const unitsSearchValue = (_: never, grant: RsuGrant) => {\n const { unitsVested, grantTerms } = grant;\n const { numOptions } = grantTerms || {};\n\n return `${unitsVested}_${numOptions}_${formatNumber(\n unitsVested,\n )}_${formatNumberWithPrecision(numOptions, DECIMAL_LIMIT.NUM_OPTIONS)}`;\n};\n\nexport const shouldRegenerateGrant = (data: any, rsuGrant: RsuGrant) => {\n const {\n grantDetailAttributes: {\n numOptions,\n exercisePrice,\n expiryDate,\n grantedAt,\n name,\n stakeholderId,\n },\n vestingAttributes: {\n vestingStartBackdate = null,\n vestingTemplateId = null,\n accelerationTemplateId = null,\n acceleratedVestingDescription = null,\n },\n grantDocumentAttributes: { usedGrantDocumentSetId },\n } = data;\n\n const regenFields = [];\n if (numOptions !== rsuGrant.grantTerms.numOptions) {\n regenFields.push('Number of options');\n }\n if (\n exercisePrice.fractional !== rsuGrant.grantTerms.exercisePrice.fractional\n ) {\n regenFields.push('Exercise price');\n }\n if (expiryDate !== rsuGrant.grantTerms.expiryDate) {\n regenFields.push('Expiry date');\n }\n if (vestingStartBackdate !== rsuGrant.grantTerms.vestingStartBackdate) {\n regenFields.push('Vesting start backdate');\n }\n if (vestingTemplateId !== (rsuGrant.vestingTemplate?.id || null)) {\n regenFields.push('Vesting template');\n }\n if (!!vestingTemplateId && rsuGrant.vestingEvents.length === 0) {\n regenFields.push('Vesting schedule (template set but no events)');\n }\n if (usedGrantDocumentSetId !== rsuGrant.usedGrantDocumentSetId) {\n regenFields.push('Grant document template');\n }\n if (grantedAt !== rsuGrant.grantTerms.grantedAt) {\n regenFields.push('Grant date');\n }\n if (name !== rsuGrant.name) {\n regenFields.push('Grant name');\n }\n if (stakeholderId !== rsuGrant.stakeholder?.id) {\n regenFields.push('Grant holder');\n }\n if (accelerationTemplateId !== (rsuGrant.accelerationTemplate?.id || null)) {\n regenFields.push('Acceleration template');\n }\n if (\n acceleratedVestingDescription !== rsuGrant.acceleratedVestingDescription\n ) {\n regenFields.push('Acceleration description');\n }\n\n return regenFields;\n};\n\nexport const rsuGrantBreadcrumbs = (\n isDraft: boolean,\n securityDraftsEnabled: boolean,\n) => {\n if (securityDraftsEnabled) {\n if (isDraft) {\n return [\n {\n title: 'Drafts',\n link: paths.equity.drafts.all,\n },\n {\n title: 'RSUs',\n link: paths.equity.drafts.rsu_grants.all,\n },\n ];\n }\n return [\n {\n title: 'Securities',\n link: paths.equity.securities.all,\n },\n {\n title: 'RSUs',\n link: paths.equity.securities.rsu_grants.all,\n },\n ];\n }\n return [\n {\n title: 'RSUs',\n link: paths.equity.rsuGrants.base,\n },\n ];\n};\n\nexport const formatUpdateArgs = (formData: any) => {\n const {\n exercisePrice,\n fairMarketValue,\n valuationId,\n ...restGrantDetailAttributes\n } = formData.grantDetailAttributes;\n\n const fmvAttributes: { [key: string]: any } = {};\n if (valuationId === 'custom') {\n fmvAttributes.fairMarketValueCurrency = fairMarketValue?.currency;\n fmvAttributes.fairMarketValueCents = fairMarketValue?.fractional;\n } else {\n fmvAttributes.valuationId = valuationId;\n }\n\n const newGrantDetailAttributes = {\n exercisePriceCurrency: exercisePrice?.currency,\n exercisePriceCents: exercisePrice?.fractional,\n ...fmvAttributes,\n ...restGrantDetailAttributes,\n };\n\n return {\n ...newGrantDetailAttributes,\n ...formData.boardConsentAttributes,\n ...formData.documentsAndNotesAttributes,\n ...formData.grantDocumentAttributes,\n ...formData.securitiesComplianceAttributes,\n ...formData.vestingAttributes,\n };\n};\n\nexport const getRsuGrantPath = (\n rsuGrant: RsuGrant,\n tab?: string,\n securityDraftsEnabled: boolean = false,\n) => {\n if (!rsuGrant) return null;\n if (securityDraftsEnabled) {\n if (rsuGrant.transactionStatus === STATUS.DRAFT) {\n return paths.equity.drafts.rsu_grants.show(rsuGrant.id, tab);\n }\n return paths.equity.securities.rsu_grants.show(rsuGrant.id, tab);\n }\n\n return paths.equity.rsuGrants.show(rsuGrant.id, tab);\n};\n","import React from 'react';\nimport { Money } from '../../../../graphql';\nimport {\n formatDate,\n formatMoneyObject,\n formatNumber,\n formatTitle,\n} from '../../../helpers/utils';\nimport StatusTag from '../StatusTag';\nimport { formatDateTime } from '../../../utils/date';\n\nexport const COLUMN_TYPES = {\n FILTER_ONLY: {\n isFilterOnly: true,\n csvExport: false,\n skipToggle: true,\n name: '',\n },\n SORT_ONLY: {\n isHidden: true,\n csvExport: false,\n skipToggle: true,\n name: '',\n allowsSorting: true,\n },\n ACTION: {\n dataField: 'action',\n csvExport: false,\n skipToggle: true,\n name: '',\n },\n};\n\nexport const CELL_PROPS = {\n TEXT: {\n kind: 'text' as 'text',\n },\n TAG: {\n kind: 'tag' as 'tag',\n },\n EDITABLE: {\n kind: 'editable' as 'editable',\n },\n CUSTOM: {\n kind: 'custom' as 'custom',\n },\n OVERFLOW_MENU: {\n kind: 'overflowMenu' as 'overflowMenu',\n },\n DATE: {\n kind: 'date' as 'date',\n format: {\n year: 'numeric' as 'numeric',\n month: 'short' as 'short',\n day: 'numeric' as 'numeric',\n },\n emptyValue: '—',\n csvFormatter: (date: Date) => formatDate(date, '—'),\n },\n DATE_TIME: {\n kind: 'date' as 'date',\n format: {\n year: 'numeric' as 'numeric',\n month: 'short' as 'short',\n day: 'numeric' as 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n },\n emptyValue: '—',\n csvFormatter: (date: Date) => formatDateTime(date, '—'),\n },\n MONEY: {\n kind: 'money' as 'money',\n emptyValue: '—',\n },\n CUSTOM_MONEY: {\n kind: 'custom' as 'custom',\n emptyValue: '—',\n formatter: (moneyObj: Money) => formatMoneyObject(moneyObj),\n },\n BETTER_MONEY: {\n kind: 'custom' as 'custom',\n emptyValue: '—',\n formatter: (moneyObj: Money) => (moneyObj ? moneyObj.betterFormat : '—'),\n csvFormatter: (moneyObj: Money) => (moneyObj ? moneyObj.betterFormat : '—'),\n searchValue: (moneyObj: Money) =>\n moneyObj ? `${moneyObj.dollars || moneyObj.betterFormat}` : '—',\n },\n NUMBER: {\n kind: 'text' as 'text',\n cellFormatter: (_row: any, _rowIndex: any, num: number) => ({\n textValue: num === undefined || num === null ? '—' : num,\n }),\n formatter: (number?: number) => formatNumber(number),\n csvFormatter: (number?: number) => formatNumber(number),\n },\n STATUS_TAG: {\n kind: 'custom' as 'custom',\n formatter: (status: string) => ,\n csvFormatter: (status: string) => formatTitle(status),\n searchValue: (status: string) => formatTitle(status),\n },\n};\n","import { EquityPlan, ShareCertificate, ShareClass } from '../../../../graphql';\nimport { ColumnType, CELL_PROPS, COLUMN_TYPES } from '../../common/StackTable';\nimport useUpdateRsaGrant from '../../rsa_grant/hooks/useUpdateRsaGrant';\nimport { CERTIFICATE_TYPES, STATUS } from '../../share_certificates/constant';\nimport useUpdateShareCertificate from '../../share_certificates/hooks/useUpdateShareCertificate';\nimport { formatNumber } from '../../../helpers/utils';\n\nexport const isDraft = (shareCertificate: ShareCertificate) => {\n if (shareCertificate.rsaGrant) {\n if (shareCertificate.rsaGrant.groupingGrantStatus === 'draft') {\n return true;\n }\n if (shareCertificate.isPendingReview) {\n return true;\n }\n } else if (shareCertificate.status === STATUS.DRAFT) {\n return true;\n } else if (shareCertificate.isPendingReview) {\n return true;\n }\n\n return false;\n};\n\nexport const issuanceMethod = (shareCertificate: ShareCertificate) => {\n if (!shareCertificate.rsaGrant) {\n return 'Offline';\n }\n if (shareCertificate.rsaGrant.grantState === 'issued') {\n return 'Offline';\n }\n return 'AngelList';\n};\n\nexport const issuanceMethodFormatter = (\n _: string,\n shareCertificate: ShareCertificate,\n) => {\n const label = issuanceMethod(shareCertificate);\n if (!label) return null;\n return label;\n};\n\nconst shareTypeFormatter = (_: string, cert: ShareCertificate) => {\n if (cert.rsaGrant) {\n return CERTIFICATE_TYPES.RSA;\n }\n return CERTIFICATE_TYPES.CERTIFICATE;\n};\n\nexport const shareCertificateTypeFormatter = (\n _: string,\n shareCertificate: ShareCertificate,\n) => {\n if (shareCertificate.rsaGrant) {\n return 'Shares From Equity Plan';\n }\n return 'Share Certificate';\n};\nexport const completionStatusFormatter = (\n _: string,\n shareCertificate: ShareCertificate,\n) =>\n shareCertificate.fieldsMissingForPublish.some((x) => x.required)\n ? 'incomplete'\n : 'complete';\n\nexport const getColumns = ({\n onUpdateShareCertificate,\n onUpdateRsaGrant,\n onMenuActionClick,\n shareClassOptions,\n equityPlanOptions,\n}: {\n onUpdateShareCertificate: ReturnType<\n typeof useUpdateShareCertificate\n >['onUpdate'];\n onUpdateRsaGrant: ReturnType['onUpdate'];\n onMenuActionClick: (key: string, shareCertificate: ShareCertificate) => void;\n shareClassOptions: Array;\n equityPlanOptions: Array;\n}): Array => [\n {\n name: 'Security name',\n dataField: 'certificateId',\n allowsSorting: true,\n cellProps: {\n ...CELL_PROPS.EDITABLE,\n searchable: true,\n emphasis: true,\n csvFormatter: (certificateId: string) => certificateId || '',\n popoverFormatter: (\n certificateId: string,\n shareCertificate: ShareCertificate,\n ) => ({\n kind: 'input',\n header: {\n title: 'Update share name',\n },\n onApply: (newVal) =>\n onUpdateShareCertificate(shareCertificate.id, {\n certificateId: newVal,\n }),\n inputProps: {\n // description: `Update the name of the convertible`,\n type: 'text',\n inputMode: 'text',\n defaultValue: certificateId ?? undefined,\n },\n }),\n },\n },\n {\n name: 'Stakeholder name',\n dataField: 'shareholder.entityName',\n allowsSorting: true,\n cellProps: {\n ...CELL_PROPS.EDITABLE,\n searchable: true,\n csvFormatter: (entityName: string) => entityName || '',\n popoverFormatter: (_: any, shareCertificate: ShareCertificate) => ({\n kind: 'input',\n header: {\n title: 'Update stakeholder name',\n },\n onApply: (newVal) =>\n onUpdateShareCertificate(shareCertificate.id, {\n inlineStakeholderAttributes: { name: newVal },\n }),\n inputProps: {\n type: 'text',\n inputMode: 'text',\n defaultValue: shareCertificate.shareholder.entityName ?? undefined,\n },\n }),\n },\n },\n {\n name: 'Stakeholder email',\n dataField: 'shareholder.user.email',\n allowsSorting: true,\n cellProps: {\n ...CELL_PROPS.EDITABLE,\n searchable: true,\n // @ts-ignore\n style: {\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n },\n csvFormatter: (email: string) => email || '',\n formatter: (_: any, shareCertificate: ShareCertificate) =>\n shareCertificate.shareholder.user.email || '—',\n popoverFormatter: (_: any, shareCertificate: ShareCertificate) => ({\n kind: 'input',\n header: {\n title: 'Update stakeholder email',\n },\n onApply: (newVal) =>\n onUpdateShareCertificate(shareCertificate.id, {\n inlineStakeholderAttributes: { email: newVal },\n }),\n inputProps: {\n type: 'text',\n inputMode: 'text',\n defaultValue: shareCertificate.shareholder.user.email ?? undefined,\n },\n }),\n },\n },\n {\n name: 'Type',\n dataField: 'type',\n allowsSorting: true,\n cellProps: {\n ...CELL_PROPS.TEXT,\n searchable: true,\n filterValue: shareTypeFormatter,\n searchValue: shareCertificateTypeFormatter,\n formatter: shareCertificateTypeFormatter,\n csvFormatter: shareCertificateTypeFormatter,\n },\n },\n {\n name: 'Issuance method',\n dataField: 'transactionStatus',\n allowsSorting: true,\n cellProps: {\n ...CELL_PROPS.TEXT,\n csvFormatter: (_: string, share: ShareCertificate) =>\n issuanceMethod(share) || '',\n formatter: issuanceMethodFormatter,\n },\n },\n {\n name: 'Shares',\n dataField: 'numShares',\n allowsSorting: true,\n cellProps: {\n ...CELL_PROPS.EDITABLE,\n searchable: true,\n formatter: (numShares: number) => formatNumber(numShares) || '—',\n csvFormatter: (numShares: string) => numShares || '',\n // @ts-ignore\n popoverFormatter: (\n numShares: number,\n shareCertificate: ShareCertificate,\n ) => ({\n kind: 'input',\n header: {\n title: 'Update number of shares',\n },\n onApply: (newVal) =>\n onUpdateShareCertificate(shareCertificate.id, {\n numShares: parseFloat(newVal),\n }),\n inputProps: {\n type: 'numeric',\n inputMode: 'numeric',\n defaultValue: numShares ?? undefined,\n },\n }),\n },\n },\n {\n // TODO disable for Shares from Equity Plan\n name: 'Share class',\n dataField: 'shareClass.name',\n allowsSorting: true,\n cellProps: {\n ...CELL_PROPS.EDITABLE,\n isDisabled: (shareCertificate: ShareCertificate) =>\n !!shareCertificate.rsaGrant,\n searchable: true,\n // @ts-ignore\n style: {\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n },\n formatter: (shareClassName: string) => shareClassName || '—',\n csvFormatter: (name: string) => name || '',\n popoverFormatter: (_: any, shareCertificate: ShareCertificate) => ({\n kind: 'selection',\n selectionMode: 'single',\n defaultSelectedKey: shareCertificate.shareClass?.id,\n items: shareClassOptions.map((vt) => ({\n key: vt.id,\n label: vt.name,\n })),\n onChange: (newVal) =>\n onUpdateShareCertificate(shareCertificate.id, {\n shareClassId: newVal,\n }),\n }),\n },\n },\n {\n // TODO disable for Shares not from Equity Plan\n name: 'Equity Plan',\n dataField: 'rsaGrant.equityPlan.name',\n allowsSorting: true,\n cellProps: {\n ...CELL_PROPS.EDITABLE,\n isDisabled: (shareCertificate: ShareCertificate) =>\n !shareCertificate.rsaGrant,\n searchable: true,\n // @ts-ignore\n style: {\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n },\n formatter: (equityPlanName: string) => equityPlanName || '—',\n csvFormatter: (name: string) => name || '',\n popoverFormatter: (_: any, shareCertificate: ShareCertificate) => ({\n kind: 'selection',\n selectionMode: 'single',\n defaultSelectedKey: shareCertificate.rsaGrant?.equityPlan?.id,\n items: equityPlanOptions.map((vt) => ({\n key: vt.id,\n label: vt.name,\n })),\n onChange: (newVal) =>\n onUpdateRsaGrant(shareCertificate.rsaGrant.id, {\n equityPlanId: newVal,\n }),\n }),\n },\n },\n {\n name: 'Completion status',\n dataField: 'completionStatus',\n allowsSorting: true,\n isHidden: true,\n cellProps: {\n ...CELL_PROPS.TEXT,\n searchable: true,\n filterValue: completionStatusFormatter,\n searchValue: completionStatusFormatter,\n formatter: completionStatusFormatter,\n },\n },\n {\n ...COLUMN_TYPES.SORT_ONLY,\n dataField: 'createdAt',\n cellProps: {\n ...CELL_PROPS.DATE,\n },\n },\n {\n ...COLUMN_TYPES.ACTION,\n cellProps: {\n ...CELL_PROPS.OVERFLOW_MENU,\n getMenuSections: () => [\n {\n label: 'View',\n key: 'view',\n },\n {\n label: 'Edit',\n key: 'edit',\n },\n {\n label: 'Delete',\n key: 'delete',\n },\n { label: 'Publish', key: 'publish' },\n ],\n onAction: (key: string, shareCertificate: ShareCertificate) =>\n onMenuActionClick(key, shareCertificate),\n exposedButton: { label: 'Publish', key: 'publish', variant: 'secondary' },\n },\n },\n];\n","import { useMemo } from 'react';\nimport {\n Convertible,\n MissingField,\n Security,\n ShareCertificate,\n} from '../../../graphql';\nimport {\n CONVERTIBLE_GQL_SQL_TYPE_MAP,\n CONVERTIBLE_TYPES_LIST,\n} from '../convertibles/constant';\nimport {\n convertibleType,\n getDebtPath,\n getSafePath,\n getSaftPath,\n getTokenWarrantPath,\n getWarrantPath,\n getConvertibleName,\n} from '../convertibles/utils';\nimport { grantTypeFormatter } from '../grants/utils';\nimport { getEsopGrantPath } from '../esop_grants/utils';\nimport { getRsuGrantPath } from '../rsu_grants/utils';\nimport { isDraft } from './share_certificates/utils';\nimport paths from '../../paths';\n\nexport const isGrantTypeName = (security: Security) =>\n security.__typename === 'EsopGrant' || security.__typename === 'RsuGrant';\n\nexport const getSecurityName = (security: Security) => {\n if (CONVERTIBLE_TYPES_LIST.includes(security.__typename))\n return getConvertibleName(security as Convertible);\n if (isGrantTypeName(security)) return security.name;\n if (security.__typename === 'ShareCertificate') return security.certificateId;\n return '—';\n};\n\nexport const securityType = (security: Security) => {\n if (CONVERTIBLE_TYPES_LIST.includes(security.__typename))\n return convertibleType(security as Convertible);\n if (security.__typename === 'EsopGrant')\n return grantTypeFormatter(security.grantType);\n if (security.__typename === 'RsuGrant') return grantTypeFormatter('RSU');\n if (security.__typename === 'ShareCertificate') return 'Share Certificate';\n return security.__typename;\n};\n\nconst getMissingFieldsForPublish = (\n security: Security,\n): Array => {\n if (isGrantTypeName(security)) {\n return security.fieldsMissingForPublish;\n }\n\n if (security.__typename === 'ShareCertificate') {\n if (security.rsaGrant) {\n return security.rsaGrant.fieldsMissingForPublish;\n }\n return security.fieldsMissingForPublish;\n }\n\n return (security as Convertible)?.missingFields || [];\n};\n\nconst getInvalidFieldsForPublish = (security: Security): Array =>\n (security as Convertible)?.invalidFieldsForPublish || [];\n\nexport const getMissingFieldsMetadata = (security: Security) => {\n const missingFields = (getMissingFieldsForPublish(security) || []).filter(\n (x) => x.required,\n );\n const invalidFields = getInvalidFieldsForPublish(security).filter(\n (x) => x.required,\n );\n\n return {\n security,\n missingFields,\n invalidFields,\n isValid: missingFields.length === 0 && invalidFields.length === 0,\n };\n};\n\nexport const backendType = (security: Security) => {\n if (\n ['EsopGrant', 'RsuGrant', 'ShareCertificate'].includes(security.__typename)\n ) {\n return security.__typename;\n }\n\n return CONVERTIBLE_GQL_SQL_TYPE_MAP[(security as Convertible).__typename];\n};\n\nexport const sortByCreatedAt = (a: Security, b: Security) => {\n if (a.createdAt && b.createdAt) {\n return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();\n }\n return 0;\n};\n\nexport const useCalculatedSecurities = (securities: Security[]) =>\n useMemo(() => {\n const allSecurities = securities.map((security) =>\n getMissingFieldsMetadata(security),\n );\n const validSecurities = allSecurities.filter((x) => x.isValid);\n const missinInfoSecurities = allSecurities.filter((x) => !x.isValid);\n\n return { allSecurities, validSecurities, missinInfoSecurities };\n }, [securities]);\n\nexport const getShareCertificatePath = (\n shareCertificate: ShareCertificate,\n tab?: string,\n securityDraftsEnabled: boolean = false,\n) => {\n if (!shareCertificate) return null;\n if (securityDraftsEnabled) {\n if (isDraft(shareCertificate)) {\n return paths.equity.drafts.shares.show(shareCertificate.id, tab);\n }\n return paths.equity.securities.shares.show(shareCertificate.id, tab);\n }\n return paths.equity.shareCertificate(shareCertificate.id, tab);\n};\n\nexport const getSecurityPath = (\n security: Security,\n securityDraftsEnabled = false,\n) => {\n const { __typename } = security;\n if (__typename === 'EsopGrant') {\n return getEsopGrantPath(security, undefined, securityDraftsEnabled);\n }\n if (__typename === 'RsuGrant') {\n return getRsuGrantPath(security, undefined, securityDraftsEnabled);\n }\n if (__typename === 'ShareCertificate') {\n return getShareCertificatePath(security, undefined, securityDraftsEnabled);\n }\n if (__typename === 'ConvertibleSafe') {\n return getSafePath(security, undefined, securityDraftsEnabled);\n }\n if (__typename === 'ConvertibleDebt') {\n return getDebtPath(security, undefined, securityDraftsEnabled);\n }\n if (__typename === 'WarrantCertificate') {\n return getWarrantPath(security, securityDraftsEnabled);\n }\n if (__typename === 'Saft') {\n return getSaftPath(security, securityDraftsEnabled);\n }\n if (__typename === 'TokenWarrant') {\n return getTokenWarrantPath(security, securityDraftsEnabled);\n }\n return null;\n};\n","import React from 'react';\nimport { Stack, Text } from '@angellist/adapt';\n\nimport {\n ConvertibleDebt,\n ConvertibleSafe,\n EquityTransaction,\n EsopGrant,\n NewStakeholder,\n Security,\n ShareCertificate,\n WarrantCertificate,\n} from '../../../graphql';\nimport {\n LinkColumn,\n LinkTextColumn,\n NameColumn,\n} from '../../helpers/formatters';\nimport { formatDate } from '../../helpers/utils';\nimport {\n AMENDMENT_STATUS_MAP,\n EXERCISE_STATUS_MAP,\n TRANSACTION_TYPES,\n TRANSACTION_TYPE_NAME_MAP,\n} from './constant';\n\nimport paths from '../../paths';\nimport SurrenderDetailPane from '../surrender/SurrenderDetailPane';\nimport ShareRepurchaseDetailPane from './components/ShareRepurchaseDetailPane';\nimport useAdaptPane from '../common/hooks/useAdaptPane';\nimport StatusTag from '../common/StatusTag';\nimport { useCompanyContext } from '../../context/CompanyContext';\nimport {\n getDebtPath,\n getSafePath,\n getWarrantPath,\n} from '../convertibles/utils';\nimport { getEsopGrantPath } from '../esop_grants/utils';\nimport { getShareCertificatePath } from '../security_drafts/utils';\n\nexport const SecurityNameFormatter = ({ security }: { security: Security }) => {\n const { securityDraftsEnabled } = useCompanyContext();\n if (security === null || security === undefined) {\n return null;\n }\n\n const { __typename } = security;\n\n if (__typename === 'ShareCertificate') {\n return (\n \n );\n }\n\n if (__typename === 'ConvertibleSafe') {\n return (\n \n );\n }\n\n if (__typename === 'ConvertibleDebt') {\n return (\n \n );\n }\n\n if (__typename === 'WarrantCertificate') {\n return (\n \n );\n }\n\n if (__typename === 'EsopGrant') {\n return (\n \n );\n }\n\n return null;\n};\n\nexport const NameFormatter = (props: {\n equityTransaction: EquityTransaction;\n}) => {\n const {\n equityTransaction: {\n instrumentId,\n transactionType,\n instrumentType,\n instrumentName,\n },\n } = props;\n\n const { securityDraftsEnabled } = useCompanyContext();\n\n if (transactionType === 'original_issuance') {\n let path;\n switch (instrumentType) {\n case 'EsopGrant':\n path = getEsopGrantPath(\n { id: instrumentId } as EsopGrant,\n undefined,\n securityDraftsEnabled,\n );\n break;\n case 'ShareCertificate':\n path = getShareCertificatePath(\n { id: instrumentId } as ShareCertificate,\n undefined,\n securityDraftsEnabled,\n );\n break;\n case 'ConvertibleSafeInstrument':\n path = getSafePath(\n { id: instrumentId } as ConvertibleSafe,\n undefined,\n securityDraftsEnabled,\n );\n break;\n case 'ConvertibleDebt':\n path = getDebtPath(\n { id: instrumentId } as ConvertibleDebt,\n undefined,\n securityDraftsEnabled,\n );\n break;\n case 'WarrantCertificate':\n path = getWarrantPath(\n { id: instrumentId } as WarrantCertificate,\n securityDraftsEnabled,\n );\n break;\n default:\n path = '';\n }\n\n if (path) {\n return ;\n }\n return ;\n }\n\n if (\n transactionType === 'share_repurchase' ||\n transactionType === 'balance_transfer'\n ) {\n return (\n \n );\n }\n\n if (transactionType === 'transfer') {\n let path;\n switch (instrumentType) {\n case 'EsopGrant':\n path = getEsopGrantPath(\n { id: instrumentId } as EsopGrant,\n undefined,\n securityDraftsEnabled,\n );\n break;\n case 'ShareCertificate':\n path = getShareCertificatePath(\n { id: instrumentId } as ShareCertificate,\n undefined,\n securityDraftsEnabled,\n );\n break;\n case 'ConvertibleSafeInstrument':\n path = getSafePath(\n { id: instrumentId } as ConvertibleSafe,\n undefined,\n securityDraftsEnabled,\n );\n break;\n case 'ConvertibleDebt':\n path = getDebtPath(\n { id: instrumentId } as ConvertibleDebt,\n undefined,\n securityDraftsEnabled,\n );\n break;\n case 'WarrantCertificate':\n path = getWarrantPath(\n { id: instrumentId } as WarrantCertificate,\n securityDraftsEnabled,\n );\n break;\n default:\n path = '';\n }\n\n if (path) {\n return ;\n }\n return ;\n }\n\n if (transactionType === 'conversion_event') {\n let path;\n switch (instrumentType) {\n case 'EsopGrant':\n path = getEsopGrantPath(\n { id: instrumentId } as EsopGrant,\n undefined,\n securityDraftsEnabled,\n );\n break;\n case 'ShareCertificate':\n path = getShareCertificatePath(\n { id: instrumentId } as ShareCertificate,\n undefined,\n securityDraftsEnabled,\n );\n break;\n case 'ConvertibleSafeInstrument':\n path = getSafePath(\n { id: instrumentId } as ConvertibleSafe,\n undefined,\n securityDraftsEnabled,\n );\n break;\n case 'ConvertibleDebt':\n path = getDebtPath(\n { id: instrumentId } as ConvertibleDebt,\n undefined,\n securityDraftsEnabled,\n );\n break;\n case 'WarrantCertificate':\n path = getWarrantPath(\n { id: instrumentId } as WarrantCertificate,\n securityDraftsEnabled,\n );\n break;\n default:\n path = '';\n }\n\n if (path) {\n return ;\n }\n return ;\n }\n\n if (transactionType === 'amendment_event') {\n let path;\n switch (instrumentType) {\n case 'EsopGrant':\n path = getEsopGrantPath(\n { id: instrumentId } as EsopGrant,\n undefined,\n securityDraftsEnabled,\n );\n break;\n case 'ShareCertificate':\n path = getShareCertificatePath(\n { id: instrumentId } as ShareCertificate,\n undefined,\n securityDraftsEnabled,\n );\n break;\n case 'ConvertibleSafeInstrument':\n path = getSafePath(\n { id: instrumentId } as ConvertibleSafe,\n undefined,\n securityDraftsEnabled,\n );\n break;\n case 'ConvertibleDebt':\n path = getDebtPath(\n { id: instrumentId } as ConvertibleDebt,\n undefined,\n securityDraftsEnabled,\n );\n break;\n case 'WarrantCertificate':\n path = getWarrantPath(\n { id: instrumentId } as WarrantCertificate,\n securityDraftsEnabled,\n );\n break;\n default:\n path = '';\n }\n\n if (path) {\n return ;\n }\n return ;\n }\n\n return (\n \n );\n};\n\nconst SurrenderDateCell = (props: { equityTransaction: EquityTransaction }) => {\n const { equityTransaction } = props;\n const detailPane = useAdaptPane();\n\n return (\n <>\n detailPane.onOpen({ id: equityTransaction.id })}\n />\n {detailPane.paneProps.id && (\n \n )}\n \n );\n};\n\nconst ShareRepurchaseDateCell = (props: {\n equityTransaction: EquityTransaction;\n}) => {\n const { equityTransaction } = props;\n const detailPane = useAdaptPane();\n\n return (\n <>\n detailPane.onOpen({ id: equityTransaction.id })}\n />\n {detailPane.paneProps.id && (\n \n )}\n \n );\n};\n\nexport const IdFormatter = (props: {\n equityTransaction: EquityTransaction;\n}) => {\n const { equityTransaction } = props;\n const { id, transactionType, transactionDate } = equityTransaction;\n const { securityDraftsEnabled } = useCompanyContext();\n\n if (transactionType === 'option_exercise') {\n return (\n \n );\n }\n\n if (transactionType === 'share_repurchase') {\n return ;\n }\n\n if (\n [\n 'balance_transfer',\n 'transfer',\n 'conversion_event',\n 'stock_split',\n ].includes(transactionType)\n ) {\n return (\n \n );\n }\n if (transactionType === 'amendment_event') {\n return (\n \n );\n }\n\n if (transactionType === 'original_issuance') {\n switch (equityTransaction.instrumentType) {\n case 'EsopGrant':\n return (\n \n );\n case 'ShareCertificate':\n return (\n \n );\n case 'ConvertibleSafeInstrument':\n return (\n \n );\n case 'ConvertibleDebt':\n return (\n \n );\n case 'WarrantCertificate':\n return (\n \n );\n default:\n return ;\n }\n }\n\n if (transactionType === 'surrender') {\n return ;\n }\n\n return ;\n};\n\nexport const stakeholderFormatter = (stakeholder: NewStakeholder) => {\n if (stakeholder?.name) {\n return stakeholder.name;\n }\n return '—';\n};\n\nexport const stakeholderValue = (stakeholder: NewStakeholder) => {\n if (stakeholder?.name) {\n return stakeholder.name;\n }\n return '';\n};\n\nexport const getTransactionTypeValue = (transactionType: string) =>\n TRANSACTION_TYPE_NAME_MAP[transactionType];\n\nexport const transactionStatusFormatter = (\n transactionType: string,\n equityTransaction: EquityTransaction,\n) => {\n const { state } = equityTransaction;\n\n return (\n <>\n {transactionType === TRANSACTION_TYPES.OPTION_EXERCISE && (\n \n )}\n \n );\n};\n\nexport const granttransactionStatusFormatter = (\n transactionType: string,\n equityTransaction: EquityTransaction,\n) => {\n const { state } = equityTransaction;\n\n const statusLabel =\n transactionType === TRANSACTION_TYPES.AMENDMENT\n ? AMENDMENT_STATUS_MAP[state]\n : EXERCISE_STATUS_MAP[state];\n\n return ;\n};\nexport const transactionTypeFormatter = (transactionType: string) => (\n \n {getTransactionTypeValue(transactionType)}\n \n);\n","export const BOARD_APPROVAL_STATUS_OPTIONS = [\n {\n label: 'Yes',\n value: 'approved',\n },\n {\n label: 'No (or unknown)',\n value: 'not_approved',\n },\n];\n\nexport const HELP_URLS = {\n RAISE: `https://help.angelliststack.com/fundraising/raise/what-is-raise`,\n ROLLUPS: `https://help.angelliststack.com/guides/equity-administration/safe-cleanups`,\n ROLLUPS_MARKETING: `https://angellist.com/startups/equity/safe-cleanups`,\n CLOSING_RUV: `https://help.angelliststack.com/fundraising/ruv/closing-an-ruv`,\n STATE_REGULATORY_FEES: `https://help.angelliststack.com/fundraising/ruv/setting-up-an-ruv#fees-and-economics`,\n STAKEHOLDER: {\n DELETE_STAKEHOLDER:\n 'https://help.angelliststack.com/guides/equity-administration/stakeholder-management#how-do-i-change-the-login-email-for-a-stakeholder',\n },\n SHAREHOLDERS: {\n AFTER_INVITE: `https://help.angelliststack.com/equity/stakeholder-experience/stakeholder-experience#how-does-a-stakeholder-login-to-their-dashboard-after-they-ve-accepted-their-invitation`,\n },\n STOCK_SPLIT: 'https://help.angelliststack.com/guides',\n};\n\nexport const INDUSTRY_OPTIONS = [\n { label: 'Software', value: 'Software' },\n { label: 'Finance and Insurance', value: 'Finance and Insurance' },\n {\n label: 'Real Estate and Rental and Leasing',\n value: 'Real Estate and Rental and Leasing',\n },\n {\n label: 'Health Care and Social Assistance',\n value: 'Health Care and Social Assistance',\n },\n {\n label: 'Arts, Entertainment, and Recreation',\n value: 'Arts, Entertainment, and Recreation',\n },\n { label: 'Construction', value: 'Construction' },\n {\n label: 'Agriculture, Forestry, Fishing and Hunting',\n value: 'Agriculture, Forestry, Fishing and Hunting',\n },\n { label: 'Educational Services', value: 'Educational Services' },\n { label: 'Other Services', value: 'Other Services' },\n { label: 'Manufacturing', value: 'Manufacturing' },\n {\n label: 'Transportation and Warehousing',\n value: 'Transportation and Warehousing',\n },\n];\n\nexport const STOCK_ISSUANCE_TYPES = {\n NON_TRACKING_STOCK_ISSUANCE: 'None - Tracking Only',\n UNCERTIFICATED_STOCK_ISSUANCE: 'Uncertificated / Certificate Free Issuances',\n CERTIFICATED_STOCK_ISSUANCE: 'Digital Certificate Generation',\n};\n\nexport const ISSUANCE_METHODS = {\n BOOK_ENTRY_NO_EMAIL: 'book_entry_no_email',\n CERTIFICATE_FREE: 'certificate_free',\n CERTIFICATE: 'certificate',\n INVITE: 'invite',\n};\n\nexport const CERTIFICATE_TYPE_OPTIONS = [\n {\n value: ISSUANCE_METHODS.BOOK_ENTRY_NO_EMAIL,\n label: 'Book Entry Only (No Email or Notice of Issuance)',\n mapValue: STOCK_ISSUANCE_TYPES.NON_TRACKING_STOCK_ISSUANCE,\n displayValue: 'Book Entry Only',\n },\n {\n value: ISSUANCE_METHODS.CERTIFICATE_FREE,\n label: 'Certificate Free Stock Issuance (Includes notice of issuance)',\n mapValue: STOCK_ISSUANCE_TYPES.UNCERTIFICATED_STOCK_ISSUANCE,\n displayValue: 'Certificate Free Stock Issuance',\n },\n {\n value: ISSUANCE_METHODS.CERTIFICATE,\n label: 'Certificated Stock Issuance (Requires Company Signatures)',\n mapValue: STOCK_ISSUANCE_TYPES.CERTIFICATED_STOCK_ISSUANCE,\n displayValue: 'Certificated Stock Issuance',\n },\n];\n","import React from 'react';\nimport {\n EquityTransaction,\n HealthCheck,\n RsaGrant,\n Security,\n SecurityInvite,\n ShareCertificate,\n} from '../../../graphql';\nimport { NameColumn, statusFormatter } from '../../helpers/formatters';\nimport {\n AllShareCertificateDraftsBreadcrumbs,\n ShareCertificateBreadcrumbs,\n ShareCertificateSecurityBreadcrumbs,\n STATUS,\n} from './constant';\nimport { formatNumber, formatTitle } from '../../helpers/utils';\nimport StatusTag, { STATUS_TAG_INTENT_MAPPING } from '../common/StatusTag';\nimport UnitsColumn from '../common/UnitsColumn';\nimport { COLUMN_ATTRIBUTES } from '../../utils/column';\nimport {\n IdFormatter,\n SecurityNameFormatter,\n} from '../equity_transactions/utils';\nimport { ISSUANCE_METHODS } from '../constants';\nimport paths from '../../paths';\nimport { isDraft } from '../security_drafts/share_certificates/utils';\nimport { getTransactionTypeValue } from '../equity_transactions/constant';\n\nexport const shareCertificateBreadcrumbs = (\n isDraftShareCertificate: boolean,\n securityDraftsEnabled: boolean,\n) => {\n if (isDraftShareCertificate) {\n return [\n {\n title: 'Drafts',\n link: paths.equity.drafts.all,\n },\n ...AllShareCertificateDraftsBreadcrumbs,\n ];\n }\n if (securityDraftsEnabled) {\n return ShareCertificateSecurityBreadcrumbs;\n }\n return ShareCertificateBreadcrumbs;\n};\n\nexport const isDraftCert = (shareCert: ShareCertificate) =>\n (shareCert.rsaGrant && !shareCert.rsaGrant.filledOut) ||\n (!shareCert.rsaGrant && shareCert.state === STATUS.DRAFT);\n\nexport const certificateIdFormatter = (\n certificateId: string,\n shareCert: ShareCertificate,\n draftCheckFn: (shareCert: ShareCertificate) => boolean = isDraftCert,\n) => {\n const healthChecks =\n shareCert.healthChecks?.reduce(\n (acc: { [key: string]: HealthCheck }, curr) => {\n if (!curr.source) acc[curr.title] = curr;\n if (curr.source && curr.status === 'active') acc[curr.title] = curr;\n return acc;\n },\n {},\n ) || {};\n\n const isADraft = draftCheckFn(shareCert);\n\n return (\n \n );\n};\n\nexport const pendingIssuanceItemsCSVFormatter = (\n _: boolean,\n shareCertificate: ShareCertificate,\n) => {\n if (shareCertificate.awardPending) {\n return 'Award Pending';\n }\n if (shareCertificate.certificatePending) {\n return 'Certificate Pending';\n }\n if (shareCertificate.noticePending) {\n return 'Notice Pending';\n }\n return '';\n};\n\nexport const pendingIssuanceItemsFormatter = (\n _: boolean,\n shareCertificate: ShareCertificate,\n) => {\n if (shareCertificate.awardPending) {\n return ;\n }\n if (shareCertificate.certificatePending) {\n return ;\n }\n if (shareCertificate.noticePending) {\n return ;\n }\n return null;\n};\n\nexport const getInviteStatus = (\n state: string,\n securityInvite: SecurityInvite,\n) => {\n const issuanceMethods = [\n ISSUANCE_METHODS.BOOK_ENTRY_NO_EMAIL,\n ISSUANCE_METHODS.INVITE,\n ];\n if (\n [\n STATUS.PARTIAL_TRANSFER,\n STATUS.TRANSFERRED,\n STATUS.FULL_TRANSFER,\n ].includes(state) ||\n !securityInvite ||\n issuanceMethods.includes(securityInvite?.issuanceMethod) ||\n securityInvite.status === 'completed' ||\n state === 'draft'\n ) {\n const status = state || 'active';\n return { transactionStatus: status, status, title: formatTitle(status) };\n }\n\n const status = state || 'active';\n return {\n transactionStatus: STATUS.PENDING_ACCEPTANCE,\n status,\n intent: 'warning' as 'warining',\n title: `${formatTitle(status)} (Pending Acceptance)`,\n };\n};\n\nexport const rsaStatusFormatter = (\n cert: ShareCertificate,\n grant: RsaGrant,\n securityInvite: SecurityInvite,\n) => {\n let intent;\n let status;\n\n // This is temporary solution to ensure that converted certificates are displayed as converted without\n // depending on the state column. Dependency on state colum breaks as of reporting\n // for some companies, so we reset their state to nil.\n const formattedState =\n cert?.status === 'converted' ? 'converted' : cert?.state;\n\n if (cert?.state === 'draft' && !grant?.grantIssuance?.completedAt) {\n intent = 'draft' as 'draft';\n status = 'Draft (Pending Execution)';\n } else if (securityInvite?.status !== 'completed') {\n const formattedTitle = formatTitle(formattedState || 'active');\n status = `${formattedTitle || 'Active'} (Pending Issuance)`;\n intent = STATUS_TAG_INTENT_MAPPING[formattedState || 'active'];\n } else {\n status = formatTitle(formattedState || 'active');\n intent = STATUS_TAG_INTENT_MAPPING[formattedState || 'active'];\n }\n\n return {\n status,\n intent,\n };\n};\n\nexport const outstandingStatusFormatter = (outstandingStatus: string) =>\n statusFormatter(\n outstandingStatus,\n STATUS_TAG_INTENT_MAPPING[outstandingStatus],\n );\n\nexport const outstandingCsvStatusFormatter = (outstandingStatus: string) =>\n formatTitle(outstandingStatus || '—');\n\nexport const inviteStatusFormatter = (\n state: string,\n cert: ShareCertificate,\n) => {\n const { securityInvite, rsaGrant } = cert;\n if (rsaGrant) {\n const { status, intent } = rsaStatusFormatter(\n cert,\n rsaGrant,\n securityInvite,\n );\n\n return statusFormatter(status, intent, status);\n }\n\n const { status, title, intent } = getInviteStatus(state, securityInvite);\n return statusFormatter(status, intent, title);\n};\n\nexport const isVestingCertificate = (shareCertificate: ShareCertificate) =>\n !!shareCertificate.vestingTemplate?.id;\n\nexport const formatContributionAttributes = (formData: any): any => {\n const {\n contributionAttributes,\n hasCapitalContribution,\n hasValueOfDebtCancelled,\n hasValueOfIpContribution,\n hasValueOfOtherConsideration,\n hasConversionAmount,\n } = formData;\n\n return {\n capitalContributionCents: hasCapitalContribution\n ? contributionAttributes?.capitalContribution?.fractional\n : null,\n capitalContributionCurrency: hasCapitalContribution\n ? contributionAttributes?.capitalContribution?.currency\n : null,\n valueOfIpContributionCents: hasValueOfIpContribution\n ? contributionAttributes?.valueOfIpContribution?.fractional\n : null,\n valueOfIpContributionCurrency: hasValueOfIpContribution\n ? contributionAttributes?.valueOfIpContribution?.currency\n : null,\n valueOfDebtCancelledCents: hasValueOfDebtCancelled\n ? contributionAttributes?.valueOfDebtCancelled?.fractional\n : null,\n valueOfDebtCancelledCurrency: hasValueOfDebtCancelled\n ? contributionAttributes?.valueOfDebtCancelled?.currency\n : null,\n valueOfOtherConsiderationCents: hasValueOfOtherConsideration\n ? contributionAttributes?.valueOfOtherConsideration?.fractional\n : null,\n valueOfOtherConsiderationCurrency: hasValueOfOtherConsideration\n ? contributionAttributes?.valueOfOtherConsideration?.currency\n : null,\n conversionAmountCents: hasConversionAmount\n ? contributionAttributes?.conversionAmount?.fractional\n : null,\n conversionAmountCurrency: hasConversionAmount\n ? contributionAttributes?.conversionAmount?.currency\n : null,\n };\n};\n\nconst formatVestingAttributes = (formData: any) => ({\n ...formData.vestingAttributes,\n vestingTemplateId: formData.hasVestingSchedule\n ? formData.vestingAttributes.vestingTemplateId\n : null,\n accelerationTemplateId: formData.hasAcceleration\n ? formData.vestingAttributes.accelerationTemplateId\n : null,\n companyLegendIds: formData.hasCompanyLegends\n ? formData.vestingAttributes.companyLegendIds\n : [],\n vestingStartBackdate: formData.hasVestingStartBackdate\n ? formData.vestingAttributes.vestingStartBackdate\n : null,\n});\n\nexport const formatShareAttributes = (formData: any) => {\n const {\n pricePerShare,\n numShares,\n ...restCertificateDetailAttributes\n } = formData.certificateDetailAttributes;\n\n return {\n ...restCertificateDetailAttributes,\n ...formData.securitiesComplianceAttributes,\n ...formData.boardConsentAttributes,\n ...formatVestingAttributes(formData),\n ...formatContributionAttributes(formData),\n ...formData.documentsAndNotesAttributes,\n ...formData.issuanceMethodAttributes,\n ...formData.spaMethodAttributes,\n numShares: Number(numShares),\n pricePerShareCents: pricePerShare?.fractional,\n pricePerShareCurrency: pricePerShare?.currency,\n spaDocument:\n // eslint-disable-next-line no-underscore-dangle\n formData.spaMethodAttributes?.spaDocument?.__typename === 'Document'\n ? undefined\n : formData.spaMethodAttributes?.spaDocument,\n };\n};\n\nexport const isCertificateTransferred = (state: string) =>\n [STATUS.PARTIAL_TRANSFER, STATUS.FULL_TRANSFER, STATUS.TRANSFERRED].includes(\n state,\n );\n\nexport const unitsColumnFormatter = (\n _: never,\n shareCertificate: ShareCertificate,\n) => {\n const { unitsVested, numShares, state } = shareCertificate;\n if (isVestingCertificate(shareCertificate) && numShares) {\n return (\n \n );\n }\n return formatNumber(numShares);\n};\n\nexport const unitsCsvFormatter = (\n _: never,\n shareCertificate: ShareCertificate,\n) => {\n const { unitsVested, numShares } = shareCertificate;\n if (isVestingCertificate(shareCertificate) && numShares) {\n return `${formatNumber(unitsVested)}/${formatNumber(numShares)}`;\n }\n return formatNumber(numShares);\n};\n\nexport const unitsSearchValue = (\n _: never,\n shareCertificate: ShareCertificate,\n) => {\n const { unitsVested, numShares } = shareCertificate;\n if (isVestingCertificate(shareCertificate) && numShares) {\n return `${unitsVested}_${numShares}_${formatNumber(\n unitsVested,\n )}_${formatNumber(numShares)}`;\n }\n\n return numShares;\n};\n\nexport const TRANSACTION_COLUMNS = [\n {\n ...COLUMN_ATTRIBUTES.DATE,\n dataField: 'transactionDate',\n text: 'Date',\n formatter: (_: string, equityTransaction: EquityTransaction) => (\n \n ),\n },\n {\n dataField: 'transactionType',\n text: 'Type',\n formatter: getTransactionTypeValue,\n searchValue: getTransactionTypeValue,\n sort: true,\n headerStyle: { minWidth: 120 },\n },\n {\n ...COLUMN_ATTRIBUTES.NUMBER,\n dataField: 'numUnits',\n text: 'Quantity',\n formatter: formatNumber,\n },\n {\n dataField: 'origin',\n text: 'Origin',\n formatter: (security: Security) => (\n \n ),\n },\n {\n dataField: 'destination',\n text: 'Destination',\n formatter: (security: Security) => (\n \n ),\n },\n];\n\nexport const getShareCertificatePath = (\n shareCertificate: ShareCertificate,\n tab?: string,\n securityDraftsEnabled: boolean = false,\n) => {\n if (!shareCertificate) return null;\n if (securityDraftsEnabled) {\n if (isDraft(shareCertificate)) {\n return paths.equity.drafts.shares.show(shareCertificate.id, tab);\n }\n return paths.equity.securities.shares.show(shareCertificate.id, tab);\n }\n return paths.equity.shareCertificate(shareCertificate.id, tab);\n};\n","import React from 'react';\nimport { groupBy } from 'lodash';\nimport { Link } from 'react-router-dom';\nimport { Tooltip } from '@angellist/adapt';\n\nimport UnitsColumn from '../common/UnitsColumn';\nimport HealthCheckRowActions from './components/HealthCheckRowActions';\nimport { COLUMN_ATTRIBUTES } from '../../utils/column';\nimport { LinkColumn } from '../../helpers/formatters';\nimport {\n HealthCheck,\n EsopGrant,\n Employee,\n AiParseResult,\n} from '../../../graphql';\n\nimport paths from '../../paths';\nimport { fromNow } from '../../utils/date';\nimport { parseLocation } from '../../helpers/locations';\nimport { CHECK_TYPES, DEGREE } from './constant';\nimport { isDeletedEmail } from '../../utils';\nimport { useCompanyContext } from '../../context/CompanyContext';\nimport { getShareCertificatePath } from '../share_certificates/utils';\nimport { getSafePath } from '../convertibles/utils';\nimport { getEsopGrantPath } from '../esop_grants/utils';\n\nexport const shareClassFormatter = (_: any, healthCheck: HealthCheck) =>\n healthCheck.equityPlan ? (\n \n ) : (\n '—'\n );\n\nexport const equityPlanNameFormatter = (_: any, healthCheck: HealthCheck) => (\n \n);\n\nexport const grantDocumentSetFormatter = (_: any, healthCheck: HealthCheck) => (\n \n);\n\nexport const numSharesFormatter = (_: never, healthCheck: HealthCheck) => {\n const { numShares, numSharesAvailable } = healthCheck.equityPlan;\n if (numShares) {\n return (\n \n );\n }\n return null;\n};\n\nexport const employeeNameFormatter = (\n name: string,\n healthCheck: HealthCheck,\n) => (\n \n
\n
\n {name || healthCheck.employee.id}\n
\n
\n \n);\n\nexport const stakeholderNameFormatter = (\n _name: string,\n healthCheck: HealthCheck,\n) => (\n \n
\n
\n {healthCheck.stakeholder.name || healthCheck.stakeholder.employee.id}\n
\n
\n \n);\n\nexport const stakeholderFormatter = (\n _name: string,\n healthCheck: HealthCheck,\n) => (\n \n
\n
\n {healthCheck.shareCertificate.stakeholder.name}\n
\n
\n \n);\n\nexport const ShareCertificateLinkNameFormatter = ({\n healthCheck,\n}: {\n healthCheck: HealthCheck;\n}) => {\n const { securityDraftsEnabled } = useCompanyContext();\n return (\n \n );\n};\n\nexport const shareCertificateShareClassFormatter = (\n _: any,\n healthCheck: HealthCheck,\n) =>\n healthCheck.shareCertificate ? (\n \n ) : (\n '—'\n );\n\nexport const emailFormatter = (email: string) => {\n if (!email || isDeletedEmail(email)) {\n return '';\n }\n\n return {email};\n};\n\nexport const unitsColumnFormatter = (_: never, grant: EsopGrant) => {\n const { unitsVested, totalUnits } = grant;\n if (totalUnits) {\n return ;\n }\n return null;\n};\n\nexport const EsopGrantNameFormatter = (props: { healthCheck: HealthCheck }) => {\n const { healthCheck } = props;\n const { securityDraftsEnabled } = useCompanyContext();\n\n return (\n \n );\n};\n\nexport const esopExerciseNameFormatter = (_: any, healthCheck: HealthCheck) => (\n \n);\n\nexport const aiHealthCheckFixPath = (\n aiParseResult: AiParseResult,\n securityDraftsEnabled: boolean,\n) => {\n if (aiParseResult.convertibleSafe) {\n return getSafePath(\n aiParseResult.convertibleSafe,\n undefined,\n securityDraftsEnabled,\n );\n }\n if (aiParseResult.esopGrant) {\n return getEsopGrantPath(\n aiParseResult.esopGrant,\n undefined,\n securityDraftsEnabled,\n );\n }\n return null;\n};\n\nexport const healthCheckFixPath = (\n healthCheck: HealthCheck,\n securityDraftsEnabled: boolean,\n) => {\n const { ownerId, ownerType, category, checkType } = healthCheck;\n let path = '';\n if (ownerType === 'EquityPlan') {\n path = paths.equity.plans.equityPlan(ownerId);\n } else if (ownerType === 'Employee') {\n path = paths.equity.stakeholders.show(ownerId);\n } else if (category === 'board_consent') {\n path = paths.legal.boardConsents.all;\n } else if (ownerType === 'EsopGrant') {\n path = getEsopGrantPath(\n { id: ownerId } as EsopGrant,\n undefined,\n securityDraftsEnabled,\n );\n } else if (category === 'valuation') {\n path = paths.equity.valuations.all;\n } else if (ownerType === 'AiParseResult') {\n path = aiHealthCheckFixPath(\n healthCheck.aiParseResult,\n securityDraftsEnabled,\n );\n } else if (ownerType === 'EsopExercise') {\n path = paths.equity.exercise(ownerId);\n } else if (checkType === CHECK_TYPES.COI_MISSING_SHARE_CLASSES) {\n path = paths.equity.shareClasses;\n } else if (ownerType === 'Stakeholder') {\n path = paths.equity.stakeholders.show(healthCheck.stakeholder.employee.id);\n }\n\n return path;\n};\n\nexport const processStatusesData = (data: any[]) => {\n if (data.length) {\n const groupHash = groupBy(data, (obj: any) => obj.category);\n return Object.keys(groupHash).map((category: string) => ({\n category,\n items: groupHash[category],\n }));\n }\n\n return [];\n};\n\nexport const parsedDataFormatter = (parsedData: any) => {\n const text = parsedData?.text;\n const pageNum = parsedData?.page;\n\n if (text) {\n return (\n \n {text}\n \n );\n }\n return '';\n};\n\nexport const equityPlanColumns = (refetch: any) => [\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'equityPlan.name',\n text: 'Name',\n formatter: equityPlanNameFormatter,\n },\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'equityPlan.shareClass',\n text: 'Share Class',\n formatter: shareClassFormatter,\n },\n {\n dataField: 'equityPlan.numShares',\n text: 'Number of shares',\n formatter: numSharesFormatter,\n headerStyle: { minWidth: 140 },\n },\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'displayDescription',\n text: 'Description',\n headerStyle: { minWidth: 180 },\n },\n {\n ...COLUMN_ATTRIBUTES.ADAPT_ACTION,\n formatter: (_: any, healthCheck: HealthCheck) => (\n \n ),\n },\n];\n\nexport const grantDocumentSetColumns = (refetch: any) => [\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'grantDocumentSet.name',\n text: 'Name',\n formatter: grantDocumentSetFormatter,\n },\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'grantDocumentSet.version',\n text: 'Version',\n },\n {\n dataField: 'grantDocumentSet.uploadedByUser.name',\n text: 'Created by',\n headerStyle: { minWidth: 140 },\n },\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'displayDescription',\n text: 'Description',\n headerStyle: { minWidth: 180 },\n },\n {\n ...COLUMN_ATTRIBUTES.ADAPT_ACTION,\n formatter: (_: any, healthCheck: HealthCheck) => (\n \n ),\n },\n];\n\nexport const shareCertificateColumns = (refetch: any) => [\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'shareCertificate.certificateId',\n text: 'Name',\n formatter: (_: any, healthCheck: HealthCheck) => (\n \n ),\n },\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'shareCertificate.shareClass.name',\n text: 'Share Class',\n formatter: shareCertificateShareClassFormatter,\n },\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'shareCertificate.stakeholder.name',\n text: 'Stakeholder',\n formatter: stakeholderFormatter,\n },\n {\n ...COLUMN_ATTRIBUTES.DATE,\n dataField: 'shareCertificate.issueDate',\n text: 'Issued On',\n },\n {\n ...COLUMN_ATTRIBUTES.ADAPT_ACTION,\n formatter: (_: any, healthCheck: HealthCheck) => (\n \n ),\n },\n];\n\nexport const employeeColumns = (refetch: any) => [\n {\n dataField: 'employee.user.name',\n text: 'Name',\n formatter: employeeNameFormatter,\n sort: true,\n },\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'employee.user.email',\n text: 'Email',\n formatter: emailFormatter,\n },\n {\n ...COLUMN_ATTRIBUTES.STATUS_TAG,\n dataField: 'employee.employeeStatus',\n text: 'Status',\n },\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'displayDescription',\n text: 'Description',\n headerStyle: { minWidth: 180 },\n },\n {\n ...COLUMN_ATTRIBUTES.ADAPT_ACTION,\n formatter: (_: any, healthCheck: HealthCheck) => (\n \n ),\n },\n];\n\nexport const stakeholderColumns = (refetch: any) => [\n {\n dataField: 'name',\n text: 'Name',\n formatter: stakeholderNameFormatter,\n sort: true,\n },\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'stakeholder.employee.user.email',\n text: 'Email',\n formatter: emailFormatter,\n },\n {\n ...COLUMN_ATTRIBUTES.STATUS_TAG,\n dataField: 'stakeholder.employee.employeeStatus',\n text: 'Status',\n },\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'displayDescription',\n text: 'Description',\n headerStyle: { minWidth: 180 },\n },\n {\n ...COLUMN_ATTRIBUTES.ADAPT_ACTION,\n formatter: (_: any, healthCheck: HealthCheck) => (\n \n ),\n },\n];\n\nexport const terminateEmployeeColumns = (refetch: any) => [\n {\n dataField: 'employee.user.name',\n text: 'Name',\n formatter: employeeNameFormatter,\n sort: true,\n },\n {\n ...COLUMN_ATTRIBUTES.TITLE,\n dataField: 'employee.level',\n text: 'Level',\n },\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'employee.startDate',\n text: 'Tenure',\n formatter: (startDate: string) => fromNow(startDate, true),\n },\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'employee',\n text: 'Location',\n formatter: (employee: Employee) => {\n const { parts } = parseLocation({\n city: employee.city,\n stateNameOrCode: employee.stateOfResidence,\n countryCode: employee.country,\n });\n\n if (parts.length === 0) {\n return '—';\n }\n\n return parts.slice(0, -1).join(', ');\n },\n },\n {\n ...COLUMN_ATTRIBUTES.DATE,\n dataField: 'employee.hrisEndDate',\n text: 'Termination date',\n },\n {\n ...COLUMN_ATTRIBUTES.ADAPT_ACTION,\n formatter: (_: any, healthCheck: HealthCheck) => (\n \n ),\n },\n];\n\nexport const optionGrantColumns = (refetch: any) => [\n {\n dataField: 'esopGrant.name',\n text: 'Grant',\n formatter: (_name: string, healthCheck: HealthCheck) => (\n \n ),\n headerStyle: { minWidth: 140 },\n },\n {\n dataField: 'esopGrant.grantType',\n text: 'Type',\n },\n {\n ...COLUMN_ATTRIBUTES.STATUS_TAG,\n dataField: 'esopGrant.groupingGrantStatus',\n text: 'Status',\n },\n {\n ...COLUMN_ATTRIBUTES.DATE,\n dataField: 'esopGrant.grantTerms.grantedAt',\n text: 'Issue Date',\n },\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'displayDescription',\n text: 'Description',\n headerStyle: { minWidth: 180 },\n },\n {\n ...COLUMN_ATTRIBUTES.ADAPT_ACTION,\n formatter: (_: any, healthCheck: HealthCheck) => (\n \n ),\n },\n];\n\nexport const optionExerciseColumns = (refetch: any) => [\n {\n dataField: 'esopExercise.esopGrant.name',\n text: 'Grant',\n formatter: esopExerciseNameFormatter,\n headerStyle: { minWidth: 140 },\n },\n {\n dataField: 'esopExercise.esopGrant.grantType',\n text: 'Type',\n },\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'esopExercise.numExercise',\n text: 'Quantity',\n },\n {\n ...COLUMN_ATTRIBUTES.BETTER_MONEY,\n dataField: 'esopExercise.pricePaid',\n text: 'Exercise Price',\n },\n {\n ...COLUMN_ATTRIBUTES.DATE,\n dataField: 'esopExercise.exerciseAt',\n text: 'Exercise Initiated On',\n },\n {\n ...COLUMN_ATTRIBUTES.DATE,\n dataField: 'esopExercise.resolvedAt',\n text: 'Exercise Approved On',\n },\n {\n ...COLUMN_ATTRIBUTES.ADAPT_ACTION,\n formatter: (_: any, healthCheck: HealthCheck) => (\n \n ),\n },\n];\n\nexport const shareholderColumns = (refetch: any) => [\n {\n dataField: 'shareholder.entityName',\n text: 'Name',\n formatter: employeeNameFormatter,\n sort: true,\n },\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'shareholder.user.email',\n text: 'Email',\n formatter: emailFormatter,\n },\n {\n ...COLUMN_ATTRIBUTES.STATUS_TAG,\n dataField: 'shareholder.status',\n text: 'Status',\n },\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'displayDescription',\n text: 'Description',\n headerStyle: { minWidth: 180 },\n },\n {\n ...COLUMN_ATTRIBUTES.ADAPT_ACTION,\n formatter: (_: any, healthCheck: HealthCheck) => (\n \n ),\n },\n];\n\nexport const shareClassColumns = (refetch: any) => [\n {\n ...COLUMN_ATTRIBUTES.TEXT,\n dataField: 'displayDescription',\n text: 'Description',\n headerStyle: { minWidth: 180 },\n },\n {\n ...COLUMN_ATTRIBUTES.ADAPT_ACTION,\n formatter: (_: any, healthCheck: HealthCheck) => (\n \n ),\n },\n];\n\nexport const getDegreeColor = (degree: string) => {\n if (degree === DEGREE.PRIORITY) {\n return 'dangerFill';\n }\n if (degree === DEGREE.RECOMMENDED) {\n return 'warningFill';\n }\n\n return 'successFill';\n};\n\nexport const healthCheckBreadCrumbs = [\n {\n title: 'Health Checks',\n link: paths.equity.healthChecks.base,\n },\n];\n","import { getOptionsNameMap } from '../../helpers/utils';\n\nexport const COST_CENTERS = [\n 'R&D',\n 'Operations',\n 'Sales & Marketing',\n 'Executives & Officers',\n 'Support',\n 'Other',\n];\n\nexport const EMPLOYEE_TYPE_OPTIONS = [\n {\n value: 'full_time',\n label: 'Full time employee',\n },\n {\n value: 'part_time',\n label: 'Part time employee',\n },\n {\n value: 'contractor',\n label: 'Contractor',\n },\n {\n value: 'advisor',\n label: 'Advisor',\n },\n {\n value: 'other_service_provider',\n label: 'Other service provider',\n },\n {\n value: 'other',\n label: 'Other',\n },\n];\n\nexport const NEW_SERVICE_PROVIDER_RELATIONSHIP_OPTIONS = [\n {\n value: 'full_time',\n label: 'Full time employee',\n },\n {\n value: 'part_time',\n label: 'Part time employee',\n },\n {\n value: 'contractor',\n label: 'Contractor',\n },\n {\n value: 'advisor',\n label: 'Advisor',\n },\n {\n value: 'other',\n label: 'Other',\n },\n];\n\nexport const EMPLOYEE_TYPE_NAME_MAP = getOptionsNameMap(EMPLOYEE_TYPE_OPTIONS);\n","import React, { useState } from 'react';\nimport { Modal } from '@angellist/adapt';\n\nimport { ModalActions } from '../../../../types';\nimport {\n GridColumnType,\n GridRowType,\n} from '../../../../shared/components/grid_editor/types';\nimport GridEditor from '../../../../shared/components/grid_editor';\nimport useGridMaxHeight from '../../../../shared/components/importer/hooks/useGridMaxHeight';\n\ntype Props = {\n title: string;\n initialData: GridRowType[];\n columns: GridColumnType[];\n submitting: boolean;\n isLoading?: boolean;\n onSave: (data: any[]) => void;\n} & Pick;\n\nconst BulkFixHealthCheckModal = (props: Props) => {\n const {\n title,\n initialData,\n columns,\n modal,\n closeModal,\n onSave,\n submitting,\n isLoading,\n } = props;\n const [data, setData] = useState(initialData);\n const gridMaxHeight = useGridMaxHeight(325, 200);\n\n return (\n onSave(data),\n },\n ],\n }}\n onClose={closeModal}\n isOpen={modal}\n width=\"full\"\n >\n \n \n );\n};\n\nexport default BulkFixHealthCheckModal;\n","import { gql } from '@apollo/client';\n\nconst BULK_FIX_EMPLOYEE_HEALTH_CHECKS = gql`\n mutation BulkFixEmployeeHealthChecks(\n $companyId: ID!\n $employeeAttributes: [EmployeeHealthChecksAttributes!]!\n ) {\n bulkFixEmployeeHealthChecks(\n companyId: $companyId\n employeeAttributes: $employeeAttributes\n )\n }\n`;\n\nexport default BULK_FIX_EMPLOYEE_HEALTH_CHECKS;\n","import { gql } from '@apollo/client';\n\nconst HEALTH_CHECK_STATUSES_QUERY = gql`\n query HealthCheckStatuses($companyId: ID!) {\n healthCheckStatuses(companyId: $companyId) {\n id\n title\n degree\n category\n checkType\n checkCount\n }\n }\n`;\n\nexport default HEALTH_CHECK_STATUSES_QUERY;\n","import { useAlert } from 'react-alert';\nimport { useMutation } from '@apollo/client';\n\nimport { showGraphQLError } from '../../../helpers/utils';\nimport BULK_FIX_EMPLOYEE_HEALTH_CHECKS from '../mutations/BulkFixEmployeeHealthChecks';\nimport { useCompanyContext } from '../../../context/CompanyContext';\nimport { EmployeeHealthChecksAttributes } from '../../../../graphql';\nimport HEALTH_CHECK_STATUSES_QUERY from '../queries/HealthCheckStatusesQuery';\n\nconst useFixBulkEmployeeHealthChecks = (afterSave: () => void) => {\n const alert = useAlert();\n const { id: companyId } = useCompanyContext();\n\n const [fixHealthChecks, { loading: mutationLoading, called }] = useMutation(\n BULK_FIX_EMPLOYEE_HEALTH_CHECKS,\n {\n onCompleted() {\n afterSave();\n },\n onError: ({ graphQLErrors }) => {\n showGraphQLError(alert, graphQLErrors);\n },\n refetchQueries: [\n {\n query: HEALTH_CHECK_STATUSES_QUERY,\n variables: { companyId },\n },\n ],\n },\n );\n\n const onSave = async (employeeAttributes: EmployeeHealthChecksAttributes[]) =>\n fixHealthChecks({\n variables: {\n companyId,\n employeeAttributes,\n },\n });\n\n return { submitting: mutationLoading && called, onSave };\n};\n\nexport default useFixBulkEmployeeHealthChecks;\n","import React, { useMemo } from 'react';\nimport { useAlert } from 'react-alert';\n\nimport { HealthCheck } from '../../../../graphql';\nimport { ModalActions } from '../../../../types';\nimport { GridRowType } from '../../../../shared/components/grid_editor/types';\nimport { NEW_SERVICE_PROVIDER_RELATIONSHIP_OPTIONS } from '../../employees/constants';\nimport BulkFixHealthCheckModal from './BulkFixHealthCheckModal';\nimport useFixBulkEmployeeHealthChecks from '../hooks/useFixBulkEmployeeHealthChecks';\n\ntype Props = {\n healthChecks: HealthCheck[];\n refetchHealthChecks: () => void;\n} & Pick;\n\nconst getColumns = () => [\n {\n label: 'Name',\n key: 'name',\n width: 180,\n isResizable: false,\n type: 'nonEditable' as 'nonEditable',\n },\n {\n label: 'Email',\n key: 'email',\n type: 'nonEditable' as 'nonEditable',\n },\n {\n label: 'Service Type',\n key: 'employeeType',\n type: 'dropdown' as 'dropdown',\n items: NEW_SERVICE_PROVIDER_RELATIONSHIP_OPTIONS,\n },\n];\n\nconst BulkFixEmploymentTypeModal = (props: Props) => {\n const { healthChecks, modal, closeModal, refetchHealthChecks } = props;\n\n const initialData = useMemo(\n () =>\n healthChecks.map((healthCheck) => ({\n id: healthCheck.employee?.id,\n name: healthCheck.employee?.user?.name,\n email: healthCheck.employee?.user?.email || '',\n })),\n [],\n );\n const alert = useAlert();\n const { submitting, onSave } = useFixBulkEmployeeHealthChecks(() => {\n closeModal();\n refetchHealthChecks();\n alert.success('Service provider type updated successfully');\n });\n\n const handleOnSave = (data: any) => {\n const attributes: any = [];\n\n data.forEach((row: GridRowType) => {\n if (row.employeeType) {\n attributes.push({\n id: row.id,\n employeeType: row.employeeType,\n });\n }\n });\n if (attributes.length > 0) {\n onSave(attributes);\n } else {\n alert.error('Please select at least one employee to update');\n }\n };\n\n return (\n \n );\n};\n\nexport default BulkFixEmploymentTypeModal;\n","import React from 'react';\n\nimport { HealthCheck } from '../../../../graphql';\nimport { CHECK_TYPES } from '../constant';\nimport AdaptModalButton from '../../common/AdaptModalButton';\nimport BulkFixEmploymentTypeModal from './BulkFixEmploymentTypeModal';\n\ntype Props = {\n checkType: string;\n healthChecks: HealthCheck[];\n refetchHealthChecks: () => void;\n};\n\nconst getButtonProps = (checkType: string) => {\n if (checkType === CHECK_TYPES.EMPLOYMENT_TYPE_MISSING) {\n return {\n label: 'Bulk Resolve',\n modalComponent: BulkFixEmploymentTypeModal,\n };\n }\n\n return {};\n};\n\nconst BulkFixEmployeeHealthCheckButton = (props: Props) => {\n const { checkType, healthChecks, refetchHealthChecks } = props;\n\n if (healthChecks?.length) {\n const { label, modalComponent } = getButtonProps(checkType);\n return (\n \n );\n }\n\n return null;\n};\n\nexport default BulkFixEmployeeHealthCheckButton;\n","import React, { useState } from 'react';\nimport { Modal } from '@angellist/adapt';\n\nimport { ModalActions } from '../../../../../types';\nimport {\n GridColumnType,\n GridRowType,\n} from '../../../../../shared/components/grid_editor/types';\nimport GridEditor from '../../../../../shared/components/grid_editor';\nimport useGridMaxHeight from '../../../../../shared/components/importer/hooks/useGridMaxHeight';\n\ntype Props = {\n title: string;\n initialData: GridRowType[];\n columns: GridColumnType[];\n submitting: boolean;\n isLoading?: boolean;\n onSave: (data: any[]) => void;\n} & Pick;\n\nconst BulkFixGridEditor = (props: Props) => {\n const {\n title,\n initialData,\n columns,\n modal,\n closeModal,\n onSave,\n submitting,\n isLoading,\n } = props;\n const [data, setData] = useState(initialData);\n const gridMaxHeight = useGridMaxHeight(325, 200);\n\n return (\n \n The following grants are not currently exercisable. To enable\n exercises, please provide the service type, exercise document\n template, and valuation details for each grant. These are required\n to process the exercise agreement and calculate the taxable income.\n \n ),\n pinned: false,\n buttons: [\n {\n key: 'submit',\n label: 'Save',\n variant: 'accent' as 'accent',\n isDisabled: submitting,\n isLoading: submitting,\n onPress: () => onSave(data),\n },\n ],\n }}\n onClose={closeModal}\n isOpen={modal}\n fullscreen\n >\n \n \n );\n};\n\nexport default BulkFixGridEditor;\n","export const getLPParticipation = (participation: boolean | string) => {\n if (typeof participation === 'boolean') {\n return participation ? 'yes' : 'no';\n }\n return '';\n};\n\nexport const requiredDataValidator = (value: string, _row: any) => {\n if (value === '' || value === null || value === undefined) {\n return 'Missing data';\n }\n return true;\n};\n","import { gql } from 'graphql-tag';\n\nexport const BULK_ENABLE_ESOP_GRANT_EXERCISE_MUTATION = gql`\n mutation BulkEnableEsopGrantExercise(\n $companyId: ID!\n $bulkEnableEsopGrantExerciseAttributes: [BulkEnableEsopGrantExerciseAttributes!]!\n ) {\n bulkEnableEsopGrantExercise(\n companyId: $companyId\n bulkEnableEsopGrantExerciseAttributes: $bulkEnableEsopGrantExerciseAttributes\n )\n }\n`;\n","import { useAlert } from 'react-alert';\nimport { useMutation } from '@apollo/client';\n\nimport { showGraphQLError } from '../../../helpers/utils';\nimport { useCompanyContext } from '../../../context/CompanyContext';\nimport HEALTH_CHECK_STATUSES_QUERY from '../queries/HealthCheckStatusesQuery';\nimport { BULK_ENABLE_ESOP_GRANT_EXERCISE_MUTATION } from '../mutations/BulkEnableEsopGrantExerciseMutation';\n\nconst useBulkEnableExercise = (afterSave: () => void) => {\n const alert = useAlert();\n const { id: companyId } = useCompanyContext();\n\n const [\n bulkEnableEsopGrantExercise,\n { loading: mutationLoading, called },\n ] = useMutation(BULK_ENABLE_ESOP_GRANT_EXERCISE_MUTATION, {\n onCompleted() {\n afterSave();\n },\n onError: ({ graphQLErrors }) => {\n showGraphQLError(alert, graphQLErrors);\n },\n refetchQueries: [\n {\n query: HEALTH_CHECK_STATUSES_QUERY,\n variables: { companyId },\n },\n ],\n });\n\n const onSave = async (bulkEnableEsopGrantExerciseAttributes: any) =>\n bulkEnableEsopGrantExercise({\n variables: {\n companyId,\n bulkEnableEsopGrantExerciseAttributes,\n },\n });\n\n return { submitting: mutationLoading && called, onSave };\n};\n\nexport default useBulkEnableExercise;\n","import { gql } from '@apollo/client';\n\nconst OUTGOING_STOCK_SPLIT_FRAGMENT = gql`\n fragment OutgoingStockSplitEventFragment on StockSplitEvent {\n id\n effectiveDate\n displayRatio\n workflow {\n id\n ownerId\n }\n instrumentTo {\n ... on Valuation {\n id\n valuePerShare {\n dollars\n fractional\n currency\n betterFormat\n }\n }\n }\n }\n`;\n\nexport default OUTGOING_STOCK_SPLIT_FRAGMENT;\n","import { gql } from '@apollo/client';\nimport OUTGOING_STOCK_SPLIT_FRAGMENT from '../fragments/OutgoingStockSplitEventFragment';\n\nconst ALL_VALUATIONS_QUERY = gql`\n query allValuationsQuery($companyId: ID!) {\n allValuations(companyId: $companyId) {\n id\n name\n valuationDate\n valuerName\n fmvType\n numberOfOutstandingShares\n notes\n status\n shareClass {\n id\n name\n }\n valuePerShare {\n dollars\n fractional\n currency\n betterFormat\n }\n totalValueOfCompany {\n dollars\n fractional\n currency\n betterFormat\n }\n createdAt\n outgoingStockSplitEvents {\n ...OutgoingStockSplitEventFragment\n }\n }\n }\n ${OUTGOING_STOCK_SPLIT_FRAGMENT}\n`;\n\nexport default ALL_VALUATIONS_QUERY;\n","import { useQuery } from '@apollo/client';\n\nimport { useCompanyContext } from '../../../context/Context';\nimport ALL_VALUATIONS_QUERY from '../queries/allValuationsQuery';\nimport { Valuation } from '../../../../graphql';\nimport { cloneList } from '../../../utils';\n\nconst useValuations = (): [boolean, Valuation[]] => {\n const { id: companyId } = useCompanyContext();\n const { loading, error, data } = useQuery(ALL_VALUATIONS_QUERY, {\n variables: { companyId },\n });\n\n if (error) {\n throw error;\n }\n\n const valuations = cloneList(data?.allValuations);\n\n return [loading, valuations];\n};\n\nexport default useValuations;\n","import { useCallback, useMemo } from 'react';\nimport { reverse } from 'lodash';\nimport { EsopGrant, Valuation } from '../../../../graphql';\nimport { formatDate, sortArrayByDate } from '../../../utils/date';\nimport useValuations from '../../valuations/hooks/useValuations';\n\nconst valuationLabel = (valuation: Valuation) => {\n if (!valuation) return '-';\n if (\n valuation.valuePerShare === null ||\n valuation.valuePerShare === undefined\n ) {\n return valuation.name;\n }\n\n return `${valuation.valuePerShare.betterFormat} - ${valuation.name}`;\n};\n\nconst useGrantValuations = (\n grant?: EsopGrant,\n allowNon409aValuations = false,\n) => {\n const [valuationsLoading, valuations] = useValuations();\n\n const filteredValuations = allowNon409aValuations\n ? valuations\n : valuations.filter((v) => v.fmvType === '409A');\n const reverseSortedValuations = reverse(\n sortArrayByDate(filteredValuations, 'valuationDate'),\n );\n const fairMarketValue = grant?.grantTerms?.fairMarketValue;\n\n const valuationOptions = useMemo(() => {\n const customOptions = [];\n if (!grant?.valuation && fairMarketValue) {\n customOptions.push({\n value: 'custom',\n label: fairMarketValue?.betterFormat,\n description: `Custom FMV`,\n });\n }\n const mappedValuations =\n reverseSortedValuations?.map((valuation) => ({\n value: valuation.id,\n label: valuationLabel(valuation),\n description: `Valuation date: ${formatDate(valuation?.valuationDate)}`,\n })) || [];\n return [...customOptions, ...mappedValuations];\n }, [reverseSortedValuations, grant]);\n\n const findClosestValuation = useCallback(\n (grantDate: string) =>\n reverseSortedValuations.find(\n (valuation: Valuation) =>\n new Date(valuation.valuationDate) <= new Date(grantDate),\n ),\n [valuations],\n );\n\n const defaultValuationValue = useMemo(() => {\n if (grant?.valuation?.id) return grant.valuation.id;\n }, [grant?.valuation?.id]);\n\n return {\n valuationOptions,\n findClosestValuation,\n valuationsLoading,\n valuations,\n defaultValuationValue,\n };\n};\n\nexport default useGrantValuations;\n","import { gql } from '@apollo/client';\n\nconst ALL_GRANT_DOCUMENT_SETS_QUERY = gql`\n query AllGrantDocumentSetsQuery($companyId: ID!) {\n allGrantDocumentSets(companyId: $companyId) {\n id\n name\n version\n adminNotes\n status\n grantCount\n documentNames\n securityType\n hasMissingVars\n requiresHtmlConverter\n grantNoticeTemplate {\n id\n name\n requiresCompanySignature\n requiresSpousalConsent\n requiresRecipientSignature\n signaturePageText\n spousalConsentText\n participantReferenceTitle\n customizedLetterDocxMetadata {\n id\n documentName\n documentPath\n createdAt\n }\n exhibitDocumentsMetadata {\n id\n documentName\n documentPath\n createdAt\n }\n skipVestingScheduleGeneration\n adminNotes\n }\n exerciseLetterTemplate {\n id\n name\n requiresCompanySignature\n requiresSpousalConsent\n requiresRecipientSignature\n participantReferenceTitle\n customizedLetterDocxMetadata {\n id\n documentName\n documentPath\n createdAt\n }\n }\n earlyExerciseLetterTemplate {\n id\n name\n requiresCompanySignature\n requiresSpousalConsent\n requiresRecipientSignature\n participantReferenceTitle\n customizedLetterDocxMetadata {\n id\n documentName\n documentPath\n createdAt\n }\n }\n uploadedByUser {\n id\n name\n }\n }\n }\n`;\n\nexport default ALL_GRANT_DOCUMENT_SETS_QUERY;\n","// Library\nimport { useQuery } from '@apollo/client';\nimport { useCompanyContext } from '../../../context/Context';\n\n// Hooks\nimport ALL_GRANT_DOCUMENT_SETS_QUERY from '../queries/AllGrantDocumentSetsQuery';\nimport { cloneList } from '../../../utils';\n\nconst useGrantDocumentSets = () => {\n const { id: companyId } = useCompanyContext();\n const { loading, error, data } = useQuery(ALL_GRANT_DOCUMENT_SETS_QUERY, {\n variables: { companyId },\n });\n\n if (error) {\n return null;\n }\n\n const grantDocumentSets = cloneList(data?.allGrantDocumentSets);\n\n return [loading, grantDocumentSets];\n};\n\nexport default useGrantDocumentSets;\n","import React, { useMemo } from 'react';\n\nimport BulkFixGridEditor from './BulkFixGridEditor';\n\nimport { NEW_SERVICE_PROVIDER_RELATIONSHIP_OPTIONS } from '../../../employees/constants';\n\nimport { requiredDataValidator } from '../../../share_classes/utils';\nimport {\n CURRENCY_PRECISION,\n formatMicroCentsToDollars,\n formatToMicroCents,\n getOptions,\n} from '../../../../helpers/utils';\n\nimport useAdaptToast from '../../../../../shared/hooks/useAdaptToast';\nimport useBulkEnableExercise from '../../hooks/useBulkEnableExercise';\nimport useGrantValuations from '../../../esop_grants/hooks/useGrantValuations';\nimport useGrantDocumentSets from '../../../grant_document_set/hooks/useGrantDocumentSets';\n\nimport { GrantDocumentSet, HealthCheck } from '../../../../../graphql';\nimport { ModalActions } from '../../../../../types';\nimport { GridRowType } from '../../../../../shared/components/grid_editor/types';\n\ntype Props = {\n healthChecks: HealthCheck[];\n refetchHealthChecks: () => void;\n} & Pick;\n\nconst useImportColumns = () => {\n const [documentSetLoading, documentSets] = useGrantDocumentSets();\n const { valuationOptions } = useGrantValuations(null);\n const isLoading = documentSetLoading;\n\n const columns = [\n {\n label: 'Name',\n key: 'name',\n type: 'nonEditable' as 'nonEditable',\n },\n {\n label: 'Stakeholder',\n key: 'stakeholder',\n width: 180,\n isResizable: false,\n type: 'nonEditable' as 'nonEditable',\n },\n {\n label: 'Service Type',\n key: 'employeeType',\n type: 'dropdown' as 'dropdown',\n items: NEW_SERVICE_PROVIDER_RELATIONSHIP_OPTIONS,\n validators: [requiredDataValidator],\n },\n {\n label: 'Exercise Document Template',\n key: 'usedGrantDocumentSetId',\n type: 'dropdown' as 'dropdown',\n width: 180,\n items: getOptions(documentSets),\n validators: [\n requiredDataValidator,\n (usedGrantDocumentSetId: string) => {\n if (usedGrantDocumentSetId) {\n const selectedDocumentSet = documentSets.find(\n (documentSet: GrantDocumentSet) =>\n documentSet.id === usedGrantDocumentSetId,\n );\n\n if (!selectedDocumentSet?.exerciseLetterTemplate) {\n return 'Missing exercise document template';\n }\n }\n return true;\n },\n ],\n },\n {\n label: 'Effective valuation on grant date',\n key: 'valuationId',\n type: 'dropdown' as 'dropdown',\n width: 230,\n items: valuationOptions,\n validators: [\n (valuationId: string, row: any) => {\n if (!valuationId && !row.fairMarketValueCents) {\n return 'Please select the effective valuation on grant date or input a custom FMV';\n }\n return true;\n },\n ],\n },\n {\n label: 'Custom FMV on grant date',\n key: 'fairMarketValueCents',\n type: 'money' as 'money',\n currencyKeyField: 'fairMarketValueCurrency',\n decimalsLimit: CURRENCY_PRECISION.MAX,\n validators: [\n (fairMarketValueCents: string, row: any) => {\n if (!fairMarketValueCents && !row.valuationId) {\n return 'Please select the effective valuation on grant date or input a custom FMV';\n }\n return true;\n },\n ],\n },\n ];\n\n return {\n columns,\n isLoading,\n };\n};\n\nconst BulkEnableExerciseModal = (props: Props) => {\n const { healthChecks, modal, closeModal, refetchHealthChecks } = props;\n\n const { showSuccessToast, showErrorToast } = useAdaptToast();\n const { isLoading, columns } = useImportColumns();\n const { submitting, onSave } = useBulkEnableExercise(() => {\n closeModal();\n refetchHealthChecks();\n showSuccessToast('Option grant exercise enabled successfully');\n });\n\n const initialData = useMemo(\n () =>\n healthChecks?.map((healthCheck) => {\n const {\n id,\n name,\n stakeholder,\n employee,\n grantTerms,\n grantDocumentSet,\n } = healthCheck.esopGrant;\n const { fairMarketValueCents, fairMarketValueCurrency } =\n grantTerms || {};\n\n return {\n grantId: id,\n name,\n stakeholder: stakeholder.name || '',\n employeeType: employee?.employeeType || '',\n usedGrantDocumentSetId: grantDocumentSet?.id || '',\n fairMarketValueCents: formatMicroCentsToDollars(fairMarketValueCents),\n fairMarketValueCurrency,\n valuationId: healthCheck.esopGrant.valuation?.id || '',\n };\n }),\n [healthChecks],\n );\n\n const handleOnSave = (formdata: any) => {\n const attributes: any = [];\n\n formdata.forEach((row: GridRowType) => {\n if (row) {\n attributes.push({\n grantId: row.grantId,\n valuationId: row.valuationId,\n fairMarketValueCents: formatToMicroCents(\n row.fairMarketValueCents as number,\n ),\n fairMarketValueCurrency: row.fairMarketValueCurrency,\n usedGrantDocumentSetId: row.usedGrantDocumentSetId,\n employeeType: row.employeeType,\n });\n }\n });\n if (attributes.length > 0) {\n onSave(attributes);\n } else {\n showErrorToast('Please select at least one grant to enable exercise');\n }\n };\n\n if (isLoading) return null;\n\n return (\n \n );\n};\n\nexport default BulkEnableExerciseModal;\n","import React from 'react';\n\nimport AdaptModalButton from '../../../common/AdaptModalButton';\nimport BulkEnableExerciseModal from './BulkEnableExerciseModal';\n\nimport { HealthCheck } from '../../../../../graphql';\nimport { CHECK_TYPES } from '../../constant';\n\ntype Props = {\n checkType: string;\n healthChecks: HealthCheck[];\n refetchHealthChecks: () => void;\n};\n\nconst getButtonProps = (checkType: string) => {\n if (checkType === CHECK_TYPES.EQUITY_GRANT_NOT_EXERCISE_ELIGIBLE) {\n return {\n label: 'Bulk Enable Exercise',\n modalComponent: BulkEnableExerciseModal,\n };\n }\n\n return {};\n};\n\nconst BulkEnableExerciseCheckButton = (props: Props) => {\n const { checkType, healthChecks, refetchHealthChecks } = props;\n\n if (healthChecks?.length) {\n const { label, modalComponent } = getButtonProps(checkType);\n return (\n \n );\n }\n\n return null;\n};\n\nexport default BulkEnableExerciseCheckButton;\n","import { ObjectType } from '../../../types';\nimport { formatTitle, getOptionsNameMap } from '../../helpers/utils';\nimport {\n employeeColumns,\n equityPlanColumns,\n optionGrantColumns,\n shareholderColumns,\n terminateEmployeeColumns,\n optionExerciseColumns,\n shareClassColumns,\n stakeholderColumns,\n grantDocumentSetColumns,\n shareCertificateColumns,\n} from './utils';\n\nimport paths from '../../paths';\nimport BulkFixEmployeeHealthCheckButton from './components/BulkFixEmployeeHealthCheckButton';\nimport BulkEnableExerciseCheckButton from './components/BulkEnableExerciseCheckButton';\n\nexport const STATUS = {\n ACTIVE: 'active',\n RESOLVED: 'resolved',\n DELETED: 'deleted',\n};\n\nexport const CATEGORIES = {\n VALUATION: 'valuation',\n SHARE_CLASS: 'share_class',\n SECURITIES: 'securities',\n COMMON: 'common',\n EQUITY_PLAN: 'equity_plan',\n STAKEHOLDER: 'stakeholder',\n BANKING: 'banking',\n ESOP_GRANT: 'esop_grant',\n BOARD_CONSENT: 'board_consent',\n ESOP_EXERCISE: 'esop_exercise',\n COMPANY_CONFIGURATION: 'company_configuration',\n SHARE_CERTIFICATE: 'share_certificate',\n};\n\nexport const DEGREE = {\n RECOMMENDED: 'recommended',\n PRIORITY: 'priority',\n HEALTHY: 'healthy',\n};\n\nexport const STATUS_GROUPS = [\n [STATUS.ACTIVE, [STATUS.ACTIVE]],\n [STATUS.RESOLVED, [STATUS.RESOLVED]],\n [STATUS.DELETED, [STATUS.DELETED]],\n];\n\nexport const STATUS_OPTIONS = [\n {\n label: 'Active',\n value: STATUS.ACTIVE,\n },\n {\n label: 'Resolved',\n value: STATUS.RESOLVED,\n },\n {\n label: 'Deleted',\n value: STATUS.DELETED,\n },\n];\n\nexport const STATUS_DISPLAY_NAME: ObjectType = getOptionsNameMap(\n STATUS_OPTIONS,\n);\n\nexport const DEGREE_FILTER_MAP: any = {\n priority: [DEGREE.PRIORITY],\n recommended: [DEGREE.RECOMMENDED],\n};\n\nexport const FILTER_ITEMS = [\n {\n key: 'all',\n value: 'all',\n label: 'All',\n },\n {\n key: DEGREE.PRIORITY,\n value: DEGREE.PRIORITY,\n label: 'Priority',\n },\n {\n key: DEGREE.RECOMMENDED,\n value: DEGREE.RECOMMENDED,\n label: 'Recommended',\n },\n];\n\nexport const STATUS_FILTER_ITEMS = [\n {\n key: 'all',\n value: 'all',\n label: 'All',\n },\n {\n key: DEGREE.PRIORITY,\n value: DEGREE.PRIORITY,\n label: 'Priority',\n },\n {\n key: DEGREE.RECOMMENDED,\n value: DEGREE.RECOMMENDED,\n label: 'Warning',\n },\n {\n key: DEGREE.HEALTHY,\n value: DEGREE.HEALTHY,\n label: 'Healthy',\n },\n];\n\nexport const CHECK_TYPES = {\n // Equity plan\n EQUITY_PLAN_SIZE_OVERDRAWN: 'equity_plan_size_overdrawn',\n EQUITY_PLAN_DOCUMENT_NOT_CONFIGURED: 'equity_plan_document_not_configured',\n EQUITY_PLAN_SIZE_APPROACHING_OVERDRAWN:\n 'equity_plan_size_approaching_overdrawn',\n EQUITY_PLAN_EXERCISE_NOT_ENABLED: 'equity_plan_exercise_not_enabled',\n\n // Valuation\n VALUATION_MISSING_409A: 'valuation_missing_409a',\n VALUATION_APPROACHING_EXPIRY_409A: 'valuation_approaching_expiry_409a',\n VALUATION_EXPIRED_409A: 'valuation_expired_409a',\n\n // COI\n COI_MISSING_SHARE_CLASSES: 'coi_missing_share_classes',\n\n // Employee\n EMPLOYEE_MISSING_ADDRESS: 'employee_missing_address',\n EMPLOYEE_MISSING_EMAIL: 'employee_missing_email',\n EMPLOYEE_SHAREHOLDER_NOT_LINKED: 'employee_shareholder_not_linked',\n HRIS_TERMINATED_EMPLOYEES: 'hris_terminated_employees',\n EMPLOYMENT_TYPE_MISSING: 'missing_employment_type',\n EMPLOYEE_MISSING_GRANT: 'employee_missing_grant',\n\n // Shareholder\n SHAREHOLDER_MISSING_EMAIL: 'shareholder_missing_email',\n\n // Equity Grant\n EQUITY_GRANT_MISSING_VESTING_EVENTS: 'equity_grant_missing_vesting_events',\n EQUITY_GRANT_MISSING_VESTING_SCHEDULE_MISALIGNED:\n 'equity_grant_missing_vesting_schedule_misaligned',\n EQUITY_GRANT_ISO_NSO_MISMATCH: 'equity_grant_iso_nso_mismatch',\n EQUITY_GRANT_GRANTED_OPTION_VESTING_MISALIGNED:\n 'equity_grant_granted_option_vesting_misaligned',\n EQUITY_GRANT_EMPLOYEE_ESIGN_PENDING: 'equity_grant_employee_esign_pending',\n EQUITY_GRANT_COMPANY_ESIGN_PENDING: 'equity_grant_company_esign_pending',\n SECURITY_BOARD_CONSENT_MISSING: 'security_board_consent_missing',\n EQUITY_GRANT_INVALID_CONSENT: 'equity_grant_invalid_consent',\n EQUITY_GRANT_MISSING_EXERCISE_PERIOD: 'equity_grant_missing_exercise_period',\n EQUITY_GRANT_MISSING_EXERCISE_AGREEMENT:\n 'equity_grant_missing_exercise_agreement',\n EQUITY_GRANT_MISSING_GRANT_TERM_END_DATE:\n 'equity_grant_missing_grant_term_end_date',\n EQUITY_GRANT_NOT_EXERCISE_ELIGIBLE: 'equity_grant_not_exercise_eligible',\n EQUITY_GRANT_OVER_EXERCISED: 'equity_grant_over_exercised',\n EQUITY_GRANT_EXCESS_RETURNING_OPTIONS:\n 'equity_grant_excess_returning_options',\n EQUITY_GRANT_VESTING_AFTER_STAKEHOLDER_TERMINATION:\n 'equity_grant_vesting_after_stakeholder_termination',\n\n // ESOP Exercise\n ESOP_EARLY_EXERCISE_MISSING_83B: 'early_exercise_missing_83b',\n COMPLETED_EXERCISE_WITHOUT_SHARE: 'completed_exercise_without_share',\n\n // Company Signatory\n COMPANY_SIGNATORY_MISSING: 'company_signatory_missing',\n\n // Stakeholder\n STAKEHOLDER_MISSING_ADDRESS: 'stakeholder_missing_address',\n\n // Grant Document Set\n GRANT_DOCUMENT_SET_ENABLE_COMPANY_SIGN:\n 'grant_document_set_enable_company_sign',\n\n // Share Certificate\n SHARE_CERTIFICATE_MISSING_VESTING_EVENTS:\n 'share_certificate_missing_vesting_events',\n SHARE_CERTIFICATE_VESTING_AFTER_STAKEHOLDER_TERMINATION:\n 'share_certificate_vesting_after_stakeholder_termination',\n SHARE_CERTIFICATE_VESTING_SUM_EQUALS_NUM_GRANTED:\n 'share_certificate_vesting_sum_equals_num_granted',\n PARTIAL_REPURCHASE_HAS_INCORRECT_SHARES:\n 'partial_repurchase_has_incorrect_shares',\n PARTIAL_REPURCHASE_MISSING_BALANCE_TRANSFER_INSTRUMENT:\n 'partial_repurchase_missing_balance_transfer_instrument',\n SHARE_ISSUED_EARLY_EXERCISE_MISSING_VESTING_EVENTS:\n 'share_issued_early_exercise_missing_vesting_events',\n SHARE_ISSUED_FROM_EXERCISE_INCORRECT_SHARES:\n 'share_issued_from_exercise_incorrect_shares',\n SHARE_IN_DRAFT_STATE_OVER_90_DAYS: 'share_in_draft_state_over_90_days',\n SHARE_VESTING_SUM_NOT_EQUAL_NUM_GRANTED:\n 'share_vesting_sum_not_equal_num_granted',\n};\n\nexport const CATEGORIES_SUFFIX_NAME_MAP: ObjectType = {\n valuation: 'plan',\n share_class: 'share class',\n securities: 'securities',\n common: '',\n banking: '',\n equity_plan: 'plan',\n stakeholder: 'stakeholder',\n esop_grant: 'grant',\n board_consent: 'board consent',\n grant_document_set: 'grant document set',\n};\n\nexport const CATEGORY_OPTIONS = Object.values(CATEGORIES).map(\n (category: string) => ({\n label: formatTitle(category),\n value: category,\n key: category,\n }),\n);\n\nexport const CATEGORY_DISPLAY_NAME: ObjectType = getOptionsNameMap(\n CATEGORY_OPTIONS,\n);\n\nexport const EQUITY_PLAN_CHECK_TYPE_MAP = {\n [CHECK_TYPES.EQUITY_PLAN_SIZE_OVERDRAWN]: {\n title: 'Equity plan overdrawn',\n description:\n 'The following equity plans have exceeded their authorized shares',\n columns: equityPlanColumns,\n },\n [CHECK_TYPES.EQUITY_PLAN_DOCUMENT_NOT_CONFIGURED]: {\n title: 'Equity Plan document not uploaded',\n description:\n 'The following equity plans do not have plan documents associated with them. A properly adopted plan document is an important step in issuing grants.',\n columns: equityPlanColumns,\n },\n [CHECK_TYPES.EQUITY_PLAN_SIZE_APPROACHING_OVERDRAWN]: {\n title: 'Approaching plan size limit',\n description:\n 'The following equity plans are approaching their authorized share limit',\n columns: equityPlanColumns,\n },\n [CHECK_TYPES.EQUITY_PLAN_EXERCISE_NOT_ENABLED]: {\n title: 'Exercise not enabled',\n description: 'The following equity plans do not have exercise enabled',\n columns: equityPlanColumns,\n },\n};\n\nexport const GRANT_DOCUMENT_SET_CHECK_TYPE_MAP = {\n [CHECK_TYPES.GRANT_DOCUMENT_SET_ENABLE_COMPANY_SIGN]: {\n title: 'Enable company signature on exercise template',\n description:\n 'The following grant document sets have the company signature disabled on the exercise template, but the exercise template contains {{company_signature_block}} template variable.',\n columns: grantDocumentSetColumns,\n },\n};\n\nexport const SHARE_CERTIFICATE_CHECK_TYPE_MAP = {\n [CHECK_TYPES.SHARE_CERTIFICATE_MISSING_VESTING_EVENTS]: {\n title: 'Missing vesting events',\n description: 'The following share certificates are missing vesting events',\n columns: shareCertificateColumns,\n },\n [CHECK_TYPES.SHARE_CERTIFICATE_VESTING_AFTER_STAKEHOLDER_TERMINATION]: {\n title: 'Vesting after stakeholder termination',\n description:\n 'The following share certificates are vesting after stakeholder termination',\n columns: shareCertificateColumns,\n },\n [CHECK_TYPES.SHARE_CERTIFICATE_VESTING_SUM_EQUALS_NUM_GRANTED]: {\n title: 'Vesting sum does not equal number of granted shares',\n description:\n 'The following share certificates vesting sum does not equal the number of granted shares',\n columns: shareCertificateColumns,\n },\n [CHECK_TYPES.PARTIAL_REPURCHASE_HAS_INCORRECT_SHARES]: {\n title: 'Repurchased share value',\n description:\n 'The following partial repurchase events may record an incorrect number of repurchased shares',\n columns: shareCertificateColumns,\n },\n [CHECK_TYPES.PARTIAL_REPURCHASE_MISSING_BALANCE_TRANSFER_INSTRUMENT]: {\n title: 'Partial repurchase missing balance transfer instrument',\n description:\n 'The following partial repurchase events are missing a balance transfer instrument',\n columns: shareCertificateColumns,\n },\n [CHECK_TYPES.SHARE_ISSUED_EARLY_EXERCISE_MISSING_VESTING_EVENTS]: {\n title: 'Share issued early exercise missing vesting events',\n description:\n 'The following shares were issued from an early exercise but do not have any associated vesting events',\n columns: shareCertificateColumns,\n },\n [CHECK_TYPES.SHARE_ISSUED_FROM_EXERCISE_INCORRECT_SHARES]: {\n title: 'Share issued from exercise incorrect shares',\n description:\n 'The following shares were issued from an exercise event with an incorrect number of shares',\n columns: shareCertificateColumns,\n },\n [CHECK_TYPES.SHARE_IN_DRAFT_STATE_OVER_90_DAYS]: {\n title: 'Share in draft state for more than 90 days',\n description:\n 'The following shares have been in draft state for more than 90 days',\n columns: shareCertificateColumns,\n },\n [CHECK_TYPES.SHARE_VESTING_SUM_NOT_EQUAL_NUM_GRANTED]: {\n title: 'Vesting sum does not equal number of granted shares',\n description:\n \"The following share certificates' vesting sums do not equal the number of granted shares\",\n columns: shareCertificateColumns,\n },\n};\n\nexport const VALUATION_CHECK_TYPE_MAP = {\n [CHECK_TYPES.VALUATION_MISSING_409A]: {\n title: 'No 409A',\n description:\n 'No 409A valuation has been uploaded. If you are planning to issue options to employees, your company generally needs a 409A valuation.',\n nullState: true,\n buttonLabel: 'Request a new valuation',\n redirectionPath: paths.equity.valuations.all,\n },\n [CHECK_TYPES.VALUATION_APPROACHING_EXPIRY_409A]: {\n title: 'Approaching 409A expiry',\n description:\n 'Your 409A valuation is approaching its expiration date. Request a new 409A valuation by clicking below.',\n nullState: true,\n buttonLabel: 'Request a new valuation',\n redirectionPath: paths.equity.valuations.all,\n },\n [CHECK_TYPES.VALUATION_EXPIRED_409A]: {\n title: 'Expired 409A',\n description:\n 'Your 409A valuation has expired. You can request a new 409A valuation by clicking below.',\n nullState: true,\n buttonLabel: 'Request a new valuation',\n redirectionPath: paths.equity.valuations.all,\n },\n};\n\nexport const EMPLOYEE_CHECK_TYPE_MAP = {\n [CHECK_TYPES.STAKEHOLDER_MISSING_ADDRESS]: {\n title: 'Missing stakeholder address',\n description:\n 'The following stakeholders are missing addresses. Addresses are required to calculate tax withholding.',\n columns: stakeholderColumns,\n },\n [CHECK_TYPES.EMPLOYEE_MISSING_EMAIL]: {\n title: 'Missing employee email address',\n description:\n 'The following employees are missing email addresses. Email addresses are required to issue equity grants.',\n columns: employeeColumns,\n },\n [CHECK_TYPES.EMPLOYEE_SHAREHOLDER_NOT_LINKED]: {\n title: 'Link employee shareholders',\n description:\n 'The following employees are also shareholders and have not had their employee profile linked to their shareholdings. On the employee profile, click \"Actions -> Link Shareholder\" in order to link.',\n columns: employeeColumns,\n },\n [CHECK_TYPES.HRIS_TERMINATED_EMPLOYEES]: {\n title: 'HRIS terminated service providers',\n description:\n 'The following service providers are terminated in your HRIS but not in AngelList. Please review and confirm if they should be terminated in AngelList.',\n columns: terminateEmployeeColumns,\n },\n [CHECK_TYPES.EMPLOYMENT_TYPE_MISSING]: {\n title: 'Missing service provider type',\n description:\n \"Service provider relationship type is required to calculate withholding. Click 'Bulk Resolve' to set the service provider type for all stakeholders.\",\n columns: employeeColumns,\n headerActionComponent: BulkFixEmployeeHealthCheckButton,\n },\n [CHECK_TYPES.EMPLOYEE_MISSING_GRANT]: {\n title: 'Employee missing equity grant',\n description: 'Employee missing equity grant',\n columns: employeeColumns,\n },\n};\n\nexport const SHAREHOLDER_CHECK_TYPE_MAP = {\n [CHECK_TYPES.SHAREHOLDER_MISSING_EMAIL]: {\n title: 'Missing shareholder email address',\n description:\n 'The following shareholders are missing email addresses. Email addresses are required to issue share instruments.',\n columns: shareholderColumns,\n },\n};\n\nexport const ESOP_EXERCISE_CHECK_TYPE_MAP = {\n [CHECK_TYPES.ESOP_EARLY_EXERCISE_MISSING_83B]: {\n title: 'Missing 83(b) election',\n description:\n 'The following equity grants that were early-exercised do not have 83(b) election documents uploaded.',\n columns: optionExerciseColumns,\n },\n [CHECK_TYPES.COMPLETED_EXERCISE_WITHOUT_SHARE]: {\n title: 'Completed exercise lacks associated share security',\n description:\n 'The following equity grants that were exercised do not have a corresponding share security.',\n columns: optionExerciseColumns,\n },\n};\n\nexport const EQUITY_GRANT_CHECK_TYPE_MAP = {\n [CHECK_TYPES.EQUITY_GRANT_MISSING_VESTING_EVENTS]: {\n title: 'Missing vesting events',\n description: 'The following equity grants are missing vesting events',\n columns: optionGrantColumns,\n },\n [CHECK_TYPES.EQUITY_GRANT_MISSING_VESTING_SCHEDULE_MISALIGNED]: {\n title: 'Vesting schedule misaligned',\n description: 'The following vesting schedules contain inconsistencies',\n columns: optionGrantColumns,\n },\n [CHECK_TYPES.EQUITY_GRANT_ISO_NSO_MISMATCH]: {\n title: 'ISO/NSO mismatch',\n description:\n 'The following equity awards are listed as ISOs but exceed the $100,000 annual ISO limit',\n columns: employeeColumns,\n },\n [CHECK_TYPES.EQUITY_GRANT_GRANTED_OPTION_VESTING_MISALIGNED]: {\n title: 'Vesting schedule inconsistencies',\n description: 'The following vesting schedules contain inconsistencies',\n columns: optionGrantColumns,\n },\n [CHECK_TYPES.EQUITY_GRANT_EMPLOYEE_ESIGN_PENDING]: {\n title: 'Pending grantee signature',\n description:\n 'The following equity awards are pending e-signatures by the grantees',\n columns: optionGrantColumns,\n },\n [CHECK_TYPES.EQUITY_GRANT_COMPANY_ESIGN_PENDING]: {\n title: 'Pending company signature',\n description:\n 'The following equity awards are pending e-signature by the company',\n columns: optionGrantColumns,\n },\n [CHECK_TYPES.SECURITY_BOARD_CONSENT_MISSING]: {\n title: 'Missing board approval dates',\n description:\n 'The following securities are missing recorded board approval dates',\n columns: optionGrantColumns,\n },\n [CHECK_TYPES.EQUITY_GRANT_MISSING_EXERCISE_PERIOD]: {\n title: 'Missing post-termination exercise period terms',\n description:\n 'The following equity awards are missing one or more post-termination exercise period terms',\n columns: optionGrantColumns,\n },\n [CHECK_TYPES.EQUITY_GRANT_MISSING_EXERCISE_AGREEMENT]: {\n title: 'Missing exercise agreement template',\n description:\n 'The following options are missing the option exercise template',\n columns: optionGrantColumns,\n },\n [CHECK_TYPES.EQUITY_GRANT_INVALID_CONSENT]: {\n title: 'Missing linked board consent document',\n description:\n 'The following grants are not associated with a linked board consent document',\n columns: optionGrantColumns,\n },\n [CHECK_TYPES.EQUITY_GRANT_MISSING_GRANT_TERM_END_DATE]: {\n title: 'Missing grant term end date',\n description: 'The following grants are missing the grant term end date',\n columns: optionGrantColumns,\n },\n [CHECK_TYPES.EQUITY_GRANT_NOT_EXERCISE_ELIGIBLE]: {\n title: 'Outstanding grant not exercisable',\n description:\n 'The following grants are not currently exercisable on AngelList due to missing data or template configuration issues.',\n columns: optionGrantColumns,\n headerActionComponent: BulkEnableExerciseCheckButton,\n },\n [CHECK_TYPES.EQUITY_GRANT_EXCESS_RETURNING_OPTIONS]: {\n title: 'Excess returning options',\n description:\n 'The following grants have more options returning to the pool than were issued.',\n columns: optionGrantColumns,\n },\n [CHECK_TYPES.EQUITY_GRANT_VESTING_AFTER_STAKEHOLDER_TERMINATION]: {\n title: 'Vesting after stakeholder termination',\n description:\n 'The following grants have vesting events after the stakeholder termination date',\n columns: optionGrantColumns,\n },\n};\n\nexport const COMPANY_CONFIGURATION_CHECK_TYPE_MAP = {\n [CHECK_TYPES.COMPANY_SIGNATORY_MISSING]: {\n title: 'Company signatory missing',\n description: 'No company signatory is set',\n nullState: true,\n buttonLabel: 'Set company signatory',\n redirectionPath: paths.company.signatories,\n },\n [CHECK_TYPES.COI_MISSING_SHARE_CLASSES]: {\n title: 'Share class from COI not found',\n description: 'Share classes that were detected from the COI are missing',\n columns: shareClassColumns,\n },\n};\n\nexport const CHECK_TYPE_MAP: any = {\n ...EQUITY_PLAN_CHECK_TYPE_MAP,\n ...VALUATION_CHECK_TYPE_MAP,\n ...EMPLOYEE_CHECK_TYPE_MAP,\n ...SHAREHOLDER_CHECK_TYPE_MAP,\n ...EQUITY_GRANT_CHECK_TYPE_MAP,\n ...ESOP_EXERCISE_CHECK_TYPE_MAP,\n ...COMPANY_CONFIGURATION_CHECK_TYPE_MAP,\n ...GRANT_DOCUMENT_SET_CHECK_TYPE_MAP,\n ...SHARE_CERTIFICATE_CHECK_TYPE_MAP,\n};\n","import { Box, Heading, Stack, Text } from '@angellist/adapt';\nimport React from 'react';\nimport { HealthCheck } from '../../../../graphql';\nimport { getDegreeColor } from '../utils';\n\ntype Props = {\n healthChecks: HealthCheck[];\n};\n\ntype HealthCheckItemProps = {\n healthCheck: HealthCheck;\n};\n\nconst HealthCheckItem = (props: HealthCheckItemProps) => {\n const { healthCheck } = props;\n const backgroundColor = getDegreeColor(healthCheck.degree);\n\n return (\n \n \n {healthCheck.title}\n \n );\n};\n\nconst HealthCheckTooltipContext = (props: Props) => {\n const { healthChecks } = props;\n if (healthChecks.length > 1) {\n return (\n \n \n Health Checks\n \n \n {healthChecks.map((healthCheck) => (\n \n ))}\n \n \n );\n }\n\n return ;\n};\n\nexport default HealthCheckTooltipContext;\n","import React from 'react';\nimport { Box, TextButton, Tooltip } from '@angellist/adapt';\n\nimport { HealthCheck } from '../../../graphql';\nimport { DEGREE } from './constant';\nimport { getDegreeColor } from './utils';\nimport HealthCheckTooltipContext from './components/HealthCheckTooltip';\n\ntype Props = {\n healthChecks: HealthCheck[];\n};\n\ntype DotProps = {\n degreeColor: any;\n zIndex: any;\n};\n\nconst Dot = (props: DotProps) => {\n const { degreeColor, zIndex } = props;\n return (\n \n \n \n );\n};\n\nconst HealthCheckDot = (props: Props) => {\n const { healthChecks } = props;\n if (healthChecks?.length) {\n const hasPriority = healthChecks.some(\n ({ degree }) => degree === DEGREE.PRIORITY,\n );\n const showDot = hasPriority;\n\n if (showDot) {\n return (\n }\n placement=\"top\"\n >\n \n {hasPriority && (\n \n )}\n \n }\n />\n \n );\n }\n }\n\n return null;\n};\n\nexport default HealthCheckDot;\n","import React from 'react';\nimport { Tag } from '@angellist/adapt';\nimport { formatTitle } from '../../helpers/utils';\nimport { IconLoading } from '@angellist/adapt';\n\nconst TAG_INTENT_STATUSES = {\n draft: [\n 'draft',\n 'no_vested',\n 'not_delivered',\n 'not_submitted',\n 'not_yet_started',\n ],\n new: [],\n neutral: [\n 'closedbycustomer',\n 'invited',\n 'suspectedfraud',\n 'created',\n 'auditor',\n 'clicked',\n 'company_live',\n 'irs_number',\n 'live',\n 'not_seen',\n 'offer_portal_manager',\n 'open',\n 'opened',\n 'physical',\n 'state_filings',\n 'stock_issuance',\n 'tax_id_number',\n 'vesting',\n 'virtual',\n ],\n other: ['clearing', 'viewer', 'expired', 'forfeited'],\n info: [],\n success: [\n 'approved',\n 'editor',\n 'lawyer_approved',\n 'seen',\n 'submitted',\n 'succeeded',\n 'success',\n 'surrendered',\n 'uploaded',\n ],\n warning: [\n 'awaiting_documents',\n 'awaiting_esigns',\n 'awaiting_funds',\n 'awaiting_signature',\n 'awaitingbackimage',\n 'awaitingdocuments',\n 'awaitingfrontimage',\n 'awaitingimages',\n 'needs_co_founder_signatures',\n 'owner',\n 'recommended',\n ],\n danger: [\n 'denied',\n 'inactive',\n 'invalid',\n 'priority',\n 'required',\n 'returned',\n 'stolen',\n ],\n inProgress: ['in_progress', 'in_review', 'inprogress', 'processing'],\n pending: [\n 'pending',\n 'pending_acceptance',\n 'pending_approval',\n 'pending_issuance',\n 'pending_payment',\n 'pending_review',\n 'pendingreview',\n 'requires_company_signature',\n ],\n complete: [\n 'complete',\n 'completed',\n 'delivered',\n 'outstanding',\n 'raising',\n 'externally_executed',\n 'fund_recieved',\n 'funds_received',\n 'sent',\n 'signed',\n 'vested',\n 'active',\n ],\n postComplete: [\n 'closed',\n 'ended',\n 'esop_manager',\n 'executed',\n 'fully_exercised',\n 'repurchased',\n 'partially_exercised',\n ],\n canceled: [\n 'cancelled',\n 'closedbycustomer',\n 'failed',\n 'frozen',\n 'lost',\n 'rejected',\n ],\n};\n\nconst tagStatusMapping = {};\n\nObject.keys(TAG_INTENT_STATUSES).forEach((intent) => {\n TAG_INTENT_STATUSES[intent].forEach((status) => {\n tagStatusMapping[status] = intent;\n });\n});\n\nexport const STATUS_TAG_INTENT_MAPPING = tagStatusMapping;\n\nexport const getStatusTagProps = (status, label, intent) => {\n const tagIntent =\n intent || STATUS_TAG_INTENT_MAPPING[status.toLowerCase()] || 'neutral';\n const tagLabel = label || formatTitle(status);\n\n return {\n intent: tagIntent,\n label: tagLabel,\n };\n};\n\nconst LoadingStatusTag = (props) => {\n const {\n status,\n intent,\n label,\n whiteSpace,\n isLoading,\n tooltipContent,\n ...rest\n } = props;\n if (status || label) {\n const { label: tagLabel, intent: tagIntent } = getStatusTagProps(\n status,\n label,\n intent,\n );\n\n return (\n \n
\n {isLoading && (\n \n )}\n {tagLabel}\n
\n
\n );\n }\n\n return null;\n};\n\nexport default LoadingStatusTag;\n","/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { Link } from 'react-router-dom';\n\nimport { IconEditTiny, Stack, Text, Tag, Divider } from '@angellist/adapt';\nimport LinkSvg from '../../css/icons/Link';\nimport { compactArray, formatDate, formatNumber, formatTitle } from './utils';\nimport StatusTag from '../components/common/StatusTag';\nimport useCountryCodes from '../components/common/hooks/useCountryCodes';\nimport { getStateNameByCode } from './address/states';\nimport { StopPropagationEvent } from '../components/common/hoc';\nimport HealthCheckDot from '../components/health_checks/HealthCheckDot';\nimport LoadingStatusTag from '../components/common/LoadingStatusTag';\n\nconst DefaultWrapper = ({ children, ...rest }) =>
{children}
;\n\nexport const LinkTextColumn = ({\n name,\n Component = DefaultWrapper,\n ...rest\n}) => (\n \n {name}\n \n \n);\n\nexport const LinkColumn = ({ name, to, ...rest }) => (\n \n \n \n);\n\nexport const EmployeeNameColumn = ({ id, name }) => (\n // eslint-disable-next-line jsx-a11y/control-has-associated-label\n \n \n \n);\n\nexport const linkRowFormatter = (linkName, linkPath) => (\n \n \n \n);\n\nexport const emphasisTextFormatter = (name) => {name};\n\nexport const NameColumn = (props) => {\n const { isDraft, name, healthChecks } = props;\n const activeChecks =\n healthChecks?.filter((check) => check.status === 'active') || [];\n return (\n \n {isDraft ? (\n \n \n {name}\n \n \n \n ) : (\n {name}\n )}\n {!!healthChecks?.length && (\n \n \n \n )}\n \n );\n};\n\nexport const dateFormatter = (date, invalidDateText = 'Unknown') => {\n if (!date || date < 15000000) {\n return {invalidDateText};\n }\n return {formatDate(date)};\n};\n\nexport const numberFormatter = (number) => (\n {formatNumber(number)}\n);\n\nexport const boolFormatter = (val) => (val ? 'Yes' : 'No');\n\nexport const statusFormatter = (status, intent = null, label = null) => (\n \n);\n\nexport const pendingStatusFormatter = (\n status,\n intent = null,\n label = null,\n isLoading = false,\n) => (\n \n);\n\nexport const directAndRuvStatusTags = (\n ruvStatus,\n directStatus,\n ruvIntent = null,\n directIntent = null,\n) => (\n \n \n \n Direct\n \n {formatTitle(directStatus)}\n \n \n \n \n RUV\n \n {formatTitle(ruvStatus)}\n \n \n \n);\n\nexport const emailFormatter = (email) => (\n {email}\n);\n\nexport const phoneFormatter = (phone) => {phone};\n\nexport const formatAddress = (address) => {\n if (address) {\n return (\n \n {compactArray(address.street, address.city).join(', ')}\n
\n {compactArray(address.state, address.country, address.postalCode).join(\n ', ',\n )}\n
\n );\n }\n return '—';\n};\n\nexport const formatAddressWithNames = (address, countryCodeMap) => {\n if (address) {\n return formatAddress({\n ...address,\n state: getStateNameByCode(address.country, address.state),\n country: countryCodeMap[address.country] || address.country,\n });\n }\n return '-';\n};\n\nexport const formatAddressWithDisplayNames = (address) => {\n const { countryCodeMap } = useCountryCodes();\n return formatAddressWithNames(address, countryCodeMap);\n};\n"],"names":["EMAIL_REGEX","EXERCISE_PERIOD_REGEX","requiredDataValidator","value","_row","requiredNumberDataValidator","emailValidator","exercisePeriodValidator","Range","rows","columns","a","b","location","_a","_b","_c","_d","_e","_f","_g","_h","range","direction","firstRow","firstColumn","lastRow","lastColumn","slicedRows","slicedColumns","_CellMatrix","ranges","start","end","cols","rowIdx","columnIdx","rowId","columnId","row","column","colIdx","CellMatrix","translateLocationIdxToLookupKey","idx","idy","areLocationsEqual","location1","location2","AbstractPointerEventsController","updateState","event","currentLocation","state","previousLocation","isFirstRowOrColumn","currentTimestamp","secondLastTimestamp","isReadyToHandleEvent","isOnClickableArea","left","isBrowserIE","isBrowserEdge","newLocation","resetSelection","newRange","selectRange","incremental","updateActiveSelectedRange","selectOneColumn","col","unSelectOneColumn","updatedIndexes","updatedIds","id","selectMultipleColumns","firstCol","lastCol","selectOneRow","unSelectOneRow","selectMultipleRows","Behavior","pane","getCompatibleCellAndTemplate","rawCell","cellTemplate","cell","e","tryAppendChange","previousCell","newCell","keyCodes","focusLocation","applyResetSelection","keyCode","onFocusLocationChanged","onFocusLocationChanging","cellLocation","isChangeAllowedByUser","isCellTemplateFocusable","forcedLocation","isLocationAcceptable","validatedFocusLocation","getScrollableParent","element","includeHidden","style","excludeStaticParent","overflowRegex","parent","getTopScrollableElement","getScrollOfScrollableElement","scrollLeft","scrollTop","isMacOs","isIOS","isIpadOS","getSizeOfElement","width","height","getReactGridOffsets","leftReactGrid","topReactGrid","top","leftScrollable","topScrollable","getVisibleSizeOfReactGrid","widthOfScrollableElement","heightOfScrollableElement","scrollBottom","reactGridBottom","visibleTop","visibleBottom","scrollRight","reactGridRight","visibleLeft","visibleRight","visibleOffsetRight","visibleOffsetBottom","getStickyOffset","scroll","offset","getLocationFromClient","clientX","clientY","favorScrollableContent","viewportX","viewportY","cellY","getRow","cellX","getColumn","getStickyTopRow","getStickyBottomRow","getRowOnNonSticky","getLeftStickyColumn","getRightStickyColumn","getColumnOnNonSticky","sticky","getScrollableContentRow","getScrollableContentColumn","cellMatrix","topStickyOffset","maxScrollTop","bottomStickyOffset","leftStickyOffset","maxScrollLeft","rightStickyOffset","scrollableContentY","scrollableContentX","handleContextMenu","clickX","clickY","contextMenuPosition","focusedLocation","CellSelectionBehavior","isSelectionKey","pointedRangeIdx","pointedRange","filteredRanges","_","index","getActiveSelectedRange","emptyCell","wipeSelectedRanges","scrollIntoView","scrollableElement","getVisibleScrollAreaHeight","wholeStickyHeight","getCalculatedScrollTopValueToBottom","visibleScrollAreaHeight","getCalculatedScrollTopValueToTop","isBottomCellAllVisible","isTopCellAllVisible","isFocusLocationOnTopSticky","stickyTopRange","getVisibleScrollAreaWidth","wholeStickyWidth","getCalculatedScrollLeftValueToRight","visibleScrollAreaWidth","getCalculatedScrollLeftValueToLeft","isRightCellAllVisible","isLeftCellAllVisible","isFocusLocationOnLeftSticky","stickyLeftRange","focusCell","withFocusLocation","moveFocusHome","withMoveFocusHome","moveFocusEnd","withMoveFocusEnd","moveFocusLeft","withMoveFocusLeft","moveFocusRight","withMoveFocusRight","moveFocusUp","withMoveFocusUp","moveFocusDown","withMoveFocusDown","moveFocusPage","withMoveFocusPage","moveFocusPageUp","pageUpRowCalc","moveFocusPageDown","pageDownRowCalc","fc","nextFocusableLocation","getNextFocusableLocation","nextLocation","getFocusLocationToLeft","getFocusLocationToRight","wasChangePrevented","getFocusLocationToUp","getFocusLocationToDown","rowCalculator","getVisibleHeight","stickyHeight","hasTopSticky","isOnTopSticky","isOnLastRowOnTopSticky","hasScrollableRange","isOnScrollableRange","isOnLastRowOfScrollableRange","hasBottomSticky","isOnBottomSticky","rowsOnScreen","isOnFirstElementOnScrollableRange","isOnFirstRowOnBottomSticky","ResizeHint","linePosition","jsx","Fragment","ResizeColumnBehavior","c","newWidth","newColWidth","componentDidUpdate","prevProps","prevState","shouldChangeScroll","wasCellEditorOpened","scrollCalculator","getScrollTop","getScrollLeft","dontChange","stickyBottomRange","additionalPixelOnScrollingOnBody","isLocationOnScrollableBody","isFocusLocationOnBottomSticky","stickyRightRange","isFocusLocationOnRightSticky","handleKeyDown","newState","handleKeyDownInternal","asr","resizeSelection","isSingleCellSelected","handleKeyDownOnCellTemplate","moveFocusInsideSelectedRange","cm","resizeSelectionUp","resizeSelectionDown","resizeSelectionLeft","resizeSelectionRight","resizeSelectionPageUp","resizeSelectionPageDown","_i","_j","_k","_l","_m","_n","isMoveRightEnable","_o","_p","_q","selectedRangeIdx","colCount","rowCount","delta","currentPosInRange","newPosInRange","onShiftAndTabKeys","onTabKey","nextSelectionRangeIdx","nextSelection","focusedCellColIdxInRange","focusedCellRowIdxInRange","focusedCellColIdx","focusedCellRowIdx","isLastRowOnTopSticky","isFirstRowOnTopSticky","isOnFirstRowOnTopSticky","isOnLastRowOnScrollableRange","isOnFirstRowOnScrollableRange","isLastRowOnBottomSticky","isFirstRowOnBottomSticky","isOnLastRowOnBottomSticky","firstColIdx","lastColIdx","firstRowIdx","lastRowIdx","scrollDirection","selectedRanges","scrollToRowIdx","scrollToColIdx","ColumnSelectionBehavior","RowSelectionBehavior","PartialArea","className","hasTopBorder","hasBottomBorder","hasRightBorder","hasLeftBorder","isRangeIntersects","range1","range2","FillHandleBehavior","selectedRange","activeSelectedRange","isKeyPressed","getCompatibleCell","fillCellsWithPredictedValues","selectedCells","cellsToFill","numbers","parameters","areParametersNaNs","i","x","selectedCell","fillVertically","fillHorizontally","y","valuesX","valuesY","sumX","sumY","sumXY","sumPowX","n","upValue","downValue","arr","first","second","result","stopCondition","power","pointerLocation","differences","prev","current","fillDirection","values","tryAppendChangeHavingGroupId","ColumnReorderBehavior","leftColumnsWidth","sum","max","dropLocation","drawRight","position","columnIds","isBefore","RowReorderBehavior","indexes","upperRowsHeight","r","shadowPosition","shadowCursor","drawDown","getDataToCopy","removeValues","div","table","createHTMLElements","text","copyElements","setStyles","prevId","tableRow","tableCell","validatedText","clearCell","isBrowserSafari","handleCopy","copyDataCommands","cellInLocation","pasteData","lastLocation","ri","ci","getNavigatorLanguage","getLocaleSeparators","locale","localeFormattedNumber","thousandsSeparator","decimalSeparator","parseLocaleNumber","stringNumber","trimmedNumberString","handlePaste","pastedRows","htmlData","document","tableRows","rawData","data","line","t","DefaultBehavior","target","handleDoubleClick","handleKeyUp","handleCompositionEnd","getCellProperty","uncertainCell","propName","expectedType","prop","CheckboxCellTemplate","checked","ctrl","shift","alt","cellToMerge","isInEditMode","onCellChanged","isAlphaNumericKey","isNumpadNumericKey","isCharAlphaNumeric","char","inNumericKey","isAllowedOnNumberTypingKey","isCharAllowedOnNumberInput","isNavigationKey","isFunctionKey","getTimestamp","time","defaultDate","getDefaultDate","textDate","getFormattedTimeUnit","timeUnit","getCharFromKey","key","isShiftKey","isCapsLock","language","DateCellTemplate$1","date","dateFormat","capsLock","year","month","day","input","v","EmailCellTemplate","eventData","textToDisplay","ChevronCellTemplate","isExpanded","indent","hasChildren","enableEditMode","cellCopy","jsxs","HeaderCellTemplate$1","NumberCellTemplate$1","cellText","numberFormat","displayValue","isValid","format","TextCellTemplate$1","placeholder","_TimeCellTemplate","timeFormat","timestamp","hours","minutes","TimeCellTemplate","DropdownCellTemplate$1","selectedValue","isDisabled","inputValue","isOpen","selectedValueFromText","val","DropdownInput","selectRef","React.useRef","setInputValue","React.useState","React.useMemo","React.useEffect","Select","CustomOption","CustomMenu","provided","innerProps","label","isSelected","isFocused","children","defaultCellTemplates","TextCellTemplate","NumberCellTemplate","HeaderCellTemplate","DateCellTemplate","DropdownCellTemplate","defaultStateFields","CellMatrixBuilder","props","edges","leftStickyColumns","topStickyRows","rightStickyColumns","bottomStickyRows","rangesToExclude","rowspan","colspan","keys","topRowsSticky","bottomRowsSticky","leftColumnsSticky","rightColumnsSticky","stickyBottomRows","stickyTopRows","stickyColumnsLeft","stickyColumnsRight","stickyRightColumns","stickyLeftColumns","VS_PAGE_HEIGHT","VS_PAGE_WIDTH","ADDITONAL_INDEX","recalcVisibleRange","visibleRange","getVisibleScrollableSize","visibleColumns","getVisibleColumns","visibleRows","getVisibleRows","heights","widths","scrollableWidth","firstIndex","colBinarySearch","lastIndex","scrollableHeight","rowBinarySearch","mid","DEFAULT_BREAKPOINT","updateResponsiveSticky","horizontalStickyBreakpoint","verticalStickyBreakpoint","predictedLeftRangeWidth","acc","predictedRightRangeWidth","shouldDisableStickyHorizontally","predictedTopRangeHeight","predictedBottomRangeHeight","shouldDisableStickyVertically","EventHandlers","pointerEventsController","reactGridElement","hiddenFocusElement","parsedData","visibleRangeCalculator","error","PAGE_UPDATE_OFFSET","calculatedXAxisOffset","getRightStickyOffset","getStickyLeftRangeWidth","getLeftStickyOffset","getBottomStickyOffset","calculatedYAxisOffset","getStickyTopRangeWidth","getTopStickyOffset","calculateCellEditorPosition","positionState","offsetLeft","offsetTop","StateContext","createContext","StateProvider","useReactGridState","React","CellEditorRenderer","currentlyEditedCell","renders","dispatch","React.useReducer","CellEditor","commit","s","cellType","HiddenElement","hiddenElementRefHandler","ErrorBoundary","Component","errorInfo","hasError","isBrowserFirefox","GridRenderer","eventHandlers","sharedStyles","defultTranslations","i18n","LegacyBrowserGridRenderer","noBorder","border","rest","isMobileDevice","ResizeHandle","unset","storeBorderAndCell","borders","property","defaultProp","borderEdge","getBorderProperties","getPropertyOnBorderFn","CellRenderer","update","customClass","currentlyEditedCellRef","storePropertyAndDefaultValue","bordersWidth","bordersStyle","bordersColor","bordersProps","isMobile","isFirstRowOrColumnWithSelection","groupIdClassName","nonEditableClassName","classNames","cellToRender","React.useCallback","CellHighlight","borderColor","FeaturedCell","CellFocus","shouldMemoRowRenderer","nextProps","prevCols","nextCols","forceUpdate","MappedColumns","cellRenderer","RowRenderer","React.memo","FillHandleRangeSelection","calculatedRange","FillHandle","targetRef","useRef","dimensions","setDimensions","useState","useLayoutEffect","FillHandleRenderer","SelectedRanges","shouldMemoPaneGridContent","nextState","PaneGridContent","renderHighlights","highlight","Pane","renderChildren","PaneContentWrapper","PaneContent","shouldRenderTopSticky","shouldRenderLeftSticky","shouldRenderCenterRange","shouldRenderMiddleRange","shouldRenderBottomSticky","shouldRenderRightSticky","PanesRenderer","renderTopSticky","renderMiddleRange","renderLeftSticky","renderCenterRange","renderBottomSticky","renderRightSticky","visibleScrollableRange","marginTop","marginLeft","marginRight","marginBottom","marginTopOnScrollable","marginLeftOnScrollable","marginBottomOnScrollable","marginRightOnScrollable","columnsSlicer","PaneShadow","rowsSlicer","renderCondition","zIndex","updateSelectedRows","updatedRows","groupedRows","activeSelectedRangeIdx","updateSelectedColumns","updatedColumns","groupedColumns","array","grouped","sortIndex","getDerivedStateFromProps","stateDeriverWithProps","stateDeriver","highlightsHasChanged","appendHighlights","updateStateProps","appendCellTemplates","appendGroupIdRender","hasChanged","dataHasChanged","disableVirtualScrolling","updateCellMatrix","updateSelections","updateFocusedLocation","updateVisibleRange","setInitialFocusLocation","areFocusesDiff","setFocusLocation","appendStateFields","fn","builder","highlights","locationToFocus","wasFocused","isLocationToFocusCorrect","handleCompositionEndOnCellTemplate","rangeSlicer","rangeToSlice","handleStateUpdate","setState","changes","right","rightPaneWidth","PointerEventsController","onClickableAreaOnPro","autoScrollDirection","stickyLocation","Line","lineOrientation","isVertical","lineStyles","Shadow","shadowSize","copySelectedRangeToClipboard","getSelectedLocations","getCellsFromClipboardPlainText","textValue","getDocumentFromHTMLClipboardItem","HTMLItem","HTMLString","getCellsFromDocumentBody","documentBody","getRowsFromClipboard","item","ContextMenu","contextMenuElRef","selectedIds","selectionMode","clickPositionX","clickPositionY","screenWidth","screenHeight","menuWidth","menuHeight","SAFETY_OFFSET","contextMenuOptions","customContextMenuOptions","options","menuOptions","handler","copyLabel","cutLabel","pasteLabel","handleContextMenuCopy","handleContextMenuPaste","isAppleMobileDevice","appleMobileDeviceContextMenuPasteAlert","otherBrowsersContextMenuPasteAlert","actionNotSupported","ReactGrid","React.Component","modifier","HEADER_HEIGHT","ROW_HEIGHT","MAX_ALLOWED_DECIMALS","ROW_STATES","FILTER_ITEMS","DEFAULT_FILTER_VALUES","MULTI_SELECT_SEPARATOR","getPastedDate","isInvalidDate","sanitizeValue","getDropdownSelectedOption","items","lowerCellValue","getMultiSelectSelectedOptions","getDropdownText","getMultiSelectText","ids","getDateText","formatDateInMDY","getNumberText","formatNumberWithPrecision","getMoneyText","currencySign","getCurrencySign","formatValue","getValidCellProps","rowOptions","isDirtyRow","errorMessage","validateColumn","getRowNumberCell","getRowActionCell","getRowActionMenuItems","rowIndex","getDropdownCell","validateProps","activeSelectData","isActive","getMultiSelectCell","getDateCell","year1","month1","day1","getCheckboxCell","getNumberCell","getMoneyCell","currency","getDefaultCell","getCells","getEmptyCellValue","formatRowValues","extractedRow","filterNonEmptyValues","isRowEmpty","isGridRowTouched","getHeaderRow","getGridColumns","validators","validator","getFilteredRow","gridFilters","cells","showRow","filterText","hasInvalidCell","isCleanState","isIssuesState","searchText","getFilteredRows","rowConfig","filteredRows","filteredRow","getDefaultEmptyRow","getChangedRows","usePreviousCell","activeDropdown","newRows","change","type","newRow","cellToUse","formatServerDate","cellValue","isUnsavedRowsPresent","validateAndFormatRows","invalidRows","formattedRows","inValidColumns","formattedRow","useGridColumnsMetaData","containerRef","gridColumns","setGridColumns","updateWidth","containerWidth","totalFixedWidth","totalInitialResizableWidth","colWidth","totalResizableWidth","newColumns","prevColumns","columnIndex","el","updatedColumn","EditModeCellWrap","isInvalidCell","cellId","errorClass","tooltipClass","elementId","Box","UncontrolledTooltip","isMultiSelect","defaultValue","createElement","selectedOption","GridDropdownCellTemplate","_isInEditMode","isMissingData","MultiSelectCellTemplate","selectedOptions","GridTextCellTemplate","GridNumberCellTemplate","NumberFormat","isPasteKey","isSelectAllKey","GridDateCellTemplate","GridHeaderCellTemplate","Stack","Text","Tooltip","NonEditableCellTemplate","MoneyInputCellTemplate","currencyKeyField","decimalsLimit","CurrencyInput","newValue","RowActionCellTemplate","actionMenuItems","handleMenuAction","menuItem","Menu","Button","useRowActionsMenu","setData","prevData","_item","DataEditor","hideContextMenu","enableFillHandle","enableRangeSelection","autoAppendRows","appendRowsCount","showRowNumbers","showRowActions","maxHeight","minHeight","isLoading","noDataProps","setIsDirty","gridRef","setActiveSelectData","cellChangesIndex","setCellChangesIndex","cellChanges","setCellChanges","getActionMenuItems","useRowActionsMenuItems","showActionColumn","tableColumns","useMemo","allColumns","onColumnResize","useEffect","applyChangesToData","changedRows","defaultEmptyRow","handleChanges","onContextMenu","_selectedRowIds","_selectedColIds","_selectionMode","_selectedRanges","handleUndoChanges","handleRedoChanges","NullState","GridEditorFilters","onFilterChange","defaultSelection","filtersOptions","processAppliedValues","filteredState","search","handleOnChange","Filters","TopActionBar","onAddRowsClick","addRowsCount","canAddRows","buttons","getGridHeight","ht","showTopActionBar","gridHeight","GridEditor","initialEmptyRowCount","topActionButtons","dataEditorProps","setGridFilters","handleOnFilterChange","emptyRowCount","initialRowData","handleAddRowClick","numberRows","defaultEmptyRows","gridMaxHeight","gridMinHeight","useGridMaxHeight","gutterSpace","setMaxHeight","handleResize","maxHt","GraphqlErrors","graphQLErrors","BRANDING","useAdaptToast","addToast","useToast","title","SvgLink","UnitsColumn","denominator","denominatorText","numerator","numeratorText","suffixText","hideProgress","percentage","formatNumber","Progress","UPDATE_HEALTH_CHECK","gql","useUpdateHealthCheck","alert","useAlert","updateHealthCheck","mutationLoading","mutationError","called","useMutation","showGraphQLError","status","HealthCheckRowActions","healthCheck","refetch","fixPath","placement","hideFixPath","submitting","onUpdate","history","useHistory","securityDraftsEnabled","useCompanyContext","handleDeleteClick","handleResolveClick","onSelection","healthCheckFixPath","COUNTRY_NAMES_BY_CODE","COUNTRY_OPTIONS","parseLocation","city","stateNameOrCode","countryCode","stateNamesByCode","STATES","base","STATUS","STATUS_SORT_ORDER","STATUS_GROUPS","STATUS_GROUP_MAP","stautsGroup","CERTIFICATE_TYPES","SHARE_TYPE_OPTIONS","OUTSTANDING_STATUS","OUTSTANDING_STATUS_OPTIONS","STATUS_OPTIONS","AllShareCertificateDraftsBreadcrumbs","paths","ShareCertificateBreadcrumbs","ShareCertificateSecurityBreadcrumbs","EXERCISE_STATUS_MAP","AMENDMENT_STATUS","AMENDMENT_STATUS_MAP","TRANSACTION_TYPES","TRANSACTION_TYPE_OPTIONS","TRANSACTION_TYPE_NAME_MAP","getOptionsNameMap","getTransactionTypeValue","transactionType","transactionsBreadcrumbs","ESOP_GRANT_FRAGMENT","GRANT_SURRENDER_QUERY","useGrantSurrender","loading","useQuery","grantSurrender","cloneObject","SvgShow","ALL_EQUITY_TRANSACTIONS_QUERY","UPDATE_ESOP_EXERCISE_MUTATION","SHARE_CERTIFICATE_SUMMARY_FRAGMENT","ALL_CERTIFICATES_QUERY","useUpdateEsopExercise","addNewShareCertificate","afterUpdate","companyId","refetchQueries","updateExercise","formData","pricePaid","shareCertificateName","pricePerShare","restFormData","esopExerciseAttributes","SHARE_CERTICATE_OPTIONS_QUERY","useCertificatesOptionsList","shareCertificateId","defaultData","allCertificates","shareCertificateOptions","shareCert","EXERCISE_STATS_QUERY","useExerciseStats","esopGrantId","asOf","stats","ExerciseForm","esopGrant","esopExercise","setAddNewShareCertificate","errors","control","watch","useFormContext","defaultCurrency","optionLoading","watchExerciseAt","watchIsEarlyExercise","defaultCurrencyValue","getObjectValue","grantedAt","statsLoading","exerciseStats","maxAllowedNumExercise","maxRule","ErrorAlert","DateInput","getDate","processError","Row","NumberInput","DECIMAL_LIMIT","AdaptMoneyInput","Heading","Callout","Input","TextButton","Textarea","FileUpload","EditExerciseModal","refetchExercises","modal","closeModal","formProps","useForm","Modal","FormProvider","Form","ExerciseRowActions","editActions","useModal","ActionMenu","ActionButton","Link","ShowIcon","EditSvg","STATUS_FILTER_MAP","ISSUED_STATUS_OPTIONS","option","NON_EXERCISABLE_STATUSES","GRANT_TYPES","ESOP_GRANT_SUB_TYPES","ALL_ESOP_GRANT_TYPES","getAllGrantTypeOptions","showOldRsus","showOtherGrantType","compact","DELETE_GRANT_FAQ","getNewGrantTypeOptions","hideRSA","quantityFormatter","num","formatGrantType","grantType","isIsoNso","getDurationValue","duration","interval","intervalText","getExercisePeriodOptions","exercisePeriod","shouldRegenerateGrant","numOptions","exercisePrice","expiryDate","name","stakeholderId","vestingStartBackdate","vestingTemplateId","allowEarlyExercise","accelerationTemplateId","acceleratedVestingDescription","usedGrantDocumentSetId","regenFields","TRANSACTION_COLUMNS","refetchGrant","COLUMN_ATTRIBUTES","equityTransaction","IdFormatter","granttransactionStatusFormatter","transaction","formatExercisePeriodAttaributes","exercisePeriodAttributes","attrs","periodKey","period","formatToNumber","formatUpdateArgs","fairMarketValue","valuationId","restGrantDetailAttributes","fmvAttributes","getEsopGrantPath","tab","INTERVAL_MAP","extractExercisePeriodValue","match","processBulkUpsertGrants","grants","grant","voluntaryTermination","involuntaryTermination","terminationForCause","death","disability","retirement","restAttributes","hasRequiredExerciseInfo","grantTerms","exerciseLetterTemplateDocument","requiresHtmlConverter","hasExerciseLetterHtmlTemplate","hasExerciseTemplate","isMissingFairMarketValue","isMissingExerciseAgreement","isMissingEmployeeType","getGrantSurrenderDetails","push","employeeName","getEmployeeName","grantName","formatTitle","formatMoneyObject","formatDate","getBuybackDetails","buybackEligibility","paymentMode","priceOfferedPerShare","maxBuybackShares","maxBuybackPercentOfVested","buyback","handleBuyBackNameClick","betterMoneyObjectFormat","SurrenderDetailPane","onClose","buyBackItems","SlidingPane","LazyText","StatusTag","AdaptRowList","REPURCHASE_EVENT_QUERY","useRepurchaseEvent","repurchaseEvent","AdaptDeleteDialog","onDelete","onCancel","headerText","confirmText","isDeleting","deleteError","actionButtonLabel","actionButtonVariant","Dialog","DELETE_ATTACHMENT_MUTATION","useDeleteAttachment","afterRemove","removeAttachment","FileView","openModal","documentName","createdAt","canDownload","canRemove","documentPath","deleteConfirmTitle","deleteConfirmText","onRowClick","description","rowClickAllowedFileTypes","previewProps","names","fileType","canRowClick","handleRowClick","deleting","AdaptFilePreview","AttachmentList","documents","emptyDocumentText","AttachmentListLoader","numLoadingRows","boxProps","Icon","RowLoader","UploadModal","onUpload","uploadError","isUploading","isRequired","multiple","restProps","handleSubmit","uploadState","UPLOAD_FILE_MUTATION","useUploadFiles","afterComplete","uploadFile","FileUploadModal","modalActions","ownerObjectType","ownerObjectId","ownerObjectField","afterUpload","buttonText","buttonType","buttonProps","uploadFiles","AdaptModalButton","DocumentsCard","canUpload","suffixHeaderActions","restModalProps","Header","getShareRepurchaseDetails","getShareCertificatePath","ShareRepurchaseDetailPane","CONVERTIBLE_TYPES","CONVERTIBLE_GQL_SQL_TYPE_MAP","CONVERTIBLE_TYPES_LIST","CONVERTIBLE_DEBT_CONVERTIBLE_TYPE_NAME_MAP","CONVERTIBLE_TYPE_OPTIONS","CONVERTIBLE_TYPE_NAME_MAP","CAPITAL_CONTRIBUTION_FIELD_FOR_SECURITY","aiHealthChecks","convertible","hc","getConvertibleName","nameFormatter","convertibleName","healthChecks","curr","NameColumn","issueDate","issueDateFormatter","emptyString","capitalContribution","field","capitalContributionFormatter","capitalContributionSortSearchFormat","cc","capitalContributionCsvFormat","convertibleType","convertibleTypeFormatter","getSafePath","convertibleSafe","getDebtPath","convertibleDebt","getWarrantPath","warrant","getTokenWarrantPath","tokenWarrant","getSaftPath","saft","getConvertibleLink","__typename","convertibleBreadcrumbs","isDraft","getIssuanceSigners","grantIssuance","grantIssuanceSigners","companyGrantIssuanceSigner","role","employeeGrantIssuanceSigner","spouseGrantIssuanceSigner","getIssuanceSignersFlags","isCompanySigned","employeeSigned","spouseSigned","pendingSpouseEsign","isEsopGrant","isRsaGrant","grantTypeFormatter","canAllowEditGrant","canAllowModifyGrant","getStakeholderName","employee","getOptionHolderValue","unitsColumnFormatter","unitsVested","totalUnits","filterCompanySignedRows","sharesColumnFormatter","shareCertificate","unitsCsvFormatter","unitsSearchValue","getSelectedGrantRows","getUpdatedRows","selectedRows","difference","notEligibleForIso","grantHolderDetail","esopGrantBreadcrumbs","breadCrumbLabel","rsuGrant","rsuGrantBreadcrumbs","getRsuGrantPath","COLUMN_TYPES","CELL_PROPS","formatDateTime","moneyObj","_rowIndex","number","issuanceMethod","issuanceMethodFormatter","shareTypeFormatter","cert","shareCertificateTypeFormatter","completionStatusFormatter","getColumns","onUpdateShareCertificate","onUpdateRsaGrant","onMenuActionClick","shareClassOptions","equityPlanOptions","certificateId","newVal","entityName","email","share","numShares","shareClassName","vt","equityPlanName","isGrantTypeName","security","getSecurityName","securityType","getMissingFieldsForPublish","getInvalidFieldsForPublish","getMissingFieldsMetadata","missingFields","invalidFields","backendType","sortByCreatedAt","useCalculatedSecurities","securities","allSecurities","validSecurities","missinInfoSecurities","getSecurityPath","SecurityNameFormatter","LinkColumn","NameFormatter","instrumentId","instrumentType","instrumentName","path","LinkTextColumn","SurrenderDateCell","detailPane","useAdaptPane","ShareRepurchaseDateCell","transactionDate","stakeholderFormatter","stakeholder","stakeholderValue","transactionStatusFormatter","statusLabel","transactionTypeFormatter","BOARD_APPROVAL_STATUS_OPTIONS","HELP_URLS","INDUSTRY_OPTIONS","STOCK_ISSUANCE_TYPES","ISSUANCE_METHODS","CERTIFICATE_TYPE_OPTIONS","shareCertificateBreadcrumbs","isDraftShareCertificate","isDraftCert","certificateIdFormatter","draftCheckFn","isADraft","pendingIssuanceItemsCSVFormatter","pendingIssuanceItemsFormatter","getInviteStatus","securityInvite","issuanceMethods","rsaStatusFormatter","intent","formattedState","STATUS_TAG_INTENT_MAPPING","outstandingStatusFormatter","outstandingStatus","statusFormatter","outstandingCsvStatusFormatter","inviteStatusFormatter","rsaGrant","isVestingCertificate","formatContributionAttributes","contributionAttributes","hasCapitalContribution","hasValueOfDebtCancelled","hasValueOfIpContribution","hasValueOfOtherConsideration","hasConversionAmount","formatVestingAttributes","formatShareAttributes","restCertificateDetailAttributes","isCertificateTransferred","shareClassFormatter","equityPlanNameFormatter","grantDocumentSetFormatter","numSharesFormatter","numSharesAvailable","employeeNameFormatter","stakeholderNameFormatter","_name","ShareCertificateLinkNameFormatter","shareCertificateShareClassFormatter","emailFormatter","isDeletedEmail","EsopGrantNameFormatter","esopExerciseNameFormatter","aiHealthCheckFixPath","aiParseResult","ownerId","ownerType","category","checkType","CHECK_TYPES","processStatusesData","groupHash","groupBy","obj","equityPlanColumns","grantDocumentSetColumns","shareCertificateColumns","employeeColumns","stakeholderColumns","terminateEmployeeColumns","startDate","fromNow","parts","optionGrantColumns","optionExerciseColumns","shareholderColumns","shareClassColumns","getDegreeColor","degree","DEGREE","healthCheckBreadCrumbs","COST_CENTERS","EMPLOYEE_TYPE_OPTIONS","NEW_SERVICE_PROVIDER_RELATIONSHIP_OPTIONS","BulkFixHealthCheckModal","initialData","onSave","BULK_FIX_EMPLOYEE_HEALTH_CHECKS","HEALTH_CHECK_STATUSES_QUERY","useFixBulkEmployeeHealthChecks","afterSave","fixHealthChecks","employeeAttributes","BulkFixEmploymentTypeModal","refetchHealthChecks","handleOnSave","attributes","getButtonProps","BulkFixEmployeeHealthCheckButton","modalComponent","BulkFixGridEditor","getLPParticipation","participation","BULK_ENABLE_ESOP_GRANT_EXERCISE_MUTATION","useBulkEnableExercise","bulkEnableEsopGrantExercise","bulkEnableEsopGrantExerciseAttributes","OUTGOING_STOCK_SPLIT_FRAGMENT","ALL_VALUATIONS_QUERY","useValuations","valuations","cloneList","valuationLabel","valuation","useGrantValuations","allowNon409aValuations","valuationsLoading","filteredValuations","reverseSortedValuations","reverse","sortArrayByDate","valuationOptions","customOptions","mappedValuations","findClosestValuation","useCallback","grantDate","defaultValuationValue","ALL_GRANT_DOCUMENT_SETS_QUERY","useGrantDocumentSets","grantDocumentSets","useImportColumns","documentSetLoading","documentSets","getOptions","selectedDocumentSet","documentSet","CURRENCY_PRECISION","fairMarketValueCents","BulkEnableExerciseModal","showSuccessToast","showErrorToast","grantDocumentSet","fairMarketValueCurrency","formatMicroCentsToDollars","formdata","formatToMicroCents","BulkEnableExerciseCheckButton","CATEGORIES","STATUS_DISPLAY_NAME","DEGREE_FILTER_MAP","STATUS_FILTER_ITEMS","CATEGORIES_SUFFIX_NAME_MAP","CATEGORY_OPTIONS","EQUITY_PLAN_CHECK_TYPE_MAP","GRANT_DOCUMENT_SET_CHECK_TYPE_MAP","SHARE_CERTIFICATE_CHECK_TYPE_MAP","VALUATION_CHECK_TYPE_MAP","EMPLOYEE_CHECK_TYPE_MAP","SHAREHOLDER_CHECK_TYPE_MAP","ESOP_EXERCISE_CHECK_TYPE_MAP","EQUITY_GRANT_CHECK_TYPE_MAP","COMPANY_CONFIGURATION_CHECK_TYPE_MAP","CHECK_TYPE_MAP","HealthCheckItem","backgroundColor","HealthCheckTooltipContext","Dot","degreeColor","HealthCheckDot","hasPriority","TAG_INTENT_STATUSES","tagStatusMapping","getStatusTagProps","tagIntent","tagLabel","LoadingStatusTag","whiteSpace","tooltipContent","Tag","IconLoading","DefaultWrapper","LinkSvg","to","EmployeeNameColumn","emphasisTextFormatter","activeChecks","check","IconEditTiny","StopPropagationEvent","dateFormatter","invalidDateText","boolFormatter","pendingStatusFormatter","directAndRuvStatusTags","ruvStatus","directStatus","ruvIntent","directIntent","Divider","phoneFormatter","phone","formatAddress","address","compactArray","formatAddressWithNames","countryCodeMap","getStateNameByCode","formatAddressWithDisplayNames","useCountryCodes"],"mappings":"oxDAAO,MAAMA,GAAc,6CACdC,GAAwB,iFAExBC,GAAwB,CAACC,EAAeC,IAC9CD,EAGE,GAFE,eAKEE,GAA8B,CAACF,EAAeC,IACrD,CAACD,GAASA,IAAU,EACf,eAEF,GAGIG,GAAiB,CAACH,EAAeC,IACxCD,GAASH,GAAY,KAAKG,CAAK,IAAM,GAChC,uBAEF,GAGII,GAA0B,CAACJ,EAAeC,IACjDD,GAASF,GAAsB,KAAKE,CAAK,IAAM,GAC1C;AAAA,0FAEF,GCxBF,MAAMK,EAAM,CAMf,YAA4BC,EAAiCC,EAAuB,CAAxD,KAAA,KAAAD,EAAiC,KAAA,QAAAC,EACpD,KAAA,MAAQ,CAAE,IAAK,KAAK,KAAK,CAAC,EAAG,OAAQ,KAAK,QAAQ,CAAC,CAAE,EAC1D,KAAK,KAAO,CAAE,IAAK,KAAK,KAAK,KAAK,KAAK,OAAS,CAAC,EAAG,OAAQ,KAAK,QAAQ,KAAK,QAAQ,OAAS,CAAC,GAC3F,KAAA,OAAS,KAAK,KAAK,OAAO,CAACC,EAAGC,IAAMD,EAAIC,EAAE,OAAQ,CAAC,EACnD,KAAA,MAAQ,KAAK,QAAQ,OAAO,CAACD,EAAGC,IAAMD,EAAIC,EAAE,MAAO,CAAC,CAC7D,CAEA,SAASC,EAA6B,qBAC3B,QAAAC,EAAAD,EAAS,SAAT,YAAAC,EAAiB,QAAOC,EAAA,KAAK,MAAM,SAAX,YAAAA,EAAmB,QAC9CC,EAAAH,EAAS,SAAT,YAAAG,EAAiB,QAAOC,EAAA,KAAK,KAAK,SAAV,YAAAA,EAAkB,QAC1CC,EAAAL,EAAS,MAAT,YAAAK,EAAc,QAAOC,EAAA,KAAK,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,GAAoC,CAC/C,CAAChG,EAAY,sCAAsC,EAAG,CACpD,MAAO,gDACP,YACE,oLACF,QAASM,EACX,CACF,EAEa2F,GAAmC,CAC9C,CAACjG,EAAY,wCAAwC,EAAG,CACtD,MAAO,yBACP,YAAa,8DACb,QAASO,EACX,EACA,CAACP,EAAY,uDAAuD,EAAG,CACrE,MAAO,wCACP,YACE,6EACF,QAASO,EACX,EACA,CAACP,EAAY,gDAAgD,EAAG,CAC9D,MAAO,sDACP,YACE,2FACF,QAASO,EACX,EACA,CAACP,EAAY,uCAAuC,EAAG,CACrD,MAAO,0BACP,YACE,+FACF,QAASO,EACX,EACA,CAACP,EAAY,sDAAsD,EAAG,CACpE,MAAO,yDACP,YACE,oFACF,QAASO,EACX,EACA,CAACP,EAAY,kDAAkD,EAAG,CAChE,MAAO,qDACP,YACE,wGACF,QAASO,EACX,EACA,CAACP,EAAY,2CAA2C,EAAG,CACzD,MAAO,8CACP,YACE,6FACF,QAASO,EACX,EACA,CAACP,EAAY,iCAAiC,EAAG,CAC/C,MAAO,6CACP,YACE,sEACF,QAASO,EACX,EACA,CAACP,EAAY,uCAAuC,EAAG,CACrD,MAAO,sDACP,YACE,2FACF,QAASO,EACX,CACF,EAEa2F,GAA2B,CACtC,CAAClG,EAAY,sBAAsB,EAAG,CACpC,MAAO,UACP,YACE,yIACF,UAAW,GACX,YAAa,0BACb,gBAAiBje,EAAM,OAAO,WAAW,GAC3C,EACA,CAACie,EAAY,iCAAiC,EAAG,CAC/C,MAAO,0BACP,YACE,0GACF,UAAW,GACX,YAAa,0BACb,gBAAiBje,EAAM,OAAO,WAAW,GAC3C,EACA,CAACie,EAAY,sBAAsB,EAAG,CACpC,MAAO,eACP,YACE,2FACF,UAAW,GACX,YAAa,0BACb,gBAAiBje,EAAM,OAAO,WAAW,GAC3C,CACF,EAEaokB,GAA0B,CACrC,CAACnG,EAAY,2BAA2B,EAAG,CACzC,MAAO,8BACP,YACE,yGACF,QAASS,EACX,EACA,CAACT,EAAY,sBAAsB,EAAG,CACpC,MAAO,iCACP,YACE,4GACF,QAASQ,EACX,EACA,CAACR,EAAY,+BAA+B,EAAG,CAC7C,MAAO,6BACP,YACE,sMACF,QAASQ,EACX,EACA,CAACR,EAAY,yBAAyB,EAAG,CACvC,MAAO,oCACP,YACE,yJACF,QAASU,EACX,EACA,CAACV,EAAY,uBAAuB,EAAG,CACrC,MAAO,gCACP,YACE,uJACF,QAASQ,GACT,sBAAuB+B,EACzB,EACA,CAACvC,EAAY,sBAAsB,EAAG,CACpC,MAAO,gCACP,YAAa,gCACb,QAASQ,EACX,CACF,EAEa4F,GAA6B,CACxC,CAACpG,EAAY,yBAAyB,EAAG,CACvC,MAAO,oCACP,YACE,mHACF,QAASgB,EACX,CACF,EAEaqF,GAA+B,CAC1C,CAACrG,EAAY,+BAA+B,EAAG,CAC7C,MAAO,yBACP,YACE,uGACF,QAASe,EACX,EACA,CAACf,EAAY,gCAAgC,EAAG,CAC9C,MAAO,qDACP,YACE,8FACF,QAASe,EACX,CACF,EAEauF,GAA8B,CACzC,CAACtG,EAAY,mCAAmC,EAAG,CACjD,MAAO,yBACP,YAAa,yDACb,QAASc,EACX,EACA,CAACd,EAAY,gDAAgD,EAAG,CAC9D,MAAO,8BACP,YAAa,0DACb,QAASc,EACX,EACA,CAACd,EAAY,6BAA6B,EAAG,CAC3C,MAAO,mBACP,YACE,0FACF,QAASQ,EACX,EACA,CAACR,EAAY,8CAA8C,EAAG,CAC5D,MAAO,mCACP,YAAa,0DACb,QAASc,EACX,EACA,CAACd,EAAY,mCAAmC,EAAG,CACjD,MAAO,4BACP,YACE,uEACF,QAASc,EACX,EACA,CAACd,EAAY,kCAAkC,EAAG,CAChD,MAAO,4BACP,YACE,qEACF,QAASc,EACX,EACA,CAACd,EAAY,8BAA8B,EAAG,CAC5C,MAAO,+BACP,YACE,qEACF,QAASc,EACX,EACA,CAACd,EAAY,oCAAoC,EAAG,CAClD,MAAO,iDACP,YACE,6FACF,QAASc,EACX,EAC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Aa,KAAM,EAE3B,SACCkwB,GAAAn6C,EAAA,IAACg6C,GAAA,CACC,OAAO,IACP,YAAa1F,GAAeE,EAAO,QAAQ,CAAA,CAC7C,CAAA,CAEJ,CAAA,CAEJ,CAAA,CAAA,CAIR,CAEO,OAAA,IACT,EC7EM4F,GAAsB,CAC1B,MAAO,CACL,QACA,YACA,gBACA,gBACA,iBACF,EACA,IAAK,CAAC,EACN,QAAS,CACP,mBACA,UACA,iBACA,UACA,UACA,UACA,eACA,aACA,OACA,WACA,uBACA,OACA,SACA,WACA,gBACA,iBACA,gBACA,UACA,SACF,EACA,MAAO,CAAC,WAAY,SAAU,UAAW,WAAW,EACpD,KAAM,CAAC,EACP,QAAS,CACP,WACA,SACA,kBACA,OACA,YACA,YACA,UACA,cACA,UACF,EACA,QAAS,CACP,qBACA,kBACA,iBACA,qBACA,oBACA,oBACA,qBACA,iBACA,8BACA,QACA,aACF,EACA,OAAQ,CACN,SACA,WACA,UACA,WACA,WACA,WACA,QACF,EACA,WAAY,CAAC,cAAe,YAAa,aAAc,YAAY,EACnE,QAAS,CACP,UACA,qBACA,mBACA,mBACA,kBACA,iBACA,gBACA,4BACF,EACA,SAAU,CACR,WACA,YACA,YACA,cACA,UACA,sBACA,gBACA,iBACA,OACA,SACA,SACA,QACF,EACA,aAAc,CACZ,SACA,QACA,eACA,WACA,kBACA,cACA,qBACF,EACA,SAAU,CACR,YACA,mBACA,SACA,SACA,OACA,UACF,CACF,EAEMC,GAAmB,CAAA,EAEzB,OAAO,KAAKD,EAAmB,EAAE,QAASzJ,GAAW,CACnDyJ,GAAoBzJ,CAAM,EAAE,QAAS7d,GAAW,CAC9CunB,GAAiBvnB,CAAM,EAAI6d,CAAA,CAC5B,CACH,CAAC,EAEM,MAAME,GAA4BwJ,GAE5BC,GAAoB,CAACxnB,EAAQ7hB,EAAO0/B,IAAW,CAC1D,MAAM4J,EACJ5J,GAAUE,GAA0B/d,EAAO,YAAA,CAAa,GAAK,UACzD0nB,EAAWvp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AI,QACpD,KAAG,EAAA,EACHC,GAAaD,EAAQ,MAAOA,EAAQ,QAASA,EAAQ,UAAU,EAAE,KAChE,IACF,CACF,CAAA,CAAA,EAGG,IAGIE,GAAyB,CAACF,EAASG,IAC1CH,EACKD,GAAc,CACnB,GAAGC,EACH,MAAOI,GAAmBJ,EAAQ,QAASA,EAAQ,KAAK,EACxD,QAASG,EAAeH,EAAQ,OAAO,GAAKA,EAAQ,OAAA,CACrD,EAEI,IAGIK,GAAiCL,GAAY,CAClD,KAAA,CAAE,eAAAG,GAAmBG,KACpB,OAAAJ,GAAuBF,EAASG,CAAc,CACvD","x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105]}