var mp = Object.defineProperty; var fp = (r, e, t) => e in r ? mp(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t; var w = (r, e, t) => fp(r, typeof e != "symbol" ? e + "" : e, t); import { DOCS_VIEW_KEY as gp, getCanvasOffsetByEngine as ru, IEditorService as Ss, VIEWPORT_KEY as vo, DOCS_COMPONENT_MAIN_LAYER_INDEX as pp, BreakLineCommand as Sp, DeleteLeftCommand as Cp, DocSelectionRenderService as Sr, ReplaceSnapshotCommand as xh, MoveSelectionOperation as vp, MoveCursorOperation as bp, SetInlineFormatBoldCommand as _p, SetInlineFormatItalicCommand as wp, SetInlineFormatUnderlineCommand as Rp, SetInlineFormatStrikethroughCommand as Ip, SetInlineFormatSubscriptCommand as yp, SetInlineFormatSuperscriptCommand as Mp, SetInlineFormatFontSizeCommand as Pp, SetInlineFormatFontFamilyCommand as Ep, SetInlineFormatTextColorCommand as Oh, SetInlineFormatCommand as Pi, NodePositionConvertToCursor as Ah, getLineBounding as Nh, DOC_VERTICAL_PADDING as Tp, IMEInputCommand as xp, InsertCommand as Op, CoverContentCommand as Ap, IRangeSelectorService as Np } from "@univerjs/docs-ui"; import { Inject as D, Injector as vt, Disposable as ce, useDependency as W, IUniverInstanceService as L, UniverInstanceType as O, ObjectMatrix as Ke, Tools as se, Direction as B, isFormulaString as Kc, isFormulaId as Hp, CellValueType as ln, numfmt as er, createIdentifier as gn, toDisposable as Ae, Rectangle as ae, RANGE_TYPE as j, ICommandService as F, IUndoRedoService as Zt, CommandType as K, sequenceExecute as pl, createInterceptorKey as sr, ColorKit as Tn, convertCellToRange as bo, Quantity as sc, InterceptorManager as Cs, ThemeService as kt, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Le, EDITOR_ACTIVATED as Je, FOCUSING_EDITOR_STANDALONE as Sl, IContextService as Ne, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Te, Workbook as Vp, Optional as Jc, FOCUSING_SHEET as Tt, RxDisposable as kn, DisposableCollection as St, IPermissionService as $e, fromEventSubject as Hh, sortRules as kp, LocaleService as Ee, getReverseDirection as Vh, VerticalAlign as an, HorizontalAlign as wt, WrapStrategy as Cr, FOCUSING_UNIVER_EDITOR as Tr, FOCUSING_COMMON_DRAWINGS as Cl, FOCUSING_FX_BAR_EDITOR as Ht, FOCUSING_EDITOR_INPUT_FORMULA as _o, LocaleType as su, FOCUSING_EDITOR_BUT_HIDDEN as ic, DEFAULT_EMPTY_DOCUMENT_VALUE as kh, LRUMap as Dp, BaselineOffset as iu, BooleanNumber as Qe, DataStreamTreeTokenType as Lp, skipParseTagNames as Wp, generateRandomId as Dh, CustomRangeType as $c, DEFAULT_WORKSHEET_ROW_HEIGHT as oc, ErrorService as Bp, CellModeEnum as Lh, ILogService as vl, isNotNullOrUndefined as Fp, extractPureTextFromCell as Wh, UserManagerService as Dt, FontWeight as Yi, FontItalic as Zi, DEFAULT_STYLES as ed, Dimension as Bh, BorderStyleTypes as Pe, AbsoluteRefType as ou, useObservable as is, IConfigService as xr, nameCharacterCheck as Up, debounce as Fh, NilCommand as td, connectInjector as Qr, UndoCommandId as jp, Range as co, cellToRange as Xp, convertBodyToHtml as zp, handleStyleToString as lu, DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY as au, DEFAULT_WORKSHEET_COLUMN_WIDTH as cu, PresetListType as Yp, isRealNum as Uh, InterceptorEffectEnum as Zp, splitIntoGrid as Gp, IAuthzIoService as bl, isValidRange as qp, DependentOn as jh, Plugin as Xh, DocumentFlavor as Qp, merge as Kp, registerDependencies as du, mergeOverrideWithDependencies as Jp, touchDependencies as Gi } from "@univerjs/core"; import { SpreadsheetSkeleton as $p, IRenderManagerService as Ce, SHEET_VIEWPORT_KEY as z, CURSOR_TYPE as Re, Vector2 as Oe, Rect as ge, ScrollTimer as Kr, ScrollTimerType as It, DashedRect as eS, Group as ua, TRANSFORM_CHANGE_OBSERVABLE_TYPE as zh, cancelRequestFrame as tS, requestNewFrame as nS, FIX_ONE_PIXEL_BLUR_OFFSET as rS, Layer as sS, DeviceInputEventType as Xe, convertTextRotation as nd, RENDER_RAW_FORMULA_KEY as iS, Spreadsheet as Yh, RENDER_CLASS_TYPE as oS, ScrollBar as rd, fixLineWidthByScale as uu, ptToPixel as hu, Shape as sd, SHEET_EXTENSION_PREFIX as mu, SpreadsheetRowHeader as lS, SpreadsheetColumnHeader as aS, Viewport as Cn, hasCJKText as cS, DEFAULT_PADDING_DATA as dS, SheetExtension as Zh, RegularPolygon as Ws, precisionTo as qn } from "@univerjs/engine-render"; import { useObservable as Yt, KeyCode as Z, ILayoutService as _l, MetaKeys as ye, DEFAULT_BACKGROUND_COLOR_RGB as uS, DEFAULT_BACKGROUND_COLOR_RGBA as hS, handleStringToStyle as mS, textTrim as fu, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as gu, HTML_CLIPBOARD_MIME_TYPE as pu, IClipboardInterfaceService as wl, INotificationService as fS, IPlatformService as gS, CopyCommand as pS, CutCommand as SS, PasteCommand as CS, SheetPasteShortKeyCommandName as vS, IConfirmService as tn, IContextMenuService as Rl, MenuItemType as Q, getMenuHiddenObservable as oe, FONT_FAMILY_LIST as bS, FONT_SIZE_LIST as _S, ISidebarService as vs, IDialogService as bs, ComponentManager as Dn, useSidebarClick as wo, DISABLE_AUTO_FOCUS_KEY as Su, useEvent as Cu, useComponentsOfPart as Gh, ComponentContainer as qh, UI_PLUGIN_CONFIG_KEY as Qh, UIMenu as wS, ContextMenuPosition as Ct, IMessageService as Kh, IMenuManagerService as id, ToolbarItem as RS, RibbonStartGroup as ha, ContextMenuGroup as Ge, FontFamily as Jh, FontFamilyItem as $h, FontSize as em, BuiltInUIPart as js, IShortcutService as Il, IUIPartsService as yl, ICanvasPopupService as IS, IZenZoneService as yS, UniverMobileUIPlugin as MS } from "@univerjs/ui"; import od, { useMemo as sn, useState as te, useEffect as be, forwardRef as ht, useRef as xn, createElement as at, useCallback as On, useLayoutEffect as PS } from "react"; import { BehaviorSubject as Me, of as Ie, merge as mt, map as _e, startWith as Vt, Subject as xe, switchMap as We, takeUntil as os, distinctUntilChanged as cn, throttleTime as tm, filter as Ml, combineLatest as ot, debounceTime as Ei, Observable as it, combineLatestWith as ir, Subscription as Kn, withLatestFrom as ES, EMPTY as vu } from "rxjs"; import { SheetInterceptorService as Ln, SheetsSelectionsService as $, SetWorksheetRowAutoHeightMutationFactory as nm, SetWorksheetRowAutoHeightMutation as _r, SetRangeValuesCommand as Ti, SetWorksheetRowIsAutoHeightCommand as Pl, SetStyleCommand as TS, MoveRangeCommand as ld, ReorderRangeCommand as xS, SetSelectionsOperation as He, SetRangeValuesMutation as Se, getSheetCommandTarget as Ue, generateNullCellValue as OS, SetRangeValuesUndoMutationFactory as en, SELECTION_CONTROL_BORDER_BUFFER_WIDTH as Ro, SELECTION_CONTROL_BORDER_BUFFER_COLOR as qi, SELECTIONS_ENABLED as Yr, REF_SELECTIONS_ENABLED as Js, BEFORE_CELL_EDIT as AS, IRefSelectionsService as El, SetWorksheetActiveOperation as et, MoveRangeMutation as tr, RemoveRowMutation as xi, RemoveColMutation as Oi, InsertRowMutation as Ai, InsertColMutation as Ni, MoveRowsMutation as Tl, MoveColsMutation as xl, SetWorksheetColWidthMutation as Qt, SetWorksheetRowHeightMutation as $s, RemoveSheetMutation as An, RemoveMergeUndoMutationFactory as Ol, RemoveWorksheetMergeMutation as Kt, AddWorksheetMergeMutation as Jt, getAddMergeMutationRangeByType as Al, AddMergeUndoMutationFactory as Nl, WorkbookEditablePermission as q, WorksheetEditPermission as ee, UnitAction as ad, alignToMergedCellsBorders as En, getSelectionsService as Hi, getCellAtRowCol as uo, SelectionMoveType as Xt, expandToContinuousRange as NS, ScrollToCellOperation as cd, COMMAND_LISTENER_SKELETON_CHANGE as Io, SetWorksheetActivateCommand as dd, getPrimaryForRange as rm, SetRowHiddenCommand as sm, SetColHiddenCommand as im, SetBoldCommand as ud, SetItalicCommand as hd, SetUnderlineCommand as md, SetStrikeThroughCommand as fd, SetFontSizeCommand as gd, SetFontFamilyCommand as pd, SetTextColorCommand as om, SetFrozenMutationFactory as lm, SetFrozenMutation as vr, IExclusiveRangeService as HS, RangeProtectionRuleModel as Ye, WorksheetProtectionRuleModel as ft, RangeProtectionPermissionEditPoint as re, WorksheetCopyPermission as yo, WorksheetSetCellStylePermission as ze, ResetBackgroundColorCommand as am, SetBackgroundColorCommand as Mo, SetHorizontalTextAlignCommand as lc, SetVerticalTextAlignCommand as ac, SetTextWrapCommand as cc, SetTextRotationCommand as dc, WorkbookCopyPermission as Bs, RangeProtectionPermissionViewPoint as uc, WorksheetSetCellValuePermission as Ut, WorksheetSetColumnStylePermission as Or, WorksheetSetRowStylePermission as Ar, CancelFrozenCommand as ho, SetRowHiddenMutation as Sd, SetRowVisibleMutation as Cd, SetSelectedRowsVisibleCommand as cm, SetColHiddenMutation as vd, SetColVisibleMutation as bd, SetSelectedColsVisibleCommand as dm, SetRowHeightCommand as um, SetWorksheetRowIsAutoHeightMutation as hm, SetColWidthCommand as mm, SetFrozenCommand as VS, InsertRangeMoveDownCommand as hc, InsertRangeMoveRightCommand as mc, InsertRowCommand as kS, InsertColCommand as DS, MoveColsCommand as fm, MoveRowsCommand as gm, RemoveColCommand as pm, RemoveRowCommand as Sm, MergeCellController as LS, MERGE_CELL_INTERCEPTOR_CHECK as WS, DeltaRowHeightCommand as BS, DeltaColumnWidthCommand as FS, COMMAND_LISTENER_VALUE_CHANGE as US, AddMergeRedoSelectionsOperationFactory as jS, AddMergeUndoSelectionsOperationFactory as XS, DeleteRangeMoveLeftCommand as bu, DeleteRangeMoveUpCommand as _u, UnitObject as At, ViewStateEnum as ls, EditStateEnum as on, DeleteWorksheetProtectionCommand as Po, DeleteRangeProtectionMutation as wu, AddRangeProtectionMutation as zS, RemoveSheetCommand as YS, AddWorksheetProtectionCommand as Cm, BorderStyleManagerService as fc, SCOPE_WORKBOOK_VALUE_DEFINED_NAME as gc, InsertDefinedNameCommand as ZS, SetDefinedNameCommand as GS, RemoveDefinedNameCommand as qS, SetWorksheetShowCommand as _d, SetWorksheetOrderMutation as wd, InsertSheetMutation as Nr, SetWorksheetNameMutation as Rd, SetWorksheetHideMutation as nr, SetWorksheetNameCommand as QS, SetWorksheetOrderCommand as KS, WorkbookManageCollaboratorPermission as vm, WorkbookRenameSheetPermission as bm, SetTabColorMutation as JS, WorkbookCreateSheetPermission as _m, InsertSheetCommand as $S, SetBorderBasicCommand as pc, ClearSelectionContentCommand as Xs, ClearSelectionFormatCommand as zs, ClearSelectionAllCommand as mo, WorksheetDeleteColumnPermission as eC, WorksheetDeleteRowPermission as tC, ToggleGridlinesCommand as wm, ToggleGridlinesMutation as nC, WorksheetInsertColumnPermission as Hl, WorksheetInsertRowPermission as Id, InsertRowBeforeCommand as Sc, InsertRowAfterCommand as Rm, InsertColBeforeCommand as Cc, InsertColAfterCommand as Im, RemoveWorksheetMergeCommand as ym, WorksheetManageCollaboratorPermission as rC, RangeProtectionCache as Vl, WorkbookCreateProtectPermission as kl, WorksheetDeleteProtectionPermission as Mm, CopySheetCommand as Pm, SetTabColorCommand as Em, SetWorksheetHideCommand as Tm, WorkbookDeleteSheetPermission as sC, WorkbookHideSheetPermission as xm, ResetTextColorCommand as iC, AddWorksheetMergeCommand as oC, AddWorksheetMergeAllCommand as lC, AddWorksheetMergeVerticalCommand as aC, AddWorksheetMergeHorizontalCommand as cC, RefRangeService as dC, MAX_CELL_PER_SHEET_KEY as uC, INTERCEPTOR_POINT as hC, SheetPermissionCheckController as Om, INumfmtService as mC, WorksheetViewPermission as fC, SetProtectionCommand as gC, AddRangeProtectionCommand as pC, setEndForRange as SC, baseProtectionActions as CC, DeleteRangeProtectionCommand as vC, WorksheetProtectionPointModel as bC, SetWorksheetPermissionPointsCommand as _C, getAllWorksheetPermissionPoint as wC, convertSelectionDataToRange as Am, UniverSheetsPlugin as Nm, RefSelectionsService as Hm, ToggleCellCheckboxCommand as RC, SetSpecificRowsVisibleCommand as IC, SetSpecificColsVisibleCommand as yC } from "@univerjs/sheets"; import { DocSkeletonManagerService as Jn, DocSelectionManagerService as yd, RichTextEditingMutation as Eo, SetTextSelectionsOperation as Vi } from "@univerjs/docs"; import { sequenceNodeType as ma, matchToken as Vm, LexerTreeBuilder as km, IFunctionService as Dm, SetFormulaCalculationNotificationMutation as MC, IDefinedNamesService as ki, operatorToken as Xr, isReferenceStrings as Lm, isReferenceStringWithEffectiveColumn as PC, serializeRangeWithSheet as Wm, FUNCTION_NAMES_STATISTICAL as Fe, FUNCTION_NAMES_MATH as Dl, FUNCTION_NAMES_TEXT as EC, NullValueObject as Ru, serializeRange as Bm, deserializeRangeWithSheet as Fm } from "@univerjs/engine-formula"; import { DEFAULT_TEXT_FORMAT as TC } from "@univerjs/engine-numfmt"; import { InputNumber as xC, DropdownLegacy as ei, ColorPicker as Md, Menu as OC, MenuItem as AC, Input as ti, RadioGroup as vc, Radio as Zr, Select as Um, Button as fn, Tooltip as Gn, Confirm as NC, Slider as HC, DropdownProvider as jm, DropdownTrigger as Xm, DropdownOverlay as zm, MessageType as Ym, FormLayout as To, Avatar as Pd, Switch as VC } from "@univerjs/design"; import { ITelemetryService as kC } from "@univerjs/telemetry"; import { filter as Zm } from "rxjs/operators"; function Ed(r, e) { if (r == null) return; const t = e.getRenderById(r); if (t == null) return; const { mainComponent: n, scene: s, engine: i, components: o } = t, l = n, a = o.get(gp.BACKGROUND); return { document: l, docBackground: a, scene: s, engine: i }; } function ni(r, e) { const { startRow: t, startColumn: n, endRow: s, endColumn: i, rangeType: o } = e, l = s < t ? s : t, a = s < t ? t : s, c = i < n ? i : n, d = i < n ? n : i, u = r.getNoMergeCellPositionByIndex(l, c), h = r.getNoMergeCellPositionByIndex(a, d); return { startRow: t, startColumn: n, endRow: s, endColumn: i, rangeType: o, startY: (u == null ? void 0 : u.startY) || 0, endY: (h == null ? void 0 : h.endY) || 0, startX: (u == null ? void 0 : u.startX) || 0, endX: (h == null ? void 0 : h.endX) || 0 }; } function Pt(r, e) { const { range: t, primary: n, style: s } = r, i = ni(e, t), o = n && xo(e, n); return { rangeWithCoord: i, primaryWithCoord: o, style: s }; } function xo(r, e) { const { actualRow: t, actualColumn: n, isMerged: s, isMergedMainCell: i, startRow: o, startColumn: l, endRow: a, endColumn: c } = e, d = r.getNoMergeCellPositionByIndex(t, n), u = r.getNoMergeCellPositionByIndex(o, l), h = r.getNoMergeCellPositionByIndex(a, c); return { actualRow: t, actualColumn: n, isMerged: s, isMergedMainCell: i, startX: d.startX, startY: d.startY, endX: d.endX, endY: d.endY, mergeInfo: { startRow: o, startColumn: l, endRow: a, endColumn: c, startY: (u == null ? void 0 : u.startY) || 0, endY: (h == null ? void 0 : h.endY) || 0, startX: (u == null ? void 0 : u.startX) || 0, endX: (h == null ? void 0 : h.endX) || 0 } }; } var DC = Object.defineProperty, LC = Object.getOwnPropertyDescriptor, WC = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? LC(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && DC(e, t, s), s; }, BC = (r, e) => (t, n) => e(t, n, r); let me = class extends ce { constructor(e, t) { super(); w(this, "_currentSkeletonSearchParam", { sheetId: "" }); w(this, "_sheetSkeletonParam", []); w(this, "_currentSkeleton$", new Me(null)); w(this, "currentSkeleton$", this._currentSkeleton$.asObservable()); /** * CurrentSkeletonBefore for pre-triggered logic during registration */ w(this, "_currentSkeletonBefore$", new Me(null)); w(this, "currentSkeletonBefore$", this._currentSkeletonBefore$.asObservable()); this._context = e, this._injector = t, this.disposeWithMe(() => { this._currentSkeletonBefore$.complete(), this._currentSkeleton$.complete(), this._sheetSkeletonParam = []; }), this._initRemoveSheet(); } _initRemoveSheet() { this.disposeWithMe(this._context.unit.sheetDisposed$.subscribe((e) => { this.disposeSkeleton({ sheetId: e.getSheetId() }); })); } getCurrentSkeleton() { var e; return (e = this.getCurrent()) == null ? void 0 : e.skeleton; } getCurrent() { return this._getSkeleton(this._currentSkeletonSearchParam); } getWorksheetSkeleton(e) { return this._getSkeleton({ sheetId: e }); } /** * unitId is never read? */ getUnitSkeleton(e, t) { const n = this._getSkeleton({ sheetId: t }); return n != null && (n.unitId = e), n; } setCurrent(e) { this._setCurrent(e); } _setCurrent(e) { const t = this._getSkeleton(e), n = this._context.unitId; if (t != null) this._reCalculate(t); else { const { sheetId: o } = e, a = this._context.unit.getSheetBySheetId(e.sheetId); if (a == null) return; const c = this._buildSkeleton(a); this._sheetSkeletonParam.push({ unitId: n, sheetId: o, skeleton: c, dirty: !1 }); } this._currentSkeletonSearchParam = e; const s = this._currentSkeletonSearchParam.sheetId, i = this.getUnitSkeleton(n, s); this._currentSkeletonBefore$.next(i), this._currentSkeleton$.next(i); } reCalculate() { const e = this.getCurrent(); e != null && this._reCalculate(e); } _reCalculate(e) { e.dirty && (e.skeleton.makeDirty(!0), e.dirty = !1), e.skeleton.calculate(); } /** * Make param dirty, if param is dirty, then the skeleton will be makeDirty in _reCalculate() * @param searchParm * @param state */ makeDirty(e, t = !0) { const n = this._getSkeleton(e); n != null && (n.dirty = t); } getOrCreateSkeleton(e) { const t = this._getSkeleton(e); if (t) return t.skeleton; const s = this._context.unit.getSheetBySheetId(e.sheetId); if (!s) return; const i = this._buildSkeleton(s); return this._sheetSkeletonParam.push({ unitId: this._context.unitId, sheetId: e.sheetId, skeleton: i, dirty: !1 }), i; } disposeSkeleton(e) { const t = this._sheetSkeletonParam.findIndex((n) => n.sheetId === e.sheetId); t > -1 && (this._sheetSkeletonParam[t].skeleton.dispose(), this._sheetSkeletonParam.splice(t, 1)); } /** @deprecated Use function `attachRangeWithCoord` instead. */ attachRangeWithCoord(e) { const t = this.getCurrentSkeleton(); return t ? ni(t, e) : null; } _getSkeleton(e) { const t = this._sheetSkeletonParam.find((n) => n.sheetId === e.sheetId); return t != null && (t.commandId = e.commandId), t; } _buildSkeleton(e) { return this._injector.createInstance( $p, e, this._context.unit.getStyles() ); } }; me = WC([ BC(1, D(vt)) ], me); function Wn() { const r = W(L), e = Yt(() => r.getCurrentTypeOfUnit$(O.UNIVER_SHEET), void 0, void 0, []); return e != null ? e : null; } function J2(r) { return Yt(() => { var t; return (t = r == null ? void 0 : r.activeSheet$) != null ? t : Ie(null); }, void 0, void 0, [r]); } function $2() { const r = W(L); return Yt(() => mt([ r.getTypeOfUnitAdded$(O.UNIVER_SHEET), r.getTypeOfUnitDisposed$(O.UNIVER_SHEET) ]).pipe( _e(() => r.getAllUnitsForType(O.UNIVER_SHEET)), Vt(r.getAllUnitsForType(O.UNIVER_SHEET)) ), [], void 0, [r]); } function FC() { const r = W(Ce), e = Wn(), { sheetSkeletonManagerService: t } = sn(() => { if (e) { const n = r.getRenderById(e.getUnitId()); return { sheetSkeletonManagerService: n == null ? void 0 : n.with(me) }; } return { sheetSkeletonManagerService: null }; }, [e, r]); return t; } const eE = "SheetUI"; var Gm = /* @__PURE__ */ ((r) => (r.FILTER_PANEL_EMBED_POINT = "filter-panel-embed-point", r.SHEETS_FOOTER = "sheets-footer", r.FORMULA_AUX = "formula-aux", r))(Gm || {}), UC = Object.defineProperty, jC = Object.getOwnPropertyDescriptor, XC = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? jC(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && UC(e, t, s), s; }, Qi = (r, e) => (t, n) => e(t, n, r); const qm = ["ff", "fs", "tr", "tb"]; let ri = class extends ce { constructor(r, e, t, n) { super(), this._renderManagerService = r, this._sheetInterceptorService = e, this._selectionManagerService = t, this._univerInstanceService = n, this._initialize(); } getUndoRedoParamsOfAutoHeight(r) { const { _univerInstanceService: e } = this, t = e.getCurrentUnitForType(O.UNIVER_SHEET), n = t.getActiveSheet(), s = t.getUnitId(), i = n.getSheetId(), o = this._renderManagerService.getRenderById(s).with(me); if (!i || !o.getCurrent()) return { redos: [], undos: [] }; const { skeleton: l } = o.getCurrent(), a = l.calculateAutoHeightInRange(r), c = { subUnitId: i, unitId: s, rowsAutoHeightInfo: a }, d = nm(c, n); return { undos: [ { id: _r.id, params: d } ], redos: [ { id: _r.id, params: c } ] }; } // eslint-disable-next-line max-lines-per-function _initialize() { const { _sheetInterceptorService: r, _selectionManagerService: e } = this; this.disposeWithMe(r.interceptCommand({ getMutations: (t) => { if (t.id === Ti.id) { const n = t.params; return this.getUndoRedoParamsOfAutoHeight(n.range); } return { redos: [], undos: [] }; } })), this.disposeWithMe(r.interceptCommand({ getMutations: (t) => t.id !== Pl.id ? { redos: [], undos: [] } : this.getUndoRedoParamsOfAutoHeight(t.params.ranges) })), this.disposeWithMe(r.interceptCommand({ getMutations: (t) => { var s, i; if (t.id !== TS.id) return { redos: [], undos: [] }; if (!qm.includes((s = t.params) == null ? void 0 : s.style.type)) return { redos: [], undos: [] }; const n = (i = e.getCurrentSelections()) == null ? void 0 : i.map((o) => o.range); return n != null && n.length ? this.getUndoRedoParamsOfAutoHeight(n) : { redos: [], undos: [] }; } })), this.disposeWithMe(r.interceptAfterCommand({ getMutations: (t) => { if (t.id === ld.id) { const n = t.params; return this.getUndoRedoParamsOfAutoHeight([n.fromRange, n.toRange]); } if (t.id === xS.id) { const n = t.params; return this.getUndoRedoParamsOfAutoHeight([n.range]); } return { redos: [], undos: [] }; } })); } }; ri = XC([ Qi(0, Ce), Qi(1, D(Ln)), Qi(2, D($)), Qi(3, D(L)) ], ri); function Ys(r, e, t, n) { const s = e.get(L), i = t ? s.getUnit(t, O.UNIVER_SHEET) : s.getCurrentUnitForType(O.UNIVER_SHEET), o = n ? i == null ? void 0 : i.getSheetBySheetId(n) : i == null ? void 0 : i.getActiveSheet(); if (!o) return null; const { startRow: l, endRow: a, startColumn: c, endColumn: d } = r, u = [], h = []; for (let m = l; m <= a; m++) o.getRowFiltered(m) || u.push(m); for (let m = c; m <= d; m++) h.push(m); return { rows: u, cols: h }; } function wr(r) { const { rows: e, cols: t } = r; return { startRow: e[0], endRow: e[e.length - 1], startColumn: t[0], endColumn: t[t.length - 1] }; } function _s(r) { let e = [], t = []; const n = []; return r.forEach((s) => { e = e.concat(s.rows), t = t.concat(s.cols); }), e = Array.from(new Set(e)).sort((s, i) => s - i), t = Array.from(new Set(t)).sort((s, i) => s - i), r.forEach((s) => { n.push({ startRow: e.findIndex((i) => i === s.rows[0]), endRow: e.findIndex((i) => i === s.rows[s.rows.length - 1]), startColumn: t.findIndex((i) => i === s.cols[0]), endColumn: t.findIndex((i) => i === s.cols[s.cols.length - 1]) }); }), { ranges: n, mapFunc: (s, i) => ({ row: e[s], col: t[i] }) }; } function zC(r) { const e = new Ke(); return r.forEach((t) => { const { rows: n, cols: s } = t; n.forEach((i) => { s.forEach((o) => { e.setValue(i, o, { v: null, p: null, f: null, si: null, custom: null }); }); }); }), e.getData(); } const bc = { 零: 0, 一: 1, 二: 2, 三: 3, 四: 4, 五: 5, 六: 6, 七: 7, 八: 8, 九: 9 }, Oo = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"], Iu = ["", "万", "亿", "万亿", "亿亿"], YC = ["", "十", "百", "千"], Qm = { 十: { value: 10, secUnit: !1 }, 百: { value: 100, secUnit: !1 }, 千: { value: 1e3, secUnit: !1 }, 万: { value: 1e4, secUnit: !0 }, 亿: { value: 1e8, secUnit: !0 } }; function Pn(r) { if (!r) return 0; let e = 0, t = 0, n = 0, s = !1; const i = r.split(""); for (let o = 0; o < i.length; o++) { const l = bc[i[o]]; if (typeof l < "u") n = l, o === i.length - 1 && (t += n); else { const a = Qm[i[o]], c = a.value; s = a.secUnit, s ? (t = (t + n) * c, e += t, t = 0) : t += n * c, n = 0; } } return e + t; } function ZC(r) { let e = "", t = "", n = 0, s = !0; for (; r > 0; ) { const i = r % 10; i === 0 ? s || (s = !0, t = Oo[i] + t) : (s = !1, e = Oo[i], e += YC[n], t = e + t), n++, r = Math.floor(r / 10); } return t; } function GC(r) { let e = 0, t = "", n = "", s = !1; if (r === 0) return Oo[0]; for (; r > 0; ) { const i = r % 1e4; s && (n = Oo[0] + n), t = ZC(i), t += i !== 0 ? Iu[e] : Iu[0], n = t + n, s = i < 1e3 && i > 0, r = Math.floor(r / 1e4), e++; } return n; } function qC(r) { if (!r) return !1; let e = !0; if (r) if (r.length === 1) r === "日" || r in bc ? e = !0 : e = !1; else { const t = r.split(""); for (let n = 0; n < t.length; n++) if (!(t[n] in bc || t[n] in Qm)) { e = !1; break; } } return e; } function Ki(r) { if (!r) return { isExtendNumber: !1 }; const e = /0|([1-9]+[0-9]*)/g, t = e.test(r); if (t) { const n = r.match(e); if (n && n.length > 0) { const s = n[n.length - 1], i = r.lastIndexOf(s), o = r.substr(0, i), l = r.substr(i + s.length); return { isExtendNumber: !0, matchTxt: Number(s), beforeTxt: o, afterTxt: l }; } return { isExtendNumber: !1 }; } return { isExtendNumber: t }; } function QC(r) { let e; return r.length === 2 && (r === "周一" || r === "周二" || r === "周三" || r === "周四" || r === "周五" || r === "周六" || r === "周日") ? e = !0 : e = !1, e; } function KC(r) { let e; return r.length === 3 && (r === "星期一" || r === "星期二" || r === "星期三" || r === "星期四" || r === "星期五" || r === "星期六" || r === "星期日") ? e = !0 : e = !1, e; } function JC(r, e) { let t = 0; for (let n = 0; n < r.length && r[n] < e; n++) t++; return t; } function Di(r) { let e = !0; const t = r[1] - r[0]; for (let n = 1; n < r.length; n++) if (r[n] - r[n - 1] !== t) { e = !1; break; } return e; } function $C(r, e, t) { const n = [], s = Math.floor(e / r), i = e % r; let o = 0; if (s > 0) { for (let l = 0; l < s; l++) for (let a = 0; a < t.length; a++) n[t[a] + l * r] = o, o++; for (let l = 0; l < t.length && t[l] < i; l++) n[t[l] + r * s] = o, o++; } else for (let l = 0; l < t.length && t[l] < i; l++) n[t[l]] = o, o++; return n; } function Rr(r, e) { const t = []; for (let n = 1; n <= e; n++) { const s = (n - 1) % r.length, i = se.deepClone(r[s]); Ir(i), t.push({ v: null, s: null, p: null, f: null, si: null, t: null, ...i }); } return t; } function ev(r, e) { var n; const t = []; for (let s = 1; s <= e; s++) { const i = (s - 1) % r.length, o = { s: (n = r[i]) == null ? void 0 : n.s }; t.push(o); } return t; } function tv(r) { let e = !0; const t = r[1] / r[0]; for (let n = 1; n < r.length; n++) if (r[n] / r[n - 1] !== t) { e = !1; break; } return e; } function nv(r) { const e = []; for (let t = 1; t <= r; t++) e.push(t); return e; } function Ao(r, e, t) { var i, o, l, a; const n = [], s = []; for (let c = 0; c < r.length; c++) s.push(Number((i = r[c]) == null ? void 0 : i.v)); if (r.length > 2 && tv(s)) for (let c = 1; c <= e; c++) { const d = (c - 1) % r.length, u = se.deepClone(r[d]); Ir(u); const h = Number((o = r[r.length - 1]) == null ? void 0 : o.v) * (Number((l = r[1]) == null ? void 0 : l.v) / Number((a = r[0]) == null ? void 0 : a.v)) ** c; u && (Eu(u) && (u.v = h), n.push(u)); } else { const c = nv(r.length); for (let d = 1; d <= e; d++) { const u = (d - 1) % r.length, h = se.deepClone(r[u]); Ir(h); const m = t === B.DOWN || t === B.RIGHT, f = rv(r.length + d, s, c, m); h && (Eu(h) && (h.v = f), n.push(h)); } } return n; } function rv(r, e, t, n = !0) { function s(u) { let h = 0; for (let m = 0; m < u.length; m++) h += u[m]; return h / u.length; } const i = s(t), o = s(e); let l = 0, a = 0; for (let u = 0; u < t.length; u++) l += (t[u] - i) * (e[u] - o), a += (t[u] - i) * (t[u] - i); let c; a === 0 ? c = n ? 1 : -1 : c = l / a; const d = o - c * i; return Math.round((d + c * r) * 1e5) / 1e5; } function yu(r, e, t) { var i; const n = [], s = /0|([1-9]+[0-9]*)/g; for (let o = 1; o <= e; o++) { const l = (o - 1) % r.length, a = se.deepClone(r[l]); Ir(a); const c = `${(i = r[r.length - 1]) == null ? void 0 : i.v}`, d = c == null ? void 0 : c.match(s), u = d == null ? void 0 : d[d.length - 1], h = Math.abs(Number(u) + t * o); if (!c || !u) continue; const m = c.lastIndexOf(u), f = c.substr(0, m) + h.toString() + c.substr(m + u.length); a && (a.v = f, n.push(a)); } return n; } function as(r, e, t, n = 0) { var l, a; const s = [ ["日", "一", "二", "三", "四", "五", "六"], ["周日", "周一", "周二", "周三", "周四", "周五", "周六"], ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"] ]; if (n >= s.length) return []; const i = s[n], o = []; for (let c = 1; c <= e; c++) { const d = (c - 1) % r.length, u = se.deepClone(r[d]); Ir(u); let h = 0; if (((l = r[r.length - 1]) == null ? void 0 : l.v) === i[0]) h = 7 + t * c; else { const f = `${(a = r[r.length - 1]) == null ? void 0 : a.v}`; if (f) { const g = f.substr(f.length - 1, 1); h = Pn(g) + t * c; } } h < 0 && (h = Math.ceil(Math.abs(h) / 7) * 7 + h); const m = h % 7; u && (u.v = i[m], o.push(u)); } return o; } function Mu(r, e, t) { var s; const n = []; for (let i = 1; i <= e; i++) { const o = (i - 1) % r.length, l = se.deepClone(r[o]); Ir(l); const a = `${(s = r[r.length - 1]) == null ? void 0 : s.v}`, c = Pn(a) + t * i; let d; c <= 0 ? d = "零" : d = GC(c), l && (l.v = d, n.push(l)); } return n; } const Zs = { enWeek1: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], enWeek2: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], enMonth1: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], enMonth2: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], chnMonth1: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], chnMonth2: ["正月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "腊月"], chHour1: ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"], chHour2: ["子时", "丑时", "寅时", "卯时", "辰时", "巳时", "午时", "未时", "申时", "酉时", "戌时", "亥时"], chYear1: ["甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"], chSeason1: ["春", "夏", "秋", "冬"], chSeason2: ["春季", "夏季", "秋季", "冬季"] }; function sv(r) { let e = !1; return Object.keys(Zs).forEach((t) => { Zs[t].includes(r) && (e = !0); }), e; } function fa(r) { let e = ""; const t = []; return Object.keys(Zs).forEach((n) => { Zs[n].includes(r) && (e = n, t.push(...Zs[n])); }), { name: e, series: t }; } function Pu(r, e, t, n) { var o; const s = n.length, i = []; for (let l = 1; l <= e; l++) { const a = (l - 1) % r.length, c = se.deepClone(r[a]); Ir(c); const d = `${(o = r[r.length - 1]) == null ? void 0 : o.v}`; let u = n.indexOf(d) + t * l; u < 0 && (u += Math.abs(t) * s); const h = u % s; c && (c.v = n[h], i.push(c)); } return i; } function tE(r, e) { const t = []; let n; if (e.startRow < r.startRow) n = B.UP; else if (e.endRow > r.endRow) n = B.DOWN; else if (e.startColumn < r.startColumn) n = B.LEFT; else if (e.endColumn > r.endColumn) n = B.RIGHT; else return []; if (n === B.DOWN || n === B.UP) { const s = r.endRow - r.startRow + 1, i = e.endRow - e.startRow + 1, o = Math.floor(i / s), l = i % s, a = { startRow: 0, startColumn: 0, endRow: r.endRow - r.startRow, endColumn: r.endColumn - r.startColumn }; if (n === B.DOWN) { for (let c = 0; c < o; c++) t.push({ repeatStartCell: { row: r.startRow + (c + 1) * s, col: r.startColumn }, relativeRange: a }); l > 0 && t.push({ repeatStartCell: { row: r.startRow + (o + 1) * s, col: r.startColumn }, relativeRange: { startRow: 0, startColumn: 0, endRow: l - 1, endColumn: r.endColumn - r.startColumn } }); } else { for (let c = 0; c < o; c++) t.push({ repeatStartCell: { row: r.startRow - (c + 1) * s, col: r.startColumn }, relativeRange: a }); l > 0 && t.push({ repeatStartCell: { row: r.startRow - (o + 1) * s, col: r.startColumn }, relativeRange: { startRow: s - l, endRow: s - 1, startColumn: 0, endColumn: r.endColumn - r.startColumn } }); } } if (n === B.RIGHT || n === B.LEFT) { const s = r.endColumn - r.startColumn + 1, i = e.endColumn - e.startColumn + 1, o = Math.floor(i / s), l = i % s, a = { startRow: 0, startColumn: 0, endRow: r.endRow - r.startRow, endColumn: r.endColumn - r.startColumn }; if (n === B.RIGHT) { for (let c = 0; c < o; c++) t.push({ repeatStartCell: { row: r.startRow, col: r.startColumn + (c + 1) * s }, relativeRange: a }); l > 0 && t.push({ repeatStartCell: { row: r.startRow, col: r.startColumn + (o + 1) * s }, relativeRange: { startRow: 0, startColumn: 0, endRow: r.endRow - r.startRow, endColumn: l - 1 } }); } else { for (let c = 0; c < o; c++) t.push({ repeatStartCell: { row: r.startRow, col: r.startColumn - (c + 1) * s }, relativeRange: a }); l > 0 && t.push({ repeatStartCell: { row: r.startRow, col: r.startColumn - (o + 1) * s }, relativeRange: { startRow: 0, startColumn: s - l, endRow: r.endRow - r.startRow, endColumn: s - 1 } }); } } return t; } function Eu(r) { return !(Kc(r.f) || Hp(r.si) || r.t === ln.BOOLEAN); } function Ir(r) { r && "custom" in r && delete r.custom; } var Gr = /* @__PURE__ */ ((r) => (r.Append = "APPEND", r.Default = "DEFAULT", r.Only = "ONLY", r))(Gr || {}), ut = /* @__PURE__ */ ((r) => (r.NUMBER = "number", r.DATE = "date", r.EXTEND_NUMBER = "extendNumber", r.CHN_NUMBER = "chnNumber", r.CHN_WEEK2 = "chnWeek2", r.CHN_WEEK3 = "chnWeek3", r.LOOP_SERIES = "loopSeries", r.FORMULA = "formula", r.OTHER = "other", r))(ut || {}), ke = /* @__PURE__ */ ((r) => (r.COPY = "COPY", r.SERIES = "SERIES", r.ONLY_FORMAT = "ONLY_FORMAT", r.NO_FORMAT = "NO_FORMAT", r))(ke || {}); const iv = { type: ut.DATE, priority: 1100, match: (r, e) => { var t; if (r != null && r.f || r != null && r.si) return !1; if ((typeof (r == null ? void 0 : r.v) == "number" || (r == null ? void 0 : r.t) === ln.NUMBER) && r.s) { if (typeof r.s == "string") { const s = e.get(L).getFocusedUnit().getStyles().get(r.s), i = (t = s == null ? void 0 : s.n) == null ? void 0 : t.pattern; if (i) return er.getInfo(i).isDate; } else if (r.s.n && er.getInfo(r.s.n.pattern).isDate) return !0; } return !1; }, isContinue: (r, e) => r.type === ut.DATE, applyFunctions: { [ke.SERIES]: (r, e, t) => { const { data: n } = r; return t === B.LEFT || t === B.UP ? (n.reverse(), Ao(n, e, t).reverse()) : Ao(n, e, t); } } }, ov = { type: ut.NUMBER, priority: 1e3, match: (r) => typeof (r == null ? void 0 : r.v) == "number" || (r == null ? void 0 : r.t) === ln.NUMBER, isContinue: (r, e) => r.type === ut.NUMBER, applyFunctions: { [ke.SERIES]: (r, e, t) => { const { data: n } = r; return t === B.LEFT || t === B.UP ? (n.reverse(), Ao(n, e, t).reverse()) : Ao(n, e, t); } } }, Km = { type: ut.OTHER, priority: 0, match: () => !0, isContinue: (r, e) => r.type === ut.OTHER }, lv = { type: ut.EXTEND_NUMBER, priority: 900, match: (r) => Ki(`${r == null ? void 0 : r.v}` || "").isExtendNumber, isContinue: (r, e) => { var t; if (r.type === ut.EXTEND_NUMBER) { const { beforeTxt: n, afterTxt: s } = Ki(`${(t = r.cellData) == null ? void 0 : t.v}` || ""), { beforeTxt: i, afterTxt: o } = Ki(`${e == null ? void 0 : e.v}` || ""); if (n === i && s === o) return !0; } return !1; }, applyFunctions: { [ke.SERIES]: (r, e, t) => { var l; const { data: n } = r, s = t === B.UP || t === B.LEFT; let i; if (n.length === 1) return i = s ? -1 : 1, jt(yu(n, e, i), s); const o = []; for (let a = 0; a < n.length; a++) { const c = `${(l = n[a]) == null ? void 0 : l.v}`; c && o.push(Number(Ki(c).matchTxt)); } return s && (n.reverse(), o.reverse()), Di(o) ? (i = o[1] - o[0], jt(yu(n, e, i), s)) : Rr(n, e); } } }, av = { type: ut.CHN_NUMBER, priority: 830, match: (r) => !!qC(`${r == null ? void 0 : r.v}` || ""), isContinue: (r, e) => r.type === ut.CHN_NUMBER, applyFunctions: { [ke.SERIES]: (r, e, t) => { var a, c, d; const { data: n } = r, s = t === B.LEFT || t === B.UP; if (n.length === 1) { const u = `${(a = n[0]) == null ? void 0 : a.v}`; let h; return s ? h = -1 : h = 1, u && (u === "日" || Pn(u) < 7) ? jt(as(n, e, h), s) : jt(Mu(n, e, h), s); } let i = !1; for (let u = 0; u < n.length; u++) if (((c = n[u]) == null ? void 0 : c.v) === "日") { i = !0; break; } const o = []; let l = 0; for (let u = 0; u < n.length; u++) { const h = `${(d = n[u]) == null ? void 0 : d.v}`; h === "日" ? u === 0 ? o.push(0) : (l++, o.push(l * 7)) : i && Pn(h) > 0 && Pn(h) < 7 ? o.push(Pn(h) + l * 7) : o.push(Pn(h)); } if (s && (n.reverse(), o.reverse()), Di(o)) { if (i || o[o.length - 1] < 6 && o[0] > 0 || o[0] < 6 && o[o.length - 1] > 0) { const h = o[1] - o[0]; return jt(as(n, e, h), s); } const u = o[1] - o[0]; return jt(Mu(n, e, u), s); } return Rr(n, e); } } }, cv = { type: ut.CHN_WEEK2, priority: 820, match: (r) => !!QC(`${r == null ? void 0 : r.v}` || ""), isContinue: (r, e) => r.type === ut.CHN_WEEK2, applyFunctions: { [ke.SERIES]: (r, e, t) => { var l; const { data: n } = r, s = t === B.LEFT || t === B.UP; if (n.length === 1) { let a; return s ? a = -1 : a = 1, jt(as(n, e, a, 1), s); } const i = []; let o = 0; for (let a = 0; a < n.length; a++) { const c = `${(l = n[a]) == null ? void 0 : l.v}`, d = c == null ? void 0 : c.substr(c.length - 1, 1); c === "周日" ? a === 0 ? i.push(0) : (o++, i.push(o * 7)) : i.push(Pn(d) + o * 7); } if (s && (n.reverse(), i.reverse()), Di(i)) { const a = i[1] - i[0]; return jt(as(n, e, a, 1), s); } return Rr(n, e); } } }, dv = { type: ut.CHN_WEEK3, priority: 810, match: (r) => KC(`${r == null ? void 0 : r.v}` || ""), isContinue: (r, e) => r.type === ut.CHN_WEEK3, applyFunctions: { [ke.SERIES]: (r, e, t) => { var l; const { data: n } = r, s = t === B.LEFT || t === B.UP; if (n.length === 1) { let a; return s ? a = -1 : a = 1, jt(as(n, e, a, 2), s); } const i = []; let o = 0; for (let a = 0; a < n.length; a++) { const c = `${(l = n[a]) == null ? void 0 : l.v}`; if (c) { const d = c.substr(c.length - 1, 1); c === "星期日" ? a === 0 ? i.push(0) : (o++, i.push(o * 7)) : i.push(Pn(d) + o * 7); } } if (s && (n.reverse(), i.reverse()), Di(i)) { const a = i[1] - i[0]; return jt(as(n, e, a, 2), s); } return Rr(n, e); } } }, uv = { type: ut.LOOP_SERIES, priority: 800, match: (r) => sv(`${r == null ? void 0 : r.v}` || ""), isContinue: (r, e) => { var t; return r.type === ut.LOOP_SERIES ? fa(`${(t = r.cellData) == null ? void 0 : t.v}` || "").name === fa(`${e == null ? void 0 : e.v}` || "").name : !1; }, applyFunctions: { [ke.SERIES]: (r, e, t) => { var a, c; const { data: n } = r, s = t === B.LEFT || t === B.UP, { series: i } = fa(`${(a = n[0]) == null ? void 0 : a.v}` || ""); if (n.length === 1) { let d; return s ? d = -1 : d = 1, jt(Pu(n, e, d, i), s); } const o = []; let l = 0; for (let d = 0; d < n.length; d++) { const u = `${(c = n[d]) == null ? void 0 : c.v}`; u && (u === i[0] ? d === 0 ? o.push(0) : (l++, o.push(l * i.length)) : o.push(i.indexOf(u) + l * 7)); } if (s && (n.reverse(), o.reverse()), Di(o)) { const d = o[1] - o[0]; return jt(Pu(n, e, d, i), s); } return Rr(n, e); } } }; function jt(r, e) { return e ? r.reverse() : r; } var hv = Object.defineProperty, mv = Object.getOwnPropertyDescriptor, fv = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? mv(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && hv(e, t, s), s; }, Dr = (r, e) => (t, n) => e(t, n, r); let No = class extends ce { constructor(e, t, n, s, i, o) { super(); w(this, "_rules", []); w(this, "_hooks", []); w(this, "_applyType$", new Me(ke.SERIES)); w(this, "_isFillingStyle", !0); w(this, "_prevUndos", []); w(this, "_autoFillLocation$", new Me(null)); w(this, "autoFillLocation$", this._autoFillLocation$.asObservable()); w(this, "_showMenu$", new Me(!1)); w(this, "showMenu$", this._showMenu$.asObservable()); w(this, "_direction", B.DOWN); w(this, "applyType$", this._applyType$.asObservable()); w(this, "_menu$", new Me([ { label: "autoFill.copy", value: ke.COPY, disable: !1 }, { label: "autoFill.series", value: ke.SERIES, disable: !1 }, { label: "autoFill.formatOnly", value: ke.ONLY_FORMAT, disable: !1 }, { label: "autoFill.noFormat", value: ke.NO_FORMAT, disable: !1 } ])); w(this, "menu$", this._menu$.asObservable()); this._commandService = e, this._undoRedoService = t, this._renderManagerService = n, this._univerInstanceService = s, this._selectionManagerService = i, this._injector = o, this._init(); } _init() { this._rules = [ iv, ov, lv, av, cv, dv, uv, Km ].sort((e, t) => t.priority - e.priority), this._isFillingStyle = !0; } _getOneByPriority(e) { return e.length <= 0 ? [] : [e.reduce((n, s) => (s.priority || 0) > (n.priority || 0) ? s : n, e[0])]; } // a cache to undo commands of last apply-type _initPrevUndo() { this._prevUndos = []; } // eslint-disable-next-line max-lines-per-function async triggerAutoFill(e, t, n, s) { var h; if (n.startColumn === s.startColumn && n.startRow === s.startRow && n.endColumn === s.endColumn && n.endRow === s.endRow) return !1; if (s.endColumn < n.endColumn && s.endColumn > n.startColumn) return this._commandService.executeCommand(si.id, { clearRange: { startRow: s.startRow, endRow: s.endRow, startColumn: s.endColumn + 1, endColumn: n.endColumn }, selectionRange: s }); if (s.endRow < n.endRow && s.endRow > n.startRow) return this._commandService.executeCommand(si.id, { clearRange: { startRow: s.endRow + 1, endRow: n.endRow, startColumn: s.startColumn, endColumn: s.endColumn }, selectionRange: s }); const i = { startRow: s.startRow, endRow: s.endRow, startColumn: s.startColumn, endColumn: s.endColumn }; let o = null; if (s.startRow < n.startRow) o = B.UP, i.endRow = n.startRow - 1; else if (s.endRow > n.endRow) o = B.DOWN, i.startRow = n.endRow + 1; else if (s.startColumn < n.startColumn) o = B.LEFT, i.endColumn = n.startColumn - 1; else if (s.endColumn > n.endColumn) o = B.RIGHT, i.startColumn = n.endColumn + 1; else return !1; this.direction = o; const l = this._injector.invoke((m) => Ys(n, m)), a = this._injector.invoke((m) => Ys(i, m)); if (!l || !a) return !1; this.autoFillLocation = { source: l, target: a, unitId: e, subUnitId: t }; const c = []; this.getActiveHooks().forEach((m) => { var g; const f = (g = m == null ? void 0 : m.onBeforeFillData) == null ? void 0 : g.call(m, { source: l, target: a, unitId: e, subUnitId: t }, o); f && c.unshift(f); }), this._initPrevUndo(); for (let m = 0; m < c.length; m++) { const f = this.menu.find((g) => g.value === c[m]); if (f && !f.disable) return this.fillData(c[m]); } const u = (h = this.menu.find((m) => m.disable === !1)) == null ? void 0 : h.value; return u ? this.fillData(u) : !1; } addHook(e) { if (this._hooks.find((t) => t.id === e.id)) throw new Error(`Add hook failed, hook id '${e.id}' already exist!`); return e.priority === void 0 && (e.priority = 0), e.type === void 0 && (e.type = Gr.Append), this._hooks.push(e), Ae(() => { const t = this._hooks.findIndex((n) => n === e); t > -1 && this._hooks.splice(t, 1); }); } registerRule(e) { if (this._rules.find((n) => n.type === e.type)) throw new Error(`Registry rule failed, type '${e.type}' already exist!`); const t = this._rules.findIndex((n) => n.priority < e.priority); this._rules.splice(t === -1 ? this._rules.length : t, 0, e); } getRules() { return this._rules; } getAllHooks() { return this._hooks; } getActiveHooks() { const { source: e, target: t, unitId: n, subUnitId: s } = this.autoFillLocation || {}; if (!e || !t || !n || !s) return []; const i = this._hooks.filter( (c) => { var d; return !((d = c.disable) != null && d.call(c, { source: e, target: t, unitId: n, subUnitId: s }, this._direction, this.applyType)); } ), o = i.filter((c) => c.type === Gr.Only); if (o.length > 0) return this._getOneByPriority(o); const l = this._getOneByPriority(i.filter((c) => c.type === Gr.Default)), a = i.filter((c) => c.type === Gr.Append) || []; return [...l, ...a]; } get applyType() { return this._applyType$.getValue(); } set applyType(e) { this._applyType$.next(e); } get menu() { return this._menu$.getValue(); } get direction() { return this._direction; } set direction(e) { this._direction = e; } isFillingStyle() { return this._isFillingStyle; } setFillingStyle(e) { this._isFillingStyle = e; } get autoFillLocation() { return this._autoFillLocation$.getValue(); } set autoFillLocation(e) { this._autoFillLocation$.next(e); } setDisableApplyType(e, t) { this._menu$.next( this._menu$.getValue().map((n) => n.value === e ? { ...n, disable: t } : n) ); } setShowMenu(e) { this._showMenu$.next(e); } // eslint-disable-next-line max-lines-per-function fillData(e) { var p, S, b; this.applyType = e; const { source: t, target: n, unitId: s = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET).getUnitId(), subUnitId: i = (p = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : p.getSheetId() } = this.autoFillLocation || {}; if (!t || !n || !s || !i) return !1; const o = this.direction; this._prevUndos.length > 0 && this._prevUndos.forEach((v) => { this._commandService.syncExecuteCommand(v.id, v.params); }), this._prevUndos = []; const l = ae.union(wr(t), wr(n)), a = this.getActiveHooks(), c = this._univerInstanceService.getUnit(s, O.UNIVER_SHEET); this._commandService.syncExecuteCommand(He.id, { selections: [ { primary: { ...(b = (S = this._selectionManagerService.getCurrentLastSelection()) == null ? void 0 : S.primary) != null ? b : l }, range: { ...l, rangeType: j.NORMAL } } ], unitId: s, subUnitId: i }); const d = [], u = []; a.forEach((v) => { var I; const { undos: _, redos: R } = ((I = v.onFillData) == null ? void 0 : I.call(v, { source: t, target: n, unitId: s, subUnitId: i }, o, e)) || {}; _ && d.push(..._), R && u.push(...R); }); const h = u.every((v) => this._commandService.syncExecuteCommand(v.id, v.params)), m = []; e !== ke.NO_FORMAT && u.forEach((v) => { if (v.id === Se.id) { const { cellValue: _ } = v.params; new Ke(_).forValue((I, y, M) => { const P = Object.keys(c.getStyles().get(M == null ? void 0 : M.s) || {}); (M != null && M.p || P.length && qm.some((E) => P.includes(E))) && m.push({ startRow: I, endRow: I, startColumn: y, endColumn: y }); }); } }); const f = this._getAutoHeightUndoRedos(s, i, m); return f.redos.every((v) => this._commandService.syncExecuteCommand(v.id, v.params)) && (d.push(...f.undos), u.push(...f.redos)), h && (this._prevUndos = d, this._undoRedoService.pushUndoRedo({ unitID: s, undoMutations: d, redoMutations: u })), a.forEach((v) => { var _; (_ = v.onAfterFillData) == null || _.call(v, { source: t, target: n, unitId: s, subUnitId: i }, o, e); }), this.setShowMenu(!0), !0; } _getAutoHeightUndoRedos(e, t, n) { var d, u; const s = (d = this._renderManagerService.getRenderById(e)) == null ? void 0 : d.with(me), i = (u = s == null ? void 0 : s.getCurrent()) == null ? void 0 : u.skeleton; if (!i) return { redos: [], undos: [] }; const o = i.calculateAutoHeightInRange(n), l = { subUnitId: t, unitId: e, rowsAutoHeightInfo: o }, a = i.worksheet, c = nm(l, a); return { undos: [{ id: _r.id, params: c }], redos: [{ id: _r.id, params: l }] }; } }; No = fv([ Dr(0, F), Dr(1, Zt), Dr(2, Ce), Dr(3, D(L)), Dr(4, D($)), Dr(5, D(vt)) ], No); const Hr = gn("univer.auto-fill-service"), pr = { type: K.COMMAND, id: "sheet.command.auto-fill", handler: async (r, e) => { const t = r.get(Hr), n = r.get(L), { sourceRange: s, targetRange: i } = e, o = Ue(n); if (!o) return !1; const { subUnitId: l, unitId: a } = o; return t.triggerAutoFill(a, l, s, i); } }, si = { id: "sheet.command.auto-clear-content", type: K.COMMAND, handler: async (r, e) => { const t = r.get(L), n = r.get(F), s = r.get(Zt), i = r.get(Ln), o = Ue(t); if (!o) return !1; const { unitId: l, subUnitId: a } = o, { clearRange: c, selectionRange: d } = e, u = { subUnitId: a, unitId: l, cellValue: OS([c]) }, h = en( r, u ), { startColumn: m, startRow: f } = d, g = { selections: [ { primary: { startColumn: m, startRow: f, endColumn: m, endRow: f, actualRow: f, actualColumn: m, isMerged: !1, isMergedMainCell: !1 }, range: { ...d } } ], unitId: l, subUnitId: a }; if (n.executeCommand(He.id, g), n.syncExecuteCommand(Se.id, u)) { const S = i.afterCommandExecute({ id: Se.id, params: u }); return pl(S.redos, n), s.pushUndoRedo({ // If there are multiple mutations that form an encapsulated project, they must be encapsulated in the same undo redo element. // Hooks can be used to hook the code of external controllers to add new actions. unitID: l, undoMutations: [{ id: Se.id, params: h }, ...S.undos], redoMutations: [{ id: Se.id, params: u }, ...S.redos] }), !0; } return !1; } }, Ll = { id: "sheet.command.refill", type: K.COMMAND, handler: async (r, e) => r.get(Hr).fillData(e.type) }, _c = [10, 400], Jm = "RANGE_SELECTOR_COMPONENT_KEY", Td = "EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY"; var qe = /* @__PURE__ */ ((r) => (r.MAIN = "__SpreadsheetRender__", r.ROW = "__SpreadsheetRowHeader__", r.COLUMN = "__SpreadsheetColumnHeader__", r.LEFT_TOP = "__SpreadsheetLeftTopPlaceholder__", r))(qe || {}); const Tu = 0, Ho = 1, rr = 10, gv = 11, xu = 12, wc = sr("rangeMovePermissionCheck"), Rc = sr("rangeFillPermissionCheck"); var $m = /* @__PURE__ */ ((r) => (r[r.FORMULA_EDITOR_SHOW = 100] = "FORMULA_EDITOR_SHOW", r[r.MARK_SELECTION = 1e4] = "MARK_SELECTION", r))($m || {}); function yr(r) { const e = r.getCurrentTheme(), t = new Tn(e.primaryColor).setAlpha(0.07).toRgbString(); return { strokeWidth: 1, stroke: e.primaryColor, fill: t, // widgets: { tl: true, tc: true, tr: true, ml: true, mr: true, bl: true, bc: true, br: true }, widgets: {}, widgetSize: 6, widgetStrokeWidth: 1, widgetStroke: e.colorWhite, autofillSize: 6, autofillStrokeWidth: 1, autofillStroke: e.colorWhite, rowHeaderFill: t, rowHeaderStroke: e.primaryColor, rowHeaderStrokeWidth: 1, columnHeaderFill: t, columnHeaderStroke: e.primaryColor, columnHeaderStrokeWidth: 1, expandCornerSize: 40 }; } class pv { constructor() { w(this, "_startColumn", -1); w(this, "_startRow", -1); w(this, "_endColumn", -1); w(this, "_endRow", -1); w(this, "_startX", 0); w(this, "_startY", 0); w(this, "_endX", 0); w(this, "_endY", 0); /** * The highlight cell of a selection. aka: current cell */ w(this, "_primary"); w(this, "_rangeType", j.NORMAL); } get startColumn() { return this._startColumn; } get startRow() { return this._startRow; } get endColumn() { return this._endColumn; } get endRow() { return this._endRow; } get startX() { return this._startX; } get startY() { return this._startY; } get endX() { return this._endX; } get endY() { return this._endY; } get currentCell() { return this._primary; } get rangeType() { return this._rangeType; } /** * @deprecated, Duplicate with `Rectangle` */ isEqual(e) { const { startColumn: t, startRow: n, endColumn: s, endRow: i } = this, { startColumn: o, startRow: l, endColumn: a, endRow: c } = e; return t === o && n === l && s === a && i === c; } /** * @deprecated, Duplicate with `Rectangle` */ isInclude(e) { const { startColumn: t, startRow: n, endColumn: s, endRow: i } = this, { startColumn: o, startRow: l, endColumn: a, endRow: c } = e; return !(a < t || o > s || l > i || c < n); } highlightToSelection() { if (this._primary) return bo(this._primary); } getRange() { return { startColumn: this._startColumn, startRow: this._startRow, endColumn: this._endColumn, endRow: this._endRow, startX: this._startX, startY: this._startY, endX: this._endX, endY: this._endY, rangeType: this.rangeType }; } getCell() { return this._primary; } getRangeType() { return this._rangeType; } setRangeType(e) { this._rangeType = e; } getValue() { return { rangeWithCoord: this.getRange(), primaryWithCoord: this._primary }; } setValue(e, t) { const { startColumn: n, startRow: s, endColumn: i, endRow: o, startX: l, startY: a, endX: c, endY: d, rangeType: u } = e; this._startColumn = n, this._startRow = s, this._endColumn = i, this._endRow = o, this._startX = l, this._startY = a, this._endX = c, this._endY = d, u !== void 0 && (this._rangeType = u), t !== void 0 && this.setCurrentCell(t); } /** * Set primary cell. * @TODO lumixraku there are 3 concepts for same thing, primary and current and highlight * highlight is best. primary sometimes means the actual cell(actual means ignore merge) * @param currentCell */ setCurrentCell(e) { this._primary = e; } clearCurrentCell() { this._primary = null; } } const Ou = "__SpreadsheetHelperSelectionTempRect", Sv = 35; class Cv { constructor(e, t) { w(this, "_startOffsetX", 0); w(this, "_startOffsetY", 0); w(this, "_relativeSelectionPositionRow", 0); w(this, "_relativeSelectionPositionColumn", 0); w(this, "_relativeSelectionRowLength", 0); w(this, "_relativeSelectionColumnLength", 0); w(this, "_scenePointerMoveSub"); w(this, "_scenePointerUpSub"); /** * The shadow selection under cursor when move whole selection control(for moving normal selection) */ w(this, "_helperSelection"); w(this, "_scrollTimer"); w(this, "_activeViewport"); w(this, "_targetSelection", { startY: 0, endY: 0, startX: 0, endX: 0, startRow: -1, endRow: -1, startColumn: -1, endColumn: -1 }); w(this, "_isInMergeState", !1); w(this, "_fillControlColors", []); w(this, "_skeleton"); w(this, "_scene"); w(this, "_themeService"); w(this, "_injector"); w(this, "_selectionHooks"); this._control = e, this._skeleton = t.skeleton, this._scene = t.scene, this._themeService = t.themeService, this._injector = t.injector, this._selectionHooks = t.selectionHooks, this._initialControl(), this._initialWidget(), this._initialAutoFill(), this._control.dispose$.subscribe(() => { this.dispose(); }); } get isHelperSelection() { return this._control.isHelperSelection; } dispose() { var e, t; (e = this._scrollTimer) == null || e.dispose(), this._fillControlColors = [], this._clearObserverEvent(), (t = this._helperSelection) == null || t.dispose(); } _getFreeze() { var n, s; return (s = (n = this._injector.get(Ce).withCurrentTypeOfUnit(O.UNIVER_SHEET, me)) == null ? void 0 : n.getCurrent()) == null ? void 0 : s.skeleton.getWorksheetConfig().freeze; } _isSelectionInViewport(e, t) { const n = this._getFreeze() || { startRow: -1, startColumn: -1, xSplit: 0, ySplit: 0 }; switch (t.viewportKey) { case z.VIEW_MAIN: return e.endRow >= n.startRow && e.endColumn >= n.startColumn; case z.VIEW_MAIN_TOP: case z.VIEW_COLUMN_RIGHT: return e.endColumn >= n.startColumn && e.startRow < n.startRow; case z.VIEW_MAIN_LEFT: case z.VIEW_ROW_BOTTOM: return e.endRow >= n.startRow && e.startColumn < n.startColumn; case z.VIEW_MAIN_LEFT_TOP: case z.VIEW_COLUMN_LEFT: case z.VIEW_ROW_TOP: case z.VIEW_LEFT_TOP: return e.startRow < n.startRow && e.startColumn < n.startColumn; } } _clearObserverEvent() { var e, t; (e = this._scenePointerMoveSub) == null || e.unsubscribe(), (t = this._scenePointerUpSub) == null || t.unsubscribe(), this._scenePointerMoveSub = null, this._scenePointerUpSub = null; } _initialControl() { const { leftControl: e, rightControl: t, topControl: n, bottomControl: s } = this._control; [e, t, n, s].forEach((i) => { i.onPointerEnter$.subscribeEvent(() => { var l; ((l = this._injector.get(dt, sc.OPTIONAL)) == null ? void 0 : l.interceptor.fetchThroughInterceptors(wc)(!1, null)) !== !1 && i.setCursor(Re.MOVE); }), i.onPointerLeave$.subscribeEvent(() => { i.resetCursor(); }), i.onPointerDown$.subscribeEvent(this._controlPointerDownHandler.bind(this)); }); } /** * Move the whole selection control after cursor turn into move state. * NOT same as widgetMoving, that's for 8 control points. * @param moveOffsetX * @param moveOffsetY */ _controlMoving(e, t) { var P; const n = this._scene, s = n.getScrollXYInfoByViewport(Oe.FromArray([e, t])), { scaleX: i, scaleY: o } = n.getAncestorScale(), l = this._skeleton.getCellIndexByOffset( e, t, i, o, s ), { row: a, column: c } = l, d = this._skeleton.getRowCount() - 1, u = this._skeleton.getColumnCount() - 1; let h = Math.max(0, a + this._relativeSelectionPositionRow), m = h + this._relativeSelectionRowLength; m > d && (m = d, m - h < this._relativeSelectionRowLength && (h = m - this._relativeSelectionRowLength)); let f = Math.max(0, c + this._relativeSelectionPositionColumn), g = f + this._relativeSelectionColumnLength; g > u && (g = u, g - f < this._relativeSelectionColumnLength && (f = g - this._relativeSelectionColumnLength)); const p = this._skeleton.worksheet.getCellInfoInMergeData(h, f), b = Pt({ range: { startRow: h, endRow: m, startColumn: f, endColumn: g }, primary: p, style: null }, this._skeleton), v = this._skeleton.getNoMergeCellPositionByIndex(h, f), _ = this._skeleton.getNoMergeCellPositionByIndex(m, g), R = (v == null ? void 0 : v.startY) || 0, I = (_ == null ? void 0 : _.endY) || 0, y = (v == null ? void 0 : v.startX) || 0, M = (_ == null ? void 0 : _.endX) || 0; (P = this._helperSelection) == null || P.transformByState({ left: y, top: R, width: M - y, height: I - R }), this._targetSelection = { ...b.rangeWithCoord }, this._control.selectionMoving$.next(b.rangeWithCoord); } /** * Drag move whole selectionControl when cursor turns to crosshair. Not for dragging 8 control points. * @param evt */ _controlPointerDownHandler(e) { const { offsetX: t, offsetY: n } = e, s = this._scene, i = s.getCoordRelativeToViewport(Oe.FromArray([t, n])), { x: o, y: l } = i, a = s.getScrollXYInfoByViewport(i), { scaleX: c, scaleY: d } = s.getAncestorScale(), u = this._skeleton.getCellIndexByOffset( o, l, c, d, a ); this._startOffsetX = o, this._startOffsetY = l; const { row: h, column: m } = u, { startRow: f, startColumn: g, endRow: p, endColumn: S } = this._control.model; let b = 0, v = 0; h < f ? b -= 1 : h > p && (b += 1), m < g ? v -= 1 : m > S && (v += 1), this._relativeSelectionPositionRow = f - h + b, this._relativeSelectionPositionColumn = g - m + v, this._relativeSelectionRowLength = p - f, this._relativeSelectionColumnLength = S - g; const _ = this._control.currentStyle, R = this._getScale(); this.isHelperSelection && (this._helperSelection = new ge(Ou, { stroke: _.stroke, strokeWidth: _.strokeWidth / R }), s.addObject(this._helperSelection)); const I = s.getViewport(z.VIEW_MAIN), y = Kr.create(s); this._scrollTimer = y, y.startScroll(o, l, I), s.disableObjectsEvent(), this._scenePointerMoveSub = s.onPointerMove$.subscribeEvent((M) => { var x; const { offsetX: P, offsetY: E } = M; if (((x = this._injector.get(dt, sc.OPTIONAL)) == null ? void 0 : x.interceptor.fetchThroughInterceptors(wc)(!1, null)) === !1) return; const { x: A, y: H } = s.getCoordRelativeToViewport( Oe.FromArray([P, E]) ); this._controlMoving(A, H), s.setCursor(Re.MOVE), y.scrolling(A, H, () => { this._controlMoving(A, H); }); }), this._scenePointerUpSub = s.onPointerUp$.subscribeEvent(() => { var P, E, T, A; (P = this._helperSelection) == null || P.dispose(); const M = this._scene; M.resetCursor(), this._clearObserverEvent(), M.enableObjectsEvent(), (E = this._scrollTimer) == null || E.dispose(), this._control.selectionMoveEnd$.next(this._targetSelection), (A = (T = this._selectionHooks).selectionMoveEnd) == null || A.call(T); }); } _initialWidget() { const { topLeftWidget: e, topCenterWidget: t, topRightWidget: n, middleLeftWidget: s, middleRightWidget: i, bottomLeftWidget: o, bottomCenterWidget: l, bottomRightWidget: a } = this._control, c = [ Re.NORTH_WEST_RESIZE, Re.NORTH_RESIZE, Re.NORTH_EAST_RESIZE, Re.WEST_RESIZE, Re.EAST_RESIZE, Re.SOUTH_WEST_RESIZE, Re.SOUTH_RESIZE, Re.SOUTH_EAST_RESIZE ]; [ e, t, n, s, i, o, l, a ].forEach((d, u) => { d.onPointerEnter$.subscribeEvent(() => { d.setCursor(c[u]); }), d.onPointerLeave$.subscribeEvent(() => { d.resetCursor(); }), d.onPointerDown$.subscribeEvent((h) => { this._widgetPointerDownEvent(h, c[u]); }); }); } /** * Pointer down Events for 8 control point. * @param evt * @param cursor */ _widgetPointerDownEvent(e, t) { const n = this._scene, { offsetX: s, offsetY: i } = e, o = n.getCoordRelativeToViewport(Oe.FromArray([s, i])), { x: l, y: a } = o; this._startOffsetX = s, this._startOffsetY = i; const { startRow: c, startColumn: d, endRow: u, endColumn: h } = this._control.model, m = Math.min(c, u), f = Math.min(d, h), g = Math.max(c, u), p = Math.max(d, h); this._relativeSelectionPositionRow = m, this._relativeSelectionPositionColumn = f, this._relativeSelectionRowLength = g - m, this._relativeSelectionColumnLength = p - f, t === Re.NORTH_WEST_RESIZE ? (this._relativeSelectionPositionRow = g, this._relativeSelectionPositionColumn = p) : t === Re.NORTH_RESIZE ? this._relativeSelectionPositionRow = g : t === Re.NORTH_EAST_RESIZE ? this._relativeSelectionPositionRow = g : t === Re.WEST_RESIZE ? this._relativeSelectionPositionColumn = p : t === Re.SOUTH_WEST_RESIZE ? this._relativeSelectionPositionColumn = p : t === Re.SOUTH_RESIZE && (this._relativeSelectionPositionRow = m); const S = Kr.create(n), b = n.getViewport(z.VIEW_MAIN); S.startScroll(l, a, b), this._scrollTimer = S, n.disableObjectsEvent(), this._scenePointerMoveSub = n.onPointerMove$.subscribeEvent((v) => { const { offsetX: _, offsetY: R } = v, { x: I, y } = n.getCoordRelativeToViewport( Oe.FromArray([_, R]) ); this._widgetMoving(I, y, t), n.setCursor(t), S.scrolling(I, y, () => { this._widgetMoving(I, y, t); }); }), this._scenePointerUpSub = n.onPointerUp$.subscribeEvent(() => { var _, R, I; const v = this._scene; v.resetCursor(), this._clearObserverEvent(), v.enableObjectsEvent(), (_ = this._scrollTimer) == null || _.dispose(), this._control.selectionScaled$.next(this._targetSelection), (I = (R = this._selectionHooks).selectionMoveEnd) == null || I.call(R); }); } /** * Pointer move Events for 8 control point. * @param moveOffsetX * @param moveOffsetY * @param cursor */ _widgetMoving(e, t, n) { const s = this._scene, i = s.getScrollXYInfoByViewport(Oe.FromArray([this._startOffsetX, this._startOffsetY])), { scaleX: o, scaleY: l } = s.getAncestorScale(), a = this._skeleton.getCellIndexByOffset( e, t, o, l, i ), { row: c, column: d } = a; let u = this._relativeSelectionPositionRow, h = this._relativeSelectionPositionColumn, m = c, f = d; n === Re.NORTH_WEST_RESIZE ? (u = c, h = d, m = this._relativeSelectionPositionRow, f = this._relativeSelectionPositionColumn) : n === Re.NORTH_RESIZE ? (u = c, h = this._relativeSelectionPositionColumn, m = this._relativeSelectionPositionRow, f = this._relativeSelectionPositionColumn + this._relativeSelectionColumnLength) : n === Re.NORTH_EAST_RESIZE ? (u = c, h = this._relativeSelectionPositionColumn, m = this._relativeSelectionPositionRow, f = d) : n === Re.WEST_RESIZE ? (u = this._relativeSelectionPositionRow, h = d, m = this._relativeSelectionPositionRow + this._relativeSelectionRowLength, f = this._relativeSelectionPositionColumn) : n === Re.EAST_RESIZE ? m = this._relativeSelectionPositionRow + this._relativeSelectionRowLength : n === Re.SOUTH_WEST_RESIZE ? (u = this._relativeSelectionPositionRow, h = d, m = c, f = this._relativeSelectionPositionColumn) : n === Re.SOUTH_RESIZE && (u = this._relativeSelectionPositionRow, h = this._relativeSelectionPositionColumn, m = c, f = this._relativeSelectionPositionColumn + this._relativeSelectionColumnLength); const g = this._swapPositions(u, h, m, f), p = this._skeleton.getCellWithMergeInfoByIndex(u, h), b = Pt({ range: g, primary: p, style: null }, this._skeleton); this._targetSelection = { ...b.rangeWithCoord }, this._control.updateRangeBySelectionWithCoord(b), this._control.selectionScaling$.next(this._targetSelection); } _initialAutoFill() { const { fillControl: e } = this._control; e.onPointerEnter$.subscribeEvent((t) => { this._injector.get(dt).interceptor.fetchThroughInterceptors(Rc)(!1, { x: t.offsetX, y: t.offsetY, skeleton: this._skeleton, scene: this._scene }) && e.setCursor(Re.CROSSHAIR); }), e.onPointerLeave$.subscribeEvent(() => { e.resetCursor(); }), e.onPointerDown$.subscribeEvent(this._autoFillForPointerdown.bind(this)); } // eslint-disable-next-line complexity _autoFillMoving(e, t) { var E, T, A; const n = this._scene, s = n.getViewportScrollXY(this._activeViewport), { scaleX: i, scaleY: o } = n.getAncestorScale(), l = this._skeleton.getCellIndexByOffset( e, t, i, o, s ), { row: a, column: c } = l, d = n.getCoordRelativeToViewport(Oe.FromArray([e, t])), u = this._skeleton.getRowCount() - 1, h = this._skeleton.getColumnCount() - 1; let m = this._relativeSelectionPositionRow, f = this._relativeSelectionPositionColumn, g = this._relativeSelectionPositionRow + this._relativeSelectionRowLength, p = this._relativeSelectionPositionColumn + this._relativeSelectionColumnLength, S = !1, b = !0; if ((c < f || c > p) && a >= m && a <= g) { const H = this._fillRuler( c, f, p, this._relativeSelectionColumnLength, h ); f = H.startRowOrColumn, p = H.endRowOrColumn, S = H.isLighten, b = !1; } else if ((a < m || a > g) && c >= f && c <= p) { const H = this._fillRuler(a, m, g, this._relativeSelectionRowLength, u); m = H.startRowOrColumn, g = H.endRowOrColumn, S = H.isLighten; } else if (Math.abs(this._startOffsetX - d.x - s.x) / 2 > Math.abs(this._startOffsetY - d.y - s.y)) { const H = this._fillRuler( c, f, p, this._relativeSelectionColumnLength, h ); f = H.startRowOrColumn, p = H.endRowOrColumn, S = H.isLighten, b = !1; } else { const H = this._fillRuler(a, m, g, this._relativeSelectionRowLength, u); m = H.startRowOrColumn, g = H.endRowOrColumn, S = H.isLighten; } const v = this._skeleton.getNoMergeCellPositionByIndex(m, f), _ = this._skeleton.getNoMergeCellPositionByIndex(g, p), R = (v == null ? void 0 : v.startY) || 0, I = (_ == null ? void 0 : _.endY) || 0, y = (v == null ? void 0 : v.startX) || 0, M = (_ == null ? void 0 : _.endX) || 0; S ? this._controlHandler((H, x) => { const k = new Tn(this._fillControlColors[x]).lighten(Sv).toRgbString(); H.setProps({ fill: k }); }) : this._controlHandler((H, x) => { H.setProps({ fill: this._fillControlColors[x] }); }); const P = Ro / this._getScale(); m === g && b === !0 || f === p && b === !1 ? (E = this._helperSelection) == null || E.hide() : ((T = this._helperSelection) == null || T.transformByState({ left: y - P / 2, top: R - P / 2, width: M - y, height: I - R }), (A = this._helperSelection) == null || A.show()), this._targetSelection = { startY: R, endY: I, startX: y, endX: M, startRow: m, endRow: g, startColumn: f, endColumn: p }, this._control.selectionFilling$.next(this._targetSelection); } _autoFillForPointerdown(e) { const { offsetX: t, offsetY: n } = e, s = this._scene, i = s.getCoordRelativeToViewport(Oe.FromArray([t, n])), { x: o, y: l } = i; this._startOffsetX = o, this._startOffsetY = l; const { startRow: a, startColumn: c, endRow: d, endColumn: u } = this._control.model; this._isInMergeState = this._hasMergeInRange(a, c, d, u), this._relativeSelectionPositionRow = a, this._relativeSelectionPositionColumn = c, this._relativeSelectionRowLength = d - a, this._relativeSelectionColumnLength = u - c; const h = this._control.currentStyle; let m = h == null ? void 0 : h.stroke, f = h == null ? void 0 : h.strokeWidth; const g = yr(this._themeService); m == null && (m = g.stroke), f == null && (f = g.strokeWidth); const p = this._getScale(); f /= p; const S = Ro / p, b = new Tn(m).darken(2).toRgbString(); this.isHelperSelection && (this._helperSelection = new ge(Ou, { stroke: b, strokeWidth: f + S / 2 }), s.addObject(this._helperSelection)), this._activeViewport = s.getActiveViewportByCoord(Oe.FromArray([t, n])); const v = s.getViewport(z.VIEW_MAIN), _ = Kr.create( s, this._activeViewport.viewportKey === z.VIEW_MAIN ? It.ALL : It.NONE ); _.startScroll(o, l, v), this._scrollTimer = _, s.disableObjectsEvent(), this._controlHandler((R) => { this._fillControlColors.push(R.fill); }), this._scenePointerMoveSub = s.onPointerMove$.subscribeEvent((R) => { var H; const { offsetX: I, offsetY: y } = R, M = s.getActiveViewportByCoord(Oe.FromArray([I, y])); if (!this._injector.get(dt).interceptor.fetchThroughInterceptors(Rc)(!1, { x: e.offsetX, y: e.offsetY, skeleton: this._skeleton, scene: this._scene })) return; const { x: E, y: T } = s.getCoordRelativeToViewport( Oe.FromArray([I, y]) ); this._autoFillMoving(E, T), s.setCursor(Re.CROSSHAIR); const A = this._targetSelection; if (v && M && ((H = this._activeViewport) == null ? void 0 : H.viewportKey) !== (M == null ? void 0 : M.viewportKey)) { let x; A.startRow !== a ? (_.scrollTimerType = It.Y, x = { ...A, endRow: A.startRow }) : A.endRow !== d ? (_.scrollTimerType = It.Y, x = { ...A, startRow: A.endRow }) : A.startColumn !== c ? (_.scrollTimerType = It.X, x = { ...A, endColumn: A.startColumn }) : (_.scrollTimerType = It.X, x = { ...A, startColumn: A.endColumn }), this._isSelectionInViewport(x, M) && (v.scrollToBarPos({ x: _.scrollTimerType === It.X ? 0 : void 0, y: _.scrollTimerType === It.Y ? 0 : void 0 }), this._activeViewport = M); } _.scrolling(E, T, () => { this._autoFillMoving(E, T); }); }), this._scenePointerUpSub = s.onPointerUp$.subscribeEvent(() => { var I, y; (I = this._helperSelection) == null || I.dispose(); const R = this._scene; R.resetCursor(), this._clearObserverEvent(), R.enableObjectsEvent(), (y = this._scrollTimer) == null || y.dispose(), this._control.refreshSelectionFilled(this._targetSelection), this._isInMergeState = !1, this._controlHandler((M, P) => { M.setProps({ fill: this._fillControlColors[P] }); }), this._fillControlColors = []; }); } _hasMergeInRange(e, t, n, s) { return this._skeleton.worksheet.getMergedCellRange(e, t, n, s).length > 0; } /** * Make sure startRow < endRow and startColumn < endColumn * * @param startRow * @param startColumn * @param endRow * @param endColumn * @returns {IRange} range */ _swapPositions(e, t, n, s) { const i = Math.min(e, n), o = Math.min(t, s), l = Math.max(e, n), a = Math.max(t, s); return { startRow: i, startColumn: o, endRow: l, endColumn: a }; } _controlHandler(e) { const { leftControl: t, rightControl: n, topControl: s, bottomControl: i, backgroundControlTop: o, backgroundControlMiddleLeft: l, backgroundControlMiddleRight: a, backgroundControlBottom: c, fillControl: d } = this._control, u = [ t, n, s, i, o, l, a, c, d ]; for (let h = 0, m = u.length; h < m; h++) { const f = u[h]; e(f, h); } } _fillRuler(e, t, n, s, i) { let o = !1; if (e < t) if (this._isInMergeState && e < t) { const l = t - e, a = s + 1, c = Math.ceil(l / a); let d = t - c * a; d < 0 && (d = t - (c - 1) * a), t = d; } else t = e; else if (e >= t && e <= n) o = !0, this._isInMergeState || (n = e); else if (this._isInMergeState && e > n) { const l = e - n, a = s + 1, c = Math.ceil(l / a); let d = n + c * a; d > i && (d = n + (c - 1) * a), n = d; } else n = e; return { rowOrColumn: e, startRowOrColumn: t, endRowOrColumn: n, isLighten: o }; } _getScale() { const { scaleX: e, scaleY: t } = this._scene.getAncestorScale(); return Math.max(e, t); } } var Ic = /* @__PURE__ */ ((r) => (r.Selection = "__SpreadsheetSelectionShape__", r.top = "__SpreadsheetSelectionTopControl__", r.bottom = "__SpreadsheetSelectionBottomControl__", r.left = "__SpreadsheetSelectionShapeLeftControl__", r.right = "__SpreadsheetSelectionShapeRightControl__", r.backgroundTop = "__SpreadsheetSelectionBackgroundControlTop__", r.backgroundMiddleLeft = "__SpreadsheetSelectionBackgroundControlMiddleLeft__", r.backgroundMiddleRight = "__SpreadsheetSelectionBackgroundControlMiddleRight__", r.backgroundBottom = "__SpreadsheetSelectionBackgroundControlBottom__", r.fill = "__SpreadsheetSelectionFillControl__", r.fillTopLeft = "__SpreadsheetSelectionFillControlTopLeft__", r.fillBottomRight = "__SpreadsheetSelectionFillControlBottomRight__", r.fillTopLeftInner = "__SpreadsheetSelectionFillControlTopLeftInner__", r.fillBottomRightInner = "__SpreadsheetSelectionFillControlBottomRightInner__", r.lineMain = "__SpreadsheetDragLineMainControl__", r.lineContent = "__SpreadsheetDragLineContentControl__", r.line = "__SpreadsheetDragLineControl__", r.dash = "__SpreadsheetDragDashControl__", r.rowHeaderBackground = "__SpreadSheetSelectionRowHeaderBackground__", r.rowHeaderBorder = "__SpreadSheetSelectionRowHeaderBorder__", r.rowHeaderGroup = "__SpreadSheetSelectionRowHeaderGroup__", r.columnHeaderBackground = "__SpreadSheetSelectionColumnHeaderBackground__", r.columnHeaderBorder = "__SpreadSheetSelectionColumnHeaderBorder__", r.columnHeaderGroup = "__SpreadSheetSelectionColumnHeaderGroup__", r.topLeftWidget = "__SpreadSheetSelectionTopLeftWidget__", r.topCenterWidget = "__SpreadSheetSelectionTopCenterWidget__", r.topRightWidget = "__SpreadSheetSelectionTopRightWidget__", r.middleLeftWidget = "__SpreadSheetSelectionMiddleLeftWidget__", r.middleRightWidget = "__SpreadSheetSelectionMiddleRightWidget__", r.bottomLeftWidget = "__SpreadSheetSelectionBottomLeftWidget__", r.bottomCenterWidget = "__SpreadSheetSelectionBottomCenterWidget__", r.bottomRightWidget = "__SpreadSheetSelectionBottomRightWidget__", r))(Ic || {}); const Au = 0.3; class xd extends ce { constructor(t, n, s, i) { var o, l, a, c; super(); w(this, "_isHelperSelection", !0); /** * For ref selections, there is no auto fill. */ w(this, "_enableAutoFill", !0); /** * Only normal selections with primary cell has auto fill. * This works for multiple normal selections. Only last selection has primary cell and auto fill. */ w(this, "_showAutoFill", !1); /** * If rowHeader & col Header would be highlighted with selection. */ w(this, "_highlightHeader", !0); w(this, "_selectionRenderModel"); w(this, "_leftBorder"); w(this, "_rightBorder"); w(this, "_topBorder"); w(this, "_bottomBorder"); w(this, "_backgroundControlTop"); w(this, "_backgroundControlBottom"); w(this, "_backgroundControlMiddleLeft"); w(this, "_backgroundControlMiddleRight"); w(this, "_autoFillControl"); w(this, "_selectionShapeGroup"); w(this, "_rowHeaderBackground"); w(this, "_rowHeaderBorder"); w(this, "_rowHeaderGroup"); w(this, "_columnHeaderBackground"); w(this, "_columnHeaderBorder"); w(this, "_columnHeaderGroup"); w(this, "_dashedRect"); // for ref selection w(this, "_topLeftWidget"); w(this, "_topCenterWidget"); w(this, "_topRightWidget"); w(this, "_middleLeftWidget"); w(this, "_middleRightWidget"); w(this, "_bottomLeftWidget"); w(this, "_bottomCenterWidget"); w(this, "_bottomRightWidget"); // why three style prop? what's diff between _selectionStyle & _currentStyle? // protected _selectionStyle: Nullable; w(this, "_defaultStyle"); w(this, "_currentStyle"); w(this, "_rowHeaderWidth", 0); w(this, "_columnHeaderHeight", 0); w(this, "_widgetRects", []); w(this, "_controlExtension"); w(this, "_dispose$", new Me(this)); w(this, "dispose$", this._dispose$.asObservable()); /** * eventSource: selectionShapeExtension selectionMoving$.next, * Observer: prompt.controller */ w(this, "selectionMoving$", new xe()); w(this, "selectionMoveEnd$", new xe()); w(this, "selectionScaling$", new xe()); w(this, "selectionScaled$", new xe()); w(this, "selectionFilling$", new xe()); w(this, "_selectionFilled$", new xe()); w(this, "selectionFilled$", this._selectionFilled$.asObservable()); w(this, "_antLineOffset", 0); w(this, "_antRequestNewFrame", -1); this._scene = t, this._zIndex = n, this._themeService = s, this._enableAutoFill = (o = i == null ? void 0 : i.enableAutoFill) != null ? o : !0, this._highlightHeader = (l = i == null ? void 0 : i.highlightHeader) != null ? l : !0, this._rowHeaderWidth = (a = i == null ? void 0 : i.rowHeaderWidth) != null ? a : 0, this._columnHeaderHeight = (c = i == null ? void 0 : i.columnHeaderHeight) != null ? c : 0, this._initializeSheetBody(), this._initialHeader(); } _initializeSheetBody() { this._defaultStyle = yr(this._themeService), this._currentStyle = yr(this._themeService), this._selectionRenderModel = new pv(); const t = this._zIndex; this._leftBorder = new ge("__SpreadsheetSelectionShapeLeftControl__" + t, { zIndex: t }), this._rightBorder = new ge("__SpreadsheetSelectionShapeRightControl__" + t, { zIndex: t }), this._topBorder = new ge("__SpreadsheetSelectionTopControl__" + t, { zIndex: t }), this._bottomBorder = new ge("__SpreadsheetSelectionBottomControl__" + t, { zIndex: t }), this._backgroundControlTop = new ge("__SpreadsheetSelectionBackgroundControlTop__" + t, { zIndex: t - 1, evented: !1 }), this._backgroundControlBottom = new ge("__SpreadsheetSelectionBackgroundControlBottom__" + t, { zIndex: t - 1, evented: !1 }), this._backgroundControlMiddleLeft = new ge("__SpreadsheetSelectionBackgroundControlMiddleLeft__" + t, { zIndex: t - 1, evented: !1 }), this._backgroundControlMiddleRight = new ge("__SpreadsheetSelectionBackgroundControlMiddleRight__" + t, { zIndex: t - 1, evented: !1 }), this._autoFillControl = new ge("__SpreadsheetSelectionFillControl__" + t, { zIndex: t + 1 }), this._autoFillControl.hide(), this._dashedRect = new eS("__SpreadsheetDragDashControl__" + t, { zIndex: t + 2, evented: !1, stroke: "#fff" }); const n = [ this._autoFillControl, this._leftBorder, this._rightBorder, this._topBorder, this._bottomBorder, this._backgroundControlTop, this._backgroundControlMiddleLeft, this._backgroundControlMiddleRight, this._backgroundControlBottom, this._dashedRect ]; this._widgetRects = this._initialWidget(), this._selectionShapeGroup = new ua("__SpreadsheetSelectionShape__" + t, ...n, ...this._widgetRects), this._selectionShapeGroup.hide(), this._selectionShapeGroup.evented = !1, this._selectionShapeGroup.zIndex = t; const s = this.getScene(); s.addObject(this._selectionShapeGroup, Ho), this.disposeWithMe( Ae( s.onTransformChange$.subscribeEvent((i) => { i.type === zh.scale && (this._updateLayoutOfSelectionControl(this._currentStyle), this._updateControlCoord()); }) ) ); } _initialHeader() { const t = this._zIndex; this._rowHeaderBackground = new ge("__SpreadSheetSelectionRowHeaderBackground__" + t, { zIndex: t - 1, evented: !1 }), this._rowHeaderBorder = new ge("__SpreadSheetSelectionRowHeaderBorder__" + t, { zIndex: t - 1, evented: !1 }), this._rowHeaderGroup = new ua( "__SpreadSheetSelectionRowHeaderGroup__" + t, this._rowHeaderBackground, this._rowHeaderBorder ), this._rowHeaderGroup.hide(), this._rowHeaderGroup.evented = !1, this._rowHeaderGroup.zIndex = t, this._columnHeaderBackground = new ge("__SpreadSheetSelectionColumnHeaderBackground__" + t, { zIndex: t - 1, evented: !1 }), this._columnHeaderBorder = new ge("__SpreadSheetSelectionColumnHeaderBorder__" + t, { zIndex: t - 1, evented: !1 }), this._columnHeaderGroup = new ua( "__SpreadSheetSelectionColumnHeaderGroup__" + t, this._columnHeaderBackground, this._columnHeaderBorder ), this._columnHeaderGroup.hide(), this._columnHeaderGroup.evented = !1, this._columnHeaderGroup.zIndex = t, this.getScene().addObjects([this._rowHeaderGroup, this._columnHeaderGroup], gv); } _initialWidget() { const t = this._zIndex; return this._topLeftWidget = new ge("__SpreadSheetSelectionTopLeftWidget__" + t, { zIndex: t + 1 }), this._topCenterWidget = new ge("__SpreadSheetSelectionTopCenterWidget__" + t, { zIndex: t + 1 }), this._topRightWidget = new ge("__SpreadSheetSelectionTopRightWidget__" + t, { zIndex: t + 1 }), this._middleLeftWidget = new ge("__SpreadSheetSelectionMiddleLeftWidget__" + t, { zIndex: t + 1 }), this._middleRightWidget = new ge("__SpreadSheetSelectionMiddleRightWidget__" + t, { zIndex: t + 1 }), this._bottomLeftWidget = new ge("__SpreadSheetSelectionBottomLeftWidget__" + t, { zIndex: t + 1 }), this._bottomCenterWidget = new ge("__SpreadSheetSelectionBottomCenterWidget__" + t, { zIndex: t + 1 }), this._bottomRightWidget = new ge("__SpreadSheetSelectionBottomRightWidget__" + t, { zIndex: t + 1 }), [ this._topLeftWidget, this._topCenterWidget, this._topRightWidget, this._middleLeftWidget, this._middleRightWidget, this._bottomLeftWidget, this._bottomCenterWidget, this._bottomRightWidget ]; } get zIndex() { return this._zIndex; } get leftControl() { return this._leftBorder; } get rightControl() { return this._rightBorder; } get topControl() { return this._topBorder; } get bottomControl() { return this._bottomBorder; } get fillControl() { return this._autoFillControl; } get backgroundControlTop() { return this._backgroundControlTop; } get backgroundControlBottom() { return this._backgroundControlBottom; } get backgroundControlMiddleLeft() { return this._backgroundControlMiddleLeft; } get backgroundControlMiddleRight() { return this._backgroundControlMiddleRight; } get selectionShape() { return this._selectionShapeGroup; } get columnHeaderGroup() { return this._columnHeaderGroup; } get rowHeaderGroup() { return this._rowHeaderGroup; } get selectionShapeGroup() { return this._selectionShapeGroup; } // That's so bad! _selectionModel is protected! But I don't want to expose it to the outside world get model() { return this._selectionRenderModel; } get topLeftWidget() { return this._topLeftWidget; } get topCenterWidget() { return this._topCenterWidget; } get topRightWidget() { return this._topRightWidget; } get middleLeftWidget() { return this._middleLeftWidget; } get middleRightWidget() { return this._middleRightWidget; } get bottomLeftWidget() { return this._bottomLeftWidget; } get bottomCenterWidget() { return this._bottomCenterWidget; } get bottomRightWidget() { return this._bottomRightWidget; } get themeService() { return this._themeService; } get selectionModel() { return this._selectionRenderModel; } set selectionModel(t) { this._selectionRenderModel = t; } // get defaultStyle(): ISelectionStyle { // return this._defaultStyle; // } // set defaultStyle(style: ISelectionStyle) { // this._defaultStyle = style; // } get currentStyle() { return this._currentStyle; } set currentStyle(t) { this._currentStyle = t; } get dashedRect() { return this._dashedRect; } get isHelperSelection() { return this._isHelperSelection; } get rowHeaderWidth() { return this._rowHeaderWidth; } set rowHeaderWidth(t) { this._rowHeaderWidth = t; } get columnHeaderHeight() { return this._columnHeaderHeight; } set columnHeaderHeight(t) { this._columnHeaderHeight = t; } setControlExtension(t) { this._controlExtension = new Cv(this, t); } setEvent(t) { this.leftControl.evented = t, this.rightControl.evented = t, this.topControl.evented = t, this.bottomControl.evented = t; } refreshSelectionFilled(t) { this._selectionFilled$.next(t); } /** * Update Control Style And Position of SelectionControl * @param selectionStyle */ _updateLayoutOfSelectionControl(t) { t && (this.currentStyle = Object.assign({}, this._defaultStyle, t)); const n = this.currentStyle, { stroke: s, widgets: i, autofillStroke: o, strokeDash: l, isAnimationDash: a } = n; let c = n.autofillSize, d = n.strokeWidth, u = n.autofillStrokeWidth; const h = this._getScale(), m = (d + Ro) / 2 / h; d /= h, c /= h, u /= h < 1 ? 1 : h; const f = Ro / h, g = rS / h, { startX: p, startY: S, endX: b, endY: v } = this._selectionRenderModel; if (this.leftControl.transformByState({ height: v - S, left: -m + g, width: d, strokeWidth: f, top: -f / 2 + g }), this.leftControl.setProps({ fill: s, stroke: qi }), this.rightControl.transformByState({ height: v - S, left: b - p - m + g, width: d, strokeWidth: f, top: -f / 2 + g }), this.rightControl.setProps({ fill: s, stroke: qi }), this.topControl.transformByState({ width: b - p + d, top: -m + g, left: -m + g, height: d, strokeWidth: f }), this.topControl.setProps({ fill: s, stroke: qi }), this.bottomControl.transformByState({ width: b - p + d, top: v - S - m + g, height: d, left: -m + g, strokeWidth: f }), this.bottomControl.setProps({ fill: s, stroke: qi }), l == null) this.dashedRect.hide(), this._stopAntLineAnimation(); else { const _ = n.strokeWidth * 2 / h; this.dashedRect.transformByState({ height: v - S, width: b - p, strokeWidth: _, left: -_ / 2 + g, top: -_ / 2 + g }), this.dashedRect.setProps({ strokeDashArray: [0, l / h] }), this._stopAntLineAnimation(), a !== !1 && this._startAntLineAnimation(), this.dashedRect.show(); } if (this._showAutoFill = this._showAutoFill && this._enableAutoFill, this._showAutoFill && !this._hasWidgets(i)) { const _ = { fill: s, stroke: o, strokeScaleEnabled: !1 }, R = { width: c - u, height: c - u, left: b - p - c / 2 + u / 2 - g, top: v - S - c / 2 + u / 2 - g, strokeWidth: u }; this._autoFillControl.setProps(_), this._autoFillControl.transformByState(R), this._autoFillControl.show(); } else this._autoFillControl.hide(); this._updateBackgroundControl(n), this._updateHeaderBackground(n), this._updateWidgets(n); } /** * update selection control coordination by curr selection model */ _updateControlCoord() { const { startX: t, startY: n } = this._selectionRenderModel; this.selectionShapeGroup.show(), this.selectionShapeGroup.translate(t, n), this.selectionShapeGroup.makeDirtyNoDebounce(!0); } updateStyle(t) { this._updateLayoutOfSelectionControl(t), this._updateControlCoord(); } /** * Update range and primary range. * * highlight cell would update if primaryWithCoord has value. * highlight cell would be cleared if primaryWithCoord is null. * highlight would keep prev value if primaryWithCoord is undefined. * @param rangeWithCoord * @param primaryWithCoord */ updateRange(t, n) { this._selectionRenderModel.setValue(t, n), this._showAutoFill = n !== null, this._updateLayoutOfSelectionControl(), this._updateControlCoord(); } /** * Update range and primary range and style. * @param selectionWthCoord */ updateRangeBySelectionWithCoord(t) { this._selectionRenderModel.setValue(t.rangeWithCoord, t.primaryWithCoord), this._showAutoFill = t.primaryWithCoord !== null, this._updateLayoutOfSelectionControl(t.style), this._updateControlCoord(); } /** * Update selection model with new range & primary cell(aka: highlight/current), also update row/col selection size & style. * * @deprecated use `updateRangeBySelectionWithCoord` and `updateStyle` to do same thing. * * @param newSelectionRange * @param rowHeaderWidth * @param columnHeaderHeight * @param style * @param primaryCell primary cell */ update(t, n = 0, s = 0, i, o) { this._rowHeaderWidth = n, this._columnHeaderHeight = s, this.updateRangeBySelectionWithCoord({ rangeWithCoord: t, primaryWithCoord: o, style: i }), i && this.updateStyle(i); } /** * Update primary range. * highlight cell would update if primary cell has value. * highlight cell would be cleared if primary cell is null. * highlight would keep prev value if primary cell is undefined. * * @param primaryCell model.current (aka: highlight) */ // @TODO lumixraku there are 3 concepts for same thing, primary and current and highlight // highlight is best. primary sometimes means the actual cell(actual means ignore merge) updateCurrCell(t) { this._showAutoFill = t !== null, this._selectionRenderModel.setCurrentCell(t); } clearHighlight() { this._showAutoFill = !1, this._selectionRenderModel.clearCurrentCell(), this._updateLayoutOfSelectionControl(this._currentStyle); } getScene() { return this._scene; } // eslint-disable-next-line complexity dispose() { var t, n, s, i, o, l, a, c, d, u, h, m, f, g, p, S, b, v, _, R, I, y, M, P, E; (t = this._leftBorder) == null || t.dispose(), (n = this._rightBorder) == null || n.dispose(), (s = this._topBorder) == null || s.dispose(), (i = this._bottomBorder) == null || i.dispose(), (o = this._backgroundControlTop) == null || o.dispose(), (l = this._backgroundControlMiddleLeft) == null || l.dispose(), (a = this._backgroundControlMiddleRight) == null || a.dispose(), (c = this._backgroundControlBottom) == null || c.dispose(), this._autoFillControl.dispose(), (d = this._selectionShapeGroup) == null || d.dispose(), (u = this._rowHeaderBackground) == null || u.dispose(), (h = this._rowHeaderBorder) == null || h.dispose(), (m = this._rowHeaderGroup) == null || m.dispose(), (f = this._rowHeaderBackground) == null || f.dispose(), (g = this._columnHeaderBackground) == null || g.dispose(), (p = this._columnHeaderBorder) == null || p.dispose(), (S = this._columnHeaderGroup) == null || S.dispose(), (b = this._topLeftWidget) == null || b.dispose(), (v = this._topCenterWidget) == null || v.dispose(), (_ = this._topRightWidget) == null || _.dispose(), (R = this._middleLeftWidget) == null || R.dispose(), (I = this._middleRightWidget) == null || I.dispose(), (y = this._bottomLeftWidget) == null || y.dispose(), (M = this._bottomCenterWidget) == null || M.dispose(), (P = this._bottomRightWidget) == null || P.dispose(), (E = this._controlExtension) == null || E.dispose(), super.dispose(), this._dispose$.next(this), this._dispose$.complete(); } /** * Get the cell information of the current selection, considering the case of merging cells */ getCurrentCellInfo() { const t = this.model.currentCell; if (t) { let n; if (t.isMerged) { const s = t.mergeInfo; n = { startRow: s.startRow, endRow: s.endRow, startColumn: s.startColumn, endColumn: s.endColumn, startX: s.startX, endX: s.endX, startY: s.startY, endY: s.endY }; } else { const { actualRow: s, actualColumn: i, startX: o, endX: l, startY: a, endY: c } = t; n = { startRow: s, endRow: s, startColumn: i, endColumn: i, startX: o, endX: l, startY: a, endY: c }; } return n; } } getValue() { return { ...this._selectionRenderModel.getValue(), style: this._currentStyle }; } getRange() { return this._selectionRenderModel.getValue().rangeWithCoord; } enableHelperSelection() { this._isHelperSelection = !0; } disableHelperSelection() { this._isHelperSelection = !1; } _updateHeaderBackground(t) { const { startX: n, startY: s, endX: i, endY: o, rangeType: l } = this._selectionRenderModel, a = this._currentStyle, c = this._getScale(), { stroke: d, rowHeaderFill: u = a.rowHeaderFill, rowHeaderStroke: h = a.rowHeaderStroke, columnHeaderFill: m = a.columnHeaderFill, columnHeaderStroke: f = a.columnHeaderStroke } = t; let { rowHeaderStrokeWidth: g = a.rowHeaderStrokeWidth, columnHeaderStrokeWidth: p = a.columnHeaderStrokeWidth } = t; g /= c, p /= c; const S = this._rowHeaderWidth, b = this._columnHeaderHeight; if (this._highlightHeader && b > 0) { let v = m; l === j.COLUMN && (v = new Tn(d).setAlpha(Au).toString()), this._columnHeaderBackground.setProps({ fill: v }), this._columnHeaderBackground.resize(i - n, b), this._columnHeaderBorder.setProps({ fill: f }), this._columnHeaderBorder.transformByState({ width: i - n, height: p, top: b - p + 1 / c }), this._columnHeaderGroup.show(), this._columnHeaderGroup.translate(n, 0); } else this._columnHeaderGroup.hide(); if (this._columnHeaderGroup.makeDirty(!0), this._highlightHeader && S > 0) { let v = u; l === j.ROW && (v = new Tn(d).setAlpha(Au).toString()), this._rowHeaderBackground.setProps({ fill: v }), this._rowHeaderBackground.resize(S, o - s), this._rowHeaderBorder.setProps({ fill: h }), this._rowHeaderBorder.transformByState({ width: g, height: o - s, left: S - g + 1 / c }), this._rowHeaderGroup.show(), this._rowHeaderGroup.translate(0, s); } else this._rowHeaderGroup.hide(); this._rowHeaderGroup.makeDirty(!0); } _updateBackgroundControl(t) { const { startX: n, startY: s, endX: i, endY: o } = this._selectionRenderModel, l = this._getScale(), { fill: a = t.fill } = t; let { strokeWidth: c } = t; c /= l; const d = this._selectionRenderModel.highlightToSelection(); if (!d) { this._backgroundControlTop.resize(i - n, o - s), this._backgroundControlTop.setProps({ fill: a }), this._backgroundControlBottom.resize(0, 0), this._backgroundControlMiddleLeft.resize(0, 0), this._backgroundControlMiddleRight.resize(0, 0); return; } const { startX: u, startY: h, endX: m, endY: f } = d, g = c / 2, p = { left: -g, top: -g, width: i - n + g * 2, height: h - s + g }; p.height < 0 && (p.width = 0, p.height = 0), this._backgroundControlTop.transformByState(p); const S = { left: -g, top: h - s, width: u - n + g, height: f - h }; S.width < 0 && (S.width = 0, S.height = 0), this._backgroundControlMiddleLeft.transformByState(S); const b = { left: m - n - g, top: h - s, width: i - m + g * 2, height: f - h }; b.width < 0 && (b.width = 0, b.height = 0), this._backgroundControlMiddleRight.transformByState(b); const v = { left: -g, top: f - s, width: i - n + g * 2, height: o - f + g }; v.height < 0 && (v.width = 0, v.height = 0), this._backgroundControlBottom.transformByState(v), this._backgroundControlTop.setProps({ fill: a }), this._backgroundControlMiddleLeft.setProps({ fill: a }), this._backgroundControlMiddleRight.setProps({ fill: a }), this._backgroundControlBottom.setProps({ fill: a }); } _updateWidgets(t) { const { startX: n, startY: s, endX: i, endY: o } = this._selectionRenderModel, { stroke: l = t.stroke, widgets: a = t.widgets, widgetStroke: c = t.widgetStroke } = t, d = this._getScale(); let { widgetSize: u, widgetStrokeWidth: h } = t; u /= d, h /= d; const m = { left: -u / 2 + h / 2, center: (i - n) / 2 - u / 2 + h / 2, right: i - n - u / 2 + h / 2, top: -u / 2, middle: (o - s) / 2 - u / 2, bottom: o - s - u / 2 + h / 2 }, f = u - h; this._widgetRects.forEach((g) => { g.setProps({ fill: l, stroke: c }); }), a.tl === !0 ? (this._topLeftWidget.transformByState({ height: f, width: f, left: m.left, top: m.top, strokeWidth: h }), this._topLeftWidget.show()) : this._topLeftWidget.hide(), a.tc === !0 ? (this._topCenterWidget.transformByState({ height: f, width: f, left: m.center, top: m.top, strokeWidth: h }), this._topCenterWidget.show()) : this._topCenterWidget.hide(), a.tr === !0 ? (this._topRightWidget.transformByState({ height: f, width: f, left: m.right, top: m.top, strokeWidth: h }), this._topRightWidget.show()) : this._topRightWidget.hide(), a.ml === !0 ? (this._middleLeftWidget.transformByState({ height: f, width: f, left: m.left, top: m.middle, strokeWidth: h }), this._middleLeftWidget.show()) : this._middleLeftWidget.hide(), a.mr === !0 ? (this._middleRightWidget.transformByState({ height: f, width: f, left: m.right, top: m.middle, strokeWidth: h }), this._middleRightWidget.show()) : this._middleRightWidget.hide(), a.bl === !0 ? (this._bottomLeftWidget.transformByState({ height: f, width: f, left: m.left, top: m.bottom, strokeWidth: h }), this._bottomLeftWidget.show()) : this._bottomLeftWidget.hide(), a.bc === !0 ? (this._bottomCenterWidget.transformByState({ height: f, width: f, left: m.center, top: m.bottom, strokeWidth: h }), this._bottomCenterWidget.show()) : this._bottomCenterWidget.hide(), a.br === !0 ? (this._bottomRightWidget.transformByState({ height: f, width: f, left: m.right, top: m.bottom, strokeWidth: h }), this._bottomRightWidget.show()) : this._bottomRightWidget.hide(); } _hasWidgets(t) { if (t == null) return !1; const n = Object.keys(t); if (n.length === 0) return !1; for (const s of n) if (t[s] === !0) return !0; return !1; } _getScale() { const { scaleX: t, scaleY: n } = this._scene.getAncestorScale(); return Math.max(t, n); } _stopAntLineAnimation() { this._antLineOffset = 0, tS(this._antRequestNewFrame); } _startAntLineAnimation() { const t = this._getScale(); this._antLineOffset += 0.6 / t, this._antLineOffset > 160 / t && (this._antLineOffset = 0), this.dashedRect.setProps({ strokeDashOffset: -this._antLineOffset }), this._antRequestNewFrame = nS(() => { this._startAntLineAnimation(); }); } } class vv extends sS { render(e, t = !1) { const n = se.now(); return super.render(e, t), this._afterRender(n), this; } _afterRender(e) { this.scene.getEngine().renderFrameTimeMetric$.next(["selectionLayer", se.now() - e]); } } const dt = gn("univer.sheet.selection-render-service"); class ef extends ce { constructor(t, n, s, i, o) { super(); w(this, "_downObserver"); w(this, "_scenePointerMoveSub"); w(this, "_scenePointerUpSub"); w(this, "_controlFillConfig$", new Me(null)); w(this, "controlFillConfig$", this._controlFillConfig$.asObservable()); w(this, "_selectionControls", []); // sheetID:Controls w(this, "_startRangeWhenPointerDown", { startY: 0, endY: 0, startX: 0, endX: 0, startRow: -1, endRow: -1, startColumn: -1, endColumn: -1 }); w(this, "_activeControlIndex", -1); /** * the posX of viewport when the pointer down */ w(this, "_startViewportPosX", 0); /** * the posY of viewport when the pointer down */ w(this, "_startViewportPosY", 0); w(this, "_scrollTimer"); w(this, "_cancelDownSubscription"); w(this, "_cancelUpSubscription"); w(this, "_skeleton"); /** * From renderContext. */ w(this, "_scene"); // The type of selector determines the type of data range and the highlighting style of the title bar, now it always true. In future, this could be configurable by user. w(this, "_highlightHeader", !0); // protected _shouldDetectMergedCells: boolean = true; w(this, "_rangeType", j.NORMAL); // The style of the selection area, including dashed lines, color, thickness, autofill, other points for modifying the range of the selection area, title highlighting, and so on, can all be customized. w(this, "_selectionStyle"); // #region ref range selection // we put the properties here for simplicity // Used in the formula selection feature, a new selection string is added by drawing a box with the mouse. w(this, "_remainLastEnabled", !1); w(this, "_skipLastEnabled", !1); w(this, "_singleSelectionEnabled", !1); // #endregion /** * Mainly emit by pointerup in spreadsheet. (pointerup is handled in _onPointerdown) */ w(this, "_selectionMoveEnd$", new Me([])); /** * Pointerup in spreadsheet */ w(this, "selectionMoveEnd$", this._selectionMoveEnd$.asObservable()); /** * Mainly emit by pointermove in spreadsheet */ w(this, "_selectionMoving$", new xe()); /** * Pointermove in spreadsheet */ w(this, "selectionMoving$", this._selectionMoving$.asObservable()); w(this, "_selectionMoveStart$", new xe()); w(this, "selectionMoveStart$", this._selectionMoveStart$.asObservable()); w(this, "_selectionMoving", !1); w(this, "_selectionTheme"); w(this, "_activeViewport"); w(this, "interceptor", new Cs({ RANGE_MOVE_PERMISSION_CHECK: wc, RANGE_FILL_PERMISSION_CHECK: Rc })); w(this, "_escapeShortcutDisposable", null); this._injector = t, this._themeService = n, this._shortcutService = s, this._sheetSkeletonManagerService = i, this.contextService = o, this._initSelectionThemeFromThemeService(), this._initMoving(); } get selectionMoving() { return this._selectionMoving; } /** * If true, the selector will respond to the range of merged cells and automatically extend the selected range. If false, it will ignore the merged cells. */ get _shouldDetectMergedCells() { return this._rangeType === j.NORMAL; } _initMoving() { this.disposeWithMe(this._selectionMoving$.subscribe(() => { this._selectionMoving = !0; })), this.disposeWithMe(this._selectionMoveEnd$.subscribe(() => { this._selectionMoving = !1; })); } _setSelectionStyle(t) { this._selectionStyle = t; } /** * Reset this._selectionStyle to default normal selection style */ // protected _resetSelectionStyle(): void { // this._setSelectionStyle(genNormalSelectionStyle(this._themeService)); // } /** @deprecated This should not be provided by the selection render service. */ getViewPort() { return this._activeViewport; } setSingleSelectionEnabled(t = !1) { this._singleSelectionEnabled = t; } newSelectionControl(t, n, s) { const i = this.getSelectionControls().length, { rowHeaderWidth: o, columnHeaderHeight: l } = n, a = new xd(t, i, this._selectionTheme, { highlightHeader: this._highlightHeader, rowHeaderWidth: o, columnHeaderHeight: l }); this._selectionControls.push(a); const c = Pt(s, n); return a.updateRangeBySelectionWithCoord(c), a.setControlExtension({ skeleton: n, scene: t, themeService: this._selectionTheme, injector: this._injector, selectionHooks: { selectionMoveEnd: () => { this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()); } } }), a; } /** * Update the corresponding selectionControl based on selectionsData from WorkbookSelectionModel * selectionData[i] --> selectionControls[i] * @param selectionsWithStyleList {ISelectionWithStyle[]} selectionsData from WorkbookSelectionModel */ resetSelectionsByModelData(t) { const n = this.getSelectionControls(), s = this._skeleton; if (!(!n || !s)) { for (let i = 0, o = t.length; i < o; i++) { const l = t[i], a = Pt(l, this._skeleton), c = n[i]; c ? c.updateRangeBySelectionWithCoord(a) : this.isSelectionEnabled() && this.newSelectionControl(this._scene, s, l); } t.length < n.length && n.splice(t.length).forEach((o) => o.dispose()); } } refreshSelectionMoveStart() { this._selectionMoveStart$.next(this.getSelectionDataWithStyle()); } refreshSelectionMoveEnd() { this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()); } _initSelectionThemeFromThemeService() { const t = this._themeService.getCurrentTheme(); this._selectionTheme = new kt(), this._selectionTheme.setTheme(t); } setSelectionTheme(t) { this._selectionTheme.setTheme(t); } _changeRuntime(t, n, s) { this._skeleton = t, this._scene = n, this._activeViewport = s || (n == null ? void 0 : n.getViewports()[0]), n.findLayerByZIndex(Ho) || n.addLayer(new vv(n, [], Ho)); } getSkeleton() { return this._skeleton; } /** * Generate selectionData from this._selectionControls.model . * @returns {ISelectionWithCoord[]} {range, primary, style}[] */ getSelectionDataWithStyle() { const t = this._selectionControls, [n, s] = this._skeleton.getLocation(); return t.map((i) => { const o = i.getValue(); return o.rangeWithCoord.sheetId = s, o.rangeWithCoord.unitId = n, o; }); } /** * @TODO lumixraku DO NOT expose private props. */ getSelectionControls() { return this._selectionControls; } /** * Add a selection in spreadsheet, create a new SelectionControl and then update this control by range derives from selection. * @param {ISelectionWithCoord} selectionWithStyle */ _addSelectionControlByModelData(t) { var l; const n = this._skeleton, s = (l = t.style) != null ? l : yr(this._selectionTheme), i = this._scene; return t.style = s, this.newSelectionControl(i, n, t); } _clearAllSelectionControls() { const t = this._selectionControls; for (const n of t) n.dispose(); this._selectionControls.length = 0; } _getFreeze() { var n; return (n = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : n.skeleton.getWorksheetConfig().freeze; } _getViewportByCell(t, n) { if (t === void 0 || n === void 0) return null; const s = this._getFreeze(); if (!s || s.startRow <= 0 && s.startColumn <= 0) return this._scene.getViewport(z.VIEW_MAIN); if (t > s.startRow && n > s.startColumn) return this._scene.getViewport(z.VIEW_MAIN); if (t <= s.startRow && n <= s.startColumn) return this._scene.getViewport(z.VIEW_MAIN_LEFT_TOP); if (t <= s.startRow && n > s.startColumn) return this._scene.getViewport(z.VIEW_MAIN_TOP); if (t > s.startRow && n <= s.startColumn) return this._scene.getViewport(z.VIEW_MAIN_LEFT); } /** * Returns the selected range in the active sheet, or null if there is no active range. If multiple ranges are selected this method returns only the last selected range. */ getActiveRange() { const t = this.getSelectionControls(), n = t && t[t.length - 1].model; return n && { startRow: n.startRow, startColumn: n.startColumn, endRow: n.endRow, endColumn: n.endColumn }; } setActiveSelectionIndex(t) { this._activeControlIndex = t; } resetActiveSelectionIndex() { this._activeControlIndex = -1; } /** * get active(actually last) selection control * @returns T extends SelectionControl */ getActiveSelectionControl() { const t = this.getSelectionControls(); if (t) return this._activeControlIndex < 0 ? t[t.length - 1] : t[this._activeControlIndex]; } endSelection() { var t; this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (t = this._escapeShortcutDisposable) == null || t.dispose(), this._escapeShortcutDisposable = null; } /** * Clear existed selections by workbookSelections.selectionMoveEnd$ */ _reset() { var t; this._clearAllSelectionControls(), (t = this._downObserver) == null || t.unsubscribe(), this._downObserver = null; } /** * Init pointer move listener in each pointer down, unbind in each pointer up. * Both cell selections and row-column selections are supported by this method. * @param viewportMain * @param activeSelectionControl * @param rangeType * @param scrollTimerType * @param moveStartPosX * @param moveStartPosY */ _setupPointerMoveListener(t, n, s, i = It.ALL, o, l) { var f, g; let a = 0, c = 0, d = o, u = l; this._scrollTimer = Kr.create(this._scene, i), this._scrollTimer.startScroll((f = t == null ? void 0 : t.left) != null ? f : 0, (g = t == null ? void 0 : t.top) != null ? g : 0, t); const h = this._scene, m = h.getActiveViewportByCoord(Oe.FromArray([o, l])); this._scenePointerMoveSub = h.onPointerMove$.subscribeEvent((p) => { var A, H, x, k, U, V, N, X, Y; const { offsetX: S, offsetY: b } = p, { x: v, y: _ } = h.getCoordRelativeToViewport(Oe.FromArray([S, b])); this._movingHandler(v, _, n, s); let R = v, I = _; const y = this.getActiveSelectionControl(), M = this._getFreeze(), P = y == null ? void 0 : y.model, E = (A = h.getActiveViewportByCoord(Oe.FromArray([S, b]))) != null ? A : this._getViewportByCell(P == null ? void 0 : P.endRow, P == null ? void 0 : P.endColumn); if ((() => { if (!m || !E || !t) return !1; const ie = [ z.VIEW_MAIN, z.VIEW_MAIN_LEFT_TOP, z.VIEW_MAIN_TOP, z.VIEW_MAIN_LEFT ]; return ie.includes(m.viewportKey) && ie.includes(E.viewportKey); })()) { if (!m || !E || !t) return !1; const ie = d < t.left && v > t.left || d > t.left && v < t.left, he = u < t.top && _ > t.top || u > t.top && _ < t.top; ie && (a += 1), he && (c += 1); const ne = m.viewportKey, pe = E.viewportKey; if (ne === z.VIEW_ROW_TOP) b < t.top && ((H = P == null ? void 0 : P.endRow) != null ? H : 0) < ((x = M == null ? void 0 : M.startRow) != null ? x : 0) ? I = t.top : he && c % 2 === 1 && t.scrollToViewportPos({ viewportScrollY: 0 }); else if (ne === z.VIEW_COLUMN_LEFT) S < t.left && ((k = P == null ? void 0 : P.endColumn) != null ? k : 0) < ((U = M == null ? void 0 : M.startColumn) != null ? U : 0) ? R = t.left : ie && a % 2 === 1 && t.scrollToViewportPos({ viewportScrollX: 0 }); else if (ne === pe) { let ve = !1, G = !1; ne === z.VIEW_MAIN_LEFT_TOP ? (ve = !0, G = !0) : ne === z.VIEW_MAIN_TOP ? G = !0 : ne === z.VIEW_MAIN_LEFT && (ve = !0), ((V = P == null ? void 0 : P.endRow) != null ? V : 0) > ((N = M == null ? void 0 : M.startRow) != null ? N : 0) && (G = !1), ((X = P == null ? void 0 : P.endColumn) != null ? X : 0) > ((Y = M == null ? void 0 : M.startColumn) != null ? Y : 0) && (ve = !1), ve && (R = t.left), G && (I = t.top); } else { const ve = { x: m.scrollX, y: m.scrollY }, G = { x: E.scrollX, y: E.scrollY }, J = ve.x !== G.x && ie && a % 2 === 1, le = ve.y !== G.y && he && c % 2 === 1; (J || le) && (t.scrollToBarPos({ x: J ? ve.x : void 0, y: le ? ve.y : void 0 }), J || (R = t.left), le || (I = t.top)), (ne === z.VIEW_MAIN_LEFT_TOP && pe === z.VIEW_MAIN_LEFT || pe === z.VIEW_MAIN_LEFT_TOP && ne === z.VIEW_MAIN_LEFT) && (R = t.left), (ne === z.VIEW_MAIN_LEFT_TOP && pe === z.VIEW_MAIN_TOP || pe === z.VIEW_MAIN_LEFT_TOP && ne === z.VIEW_MAIN_TOP) && (I = t.top); } d = v, u = _; } this._scrollTimer.scrolling(R, I, () => { this._movingHandler(v, _, n, s); }); }); } /** @deprecated Use the function `attachSelectionWithCoord` instead`. */ attachSelectionWithCoord(t) { return Pt(t, this._skeleton); } /** @deprecated Use the function `attachPrimaryWithCoord` instead`. */ attachPrimaryWithCoord(t) { return xo(this._skeleton, t); } /** * @deprecated Please use `getCellWithCoordByOffset` instead. */ getSelectionCellByPosition(t, n) { return this.getCellWithCoordByOffset(t, n); } getCellWithCoordByOffset(t, n, s) { const i = this._scene, o = s != null ? s : this._skeleton, l = i.getViewportScrollXY(i.getViewport(z.VIEW_MAIN)), { scaleX: a, scaleY: c } = i.getAncestorScale(); return o.getCellWithCoordByOffset(t, n, a, c, l); } /** * When mousedown and mouseup need to go to the coordination and undo stack, when mousemove does not need to go to the coordination and undo stack */ _movingHandler(t, n, s, i) { var R, I, y, M, P; const o = this._skeleton, l = this._scene, [a, c] = o.getLocation(), d = { startRow: (R = s == null ? void 0 : s.model.startRow) != null ? R : -1, endRow: (I = s == null ? void 0 : s.model.endRow) != null ? I : -1, startColumn: (y = s == null ? void 0 : s.model.startColumn) != null ? y : -1, endColumn: (M = s == null ? void 0 : s.model.endColumn) != null ? M : -1, unitId: a, sheetId: c }, u = l.getViewport(z.VIEW_MAIN), h = (P = this._getViewportByCell(d.endRow, d.endColumn)) != null ? P : u, m = l.getScrollXYInfoByViewport( Oe.FromArray([this._startViewportPosX, this._startViewportPosY]), h ), { scaleX: f, scaleY: g } = l.getAncestorScale(); i === j.ROW ? t = Number.POSITIVE_INFINITY : i === j.COLUMN && (n = Number.POSITIVE_INFINITY); const p = this._skeleton.getCellByOffset(t, n, f, g, m); if (!p) return; let S = { startRow: Math.min(p.startRow, this._startRangeWhenPointerDown.startRow), startColumn: Math.min(p.startColumn, this._startRangeWhenPointerDown.startColumn), endRow: Math.max(p.endRow, this._startRangeWhenPointerDown.endRow), endColumn: Math.max(p.endColumn, this._startRangeWhenPointerDown.endColumn) }; this._shouldDetectMergedCells && (S = o.expandRangeByMerge(S)); const v = Pt({ range: S, primary: void 0, style: null }, o); v.rangeWithCoord.unitId = a, v.rangeWithCoord.sheetId = c, v.rangeWithCoord.rangeType = i; const _ = d.startRow !== S.startRow || d.startColumn !== S.startColumn || d.endRow !== S.endRow || d.endColumn !== S.endColumn; s != null && _ && (s.updateRangeBySelectionWithCoord(v), this._selectionMoving$.next(this.getSelectionDataWithStyle())); } _clearUpdatingListeners() { var n, s, i, o, l; this._scene.enableObjectsEvent(), (n = this._scenePointerMoveSub) == null || n.unsubscribe(), this._scenePointerMoveSub = null, (s = this._scenePointerUpSub) == null || s.unsubscribe(), this._scenePointerUpSub = null, (i = this._cancelDownSubscription) == null || i.unsubscribe(), this._cancelDownSubscription = null, (o = this._cancelUpSubscription) == null || o.unsubscribe(), this._cancelUpSubscription = null, (l = this._scrollTimer) == null || l.dispose(); } _addEndingListeners() { var s, i, o; const t = this._scene, n = (s = t.getEngine()) == null ? void 0 : s.activeScene; !n || n === t || ((i = this._cancelDownSubscription) == null || i.unsubscribe(), this._cancelDownSubscription = null, (o = this._cancelUpSubscription) == null || o.unsubscribe(), this._cancelUpSubscription = null, this._cancelDownSubscription = n.onPointerDown$.subscribeEvent(() => this._clearUpdatingListeners()), this._cancelUpSubscription = n.onPointerUp$.subscribeEvent(() => this._clearUpdatingListeners())); } /** * Get visible selection range & coord by offset on viewport. Nearly same as skeleton.getCellWithCoordByOffset * Returning selection is only one cell. primary and range are same cell. * * visible selection range means getCellWithCoordByOffset needs first matched row/col in rowHeightAccumulation & colWidthAccumulation. * Original name: _getCellRangeByCursorPosition * * @param offsetX position X in viewport. * @param offsetY * @param scaleX * @param scaleY * @param scrollXY * @returns {Nullable} selection range with coord. */ _getSelectionWithCoordByOffset(t, n, s, i, o) { const l = this._skeleton; if (l == null) return null; if (this._shouldDetectMergedCells) { const S = l == null ? void 0 : l.getCellWithCoordByOffset( t, n, s, i, o, { firstMatch: !0 } ); if (!S) return; const b = bo(S); return { primaryWithCoord: S, rangeWithCoord: b }; } const { row: a, column: c } = l.getCellIndexByOffset(t, n, s, i, o), d = l.getNoMergeCellPositionByIndex(a, c), { startX: u, startY: h, endX: m, endY: f } = d, g = { startY: h, endY: f, startX: u, endX: m, startRow: a, endRow: a, startColumn: c, endColumn: c }; return { primaryWithCoord: { mergeInfo: g, actualRow: a, actualColumn: c, isMerged: !1, isMergedMainCell: !1, startY: h, endY: f, startX: u, endX: m }, rangeWithCoord: g }; } _checkClearPreviousControls(t) { this.getSelectionControls().length !== 0 && (!t.ctrlKey && !t.shiftKey && !this._remainLastEnabled || this._singleSelectionEnabled && !t.shiftKey) && this._clearAllSelectionControls(); } _makeSelectionByTwoCells(t, n, s, i, o) { const { actualRow: l, actualColumn: a, mergeInfo: c } = t; this._startRangeWhenPointerDown = { ...t.mergeInfo }; const d = Math.min(l, n.startRow, c.startRow), u = Math.max(l, n.endRow, c.endRow), h = Math.min(a, n.startColumn, c.startColumn), m = Math.max(a, n.endColumn, c.endColumn), g = { range: s.expandRangeByMerge({ startRow: d, startColumn: h, endRow: u, endColumn: m }), primary: null, style: null }, p = Pt(g, s); o.updateRangeBySelectionWithCoord(p); } isSelectionEnabled() { return this.contextService.getContextValue(Yr); } isSelectionDisabled() { return this.contextService.getContextValue(Yr) === !1; } inRefSelectionMode() { return this.contextService.getContextValue(Js); } } function tf(r) { return { range: { startRow: 0, startColumn: 0, endRow: r.getRowCount() - 1, endColumn: r.getColumnCount() - 1, rangeType: j.ALL }, primary: Od(r).primary, style: null }; } function Od(r) { return bv(r, { startRow: 0, startColumn: 0, endRow: 0, endColumn: 0 }); } function bv(r, e) { const t = r.worksheet.getCellInfoInMergeData(e.startRow, e.startColumn), n = r.worksheet.getCellInfoInMergeData(e.endRow, e.endColumn); return { range: { startRow: t.startRow, startColumn: t.startColumn, endRow: n.endRow, endColumn: n.endColumn, rangeType: j.NORMAL }, primary: { actualRow: t.startRow, actualColumn: t.startColumn, startRow: t.startRow, startColumn: t.startColumn, endRow: t.endRow, endColumn: t.endColumn, isMerged: t.isMerged, isMergedMainCell: t.isMergedMainCell }, style: null }; } var _v = Object.defineProperty, wv = Object.getOwnPropertyDescriptor, Rv = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? wv(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && _v(e, t, s), s; }, lr = (r, e) => (t, n) => e(t, n, r); let yc = class extends ce { constructor(e, t, n, s, i, o, l) { super(); w(this, "_editorUnitId", Le); w(this, "_editorIsDirty", !1); w(this, "_isDisabled", !1); w(this, "_visible", { visible: !1, eventType: Xe.Dblclick, unitId: "" }); w(this, "_currentEditCell", null); w(this, "_currentEditCellState", null); w(this, "_currentEditCellLayout", null); // TODO: @weird94 this should split into to subjects, documentDataModel & position w(this, "_currentEditCellState$", new Me(null)); w(this, "currentEditCellState$", this._currentEditCellState$.asObservable()); w(this, "_currentEditCellLayout$", new Me(null)); w(this, "currentEditCellLayout$", this._currentEditCellLayout$.asObservable()); w(this, "currentEditCell$", this._currentEditCellState$.pipe( We((e) => this._currentEditCellLayout$.pipe(_e((t) => e && t ? { ...e, ...t } : null))) )); w(this, "_visible$", new Me(this._visible)); w(this, "visible$", this._visible$.asObservable()); w(this, "_afterVisible$", new Me(this._visible)); w(this, "afterVisible$", this._afterVisible$.asObservable()); w(this, "_forceKeepVisible$", new Me(!1)); w(this, "forceKeepVisible$", this._forceKeepVisible$.asObservable()); this._sheetInterceptorService = e, this._renderManagerService = t, this._themeService = n, this._univerInstanceService = s, this._editorService = i, this._refSelectionsService = o, this._contextService = l, this.disposeWithMe(Ae(() => { this._currentEditCellState$.complete(), this._currentEditCell = null; })), this._univerInstanceService.getTypeOfUnitDisposed$(O.UNIVER_SHEET).subscribe((a) => { var c; a.getUnitId() === ((c = this._currentEditCellState) == null ? void 0 : c.unitId) && this._clearCurrentEditCellState(); }); } refreshEditCellState() { const e = this.getLatestEditCellState(); if (!e) { this._currentEditCellState = null, this._currentEditCellLayout = null, this._currentEditCellState$.next(null), this._currentEditCellLayout$.next(null); return; } const { position: t, scaleX: n, scaleY: s, canvasOffset: i, ...o } = e; this._currentEditCellState = o, this._currentEditCellLayout = { position: t, scaleX: n, scaleY: s, canvasOffset: i }, this._currentEditCellState$.next(this._currentEditCellState), this._currentEditCellLayout$.next(this._currentEditCellLayout); } refreshEditCellPosition(e) { var R; const t = this._currentEditCell; if (t == null) return; const n = this._renderManagerService.getCurrentTypeOfRenderer(O.UNIVER_SHEET); if (!n) return; const s = (R = n.with(me).getWorksheetSkeleton(t.sheetId)) == null ? void 0 : R.skeleton, i = n.with(dt); if (!s || !this._currentEditCellState) return; const { primary: o, unitId: l, sheetId: a, scene: c, engine: d } = t, u = xo(s, o); if (u == null) return; const h = bo(u), m = ru(d); let { startX: f, startY: g, endX: p, endY: S } = h; const { scaleX: b, scaleY: v } = c.getAncestorScale(), _ = c.getViewportScrollXY(i.getViewPort()); f = s.convertTransformToOffsetX(f, b, _), g = s.convertTransformToOffsetY(g, v, _), p = s.convertTransformToOffsetX(p, b, _), S = s.convertTransformToOffsetY(S, v, _), e && this._currentEditCellLayout && (p = p - f + this._currentEditCellLayout.position.startX, S = S - g + this._currentEditCellLayout.position.startY, f = this._currentEditCellLayout.position.startX, g = this._currentEditCellLayout.position.startY), this._currentEditCellLayout = { position: { startX: f, startY: g, endX: p, endY: S }, canvasOffset: m, scaleX: b, scaleY: v }, this._currentEditCellLayout$.next(this._currentEditCellLayout); } setEditCell(e) { this._currentEditCell = e, this._editorService.getFocusEditor() || (this._editorService.focus(Le), this._contextService.setContextValue(Je, !1), this._contextService.setContextValue(Sl, !1)); const t = this.getLatestEditCellState(); if (!t) { this._currentEditCellState = t, this._currentEditCellLayout = t, this._currentEditCellState$.next(t), this._currentEditCellLayout$.next(t); return; } const { position: n, canvasOffset: s, scaleX: i, scaleY: o, ...l } = t; this._currentEditCellState = l, this._currentEditCellLayout = { position: n, canvasOffset: s, scaleX: i, scaleY: o }, this._currentEditCellState$.next(this._currentEditCellState), this._currentEditCellLayout$.next(this._currentEditCellLayout); } _clearCurrentEditCellState() { this._currentEditCellState = null, this._currentEditCellState$.next(null), this._currentEditCellLayout = null, this._currentEditCellLayout$.next(null); } getEditCellState() { return this._currentEditCellState == null || this._currentEditCellLayout == null ? null : { ...this._currentEditCellState, ...this._currentEditCellLayout }; } getEditCellLayout() { return this._currentEditCellLayout; } getEditLocation() { return this._currentEditCellState; } // eslint-disable-next-line max-lines-per-function getLatestEditCellState() { var A, H, x; const e = this._currentEditCell; if (e == null) return; const t = this._renderManagerService.getCurrentTypeOfRenderer(O.UNIVER_SHEET); if (!t) return; const n = t.with(me).getCurrentSkeleton(), s = t.with(dt); if (!n) return; const { primary: i, unitId: o, sheetId: l, scene: a, engine: c } = e, { startRow: d, startColumn: u } = i, h = xo(n, i); if (h == null) return; const m = bo(h), f = ru(c); let { startX: g, startY: p, endX: S, endY: b } = m; const { scaleX: v, scaleY: _ } = a.getAncestorScale(), R = a.getViewportScrollXY(s.getViewPort()); g = n.convertTransformToOffsetX(g, v, R), p = n.convertTransformToOffsetY(p, _, R), S = n.convertTransformToOffsetX(S, v, R), b = n.convertTransformToOffsetY(b, _, R); const I = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET), y = I.getActiveSheet(); if (!y) return; const M = { workbook: I, worksheet: y, unitId: I.getUnitId(), subUnitId: y.getSheetId(), row: d, col: u, origin: y.getCellRaw(d, u) }; let P; const E = this._sheetInterceptorService.writeCellInterceptor.fetchThroughInterceptors(AS)( y.getCell(d, u), M ); P = E && n.getCellDocumentModelWithFormula(E); const T = (A = P == null ? void 0 : P.documentModel) == null ? void 0 : A.documentStyle.renderConfig; if (T != null && (T.cellValueType = ln.STRING), !P || P.documentModel == null) { const k = n.getBlankCellDocumentModel(E); if (P != null) { const { verticalAlign: U, horizontalAlign: V, wrapStrategy: N, textRotation: X, fill: Y } = P, { centerAngle: ie, vertexAngle: he } = nd(X); k.documentModel.documentStyle.renderConfig = { ...T, verticalAlign: U, horizontalAlign: V, wrapStrategy: N, background: { rgb: Y }, centerAngle: ie, vertexAngle: he }; } P = k; } if (P.fill = P.fill || "#fff", (H = P.documentModel) == null || H.setZoomRatio(Math.max(v, _)), (E == null ? void 0 : E.isInArrayFormulaRange) === !0) { const k = (x = P.documentModel) == null ? void 0 : x.getBody(); k && (k.textRuns = [ { st: 0, ed: k.dataStream.length - 2, ts: { cl: { rgb: this._themeService.getCurrentTheme().textColorSecondary } } } ]); } return { position: { startX: g, startY: p, endX: S, endY: b }, scaleX: v, scaleY: _, canvasOffset: f, row: d, column: u, unitId: o, sheetId: l, documentLayoutObject: P, editorUnitId: this._editorUnitId, isInArrayFormulaRange: E == null ? void 0 : E.isInArrayFormulaRange }; } getCurrentEditorId() { return this._editorUnitId; } changeVisible(e) { this._visible = e, e.visible && (this._editorIsDirty = !1), this._visible$.next(this._visible), this._afterVisible$.next(this._visible); } isVisible() { return this._visible; } enableForceKeepVisible() { this._forceKeepVisible$.next(!0); } disableForceKeepVisible() { this._forceKeepVisible$.next(!1); } isForceKeepVisible() { return this._forceKeepVisible$.getValue(); } changeEditorDirty(e) { this._editorIsDirty = e; } getEditorDirty() { return this._editorIsDirty; } }; yc = Rv([ lr(0, D(Ln)), lr(1, Ce), lr(2, D(kt)), lr(3, L), lr(4, Ss), lr(5, El), lr(6, Ne) ], yc); const tt = gn("univer.sheet-editor-bridge.service"), Et = { id: "sheet.operation.set-cell-edit-visible", type: K.OPERATION, handler: (r, e) => e ? (r.get(tt).changeVisible(e), !0) : !1 }, Wl = { id: "sheet.operation.set-cell-edit-visible-f2", type: K.OPERATION, handler: (r, e) => { const t = r.get(F), s = r.get(L).getCurrentUnitForType(O.UNIVER_SHEET); return s ? (t.syncExecuteCommand(Et.id, { ...e, unitId: s.getUnitId() }), !0) : !1; } }, cs = { id: "sheet.operation.set-cell-edit-visible-arrow", type: K.OPERATION, handler: () => !0 }, Li = { id: "sheet.command.change-zoom-ratio", type: K.COMMAND, handler: (r, e) => { if (!e) return !1; const t = r.get(L), n = Ue(t); if (!n) return !1; const { worksheet: s, subUnitId: i, unitId: o } = n, { delta: l, reset: a } = e; let c = a ? 100 : Math.round((s.getConfig().zoomRatio + l) * 100); c = Math.max(_c[0], c), c = Math.min(_c[1], c); const d = c / 100, h = r.get(tt).isVisible(); return (h.unitId === o || h.unitId === Te) && h.visible ? !1 : r.get(F).executeCommand($t.id, { unitId: o, subUnitId: i, zoomRatio: d }); } }, Wi = { id: "sheet.command.set-zoom-ratio", type: K.COMMAND, handler: async (r, e) => { if (!e) return !1; const { unitId: t, subUnitId: n, zoomRatio: s } = e, o = r.get(tt).isVisible(); return (o.unitId === t || o.unitId === Te) && o.visible ? !1 : r.get(F).executeCommand($t.id, { unitId: t, subUnitId: n, zoomRatio: s }); } }; function Iv(r) { return typeof r.isMainScene > "u"; } function pn(r, e) { const t = r instanceof Vp ? r : r.getCurrentUnitForType(O.UNIVER_SHEET); if (!t) return null; const n = t.getUnitId(); let s, i, o, l; if (Iv(e)) { const h = e.getRenderById(n); if (h == null) return null; s = h.components, s = h.components, i = h.mainComponent, o = h.scene, l = h.engine; } else s = e.components, i = e.mainComponent, o = e.scene, l = e.engine; if (!s || !i) return null; const a = i, c = s.get(qe.ROW), d = s.get(qe.COLUMN), u = s.get(qe.LEFT_TOP); return { spreadsheet: a, spreadsheetRowHeader: c, spreadsheetColumnHeader: d, spreadsheetLeftTopPlaceholder: u, scene: o, engine: l }; } function Nu(r, e, t, n) { const { startX: s, startY: i, endX: o, endY: l } = n.getCellWithCoordByIndex(r, e); return { startX: s, startY: i, endX: o, endY: l }; } function Nn(r, e, t, n, s, i) { const o = t.getCoordRelativeToViewport(Oe.FromArray([r, e])), { x: l, y: a } = o, c = t.getScrollXYInfoByViewport(o, s), { scaleX: d, scaleY: u } = t.getAncestorScale(), h = n.getCellIndexByOffset( l, a, d, u, c, { closeFirst: i } ), { row: m, column: f } = h, g = n.getNoMergeCellPositionByIndex(m, f), { startX: p, startY: S, endX: b, endY: v } = g; return { startX: p, startY: S, endX: b, endY: v, row: m, column: f }; } function fo(r, e, t, n) { const s = t.getCoordRelativeToViewport(Oe.FromArray([r, e])), i = t.getViewport(z.VIEW_MAIN), o = t.getScrollXYInfoByViewport(s, i), { scaleX: l, scaleY: a } = t.getAncestorScale(), { x: c, y: d } = o, u = r / l + c, h = e / a + d; return { x: u, y: h }; } var yv = Object.defineProperty, Mv = Object.getOwnPropertyDescriptor, Pv = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? Mv(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && yv(e, t, s), s; }, Ji = (r, e) => (t, n) => e(t, n, r); let ii = class extends ce { constructor(r, e, t, n, s) { super(), this._context = r, this._sheetSkeletonManagerService = e, this._commandService = t, this._contextService = n, this._editorBridgeService = s, this._initSkeletonListener(), this._initZoomEventListener(); } updateZoom(r, e) { const t = this._context.unit.getSheetBySheetId(r); return t ? (t.getConfig().zoomRatio = e, t === this._context.unit.getActiveSheet() && this._updateViewZoom(e), !0) : !1; } _initZoomEventListener() { const r = this._getSheetObject().scene; this.disposeWithMe( r.onMouseWheel$.subscribeEvent((e) => { if (!e.ctrlKey || !this._contextService.getContextValue(Tt)) return; if (this._editorBridgeService) { const a = this._editorBridgeService.isVisible(); if ((a.unitId === this._context.unitId || a.unitId === Te) && a.visible) return; } const t = Math.abs(e.deltaX); let n = t < 40 ? 0.2 : t < 80 ? 0.4 : 0.2; n *= e.deltaY > 0 ? -1 : 1, r.scaleX < 1 && (n /= 2); const s = this._context.unit, i = s.getActiveSheet(); if (!i) return; const o = i.getZoomRatio(); let l = +Number.parseFloat(`${o + n}`).toFixed(1); l = l >= 4 ? 4 : l <= 0.1 ? 0.1 : l, this._commandService.executeCommand(Wi.id, { zoomRatio: Math.round(l * 10) / 10, unitId: s.getUnitId(), subUnitId: i.getSheetId() }), e.preventDefault(); }) ); } _initSkeletonListener() { this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeletonBefore$.subscribe((r) => { if (r == null) return; const t = this._context.unit.getActiveSheet(); if (!t) return; const n = t.getZoomRatio() || 1; this._updateViewZoom(n); })); } /** * Zoom scene, resize viewport and then setScrollInfo * @param zoomRatio */ _updateViewZoom(r) { const e = this._getSheetObject(); e == null || e.scene.scale(r, r), e == null || e.spreadsheet.makeForceDirty(); } _getSheetObject() { return pn(this._context.unit, this._context); } }; ii = Pv([ Ji(1, D(me)), Ji(2, F), Ji(3, Ne), Ji(4, Jc(tt)) ], ii); const $t = { id: "sheet.operation.set-zoom-ratio", type: K.OPERATION, handler: (r, e) => { const n = r.get(Ce).getRenderById(e.unitId); return n ? n.with(ii).updateZoom(e.subUnitId, e.zoomRatio) : !1; } }; var Ev = Object.defineProperty, Tv = Object.getOwnPropertyDescriptor, xv = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? Tv(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && Ev(e, t, s), s; }, ga = (r, e) => (t, n) => e(t, n, r); const Hu = "univer-sheet-main-canvas"; let Mr = class extends kn { constructor(e, t, n) { super(); w(this, "_skeletonChangeMutations", /* @__PURE__ */ new Set()); this._contextService = e, this._instanceSrv = t, this._renderManagerService = n, Promise.resolve().then(() => this._init()); } /** * Register a mutation id that will trigger the skeleton change. * * @param mutationId the id of the mutation * @returns a disposable to unregister the mutation */ registerSkeletonChangingMutations(e) { return this._skeletonChangeMutations.has(e) ? Ae(() => { }) : (this._skeletonChangeMutations.add(e), Ae(() => this._skeletonChangeMutations.delete(e))); } /** * Examine if a mutation would make the skeleton to change. */ checkMutationShouldTriggerRerender(e) { return this._skeletonChangeMutations.has(e); } _init() { this._initWorkbookListener(), this._initContextListener(); } _initWorkbookListener() { this._instanceSrv.getTypeOfUnitAdded$(O.UNIVER_SHEET).pipe(os(this.dispose$)).subscribe((e) => this._createRenderer(e)), this._instanceSrv.getAllUnitsForType(O.UNIVER_SHEET).forEach((e) => this._createRenderer(e)), this._instanceSrv.getTypeOfUnitDisposed$(O.UNIVER_SHEET).pipe(os(this.dispose$)).subscribe((e) => this._disposeRenderer(e)); } _createRenderer(e) { const t = e.getUnitId(); this._renderManagerService.created$.subscribe((n) => { n.unitId === t && (n.engine.getCanvas().setId(`${Hu}_${t}`), n.engine.getCanvas().getContext().setId(`${Hu}_${t}`)); }), this._renderManagerService.createRender(t), this._renderManagerService.setCurrent(t); } _disposeRenderer(e) { const t = e.getUnitId(); this._renderManagerService.removeRender(t); } _initContextListener() { this.disposeWithMe(this._contextService.subscribeContextValue$(iS).pipe(cn()).subscribe(() => { this._renderManagerService.getRenderAll().forEach((e) => { e.mainComponent instanceof Yh && e.mainComponent.makeForceDirty(!0); }); })); } }; Mr = xv([ ga(0, Ne), ga(1, L), ga(2, Ce) ], Mr); var Ov = Object.defineProperty, Av = Object.getOwnPropertyDescriptor, Nv = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? Av(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && Ov(e, t, s), s; }, ar = (r, e) => (t, n) => e(t, n, r); let Vo = class extends ce { constructor(e, t, n, s, i, o, l) { super(); w(this, "_beforeApplyData", []); w(this, "_currentLocation", null); w(this, "_copyData", []); w(this, "_defaultHook"); this._univerInstanceService = e, this._commandService = t, this._autoFillService = n, this._editorBridgeService = s, this._renderManagerService = i, this._injector = o, this._sheetsRenderService = l, this._defaultHook = { id: "default", type: Gr.Default, priority: 0, onBeforeFillData: (a, c) => this._presetAndCacheData(a, c), onFillData: (a, c, d) => this._fillData(a, c, d) }, this._init(); } _init() { this._initDefaultHook(), this._onSelectionControlFillChanged(), this._initQuitListener(), this._initSkeletonChange(); } _initSkeletonChange() { this.disposeWithMe(this._sheetsRenderService.registerSkeletonChangingMutations(pr.id)); } _initDefaultHook() { this.disposeWithMe(this._autoFillService.addHook(this._defaultHook)); } _initQuitListener() { const e = [ Et.id, si.id, Ti.id, $t.id, et.id, tr.id, xi.id, Oi.id, Ai.id, Ni.id, Tl.id, xl.id, Qt.id, $s.id, Se.id ]; this.disposeWithMe(this._commandService.onCommandExecuted((t, n) => { var l, a; const s = n == null ? void 0 : n.fromCollab, i = n == null ? void 0 : n.fromSync, o = n == null ? void 0 : n.fromFormula; e.includes(t.id) && !s && !i && !o && t.params.trigger !== pr.id && t.params.trigger !== Ll.id && this._quit(), t.id === An.id && t.params.unitId === ((l = this._currentLocation) == null ? void 0 : l.unitId) && t.params.subUnitId === ((a = this._currentLocation) == null ? void 0 : a.subUnitId) && this._quit(); })), this.disposeWithMe(this._univerInstanceService.unitDisposed$.subscribe((t) => { var n; t.getUnitId() === ((n = this._currentLocation) == null ? void 0 : n.unitId) && this._quit(); })); } _quit() { this._currentLocation = null, this._beforeApplyData = [], this._copyData = [], this._autoFillService.setShowMenu(!1); } // eslint-disable-next-line max-lines-per-function _onSelectionControlFillChanged() { const e = new St(), t = (n) => { n.dispose(); const s = this._renderManagerService.getCurrentTypeOfRenderer(O.UNIVER_SHEET); if (!s) return; s.with(dt).getSelectionControls().forEach((l) => { n.add( Ae( l.selectionFilled$.subscribe((a) => { if (a == null || a.startColumn === -1 || a.startRow === -1 || a.endColumn === -1 || a.endRow === -1) return; const c = { startColumn: l.model.startColumn, endColumn: l.model.endColumn, startRow: l.model.startRow, endRow: l.model.endRow }, d = { startColumn: a.startColumn, endColumn: a.endColumn, startRow: a.startRow, endRow: a.endRow }; this._commandService.executeCommand(pr.id, { sourceRange: c, targetRange: d }); }) ) ), n.add( Ae( l.fillControl.onDblclick$.subscribeEvent(() => { const a = { startColumn: l.model.startColumn, endColumn: l.model.endColumn, startRow: l.model.startRow, endRow: l.model.endRow }; this._handleDbClickFill(a); }) ) ), n.add( Ae( l.fillControl.onPointerDown$.subscribeEvent(() => { this._editorBridgeService.isVisible().visible && this._editorBridgeService.changeVisible({ visible: !1, eventType: Xe.PointerDown, unitId: s.unitId }); }) ) ); }); }; t(e), this.disposeWithMe( this._commandService.onCommandExecuted((n) => { n.id === He.id && t(e); }) ); } _handleDbClickFill(e) { const t = this._detectFillRange(e); t.endRow <= e.endRow || this._commandService.executeCommand(pr.id, { sourceRange: e, targetRange: t }); } _detectFillRange(e) { var u, h, m, f, g, p; const { startRow: t, endRow: n, startColumn: s, endColumn: i } = e, o = (u = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET)) == null ? void 0 : u.getActiveSheet(); if (!o) return e; const l = o.getCellMatrix(), a = o.getMaxRows() - 1, c = o.getMaxColumns() - 1; let d = n; if (s > 0 && ((h = l.getValue(t, s - 1)) == null ? void 0 : h.v) != null) { let S = t; for (; ((m = l.getValue(S, s - 1)) == null ? void 0 : m.v) != null && S < a; ) S += 1; d = S - 1; } else if (i < c && ((f = l.getValue(n, i + 1)) == null ? void 0 : f.v) != null) { let S = t; for (; ((g = l.getValue(S, i + 1)) == null ? void 0 : g.v) != null && S < a; ) S += 1; d = S - 1; } for (let S = n + 1; S <= d; S++) for (let b = s; b <= i; b++) if (((p = l.getValue(S, b)) == null ? void 0 : p.v) != null) { d = S - 1; break; } return { startColumn: s, endColumn: i, startRow: t, endRow: d }; } // calc apply data according to copy data and direction _getApplyData(e, t, n, s, i, o = !0) { const l = [], a = Math.floor(n / t), c = n % t, d = this._autoFillService.getRules(); if (!o && i === ke.ONLY_FORMAT) return console.error("ERROR: only format can not be applied when hasStyle is false"), []; const u = {}; d.forEach((h) => { u[h.type] = []; }), d.forEach((h) => { const { type: m, applyFunctions: f = {} } = h, g = e[m]; g && g.forEach((p) => { const S = JC(p.index, c), b = p.index.length * a + S, v = this._applyFunctions( p, b, s, i, f, e ), _ = $C(t, n, p.index); u[m].push({ data: v, index: _ }); }); }); for (let h = 0; h < n; h++) d.forEach((m) => { const { type: f } = m, g = u[f]; for (let p = 0; p < g.length; p++) h in g[p].index && l.push(g[p].data[g[p].index[h]]); }); return l; } _applyFunctions(e, t, n, s, i, o) { const { data: l } = e, a = n === B.UP || n === B.LEFT; if (s === ke.COPY) { const c = i == null ? void 0 : i[ke.COPY]; return c ? c(e, t, n, o) : (a && l.reverse(), Rr(l, t)); } if (s === ke.SERIES) { const c = i == null ? void 0 : i[ke.SERIES]; return c ? c(e, t, n, o) : (a && l.reverse(), i != null && i[ke.COPY] ? i[ke.COPY](e, t, n, o) : Rr(l, t)); } if (s === ke.ONLY_FORMAT) { const c = i == null ? void 0 : i[ke.ONLY_FORMAT]; return c ? c(e, t, n, o) : ev(l, t); } } _getCopyData(e, t) { const n = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET).getActiveSheet(); if (!n) throw new Error("No active sheet found"); const s = n.getCellMatrix(), i = this._autoFillService.getRules(), o = [], l = t === B.DOWN || t === B.UP; let a, c; return l ? (a = e.cols, c = e.rows) : (a = e.rows, c = e.cols), a.forEach((d) => { const u = this._getEmptyCopyDataPiece(), h = { type: void 0, cellData: void 0 }; c.forEach((m) => { let f; l ? f = s.getValue(m, d) : f = s.getValue(d, m); const { type: g, isContinue: p } = i.find((S) => S.match(f, this._injector)) || Km; if (p(h, f)) { const S = u[g], b = S[S.length - 1]; b.data.push(f), b.index.push(m - c[0]); } else { const S = u[g]; S ? S.push({ data: [f], index: [m - c[0]] }) : u[g] = [ { data: [f], index: [m - c[0]] } ]; } h.type = g, h.cellData = f; }), o.push(u); }), o; } _getEmptyCopyDataPiece() { const e = {}; return this._autoFillService.getRules().forEach((t) => { e[t.type] = []; }), e; } _getMergeApplyData(e, t, n, s) { const i = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET).getActiveSheet(); if (!i) throw new Error("No active sheet found"); const o = []; for (let l = e.startRow; l <= e.endRow; l++) for (let a = e.startColumn; a <= e.endColumn; a++) { const { isMergedMainCell: c, startRow: d, startColumn: u, endRow: h, endColumn: m } = i.getCellInfoInMergeData(l, a); if (c) { if (n === B.DOWN) { let f = d + s, g = h + s; for (; g <= t.endRow; ) o.push({ startRow: f, startColumn: u, endRow: g, endColumn: m }), f += s, g += s; } else if (n === B.UP) { let f = d - s, g = h - s; for (; f >= t.startRow; ) o.push({ startRow: f, startColumn: u, endRow: g, endColumn: m }), f -= s, g -= s; } else if (n === B.RIGHT) { let f = u + s, g = m + s; for (; g <= t.endColumn; ) o.push({ startRow: d, startColumn: f, endRow: h, endColumn: g }), f += s, g += s; } else if (n === B.LEFT) { let f = u - s, g = m - s; for (; f >= t.startColumn; ) o.push({ startRow: d, startColumn: f, endRow: h, endColumn: g }), f -= s, g -= s; } } } return o; } _presetAndCacheData(e, t) { const { source: n, target: s } = e, i = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET).getActiveSheet(); if (!i) throw new Error("No active sheet found"); const o = i.getCellMatrix(), l = []; return s.rows.forEach((a) => { const c = []; s.cols.forEach((d) => { c.push(se.deepClone(o.getValue(a, d))); }), l.push(c); }), this._beforeApplyData = l, this._copyData = this._getCopyData(n, t), this._currentLocation = e, this._shouldDisableSeries(this._copyData) ? (this._autoFillService.setDisableApplyType(ke.SERIES, !0), ke.COPY) : (this._autoFillService.setDisableApplyType(ke.SERIES, !1), this._getPreferredApplyType(this._copyData)); } // auto fill entry // eslint-disable-next-line max-lines-per-function _fillData(e, t, n) { var A, H; const s = [], i = []; let o = !0; n === ke.NO_FORMAT && (o = !1, n = ke.SERIES); const { source: l, target: a, unitId: c, subUnitId: d } = e; if (!l || !a || t == null) return { undos: s, redos: i }; const u = wr(l), h = wr(a), { cols: m, rows: f } = a, { cols: g, rows: p } = l, S = this._copyData; let b; t === B.DOWN || t === B.UP ? b = p.length : b = g.length; const v = []; if (t === B.DOWN || t === B.UP) { const x = f.length, k = []; m.forEach((U, V) => { const N = S[V], X = this._getApplyData(N, b, x, t, n, o); k.push(X); }); for (let U = 0; U < k[0].length; U++) { const V = []; for (let N = 0; N < k.length; N++) V.push({ s: null, ...k[N][U] }); v.push(V); } } else { const x = m.length; f.forEach((k, U) => { const V = S[U], N = this._getApplyData(V, b, x, t, n, o), X = []; for (let Y = 0; Y < N.length; Y++) X.push({ s: null, ...N[Y] }); v.push(X); }); } let _ = []; const R = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET).getStyles(); if (o ? (_ = this._getMergeApplyData(u, h, t, b), v.forEach((x) => { x.forEach((k) => { k && R && R && (k.s = R.getStyleByCell(k)); }); })) : v.forEach((x, k) => { x.forEach((U, V) => { U && R && (U.s = R.getStyleByCell(this._beforeApplyData[k][V]) || null); }); }), n === ke.ONLY_FORMAT && v.forEach((x, k) => { x.forEach((U, V) => { if (U) { const N = this._beforeApplyData[k][V] || {}; U.f = N.f, U.si = N.si, U.t = N.t, U.v = N.v; } }); }), o) { const x = [], k = (H = (A = this._univerInstanceService.getUniverSheetInstance(c)) == null ? void 0 : A.getSheetBySheetId(d)) == null ? void 0 : H.getMergeData(); k && k.forEach((N) => { ae.intersects(N, h) && x.push(N); }); const U = { unitId: c, subUnitId: d, ranges: x }, V = this._injector.invoke( Ol, U ); x.length && (i.push({ id: Kt.id, params: U }), s.unshift({ id: Jt.id, params: V })); } const I = { subUnitId: d, unitId: c, cellValue: zC([a]) }, y = this._injector.invoke( en, I ); i.push({ id: Se.id, params: I }), s.unshift({ id: Se.id, params: y }); const M = new Ke(); f.forEach((x, k) => { m.forEach((U, V) => { v[k][V] && M.setValue(x, U, v[k][V]); }); }); const P = M.getMatrix(), E = { subUnitId: d, unitId: c, cellValue: P }, T = this._injector.invoke( en, E ); if (this._autoFillService.getActiveHooks().forEach((x) => { var k; (k = x.onBeforeSubmit) == null || k.call(x, e, t, n, P); }), s.unshift({ id: Se.id, params: T }), i.push({ id: Se.id, params: E }), _ != null && _.length) { const x = Al(_), k = { unitId: c, subUnitId: d, ranges: x }, U = this._injector.invoke( Nl, k ); s.unshift({ id: Kt.id, params: U }), i.push({ id: Jt.id, params: k }); } return { undos: s, redos: i }; } _shouldDisableSeries(e) { return e.every( (t) => Object.keys(t).every( (n) => { var s; return ((s = t[n]) == null ? void 0 : s.length) === 0 || [ut.OTHER, ut.FORMULA].includes(n); } ) ); } _getPreferredApplyType(e) { return e.every( (n) => Object.keys(n).every( (s) => { var i, o; return ((i = n[s]) == null ? void 0 : i.length) === 0 || ((o = n[s]) == null ? void 0 : o.length) === 1 && n[s][0].data.length === 1 && ut.NUMBER === s; } ) ) ? ke.COPY : ke.SERIES; } }; Vo = Nv([ ar(0, L), ar(1, F), ar(2, Hr), ar(3, tt), ar(4, Ce), ar(5, D(vt)), ar(6, D(Mr)) ], Vo); var Hv = Object.defineProperty, Vv = Object.getOwnPropertyDescriptor, kv = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? Vv(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && Hv(e, t, s), s; }, pa = (r, e) => (t, n) => e(t, n, r); let ko = class extends ce { constructor(e, t, n, s) { super(); w(this, "_enterActiveRender"); this._context = e, this._sheetSkeletonManagerService = t, this._renderManagerService = n, this._permissionService = s, this._initEventBinding(); } // eslint-disable-next-line max-lines-per-function _initEventBinding() { const e = new St(), t = this._context.unit, n = (s) => { if (e.dispose(), !s) return; const i = this._context.unitId, { skeleton: o } = s, l = this._renderManagerService.getRenderById(i); if (l && l.mainComponent) { const a = l.mainComponent, c = (h) => { const { offsetX: m, offsetY: f } = h, g = l.scene, p = t.getActiveSheet(); if (!p) return; const S = g.getActiveViewportByCoord( Oe.FromArray([m, f]) ); if (!S) return; const { scaleX: b, scaleY: v } = g.getAncestorScale(), _ = { x: S.viewportScrollX, y: S.viewportScrollY }, R = o.getCellIndexByOffset(m, f, b, v, _), I = o.worksheet.getMergedCell(R.row, R.column), y = { actualRow: I ? I.startRow : R.row, actualCol: I ? I.startColumn : R.column, mergeCell: I, row: R.row, col: R.column }; if (!y || !o) return; const M = p.getCell(y.actualRow, y.actualCol); if (!M) return; const P = M.customRender; if (!(P != null && P.length)) return; const E = y.actualRow, T = y.actualCol, A = P.sort(kp), H = p.getSheetId(), x = { data: M, style: o.getsStyles().getStyleByCell(M), primaryWithCoord: o.getCellWithCoordByIndex(y.actualRow, y.actualCol), unitId: i, subUnitId: H, row: E, col: T, workbook: t, worksheet: p }, k = { x: _.x + m / b, y: _.y + f / v }, U = A.find((V) => { var N; return (N = V.isHit) == null ? void 0 : N.call(V, k, x); }); if (U) return [U, x]; }, d = a.onPointerDown$.subscribeEvent((h) => { var f, g, p, S; const m = c(h); if (m) { const [b, v] = m, { row: _, col: R, worksheet: I, unitId: y, subUnitId: M } = v; if (!((f = this._permissionService.composePermission( [new q(y).id, new ee(y, M).id] )) == null ? void 0 : f.every((T) => T.value))) return !1; const E = (p = (g = I.getCell(_, R)) == null ? void 0 : g.selectionProtection) == null ? void 0 : p[0]; if ((E == null ? void 0 : E[ad.Edit]) === !1) return !1; (S = b.onPointerDown) == null || S.call(b, v, h); } }), u = Hh(a.onPointerMove$).pipe(tm(30)).subscribe((h) => { var f, g, p, S, b, v; const m = c(h); if (m) { const [_, R] = m; this._enterActiveRender ? this._enterActiveRender.render !== _ && ((g = (f = this._enterActiveRender.render).onPointerLeave) == null || g.call(f, this._enterActiveRender.cellContext, h), this._enterActiveRender = { render: _, cellContext: R }, (p = _.onPointerEnter) == null || p.call(_, R, h)) : (this._enterActiveRender = { render: _, cellContext: R }, (S = _.onPointerEnter) == null || S.call(_, R, h)); } else this._enterActiveRender && ((v = (b = this._enterActiveRender.render).onPointerLeave) == null || v.call(b, this._enterActiveRender.cellContext, h), this._enterActiveRender = null); }); d && e.add(d), u && e.add(u); } }; this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe(n)), n(this._sheetSkeletonManagerService.getCurrent()), this.disposeWithMe(e); } }; ko = kv([ pa(1, D(me)), pa(2, Ce), pa(3, $e) ], ko); class Ad extends ce { constructor() { super(...arguments); w(this, "rangesStack", []); w(this, "selectedRangeWorksheet", ""); } } var Dv = Object.defineProperty, Lv = Object.getOwnPropertyDescriptor, Wv = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? Lv(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && Dv(e, t, s), s; }, Vu = (r, e) => (t, n) => e(t, n, r); let ds = class { constructor(r, e) { w(this, "_current", null); w(this, "_shortcutParam", []); this._univerInstanceService = r, this._localeService = e; } dispose() { this._shortcutParam = []; } getCurrentBySearch(r) { return this._getCurrentBySearch(r); } getCurrent() { return this._getCurrentBySearch(this._current); } addOrUpdate(r) { const e = this._getCurrentBySearch({ unitId: r.unitId, sheetId: r.sheetId, keycode: r.keycode }); if (e != null) { const t = this._shortcutParam.indexOf(e); this._shortcutParam.splice(t, 1); } return this._shortcutParam.push(r), e; } remove(r) { if (r == null) return; const e = this._getCurrentBySearch(r); if (e == null) return; const t = this._shortcutParam.indexOf(e); return this._shortcutParam.splice(t, 1)[0]; } _getCurrentBySearch(r) { return r == null ? void 0 : this._shortcutParam.find( (t) => t.unitId === r.unitId && t.sheetId === r.sheetId && t.keycode === r.keycode ); } }; ds = Wv([ Vu(0, L), Vu(1, D(Ee)) ], ds); var Bl = /* @__PURE__ */ ((r) => (r.MergeAll = "mergeAll", r.MergeVertical = "mergeVertical", r.MergeHorizontal = "mergeHorizontal", r))(Bl || {}); function Qn(r, e, t, n, s = !0, i = 1, o = !0) { let l = { ...r }; n == null && (n = { startRow: 0, endRow: t.getRowCount() - 1, startColumn: 0, endColumn: t.getColumnCount() - 1 }); let a; switch (e) { case B.UP: for (a = r.startRow - i; a > -1 && !t.getRowVisible(a); ) a -= 1; a >= n.startRow ? (l.startRow = a, l.endRow = a) : o && (l.startRow = n.endRow, l.endRow = n.endRow, s && (l = Qn(l, B.LEFT, t, n, !1))); break; case B.DOWN: for (a = r.endRow + i; a < t.getRowCount() && !t.getRowVisible(a); ) a += 1; a <= n.endRow ? (l.startRow = a, l.endRow = a) : o && (l.startRow = n.startRow, l.endRow = n.startRow, s && (l = Qn(l, B.RIGHT, t, n, !1))); break; case B.LEFT: for (a = r.startColumn - i; a > -1 && !t.getColVisible(a); ) a -= 1; a >= n.startColumn ? (l.startColumn = a, l.endColumn = a) : o && (l.startColumn = n.endColumn, l.endColumn = n.endColumn, s && (l = Qn(l, B.UP, t, n, !1))); break; case B.RIGHT: for (a = r.endColumn + i; a < t.getColumnCount() && !t.getColVisible(a); ) a += 1; a <= n.endColumn ? (l.startColumn = a, l.endColumn = a) : o && (l.startColumn = n.startColumn, l.endColumn = n.startColumn, s && (l = Qn(l, B.DOWN, t, n, !1))); break; } return l; } function Nd(r, e, t) { const n = { ...r }, { startRow: s, startColumn: i, endRow: o, endColumn: l } = oi(r, e, t); let a = Os(t, s, i, o, l).hasValue, c = !0, d = !0; for (; d; ) { if (B.UP === e) { let u = n.startRow - 1; for (; u > -1 && !t.getRowVisible(u); ) u -= 1; if (u === -1) { d = !1; break; } const { hasValue: h, matrix: m } = Os( t, u, n.startColumn, u, n.endColumn ); if (a && !h && !c) { d = !1; break; } else { if (m.getLength() !== 0) { let f = u; m.forValue((g) => { f = Math.min(g, f); }), n.startRow = f; } else n.startRow = u; if (n.endRow = n.startRow, !a && h) { d = !1; break; } a = h, c = !1; } } if (B.DOWN === e) { let u = n.endRow + 1; for (; u < t.getRowCount() && !t.getRowVisible(u); ) u += 1; if (u === t.getRowCount()) { d = !1; break; } const { hasValue: h, matrix: m } = Os( t, u, n.startColumn, u, n.endColumn ); if (a && !h && !c) { d = !1; break; } else { if (m.getLength() !== 0) { let f = u; m.forValue((g, p, S) => { f = Math.max(g + (S.rowSpan || 1) - 1, f); }), n.endRow = f; } else n.endRow = u; if (n.startRow = n.endRow, !a && h) { d = !1; break; } a = h, c = !1; } } if (B.LEFT === e) { let u = n.startColumn - 1; for (; u > -1 && !t.getColVisible(u); ) u -= 1; if (u === -1) { d = !1; break; } const { hasValue: h, matrix: m } = Os( t, n.startRow, u, n.endRow, u ); if (a && !h && !c) { d = !1; break; } else { if (m.getLength() !== 0) { let f = u; m.forValue((g, p) => { f = Math.min(p, f); }), n.startColumn = f; } else n.startColumn = u; if (n.endColumn = n.startColumn, !a && h) { d = !1; break; } a = h, c = !1; } } if (B.RIGHT === e) { let u = n.endColumn + 1; for (; u < t.getColumnCount() && !t.getColVisible(u); ) u += 1; if (u === t.getColumnCount()) { d = !1; break; } const { hasValue: h, matrix: m } = Os( t, n.startRow, u, n.endRow, u ); if (a && !h && !c) { d = !1; break; } else { if (m.getLength() !== 0) { let f = u; m.forValue((g, p, S) => { f = Math.max(p + (S.colSpan || 1) - 1, f); }), n.endColumn = f; } else n.endColumn = u; if (n.startColumn = n.endColumn, !a && h) { d = !1; break; } a = h, c = !1; } } } return En(n, t, !0); } function nf(r, e, t) { return Qn(r, e, t, void 0, !1, 1, !1); } function Bv(r, e, t) { const n = Nd(r, e, t); return En(ae.union(n, r), t, !0); } function Fv(r, e, t) { const n = nf(r, e, t), s = { startRow: Math.min(r.startRow, n.startRow), startColumn: Math.min(r.startColumn, n.startColumn), endRow: Math.max(r.endRow, n.endRow), endColumn: Math.max(r.endColumn, n.endColumn) }; return En(ae.union(r, s), t); } function Uv(r, e, t, n) { const s = Vh(t), i = Nd(oi(r, s, n), t, n); return t === B.UP && i.startRow <= r.startRow ? En( { ...e, startColumn: r.startColumn, endColumn: r.endColumn }, n, !0 ) : t === B.DOWN && i.endRow >= r.endRow ? En( { ...e, startColumn: r.startColumn, endColumn: r.endColumn }, n, !0 ) : t === B.LEFT && i.startColumn <= r.startColumn ? En( { ...e, startRow: r.startRow, endRow: r.endRow }, n, !0 ) : t === B.RIGHT && i.endColumn >= r.endColumn ? En( { ...e, startRow: r.startRow, endRow: r.endRow }, n, !0 ) : ae.union(ae.clone(e), i); } function jv(r, e, t) { const n = Vh(e), s = oi(r, n, t), i = oi(r, e, t), o = nf(s, e, t); return En(ae.union(i, o), t, !1); } function ku(r) { return { startRow: 0, startColumn: 0, endRow: r.getRowCount() - 1, endColumn: r.getColumnCount() - 1, rangeType: j.ALL }; } function oi(r, e, t) { let n; switch (e) { case B.UP: n = { startRow: r.startRow, startColumn: r.startColumn, endRow: r.startRow, endColumn: r.endColumn, rangeType: j.NORMAL }; break; case B.DOWN: n = { startRow: r.endRow, startColumn: r.startColumn, endRow: r.endRow, endColumn: r.endColumn, rangeType: j.NORMAL }; break; case B.LEFT: n = { startRow: r.startRow, startColumn: r.startColumn, endRow: r.endRow, endColumn: r.startColumn, rangeType: j.NORMAL }; break; case B.RIGHT: n = { startRow: r.startRow, startColumn: r.endColumn, endRow: r.endRow, endColumn: r.endColumn, rangeType: j.NORMAL }; break; default: throw new Error("Invalid direction"); } return En(n, t, !1); } function Os(r, e, t, n, s) { let i = !1; const o = r.getMatrixWithMergedCells(e, t, n, s).forValue((l, a, c) => { if (zv(c)) return i = !0, !1; }); return { hasValue: i, matrix: o }; } function Mc(r, e, t) { const n = ae.clone(r); if (e == null) return n; switch (t) { case B.UP: case B.DOWN: n.startColumn = n.endColumn = e.actualColumn; break; case B.LEFT: case B.RIGHT: n.startRow = n.endRow = e.actualRow; break; } return n; } function Xv(r, e, t) { var l, a, c, d; const { primary: n, range: s } = r, i = ae.clone(s); switch (e) { case B.UP: case B.DOWN: i.startRow = (l = n == null ? void 0 : n.startRow) != null ? l : s.startRow, i.endRow = (a = n == null ? void 0 : n.endRow) != null ? a : s.startRow; break; case B.LEFT: case B.RIGHT: i.startColumn = (c = n == null ? void 0 : n.startColumn) != null ? c : s.startColumn, i.endColumn = (d = n == null ? void 0 : n.endColumn) != null ? d : s.startColumn; break; } const o = oi(i, e, t); switch (e) { case B.DOWN: return s.startRow < o.startRow; case B.UP: return s.endRow > o.endRow; case B.LEFT: return o.endColumn < s.endColumn; case B.RIGHT: return o.startColumn > s.startColumn; } } function rf(r, e) { let t = r[0].startRow, n = r[0].endRow; r.forEach((i) => { const { startRow: o, endRow: l } = i; t = Math.min(t, o), n = Math.max(n, l); }); const s = new Array(n - t + 1).fill(!1); return e.forEach((i) => { const { startRow: o, endRow: l } = i; for (let a = Math.max(o, t); a <= Math.min(l, n); a++) s[a - t] = !0; }), r.every((i) => { const { startRow: o, endRow: l } = i; for (let a = o; a <= l; a++) if (!s[a - t]) return !1; return !0; }); } function sf(r, e) { let t = r[0].startColumn, n = r[0].endColumn; r.forEach((i) => { const { startColumn: o, endColumn: l } = i; t = Math.min(t, o), n = Math.max(n, l); }); const s = new Array(n - t + 1).fill(!1); return e.forEach((i) => { const { startColumn: o, endColumn: l } = i; for (let a = Math.max(o, t); a <= Math.min(l, n); a++) s[a - t] = !0; }), r.every((i) => { const { startColumn: o, endColumn: l } = i; for (let a = o; a <= l; a++) if (!s[a - t]) return !1; return !0; }); } function Hd(r, e) { return e ? r === "mergeAll" ? e.filter((t) => !(t.startRow === t.endRow && t.startColumn === t.endColumn)) : r === "mergeVertical" ? e.filter((t) => t.startRow !== t.endRow) : r === "mergeHorizontal" ? e.filter((t) => t.startColumn !== t.endColumn) : e : null; } function zv(r) { return r.v !== void 0 && r.v !== null && r.v !== "" || r.p !== void 0; } var Bn = /* @__PURE__ */ ((r) => (r[r.moveStopeOne = 0] = "moveStopeOne", r[r.moveGap = 1] = "moveGap", r[r.moveStepPage = 2] = "moveStepPage", r[r.moveStepEnd = 3] = "moveStepEnd", r))(Bn || {}); const Lt = { id: "sheet.command.move-selection", type: K.COMMAND, handler: (r, e) => { if (!e) return !1; const t = Ue(r.get(L)); if (!t) return !1; const { workbook: n, worksheet: s } = t, i = Hi(r, e.fromCurrentSelection).getCurrentLastSelection(); if (!i) return !1; const { direction: o, jumpOver: l, extra: a } = e, { range: c, primary: d } = i, u = Mc(c, d, o), h = l === 1 ? Nd(u, o, s) : Qn(u, o, s), m = uo(h.startRow, h.startColumn, s); if (ae.equals(m, u)) return !1; const f = n.getUnitId(); r.get(ds).remove({ unitId: f, sheetId: s.getSheetId(), keycode: Z.TAB }); const g = [ { range: ae.clone(m), primary: { startRow: m.startRow, startColumn: m.startColumn, endRow: m.endRow, endColumn: m.endColumn, actualRow: h.startRow, actualColumn: h.startColumn, isMerged: m.isMerged, isMergedMainCell: m.startRow === h.startRow && m.startColumn === h.startColumn } } ]; return r.get(F).executeCommand(He.id, { unitId: n.getUnitId(), subUnitId: s.getSheetId(), selections: g, type: Xt.MOVE_END, extra: a }); } }, Fn = { id: "sheet.command.move-selection-enter-tab", type: K.COMMAND, // eslint-disable-next-line max-lines-per-function, complexity handler: (r, e) => { var k; if (!e) return !1; const t = Ue(r.get(L)); if (!t) return !1; const { workbook: n, worksheet: s } = t, i = Hi(r), { direction: o, keycode: l } = e, a = o === B.LEFT || o === B.UP, c = i.getCurrentSelections().concat(), d = c.findIndex((U) => U.primary), u = c[d]; if (!u) return !1; const h = a ? -1 : 1, m = d + h !== c.length ? c[d + h] : c[0], f = c.findIndex((U) => U === m), g = n.getUnitId(), p = s.getSheetId(); if (!u) return !1; const { range: S } = u, b = u.primary; let v = Mc(S, b, o); const _ = r.get(ds), R = _.getCurrentBySearch({ unitId: g, sheetId: p, keycode: Z.TAB }); let I; const { startRow: y, endRow: M, startColumn: P, endColumn: E } = S, T = a ? b.startRow === y && b.startColumn === P : b.endRow === M && b.endColumn === E; if (ae.equals(S, b)) { if (l === Z.TAB) R == null && _.addOrUpdate({ unitId: g, sheetId: p, keycode: Z.TAB, selection: u }); else { const N = R == null ? void 0 : R.selection; if (N != null) { const { range: X, primary: Y } = N; v = Mc(X, Y, o); } _.remove({ unitId: g, sheetId: p, keycode: Z.TAB }); } const U = Qn(v, o, s), V = uo(U.startRow, U.startColumn, s); if (ae.equals(V, v)) return !1; I = { range: ae.clone(V), primary: { startRow: V.startRow, startColumn: V.startColumn, endRow: V.endRow, endColumn: V.endColumn, actualRow: U.startRow, actualColumn: U.startColumn, isMerged: V.isMerged, isMergedMainCell: V.startRow === U.startRow && V.startColumn === U.startColumn } }; } else { _.remove({ unitId: g, sheetId: p, keycode: Z.TAB }); const U = se.deepClone(b), V = T ? m.range : Qn( { startRow: U.startRow, startColumn: U.startColumn, endRow: U.endRow, endColumn: U.endColumn }, o, s, { startRow: y, endRow: M, startColumn: P, endColumn: E } ), N = T && a, X = N ? uo(V.endRow, V.endColumn, s) : uo(V.startRow, V.startColumn, s); I = { range: T ? m.range : ae.clone(S), primary: { startRow: X.startRow, startColumn: X.startColumn, endRow: X.endRow, endColumn: X.endColumn, actualRow: N ? X.startRow : V.startRow, actualColumn: N ? X.startColumn : V.startColumn, isMerged: X.isMerged, isMergedMainCell: X.startRow === V.startRow && X.startColumn === V.startColumn }, style: T ? m.style : u.style }; } T ? (c[d].primary = null, c[f] = I, i.setSelections(g, p, [], Xt.MOVE_END)) : c[d] = I; const A = r.get(F).executeCommand(He.id, { unitId: g, subUnitId: p, type: Xt.MOVE_END, selections: c, extra: e.extra }), x = (k = r.get(Ce).getRenderById(g)) == null ? void 0 : k.with(dt); return x == null || x.refreshSelectionMoveEnd(), A; } }, Gt = { id: "sheet.command.expand-selection", type: K.COMMAND, handler: (r, e) => { if (!e) return !1; const t = Ue(r.get(L)); if (!t) return !1; const { worksheet: n, unitId: s, subUnitId: i } = t, o = Hi(r).getCurrentLastSelection(); if (!o) return !1; const { range: l, primary: a } = o, { jumpOver: c, direction: d, extra: u } = e, m = Xv(o, d, n) ? c === 1 ? Uv( l, { ...ae.clone(a), rangeType: j.NORMAL }, d, n ) : jv(l, d, n) : c === 1 ? Bv(l, d, n) : Fv(l, d, n); return m.rangeType = o.range.rangeType, ae.equals(m, l) ? !1 : r.get(F).syncExecuteCommand(He.id, { unitId: s, subUnitId: i, type: Xt.ONLY_SET, selections: [ { range: m, primary: a // this remains unchanged } ], extra: u }); } }, Vd = { id: "sheet.command.select-all", type: K.COMMAND, handler: async (r, e = { expandToGapFirst: !0, loop: !1 }) => { const t = Ue(r.get(L)); if (!t) return !1; const n = Hi(r).getCurrentLastSelection(); if (!n) return !1; const s = r.get(Ad), { worksheet: i, unitId: o, subUnitId: l } = t, a = `${o}|${l}`; a !== s.selectedRangeWorksheet && (s.rangesStack = [], s.selectedRangeWorksheet = a); const c = i.getMaxRows(), d = i.getMaxColumns(), { expandToGapFirst: u, loop: h } = e, { range: m, primary: f } = n, g = m.endColumn === d - 1 && m.endRow === c - 1 && m.startRow === 0 && m.startColumn === 0; s.rangesStack.some((S) => ae.equals(S, m)) || (s.rangesStack = [], s.rangesStack.push(m)); let p; if (g) if (h) { if (s.rangesStack.findIndex((b) => ae.equals(b, m)) !== s.rangesStack.length - 1) return !1; p = s.rangesStack[0]; } else return !1; else u ? (p = NS(m, { left: !0, right: !0, up: !0, down: !0 }, i), ae.equals(p, m) && (p = ku(i))) : p = ku(i); return s.rangesStack.some((S) => ae.equals(S, p)) || s.rangesStack.push(p), r.get(F).executeCommand(He.id, { unitId: o, subUnitId: l, selections: [ { range: p, primary: f // this remains unchanged } ] }); } }; var Yv = Object.defineProperty, Zv = Object.getOwnPropertyDescriptor, Gv = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? Zv(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && Yv(e, t, s), s; }, qv = (r, e) => (t, n) => e(t, n, r); let yt = class { constructor(r, e) { /** * a map holds all scroll info for each sheet */ w(this, "_scrollStateMap", /* @__PURE__ */ new Map()); /** * a subject for current sheet scrollInfo, no limit by viewport. */ w(this, "_rawScrollInfo$", new Me(null)); /** * a subject for current sheet scrollInfo ( events, ex wheel event and point events add deltaXY to rawScrollInfo$) */ w(this, "rawScrollInfo$", this._rawScrollInfo$.asObservable()); /** * a subject for current valid scrollInfo, viewport@_scrollCore would limit rawScrollInfo$ exclude negative value or over max value. * use this subject not rawScrollInfo$ when get scrolling state of viewport. * The value of this subject is the same as the value of onScrollAfter$ * */ w(this, "validViewportScrollInfo$", new Me(null)); /** * a subject for current valid scrollInfo, viewport@_scrollCore would limit rawScrollInfo$ exclude negative value or over max value. * use this subject not rawScrollInfo$ when get scrolling state of viewport. */ w(this, "_searchParamForScroll", null); this._context = r, this._sheetSkeletonManagerService = e; } dispose() { this._rawScrollInfo$.complete(); } setSearchParam(r) { this._searchParamForScroll = r; } setSearchParamAndRefresh(r) { this._searchParamForScroll = r, this._scrollStateNext(r); } getScrollStateByParam(r) { return this._getCurrentScroll(r); } getCurrentScrollState() { return this._getCurrentScroll(this._searchParamForScroll); } /** * Set scrollInfo by SetScrollOperation, call by ScrollCommand.id. * @param param */ setScrollInfoAndEmitEvent(r) { this._setScrollState(r), this._scrollStateNext(r); } /** * Set _scrollStateMap but no _scrollInfo$.next * @param scroll */ setScrollStateToCurrSheet(r) { this._searchParamForScroll != null && this._setScrollState({ ...this._searchParamForScroll, ...r }); } clear() { this._searchParamForScroll != null && this._clearByParamAndNotify(this._searchParamForScroll); } calcViewportScrollFromRowColOffset(r) { if (!r) return { viewportScrollX: 0, viewportScrollY: 0 }; let { sheetViewStartColumn: e, sheetViewStartRow: t, offsetX: n, offsetY: s } = r; t = t || 0, s = s || 0; const i = this._sheetSkeletonManagerService.getCurrentSkeleton(), o = (i == null ? void 0 : i.rowHeightAccumulation[t - 1]) || 0, a = ((i == null ? void 0 : i.columnWidthAccumulation[e - 1]) || 0) + n, c = o + s; return { viewportScrollX: a, viewportScrollY: c }; } _setScrollState(r) { const { unitId: e, sheetId: t, sheetViewStartColumn: n, sheetViewStartRow: s, offsetX: i, offsetY: o } = r; this._scrollStateMap.has(e) || this._scrollStateMap.set(e, /* @__PURE__ */ new Map()); const l = this._scrollStateMap.get(e), a = { sheetViewStartRow: s, sheetViewStartColumn: n, offsetX: i, offsetY: o }; l.set(t, a); } _clearByParamAndNotify(r) { this._setScrollState({ ...r, sheetViewStartRow: 0, sheetViewStartColumn: 0, offsetX: 0, offsetY: 0 }), this._scrollStateNext(r); } _getCurrentScroll(r) { var i; const e = { sheetViewStartRow: 0, sheetViewStartColumn: 0, offsetX: 0, offsetY: 0 }; if (r == null) return e; const { unitId: t, sheetId: n } = r; return ((i = this._scrollStateMap.get(t)) == null ? void 0 : i.get(n)) || e; } _scrollStateNext(r) { const e = this._getCurrentScroll(r); this._rawScrollInfo$.next(e); } }; yt = Gv([ qv(1, D(me)) ], yt); const dn = { id: "sheet.operation.set-scroll", type: K.OPERATION, handler: (r, e) => { if (!e) return !1; const { unitId: t, sheetId: n, offsetX: s, offsetY: i, sheetViewStartColumn: o, sheetViewStartRow: l } = e; return r.get(Ce).getRenderById(t).with(yt).setScrollInfoAndEmitEvent({ unitId: t, sheetId: n, offsetX: s, offsetY: i, sheetViewStartRow: l, sheetViewStartColumn: o }), !0; } }, li = { id: "sheet.command.set-scroll-relative", type: K.COMMAND, // offsetXY derived from mouse wheel event // this._commandService.executeCommand(SetScrollRelativeCommand.id, { offsetY }); handler: async (r, e) => { const t = r.get(F), n = r.get(L), s = r.get(Ce), i = Ue(n); if (!i) return !1; const { unitId: o, subUnitId: l } = i, c = s.getRenderById(o).with(yt).getCurrentScrollState(), { offsetX: d = 0, offsetY: u = 0 } = e || {}, { sheetViewStartRow: h = 0, sheetViewStartColumn: m = 0, offsetX: f = 0, offsetY: g = 0 } = c || {}; return t.executeCommand(dn.id, { unitId: o, sheetId: l, // why + ySplit? receiver - ySplit in scroll.operation.ts // sheetViewStartRow: sheetViewStartRow + ySplit, // sheetViewStartColumn: sheetViewStartColumn + xSplit, sheetViewStartRow: h, sheetViewStartColumn: m, offsetX: f + d, // currentOffsetX + offsetX may be negative or over max offsetY: g + u }); } }, un = { id: "sheet.command.scroll-view", type: K.COMMAND, handler: (r, e) => { if (!e) return !1; const t = r.get(L), n = r.get(Ce), s = Ue(t); if (!s) return !1; const { workbook: i, worksheet: o, unitId: l } = s, c = n.getRenderById(l).with(yt).getCurrentScrollState(); if (!o) return !1; const { sheetViewStartRow: d, sheetViewStartColumn: u, offsetX: h, offsetY: m } = e, { sheetViewStartColumn: f, sheetViewStartRow: g, offsetX: p, offsetY: S } = c || {}, { xSplit: b, ySplit: v } = s.worksheet.getConfig().freeze; return r.get(F).syncExecuteCommand(dn.id, { unitId: i.getUnitId(), sheetId: o.getSheetId(), // why + ySplit? receiver - ySplit in scroll.operation.ts // sheetViewStartRow: sheetViewStartRow + ySplit, // sheetViewStartColumn: sheetViewStartColumn + xSplit, sheetViewStartRow: d != null ? d : g != null ? g : 0 + v, sheetViewStartColumn: u != null ? u : f != null ? f : 0 + b, offsetX: h != null ? h : p, offsetY: m != null ? m : S }); } }, of = { id: "sheet.command.scroll-to-cell", type: K.COMMAND, handler: (r, e) => { const t = r.get(L); return r.get(Ce).getRenderById(t.getCurrentUnitForType(O.UNIVER_SHEET).getUnitId()).with(ai).scrollToRange(e.range, e.forceTop, e.forceLeft); } }, nE = { id: "sheet.command.scroll-view-reset", type: K.COMMAND, handler: async (r) => { const e = r.get(L), t = Ue(e); if (!t) return !1; const { subUnitId: n, unitId: s } = t; return r.get(F).executeCommand(dn.id, { unitId: s, sheetId: n, sheetViewStartRow: 0, sheetViewStartColumn: 0 }); } }; var Qv = Object.defineProperty, Kv = Object.getOwnPropertyDescriptor, Jv = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? Kv(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && Qv(e, t, s), s; }, Lr = (r, e) => (t, n) => e(t, n, r); const $v = [Lt.id, Fn.id], e1 = 3; let ai = class extends ce { constructor(r, e, t, n, s, i, o) { super(), this._context = r, this._injector = e, this._sheetSkeletonManagerService = t, this._contextService = n, this._commandService = s, this._renderManagerService = i, this._scrollManagerService = o, this._initCommandListener(), this._wheelEventListener(), this._scrollBarEventListener(), this._initSkeletonListener(); } _wheelEventListener() { const { scene: r } = this._context; if (!r) return; const e = r.getViewport(z.VIEW_MAIN); e && this.disposeWithMe( r.onMouseWheel$.subscribeEvent((t, n) => { if (t.ctrlKey || !this._contextService.getContextValue(Tt)) return; let s = 0, i = 0; const o = e.limitedScroll(); s = t.deltaX, t.shiftKey ? s = (t.deltaY || t.deltaX) * e1 : i = t.deltaY, this._commandService.executeCommand(li.id, { offsetX: s, offsetY: i }), this._context.scene.makeDirty(!0), o && !o.isLimitedX && !o.isLimitedY && (t.preventDefault(), r.getParent().classType === oS.SCENE_VIEWER && n.stopPropagation()), e.isWheelPreventDefaultX && e.isWheelPreventDefaultY && t.preventDefault(); }) ); } // eslint-disable-next-line max-lines-per-function _scrollBarEventListener() { const { scene: r } = this._context; if (r == null) return; const e = r.getViewport(z.VIEW_MAIN); e && (this.disposeWithMe( Ae( this._scrollManagerService.rawScrollInfo$.subscribe((t) => { var h; const n = (h = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : h.skeleton; if (!n) return; if (t == null) { e.scrollToViewportPos({ viewportScrollX: 0, viewportScrollY: 0 }); return; } const { sheetViewStartRow: s, sheetViewStartColumn: i, offsetX: o, offsetY: l } = t, { startX: a, startY: c } = n.getCellWithCoordByIndex( s, i, !1 ), d = a + o, u = c + l; e.scrollToViewportPos({ viewportScrollX: d, viewportScrollY: u }); }) ) ), this.disposeWithMe( // set scrollInfo, the event is triggered in viewport@_scrollToScrollbarPos e.onScrollAfter$.subscribeEvent((t) => { var f; const n = (f = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : f.skeleton; if (n == null || t.isTrigger === !1) return; const s = this._getSheetObject(); if (n == null || s == null) return; const { viewportScrollX: i, viewportScrollY: o, scrollX: l, scrollY: a } = t, { row: c, column: d, rowOffset: u, columnOffset: h } = n.getDecomposedOffset( i, o ), m = { sheetViewStartRow: c, sheetViewStartColumn: d, offsetX: h, offsetY: u }; this._scrollManagerService.setScrollStateToCurrSheet(m), this._scrollManagerService.validViewportScrollInfo$.next({ ...m, viewportScrollX: i, viewportScrollY: o, scrollX: l, scrollY: a }); }) ), this.disposeWithMe( // get scrollByBar event from viewport and exec ScrollCommand.id. e.onScrollByBar$.subscribeEvent((t) => { var u; const n = (u = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : u.skeleton; if (n == null || t.isTrigger === !1) return; const s = this._getSheetObject(); if (n == null || s == null) return; const { viewportScrollX: i = 0, viewportScrollY: o = 0 } = t, { row: l, column: a, rowOffset: c, columnOffset: d } = n.getDecomposedOffset( i, o ); this._commandService.executeCommand(un.id, { sheetViewStartRow: l, sheetViewStartColumn: a, offsetX: d, offsetY: c }); }) )); } _initSkeletonListener() { this.disposeWithMe(Ae( this._sheetSkeletonManagerService.currentSkeletonBefore$.subscribe((r) => { if (r == null) return; const e = { unitId: r.unitId, sheetId: r.sheetId }; this._scrollManagerService.setSearchParam(e); const t = this._getSheetObject(); if (!t) return; const s = t.scene.getViewport(z.VIEW_MAIN), i = this._scrollManagerService.getScrollStateByParam(e), { viewportScrollX: o, viewportScrollY: l } = this._scrollManagerService.calcViewportScrollFromRowColOffset(i); s && (i ? (s.viewportScrollX = o, s.viewportScrollY = l) : (s.viewportScrollX = 0, s.viewportScrollY = 0), this._updateSceneSize(r)); }) )); } scrollToRange(r, e, t) { let { endRow: n, endColumn: s, startColumn: i, startRow: o } = r; const l = this._getViewportBounding(); if (r.rangeType === j.ROW ? (i = 0, s = 0) : r.rangeType === j.COLUMN && (o = 0, n = 0), l && !e && !t) { const a = l.startRow > n ? o : n, c = l.startColumn > s ? i : s; return this._scrollToCell(a, c); } else return this._scrollToCell(o, i, e, t); } /** * Scroll spreadsheet(viewMain) to cell position. Based on the limitations of viewport and the number of rows and columns, you can only scroll to the maximum scrollable range. * * if column A ~ B is frozen. set second param to 0 would make viewMain start at column C. * set second param to 2 would make viewMain start at column E. * @param {number} row - Cell row * @param {number} column - Cell column * @returns {boolean} - true if scroll is successful */ scrollToCell(r, e) { const t = this._context.unit.getActiveSheet(), { ySplit: n, xSplit: s } = t.getFreeze(); return this._commandService.syncExecuteCommand(un.id, { sheetViewStartRow: r - n, sheetViewStartColumn: e - s, offsetX: 0, offsetY: 0 }); } _initCommandListener() { this.disposeWithMe(this._commandService.onCommandExecuted((r) => { if ($v.includes(r.id)) this._scrollToSelection(); else if (r.id === cd.id) { const e = r.params; this.scrollToRange(e); } else if (r.id === Gt.id) { const e = r.params; this._scrollToSelectionForExpand(e); } else r.id === He.id && r.params.reveal && this._scrollToSelection(); })); } _scrollToSelectionForExpand(r) { setTimeout(() => { const e = this._getSelectionsService().getCurrentLastSelection(); if (e == null) return; const { startRow: t, startColumn: n, endRow: s, endColumn: i } = e.range, o = this._getViewportBounding(); if (o == null) return; const { startRow: l, startColumn: a, endRow: c, endColumn: d } = o; let u = 0, h = 0; t > l ? u = s : s < c ? u = t : u = l, n > a ? h = i : i < d ? h = n : h = a, r.direction === B.DOWN ? u = s : r.direction === B.UP ? u = t : r.direction === B.RIGHT ? h = i : r.direction === B.LEFT && (h = n), this._scrollToCell(u, h); }, 0); } _getFreeze() { var e; const r = (e = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : e.skeleton.getWorksheetConfig(); if (r != null) return r.freeze; } _updateSceneSize(r) { var u; if (r == null) return; const { unitId: e } = this._context, { skeleton: t } = r, n = (u = this._renderManagerService.getRenderById(e)) == null ? void 0 : u.scene; if (t == null || n == null) return; const { rowTotalHeight: s, columnTotalWidth: i, rowHeaderWidthAndMarginLeft: o, columnHeaderHeightAndMarginTop: l } = t, c = this._context.unit.getActiveSheet(); if (!c) return; const d = c.getZoomRatio() || 1; n == null || n.setScaleValue(d, d), n == null || n.transformByState({ width: o + i, height: l + s }); } _getSheetObject() { return pn(this._context.unit, this._context); } _scrollToSelectionByDirection(r) { const e = this._getViewportBounding(); if (e == null) return !1; const { startRow: t, startColumn: n, endRow: s, endColumn: i } = e; let o = 0, l = 0; const { startRow: a, startColumn: c, endRow: d, endColumn: u } = r; a >= t && (o = d), d <= s && (o = a), c >= n && (l = u), u <= i && (l = c), this._scrollToCell(o, l); } _scrollToSelection(r = !0) { var a; const e = this._getSelectionsService().getCurrentLastSelection(); if (!e) return; const { startRow: t, startColumn: n, actualRow: s, actualColumn: i } = (a = e.primary) != null ? a : e.range, o = r && s != null ? s : t, l = r && i != null ? i : n; this._scrollToCell(o, l); } _getSelectionsService() { return Hi(this._injector); } _getViewportBounding() { var s, i; const r = (s = this._getSheetObject()) == null ? void 0 : s.scene; if (r == null) return; const e = r.getViewport(z.VIEW_MAIN); if (e == null) return; const t = (i = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : i.skeleton; if (t == null) return; const n = e.calcViewportInfo(); return t.getRangeByViewBound(n.viewBound); } // For arrow key to active cell cause scrolling. // eslint-disable-next-line max-lines-per-function, complexity _scrollToCell(r, e, t = !1, n = !1) { var P, E, T, A; const { rowHeightAccumulation: s, columnWidthAccumulation: i } = (E = (P = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : P.skeleton) != null ? E : {}; if (s == null || i == null) return !1; const o = (T = this._getSheetObject()) == null ? void 0 : T.scene; if (o == null) return !1; const l = o.getViewport(z.VIEW_MAIN); if (l == null) return !1; const a = (A = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : A.skeleton; if (a == null) return !1; const c = this._context.unit.getActiveSheet(); if (!c) return !1; r = se.clamp(r, 0, s.length - 1), e = se.clamp(e, 0, i.length - 1); const { startColumn: d, startRow: u, ySplit: h, xSplit: m } = c.getFreeze(), f = this._getViewportBounding(); if (f == null) return !1; const { startRow: g, startColumn: p, endRow: S, endColumn: b } = f; a.getVisibleRangeByViewport(z.VIEW_MAIN); let v, _; if (r >= u && e >= d - h && (r <= g && (v = r, t = !0), r >= S)) { const H = s[r] - l.height; for (let x = g; x <= r && (v = x + 1, !(s[x] >= H)); x++) ; } if (e >= d && r >= u - h && (e <= p && (_ = e, n = !0), e >= b)) { const H = i[e] - l.width; for (let x = p; x <= e && (_ = x + 1, !(i[x] >= H)); x++) ; } if (v === void 0 && _ === void 0) return !1; let { offsetX: R, offsetY: I, sheetViewStartRow: y, sheetViewStartColumn: M } = this._scrollManagerService.getCurrentScrollState() || {}; if (v = v ? Math.min(v, r) : y + h, _ = _ ? Math.min(_, e) : M + m, n) { R = 0, _ = e; const H = a.getHiddenColumnsInRange({ startColumn: _ - m, endColumn: _ }); _ = _ - H.length; } if (t) { I = 0, v = r; const H = a.getHiddenRowsInRange({ startRow: v - h, endRow: v }); v = v - H.length; } return this._commandService.syncExecuteCommand(un.id, { // sheetViewStartRow & offsetX should never be undefined, it's rendering, there should always be a value! // sheetViewStartRow: forceTop ? Math.max(0, row - freezeYSplit) : ((startSheetViewRow ?? 0) - freezeYSplit), // sheetViewStartColumn: forceLeft ? Math.max(0, column - freezeXSplit) : ((startSheetViewColumn ?? 0) - freezeXSplit), // offsetX: startSheetViewColumn === undefined ? offsetX : 0, // offsetY: startSheetViewRow === undefined ? offsetY : 0, sheetViewStartRow: Math.max(0, v - h), sheetViewStartColumn: Math.max(0, _ - m), offsetX: R, offsetY: I }); } }; ai = Jv([ Lr(1, D(vt)), Lr(2, D(me)), Lr(3, Ne), Lr(4, F), Lr(5, Ce), Lr(6, D(yt)) ], ai); const lf = { id: "sheet.operation.scroll-to-range", type: K.OPERATION, handler: (r, e) => { if (!e) return !1; const t = r.get(L); return r.get(Ce).getRenderById(t.getCurrentUnitForType(O.UNIVER_SHEET).getUnitId()).with(ai).scrollToRange(e.range, e.forceTop, e.forceLeft); } }; class t1 { constructor() { w(this, "_state", null); w(this, "_rect", null); w(this, "_state$", new Me(null)); w(this, "state$", this._state$.asObservable()); w(this, "_rect$", new Me(null)); w(this, "rect$", this._rect$.asObservable()); w(this, "_focus", !1); w(this, "_focus$", new Me(this._focus)); w(this, "focus$", this._focus$.asObservable()); } dispose() { this._state$.complete(), this._state = null, this._rect$.complete(), this._rect = null; } setState(e) { this._state = e, this._refresh(e); } getRect() { return this._rect; } setRect(e) { this._rect = e, this._rect$.next(e); } getState() { return this._state; } setFocus(e = !1) { this._focus = e, this._focus$.next(e); } _refresh(e) { this._state$.next(e); } } const Fl = gn( "univer.sheet-cell-editor-manager.service" ), n1 = "36", r1 = "univer-sheet-container", af = { sheetFooterBarHeight: n1, sheetContainer: r1 }; var s1 = Object.defineProperty, i1 = Object.getOwnPropertyDescriptor, o1 = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? i1(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && s1(e, t, s), s; }, Wr = (r, e) => (t, n) => e(t, n, r); const Du = 5, Lu = 2; let Do = class extends ce { constructor(r, e, t, n, s, i, o) { super(), this._context = r, this._layoutService = e, this._cellEditorManagerService = t, this._editorBridgeService = n, this._renderManagerService = s, this._sheetSkeletonManagerService = i, this._univerInstanceService = o; } // eslint-disable-next-line complexity fitTextSize(r) { var M, P, E, T; const e = this._editorBridgeService.getEditCellState(); if (!e) return; const { position: t, documentLayoutObject: n, canvasOffset: s, scaleX: i, scaleY: o } = e, { startX: l, startY: a, endX: c, endY: d } = t, u = this._univerInstanceService.getUnit(Le, O.UNIVER_DOC); if (u == null) return; const h = this._getEditorSkeleton(); if (!h) return; const m = this._predictingSize( t, s, h, n, i, o ); if (!m) return; let { actualWidth: f, actualHeight: g } = m; const { verticalAlign: p, horizontalAlign: S, paddingData: b, fill: v } = n; f = f + ((M = b.l) != null ? M : 0) + ((P = b.r) != null ? P : 0), g = g + ((E = b.t) != null ? E : 0) + ((T = b.b) != null ? T : 0); let _ = c - l, R = d - a; _ < f && (_ = Math.ceil(f)), R < g && (R = Math.ceil(g)); let I = 0; p === an.MIDDLE ? I = (R - g) / 2 / o : p === an.TOP ? I = b.t || 0 : I = (R - g) / o; let y = 0; S === wt.CENTER ? y = (_ - f) / 2 / i : S === wt.RIGHT ? y = (_ - f) / i : y = b.l || 0, I = I < (b.t || 0) ? b.t || 0 : I, y = y < (b.l || 0) ? b.l || 0 : y, u.updateDocumentDataMargin({ t: I, l: y }), h.calculate(), this._editAreaProcessing( _, R, t, s, v, i, o, S, r ); } /** * Mainly used to pre-calculate the width of the editor, * to determine whether it needs to be automatically widened. */ _predictingSize(r, e, t, n, s = 1, i = 1) { const { startX: o, endX: l } = r, { textRotation: a, wrapStrategy: c, paddingData: d } = n, u = this._univerInstanceService.getUnit(Le, O.UNIVER_DOC), { vertexAngle: h } = nd(a); if (c === Cr.WRAP && h === 0) { u == null || u.updateDocumentDataPageSize(l - o), u == null || u.updateDocumentDataMargin({ l: d.l, t: d.t }), t.calculate(); const { actualWidth: p, actualHeight: S } = t.getActualSize(); return { actualWidth: p * s, actualHeight: S * i }; } const m = this._getEditorMaxSize(r, e, n.horizontalAlign); if (!m) return; u == null || u.updateDocumentDataPageSize(m.width / s), t.calculate(); const f = t.getActualSize(); let g = l - o; return g < f.actualWidth * s + Du * s && (g = f.actualWidth * s + Du * s), u == null || u.updateDocumentDataPageSize(g / s), u == null || u.updateDocumentRenderConfig({ horizontalAlign: wt.UNSPECIFIED, cellValueType: void 0 }), { actualWidth: f.actualWidth * s, actualHeight: f.actualHeight * i }; } _getEditorMaxSize(r, e, t) { if (this._getEditorObject() == null) return; function s(S) { return Number.parseInt(S.replace("px", "")); } const o = this._context.engine.getCanvasElement(), l = o.getBoundingClientRect(), a = s(o.style.width), { width: c } = l, d = c / a, { startX: u, startY: h, endX: m } = r, f = this._context.engine.width, g = document.body.clientHeight - h - Number.parseFloat(af.sheetFooterBarHeight) - e.top - Lu * 2; let p = c - u; if (t === wt.CENTER) { const S = f - m, b = u; p = m - u + Math.min(b, S) * 2; } else t === wt.RIGHT && (p = m); return { height: g, width: p - Lu, scaleAdjust: d }; } /** * Mainly used to calculate the volume of scenes and objects, * determine whether a scrollbar appears, * and calculate the editor's boundaries relative to the browser. */ // eslint-disable-next-line max-lines-per-function _editAreaProcessing(r, e, t, n, s, i = 1, o = 1, l, a) { var H; const c = this._getEditorObject(); if (c == null) return; const u = this._context.engine.getCanvasElement(); let { startX: h, startY: m } = t; const { document: f, scene: g, engine: p } = c, S = g.getViewport(vo.VIEW_MAIN), b = this._getEditorMaxSize(t, n, l), { height: v, width: _, scaleAdjust: R } = b; let I = e, y = S == null ? void 0 : S.getScrollBar(); I > v ? (y == null ? S && new rd(S, { enableHorizontal: !1, barSize: 8 }) : S == null || S.resetCanvasSizeAndUpdateScroll(), S == null || S.scrollToViewportPos({ viewportScrollY: I - v }), I = v) : (y = null, (H = S == null ? void 0 : S.getScrollBar()) == null || H.dispose()), r += (y == null ? void 0 : y.barSize) || 0, r > _ && (r = _), this._addBackground(g, r / i, e / o, s); const { scaleX: M, scaleY: P } = g.getPrecisionScale(); g.transformByState({ width: r * R / i, height: e * R / o, scaleX: i * R, scaleY: o * R }), f.resize(r * R / i, e * R / o), setTimeout(() => { p.resizeBySize( uu(r, M), uu(I, P) ), a == null || a(); }, 0); const E = this._layoutService.getContentElement().getBoundingClientRect(), T = u.getBoundingClientRect(); h = h * R + (T.left - E.left), m = m * R + (T.top - E.top); const A = t.endX - t.startX; l === wt.RIGHT ? h += (A - r) * R : l === wt.CENTER && (h += (A - r * R) / 2), this._cellEditorManagerService.setState({ startX: h, startY: m, endX: r * R + h, endY: I * R + m, show: !0 }); } /** * Since the document does not support cell background color, an additional rect needs to be added. */ _addBackground(r, e, t, n) { const s = "_backgroundRectHelperColor_", i = r.getObject(s); i == null && n == null || (i == null ? r.addObjects( [ new ge(s, { width: e, height: t, fill: n, evented: !1 }) ], pp ) : n == null ? i.dispose() : (i.setProps({ fill: n }), i.transformByState({ width: e, height: t }))); } resizeCellEditor(r) { var R; const e = this._cellEditorManagerService.getState(); if (!e || !this._editorBridgeService.isVisible().visible) return; this._editorBridgeService.refreshEditCellPosition(!0); const t = this._editorBridgeService.getEditCellState(); if (!t) return; const n = (R = this._sheetSkeletonManagerService.getWorksheetSkeleton(t.sheetId)) == null ? void 0 : R.skeleton; if (!n) return; const { row: s, column: i, scaleX: o, scaleY: l, position: a, canvasOffset: c, documentLayoutObject: d } = t, { horizontalAlign: u } = d, h = this._getEditorMaxSize(a, c, u); if (!h) return; const { height: m, width: f, scaleAdjust: g } = h, p = n.getCellWithCoordByIndex(s, i), S = Math.min((p.mergeInfo.endY - p.mergeInfo.startY) * l, m) * g, b = Math.min((p.mergeInfo.endX - p.mergeInfo.startX) * o, f) * g, v = e.endY - e.startY, _ = e.endX - e.startX; if (v !== S || _ !== b) { if (this._editorBridgeService.refreshEditCellPosition(!0), !this._getEditorSkeleton()) return; this.fitTextSize(r); } } _getEditorObject() { return Ed(this._editorBridgeService.getCurrentEditorId(), this._renderManagerService); } _getEditorSkeleton() { var r; return (r = this._renderManagerService.getRenderById(Le)) == null ? void 0 : r.with(Jn).getSkeleton(); } }; Do = o1([ Wr(1, _l), Wr(2, Fl), Wr(3, tt), Wr(4, Ce), Wr(5, D(me)), Wr(6, L) ], Do); function kd(r) { return r.getContextValue(Tt); } function De(r) { return r.getContextValue(Tt) && r.getContextValue(Tr) && !r.getContextValue(Je) && !r.getContextValue(Cl); } function cf(r) { return r.getContextValue(Tt) && r.getContextValue(Tr) && !r.getContextValue(Je) && !r.getContextValue(Ht) && !r.getContextValue(Cl); } function l1(r) { return r.getContextValue(Tt) && r.getContextValue(Tr) && r.getContextValue(Je); } function a1(r) { return r.getContextValue(Tr) && r.getContextValue(Je); } function df(r) { return r.getContextValue(Ht) && r.getContextValue(Tr); } function rE(r) { return r.getContextValue(Tt) && r.getContextValue(Je) && r.getContextValue(_o) && r.getContextValue(Tr); } function ci(r) { return r.getContextValue(Tt) && r.getContextValue(Tr) && r.getContextValue(Je) && !r.getContextValue(_o) && !r.getContextValue(Sl); } const uf = [ Z.ARROW_DOWN, Z.ARROW_UP, Z.ARROW_LEFT, Z.ARROW_RIGHT ], c1 = [Z.ENTER, Z.TAB, ...uf]; function hf() { const r = []; for (const e of uf) r.push({ id: cs.id, binding: e, preconditions: (t) => ci(t), staticParameters: { visible: !1, eventType: Xe.Keyboard, keycode: e, isShift: !1 } }), r.push({ id: cs.id, binding: e | ye.SHIFT, preconditions: (t) => ci(t), staticParameters: { visible: !1, eventType: Xe.Keyboard, keycode: e, isShift: !0 } }); return r; } const mf = { id: Wl.id, binding: Z.F2, description: "shortcut.sheet.start-editing", group: "4_sheet-edit", preconditions: De, staticParameters: { visible: !0, eventType: Xe.Keyboard, keycode: Z.F2 } }, ff = { id: Et.id, binding: Z.ENTER, description: "shortcut.sheet.toggle-editing", group: "4_sheet-edit", preconditions: (r) => ci(r), staticParameters: { visible: !1, eventType: Xe.Keyboard, keycode: Z.ENTER } }, gf = { id: Et.id, binding: Z.TAB, preconditions: (r) => ci(r), staticParameters: { visible: !1, eventType: Xe.Keyboard, keycode: Z.TAB } }, pf = { id: Et.id, binding: Z.ESC, description: "shortcut.sheet.abort-editing", group: "4_sheet-edit", preconditions: (r) => ci(r), staticParameters: { visible: !1, eventType: Xe.Keyboard, keycode: Z.ESC } }, Sf = { id: Sp.id, description: "shortcut.sheet.break-line", group: "4_sheet-edit", preconditions: (r) => l1(r), binding: Z.ENTER | ye.ALT }, Cf = { id: Cp.id, preconditions: (r) => a1(r) || df(r), binding: Z.BACKSPACE }, vf = { id: Et.id, description: "shortcut.sheet.delete-and-start-editing", group: "4_sheet-edit", preconditions: (r) => De(r) && !df(r), binding: Z.BACKSPACE, staticParameters: { visible: !0, eventType: Xe.Keyboard, keycode: Z.BACKSPACE } }; function d1(r) { return r.startsWith("'"); } function u1(r) { return r.slice(1); } const h1 = { "0": "0", "1": "1", "2": "2", "3": "3", "4": "4", "5": "5", "6": "6", "7": "7", "8": "8", "9": "9", A: "A", B: "B", C: "C", D: "D", E: "E", F: "F", G: "G", H: "H", I: "I", J: "J", K: "K", L: "L", M: "M", N: "N", O: "O", P: "P", Q: "Q", R: "R", S: "S", T: "T", U: "U", V: "V", W: "W", X: "X", Y: "Y", Z: "Z", a: "a", b: "b", c: "c", d: "d", e: "e", f: "f", g: "g", h: "h", i: "i", j: "j", k: "k", l: "l", m: "m", n: "n", o: "o", p: "p", q: "q", r: "r", s: "s", t: "t", u: "u", v: "v", w: "w", x: "x", y: "y", z: "z", "%": "%", "-": "-", ".": ".", ":": ":", "/": "/", "+": "+", "@": "@", "&": "&", "*": "*", "#": "#", "=": "=", ">": ">", "<": "<", "$": "$", """: '"', "'": "'", "(": "(", ")": ")", " ": " ", ",": ",", "!": "!", "?": "?", ";": ";", "[": "[", "]": "]", "{": "{", "}": "}" }, Pc = { true: "TRUE", false: "FALSE" }; function m1(r) { return [su.ZH_CN, su.ZH_TW].includes(r); } function f1(r, e, t, n) { let s = r; if (m1(t)) { if (r.startsWith("'") || r.startsWith("'")) return `'${r.slice(1)}`; s = g1(s); } if (s.startsWith("=")) return p1(r, s, e, n); const i = s.toLowerCase(); return Pc[i] ? Pc[i] : er.parseValue(s) == null ? r : s; } function g1(r) { const e = /['"].*?['"]/g, t = [], n = r.split(e); r.replace(e, (i) => (t.push(i), "")); let s = n.join("").split("").map(v1).join(""); return t.forEach((i, o) => { s = s.slice(0, o * 2) + i + s.slice((o + 1) * 2); }), s; } function p1(r, e, t, n) { const s = t.sequenceNodesBuilder(e); if (!s) return r; let i = e, o = 0; return s.forEach((l, a) => { if (typeof l == "object") { const c = l.token; if (Pc[c.toLowerCase()]) { const d = l.startIndex + o + 1, u = l.endIndex + o + 2; i = Br(c.toLocaleUpperCase(), i, d, u); } else if (l.nodeType === ma.FUNCTION && S1(c, n, s, a) || l.nodeType === ma.REFERENCE) { const d = c.indexOf("!"); if (d > -1) { const u = c.substring(d + 1), h = l.startIndex + o + (d + 1) + 1, m = l.endIndex + o + 2; i = Br(u.toLocaleUpperCase(), i, h, m); } else { const u = l.startIndex + o + 1, h = l.endIndex + o + 2; i = Br(c.toLocaleUpperCase(), i, u, h); } } else if (c.startsWith('"') && c.endsWith('"') || c.startsWith("'") && c.endsWith("'")) { const d = l.startIndex + o + 2, u = l.endIndex + o + 1; i = Br(r.slice(d, u), i, d, u); } else if (l.nodeType !== ma.ARRAY) { const d = er.parseValue(c); if (d == null) { const u = l.startIndex + o + 1, h = l.endIndex + o + 2; i = Br(r.slice(u, h), i, u, h); } else if (typeof d.v == "number" && (d.z === void 0 || !er.isDate(d.z))) { const u = `${d.v}`, h = l.startIndex + o + 1, m = l.endIndex + o + 2, { processedString: f, offset: g } = b1(c, u); i = Br(f, i, h, m), o += g; } } } }), i; } function S1(r, e, t, n) { const s = e.getDescriptions(); return t[n + 1] !== Vm.OPEN_BRACKET ? !1 : s.get(C1(r).toLocaleUpperCase()) !== void 0; } function C1(r) { const e = /^@+/; return r.replace(e, ""); } function v1(r) { return h1[r] || r; } function Br(r, e, t, n) { return e.substring(0, t) + r + e.substring(n); } function b1(r, e) { var o, l; const t = ((o = r.match(/^\s*/)) == null ? void 0 : o[0]) || "", n = ((l = r.match(/\s*$/)) == null ? void 0 : l[0]) || "", s = t + e + n, i = s.length - r.length; return { processedString: s, offset: i }; } const _1 = "range_selector", w1 = (r) => r.includes(_1); var R1 = Object.defineProperty, I1 = Object.getOwnPropertyDescriptor, y1 = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? I1(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && R1(e, t, s), s; }, Rt = (r, e) => (t, n) => e(t, n, r); const Wu = -1e3; let Ec = class extends ce { constructor(e, t, n, s, i, o, l, a, c, d, u, h, m, f, g, p) { super(); /** * It is used to distinguish whether the user has actively moved the cursor in the editor, mainly through mouse clicks. */ w(this, "_cursorChange", 0); /** If the corresponding unit is active and prepared for editing. */ w(this, "_isUnitEditing", !1); w(this, "_workbookSelections"); w(this, "_d"); w(this, "_cursorTimeout"); this._context = e, this._undoRedoService = n, this._contextService = s, this._renderManagerService = i, this._editorBridgeService = o, this._cellEditorManagerService = l, this._lexerTreeBuilder = a, this._functionService = c, this._textSelectionManagerService = d, this._commandService = u, this._localService = h, this._editorService = m, this._sheetCellEditorResizeService = f, this._univerInstanceService = g, this._sheetInterceptorService = p, this._workbookSelections = t.getWorkbookSelections(this._context.unitId), this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(O.UNIVER_SHEET).subscribe((S) => { (S == null ? void 0 : S.getUnitId()) === this._context.unitId ? this._d = this._init() : (this._disposeCurrent(), this._isUnitEditing && (this._handleEditorInvisible({ visible: !1, eventType: Xe.Keyboard, keycode: Z.ESC, unitId: this._context.unitId }), this._isUnitEditing = !1)); })), this._initEditorVisibilityListener(); } dispose() { super.dispose(), this._disposeCurrent(); } _disposeCurrent() { var e; (e = this._d) == null || e.dispose(), this._d = null; } _init() { const e = new St(); return this._subscribeToCurrentCell(e), this._initialCursorSync(e), this._listenEditorFocus(e), this._commandExecutedListener(e), this._initSkeletonListener(e), this.disposeWithMe(this._univerInstanceService.unitDisposed$.subscribe((t) => { clearTimeout(this._cursorTimeout); })), this._cursorTimeout = setTimeout(() => { this._cursorStateListener(e); }, 1e3), e; } _initEditorVisibilityListener() { this.disposeWithMe( this._editorBridgeService.visible$.pipe(cn((e, t) => e.visible === t.visible)).subscribe((e) => { (e.unitId === Te || e.unitId === this._context.unitId) && e.visible ? (this._isUnitEditing = !0, this._handleEditorVisible(e)) : this._isUnitEditing && (this._handleEditorInvisible(e), this._isUnitEditing = !1); }) ); } _listenEditorFocus(e) { const t = this._getEditorObject(); t && e.add(t.document.onPointerDown$.subscribeEvent(() => { if (this._isUnitEditing && this._editorBridgeService.isVisible()) { const n = this._editorBridgeService.getEditCellState(), s = this._editorBridgeService.getCurrentEditorId(); if (!n || !s) return; this._sheetCellEditorResizeService.fitTextSize(); } })); } _initialCursorSync(e) { e.add(this._cellEditorManagerService.focus$.pipe(Ml((t) => !!t)).subscribe(() => { var n; const t = (n = this._renderManagerService.getCurrentTypeOfRenderer(O.UNIVER_DOC)) == null ? void 0 : n.with(Sr); t && t.sync(); })); } _initSkeletonListener(e) { const t = new Set(Io); t.delete(et.id), e.add(this._commandService.onCommandExecuted((n) => { t.has(n.id) && this._sheetCellEditorResizeService.resizeCellEditor(() => { this._textSelectionManagerService.refreshSelection({ unitId: Le, subUnitId: Le }); }); })); } /** * Should update current editing cell info when selection is changed. * @param d DisposableCollection */ _subscribeToCurrentCell(e) { e.add(this._editorBridgeService.currentEditCellState$.subscribe((t) => { var S, b; if (t == null || this._editorBridgeService.isForceKeepVisible()) return; const n = this._editorBridgeService.getEditCellState(); if (n == null) return; const { position: s, documentLayoutObject: i, scaleX: o, editorUnitId: l } = n; if (this._contextService.getContextValue(Sl)) return; const a = this._getDocumentDataModel(); if (a == null) return; const { startX: c, endX: d } = s, { textRotation: u, wrapStrategy: h, documentModel: m } = i, { vertexAngle: f } = nd(u); h === Cr.WRAP && f === 0 && a.updateDocumentDataPageSize((d - c) / o), this._commandService.syncExecuteCommand(xh.id, { unitId: l, snapshot: m.getSnapshot() }), this._contextService.setContextValue(ic, !0), this._textSelectionManagerService.replaceDocRanges( [{ startOffset: 0, endOffset: 0 }], { unitId: Le, subUnitId: Le } ); const g = (S = this._renderManagerService.getRenderById(Le)) == null ? void 0 : S.with(Sr), p = (b = this._renderManagerService.getRenderById(Te)) == null ? void 0 : b.with(Sr); (g != null && g.canFocusing || p != null && p.canFocusing) && (this._univerInstanceService.setCurrentUnitForType(Le), g == null || g.activate( Wu, Wu, !0 )); })); } /** * Listen to document edits to refresh the size of the sheet editor, not for normal editor. */ _commandExecutedListener(e) { e.add(this._commandService.onCommandExecuted((n) => { if (n.id === Eo.id) { const s = n.params, { unitId: i } = s; if (!this._isCurrentSheetFocused() || w1(i) || (this._editorBridgeService.changeEditorDirty(!0), !this._editorBridgeService.isVisible().visible)) return; i === Le && this._sheetCellEditorResizeService.fitTextSize(); } })); const t = [cs.id]; e.add(this._commandService.onCommandExecuted((n) => { if (t.includes(n.id)) { const s = n.params, { keycode: i, isShift: o } = s; if (i != null && (this._cursorChange === 2 || this._contextService.getContextValue(Ht))) { this._moveInEditor(i, o); return; } this._editorBridgeService.changeVisible(s); } n.id === Wl.id && (this._cursorChange = 2); })); } // You can double-click on the cell or input content by keyboard to put the cell into the edit state. // eslint-disable-next-line complexity _handleEditorVisible(e) { var h, m, f; const { eventType: t, keycode: n } = e; this._cursorChange = t === Xe.PointerDown || t === Xe.Dblclick ? 2 : 1; const s = this._editorBridgeService.getEditLocation(); if (s == null) return; this._commandService.syncExecuteCommand(lf.id, { range: { startRow: s.row, startColumn: s.column, endRow: s.row, endColumn: s.column } }), this._editorBridgeService.refreshEditCellPosition(!1); const { unitId: i, isInArrayFormulaRange: o = !1 } = s, l = this._getEditorObject(); if (l == null) return; const { document: a, scene: c } = l; this._contextService.setContextValue(Je, !0); const d = this._getDocumentDataModel(), u = this._getEditorSkeleton(Le); if (!(!u || !d)) { if (this._sheetCellEditorResizeService.fitTextSize(() => { const g = c.getViewport(vo.VIEW_MAIN); g == null || g.scrollToViewportPos({ viewportScrollX: Number.POSITIVE_INFINITY, viewportScrollY: Number.POSITIVE_INFINITY }); }), t === Xe.Keyboard && n === Z.F2) { a.makeDirty(), this._textSelectionManagerService.replaceDocRanges([ { startOffset: 0, endOffset: 0 } ]); const g = ((m = (h = d.getBody()) == null ? void 0 : h.dataStream.length) != null ? m : 2) - 2; this._textSelectionManagerService.replaceDocRanges( [{ startOffset: g, endOffset: g }], { unitId: Le, subUnitId: Le } ); } else if ( // clear and edit t === Xe.Keyboard || t === Xe.Dblclick && o ) this._emptyDocumentDataModel(d.getSnapshot().documentStyle, !!o), a.makeDirty(), (n === Z.BACKSPACE || t === Xe.Dblclick) && (u.calculate(), this._editorBridgeService.changeEditorDirty(!0)), this._textSelectionManagerService.replaceDocRanges( [{ startOffset: 0, endOffset: 0 }], { unitId: Le, subUnitId: Le } ); else if (t === Xe.Dblclick) { if (this._contextService.getContextValue(_o)) return; const g = d.getBody().dataStream.length - 2 || 0; this._textSelectionManagerService.replaceDocRanges([ { startOffset: g, endOffset: g } ]); } (f = this._renderManagerService.getRenderById(i)) == null || f.scene.resetCursor(); } } async _handleEditorInvisible(e) { const t = this._editorBridgeService.getEditCellState(), n = this._univerInstanceService.getUnit(Le), s = se.deepClone(n == null ? void 0 : n.getSnapshot()); let { keycode: i } = e; if (this._cursorChange = 0, this._exitInput(e), t == null) return; this._editorBridgeService.getEditorDirty() === !1 && (i = Z.ESC); const a = this._context.unit.getActiveSheet(), c = this._context.unitId, d = a.getSheetId(), { unitId: u, sheetId: h } = t; if (c === u && h !== d && await this._commandService.executeCommand(dd.id, { subUnitId: h, unitId: u }), i === Z.ESC) { this._editorBridgeService.isForceKeepVisible() && this._editorBridgeService.disableForceKeepVisible(); const m = this._workbookSelections.getCurrentSelections(); m && (this._contextService.setContextValue(Js, !1), this._commandService.syncExecuteCommand(He.id, { unitId: this._context.unit.getUnitId(), subUnitId: h, selections: m })); return; } s && await this._submitCellData(s), this._moveCursor(i); } _getEditorObject() { return Ed(this._editorBridgeService.getCurrentEditorId(), this._renderManagerService); } submitCellData(e) { return this._submitCellData(e.getSnapshot()); } async _submitCellData(e) { const t = this._editorBridgeService.getEditCellState(); if (t == null) return; const { unitId: n, sheetId: s, row: i, column: o } = t, l = this._context.unit; let a = l.getActiveSheet(); if (!l.getSheetBySheetId(s)) return; a = l.getActiveSheet(); const d = M1( { ...a.getCellRaw(i, o) || {} }, e, this._lexerTreeBuilder, this._localService, this._functionService, l.getStyles() ); if (!d) return; const u = await this._sheetInterceptorService.onWriteCell(l, a, i, o, d); u !== a.getCellRaw(i, o) && this._commandService.executeCommand(Ti.id, { subUnitId: s, unitId: n, range: { startRow: i, startColumn: o, endRow: i, endColumn: o }, value: u }); } _exitInput(e) { var s; this._contextService.setContextValue(_o, !1), this._contextService.setContextValue(Je, !1), this._contextService.setContextValue(ic, !1), this._contextService.setContextValue(Ht, !1), this._cellEditorManagerService.setState({ show: e.visible }); const t = this._getEditorObject(); (s = t == null ? void 0 : t.scene.getViewport(vo.VIEW_MAIN)) == null || s.scrollToViewportPos({ viewportScrollX: 0, viewportScrollY: 0 }); const n = this._editorBridgeService.getCurrentEditorId(); n == null || !this._editorService.isSheetEditor(n) || (this._undoRedoService.clearUndoRedo(n), this._undoRedoService.clearUndoRedo(Te)); } _moveCursor(e) { if (e == null || !c1.includes(e)) return; let t = B.LEFT; switch (e) { case Z.ENTER: t = B.DOWN; break; case Z.TAB: t = B.RIGHT; break; case Z.ARROW_DOWN: t = B.DOWN; break; case Z.ARROW_UP: t = B.UP; break; case Z.ARROW_LEFT: t = B.LEFT; break; case Z.ARROW_RIGHT: t = B.RIGHT; break; } e === Z.ENTER || e === Z.TAB ? this._commandService.executeCommand(Fn.id, { keycode: e, direction: t }) : this._commandService.executeCommand(Lt.id, { direction: t }); } /** * The user's operations follow the sequence of opening the editor and then moving the cursor. * The logic here predicts the user's first cursor movement behavior based on this rule */ _cursorStateListener(e) { const t = this._getEditorObject(); if (!(t != null && t.document)) return; const { document: n } = t; e.add(Ae(n.onPointerDown$.subscribeEvent(() => { this._cursorChange === 1 && (this._cursorChange = 2); }))); } // TODO: @JOCS, is it necessary to move these commands MoveSelectionOperation\MoveCursorOperation to shortcut? and use multi-commands? _moveInEditor(e, t) { let n = B.LEFT; e === Z.ARROW_DOWN ? n = B.DOWN : e === Z.ARROW_UP ? n = B.UP : e === Z.ARROW_RIGHT && (n = B.RIGHT), t ? this._commandService.executeCommand(vp.id, { direction: n }) : this._commandService.executeCommand(bp.id, { direction: n }); } _getDocumentDataModel() { return this._univerInstanceService.getUnit(Le, O.UNIVER_DOC); } // WTF: this is should not exist at all. It is because all editor instances reuse the singleton // "DocSelectionManagerService" and other modules. Which will be refactored soon in August, 2024. _isCurrentSheetFocused() { var e; return ((e = this._univerInstanceService.getFocusedUnit()) == null ? void 0 : e.getUnitId()) === this._context.unitId; } _getEditorSkeleton(e) { var t; return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(Jn).getSkeleton(); } _getEditorViewModel(e) { var t; return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(Jn).getViewModel(); } _emptyDocumentDataModel(e, t) { const n = (o, l) => { const a = se.deepClone(o.getSnapshot()), c = this._getEditorViewModel(o.getUnitId()); c != null && (P1(a.body, t), l && (a.documentStyle = e), a.drawings = {}, a.drawingsOrder = [], o.reset(a), c.reset(o)); }, s = this._getDocumentDataModel(); s && n(s, !0); const i = this._univerInstanceService.getUnit(Te, O.UNIVER_DOC); i && n(i); } }; Ec = y1([ Rt(1, D($)), Rt(2, Zt), Rt(3, Ne), Rt(4, Ce), Rt(5, tt), Rt(6, Fl), Rt(7, D(km)), Rt(8, Dm), Rt(9, D(yd)), Rt(10, F), Rt(11, D(Ee)), Rt(12, Ss), Rt(13, D(Do)), Rt(14, L), Rt(15, D(Ln)) ], Ec); function M1(r, e, t, n, s, i) { var u, h, m; if ((e == null ? void 0 : e.body) == null) return null; const { body: o } = e; r.t = void 0; const l = o.dataStream; let c = l.substring(l.length - 2, l.length) === kh ? l.substring(0, l.length - 2) : l; const d = n.getCurrentLocale(); if (c = f1(c, t, d, s), (u = e.drawingsOrder) != null && u.length) r.v = "", r.f = null, r.si = null, r.p = e, r.t = ln.STRING; else if (r.s && ((m = (h = i == null ? void 0 : i.get(r.s)) == null ? void 0 : h.n) == null ? void 0 : m.pattern) === TC) { r.v = c, r.f = null, r.si = null, r.p = null, r.t = ln.STRING, Tc(o) && o.dataStream !== `\r ` && (r.p = e); const f = Bu(e); f && (r.s = f); } else if (Kc(c)) { if (r.f === c) return null; const f = t.checkIfAddBracket(c); for (let g = 0; g < f; g++) c += Vm.CLOSE_BRACKET; r.f = c, r.si = null, r.v = null, r.p = null; } else if (d1(c)) { const f = u1(c); r.v = f, r.f = null, r.si = null, r.p = null, r.t = ln.FORCE_STRING; } else if (Tc(o)) o.dataStream === `\r ` ? (r.v = "", r.f = null, r.si = null, r.p = null) : (r.p = e, r.v = null, r.f = null, r.si = null); else { if (c === "" && r.v == null && r.p == null) return null; r.v = c, r.f = null, r.si = null, r.p = null; const f = Bu(e); f && (r.s = f); } return r; } function Tc(r) { const { textRuns: e = [], paragraphs: t = [], customRanges: n, customBlocks: s = [] } = r, i = r.dataStream.replace(/(\r\n)+$/, ""), o = ["va"]; return ( // This is because after editing, an inexplicable second paragraph style will appear \r\n e.filter((l) => l.st < i.length).some((l) => { var c; return !!(l.ts && Object.keys(l.ts).some((d) => o.includes(d))) || Object.keys((c = l.ts) != null ? c : {}).length && l.ed - l.st < i.length; }) || t.some((l) => l.bullet) || t.length >= 2 || !!(n != null && n.length) || s.length > 0 ); } function Bu(r) { const { body: e } = r; if (!e) return null; const { textRuns: t = [] } = e; let n = {}; const s = e.dataStream.replace(`\r `, ""); return t.forEach((i) => { const { st: o, ed: l, ts: a } = i; l - o >= s.length && (n = { ...n, ...a }); }), Object.keys(n).length ? n : null; } function P1(r, e = !1) { r.dataStream = kh, r.textRuns != null && (r.textRuns.length === 1 && !e ? (r.textRuns[0].st = 0, r.textRuns[0].ed = 1) : r.textRuns = void 0), r.paragraphs != null && (r.paragraphs = [ { startIndex: 0 } ]), r.sectionBreaks != null && (r.sectionBreaks = void 0), r.tables != null && (r.tables = void 0), r.customRanges != null && (r.customRanges = void 0), r.customBlocks != null && (r.customBlocks = void 0); } var E1 = Object.defineProperty, T1 = Object.getOwnPropertyDescriptor, x1 = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? T1(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && E1(e, t, s), s; }, Sa = (r, e) => (t, n) => e(t, n, r); const Fu = $m.MARK_SELECTION, ws = gn("univer.mark-selection-service"); let Lo = class extends ce { constructor(e, t, n) { super(); w(this, "_shapeMap", /* @__PURE__ */ new Map()); this._currentService = e, this._renderManagerService = t, this._themeService = n; } addShape(e, t = [], n = Fu) { var a; const s = this._currentService.getCurrentUnitForType(O.UNIVER_SHEET), i = (a = s.getActiveSheet()) == null ? void 0 : a.getSheetId(); if (!i) return null; const o = se.generateRandomId(), l = { selection: e, subUnitId: i, unitId: s.getUnitId(), zIndex: n, control: null, exits: t }; return this._shapeMap.set(o, l), this.refreshShapes(), o; } addShapeWithNoFresh(e, t = [], n = Fu) { var l; const s = this._currentService.getCurrentUnitForType(O.UNIVER_SHEET), i = (l = s.getActiveSheet()) == null ? void 0 : l.getSheetId(); if (!i) return null; const o = se.generateRandomId(); return this._shapeMap.set(o, { selection: e, subUnitId: i, unitId: s.getUnitId(), zIndex: n, control: null, exits: t }), o; } refreshShapes() { var s; const e = this._currentService.getCurrentUnitForType(O.UNIVER_SHEET); if (!e) return; const t = e.getUnitId(), n = (s = e.getActiveSheet()) == null ? void 0 : s.getSheetId(); this._shapeMap.forEach((i) => { var b; const { unitId: o, subUnitId: l, selection: a, control: c, zIndex: d } = i; if (c == null || c.dispose(), o !== t || l !== n) return; const u = this._renderManagerService.getRenderById(o); if (!u) return; const h = (b = this._renderManagerService.withCurrentTypeOfUnit(O.UNIVER_SHEET, me)) == null ? void 0 : b.getCurrentSkeleton(); if (!h) return; const { scene: m } = u, { rowHeaderWidth: f, columnHeaderHeight: g } = h, p = new xd(m, d, this._themeService, { enableAutoFill: !1, highlightHeader: !1, rowHeaderWidth: f, columnHeaderHeight: g }), S = Pt(a, h); p.updateRangeBySelectionWithCoord(S), i.control = p; }); } getShapeMap() { return this._shapeMap; } removeShape(e) { const t = this._shapeMap.get(e); if (!t) return; const { control: n } = t; n == null || n.dispose(), this._shapeMap.delete(e); } removeAllShapes() { for (const e of this._shapeMap.values()) { const { control: t } = e; t == null || t.dispose(); } this._shapeMap.clear(); } }; Lo = x1([ Sa(0, L), Sa(1, Ce), Sa(2, D(kt)) ], Lo); function bf(r) { return { strokeWidth: 1.5, stroke: r.getCurrentTheme().primaryColor, fill: "rgba(178, 178, 178, 0.10)", widgets: {}, strokeDash: 8 }; } const O1 = 10, A1 = 6; function N1() { return se.generateRandomId(A1); } function H1(r) { const e = r.match(/data-copy-id="([^\s]+)"/); return e && e[1] ? e[1] : null; } class V1 { constructor() { w(this, "_cache", new Dp(O1)); } set(e, t) { this._cache.set(e, t); } get(e) { return this._cache.get(e); } del(e) { this._cache.delete(e); } clear() { this._cache.clear(); } clearWithUnitId(e) { this._cache.forEach((t, n) => { t.unitId === e && this._cache.delete(n); }); } } function Wo(r, e) { const t = e != null ? e : r.style, n = {}, s = r.tagName.toLowerCase(); switch (s) { case "b": case "em": case "strong": { n.bl = Qe.TRUE; break; } case "s": { n.st = { s: Qe.TRUE }; break; } case "u": { n.ul = { s: Qe.TRUE }; break; } case "i": { n.it = Qe.TRUE; break; } case "sub": case "sup": { n.va = s === "sup" ? iu.SUPERSCRIPT : iu.SUBSCRIPT; break; } } return k1(t, n), n; } function k1(r, e) { if (r instanceof CSSStyleDeclaration) for (let t = 0; t < r.length; t++) { const n = r[t], s = r.getPropertyValue(n); Uu(n, s, e); } else for (const t in r) { const n = r[t]; Uu(t, n, e); } } function Uu(r, e, t) { switch (r) { case "font-family": t.ff = e; break; case "font-size": { const n = Number.parseInt(e); Number.isNaN(n) || (e.endsWith("pt") ? t.fs = n : e.endsWith("px") && (t.fs = n * 0.75)); break; } case "font-style": e === "italic" && (t.it = Qe.TRUE); break; case "font-weight": { (Number(e) > 400 || e === "bold") && (t.bl = Qe.TRUE); break; } case "text-decoration": { /underline/.test(e) ? t.ul = { s: Qe.TRUE } : /overline/.test(e) ? t.ol = { s: Qe.TRUE } : /line-through/.test(e) && (t.st = { s: Qe.TRUE }); break; } case "color": { try { const n = new Tn(e); n.isValid && (t.cl = { rgb: n.toRgbString() }); } catch { } break; } case "background-color": { const n = new Tn(e), s = n.isValid ? n.toRgbString() : ""; s !== uS && s !== hS && (t.bg = { rgb: s }); break; } } } function D1(r) { const e = document.createElement("body"); return e.innerHTML = r, e; } function _f(r) { const e = r.style, t = {}; for (let n = 0; n < e.length; n++) { const s = e[n], i = e.getPropertyValue(s); switch (s) { case "margin-top": { const o = Number.parseInt(i); t.spaceAbove = { v: /pt/.test(i) ? hu(o) : o }; break; } case "margin-bottom": { const o = Number.parseInt(i); t.spaceBelow = { v: /pt/.test(i) ? hu(o) : o }; break; } case "line-height": { const o = Number.parseFloat(i); t.lineSpacing = o; break; } } } return Object.getOwnPropertyNames(t).length ? t : null; } function Ca(r, e) { const t = []; for (let n = 0, s = r.length; n < s; n++) r[n] === Lp.PARAGRAPH && t.push({ startIndex: n }); return t; } function ju(r, e, t) { var o, l, a; const n = e.length, i = ((o = t == null ? void 0 : t.length) != null ? o : 0) === 1 && t[0].st === 0 && t[0].ed === n; return r.p ? i && ((a = (l = r.p.body) == null ? void 0 : l.textRuns) != null && a.length) ? (r.p.body.textRuns = [], { ...r, s: t[0].ts }) : r : i ? { ...r, s: t[0].ts } : r; } const Xu = [ // Rich Text Style Rules, "color", "background", "font-size", "text-align", "vertical-align", "font-weight", "font-style", "font-family", "text-decoration", "white-space", "word-wrap", // Border Style Rules, "border-left", "border-right", "border-top", "border-bottom", // Custom Style Rules, '--' needs to be used as a prefix. "--data-rotate" ]; function zu(r, e) { const t = r.tagName.toLowerCase(); return typeof e == "string" ? t === e : Array.isArray(e) ? e.some((n) => n === t) : e(r); } const gl = class gl { constructor(e) { w(this, "_styleMap", /* @__PURE__ */ new Map()); w(this, "_styleCache", /* @__PURE__ */ new Map()); w(this, "_styleRules", []); w(this, "_afterProcessRules", []); w(this, "_dom", null); w(this, "_getCurrentSkeleton"); this._getCurrentSkeleton = e.getCurrentSkeleton; } static use(e) { if (this._pluginList.includes(e)) throw new Error(`Univer paste plugin ${e.name} already added`); this._pluginList.push(e); } // eslint-disable-next-line max-lines-per-function convert(e) { const t = gl._pluginList.find((g) => g.checkPasteType(e)); t && (this._styleRules = [...t.stylesRules], this._afterProcessRules = [...t.afterProcessRules]); const n = new Ke(); this._dom = D1(e); const s = this._dom.querySelector("style"); if (s) { const g = document.createElement("div"), p = g.attachShadow({ mode: "open" }); document.body.appendChild(g), p.appendChild(s); for (const S of s.sheet.cssRules) { const b = S, v = b.selectorText, _ = b.style; this._styleMap.set(v, _); } s.remove(), g.remove(); } const i = { dataStream: "", textRuns: [] }, o = [], l = [], a = e.match(/]*>([\s\S]*?)<\/table>/gi), c = []; this.process(null, this._dom.childNodes, i, c); const { paragraphs: d, dataStream: u, textRuns: h, payloads: m, customRanges: f } = i; if (d) { const g = d.map((p) => p.startIndex + 1); g.unshift(0); for (let p = 0; p < g.length; p++) { let S; if (p === g.length - 1) { if (S = `${u.substring(g[p])}\r `, S === `\r `) continue; } else S = `${u.substring(g[p], g[p + 1] - 1)}\r `; const b = []; h == null || h.forEach((I) => { I.st >= g[p] && I.ed <= g[p + 1] && b.push({ st: I.st - g[p], ed: I.ed - g[p], ts: I.ts }); }); const v = []; f == null || f.forEach((I) => { I.startIndex >= g[p] && I.endIndex <= g[p + 1] && v.push({ ...I, startIndex: I.startIndex - g[p], endIndex: I.endIndex - g[p] }); }); const _ = this._generateDocumentDataModelSnapshot({ body: { dataStream: S, textRuns: b, paragraphs: Ca(S), customRanges: v } }), R = Object.keys(n.getMatrix()).length === 0; n.setValue(R ? 0 : n.getLength(), 0, { v: S, p: _ }), o.push({}); } } else if (u) { const g = `${u}\r `, p = { dataStream: g, textRuns: h, paragraphs: Ca(g), payloads: m, customRanges: f }; if (!(f != null && f.length)) n.setValue(0, 0, ju({ v: u }, u, h)); else { const S = this._generateDocumentDataModelSnapshot({ body: p }); n.setValue(0, 0, ju({ v: u, p: S }, u, h)); } o.push({}); } return a && a.forEach((g, p) => { const S = n.getDataRange().endRow + 1, { cellMatrix: b, rowProperties: v, colProperties: _ } = this._parseTable(g, p); b && b.forValue((R, I, y) => { n.setValue(S + R, I, y); }), _ && l.push(..._), o.push(...v); }), this.dispose(), { rowProperties: o, colProperties: l, cellMatrix: n }; } _getStyleBySelectorText(e, t) { var s; const n = (s = this._styleMap.get(e)) == null ? void 0 : s.getPropertyValue(t); return n || ""; } _getStyle(e, t) { const n = Yu(t), s = e.style; let i = ""; for (let o = 0; o < Xu.length; o++) { const l = Xu[o]; if (l === "background") { let c = ""; e.classList.forEach((u) => { c = this._getStyleBySelectorText(`.${u}`, "background-color") || this._getStyleBySelectorText(`.${u}`, l); }); const d = s.getPropertyValue("background-color") || c || this._getStyleBySelectorText(`#${e.id}`, "background-color") || this._getStyleBySelectorText(`#${e.id}`, l) || this._getStyleBySelectorText(e.nodeName.toLowerCase(), l) || this._getStyleBySelectorText(e.nodeName, "background-color") || n["background-color"] || ""; d && (i += `background:${d};`); continue; } if (l === "text-decoration") { let c = ""; e.classList.forEach((u) => { c = this._getStyleBySelectorText(`.${u}`, "text-decoration-line") || this._getStyleBySelectorText(`.${u}`, l); }); const d = s.getPropertyValue("text-decoration-line") || s.getPropertyValue("text-decoration") || c || this._getStyleBySelectorText(`#${e.id}`, "text-decoration-line") || this._getStyleBySelectorText(`#${e.id}`, l) || this._getStyleBySelectorText(e.nodeName.toLowerCase(), l) || this._getStyleBySelectorText(e.nodeName, "text-decoration-line") || n["text-decoration-line"] || ""; d && (i += `text-decoration:${d};`); continue; } let a = ""; e.classList.forEach((c) => { a = this._getStyleBySelectorText(`.${c}`, l); }), a = s.getPropertyValue(l) || this._getStyleBySelectorText(`#${e.id}`, l) || a || this._getStyleBySelectorText(e.nodeName.toLowerCase(), l) || n[l] || "", a && (i += `${l}:${a};`); } return i; } _parseTable(e, t) { var l, a; const n = new Ke(), s = (l = W1(e)) != null ? l : [], { rowProperties: i = [] } = L1(e), o = this._parseTableByHtml(this._dom, t, (a = this._getCurrentSkeleton()) == null ? void 0 : a.skeleton); return o && o.forValue((c, d, u) => { var f, g, p, S, b, v, _, R, I, y, M, P, E, T, A, H, x, k, U, V, N, X, Y, ie; let h = mS(void 0, u.style); if ((S = (p = (g = (f = u == null ? void 0 : u.richTextParma) == null ? void 0 : f.p) == null ? void 0 : g.body) == null ? void 0 : p.textRuns) != null && S.length) { const he = (v = (b = u == null ? void 0 : u.richTextParma) == null ? void 0 : b.v) == null ? void 0 : v.length; for (let ne = 0; ne < ((y = (I = (R = (_ = u == null ? void 0 : u.richTextParma) == null ? void 0 : _.p) == null ? void 0 : R.body) == null ? void 0 : I.textRuns) == null ? void 0 : y.length); ne++) { const pe = (E = (P = (M = u == null ? void 0 : u.richTextParma) == null ? void 0 : M.p) == null ? void 0 : P.body) == null ? void 0 : E.textRuns[ne]; pe.st === 0 && pe.ed === he && (h = { ...pe.ts, ...h }, (H = (A = (T = u == null ? void 0 : u.richTextParma) == null ? void 0 : T.p) == null ? void 0 : A.body) == null || H.textRuns.splice(ne, 1), ne--); } ((V = (U = (k = (x = u == null ? void 0 : u.richTextParma) == null ? void 0 : x.p) == null ? void 0 : k.body) == null ? void 0 : U.textRuns) == null ? void 0 : V.length) === 0 && (u.content = (N = u == null ? void 0 : u.richTextParma) == null ? void 0 : N.v, delete u.richTextParma); } const m = (ie = (Y = (X = u == null ? void 0 : u.richTextParma) == null ? void 0 : X.p) == null ? void 0 : Y.body) != null && ie.textRuns ? { v: u.richTextParma.v, p: u.richTextParma.p, s: h, rowSpan: u.rowSpan, colSpan: u.colSpan } : { v: u.content, s: h, rowSpan: u.rowSpan, colSpan: u.colSpan }; n.setValue(c, d, m); }), { rowProperties: i, colProperties: s, cellMatrix: n }; } _parseTableByHtml(e, t, n) { var a, c; const s = new Ke(), i = e.querySelectorAll("table")[t]; if (!i) return s; const o = this._getStyle(i, ""), l = i == null ? void 0 : i.querySelectorAll("tr"); for (let d = 0; d < l.length; d++) { const u = l[d], h = this._getStyle(u, o), m = u.querySelectorAll("td, th"); let f = 0; for (let g = 0; g < m.length; ) { const p = m[g]; let S = ""; const b = Number(p.getAttribute("rowSpan")) || 1, v = Number(p.getAttribute("colSpan")) || 1; if (S = this._getStyle(p, h), d > 0) { const y = s.getValue(d - 1, f); if ((a = y == null ? void 0 : y.style) != null && a.includes("border-bottom") && S.includes("border-top")) { const M = Zu(y.style, "border-bottom"); M && fu(M.substr(M.indexOf(":") + 1)) !== "none" && (S = S.replace(/border-top:[^;]+;/, "")); } } if (g > 0) { const y = s.getValue(d, f - 1); if ((c = y == null ? void 0 : y.style) != null && c.includes("border-right") && S.includes("border-left")) { const M = Zu(y.style, "border-right"); M && fu(M.substr(M.indexOf(":") + 1)) !== "none" && (S = S.replace(/border-left:[^;]+;/, "")); } } const { cellText: _, cellRichStyle: R } = this._getCellTextAndRichText(p, S, n), I = { rowSpan: b, colSpan: v, content: _, style: S, richTextParma: { p: R, v: _ } }; if (s.getValue(d, f)) { f += 1; continue; } else b > 1 || v > 1 ? F1(s, S, I, { colSpan: v, rowSpan: b, rowIndex: d, colIndex: g, colSetValueIndex: f }) : s.setValue(d, f, I), f += v, g++; } } return s; } _parseCellHtml(e, t, n, s = /* @__PURE__ */ new Map(), i) { var o; for (const l of t) if (l.nodeType === Node.TEXT_NODE) { const a = (o = l.nodeValue) == null ? void 0 : o.replace(/[\r\n]/g, ""); let c; e && s.has(e) && (c = s.get(e)), n.dataStream += a, c && Object.getOwnPropertyNames(c).length && n.textRuns.push({ st: n.dataStream.length - a.length, ed: n.dataStream.length, ts: c }); } else { if (l.nodeType === Node.COMMENT_NODE || l.nodeName === "STYLE") continue; if (l.nodeType === Node.ELEMENT_NODE) { const a = this._getStyle(l, i), c = e ? s.get(e) : {}, d = Yu(a), u = Wo(l, d); s.set(l, { ...c, ...u }); const { childNodes: h } = l; this._parseCellHtml(l, h, n, s, a); } } } _getCellTextAndRichText(e, t, n) { var l; let s = "", i; if (/<[^>]+>/.test(e.innerHTML) && n) { const a = { dataStream: "", textRuns: [] }; this._parseCellHtml(null, e.childNodes, a, void 0, t); const c = (l = n.getBlankCellDocumentModel()) == null ? void 0 : l.documentModel, d = c == null ? void 0 : c.getSnapshot(), u = `${a.dataStream}\r `, h = { ...d, body: { dataStream: u, textRuns: a.textRuns, paragraphs: Ca(u) } }; c == null || c.reset(h), i = c == null ? void 0 : c.getSnapshot(), s = a.dataStream; } else s = B1(e.innerHTML.replace(/[\r\n]/g, "")); return { cellText: s, cellRichStyle: i }; } _generateDocumentDataModelSnapshot(e) { var l; const t = this._getCurrentSkeleton(); if (t == null) return null; const { skeleton: n } = t, s = (l = n.getBlankCellDocumentModel()) == null ? void 0 : l.documentModel, o = { ...s == null ? void 0 : s.getSnapshot(), ...e }; return s == null || s.reset(o), s == null ? void 0 : s.getSnapshot(); } process(e, t, n, s) { var i, o, l; for (const a of t) if (a.nodeName.toLowerCase() === "table") s.push({ index: ((i = n == null ? void 0 : n.paragraphs) == null ? void 0 : i.length) || 0 }); else if (a.nodeType === Node.TEXT_NODE) { if (((o = a.nodeValue) == null ? void 0 : o.trim()) === "") continue; const c = (l = a.nodeValue) == null ? void 0 : l.replace(/[\r\n]/g, ""); let d; e && this._styleCache.has(e) && (d = this._styleCache.get(e)); const u = { dataStream: "", textRuns: [] }; n.dataStream += c, u.dataStream += c, d && Object.getOwnPropertyNames(d).length && (n.textRuns.push({ st: n.dataStream.length - c.length, ed: n.dataStream.length, ts: d }), u.textRuns.push({ st: n.dataStream.length - c.length, ed: n.dataStream.length, ts: d })); } else { if (Wp.includes(a.nodeName.toLowerCase())) continue; if (a.nodeName.toLowerCase() === "br") n.paragraphs || (n.paragraphs = []), n.paragraphs.push({ startIndex: n.dataStream.length }), n.dataStream += "\r"; else if (a.nodeType === Node.ELEMENT_NODE) { if (a.nodeName === "STYLE") continue; const c = a, d = this._processBeforeLink(c, { body: n }), u = e ? this._styleCache.get(e) : {}, h = this._styleRules.find(({ filter: p }) => zu(a, p)), m = h ? h.getStyle(a) : Wo(a); this._styleCache.set(a, { ...u, ...m }); const { childNodes: f } = a; this.process(a, f, n, s); const g = this._afterProcessRules.find( ({ filter: p }) => zu(a, p) ); g && g.handler(n, a), this._processAfterLink(c, { body: n }, d); } } } _processBeforeLink(e, t) { return t.body.dataStream.length; } _processAfterLink(e, t, n) { var o, l; const s = t.body, i = e; i.tagName.toUpperCase() === "A" && (s.customRanges = (o = s.customRanges) != null ? o : [], s.customRanges.push({ startIndex: n, endIndex: s.dataStream.length - 1, rangeId: (l = i.dataset.rangeid) != null ? l : Dh(), rangeType: $c.HYPERLINK, properties: { url: i.href } })); } dispose() { this._dom = null, this._styleCache.clear(), this._styleMap.clear(); } }; w(gl, "_pluginList", []); let us = gl; function L1(r) { const e = /([\s\S]*?)<\/tr>/gi, t = r.matchAll(e); if (!t) return { rowProperties: [], rowCount: 0 }; const s = Array.from(t).map((i) => wf(i[1])).map((i) => { if (!i.height) { const o = i.style, l = o && o.match(/height\s*:\s*(\d+(\.\d+)?)px/); i.height = `${l ? Number.parseInt(l[1], 10) : oc}`; } return i; }); return { rowProperties: s, rowCount: s.length }; } function Yu(r) { const e = {}; return r.split(";").forEach((n) => { const [s, i] = n.split(":"); e[s] = i; }), e; } function wf(r) { if (!r) return {}; const e = {}, t = /([\w-]+)\s*=\s*(?:(['"])([^'"]*)\2|(\S+))/g; let n; for (; (n = t.exec(r)) !== null; ) { const [, s, , i, o] = n, l = i !== void 0 ? i : o; e[s] = l; } return e; } function W1(r) { const e = /(.*?)<\/colgroup>/, t = r.match(e), n = //g; let s; if (t != null && t[2] ? s = t[2].matchAll(n) : s = r.matchAll(n), !s) return null; const i = Array.from(s).map((l) => wf(l[1])), o = []; return i.forEach((l) => { const a = Number(l.span); if (a) for (let c = 0; c < a; c++) { const d = { ...l }; delete d.span, o.push(d); } else o.push(l); }), o; } function B1(r) { const e = { "<": "<", ">": ">", "&": "&", """: '"', "'": "'", " ": " " }; return r.replace(/<|>|&|"|'| |
/g, (t) => e[t]); } function Zu(r, e) { if (!r || !e) return null; const t = new RegExp(`(${e}\\s*:\\s*[^;]+);`, "i"), n = r.match(t); return n ? n[1] : null; } function F1(r, e, t, n) { const { rowSpan: s, colSpan: i, rowIndex: o, colSetValueIndex: l } = n; for (let a = o; a < o + s; a++) for (let c = l; c < l + i; c++) a === o && c === l ? r.setValue(a, c, { ...t, style: e }) : r.setValue(a, c, { style: e }); } const U1 = { name: "univer-doc-paste-plugin-lark", checkPasteType(r) { return /lark-record-clipboard/i.test(r); }, // TODO: @JOCS, support inline code copy from lark. stylesRules: [ { filter: ["s"], getStyle(r) { const e = Wo(r); return { st: { s: Qe.TRUE }, ...e }; } } ], afterProcessRules: [ { filter(r) { return r.tagName === "DIV" && /ace-line/i.test(r.className); }, handler(r) { r.paragraphs == null && (r.paragraphs = []), r.paragraphs.push({ startIndex: r.dataStream.length }), r.dataStream += "\r"; } } ] }, j1 = { name: "univer-doc-paste-plugin-univer", checkPasteType(r) { return /UniverNormal/i.test(r); }, stylesRules: [], afterProcessRules: [ { filter(r) { return r.tagName === "P" && /UniverNormal/i.test(r.className); }, handler(r, e) { r.paragraphs == null && (r.paragraphs = []); const t = { startIndex: r.dataStream.length }, n = _f(e); n && (t.paragraphStyle = n), r.paragraphs.push(t), r.dataStream += "\r"; } } ] }, X1 = { name: "univer-doc-paste-plugin-word", checkPasteType(r) { return /word|mso/i.test(r); }, stylesRules: [ { filter: ["b"], getStyle(r) { const e = Wo(r); return { bl: Qe.TRUE, ...e }; } } ], afterProcessRules: [ { filter(r) { return r.tagName === "P" && /mso/i.test(r.className); }, handler(r, e) { r.paragraphs == null && (r.paragraphs = []); const t = { startIndex: r.dataStream.length }, n = _f(e); n && (t.paragraphStyle = n), r.paragraphs.push(t), r.dataStream += "\r"; } } ] }; var gr = /* @__PURE__ */ ((r) => (r.COPY = "COPY", r.CUT = "CUT", r))(gr || {}); function z1(r, e, t, n, s) { const i = t.map((c) => { var d; return (d = c.onCopyRow) == null ? void 0 : d.call(c, r); }).filter((c) => !!c), o = Dd(i), l = Ld(o), a = e.map((c) => { if (!s.has(`${r}-${c}`)) { const d = n.getValue(r, c); if (d != null && d.rowSpan && (d != null && d.colSpan)) for (let u = r; u < r + d.rowSpan; u++) for (let h = c; h < c + d.colSpan; h++) s.add(`${u}-${h}`); return Y1(r, c, t, n); } return null; }).filter((c) => !!c).join(""); return `${a}`; } function Y1(r, e, t, n) { const s = n.getValue(r, e), i = t.map((c) => { var d; return (d = c.onCopyCellStyle) == null ? void 0 : d.call(c, r, e, s == null ? void 0 : s.rowSpan, s == null ? void 0 : s.colSpan); }).filter((c) => !!c), o = Dd(i), l = Ld(o), a = t.reduce((c, d) => { var u; return c || ((u = d.onCopyCellContent) == null ? void 0 : u.call(d, r, e)) || ""; }, ""); return `${a}`; } function Z1(r, e) { return `${r.map((n) => { const s = e.map((l) => { var a; return (a = l.onCopyColumn) == null ? void 0 : a.call(l, n); }).filter((l) => !!l), i = Dd(s); return ``; }).join("")}`; } function Dd(r) { return r.reduce((e, t) => (Object.keys(t).forEach((s) => { e[s] ? e[s] += `;${t[s]}` : e[s] = t[s]; }), e), {}); } function Ld(r) { return Object.keys(r).reduce((e, t) => (e += ` ${t}="${r[t]}"`, e), ""); } class G1 { convert(e, t, n) { const { cols: s, rows: i } = t; if (!s.length) return ""; const o = Z1(s, n), l = [], a = /* @__PURE__ */ new Set(); return i.forEach((d) => { l.push(z1(d, s, n, e, a)); }), `${o} ${l.join("")}
`; } } const sE = (r, e, t = !1) => { const n = (u) => u.endRow - u.startRow + 1, s = (u) => u.endColumn - u.startColumn + 1, i = n(e) % n(r), o = s(e) % s(r), l = { startRow: 0, endRow: n(r) - 1, startColumn: 0, endColumn: s(r) - 1 }, a = Math.floor(n(e) / n(r)), c = Math.floor(s(e) / s(r)), d = []; if (!i && !o) for (let u = 1; u <= a; u++) for (let h = 1; h <= c; h++) { const m = n(r) * (u - 1), f = s(r) * (h - 1), g = { startRow: m + e.startRow, endRow: m + e.startRow, startColumn: f + e.startColumn, endColumn: f + e.startColumn }; d.push({ repeatRelativeRange: l, startRange: g }); } else if (!i && o && !t) for (let u = 1; u <= a; u++) { const h = n(r) * (u - 1), m = 0, f = { startRow: h + e.startRow, endRow: h + e.startRow, startColumn: m + e.startColumn, endColumn: m + e.startColumn }; d.push({ repeatRelativeRange: l, startRange: f }); } else if (i && !o && !t) for (let u = 1; u <= c; u++) { const m = s(r) * (u - 1), f = { startRow: 0 + e.startRow, endRow: 0 + e.startRow, startColumn: m + e.startColumn, endColumn: m + e.startColumn }; d.push({ repeatRelativeRange: l, startRange: f }); } else { const u = { startRow: e.startRow, endRow: e.startRow, startColumn: e.startColumn, endColumn: e.startColumn }; d.push({ startRange: u, repeatRelativeRange: l }); } return d; }; async function q1(r) { return r ? /]*class=".*?xl.*?"[^>]*>.*?<\/td>/.test(r) : !1; } function Q1(...r) { if (r.length === 1) return r[0]; const e = new Ke(); return r.forEach((t) => { t && new Ke(t).forValue((s, i, o) => { e.setValue(s, i, { ...e.getValue(s, i), ...o }); }); }), e.getMatrix(); } function K1(r, e) { return r.id === e.id && r.params.unitId === e.params.unitId && r.params.subUnitId === e.params.subUnitId; } function Gu(r) { const e = []; for (let t = 0; t < r.length; ) { let n = 1; if (r[t].id === Se.id) { const s = r[t], i = [s]; for (; t + n < r.length && K1(s, r[t + n]); ) i.push(r[t + n]), n += 1; const o = Q1(...i.map((l) => l.params.cellValue || {})); e.push({ ...s, params: { ...s.params, cellValue: o } }); } else e.push(r[t]); t += n; } return e; } function va(r, e) { const { startRow: t, endRow: n, startColumn: s, endColumn: i } = r; for (let o = t; o <= n; o++) for (let l = s; l <= i; l++) if (e.rows.includes(o) && e.cols.includes(l)) return !0; } function qu(r, e) { const { startRow: t, endRow: n, startColumn: s, endColumn: i } = e; for (let o = t; o <= n; o++) if (!r.rows.includes(o)) return !1; for (let o = s; o <= i; o++) if (!r.cols.includes(o)) return !1; return !0; } function J1(r) { const e = r.trim().split(` `); let t = ""; return e.forEach((n) => { const s = n.split(" "); t += "", s.forEach((i) => { t += ``; }), t += ""; }), t += "
${i}
", t; } var $1 = Object.defineProperty, eb = Object.getOwnPropertyDescriptor, tb = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? eb(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && $1(e, t, s), s; }, Mt = (r, e) => (t, n) => e(t, n, r); const rt = { DEFAULT_COPY: "default-copy", DEFAULT_PASTE: "default-paste", SPECIAL_PASTE_VALUE: "special-paste-value", SPECIAL_PASTE_FORMAT: "special-paste-format", SPECIAL_PASTE_COL_WIDTH: "special-paste-col-width", SPECIAL_PASTE_BESIDES_BORDER: "special-paste-besides-border", SPECIAL_PASTE_FORMULA: "special-paste-formula" }; us.use(X1); us.use(U1); us.use(j1); const Sn = gn("sheet.clipboard-service"); let Bo = class extends ce { constructor(e, t, n, s, i, o, l, a, c, d, u, h, m, f) { super(); w(this, "_clipboardHooks", []); w(this, "_clipboardHooks$", new Me([])); w(this, "clipboardHooks$", this._clipboardHooks$.asObservable()); w(this, "_htmlToUSM"); w(this, "_usmToHtml"); w(this, "_copyContentCache"); w(this, "_copyMarkId", null); // Record the parsed matrix and row and column attributes w(this, "_pasteOptionsCache$", new Me(null)); w(this, "pasteOptionsCache$", this._pasteOptionsCache$.asObservable()); //Control the visibility of the Paste Options menu w(this, "_showMenu$", new xe()); w(this, "showMenu$", this._showMenu$.asObservable()); this._logService = e, this._univerInstanceService = t, this._selectionManagerService = n, this._clipboardInterfaceService = s, this._undoRedoService = i, this._commandService = o, this._markSelectionService = l, this._notificationService = a, this._platformService = c, this._renderManagerService = d, this._themeService = u, this._localeService = h, this._errorService = m, this._injector = f, this._htmlToUSM = new us({ getCurrentSkeleton: () => { var g; return (g = this._renderManagerService.withCurrentTypeOfUnit(O.UNIVER_SHEET, me)) == null ? void 0 : g.getCurrent(); } }), this._usmToHtml = new G1(), this._copyContentCache = new V1(), this.disposeWithMe(this._htmlToUSM), this._initUnitDisposed(); } setShowMenu(e) { this._showMenu$.next(e); } copyContentCache() { return this._copyContentCache; } generateCopyContent(e, t, n) { const s = this._clipboardHooks; s.forEach((o) => { var l; return (l = o.onBeforeCopy) == null ? void 0 : l.call(o, e, t, n); }); const i = this._generateCopyContent(e, t, n, s); return s.forEach((o) => { var l; return (l = o.onAfterCopy) == null ? void 0 : l.call(o); }), i; } async copy(e = gr.COPY) { const t = this._selectionManagerService.getCurrentLastSelection(); if (!t) return !1; const n = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET), s = n.getActiveSheet(); if (!s) return !1; const i = this.generateCopyContent(n.getUnitId(), s.getSheetId(), t.range); if (!i) return !1; const { html: o, plain: l, matrixFragment: a, copyId: c, discreteRange: d } = i; this._copyContentCache.set(c, { unitId: n.getUnitId(), subUnitId: s.getSheetId(), range: d, matrix: a, copyType: e }), await this._clipboardInterfaceService.write(l, o), this._markSelectionService.removeAllShapes(); const u = bf(this._themeService); return this._copyMarkId = this._markSelectionService.addShape({ ...t, style: u }), !0; } async cut() { return this.copy(gr.CUT); } async paste(e, t = rt.DEFAULT_PASTE) { const n = e.types, s = n.indexOf(gu) !== -1 ? await e.getType(gu).then((o) => o && o.text()) : "", i = n.indexOf(pu) !== -1 ? await e.getType(pu).then((o) => o && o.text()) : ""; return i ? (this._platformService.isWindows && await q1(i) && this._notificationService.show({ type: "warning", title: this._localeService.t("clipboard.shortCutNotify.title"), content: this._localeService.t("clipboard.shortCutNotify.useShortCutInstead") }), this._pasteHTML(i, t)) : s ? this._pastePlainText(s, t) : (this._logService.error("[SheetClipboardService]", "No valid data on clipboard"), !1); } legacyPaste(e, t) { return e ? this._pasteHTML(e, rt.DEFAULT_PASTE) : t ? /[\n\t]/.test(t) ? this._pasteHTML(J1(t), rt.DEFAULT_PASTE) : this._pastePlainText(t, rt.DEFAULT_PASTE) : Promise.resolve(!1); } rePasteWithPasteType(e) { const t = this._pasteOptionsCache$.getValue(); if (!t) return !1; const n = this._injector.get(Zt), s = n.pitchTopUndoElement(); s && pl(s.undoMutations, this._commandService) && n.popUndoToRedo(); const { cellMatrix: i, rowProperties: o = [], colProperties: l = [], source: a, target: c } = t; return this._pasteUSM({ cellMatrix: i, colProperties: l, rowProperties: o }, c, rt[e], a), !0; } updatePasteOptionsCache(e) { this._pasteOptionsCache$.next(e); } addClipboardHook(e) { if (this._clipboardHooks.findIndex((n) => n.id === e.id) !== -1) return this._logService.error("[SheetClipboardService]", "hook already exists", e.id), { dispose: () => { } }; const t = this._clipboardHooks.findIndex((n) => { const s = n.priority || 0; return (e.priority || 0) < s; }); return this._clipboardHooks.splice(t !== -1 ? t : this._clipboardHooks.length, 0, e), this._notifyClipboardHook(), Ae(() => { const n = this._clipboardHooks.indexOf(e); n > -1 && (this._clipboardHooks.splice(n, 1), this._notifyClipboardHook()); }); } getClipboardHooks() { return this._clipboardHooks; } _generateCopyContent(e, t, n, s) { const i = this._univerInstanceService.getUniverSheetInstance(e), o = i == null ? void 0 : i.getSheetBySheetId(t); if (!i || !o) return null; const l = s.reduce((_, R) => { var y; const I = (y = R.getFilteredOutRows) == null ? void 0 : y.call(R, n); return I == null || I.forEach((M) => _.add(M)), _; }, /* @__PURE__ */ new Set()), { startColumn: a, startRow: c, endColumn: d, endRow: u } = n, h = o.getMatrixWithMergedCells(c, a, u, d, Lh.Both), m = new Ke(); let f = c; const g = new Ke(), p = { rows: [], cols: [] }; for (let _ = c; _ <= u; _++) if (!l.has(_)) { p.rows.push(_); for (let R = a; R <= d; R++) { const I = h.getValue(_, R); if (I) { const y = se.deepClone(I); g.setValue(f - c, R - a, { ...As(), ...y }), delete y.displayV, m.setValue(f - c, R - a, { ...As(), ...y }); } else g.setValue(f - c, R - a, As()), m.setValue(f - c, R - a, As()), h.setValue(_, R, As()); } f += 1; } for (let _ = a; _ <= d; _++) p.cols.push(_); let S = this._usmToHtml.convert(h, p, s); const b = nb(g), v = N1(); return S = S.replace(/(<[a-z]+)/, (_, R) => `${R} data-copy-id="${v}"`), { copyId: v, plain: b, html: S, matrixFragment: m, discreteRange: p }; } _notifyClipboardHook() { this._clipboardHooks$.next(this._clipboardHooks); } async _pastePlainText(e, t) { const n = this._getPastingTarget(); if (!n.subUnitId || !n.selection) return !1; const s = this._injector.invoke((m) => Ys(n.selection.range, m, n.unitId, n.subUnitId)); if (!s) return !1; const { unitId: i, subUnitId: o } = n, l = this._clipboardHooks, a = []; if (l.some( (m) => { var f; return a.push(m) && ((f = m.onBeforePaste) == null ? void 0 : f.call(m, { unitId: i, subUnitId: o, range: s })) === !1; } )) return a.forEach((m) => { var f; return (f = m.onAfterPaste) == null ? void 0 : f.call(m, !1); }), !1; const d = [], u = []; a.forEach((m) => { var g; const f = (g = m.onPastePlainText) == null ? void 0 : g.call( m, { unitId: i, subUnitId: o, range: s }, e, { pasteType: t } ); f && (d.push(...f.redos), u.push(...f.undos)); }); const h = d.every((m) => this._commandService.executeCommand(m.id, m.params)); return h && this._undoRedoService.pushUndoRedo({ unitID: this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET).getUnitId(), undoMutations: u, redoMutations: d }), h; } async _pasteHTML(e, t) { const n = H1(e); return n && this._copyContentCache.get(n) ? this._pasteInternal(n, t) : this._pasteExternal(e, t); } async _pasteExternal(e, t) { var d; const { rowProperties: n, colProperties: s, cellMatrix: i } = this._htmlToUSM.convert(e); if (!i) return !1; const o = this._getPastedRange(i); if (!o) return !1; const l = (d = this._univerInstanceService.getUniverSheetInstance(o.unitId)) == null ? void 0 : d.getSheetBySheetId(o.subUnitId); if (!l) return !1; const a = l == null ? void 0 : l.getMergeData(); return a.length && a.some((h) => va(h, o.pastedRange) && !qu(o.pastedRange, h)) ? (this._errorService.emit(this._localeService.t("clipboard.paste.overlappingMergedCells")), !1) : this._pasteUSM( { rowProperties: n, colProperties: s, cellMatrix: i }, o, t ); } // eslint-disable-next-line max-lines-per-function, complexity async _pasteInternal(e, t) { var R, I; const n = se.deepClone(this._copyContentCache.get(e)), { range: s, matrix: i, unitId: o, subUnitId: l } = n || {}; if (!i || !n || !s || !o || !l || !i || !n) return !1; const a = (R = this._univerInstanceService.getUniverSheetInstance(o)) == null ? void 0 : R.getStyles(); i.forValue((y, M, P) => { if (typeof P.s == "string") { const E = se.deepClone(P); E.s = a == null ? void 0 : a.getStyleByCell(P), i.setValue(y, M, E); } if (P.colSpan || P.rowSpan) for (let E = 0; E < P.rowSpan; E++) for (let T = 0; T < P.colSpan; T++) { if (E === 0 && T === 0) continue; const A = y + E, H = M + T; i.setValue(A, H, { s: a == null ? void 0 : a.getStyleByCell(P) }); } }); const c = this._getPastedRange(i); if (!c) return !1; const d = (I = this._univerInstanceService.getUniverSheetInstance(c.unitId)) == null ? void 0 : I.getSheetBySheetId(c.subUnitId); if (!d) return !1; const u = d == null ? void 0 : d.getMergeData(); if (u && u.some((M) => va(M, c.pastedRange) && !qu(c.pastedRange, M))) return this._errorService.emit(this._localeService.t("clipboard.paste.overlappingMergedCells")), !1; const h = this._univerInstanceService.getUnit(o); if (!h) return !1; const m = h.getSheetBySheetId(l); if (!m) return !1; const f = m.getColumnManager(), g = m.getRowManager(), p = m.getConfig().defaultColumnWidth, S = m.getConfig().defaultRowHeight, b = [], v = []; if (s.cols.forEach((y) => { const M = f.getColumnOrCreate(y); b.push({ width: `${M.w || p}` }); }), s.rows.forEach((y) => { const M = g.getRowOrCreate(y), { ah: P = S, h: E = S } = M, T = Math.max(P, E); v.push({ height: `${T}` }); }), n.copyType === gr.CUT) { const y = c.pastedRange.rows[0], M = s.rows[s.rows.length - 1] - s.rows[0] + y; c.pastedRange.rows = Array.from(new Array(M + 1).keys()).slice(y); } const _ = this._pasteUSM( { cellMatrix: i, colProperties: b, rowProperties: v }, // paste data c, t, { range: s, // paste source unitId: n.unitId, subUnitId: n.subUnitId, copyType: n.copyType, copyId: e } ); return n.copyType === gr.CUT && (this._copyContentCache.set(e, { ...n, matrix: null }), this._copyMarkId && this._markSelectionService.removeShape(this._copyMarkId), this._copyMarkId = null), _; } // eslint-disable-next-line max-lines-per-function _pasteUSM(e, t, n, s) { const { rowProperties: i, colProperties: o, cellMatrix: l } = e, { unitId: a, subUnitId: c, pastedRange: d } = t, u = d.cols.length, h = this._clipboardHooks, m = []; if (h.some( (I) => { var y; return m.push(I) && ((y = I.onBeforePaste) == null ? void 0 : y.call(I, { unitId: a, subUnitId: c, range: d })) === !1; } )) return m.forEach((I) => { var y; return (y = I.onAfterPaste) == null ? void 0 : y.call(I, !1); }), !1; if (!l) return !1; const g = s ? { unitId: s.unitId, subUnitId: s.subUnitId, range: s.range } : null, p = { copyType: (s == null ? void 0 : s.copyType) || gr.COPY, copyId: s == null ? void 0 : s.copyId, pasteType: n }; let S = [], b = []; const v = m.filter( (I) => !I.specialPasteInfo && I.id !== rt.DEFAULT_PASTE || n === I.id ); v.forEach((I) => { var P, E, T; if (i) { const A = (P = I.onPasteRows) == null ? void 0 : P.call(I, { range: d, unitId: a, subUnitId: c }, i, { pasteType: n }); A && (S.push(...A.redos), b.push(...A.undos)); } const y = (E = I.onPasteColumns) == null ? void 0 : E.call( I, { range: d, unitId: a, subUnitId: c }, o || new Array(u).map(() => ({})), { pasteType: n } ); y && (S.push(...y.redos), b.push(...y.undos)); const M = (T = I.onPasteCells) == null ? void 0 : T.call( I, g, { range: d, unitId: a, subUnitId: c }, l, p ); M && (S.push(...M.redos), b.push(...M.undos)); }); const _ = this._getSetSelectionOperation(a, c, d, l, n); _ && S.push(_), S = Gu(S), b = Gu(b), b.push({ id: et.id, params: { unitId: t.unitId, subUnitId: t.subUnitId } }), this._logService.log("[SheetClipboardService]", "pasting mutations", { undoMutationsInfo: b, redoMutationsInfo: S }); const R = S.every((I) => this._commandService.syncExecuteCommand(I.id, I.params)); return R && (this._undoRedoService.pushUndoRedo({ unitID: a, undoMutations: b, redoMutations: S }), this.updatePasteOptionsCache({ target: { pastedRange: d, unitId: a, subUnitId: c }, cellMatrix: l, rowProperties: i, colProperties: o, pasteType: n, source: s }), this.setShowMenu(!0)), v.forEach((I) => { var y; return (y = I.onAfterPaste) == null ? void 0 : y.call(I, R); }), R; } _getSetSelectionOperation(e, t, n, s, i) { var _; const o = (_ = this._univerInstanceService.getUniverSheetInstance(e)) == null ? void 0 : _.getSheetBySheetId(t); if (!o) return null; const { rows: l, cols: a } = n, c = l[0], d = a[0], u = l[l.length - 1], h = a[a.length - 1], f = rm({ startRow: c, endRow: c, startColumn: d, endColumn: d }, o), g = s.getValue(0, 0), p = (g == null ? void 0 : g.rowSpan) || 1, S = (g == null ? void 0 : g.colSpan) || 1; if ((i === rt.DEFAULT_PASTE || i === rt.SPECIAL_PASTE_BESIDES_BORDER || i === rt.SPECIAL_PASTE_FORMAT) && (p > 1 || S > 1)) { const R = { startRow: c, endRow: c + p - 1, startColumn: d, endColumn: d + S - 1 }; f.startRow = R.startRow, f.endRow = R.endRow, f.startColumn = R.startColumn, f.endColumn = R.endColumn, f.isMerged = !0, f.isMergedMainCell = !0; } const v = { unitId: e, subUnitId: t, selections: [{ range: { startRow: c, endRow: u, startColumn: d, endColumn: h }, primary: f, style: null }] }; return { id: He.id, params: v }; } _getPastingTarget() { const e = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET), t = e.getActiveSheet(), n = this._selectionManagerService.getCurrentLastSelection(); return { unitId: e.getUnitId(), subUnitId: t == null ? void 0 : t.getSheetId(), selection: n }; } /** * Handles copying one range to another range, obtained by the following rules * * [Content to be assigned] => [Target range] * * I. There are no merged cells in the upper left corner of the pasted area * * 1. 1 -> 1: 1 => 1 * 2. N -> 1: N => N * 3. 1 -> N: N => N * 4. N1 -> N2: * 1) N1 N2; If not, N1 => N1 (refer to office excel, different from google sheet) * 2) N1> N2: N1 => N1 * * The above four cases can be combined and processed as * * Case 1, 1/2/4-2 merged into N1 => N1 * Case 2, 3/4-1 merge into N1 * X => N2 or Case 1 * * In the end we only need to judge whether N2 is a multiple of N1 * * II. The pasted area contains merged cells * * 1. If N2 is a multiple of N1, * 1) If N2 === N1, paste this area directly and the range remains unchanged. * 2) Otherwise, determine whether other cells are included * 1] If included, tile, the range remains unchanged * 2] If not included, determine whether the source data is a combined cell * 1} If yes, tile, the range remains unchanged * 2} If not, only the content will be pasted, the original style will be discarded, and the scope will remain unchanged. * * 2. If N2 is not a multiple of N1, determine whether the upper left corner cell (merged or non-merged or combined) is consistent with the size of the original data. * 1) If consistent, only paste this area; * 2) If inconsistent, then determine whether the pasted area contains other cells. * 1] If yes, pasting is not allowed and an error will pop up; * 2] If not, only the content will be pasted and the original style will be discarded. * * @param rowCount * @param colCount * @param cellMatrix * @param range */ // eslint-disable-next-line max-lines-per-function, complexity _transformPastedData(e, t, n) { const s = this._getPastingTarget(), { selection: i, unitId: o, subUnitId: l } = s; if (!l || !i) return null; const a = this._injector.invoke((E) => Ys(i.range, E, o, l)); if (!a) return null; const { ranges: [c], mapFunc: d } = _s([a]), { startRow: u, startColumn: h, endRow: m, endColumn: f } = c, g = m - u + 1, p = f - h + 1, S = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET), b = S == null ? void 0 : S.getActiveSheet(); if (!b) return null; const _ = b.getMergeData().filter( (E) => a.rows.includes(E.startRow) && a.cols.includes(E.startColumn) ), R = _[0]; let I = 0, y = 0, M = 0, P = 0; if (R && (I = R.startRow, y = R.startColumn, M = R.endRow, P = R.endColumn), g % e === 0 && p % t === 0) if (_.length > 0 && (g !== e || p !== t)) if (I === a.rows[0] && y === a.cols[0] && M === a.rows[g - 1] && P === a.cols[p - 1]) if (ob(n)) for (let T = 0; T < g; T++) for (let A = 0; A < p; A++) { const H = n.getValue(T % e, A % t); H && n.setValue(T, A, H); } else n.forValue((T, A, H) => { H.s = null, delete H.colSpan, delete H.rowSpan; }); else for (let E = 0; E < g; E++) for (let T = 0; T < p; T++) { const A = n.getValue(E % e, T % t); A && n.setValue(E, T, A); } else for (let E = 0; E < g; E++) for (let T = 0; T < p; T++) { const A = n.getValue(E % e, T % t); A && n.setValue(E, T, A); } else if (_.length > 0) { const { row: E, col: T } = d(u, h); if (this._topLeftCellsMatch(e, t, { topRow: E, leftCol: T })) { const H = this._expandOrShrinkRowsCols(o, l, a, t, e); a.rows = H.rows, a.cols = H.cols; } else { if (m > R.endRow || f > R.endColumn) return null; n.forValue((H, x, k) => { k.s = null, delete k.colSpan, delete k.rowSpan; }); } } else { const E = this._expandOrShrinkRowsCols(o, l, a, t, e); a.rows = E.rows, a.cols = E.cols; } return { pastedRange: a, unitId: o, subUnitId: l }; } _getPastedRange(e) { var b; const t = this._getPastingTarget(), { selection: n, unitId: s, subUnitId: i } = t; if (!i || !n) return null; const o = this._injector.invoke((v) => Ys(n.range, v, s, i)); if (!o) return null; const { startColumn: l, endColumn: a, startRow: c, endRow: d } = e.getDataRange(), u = d - c + 1, h = a - l + 1; if (u <= 0 || h <= 0) return null; const m = o.rows.length, f = o.cols.length, g = (b = this._univerInstanceService.getUniverSheetInstance(s)) == null ? void 0 : b.getSheetBySheetId(i); if (!g) return null; const p = g == null ? void 0 : g.getMergeData(); if (m % u === 0 && f % h === 0 && !(p == null ? void 0 : p.some((_) => va(_, o)))) { for (let _ = 0; _ < m; _++) for (let R = 0; R < f; R++) { const I = e.getValue(_ % u, R % h); I && e.setValue(_, R, I); } return { pastedRange: o, unitId: s, subUnitId: i }; } const S = this._expandOrShrinkRowsCols(s, i, o, h, u); return o.rows = S.rows, o.cols = S.cols, { pastedRange: o, unitId: s, subUnitId: i }; } _expandOrShrinkRowsCols(e, t, n, s, i) { const { rows: o, cols: l } = n, a = this._univerInstanceService.getUniverSheetInstance(e), c = a == null ? void 0 : a.getSheetBySheetId(t); let d, u; if (o.length >= i) d = o.slice(0, i); else { d = o.slice(0); let h = o[o.length - 1] + 1; for (; d.length < i; ) c.getRowFiltered(h) || d.push(h), h++; } if (l.length >= s) u = l.slice(0, s); else { u = l.slice(0); let h = l[l.length - 1] + 1; for (; u.length < s; ) u.push(h), h++; } return { rows: d, cols: u }; } /** * Determine whether the cells starting from the upper left corner of the range (merged or non-merged or combined) are consistent with the size of the original data * @param cellMatrix * @param range */ _topLeftCellsMatch(e, t, n) { const s = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET), i = s == null ? void 0 : s.getActiveSheet(); if (!i) return !1; const { topRow: o, leftCol: l } = n, a = sb( o + e - 1, l, l + t - 1, i ), c = ib( l + t - 1, o, o + e - 1, i ); return !a && !c; } removeMarkSelection() { this._copyMarkId && (this._markSelectionService.removeShape(this._copyMarkId), this._copyMarkId = null); } _initUnitDisposed() { this.disposeWithMe( this._univerInstanceService.getTypeOfUnitDisposed$(O.UNIVER_SHEET).subscribe((e) => { e && this.copyContentCache().clearWithUnitId(e.getUnitId()); }) ); } disposePasteOptionsCache() { this.setShowMenu(!1), this.updatePasteOptionsCache(null); } }; Bo = tb([ Mt(0, vl), Mt(1, L), Mt(2, D($)), Mt(3, wl), Mt(4, Zt), Mt(5, F), Mt(6, ws), Mt(7, fS), Mt(8, gS), Mt(9, Ce), Mt(10, D(kt)), Mt(11, D(Ee)), Mt(12, D(Bp)), Mt(13, D(vt)) ], Bo); function nb(r) { let e = ""; const t = r.getLength(); return r.forRow((n, s) => { const i = []; s.forEach((o) => { const l = r.getValue(n, o); if (l) { const a = rb(l); i.push(a); } }), e += i.join(" "), n !== t - 1 && (e += ` `); }), e; } function rb(r) { return Fp(r.displayV) ? r.displayV : Wh(r); } function sb(r, e, t, n) { return n.getMergeData().some( (s) => s.startRow <= r && r < s.endRow && e <= s.startColumn && s.startColumn <= t ); } function ib(r, e, t, n) { return n.getMergeData().some( (s) => s.startColumn <= r && r < s.endColumn && e <= s.startRow && s.startRow <= t ); } function ob(r) { let e = 0; return r.forValue((t, n, s) => { if (s && e++, e > 1) return !1; }), e > 1; } function As() { return { p: null, v: null, s: null, f: null, si: null, t: null }; } const Wd = 998, hn = { id: pS.id, name: "sheet.command.copy", type: K.COMMAND, multi: !0, priority: Wd, preconditions: kd, handler: async (r) => r.get(Sn).copy() }, Rf = { id: SS.id, name: "sheet.command.cut", type: K.COMMAND, multi: !0, priority: Wd, preconditions: kd, handler: async (r) => r.get(Sn).cut() }, mn = { id: CS.id, type: K.COMMAND, multi: !0, name: "sheet.command.paste", priority: Wd, preconditions: kd, handler: async (r, e) => { const n = await r.get(wl).read(), s = r.get(Sn); return n.length !== 0 ? s.paste(n[0], e == null ? void 0 : e.value) : !1; } }, xc = { id: vS, type: K.COMMAND, handler: async (r, e) => { const t = r.get(Sn), { htmlContent: n, textContent: s } = e; return t.legacyPaste(n, s), !0; } }, Gs = { id: "sheet.command.paste-value", type: K.COMMAND, handler: async (r) => r.get(F).executeCommand(mn.id, { value: rt.SPECIAL_PASTE_VALUE }) }, qs = { id: "sheet.command.paste-format", type: K.COMMAND, handler: async (r) => r.get(F).executeCommand(mn.id, { value: rt.SPECIAL_PASTE_FORMAT }) }, Jr = { id: "sheet.command.paste-col-width", type: K.COMMAND, handler: async (r) => r.get(F).executeCommand(mn.id, { value: rt.SPECIAL_PASTE_COL_WIDTH }) }, Qs = { id: "sheet.command.paste-besides-border", type: K.COMMAND, handler: async (r) => r.get(F).executeCommand(mn.id, { value: rt.SPECIAL_PASTE_BESIDES_BORDER }) }, If = { id: "sheet.command.optional-paste", type: K.COMMAND, handler: async (r, { type: e }) => r.get(Sn).rePasteWithPasteType(e) }, Ul = { id: "sheet.command.hide-row-confirm", type: K.COMMAND, handler: async (r) => { var a; const t = (a = r.get($).getCurrentSelections()) == null ? void 0 : a.map((c) => c.range); if (!(t != null && t.length)) return !1; const n = r.get(F), s = r.get(L), i = Ue(s); if (!i) return !1; const { worksheet: o } = i, l = o.getVisibleRows(); if (rf(l, t)) { const c = r.get(tn), d = r.get(Ee); return await c.confirm({ id: "sheet.confirm.hide-row", title: { title: d.t("info.problem") }, children: { title: d.t("rightClick.hideAllRowsAlert") }, cancelText: d.t("button.cancel"), confirmText: d.t("button.confirm") }), !1; } return await n.executeCommand(sm.id), !0; } }, jl = { id: "sheet.command.hide-col-confirm", type: K.COMMAND, handler: async (r) => { var a; const t = (a = r.get($).getCurrentSelections()) == null ? void 0 : a.map((c) => c.range); if (!(t != null && t.length)) return !1; const n = r.get(F), s = r.get(L), i = Ue(s); if (!i) return !1; const { worksheet: o } = i, l = o.getVisibleCols(); if (sf(l, t)) { const c = r.get(tn), d = r.get(Ee); return await c.confirm({ id: "sheet.confirm.hide-col", title: { title: d.t("info.problem") }, children: { title: d.t("rightClick.hideAllColumnsAlert") }, cancelText: d.t("button.cancel"), confirmText: d.t("button.confirm") }), !1; } return await n.executeCommand(im.id), !0; } }, Rs = { type: K.COMMAND, id: "sheet.command.set-range-bold", handler: async (r) => { const e = r.get(F); return r.get(Ne).getContextValue(Je) ? e.executeCommand(_p.id) : e.executeCommand(ud.id); } }, Is = { type: K.COMMAND, id: "sheet.command.set-range-italic", handler: async (r) => { const e = r.get(F); return r.get(Ne).getContextValue(Je) ? e.executeCommand(wp.id) : e.executeCommand(hd.id); } }, ys = { type: K.COMMAND, id: "sheet.command.set-range-underline", handler: async (r) => { const e = r.get(F); return r.get(Ne).getContextValue(Je) ? e.executeCommand(Rp.id) : e.executeCommand(md.id); } }, Ms = { type: K.COMMAND, id: "sheet.command.set-range-stroke", handler: async (r) => { const e = r.get(F); return r.get(Ne).getContextValue(Je) ? e.executeCommand(Ip.id) : e.executeCommand(fd.id); } }, yf = { type: K.COMMAND, id: "sheet.command.set-range-subscript", handler: async (r) => { const e = r.get(F); return r.get(Ne).getContextValue(Je) ? e.executeCommand(yp.id) : !1; } }, Mf = { type: K.COMMAND, id: "sheet.command.set-range-superscript", handler: async (r) => { const e = r.get(F); return r.get(Ne).getContextValue(Je) ? e.executeCommand(Mp.id) : !1; } }, Xl = { type: K.COMMAND, id: "sheet.command.set-range-fontsize", handler: async (r, e) => { const t = r.get(F); return r.get(Ne).getContextValue(Je) ? t.executeCommand(Pp.id, e) : t.executeCommand(gd.id, e); } }, zl = { type: K.COMMAND, id: "sheet.command.set-range-font-family", handler: async (r, e) => { const t = r.get(F); return r.get(Ne).getContextValue(Je) ? t.executeCommand(Ep.id, e) : t.executeCommand(pd.id, e); } }, di = { type: K.COMMAND, id: "sheet.command.set-range-text-color", handler: async (r, e) => { const t = r.get(F); return r.get(Ne).getContextValue(Je) ? t.executeCommand(Oh.id, e) : t.executeCommand(om.id, e); } }, Pf = { type: K.COMMAND, id: "sheet.command.reset-range-text-color", handler: async (r) => { const e = r.get(F), n = r.get(Ne).getContextValue(Je), s = r.get(kt); return n ? e.executeCommand(Oh.id, { value: null }) : e.executeCommand(om.id, { value: s.getCurrentTheme().textColor }); } }; var lb = Object.defineProperty, ab = Object.getOwnPropertyDescriptor, cb = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? ab(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && lb(e, t, s), s; }, Fr = (r, e) => (t, n) => e(t, n, r), zt = /* @__PURE__ */ ((r) => (r[r.OFF = 0] = "OFF", r[r.ONCE = 1] = "ONCE", r[r.INFINITE = 2] = "INFINITE", r))(zt || {}); const Un = gn("univer.format-painter-service"); let Fo = class extends ce { constructor(e, t, n, s, i, o) { super(); w(this, "status$"); w(this, "_selectionFormat"); w(this, "_markId", null); w(this, "_status$"); w(this, "_defaultHook", null); w(this, "_extendHooks", []); this._selectionManagerService = e, this._themeService = t, this._markSelectionService = n, this._logService = s, this._commandService = i, this._undoRedoService = o, this._status$ = new Me( 0 /* OFF */ ), this.status$ = this._status$.asObservable(), this._selectionFormat = { styles: new Ke(), merges: [] }; } addHook(e) { var t, n, s; e.isDefaultHook && ((t = e.priority) != null ? t : 0) > ((s = (n = this._defaultHook) == null ? void 0 : n.priority) != null ? s : -1) ? this._defaultHook = e : (this._extendHooks.push(e), this._extendHooks.sort((i, o) => (i.priority || 0) - (o.priority || 0))); } getHooks() { return this._defaultHook ? [this._defaultHook, ...this._extendHooks] : this._extendHooks; } setStatus(e) { this._updateRangeMark(e), this._status$.next(e), this.getHooks().forEach((n) => { n.onStatusChange !== void 0 && n.onStatusChange(e); }); } getStatus() { return this._status$.getValue(); } setSelectionFormat(e) { this._selectionFormat = e; } getSelectionFormat() { return this._selectionFormat; } applyFormatPainter(e, t, n) { const s = this.getHooks(), i = [], o = []; s.forEach((a) => { if (a.onApply !== void 0) { const c = a.onApply( e, t, n, this._selectionFormat ); c && (i.push(...c.redos), o.push(...c.undos)); } }); for (const a of s) if (a.onBeforeApply !== void 0 && !a.onBeforeApply({ unitId: e, subUnitId: t, range: n, redoMutationsInfo: i, format: this._selectionFormat, undoMutationsInfo: o })) return !1; this._logService.log("[FormatPainterService]", "apply mutations", { undoMutationsInfo: o, redoMutationsInfo: i }); const l = i.every((a) => this._commandService.executeCommand(a.id, a.params)); return l && this._undoRedoService.pushUndoRedo({ unitID: e, undoMutations: o, redoMutations: i }), l; } _updateRangeMark(e) { if (this._markSelectionService.removeAllShapes(), e !== 0) { const t = this._selectionManagerService.getCurrentLastSelection(); if (t) { const n = bf(this._themeService); e === 2 ? this._markId = this._markSelectionService.addShape({ ...t, style: n }) : this._markId = this._markSelectionService.addShape({ ...t, style: n }, [ Se.id ]); } } } }; Fo = cb([ Fr(0, D($)), Fr(1, D(kt)), Fr(2, ws), Fr(3, vl), Fr(4, F), Fr(5, Zt) ], Fo); const Yl = { id: "sheet.operation.set-format-painter", type: K.OPERATION, handler: (r, e) => e ? (r.get(Un).setStatus(e.status), !0) : !1 }, Bd = { type: K.COMMAND, id: "sheet.command.set-infinite-format-painter", handler: async (r) => { const t = r.get(Un).getStatus(); let n; return t !== zt.OFF ? n = zt.OFF : n = zt.INFINITE, r.get(F).executeCommand(Yl.id, { status: n }); } }, Bi = { type: K.COMMAND, id: "sheet.command.set-once-format-painter", handler: async (r) => { const t = r.get(Un).getStatus(); let n; return t !== zt.OFF ? n = zt.OFF : n = zt.ONCE, r.get(F).executeCommand(Yl.id, { status: n }); } }, Zl = { type: K.COMMAND, id: "sheet.command.apply-format-painter", handler: async (r, e) => r.get(Un).applyFormatPainter(e.unitId, e.subUnitId, e.range) }, $n = { type: K.COMMAND, id: "sheet.command.set-selection-frozen", handler: async (r, e) => { const { type: t } = e || {}, n = r.get(L), s = r.get(Zt), i = Ue(n); if (!i) return !1; const { unitId: o, subUnitId: l } = i, a = r.get(F), d = r.get($).getCurrentSelections(); if (!d) return !1; const u = d[(d == null ? void 0 : d.length) - 1], { range: h } = u, f = r.get(Ce).getRenderById(o).with(yt), { sheetViewStartRow: g = 0, sheetViewStartColumn: p = 0 } = f.getCurrentScrollState() || {}; let S, b, v, _; const { startRow: R, startColumn: I, rangeType: y } = h; if (y === j.ROW || t === 1) S = R, v = R - g, b = -1, _ = 0; else if (y === j.COLUMN || t === 2) S = -1, v = 0, b = I, _ = I - p; else if (y === j.NORMAL) S = R, v = R - g, b = I, _ = I - p; else return !1; const M = { unitId: o, subUnitId: l, startRow: S, startColumn: b, xSplit: b > 0 ? Math.max(1, _) : _, ySplit: S > 0 ? Math.max(1, v) : v }, P = lm(r, M); return a.syncExecuteCommand(vr.id, M) && s.pushUndoRedo({ unitID: o, undoMutations: [{ id: vr.id, params: P }], redoMutations: [{ id: vr.id, params: M }] }), !0; } }, Gl = { type: K.COMMAND, id: "sheet.command.set-row-frozen", handler: async (r) => (r.get(F).executeCommand($n.id, { type: 1 /* Row */ }), !0) }, ql = { type: K.COMMAND, id: "sheet.command.set-col-frozen", handler: async (r) => (r.get(F).executeCommand($n.id, { type: 2 /* Column */ }), !0) }; var db = Object.defineProperty, ub = Object.getOwnPropertyDescriptor, hb = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? ub(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && db(e, t, s), s; }, Qu = (r, e) => (t, n) => e(t, n, r); const mb = (r, e) => { const { unitId: t, subUnitId: n, ranges: s } = r, i = {}, o = e.getColumnManager(); for (let l = 0; l < s.length; l++) { const a = s[l]; for (let c = a.startColumn; c < a.endColumn + 1; c++) { const d = o.getColumnOrCreate(c); i[c] = d.w; } } return { unitId: t, subUnitId: n, ranges: s, colWidth: i }; }; let ui = class extends ce { constructor(r, e) { super(), this._renderManagerService = r, this._univerInstanceService = e; } getUndoRedoParamsOfColWidth(r) { const e = { redos: [], undos: [] }, { _univerInstanceService: t } = this, n = Ue(t); if (!n) return e; const { unitId: s, subUnitId: i, worksheet: o } = n, l = this._renderManagerService.getRenderById(s).with(me); if (!l.getCurrent()) return e; const { skeleton: a } = l.getCurrent(), c = a.calculateAutoWidthInRange(r.ranges), d = {}; for (const { col: m, width: f } of c) d[m] = f; const u = { subUnitId: i, unitId: s, ranges: r.ranges, colWidth: d }, h = mb(u, o); return { undos: [ { id: Qt.id, params: h } ], redos: [ { id: Qt.id, params: u } ] }; } }; ui = hb([ Qu(0, Ce), Qu(1, D(L)) ], ui); const Ql = { type: K.COMMAND, id: "sheet.command.set-col-auto-width", handler: async (r, e) => { const t = r.get(F), n = r.get(Zt), s = r.get($), i = r.get(L), o = Ue(i, e); if (!o) return !1; const { unitId: l, subUnitId: a } = o; let c = []; if (e != null && e.ranges) c = [...e.ranges]; else { const f = s.getCurrentSelections(); for (let g = 0; g < f.length; g++) c.push(f[g].range); } if (!(c != null && c.length)) return !1; const d = { unitId: l, subUnitId: a, ranges: c }, { redos: u, undos: h } = r.get(ui).getUndoRedoParamsOfColWidth(d); return pl([...u], t).result ? (n.pushUndoRedo({ unitID: l, undoMutations: [...h], redoMutations: [...u] }), !0) : !1; } }, Ps = "UI_PLUGIN_SHEETS", Fi = `${Ps}_COLOR_PICKER_COMPONENT`, Fd = `${Ps}_FONT_FAMILY_COMPONENT`, Ud = `${Ps}_FONT_FAMILY_ITEM_COMPONENT`, jd = `${Ps}_FONT_SIZE_COMPONENT`, Kl = `${Ps}_MENU_ITEM_INPUT_COMPONENT`; var ba = { exports: {} }, Ns = {}; /** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Ku; function fb() { if (Ku) return Ns; Ku = 1; var r = od, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, s = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 }; function o(l, a, c) { var d, u = {}, h = null, m = null; c !== void 0 && (h = "" + c), a.key !== void 0 && (h = "" + a.key), a.ref !== void 0 && (m = a.ref); for (d in a) n.call(a, d) && !i.hasOwnProperty(d) && (u[d] = a[d]); if (l && l.defaultProps) for (d in a = l.defaultProps, a) u[d] === void 0 && (u[d] = a[d]); return { $$typeof: e, type: l, key: h, ref: m, props: u, _owner: s.current }; } return Ns.Fragment = t, Ns.jsx = o, Ns.jsxs = o, Ns; } var Ju; function gb() { return Ju || (Ju = 1, ba.exports = fb()), ba.exports; } var C = gb(); const pb = "univer-sheets-ui-context-menu-input", Sb = "univer-sheets-ui-context-menu-input-container", Cb = "univer-sheets-ui-context-menu-input-number", _a = { sheetsUiContextMenuInput: pb, sheetsUiContextMenuInputContainer: Sb, sheetsUiContextMenuInputNumber: Cb }, Ef = (r) => { const { prefix: e, suffix: t, value: n, onChange: s, min: i = Number.MIN_SAFE_INTEGER, max: o = Number.MAX_SAFE_INTEGER } = r, l = W(Ee), a = W(Rl), [c, d] = te(), u = (m) => { var f; d(m == null ? void 0 : m.toString()), s((f = m == null ? void 0 : m.toString()) != null ? f : ""); }; be(() => { a.visible || d(n); }, [a.visible]), be(() => { d(n); }, [n]); function h(m) { m.key === "Backspace" && m.stopPropagation(); } return /* @__PURE__ */ C.jsxs("div", { className: _a.sheetsUiContextMenuInput, children: [ l.t(e), /* @__PURE__ */ C.jsx("span", { className: _a.sheetsUiContextMenuInputContainer, onClick: (m) => m.stopPropagation(), children: /* @__PURE__ */ C.jsx( xC, { className: _a.sheetsUiContextMenuInputNumber, value: Number(c), precision: 0, onKeyDown: h, onChange: u, min: i, max: o } ) }), l.t(t) ] }); }; function vb(r) { return r.getCurrentTypeOfUnit$(O.UNIVER_SHEET).pipe(We((e) => e ? e.activeSheet$.pipe(_e((t) => t ? { workbook: e, worksheet: t } : null)) : Ie(null))); } function xt(r, e, t) { return vb(r).pipe(We((n) => n ? t(n) : Ie(e))); } function bb(r, e) { const t = r.get(L), n = r.get(HS), s = r.get($); return t.getCurrentTypeOfUnit$(O.UNIVER_SHEET).pipe( We((o) => o ? ot([s.selectionMoveEnd$, o.activeSheet$]).pipe( We(([l, a]) => { if (!a) return Ie(!1); if (l.length === 0) return Ie(!1); const c = n.getInterestGroupId(l); if (e) { const d = c.filter((u) => e.has(u)); return Ie(d.length > 0); } else return Ie(c.length > 0); }) ) : Ie(!1)) ); } function Es(r, e, t) { return ot([e, bb(r, t)]).pipe( _e(([n, s]) => n || s) ); } function ue(r, e = {}, t = !1) { var d; const s = r.get(L).getCurrentTypeOfUnit$(O.UNIVER_SHEET), i = r.get(Dt), o = r.has(tt) ? r.get(tt) : null, a = r.get(Ne).subscribeContextValue$(Ht), c = (d = o == null ? void 0 : o.visible$) != null ? d : Ie(null); return ot([i.currentUser$, s, c, a]).pipe( We(([u, h, m, f]) => !h || m != null && m.visible && m.unitId === h.getUnitId() && !t || f && !t ? Ie(!0) : h.activeSheet$.pipe( We((g) => { if (!g) return Ie(!0); const p = r.get($), S = r.get(Ye), b = r.get(ft), _ = r.get(Ne).subscribeContextValue$(Cl).pipe(Vt(!1)); return ot([p.selectionMoveEnd$, _]).pipe( We(([R, I]) => { if (I) return Ie(!0); const y = h.getUnitId(), M = g.getSheetId(), P = r.get($e), { workbookTypes: E = [q], worksheetTypes: T, rangeTypes: A } = e, H = []; if (E == null || E.forEach((V) => { H.push(new V(y).id); }), T == null || T.forEach((V) => { H.push(new V(y, M).id); }), b.getRule(y, M)) return P.composePermission$(H).pipe(_e((V) => V.some((N) => N.value === !1))); const k = R == null ? void 0 : R.map((V) => V.range), U = S.getSubunitRuleList(y, M).filter((V) => k == null ? void 0 : k.some((N) => V.ranges.some((X) => ae.intersects(N, X)))); return A == null || A.forEach((V) => { U.forEach((N) => { H.push(new V(y, M, N.permissionId).id); }); }), P.composePermission$(H).pipe(_e((V) => V.some((N) => N.value === !1))); }) ); }) )) ); } function Jl(r) { const e = r.get(L), t = r.get($), n = r.get(Ye), s = r.get($e); return mt(t.selectionMoveEnd$, s.permissionPointUpdate$.pipe(Ei(100))).pipe( _e(() => { var u; const i = (u = t.getCurrentLastSelection()) == null ? void 0 : u.range; if (!i) return !0; const o = e.getCurrentUnitForType(O.UNIVER_SHEET), l = o == null ? void 0 : o.getActiveSheet(); if (!o || !l) return !0; const a = o.getUnitId(), c = l.getSheetId(), d = [new q(a).id, new ee(a, c).id]; return n.getSubunitRuleList(a, c).filter((h) => h.ranges.some((m) => ae.intersects(i, m))).forEach((h) => { d.push(new re(a, c, h.permissionId).id); }), s.composePermission(d).some((h) => h.value === !1); }) ); } function Tf(r, e) { const t = r.get(L), n = r.get($), s = r.get(Ye), i = r.get($e); return mt(n.selectionMoveEnd$, i.permissionPointUpdate$.pipe(Ei(100))).pipe( _e(() => { var h; const o = (h = n.getCurrentLastSelection()) == null ? void 0 : h.range; if (!o) return !0; const l = t.getCurrentUnitForType(O.UNIVER_SHEET), a = l == null ? void 0 : l.getActiveSheet(); if (!l || !a) return !0; const c = l.getUnitId(), d = a.getSheetId(), u = [new q(c).id, new ee(c, d).id]; return s.getSubunitRuleList(c, d).filter((m) => e === "row" ? m.ranges.some((f) => o.endRow > f.startRow && o.endRow <= f.endRow) : m.ranges.some((f) => o.endColumn > f.startColumn && o.endColumn <= f.endColumn)).forEach((m) => { u.push(new re(c, d, m.permissionId).id); }), i.composePermission(u).some((m) => m.value === !1); }) ); } function xf(r, e) { const t = r.get(L), n = r.get($), s = r.get(Ye), i = r.get($e); return mt(n.selectionMoveEnd$, i.permissionPointUpdate$.pipe(Ei(100))).pipe( _e(() => { var h; const o = (h = n.getCurrentLastSelection()) == null ? void 0 : h.range; if (!o) return !0; const l = t.getCurrentUnitForType(O.UNIVER_SHEET), a = l == null ? void 0 : l.getActiveSheet(); if (!l || !a) return !0; const c = l.getUnitId(), d = a.getSheetId(), u = [new q(c).id, new ee(c, d).id]; return s.getSubunitRuleList(c, d).filter((m) => e === "row" ? m.ranges.some((f) => o.startRow > f.startRow && o.startRow <= f.endRow) : m.ranges.some((f) => o.startColumn > f.startColumn && o.startColumn <= f.endColumn)).forEach((m) => { u.push(new re(c, d, m.permissionId).id); }), i.composePermission(u).some((m) => m.value === !1); }) ); } function Of(r, e) { const t = r.get(L), n = r.get($), s = r.get(Ye), i = r.get($e); return mt(n.selectionMoveEnd$, i.permissionPointUpdate$.pipe(Ei(100))).pipe( _e(() => { var m; const o = (m = n.getCurrentLastSelection()) == null ? void 0 : m.range; if (!o) return !0; const l = t.getCurrentUnitForType(O.UNIVER_SHEET), a = l == null ? void 0 : l.getActiveSheet(); if (!l || !a) return !0; const c = l.getUnitId(), d = a.getSheetId(), u = [new q(c).id, new ee(c, d).id], h = se.deepClone(o); return e === "row" ? (h.startColumn = 0, h.endColumn = a.getColumnCount() - 1) : (h.startRow = 0, h.endRow = a.getRowCount() - 1), s.getSubunitRuleList(c, d).filter((f) => f.ranges.some((g) => ae.intersects(h, g))).forEach((f) => { u.push(new re(c, d, f.permissionId).id); }), i.composePermission(u).some((f) => f.value === !1); }) ); } function $l(r, e) { const t = r.get(L), n = r.get($), s = r.get(Ye), i = r.get($e); return mt(n.selectionMoveEnd$, i.permissionPointUpdate$.pipe(Ei(100))).pipe( _e(() => { var m; const o = (m = n.getCurrentLastSelection()) == null ? void 0 : m.range; if (!o) return !0; const l = t.getCurrentUnitForType(O.UNIVER_SHEET), a = l == null ? void 0 : l.getActiveSheet(); if (!l || !a) return !0; const c = l.getUnitId(), d = a.getSheetId(), u = [new q(c).id, new ee(c, d).id], h = se.deepClone(o); return e === "row" ? h.endRow = a.getRowCount() - 1 : h.endColumn = a.getColumnCount() - 1, s.getSubunitRuleList(c, d).filter((f) => f.ranges.some((g) => ae.intersects(h, g))).forEach((f) => { u.push(new re(c, d, f.permissionId).id); }), i.composePermission(u).some((f) => f.value === !1); }) ); } function Ts(r, e) { const n = r.get(L).getCurrentTypeOfUnit$(O.UNIVER_SHEET), s = r.get(ft), i = r.get(Ye), o = r.get($e), l = r.get(Dt); return ot([l.currentUser$, n]).pipe( We(([a, c]) => c ? c.activeSheet$.pipe( We((d) => { if (!d) return Ie(!0); const u = c.getUnitId(), h = []; return e.forEach((f) => h.push(new f(u).id)), o.composePermission$(h).pipe(_e((f) => f.every((g) => g.value === !0))).pipe( _e((f) => { if (!f) return !0; const g = d.getSheetId(), p = s.getRule(u, g), S = i.getSubunitRuleList(u, g); return !!(p || S.length); }) ); }) ) : Ie(!0)) ); } var _b = /* @__PURE__ */ ((r) => (r.ROW_HEADER_CONTEXT_MENU = "ROW_HEADER_CONTEXT_MENU", r.COL_HEADER_CONTEXT_MENU = "COL_HEADER_CONTEXT_MENU", r.SHEET_BAR = "SHEET_BAR", r.SHEET_FOOTER = "SHEET_FOOTER", r))(_b || {}); function wb(r) { const e = r.get(Un); return { id: Bi.id, subId: Bd.id, type: Q.BUTTON, icon: "BrushSingle", title: "Format Painter", tooltip: "toolbar.formatPainter", activated$: new it((t) => { let n = !1; const s = e.status$.subscribe((i) => { n = i !== zt.OFF, t.next(n); }); return t.next(n), () => { s.unsubscribe(); }; }), hidden$: oe(r, O.UNIVER_SHEET), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [yo, ee], rangeTypes: [re] }, !0) }; } function Rb(r) { const e = r.get(F), t = r.get(L), n = r.get(Ne), s = r.get($); return { id: Rs.id, type: Q.BUTTON, icon: "BoldSingle", title: "Set bold", tooltip: "toolbar.bold", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, ze], rangeTypes: [re] }, !0), activated$: xt(t, !1, ({ worksheet: i }) => new it((o) => { var d; const l = e.onCommandExecuted((u) => { var m, f; const h = u.id; if (h === Se.id || h === He.id || h === et.id) { const g = (m = s.getCurrentLastSelection()) == null ? void 0 : m.primary; let p = Yi.NORMAL; if (g != null) { const S = i.getRange(g.startRow, g.startColumn); p = S == null ? void 0 : S.getFontWeight(); } o.next(p === Yi.BOLD); } if ((h === Vi.id || h === Pi.id) && n.getContextValue(Je) && n.getContextValue(Tt)) { const g = ji(r); if (g == null) return; const p = (f = g.ts) == null ? void 0 : f.bl; o.next(p === Qe.TRUE); } }), a = (d = s.getCurrentLastSelection()) == null ? void 0 : d.primary; if (!i) { o.next(!1); return; } let c = Yi.NORMAL; if (a != null) { const u = i.getRange(a.startRow, a.startColumn); c = u == null ? void 0 : u.getFontWeight(); } return o.next(c === Yi.BOLD), l.dispose; })), hidden$: oe(r, O.UNIVER_SHEET) }; } function Ib(r) { const e = r.get(F), t = r.get(L), n = r.get($), s = r.get(Ne); return { id: Is.id, type: Q.BUTTON, icon: "ItalicSingle", title: "Set italic", tooltip: "toolbar.italic", disabled$: ue( r, { workbookTypes: [q], worksheetTypes: [ee, ze], rangeTypes: [re] }, !0 ), activated$: xt(t, !1, ({ worksheet: i }) => new it((o) => { var d; const l = e.onCommandExecuted((u) => { var m, f; const h = u.id; if (h === Se.id || h === He.id || h === et.id) { const g = (m = n.getCurrentLastSelection()) == null ? void 0 : m.primary; let p = Zi.NORMAL; if (g != null) { const S = i.getRange(g.startRow, g.startColumn); p = S == null ? void 0 : S.getFontStyle(); } o.next(p === Zi.ITALIC); } if ((h === Vi.id || h === Pi.id) && s.getContextValue(Je) && s.getContextValue(Tt)) { const g = ji(r); if (g == null) return; const p = (f = g.ts) == null ? void 0 : f.it; o.next(p === Qe.TRUE); } }), a = (d = n.getCurrentLastSelection()) == null ? void 0 : d.primary; let c = Zi.NORMAL; if (a != null) { const u = i.getRange(a.startRow, a.startColumn); c = u == null ? void 0 : u.getFontStyle(); } return o.next(c === Zi.ITALIC), l.dispose; })), hidden$: oe(r, O.UNIVER_SHEET) }; } function yb(r) { const e = r.get(F), t = r.get(L), n = r.get($), s = r.get(Ne); return { id: ys.id, type: Q.BUTTON, icon: "UnderlineSingle", title: "Set underline", tooltip: "toolbar.underline", activated$: xt(t, !1, ({ worksheet: i }) => new it((o) => { var d; const l = e.onCommandExecuted((u) => { var m, f; const h = u.id; if (h === Se.id || h === He.id || h === et.id) { const g = (m = n.getCurrentLastSelection()) == null ? void 0 : m.primary; let p; if (g != null) { const S = i.getRange(g.startRow, g.startColumn); p = S == null ? void 0 : S.getUnderline(); } o.next(!!(p && p.s)); } if ((h === Vi.id || h === Pi.id) && s.getContextValue(Je) && s.getContextValue(Tt)) { const g = ji(r); if (g == null) return; const p = (f = g.ts) == null ? void 0 : f.ul; o.next((p == null ? void 0 : p.s) === Qe.TRUE); } }), a = (d = n.getCurrentLastSelection()) == null ? void 0 : d.primary; let c; if (a != null) { const u = i.getRange(a.startRow, a.startColumn); c = u == null ? void 0 : u.getUnderline(); } return o.next(!!(c && c.s)), l.dispose; })), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, ze], rangeTypes: [re] }, !0), hidden$: oe(r, O.UNIVER_SHEET) }; } function Mb(r) { const e = r.get(F), t = r.get(L), n = r.get($), s = r.get(Ne); return { id: Ms.id, type: Q.BUTTON, icon: "StrikethroughSingle", title: "Set strike through", tooltip: "toolbar.strikethrough", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, ze], rangeTypes: [re] }, !0), activated$: xt(t, !1, ({ worksheet: i }) => new it((o) => { var d; const l = e.onCommandExecuted((u) => { var m, f; const h = u.id; if (h === Se.id || h === He.id || h === et.id) { const g = (m = n.getCurrentLastSelection()) == null ? void 0 : m.primary; let p; if (g != null) { const S = i.getRange(g.startRow, g.startColumn); p = S == null ? void 0 : S.getStrikeThrough(); } o.next(!!(p && p.s)); } if ((h === Vi.id || h === Pi.id) && s.getContextValue(Je) && s.getContextValue(Tt)) { const g = ji(r); if (g == null) return; const p = (f = g.ts) == null ? void 0 : f.st; o.next((p == null ? void 0 : p.s) === Qe.TRUE); } }), a = (d = n.getCurrentLastSelection()) == null ? void 0 : d.primary; let c; if (a != null) { const u = i.getRange(a.startRow, a.startColumn); c = u == null ? void 0 : u.getStrikeThrough(); } return o.next(!!(c && c.s)), l.dispose; })), hidden$: oe(r, O.UNIVER_SHEET) }; } function Pb(r) { const e = r.get(F), t = r.get(L), n = r.get($), s = ed.ff; return { id: zl.id, tooltip: "toolbar.font", type: Q.SELECTOR, label: Fd, selections: bS.map((i) => ({ label: { name: Ud, hoverable: !0 }, value: i.value })), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, ze], rangeTypes: [re] }, !0), value$: xt(t, s, ({ worksheet: i }) => new it((o) => { var d; const l = e.onCommandExecuted((u) => { var g; const h = u.id; if (h !== Se.id && h !== He.id && h !== et.id) return; const m = (g = n.getCurrentLastSelection()) == null ? void 0 : g.primary; let f; if (m != null) { const p = i.getRange(m.startRow, m.startColumn); f = p == null ? void 0 : p.getFontFamily(); } o.next(f != null ? f : s); }), a = (d = n.getCurrentLastSelection()) == null ? void 0 : d.primary; let c; if (a != null) { const u = i.getRange(a.startRow, a.startColumn); c = u == null ? void 0 : u.getFontFamily(); } return o.next(c != null ? c : s), l.dispose; })), hidden$: oe(r, O.UNIVER_SHEET) }; } function Eb(r) { const e = r.get(F), t = r.get(L), n = r.get($), s = r.get(Ne), i = ed.fs, o = ue(r, { workbookTypes: [q], worksheetTypes: [ee, ze], rangeTypes: [re] }, !0); return { id: Xl.id, type: Q.SELECTOR, tooltip: "toolbar.fontSize", label: { name: jd, props: { min: 1, max: 400, disabled$: o } }, selections: _S, disabled$: o, value$: xt(t, i, ({ worksheet: l }) => new it((a) => { var h; const c = e.onCommandExecuted((m) => { var g, p; const f = m.id; if (f === Se.id || f === He.id || f === et.id) { const S = (g = n.getCurrentLastSelection()) == null ? void 0 : g.primary; let b; if (S != null) { const v = l.getRange(S.startRow, S.startColumn); b = v == null ? void 0 : v.getFontSize(); } a.next(b != null ? b : i); } if ((f === Vi.id || f === Pi.id) && s.getContextValue(Je) && s.getContextValue(Tt)) { const S = ji(r); if (S == null) return; const b = (p = S.ts) == null ? void 0 : p.fs; a.next(b != null ? b : i); } }), d = (h = n.getCurrentLastSelection()) == null ? void 0 : h.primary; let u; if (d != null) { const m = l.getRange(d.startRow, d.startColumn); u = m == null ? void 0 : m.getFontSize(); } return a.next(u != null ? u : i), c.dispose; })), hidden$: oe(r, O.UNIVER_SHEET) }; } function Tb(r) { return { id: Pf.id, type: Q.BUTTON, title: "toolbar.resetColor", icon: "NoColor", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, ze], rangeTypes: [re] }, !0), hidden$: oe(r, O.UNIVER_SHEET) }; } function xb(r) { const e = r.get(F), t = r.get(kt); return { id: di.id, icon: "FontColor", tooltip: "toolbar.textColor.main", type: Q.BUTTON_SELECTOR, selections: [ { label: { name: Fi, hoverable: !1 } } ], value$: new it((n) => { const s = t.getCurrentTheme().textColor, i = e.onCommandExecuted((o) => { if (o.id === di.id) { const l = o.params.value; n.next(l != null ? l : s); } }); return n.next(s), i.dispose; }), hidden$: oe(r, O.UNIVER_SHEET), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, ze], rangeTypes: [re] }, !0) }; } function Ob(r) { return { id: am.id, type: Q.BUTTON, title: "toolbar.resetColor", icon: "NoColor", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, ze], rangeTypes: [re] }) }; } function Ab(r) { const e = r.get(F), t = r.get(kt); return { id: Mo.id, tooltip: "toolbar.fillColor.main", type: Q.BUTTON_SELECTOR, icon: "PaintBucket", selections: [ { label: { name: Fi, hoverable: !1 } } ], value$: new it((n) => { const s = t.getCurrentTheme().primaryColor, i = e.onCommandExecuted((o) => { if (o.id === Mo.id) { const l = o.params.value; n.next(l != null ? l : s); } }); return n.next(s), i.dispose; }), hidden$: oe(r, O.UNIVER_SHEET), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, ze], rangeTypes: [re] }) }; } const $u = [ { label: "align.left", icon: "LeftJustifyingSingle", value: wt.LEFT }, { label: "align.center", icon: "HorizontallySingle", value: wt.CENTER }, { label: "align.right", icon: "RightJustifyingSingle", value: wt.RIGHT } ]; function Nb(r) { const e = r.get(L), t = r.get($), n = wt.LEFT; return { id: lc.id, icon: $u[0].icon, tooltip: "toolbar.horizontalAlignMode.main", type: Q.SELECTOR, selections: $u, value$: xt(e, n, ({ worksheet: s }) => new it((i) => { var c; const o = r.get(F).onCommandExecuted((d) => { var f; const u = d.id; if (u !== lc.id && u !== He.id && u !== et.id) return; const h = (f = t.getCurrentLastSelection()) == null ? void 0 : f.primary; let m; if (h != null) { const g = s.getRange(h.startRow, h.startColumn); m = g == null ? void 0 : g.getHorizontalAlignment(); } i.next(m != null ? m : n); }), l = (c = t.getCurrentLastSelection()) == null ? void 0 : c.primary; let a; if (l != null) { const d = s.getRange(l.startRow, l.startColumn); a = d == null ? void 0 : d.getHorizontalAlignment(); } return i.next(a != null ? a : n), o.dispose; })), hidden$: oe(r, O.UNIVER_SHEET), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, ze], rangeTypes: [re] }) }; } const eh = [ { label: "align.top", icon: "AlignTopSingle", value: an.TOP }, { label: "align.middle", icon: "VerticalCenterSingle", value: an.MIDDLE }, { label: "align.bottom", icon: "AlignBottomSingle", value: an.BOTTOM } ]; function Hb(r) { const e = r.get(L), t = r.get($), n = an.BOTTOM; return { id: ac.id, icon: eh[2].icon, tooltip: "toolbar.verticalAlignMode.main", type: Q.SELECTOR, selections: eh, value$: xt(e, n, ({ worksheet: s }) => new it((i) => { var c; const o = r.get(F).onCommandExecuted((d) => { var f; const u = d.id; if (u !== ac.id && u !== He.id && u !== et.id) return; const h = (f = t.getCurrentLastSelection()) == null ? void 0 : f.primary; let m; if (h != null) { const g = s.getRange(h.startRow, h.startColumn); m = g == null ? void 0 : g.getVerticalAlignment(); } i.next(m != null ? m : n); }), l = (c = t.getCurrentLastSelection()) == null ? void 0 : c.primary; let a; if (l != null) { const d = s.getRange(l.startRow, l.startColumn); a = d == null ? void 0 : d.getVerticalAlignment(); } return i.next(a != null ? a : n), o.dispose; })), hidden$: oe(r, O.UNIVER_SHEET), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, ze], rangeTypes: [re] }) }; } const th = [ { label: "textWrap.overflow", icon: "OverflowSingle", value: Cr.OVERFLOW }, { label: "textWrap.wrap", icon: "AutowrapSingle", value: Cr.WRAP }, { label: "textWrap.clip", icon: "TruncationSingle", value: Cr.CLIP } ]; function Vb(r) { const e = r.get($), t = r.get(L), n = Cr.OVERFLOW; return { id: cc.id, tooltip: "toolbar.textWrapMode.main", icon: th[0].icon, type: Q.SELECTOR, selections: th, value$: xt(t, n, ({ worksheet: s }) => new it((i) => { var c; const o = r.get(F).onCommandExecuted((d) => { var f; const u = d.id; if (u !== cc.id && u !== He.id && u !== et.id) return; const h = (f = e.getCurrentLastSelection()) == null ? void 0 : f.primary; let m; if (h != null) { const g = s.getRange(h.startRow, h.startColumn); m = g == null ? void 0 : g.getWrapStrategy(); } i.next(m != null ? m : n); }), l = (c = e.getCurrentLastSelection()) == null ? void 0 : c.primary; let a; if (l != null) { const d = s.getRange(l.startRow, l.startColumn); a = d == null ? void 0 : d.getWrapStrategy(); } return i.next(a != null ? a : n), o.dispose; })), hidden$: oe(r, O.UNIVER_SHEET), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, ze], rangeTypes: [re] }) }; } const nh = [ { label: "textRotate.none", icon: "NoRotationSingle", value: 0 }, { label: "textRotate.angleUp", icon: "LeftRotationFortyFiveDegreesSingle", value: -45 }, { label: "textRotate.angleDown", icon: "RightRotationFortyFiveDegreesSingle", value: 45 }, { label: "textRotate.vertical", icon: "VerticalTextSingle", value: "v" }, { label: "textRotate.rotationUp", icon: "LeftRotationNinetyDegreesSingle", value: -90 }, { label: "textRotate.rotationDown", icon: "RightRotationNinetyDegreesSingle", value: 90 } ]; function kb(r) { const e = r.get($), t = r.get(L), n = 0; return { id: dc.id, tooltip: "toolbar.textRotateMode.main", icon: nh[0].icon, type: Q.SELECTOR, selections: nh, value$: xt(t, n, ({ worksheet: s }) => new it((i) => { var c, d; const o = r.get(F).onCommandExecuted((u) => { var g, p; const h = u.id; if (h !== dc.id && h !== He.id && h !== et.id) return; const m = (g = e.getCurrentLastSelection()) == null ? void 0 : g.primary; let f; if (m != null) { const S = s.getRange(m.startRow, m.startColumn); f = S == null ? void 0 : S.getTextRotation(); } (f == null ? void 0 : f.v) === Qe.TRUE ? i.next("v") : i.next((p = f && f.a) != null ? p : n); }), l = (c = e.getCurrentLastSelection()) == null ? void 0 : c.primary; let a; if (l != null) { const u = s.getRange(l.startRow, l.startColumn); a = u == null ? void 0 : u.getTextRotation(); } return (a == null ? void 0 : a.v) === Qe.TRUE ? i.next("v") : i.next((d = a && a.a) != null ? d : n), o.dispose; })), hidden$: oe(r, O.UNIVER_SHEET), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, ze], rangeTypes: [re] }) }; } function Ui(r) { return new it((t) => t.next(!r.get(wl).supportClipboard)); } function $r(r) { return { id: hn.name, commandId: hn.id, type: Q.BUTTON, title: "rightClick.copy", icon: "Copy", disabled$: ue(r, { workbookTypes: [Bs], worksheetTypes: [yo], rangeTypes: [uc] }), hidden$: oe(r, O.UNIVER_SHEET) }; } function wa(r) { return { id: mn.name, commandId: mn.id, type: Q.BUTTON, title: "rightClick.paste", icon: "PasteSpecial", disabled$: Ui(r).pipe( ir(ue(r, { rangeTypes: [re], worksheetTypes: [ee, ze, Ut], workbookTypes: [q] })), _e(([e, t]) => e || t) ), hidden$: oe(r, O.UNIVER_SHEET) }; } const go = "sheet.menu.paste-special"; function Ra(r) { return { id: go, type: Q.SUBITEMS, icon: "PasteSpecial", title: "rightClick.pasteSpecial", hidden$: Es(r, oe(r, O.UNIVER_SHEET)) }; } function Ia(r) { return { id: Gs.id, type: Q.BUTTON, title: "rightClick.pasteValue", disabled$: Ui(r).pipe( ir(ue(r, { rangeTypes: [re], worksheetTypes: [Ut, ee], workbookTypes: [q] })), _e(([e, t]) => e || t) ), hidden$: oe(r, O.UNIVER_SHEET) }; } function ya(r) { return { id: qs.id, type: Q.BUTTON, title: "rightClick.pasteFormat", disabled$: Ui(r).pipe( ir(ue(r, { rangeTypes: [re], worksheetTypes: [ze, ee], workbookTypes: [q] })), _e(([e, t]) => e || t) ), hidden$: oe(r, O.UNIVER_SHEET) }; } function Ma(r) { return { id: Jr.id, type: Q.BUTTON, title: "rightClick.pasteColWidth", disabled$: Ui(r).pipe( ir(ue(r, { rangeTypes: [re], worksheetTypes: [Or, ee], workbookTypes: [q] })), _e(([e, t]) => e || t) ) }; } function Pa(r) { return { id: Qs.id, type: Q.BUTTON, title: "rightClick.pasteBesidesBorder", disabled$: Ui(r).pipe( ir(ue(r, { rangeTypes: [re], worksheetTypes: [ee, ze, Ut, Ar, Or], workbookTypes: [q] })), _e(([e, t]) => e || t) ), hidden$: oe(r, O.UNIVER_SHEET) }; } function Db(r) { return { id: Pl.id, type: Q.BUTTON, icon: "AutoHeight", title: "rightClick.fitContent", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [Ar, ee], rangeTypes: [re] }), hidden$: oe(r, O.UNIVER_SHEET) }; } function Lb(r) { return { id: Ql.id, type: Q.BUTTON, icon: "AutoWidth", title: "rightClick.fitContent", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [Ar, ee], rangeTypes: [re] }), hidden$: oe(r, O.UNIVER_SHEET) }; } const Af = "sheet.menu.sheet-frozen"; function Wb(r) { return { id: Af, type: Q.SUBITEMS, title: "rightClick.freeze", icon: "FreezeToSelectedSingle", hidden$: oe(r, O.UNIVER_SHEET) }; } const Oc = "sheet.header-menu.sheet-frozen"; function rh(r) { return { id: Oc, type: Q.SUBITEMS, title: "rightClick.freeze", icon: "FreezeToSelectedSingle", hidden$: oe(r, O.UNIVER_SHEET) }; } function Ea(r) { return { id: $n.id, type: Q.BUTTON, title: "rightClick.freeze", icon: "FreezeToSelectedSingle", // disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission], rangeTypes: [RangeProtectionPermissionEditPoint] }), hidden$: oe(r, O.UNIVER_SHEET) }; } function Bb(r) { return { id: Gl.id, type: Q.BUTTON, title: "rightClick.freezeRow", icon: "FreezeRowSingle", // disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission], rangeTypes: [RangeProtectionPermissionEditPoint] }), hidden$: oe(r, O.UNIVER_SHEET) }; } function Fb(r) { return { id: ql.id, type: Q.BUTTON, title: "rightClick.freezeCol", icon: "FreezeColumnSingle", // disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission], rangeTypes: [RangeProtectionPermissionEditPoint] }), hidden$: oe(r, O.UNIVER_SHEET) }; } function Ta(r) { return { id: ho.id, type: Q.BUTTON, title: "rightClick.cancelFreeze", icon: "CancelFreezeSingle", // disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission], rangeTypes: [RangeProtectionPermissionEditPoint] }), hidden$: oe(r, O.UNIVER_SHEET) }; } function Ub(r) { return { id: Ul.id, type: Q.BUTTON, icon: "Hide", title: "rightClick.hideSelectedRow", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [Ar, ee], rangeTypes: [re] }), hidden$: oe(r, O.UNIVER_SHEET) }; } function jb(r) { return { id: jl.id, type: Q.BUTTON, icon: "Hide", title: "rightClick.hideSelectedColumn", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, Or], rangeTypes: [re] }), hidden$: oe(r, O.UNIVER_SHEET) }; } function Xb(r) { const e = r.get(L), t = r.get($), n = r.get(F), s = [He, Sd, Cd].map((i) => i.id); return { id: cm.id, type: Q.BUTTON, title: "rightClick.showHideRow", hidden$: xt(e, !0, ({ worksheet: i }) => new it((o) => { function l() { var d; const c = (d = t.getCurrentSelections()) == null ? void 0 : d.map((u) => u.range).filter((u) => u.rangeType === j.ROW); return !!(c != null && c.some((u) => { for (let h = u.startRow; h <= u.endRow; h++) if (!i.getRowRawVisible(h)) return !0; return !1; })); } const a = n.onCommandExecuted((c) => { s.findIndex((d) => d === c.id) !== -1 && o.next(!l()); }); return o.next(!l()), () => a.dispose(); })), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, Ar], rangeTypes: [re] }) }; } function zb(r) { const e = r.get(L), t = r.get($), n = r.get(F), s = [He, vd, bd].map((i) => i.id); return { id: dm.id, type: Q.BUTTON, title: "rightClick.showHideColumn", hidden$: xt(e, !0, ({ worksheet: i }) => new it((o) => { function l() { var d; const c = (d = t.getCurrentSelections()) == null ? void 0 : d.map((u) => u.range).filter((u) => u.rangeType === j.COLUMN); return !c || c.length === 0 ? !1 : !!c.some((u) => { for (let h = u.startColumn; h <= u.endColumn; h++) if (!i.getColVisible(h)) return !0; return !1; }); } const a = n.onCommandExecuted((c) => { s.findIndex((d) => d === c.id) !== -1 && o.next(!l()); }); return o.next(!l()), () => a.dispose(); })), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [Or, ee], rangeTypes: [re] }) }; } function Yb(r) { const e = r.get(F), t = r.get(L), n = r.get($), s = 0; return { id: um.id, type: Q.BUTTON, icon: "AdjustHeight", label: { name: Kl, props: { prefix: "rightClick.rowHeight", suffix: "px", min: 2, max: 1e3 } }, value$: xt(t, s, ({ worksheet: i }) => new it((o) => { function l() { var u; const c = (u = n.getCurrentLastSelection()) == null ? void 0 : u.primary, d = c ? i.getRowHeight(c.startRow) : s; o.next(d); } const a = e.onCommandExecuted((c) => { const d = c.id; if (d === Se.id || d === He.id || d === hm.id) return l(); }); return l(), a.dispose; })), hidden$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, Ar], rangeTypes: [re] }) }; } function Zb(r) { const e = r.get(F), t = r.get(L), n = r.get($), s = 0; return { id: mm.id, type: Q.BUTTON, icon: "AdjustWidth", label: { name: Kl, props: { prefix: "rightClick.columnWidth", suffix: "px", min: 2, max: 1e3 } }, value$: xt(t, s, ({ worksheet: i }) => new it((o) => { function l() { var u; const c = (u = n.getCurrentLastSelection()) == null ? void 0 : u.primary; let d = s; c != null && (d = i.getColumnWidth(c.startColumn)), o.next(d); } const a = e.onCommandExecuted((c) => { const d = c.id; if (d === Se.id || d === He.id || d === Qt.id) return l(); }); return l(), a.dispose; })), hidden$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, Or], rangeTypes: [re] }) }; } function ji(r) { var a; const e = r.get(L), t = r.get(yd), n = e.getUniverDocInstance(Le), s = t.getActiveTextRange(); if (n == null || s == null) return null; const i = (a = n.getBody()) == null ? void 0 : a.textRuns; if (i == null) return; const { startOffset: o } = s; return i.find(({ st: c, ed: d }) => o >= c && o <= d); } var Gb = Object.defineProperty, qb = Object.getOwnPropertyDescriptor, Qb = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? qb(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && Gb(e, t, s), s; }, cr = (r, e) => (t, n) => e(t, n, r); const Kb = "__SpreadsheetFreezeRowMainName__", Jb = "__SpreadsheetFreezeRowHeaderName__", $b = "__SpreadsheetFreezeColumnMainName__", e_ = "__SpreadsheetFreezeColumnHeaderName__", xa = 2, t_ = 0.01, Hs = sr("freezePermissionCheck"); let hi = class extends ce { constructor(e, t, n, s, i, o, l, a) { super(); w(this, "_rowFreezeHeaderRect"); w(this, "_rowFreezeMainRect"); w(this, "_columnFreezeHeaderRect"); w(this, "_columnFreezeMainRect"); w(this, "_freezeDownSubs"); w(this, "_freezePointerEnterSubs"); w(this, "_freezePointerLeaveSubs"); w(this, "_scenePointerMoveSub"); w(this, "_scenePointerUpSub"); w(this, "_changeToRow", -1); w(this, "_changeToColumn", -1); w(this, "_changeToOffsetX", 0); w(this, "_changeToOffsetY", 0); w(this, "_activeViewport", null); w(this, "_freezeNormalHeaderColor", ""); w(this, "_freezeNormalMainColor", ""); w(this, "_freezeActiveColor", ""); w(this, "_freezeHoverColor", ""); w(this, "_lastFreeze"); w(this, "interceptor", new Cs({ FREEZE_PERMISSION_CHECK: Hs })); this._context = e, this._sheetSkeletonManagerService = t, this._commandService = n, this._selectionManagerService = s, this._scrollManagerService = i, this._themeService = o, this._sheetInterceptorService = l, this._injector = a, this._initialize(); } dispose() { super.dispose(); } _initialize() { this._skeletonListener(), this._commandExecutedListener(), this._themeChangeListener(), this._interceptorCommands(), this._bindViewportScroll(), this._zoomRefresh(); } // eslint-disable-next-line max-lines-per-function _createFreeze(e = 0, t) { var y; const n = t != null ? t : this._getFreeze(); if (n == null) return null; const s = (y = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : y.skeleton, { startRow: i, startColumn: o } = n, l = this._getPositionByIndex(i, o); if (l == null || s == null) return null; const a = this._getSheetObject(), c = a.engine, d = (c == null ? void 0 : c.width) || 0, u = (c == null ? void 0 : c.height) || 0, h = a.scene, { startX: m, startY: f } = l, { rowTotalHeight: g, columnTotalWidth: p, rowHeaderWidthAndMarginLeft: S, columnHeaderHeightAndMarginTop: b } = s, v = d > p + S ? d : p + b, _ = u > g + b ? u : g + b; this._changeToRow = i, this._changeToColumn = o, this._changeToOffsetX = m, this._changeToOffsetY = f; const R = Math.max(h.scaleX, h.scaleY); let I = xa / (R < 1 ? 1 : R); if (e === 0) { (i === -1 || i === 0) && (I = I * 2); const M = I; this._rowFreezeHeaderRect = new ge(Jb, { fill: this._freezeNormalHeaderColor, width: S, height: I, left: 0, top: f - M, zIndex: 3 }); let P = this._freezeNormalHeaderColor; (i === -1 || i === 0) && (P = this._freezeNormalMainColor), this._rowFreezeMainRect = new ge(Kb, { fill: P, width: v * 2 / R, height: I, left: S, top: f - M, zIndex: 3 }), h.addObjects([this._rowFreezeHeaderRect, this._rowFreezeMainRect], rr); } else { (o === -1 || o === 0) && (I = I * 2); const M = I; this._columnFreezeHeaderRect = new ge(e_, { fill: this._freezeNormalHeaderColor, width: I, height: b, left: m - M, top: 0, zIndex: 3 }); let P = this._freezeNormalHeaderColor; (o === -1 || o === 0) && (P = this._freezeNormalMainColor), this._columnFreezeMainRect = new ge($b, { fill: P, width: I, height: _ * 2 / R, left: m - M, top: b, zIndex: 3 }), h.addObjects([this._columnFreezeHeaderRect, this._columnFreezeMainRect], rr); } this._eventBinding(e); } // eslint-disable-next-line max-lines-per-function _eventBinding(e = 0) { let t = this._rowFreezeHeaderRect, n = this._rowFreezeMainRect; e === 1 && (t = this._columnFreezeHeaderRect, n = this._columnFreezeMainRect); const s = this._getSheetObject(); if (s == null) return; const { scene: i } = s; if (this._freezePointerEnterSubs = new Kn(), this._freezePointerLeaveSubs = new Kn(), this._freezeDownSubs = new Kn(), n) { const a = n.onPointerEnter$.subscribeEvent(() => { if (!this.interceptor.fetchThroughInterceptors(Hs)(!0, null)) return !1; t == null || t.setProps({ fill: this._freezeHoverColor, zIndex: 4 }), i.setCursor(Re.GRAB); }); this._freezePointerEnterSubs.add(a); const c = n.onPointerLeave$.subscribeEvent(() => { t == null || t.setProps({ fill: this._freezeNormalHeaderColor, zIndex: 3 }), i.resetCursor(); }); this._freezePointerLeaveSubs.add(c); } if (t) { const a = t.onPointerEnter$.subscribeEvent(() => { if (!this.interceptor.fetchThroughInterceptors(Hs)(!0, null)) return !1; t == null || t.setProps({ fill: this._freezeHoverColor, zIndex: 4 }), i.setCursor(Re.GRAB); }); this._freezePointerEnterSubs.add(a); const c = t.onPointerLeave$.subscribeEvent(() => { t == null || t.setProps({ fill: this._freezeNormalHeaderColor, zIndex: 3 }), i.resetCursor(); }); this._freezePointerLeaveSubs.add(c); } const o = t == null ? void 0 : t.onPointerDown$.subscribeEvent((a) => { this._freezeDown(a, t, n, e); }); o && this._freezeDownSubs.add(o); const l = n == null ? void 0 : n.onPointerDown$.subscribeEvent((a) => { this._freezeDown(a, t, n, e); }); l && this._freezeDownSubs.add(l); } // eslint-disable-next-line complexity _getCurrentLastVisible() { var p, S, b, v, _, R, I; const e = this._getSheetObject(); if (e == null) return; const t = (p = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : p.skeleton; if (t == null) return; const n = e.scene, s = Math.max(n.scaleX, n.scaleY), i = this._scrollManagerService.getCurrentScrollState(), o = (e.engine.height - t.columnHeaderHeight) / s, l = (e.engine.width - t.rowHeaderWidth) / s, a = (S = i == null ? void 0 : i.sheetViewStartRow) != null ? S : 0, c = a === 0 ? -((b = i == null ? void 0 : i.offsetY) != null ? b : 0) : t.rowHeightAccumulation[a - 1] - ((v = i == null ? void 0 : i.offsetY) != null ? v : 0); let d = 0, u = !1; for (let y = a, M = t.rowHeightAccumulation.length; y < M; y++) if (t.rowHeightAccumulation[y] - c > o) { d = y, u = !0; break; } u || (d = t.rowHeightAccumulation.length - 1); const h = (_ = i == null ? void 0 : i.sheetViewStartColumn) != null ? _ : 0, m = h === 0 ? -((R = i == null ? void 0 : i.offsetX) != null ? R : 0) : t.columnWidthAccumulation[h - 1] - ((I = i == null ? void 0 : i.offsetX) != null ? I : 0); let f = 0, g = !1; for (let y = h, M = t.columnWidthAccumulation.length; y < M; y++) if (t.columnWidthAccumulation[y] - m > l) { f = y, g = !0; break; } return g || (f = t.columnWidthAccumulation.length - 1), { lastRow: d, lastColumn: f }; } _getActiveViewport(e) { var n; const t = (n = this._getSheetObject()) == null ? void 0 : n.scene.getViewports(); return t && t.find((s) => s.isHit(new Oe(e.offsetX, e.offsetY))) || null; } // eslint-disable-next-line max-lines-per-function _freezeDown(e, t, n, s = 0) { var m; const i = (m = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : m.skeleton; if (i == null) return; const o = this._getSheetObject(); if (o == null) return; if (!this.interceptor.fetchThroughInterceptors(Hs)(!0, null)) return !1; const { scene: a } = o; a.setCursor(Re.GRABBING), a.disableObjectsEvent(); const c = this._getCurrentLastVisible(), d = c === void 0 ? Number.POSITIVE_INFINITY : i.rowHeightAccumulation[c.lastRow], u = c === void 0 ? Number.POSITIVE_INFINITY : i.columnWidthAccumulation[c.lastColumn - 1] + i.rowHeaderWidth; this._activeViewport = null; const h = this._getFreeze(); h && (this._changeToColumn = h.startColumn, this._changeToRow = h.startRow), this._scenePointerMoveSub = a.onPointerMove$.subscribeEvent((f) => { var I, y, M, P; const g = this._getActiveViewport(f), { startX: p, startY: S, row: b, column: v } = Nn( f.offsetX, f.offsetY, a, i, g || void 0, !0 ); if (!this.interceptor.fetchThroughInterceptors(Hs)(!0, null)) return !1; a.setCursor(Re.GRABBING); const R = xa / Math.max(a.scaleX, a.scaleY); s === 0 ? ((I = t.transformByState({ top: Math.min(S, d) - R / 2 })) == null || I.setProps({ fill: this._freezeActiveColor }), (y = n.transformByState({ top: Math.min(S, d) - R / 2 })) == null || y.setProps({ fill: this._freezeNormalHeaderColor }), this._changeToRow = c === void 0 ? b : Math.min(b, c.lastRow), this._changeToOffsetY = Math.min(S, d), this._activeViewport = g) : ((M = t.transformByState({ left: Math.min(p, u) - R / 2 })) == null || M.setProps({ fill: this._freezeActiveColor }), (P = n.transformByState({ left: Math.min(p, u) - R / 2 })) == null || P.setProps({ fill: this._freezeNormalHeaderColor }), this._changeToColumn = c === void 0 ? v : Math.min(v, c.lastColumn), this._changeToOffsetX = p, this._activeViewport = g); }), this._scenePointerUpSub = a.onPointerUp$.subscribeEvent(() => { var E, T; a.resetCursor(), a.enableObjectsEvent(), this._clearObserverEvent(); const { rowHeaderWidthAndMarginLeft: f, columnHeaderHeightAndMarginTop: g } = i; s === 0 && (this._changeToRow === 0 || this._changeToRow === -1) || s === 1 && (this._changeToColumn === 0 || this._changeToColumn === -1) ? (t.setProps({ fill: this._freezeNormalHeaderColor }), n.setProps({ fill: this._freezeNormalMainColor })) : (t == null || t.setProps({ fill: this._freezeNormalHeaderColor }), n == null || n.setProps({ fill: this._freezeNormalHeaderColor })); const p = xa / Math.max(a.scaleX, a.scaleY); s === 0 ? (this._changeToRow === 0 || this._changeToRow === -1) && (t.transformByState({ top: g - p }), n.transformByState({ top: g - p })) : (this._changeToColumn === 0 || this._changeToColumn === -1) && (t.transformByState({ left: f - p }), n.transformByState({ left: f - p })); const S = this._scrollManagerService.getCurrentScrollState() || { sheetViewStartRow: 0, sheetViewStartColumn: 0 }, { sheetViewStartRow: b, sheetViewStartColumn: v } = S; if (v == null || b == null) return; const _ = this._context.unit, R = _.getActiveSheet(); if (!R) return; const I = (E = R.getConfig()) == null ? void 0 : E.freeze; let y = (I == null ? void 0 : I.xSplit) || 0, M = (I == null ? void 0 : I.ySplit) || 0; const P = (T = this._activeViewport) == null ? void 0 : T.viewportKey; s === 0 && (!P || P === z.VIEW_LEFT_TOP || P === z.VIEW_MAIN_LEFT_TOP || P === z.VIEW_MAIN_TOP || P === z.VIEW_ROW_TOP ? M = this._changeToRow - (I.startRow - I.ySplit) : M = this._changeToRow - b, M = M < 0 ? 0 : M), s === 1 && (!P || P === z.VIEW_LEFT_TOP || P === z.VIEW_MAIN_LEFT_TOP || P === z.VIEW_MAIN_LEFT || P === z.VIEW_COLUMN_LEFT ? y = this._changeToColumn - (I.startColumn - I.xSplit) : y = this._changeToColumn - v, y = y < 0 ? 0 : y), this._commandService.executeCommand(VS.id, { startRow: M === 0 ? -1 : this._changeToRow, startColumn: y === 0 ? -1 : this._changeToColumn, ySplit: M, xSplit: y, unitId: _.getUnitId(), subUnitId: R.getSheetId() }); }); } _getViewports() { const e = this._getSheetObject(); if (e == null) return; const { scene: t } = e, n = t.getViewport(z.VIEW_COLUMN_LEFT), s = t.getViewport(z.VIEW_COLUMN_RIGHT), i = t.getViewport(z.VIEW_ROW_TOP), o = t.getViewport(z.VIEW_ROW_BOTTOM), l = t.getViewport(z.VIEW_LEFT_TOP), a = t.getViewport(z.VIEW_MAIN), c = t.getViewport(z.VIEW_MAIN_LEFT_TOP), d = t.getViewport(z.VIEW_MAIN_LEFT), u = t.getViewport(z.VIEW_MAIN_TOP); if (!(n == null || s == null || i == null || o == null || l == null || a == null || c == null || d == null || u == null)) return { viewMain: a, viewMainLeftTop: c, viewMainLeft: d, viewMainTop: u, viewColumnLeft: n, viewColumnRight: s, viewRowTop: i, viewRowBottom: o, viewLeftTop: l }; } _bindViewportScroll() { const e = this._getViewports(); if (!e) return; const { viewRowBottom: t, viewColumnRight: n, viewMainLeft: s, viewMainTop: i } = e; this.disposeWithMe( this._scrollManagerService.validViewportScrollInfo$.subscribe((o) => { if (!o) return; const { scrollX: l, scrollY: a, viewportScrollX: c, viewportScrollY: d } = o; t.isActive && t.updateScrollVal({ scrollY: a, viewportScrollY: d }), n.isActive && n.updateScrollVal({ scrollX: l, viewportScrollX: c }), s.isActive && s.updateScrollVal({ scrollY: a, viewportScrollY: d }), i.isActive && i.updateScrollVal({ scrollX: l, viewportScrollX: c }); }) ); } // eslint-disable-next-line max-lines-per-function, complexity _updateViewport(e = -1, t = -1, n = 0, s = 0, i = 3) { var y; const o = (y = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : y.skeleton; if (o == null) return; const { rowHeaderWidthAndMarginLeft: l, columnHeaderHeightAndMarginTop: a } = o, c = this._getViewports(); if (!c) return; const { viewMain: d, viewMainLeftTop: u, viewMainLeft: h, viewMainTop: m, viewColumnLeft: f, viewColumnRight: g, viewRowTop: p, viewRowBottom: S, viewLeftTop: b } = c; g.resizeWhenFreezeChange({ left: l, top: 0, height: a, right: 0 }), S.resizeWhenFreezeChange({ left: 0, top: a, bottom: 0, width: l }), b.resizeWhenFreezeChange({ left: 0, top: 0, width: l, height: a }); let v = !0, _ = !0; u.enable(), (e === -1 || e === 0) && (v = !1), (t === -1 || t === 0) && (_ = !1); const R = o.getNoMergeCellPositionByIndexWithNoHeader(e - n, t - s), I = o.getNoMergeCellPositionByIndexWithNoHeader(e, t); if (u.disable(), m.disable(), h.disable(), p.disable(), f.disable(), u.resetPadding(), m.resetPadding(), h.resetPadding(), p.resetPadding(), f.resetPadding(), v === !1 && _ === !1) d.resizeWhenFreezeChange({ left: l, top: a, bottom: 0, right: 0 }), d.resetPadding(); else if (v === !0 && _ === !1) { const M = I.startY - R.startY; d.resizeWhenFreezeChange({ left: l, top: a + M, bottom: 0, right: 0 }), d.setPadding({ startY: R.startY, endY: I.startY, startX: 0, endX: 0 }), i & 2 && this._commandService.executeCommand(un.id, { sheetViewStartRow: 0, offsetY: 0 }), m.resizeWhenFreezeChange({ left: l, top: a, height: M, right: 0 }), m.updateScrollVal({ viewportScrollY: R.startY, rawScrollX: d.scrollX, viewportScrollX: d.viewportScrollX }), p.resizeWhenFreezeChange({ left: 0, top: a, width: l, height: M }), p.updateScrollVal({ viewportScrollY: R.startY }), S.resizeWhenFreezeChange({ left: 0, top: a + M, bottom: 0, width: l }), m.enable(), p.enable(); } else if (v === !1 && _ === !0) { const M = I.startX - R.startX; d.resizeWhenFreezeChange({ left: l + M, top: a, bottom: 0, right: 0 }), d.setPadding({ startX: R.startX, endX: I.startX, startY: 0, endY: 0 }), i & 1 && this._commandService.executeCommand(un.id, { sheetViewStartColumn: 0, offsetX: 0 }), h.resizeWhenFreezeChange({ left: l, top: a, width: M, bottom: 0, right: 0 }), h.updateScrollVal({ viewportScrollX: R.startX, rawScrollY: d.scrollY, viewportScrollY: d.viewportScrollY }), f.resizeWhenFreezeChange({ left: l, top: 0, width: M, height: a }), f.updateScrollVal({ viewportScrollX: R.startX }), g.resizeWhenFreezeChange({ left: l + M, top: 0, height: a, right: 0 }), h.enable(), f.enable(); } else { const M = I.startX - R.startX, P = I.startY - R.startY; d.resizeWhenFreezeChange({ left: l + M, top: a + P, bottom: 0, right: 0 }), d.setPadding({ startY: R.startY, endY: I.startY, startX: R.startX, endX: I.startX }), i && this._commandService.executeCommand(un.id, { ...i & 1 ? { sheetViewStartColumn: 0, offsetX: 0 } : null, ...i & 2 ? { sheetViewStartRow: 0, offsetY: 0 } : null }), h.resizeWhenFreezeChange({ left: l, top: a + P, width: M, bottom: 0 }), h.updateScrollVal({ viewportScrollX: R.startX, rawScrollY: d.scrollY, viewportScrollY: d.viewportScrollY }), m.resizeWhenFreezeChange({ left: l + M, top: a, height: P, right: 0 }), m.updateScrollVal({ viewportScrollY: R.startY, rawScrollX: d.scrollX, viewportScrollX: d.viewportScrollX }), u.resizeWhenFreezeChange({ left: l, top: a, width: M, height: P }), u.updateScrollVal({ viewportScrollX: R.startX, viewportScrollY: R.startY }), p.resizeWhenFreezeChange({ left: 0, top: a, width: l, height: P }), p.updateScrollVal({ viewportScrollY: R.startY }), S.resizeWhenFreezeChange({ left: 0, top: a + P, bottom: 0, width: l }), f.resizeWhenFreezeChange({ left: l, top: 0, width: M, height: a }), f.updateScrollVal({ viewportScrollX: R.startX }), g.resizeWhenFreezeChange({ left: l + M, top: 0, height: a, right: 0 }), u.enable(), m.enable(), h.enable(), p.enable(), f.enable(); } } /** * When switching sheet tabs, it is necessary to update the frozen state of the current view. */ _skeletonListener() { this.disposeWithMe( Ae( this._sheetSkeletonManagerService.currentSkeleton$.subscribe((e) => { [ et.id, hc.id, mc.id ].includes((e == null ? void 0 : e.commandId) || "") && this._refreshCurrent(); }) ) ); } _refreshCurrent() { const t = this._context.unit.getActiveSheet(); if (!t) return; const n = t.getConfig().freeze, { startRow: s = -1, startColumn: i = -1, ySplit: o = 0, xSplit: l = 0 } = n; this._refreshFreeze( s, i, o, l, 0 /* NONE */ ); } _themeChangeListener() { this._themeChange(this._themeService.getCurrentTheme()), this.disposeWithMe( this._themeService.currentTheme$.subscribe((e) => { this._clearFreeze(), this._themeChange(e), this._refreshCurrent(); }) ); } _themeChange(e) { this._freezeNormalHeaderColor = e.grey400, this._freezeNormalMainColor = new Tn(e.grey400).setAlpha(t_).toRgbString(), this._freezeActiveColor = e.primaryColor, this._freezeHoverColor = e.grey500; } // eslint-disable-next-line max-lines-per-function _interceptorCommands() { this.disposeWithMe( this._sheetInterceptorService.interceptCommand({ // eslint-disable-next-line complexity, max-lines-per-function getMutations: (e) => { const t = { redos: [], undos: [] }, n = this._getFreeze(); if (!n) return t; const s = (i) => { const o = this._context.unit, l = o.getUnitId(), a = o.getActiveSheet(); if (!a) return t; const c = a.getSheetId(); this._refreshFreeze( i.startRow, i.startColumn, i.ySplit, i.xSplit, 0 /* NONE */ ); const d = { ...i, unitId: l, subUnitId: c, resetScroll: !1 }, u = lm(this._injector, d); return { undos: [{ id: vr.id, params: u }], redos: [{ id: vr.id, params: d }] }; }; if (e.id === kS.id) { const i = e.params, { range: o, direction: l } = i, a = o.endRow - o.startRow + 1; if (o.startRow + 1 < n.startRow || o.startRow + 1 === n.startRow && l === B.UP) { const c = { ...n, startRow: Math.max(1, n.startRow + a), ySplit: Math.max(1, n.ySplit + a) }; return s(c); } } if (e.id === DS.id) { const i = e.params, { range: o, direction: l } = i, a = o.endColumn - o.startColumn + 1; if (o.startColumn + 1 < n.startColumn || o.startColumn + 1 === n.startColumn && l === B.LEFT) { const c = { ...n, startColumn: Math.max(1, n.startColumn + a), xSplit: Math.max(1, n.xSplit + a) }; return s(c); } } if (e.id === fm.id) { const i = this._selectionManagerService.getCurrentSelections(), { fromRange: { startColumn: o }, toRange: { startColumn: l } } = e.params, a = i == null ? void 0 : i.filter( (p) => p.range.rangeType === j.COLUMN && p.range.startColumn <= o && o <= p.range.endColumn ); if (!(a != null && a.length)) return t; const c = a[0].range, d = { ...c, startColumn: l, endColumn: l + c.endColumn - c.startColumn }; if (!n || n.startColumn <= 0 || // move out of freeze c.startColumn >= n.startColumn && d.startColumn >= n.startColumn || // not move c.startColumn === d.startColumn || // move in freeze range c.endColumn < n.startColumn && d.startColumn < n.startColumn) return t; const u = c.endColumn - c.startColumn + 1, h = Math.max( Math.min(n.startColumn, c.endColumn + 1) - c.startColumn, 0 ); let m, f; d.startColumn >= n.startColumn ? (m = Math.max(n.startColumn - h, 1), f = Math.max(n.xSplit - h, 1)) : (m = n.startColumn + u - h, f = n.xSplit + u - h); const g = { ...n, startColumn: m, xSplit: f }; return s(g); } if (e.id === gm.id) { const i = this._selectionManagerService.getCurrentSelections(), { fromRange: { startRow: o }, toRange: { startRow: l } } = e.params, a = i == null ? void 0 : i.filter( (p) => p.range.rangeType === j.ROW && p.range.startRow <= o && o <= p.range.endRow ); if (!(a != null && a.length)) return t; const c = a[0].range, d = { ...c, startRow: l, endRow: l + c.endRow - c.startRow }; if (!n || n.startRow <= 0 || // move out of freeze c.startRow >= n.startRow && d.startRow >= n.startRow || // not move c.startRow === d.startRow || // move in freeze range c.endRow < n.startRow && d.startRow < n.startRow) return t; const u = c.endRow - c.startRow + 1, h = Math.max( Math.min(n.startRow, c.endRow + 1) - c.startRow, 0 ); let m, f; d.startRow >= n.startRow ? (m = Math.max(n.startRow - h, 1), f = Math.max(n.ySplit - h, 1)) : (m = n.startRow + u - h, f = n.ySplit + u - h); const g = { ...n, startRow: m, ySplit: f }; return s(g); } if (e.id === pm.id || e.id === Sm.id) { const i = e.params, o = i.range; if (o.rangeType === j.COLUMN && o.startColumn < n.startColumn) { const l = Math.min(n.startColumn, o.endColumn + 1) - o.startColumn, a = { ...n, startColumn: Math.max(1, n.startColumn - l), xSplit: Math.max(1, n.xSplit - l) }; return s(a); } if (i.range.rangeType === j.ROW && o.startRow < n.startRow) { const l = Math.min(n.startRow, o.endRow + 1) - o.startRow, a = { ...n, startRow: Math.max(1, n.startRow - l), ySplit: Math.max(1, n.ySplit - l) }; return s(a); } } return t; } }) ); } _commandExecutedListener() { const e = [vr.id, $t.id]; this.disposeWithMe( // eslint-disable-next-line complexity this._commandService.onCommandExecuted((t) => { if (e.includes(t.id)) { const n = this._lastFreeze, s = this._context.unit, i = s.getActiveSheet(), o = t.params, { unitId: l, subUnitId: a } = o; if (!(l === s.getUnitId() && a === (i == null ? void 0 : i.getSheetId()))) return; const c = i.getConfig().freeze; if (this._lastFreeze = c, c == null) return; let d = 0; const { startRow: u = -1, startColumn: h = -1, ySplit: m = 0, xSplit: f = 0 } = c; (!n || n.startRow !== u || n.ySplit !== m) && (d |= 2), (!n || n.startColumn !== h || n.xSplit !== f) && (d |= 1), o.resetScroll === !1 && (d = 0), this._refreshFreeze(u, h, m, f, d); } else if (t.id === $s.id) { const n = this._getFreeze(), s = n && t.params.ranges.some((i) => i.startRow < n.startRow); t.params && s && this._refreshCurrent(); } else if (t.id === Qt.id) { const n = this._getFreeze(); t.params && n && t.params.ranges.some( (s) => s.startColumn < n.startColumn ) && this._refreshCurrent(); } else if (t.id === _r.id) { const n = t.params, s = this._getFreeze(); if (s && s.startRow > -1 && n.rowsAutoHeightInfo.some((i) => i.row < s.startRow)) { const i = this._sheetSkeletonManagerService.currentSkeleton$.subscribe(() => { this._refreshCurrent(), setTimeout(() => { i.unsubscribe(); }); }); } } else if (t.id === vd.id || t.id === bd.id) { const n = t.params, s = this._getFreeze(), i = n.ranges; s && s.startColumn > -1 && i.some((o) => o.startColumn < s.startColumn) && this._refreshCurrent(); } else if (t.id === Sd.id || t.id === Cd.id) { const n = t.params, s = this._getFreeze(), i = n.ranges; s && s.startRow > -1 && i.some((o) => o.startRow < s.startRow) && this._refreshCurrent(); } }) ); } _zoomRefresh() { const e = this._getSheetObject(); if (e == null) return; const { scene: t } = e; t.onTransformChange$.subscribeEvent((n) => { n.type === zh.scale && this._refreshCurrent(); }); } _clearObserverEvent() { var t, n; this._getSheetObject() != null && ((t = this._scenePointerMoveSub) == null || t.unsubscribe(), (n = this._scenePointerUpSub) == null || n.unsubscribe(), this._scenePointerMoveSub = null, this._scenePointerUpSub = null); } _clearFreeze() { var t, n, s, i, o, l; (t = this._rowFreezeHeaderRect) == null || t.dispose(), (n = this._rowFreezeMainRect) == null || n.dispose(), (s = this._columnFreezeHeaderRect) == null || s.dispose(), (i = this._columnFreezeMainRect) == null || i.dispose(), this._getSheetObject() != null && ([this._freezeDownSubs, this._freezePointerEnterSubs, this._freezePointerLeaveSubs].forEach((a) => { a == null || a.unsubscribe(); }), this._freezeDownSubs = null, this._freezePointerEnterSubs = null, this._freezePointerLeaveSubs = null, (o = this._scenePointerMoveSub) == null || o.unsubscribe(), (l = this._scenePointerUpSub) == null || l.unsubscribe(), this._scenePointerMoveSub = null, this._scenePointerUpSub = null); } _getPositionByIndex(e, t) { var a; if (this._getSheetObject() == null) return; const s = (a = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : a.skeleton, i = s == null ? void 0 : s.getNoMergeCellPositionByIndex(e, t); if (s == null) return; if (i != null && (!isNaN(i.endX) || !isNaN(i.endY))) return i; const { rowHeaderWidthAndMarginLeft: o, columnHeaderHeightAndMarginTop: l } = s; return { startX: o, endX: o, startY: l, endY: l }; } _getFreeze() { var t; const e = (t = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : t.skeleton.getWorksheetConfig(); if (e != null) return e.freeze; } _getSheetObject() { return pn(this._context.unit, this._context); } /** * 调整冻结 & 缩放都会进入 * 但是窗口 resize 并不会进入 * @param startRow * @param startColumn * @param ySplit * @param xSplit * @param resetScroll */ _refreshFreeze(e, t, n, s, i) { var l; const o = { startRow: e, startColumn: t, ySplit: n, xSplit: s }; this._clearFreeze(), this._createFreeze(0, o), this._createFreeze(1, o), this._updateViewport(e, t, n, s, i), (l = this._getSheetObject()) == null || l.spreadsheet.makeForceDirty(); } }; hi = Qb([ cr(1, D(me)), cr(2, F), cr(3, D($)), cr(4, D(yt)), cr(5, D(kt)), cr(6, D(Ln)), cr(7, D(vt)) ], hi); function n_(r) { const e = r.get($), t = r.get(Ye), n = r.get(L), s = r.get(LS), i = n.getCurrentTypeOfUnit$(O.UNIVER_SHEET); return ot([ e.selectionMoveEnd$, i.pipe(_e((o) => { var l; return (l = o == null ? void 0 : o.getUnitId()) != null ? l : ""; })), i.pipe(We((o) => { var l; return (l = o == null ? void 0 : o.activeSheet$) != null ? l : Ie(null); })) ]).pipe( _e(([o, l, a]) => { if (!a || !o || o.length === 0) return !1; const c = a.getSheetId(), d = o.map((m) => m.range); if (s.interceptor.fetchThroughInterceptors(WS)(!1, d)) return !0; const h = t.getSubunitRuleList(l, c).map((m) => m.ranges).flat(); if (o.length < 2) { const m = o[0].range; return h.some((g) => ae.intersects(g, m) && !ae.contains(g, m)); } for (let m = 0; m < o.length; m++) for (let f = m + 1; f < o.length; f++) if (ae.intersects(o[m].range, o[f].range)) return !0; return !1; }) ); } function Nf(r, e) { return !!Uo(r, e, j.ROW); } function Hf(r, e) { return !!Uo(r, e, j.COLUMN); } function Uo(r, e, t) { return r.find((s) => { const i = s.range, { startRow: o, endRow: l, startColumn: a, endColumn: c, rangeType: d } = i; return d === j.ALL || d === j.NORMAL ? !1 : d === t && (t === j.COLUMN && a <= e && e <= c || t === j.ROW && o <= e && e <= l); }); } var r_ = Object.defineProperty, s_ = Object.getOwnPropertyDescriptor, i_ = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? s_(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && r_(e, t, s), s; }, Oa = (r, e) => (t, n) => e(t, n, r); const o_ = "__SpreadsheetHeaderMoveControllerBackground__", l_ = "__SpreadsheetHeaderMoveControllerShapeLine__", a_ = "rgba(0, 0, 0, 0.1)", c_ = "rgb(119, 119, 119)", d_ = 4, Aa = sr("headerMovePermissionCheck"); let mi = class extends ce { constructor(e, t, n, s) { super(); w(this, "_startOffsetX", Number.NEGATIVE_INFINITY); w(this, "_startOffsetY", Number.NEGATIVE_INFINITY); w(this, "_moveHelperBackgroundShape"); w(this, "_moveHelperLineShape"); w(this, "_headerPointerDownSubs"); w(this, "_headerPointerMoveSubs"); w(this, "_headerPointerLeaveSubs"); w(this, "_dragHeaderMoveSub"); w(this, "_scenePointerUpSub"); w(this, "_scrollTimer"); w(this, "_changeFromColumn", -1); w(this, "_changeFromRow", -1); w(this, "_changeToColumn", -1); w(this, "_changeToRow", -1); w(this, "interceptor", new Cs({ HEADER_MOVE_PERMISSION_CHECK: Aa })); w(this, "_workbookSelections"); this._context = e, this._sheetSkeletonManagerService = n, this._commandService = s, this._workbookSelections = t.getWorkbookSelections(this._context.unitId), this._init(); } dispose() { var e, t, n, s, i, o, l, a; (e = this._moveHelperBackgroundShape) == null || e.dispose(), (t = this._moveHelperLineShape) == null || t.dispose(), (n = this._headerPointerMoveSubs) == null || n.unsubscribe(), (s = this._headerPointerLeaveSubs) == null || s.unsubscribe(), (i = this._headerPointerDownSubs) == null || i.unsubscribe(), this._headerPointerMoveSubs = null, this._headerPointerLeaveSubs = null, this._headerPointerDownSubs = null, (o = this._dragHeaderMoveSub) == null || o.unsubscribe(), (l = this._scenePointerUpSub) == null || l.unsubscribe(), this._dragHeaderMoveSub = null, this._scenePointerUpSub = null, (a = this._scrollTimer) == null || a.dispose(); } _init() { this._initialRowOrColumn(j.ROW), this._initialRowOrColumn(j.COLUMN); } // eslint-disable-next-line max-lines-per-function _initialRowOrColumn(e = j.ROW) { const t = this._context.components.get(qe.COLUMN), n = this._context.components.get(qe.ROW), s = this._context.scene, i = e === j.ROW ? n : t, o = (c) => { var S, b; const d = (S = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : S.skeleton; if (d == null) return; const u = (b = this._workbookSelections.getCurrentLastSelection()) == null ? void 0 : b.range; if (!u || !this.interceptor.fetchThroughInterceptors(Aa)(!1, u)) return; const m = this._workbookSelections.getCurrentSelections(), { row: f, column: g } = Nn(c.offsetX, c.offsetY, s, d); if (!Uo( m, e === j.ROW ? f : g, e )) { s.resetCursor(); return; } s.setCursor(Re.GRAB); }, l = () => { var c, d; (c = this._moveHelperBackgroundShape) == null || c.hide(), (d = this._moveHelperLineShape) == null || d.hide(), s.resetCursor(); }, a = (c, d) => { var A, H; if (d.isStopPropagation) return; const u = (A = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : A.skeleton; if (u == null) return; const h = (H = this._workbookSelections.getCurrentLastSelection()) == null ? void 0 : H.range; if (!h || !this.interceptor.fetchThroughInterceptors(Aa)(!1, h)) return; const { offsetX: f, offsetY: g } = c, p = s.getCoordRelativeToViewport(Oe.FromArray([f, g])), { x: S, y: b } = p; this._startOffsetX = S, this._startOffsetY = b; const { row: v, column: _ } = Nn(c.offsetX, c.offsetY, s, u); let R; e === j.ROW ? (this._changeFromRow = v, R = It.Y) : (this._changeFromColumn = _, R = It.X); const I = this._workbookSelections.getCurrentSelections(), y = Uo( I, e === j.ROW ? v : _, e ); if (!y) return; const M = s.getScrollXYInfoByViewport( Oe.FromArray([this._startOffsetX, this._startOffsetY]) ); this._newBackgroundAndLine(), s.setCursor(Re.GRABBING), s.disableObjectsEvent(); let P = !1, E; const T = () => { if (P) return; E = Kr.create(s, R), this._scrollTimer = E; const x = s.getViewport(z.VIEW_MAIN); E.startScroll(S, b, x), P = !0; }; this._dragHeaderMoveSub = s.onPointerMove$.subscribeEvent((x) => { T(); const { offsetX: k, offsetY: U } = x, { x: V, y: N } = s.getCoordRelativeToViewport( Oe.FromArray([k, U]) ); this._rowColumnMoving( V, N, y, M, e ), E.scrolling(V, N, () => { this._rowColumnMoving( V, N, y, M, e ); }); }), this._scenePointerUpSub = s.onPointerUp$.subscribeEvent(() => { var k, U, V; this._disposeBackgroundAndLine(), s.resetCursor(), s.enableObjectsEvent(), this._clearObserverEvent(), (k = this._scrollTimer) == null || k.dispose(); const x = this._workbookSelections.getCurrentSelections(); if (e === j.ROW) { if (this._changeFromRow !== this._changeToRow && this._changeToRow !== -1) { const X = (U = ((x == null ? void 0 : x.filter( (Y) => Y.range.rangeType === j.ROW && Y.range.startRow <= this._changeFromRow && this._changeFromRow <= Y.range.endRow )) || [])[0]) == null ? void 0 : U.range; X && this._commandService.executeCommand(gm.id, { fromRange: X, toRange: { ...X, startRow: this._changeToRow, endRow: this._changeToRow + X.endRow - X.startRow } }); } this._changeToRow = this._changeFromRow = -1; } else { if (this._changeFromColumn !== this._changeToColumn && this._changeToColumn !== -1) { const X = (V = ((x == null ? void 0 : x.filter( (Y) => Y.range.rangeType === j.COLUMN && Y.range.startColumn <= this._changeFromColumn && this._changeFromColumn <= Y.range.endColumn )) || [])[0]) == null ? void 0 : V.range; X && this._commandService.executeCommand(fm.id, { fromRange: X, toRange: { ...X, startColumn: this._changeToColumn, endColumn: this._changeToColumn + X.endColumn - X.startColumn } }); } this._changeToColumn = this._changeFromColumn = -1; } }); }; this._headerPointerMoveSubs = new Kn(), this._headerPointerMoveSubs.add(i.onPointerMove$.subscribeEvent(o)), this._headerPointerLeaveSubs = new Kn(), this._headerPointerLeaveSubs.add(i == null ? void 0 : i.onPointerLeave$.subscribeEvent(l)), this._headerPointerDownSubs = new Kn(), this._headerPointerDownSubs.add(i == null ? void 0 : i.onPointerDown$.subscribeEvent(a)); } // eslint-disable-next-line max-lines-per-function _rowColumnMoving(e, t, n, s, i) { var N, X, Y, ie, he, ne, pe; const o = this._context.scene, l = (N = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : N.skeleton; if (l == null) return; const { rowHeaderWidth: a, columnHeaderHeight: c, rowTotalHeight: d, columnTotalWidth: u } = l, h = o.getViewportScrollXY(o.getViewport(z.VIEW_MAIN)), { scaleX: m, scaleY: f } = o.getAncestorScale(), g = l.getCellIndexByOffset( e, t, m, f, h ), { row: p, column: S } = g, b = l.getNoMergeCellPositionByIndex(p, S), { startX: v, startY: _, endX: R, endY: I } = b, y = this._sheetSkeletonManagerService.attachRangeWithCoord(n.range); if (y == null) return; const M = Math.max(m, m), { startX: P, endX: E, startY: T, endY: A, startRow: H, startColumn: x, endRow: k, endColumn: U } = y; i === j.ROW ? (X = this._moveHelperBackgroundShape) == null || X.transformByState({ height: A - T, width: u + a, left: 0, top: T + (t - this._startOffsetY) / M + h.y - s.y }) : (Y = this._moveHelperBackgroundShape) == null || Y.transformByState({ height: d + c, width: E - P, left: P + (e - this._startOffsetX) / M + h.x - s.x, top: 0 }), (ie = this._moveHelperBackgroundShape) == null || ie.show(); const V = d_ / M; if (i === j.ROW) { let ve = 0; if (p <= H) ve = _ - V / 2, this._changeToRow = p; else if (p > k) ve = I - V / 2, this._changeToRow = p + 1; else return; (he = this._moveHelperLineShape) == null || he.transformByState({ height: V, width: u, left: a, top: ve }); } else { let ve = 0; if (S <= x) ve = v - V / 2, this._changeToColumn = S; else if (S > U) ve = R - V / 2, this._changeToColumn = S + 1; else return; (ne = this._moveHelperLineShape) == null || ne.transformByState({ height: d, width: V, left: ve, top: c }); } (pe = this._moveHelperLineShape) == null || pe.show(); } _clearObserverEvent() { var e, t; (e = this._dragHeaderMoveSub) == null || e.unsubscribe(), (t = this._scenePointerUpSub) == null || t.unsubscribe(), this._dragHeaderMoveSub = null, this._scenePointerUpSub = null; } _newBackgroundAndLine() { const e = this._context.scene; this._moveHelperBackgroundShape = new ge(o_, { fill: a_, evented: !1, zIndex: 100 }), this._moveHelperLineShape = new ge(l_, { fill: c_, evented: !1, zIndex: 100 }), e.addObjects( [this._moveHelperBackgroundShape, this._moveHelperLineShape], rr ); } _disposeBackgroundAndLine() { var e, t; (e = this._moveHelperBackgroundShape) == null || e.dispose(), (t = this._moveHelperLineShape) == null || t.dispose(); } }; mi = i_([ Oa(1, D($)), Oa(2, D(me)), Oa(3, F) ], mi); var Ac = /* @__PURE__ */ ((r) => (r[r.VERTICAL = 0] = "VERTICAL", r[r.HORIZONTAL = 1] = "HORIZONTAL", r))(Ac || {}); const u_ = "rgba(120, 120, 120, 0.01)", Na = "rgb(68, 71, 70)", Fs = 12, h_ = 44, Nc = 4; class sh extends sd { constructor(t, n) { super(t, n); w(this, "_size", Fs); w(this, "_color", Na); w(this, "_mode", 0); this.setShapeProps(n); } get size() { return this._size; } get mode() { return this._mode; } get color() { return this._color; } _draw(t) { const n = this.getScene(); if (!n) return; const { scaleX: s, scaleY: i } = n.getAncestorScale(), o = Math.max(s, i), l = Fs / o, a = Nc / o; let { width: c, height: d } = this, u = 0, h = 0; this.mode === 0 ? (c = a, u = l - a) : (d = a, h = l - a), ge.drawWith(t, { width: this.width, height: this.height, left: 0, top: 0, fill: u_ }), ge.drawWith(t, { width: c, height: d, fill: Na, radius: a }), t.save(), t.transform(1, 0, 0, 1, u, h), ge.drawWith(t, { width: c, height: d, fill: Na, radius: a }), t.restore(); } setShapeProps(t) { return t != null && t.size && (this._size = t.size), t != null && t.mode && (this._mode = t.mode), t != null && t.color && (this._color = t.color), this.mode === 0 ? this.transformByState({ width: Fs, height: this.size }) : this.transformByState({ width: this.size, height: Fs }), this; } } var m_ = Object.defineProperty, f_ = Object.getOwnPropertyDescriptor, g_ = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? f_(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && m_(e, t, s), s; }, Ha = (r, e) => (t, n) => e(t, n, r); const p_ = "__SpreadsheetHeaderResizeControllerShapeRow__", S_ = "__SpreadsheetHeaderResizeControllerShapeColumn__", ih = "__SpreadsheetHeaderResizeControllerShapeHelper__", oh = "rgb(199, 199, 199)", C_ = 2, Va = sr("headerResizePermissionCheck"); let jo = class extends ce { constructor(e, t, n, s) { super(); w(this, "_currentRow", 0); w(this, "_currentColumn", 0); w(this, "_rowResizeRect"); w(this, "_columnResizeRect"); w(this, "_headerPointerSubs"); // private _colHeaderPointerSubs: Array; w(this, "_scenePointerMoveSub"); w(this, "_scenePointerUpSub"); w(this, "_resizeHelperShape"); w(this, "_startOffsetX", Number.POSITIVE_INFINITY); w(this, "_startOffsetY", Number.POSITIVE_INFINITY); w(this, "interceptor", new Cs({ HEADER_RESIZE_PERMISSION_CHECK: Va })); this._context = e, this._sheetSkeletonManagerService = t, this._selectionManagerService = n, this._commandService = s, this._init(); } dispose() { var e, t, n; (e = this._rowResizeRect) == null || e.dispose(), this._rowResizeRect = null, (t = this._columnResizeRect) == null || t.dispose(), this._columnResizeRect = null, (n = this._headerPointerSubs) == null || n.unsubscribe(), this._headerPointerSubs = null; } _init() { const e = this._context.scene; this._rowResizeRect = new sh(p_, { visible: !1, mode: Ac.HORIZONTAL, zIndex: 100 }), this._columnResizeRect = new sh(S_, { visible: !1, mode: Ac.VERTICAL, zIndex: 100 }), e.addObjects([this._rowResizeRect, this._columnResizeRect], rr), this._initialHover( 0 /* ROW */ ), this._initialHover( 1 /* COLUMN */ ), this._initialHoverResize( 0 /* ROW */ ), this._initialHoverResize( 1 /* COLUMN */ ); } _initialHover(e = 0) { const t = this._context.components.get(qe.COLUMN), n = this._context.components.get(qe.ROW), s = this._context.scene, i = e === 0 ? n : t, o = (a, c) => { var d, u; (d = this._rowResizeRect) == null || d.hide(), (u = this._columnResizeRect) == null || u.hide(); }, l = (a, c) => { var M; const d = (M = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : M.skeleton; if (d == null || this._rowResizeRect == null || this._columnResizeRect == null) return; const { rowHeaderWidth: u, columnHeaderHeight: h } = d, { startX: m, startY: f, endX: g, endY: p, row: S, column: b } = Nn( a.offsetX, a.offsetY, s, d ), v = fo(a.offsetX, a.offsetY, s), { scaleX: _, scaleY: R } = s.getAncestorScale(), I = Math.max(_, R), y = Fs / I; if (e === 0) { let P = f - y / 2; if (v.y <= f + y / 2 && v.y >= f) this._currentRow = S - 1; else if (v.y >= p - y / 2 && v.y <= p) this._currentRow = S, P = p - y / 2; else { this._rowResizeRect.hide(); return; } if (this._currentRow === -1) return; if (!this.interceptor.fetchThroughInterceptors(Va)(null, { row: this._currentRow })) return !1; const T = Math.min(h_, u / 3); this._rowResizeRect.transformByState({ left: u / 2 - T / 2, top: P }), this._rowResizeRect.setShapeProps({ size: T }), this._rowResizeRect.show(); } else { let P = m - y / 2; if (v.x <= m + y / 2 && v.x >= m) this._currentColumn = b - 1; else if (v.x >= g - y / 2 && v.x <= g) this._currentColumn = b, P = g - y / 2; else { this._columnResizeRect.hide(); return; } if (this._currentColumn === -1) return; if (!this.interceptor.fetchThroughInterceptors(Va)(null, { col: this._currentColumn })) return !1; const T = h * 0.7; this._columnResizeRect.transformByState({ left: P, top: h / 2 - T / 2 }), this._columnResizeRect.setShapeProps({ size: T }), this._columnResizeRect.show(); } }; this._headerPointerSubs = new Kn(), this._headerPointerSubs.add(i == null ? void 0 : i.onPointerMove$.subscribeEvent(l)), this._headerPointerSubs.add(i == null ? void 0 : i.onPointerLeave$.subscribeEvent(o)); } _initialHoverResize(e = 0) { const t = this._context.scene, n = e === 0 ? this._rowResizeRect : this._columnResizeRect; n != null && (this.disposeWithMe( n.onPointerEnter$.subscribeEvent(() => { n != null && (n.show(), t.setCursor( e === 0 ? Re.ROW_RESIZE : Re.COLUMN_RESIZE )); }) ), this.disposeWithMe( n.onPointerLeave$.subscribeEvent(() => { n != null && (n.hide(), t.resetCursor()); }) ), this.disposeWithMe( n.onPointerDown$.subscribeEvent((s) => { var U, V, N, X, Y, ie, he; const i = (U = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : U.skeleton; if (i == null) return; const o = this._context.scene, l = o.getEngine(), a = (l == null ? void 0 : l.height) || 0, c = (l == null ? void 0 : l.width) || 0, d = o.getViewport(z.VIEW_MAIN), u = (((N = (V = d == null ? void 0 : d.getScrollBar()) == null ? void 0 : V.horizonScrollTrack) == null ? void 0 : N.height) || 0) + 10, h = (((Y = (X = d == null ? void 0 : d.getScrollBar()) == null ? void 0 : X.verticalScrollTrack) == null ? void 0 : Y.width) || 0) + 10, m = fo(s.offsetX, s.offsetY, o), { scaleX: f, scaleY: g } = o.getAncestorScale(); this._startOffsetX = m.x, this._startOffsetY = m.y; const p = i.getOffsetByPositionX(this._currentColumn), S = i.getOffsetByPositionY(this._currentRow), b = i.getNoMergeCellPositionByIndex(this._currentRow, this._currentColumn); let v = !1, _ = 0, R = 0; const { columnTotalWidth: I, rowHeaderWidth: y, rowTotalHeight: M, columnHeaderHeight: P } = i, E = c > I + y ? c : I + y, T = a > M + P ? a : M + P, A = Math.max(f, g), H = Nc / A; e === 0 ? this._resizeHelperShape = new ge(ih, { width: E, height: H, fill: oh, left: 0, top: S - H / 2 }) : this._resizeHelperShape = new ge(ih, { width: H, height: T, fill: oh, left: p - H / 2, top: 0 }); const x = ((ie = this._columnResizeRect) == null ? void 0 : ie.left) || 0, k = ((he = this._rowResizeRect) == null ? void 0 : he.top) || 0; o.addObject(this._resizeHelperShape, rr), o.disableObjectsEvent(), this._scenePointerMoveSub = o.onPointerMove$.subscribeEvent((ne) => { var we, Ve, pt, bt, xs, nu; const pe = o.getCoordRelativeToViewport( Oe.FromArray([this._startOffsetX, this._startOffsetY]) ), ve = o.getScrollXYInfoByViewport(pe, d), G = fo(ne.offsetX, ne.offsetY, o), { x: J, y: le } = G, { scaleX: fe, scaleY: Ze } = o.getAncestorScale(), lt = Math.max(fe, Ze), Be = Nc / lt; _ = J - this._startOffsetX - Be / 2, R = le - this._startOffsetY - Be / 2, Math.abs(e === 0 ? R : _) >= C_ && (v = !0), e === 0 ? (R > a - u + ve.y - b.startY && (R = a - u + ve.y - b.startY), R < -(b.endY - b.startY) + 2 && (R = -(b.endY - b.startY) + 2), v && ((we = this._resizeHelperShape) == null || we.transformByState({ top: S + R }), (Ve = this._rowResizeRect) == null || Ve.transformByState({ top: k + R + Be / 2 }), (pt = this._rowResizeRect) == null || pt.show(), o.setCursor(Re.ROW_RESIZE))) : (_ > c - h + ve.x - b.startX && (_ = c - h + ve.x - b.startX), _ < -(b.endX - b.startX) + 2 && (_ = -(b.endX - b.startX) + 2), v && ((bt = this._resizeHelperShape) == null || bt.transformByState({ left: p + _ }), (xs = this._columnResizeRect) == null || xs.transformByState({ left: x + _ + Be / 2 }), (nu = this._columnResizeRect) == null || nu.show(), o.setCursor(Re.COLUMN_RESIZE))); }), this._scenePointerUpSub = o.onPointerUp$.subscribeEvent((ne) => { var ve, G, J; const pe = this._context.scene; this._clearObserverEvent(), (ve = this._resizeHelperShape) == null || ve.dispose(), this._resizeHelperShape = null, pe.enableObjectsEvent(), v && (pe.resetCursor(), (G = this._rowResizeRect) == null || G.hide(), (J = this._columnResizeRect) == null || J.hide(), e === 0 ? this._commandService.executeCommand(BS.id, { deltaY: R, anchorRow: this._currentRow }) : this._commandService.executeCommand( FS.id, { deltaX: _, anchorCol: this._currentColumn } )); }); }) ), this.disposeWithMe( n.onDblclick$.subscribeEvent(() => { var d, u, h; this._context.scene.resetCursor(); const i = (d = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : d.skeleton; if (!i) return; const o = 0, l = 0, a = i.worksheet.getRowCount() - 1 || 0, c = i.worksheet.getColumnCount() - 1 || 0; switch (e) { case 1: { const m = this._selectionManagerService.getCurrentSelections(), f = []; for (let g = 0; g < m.length; g++) { const p = m[g]; p.range.rangeType === j.COLUMN && this._currentColumn <= p.range.endColumn && this._currentColumn >= p.range.startColumn && f.push({ startColumn: p.range.startColumn, endColumn: p.range.endColumn, startRow: o, endRow: a }); } f.length === 0 && f.push({ startColumn: this._currentColumn, endColumn: this._currentColumn, startRow: o, endRow: a }), this._commandService.executeCommand( Ql.id, { ranges: f } ), (u = this._columnResizeRect) == null || u.hide(); break; } case 0: this._commandService.executeCommand( Pl.id, { ranges: [{ startRow: this._currentRow, endRow: this._currentRow, startColumn: l, endColumn: c }] } ), (h = this._rowResizeRect) == null || h.hide(); break; } }) )); } _clearObserverEvent() { var e, t; (e = this._scenePointerMoveSub) == null || e.unsubscribe(), (t = this._scenePointerUpSub) == null || t.unsubscribe(), this._scenePointerMoveSub = null, this._scenePointerUpSub = null; } }; jo = g_([ Ha(1, D(me)), Ha(2, D($)), Ha(3, F) ], jo); var v_ = Object.defineProperty, b_ = Object.getOwnPropertyDescriptor, __ = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? b_(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && v_(e, t, s), s; }, $i = (r, e) => (t, n) => e(t, n, r); const w_ = 60; let Xo = class extends kn { constructor(e, t, n, s, i) { super(); w(this, "_renderFrameTimeMetric", null); w(this, "_renderFrameTags", {}); w(this, "_afterRenderMetric$", new xe()); this._context = e, this._sheetSkeletonManagerService = t, this._sheetRenderService = n, this._commandService = s, this._telemetryService = i, this._addNewRender(), this._initRenderMetricSubscriber(); } _addNewRender() { const { scene: e, engine: t, unit: n } = this._context; this._addComponent(n), this._initRerenderScheduler(), this._initCommandListener(); const s = this._context.unit.getActiveSheet(); if (!s) throw new Error("No active sheet found"); const i = s.getSheetId(); this._sheetSkeletonManagerService.setCurrent({ sheetId: i }), t.runRenderLoop(() => e.render()); } _initRenderMetricSubscriber() { if (!this._telemetryService) return; const { engine: e } = this._context; e.beginFrame$.subscribe(() => { this._renderFrameTimeMetric = null, this._renderFrameTags = {}; }), e.endFrame$.subscribe(() => { this._renderFrameTimeMetric && Object.keys(this._renderFrameTimeMetric).filter((s) => s.startsWith(mu)).length > 0 && this._afterRenderMetric$.next({ frameTimeMetric: this._renderFrameTimeMetric, tags: this._renderFrameTags }); }), e.renderFrameTimeMetric$.subscribe(([n, s]) => { this._renderFrameTimeMetric || (this._renderFrameTimeMetric = {}), this._renderFrameTimeMetric[n] || (this._renderFrameTimeMetric[n] = []), this._renderFrameTimeMetric[n].push(Math.round(s * 100) / 100); }), e.renderFrameTags$.subscribe(([n, s]) => { this._renderFrameTags[n] = s; }); const t = []; this._afterRenderMetric$.pipe(ES(e.endFrame$)).subscribe(([n, s]) => { t.push({ FPS: s.FPS, elapsedTime: s.elapsedTime, frameTime: Math.round(s.frameTime * 100) / 100, ...n.frameTimeMetric, ...n.tags }), t.length > w_ && (this._renderMetricCapture(t), t.length = 0); }); } _renderMetricCapture(e) { const t = e; if (t.length === 0) return; const n = (u) => { let h = 0; const f = Object.entries(u).filter(([p, S]) => Array.isArray(S)).map(([p]) => p).reduce((p, S) => { const b = u[S].reduce((v, _) => v + _, 0); return p[S] = b, p; }, {}); return Object.keys(u).filter((p) => p.startsWith(mu)).forEach((p) => { h += f[p]; }), { ...f, extensionTotal: h }; }, s = e.map((u) => ({ ...u, ...n(u) })), o = ((u) => Object.entries(u[0]).filter(([f, g]) => !["elapsedTime"].includes(f)).filter(([f, g]) => typeof g == "number").map(([f]) => f).reduce((f, g) => { const p = u.map((_) => _[g]), S = Math.max(...p), b = Math.min(...p), v = p.reduce((_, R) => _ + R, 0) / p.length; return f[g] = { max: Math.round(S * 100) / 100, min: Math.round(b * 100) / 100, avg: Math.round(v * 100) / 100 }, f; }, {}))(s), l = t[t.length - 1].elapsedTime, a = this._context.unit.getActiveSheet().getSheetId(), c = this._context.unit.getUnitId(), d = { sheetId: a, unitId: c, elapsedTimeToStart: l, ...o }; this._telemetryService.capture("sheet_render_cost", d); } _addComponent(e) { const { scene: t, components: n } = this._context, s = e.getActiveSheet(), i = new Yh(qe.MAIN); this._addViewport(s); const o = new lS(qe.ROW), l = new aS(qe.COLUMN), a = new ge(qe.LEFT_TOP, { zIndex: 2, left: -1, top: -1, fill: "rgb(248, 249, 250)", stroke: "rgb(217, 217, 217)", strokeWidth: 1 }); this._context.mainComponent = i, n.set(qe.MAIN, i), n.set(qe.ROW, o), n.set(qe.COLUMN, l), n.set(qe.LEFT_TOP, a), t.addObjects([i], Tu), t.addObjects( [o, l, a], rr ), t.enableLayerCache(Tu, rr); } _initViewports(e, t, n) { const o = new Cn(z.VIEW_MAIN, e, { left: t.width, top: n.height, bottom: 0, right: 0, isWheelPreventDefaultX: !0, allowCache: !0, bufferEdgeX: 100, bufferEdgeY: 100 }), l = new Cn(z.VIEW_MAIN_LEFT_TOP, e, { isWheelPreventDefaultX: !0, active: !1, allowCache: !0, bufferEdgeX: 0, bufferEdgeY: 0 }), a = new Cn(z.VIEW_MAIN_LEFT, e, { isWheelPreventDefaultX: !0, active: !1, allowCache: !0, bufferEdgeX: 0, bufferEdgeY: 100 }), c = new Cn(z.VIEW_MAIN_TOP, e, { isWheelPreventDefaultX: !0, active: !1, allowCache: !0, bufferEdgeX: 100, bufferEdgeY: 0 }), d = new Cn(z.VIEW_ROW_TOP, e, { active: !1, isWheelPreventDefaultX: !0 }), u = new Cn(z.VIEW_ROW_BOTTOM, e, { left: 0, top: n.height, bottom: 0, width: t.width, isWheelPreventDefaultX: !0 }), h = new Cn(z.VIEW_COLUMN_LEFT, e, { active: !1, isWheelPreventDefaultX: !0 }), m = new Cn(z.VIEW_COLUMN_RIGHT, e, { left: t.width, top: 0, height: n.height, right: 0, isWheelPreventDefaultX: !0 }), f = new Cn(z.VIEW_LEFT_TOP, e, { left: 0, top: 0, width: t.width, height: n.height, isWheelPreventDefaultX: !0 }); return { viewMain: o, viewLeftTop: f, viewMainLeftTop: l, viewMainLeft: a, viewMainTop: c, viewColumnLeft: h, viewRowTop: d, viewRowBottom: u, viewColumnRight: m }; } /** * * initViewport & wheel event * +-----------------+--------------------+-------------------+ * | VIEW_LEFT_TOP | VIEW_COLUMN_LEFT | VIEW_COLUMN_RIGHT | * +-----------------+--------------------+-------------------+ * | VIEW_ROW_TOP | VIEW_MAIN_LEFT_TOP | VIEW_MAIN_TOP | * +-----------------+--------------------+-------------------+ * | VIEW_ROW_BOTTOM | VIEW_MAIN_LEFT | VIEW_MAIN | * +-----------------+--------------------+-------------------+ */ _addViewport(e) { const t = this._context.scene, { rowHeader: n, columnHeader: s } = e.getConfig(), { viewMain: i } = this._initViewports(t, n, s); return new rd(i), t.attachControl(), i; } _initRerenderScheduler() { this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((e) => { if (!e) return null; const { skeleton: t, sheetId: n } = e, s = this._context.unit, i = s == null ? void 0 : s.getSheetBySheetId(n); if (s == null || i == null) return; const { mainComponent: o, components: l } = this._context, a = o, c = l.get(qe.ROW), d = l.get(qe.COLUMN), u = l.get(qe.LEFT_TOP), { rowHeaderWidth: h, columnHeaderHeight: m } = t; a == null || a.updateSkeleton(t), c == null || c.updateSkeleton(t), d == null || d.updateSkeleton(t), u == null || u.transformByState({ width: h, height: m }); })); } _initCommandListener() { this.disposeWithMe(this._commandService.onCommandExecuted((e) => { const { unit: t } = this._context, { id: n } = e; if (Io.includes(n) || this._sheetRenderService.checkMutationShouldTriggerRerender(n)) { const s = e.params, { unitId: i, subUnitId: o } = s, l = t.getActiveSheet(); if (!l) return; const a = this._context.unitId, c = l.getSheetId(); if (i !== a || o !== c) return; this._sheetSkeletonManagerService.makeDirty({ sheetId: c, commandId: n }, !0), this._sheetSkeletonManagerService.setCurrent({ sheetId: c, commandId: n }); } else US.includes(n) && this._sheetSkeletonManagerService.reCalculate(); e.type === K.MUTATION && this._markUnitDirty(e); })); } _markUnitDirty(e) { const { mainComponent: t, scene: n } = this._context; if (e.id === MC.id && e.params.stageInfo != null || (t && t.makeDirty(), n.makeDirty(), !e.params)) return; const s = e.params, i = this._spreadsheetViewports(n); if (e.id === Se.id && s.cellValue) { const o = this._cellValueToRange(s.cellValue), l = this._rangeToBounds([o]); this._markViewportDirty(i, l), t.setDirtyArea(l); } if (e.id === tr.id && s.from && s.to) { const o = s.fromRange || this._cellValueToRange(s.from.value), l = s.toRange || this._cellValueToRange(s.to.value), a = this._rangeToBounds([o, l]); this._markViewportDirty(i, a), t.setDirtyArea(a); } } /** * cellValue data structure: * {[row]: { [col]: value}} * @param cellValue * @returns IRange */ _cellValueToRange(e) { let t = 0, n = 0, s = 0, i = 0; for (const [d, u] of Object.entries(e)) { for (const h in u) t > Number(h) && (t = Number(h)), n < Number(h) && (n = Number(h)); s > Number(d) && (s = Number(d)), i < Number(d) && (i = Number(d)); } return { startRow: s, endRow: i, startColumn: t, endColumn: n }; } _rangeToBounds(e) { const t = this._sheetSkeletonManagerService.getCurrent().skeleton, { rowHeightAccumulation: n, columnWidthAccumulation: s, rowHeaderWidth: i, columnHeaderHeight: o } = t, l = []; for (const a of e) { const { startRow: c, endRow: d, startColumn: u, endColumn: h } = a, m = c === 0 ? 0 : n[c - 1] + o, f = n[d] + o, g = u === 0 ? 0 : s[u - 1] + i, p = s[h] + i; l.push({ top: m, left: g, bottom: f, right: p, width: p - g, height: f - m }); } return l; } _markViewportDirty(e, t) { const n = e.filter((s) => s.isActive && s.cacheBound); for (const s of n) for (const i of t) ae.hasIntersectionBetweenTwoRect(s.cacheBound, i) && s.markDirty(!0); } _spreadsheetViewports(e) { return e.getViewports().filter((t) => ["viewMain", "viewMainLeftTop", "viewMainTop", "viewMainLeft"].includes(t.viewportKey)); } }; Xo = __([ $i(1, D(me)), $i(2, D(Mr)), $i(3, F), $i(4, Jc(kC)) ], Xo); var Bt = function() { return Bt = Object.assign || function(r) { for (var e, t = 1, n = arguments.length; t < n; t++) { e = arguments[t]; for (var s in e) Object.prototype.hasOwnProperty.call(e, s) && (r[s] = e[s]); } return r; }, Bt.apply(this, arguments); }, R_ = function(r, e) { var t = {}; for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && e.indexOf(n) < 0 && (t[n] = r[n]); if (r != null && typeof Object.getOwnPropertySymbols == "function") for (var s = 0, n = Object.getOwnPropertySymbols(r); s < n.length; s++) e.indexOf(n[s]) < 0 && Object.prototype.propertyIsEnumerable.call(r, n[s]) && (t[n[s]] = r[n[s]]); return t; }, gt = ht(function(r, e) { var t = r.icon, n = r.id, s = r.className, i = r.extend, o = R_(r, ["icon", "id", "className", "extend"]), l = "univerjs-icon univerjs-icon-".concat(n, " ").concat(s || "").trim(), a = xn("_".concat(M_())); return Vf(t, "".concat(n), { defIds: t.defIds, idSuffix: a.current }, Bt({ ref: e, className: l }, o), i); }); function Vf(r, e, t, n, s) { return at(r.tag, Bt(Bt({ key: e }, I_(r, t, s)), n), (y_(r, t).children || []).map(function(i, o) { return Vf(i, "".concat(e, "-").concat(r.tag, "-").concat(o), t, void 0, s); })); } function I_(r, e, t) { var n = Bt({}, r.attrs); t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1); var s = e.defIds; return !s || s.length === 0 || (r.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(i) { var o = i[0], l = i[1]; typeof l == "string" && (n[o] = l.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")"))); })), n; } function y_(r, e) { var t, n = e.defIds; return !n || n.length === 0 ? r : r.tag === "defs" && (!((t = r.children) === null || t === void 0) && t.length) ? Bt(Bt({}, r), { children: r.children.map(function(s) { return typeof s.attrs.id == "string" && n && n.indexOf(s.attrs.id) > -1 ? Bt(Bt({}, s), { attrs: Bt(Bt({}, s.attrs), { id: s.attrs.id + e.idSuffix }) }) : s; }) }) : r; } function M_() { return Math.random().toString(36).substring(2, 8); } gt.displayName = "UniverIcon"; var P_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "colorChannel1", d: "M11.0363 12.2367V14.0367C11.0363 14.3681 11.3049 14.6367 11.6363 14.6367C11.9676 14.6367 12.2363 14.3681 12.2363 14.0367V12.2367H14.0364C14.3677 12.2367 14.6364 11.9681 14.6364 11.6367C14.6364 11.3054 14.3677 11.0367 14.0364 11.0367H12.2363V9.23672C12.2363 8.90535 11.9676 8.63672 11.6363 8.63672C11.3049 8.63672 11.0363 8.90535 11.0363 9.23672V11.0367H9.23635C8.90498 11.0367 8.63635 11.3054 8.63635 11.6367C8.63635 11.9681 8.90498 12.2367 9.23635 12.2367H11.0363Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M2.56365 1.36377C1.90091 1.36377 1.36365 1.90103 1.36365 2.56377V6.16377C1.36365 6.82651 1.90091 7.36377 2.56365 7.36377H6.16365C6.82639 7.36377 7.36365 6.82651 7.36365 6.16377V2.56377C7.36365 1.90103 6.82639 1.36377 6.16365 1.36377H2.56365zM6.16365 2.56377H2.56365L2.56365 6.16377H6.16365V2.56377zM2.56365 8.63647C1.90091 8.63647 1.36365 9.17373 1.36365 9.83647V13.4365C1.36365 14.0992 1.90091 14.6365 2.56365 14.6365H6.16365C6.82639 14.6365 7.36365 14.0992 7.36365 13.4365V9.83647C7.36365 9.17373 6.82639 8.63647 6.16365 8.63647H2.56365zM6.16365 9.83647H2.56365L2.56365 13.4365H6.16365V9.83647zM9.83635 7.36377C9.17361 7.36377 8.63635 6.82651 8.63635 6.16377V2.56377C8.63635 1.90103 9.17361 1.36377 9.83635 1.36377H13.4364C14.0991 1.36377 14.6364 1.90103 14.6364 2.56377V6.16377C14.6364 6.82651 14.0991 7.36377 13.4364 7.36377H9.83635zM9.83635 6.16377V2.56377L13.4364 2.56377V6.16377H9.83635z", fillRule: "evenodd", clipRule: "evenodd" } }] }, kf = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "autofill", ref: e, icon: P_ })); }); kf.displayName = "Autofill"; var E_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Hn = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "check-mark-single", ref: e, icon: E_ })); }); Hn.displayName = "CheckMarkSingle"; var T_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z" } }] }, Df = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "close-single", ref: e, icon: T_ })); }); Df.displayName = "CloseSingle"; var x_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "g", attrs: { fill: "currentColor", clipPath: "url(#convert-single_clip0_911_593)" }, children: [{ tag: "path", attrs: { d: "M2.44766.848145C1.564.848145.847656 1.56449.847656 2.44814V6.44814C.847656 7.3318 1.564 8.04814 2.44766 8.04814H6.44766C7.33131 8.04814 8.04766 7.3318 8.04766 6.44814V2.44814C8.04766 1.56449 7.33131.848145 6.44766.848145H2.44766zM2.04766 6.44814V5.04824H3.84775V6.84814H2.44766C2.22674 6.84814 2.04766 6.66906 2.04766 6.44814zM2.04766 3.84824H3.84775V2.04814H2.44766C2.22674 2.04814 2.04766 2.22723 2.04766 2.44814V3.84824zM5.04775 6.84814V5.04824H6.84766V6.44814C6.84766 6.66906 6.66857 6.84814 6.44766 6.84814H5.04775zM5.04775 3.84824H6.84766V2.44814C6.84766 2.22723 6.66857 2.04814 6.44766 2.04814H5.04775V3.84824zM9.55215 7.95166C8.66849 7.95166 7.95215 8.668 7.95215 9.55166V13.5517C7.95215 14.4353 8.66849 15.1517 9.55215 15.1517L11.5522 15.1517 13.5521 15.1517C14.4358 15.1517 15.1521 14.4353 15.1521 13.5517L15.1521 11.5518 15.1521 9.55166C15.1521 8.668 14.4358 7.95166 13.5521 7.95166H9.55215zM13.9521 10.9518V9.55166C13.9521 9.33075 13.7731 9.15166 13.5521 9.15166H12.1522V10.9518H13.9521zM10.9522 10.9518V9.15166H9.55215C9.33123 9.15166 9.15215 9.33075 9.15215 9.55166V10.9518H10.9522zM9.15215 12.1518H10.9522V13.9517H9.55215C9.33123 13.9517 9.15215 13.7726 9.15215 13.5517V12.1518zM12.1522 12.1518H13.9521V13.5517C13.9521 13.7726 13.7731 13.9517 13.5521 13.9517H12.1522V12.1518z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { d: "M9.62158 2.44912C9.62158 2.11775 9.89021 1.84912 10.2216 1.84912H12.7516C13.6352 1.84912 14.3516 2.56547 14.3516 3.44912V5.9791C14.3516 6.31047 14.0829 6.5791 13.7516 6.5791 13.4202 6.5791 13.1516 6.31047 13.1516 5.9791V3.44912C13.1516 3.22821 12.9725 3.04912 12.7516 3.04912H10.2216C9.89021 3.04912 9.62158 2.78049 9.62158 2.44912zM5.77871 14.1507C6.11008 14.1507 6.37871 13.8821 6.37871 13.5507 6.37871 13.2193 6.11008 12.9507 5.77871 12.9507L3.24873 12.9507C3.02782 12.9507 2.84873 12.7716 2.84873 12.5507L2.84873 10.0207C2.84873 9.68933 2.5801 9.4207 2.24873 9.4207 1.91736 9.4207 1.64873 9.68933 1.64873 10.0207L1.64873 12.5507C1.64873 13.4343 2.36507 14.1507 3.24873 14.1507H5.77871z" } }] }, { tag: "defs", attrs: {}, children: [{ tag: "clipPath", attrs: { id: "convert-single_clip0_911_593" }, children: [{ tag: "path", attrs: { fill: "#fff", d: "M0 0H16V16H0z" } }] }] }], defIds: ["convert-single_clip0_911_593"] }, Lf = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "convert-single", ref: e, icon: x_ })); }); Lf.displayName = "ConvertSingle"; var O_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, ea = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "delete-single", ref: e, icon: O_ })); }); ea.displayName = "DeleteSingle"; var A_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_371_77", style: { maskType: "alpha" }, width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#DCDCDC", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { mask: "url(#mask0_371_77)" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.85869 12.9216C8.38445 13.4708 7.61555 13.4708 7.14131 12.9216L0.358114 5.06726C-0.406895 4.18144 0.134916 2.66683 1.2168 2.66683L14.7832 2.66683C15.8651 2.66683 16.4069 4.18144 15.6419 5.06726L8.85869 12.9216Z" } }] }] }, Hc = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "dropdown-single", ref: e, icon: A_ })); }); Hc.displayName = "DropdownSingle"; var N_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM10.3097 5.69014C10.544 5.92445 10.544 6.30435 10.3097 6.53867L8.84843 7.9999L10.3099 9.46137C10.5442 9.69569 10.5442 10.0756 10.3099 10.3099C10.0756 10.5442 9.69569 10.5442 9.46137 10.3099L7.9999 8.84843L6.53842 10.3099C6.30411 10.5442 5.92421 10.5442 5.6899 10.3099C5.45558 10.0756 5.45558 9.69569 5.6899 9.46137L7.15137 7.9999L5.69014 6.53867C5.45583 6.30435 5.45583 5.92445 5.69014 5.69014C5.92445 5.45583 6.30435 5.45583 6.53867 5.69014L7.9999 7.15137L9.46113 5.69014C9.69544 5.45583 10.0753 5.45583 10.3097 5.69014Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Xd = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "error-single", ref: e, icon: N_ })); }); Xd.displayName = "ErrorSingle"; var H_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.28096 4.6541C1.57489 4.50109 1.93721 4.61533 2.09022 4.90926C2.27315 5.26067 2.55999 5.60455 2.94829 5.92278C4.04628 6.82266 5.87505 7.44865 7.99828 7.44865C10.1215 7.44865 11.9503 6.82267 13.0482 5.92279C13.4366 5.60455 13.7234 5.26067 13.9063 4.90927C14.0594 4.61533 14.4217 4.50109 14.7156 4.65409C15.0095 4.8071 15.1238 5.16941 14.9708 5.46334C14.6995 5.98445 14.2981 6.44997 13.8089 6.8509C13.7298 6.91575 13.6481 6.97914 13.564 7.041L15.2245 8.70153C15.4588 8.93585 15.4588 9.31575 15.2245 9.55006C14.9902 9.78438 14.6103 9.78438 14.376 9.55006L12.5041 7.67822C11.8977 7.97568 11.2181 8.21208 10.4884 8.37706L11.0996 10.6581C11.1853 10.9782 10.9954 11.3072 10.6753 11.393C10.3552 11.4787 10.0262 11.2888 9.94045 10.9687L9.29949 8.57652C8.8758 8.62404 8.44081 8.64865 7.99828 8.64865C7.55276 8.64865 7.11487 8.62371 6.68846 8.57555L6.04723 10.9687C5.96147 11.2888 5.63247 11.4788 5.31239 11.393C4.99231 11.3073 4.80236 10.9783 4.88812 10.6582L5.49983 8.37516C4.7743 8.2105 4.09843 7.9752 3.49498 7.67947L1.62436 9.55009C1.39005 9.78441 1.01015 9.78441 0.775835 9.5501C0.54152 9.31578 0.541518 8.93588 0.775832 8.70157L2.43478 7.04261C2.34987 6.98024 2.26746 6.91632 2.18764 6.8509C1.69842 6.44997 1.29706 5.98445 1.0258 5.46335C0.872791 5.16942 0.987031 4.80711 1.28096 4.6541Z" } }] }, Wf = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "eyelash-single", ref: e, icon: H_ })); }); Wf.displayName = "EyelashSingle"; var V_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M6.06409 5.53454C5.93592 5.53454 5.84083 5.41567 5.86897 5.29063L5.95442 4.9109C6.05444 4.48178 6.23806 4.11547 6.51182 3.81952 6.81082 3.49628 7.25398 3.35405 7.79738 3.35405 7.99847 3.35405 8.21359 3.37775 8.44188 3.42245 8.46089 3.42617 8.47974 3.43006 8.49846 3.4341 8.7099 3.4798 8.93698 3.38478 9.02031 3.18514L9.24767 2.6404C9.33457 2.43219 9.23178 2.19404 9.01582 2.12874 8.98358 2.11899 8.95028 2.10912 8.91591 2.09914 8.62745 2.01631 8.28392 1.97217 7.88074 1.97217 6.82015 1.97217 6.02714 2.23936 5.4746 2.7444 4.90987 3.26069 4.50889 3.99917 4.28413 4.9762L2.83703 11.1909C2.76126 11.5286 2.666 11.8917 2.54844 12.2812 2.42975 12.6734 2.2873 13.0595 2.12221 13.4373 1.95577 13.8159 1.76813 14.1762 1.55955 14.5171 1.49345 14.6251 1.42515 14.7282 1.35467 14.8263 1.26508 14.9509 1.3347 15.133 1.48655 15.1554 2.13635 15.2509 2.8179 15.0763 3.18197 14.5296 3.32661 14.3124 3.46779 14.0646 3.60509 13.7851 3.96635 13.0497 4.30522 12.0103 4.61867 10.6574L5.469 7.01534C5.49013 6.92483 5.57082 6.86081 5.66376 6.86081H7.62478C7.8097 6.86081 7.97051 6.73405 8.01371 6.55425L8.14014 6.02798C8.20057 5.77642 8.00992 5.53454 7.75121 5.53454H6.06409zM14.3211 5.72037L12.5124 7.96963 11.4089 5.77754C11.3422 5.63012 11.1954 5.5354 11.0336 5.5354H10.3129C10.0085 5.5354 9.80921 5.85428 9.9427 6.1279L11.4089 9.05502 8.79783 12.1493C8.56587 12.4158 8.75519 12.8315 9.10855 12.8315H9.68607C9.80672 12.8315 9.9605 12.7822 10.0388 12.6904L12.1108 10.2648 13.1176 12.561C13.1786 12.7231 13.333 12.8315 13.5061 12.8315H14.3C14.5831 12.8315 14.7417 12.6175 14.6426 12.3524L13.1728 9.28628C13.1728 9.28628 15.4009 6.45542 15.6013 6.17892 15.7966 5.90929 15.6023 5.5354 15.2693 5.5354H14.6661C14.5275 5.5354 14.4333 5.58887 14.3211 5.72037z" } }] }, Bf = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "fx-single", ref: e, icon: V_ })); }); Bf.displayName = "FxSingle"; var k_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "colorChannel1", d: "M6.4833 1.65005C6.4833 1.31868 6.21467 1.05005 5.8833 1.05005C5.55193 1.05005 5.2833 1.31868 5.2833 1.65005V5.28345H1.65029C1.31892 5.28345 1.05029 5.55208 1.05029 5.88345C1.05029 6.21482 1.31892 6.48345 1.65029 6.48345H5.2833V9.51684H1.65029C1.31892 9.51684 1.05029 9.78547 1.05029 10.1168C1.05029 10.4482 1.31892 10.7168 1.65029 10.7168H5.2833V14.35C5.2833 14.6814 5.55193 14.95 5.8833 14.95C6.21467 14.95 6.4833 14.6814 6.4833 14.35V10.7168H9.5167V14.35C9.5167 14.6814 9.78533 14.95 10.1167 14.95C10.4481 14.95 10.7167 14.6814 10.7167 14.35V10.7168H14.3503C14.6817 10.7168 14.9503 10.4482 14.9503 10.1168C14.9503 9.78547 14.6817 9.51685 14.3503 9.51685H10.7167V6.48345H14.3503C14.6817 6.48345 14.9503 6.21482 14.9503 5.88345C14.9503 5.55208 14.6817 5.28345 14.3503 5.28345H10.7167V1.65005C10.7167 1.31868 10.4481 1.05005 10.1167 1.05005C9.78533 1.05005 9.5167 1.31868 9.5167 1.65005V5.28345L6.4833 5.28345V1.65005ZM6.4833 6.48345V9.51684L9.5167 9.51685V6.48345L6.4833 6.48345Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.0498 3.65005C1.0498 2.21411 2.21386 1.05005 3.6498 1.05005H12.3498C13.7857 1.05005 14.9498 2.21411 14.9498 3.65005V12.3501C14.9498 13.786 13.7857 14.95 12.3498 14.95H3.6498C2.21386 14.95 1.0498 13.786 1.0498 12.35V3.65005ZM3.6498 2.25005C2.87661 2.25005 2.2498 2.87685 2.2498 3.65005V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V3.65005C13.7498 2.87685 13.123 2.25005 12.3498 2.25005H3.6498Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ff = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "hide-gridlines", ref: e, icon: k_ })); }); Ff.displayName = "HideGridlines"; var D_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, zd = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "increase-single", ref: e, icon: D_ })); }); zd.displayName = "IncreaseSingle"; var L_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.62402 7.72905C2.58427 7.72905 2.55205 7.76127 2.55205 7.80102V13.6782C2.55205 13.7179 2.58427 13.7502 2.62402 13.7502H13.3755C13.4152 13.7502 13.4474 13.7179 13.4474 13.6782V7.80102C13.4474 7.76127 13.4152 7.72905 13.3755 7.72905H2.62402ZM1.35205 7.80102C1.35205 7.09853 1.92153 6.52905 2.62402 6.52905H13.3755C14.0779 6.52905 14.6474 7.09853 14.6474 7.80102V13.6782C14.6474 14.3807 14.0779 14.9502 13.3755 14.9502H2.62402C1.92153 14.9502 1.35205 14.3807 1.35205 13.6782V7.80102Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8 2.25005C6.69847 2.25003 5.64336 3.30513 5.64336 4.60666V7.12895C5.64336 7.46032 5.37473 7.72895 5.04336 7.72895 4.71199 7.72895 4.44336 7.46032 4.44336 7.12895V4.60666C4.44336 2.64239 6.04451 1.05565 8.00879 1.05566M8 2.25005L8.00879 1.05566 8 2.25005zM8.00879 1.05566L8 2.25005C9.30154 2.25003 10.3567 3.30513 10.3567 4.60666V7.12895C10.3567 7.46032 10.6253 7.72895 10.9567 7.72895 11.288 7.72895 11.5567 7.46032 11.5567 7.12895V4.60666C11.5567 2.64239 9.97306 1.05565 8.00879 1.05566zM8.00039 9.4668C8.33176 9.4668 8.60039 9.73543 8.60039 10.0668V12.0827C8.60039 12.4141 8.33176 12.6827 8.00039 12.6827 7.66902 12.6827 7.40039 12.4141 7.40039 12.0827V10.0668C7.40039 9.73543 7.66902 9.4668 8.00039 9.4668z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Yd = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "lock-single", ref: e, icon: L_ })); }); Yd.displayName = "LockSingle"; var W_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, hs = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "more-down-single", ref: e, icon: W_ })); }); hs.displayName = "MoreDownSingle"; var B_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.90913 3.57564C6.14345 3.34132 6.52335 3.34132 6.75766 3.57564L10.7577 7.57564C10.992 7.80995 10.992 8.18985 10.7577 8.42417L6.75766 12.4242C6.52335 12.6585 6.14345 12.6585 5.90913 12.4242C5.67482 12.1899 5.67482 11.81 5.90913 11.5756L9.48487 7.9999L5.90913 4.42417C5.67482 4.18985 5.67482 3.80995 5.90913 3.57564Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Vc = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "more-single", ref: e, icon: B_ })); }); Vc.displayName = "MoreSingle"; var F_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_102_1204", style: { maskType: "alpha" }, width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#DCDCDC", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { mask: "url(#mask0_102_1204)" }, children: [{ tag: "rect", attrs: { width: 12.62, height: 2.79, x: 1.69, y: 12.25, fill: "colorChannel1", rx: 1.4 } }, { tag: "path", attrs: { fill: "currentColor", d: "M7.74646 2.1642C7.34284 1.65121 6.85947 1.28205 6.38447 1.09593C5.86863 0.893787 5.15166 0.852126 4.70047 1.42917C4.29842 1.94344 4.33082 2.70249 4.57691 3.50395C4.68808 3.8661 4.86846 4.22254 5.12522 4.56617C5.13695 4.58185 5.14927 4.5968 5.16211 4.61102C5.17152 4.6214 5.18122 4.63139 5.19115 4.64096C5.20459 4.65393 5.21855 4.66618 5.23296 4.6777L3.5064 6.40422C3.26756 6.64306 3.26756 7.03033 3.5064 7.26919L7.23756 11.0004C7.47648 11.2392 7.86375 11.2392 8.1026 11.0004L12.8329 6.27001C13.0717 6.03117 13.0717 5.6439 12.8329 5.40505L9.10172 1.67387C8.86288 1.43503 8.47561 1.43503 8.23676 1.67387L7.74646 2.1642ZM7.46162 4.50638C7.47252 4.57574 7.48163 4.64652 7.4888 4.71868C7.52232 5.05481 7.82194 5.30013 8.15807 5.26661C8.4942 5.23311 8.73954 4.93345 8.70601 4.59732C8.65786 4.11463 8.54251 3.6666 8.37892 3.26169L8.66928 2.97135L11.5354 5.83753L10.6106 6.76237H4.87824L7.40802 4.2326C7.42885 4.32128 7.44684 4.41255 7.46162 4.50638ZM6.87284 3.03784C6.57441 2.62008 6.22261 2.34634 5.93815 2.23487C5.80233 2.18165 5.71528 2.17827 5.67638 2.18335C5.6725 2.18387 5.66929 2.18443 5.6666 2.18497L5.6619 2.18607C5.64166 2.21954 5.53594 2.45979 5.74626 3.1449C5.81241 3.36036 5.92262 3.58602 6.09307 3.81761L6.87284 3.03784Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M12.1932 11.5463C12.6454 11.5463 13.012 11.1797 13.012 10.7275C13.012 10.4475 12.6981 9.92821 12.459 9.5733C12.3299 9.38173 12.0564 9.38174 11.9274 9.57331C11.6883 9.92822 11.3744 10.4475 11.3744 10.7275C11.3744 11.1797 11.741 11.5463 12.1932 11.5463Z" } }] }] }, Uf = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "paint-bucket", ref: e, icon: F_ })); }); Uf.displayName = "PaintBucket"; var U_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_102_1138", style: { maskType: "alpha" }, width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#DCDCDC", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { mask: "url(#mask0_102_1138)" }, children: [{ tag: "path", attrs: { fill: "colorChannel1", d: "M7.74692 9.12463C7.74692 9.46018 8.01893 9.73219 8.35448 9.73219H11.4933C11.8288 9.73219 12.1009 9.46018 12.1009 9.12463 12.1009 8.78909 11.8288 8.51707 11.4933 8.51707H8.35448C8.01893 8.51707 7.74692 8.78909 7.74692 9.12463zM10.8636 10.8523C10.8636 11.1879 10.5915 11.4599 10.256 11.4599H8.35448C8.01893 11.4599 7.74692 11.1879 7.74692 10.8523 7.74692 10.5168 8.01893 10.2447 8.35448 10.2447H10.256C10.5915 10.2447 10.8636 10.5168 10.8636 10.8523z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M5.4791 1.98268C5.47913 1.71529 5.87912 1.49854 6.37252 1.49854C6.86593 1.49854 7.26592 1.71529 7.26595 1.98268H7.62187C8.22277 1.98268 8.72459 2.39534 8.84412 2.9452H9.39563C10.0856 2.9452 10.6449 3.48923 10.6449 4.16032V6.00569H12.1261C13.161 6.00569 14 6.82174 14 7.82838V11.334C14 11.8174 13.8025 12.281 13.4511 12.6228L12.0693 13.9647C11.7179 14.3065 11.2412 14.4985 10.7442 14.4985H7.91116C7.05024 14.4985 6.32492 14.0431 6.10535 13.2737H3.34925C2.6593 13.2737 2.09998 12.7297 2.09998 12.0586V4.16032C2.09998 3.48923 2.6593 2.9452 3.34925 2.9452H3.90107C4.0206 2.39534 4.52241 1.98268 5.12332 1.98268H5.4791ZM3.97249 4.16032H3.24925L3.24925 12.0586H6.03725V7.82838C6.03725 6.82174 6.87623 6.00569 7.91116 6.00569H9.49563V4.16032H8.7727C8.58289 4.59611 8.13909 4.90183 7.62187 4.90183H5.12332C4.6061 4.90183 4.1623 4.59611 3.97249 4.16032ZM5.12332 2.89403H7.62187C7.79436 2.89403 7.93419 3.03003 7.93419 3.19781V3.68671C7.93419 3.85448 7.79436 3.99049 7.62187 3.99049H5.12332C4.95083 3.99049 4.811 3.85448 4.811 3.68671V3.19781C4.811 3.03003 4.95083 2.89403 5.12332 2.89403ZM7.91116 7.11157C7.56618 7.11157 7.28652 7.38359 7.28652 7.71913V12.7851C7.28652 13.1206 7.56618 13.3927 7.91116 13.3927H10.7442C10.8401 13.3927 10.9337 13.3712 11.0182 13.3311C11.1373 13.2746 11.1859 13.1423 11.1859 13.0134V12.0066C11.1859 11.8724 11.2978 11.7636 11.4358 11.7636H12.4709C12.6034 11.7636 12.7394 11.7163 12.7975 11.6004C12.8388 11.5182 12.8608 11.4272 12.8608 11.334V7.71913C12.8608 7.38359 12.5811 7.11157 12.2362 7.11157H7.91116Z", fillRule: "evenodd", clipRule: "evenodd" } }] }] }, jf = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "paste-special", ref: e, icon: U_ })); }); jf.displayName = "PasteSpecial"; var j_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.785 6.77762C5.78908 6.7777 5.79316 6.77774 5.79725 6.77774C5.80134 6.77774 5.80543 6.7777 5.8095 6.77762H10.0184C10.0225 6.7777 10.0266 6.77774 10.0307 6.77774C10.0347 6.77774 10.0388 6.7777 10.0429 6.77762H13.6638V7.63727C13.6638 7.96864 13.9324 8.23727 14.2638 8.23727C14.5951 8.23727 14.8638 7.96864 14.8638 7.63727V3.9999C14.8638 2.56395 13.6997 1.39989 12.2637 1.3999L3.56389 1.39999C2.12797 1.40001 0.96393 2.56405 0.96392 3.99998L0.963867 11.6666C0.963857 13.1025 2.12792 14.2666 3.56387 14.2666H8.0542C8.38557 14.2666 8.6542 13.9979 8.6542 13.6666C8.6542 13.3352 8.38557 13.0666 8.0542 13.0666H3.56387C2.79067 13.0666 2.16386 12.4398 2.16387 11.6666L2.1639 6.77762H5.785ZM6.39725 2.59996L9.43065 2.59993V5.57762H6.39725V2.59996ZM5.19725 5.57762V2.59998L3.56391 2.59999C2.79072 2.6 2.16393 3.22679 2.16392 3.99998L2.16391 5.57762H5.19725ZM13.6638 5.57762V3.9999C13.6638 3.2267 13.037 2.59989 12.2638 2.5999L10.6307 2.59992V5.57762H13.6638Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M14.1223 10.2333V10.7496C14.7087 10.9869 15.1223 11.5618 15.1223 12.2333V12.8999C15.1223 13.7836 14.406 14.4999 13.5223 14.4999H11.5223C10.6387 14.4999 9.92235 13.7836 9.92235 12.8999V12.2333C9.92235 11.5618 10.336 10.9869 10.9223 10.7496V10.2333C10.9223 9.34961 11.6387 8.63328 12.5223 8.63328C13.406 8.63328 14.1223 9.34961 14.1223 10.2333ZM11.1223 12.2333C11.1223 12.0124 11.3014 11.8333 11.5223 11.8333H13.5223C13.7433 11.8333 13.9223 12.0124 13.9223 12.2333V12.8999C13.9223 13.1209 13.7433 13.2999 13.5223 13.2999H11.5223C11.3014 13.2999 11.1223 13.1209 11.1223 12.8999V12.2333ZM12.9223 10.2333V10.6333H12.1223V10.2333C12.1223 10.0124 12.3014 9.83328 12.5223 9.83328C12.7433 9.83328 12.9223 10.0124 12.9223 10.2333Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Xf = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "protect-single", ref: e, icon: j_ })); }); Xf.displayName = "ProtectSingle"; var X_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM8.00008 12.3671C8.46031 12.3671 8.83342 11.994 8.83342 11.5338C8.83342 11.0735 8.46031 10.7004 8.00008 10.7004C7.53985 10.7004 7.16675 11.0735 7.16675 11.5338C7.16675 11.994 7.53985 12.3671 8.00008 12.3671ZM8.5999 4.4335C8.5999 4.10213 8.33127 3.8335 7.9999 3.8335C7.66853 3.8335 7.3999 4.10213 7.3999 4.4335V9.36683C7.3999 9.6982 7.66853 9.96683 7.9999 9.96683C8.33127 9.96683 8.5999 9.6982 8.5999 9.36683V4.4335Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, kc = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "warning-single", ref: e, icon: X_ })); }); kc.displayName = "WarningSingle"; var z_ = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z" } }] }, Zd = ht(function(r, e) { return at(gt, Object.assign({}, r, { id: "write-single", ref: e, icon: z_ })); }); Zd.displayName = "WriteSingle"; function Y_(r, e) { if (r.length !== e.length) return !1; const t = r.sort((s, i) => s.id.localeCompare(i.id)), n = e.sort((s, i) => s.id.localeCompare(i.id)); return t.every((s, i) => { var o, l; return ((o = s.subject) == null ? void 0 : o.userID) === ((l = n[i].subject) == null ? void 0 : l.userID) && s.role === n[i].role; }); } function zf(r, e) { return e.some((t) => Z_(r, t)); } function Z_(r, e) { const { startRow: t, startColumn: n, endColumn: s, endRow: i } = e, o = r.getMatrixWithMergedCells(t, n, i, s); let l = !1; return o.forValue((a, c, d) => { if (d && (a !== t || c !== n) && r.cellHasValue(d)) return l = !0, !1; }), l; } function Yf(r, e, t, n) { const s = [], i = [], o = t.getSheetId(); return n.forEach((l) => { const a = G_(t, l), c = { unitId: e, subUnitId: o, cellValue: a.getData() }, d = en( r, c ); s.push({ id: Se.id, params: d }), i.push({ id: Se.id, params: c }); }), { undos: s, redos: i }; } function G_(r, e) { const { startRow: t, startColumn: n, endColumn: s, endRow: i } = e, o = r.getMatrixWithMergedCells(t, n, i, s, Lh.Intercepted), l = new Ke(); let a = null; return o.forValue((c, d, u) => { var h, m, f, g; u && c >= t && d >= n && (!a && r.cellHasValue(u) && (u.v !== "" || ((g = (f = (m = (h = u.p) == null ? void 0 : h.body) == null ? void 0 : m.dataStream) == null ? void 0 : f.length) != null ? g : 0) > 2) && (a = u), l.setValue(c, d, null)); }), l.setValue(t, n, a), l; } function q_(r, e, t, n) { const s = t.getActiveViewportByCoord( Oe.FromArray([r, e]) ); if (!s) return; const { scaleX: i, scaleY: o } = t.getAncestorScale(), l = { x: s.viewportScrollX, y: s.viewportScrollY }, a = n.getCellIndexByOffset(r, e, i, o, l), c = n.worksheet.getMergedCell(a.row, a.column); return { actualRow: c ? c.startRow : a.row, actualCol: c ? c.startColumn : a.column, mergeCell: c, row: a.row, col: a.column }; } function lh(r, e, t, n) { const s = n.getFreeze(); if (!s || s.startRow <= 0 && s.startColumn <= 0) return t.getViewport(z.VIEW_MAIN); if (r >= s.startRow && e >= s.startColumn) return t.getViewport(z.VIEW_MAIN); if (r < s.startRow && e < s.startColumn) return t.getViewport(z.VIEW_MAIN_LEFT_TOP); if (r < s.startRow && e >= s.startColumn) return t.getViewport(z.VIEW_MAIN_TOP); if (r >= s.startRow && e < s.startColumn) return t.getViewport(z.VIEW_MAIN_LEFT); } function Q_(r, e, t, n) { const s = ah(r.left, r.top, e, t, n), i = ah(r.right, r.bottom, e, t, n); return { left: s.x, top: s.y, right: i.x, bottom: i.y }; } function ah(r, e, t, n, s) { const { scaleX: i, scaleY: o } = t.getAncestorScale(), l = t.getViewport(z.VIEW_MAIN); if (!l) return { x: r, y: e }; const a = s.getFreeze(), { startColumn: c, startRow: d, xSplit: u, ySplit: h } = a, m = n.getNoMergeCellPositionByIndexWithNoHeader(d - h, c - u), f = n.getNoMergeCellPositionByIndexWithNoHeader(d, c), { rowHeaderWidth: g, columnHeaderHeight: p } = n, S = f.startX - m.startX, b = f.startY - m.startY, { top: v, left: _, viewportScrollX: R, viewportScrollY: I } = l; let y; r > _ ? y = (r - R) * i : y = (S + g - (_ - r)) * i; let M; return e > v ? M = (e - I) * o : M = (b + p - (v - e)) * i, { x: y, y: M }; } function K_(r, e, t, n, s) { let i = n, o = s; t.overflowCache.forValue((c, d, u) => { u.startRow <= i && u.endRow >= i && u.startColumn <= o && u.endColumn >= o && (o = d, i = c); }); const l = t.getCellWithCoordByIndex(i, o); return { unitId: r.getUnitId(), subUnitId: e.getSheetId(), workbook: r, worksheet: e, row: l.actualRow, col: l.actualColumn }; } function Zf(r, e, t, n, s, i) { const { scene: o } = r, l = e.getUnitId(), { skeleton: a, sheetId: c } = n, d = q_(s, i, o, a); if (!d) return null; let { actualCol: u, actualRow: h } = d; const m = { unitId: l, subUnitId: c, workbook: e, worksheet: t, row: h, col: u }; a.overflowCache.forValue((I, y, M) => { M.startRow <= h && M.endRow >= h && M.startColumn <= u && M.endColumn >= u && (u = y, h = I); }); const f = a.getCellWithCoordByIndex(h, u), g = K_(e, t, a, h, u); let p; f.mergeInfo ? p = f.mergeInfo : p = { startRow: g.row, endRow: g.row, startColumn: g.col, endColumn: g.col }; const S = o.getActiveViewportByCoord( Oe.FromArray([s, i]) ); if (!S) return; const { scaleX: b, scaleY: v } = o.getAncestorScale(), _ = { x: S.viewportScrollX, y: S.viewportScrollY }; return { position: { startX: (a.getOffsetByPositionX(p.startColumn - 1) - _.x) * b, endX: (a.getOffsetByPositionX(p.endColumn) - _.x) * b, startY: (a.getOffsetByPositionY(p.startRow - 1) - _.y) * v, endY: (a.getOffsetByPositionY(p.endRow) - _.y) * v }, location: m, overflowLocation: g }; } const or = { type: K.COMMAND, id: "sheet.command.add-worksheet-merge", handler: async (r, e) => { const t = r.get(F), n = r.get(Zt), s = r.get(L), i = r.get(tn), o = r.get(Ee), l = e.unitId, a = e.subUnitId, c = e.selections, d = Al(c, e.value), u = s.getUniverSheetInstance(l).getSheetBySheetId(a), h = [], m = [], f = zf(u, d); if (f && !e.defaultMerge && !await i.confirm({ id: "merge.confirm.add-worksheet-merge", title: { title: "merge.confirm.title" }, cancelText: o.t("merge.confirm.cancel"), confirmText: o.t("merge.confirm.confirm") })) return !1; const g = { unitId: l, subUnitId: a, ranges: se.deepClone(d) }, p = { unitId: l, subUnitId: a, ranges: se.deepClone(d) }, S = Ol(r, g), b = Nl(r, p); if (S.ranges.length > 0 && h.push({ id: Kt.id, params: S }), h.push({ id: Jt.id, params: p }), m.push({ id: Kt.id, params: b }), S.ranges.length > 0 && m.push({ id: Jt.id, params: S }), f) { const M = Yf(r, l, u, d); h.unshift(...M.redos), m.push(...M.undos); } const v = jS(r, e, d); v && h.push(v); const _ = XS(r, e); _ && m.push(_); const I = r.get(Ln).onCommandExecute({ id: or.id, params: { unitId: l, subUnitId: a, ranges: d } }); return h.push(...I.redos), m.push(...I.undos), pl(h, t).result ? (n.pushUndoRedo({ unitID: l, undoMutations: m, redoMutations: h }), !0) : !1; } }, Gd = { type: K.COMMAND, id: "sheet.command.add-worksheet-merge-all", handler: async (r) => { var d; const e = r.get(F), n = (d = r.get($).getCurrentSelections()) == null ? void 0 : d.map((u) => u.range), s = Hd(Bl.MergeAll, n); if (!(s != null && s.length)) return !1; const o = r.get(L).getCurrentUnitForType(O.UNIVER_SHEET); if (!o) return !1; const l = o.getActiveSheet(); if (!l) return !1; const a = o.getUnitId(), c = l.getSheetId(); return e.executeCommand(or.id, { selections: s, unitId: a, subUnitId: c }); } }, qd = { type: K.COMMAND, id: "sheet.command.add-worksheet-merge-vertical", handler: async (r) => { var d; const e = r.get(F), n = (d = r.get($).getCurrentSelections()) == null ? void 0 : d.map((u) => u.range), s = Hd(Bl.MergeVertical, n); if (!(s != null && s.length)) return !1; const o = r.get(L).getCurrentUnitForType(O.UNIVER_SHEET); if (!o) return !1; const l = o.getActiveSheet(); if (!l) return !1; const a = o.getUnitId(), c = l.getSheetId(); return e.executeCommand(or.id, { value: Bh.COLUMNS, selections: s, unitId: a, subUnitId: c }); } }, Qd = { type: K.COMMAND, id: "sheet.command.add-worksheet-merge-horizontal", handler: async (r) => { var d; const e = r.get(F), n = (d = r.get($).getCurrentSelections()) == null ? void 0 : d.map((u) => u.range), s = Hd(Bl.MergeHorizontal, n); if (!(s != null && s.length)) return !1; const o = r.get(L).getCurrentUnitForType(O.UNIVER_SHEET); if (!o) return !1; const l = o.getActiveSheet(); if (!l) return !1; const a = o.getUnitId(), c = l.getSheetId(); return e.executeCommand(or.id, { value: Bh.ROWS, selections: s, unitId: a, subUnitId: c }); } }, Xi = { type: K.COMMAND, id: "sheet.command.delete-range-move-left-confirm", handler: async (r) => { const e = r.get(tn), t = r.get(F), n = r.get(Ee), s = r.get($), i = r.get(L), o = s.getCurrentSelections(); if (!o) return !1; const l = Ue(i); if (!l) return !1; const { worksheet: a } = l; let c = o[0].range; if (!c) return !1; c = { ...c, endColumn: a.getColumnCount() - 1 }; const d = (m) => m.endRow - m.startRow; return a.getMergeData().find((m) => { const f = ae.getIntersects(m, c); return f ? d(m) > d(f) : !1; }) ? await e.confirm({ id: Xi.id, title: { title: n.t("merge.confirm.waring") }, children: { title: n.t("merge.confirm.dismantleMergeCellWaring") }, cancelText: n.t("button.cancel"), confirmText: n.t("button.confirm") }) ? t.executeCommand(bu.id) : !0 : t.executeCommand(bu.id); } }, ms = { type: K.COMMAND, id: "sheet.command.delete-range-move-up-confirm", handler: async (r) => { const e = r.get(tn), t = r.get(F), n = r.get(Ee), s = r.get($), i = r.get(L), o = s.getCurrentSelections(); if (!o) return !1; const l = Ue(i); if (!l) return !1; const { worksheet: a } = l; let c = o[0].range; if (!c) return !1; c = { ...c, endRow: a.getRowCount() - 1 }; for (let m = c.startRow; m <= c.endRow; m++) if (a.getRowFiltered(m) && await e.confirm({ id: ms.id, title: { title: n.t("filter.confirm.error") }, children: { title: n.t("filter.confirm.notAllowedToInsertRange") }, confirmText: n.t("button.confirm") })) return !1; const d = (m) => m.endColumn - m.startColumn; return a.getMergeData().find((m) => { const f = ae.getIntersects(m, c); return f ? d(m) > d(f) : !1; }) ? await e.confirm({ id: ms.id, title: { title: n.t("merge.confirm.waring") }, children: { title: n.t("merge.confirm.dismantleMergeCellWaring") }, cancelText: n.t("button.cancel"), confirmText: n.t("button.confirm") }) ? t.executeCommand(_u.id) : !0 : t.executeCommand(_u.id); } }, fs = { type: K.COMMAND, id: "sheet.command.insert-range-move-down-confirm", handler: async (r) => { const e = r.get(tn), t = r.get(F), n = r.get(Ee), s = r.get($), i = r.get(L), o = s.getCurrentSelections(); if (!o) return !1; const l = Ue(i); if (!l) return !1; const { worksheet: a } = l; let c = o[0].range; if (!c) return !1; c = { ...c, endRow: a.getRowCount() - 1 }; for (let m = c.startRow; m <= c.endRow; m++) if (a.getRowFiltered(m) && await e.confirm({ id: fs.id, title: { title: n.t("filter.confirm.error") }, children: { title: n.t("filter.confirm.notAllowedToInsertRange") }, confirmText: n.t("button.confirm") })) return !1; const d = (m) => m.endColumn - m.startColumn; return a.getMergeData().find((m) => { const f = ae.getIntersects(m, c); return f ? d(m) > d(f) : !1; }) ? await e.confirm({ id: fs.id, title: { title: n.t("merge.confirm.waring") }, children: { title: n.t("merge.confirm.dismantleMergeCellWaring") }, cancelText: n.t("button.cancel"), confirmText: n.t("button.confirm") }) ? t.executeCommand(hc.id) : !0 : t.executeCommand(hc.id); } }, zi = { type: K.COMMAND, id: "sheet.command.insert-range-move-right-confirm", handler: async (r) => { const e = r.get(tn), t = r.get(F), n = r.get(Ee), s = r.get($), i = r.get(L), o = s.getCurrentSelections(); if (!o) return !1; const l = Ue(i); if (!l) return !1; const { worksheet: a } = l; let c = o[0].range; if (!c) return !1; c = { ...c, endColumn: a.getColumnCount() - 1 }; const d = (m) => m.endRow - m.startRow; return a.getMergeData().find((m) => { const f = ae.getIntersects(m, c); return f ? d(m) > d(f) : !1; }) ? await e.confirm({ id: zi.id, title: { title: n.t("merge.confirm.waring") }, children: { title: n.t("merge.confirm.dismantleMergeCellWaring") }, cancelText: n.t("button.cancel"), confirmText: n.t("button.confirm") }) ? t.executeCommand(mc.id) : !0 : t.executeCommand(mc.id); } }; var Gf = /* @__PURE__ */ ((r) => (r[r.UNIVER_UNKNOWN = 0] = "UNIVER_UNKNOWN", r[r.UNIVER_DOC = 1] = "UNIVER_DOC", r[r.UNIVER_SHEET = 2] = "UNIVER_SHEET", r[r.UNIVER_SLIDE = 3] = "UNIVER_SLIDE", r[r.UNIVER_PROJECT = 4] = "UNIVER_PROJECT", r[r.UNRECOGNIZED = -1] = "UNRECOGNIZED", r))(Gf || {}), de = /* @__PURE__ */ ((r) => (r[r.View = 0] = "View", r[r.Edit = 1] = "Edit", r[r.ManageCollaborator = 2] = "ManageCollaborator", r[r.Print = 3] = "Print", r[r.Duplicate = 4] = "Duplicate", r[r.Comment = 5] = "Comment", r[r.Copy = 6] = "Copy", r[r.Share = 7] = "Share", r[r.Export = 8] = "Export", r[r.MoveWorksheet = 9] = "MoveWorksheet", r[r.DeleteWorksheet = 10] = "DeleteWorksheet", r[r.HideWorksheet = 11] = "HideWorksheet", r[r.RenameWorksheet = 12] = "RenameWorksheet", r[r.CreateWorksheet = 13] = "CreateWorksheet", r[r.SetWorksheetStyle = 14] = "SetWorksheetStyle", r[r.EditWorksheetCell = 15] = "EditWorksheetCell", r[r.InsertHyperlink = 16] = "InsertHyperlink", r[r.Sort = 17] = "Sort", r[r.Filter = 18] = "Filter", r[r.PivotTable = 19] = "PivotTable", r[r.FloatImg = 20] = "FloatImg", r[r.History = 21] = "History", r[r.RwHgtClWdt = 22] = "RwHgtClWdt", r[r.ViemRwHgtClWdt = 23] = "ViemRwHgtClWdt", r[r.ViewFilter = 24] = "ViewFilter", r[r.MoveSheet = 25] = "MoveSheet", r[r.DeleteSheet = 26] = "DeleteSheet", r[r.HideSheet = 27] = "HideSheet", r[r.CopySheet = 28] = "CopySheet", r[r.RenameSheet = 29] = "RenameSheet", r[r.CreateSheet = 30] = "CreateSheet", r[r.SelectProtectedCells = 31] = "SelectProtectedCells", r[r.SelectUnProtectedCells = 32] = "SelectUnProtectedCells", r[r.SetCellStyle = 33] = "SetCellStyle", r[r.SetCellValue = 34] = "SetCellValue", r[r.SetRowStyle = 35] = "SetRowStyle", r[r.SetColumnStyle = 36] = "SetColumnStyle", r[r.InsertRow = 37] = "InsertRow", r[r.InsertColumn = 38] = "InsertColumn", r[r.DeleteRow = 39] = "DeleteRow", r[r.DeleteColumn = 40] = "DeleteColumn", r[r.EditExtraObject = 41] = "EditExtraObject", r[r.Delete = 42] = "Delete", r[r.RecoverHistory = 43] = "RecoverHistory", r[r.ViewHistory = 44] = "ViewHistory", r[r.CreatePermissionObject = 45] = "CreatePermissionObject", r[r.UNRECOGNIZED = -1] = "UNRECOGNIZED", r))(de || {}), Nt = /* @__PURE__ */ ((r) => (r[r.Reader = 0] = "Reader", r[r.Editor = 1] = "Editor", r[r.Owner = 2] = "Owner", r[r.UNRECOGNIZED = -1] = "UNRECOGNIZED", r))(Nt || {}), Mn = /* @__PURE__ */ ((r) => (r[r.Unkonwn = 0] = "Unkonwn", r[r.Workbook = 1] = "Workbook", r[r.Worksheet = 2] = "Worksheet", r[r.SelectRange = 3] = "SelectRange", r[r.Document = 4] = "Document", r[r.Slide = 5] = "Slide", r[r.UNRECOGNIZED = -1] = "UNRECOGNIZED", r))(Mn || {}), rn = /* @__PURE__ */ ((r) => (r[r.SomeCollaborator = 0] = "SomeCollaborator", r[r.AllCollaborator = 1] = "AllCollaborator", r[r.OneSelf = 2] = "OneSelf", r[r.UNRECOGNIZED = -1] = "UNRECOGNIZED", r))(rn || {}); const fi = "UNIVER_SHEET_PERMISSION_PANEL", Dc = "UNIVER_SHEET_PERMISSION_USER_PART", qf = "UNIVER_SHEET_PERMISSION_BACKGROUND", Qf = "UNIVER_SHEET_PERMISSION_USER_DIALOG", Kf = "UNIVER_SHEET_PERMISSION_DIALOG", zo = "UNIVER_SHEET_PERMISSION_USER_DIALOG_ID", Yo = "UNIVER_SHEET_PERMISSION_DIALOG_ID", eo = { [de.Copy]: "Copy", [de.SetCellStyle]: "SetCellStyle", [de.SetCellValue]: "SetCellValue", [de.SetRowStyle]: "SetRowStyle", [de.SetColumnStyle]: "SetColumnStyle", [de.InsertRow]: "InsertRow", [de.InsertColumn]: "InsertColumn", [de.InsertHyperlink]: "InsertHyperlink", [de.DeleteRow]: "DeleteRow", [de.DeleteColumn]: "DeleteColumn", [de.Sort]: "Sort", [de.Filter]: "Filter", [de.PivotTable]: "PivotTable", [de.EditExtraObject]: "EditExtraObject" }, J_ = [ de.Copy, de.SetCellStyle, de.SetCellValue, de.SetRowStyle, de.SetColumnStyle, de.InsertRow, de.InsertColumn, de.InsertHyperlink, de.DeleteRow, de.DeleteColumn, de.Sort, de.Filter, de.PivotTable, de.EditExtraObject, de.View ], Jf = "sheet-permission-menu-icon", $_ = "sheet-permission-delete-icon", ew = "sheet-permission-edit-icon", tw = "sheet-permission-check-icon", $f = "sheet-permission-lock-icon", nw = { unitId: "", subUnitId: "", permissionId: "", unitType: At.SelectRange, id: "", ranges: [], viewState: ls.OthersCanView, editState: on.OnlyMe }; class gs { constructor() { w(this, "_rule", nw); w(this, "_visible", !1); } setVisible(e) { this._visible = e; } getVisible() { return this._visible; } reset() { this.setVisible(!1); } } class Vr { constructor() { w(this, "_userList", []); w(this, "_oldCollaboratorList", []); w(this, "_selectUserList", []); w(this, "_selectUserList$", new Me(this._selectUserList)); w(this, "selectUserList$", this._selectUserList$.asObservable()); } get userList() { return this._userList; } // Set all editable users of this unit setCanEditUserList(e) { this._userList = e; } reset() { this._userList = [], this._oldCollaboratorList = [], this._selectUserList = [], this._selectUserList$.next([]); } get oldCollaboratorList() { return this._oldCollaboratorList; } setOldCollaboratorList(e) { this._oldCollaboratorList = e; } get selectUserList() { return this._selectUserList; } // The results of the user dialog selection panel should be rendered in the permission panel setSelectUserList(e) { this._selectUserList = e, this._selectUserList$.next(e); } } const Vn = { type: K.OPERATION, id: "sheet-permission.operation.openPanel", async handler(r, e = {}) { const t = r.get(vs), n = r.get(gs), s = r.get(Vr), { showDetail: i = !0, fromSheetBar: o = !1, rule: l, oldRule: a } = e, c = { header: { title: "permission.panel.title" }, children: { label: fi, showDetail: i, fromSheetBar: o, rule: l, oldRule: a }, width: 330, onClose: () => { n.reset(), s.reset(); } }; return n.setVisible(!0), t.open(c), !0; } }, ta = { type: K.COMMAND, id: "sheet.command.add-range-protection-from-toolbar", async handler(r) { return await r.get(F).executeCommand(Vn.id, { showDetail: !0 }), !0; } }, es = { type: K.COMMAND, id: "sheet.command.add-range-protection-from-context-menu", async handler(r) { return await r.get(F).executeCommand(Vn.id, { showDetail: !0 }), !0; } }, ts = { type: K.COMMAND, id: "sheet.command.view-sheet-permission-from-context-menu", async handler(r) { return await r.get(F).executeCommand(Vn.id, { showDetail: !1 }), !0; } }, na = { type: K.COMMAND, id: "sheet.command.add-range-protection-from-sheet-bar", async handler(r) { return await r.get(F).executeCommand(Vn.id, { fromSheetBar: !0, showDetail: !0 }), !0; } }, ra = { type: K.COMMAND, id: "sheet.command.view-sheet-permission-from-sheet-bar", async handler(r) { return await r.get(F).executeCommand(Vn.id, { showDetail: !1 }), !0; } }, ns = { type: K.COMMAND, id: "sheet.command.delete-range-protection-from-context-menu", async handler(r) { var u; const e = r.get(F), t = r.get(L), n = r.get(Zt), s = r.get($), i = r.get(ft), o = t.getCurrentUnitForType(O.UNIVER_SHEET), l = o.getActiveSheet(), a = o.getUnitId(), c = l.getSheetId(), d = i.getRule(a, c); if (d != null && d.permissionId) return e.executeCommand(Po.id, { unitId: a, subUnitId: c, rule: d }); { const h = (u = s.getCurrentLastSelection()) == null ? void 0 : u.range; if (!h) return !1; const g = r.get(Ye).getSubunitRuleList(a, c).find((p) => p.ranges.some((S) => ae.intersects(S, h))); if (g) { const p = { unitId: a, subUnitId: c, ruleIds: [g.id] }; return await e.executeCommand(wu.id, p) && n.pushUndoRedo({ unitID: a, redoMutations: [{ id: wu.id, params: p }], undoMutations: [{ id: zS.id, params: { unitId: a, subUnitId: c, rules: [g] } }] }), !0; } else return !1; } } }, rs = { type: K.COMMAND, id: "sheet.command.set-range-protection-from-context-menu", async handler(r) { var d; const e = r.get(F), t = r.get(L), n = r.get($), s = r.get(ft), i = t.getCurrentUnitForType(O.UNIVER_SHEET), o = i.getActiveSheet(), l = i.getUnitId(), a = o.getSheetId(), c = s.getRule(l, a); if (c != null && c.permissionId) { const u = { ...c, unitId: l, subUnitId: a, ranges: [] }; return await e.executeCommand(Vn.id, { showDetail: !0, rule: se.deepClone(u), oldRule: se.deepClone(u) }), !0; } else { const u = (d = n.getCurrentLastSelection()) == null ? void 0 : d.range; if (!u) return !1; const f = r.get(Ye).getSubunitRuleList(l, a).find((g) => { var p; return (p = g == null ? void 0 : g.ranges) == null ? void 0 : p.some((S) => ae.intersects(S, u)); }); if (f) { const g = { ...f, unitId: l, subUnitId: a }; return await e.executeCommand(Vn.id, { showDetail: !0, rule: se.deepClone(g), oldRule: se.deepClone(g) }), !0; } else return !1; } } }, gi = { id: "sheet.command.remove-row-confirm", type: K.COMMAND, handler: async (r, e) => { var c; const t = r.get($); let n = e == null ? void 0 : e.range; if (n || (n = (c = t.getCurrentLastSelection()) == null ? void 0 : c.range), !n) return !1; const s = r.get(F), i = r.get(L), o = Ue(i); if (!o) return !1; const { worksheet: l } = o, a = l.getVisibleRows(); if (rf(a, [n])) { const d = r.get(tn), u = r.get(Ee); return await d.confirm({ id: "sheet.confirm.remove-row", title: { title: u.t("info.problem") }, children: { title: u.t("rightClick.deleteAllRowsAlert") }, cancelText: u.t("button.cancel"), confirmText: u.t("button.confirm") }), !1; } return await s.executeCommand(Sm.id, { range: n }), !0; } }, pi = { id: "sheet.command.remove-col-confirm", type: K.COMMAND, handler: async (r, e) => { var c; const t = r.get($); let n = e == null ? void 0 : e.range; if (n || (n = (c = t.getCurrentLastSelection()) == null ? void 0 : c.range), !n) return !1; const s = r.get(F), i = r.get(L), o = Ue(i); if (!o) return !1; const { worksheet: l } = o, a = l.getVisibleCols(); if (sf(a, [n])) { const d = r.get(tn), u = r.get(Ee); return await d.confirm({ id: "sheet.confirm.remove-col", title: { title: u.t("info.problem") }, children: { title: u.t("rightClick.deleteAllColumnsAlert") }, cancelText: u.t("button.cancel"), confirmText: u.t("button.confirm") }), !1; } return await s.executeCommand(pm.id, { range: n }), !0; } }, sa = { id: "sheet.command.remove-sheet-confirm", type: K.COMMAND, handler: async (r, e) => { const { subUnitId: t } = e, n = r.get(tn), s = r.get(F), i = r.get(Ee); return await n.confirm({ id: "sheet.confirm.remove-sheet", title: { title: i.t("sheetConfig.deleteSheet") }, children: { title: i.t("sheetConfig.deleteSheetContent") }, cancelText: i.t("button.cancel"), confirmText: i.t("button.confirm") }) ? (await s.executeCommand(YS.id, { subUnitId: t }), !0) : !1; } }, kr = gn("univer.sheetbar-service"); class eg extends ce { constructor() { super(); w(this, "renameId$"); w(this, "removeId$"); w(this, "scroll$"); w(this, "scrollX$"); w(this, "addSheet$"); w(this, "_renameId$"); w(this, "_removeId$"); w(this, "_scroll$"); w(this, "_scrollX$"); w(this, "_addSheet$"); w(this, "_currentHandler", null); this._renameId$ = new xe(), this.renameId$ = this._renameId$.asObservable(), this._removeId$ = new xe(), this.removeId$ = this._removeId$.asObservable(), this._scroll$ = new xe(), this.scroll$ = this._scroll$.asObservable(), this._scrollX$ = new xe(), this.scrollX$ = this._scrollX$.asObservable(), this._addSheet$ = new xe(), this.addSheet$ = this._addSheet$.asObservable(); } setRenameId(t) { this._renameId$.next(t); } setRemoveId(t) { this._removeId$.next(t); } setScroll(t) { this._scroll$.next(t); } setScrollX(t) { this._scrollX$.next(t); } setAddSheet(t) { this._addSheet$.next(t); } triggerSheetBarMenu() { var t; (t = this._currentHandler) == null || t.handleSheetBarMenu(); } registerSheetBarMenuHandler(t) { if (this._currentHandler) throw new Error("There is already a context menu handler!"); return this._currentHandler = t, Ae(() => { this._currentHandler = null; }); } } const ia = { id: "ui-sheet.command.show-menu-list", type: K.OPERATION, handler: async (r) => (r.get(kr).triggerSheetBarMenu(), !0) }, oa = { type: K.COMMAND, id: "sheet.command.delete-worksheet-protection-from-sheet-bar", async handler(r, e) { if (!e) return !1; const t = r.get(F), n = r.get(Zt), s = r.get(ft), o = r.get(L).getCurrentUnitForType(Gf.UNIVER_SHEET), l = o == null ? void 0 : o.getActiveSheet(), a = o.getUnitId(); if (!l) return !1; const c = l.getSheetId(), d = s.getRule(a, c); if (await t.executeCommand(Po.id, { unitId: a, subUnitId: c })) { const h = [{ id: Po.id, params: { unitId: a, subUnitId: c } }], m = [{ id: Cm.id, params: { unitId: a, rule: d } }]; n.pushUndoRedo({ unitID: a, redoMutations: h, undoMutations: m }); } return !0; } }, la = { type: K.COMMAND, id: "sheet.command.change-sheet-protection-from-sheet-bar", async handler(r) { return await r.get(F).executeCommand("sheet-permission.operation.openDialog"), !0; } }, Kd = { id: "sheet.operation.set-activate-cell-edit", type: K.OPERATION, handler: (r, e) => (r.get(tt).setEditCell(e), !0) }, aa = { id: "sheet.operation.rename-sheet", type: K.OPERATION, handler: async (r, e) => { const t = r.get(kr); return e && t.setRenameId(e.subUnitId), !0; } }, tg = { type: K.OPERATION, id: "sheet-permission.operation.openDialog", async handler(r, e) { const t = r.get(bs); return t.close("DESKTOP_FIND_REPLACE_DIALOG"), t.open({ id: Yo, title: { title: "permission.dialog.allowedPermissionType" }, children: { label: Kf }, width: 393, destroyOnClose: !0, onClose: () => t.close(Yo) }), !0; } }, Si = "DefinedNameContainer", Jd = { id: "sidebar.operation.defined-name", type: K.COMMAND, handler: async (r, e) => { const t = r.get(vs); r.get(Ss); const n = r.get(Ee), s = r.get(L); if (!Ue(s)) return !1; switch (e.value) { case "open": t.open({ id: Si, header: { title: n.t("definedName.featureTitle") }, children: { label: Si }, onClose: () => { }, width: 333 }); break; case "close": default: t.close(); break; } return !0; } }, rw = () => /* @__PURE__ */ C.jsxs("svg", { width: "120", height: "2", viewBox: "0 0 120 2", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [ /* @__PURE__ */ C.jsx("path", { d: "M0.98999 1.08218H-0.0100098V0.0821838H0.98999V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M5.78992 1.08218H2.78992V0.0821838H5.78992V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M7.58984 1.08218H8.58984V0.0821838H7.58984V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M14.9152 1.08218H13.9152V0.0821838H14.9152V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M16.7151 1.08218H19.7151V0.0821838H16.7151V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M22.515 1.08218H21.515V0.0821838H22.515V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M27.8405 1.08218H28.8405V0.0821838H27.8405V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M33.6404 1.08218H30.6404V0.0821838H33.6404V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M35.4403 1.08218H36.4403V0.0821838H35.4403V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M42.7657 1.08218H41.7657V0.0821838H42.7657V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M44.5657 1.08218H47.5657V0.0821838H44.5657V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M50.3656 1.08218H49.3656V0.0821838H50.3656V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M55.691 1.08218H56.691V0.0821838H55.691V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M61.491 1.08218H58.491V0.0821838H61.491V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M63.2909 1.08218H64.2909V0.0821838H63.2909V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M70.6163 1.08218H69.6163V0.0821838H70.6163V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M72.4163 1.08218H75.4163V0.0821838H72.4163V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M78.2162 1.08218H77.2162V0.0821838H78.2162V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M83.5416 1.08218H84.5416V0.0821838H83.5416V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M89.3416 1.08218H86.3416V0.0821838H89.3416V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M91.1415 1.08218H92.1415V0.0821838H91.1415V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M98.4669 1.08218H97.4669V0.0821838H98.4669V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M100.267 1.08218H103.267V0.0821838H100.267V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M106.067 1.08218H105.067V0.0821838H106.067V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M111.392 1.08218H112.392V0.0821838H111.392V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M117.192 1.08218H114.192V0.0821838H117.192V1.08218Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M118.992 1.08218H119.992V0.0821838H118.992V1.08218Z", fill: "black" }) ] }), sw = () => /* @__PURE__ */ C.jsxs("svg", { width: "120", height: "2", viewBox: "0 0 120 2", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [ /* @__PURE__ */ C.jsx("path", { d: "M-0.0100098 1.15771H0.98999V0.157715H-0.0100098V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M2.78992 1.15771H5.78992V0.157715H2.78992V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M8.58984 1.15771H7.58984V0.157715H8.58984V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M10.3899 1.15771H11.3899V0.157715H10.3899V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M19.0903 1.15771H18.0903V0.157715H19.0903V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M20.8903 1.15771H23.8903V0.157715H20.8903V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M26.6902 1.15771H25.6902V0.157715H26.6902V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M28.4902 1.15771H29.4902V0.157715H28.4902V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M37.1907 1.15771H36.1907V0.157715H37.1907V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M38.9906 1.15771H41.9906V0.157715H38.9906V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M44.7905 1.15771H43.7905V0.157715H44.7905V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M46.5906 1.15771H47.5906V0.157715H46.5906V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M55.291 1.15771H54.291V0.157715H55.291V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M57.0909 1.15771H60.0909V0.157715H57.0909V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M62.8909 1.15771H61.8909V0.157715H62.8909V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M64.6909 1.15771H65.6909V0.157715H64.6909V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M73.3914 1.15771H72.3914V0.157715H73.3914V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M75.1913 1.15771H78.1913V0.157715H75.1913V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M80.9912 1.15771H79.9912V0.157715H80.9912V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M82.7913 1.15771H83.7913V0.157715H82.7913V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M91.4917 1.15771H90.4917V0.157715H91.4917V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M93.2916 1.15771H96.2916V0.157715H93.2916V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M99.0916 1.15771H98.0916V0.157715H99.0916V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M100.892 1.15771H101.892V0.157715H100.892V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M109.592 1.15771H108.592V0.157715H109.592V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M111.392 1.15771H114.392V0.157715H111.392V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M117.192 1.15771H116.192V0.157715H117.192V1.15771Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M118.992 1.15771H119.992V0.157715H118.992V1.15771Z", fill: "black" }) ] }), iw = () => /* @__PURE__ */ C.jsxs("svg", { width: "120", height: "2", viewBox: "0 0 120 2", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [ /* @__PURE__ */ C.jsx("path", { d: "M-0.00842285 1.22449H2.99158V0.224487H-0.00842285V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M6.14941 1.22449H9.14941V0.224487H6.14941V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M15.3073 1.22449H12.3073V0.224487H15.3073V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M18.4651 1.22449H21.4651V0.224487H18.4651V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M27.6229 1.22449H24.6229V0.224487H27.6229V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M30.7808 1.22449H33.7808V0.224487H30.7808V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M39.9386 1.22449H36.9386V0.224487H39.9386V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M43.0964 1.22449H46.0964V0.224487H43.0964V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M52.2543 1.22449H49.2543V0.224487H52.2543V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M55.4121 1.22449H58.4121V0.224487H55.4121V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M64.5699 1.22449H61.5699V0.224487H64.5699V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M67.7278 1.22449H70.7278V0.224487H67.7278V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M76.8856 1.22449H73.8856V0.224487H76.8856V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M80.0435 1.22449H83.0435V0.224487H80.0435V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M89.2013 1.22449H86.2013V0.224487H89.2013V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M92.3591 1.22449H95.3591V0.224487H92.3591V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M101.517 1.22449H98.517V0.224487H101.517V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M104.675 1.22449H107.675V0.224487H104.675V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M113.833 1.22449H110.833V0.224487H113.833V1.22449Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M116.99 1.22449H119.99V0.224487H116.99V1.22449Z", fill: "black" }) ] }), ow = () => /* @__PURE__ */ C.jsxs("svg", { width: "120", height: "2", viewBox: "0 0 120 2", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [ /* @__PURE__ */ C.jsx("path", { d: "M-0.00976562 1.65707H0.990234V0.657074H-0.00976562V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M2.32361 1.65707H3.32361V0.657074H2.32361V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M5.65698 1.65707H4.65698V0.657074H5.65698V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M6.99036 1.65707H7.99036V0.657074H6.99036V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M10.3237 1.65707H9.32373V0.657074H10.3237V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M11.6571 1.65707H12.6571V0.657074H11.6571V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M14.9905 1.65707H13.9905V0.657074H14.9905V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M16.3239 1.65707H17.3239V0.657074H16.3239V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M19.6572 1.65707H18.6572V0.657074H19.6572V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M20.9906 1.65707H21.9906V0.657074H20.9906V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M24.324 1.65707H23.324V0.657074H24.324V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M25.6573 1.65707H26.6573V0.657074H25.6573V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M28.9907 1.65707H27.9907V0.657074H28.9907V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M30.3241 1.65707H31.3241V0.657074H30.3241V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M33.6575 1.65707H32.6575V0.657074H33.6575V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M34.9908 1.65707H35.9908V0.657074H34.9908V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M38.3242 1.65707H37.3242V0.657074H38.3242V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M39.6576 1.65707H40.6576V0.657074H39.6576V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M42.991 1.65707H41.991V0.657074H42.991V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M44.3243 1.65707H45.3243V0.657074H44.3243V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M47.6577 1.65707H46.6577V0.657074H47.6577V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M48.9911 1.65707H49.9911V0.657074H48.9911V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M52.3245 1.65707H51.3245V0.657074H52.3245V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M53.6578 1.65707H54.6578V0.657074H53.6578V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M56.9912 1.65707H55.9912V0.657074H56.9912V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M58.3246 1.65707H59.3246V0.657074H58.3246V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M61.658 1.65707H60.658V0.657074H61.658V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M62.9913 1.65707H63.9913V0.657074H62.9913V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M66.3247 1.65707H65.3247V0.657074H66.3247V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M67.6581 1.65707H68.6581V0.657074H67.6581V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M70.9915 1.65707H69.9915V0.657074H70.9915V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M72.3248 1.65707H73.3248V0.657074H72.3248V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M75.6582 1.65707H74.6582V0.657074H75.6582V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M76.9916 1.65707H77.9916V0.657074H76.9916V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M80.325 1.65707H79.325V0.657074H80.325V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M81.6583 1.65707H82.6583V0.657074H81.6583V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M84.9917 1.65707H83.9917V0.657074H84.9917V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M86.3251 1.65707H87.3251V0.657074H86.3251V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M89.6584 1.65707H88.6584V0.657074H89.6584V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M90.9918 1.65707H91.9918V0.657074H90.9918V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M94.3252 1.65707H93.3252V0.657074H94.3252V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M95.6586 1.65707H96.6586V0.657074H95.6586V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M98.9919 1.65707H97.9919V0.657074H98.9919V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M100.325 1.65707H101.325V0.657074H100.325V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M103.659 1.65707H102.659V0.657074H103.659V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M104.992 1.65707H105.992V0.657074H104.992V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M108.325 1.65707H107.325V0.657074H108.325V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M109.659 1.65707H110.659V0.657074H109.659V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M112.992 1.65707H111.992V0.657074H112.992V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M114.325 1.65707H115.325V0.657074H114.325V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M117.659 1.65707H116.659V0.657074H117.659V1.65707Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M118.992 1.65707H119.992V0.657074H118.992V1.65707Z", fill: "black" }) ] }), lw = () => /* @__PURE__ */ C.jsx("svg", { width: "120", height: "3", viewBox: "0 0 120 3", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ C.jsx( "path", { fillRule: "evenodd", clipRule: "evenodd", d: "M119.991 2.42035H-0.0090332V0.420349H119.991V2.42035Z", fill: "black" } ) }), aw = () => /* @__PURE__ */ C.jsxs("svg", { width: "120", height: "3", viewBox: "0 0 120 3", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [ /* @__PURE__ */ C.jsx("path", { d: "M-0.0100098 2.47614H1.98999V0.476135H-0.0100098V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M3.99014 2.47614H9.99014V0.476135H3.99014V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M13.9901 2.47614H11.9901V0.476135H13.9901V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M21.1904 2.47614H23.1904V0.476135H21.1904V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M31.1906 2.47614H25.1906V0.476135H31.1906V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M33.1906 2.47614H35.1906V0.476135H33.1906V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M44.3909 2.47614H42.3909V0.476135H44.3909V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M46.391 2.47614H52.391V0.476135H46.391V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M56.391 2.47614H54.391V0.476135H56.391V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M63.5913 2.47614H65.5913V0.476135H63.5913V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M73.5915 2.47614H67.5915V0.476135H73.5915V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M75.5915 2.47614H77.5915V0.476135H75.5915V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M86.7917 2.47614H84.7917V0.476135H86.7917V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M88.7919 2.47614H94.7919V0.476135H88.7919V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M98.7919 2.47614H96.7919V0.476135H98.7919V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M105.992 2.47614H107.992V0.476135H105.992V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M115.992 2.47614H109.992V0.476135H115.992V2.47614Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M117.992 2.47614H119.992V0.476135H117.992V2.47614Z", fill: "black" }) ] }), cw = () => /* @__PURE__ */ C.jsxs("svg", { width: "120", height: "2", viewBox: "0 0 120 2", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [ /* @__PURE__ */ C.jsx("path", { d: "M-0.0100098 2.00415H1.98999V0.00415039H-0.0100098V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M3.99014 2.00415H9.99014V0.00415039H3.99014V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M13.9901 2.00415H11.9901V0.00415039H13.9901V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M15.9901 2.00415H17.9901V0.00415039H15.9901V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M27.4905 2.00415H25.4905V0.00415039H27.4905V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M29.4906 2.00415H35.4906V0.00415039H29.4906V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M39.4906 2.00415H37.4906V0.00415039H39.4906V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M41.4906 2.00415H43.4906V0.00415039H41.4906V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M52.991 2.00415H50.991V0.00415039H52.991V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M54.9911 2.00415H60.9911V0.00415039H54.9911V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M64.9911 2.00415H62.9911V0.00415039H64.9911V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M66.9911 2.00415H68.9911V0.00415039H66.9911V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M78.4915 2.00415H76.4915V0.00415039H78.4915V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M80.4916 2.00415H86.4916V0.00415039H80.4916V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M90.4916 2.00415H88.4916V0.00415039H90.4916V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M92.4916 2.00415H94.4916V0.00415039H92.4916V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M103.992 2.00415H101.992V0.00415039H103.992V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M105.992 2.00415H111.992V0.00415039H105.992V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M115.992 2.00415H113.992V0.00415039H115.992V2.00415Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M117.992 2.00415H119.992V0.00415039H117.992V2.00415Z", fill: "black" }) ] }), dw = () => /* @__PURE__ */ C.jsxs("svg", { width: "118", height: "3", viewBox: "0 0 118 3", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [ /* @__PURE__ */ C.jsx("path", { d: "M-0.00854492 2.94815H1.99146V0.948151H-0.00854492V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M6.09668 2.94815H8.09668V0.948151H6.09668V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M14.2019 2.94815H12.2019V0.948151H14.2019V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M18.3071 2.94815H20.3071V0.948151H18.3071V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M26.4124 2.94815H24.4124V0.948151H26.4124V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M30.5176 2.94815H32.5176V0.948151H30.5176V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M38.6228 2.94815H36.6228V0.948151H38.6228V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M42.728 2.94815H44.728V0.948151H42.728V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M50.8333 2.94815H48.8333V0.948151H50.8333V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M54.9385 2.94815H56.9385V0.948151H54.9385V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M63.0437 2.94815H61.0437V0.948151H63.0437V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M67.1489 2.94815H69.1489V0.948151H67.1489V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M75.2542 2.94815H73.2542V0.948151H75.2542V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M79.3594 2.94815H81.3594V0.948151H79.3594V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M87.4645 2.94815H85.4645V0.948151H87.4645V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M91.5697 2.94815H93.5697V0.948151H91.5697V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M99.6749 2.94815H97.6749V0.948151H99.6749V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M103.78 2.94815H105.78V0.948151H103.78V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M111.885 2.94815H109.885V0.948151H111.885V2.94815Z", fill: "black" }), /* @__PURE__ */ C.jsx("path", { d: "M115.991 2.94815H117.991V0.948151H115.991V2.94815Z", fill: "black" }) ] }), uw = () => /* @__PURE__ */ C.jsx("svg", { width: "120", height: "4", viewBox: "0 0 120 4", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ C.jsx( "path", { fillRule: "evenodd", clipRule: "evenodd", d: "M119.991 3.86215H-0.0090332V0.862152H119.991V3.86215Z", fill: "black" } ) }), ch = () => /* @__PURE__ */ C.jsx("svg", { width: "120", height: "2", viewBox: "0 0 120 2", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ C.jsx( "path", { fillRule: "evenodd", clipRule: "evenodd", d: "M119.991 1.15668H-0.0090332V0.156677H119.991V1.15668Z", fill: "black" } ) }); function dh(r) { const { type: e = Pe.THIN } = r; switch (e) { case Pe.DASH_DOT: return /* @__PURE__ */ C.jsx(rw, {}); case Pe.DASH_DOT_DOT: return /* @__PURE__ */ C.jsx(sw, {}); case Pe.DASHED: return /* @__PURE__ */ C.jsx(iw, {}); case Pe.HAIR: return /* @__PURE__ */ C.jsx(ow, {}); case Pe.MEDIUM: return /* @__PURE__ */ C.jsx(lw, {}); case Pe.MEDIUM_DASH_DOT: return /* @__PURE__ */ C.jsx(aw, {}); case Pe.MEDIUM_DASH_DOT_DOT: return /* @__PURE__ */ C.jsx(cw, {}); case Pe.MEDIUM_DASHED: return /* @__PURE__ */ C.jsx(dw, {}); case Pe.THICK: return /* @__PURE__ */ C.jsx(uw, {}); case Pe.THIN: return /* @__PURE__ */ C.jsx(ch, {}); default: return /* @__PURE__ */ C.jsx(ch, {}); } } const hw = "univer-ui-plugin-sheets-border-panel", mw = "univer-ui-plugin-sheets-border-panel-position", fw = "univer-ui-plugin-sheets-border-panel-position-item", gw = "univer-ui-plugin-sheets-border-panel-position-item-active", pw = "univer-ui-plugin-sheets-border-panel-styles", Sw = "univer-ui-plugin-sheets-border-panel-board", Cw = "univer-ui-plugin-sheets-border-panel-button", vw = "univer-ui-plugin-sheets-border-panel-more-icon", qt = { uiPluginSheetsBorderPanel: hw, uiPluginSheetsBorderPanelPosition: mw, uiPluginSheetsBorderPanelPositionItem: fw, uiPluginSheetsBorderPanelPositionItemActive: gw, uiPluginSheetsBorderPanelStyles: pw, uiPluginSheetsBorderPanelBoard: Sw, uiPluginSheetsBorderPanelButton: Cw, uiPluginSheetsBorderPanelMoreIcon: vw }, $d = `${Ps}_BORDER_PANEL_COMPONENT`, ng = [ { label: "borderLine.borderTop", icon: "UpBorder", value: "top" }, { label: "borderLine.borderBottom", icon: "DownBorder", value: "bottom" }, { label: "borderLine.borderLeft", icon: "LeftBorder", value: "left" }, { label: "borderLine.borderRight", icon: "RightBorder", value: "right" }, { label: "borderLine.borderNone", icon: "NoBorderSingle", value: "none" }, { label: "borderLine.borderAll", icon: "AllBorderSingle", value: "all" }, { label: "borderLine.borderOutside", icon: "OuterBorder", value: "outside" }, { label: "borderLine.borderInside", icon: "InnerBorder", value: "inside" }, { label: "borderLine.borderHorizontal", icon: "HorizontalBorder", value: "horizontal" }, { label: "borderLine.borderVertical", icon: "VerticalBorder", value: "vertical" }, { label: "borderLine.borderTlbr", icon: "BackSlashSingle", value: "tlbr" }, { label: "borderLine.borderTlbcTlmr", icon: "LeftDoubleDiagonalSingle", value: "tlbc_tlmr" }, { label: "borderLine.borderTlbrTlbcTlmr", icon: "LeftTridiagonalSingle", value: "tlbr_tlbc_tlmr" }, { label: "borderLine.borderBlTr", icon: "SlashSingle", value: "bltr" }, { label: "borderLine.borderMltrBctr", icon: "RightDoubleDiagonalSingle", value: "mltr_bctr" } ], bw = [ { label: Pe.THIN, value: Pe.THIN }, { label: Pe.HAIR, value: Pe.HAIR }, { label: Pe.DOTTED, value: Pe.DOTTED }, { label: Pe.DASHED, value: Pe.DASHED }, { label: Pe.DASH_DOT, value: Pe.DASH_DOT }, { label: Pe.DASH_DOT_DOT, value: Pe.DASH_DOT_DOT }, { label: Pe.MEDIUM, value: Pe.MEDIUM }, { label: Pe.MEDIUM_DASHED, value: Pe.MEDIUM_DASHED }, { label: Pe.MEDIUM_DASH_DOT, value: Pe.MEDIUM_DASH_DOT }, { label: Pe.MEDIUM_DASH_DOT_DOT, value: Pe.MEDIUM_DASH_DOT_DOT }, { label: Pe.THICK, value: Pe.THICK } ]; function rg(r) { var a; const e = W(Dn), t = W(fc), { onChange: n, value: s } = r; function i(c, d) { n == null || n({ ...s, [d]: c }); } function o(c) { const d = e.get(c); return d && /* @__PURE__ */ C.jsx(d, { extend: { colorChannel1: "rgb(var(--primary-color))" } }); } function l(c) { c.stopPropagation(); } return /* @__PURE__ */ C.jsxs("section", { className: qt.uiPluginSheetsBorderPanel, children: [ /* @__PURE__ */ C.jsx("div", { className: qt.uiPluginSheetsBorderPanelPosition, children: ng.map((c) => /* @__PURE__ */ C.jsx( "div", { className: t.getBorderInfo().type === c.value ? ` ${qt.uiPluginSheetsBorderPanelPositionItemActive} ${qt.uiPluginSheetsBorderPanelPositionItem} ` : qt.uiPluginSheetsBorderPanelPositionItem, onClick: (d) => { d.stopPropagation(), i(c.value, "type"); }, children: o(c.icon) }, c.value )) }), /* @__PURE__ */ C.jsxs("div", { className: qt.uiPluginSheetsBorderPanelStyles, children: [ /* @__PURE__ */ C.jsx("div", { children: /* @__PURE__ */ C.jsx( ei, { align: { offset: [0, 18] }, overlay: /* @__PURE__ */ C.jsx("section", { className: qt.uiPluginSheetsBorderPanelBoard, onClick: l, children: /* @__PURE__ */ C.jsx(Md, { onChange: (c) => i(c, "color") }) }), children: /* @__PURE__ */ C.jsxs("a", { className: qt.uiPluginSheetsBorderPanelButton, onClick: l, children: [ /* @__PURE__ */ C.jsx(Uf, { extend: { colorChannel1: (a = s == null ? void 0 : s.color) != null ? a : "rgb(var(--primary-color))" } }), /* @__PURE__ */ C.jsx("span", { className: qt.uiPluginSheetsBorderPanelMoreIcon, children: /* @__PURE__ */ C.jsx(hs, {}) }) ] }) } ) }), /* @__PURE__ */ C.jsx("div", { children: /* @__PURE__ */ C.jsx( ei, { align: { offset: [0, 18] }, overlay: /* @__PURE__ */ C.jsx("section", { onClick: l, children: /* @__PURE__ */ C.jsx(OC, { children: bw.map((c) => /* @__PURE__ */ C.jsx( AC, { eventKey: c.value.toString(), onClick: () => i(c.value, "style"), children: /* @__PURE__ */ C.jsx(dh, { type: c.value }) }, c.value )) }) }), children: /* @__PURE__ */ C.jsxs("a", { className: qt.uiPluginSheetsBorderPanelButton, onClick: l, children: [ /* @__PURE__ */ C.jsx(dh, { type: Pe.THIN }), /* @__PURE__ */ C.jsx("span", { className: qt.uiPluginSheetsBorderPanelMoreIcon, children: /* @__PURE__ */ C.jsx(hs, {}) }) ] }) } ) }) ] }) ] }); } function sg(r) { var e, t, n = ""; if (typeof r == "string" || typeof r == "number") n += r; else if (typeof r == "object") if (Array.isArray(r)) { var s = r.length; for (e = 0; e < s; e++) r[e] && (t = sg(r[e])) && (n && (n += " "), n += t); } else for (t in r) r[t] && (n && (n += " "), n += t); return n; } function st() { for (var r, e, t = 0, n = "", s = arguments.length; t < s; t++) (r = arguments[t]) && (e = sg(r)) && (n && (n += " "), n += e); return n; } const _w = "univer-defined-name", ww = "univer-defined-name-overlay", Rw = "univer-defined-name-overlay-container", Iw = "univer-defined-name-overlay-item", yw = "univer-defined-name-overlay-item-name", Mw = "univer-defined-name-overlay-item-name-for-sheet", Pw = "univer-defined-name-overlay-item-formula", Ew = "univer-defined-name-overlay-manager", Tw = "univer-defined-name-overlay-manager-title", xw = "univer-defined-name-overlay-manager-content", Ow = "univer-defined-name-container", Aw = "univer-defined-name-container-scroll", Nw = "univer-defined-name-container-addButton", Hw = "univer-defined-name-container-addButton-text", Vw = "univer-defined-name-container-item", kw = "univer-defined-name-container-item-name", Dw = "univer-defined-name-container-item-name-for-sheet", Lw = "univer-defined-name-container-item-formula-or-refString", Ww = "univer-defined-name-container-item-update", Bw = "univer-defined-name-container-item-delete", Fw = "univer-defined-name-container-item-show", Uw = "univer-defined-name-input", jw = "univer-defined-name-input-formula-selector-text-wrap", Xw = "univer-defined-name-input-text-editor-container", zw = "univer-defined-name-input-validation", Yw = "univer-defined-name-input-disable", _t = { definedName: _w, definedNameOverlay: ww, definedNameOverlayContainer: Rw, definedNameOverlayItem: Iw, definedNameOverlayItemName: yw, definedNameOverlayItemNameForSheet: Mw, definedNameOverlayItemFormula: Pw, definedNameOverlayManager: Ew, definedNameOverlayManagerTitle: Tw, definedNameOverlayManagerContent: xw, definedNameContainer: Ow, definedNameContainerScroll: Aw, definedNameContainerAddButton: Nw, definedNameContainerAddButtonText: Hw, definedNameContainerItem: Vw, definedNameContainerItemName: kw, definedNameContainerItemNameForSheet: Dw, definedNameContainerItemFormulaOrRefString: Lw, definedNameContainerItemUpdate: Ww, definedNameContainerItemDelete: Bw, definedNameContainerItemShow: Fw, definedNameInput: Uw, definedNameInputFormulaSelectorTextWrap: jw, definedNameInputTextEditorContainer: Xw, definedNameInputValidation: zw, definedNameInputDisable: Yw }, ka = { width: "100%" }, uh = (r) => { const { inputId: e, state: t = !1, type: n = "range", confirm: s, cancel: i, name: o, formulaOrRefString: l, comment: a = "", localSheetId: c = gc, hidden: d = !1, // 是否对用户隐藏,与excel兼容,暂时用不上。 id: u } = r, m = W(L).getCurrentUnitForType(O.UNIVER_SHEET), f = W(Ee), g = W(ki), p = W(Dm), S = W(km), b = W(Dn), v = sn(() => b.get(Jm), []), _ = sn(() => b.get(Td), []); if (m == null) return; const R = sn(() => m.getUnitId(), []), I = sn(() => m.getActiveSheet().getSheetId(), []), [y, M] = te(o), [P, E] = te(l), [T, A] = te(a), [H, x] = te(c), [k, U] = te(""), [V, N] = te(n), [X, Y] = te(!0), ie = xn({}), [he, ne] = te(!1), pe = [{ label: f.t("definedName.scopeWorkbook"), value: gc }], ve = (we) => !Lm(we); be(() => { ne(!1); }, [I]), be(() => { Y(!0), M(o), A(a), x(c); let we = l; l.substring(0, 1) === Xr.EQUALS ? N("formula") : ve(l) ? (N("formula"), we = Xr.EQUALS + l) : N("range"), E(we), U(""); }, [t]), m.getSheetOrders().forEach((we) => { const Ve = m.getSheetBySheetId(we); pe.push({ label: (Ve == null ? void 0 : Ve.getName()) || "", value: we }); }); const G = (we) => { E(we); }, J = (we) => { E(we || ""); }, le = () => { if (y.length === 0) { U(f.t("definedName.nameEmpty")); return; } if (g.getValueByName(R, y) != null && (u == null || u.length === 0)) { U(f.t("definedName.nameDuplicate")); return; } if (!se.isValidParameter(y) || PC(y) || !se.isStartValidPosition(y) && !cS(y.substring(0, 1))) { U(f.t("definedName.nameInvalid")); return; } if (m.getSheetOrders().map((pt) => { var bt; return ((bt = m.getSheetBySheetId(pt)) == null ? void 0 : bt.getName()) || ""; }).includes(y)) { U(f.t("definedName.nameSheetConflict")); return; } if (P.length === 0) { U(f.t("definedName.formulaOrRefStringEmpty")); return; } if (!X) { U(f.t("definedName.formulaOrRefStringInvalid")); return; } if (p.hasExecutor(y.toUpperCase())) { U(f.t("definedName.nameConflict")); return; } const Ve = m.getActiveSheet().getName(); s && s({ id: u || "", name: y, formulaOrRefString: S.convertRefersToAbsolute(P, ou.ALL, ou.ALL, Ve), comment: T, localSheetId: H }); }, fe = (we) => { const Ve = we; Ve === "formula" ? l[0] === Xr.EQUALS ? E(l) : E(`${Xr.EQUALS}`) : l[0] === Xr.EQUALS ? E("") : E(l), N(Ve); }, Ze = xn({}), [lt, Be] = te(!1); return wo((we) => { var pt; const Ve = (pt = ie.current) == null ? void 0 : pt.handleOutClick; Ve && Ve(we, () => ne(!1)); }), wo((we) => { var pt; const Ve = (pt = Ze.current) == null ? void 0 : pt.handleOutClick; Ve && Ve(we, () => Be(!1)); }), /* @__PURE__ */ C.jsxs("div", { className: _t.definedNameInput, style: { display: t ? "block" : "none" }, children: [ /* @__PURE__ */ C.jsx("div", { children: /* @__PURE__ */ C.jsx(ti, { placeholder: f.t("definedName.inputNamePlaceholder"), value: y, allowClear: !0, onChange: M, affixWrapperStyle: ka }) }), /* @__PURE__ */ C.jsx("div", { children: /* @__PURE__ */ C.jsxs(vc, { value: V, onChange: fe, children: [ /* @__PURE__ */ C.jsx(Zr, { value: "range", children: f.t("definedName.ratioRange") }), /* @__PURE__ */ C.jsx(Zr, { value: "formula", children: f.t("definedName.ratioFormula") }) ] }) }), V === "range" ? v && /* @__PURE__ */ C.jsx( v, { unitId: R, subUnitId: I, initValue: P, onChange: G, isFocus: he, onFocus: () => ne(!0), actions: ie.current, isSupportAcrossSheet: !0 } ) : _ && /* @__PURE__ */ C.jsx( _, { initValue: P, unitId: R, subUnitId: I, isFocus: lt, isSupportAcrossSheet: !0, onChange: (we = "") => { J(we || ""); }, onVerify: (we) => { Y(we); }, onFocus: () => Be(!0), actions: Ze.current } ), /* @__PURE__ */ C.jsx("div", { children: /* @__PURE__ */ C.jsx(Um, { style: ka, value: H, options: pe, onChange: x }) }), /* @__PURE__ */ C.jsx("div", { children: /* @__PURE__ */ C.jsx(ti, { affixWrapperStyle: ka, placeholder: f.t("definedName.inputCommentPlaceholder"), value: T, onChange: A }) }), /* @__PURE__ */ C.jsxs("div", { style: { display: k.length === 0 ? "none" : "flex" }, className: _t.definedNameInputValidation, children: [ /* @__PURE__ */ C.jsx("span", { children: k }), /* @__PURE__ */ C.jsx(Xd, {}) ] }), /* @__PURE__ */ C.jsxs("div", { children: [ /* @__PURE__ */ C.jsx( fn, { onClick: () => { i && i(); }, children: f.t("definedName.cancel") } ), /* @__PURE__ */ C.jsx( fn, { style: { marginLeft: 15 }, type: "primary", onClick: le, children: f.t("definedName.confirm") } ) ] }) ] }); }, ig = () => { const r = W(F), t = W(L).getCurrentUnitForType(O.UNIVER_SHEET), n = W(Ee), s = W(ki), i = W($); if (t == null) return; const o = t.getUnitId(), l = () => { const T = s.getDefinedNameMap(o); return T ? Array.from(Object.values(T)) : []; }, [a, c] = te(!1), [d, u] = te(l()), [h, m] = te(null), [f, g] = te(); be(() => { const T = s.update$.subscribe(() => { u(l()); }); return () => { T.unsubscribe(); }; }, []); const p = (T) => { const { name: A, formulaOrRefString: H, comment: x, localSheetId: k, hidden: U } = T; let V = T.id; if (V == null || V.length === 0) V = se.generateRandomId(10), r.executeCommand(ZS.id, { id: V, unitId: o, name: A, formulaOrRefString: H, comment: x, localSheetId: k, hidden: U }); else { const N = { id: V, unitId: o, name: A, formulaOrRefString: H, comment: x, localSheetId: k, hidden: U }; r.executeCommand(GS.id, N); } c(!1), m(null); }, S = (T) => { g(T); }; function b() { g(null); } function v(T) { const A = s.getValueById(o, T); r.executeCommand(qS.id, { ...A, unitId: o }), g(null); } const _ = async (T) => { const { formulaOrRefString: A, id: H } = T, x = s.getWorksheetByRef(o, A); if (!x) return; x.isSheetHidden() && await r.executeCommand(_d.id, { unitId: o, subUnitId: x.getSheetId() }), s.focusRange(o, H); }, R = () => { const T = d.length + 1, A = n.t("definedName.defaultName") + T; if (s.getValueByName(o, A) == null) return A; let H = T + 1; for (; ; ) { const x = n.t("definedName.defaultName") + H; if (s.getValueByName(o, x) == null) return x; H++; } }, I = () => { var x; const T = (x = t.getActiveSheet()) == null ? void 0 : x.getName(); if (!T) return ""; const A = i.getCurrentSelections(); return A == null ? "" : A.map((k) => Wm(T, k.range)).join(","); }, y = () => { c(!1), m(null); }, M = () => { c(!0), m(null); }, P = (T) => { c(!1), m(T); }, E = (T) => { const A = t.getSheetBySheetId(T); return A == null ? "" : A.getName(); }; return /* @__PURE__ */ C.jsx("div", { className: _t.definedNameContainer, children: /* @__PURE__ */ C.jsxs("div", { className: _t.definedNameContainerScroll, children: [ /* @__PURE__ */ C.jsxs("div", { children: [ /* @__PURE__ */ C.jsxs("div", { onClick: M, className: _t.definedNameContainerAddButton, style: { display: a ? "none" : "flex" }, children: [ /* @__PURE__ */ C.jsx(zd, {}), /* @__PURE__ */ C.jsx("span", { className: _t.definedNameContainerAddButtonText, children: n.t("definedName.addButton") }) ] }), a && /* @__PURE__ */ C.jsx(uh, { confirm: p, cancel: y, state: a, inputId: "insertDefinedName", name: R(), formulaOrRefString: I() }) ] }, "insertDefinedName"), d.map((T, A) => /* @__PURE__ */ C.jsxs("div", { children: [ /* @__PURE__ */ C.jsxs("div", { onClick: () => { _(T); }, className: _t.definedNameContainerItem, style: { display: T.id === h ? "none" : "flex" }, children: [ /* @__PURE__ */ C.jsxs("div", { title: T.comment, children: [ /* @__PURE__ */ C.jsxs("div", { className: _t.definedNameContainerItemName, children: [ T.name, /* @__PURE__ */ C.jsx("span", { className: _t.definedNameContainerItemNameForSheet, children: T.localSheetId === gc || T.localSheetId == null ? "" : E(T.localSheetId) }) ] }), /* @__PURE__ */ C.jsx("div", { className: _t.definedNameContainerItemFormulaOrRefString, children: T.formulaOrRefString }) ] }), /* @__PURE__ */ C.jsx(Gn, { title: n.t("definedName.updateButton"), placement: "top", children: /* @__PURE__ */ C.jsx("div", { className: st(_t.definedNameContainerItemUpdate, _t.definedNameContainerItemShow), onClick: () => { P(T.id); }, children: /* @__PURE__ */ C.jsx(Hn, {}) }) }), /* @__PURE__ */ C.jsx(Gn, { title: n.t("definedName.deleteButton"), placement: "top", children: /* @__PURE__ */ C.jsx("div", { className: st(_t.definedNameContainerItemDelete, _t.definedNameContainerItemShow), onClick: () => { S(T.id); }, children: /* @__PURE__ */ C.jsx(ea, {}) }) }) ] }), /* @__PURE__ */ C.jsx(NC, { visible: f === T.id, onClose: b, onConfirm: () => { v(T.id); }, children: n.t("definedName.deleteConfirmText") }), T.id === h && /* @__PURE__ */ C.jsx( uh, { confirm: p, cancel: y, state: T.id === h, id: T.id, inputId: T.id + A, name: T.name, formulaOrRefString: T.formulaOrRefString, comment: T.comment, localSheetId: T.localSheetId } ) ] }, A)) ] }) }); }, Zw = "univer-count-bar", Gw = { countBar: Zw }, qw = [50, 75, 100, 125, 150, 175, 200, 400]; function Qw() { const r = W(F), e = W(L), t = Wn(), n = W(tt), s = is(n.visible$), i = On(() => { if (!t) return 100; const d = t.getActiveSheet(), u = d && d.getZoomRatio() * 100 || 100; return Math.round(u); }, [t]), [o, l] = te(() => i()); be(() => (l(i()), r.onCommandExecuted((u) => { if (u.id === $t.id || u.id === et.id) { const h = i(); l(h); } }).dispose), [r, i]); function a(d) { l(d); const u = e.getCurrentUnitForType(O.UNIVER_SHEET), h = u == null ? void 0 : u.getActiveSheet(); if (h == null) return; const m = d / 100; r.executeCommand(Wi.id, { unitId: u.getUnitId(), subUnitId: h.getSheetId(), zoomRatio: m }); } const c = (s == null ? void 0 : s.visible) && (s.unitId === (t == null ? void 0 : t.getUnitId()) || s.unitId === Te); return /* @__PURE__ */ C.jsx( HC, { disabled: c, min: _c[0], value: o, shortcuts: qw, onChange: a } ); } function Kw(r) { return /* @__PURE__ */ C.jsx("section", { className: Gw.countBar, children: /* @__PURE__ */ C.jsx(Qw, {}) }); } function og(r, e) { const t = W(tt); return sn(() => ({ keyCodes: [ { keyCode: Z.ENTER }, { keyCode: Z.ESC }, { keyCode: Z.TAB } ], handler: (s) => { (s === Z.ENTER || s === Z.ESC || s === Z.TAB) && (t.disableForceKeepVisible(), t.changeVisible({ visible: !1, eventType: Xe.Keyboard, keycode: s, unitId: e })); } }), [t, e]); } const Jw = "univer-editor-container", $w = "univer-editor-input", e0 = "univer-sheet-embedding-formula-editor-wrap", hh = { editorContainer: Jw, editorInput: $w, sheetEmbeddingFormulaEditorWrap: e0 }, Zo = -1e3, mh = { width: 0, height: 0, top: Zo, left: Zo }, t0 = () => { const [r, e] = te({ ...mh }), t = W(Fl), n = W(Ss), s = W(Ne), i = W(Dn), o = W(tt), l = Yt(o.visible$), a = W(F), c = xn(0), d = Yt( () => s.subscribeContextValue$(Su), !1, void 0, [s, Su] ), u = i.get(Td), h = o.getEditLocation(); be(() => { const p = t.state$.subscribe((S) => { if (S == null) return; const { startX: b = Zo, startY: v = Zo, endX: _ = 0, endY: R = 0, show: I = !1 } = S; if (!I) e({ ...mh }); else { e({ width: _ - b, height: R - v, left: b, top: v }); const y = n.getEditor(Le); if (y == null) return; const { left: M, top: P, width: E, height: T } = y.getBoundingClientRect(); t.setRect({ left: M, top: P, width: E, height: T }); } }); return () => { p.unsubscribe(); }; }, []), be(() => { d || t.setFocus(!0); }, [d, r]); const m = Cu(() => { o.isVisible().visible && o.changeVisible({ visible: !1, eventType: Xe.PointerUp, unitId: h.unitId }); }); wo(m); const f = og(c, h == null ? void 0 : h.unitId), g = Cu((p, S) => { a.executeCommand(cs.id, { keycode: p, visible: !1, eventType: Xe.Keyboard, isShift: S === ye.SHIFT || S === (ye.CTRL_COMMAND | ye.SHIFT), unitId: h == null ? void 0 : h.unitId }); }); return /* @__PURE__ */ C.jsx( "div", { className: hh.editorContainer, style: { left: r.left, top: r.top, width: r.width, height: r.height }, children: u && /* @__PURE__ */ C.jsx( u, { editorId: Le, className: hh.editorInput, initValue: "", onChange: () => { }, isFocus: l == null ? void 0 : l.visible, unitId: h == null ? void 0 : h.unitId, subUnitId: h == null ? void 0 : h.sheetId, keyboradEventConfig: f, onMoveInEditor: g, isSupportAcrossSheet: !0, resetSelectionOnBlur: !1, isSingle: !1, autoScrollbar: !1, onFormulaSelectingChange: (p) => { c.current = p, p ? o.enableForceKeepVisible() : o.disableForceKeepVisible(); }, disableSelectionOnClick: !0, disableContextMenu: !1 } ) } ); }; class n0 { constructor() { w(this, "_position", null); w(this, "_position$", new Me(null)); w(this, "position$", this._position$.asObservable()); w(this, "_focus", !1); w(this, "_focus$", new Me(this._focus)); w(this, "focus$", this._focus$.asObservable()); w(this, "_fxBtnClick$", new xe()); w(this, "fxBtnClick$", this._fxBtnClick$.asObservable()); w(this, "_foldBtnStatus$", new xe()); w(this, "foldBtnStatus$", this._foldBtnStatus$.asObservable()); } dispose() { this._position$.complete(), this._focus$.complete(), this._position = null, this._focus = !1; } setPosition(e) { this._position = e, this._refresh(e); } getPosition() { return this._position; } setFocus(e = !1) { this._focus = e, this._focus$.next(e); } handleFxBtnClick(e) { this._fxBtnClick$.next(e); } handleFoldBtnClick(e) { this._foldBtnStatus$.next(e); } _refresh(e) { this._position$.next(e); } } const ca = gn( "univer.sheet-formula-editor-manager.service" ); function r0(r) { const e = W(F), t = W(Ee), n = W(ki), s = W(L), i = W(vs), l = s.getCurrentUnitForType(O.UNIVER_SHEET).getUnitId(), a = () => { const m = n.getDefinedNameMap(l); return m ? Array.from(Object.values(m)) : []; }, [c, d] = te(a()); be(() => { const m = n.update$.subscribe(() => { d(a()); }); return () => { m.unsubscribe(); }; }, []), be(() => { const m = i.sidebarOptions$.subscribe((f) => { f.id === Si && (f.visible || setTimeout(() => { i.sidebarOptions$.next({ visible: !1 }); })); }); return () => { m.unsubscribe(); }; }, []); const u = () => { e.executeCommand(Jd.id, { value: "open" }); }, h = async (m) => { const { formulaOrRefString: f, id: g } = m, p = n.getWorksheetByRef(l, f); if (!p) return; p.isSheetHidden() && await e.executeCommand(_d.id, { unitId: l, subUnitId: p.getSheetId() }), n.focusRange(l, g); }; return /* @__PURE__ */ C.jsxs("div", { className: "univer-w-[300px]", children: [ /* @__PURE__ */ C.jsx( "ul", { className: ` univer-max-h-[360px] univer-overflow-y-auto univer-scrollbar-thin univer-scrollbar-thumb-gray-300 univer-scrollbar-track-transparent univer-scrollbar-w-[4px] univer-m-0 univer-list-none univer-p-0 `, children: c.map((m, f) => /* @__PURE__ */ C.jsx( "li", { className: ` univer-px-2 univer-cursor-pointer univer-transition-colors univer-duration-200 dark:hover:univer-bg-gray-600 hover:univer-bg-gray-100 `, onClick: () => { h(m); }, children: /* @__PURE__ */ C.jsxs( "div", { className: ` univer-flex univer-py-1 univer-items-center univer-justify-between univer-border-b univer-border-solid univer-border-0 univer-border-gray-200 univer-gap-2 `, children: [ /* @__PURE__ */ C.jsx( "div", { className: ` univer-text-gray-600 univer-text-sm univer-overflow-hidden univer-text-ellipsis univer-flex-shrink-0 univer-w-[50%] univer-whitespace-nowrap `, title: m.name, children: m.name } ), /* @__PURE__ */ C.jsx( "div", { className: ` univer-text-gray-400 univer-text-xs univer-flex-shrink-0 univer-overflow-hidden univer-text-ellipsis univer-w-[50%] univer-whitespace-nowrap `, title: m.formulaOrRefString, children: m.formulaOrRefString } ) ] } ) }, f )) } ), /* @__PURE__ */ C.jsxs( "div", { className: ` univer-p-2 univer-cursor-pointer univer-transition-colors univer-duration-200 dark:hover:univer-bg-gray-600 hover:univer-bg-gray-100 `, onClick: u, children: [ /* @__PURE__ */ C.jsx("div", { className: "univer-text-sm univer-font-semibold univer-text-gray-600 univer-mb-2", children: t.t("definedName.managerTitle") }), /* @__PURE__ */ C.jsx("div", { className: "univer-text-xs univer-text-gray-400", children: t.t("definedName.managerDescription") }) ] } ) ] }); } function s0({ disable: r }) { const [e, t] = te(""), n = W(ki); return be(() => { const s = n.currentRange$.subscribe(() => { t(n.getCurrentRangeForString()); }); return () => { s.unsubscribe(); }; }, []), /* @__PURE__ */ C.jsxs("div", { className: _t.definedName, children: [ /* @__PURE__ */ C.jsx( ti, { className: st({ [_t.defineNameInputDisable]: r }), value: e, type: "text", size: "small", affixWrapperStyle: { border: "none", paddingLeft: "6px", paddingRight: "6px", height: "100%" } } ), /* @__PURE__ */ C.jsxs(jm, { children: [ /* @__PURE__ */ C.jsx(Xm, { children: /* @__PURE__ */ C.jsx( "a", { className: st( ` univer-flex univer-items-center univer-justify-center univer-px-1 univer-cursor-pointer univer-absolute univer-right-0 univer-h-full univer-transition-colors univer-duration-200 hover:univer-bg-gray-100 `, { "univer-text-gray-300 univer-cursor-not-allowed hover:univer-bg-transparent": r } ), children: /* @__PURE__ */ C.jsx(hs, {}) } ) }), /* @__PURE__ */ C.jsx(zm, { className: "univer-z-[1001]", offset: { x: -75, y: 2 }, children: /* @__PURE__ */ C.jsx(r0, {}) }) ] }) ] }); } const i0 = "univer-formula-box", o0 = "univer-name-ranges", l0 = "univer-formula-bar", a0 = "univer-formula-icon", c0 = "univer-formula-icon-disable", d0 = "univer-formula-icon-wrapper", u0 = "univer-icon-container", h0 = "univer-icon-container-success", m0 = "univer-formula-active", f0 = "univer-icon-container-error", g0 = "univer-icon-container-fx", p0 = "univer-formula-input", S0 = "univer-formula-container", C0 = "univer-sheet-embedding-formula-editor-wrap", v0 = "univer-formula-content", b0 = "univer-arrow-container", _0 = "univer-arrow-container-disable", ct = { formulaBox: i0, nameRanges: o0, formulaBar: l0, formulaIcon: a0, formulaIconDisable: c0, formulaIconWrapper: d0, iconContainer: u0, iconContainerSuccess: h0, formulaActive: m0, iconContainerError: f0, iconContainerFx: g0, formulaInput: p0, formulaContainer: S0, sheetEmbeddingFormulaEditorWrap: C0, formulaContent: v0, arrowContainer: b0, arrowContainerDisable: _0 }; function w0() { var U; const [r, e] = te(ct.formulaGrey), [t, n] = te( 0 /* Down */ ), s = W(ca), i = W(tt), o = W(ft), l = W(Ye), a = W(L), c = W($), d = W($e), [u, h] = te(!1), [m, f] = te(!1), g = Wn(), p = W(Dn), S = is(() => a.getCurrentTypeOfUnit$(O.UNIVER_SHEET), void 0, void 0, []), b = xn(0), v = i.getEditLocation(), _ = og(b, (U = v == null ? void 0 : v.unitId) != null ? U : ""), R = p.get(Td), I = Gh(Gm.FORMULA_AUX), y = W(Ne); is(sn(() => y.subscribeContextValue$(Ht), [y])); const M = y.getContextValue(Ht), P = xn(null); function E(V, N) { return [ new q(V).id, new Ut(V, N).id, new ee(V, N).id ]; } PS(() => { const V = S.activeSheet$.pipe( We((N) => N ? mt( o.ruleChange$, l.ruleChange$, c.selectionMoveEnd$, c.selectionSet$ ).pipe( We(() => { var ve, G; const X = S.getUnitId(), Y = N.getSheetId(); if (!((ve = c.getCurrentLastSelection()) == null ? void 0 : ve.range)) return vu; const he = E(X, Y), ne = (G = c.getCurrentSelections()) == null ? void 0 : G.map((J) => J.range); return l.getSubunitRuleList(X, Y).filter((J) => J.ranges.some((le) => ne == null ? void 0 : ne.some((fe) => ae.intersects(le, fe)))).forEach((J) => { he.push(new re(X, Y, J.permissionId).id); }), d.composePermission$(he); }) ) : vu) ).subscribe((N) => { N && h(!N.every((X) => X.value)); }); return () => { V.unsubscribe(); }; }, [S]), be(() => { const V = i.visible$.subscribe((N) => { e(N.visible ? ct.formulaActive : ct.formulaGrey); }); return () => V.unsubscribe(); }, [i.visible$]), be(() => { const V = i.currentEditCellState$.subscribe((N) => { var X, Y, ie; (ie = (Y = (X = N == null ? void 0 : N.documentLayoutObject.documentModel) == null ? void 0 : X.getBody()) == null ? void 0 : Y.customBlocks) != null && ie.length ? f(!0) : f(!1); }); return () => V.unsubscribe(); }, [i.currentEditCellState$]), be(() => { if (P.current) { const V = () => { const X = P.current.getBoundingClientRect(); s.setPosition(X); }; V(); const N = new ResizeObserver(V); return N.observe(P.current), () => N.disconnect(); } }, [s]); function T() { n( t === 0 ? 1 : 0 /* Down */ ), setTimeout(() => { s.handleFoldBtnClick( t === 1 /* Up */ ); }, 150); } function A() { var N; i.isVisible().visible && i.changeVisible({ visible: !1, eventType: Xe.Keyboard, keycode: Z.ESC, unitId: (N = g == null ? void 0 : g.getUnitId()) != null ? N : "" }); } function H() { var N; i.isVisible().visible && i.changeVisible({ visible: !1, eventType: Xe.PointerDown, unitId: (N = g == null ? void 0 : g.getUnitId()) != null ? N : "" }); } function x() { s.handleFxBtnClick(!0); } const k = u || m; return /* @__PURE__ */ C.jsxs( "div", { className: ct.formulaBox, style: { height: t === 0 ? "28px" : "82px", pointerEvents: u ? "none" : "auto" }, children: [ /* @__PURE__ */ C.jsx("div", { className: ct.nameRanges, children: /* @__PURE__ */ C.jsx(s0, { disable: u }) }), /* @__PURE__ */ C.jsxs("div", { className: ct.formulaBar, children: [ /* @__PURE__ */ C.jsx("div", { className: st(ct.formulaIcon, { [ct.formulaIconDisable]: k }), children: /* @__PURE__ */ C.jsxs("div", { className: ct.formulaIconWrapper, children: [ /* @__PURE__ */ C.jsx( "span", { className: st(ct.iconContainer, ct.iconContainerError, r), onClick: A, children: /* @__PURE__ */ C.jsx(Df, {}) } ), /* @__PURE__ */ C.jsx( "span", { className: st(ct.iconContainer, ct.iconContainerSuccess, r), onClick: H, children: /* @__PURE__ */ C.jsx(Hn, {}) } ), /* @__PURE__ */ C.jsx("span", { className: st(ct.iconContainer, ct.iconContainerFx), onClick: x, children: /* @__PURE__ */ C.jsx(Bf, {}) }) ] }) }), /* @__PURE__ */ C.jsxs("div", { className: ct.formulaContainer, children: [ /* @__PURE__ */ C.jsx("div", { className: ct.formulaInput, ref: P, children: R && /* @__PURE__ */ C.jsx( R, { disableSelectionOnClick: !0, editorId: Te, initValue: "", onChange: () => { }, isFocus: M, className: ct.formulaContent, unitId: v == null ? void 0 : v.unitId, subUnitId: v == null ? void 0 : v.sheetId, isSupportAcrossSheet: !0, resetSelectionOnBlur: !1, isSingle: !1, keyboradEventConfig: _, onFormulaSelectingChange: (V) => { b.current = V, V ? i.enableForceKeepVisible() : i.disableForceKeepVisible(); }, autoScrollbar: !1, disableContextMenu: !1 } ) }), /* @__PURE__ */ C.jsx("div", { className: st(ct.arrowContainer, { [ct.arrowContainerDisable]: u }), onClick: T, children: t === 0 ? /* @__PURE__ */ C.jsx(Hc, {}) : /* @__PURE__ */ C.jsx(Hc, { style: { transform: "rotateZ(180deg)" } }) }) ] }) ] }), /* @__PURE__ */ C.jsx(qh, { components: I }, "formula-aux") ] } ); } const R0 = "univer-operate-container", I0 = "univer-auto-fill-popup-menu", y0 = "univer-auto-fill-popup-menu-item", M0 = "univer-auto-fill-popup-menu-item-icon", P0 = "univer-auto-fill-popup-menu-item-title", E0 = "univer-auto-fill-popup-menu-item-hide", T0 = "univer-btn-container", x0 = "univer-btn-container-expand", fr = { operateContainer: R0, autoFillPopupMenu: I0, autoFillPopupMenuItem: y0, autoFillPopupMenuItemIcon: M0, autoFillPopupMenuItemTitle: P0, autoFillPopupMenuItemHide: E0, btnContainer: T0, btnContainerExpand: x0 }, O0 = () => { const [, r] = te({}); return On(() => r((e) => !e), []); }, A0 = () => { const r = W(F), e = W(L), t = W(Ce), n = W(Hr), s = W(Ee), [i, o] = te([]), [l, a] = te(!1), [c, d] = te({ row: -1, col: -1 }), [u, h] = te(ke.SERIES), [m, f] = te(!1), g = Wn(), { sheetSkeletonManagerService: p, selectionRenderService: S } = sn(() => { if (g) { const Y = t.getRenderById(g.getUnitId()); return { sheetSkeletonManagerService: Y == null ? void 0 : Y.with(me), selectionRenderService: Y == null ? void 0 : Y.with(dt) }; } return { sheetSkeletonManagerService: null, selectionRenderService: null }; }, [g, t]), b = () => { f(!0); }, v = () => { f(!1); }, _ = O0(); if (be(() => r.onCommandExecuted((ie, he) => { ie.id === dn.id && _(); }).dispose, [_, r]), be(() => { const Y = p && Ae( p.currentSkeleton$.subscribe((ie) => { ie && _(); }) ); return Y == null ? void 0 : Y.dispose; }, [p, _]), be(() => Ae( n.menu$.subscribe((ie) => { o(ie.map((he) => ({ ...he, index: ie.indexOf(he) }))); }) ).dispose, [n]), be(() => Ae( n.showMenu$.subscribe((ie) => { const { source: he, target: ne } = n.autoFillLocation || { source: null, target: null }; if (ie && he && ne) { const pe = Math.max(he.rows[he.rows.length - 1], ne.rows[ne.rows.length - 1]), ve = Math.max(he.cols[he.cols.length - 1], ne.cols[ne.cols.length - 1]); d({ row: pe, col: ve }); } else d({ row: -1, col: -1 }); }) ).dispose, [n]), be(() => Ae( n.applyType$.subscribe((ie) => { h(ie); }) ).dispose, [n]), be(() => { function Y() { a(!1); } return document.addEventListener("wheel", Y), () => { document.removeEventListener("wheel", Y); }; }, [l]), c.col < 0 || c.row < 0) return null; const R = pn(e, t); if (!R || !S) return null; const { scene: I } = R, y = p == null ? void 0 : p.getCurrentSkeleton(), M = S.getViewPort(), P = I == null ? void 0 : I.scaleX, E = I == null ? void 0 : I.scaleY, T = I == null ? void 0 : I.getViewportScrollXY(M); if (!P || !I || !P || !E || !T) return null; const A = (y == null ? void 0 : y.getNoMergeCellPositionByIndex(c.row, c.col).endX) || 0, H = (y == null ? void 0 : y.getNoMergeCellPositionByIndex(c.row, c.col).endY) || 0, x = y == null ? void 0 : y.convertTransformToOffsetX(A, P, T), k = y == null ? void 0 : y.convertTransformToOffsetY(H, E, T); if (x == null || k == null) return null; const U = (Y) => { a(Y); }, V = (Y) => { r.executeCommand(Ll.id, { type: Y.value }), a(!1); }, N = l || m, X = i.filter((Y) => !Y.disable); return /* @__PURE__ */ C.jsx( "div", { onMouseEnter: b, onMouseLeave: v, style: { left: `${x + 2}px`, top: `${k + 2}px`, position: "absolute" }, children: /* @__PURE__ */ C.jsx( ei, { placement: "bottomLeft", trigger: ["click"], overlay: /* @__PURE__ */ C.jsx("ul", { className: fr.autoFillPopupMenu, children: X.map((Y) => /* @__PURE__ */ C.jsxs( "li", { onClick: () => V(Y), className: fr.autoFillPopupMenuItem, children: [ /* @__PURE__ */ C.jsx("span", { className: fr.autoFillPopupMenuItemIcon, children: Y.value === u && /* @__PURE__ */ C.jsx(Hn, { style: { color: "rgb(var(--green-700, #409f11))" } }) }), /* @__PURE__ */ C.jsx("span", { className: fr.autoFillPopupMenuItemTitle, children: s.t(Y.label) }) ] }, Y.index )) }), visible: l, onVisibleChange: U, children: /* @__PURE__ */ C.jsxs( "div", { className: st(fr.btnContainer, { [fr.btnContainerExpand]: l }), children: [ /* @__PURE__ */ C.jsx( kf, { style: { color: "#35322B" }, extend: { colorChannel1: "rgb(var(--green-700, #409f11))" } } ), N && /* @__PURE__ */ C.jsx(hs, { style: { color: "#CCCCCC", fontSize: "8px", marginLeft: "8px" } }) ] } ) } ) } ); }, N0 = () => /* @__PURE__ */ C.jsx("div", { className: fr.operateContainer, children: /* @__PURE__ */ C.jsx(A0, {}) }), H0 = "univer-sheet-bar", V0 = "univer-sheet-bar-options", k0 = "univer-sheet-bar-options-divider", to = { sheetBar: H0, sheetBarOptions: V0, sheetBarOptionsDivider: k0 }, D0 = "univer-sheet-bar-btn", L0 = { sheetBarBtn: D0 }; function po(r) { const { children: e, className: t, style: n, disabled: s = !1, onClick: i, ...o } = r, l = (a) => { if (s) { a.preventDefault(); return; } i && i(a); }; return /* @__PURE__ */ C.jsx("button", { className: L0.sheetBarBtn, style: n, disabled: s, onClick: l, ...o, children: e }); } const W0 = "36", B0 = "univer-sheet-container", F0 = "univer-sheet-bar-menu", U0 = "univer-sheet-bar-menu-item", j0 = "univer-sheet-bar-menu-item-icon", X0 = "univer-sheet-bar-menu-item-hide", z0 = "univer-sheet-bar-menu-item-select", Y0 = "univer-sheet-bar-menu-item-label", jn = { sheetFooterBarHeight: W0, sheetContainer: B0, sheetBarMenu: F0, sheetBarMenuItem: U0, sheetBarMenuItemIcon: j0, sheetBarMenuItemHide: X0, sheetBarMenuItemSelect: z0, sheetBarMenuItemLabel: Y0 }; function Z0(r) { const { style: e } = r, [t, n] = te([]), [s, i] = te(!1), o = W(L), l = W(F), a = W(kr), c = W(ft), d = Yt(() => o.getCurrentTypeOfUnit$(O.UNIVER_SHEET), null, !1, []), u = (p) => { const { sheetId: S } = p; !S || !d || (p.hidden ? l.executeCommand(_d.id, { unitId: d.getUnitId(), subUnitId: S, value: S }) : p.selected || l.executeCommand(dd.id, { unitId: d.getUnitId(), subUnitId: S }), i(!1)); }, h = On(() => { if (!d) return; const p = d.getSheets(), S = d.getActiveSheet(), b = p.map((v, _) => ({ label: v.getName(), index: `${_}`, sheetId: v.getSheetId(), hidden: v.isSheetHidden() === Qe.TRUE, selected: S === v })); n(b); }, [d, c]), m = On(() => l.onCommandExecuted((p) => { switch (p.id) { case nr.id: case An.id: case Rd.id: case Nr.id: case wd.id: case et.id: h(); break; } }), [l, h]); function f() { i(!0); } const g = (p) => { i(p); }; return be(() => { h(); const p = new St(); return p.add(m()), p.add(a.registerSheetBarMenuHandler({ handleSheetBarMenu: f })), () => p.dispose(); }, [m, a, h, d]), /* @__PURE__ */ C.jsx( ei, { placement: "topLeft", trigger: ["click"], overlay: /* @__PURE__ */ C.jsx("ul", { className: jn.sheetBarMenu, style: { ...e }, children: t.map((p) => /* @__PURE__ */ C.jsxs( "li", { onClick: () => u(p), className: p.selected ? ` ${jn.sheetBarMenuItem} ${jn.sheetBarMenuItemSelect} ` : p.hidden ? ` ${jn.sheetBarMenuItem} ${jn.sheetBarMenuItemHide} ` : jn.sheetBarMenuItem, children: [ /* @__PURE__ */ C.jsx("span", { className: jn.sheetBarMenuItemIcon, children: p.selected ? /* @__PURE__ */ C.jsx(Hn, {}) : p.hidden ? /* @__PURE__ */ C.jsx(Wf, {}) : /* @__PURE__ */ C.jsx(Hn, {}) }), /* @__PURE__ */ C.jsx("div", { className: jn.sheetBarMenuItemLabel, children: p.label }) ] }, p.index )) }), visible: s, onVisibleChange: g, children: /* @__PURE__ */ C.jsx("div", { children: /* @__PURE__ */ C.jsx(po, { children: /* @__PURE__ */ C.jsx(Lf, {}) }) }) } ); } const G0 = "univer-slide-tab-bar-container", q0 = "univer-slide-tab-bar", Q0 = "univer-slide-tab-item", K0 = "univer-slide-tab-active", J0 = "univer-slide-tab-div", $0 = "univer-slide-tab-div-edit", eR = "univer-slide-tab-item-dropdown", Wt = { slideTabBarContainer: G0, slideTabBar: q0, slideTabItem: Q0, slideTabActive: K0, slideTabDiv: J0, slideTabDivEdit: $0, slideTabItemDropdown: eR }; function tR(r) { const { sheetId: e, label: t, color: n, selected: s } = r, [i, o] = te(s), l = W(kt); be(() => { o(s); }, [s]); const a = (c) => { const d = l.getCurrentTheme(), u = d.textColor, h = d.colorWhite; return new Tn(c).isDark() ? h : u; }; return /* @__PURE__ */ C.jsx( "div", { "data-id": e, className: i ? ` ${Wt.slideTabActive} ${Wt.slideTabItem} ` : Wt.slideTabItem, style: { backgroundColor: !i && n ? n : "", color: !i && n ? a(n) : "", boxShadow: i && n ? `0px 0px 8px rgba(0, 0, 0, 0.08), inset 0px -2px 0px 0px ${n}` : "" }, children: /* @__PURE__ */ C.jsx("div", { className: Wt.slideTabDiv, children: t }) }, e ); } const nR = { easeOutStrong(r, e, t, n) { return -t * ((r = r / n - 1) * r * r * r - 1) + e; }, backOut(r, e, t, n, s) { return typeof s > "u" && (s = 0.7), t * ((r = r / n - 1) * r * ((s + 1) * r + s) + 1) + e; } }, rR = { loop: !1, begin: 0, end: 0, duration: 300, delay: 0, type: "easeOutStrong", receive(r) { }, success(r) { }, cancel(r) { }, complete(r) { } }; class sR { constructor(e) { w(this, "_config"); w(this, "_status", 0); w(this, "_start", 0); w(this, "_handle", 0); w(this, "_delayHandle", null); this._config = { ...rR, ...e }, this._config.loop && (this._config.complete = () => { }, this._config.success = () => { this.request(); }); } static success(...e) { let t = 0; return new Promise((n) => { for (let s = 0; s < e.length; s++) { const i = e[s], o = i._config, l = o.success; o.loop || (o.success = (c) => { t++, l && l.call(i, c), t === e.length && n(); }); } }); } request() { this._config.delay === 0 ? (this._status = 0, this._start = Date.now(), this._fakeHandle()) : (this._delayHandle && clearTimeout(this._delayHandle), this._delayHandle = setTimeout(() => { this._status = 0, this._start = Date.now(), this._fakeHandle(); }, this._config.delay)); } cancel() { this._status = 1, this._delayHandle && clearTimeout(this._delayHandle), cancelAnimationFrame(this._handle); } _fakeHandle() { let e = Date.now() - this._start; e = e >= this._config.duration ? this._config.duration : e; const n = nR[this._config.type]( e, this._config.begin, this._config.end - this._config.begin, this._config.duration, 0.7 ).toFixed(2); if (this._config.receive(n), this._status === 1) { this._config.cancel(n), this._config.complete(n); return; } if (e === this._config.duration) { this._config.success(n), this._config.complete(n); return; } this._handle = requestAnimationFrame(() => { this._fakeHandle(); }); } } class br { constructor(e, t) { w(this, "_slideTabItem"); w(this, "_animate"); w(this, "_midline", 0); w(this, "_translateX"); w(this, "_scrollbar"); w(this, "_slideTabBar"); w(this, "_editMode"); w(this, "_placeholder"); this._slideTabItem = e, this._animate = null, this._translateX = 0, this._editMode = !1, this._slideTabBar = t, this._placeholder = null, this._scrollbar = t.getScrollbar(), this.update(); } static midline(e) { return e.getBoundingRect().x + e.getBoundingRect().width / 2; } static leftLine(e) { return e.getBoundingRect().x; } static rightLine(e) { return e.getBoundingRect().x + e.getBoundingRect().width; } static make(e, t) { const n = []; return e.forEach((s) => n.push(new br(s, t))), n; } getSlideTabItem() { return this._slideTabItem; } getEditor() { return this._slideTabItem.querySelector("span"); } focus() { var e; (e = this.getEditor()) == null || e.focus(); } selectAll() { const e = this.getEditor(); e && ss.keepSelectAll(e); } isEditMode() { return this._editMode; } classList() { return this._slideTabItem.classList; } translateX(e) { return this._translateX = e, this._slideTabItem.style.transform = `translateX(${e}px)`, this.getTranslateXDirection(); } setEditor(e) { if (!this._slideTabBar.getConfig().onNameChangeCheck()) return; let t = !0; if (this._editMode === !1) { const n = this._slideTabItem.querySelector("span"), s = (c) => { if (!this.nameCheck()) { if (this._editMode = !1, n && (n.removeAttribute("contentEditable"), n.removeEventListener("focusout", s), n.removeEventListener("compositionstart", o), n.removeEventListener("compositionend", l), n.removeEventListener("input", a), n.removeEventListener("keydown", i), n.classList.remove(this._slideTabBar.getConfig().slideTabBarSpanEditClassName)), this._slideTabBar.removeListener(), this._slideTabBar.updateItems(), this._slideTabBar.getConfig().onChangeName) { const d = (n == null ? void 0 : n.innerText) || "", u = this.getId(); this._slideTabBar.getConfig().onChangeName(u, d); } e && e(c); } }; let i = (c) => { n && (c.stopPropagation(), c.key === "Enter" && n.blur()); }; const o = (c) => { t = !1; }, l = (c) => { t = !0; }, a = (c) => { if (!n) return; const d = 31; setTimeout(() => { if (t) { const u = n.innerText; u.length > d && (n.innerText = u.substring(0, d), ss.keepLastIndex(n)); } }, 0); }; n && (n.setAttribute("contentEditable", "true"), n.addEventListener("focusout", s), n.addEventListener("compositionstart", o), n.addEventListener("compositionend", l), n.addEventListener("input", a), n.addEventListener("keydown", i), n.classList.add(this._slideTabBar.getConfig().slideTabBarSpanEditClassName), this._editMode = !0, ss.keepSelectAll(n)); } } nameCheck() { const e = this._slideTabItem.querySelector("span"); if (!e) return !1; const t = e.innerText; return this._slideTabBar.getConfig().onNameCheckAlert(t); } animate() { return { translateX: (e) => { this._translateX !== e && (this._animate && (this._animate.cancel(), this._animate = null), this._animate = new sR({ begin: this._translateX, end: e, receive: (t) => { this._slideTabItem.style.transform = `translateX(${t}px)`; } }), this._translateX = e, this._animate.request()); }, cancel: () => { this._animate && (this._animate.cancel(), this._animate = null); } }; } after(e) { this._slideTabItem.after(e._slideTabItem || e); } update() { this._midline = br.midline(this); } disableFixed() { if (this._placeholder) { const e = this._slideTabBar.primeval(); this._slideTabItem.style.removeProperty("position"), this._slideTabItem.style.removeProperty("left"), this._slideTabItem.style.removeProperty("top"), this._slideTabItem.style.removeProperty("width"), this._slideTabItem.style.removeProperty("height"), this._slideTabItem.style.removeProperty("background"), this._slideTabItem.style.removeProperty("padding"), this._slideTabItem.style.removeProperty("box-sizing"), this._slideTabItem.style.removeProperty("font-size"), this._slideTabItem.style.removeProperty("font-family"), this._slideTabItem.style.removeProperty("font-weight"), this._slideTabItem.style.removeProperty("color"), this._slideTabItem.style.removeProperty("border-radius"), this._placeholder.after(this._slideTabItem), e.removeChild(this._placeholder), this._placeholder = null; } } enableFixed() { const e = document.createElement("div"), t = this.getBoundingRect(), n = getComputedStyle(this._slideTabItem), s = this._slideTabItem.querySelector("span"); if (this._placeholder = e, this._placeholder.style.width = `${t.width}px`, this._placeholder.style.height = `${t.height}px`, this._placeholder.style.flexShrink = "0", this._placeholder.style.margin = n.margin, this._slideTabItem.style.background = n.background, s) { const i = getComputedStyle(s).padding; this._slideTabItem.style.padding = i; } this._slideTabItem.style.boxSizing = n.boxSizing, this._slideTabItem.style.fontSize = n.fontSize, this._slideTabItem.style.fontFamily = n.fontFamily, this._slideTabItem.style.fontWeight = n.fontWeight, this._slideTabItem.style.color = n.color, this._slideTabItem.style.borderRadius = n.borderRadius, this._slideTabItem.style.left = `${t.x - this.getScrollbar().getScrollX()}px`, this._slideTabItem.style.top = `${t.y}px`, this._slideTabItem.style.width = `${t.width}px`, this._slideTabItem.style.height = `${t.height}px`, this._slideTabItem.style.position = "fixed", this._slideTabItem.after(e), document.body.appendChild(this._slideTabItem); } addEventListener(e, t, n) { this._slideTabItem.addEventListener(e, t, n); } removeEventListener(e, t, n) { this._slideTabItem.removeEventListener(e, t, n); } getScrollbar() { return this._scrollbar; } getMidLine() { return this._midline; } getBoundingRect() { const e = this._slideTabItem.getBoundingClientRect(); return e.x += this._scrollbar.getScrollX(), e; } getWidth() { return this.getBoundingRect().width; } getTranslateXDirection() { const e = br.midline(this); return e > this._midline ? 1 : e < this._midline ? -1 : 0; } equals(e) { return e && e._slideTabItem === this._slideTabItem; } getId() { return this._slideTabItem.dataset.id || ""; } } class iR { constructor(e) { w(this, "_slideTabBar"); w(this, "_scrollX"); const t = e.primeval(); this._scrollX = t.scrollLeft, this._slideTabBar = e; } scrollX(e) { const t = this._slideTabBar.primeval(); t.scrollLeft = e, this._scrollX = t.scrollLeft; } scrollRight() { const e = this._slideTabBar.primeval(); e.scrollLeft = e.scrollWidth, this._scrollX = e.scrollLeft; } getScrollX() { return this._scrollX; } } const qr = class qr { // eslint-disable-next-line max-lines-per-function constructor(e) { // in milliseconds w(this, "_activeTabItemIndex", 0); w(this, "_slideTabBar"); w(this, "_slideTabItems", []); w(this, "_config"); w(this, "_downActionX", 0); w(this, "_moveActionX", 0); w(this, "_compareIndex", 0); w(this, "_activeTabItem", null); w(this, "_moveAction"); w(this, "_upAction"); w(this, "_downAction"); w(this, "_wheelAction"); w(this, "_scrollIncremental", 0); w(this, "_compareDirection", 0); w(this, "_autoScrollTime", null); w(this, "_slideScrollbar"); w(this, "_longPressTimer", null); /** * left border line */ w(this, "_leftBoundingLine", 0); /** * right border line */ w(this, "_rightBoundingLine", 0); /** * The distance required to move to the left border */ w(this, "_leftMoveX", 0); /** * The distance required to move to the right border */ w(this, "_rightMoveX", 0); var o; if (e.slideTabBarContainer == null) throw new Error("not found slide-tab-bar root element"); const t = e.slideTabBarContainer.querySelector( `.${(o = e.slideTabBarClassName) != null ? o : "slide-tab-bar"}` ); if (t == null) throw new Error("not found slide-tab-bar"); this._slideTabBar = t, this._slideScrollbar = new iR(this), this._config = e, this._initConfig(); let n = 0, s = 0, i = 0; this._downAction = (l) => { var I, y, M, P, E, T; if ((I = this._activeTabItem) != null && I.isEditMode()) return; this._longPressTimer && (clearTimeout(this._longPressTimer), this._longPressTimer = null); const a = (M = (y = l.target) == null ? void 0 : y.closest(`.${e.slideTabBarItemClassName}`)) == null ? void 0 : M.getAttribute("data-id"), c = this._slideTabItems.findIndex((A) => A.getId() === a); if (a == null || c === -1) return; if (this._activeTabItemIndex !== c) { (P = this._activeTabItem) == null || P.removeEventListener("pointermove", this._moveAction), (E = this._activeTabItem) == null || E.removeEventListener("pointerup", this._upAction), this.removeListener(), this._config.onChangeTab(l, a); return; } if (this._compareIndex = c, this._downActionX = l.pageX, this._moveActionX = 0, this._scrollIncremental = 0, this._activeTabItem = this._slideTabItems[c], !this._activeTabItem) { console.error("Not found active slide-tab-item in sheet bar"); return; } const d = this._activeTabItem.getSlideTabItem(); d == null || d.setPointerCapture(l.pointerId), (T = this._activeTabItem) == null || T.addEventListener("pointerup", this._upAction); const { x: u, width: h } = this._activeTabItem.getBoundingRect(), { x: m, width: f } = this.getBoundingRect(), g = this._slideScrollbar.getScrollX(); if (this._leftBoundingLine = this._downActionX - (u - g), this._rightBoundingLine = u - g + h - this._downActionX, this._leftMoveX = u - m - g, this._rightMoveX = m + f - (u + h) + g, l.button === 2 || this._hasEditItem()) return; const { pageX: p, pageY: S } = l, b = Date.now(), v = b - i <= qr.DoubleClickDelay, _ = Math.abs(p - n) < 10, R = Math.abs(S - s) < 10; v && _ && R && this._activeTabItem.setEditor(), n = p, s = S, i = b, this._longPressTimer = setTimeout(() => { var A, H, x; !d || (A = this._activeTabItem) != null && A.isEditMode() || ((H = this._activeTabItem) == null || H.enableFixed(), this._startAutoScroll(), d.setPointerCapture(l.pointerId), d.style.cursor = "move", (x = this._activeTabItem) == null || x.addEventListener("pointermove", this._moveAction)); }, qr.LongPressDelay); }, this._upAction = (l) => { var d, u, h, m; if ((d = this._activeTabItem) != null && d.isEditMode() || (this._longPressTimer && (clearTimeout(this._longPressTimer), this._longPressTimer = null), !this._activeTabItem)) return; const a = this._autoScrollTime !== null; this._closeAutoScroll(), this._activeTabItem.disableFixed(), this.updateItems(); const c = (u = this._activeTabItem) == null ? void 0 : u.getSlideTabItem(); c && (c.style.cursor = "", c.releasePointerCapture(l.pointerId), (h = this._activeTabItem) == null || h.removeEventListener("pointermove", this._moveAction), (m = this._activeTabItem) == null || m.removeEventListener("pointerup", this._upAction), this._config.onSlideEnd && this._activeTabItemIndex !== this._compareIndex && a && (this.removeListener(), this._config.onSlideEnd(l, this._compareIndex || 0)), this._scrollIncremental = 0, this._downActionX = 0, this._moveActionX = 0, this._compareIndex = 0); }, this._moveAction = (l) => { this._activeTabItem && (this._moveActionX = l.pageX - this._downActionX, this._moveActionX <= -this._leftMoveX ? this._moveActionX = -this._leftMoveX : this._moveActionX >= this._rightMoveX && (this._moveActionX = this._rightMoveX), this._scrollIncremental = 0, this._scrollLeft(l), this._scrollRight(l)); }, this._wheelAction = (l) => { this.setScroll(l.deltaY); }, this.addListener(); } static checkedSkipSlide(e) { let t = e.target; for (; t != null && t !== document.body; ) { if (t.getAttribute("data-slide-skip")) return !0; t = t.parentElement; } return !1; } static keepLastIndex(e) { setTimeout(() => { const t = window.getSelection(); t && (t.selectAllChildren(e), t.collapseToEnd()); }); } static keepSelectAll(e) { setTimeout(() => { const t = window.getSelection(); if (!t) return; const n = document.createRange(); n.selectNodeContents(e), t.removeAllRanges(), t.addRange(n); }); } /** * The current instance is persistent, but some parameters need to be updated after refreshing * @param currentIndex */ update(e) { this._config.currentIndex = e, this._initConfig(), this.removeListener(), this.addListener(), this.scrollToItem(e); } primeval() { return this._slideTabBar; } updateItems() { for (let e = 0; e < this._slideTabItems.length; e++) this._slideTabItems[e].animate().cancel(), this._slideTabItems[e].translateX(0), this._slideTabItems[e].update(); } getScrollbar() { return this._slideScrollbar; } getConfig() { return this._config; } getBoundingRect() { return this._slideTabBar.getBoundingClientRect(); } getSlideTabItems() { return this._slideTabItems; } getActiveItem() { return this._activeTabItem; } isLeftEnd() { return this._slideTabBar.scrollLeft === 0; } isRightEnd() { const e = this._slideTabBar.parentElement; return e ? this._slideTabBar.scrollWidth - e.clientWidth === this._slideTabBar.scrollLeft : !1; } addListener() { this._slideTabBar.addEventListener("wheel", this._wheelAction), this._slideTabItems.forEach((e) => { e.addEventListener("pointerdown", this._downAction); }); } removeListener() { this._slideTabBar.removeEventListener("wheel", this._wheelAction), this._slideTabItems.forEach((e) => { e.removeEventListener("pointerdown", this._downAction); }); } setScroll(e) { if (this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX() + e), e > 0) { const t = this.calculateLeftScrollX(); this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX() + t); } else if (e < 0) { const t = this.calculateRightScrollX(); this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX() + t); } this._config.onScroll({ leftEnd: this.isLeftEnd(), rightEnd: this.isRightEnd() }); } flipPage(e) { if (e > 0) { const t = this.calculateLeftScrollX(!0); this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX() + t); } else if (e < 0) { const t = this.calculateRightScrollX(!0); this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX() + t); } this._config.onScroll({ leftEnd: this.isLeftEnd(), rightEnd: this.isRightEnd() }); } scrollToItem(e) { if (e = e != null ? e : this._config.currentIndex, e < 0 || e >= this._slideTabItems.length) { console.error("Index out of bounds"); return; } const t = this.calculateTabItemScrollX(e); this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX() + t), this._config.onScroll({ leftEnd: this.isLeftEnd(), rightEnd: this.isRightEnd() }); } calculateLeftScrollX(e) { let t = 0; const n = 4; return this._slideTabItems.some((s) => { const i = this._slideTabBar.getBoundingClientRect(), o = i.left + i.width, l = s.getSlideTabItem().getBoundingClientRect(), a = l.left, c = l.width; return a < o && a + c + n * 2 > o ? (t = e ? a - i.left - n : a + c - o + n, !0) : !1; }), t; } calculateRightScrollX(e) { let t = 0; const n = 4; return this._slideTabItems.some((s) => { const i = this._slideTabBar.getBoundingClientRect(), o = i.left, l = s.getSlideTabItem().getBoundingClientRect(), a = l.left, c = l.width; return a - n * 2 < o && a + c > o ? (t = e ? a + c - i.left - i.width + n : a - o - n, !0) : !1; }), t; } calculateTabItemScrollX(e) { let t = 0; const n = 4, s = this._slideTabBar.getBoundingClientRect(), i = s.left, o = s.left + s.width, l = this._slideTabItems[e].getSlideTabItem().getBoundingClientRect(), a = l.left, c = l.width; return a - n * 2 < i && (t = a - i - n), a + c + n * 2 > o && (t = a + c - o + n), t; } calculateActiveTabItemScrollX() { var c; let e = 0; const t = 4, n = this._slideTabBar.getBoundingClientRect(), s = n.left, i = n.left + n.width, o = (c = this._activeTabItem) == null ? void 0 : c.getSlideTabItem().getBoundingClientRect(); if (!o) return 0; const l = o.left, a = o.width; return l - t * 2 < s && l + a > s && (e = l - s - t), l < i && l + a + t * 2 > i && (e = l + a - i + t), e; } destroy() { this.removeListener(), this._downActionX = 0, this._moveActionX = 0, this._compareDirection = 0, this._compareIndex = 0, this._slideTabItems = [], this._activeTabItem = null; } _hasEditItem() { for (let e = 0; e < this._slideTabItems.length; e++) if (this._slideTabItems[e].isEditMode()) return !0; return !1; } _autoScrollFrame() { if (this._activeTabItem) switch (this._compareDirection = this._activeTabItem.translateX(this._moveActionX), this._compareDirection) { case 1: { this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX() + this._scrollIncremental), this._compareRight(); break; } case 0: { this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX() + this._scrollIncremental), this._compareIndex = this._activeTabItemIndex; break; } case -1: { this._slideScrollbar.scrollX(this._slideScrollbar.getScrollX() + this._scrollIncremental), this._compareLeft(); break; } } this._autoScrollTime = requestAnimationFrame(() => { this._autoScrollFrame(); }); } _startAutoScroll() { this._autoScrollTime == null && this._autoScrollFrame(); } _closeAutoScroll() { this._autoScrollTime && cancelAnimationFrame(this._autoScrollTime), this._autoScrollTime = null; } _scrollLeft(e) { const t = this.getBoundingRect(), n = e.pageX - t.x; n < this._leftBoundingLine && (this._scrollIncremental = -Math.min(Math.abs(n - this._leftBoundingLine) * 0.1, 50)); } _scrollRight(e) { const t = this.getBoundingRect(), n = e.pageX - t.x; n > t.width - this._rightBoundingLine && (this._scrollIncremental = Math.min(Math.abs(n - (t.width - this._rightBoundingLine)) * 0.1, 50)); } _sortedItems() { if (this._activeTabItem != null && this._activeTabItemIndex != null && this._compareIndex != null && (this._slideTabItems.splice(this._activeTabItemIndex, 1), this._slideTabItems.splice(this._compareIndex, 0, this._activeTabItem), this._config.slideTabBarItemAutoSort)) for (let e = 0; e < this._slideTabItems.length; e++) { const t = this._slideTabItems[e], n = this._slideTabItems[e + 1]; n && t.after(n); } } _compareLeft() { if (this._activeTabItem && this._activeTabItemIndex) { const e = this._slideTabItems.findIndex((i) => i.equals(this._activeTabItem)), t = this._slideTabItems.length, n = []; for (let i = 0; i < e && !(i >= e); i++) n.push(this._slideTabItems[i]); for (let i = e + 1; i < t; i++) this._slideTabItems[i].animate().translateX(0); let s = !0; for (let i = n.length - 1; i >= 0; i--) { const o = n[i]; br.leftLine(this._activeTabItem) < o.getMidLine() ? (o.animate().translateX(this._activeTabItem.getWidth()), this._compareIndex = i, s = !1) : (o.animate().translateX(0), s && (this._compareIndex = this._activeTabItemIndex)); } } } _compareRight() { if (this._activeTabItem) { const e = this._slideTabItems.findIndex((i) => i.equals(this._activeTabItem)), t = this._slideTabItems.length, n = []; for (let i = e + 1; i < t; i++) n.push(this._slideTabItems[i]); for (let i = 0; i < e; i++) this._slideTabItems[i].animate().translateX(0); let s = !0; for (let i = 0; i < n.length; i++) { const o = n[i]; br.rightLine(this._activeTabItem) > o.getMidLine() ? (o.animate().translateX(-this._activeTabItem.getWidth()), this._compareIndex = e + i + 1, s = !1) : (o.animate().translateX(0), s && (this._compareIndex = this._activeTabItemIndex)); } } } _initConfig() { var t; const e = this._slideTabBar.querySelectorAll( `.${(t = this._config.slideTabBarItemClassName) != null ? t : "slide-tab-item"}` ); this._downActionX = 0, this._moveActionX = 0, this._compareDirection = 0, this._compareIndex = 0, this._slideTabItems = br.make(e, this), this._activeTabItemIndex = this._config.currentIndex, this._activeTabItem = this._slideTabItems[this._activeTabItemIndex]; } }; /** Time in milliseconds to wait to raise long press events if button is still pressed */ w(qr, "LongPressDelay", 500), // in milliseconds /** Time in milliseconds with two consecutive clicks will be considered as a double click */ w(qr, "DoubleClickDelay", 300); let ss = qr; function oR() { var ve; const [r, e] = te([]), [t, n] = te(""), [s, i] = te(""), [o, l] = te(!1), [a, c] = te([0, 0]), d = xn({ slideTabBar: null }), u = xn(null), h = W(F), m = W(kr), f = W(Ee), g = W(tn), p = W(xr), S = W(tt, sc.OPTIONAL), b = W(ft), v = W(Ye), _ = Yt(b.resetOrder$), R = Wn(), I = W($e), y = On(() => { var Ze; const G = ((Ze = R.getActiveSheet()) == null ? void 0 : Ze.getSheetId()) || ""; n(G); const J = R.getSheets(), le = R.getActiveSheet(), fe = J.filter((lt) => !lt.isSheetHidden()).map((lt, Be) => { var xs; const we = b.getRule(R.getUnitId(), lt.getSheetId()), Ve = v.getSubunitRuleList(R.getUnitId(), lt.getSheetId()).length > 0, bt = (we == null ? void 0 : we.permissionId) || Ve ? /* @__PURE__ */ C.jsxs(C.Fragment, { children: [ /* @__PURE__ */ C.jsx(Yd, {}), /* @__PURE__ */ C.jsx("span", { children: lt.getName() }) ] }) : /* @__PURE__ */ C.jsx("span", { children: lt.getName() }); return { sheetId: lt.getSheetId(), label: bt, index: Be, selected: le === lt, color: (xs = lt.getTabColor()) != null ? xs : void 0 }; }); e(fe), n(G); }, [v, R, b]); be(() => { y(); const { slideTabBar: G, disconnectResizeObserver: J } = M(), le = V(), fe = [ N(), X(), Y() // When adding a sheet, it no longer slides, which has been uniformly handled in setupSlideTabBarUpdate ]; return () => { le.dispose(), G.destroy(), fe.forEach((Ze) => Ze.unsubscribe()), J && J(); }; }, [_, R]), be(() => { r.length > 0 && U(); }, [r]), be(() => { const G = mt( b.ruleChange$, v.ruleChange$ ).subscribe(() => { y(); }); return () => { G.unsubscribe(); }; }, [b, y]); const M = () => { const G = new ss({ slideTabBarClassName: Wt.slideTabBar, slideTabBarItemActiveClassName: Wt.slideTabActive, slideTabBarItemClassName: Wt.slideTabItem, slideTabBarSpanEditClassName: Wt.slideTabDivEdit, slideTabBarItemAutoSort: !0, slideTabBarContainer: u.current, currentIndex: 0, onChangeName: (le, fe) => { h.executeCommand(QS.id, { subUnitId: le, name: fe }); }, onSlideEnd: async (le, fe) => { await h.executeCommand(KS.id, { order: fe }); }, onChangeTab: (le, fe) => { h.executeCommand(et.id, { subUnitId: fe, unitId: R.getUnitId() }).then(() => { le.button === 2 && pe(!0); }); }, onScroll: (le) => { m.setScroll(le); }, onNameCheckAlert: (le) => T(le) || A(le) || H(le), onNameChangeCheck: () => { var we, Ve, pt, bt; const le = R.getUnitId(), fe = R == null ? void 0 : R.getActiveSheet(); if (!fe) throw new Error("No active sheet found"); const Ze = fe.getSheetId(), lt = b.getRule(le, Ze), Be = v.getSubunitRuleList(le, Ze).length > 0; return lt || Be ? (Ve = (we = I.getPermissionPoint(new vm(le).id)) == null ? void 0 : we.value) != null ? Ve : !1 : (bt = (pt = I.getPermissionPoint(new bm(le).id)) == null ? void 0 : pt.value) != null ? bt : !1; } }); d.current.slideTabBar = G; const J = ne(G); return { slideTabBar: G, disconnectResizeObserver: J }; }, P = p.getConfig(Qh), E = (ve = P == null ? void 0 : P.contextMenu) != null ? ve : !0, T = (G) => { if (G.trim() === "") { const J = "sheetNameEmptyAlert"; return g.open({ id: J, title: { title: f.t("sheetConfig.sheetNameErrorTitle") }, children: { title: f.t("sheetConfig.sheetNameCannotIsEmptyError") }, cancelText: f.t("button.cancel"), confirmText: f.t("button.confirm"), onClose() { x(), g.close(J); }, onConfirm() { x(), g.close(J); } }), !0; } return !1; }, A = (G) => { if (!Up(G)) { const J = "sheetNameSpecCharAlert"; return g.open({ id: J, title: { title: f.t("sheetConfig.sheetNameErrorTitle") }, children: { title: f.t("sheetConfig.sheetNameSpecCharError") }, cancelText: f.t("button.cancel"), confirmText: f.t("button.confirm"), onClose() { x(), g.close(J); }, onConfirm() { x(), g.close(J); } }), !0; } return !1; }, H = (G) => { const J = R.getActiveSheet(); if ((J == null ? void 0 : J.getName()) === G) return !1; const fe = R.checkSheetName(G); if (fe) { const Ze = "sheetNameRepeatAlert"; g.open({ id: Ze, title: { title: f.t("sheetConfig.sheetNameErrorTitle") }, children: { title: f.t("sheetConfig.sheetNameAlreadyExistsError") }, cancelText: f.t("button.cancel"), confirmText: f.t("button.confirm"), onClose() { g.close(Ze), x(); }, onConfirm() { g.close(Ze), x(); } }); } return fe; }, x = () => { setTimeout(() => { var J; const G = (J = d.current.slideTabBar) == null ? void 0 : J.getActiveItem(); G && (G.focus(), G.selectAll()); }, 0); }, k = () => { var G, J; (J = (G = d.current.slideTabBar) == null ? void 0 : G.getActiveItem()) == null || J.setEditor(); }, U = () => { var J; const G = r.findIndex((le) => le.selected); (J = d.current.slideTabBar) == null || J.update(G); }, V = () => h.onCommandExecuted((G) => { switch (G.id) { case JS.id: case nr.id: case An.id: case Rd.id: case Nr.id: case wd.id: case et.id: y(); break; } }), N = () => m.scroll$.subscribe((G) => { ie(G); }), X = () => m.scrollX$.subscribe((G) => { var J; (J = d.current.slideTabBar) == null || J.flipPage(G); }), Y = () => m.renameId$.subscribe(() => { k(); }), ie = (G) => { const { leftEnd: J, rightEnd: le } = G; let fe = ""; J && le ? fe = "" : J && !le ? fe = "inset -10px 0px 10px -10px rgba(0, 0, 0, 0.2)" : !J && le ? fe = "inset 10px 0px 10px -10px rgba(0, 0, 0, 0.2)" : !J && !le && (fe = "inset 10px 0px 10px -10px rgba(0, 0, 0, 0.2), inset -10px 0px 10px -10px rgba(0, 0, 0, 0.2)"), i(fe); }, he = (G) => { const J = G.calculateActiveTabItemScrollX(); if (J) { const le = G.getScrollbar(); le.scrollX(le.getScrollX() + J); } m.setScroll({ leftEnd: G.isLeftEnd(), rightEnd: G.isRightEnd() }); }, ne = (G) => { var fe; const J = (fe = u.current) == null ? void 0 : fe.querySelector(`.${Wt.slideTabBar}`); if (!J) return; const le = new ResizeObserver(() => { he(G); }); return le.observe(J), () => le.disconnect(); }, pe = (G) => { var J, le, fe, Ze, lt; if (E && !(S != null && S.isForceKeepVisible())) { if (G) { const { left: Be } = (le = (J = u.current) == null ? void 0 : J.getBoundingClientRect()) != null ? le : {}, { left: we } = (lt = (Ze = (fe = d.current.slideTabBar) == null ? void 0 : fe.getActiveItem()) == null ? void 0 : Ze.getSlideTabItem().getBoundingClientRect()) != null ? lt : {}; Be !== void 0 && we !== void 0 && c([we - Be, 0]); } l(G); } }; return /* @__PURE__ */ C.jsx( ei, { className: Wt.slideTabItemDropdown, visible: o, align: { offset: a }, trigger: ["contextMenu"], overlay: /* @__PURE__ */ C.jsx( wS, { menuType: Ct.FOOTER_TABS, onOptionSelect: (G) => { const { label: J, value: le, commandId: fe } = G; h.executeCommand(fe != null ? fe : J, { value: le, subUnitId: t }), l(!1); } } ), onVisibleChange: pe, children: /* @__PURE__ */ C.jsx( "div", { className: Wt.slideTabBarContainer, ref: u, onDragStart: (G) => G.preventDefault(), onContextMenu: (G) => G.preventDefault(), children: /* @__PURE__ */ C.jsx("div", { className: Wt.slideTabBar, style: { boxShadow: s }, children: r.map((G) => /* @__PURE__ */ at(tR, { ...G, key: G.sheetId, selected: t === G.sheetId })) }) } ) } ); } const lR = 100, aR = () => { var g, p; const [r, e] = te(!0), [t, n] = te(!0), s = W(F), i = W(kr), o = W($e), a = Wn().getUnitId(), c = Yt(o.getPermissionPoint$((g = new q(a)) == null ? void 0 : g.id)), d = Yt(o.getPermissionPoint$((p = new _m(a)) == null ? void 0 : p.id)); be(() => { const S = i.scroll$.subscribe((b) => { u(b); }); return () => { S.unsubscribe(); }; }, []); const u = (S) => { const { leftEnd: b, rightEnd: v } = S; e(b), n(v); }, h = () => { s.executeCommand($S.id), setTimeout(() => { i.setAddSheet(0); }, 0); }, m = () => { i.setScrollX(-100); }, f = () => { i.setScrollX(lR); }; return /* @__PURE__ */ C.jsxs("div", { className: to.sheetBar, children: [ /* @__PURE__ */ C.jsxs("div", { className: to.sheetBarOptions, children: [ /* @__PURE__ */ C.jsx(po, { onClick: h, disabled: !(d != null && d.value && (c != null && c.value)), children: /* @__PURE__ */ C.jsx(zd, {}) }), /* @__PURE__ */ C.jsx(Z0, {}) ] }), /* @__PURE__ */ C.jsx(oR, {}), (!r || !t) && /* @__PURE__ */ C.jsxs( "div", { className: ` ${to.sheetBarOptions} ${to.sheetBarOptionsDivider} `, children: [ /* @__PURE__ */ C.jsx(po, { disabled: r, onClick: m, children: /* @__PURE__ */ C.jsx(Vc, { style: { transform: "rotateZ(180deg)" } }) }), /* @__PURE__ */ C.jsx(po, { disabled: t, onClick: f, children: /* @__PURE__ */ C.jsx(Vc, {}) }) ] } ) ] }); }; class lg { constructor() { w(this, "_functions", [ { func: Fe.MAX, filter: (e) => { var t, n, s, i; return ((n = (t = e.values.find((o) => o.func === Fe.COUNTA)) == null ? void 0 : t.value) != null ? n : 0) > 1 && ((i = (s = e.values.find((o) => o.func === Fe.COUNT)) == null ? void 0 : s.value) != null ? i : 0) > 0; } }, { func: Fe.MIN, filter: (e) => { var t, n, s, i; return ((n = (t = e.values.find((o) => o.func === Fe.COUNTA)) == null ? void 0 : t.value) != null ? n : 0) > 1 && ((i = (s = e.values.find((o) => o.func === Fe.COUNT)) == null ? void 0 : s.value) != null ? i : 0) > 0; } }, { func: Dl.SUM, filter: (e) => { var t, n, s, i; return ((n = (t = e.values.find((o) => o.func === Fe.COUNTA)) == null ? void 0 : t.value) != null ? n : 0) > 1 && ((i = (s = e.values.find((o) => o.func === Fe.COUNT)) == null ? void 0 : s.value) != null ? i : 0) > 0; } }, { func: Fe.COUNTA, filter: (e) => { var t, n; return ((n = (t = e.values.find((s) => s.func === Fe.COUNTA)) == null ? void 0 : t.value) != null ? n : 0) > 1; } }, { func: Fe.COUNT, filter: (e) => { var t, n, s, i; return ((n = (t = e.values.find((o) => o.func === Fe.COUNTA)) == null ? void 0 : t.value) != null ? n : 0) > 1 && ((i = (s = e.values.find((o) => o.func === Fe.COUNT)) == null ? void 0 : s.value) != null ? i : 0) > 0; } }, { func: Fe.AVERAGE, filter: (e) => { var t, n, s, i; return ((n = (t = e.values.find((o) => o.func === Fe.COUNTA)) == null ? void 0 : t.value) != null ? n : 0) > 1 && ((i = (s = e.values.find((o) => o.func === Fe.COUNT)) == null ? void 0 : s.value) != null ? i : 0) > 0; } } ]); w(this, "_state$", new Me(null)); w(this, "state$", this._state$.asObservable()); } dispose() { this._state$.complete(); } setState(e) { var n; const t = { values: [], pattern: null }; e == null || e.values.forEach((s) => { const i = this._functions.find((o) => o.func === s.func); i && (i.filter === void 0 || i.filter(e)) && t.values.push(s); }), t.pattern = (n = e == null ? void 0 : e.pattern) != null ? n : null, this._state$.next(t); } getState() { return this._state$.getValue(); } getFunctions() { return this._functions; } addFunctions(e) { this._functions.push(...e); } } const da = gn("univer.sheet-status-bar.service"), cR = "univer-status-bar", dR = "univer-single-mode", uR = "univer-status-bar-div", hR = "univer-statistic-list", mR = "univer-statistic-list-column", fR = "univer-statistic-item", gR = "univer-statistic-picker", pR = "univer-statistic-picker-item", SR = "univer-statistic-more", zr = { statusBar: cR, singleMode: dR, statusBarDiv: uR, statisticList: hR, statisticListColumn: mR, statisticItem: fR, statisticPicker: gR, statisticPickerItem: pR, statisticMore: SR }, CR = [ Dl.SUM, Fe.AVERAGE, Fe.MIN, Fe.MAX ], Da = { [Dl.SUM]: "statusbar.sum", [Fe.AVERAGE]: "statusbar.average", [Fe.MIN]: "statusbar.min", [Fe.MAX]: "statusbar.max", [Fe.COUNT]: "statusbar.count", [Fe.COUNTA]: "statusbar.countA", [EC.CONCATENATE]: "concatenate" }, La = (r) => { const e = W(Ee), t = W(Kh), n = W(wl), s = vR(r), i = async () => { await n.writeText(r.value.toString()), t.show({ type: Ym.Success, content: e.t("statusbar.copied") }); }; return /* @__PURE__ */ C.jsx(Gn, { title: e.t("statusbar.clickToCopy"), placement: "top", children: /* @__PURE__ */ C.jsx("div", { className: zr.statisticItem, onClick: i, children: /* @__PURE__ */ C.jsx("span", { children: `${e.t( (Da == null ? void 0 : Da[r.name]) || r.name )}: ${s}` }) }, r.name) }); }; function vR(r) { const { pattern: e, value: t } = r; return typeof t != "number" ? 0 : t >= 1e8 ? t.toExponential(2) : e && CR.includes(r.name) ? er.format(e, t, { throws: !1 }) : t.toLocaleString(); } const fh = 800, bR = 3, _R = () => { const [r, e] = te(window.innerWidth < fh), [t, n] = te(!0), s = W(da), i = s.getFunctions().map((h, m) => ({ name: h.func, value: 0, show: !0, disable: !1, pattern: null })), [o, l] = te(i), a = o.find((h) => h.show && !h.disable), c = r && a ? [a] : o.filter((h) => h.show && !h.disable); be(() => { const h = s.state$.subscribe((m) => { const f = m == null ? void 0 : m.values; if (!f || f.length === 0) n(!1); else { n(!0); const g = o.map((p) => { var b; const S = f.find((v) => v.func === p.name); return S ? (p.value = S.value, p.disable = !1) : p.disable = !0, p.pattern = (b = m == null ? void 0 : m.pattern) != null ? b : null, p; }); l(g); } }); return () => { h.unsubscribe(); }; }, [s]); const d = Fh(() => { const h = window.innerWidth < fh; r !== h && e(h); }, 100); be(() => (window.addEventListener("resize", d), () => { window.removeEventListener("resize", d); }), [r]); let u = null; if (c.length > bR) { const h = []; c.forEach((m, f) => { f % 2 === 0 && h.push(c.slice(f, f + 2)); }), u = /* @__PURE__ */ C.jsxs(C.Fragment, { children: [ " ", h.map((m, f) => /* @__PURE__ */ C.jsxs("div", { className: zr.statisticListColumn, children: [ (m == null ? void 0 : m[0]) && /* @__PURE__ */ C.jsx(La, { ...m == null ? void 0 : m[0] }, m == null ? void 0 : m[0].name), (m == null ? void 0 : m[1]) && /* @__PURE__ */ C.jsx(La, { ...m == null ? void 0 : m[1] }, m == null ? void 0 : m[1].name) ] }, `stat-col-${f}`)), " " ] }); } else u = /* @__PURE__ */ C.jsx(C.Fragment, { children: c.map((h) => /* @__PURE__ */ C.jsx(La, { ...h }, h.name)) }); return t && /* @__PURE__ */ C.jsxs( "div", { className: st(zr.statusBar, { [zr.singleMode]: r }), children: [ /* @__PURE__ */ C.jsx("div", { className: st(zr.statisticList), children: u }), /* @__PURE__ */ C.jsx("div", { className: zr.statusBarDiv }) ] } ); }; function wR() { const r = W(id), e = Wn(), t = r.getMenuByPositionKey(Ct.FOOTER_MENU); return e ? /* @__PURE__ */ C.jsxs("section", { className: af.sheetContainer, "data-range-selector": !0, children: [ /* @__PURE__ */ C.jsx(aR, {}), /* @__PURE__ */ C.jsx(_R, {}), t.map((n) => { var s; return (s = n.children) == null ? void 0 : s.map((i) => (i == null ? void 0 : i.item) && /* @__PURE__ */ C.jsx( RS, { align: { offset: [-32, 18] }, ...i.item }, i.key )); }), /* @__PURE__ */ C.jsx(Kw, {}) ] }) : null; } function RR() { return ag() ? /* @__PURE__ */ C.jsx(w0, {}) : null; } function IR() { return ag() ? /* @__PURE__ */ C.jsxs(C.Fragment, { children: [ /* @__PURE__ */ C.jsx(t0, {}), /* @__PURE__ */ C.jsx(N0, {}) ] }) : null; } function ag() { const r = W(L), t = !!Yt(() => r.getCurrentTypeOfUnit$(O.UNIVER_SHEET), null, !1, []); return sn( () => r.getAllUnitsForType(O.UNIVER_SHEET).length > 0, // eslint-disable-next-line react-hooks/exhaustive-deps [r, t] ); } const Pr = "sheets-ui.config", Lc = { formulaBar: !0 }; function yR(r) { const e = r.get(fc), t = ue(r, { workbookTypes: [q], worksheetTypes: [ee, ze], rangeTypes: [re] }); return { id: pc.id, icon: new it((n) => { const s = "AllBorderSingle", i = r.get(fc), o = r.get(F).onCommandExecuted((l) => { var h; if (l.id !== pc.id) return; const { type: c } = i.getBorderInfo(), d = ng.find((m) => m.value === c), u = (h = d == null ? void 0 : d.icon) != null ? h : s; n.next(u); }); return n.next(s), o.dispose; }), tooltip: "toolbar.border.main", type: Q.BUTTON_SELECTOR, selections: [ { label: { name: $d, hoverable: !1 }, value$: e.borderInfo$ } ], value$: e.borderInfo$, hidden$: oe(r, O.UNIVER_SHEET), disabled$: t }; } const So = "sheet.menu.clear-selection"; function Wa(r) { return { id: So, type: Q.SUBITEMS, icon: "ClearFormat", title: "rightClick.clearSelection", hidden$: oe(r, O.UNIVER_SHEET) }; } function Ba(r) { return { id: Xs.id, type: Q.BUTTON, title: "rightClick.clearContent", disabled$: Es(r, ue(r, { workbookTypes: [q], worksheetTypes: [ee, Ut], rangeTypes: [re] })), hidden$: oe(r, O.UNIVER_SHEET) }; } function Fa(r) { return { id: zs.id, type: Q.BUTTON, title: "rightClick.clearFormat", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, ze], rangeTypes: [re] }), hidden$: oe(r, O.UNIVER_SHEET) }; } function Ua(r) { return { id: mo.id, type: Q.BUTTON, title: "rightClick.clearAll", disabled$: Es(r, ue(r, { workbookTypes: [q], worksheetTypes: [ee, Ut, ze], rangeTypes: [re] })), hidden$: oe(r, O.UNIVER_SHEET) }; } const cg = "sheet.menu.delete"; function MR(r) { return { id: cg, type: Q.SUBITEMS, title: "rightClick.delete", icon: "Reduce", hidden$: Es(r, Jl(r)), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee] }) }; } function gh(r) { return { id: pi.id, type: Q.BUTTON, icon: "DeleteColumn", title: "rightClick.deleteSelectedColumn", hidden$: Es(r, Of(r, "col")), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, eC] }) }; } function ph(r) { return { id: gi.id, type: Q.BUTTON, icon: "DeleteRow", title: "rightClick.deleteSelectedRow", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, tC] }), hidden$: Of(r, "row") }; } function PR(r) { return { id: Xi.id, type: Q.BUTTON, title: "rightClick.moveLeft", icon: "DeleteCellShiftLeft", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee], rangeTypes: [re] }), hidden$: $l(r, "col") }; } function ER(r) { return { id: ms.id, type: Q.BUTTON, title: "rightClick.moveUp", icon: "DeleteCellShiftUp", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee], rangeTypes: [re] }), hidden$: $l(r, "row") }; } function TR(r) { const e = r.get(F), t = r.get(L); return { id: wm.id, type: Q.BUTTON, tooltip: "toolbar.toggleGridlines", icon: "HideGridlines", activated$: new it((n) => { const s = () => { const o = t.getCurrentUnitForType(O.UNIVER_SHEET); return o ? o.getActiveSheet().getConfig().showGridlines === Qe.TRUE : !1; }, i = new St(); return i.add(e.onCommandExecuted((o) => { (o.id === nC.id || o.id === et.id) && n.next(s()); })), i.add(t.getCurrentTypeOfUnit$(O.UNIVER_SHEET).subscribe(() => { n.next(s()); })), n.next(s()), () => i.dispose(); }), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee] }) }; } const dg = "sheet.menu.col-insert"; function xR(r) { return { id: dg, type: Q.SUBITEMS, title: "rightClick.insert", icon: "Insert", hidden$: Jl(r), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee, Hl] }) }; } const ug = "sheet.menu.row-insert"; function OR(r) { return { id: ug, type: Q.SUBITEMS, title: "rightClick.insert", icon: "Insert", hidden$: Jl(r), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [Id, ee], rangeTypes: [re] }) }; } const hg = "sheet.menu.cell-insert"; function AR(r) { return { id: hg, type: Q.SUBITEMS, title: "rightClick.insert", icon: "Insert", hidden$: Es(r, Jl(r)), disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [Hl, ee], rangeTypes: [re] }) }; } function Sh(r) { return { id: Sc.id, type: Q.BUTTON, title: "rightClick.insertRowBefore", icon: "InsertRowAbove", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [Id, ee], rangeTypes: [re] }), hidden$: xf(r, "row") }; } function NR(r) { return { id: Rm.id, type: Q.BUTTON, title: "rightClick.insertRow", icon: "InsertRowBelow", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [Id, ee], rangeTypes: [re] }), hidden$: Tf(r, "row") }; } function Ch(r) { return { id: Cc.id, type: Q.BUTTON, title: "rightClick.insertColumnBefore", icon: "LeftInsertColumn", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [Hl, ee], rangeTypes: [re] }), hidden$: xf(r, "col") }; } function HR(r) { return { id: Im.id, type: Q.BUTTON, title: "rightClick.insertColumn", icon: "RightInsertColumn", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [Hl, ee], rangeTypes: [re] }), hidden$: Tf(r, "col") }; } function VR(r) { return { id: zi.id, type: Q.BUTTON, title: "rightClick.moveRight", icon: "InsertCellShiftRight", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee], rangeTypes: [re] }), hidden$: $l(r, "col") }; } function kR(r) { return { id: fs.id, type: Q.BUTTON, title: "rightClick.moveDown", icon: "InsertCellDown", disabled$: ue(r, { workbookTypes: [q], worksheetTypes: [ee], rangeTypes: [re] }), hidden$: $l(r, "row") }; } function DR(r) { const e = ue(r, { workbookTypes: [q], worksheetTypes: [ee, Ut, ze], rangeTypes: [re] }), t = n_(r); return { id: or.id, icon: "MergeAllSingle", tooltip: "toolbar.mergeCell.main", type: Q.SUBITEMS, // selections: [...MERGE_CHILDREN], hidden$: oe(r, O.UNIVER_SHEET), disabled$: e.pipe( ir(t), _e(([n, s]) => n || s) ) }; } function LR(r) { return { id: Gd.id, type: Q.BUTTON, title: "merge.all", icon: "MergeAllSingle", hidden$: oe(r, O.UNIVER_SHEET) }; } function WR(r) { return { id: qd.id, type: Q.BUTTON, title: "merge.vertical", icon: "VerticalIntegrationSingle", hidden$: oe(r, O.UNIVER_SHEET) }; } function BR(r) { return { id: Qd.id, type: Q.BUTTON, title: "merge.horizontal", icon: "HorizontalMergeSingle", hidden$: oe(r, O.UNIVER_SHEET) }; } function FR(r) { return { id: ym.id, type: Q.BUTTON, title: "merge.cancel", icon: "CancelMergeSingle", hidden$: oe(r, O.UNIVER_SHEET) }; } function UR(r) { const t = r.get(L).getCurrentTypeOfUnit$(O.UNIVER_SHEET), n = r.get(Dt); return ot([t, n.currentUser$]).pipe( We(([s, i]) => s ? s.activeSheet$.pipe( We((o) => { if (!o) return Ie(!0); const l = r.get(Ye), a = r.get(ft), c = r.get($); return mt( c.selectionMoveEnd$, l.ruleChange$, a.ruleChange$ ).pipe( _e(() => { const d = s.getUnitId(), u = o.getSheetId(), h = l.getSubunitRuleList(d, u), m = c.getCurrentSelections(), f = m == null ? void 0 : m.map((S) => S.range), g = h.map((S) => S.ranges).flat(); if (!f) return !1; const p = a.getRule(d, u); return p != null && p.permissionId ? !0 : f == null ? void 0 : f.some((S) => g.some((b) => ae.intersects(S, b))); }) ); }) ) : Ie(!0)) ); } function jR(r) { const e = r.get(L), t = r.get(Ye), n = e.getCurrentTypeOfUnit$(O.UNIVER_SHEET), s = r.get(Dt); return ot([n, s.currentUser$]).pipe( We(([i, o]) => i ? i.activeSheet$.pipe( We((l) => { if (!l) return Ie(!0); const a = r.get(Ye), c = r.get(ft), d = r.get($e), u = r.get($); return mt( u.selectionMoveEnd$, a.ruleChange$, c.ruleChange$ ).pipe( _e(() => { var M, P; const h = i.getUnitId(), m = l.getSheetId(), f = t.getSubunitRuleList(h, m), g = (M = u.getCurrentSelections()) == null ? void 0 : M.map((E) => E.range); if (f.map((E) => E.ranges).flat(), !(g != null && g.length) || g.length > 1) return !0; const p = g[0]; if ((p == null ? void 0 : p.rangeType) === j.ALL || (p == null ? void 0 : p.rangeType) === j.COLUMN || (p == null ? void 0 : p.rangeType) === j.ROW) return !0; const S = c.getRule(h, m); if (S != null && S.permissionId) return ((P = d.getPermissionPoint(new rC(h, m).id)) == null ? void 0 : P.value) === !1; if (f.filter((E) => E.ranges.some((T) => ae.intersects(T, p))).length !== 1) return !0; const { startRow: v, endRow: _, startColumn: R, endColumn: I } = p, y = r.get(Vl); for (let E = v; E <= _; E++) for (let T = R; T <= I; T++) { const A = y.getCellInfo(h, m, E, T); if (A) return A[ad.ManageCollaborator] === !1; } return !1; }) ); }) ) : Ie(!0)) ); } function XR(r) { const e = r.get(L), t = r.get($e), n = e.getCurrentTypeOfUnit$(O.UNIVER_SHEET), s = r.get(Dt); return ot([n, s.currentUser$]).pipe( We(([i, o]) => i ? i.activeSheet$.pipe( We((l) => { var f; if (!l) return Ie(!0); const a = i.getUnitId(), c = r.get($), d = r.get(Ye), u = r.get(ft), h = (f = t.composePermission$([new q(a).id]).pipe(_e((g) => g.every((p) => p.value)))) != null ? f : Ie(!1), m = mt( d.ruleChange$, u.ruleChange$ ).pipe( Vt(null) ); return ot([h, m, c.selectionMoveEnd$]).pipe( _e(([g, p, S]) => { if (!g) return !0; const b = c.getCurrentSelections(), v = b == null ? void 0 : b.map((_) => _.range); return v != null && v.length ? v.length > 1 : !1; }) ); }) ) : Ie(!0)) ); } function mg(r) { var c; const e = r.get(L), t = r.get($e), n = e.getCurrentTypeOfUnit$(O.UNIVER_SHEET), s = r.get(Dt), i = r.has(tt) ? r.get(tt) : null, l = r.get(Ne).subscribeContextValue$(Ht), a = (c = i == null ? void 0 : i.visible$) != null ? c : Ie(null); return ot([n, s.currentUser$, a, l]).pipe( We(([d, u, h, m]) => !d || h != null && h.visible && h.unitId === d.getUnitId() || m ? Ie(!0) : d.activeSheet$.pipe( We((f) => { var M; if (!f) return Ie(!0); const p = r.get(Ne).subscribeContextValue$(Cl).pipe(Vt(!1)), S = d.getUnitId(), b = f.getSheetId(), v = r.get(Ye), _ = r.get(ft), R = r.get($), I = (M = t.composePermission$([new kl(S).id]).pipe(_e((P) => P.every((E) => E.value)))) != null ? M : Ie(!1), y = mt( v.ruleChange$, _.ruleChange$ ).pipe( Vt(null) ); return ot([I, y, R.selectionMoveEnd$, p]).pipe( _e(([P, E, T, A]) => { if (!P || A) return !0; const H = R.getCurrentSelections(), x = H == null ? void 0 : H.map((N) => N.range); if (!(x != null && x.length)) return !0; const k = _.getRule(S, b); if (k != null && k.permissionId) return !0; const U = v.getSubunitRuleList(S, b); return x == null ? void 0 : x.some((N) => U.some((X) => X.ranges.some((Y) => ae.intersects(N, Y)))); }) ); }) )) ); } function zR(r) { const e = r.get(L), t = r.get($e), n = e.getCurrentTypeOfUnit$(O.UNIVER_SHEET), s = r.get(Dt); return ot([n, s.currentUser$]).pipe( We(([i, o]) => i ? i.activeSheet$.pipe( We((l) => { var f; if (!l) return Ie(!0); const a = i.getUnitId(), c = l.getSheetId(), d = r.get(Ye), u = r.get(ft), h = (f = t.composePermission$([new kl(a).id]).pipe(_e((g) => g.every((p) => p.value)))) != null ? f : Ie(!1), m = mt( d.ruleChange$, u.ruleChange$ ).pipe( Vt(null) ); return ot([h, m]).pipe( _e(([g, p]) => { var v; if (!g) return !0; const S = u.getRule(a, c); return S != null && S.permissionId ? !0 : ((v = d.getSubunitRuleList(a, c)) == null ? void 0 : v.filter((_) => _ == null ? void 0 : _.permissionId)).length > 0; }) ); }) ) : Ie(!0)) ); } function YR(r) { const e = r.get(L), t = r.get($e), n = e.getCurrentTypeOfUnit$(O.UNIVER_SHEET), s = r.get(Dt); return ot([n, s.currentUser$]).pipe( We(([i, o]) => i ? i.activeSheet$.pipe( We((l) => { if (!l) return Ie(!0); const a = i.getUnitId(), c = l.getSheetId(), d = r.get(ft); return d.ruleChange$.pipe(Vt(null)).pipe( _e(() => { var h; return d.getRule(a, c) ? ((h = t.getPermissionPoint(new Mm(a, c).id)) == null ? void 0 : h.value) === !1 : !0; }) ); }) ) : Ie(!0)) ); } function ZR(r) { const e = r.get(L), t = r.get($e), n = e.getCurrentTypeOfUnit$(O.UNIVER_SHEET), s = r.get(Dt); return ot([n, s.currentUser$]).pipe( We(([i, o]) => i ? i.activeSheet$.pipe( We((l) => { var f; if (!l) return Ie(!0); const a = i.getUnitId(), c = r.get(Ye), d = r.get(ft), u = (f = t.composePermission$([new kl(a).id, new vm(a).id]).pipe(_e((g) => g.every((p) => p.value)))) != null ? f : Ie(!1), h = d.ruleChange$.pipe(Vt(null)), m = c.ruleChange$.pipe(Vt(null)); return ot([u, h, m]).pipe( _e(([g, p, S]) => { if (!g) return !0; const b = l.getSheetId(), v = d.getRule(a, b), _ = c.getSubunitRuleList(a, b); return !(v || _.length); }) ); }) ) : Ie(!0)) ); } function GR(r) { const e = r.get(L), t = r.get($e), n = e.getCurrentTypeOfUnit$(O.UNIVER_SHEET), s = r.get(Dt); return ot([n, s.currentUser$]).pipe( We(([i, o]) => i ? i.activeSheet$.pipe( We((l) => { if (!l) return Ie(!0); const a = i.getUnitId(), c = l.getSheetId(), d = r.get($), u = r.get(Ye), h = r.get(ft), m = mt( u.ruleChange$, h.ruleChange$, d.selectionMoveEnd$ ).pipe(Vt(null)); return ot([m]).pipe( _e(([f]) => { var P; const g = r.get($).getCurrentSelections(), p = g == null ? void 0 : g.map((E) => E.range); if (!(p != null && p.length) || p.length > 1) return !0; const S = p[0]; if ((S == null ? void 0 : S.rangeType) === j.ALL || (S == null ? void 0 : S.rangeType) === j.COLUMN || (S == null ? void 0 : S.rangeType) === j.ROW) return !0; const b = h.getRule(a, c); if (b != null && b.permissionId) return ((P = t.getPermissionPoint(new Mm(a, c).id)) == null ? void 0 : P.value) === !1; if (u.getSubunitRuleList(a, c).filter((E) => E.ranges.some((T) => ae.intersects(T, S))).length !== 1) return !0; const { startRow: _, endRow: R, startColumn: I, endColumn: y } = S, M = r.get(Vl); for (let E = _; E <= R; E++) for (let T = I; T <= y; T++) { const A = M.getCellInfo(a, c, E, T); if (A) return A[ad.Delete] === !1; } return !1; }) ); }) ) : Ie(!0)) ); } function fg(r) { var c; const e = r.get(L), t = r.get($e), n = e.getCurrentTypeOfUnit$(O.UNIVER_SHEET), s = r.get(Dt), i = r.has(tt) ? r.get(tt) : null, l = r.get(Ne).subscribeContextValue$(Ht), a = (c = i == null ? void 0 : i.visible$) != null ? c : Ie(null); return ot([n, s.currentUser$, a, l]).pipe( We(([d, u, h, m]) => !d || h != null && h.visible && h.unitId === d.getUnitId() || m ? Ie(!0) : d.activeSheet$.pipe( We((f) => { var S, b; if (!f) return Ie(!0); const g = d.getUnitId(); return ((b = (S = t.getPermissionPoint$(new q(g).id)) == null ? void 0 : S.pipe(_e((v) => !!v.value))) != null ? b : Ie(!1)).pipe( _e((v) => !v) ); }) )) ); } const Co = "sheet.contextMenu.permission"; function qR(r) { return { id: ta.id, type: Q.BUTTON, icon: Jf, tooltip: "permission.toolbarMenu", hidden$: oe(r, O.UNIVER_SHEET), disabled$: mg(r) }; } function ja(r) { return { id: Co, type: Q.SUBITEMS, title: "rightClick.protectRange", icon: $f, hidden$: oe(r, O.UNIVER_SHEET) }; } function Xa(r) { return { id: es.id, type: Q.BUTTON, title: "rightClick.turnOnProtectRange", hidden$: UR(r), disabled$: mg(r) }; } function za(r) { return { id: rs.id, type: Q.BUTTON, title: "rightClick.editProtectRange", disabled$: XR(r), hidden$: jR(r) }; } function Ya(r) { return { id: ns.id, type: Q.BUTTON, title: "rightClick.removeProtectRange", disabled$: GR(r), hidden$: oe(r, O.UNIVER_SHEET) }; } function Za(r) { return { id: ts.id, type: Q.BUTTON, title: "rightClick.viewAllProtectArea", disabled$: fg(r), hidden$: oe(r, O.UNIVER_SHEET) }; } function QR(r) { return { id: na.id, type: Q.BUTTON, title: "sheetConfig.addProtectSheet", disabled$: zR(r), hidden$: oe(r, O.UNIVER_SHEET) }; } function KR(r) { return { id: oa.id, type: Q.BUTTON, title: "sheetConfig.removeProtectSheet", disabled$: YR(r), hidden$: oe(r, O.UNIVER_SHEET) }; } function JR(r) { return { id: la.id, type: Q.BUTTON, title: "sheetConfig.changeSheetPermission", disabled$: ZR(r), hidden$: oe(r, O.UNIVER_SHEET) }; } function $R(r) { return { id: ra.id, type: Q.BUTTON, title: "sheetConfig.viewAllProtectArea", disabled$: fg(r), hidden$: oe(r, O.UNIVER_SHEET) }; } function eI(r) { const e = r.get(L), t = r.get(F), n = new it((i) => { const o = t.onCommandExecuted((l) => { const a = l.id; (a === An.id || a === Nr.id || a === nr.id) && Go(e, i); }); return Go(e, i), o.dispose; }), s = Ts(r, [q, sC]); return { id: sa.id, type: Q.BUTTON, title: "sheetConfig.delete", disabled$: ot([n, s]).pipe( _e(([i, o]) => i || o) ), hidden$: oe(r, O.UNIVER_SHEET) }; } function tI(r) { return { id: Pm.id, type: Q.BUTTON, title: "sheetConfig.copy", disabled$: Ts(r, [q, _m]), hidden$: oe(r, O.UNIVER_SHEET) }; } function nI(r) { return { id: aa.id, type: Q.BUTTON, title: "sheetConfig.rename", disabled$: Ts(r, [q, bm]), hidden$: oe(r, O.UNIVER_SHEET) }; } function rI(r) { return { id: Em.id, title: "sheetConfig.changeColor", type: Q.SELECTOR, selections: [ { label: { name: Fi, hoverable: !1 } } ], hidden$: Ts(r, [q]) }; } function sI(r) { const e = r.get(L), t = r.get(F); return { id: Tm.id, type: Q.BUTTON, title: "sheetConfig.hide", disabled$: new it((n) => { const s = t.onCommandExecuted((i) => { const o = i.id; (o === An.id || o === Nr.id || o === nr.id) && Go(e, n); }); return Go(e, n), s.dispose; }).pipe( ir(Ts(r, [q, xm])), _e(([n, s]) => n || s) ), hidden$: oe(r, O.UNIVER_SHEET) }; } function iI(r) { const e = r.get(L), t = r.get(F); return { id: ia.id, type: Q.BUTTON, title: "sheetConfig.unhide", disabled$: new it((n) => { function s() { const o = e.getCurrentUnitForType(O.UNIVER_SHEET).getWorksheets(), l = Array.from(o.values()); n.next(l.length === 1); } const i = t.onCommandExecuted((o) => { const l = o.id; (l === An.id || l === Nr.id || l === nr.id) && s(); }); return s(), i.dispose; }).pipe( ir(Ts(r, [q, xm])), _e(([n, s]) => n || s) ), hidden$: oe(r, O.UNIVER_SHEET) }; } function Go(r, e) { const t = r.getCurrentUnitForType(O.UNIVER_SHEET).getWorksheets(), n = Array.from(t.values()).filter( (s) => s.getConfig().hidden === Qe.FALSE ); e.next(n.length === 1); } const oI = { [ha.FORMAT]: { [Bi.id]: { order: 0, menuItemFactory: wb }, [Rs.id]: { order: 1, menuItemFactory: Rb }, [Is.id]: { order: 2, menuItemFactory: Ib }, [ys.id]: { order: 3, menuItemFactory: yb }, [Ms.id]: { order: 4, menuItemFactory: Mb }, [zl.id]: { order: 5, menuItemFactory: Pb }, [Xl.id]: { order: 6, menuItemFactory: Eb }, [di.id]: { order: 7, menuItemFactory: xb, [iC.id]: { order: 0, menuItemFactory: Tb } }, [Mo.id]: { order: 9, menuItemFactory: Ab, [am.id]: { order: 0, menuItemFactory: Ob } }, [pc.id]: { order: 10, menuItemFactory: yR } }, [ha.LAYOUT]: { [oC.id]: { order: 0, menuItemFactory: DR, [lC.id]: { order: 0, menuItemFactory: LR }, [aC.id]: { order: 1, menuItemFactory: WR }, [cC.id]: { order: 2, menuItemFactory: BR }, [ym.id]: { order: 3, menuItemFactory: FR } }, [lc.id]: { order: 1, menuItemFactory: Nb }, [ac.id]: { order: 1, menuItemFactory: Hb }, [cc.id]: { order: 2, menuItemFactory: Vb }, [dc.id]: { order: 3, menuItemFactory: kb } }, [ha.OTHERS]: { [ta.id]: { order: 0, menuItemFactory: qR } }, [Ct.MAIN_AREA]: { [Ge.FORMAT]: { [hn.name]: { order: 0, menuItemFactory: $r }, // [SheetCutCommand.name]: { // order: 1, // menuItemFactory: CutMenuItemFactory, // }, [mn.name]: { order: 2, menuItemFactory: wa }, [go]: { order: 3, menuItemFactory: Ra, [Gs.id]: { order: 0, menuItemFactory: Ia }, [qs.id]: { order: 1, menuItemFactory: ya }, [Jr.id]: { order: 2, menuItemFactory: Ma }, [Qs.id]: { order: 3, menuItemFactory: Pa } }, [So]: { order: 4, menuItemFactory: Wa, [Xs.id]: { order: 0, menuItemFactory: Ba }, [zs.id]: { order: 1, menuItemFactory: Fa }, [mo.id]: { order: 2, menuItemFactory: Ua } } }, [Ge.LAYOUT]: { order: 1, [hg]: { order: 0, menuItemFactory: AR, [Sc.id]: { order: 0, menuItemFactory: Sh }, [Cc.id]: { order: 1, menuItemFactory: Ch }, [zi.id]: { order: 2, menuItemFactory: VR }, [fs.id]: { order: 3, menuItemFactory: kR } }, [cg]: { order: 0, menuItemFactory: MR, [pi.id]: { order: 0, menuItemFactory: gh }, [gi.id]: { order: 1, menuItemFactory: ph }, [Xi.id]: { order: 2, menuItemFactory: PR }, [ms.id]: { order: 3, menuItemFactory: ER } }, [Af]: { order: 2, menuItemFactory: Wb, [$n.id]: { order: 0, menuItemFactory: Ea }, [Gl.id]: { order: 1, menuItemFactory: Bb }, [ql.id]: { order: 2, menuItemFactory: Fb }, [ho.id]: { order: 3, menuItemFactory: Ta } }, [Co]: { order: 3, menuItemFactory: ja, [es.id]: { order: 0, menuItemFactory: Xa }, [rs.id]: { order: 1, menuItemFactory: za }, [ns.id]: { order: 2, menuItemFactory: Ya }, [ts.id]: { order: 3, menuItemFactory: Za } } }, [Ge.DATA]: { order: 2 }, [Ge.OTHERS]: { order: 3 } }, [Ct.COL_HEADER]: { [Ge.FORMAT]: { [hn.name]: { order: 0, menuItemFactory: $r }, // [SheetCutCommand.name]: { // order: 1, // menuItemFactory: CutMenuItemFactory, // }, [mn.name]: { order: 2, menuItemFactory: wa }, [go]: { order: 3, menuItemFactory: Ra, [Gs.id]: { order: 0, menuItemFactory: Ia }, [qs.id]: { order: 1, menuItemFactory: ya }, [Jr.id]: { order: 2, menuItemFactory: Ma }, [Qs.id]: { order: 3, menuItemFactory: Pa } }, [So]: { order: 4, menuItemFactory: Wa, [Xs.id]: { order: 0, menuItemFactory: Ba }, [zs.id]: { order: 1, menuItemFactory: Fa }, [mo.id]: { order: 2, menuItemFactory: Ua } } }, [Ge.LAYOUT]: { order: 1, [dg]: { order: 0, menuItemFactory: xR, [Cc.id]: { order: 0, menuItemFactory: Ch }, [Im.id]: { order: 1, menuItemFactory: HR } }, [jl.id]: { order: 1, menuItemFactory: jb }, [dm.id]: { order: 2, menuItemFactory: zb }, [pi.id]: { order: 2, menuItemFactory: gh }, [mm.id]: { order: 3, menuItemFactory: Zb }, [Ql.id]: { order: 4, menuItemFactory: Lb }, [Oc]: { order: 5, menuItemFactory: rh, [$n.id]: { order: 0, menuItemFactory: Ea }, [ho.id]: { order: 3, menuItemFactory: Ta } }, [Co]: { order: 6, menuItemFactory: ja, [es.id]: { order: 0, menuItemFactory: Xa }, [rs.id]: { order: 1, menuItemFactory: za }, [ns.id]: { order: 2, menuItemFactory: Ya }, [ts.id]: { order: 3, menuItemFactory: Za } } }, [Ge.DATA]: { order: 2 }, [Ge.OTHERS]: { order: 3 } }, [Ct.ROW_HEADER]: { [Ge.FORMAT]: { [hn.name]: { order: 0, menuItemFactory: $r }, // [SheetCutCommand.name]: { // order: 1, // menuItemFactory: CutMenuItemFactory, // }, [mn.name]: { order: 2, menuItemFactory: wa }, [go]: { order: 3, menuItemFactory: Ra, [Gs.id]: { order: 0, menuItemFactory: Ia }, [qs.id]: { order: 1, menuItemFactory: ya }, [Jr.id]: { order: 2, menuItemFactory: Ma }, [Qs.id]: { order: 3, menuItemFactory: Pa } }, [So]: { order: 4, menuItemFactory: Wa, [Xs.id]: { order: 0, menuItemFactory: Ba }, [zs.id]: { order: 1, menuItemFactory: Fa }, [mo.id]: { order: 2, menuItemFactory: Ua } } }, [Ge.LAYOUT]: { order: 1, [ug]: { order: 0, menuItemFactory: OR, [Sc.id]: { order: 0, menuItemFactory: Sh }, [Rm.id]: { order: 1, menuItemFactory: NR } }, [gi.id]: { order: 1, menuItemFactory: ph }, [Ul.id]: { order: 2, menuItemFactory: Ub }, [cm.id]: { order: 2, menuItemFactory: Xb }, [um.id]: { order: 3, menuItemFactory: Yb }, [Pl.id]: { order: 4, menuItemFactory: Db }, [Oc]: { order: 5, menuItemFactory: rh, [$n.id]: { order: 0, menuItemFactory: Ea }, [ho.id]: { order: 3, menuItemFactory: Ta } }, [Co]: { order: 6, menuItemFactory: ja, [es.id]: { order: 0, menuItemFactory: Xa }, [rs.id]: { order: 1, menuItemFactory: za }, [ns.id]: { order: 2, menuItemFactory: Ya }, [ts.id]: { order: 3, menuItemFactory: Za } } }, [Ge.DATA]: { order: 2 }, [Ge.OTHERS]: { order: 3 } }, [Ct.FOOTER_TABS]: { [Ge.OTHERS]: { order: 0, [sa.id]: { order: 0, menuItemFactory: eI }, [Pm.id]: { order: 1, menuItemFactory: tI }, [aa.id]: { order: 2, menuItemFactory: nI }, [Em.id]: { order: 3, menuItemFactory: rI }, [Tm.id]: { order: 4, menuItemFactory: sI }, // [SetWorksheetShowCommand.id]: { // order: 5, // menuItemFactory: UnHideSheetMenuItemFactory, // }, [ia.id]: { order: 6, menuItemFactory: iI }, [na.id]: { order: 7, menuItemFactory: QR }, [oa.id]: { order: 8, menuItemFactory: KR }, [la.id]: { order: 9, menuItemFactory: JR }, [ra.id]: { order: 10, menuItemFactory: $R } } }, [Ct.FOOTER_MENU]: { [Ge.OTHERS]: { [wm.id]: { order: 1, menuItemFactory: TR } } } }, gg = { id: sm.id, // when focusing on any other input tag do not trigger this shortcut preconditions: (r) => De(r), binding: Z.Digit9 | ye.CTRL_COMMAND }, pg = { id: im.id, // when focusing on any other input tag do not trigger this shortcut preconditions: (r) => De(r), binding: Z.Digit0 | ye.CTRL_COMMAND | ye.SHIFT }, Sg = { id: Lt.id, description: "shortcut.sheet.select-below-cell", group: "3_sheet-view", binding: Z.ARROW_DOWN, priority: 100, preconditions: De, staticParameters: { direction: B.DOWN } }, Cg = { id: Lt.id, description: "shortcut.sheet.select-up-cell", group: "3_sheet-view", binding: Z.ARROW_UP, priority: 100, preconditions: De, staticParameters: { direction: B.UP } }, vg = { id: Lt.id, description: "shortcut.sheet.select-left-cell", group: "3_sheet-view", binding: Z.ARROW_LEFT, priority: 100, preconditions: cf, staticParameters: { direction: B.LEFT } }, bg = { id: Lt.id, description: "shortcut.sheet.select-right-cell", group: "3_sheet-view", binding: Z.ARROW_RIGHT, priority: 100, preconditions: cf, staticParameters: { direction: B.RIGHT } }, _g = { id: Fn.id, description: "shortcut.sheet.select-next-cell", group: "3_sheet-view", binding: Z.TAB, priority: 100, preconditions: De, staticParameters: { direction: B.RIGHT, keycode: Z.TAB } }, wg = { id: Fn.id, description: "shortcut.sheet.select-previous-cell", group: "3_sheet-view", binding: Z.TAB | ye.SHIFT, priority: 100, preconditions: De, staticParameters: { direction: B.LEFT, keycode: Z.TAB } }, Rg = { id: Fn.id, description: "shortcut.sheet.select-below-cell", group: "3_sheet-view", binding: Z.ENTER, priority: 100, preconditions: De, staticParameters: { direction: B.DOWN, keycode: Z.ENTER } }, Ig = { id: Fn.id, description: "shortcut.sheet.select-up-cell", group: "3_sheet-view", binding: Z.ENTER | ye.SHIFT, priority: 100, preconditions: De, staticParameters: { direction: B.UP, keycode: Z.ENTER } }, yg = { id: Lt.id, description: "shortcut.sheet.select-below-value-cell", group: "3_sheet-view", binding: Z.ARROW_DOWN | ye.CTRL_COMMAND, preconditions: De, staticParameters: { direction: B.DOWN, jumpOver: Bn.moveGap } }, Mg = { id: Lt.id, description: "shortcut.sheet.select-up-value-cell", group: "3_sheet-view", binding: Z.ARROW_UP | ye.CTRL_COMMAND, preconditions: De, staticParameters: { direction: B.UP, jumpOver: Bn.moveGap } }, Pg = { id: Lt.id, description: "shortcut.sheet.select-left-value-cell", group: "3_sheet-view", binding: Z.ARROW_LEFT | ye.CTRL_COMMAND, preconditions: De, staticParameters: { direction: B.LEFT, jumpOver: Bn.moveGap } }, Eg = { id: Lt.id, description: "shortcut.sheet.select-right-value-cell", group: "3_sheet-view", binding: Z.ARROW_RIGHT | ye.CTRL_COMMAND, preconditions: De, staticParameters: { direction: B.RIGHT, jumpOver: Bn.moveGap } }, Tg = { id: Gt.id, description: "shortcut.sheet.expand-selection-down", group: "3_sheet-view", binding: Z.ARROW_DOWN | ye.SHIFT, preconditions: De, staticParameters: { direction: B.DOWN } }, xg = { id: Gt.id, description: "shortcut.sheet.expand-selection-up", group: "3_sheet-view", binding: Z.ARROW_UP | ye.SHIFT, preconditions: De, staticParameters: { direction: B.UP } }, Og = { id: Gt.id, description: "shortcut.sheet.expand-selection-left", group: "3_sheet-view", binding: Z.ARROW_LEFT | ye.SHIFT, preconditions: De, staticParameters: { direction: B.LEFT } }, Ag = { id: Gt.id, description: "shortcut.sheet.expand-selection-right", group: "3_sheet-view", binding: Z.ARROW_RIGHT | ye.SHIFT, preconditions: De, staticParameters: { direction: B.RIGHT } }, Ng = { id: Gt.id, description: "shortcut.sheet.expand-selection-to-below-gap", group: "3_sheet-view", binding: Z.ARROW_DOWN | ye.SHIFT | ye.CTRL_COMMAND, preconditions: De, staticParameters: { direction: B.DOWN, jumpOver: Bn.moveGap } }, Hg = { id: Gt.id, description: "shortcut.sheet.expand-selection-to-up-gap", group: "3_sheet-view", binding: Z.ARROW_UP | ye.SHIFT | ye.CTRL_COMMAND, preconditions: De, staticParameters: { direction: B.UP, jumpOver: Bn.moveGap } }, Vg = { id: Gt.id, description: "shortcut.sheet.expand-selection-to-left-gap", group: "3_sheet-view", binding: Z.ARROW_LEFT | ye.SHIFT | ye.CTRL_COMMAND, preconditions: De, staticParameters: { direction: B.LEFT, jumpOver: Bn.moveGap } }, kg = { id: Gt.id, description: "shortcut.sheet.expand-selection-to-right-gap", group: "3_sheet-view", binding: Z.ARROW_RIGHT | ye.SHIFT | ye.CTRL_COMMAND, preconditions: De, staticParameters: { direction: B.RIGHT, jumpOver: Bn.moveGap } }, Dg = { id: Vd.id, description: "shortcut.sheet.select-all", group: "3_sheet-view", binding: Z.A | ye.CTRL_COMMAND, preconditions: De, staticParameters: { expandToGapFirst: !0, loop: !0 } }, Lg = { id: Rs.id, description: "shortcut.sheet.set-bold", group: "4_sheet-edit", preconditions: (r) => De(r), binding: Z.B | ye.CTRL_COMMAND }, Wg = { id: Is.id, description: "shortcut.sheet.set-italic", group: "4_sheet-edit", preconditions: (r) => De(r), binding: Z.I | ye.CTRL_COMMAND }, Bg = { id: ys.id, description: "shortcut.sheet.set-underline", group: "4_sheet-edit", preconditions: (r) => De(r), binding: Z.U | ye.CTRL_COMMAND }, Fg = { id: Ms.id, description: "shortcut.sheet.set-strike-through", group: "4_sheet-edit", preconditions: (r) => De(r), binding: Z.X | ye.SHIFT | ye.CTRL_COMMAND }, Ug = { id: Xs.id, // when focusing on any other input tag do not trigger this shortcut preconditions: (r) => De(r), binding: Z.DELETE, mac: Z.BACKSPACE }, jg = { id: Li.id, description: "shortcut.sheet.zoom-in", binding: Z.EQUAL | ye.CTRL_COMMAND, group: "3_sheet-view", preconditions: De, priority: 1, staticParameters: { delta: 0.2 } }, Xg = { id: td.id, binding: Z.EQUAL | ye.CTRL_COMMAND }, zg = { id: Li.id, description: "shortcut.sheet.zoom-out", binding: Z.MINUS | ye.CTRL_COMMAND, group: "3_sheet-view", preconditions: De, priority: 1, staticParameters: { delta: -0.2 } }, Yg = { id: td.id, binding: Z.MINUS | ye.CTRL_COMMAND }, Zg = { id: Li.id, description: "shortcut.sheet.reset-zoom", binding: Z.Digit0 | ye.CTRL_COMMAND, preconditions: De, group: "3_sheet-view", priority: 1, staticParameters: { reset: !0 } }, Gg = { id: td.id, binding: Z.Digit0 | ye.CTRL_COMMAND }; var lI = Object.defineProperty, aI = Object.getOwnPropertyDescriptor, cI = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? aI(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && lI(e, t, s), s; }, Xn = (r, e) => (t, n) => e(t, n, r); let qo = class extends ce { constructor(r, e, t, n, s, i, o, l) { super(), this._injector = r, this._componentManager = e, this._layoutService = t, this._commandService = n, this._shortcutService = s, this._menuManagerService = i, this._uiPartsService = o, this._configService = l, this._init(); } _init() { this._initComponents(), this._initCommands(), this._initMenus(), this._initShortcuts(), this._initWorkbenchParts(), this._initFocusHandler(); } _initComponents() { const r = this._componentManager; this.disposeWithMe(r.register(Kl, Ef)), this.disposeWithMe(r.register($d, rg)), this.disposeWithMe(r.register(Fi, Md)), this.disposeWithMe(r.register(Fd, Jh)), this.disposeWithMe(r.register(Ud, $h)), this.disposeWithMe(r.register(jd, em)), this.disposeWithMe(r.register(Si, ig)), this.disposeWithMe(r.register("HideGridlines", Ff)); } _initCommands() { [ Gd, or, Qd, qd, Li, Gt, Lt, Fn, aa, sa, gi, pi, Ul, jl, un, of, Vd, Kd, ud, cs, Et, Wl, Rs, Is, ys, Ms, yf, Mf, Xl, zl, di, Pf, hd, fd, pd, gd, Yl, Bd, Bi, Zl, dn, li, $n, Gl, ql, lf, md, Wi, $t, ia, Ll, fs, ms, zi, Xi, Jd, pr, si, // permission Vn, tg, ta, es, ts, na, ra, la, ns, rs, oa, Ql ].forEach((r) => { this.disposeWithMe(this._commandService.registerCommand(r)); }); } _initMenus() { this._menuManagerService.mergeMenu(oI); } _initShortcuts() { [ // selection shortcuts Sg, Cg, vg, bg, _g, wg, Rg, Ig, // MoveBackSelectionShortcutItem, yg, Mg, Pg, Eg, Tg, xg, Og, Ag, Ng, Hg, Vg, kg, Dg, // view shortcuts jg, zg, Zg, Gg, Xg, Yg, // toggle cell style shortcuts Lg, Wg, Bg, Fg, // cell content editing shortcuts Ug, ...hf(), ff, mf, gf, Sf, Cf, vf, pf, // operation shortcuts gg, pg ].forEach((r) => { this.disposeWithMe(this._shortcutService.registerShortcut(r)); }); } _initWorkbenchParts() { const r = this._uiPartsService, e = this._injector, t = this._configService.getConfig(Pr); (t == null ? void 0 : t.formulaBar) !== !1 && this.disposeWithMe(r.registerComponent(js.HEADER, () => Qr(RR, e))), this.disposeWithMe(r.registerComponent(js.FOOTER, () => Qr(wR, e))), this.disposeWithMe(r.registerComponent(js.CONTENT, () => Qr(IR, e))); } _initFocusHandler() { this.disposeWithMe( this._layoutService.registerFocusHandler(O.UNIVER_SHEET, (r) => { const t = this._injector.get(Ce).getCurrentTypeOfRenderer(O.UNIVER_DOC), n = t == null ? void 0 : t.with(Sr); n == null || n.focus(); }) ); } }; qo = cI([ Xn(0, D(vt)), Xn(1, D(Dn)), Xn(2, _l), Xn(3, F), Xn(4, Il), Xn(5, id), Xn(6, yl), Xn(7, xr) ], qo); const dI = (r = []) => { const e = W(ws); be(() => { const t = r.map((n) => e.addShape({ range: n, style: { fill: "rgba(73, 184, 17, 0.05)", strokeWidth: 1, stroke: "#49B811", widgets: {} }, primary: { startColumn: n.startColumn, endColumn: n.endColumn, startRow: n.startRow, endRow: n.endRow, actualRow: n.startRow, actualColumn: n.startColumn, isMerged: !1, isMergedMainCell: !1 } })); return () => { t.forEach((n) => { n && e.removeShape(n); }); }; }, [r]); }; var uI = Object.defineProperty, hI = Object.getOwnPropertyDescriptor, mI = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? hI(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && uI(e, t, s), s; }, vh = (r, e) => (t, n) => e(t, n, r); let Ci = class extends ce { constructor(e, t) { super(); w(this, "_previousSheetIndex", -1); this._commandService = e, this._univerInstanceService = t, this.disposeWithMe(this._commandService.beforeCommandExecuted((n) => { if (n.id === An.id) return this._beforeAdjustActiveSheetOnRemoveSheet( n ); })), this.disposeWithMe(this._commandService.onCommandExecuted((n, s) => { if (n.id === An.id) return this._adjustActiveSheetOnRemoveSheet(n); if (n.id === nr.id && n.params.hidden) return this._adjustActiveSheetOnHideSheet(n); if (s != null && s.fromCollab) return !1; if (n.id === Nr.id) return this._adjustActiveSheetOnInsertSheet(n); if (n.id === nr.id && !n.params.hidden) return this._adjustActiveSheetOnShowSheet(n); if (n.id === He.id) return this._adjustActiveSheetOnSelection(n); })); } _adjustActiveSheetOnHideSheet(e) { var a; const { unitId: t, subUnitId: n } = e.params, s = this._univerInstanceService.getUniverSheetInstance(t); if (!s || ((a = s.getActiveSheet()) == null ? void 0 : a.getSheetId()) !== n) return; const o = s.getActiveSheetIndex(), l = bh(s, o); this._switchToNextSheet(t, l); } _beforeAdjustActiveSheetOnRemoveSheet(e) { const { unitId: t, subUnitId: n } = e.params, s = this._univerInstanceService.getUniverSheetInstance(t); if (!s) return; const i = s.getSheetBySheetId(n); i && (this._previousSheetIndex = s.getSheetIndex(i)); } _adjustActiveSheetOnRemoveSheet(e) { if (this._previousSheetIndex === -1) return; const { unitId: t } = e.params, n = this._univerInstanceService.getUniverSheetInstance(t); if (!n) return; if (n.getActiveSheet().getSheetId() === e.params.subUnitId) { const i = this._previousSheetIndex, o = i >= 1 ? i - 1 : 0, l = bh(n, o); this._switchToNextSheet(t, l); } } _adjustActiveSheetOnInsertSheet(e) { const { unitId: t, sheet: n } = e.params; this._switchToNextSheet(t, n.id); } _adjustActiveSheetOnShowSheet(e) { const { unitId: t, subUnitId: n } = e.params; this._switchToNextSheet(t, n); } _adjustActiveSheetOnSelection(e) { var s; const { unitId: t, subUnitId: n } = e.params; n !== ((s = this._univerInstanceService.getUnit(t)) == null ? void 0 : s.getActiveSheet().getSheetId()) && this._switchToNextSheet(t, n); } _switchToNextSheet(e, t) { this._commandService.executeCommand(et.id, { unitId: e, subUnitId: t }); } }; Ci = mI([ vh(0, F), vh(1, L) ], Ci); function bh(r, e) { const t = r.getSheetSize(); for (let n = e; n > -1; n--) { const s = r.getSheetByIndex(n); if (!s.getConfig().hidden) return s.getSheetId(); } for (let n = e; n < t; n++) { const s = r.getSheetByIndex(n); if (!s.getConfig().hidden) return s.getSheetId(); } throw new Error( "[ActiveWorksheetController]: could not find the next unhidden sheet! Collaboration error perhaps." ); } var fI = Object.defineProperty, gI = Object.getOwnPropertyDescriptor, pI = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? gI(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && fI(e, t, s), s; }, dr = (r, e) => (t, n) => e(t, n, r); let vi = class extends ce { constructor(e, t, n, s, i, o, l) { super(); // the DrawingTypeEnum should refer from drawing package, here we just use type, so no need to import the drawing package w(this, "_popupMenuFeatureMap", /* @__PURE__ */ new Map()); w(this, "_isSelectionMoving", !1); this._globalPopupManagerService = e, this._renderManagerService = t, this._univerInstanceService = n, this._refRangeService = s, this._commandService = i, this._refSelectionsService = o, this._selectionManagerService = l, this._initMoving(); } _initMoving() { this.disposeWithMe( this._refSelectionsService.selectionMoving$.subscribe(() => { this._isSelectionMoving = !0; }) ), this.disposeWithMe( this._refSelectionsService.selectionMoveEnd$.subscribe(() => { this._isSelectionMoving = !1; }) ), this.disposeWithMe( this._selectionManagerService.selectionMoving$.subscribe(() => { this._isSelectionMoving = !0; }) ), this.disposeWithMe( this._selectionManagerService.selectionMoveEnd$.subscribe(() => { this._isSelectionMoving = !1; }) ); } /** * Register a feature menu callback for a specific drawing type.such as image, chart, etc. */ registerFeatureMenu(e, t) { this._popupMenuFeatureMap.set(e, t); } /** * Get the feature menu by drawing type, the function should be called when a drawing element need trigger popup menu, so the unitId, subUnitId, drawingId should be provided. * @param {string} unitId the unit id * @param {string} subUnitId the sub unit id * @param {string} drawingId the drawing id * @param {DrawingTypeEnum} drawingType the feature type * @returns the feature menu if it exists, otherwise return undefined */ getFeatureMenu(e, t, n, s) { const i = this._popupMenuFeatureMap.get(s); if (i) return i(e, t, n, s); } dispose() { super.dispose(), this._popupMenuFeatureMap.clear(); } _createHiddenRectObserver(e) { const { row: t, column: n, worksheet: s, skeleton: i, currentRender: o } = e, l = () => { var N, X; const u = s.getFreeze(), { startRow: h, startColumn: m, xSplit: f, ySplit: g } = u, p = h - g, S = m - f, { rowHeightAccumulation: b, columnWidthAccumulation: v, rowHeaderWidth: _, columnHeaderHeight: R } = i, I = _ + (S === -1 ? 0 : v[S + f - 1] - ((N = v[S - 1]) != null ? N : 0)), y = R + (p === -1 ? 0 : b[p + g - 1] - ((X = b[p]) != null ? X : 0)), M = o.engine.getCanvasElement(), P = M.getBoundingClientRect(), E = Ga(M.style.width), T = P.width / E, A = o.scene.getAncestorScale().scaleX, H = I * T * A, x = y * T * A, k = { left: -1 / 0, top: -1 / 0, right: P.left + H, bottom: P.top + x }, U = { left: P.left + H, top: -1 / 0, right: 1 / 0, bottom: P.top + x }, V = { left: -1 / 0, top: P.top + x, right: P.left + H, bottom: 1 / 0 }; return t < h && n < m ? [] : t < h ? [k] : n < m ? [k] : [k, U, V]; }, a = l(), c = new Me(a), d = new St(); return d.add(this._commandService.onCommandExecuted((u) => { if (u.id === vr.id) { const h = l(); c.next(h); } })), { rects$: c, disposable: d }; } // #region attach to object // Unlike _createCellPositionObserver, this bind to a certain position. _createPositionObserver(e, t, n, s) { const i = () => { const { scene: c } = t, d = Q_(e, c, n, s), u = t.engine.getCanvasElement(), h = u.getBoundingClientRect(), m = Ga(u.style.width), f = h.width / m; return { left: d.left * f + h.left, right: d.right * f + h.left, top: d.top * f + h.top, bottom: d.bottom * f + h.top }; }, o = i(), l = new Me(o), a = new St(); return a.add(this._commandService.onCommandExecuted((c) => { (c.id === dn.id || c.id === $t.id) && l.next(i()); })), { position: o, position$: l, disposable: a }; } /** * attach a popup to canvas object * @param targetObject target canvas object * @param popup popup item * @returns disposable */ attachPopupToObject(e, t) { var b; const n = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET), s = n.getActiveSheet(); if (!s || this._isSelectionMoving && !t.showOnSelectionMoving) return { dispose: () => { }, canDispose: () => !0 }; const i = n.getUnitId(), o = s.getSheetId(), l = (b = this._renderManagerService.getRenderById(i)) == null ? void 0 : b.with(me).getOrCreateSkeleton({ sheetId: o }), a = this._renderManagerService.getRenderById(i); if (!a || !l) return { dispose: () => { }, canDispose: () => !0 }; const { left: c, top: d, width: u, height: h } = e, m = { left: c, right: c + u, top: d, bottom: d + h }, { position: f, position$: g, disposable: p } = this._createPositionObserver(m, a, l, s), S = this._globalPopupManagerService.addPopup({ ...t, unitId: i, subUnitId: o, anchorRect: f, anchorRect$: g, canvasElement: a.engine.getCanvasElement() }); return { dispose: () => { this._globalPopupManagerService.removePopup(S), g.complete(), p.dispose(); }, canDispose: () => this._globalPopupManagerService.activePopupId !== S }; } // #endregion // #region attach to position attachPopupByPosition(e, t, n) { var p; const s = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET), i = s.getActiveSheet(); if (!i) return null; const o = s.getUnitId(), l = i.getSheetId(); if (o !== n.unitId || n.subUnitId !== l) return null; if (this._isSelectionMoving && !t.showOnSelectionMoving) return; const a = (p = this._renderManagerService.getRenderById(o)) == null ? void 0 : p.with(me).getOrCreateSkeleton({ sheetId: l }), c = this._renderManagerService.getRenderById(o); if (!c || !a) return null; const { position: d, position$: u, disposable: h } = this._createPositionObserver(e, c, a, i), { rects$: m, disposable: f } = this._createHiddenRectObserver({ row: n.row, column: n.col, worksheet: i, skeleton: a, currentRender: c }), g = this._globalPopupManagerService.addPopup({ ...t, unitId: o, subUnitId: l, anchorRect: d, anchorRect$: u, hiddenRects$: m, canvasElement: c.engine.getCanvasElement() }); return { dispose: () => { this._globalPopupManagerService.removePopup(g), u.complete(), h.dispose(), f.dispose(); }, canDispose: () => this._globalPopupManagerService.activePopupId !== g }; } // #endregion // #region attach to absolute position attachPopupToAbsolutePosition(e, t, n, s) { var m; const i = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET), o = i.getActiveSheet(); if (!o) return null; const l = i.getUnitId(), a = o.getSheetId(); if (n && l !== n || s && s !== a) return null; const c = (m = this._renderManagerService.getRenderById(l)) == null ? void 0 : m.with(me).getOrCreateSkeleton({ sheetId: a }), d = this._renderManagerService.getRenderById(l); if (!d || !c) return null; if (this._isSelectionMoving && !t.showOnSelectionMoving) return; const u = new Me(e), h = this._globalPopupManagerService.addPopup({ ...t, unitId: l, subUnitId: a, anchorRect: e, anchorRect$: u.asObservable(), canvasElement: d.engine.getCanvasElement() }); return { dispose: () => { this._globalPopupManagerService.removePopup(h), u.complete(); }, canDispose: () => this._globalPopupManagerService.activePopupId !== h }; } // #endregion // #region attach to cell /** * Bind popup to the right part of cell at(row, col). * This popup would move with the cell. * @param row * @param col * @param popup * @param _unitId * @param _subUnitId * @param viewport * @returns */ attachPopupToCell(e, t, n, s, i, o) { const l = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET), a = l.getActiveSheet(); if (!a) return null; const c = l.getUnitId(), d = a.getSheetId(); if (s && c !== s || i && d !== i) return null; const u = this._renderManagerService.getRenderById(c), h = u == null ? void 0 : u.with(me).getOrCreateSkeleton({ sheetId: d }), m = u == null ? void 0 : u.with(dt); if (!u || !h || !m) return null; if (this._isSelectionMoving && !n.showOnSelectionMoving) return; const f = o != null ? o : lh(e, t, u.scene, a); if (!f) return null; const { position: g, position$: p, disposable: S, updateRowCol: b } = this._createCellPositionObserver(e, t, u, h, f), { rects$: v, disposable: _ } = this._createHiddenRectObserver({ row: e, column: t, worksheet: a, skeleton: h, currentRender: u }), R = this._globalPopupManagerService.addPopup({ ...n, unitId: c, subUnitId: d, anchorRect: g, anchorRect$: p, canvasElement: u.engine.getCanvasElement(), hiddenRects$: v }), I = new St(); I.add(S), I.add(Ae(() => { this._globalPopupManagerService.removePopup(R), p.complete(); })), I.add(_); const y = { startRow: e, endRow: e, startColumn: t, endColumn: t }; return I.add(this._refRangeService.watchRange(c, d, y, (M, P) => { P ? b(P.startRow, P.startColumn) : I.dispose(); })), { dispose() { I.dispose(); }, canDispose: () => this._globalPopupManagerService.activePopupId !== R }; } /** * attach Comp to floatDOM * @param range * @param popup * @param _unitId * @param _subUnitId * @param viewport * @param showOnSelectionMoving * @returns */ attachRangePopup(e, t, n, s, i, o = !1) { const l = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET), a = l.getActiveSheet(); if (!a) return null; const c = l.getUnitId(), d = a.getSheetId(); if (n && c !== n || s && d !== s) return null; const u = this._renderManagerService.getRenderById(c), h = u == null ? void 0 : u.with(me).getOrCreateSkeleton({ sheetId: d }), m = u == null ? void 0 : u.with(dt); if (!u || !h || !m) return null; if (m.selectionMoving && !o) return; const f = i != null ? i : lh(e.startRow, e.startColumn, u.scene, a); if (!f) return null; const { position: g, position$: p, disposable: S, updateRowCol: b, topLeftPos$: v, rightBottomPos$: _ } = this._createRangePositionObserver(e, u, h, f), { rects$: R, disposable: I } = this._createHiddenRectObserver({ row: e.startRow, column: e.startColumn, worksheet: a, skeleton: h, currentRender: u }), y = this._globalPopupManagerService.addPopup({ ...t, unitId: c, subUnitId: d, anchorRect: g, anchorRect$: p, canvasElement: u.engine.getCanvasElement(), hiddenRects$: R }), M = new St(); M.add(S), M.add(Ae(() => { this._globalPopupManagerService.removePopup(y), v.complete(), _.complete(); })), M.add(I); const P = { ...e }; return M.add(this._refRangeService.watchRange(c, d, P, (E, T) => { T ? b(T.startRow, T.startColumn) : M.dispose(); })), { dispose() { M.dispose(); }, canDispose: () => this._globalPopupManagerService.activePopupId !== y }; } /** * * @param initialRow * @param initialCol * @param currentRender * @param skeleton * @param activeViewport * @returns */ _createCellPositionObserver(e, t, n, s, i) { let o = e, l = t; const a = this._calcCellPositionByCell(o, l, n, s, i), c = new Me(a), d = () => c.next(this._calcCellPositionByCell(o, l, n, s, i)), u = new St(); return u.add(n.engine.clientRect$.subscribe(() => d())), u.add(this._commandService.onCommandExecuted((m) => { if (m.id === _r.id && m.params.rowsAutoHeightInfo.findIndex((g) => g.row === o) > -1) { d(); return; } (Io.indexOf(m.id) > -1 || m.id === dn.id || m.id === $t.id) && d(); })), { position$: c, disposable: u, position: a, updateRowCol: (m, f) => { o = m, l = f, d(); } }; } // TODO @lumixraku to a normal function, not method. _calcCellPositionByCell(e, t, n, s, i) { const { scene: o, engine: l } = n, a = s.getCellWithCoordByIndex(e, t), c = a.isMergedMainCell ? a.mergeInfo : a, { scaleX: d, scaleY: u } = o.getAncestorScale(), h = { x: i.viewportScrollX, y: i.viewportScrollY }, m = l.getCanvasElement(), f = m.getBoundingClientRect(), g = Ga(m.style.width), { top: p, left: S, width: b } = f, v = b / g; return { left: (c.startX - h.x) * v * d + S, right: (c.endX - h.x) * v * d + S, top: (c.startY - h.y) * v * u + p, bottom: (c.endY - h.y) * v * u + p }; } // #endregion /** * Unlike _createCellPositionObserver, this accept a range not a single cell. * @param initialRow * @param initialCol * @param currentRender * @param skeleton * @param activeViewport */ _createRangePositionObserver(e, t, n, s) { let { startRow: i, startColumn: o } = e; const l = this._calcCellPositionByCell(i, o, t, n, s), a = new Me(l), c = this._calcCellPositionByCell(e.endRow, e.endColumn, t, n, s), d = new Me(c), u = () => { const p = this._calcCellPositionByCell(i, o, t, n, s), S = this._calcCellPositionByCell(e.endRow, e.endColumn, t, n, s); a.next(p), d.next(S); }, h = new St(); h.add(t.engine.clientRect$.subscribe(() => u())), h.add(this._commandService.onCommandExecuted((p) => { if (p.id === _r.id && p.params.rowsAutoHeightInfo.findIndex((b) => b.row === i) > -1) { u(); return; } (Io.indexOf(p.id) > -1 || p.id === dn.id || p.id === $t.id) && u(); })); const m = (p, S) => { i = p, o = S, u(); }, f = a.pipe( _e((p) => { const S = this._calcCellPositionByCell(e.endRow, e.endColumn, t, n, s); return { top: p.top, left: p.left, right: S.right, bottom: S.bottom }; }) ), g = { top: l.top, left: l.left, right: c.right, bottom: c.bottom }; return { position$: f, position: g, updateRowCol: m, topLeftPos$: a, rightBottomPos$: d, disposable: h }; } }; vi = pI([ dr(0, D(IS)), dr(1, Ce), dr(2, L), dr(3, D(dC)), dr(4, F), dr(5, El), dr(6, D($)) ], vi); function Ga(r) { return Number.parseInt(r.replace("px", "")); } var SI = Object.defineProperty, CI = Object.getOwnPropertyDescriptor, vI = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? CI(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && SI(e, t, s), s; }, _h = (r, e) => (t, n) => e(t, n, r), Ks = /* @__PURE__ */ ((r) => (r[r.INFO = 0] = "INFO", r[r.WARNING = 1] = "WARNING", r[r.ERROR = 2] = "ERROR", r))(Ks || {}); let bi = class extends ce { constructor(e, t) { super(); w(this, "_currentAlert$", new xe()); w(this, "_currentAlert", /* @__PURE__ */ new Map()); w(this, "currentAlert$", this._currentAlert$.asObservable()); this._renderManagerService = e, this._canvasPopManagerService = t, this.disposeWithMe(() => { this._currentAlert$.complete(); }); } get currentAlert() { return this._currentAlert; } showAlert(e) { let t = this._currentAlert.get(e.key); t && t.dispose.dispose(), t ? t.dispose.dispose() : (t = { alert: e, dispose: { dispose() { } } }, this._currentAlert.set(e.key, t)); const { location: n } = e, { row: s, col: i, unitId: o } = n; if (!this._renderManagerService.getRenderById(o)) return; const a = this._canvasPopManagerService.attachPopupToCell(s, i, { componentKey: qg, direction: "horizontal", offset: [2, 0], extraProps: { alert: e } }); a && (t.dispose = a), this._currentAlert$.next(Array.from(this._currentAlert.entries())); } removeAlert(e) { const t = this._currentAlert.get(e); t && (this._currentAlert.delete(e), t == null || t.dispose.dispose(), this._currentAlert$.next(Array.from(this._currentAlert.entries()))); } clearAlert() { this._currentAlert.forEach((e) => { e.dispose.dispose(); }), this._currentAlert.clear(), this._currentAlert$.next(Array.from(this._currentAlert.entries())); } }; bi = vI([ _h(0, Ce), _h(1, D(vi)) ], bi); const bI = "univer-cell-alert", _I = "univer-cell-alert-title", wI = "univer-cell-alert-icon", RI = "univer-cell-alert-icon-error", II = "univer-cell-alert-icon-info", yI = "univer-cell-alert-icon-warning", MI = "univer-cell-alert-content", vn = { cellAlert: bI, cellAlertTitle: _I, cellAlertIcon: wI, cellAlertIconError: RI, cellAlertIconInfo: II, cellAlertIconWarning: yI, cellAlertContent: MI }; function PI({ popup: r }) { var o; const e = (o = r.extraProps) == null ? void 0 : o.alert; if (!e) return null; const { type: t, title: n, message: s } = e, i = { [Ks.ERROR]: /* @__PURE__ */ C.jsx(Xd, { className: st(vn.cellAlertIcon, vn.cellAlertIconError) }), [Ks.INFO]: /* @__PURE__ */ C.jsx(kc, { className: st(vn.cellAlertIcon, vn.cellAlertIconInfo) }), [Ks.WARNING]: /* @__PURE__ */ C.jsx(kc, { className: st(vn.cellAlertIcon, vn.cellAlertIconWarning) }) }; return /* @__PURE__ */ C.jsxs("div", { className: vn.cellAlert, children: [ /* @__PURE__ */ C.jsxs("div", { className: vn.cellAlertTitle, children: [ t ? i[t] : null, n ] }), /* @__PURE__ */ C.jsx("div", { className: vn.cellAlertContent, children: s }) ] }); } const qg = "univer.sheet.cell-alert"; var EI = Object.defineProperty, TI = Object.getOwnPropertyDescriptor, xI = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? TI(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && EI(e, t, s), s; }, OI = (r, e) => (t, n) => e(t, n, r); let Qo = class extends ce { constructor(r, e) { super(), this._context = r, this._componentManager = e, this._initComponent(); } _initComponent() { this._componentManager.register(qg, PI); } }; Qo = xI([ OI(1, D(Dn)) ], Qo); const AI = "univer-sheet-paste-options-wrapper", NI = "univer-sheet-paste-options-icon-wrapper", HI = "univer-sheet-paste-options-menu", VI = "univer-sheet-paste-options-menu-item", kI = "univer-sheet-paste-options-menu-item-title", DI = "univer-sheet-paste-options-menu-item-icon", Ur = { sheetPasteOptionsWrapper: AI, sheetPasteOptionsIconWrapper: NI, sheetPasteOptionsMenu: HI, sheetPasteOptionsMenuItem: VI, sheetPasteOptionsMenuItemTitle: kI, sheetPasteOptionsMenuItemIcon: DI }, wh = 2, LI = [ { value: "DEFAULT_PASTE", label: "rightClick.paste" }, { value: "SPECIAL_PASTE_VALUE", label: "rightClick.pasteValue" }, { value: "SPECIAL_PASTE_FORMAT", label: "rightClick.pasteFormat" }, { value: "SPECIAL_PASTE_COL_WIDTH", label: "rightClick.pasteColWidth" }, { value: "SPECIAL_PASTE_BESIDES_BORDER", label: "rightClick.pasteBesidesBorder" }, { value: "SPECIAL_PASTE_FORMULA", label: "formula.operation.pasteFormula" } ], WI = (r) => { var T, A, H, x, k; const e = W(L), t = W(Ce), n = Wn(); if (!r || !n) return null; const s = { startRow: r.rows[0], startCol: r.cols[0], endRow: r.rows[r.rows.length - 1], endCol: r.cols[r.cols.length - 1] }; if (s.endRow < 0 || s.endCol < 0) return null; const i = t.getRenderById(n.getUnitId()), o = i == null ? void 0 : i.with(me), l = i == null ? void 0 : i.with(dt), a = pn(e, t); if (!a || !l) return null; const { scene: c } = a, d = o == null ? void 0 : o.getCurrentSkeleton(), u = l.getViewPort(), h = c == null ? void 0 : c.scaleX, m = c == null ? void 0 : c.scaleY, f = c == null ? void 0 : c.getViewportScrollXY(u), g = (T = c.getEngine()) == null ? void 0 : T.getCanvas(); if (!h || !c || !h || !m || !f) return null; const p = d == null ? void 0 : d.getNoMergeCellPositionByIndex(s.endRow, s.endCol), S = (A = p == null ? void 0 : p.endX) != null ? A : 0, b = (H = p == null ? void 0 : p.endY) != null ? H : 0, v = (x = d == null ? void 0 : d.convertTransformToOffsetX(S, h, f)) != null ? x : -9999, _ = (k = d == null ? void 0 : d.convertTransformToOffsetY(b, m, f)) != null ? k : -9999, R = g == null ? void 0 : g.getWidth(), I = g == null ? void 0 : g.getHeight(); if (!R || !I) return null; const y = v + 50 <= R, M = _ + 50 <= I; let P = v, E = _; return y || (P = R - 100), M || (E = I - 100), { positionX: P, positionY: E }; }, BI = () => { const r = W(Sn), e = is(r.showMenu$, !0), t = is(r.pasteOptionsCache$, null); W(Ce); const n = W(Ee), s = W(F), [i, o] = te(!1), [l, a] = te(!1), [c, d] = te(Math.random()), u = t == null ? void 0 : t.target.pastedRange, h = WI(u), m = FC(); be(() => { e || (o(!1), a(!1)); }, [e]); const f = On(() => d(Math.random()), []); if (be(() => { const S = m && Ae( m.currentSkeleton$.subscribe((b) => { b && f(); }) ); return S == null ? void 0 : S.dispose; }, [m, f]), be(() => s.onCommandExecuted((b) => { b.id === dn.id && f(); }).dispose, [f, s]), !h || !e || h.positionX < 50 || h.positionY < 30) return null; const g = i || l, p = (S) => { s.executeCommand(If.id, { type: S }); }; return /* @__PURE__ */ C.jsx( "div", { className: Ur.sheetPasteOptionsWrapper, style: { left: h.positionX + wh, top: h.positionY + wh }, onMouseEnter: () => o(!0), onMouseLeave: () => o(!1), children: /* @__PURE__ */ C.jsxs(jm, { children: [ /* @__PURE__ */ C.jsx(Xm, { children: /* @__PURE__ */ C.jsxs( "div", { className: Ur.sheetPasteOptionsIconWrapper, onClick: () => { a(!l); }, children: [ /* @__PURE__ */ C.jsx( jf, { style: { color: "#35322B" }, extend: { colorChannel1: "rgb(var(--green-700))" } } ), g && /* @__PURE__ */ C.jsx(hs, {}) ] } ) }), /* @__PURE__ */ C.jsx( zm, { className: st(Ur.sheetPasteOptionsMenu, ` univer-border univer-border-gray-200 univer-border-solid `), children: /* @__PURE__ */ C.jsx("ul", { children: LI.map((S) => { const b = rt[S.value], v = (t == null ? void 0 : t.pasteType) === b; return /* @__PURE__ */ C.jsxs( "li", { onClick: () => p(S.value), className: st(Ur.sheetPasteOptionsMenuItem, "hover:univer-bg-neutral-100"), children: [ /* @__PURE__ */ C.jsx("span", { children: v && /* @__PURE__ */ C.jsx(Hn, { className: Ur.sheetPasteOptionsMenuItemIcon, style: { color: "rgb(var(--green-700, #409f11))" } }) }), /* @__PURE__ */ C.jsx("div", { className: st(Ur.sheetPasteOptionsMenuItemTitle, "univer-text-gray-700"), children: n.t(S.label) }) ] }, S.value ); }) }) } ) ] }) } ); }, FI = [ Et.id, Ti.id, $t.id, tr.id, xi.id, Oi.id, Ai.id, Ni.id, Tl.id, xl.id, Qt.id, $s.id, He.id, jp ]; function UI(r, e, t, n, s) { const i = [], o = []; if (n.copyType === gr.CUT) { const { undos: l, redos: a } = jI(r, e, s); i.push(...a), o.push(...l); } else { const { undos: l, redos: a } = Jg(e, t, s); i.push(...a), o.push(...l); const { undos: c, redos: d } = XI(e, t, s); i.push(...d), o.push(...c); const { undos: u, redos: h } = Qg(e, r, t, s); i.push(...h), o.push(...u); const { undos: m, redos: f } = Kg(e, t, s, !0); i.push(...f), o.push(...m); const { undos: g, redos: p } = Wc( e, t, s ); i.push(...p), o.push(...g); } return { undos: o, redos: i }; } function jI(r, e, t) { let n = [], s = []; const { range: i, subUnitId: o, unitId: l } = r, { range: a, subUnitId: c } = e, d = a ? wr(a) : null, u = i ? wr(i) : null; if (u && d) { const h = t.get(L), m = t.get(Ln), f = h.getUniverSheetInstance(l), g = f == null ? void 0 : f.getSheetBySheetId(o), p = f == null ? void 0 : f.getSheetBySheetId(c); if (g && p) { const S = new Ke(), b = new Ke(), v = g.getCellMatrix(), _ = p.getCellMatrix(); co.foreach(u, (N, X) => { S.setValue(N, X, se.deepClone(v.getValue(N, X))), b.setValue(N, X, null); }); const R = new Ke(); co.foreach(d, (N, X) => { R.setValue(N, X, se.deepClone(_.getValue(N, X))); }); const I = new Ke(); co.foreach(u, (N, X) => { const Y = Xp(N, X), ie = ae.getRelativeRange(Y, u), he = ae.getPositionRange(ie, d); I.setValue(he.startRow, he.startColumn, v.getValue(N, X)); }); const y = { fromRange: u, toRange: d, from: { value: b.getMatrix(), subUnitId: o }, to: { value: I.getMatrix(), subUnitId: c }, unitId: l }, M = { fromRange: d, toRange: u, from: { value: S.getMatrix(), subUnitId: o }, to: { value: R.getMatrix(), subUnitId: c }, unitId: l }, P = m.onCommandExecute({ id: ld.id, params: { toRange: d, fromRange: u } }), E = g.getMergeData(), T = p.getMergeData(), A = E.filter((N) => ae.intersects(N, u)), H = T.filter((N) => ae.intersects(N, d)), x = A.map((N) => ae.getRelativeRange(N, u)).map((N) => ae.getPositionRange(N, d)), k = Al(x), U = [ { id: Kt.id, params: { unitId: l, subUnitId: o, ranges: A } }, { id: Kt.id, params: { unitId: l, subUnitId: o, ranges: H } }, { id: Jt.id, params: { unitId: l, subUnitId: c, ranges: k } } ], V = [ { id: Kt.id, params: { unitId: l, subUnitId: c, ranges: k } }, { id: Jt.id, params: { unitId: l, subUnitId: c, ranges: H } }, { id: Jt.id, params: { unitId: l, subUnitId: o, ranges: A } } ]; n = [ { id: tr.id, params: y }, ...P.redos, ...U, { id: He.id, params: { unitId: l, subUnitId: c, selections: [{ range: d }], type: Xt.MOVE_END } } ], s = [ { id: tr.id, params: M }, ...P.undos, ...V, { id: He.id, params: { unitId: l, subUnitId: o, type: Xt.MOVE_END, selections: [{ range: u }] } } ]; } } return { undos: s, redos: n }; } function Qg(r, e, t, n) { const { unitId: s, subUnitId: i, range: o } = r, l = [], a = [], { mapFunc: c } = _s([o]), d = new Ke(); t.forValue((m, f, g) => { var v; let p; if (!g.p && g.v && !e) { const _ = String(g.v), R = er.parseValue(_); (R == null ? void 0 : R.v) !== void 0 && typeof R.v == "number" && (p = R.v); } const { row: S, col: b } = c(m, f); if ((v = g.p) != null && v.body && Tc(g.p.body)) { const _ = se.deepClone({ p: g.p, v: p != null ? p : g.v }); d.setValue(S, b, _); } else d.setValue(S, b, se.deepClone({ v: p != null ? p : g.v, t: g.t })); }); const u = { unitId: s, subUnitId: i, cellValue: se.deepClone(d.getMatrix()) }; l.push({ id: Se.id, params: u }); const h = en( n, u ); return a.push({ id: Se.id, params: h }), { undos: a, redos: l }; } function Kg(r, e, t, n = !1) { const s = [], i = [], { unitId: o, subUnitId: l, range: a } = r, c = new Ke(), { mapFunc: d } = _s([a]); e.forValue((m, f, g) => { var I; const p = { s: Object.assign({}, { ...ed, pd: dS, bg: null, cl: null }, g.s) }, S = p.s.bd; S && (Object.keys(S).length > 0 || (p.s.bd = { b: null, l: null, r: null, t: null })); const b = String(g.v), v = er.parseValue(b); v != null && v.z && (p.s || (p.s = {}), typeof p.s == "object" && ((I = p.s) != null && I.n ? p.s.n.pattern = v.z : p.s.n = { pattern: v.z })); const { row: _, col: R } = d(m, f); c.setValue(_, R, p); }); const u = { unitId: o, subUnitId: l, cellValue: se.deepClone(c.getMatrix()) }; s.push({ id: Se.id, params: u }); const h = en( t, u ); return i.push({ id: Se.id, params: h }), { undos: i, redos: s }; } function Jg(r, e, t) { const n = [], s = [], i = new Ke(), { unitId: o, subUnitId: l, range: a } = r, { mapFunc: c } = _s([a]); if (e.forEach((d, u) => { Object.keys(u).forEach((h) => { const m = Number(h), { row: f, col: g } = c(d, m); i.setValue(f, g, { s: null }); }); }), i.getLength() > 0) { const d = { subUnitId: l, unitId: o, cellValue: se.deepClone(i.getMatrix()) }; n.push({ id: Se.id, params: d }); const u = en( t, d ); s.push({ id: Se.id, params: u }); } return { undos: s, redos: n }; } function XI(r, e, t) { const n = [], s = [], i = new Ke(), { unitId: o, subUnitId: l, range: a } = r, { mapFunc: c } = _s([a]); if (e.forValue((d, u, h) => { const { row: m, col: f } = c(d, u); i.setValue(m, f, { v: null, p: null }); }), i.getLength() > 0) { const d = { subUnitId: l, unitId: o, cellValue: se.deepClone(i.getMatrix()) }; n.push({ id: Se.id, params: d }); const u = en( t, d ); s.push({ id: Se.id, params: u }); } return { undos: s, redos: n }; } function Wc(r, e, t) { const n = [], s = [], { unitId: i, subUnitId: o, range: l } = r, { startColumn: a, startRow: c, endColumn: d, endRow: u } = wr(l), h = []; e.forValue((b, v, _) => { if (_.rowSpan && _.rowSpan > 1) { const R = _.colSpan || 1, I = { startRow: c + b, endRow: c + b + _.rowSpan - 1, startColumn: a + v, endColumn: a + v + R - 1 }; h.push(I); } else if (_.colSpan && _.colSpan > 1) { const R = _.rowSpan || 1, I = { startRow: c + b, endRow: c + b + R - 1, startColumn: a + v, endColumn: a + v + _.colSpan - 1 }; h.push(I); } }); const f = t.get(L).getUniverSheetInstance(i), g = f == null ? void 0 : f.getSheetBySheetId(o); if (f && g) { const v = g.getMergeData().filter( (I) => ae.intersects({ startRow: c, startColumn: a, endRow: u, endColumn: d }, I) ), _ = { unitId: i, subUnitId: o, ranges: v }; n.push({ id: Kt.id, params: _ }); const R = Ol( t, _ ); s.push({ id: Jt.id, params: R }); } const p = { unitId: i, subUnitId: o, ranges: h }; h.length > 0 && n.push({ id: Jt.id, params: p }); const S = Nl( t, p ); return h.length > 0 && s.push({ id: Kt.id, params: S }), { undos: s, redos: n }; } function zI(r) { if (!r.includes("\r") && se.isLegalUrl(r)) { const n = Dh(), s = `${r}`, i = { startIndex: 0, endIndex: s.length - 1, rangeId: n, rangeType: $c.HYPERLINK, properties: { url: r } }; return { dataStream: `${s}\r `, paragraphs: [{ startIndex: s.length }], customRanges: [i] }; } let e = r.replace(/(\r\n|\n)/g, "\r"); e.endsWith(`\r `) || (e += `\r `); const t = []; for (let n = 0; n < e.length; n++) e[n] === "\r" && t.push({ startIndex: n }); return { dataStream: e, paragraphs: t, sectionBreaks: [{ startIndex: e.indexOf(` `) }] }; } var YI = Object.defineProperty, ZI = Object.getOwnPropertyDescriptor, GI = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? ZI(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && YI(e, t, s), s; }, nn = (r, e) => (t, n) => e(t, n, r); const qI = [ Ni.id, Ai.id, Oi.id, xi.id, tr.id, Tl.id, xl.id ]; let _i = class extends kn { constructor(r, e, t, n, s, i, o, l, a, c) { super(), this._injector = r, this._currentUniverSheet = e, this._renderManagerService = t, this._commandService = n, this._contextService = s, this._configService = i, this._sheetClipboardService = o, this._messageService = l, this._localService = a, this._uiPartsService = c, this._init(), this._initCommandListener(), this._initUIComponents(), this._pasteWithDoc(); } _pasteWithDoc() { var t; const r = (n) => { n.onPaste$.pipe(os(this.dispose$)).subscribe((s) => { var a, c; if (!De(this._contextService)) return; s.event.preventDefault(); const i = s.event, o = (a = i.clipboardData) == null ? void 0 : a.getData("text/html"), l = (c = i.clipboardData) == null ? void 0 : c.getData("text/plain"); this._commandService.executeCommand(xc.id, { htmlContent: o, textContent: l }); }); }; let e = (t = this._renderManagerService.getRenderById(Le)) == null ? void 0 : t.with(Sr); e && r(e), this._renderManagerService.created$.subscribe((n) => { var s; n.unitId === Le && (e = (s = this._renderManagerService.getRenderById(Le)) == null ? void 0 : s.with(Sr), e && r(e)); }); } _init() { [hn, Rf, mn].forEach( (e) => this.disposeWithMe(this._commandService.registerMultipleCommand(e)) ), [ Gs, qs, Jr, Qs, xc, If ].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e))), this.disposeWithMe(this._sheetClipboardService.addClipboardHook(this._initCopyingHooks())), this.disposeWithMe(this._sheetClipboardService.addClipboardHook(this._initPastingHook())); const r = this._initSpecialPasteHooks().map( (e) => this._sheetClipboardService.addClipboardHook(e) ); this.disposeWithMe({ dispose: () => r.forEach((e) => e.dispose()) }); } // eslint-disable-next-line max-lines-per-function _initCopyingHooks() { const r = this; let e = null; return { id: rt.DEFAULT_COPY, isDefaultHook: !0, onBeforeCopy(t, n) { e = r._getWorksheet(t, n); }, onCopyCellContent(t, n) { var o, l, a, c; const s = e.getCell(t, n); return (l = (o = s == null ? void 0 : s.p) == null ? void 0 : o.body) != null && l.paragraphs || (c = (a = s == null ? void 0 : s.p) == null ? void 0 : a.body) != null && c.textRuns ? zp(s.p.body) : s ? Wh(s) : ""; }, onCopyCellStyle: (t, n, s, i) => { const o = {}; (s || i) && (o.rowspan = `${s || 1}`, o.colspan = `${i || 1}`); const l = e.getRange(t, n), a = e.getMergedCell(t, n), c = l.getTextStyle(); let d = ""; if (c && (d = lu(c)), a) { const u = a.endRow, h = a.endColumn, f = e.getRange(u, h).getTextStyle(); if (f) { const g = lu(f); d ? d += g ? `;${g}` : "" : d = g; } } return d && (o.style = d), Object.keys(o).length ? o : null; }, onCopyColumn(t) { return { width: `${e.getColumnWidth(t)}` }; }, onCopyRow(t) { return { style: `height: ${e.getRowHeight(t)}px;` }; }, onAfterCopy() { e = null; }, getFilteredOutRows(t) { var l; const { startRow: n, endRow: s } = t, i = (l = r._currentUniverSheet.getCurrentUnitForType(O.UNIVER_SHEET)) == null ? void 0 : l.getActiveSheet(), o = []; if (!i) return o; for (let a = n; a <= s; a++) i.getRowFiltered(a) && o.push(a); return o; } }; } // eslint-disable-next-line max-lines-per-function _initPastingHook() { const r = this; let e = null, t = null, n = null; return { id: rt.DEFAULT_PASTE, isDefaultHook: !0, onBeforePaste({ unitId: s, subUnitId: i, range: o }) { n = r._getWorksheet(s, i), e = s, t = i; const l = r._configService.getConfig(uC), a = o.rows[o.rows.length - 1], c = o.cols[o.cols.length - 1]; return l && a * c > l ? (r._messageService.show({ type: Ym.Error, content: r._localService.t("clipboard.paste.exceedMaxCells") }), !1) : !0; }, // eslint-disable-next-line max-lines-per-function onPasteRows(s, i) { const { range: o } = s, l = [], a = [], c = n.getMaxRows(), d = c - 1, u = o.rows[o.rows.length - 1] - d, h = i.length - u, m = n.getRowManager(); if (u > 0) { const p = {}; i.slice(h).forEach((v, _) => { const { height: R } = v || {}; R && (p[_] = { h: Number.parseFloat(R), hd: Qe.FALSE }); }); const S = { startColumn: o.cols[0], endColumn: o.cols[o.cols.length - 1], endRow: o.rows[o.rows.length - 1], startRow: c }, b = { unitId: e, subUnitId: t, range: S, rowInfo: p }; l.push({ id: Ai.id, params: b }), a.push({ id: xi.id, params: { unitId: e, subUnitId: t, range: S } }); } const f = {}, g = {}; if (i.slice(0, h).forEach((p, S) => { var v, _; const { height: b } = p; if (b) { const R = m.getRow(o.rows[0] + S), I = Number.parseFloat(b); if (R) { const { h: y = oc, ah: M = 0 } = R, P = Math.max(y, M); I > P ? (f[S + o.rows[0]] = I, g[S + o.rows[0]] = P) : (f[S + o.rows[0]] = P, g[S + o.rows[0]] = P); } else f[S + o.rows[0]] = I, g[S + o.rows[0]] = (_ = (v = m.getRow(o.rows[0] + S)) == null ? void 0 : v.h) != null ? _ : oc; } }), Object.keys(f).length) { const p = { unitId: e, subUnitId: t, ranges: [{ startRow: o.rows[0], endRow: Math.min(o.rows[o.rows.length - 1], c), startColumn: o.cols[0], endColumn: o.cols[o.cols.length - 1] }], rowHeight: f }; l.push({ id: $s.id, params: p }), a.push({ id: $s.id, params: { ...p, rowHeight: g } }); } return { redos: l, undos: a }; }, // eslint-disable-next-line max-lines-per-function onPasteColumns(s, i, o) { var b; const { range: l } = s, a = [], c = [], d = n.getMaxColumns(), u = d - 1, h = l.cols[l.cols.length - 1] - u, m = i.length - h, f = (b = r._configService.getConfig(au)) != null ? b : cu, g = l.cols, p = g[0]; if (h > 0) { const v = { startRow: l.rows[0], endRow: l.rows[l.rows.length - 1], endColumn: l.cols[l.cols.length - 1], startColumn: d }, _ = { unitId: e, subUnitId: t, range: v, colInfo: i.slice(m).map((R, I) => ({ w: R.width ? Math.max(+R.width, n.getColumnWidth(g[I])) : f, hd: Qe.FALSE })) }; a.push({ id: Ni.id, params: _ }), c.push({ id: Oi.id, params: { unitId: e, subUnitId: t, range: v } }); } const S = { unitId: e, subUnitId: t, ranges: [{ startRow: l.rows[0], endRow: l.rows[l.rows.length - 1], startColumn: l.cols[0], endColumn: Math.min(l.cols[l.cols.length - 1], d) }] }; if (i.length > 0) { const v = { ...S, colWidth: i.slice(0, m).reduce((R, I, y) => { var M; return R[y + p] = I.width ? Math.max(+I.width, (M = n.getColumnWidth(g[y])) != null ? M : f) : f, R; }, {}) }, _ = { ...S, colWidth: i.slice(0, m).reduce((R, I, y) => { var M; return R[y + p] = (M = n.getColumnWidth(g[y])) != null ? M : f, R; }, {}) }; a.push({ id: Qt.id, params: v }), c.push({ id: Qt.id, params: _ }); } return { redos: a, undos: c }; }, onPastePlainText(s, i, o) { return r._onPastePlainText(s, i, o); }, onPasteCells(s, i, o, l) { return r._onPasteCells(s, i, o, l); }, onAfterPaste(s) { n = null; } }; } _generateDocumentDataModelSnapshot(r) { var o, l; const e = (o = this._renderManagerService.withCurrentTypeOfUnit(O.UNIVER_SHEET, me)) == null ? void 0 : o.getCurrent(); if (e == null) return null; const { skeleton: t } = e, n = (l = t.getBlankCellDocumentModel()) == null ? void 0 : l.documentModel, i = { ...n == null ? void 0 : n.getSnapshot(), ...r }; return n == null || n.reset(i), n == null ? void 0 : n.getSnapshot(); } _onPastePlainText(r, e, t) { const { range: n, unitId: s, subUnitId: i } = r; let o; if (/\r|\n/.test(e) || se.isLegalUrl(e)) { const a = zI(e), c = this._generateDocumentDataModelSnapshot({ body: a }); o = { [n.rows[0]]: { [n.cols[0]]: { p: c } } }; } else Kc(e) ? o = { [n.rows[0]]: { [n.cols[0]]: { f: e } } } : o = { [n.rows[0]]: { [n.cols[0]]: { v: e } } }; const l = { unitId: s, subUnitId: i, cellValue: o }; return { redos: [ { id: Se.id, params: l } ], undos: [ { id: Se.id, params: en(this._injector, l) } ] }; } _onPasteCells(r, e, t, n) { return this._injector.invoke((s) => UI(r, e, t, n, s)); } // eslint-disable-next-line max-lines-per-function _initSpecialPasteHooks() { const r = this, e = { id: rt.SPECIAL_PASTE_VALUE, specialPasteInfo: { label: "specialPaste.value" }, onPasteCells: (i, o, l) => this._injector.invoke((a) => Qg(o, i, l, a)) }, t = { id: rt.SPECIAL_PASTE_FORMAT, specialPasteInfo: { label: "specialPaste.format" }, onPasteCells: (i, o, l) => { const a = [], c = [], { undos: d, redos: u } = this._injector.invoke((p) => Jg(o, l, p)); a.push(...u), c.push(...d); const { undos: h, redos: m } = this._injector.invoke((p) => Wc( o, l, p )); a.push(...m), c.push(...h); const { undos: f, redos: g } = this._injector.invoke((p) => Kg( o, l, p )); return a.push(...g), c.push(...f), { undos: c, redos: a }; } }, n = { id: rt.SPECIAL_PASTE_COL_WIDTH, specialPasteInfo: { label: "specialPaste.colWidth" }, onPasteCells() { return { undos: [], redos: [] }; }, onPasteColumns(i, o, l) { var y, M; const a = r._currentUniverSheet.getCurrentUnitForType(O.UNIVER_SHEET), c = a.getUnitId(), d = (y = a.getActiveSheet()) == null ? void 0 : y.getSheetId(); if (!c || !d) throw new Error("Cannot find unitId or subUnitId"); const u = [], h = [], m = r._getWorksheet(c, d), { range: f } = i, g = f.cols, p = g[0], S = m.getMaxColumns(), b = f.cols[f.cols.length - 1] - S, v = o.length - b, _ = (M = r._configService.getConfig(au)) != null ? M : cu, R = { unitId: c, subUnitId: d, ranges: [{ startRow: f.rows[0], endRow: Math.min(f.cols[f.cols.length - 1], S), startColumn: f.cols[0], endColumn: f.cols[f.cols.length - 1] }], colWidth: o.slice(0, v).reduce((P, E, T) => { var A; return P[T + p] = E.width ? Math.max(+E.width, (A = m.getColumnWidth(g[T])) != null ? A : _) : _, P; }, {}) }, I = { unitId: c, subUnitId: d, ranges: [{ startRow: f.rows[0], endRow: Math.min(f.cols[f.cols.length - 1], S), startColumn: f.cols[0], endColumn: f.cols[f.cols.length - 1] }], colWidth: o.slice(0, v).reduce((P, E, T) => { var A; return P[T + p] = (A = m.getColumnWidth(g[T])) != null ? A : _, P; }, {}) }; return u.push({ id: Qt.id, params: R }), h.push({ id: Qt.id, params: I }), { redos: u, undos: h }; } }, s = { id: rt.SPECIAL_PASTE_BESIDES_BORDER, specialPasteInfo: { label: "specialPaste.besidesBorder" }, onPasteCells: (i, o, l, a) => { r._currentUniverSheet.getCurrentUnitForType(O.UNIVER_SHEET); const c = [], d = [], { range: u, unitId: h, subUnitId: m } = o, f = new Ke(); l.forValue((v, _, R) => { const I = R.s; if (typeof I == "object") { const y = se.deepClone(R); y.s && (y.s = { ...I, bd: null }), f.setValue(u.rows[v], u.cols[_], y); } }); const g = { unitId: h, subUnitId: m, cellValue: f.getData() }; c.push({ id: Se.id, params: g }); const p = this._injector.invoke( en, g ); d.push({ id: Se.id, params: p }); const { undos: S, redos: b } = this._injector.invoke((v) => Wc(o, l, v)); return d.push(...S), c.push(...b), { redos: c, undos: d }; } }; return [e, t, n, s]; } _getWorksheet(r, e) { var n; const t = (n = this._currentUniverSheet.getUniverSheetInstance(r)) == null ? void 0 : n.getSheetBySheetId(e); if (!t) throw new Error( `[SheetClipboardController]: cannot find a worksheet with unitId ${r} and subUnitId ${e}.` ); return t; } _initCommandListener() { var e; this.disposeWithMe( this._commandService.onCommandExecuted((t) => { t.id === or.id ? this._sheetClipboardService.removeMarkSelection() : qI.includes(t.id) && this._sheetClipboardService.removeMarkSelection(); }) ); const r = this._configService.getConfig(Pr); (e = r == null ? void 0 : r.clipboardConfig) != null && e.hidePasteOptions || this.disposeWithMe( this._commandService.onCommandExecuted((t) => { FI.includes(t.id) && this._sheetClipboardService.disposePasteOptionsCache(); }) ); } _initUIComponents() { var e; const r = this._configService.getConfig(Pr); (e = r == null ? void 0 : r.clipboardConfig) != null && e.hidePasteOptions || this.disposeWithMe( this._uiPartsService.registerComponent(js.CONTENT, () => Qr(BI, this._injector)) ); } }; _i = GI([ nn(0, D(vt)), nn(1, L), nn(2, Ce), nn(3, F), nn(4, Ne), nn(5, xr), nn(6, Sn), nn(7, Kh), nn(8, D(Ee)), nn(9, yl) ], _i); var QI = Object.defineProperty, KI = Object.getOwnPropertyDescriptor, JI = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? KI(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && QI(e, t, s), s; }, Rh = (r, e) => (t, n) => e(t, n, r); let wi = class extends ce { constructor(e, t) { super(); w(this, "_currentCell$", new xe()); w(this, "currentCell$", this._currentCell$.asObservable().pipe(cn( (e, t) => { var n, s, i, o, l, a, c, d; return ((n = e == null ? void 0 : e.location) == null ? void 0 : n.unitId) === ((s = t == null ? void 0 : t.location) == null ? void 0 : s.unitId) && ((i = e == null ? void 0 : e.location) == null ? void 0 : i.subUnitId) === ((o = t == null ? void 0 : t.location) == null ? void 0 : o.subUnitId) && ((l = e == null ? void 0 : e.location) == null ? void 0 : l.row) === ((a = t == null ? void 0 : t.location) == null ? void 0 : a.row) && ((c = e == null ? void 0 : e.location) == null ? void 0 : c.col) === ((d = t == null ? void 0 : t.location) == null ? void 0 : d.col); } ))); w(this, "_endCell$", new xe()); w(this, "endCell$", this._endCell$.asObservable()); this._univerInstanceService = e, this._renderManagerService = t, this._initCellDisposableListener(); } dispose() { super.dispose(), this._currentCell$.complete(), this._endCell$.complete(); } _initCellDisposableListener() { this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(O.UNIVER_SHEET).subscribe((e) => { e || (this._currentCell$.next(null), this._endCell$.next(null)); })); } _calcActiveCell(e, t) { const n = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET); if (!n) return null; const s = n.getActiveSheet(); if (!s) return; const i = this._renderManagerService.getRenderById(n.getUnitId()); if (!i) return; const o = i.with(me).getCurrent(), a = i.with(yt).getCurrentScrollState(); if (!(!o || !a || !i)) return Zf(i, n, s, o, e, t); } onDragOver(e) { const { offsetX: t, offsetY: n, dataTransfer: s } = e, i = this._calcActiveCell(t, n); if (!i) { this._currentCell$.next(null); return; } const { location: o, position: l } = i; this._currentCell$.next({ location: o, position: l, dataTransfer: s }); } onDrop(e) { const { offsetX: t, offsetY: n, dataTransfer: s } = e, i = this._calcActiveCell(t, n); if (!i) { this._endCell$.next(null); return; } const { location: o, position: l } = i; this._endCell$.next({ location: o, position: l, dataTransfer: s }); } }; wi = JI([ Rh(0, L), Rh(1, Ce) ], wi); var $I = Object.defineProperty, ey = Object.getOwnPropertyDescriptor, ty = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? ey(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && $I(e, t, s), s; }, qa = (r, e) => (t, n) => e(t, n, r); let Ko = class extends ce { constructor(r, e, t, n) { super(), this._context = r, this._renderManagerService = e, this._dragManagerService = t, this._sheetSkeletonManagerService = n, this._initDragEvent(); } _initDragEvent() { const r = new St(), e = (t) => { if (r.dispose(), !t) return; const { scene: n } = this._context, s = n.onDragOver$.subscribeEvent((o) => { this._dragManagerService.onDragOver(o); }), i = n.onDrop$.subscribeEvent((o) => { this._dragManagerService.onDrop(o); }); r.add({ dispose() { s.unsubscribe(), i.unsubscribe(); } }); }; e(this._sheetSkeletonManagerService.getCurrent()), this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((t) => { e(t); })); } }; Ko = ty([ qa(1, Ce), qa(2, D(wi)), qa(3, D(me)) ], Ko); const eu = (r, e) => { var u, h, m, f, g; const n = e.findNodePositionByCharIndex(r.startOffset, !0, r.segmentId, -1), s = e.getSkeletonData(); let i = r.endOffset; if (r.segmentId) { const p = (g = Array.from((h = (u = s == null ? void 0 : s.skeFooters.get(r.segmentId)) == null ? void 0 : u.values()) != null ? h : [])[0]) != null ? g : Array.from((f = (m = s == null ? void 0 : s.skeHeaders.get(r.segmentId)) == null ? void 0 : m.values()) != null ? f : [])[0]; p && (i = Math.min(p.ed, i)); } const o = e.findNodePositionByCharIndex(i, !0, r.segmentId, -1); if (!o || !n) return; const l = { docsLeft: 0, docsTop: 0, pageMarginLeft: 0, pageMarginTop: 0 }, a = new Ah(l, e), { borderBoxPointGroup: c } = a.getRangePointData(n, o); return Nh(c).map((p) => ({ top: p.top, bottom: p.bottom, left: p.left, right: p.right })); }, ny = (r, e, t = -1) => { const n = e.findPositionByGlyph(r, t); if (!n) return; const s = { ...n, isBack: !0 }, i = { docsLeft: 0, docsTop: 0, pageMarginLeft: 0, pageMarginTop: 0 }, o = new Ah(i, e), { borderBoxPointGroup: l } = o.getRangePointData(s, s), c = Nh(l)[0]; return { top: c.top, bottom: c.bottom, left: c.left, right: c.right }; }, ry = (r, e, t = 0, n = 0) => { const s = eu({ startOffset: e.startIndex, endOffset: e.endIndex + 1, collapsed: !1 }, r); if (s) return { rects: s.map((i) => ({ top: i.top + n, bottom: i.bottom + n, left: i.left + t, right: i.right + t })), range: e }; }, sy = (r, e, t = 0, n = 0) => { var u, h, m; const s = r.findNodeByCharIndex(e.startIndex), i = s == null ? void 0 : s.parent, o = i == null ? void 0 : i.parent, l = o == null ? void 0 : o.parent, a = l == null ? void 0 : l.lines.find((f) => f.paragraphStart && f.paragraphIndex === e.startIndex), c = (m = (h = (u = a == null ? void 0 : a.divides) == null ? void 0 : u[0]) == null ? void 0 : h.glyphGroup) == null ? void 0 : m[0]; if (!c || !c) return; const d = ny(c, r); if (d) return { rect: { top: d.top + n, bottom: d.bottom + n, left: d.left + t, right: d.right + t }, segmentId: void 0, segmentPageIndex: -1, paragraph: e }; }, iy = (r, e = 0, t = 0) => { var l, a, c, d, u, h, m; const n = r.getViewModel().getDataModel(), s = (c = (a = (l = n.getBody()) == null ? void 0 : l.customRanges) == null ? void 0 : a.filter((f) => f.rangeType === $c.HYPERLINK)) != null ? c : [], i = (h = (u = (d = n.getBody()) == null ? void 0 : d.paragraphs) == null ? void 0 : u.filter((f) => { var g; return ((g = f.bullet) == null ? void 0 : g.listType.indexOf(Yp.CHECK_LIST)) === 0; })) != null ? h : [], o = (m = r.getSkeletonData()) == null ? void 0 : m.pages[0].skeDrawings; return { links: s.map((f) => ry(r, f, e, t)).filter(Boolean), checkLists: i.map((f) => sy(r, f, e, t)).filter(Boolean), drawings: o ? Array.from(o.keys()).map((f) => ({ drawingId: f, rect: { top: o.get(f).aTop, bottom: o.get(f).aTop + o.get(f).width, left: o.get(f).aLeft, right: o.get(f).aLeft + o.get(f).height } })) : [] }; }; function $g(r, e, t) { var c, d, u, h; const n = (d = (c = e.documentSkeleton.getSkeletonData()) == null ? void 0 : c.pages[0].height) != null ? d : 0, s = (h = (u = e.documentSkeleton.getSkeletonData()) == null ? void 0 : u.pages[0].width) != null ? h : 0, i = e.verticalAlign, o = e.horizontalAlign; let l = 0; switch (i) { case an.UNSPECIFIED: case an.BOTTOM: l = r.mergeInfo.endY - r.mergeInfo.startY - n; break; case an.MIDDLE: l = (r.mergeInfo.endY - r.mergeInfo.startY - n) / 2; break; } let a = 0; switch (o) { case wt.RIGHT: a = r.mergeInfo.endX - r.mergeInfo.startX - s; break; case wt.CENTER: a = (r.mergeInfo.endX - r.mergeInfo.startX - s) / 2; break; case wt.UNSPECIFIED: { t && (a = r.mergeInfo.endX - r.mergeInfo.startX - s); break; } } return { paddingLeft: a, paddingTop: l }; } const iE = (r, e, t, n, s, i) => { var T, A, H; const o = r.get(L), l = r.get(Ce), a = o.getUnit(e, O.UNIVER_SHEET); if (!a) return null; const c = a.getSheetBySheetId(t); if (!c) return null; const d = l.getRenderById(a.getUnitId()), u = d == null ? void 0 : d.with(me).getWorksheetSkeleton(c.getSheetId()), h = u == null ? void 0 : u.skeleton; if (!h || !d) return; const m = h.getFont(n, s), f = m == null ? void 0 : m.documentSkeleton; if (!f) return null; const g = (A = (T = f.getViewModel().getBody()) == null ? void 0 : T.customRanges) == null ? void 0 : A.find((x) => x.rangeId === i); if (!g) return null; const p = Tp, S = h.getCellWithCoordByIndex(n, s); let { actualColumn: b, actualRow: v } = S; h.overflowCache.forValue((x, k, U) => { U.startRow <= v && U.endRow >= v && U.startColumn <= b && U.endColumn >= b && (b = k, v = x); }); const _ = h.getCellWithCoordByIndex(v, b), R = c.getCell(_.actualRow, _.actualColumn), { topOffset: I = 0, leftOffset: y = 0 } = (H = R == null ? void 0 : R.fontRenderExtension) != null ? H : {}, { paddingLeft: M, paddingTop: P } = $g(_, m, !1), E = eu({ startOffset: g.startIndex, endOffset: g.endIndex, collapsed: !1 }, f); return { rects: E == null ? void 0 : E.map((x) => ({ top: x.top + _.mergeInfo.startY + P + I + p, bottom: x.bottom + _.mergeInfo.startY + P + I + p, left: x.left + _.mergeInfo.startX + M + y, right: x.right + _.mergeInfo.startX + M + y })), customRange: g, label: f.getViewModel().getBody().dataStream.slice(g.startIndex, g.endIndex + 1) }; }, oE = (r, e, t, n, s, i) => { var y, M, P; const o = r.get(tt), l = o.getEditCellState(); if (!l || !o.isVisible().visible) return null; const { editorUnitId: c, unitId: d, sheetId: u, row: h, column: m } = l; if (e !== d || t !== u || h !== n || m !== s) return null; const f = r.get(Ce), g = f.getRenderById(c), p = f.getRenderById(e); if (!g || !p) return null; const S = g.with(Jn).getSkeleton(), b = (y = p.with(me).getWorksheetSkeleton(u)) == null ? void 0 : y.skeleton; if (!S || !b) return null; const v = (P = (M = S.getViewModel().getBody()) == null ? void 0 : M.customRanges) == null ? void 0 : P.find((E) => E.rangeId === i); if (!v) return null; const _ = 4, R = eu({ startOffset: v.startIndex, endOffset: v.endIndex, collapsed: !1 }, S), I = g.engine.getCanvasElement().getBoundingClientRect(); return { rects: R == null ? void 0 : R.map((E) => ({ top: E.top + I.top - _, bottom: E.bottom + I.top + _, left: E.left + I.left, right: E.right + I.left })), customRange: v, label: S.getViewModel().getBody().dataStream.slice(v.startIndex, v.endIndex + 1) }; }; var oy = Object.defineProperty, ly = Object.getOwnPropertyDescriptor, ay = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? ly(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && oy(e, t, s), s; }, Ih = (r, e) => (t, n) => e(t, n, r); function ur(r) { const { workbook: e, worksheet: t, ...n } = r; return n; } let Er = class extends ce { constructor(e, t) { super(); w(this, "_currentCell$", new Me(null)); w(this, "_currentRichText$", new Me(null)); w(this, "_currentClickedCell$", new xe()); w(this, "_currentDbClickedCell$", new xe()); w(this, "_currentCellWithEvent$", new xe()); w(this, "_currentPointerDownCell$", new xe()); w(this, "_currentPointerUpCell$", new xe()); w(this, "_currentHoveredRowHeader$", new Me(null)); w(this, "_currentHoveredColHeader$", new Me(null)); w(this, "_currentRowHeaderClick$", new xe()); w(this, "_currentColHeaderClick$", new xe()); w(this, "_currentRowHeaderDbClick$", new xe()); w(this, "_currentColHeaderDbClick$", new xe()); w(this, "_currentRowHeaderPointerDown$", new xe()); w(this, "_currentColHeaderPointerDown$", new xe()); w(this, "_currentRowHeaderPointerUp$", new xe()); w(this, "_currentColHeaderPointerUp$", new xe()); // Notify when hovering over different cells w(this, "currentCell$", this._currentCell$.asObservable().pipe( cn( (e, t) => { var n, s, i, o, l, a, c, d; return ((n = e == null ? void 0 : e.location) == null ? void 0 : n.unitId) === ((s = t == null ? void 0 : t.location) == null ? void 0 : s.unitId) && ((i = e == null ? void 0 : e.location) == null ? void 0 : i.subUnitId) === ((o = t == null ? void 0 : t.location) == null ? void 0 : o.subUnitId) && ((l = e == null ? void 0 : e.location) == null ? void 0 : l.row) === ((a = t == null ? void 0 : t.location) == null ? void 0 : a.row) && ((c = e == null ? void 0 : e.location) == null ? void 0 : c.col) === ((d = t == null ? void 0 : t.location) == null ? void 0 : d.col); } ) )); // Notify when hovering over different cells and different custom range or bullet w(this, "currentRichText$", this._currentRichText$.pipe( cn( // eslint-disable-next-line complexity (e, t) => { var n, s, i, o, l, a, c, d, u, h, m, f, g, p, S, b; return ((n = e == null ? void 0 : e.location) == null ? void 0 : n.unitId) === ((s = t == null ? void 0 : t.location) == null ? void 0 : s.unitId) && ((i = e == null ? void 0 : e.location) == null ? void 0 : i.subUnitId) === ((o = t == null ? void 0 : t.location) == null ? void 0 : o.subUnitId) && ((l = e == null ? void 0 : e.location) == null ? void 0 : l.row) === ((a = t == null ? void 0 : t.location) == null ? void 0 : a.row) && ((c = e == null ? void 0 : e.location) == null ? void 0 : c.col) === ((d = t == null ? void 0 : t.location) == null ? void 0 : d.col) && ((u = e == null ? void 0 : e.customRange) == null ? void 0 : u.rangeId) === ((h = t == null ? void 0 : t.customRange) == null ? void 0 : h.rangeId) && ((m = e == null ? void 0 : e.bullet) == null ? void 0 : m.startIndex) === ((f = t == null ? void 0 : t.bullet) == null ? void 0 : f.startIndex) && ((g = e == null ? void 0 : e.customRange) == null ? void 0 : g.startIndex) === ((p = t == null ? void 0 : t.customRange) == null ? void 0 : p.startIndex) && ((S = e == null ? void 0 : e.customRange) == null ? void 0 : S.endIndex) === ((b = t == null ? void 0 : t.customRange) == null ? void 0 : b.endIndex) && (e == null ? void 0 : e.drawing) === (t == null ? void 0 : t.drawing); } ), _e((e) => e && { unitId: e.location.unitId, subUnitId: e.location.subUnitId, row: e.location.row, col: e.location.col, customRange: e.customRange, bullet: e.bullet, rect: e.rect, drawing: e.drawing }) )); /** * Nearly same as currentRichText$, but with event */ w(this, "currentCellPosWithEvent$", this._currentCellWithEvent$.pipe( cn( (e, t) => { var n, s, i, o, l, a, c, d; return ((n = e == null ? void 0 : e.location) == null ? void 0 : n.unitId) === ((s = t == null ? void 0 : t.location) == null ? void 0 : s.unitId) && ((i = e == null ? void 0 : e.location) == null ? void 0 : i.subUnitId) === ((o = t == null ? void 0 : t.location) == null ? void 0 : o.subUnitId) && ((l = e == null ? void 0 : e.location) == null ? void 0 : l.row) === ((a = t == null ? void 0 : t.location) == null ? void 0 : a.row) && ((c = e == null ? void 0 : e.location) == null ? void 0 : c.col) === ((d = t == null ? void 0 : t.location) == null ? void 0 : d.col); } ), _e((e) => e && { unitId: e.location.unitId, subUnitId: e.location.subUnitId, row: e.location.row, col: e.location.col, event: e.event }) )); // Notify when mouse position changes w(this, "currentPosition$", this._currentCell$.asObservable()); w(this, "currentClickedCell$", this._currentClickedCell$.asObservable()); w(this, "currentDbClickedCell$", this._currentDbClickedCell$.asObservable()); w(this, "currentPointerDownCell$", this._currentPointerDownCell$.asObservable()); w(this, "currentPointerUpCell$", this._currentPointerUpCell$.asObservable()); w(this, "currentHoveredRowHeader$", this._currentHoveredRowHeader$.asObservable()); w(this, "currentHoveredColHeader$", this._currentHoveredColHeader$.asObservable()); w(this, "currentRowHeaderClick$", this._currentRowHeaderClick$.asObservable()); w(this, "currentColHeaderClick$", this._currentColHeaderClick$.asObservable()); w(this, "currentRowHeaderDbClick$", this._currentRowHeaderDbClick$.asObservable()); w(this, "currentColHeaderDbClick$", this._currentColHeaderDbClick$.asObservable()); w(this, "currentRowHeaderPointerDown$", this._currentRowHeaderPointerDown$.asObservable()); w(this, "currentColHeaderPointerDown$", this._currentColHeaderPointerDown$.asObservable()); w(this, "currentRowHeaderPointerUp$", this._currentRowHeaderPointerUp$.asObservable()); w(this, "currentColHeaderPointerUp$", this._currentColHeaderPointerUp$.asObservable()); this._univerInstanceService = e, this._renderManagerService = t, this._initCellDisposableListener(); } dispose() { super.dispose(), this._currentCell$.complete(), this._currentClickedCell$.complete(), this._currentPointerDownCell$.complete(), this._currentPointerUpCell$.complete(), this._currentCellWithEvent$.complete(); } _initCellDisposableListener() { this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(O.UNIVER_SHEET).subscribe((e) => { e || this._currentCell$.next(null); })), this.disposeWithMe(this._univerInstanceService.unitDisposed$.subscribe((e) => { var t, n; ((t = this._currentCell$.getValue()) == null ? void 0 : t.location.unitId) === e.getUnitId() && this._currentCell$.next(null), ((n = this._currentRichText$.getValue()) == null ? void 0 : n.location.unitId) === e.getUnitId() && this._currentRichText$.next(null); })); } _getCalcDeps(e) { const t = this._univerInstanceService.getUnit(e, O.UNIVER_SHEET); if (!t) return null; const n = t.getActiveSheet(); if (!n) return null; const s = this._renderManagerService.getRenderById(t.getUnitId()); if (!s) return null; const i = s.with(me).getWorksheetSkeleton(n.getSheetId()); if (!i) return null; const o = s.with(yt); if (!(!(o != null && o.getCurrentScrollState()) || !s)) return { currentRender: s, workbook: t, worksheet: n, skeletonParam: i }; } _calcActiveCell(e, t, n, s, i, o) { var R, I, y; const l = Zf(e, t, n, s, i, o), a = s.skeleton; if (!l) return null; const { position: c, overflowLocation: d, location: u } = l, h = a.getFont(d.row, d.col); let m = null, f = null, g = null; const p = a.getCellWithCoordByIndex(d.row, d.col), S = n.getCell(d.row, d.col), { topOffset: b = 0, leftOffset: v = 0 } = (R = S == null ? void 0 : S.fontRenderExtension) != null ? R : {}; if (h) { const { paddingLeft: M, paddingTop: P } = $g(p, h, (S == null ? void 0 : S.v) !== null && (S == null ? void 0 : S.v) !== void 0 ? !Number.isNaN(+S.v) : !1), E = iy(h.documentSkeleton, M, P), T = i - c.startX - v, A = o - c.startY - b; m = E.links.find((H) => H.rects.some((x) => x.left <= T && T <= x.right && x.top <= A && A <= x.bottom)), f = E.checkLists.find((H) => H.rect.left <= T && T <= H.rect.right && H.rect.top <= A && A <= H.rect.bottom), g = E.drawings.find((H) => H.rect.left <= T && T <= H.rect.right && H.rect.top <= A && A <= H.rect.bottom); } const _ = (y = (I = m == null ? void 0 : m.rects.pop()) != null ? I : f == null ? void 0 : f.rect) != null ? y : g == null ? void 0 : g.rect; return { location: u, position: c, overflowLocation: d, customRange: m == null ? void 0 : m.range, bullet: f == null ? void 0 : f.paragraph, drawing: g == null ? void 0 : g.drawingId, rect: _ && { top: _.top + p.mergeInfo.startY + b, bottom: _.bottom + p.mergeInfo.startY + b, left: _.left + p.mergeInfo.startX + v, right: _.right + p.mergeInfo.startX + v } }; } _calcActiveRowHeader(e, t, n) { const s = this._getCalcDeps(e); if (!s) return; const { currentRender: i, worksheet: o, skeletonParam: l } = s, { scaleY: a } = i.scene.getAncestorScale(), c = i.scene.getViewports().find((h) => h.isHit(new Oe(t, n))); if (!c || c.viewportKey !== z.VIEW_ROW_TOP && c.viewportKey !== z.VIEW_ROW_BOTTOM) return; const d = { x: c.viewportScrollX, y: c.viewportScrollY }, u = l.skeleton.getRowIndexByOffsetY(n, a, d); return { unitId: e, index: u, subUnitId: o.getSheetId() }; } _calcActiveColHeader(e, t, n) { const s = this._getCalcDeps(e); if (!s) return; const { currentRender: i, worksheet: o, skeletonParam: l } = s, { scaleX: a } = i.scene.getAncestorScale(), c = i.scene.getViewports().find((h) => h.isHit(new Oe(t, n))); if (!c || c.viewportKey !== z.VIEW_COLUMN_LEFT && c.viewportKey !== z.VIEW_COLUMN_RIGHT) return; const d = { x: c.viewportScrollX, y: c.viewportScrollY }, u = l.skeleton.getColumnIndexByOffsetX(t, a, d); return { unitId: e, index: u, subUnitId: o.getSheetId() }; } triggerPointerDown(e, t) { const n = this._getCalcDeps(e); if (!n) return; const { currentRender: s, workbook: i, worksheet: o, skeletonParam: l } = n, a = this._calcActiveCell(s, i, o, l, t.offsetX, t.offsetY); if (a && a.location) { const { unitId: c, subUnitId: d, row: u, col: h } = ur(a.location); this._currentPointerDownCell$.next({ unitId: c, subUnitId: d, row: u, col: h, event: t }); } } triggerPointerUp(e, t) { const n = this._getCalcDeps(e); if (!n) return; const { currentRender: s, workbook: i, worksheet: o, skeletonParam: l } = n, a = this._calcActiveCell(s, i, o, l, t.offsetX, t.offsetY); if (a) { const c = ur(a.location); this._currentPointerUpCell$.next({ ...c, event: t }); } } triggerMouseMove(e, t) { const n = this._getCalcDeps(e); if (!n) return; const { currentRender: s, workbook: i, worksheet: o, skeletonParam: l } = n, a = this._calcActiveCell(s, i, o, l, t.offsetX, t.offsetY); this._currentCell$.next(a && { location: ur(a.location), position: a.position }), this._currentRichText$.next(a && { ...a, location: ur(a.overflowLocation) }), this._currentCellWithEvent$.next(a && { ...a, location: ur(a.location), event: t }); } /** * Trigger by pointerup. * @param unitId * @param offsetX * @param offsetY */ triggerClick(e, t, n) { const s = this._getCalcDeps(e); if (!s) return; const { currentRender: i, workbook: o, worksheet: l, skeletonParam: a } = s, c = this._calcActiveCell(i, o, l, a, t, n); c && this._currentClickedCell$.next({ ...c, location: ur(c.location) }); } triggerDbClick(e, t, n) { const s = this._getCalcDeps(e); if (!s) return; const { currentRender: i, workbook: o, worksheet: l, skeletonParam: a } = s, c = this._calcActiveCell(i, o, l, a, t, n); c && this._currentDbClickedCell$.next({ ...c, location: ur(c.location) }); } triggerScroll() { this._currentCell$.next(null); } triggerRowHeaderClick(e, t, n) { const s = this._calcActiveRowHeader(e, t, n); s && this._currentRowHeaderClick$.next(s); } triggerColHeaderClick(e, t, n) { const s = this._calcActiveColHeader(e, t, n); s && this._currentColHeaderClick$.next(s); } triggerRowHeaderDbClick(e, t, n) { const s = this._calcActiveRowHeader(e, t, n); s && this._currentRowHeaderDbClick$.next(s); } triggerColHeaderDbClick(e, t, n) { const s = this._calcActiveColHeader(e, t, n); s && this._currentColHeaderDbClick$.next(s); } triggerRowHeaderMouseMove(e, t, n) { this._currentHoveredRowHeader$.next(this._calcActiveRowHeader(e, t, n)); } triggerColHeaderMouseMove(e, t, n) { this._currentHoveredColHeader$.next(this._calcActiveColHeader(e, t, n)); } triggerRowHeaderPoniterDown(e, t, n) { const s = this._calcActiveRowHeader(e, t, n); s && this._currentRowHeaderPointerDown$.next(s); } triggerColHeaderPoniterDown(e, t, n) { const s = this._calcActiveColHeader(e, t, n); s && this._currentColHeaderPointerDown$.next(s); } triggerRowHeaderPoniterUp(e, t, n) { const s = this._calcActiveRowHeader(e, t, n); s && this._currentRowHeaderPointerUp$.next(s); } triggerColHeaderPoniterUp(e, t, n) { const s = this._calcActiveColHeader(e, t, n); s && this._currentColHeaderPointerUp$.next(s); } }; Er = ay([ Ih(0, L), Ih(1, Ce) ], Er); var cy = Object.defineProperty, dy = Object.getOwnPropertyDescriptor, uy = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? dy(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && cy(e, t, s), s; }, no = (r, e) => (t, n) => e(t, n, r); const Qa = "SHEET_FORCE_STRING_ALERT"; let Jo = class extends ce { constructor(r, e, t, n, s) { super(), this._context = r, this._hoverManagerService = e, this._cellAlertManagerService = t, this._localeService = n, this._zenZoneService = s, this._init(); } _init() { this._initCellAlertPopup(), this._initZenService(); } _initCellAlertPopup() { this.disposeWithMe(this._hoverManagerService.currentCell$.subscribe((r) => { var e; if (r) { const n = this._context.unit.getActiveSheet(); if (!n) return; const s = n.getCell(r.location.row, r.location.col); if ((s == null ? void 0 : s.t) === ln.FORCE_STRING && s.v && Uh(s.v)) { const i = this._cellAlertManagerService.currentAlert.get(Qa), o = (e = i == null ? void 0 : i.alert) == null ? void 0 : e.location; if (o && o.row === r.location.row && o.col === r.location.col && o.subUnitId === r.location.subUnitId && o.unitId === r.location.unitId) return; this._cellAlertManagerService.showAlert({ type: Ks.ERROR, title: this._localeService.t("info.error"), message: this._localeService.t("info.forceStringInfo"), location: r.location, width: 200, height: 74, key: Qa }); return; } } this._hideAlert(); })); } _initZenService() { this.disposeWithMe(this._zenZoneService.visible$.subscribe((r) => { r && this._hideAlert(); })); } _hideAlert() { this._cellAlertManagerService.removeAlert(Qa); } }; Jo = uy([ no(1, D(Er)), no(2, D(bi)), no(3, D(Ee)), no(4, yS) ], Jo); var hy = Object.defineProperty, my = Object.getOwnPropertyDescriptor, fy = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? my(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && hy(e, t, s), s; }, yh = (r, e) => (t, n) => e(t, n, r); let $o = class extends kn { constructor(r, e, t) { super(), this._context = r, this._sheetSkeletonManagerService = e, this._sheetInterceptorService = t, this._initViewModelIntercept(); } _initViewModelIntercept() { const r = { tl: { size: 6, color: "#409f11" } }; this.disposeWithMe( this._sheetInterceptorService.intercept( hC.CELL_CONTENT, { priority: 10, effect: Zp.Style, handler: (e, t, n) => { var o; if (!((o = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : o.skeleton)) return n(e); const i = t.worksheet.getCellRaw(t.row, t.col); return !i || i.v === null || i.v === void 0 ? n(e) : (e == null ? void 0 : e.t) === ln.FORCE_STRING && Uh(i.v) ? n({ ...e, markers: { ...e == null ? void 0 : e.markers, ...r } }) : n(e); } } ) ); } }; $o = fy([ yh(1, D(me)), yh(2, D(Ln)) ], $o); var gy = Object.defineProperty, py = Object.getOwnPropertyDescriptor, Sy = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? py(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && gy(e, t, s), s; }, Ka = (r, e) => (t, n) => e(t, n, r); let el = class extends ce { constructor(e, t, n, s) { super(); w(this, "_active", !1); this._context = e, this._hoverManagerService = t, this._sheetSkeletonManagerService = n, this._scrollManagerService = s, this._initPointerEvent(), this._initScrollEvent(); } get active() { return this._active; } // eslint-disable-next-line max-lines-per-function _initPointerEvent() { const e = new St(), t = (n) => { if (e.dispose(), !n) return; const { mainComponent: s, unitId: i, components: o } = this._context; if (!s) return; e.add(s.onPointerEnter$.subscribeEvent((c) => { this._active = !0; })), e.add(Hh(s.onPointerMove$).subscribe((c) => { this._active = !0, this._hoverManagerService.triggerMouseMove(i, c); })), e.add(s.onPointerDown$.subscribeEvent((c) => { this._hoverManagerService.triggerPointerDown(i, c); })), e.add(s.onPointerUp$.subscribeEvent((c) => { this._hoverManagerService.triggerPointerUp(i, c), this._hoverManagerService.triggerClick(i, c.offsetX, c.offsetY); })), e.add(s.onDblclick$.subscribeEvent((c) => { this._hoverManagerService.triggerDbClick(i, c.offsetX, c.offsetY); })), e.add(s.onPointerLeave$.subscribeEvent(() => { this._active = !1; })); const l = o.get(qe.ROW), a = o.get(qe.COLUMN); l && (e.add(l.onPointerMove$.subscribeEvent((c) => { this._hoverManagerService.triggerRowHeaderMouseMove(i, c.offsetX, c.offsetY); })), e.add(l.onPointerDown$.subscribeEvent((c) => { this._hoverManagerService.triggerRowHeaderPoniterDown(i, c.offsetX, c.offsetY); })), e.add(l.onPointerUp$.subscribeEvent((c) => { this._hoverManagerService.triggerRowHeaderPoniterUp(i, c.offsetX, c.offsetY), this._hoverManagerService.triggerRowHeaderClick(i, c.offsetX, c.offsetY); })), e.add(l.onDblclick$.subscribeEvent((c) => { this._hoverManagerService.triggerRowHeaderDbClick(i, c.offsetX, c.offsetY); }))), a && (e.add(a.onPointerMove$.subscribeEvent((c) => { this._hoverManagerService.triggerColHeaderMouseMove(i, c.offsetX, c.offsetY); })), e.add(a.onPointerDown$.subscribeEvent((c) => { this._hoverManagerService.triggerColHeaderPoniterDown(i, c.offsetX, c.offsetY); })), e.add(a.onPointerUp$.subscribeEvent((c) => { this._hoverManagerService.triggerColHeaderPoniterUp(i, c.offsetX, c.offsetY), this._hoverManagerService.triggerColHeaderClick(i, c.offsetX, c.offsetY); })), e.add(a.onDblclick$.subscribeEvent((c) => { this._hoverManagerService.triggerColHeaderDbClick(i, c.offsetX, c.offsetY); }))); }; t(this._sheetSkeletonManagerService.getCurrent()), this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((n) => { t(n); })); } _initScrollEvent() { this.disposeWithMe(this._scrollManagerService.validViewportScrollInfo$.subscribe(() => this._hoverManagerService.triggerScroll())); } }; el = Sy([ Ka(1, D(Er)), Ka(2, D(me)), Ka(3, D(yt)) ], el); var Cy = Object.defineProperty, vy = Object.getOwnPropertyDescriptor, by = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? vy(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && Cy(e, t, s), s; }, Ja = (r, e) => (t, n) => e(t, n, r); let tl = class extends ce { constructor(r, e, t, n) { super(), this._context = r, this._markSelectionService = e, this._commandService = t, this._sheetSkeletonManagerService = n, this._initListeners(); } _initListeners() { this._addRemoveListener(), this._addRefreshListener(); } _addRemoveListener() { const r = [Et.id]; this.disposeWithMe( this._commandService.onCommandExecuted((e) => { r.includes(e.id) ? this._markSelectionService.removeAllShapes() : this._markSelectionService.getShapeMap().forEach((n, s) => { n.exits.includes(e.id) && this._markSelectionService.removeShape(s); }); }) ); } _addRefreshListener() { this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((r) => { r && this._markSelectionService.refreshShapes(); })); } }; tl = by([ Ja(1, D(ws)), Ja(2, F), Ja(3, D(me)) ], tl); const _y = "univer-mobile-sheet-bar-container", wy = "univer-mobile-sheet-bar-slider", Ry = "univer-mobile-sheet-bar-item", Iy = "univer-mobile-sheet-bar-item-activated", ro = { mobileSheetBarContainer: _y, mobileSheetBarSlider: wy, mobileSheetBarItem: Ry, mobileSheetBarItemActivated: Iy }; function yy() { const r = Wn(); return r ? /* @__PURE__ */ C.jsx(My, { workbook: r }) : null; } function My(r) { const { workbook: e } = r, [t, n] = te([]), [s, i] = te(""), o = od.useRef(/* @__PURE__ */ new Map()), l = W(F), a = On(() => { const d = e.getActiveSheet().getSheetId(), u = e.getSheets(), h = e.getActiveSheet(), m = u.filter((f) => !f.isSheetHidden()).map((f, g) => { var p; return { sheetId: f.getSheetId(), label: f.getName(), index: g, selected: h === f, color: (p = f.getTabColor()) != null ? p : void 0 }; }); if (n(m), i(d), o.current.has(d)) { const f = o.current.get(d); f && f.scrollIntoView({ behavior: "smooth", block: "nearest" }); } o.current.clear(); }, [e]); be(() => a(), [a]); const c = On((d) => { l.executeCommand(et.id, { unitId: e.getUnitId(), subUnitId: d }); }, [l, e]); return be(() => { const d = l.onCommandExecuted((u) => { switch (u.id) { case nr.id: case An.id: case Rd.id: case Nr.id: case wd.id: case et.id: a(); break; } }); return () => d.dispose(); }, [l, a]), /* @__PURE__ */ C.jsx("div", { className: ro.mobileSheetBarContainer, children: /* @__PURE__ */ C.jsx("div", { className: ro.mobileSheetBarSlider, children: t.map((d) => /* @__PURE__ */ C.jsx( "div", { className: st( ro.mobileSheetBarItem, { [ro.mobileSheetBarItemActivated]: d.sheetId === s } ), onClick: () => c(d.sheetId), ref: (u) => o.current.set(d.sheetId, u), children: d.label }, d.sheetId )) }) }); } const Py = { [Ct.MAIN_AREA]: { [Ge.FORMAT]: { [hn.name]: { order: 0, menuItemFactory: $r } }, [Ge.DATA]: { order: 2 }, [Ge.OTHERS]: { order: 3 } }, [Ct.COL_HEADER]: { [Ge.FORMAT]: { [hn.name]: { order: 0, menuItemFactory: $r } }, [Ge.LAYOUT]: { order: 1 }, [Ge.DATA]: { order: 2 }, [Ge.OTHERS]: { order: 3 } }, [Ct.ROW_HEADER]: { [Ge.FORMAT]: { [hn.name]: { order: 0, menuItemFactory: $r } }, [Ge.LAYOUT]: { order: 1 }, [Ge.DATA]: { order: 2 }, [Ge.OTHERS]: { order: 3 } } }; var Ey = Object.defineProperty, Ty = Object.getOwnPropertyDescriptor, xy = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? Ty(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && Ey(e, t, s), s; }, hr = (r, e) => (t, n) => e(t, n, r); let nl = class extends ce { constructor(r, e, t, n, s, i, o) { super(), this._injector = r, this._componentManager = e, this._layoutService = t, this._commandService = n, this._shortcutService = s, this._menuManagerService = i, this._uiPartsService = o, this._init(); } _init() { this._initCustomComponents(), this._initCommands(), this._initMenus(), this._initShortcuts(), this._initWorkbenchParts(), this._initFocusHandler(); } _initCustomComponents() { const r = this._componentManager; this.disposeWithMe(r.register(Kl, Ef)), this.disposeWithMe(r.register($d, rg)), this.disposeWithMe(r.register(Fi, Md)), this.disposeWithMe(r.register(Fd, Jh)), this.disposeWithMe(r.register(Ud, $h)), this.disposeWithMe(r.register(jd, em)), this.disposeWithMe(r.register(Si, ig)); } _initCommands() { [ Gd, or, Qd, qd, Li, Gt, Lt, Fn, aa, sa, gi, pi, Ul, jl, un, of, Vd, Kd, ud, cs, Et, Wl, Rs, Is, ys, Ms, yf, Mf, Xl, zl, di, hd, fd, pd, gd, Yl, Bd, Bi, Zl, dn, li, $n, Gl, ql, md, Wi, $t, ia, Ll, fs, ms, zi, Xi, Jd, pr, si, // permission Vn, tg, ta, es, ts, na, ra, la, ns, rs, oa ].forEach((r) => { this.disposeWithMe(this._commandService.registerCommand(r)); }); } _initMenus() { this._menuManagerService.mergeMenu(Py); } _initShortcuts() { [ // selection shortcuts Sg, Cg, vg, bg, _g, wg, Rg, Ig, // MoveBackSelectionShortcutItem, yg, Mg, Pg, Eg, Tg, xg, Og, Ag, Ng, Hg, Vg, kg, Dg, // view shortcuts jg, zg, Zg, Gg, Xg, Yg, // toggle cell style shortcuts Lg, Wg, Bg, Fg, // cell content editing shortcuts Ug, ...hf(), ff, mf, gf, Sf, Cf, vf, pf, // operation shortcuts gg, pg ].forEach((r) => { this.disposeWithMe(this._shortcutService.registerShortcut(r)); }); } _initWorkbenchParts() { this._uiPartsService.registerComponent(js.HEADER, () => Qr(yy, this._injector)); } _initFocusHandler() { this.disposeWithMe( this._layoutService.registerFocusHandler(O.UNIVER_SHEET, (r) => { }) ); } }; nl = xy([ hr(0, D(vt)), hr(1, D(Dn)), hr(2, _l), hr(3, F), hr(4, Il), hr(5, id), hr(6, yl) ], nl); const Bc = "UNIVER_SHEET_PERMISSION_ALERT_DIALOG_ID", ep = "UNIVER_SHEET_PERMISSION_ALERT_DIALOG"; var Oy = Object.defineProperty, Ay = Object.getOwnPropertyDescriptor, Ny = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? Ay(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && Oy(e, t, s), s; }, bn = (r, e) => (t, n) => e(t, n, r); let Ri = class extends ce { constructor(e, t, n, s, i, o, l, a, c) { super(); w(this, "disposableCollection", new St()); this._commandService = e, this._univerInstanceService = t, this._permissionService = n, this._dialogService = s, this._rangeProtectionRuleModel = i, this._autoFillService = o, this._localeService = l, this._contextService = a, this._sheetPermissionCheckController = c, this._initialize(), this._initUIEvent(); } _initUIEvent() { this.disposeWithMe( this._sheetPermissionCheckController.triggerPermissionUIEvent$.subscribe((e) => { this._haveNotPermissionHandle(e); }) ); } _haveNotPermissionHandle(e) { const t = { id: Bc, title: { title: "" }, children: { label: ep, errorMsg: e }, width: 320, destroyOnClose: !0, onClose: () => this._dialogService.close(Bc), className: "sheet-permission-user-dialog" }; this._permissionService.getShowComponents() && this._dialogService.open(t); } _getPermissionCheck(e, t) { var i, o; let n = !0, s = ""; switch (e) { case Op.id: case xp.id: if (this._contextService.getContextValue(Sl) === !0) break; n = this._sheetPermissionCheckController.permissionCheckWithoutRange({ workbookTypes: [q], rangeTypes: [re], worksheetTypes: [Ut, ee] }), s = this._localeService.t("permission.dialog.editErr"); break; case Et.id: if (t.visible === !1) break; n = this._sheetPermissionCheckController.permissionCheckWithoutRange({ workbookTypes: [q], rangeTypes: [re], worksheetTypes: [Ut, ee] }), s = this._localeService.t("permission.dialog.editErr"); break; case Jr.id: n = this._sheetPermissionCheckController.permissionCheckWithoutRange({ workbookTypes: [q], rangeTypes: [re], worksheetTypes: [ee, Or] }), s = this._localeService.t("permission.dialog.pasteErr"); break; case xc.id: n = this._permissionCheckByPaste(t), s = this._localeService.t("permission.dialog.pasteErr"); break; case Zl.id: n = this._sheetPermissionCheckController.permissionCheckWithRanges({ workbookTypes: [q], rangeTypes: [re], worksheetTypes: [ee, Ut, ze] }), s = this._localeService.t("permission.dialog.commonErr"); break; case Mo.id: case Rs.id: case Is.id: case ys.id: case Ms.id: n = this._sheetPermissionCheckController.permissionCheckWithRanges({ workbookTypes: [q], rangeTypes: [re], worksheetTypes: [ze, ee] }), s = this._localeService.t("permission.dialog.setStyleErr"); break; case hn.id: n = this._sheetPermissionCheckController.permissionCheckWithRanges({ workbookTypes: [Bs], rangeTypes: [uc], worksheetTypes: [yo] }), s = this._localeService.t("permission.dialog.copyErr"), (i = this._permissionService.getPermissionPoint(new Bs(this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET).getUnitId()).id)) != null && i.value || (s = this._localeService.t("permission.dialog.workbookCopyErr")); break; case Rf.id: n = this._sheetPermissionCheckController.permissionCheckWithRanges({ workbookTypes: [Bs, q], rangeTypes: [uc, re], worksheetTypes: [yo, ee] }), s = this._localeService.t("permission.dialog.copyErr"), (o = this._permissionService.getPermissionPoint(new Bs(this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET).getUnitId()).id)) != null && o.value || (s = this._localeService.t("permission.dialog.workbookCopyErr")); break; case pr.id: n = this._permissionCheckByAutoFillCommand(t), s = this._localeService.t("permission.dialog.autoFillErr"); break; } n || this._sheetPermissionCheckController.blockExecuteWithoutPermission(s); } _initialize() { this._commandExecutedListener(); } _commandExecutedListener() { this.disposeWithMe( this._commandService.beforeCommandExecuted((e) => { this._getPermissionCheck(e.id, e == null ? void 0 : e.params); }) ); } _permissionCheckByPaste(e) { return e.value === rt.SPECIAL_PASTE_VALUE || e.value === rt.SPECIAL_PASTE_FORMULA ? this._sheetPermissionCheckController.permissionCheckWithRanges({ workbookTypes: [q], rangeTypes: [re], worksheetTypes: [ze, ee] }) : e.value === rt.SPECIAL_PASTE_FORMAT ? this._sheetPermissionCheckController.permissionCheckWithRanges({ workbookTypes: [q], rangeTypes: [re], worksheetTypes: [ze, ee] }) : this._sheetPermissionCheckController.permissionCheckWithRanges({ workbookTypes: [q], rangeTypes: [re], worksheetTypes: [Ut, ze, ee] }); } _permissionCheckByAutoFillCommand(e) { if (!e) return !1; const { targetRange: t } = e, n = Ue(this._univerInstanceService); if (!n) return !1; const { worksheet: s, unitId: i, subUnitId: o } = n; return !this._rangeProtectionRuleModel.getSubunitRuleList(i, o).reduce((c, d) => [...c, ...d.ranges], []).filter((c) => ae.intersects(c, t)).some((c) => { var d, u; for (let h = c.startRow; h <= c.endRow; h++) for (let m = c.startColumn; m <= c.endColumn; m++) { const f = (u = (d = s.getCell(h, m)) == null ? void 0 : d.selectionProtection) == null ? void 0 : u[0]; if ((f == null ? void 0 : f[de.Edit]) === !1) return !0; } return !1; }); } }; Ri = Ny([ bn(0, F), bn(1, L), bn(2, $e), bn(3, bs), bn(4, D(Ye)), bn(5, Hr), bn(6, D(Ee)), bn(7, Ne), bn(8, D(Om)) ], Ri); var Hy = Object.defineProperty, Vy = Object.getOwnPropertyDescriptor, ky = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? Vy(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && Hy(e, t, s), s; }, _n = (r, e) => (t, n) => e(t, n, r); let rl = class extends kn { constructor(e, t, n, s, i, o, l, a, c, d) { super(); w(this, "disposableCollection", new St()); this._context = e, this._univerInstanceService = t, this._permissionService = n, this._selectionManagerService = s, this._rangeProtectionRuleModel = i, this._headerMoveRenderController = o, this._selectionRenderService = l, this._headerFreezeRenderController = a, this._rangeProtectionCache = c, this._headerResizeRenderController = d, this._initHeaderMovePermissionInterceptor(), this._initHeaderResizePermissionInterceptor(), this._initRangeFillPermissionInterceptor(), this._initRangeMovePermissionInterceptor(); } _initHeaderMovePermissionInterceptor() { const e = this._headerMoveRenderController.interceptor.getInterceptPoints().HEADER_MOVE_PERMISSION_CHECK; this.disposeWithMe( this._headerMoveRenderController.interceptor.intercept(e, { handler: (t, n) => { const s = Ue(this._univerInstanceService); if (!s) return !1; const { unitId: i, subUnitId: o } = s; if (!this._permissionService.composePermission([new q(i).id, new ee(i, o).id]).every((a) => a.value)) return !1; if (!n) return !0; if (n.rangeType !== j.ROW && n.rangeType !== j.COLUMN) return t; if (n.rangeType === j.ROW) { for (let a = n.startRow; a <= n.endRow; a++) if (this._rangeProtectionCache.getRowPermissionInfo(i, o, a, [de.Edit]) === !1) return !1; } else for (let a = n.startColumn; a <= n.endColumn; a++) if (this._rangeProtectionCache.getColPermissionInfo(i, o, a, [de.Edit]) === !1) return !1; return !0; } }) ); } _initHeaderResizePermissionInterceptor() { this._headerResizeRenderController && this.disposeWithMe( this._headerResizeRenderController.interceptor.intercept(this._headerResizeRenderController.interceptor.getInterceptPoints().HEADER_RESIZE_PERMISSION_CHECK, { handler: (e, t) => { var o, l, a, c; const n = Ue(this._univerInstanceService); if (!n) return !1; const { unitId: s, subUnitId: i } = n; if (t.row) { if (((l = (o = this._permissionService.getPermissionPoint(new Ar(s, i).id)) == null ? void 0 : o.value) != null ? l : !1) === !1) return !1; } else if (t.col && ((c = (a = this._permissionService.getPermissionPoint(new Or(s, i).id)) == null ? void 0 : a.value) != null ? c : !1) === !1) return !1; return !0; } }) ); } _initRangeFillPermissionInterceptor() { this.disposeWithMe( this._selectionRenderService.interceptor.intercept(this._selectionRenderService.interceptor.getInterceptPoints().RANGE_FILL_PERMISSION_CHECK, { handler: (e, t) => { var f, g, p; const n = Ue(this._univerInstanceService); if (!n) return !1; const { worksheet: s, unitId: i, subUnitId: o } = n; if (!this._permissionService.composePermission([ new q(i).id, new ee(i, o).id, new Ut(i, o).id, new ze(i, o).id ]).every((S) => S.value)) return !1; const a = (f = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : f.map((S) => S.range), c = a == null ? void 0 : a.find((S) => { const b = fo(t.x, t.y, t.scene, t.skeleton), v = t.skeleton.getCellWithCoordByIndex(S.endRow, S.endColumn), _ = Math.abs(v.endX - b.x), R = Math.abs(v.endY - b.y); return _ <= 5 && R <= 5; }); if (!c) return !0; const { startRow: d, endRow: u, startColumn: h, endColumn: m } = c; for (let S = d; S <= u; S++) for (let b = h; b <= m; b++) { const v = (p = (g = s.getCell(S, b)) == null ? void 0 : g.selectionProtection) == null ? void 0 : p[0]; if ((v == null ? void 0 : v[de.Edit]) === !1 || (v == null ? void 0 : v[de.View]) === !1) return !1; } return !0; } }) ); } _initRangeMovePermissionInterceptor() { this.disposeWithMe( this._selectionRenderService.interceptor.intercept(this._selectionRenderService.interceptor.getInterceptPoints().RANGE_MOVE_PERMISSION_CHECK, { handler: (e, t) => { var h; const n = Ue(this._univerInstanceService); if (!n) return !1; const { worksheet: s, unitId: i, subUnitId: o } = n; if (!this._permissionService.composePermission([new q(i).id, new ee(i, o).id]).every((m) => m.value)) return !1; const a = (h = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : h.map((m) => m.range), c = this._rangeProtectionRuleModel.getSubunitRuleList(i, o).reduce((m, f) => [...m, ...f.ranges], []), d = a == null ? void 0 : a.filter((m) => c.some((f) => ae.intersects(f, m))); return !(d == null ? void 0 : d.some((m) => { var b, v; const { startRow: f, startColumn: g, endRow: p, endColumn: S } = m; for (let _ = f; _ <= p; _++) for (let R = g; R <= S; R++) { const I = (v = (b = s.getCell(_, R)) == null ? void 0 : b.selectionProtection) == null ? void 0 : v[0]; if ((I == null ? void 0 : I[de.Edit]) === !1) return !0; } return !1; })); } }) ); } _initFreezePermissionInterceptor() { this.disposeWithMe( this._headerFreezeRenderController.interceptor.intercept(this._headerFreezeRenderController.interceptor.getInterceptPoints().FREEZE_PERMISSION_CHECK, { handler: (e, t) => { var o, l; const n = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET); return !(n == null ? void 0 : n.getActiveSheet()) || !n ? !1 : (l = (o = this._permissionService.getPermissionPoint(new q(n.getUnitId()).id)) == null ? void 0 : o.value) != null ? l : !1; } }) ); } }; rl = ky([ _n(1, L), _n(2, $e), _n(3, D($)), _n(4, D(Ye)), _n(5, D(mi)), _n(6, dt), _n(7, D(hi)), _n(8, D(Vl)), _n(9, Jc(jo)) ], rl); var Dy = Object.defineProperty, Ly = Object.getOwnPropertyDescriptor, Wy = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? Ly(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && Dy(e, t, s), s; }, Vs = (r, e) => (t, n) => e(t, n, r); const By = "SHEET_PERMISSION_PASTE_PLUGIN"; let Ii = class extends ce { constructor(e, t, n, s, i) { super(); w(this, "disposableCollection", new St()); this._univerInstanceService = e, this._selectionManagerService = t, this._localService = n, this._sheetClipboardService = s, this._sheetPermissionCheckController = i, this._initClipboardHook(); } _initClipboardHook() { this.disposeWithMe( this._sheetClipboardService.addClipboardHook({ id: By, onBeforePaste: (e) => { var h, m, f; const [t] = _s([e.range]).ranges, n = (h = this._selectionManagerService.getCurrentLastSelection()) == null ? void 0 : h.range; if (!n) return !1; const s = { startRow: n.startRow + t.startRow, endRow: n.startRow + t.endRow, startColumn: n.startColumn + t.startColumn, endColumn: n.startColumn + t.endColumn }, o = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET).getActiveSheet(); if (!o) return !1; const { startRow: l, endRow: a, startColumn: c, endColumn: d } = s; let u = !0; for (let g = l; g <= a; g++) for (let p = c; p <= d; p++) { const S = (f = (m = o.getCell(g, p)) == null ? void 0 : m.selectionProtection) == null ? void 0 : f[0]; if ((S == null ? void 0 : S[de.Edit]) === !1) { u = !1; break; } } return u || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localService.t("permission.dialog.pasteErr")), u; } }) ); } }; Ii = Wy([ Vs(0, L), Vs(1, D($)), Vs(2, D(Ee)), Vs(3, D(Sn)), Vs(4, D(Om)) ], Ii); var Fy = Object.defineProperty, Uy = Object.getOwnPropertyDescriptor, jy = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? Uy(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && Fy(e, t, s), s; }, ks = (r, e) => (t, n) => e(t, n, r); const Xy = sr("statusBarPermissionCorrect"); class zy { constructor() { w(this, "_sum", 0); w(this, "_count", 0); w(this, "_countNumber", 0); w(this, "_min", Number.POSITIVE_INFINITY); w(this, "_max", Number.NEGATIVE_INFINITY); } add(e) { const t = e == null ? void 0 : e.v, n = e == null ? void 0 : e.t; t != null && (typeof t == "number" && n !== ln.STRING && (this._sum += t, this._countNumber++, this._min = Math.min(this._min, t), this._max = Math.max(this._max, t)), this._count++); } getResults() { return { sum: this._sum, count: this._countNumber, // the countA in formula is the count of all values countA: this._count, min: this._min, max: this._max }; } } function Yy(r) { const { sum: e, count: t, countA: n, min: s, max: i } = r.getResults(); return [ { func: Fe.MAX, value: i }, { func: Fe.MIN, value: s }, { func: Dl.SUM, value: e }, { func: Fe.COUNTA, value: n }, { func: Fe.COUNT, value: t }, { func: Fe.AVERAGE, value: e / t } ]; } let ps = class extends ce { constructor(e, t, n, s, i) { super(); w(this, "interceptor", new Cs({ STATUS_BAR_PERMISSION_CORRECT: Xy })); this._univerInstanceService = e, this._selectionManagerService = t, this._statusBarService = n, this._commandService = s, this._numfmtService = i, this._init(); } _init() { this._registerSelectionListener(); } _registerSelectionListener() { const e = Fh((t) => { var s; const n = (s = t[t.length - 1]) == null ? void 0 : s.primary; this._calculateSelection( t.map((i) => i.range), n ); }, 100); this.disposeWithMe( Ae( this._selectionManagerService.selectionMoving$.subscribe((t) => { t && e(t); }) ) ), this.disposeWithMe( Ae( this._selectionManagerService.selectionMoveEnd$.subscribe((t) => { t && e(t); }) ) ), this.disposeWithMe( this._commandService.onCommandExecuted((t) => { if (t.id === Se.id) { const n = this._selectionManagerService.getCurrentSelections(); n && e(n); } }) ); } _clearResult() { this._statusBarService.setState(null); } getRangeStartEndInfo(e, t) { return e.rangeType === j.ALL ? { startRow: 0, startColumn: 0, endRow: t.getRowCount() - 1, endColumn: t.getColumnCount() - 1 } : e.rangeType === j.COLUMN ? { startRow: 0, startColumn: e.startColumn, endRow: t.getRowCount() - 1, endColumn: e.endColumn } : e.rangeType === j.ROW ? { startRow: e.startRow, startColumn: 0, endRow: e.endRow, endColumn: t.getColumnCount() - 1 } : { startRow: e.startRow, startColumn: e.startColumn, endRow: e.endRow, endColumn: e.endColumn }; } // eslint-disable-next-line max-lines-per-function _calculateSelection(e, t) { var a; const n = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET); if (!n) return this._clearResult(); const s = n.getUnitId(), i = n.getActiveSheet(), o = i == null ? void 0 : i.getSheetId(); if (!o) return this._clearResult(); const l = {}; if (this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET).getSheets().forEach((c) => { const d = c.getConfig(); l[c.getSheetId()] = { cellData: new Ke(d.cellData), rowCount: d.rowCount, columnCount: d.columnCount, rowData: d.rowData, columnData: d.columnData }; }), e != null && e.length) { const c = []; e.forEach((p) => { const { startRow: S, endRow: b } = p; let v = null; for (let _ = S; _ <= b; _++) i.getRowVisible(_) ? v === null && (v = _) : v !== null && (c.push({ ...p, startRow: v, endRow: _ - 1 }), v = null); v !== null && c.push({ ...p, startRow: v, endRow: b }); }); const d = Gp(c), u = new zy(); for (const p of d) { const { startRow: S, startColumn: b, endColumn: v, endRow: _ } = this.getRangeStartEndInfo(p, i); for (let R = S; R <= _; R++) for (let I = b; I <= v; I++) { const y = i.getCell(R, I); u.add(y); } } const h = Yy(u); if (h.every((p) => p === void 0)) return; let m = null; if (t) { const { actualRow: p, actualColumn: S } = t; m = (a = this._numfmtService.getValue(s, o, p, S)) == null ? void 0 : a.pattern; } const g = { values: h.filter((p) => p !== void 0), pattern: m }; this._statusBarService.setState(g); } else this._clearResult(); } }; ps = jy([ ks(0, L), ks(1, D($)), ks(2, da), ks(3, F), ks(4, D(mC)) ], ps); var Zy = Object.defineProperty, Gy = Object.getOwnPropertyDescriptor, qy = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? Gy(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && Zy(e, t, s), s; }, so = (r, e) => (t, n) => e(t, n, r); let sl = class extends kn { constructor(e, t, n, s, i) { super(); w(this, "disposableCollection", new St()); this._context = e, this._univerInstanceService = t, this._permissionService = n, this._statusBarController = s, this._rangeProtectionCache = i, this._initStatusBarPermissionInterceptor(); } _initStatusBarPermissionInterceptor() { this.disposeWithMe( this._statusBarController.interceptor.intercept(this._statusBarController.interceptor.getInterceptPoints().STATUS_BAR_PERMISSION_CORRECT, { priority: 100, handler: (e, t) => { var a; const n = Ue(this._univerInstanceService); if (!n) return e != null ? e : []; const { worksheet: s, unitId: i, subUnitId: o } = n; return ((a = this._permissionService.getPermissionPoint(new fC(i, o).id)) == null ? void 0 : a.value) === !1 ? t.forEach((c) => { const d = c.getArrayValue(); d.forEach((u, h) => { u.forEach((m, f) => { d[h][f] = Ru.create(); }); }); }) : t.forEach((c) => { const d = c.getArrayValue(), u = c.getCurrentRow(), h = c.getCurrentColumn(); d.forEach((m, f) => { m.forEach((g, p) => { var v; if (((v = s.getCellRaw(f + u, p + h)) == null ? void 0 : v.v) === void 0) return; const b = this._rangeProtectionCache.getCellInfo(i, o, f + u, p + h); (b == null ? void 0 : b[de.View]) === !1 && (d[f][p] = Ru.create()); }); }); }), t; } }) ); } }; sl = qy([ so(1, L), so(2, $e), so(3, D(ps)), so(4, D(Vl)) ], sl); const tp = (r, e, t, n, s) => { const i = r.get(Ee), o = r.get(ft), l = r.get(Ye); let a = ""; if (e.length === 0) a = i.t("permission.panel.emptyRangeError"); else if (e.length > 1) { let c = !1; for (let d = 0; d < e.length; d++) { for (let u = d + 1; u < e.length; u++) if (ae.intersects(e[d], e[u])) { c = !0; break; } if (c) break; } c && (a = i.t("permission.panel.rangeOverlapError")); } if (!a) { if (o.getRule(n, s) && !t) return a = i.t("permission.panel.rangeOverlapOverPermissionError"), a; const d = l.getSubunitRuleList(n, s).filter((h) => h.permissionId !== t).find((h) => h.ranges.some((m) => e.some((f) => ae.intersects(m, f)))); (d == null ? void 0 : d.ranges.find((h) => e.some((m) => ae.intersects(h, m)))) && (a = i.t("permission.panel.rangeOverlapOverPermissionError")); } return a === "" ? void 0 : a; }, Qy = (r, e) => { if (r.length !== 1) return !1; const t = r[0], n = e.getRowCount(), s = e.getColumnCount(), { startRow: i, endRow: o, startColumn: l, endColumn: a } = t; return i === 0 && l === 0 && o === n - 1 && a === s - 1; }, Ky = (r, e) => { var a, c; const t = r.get(L), n = r.get($), s = t.getCurrentUnitForType(O.UNIVER_SHEET), i = s.getActiveSheet(); let o = At.SelectRange, l = (c = (a = n.getCurrentSelections()) == null ? void 0 : a.map((d) => d.range)) != null ? c : []; return e && (o = At.Worksheet, l = [{ startRow: 0, startColumn: 0, endRow: i.getRowCount() - 1, endColumn: i.getColumnCount() - 1, rangeType: j.ALL }]), { unitId: s.getUnitId(), subUnitId: i.getSheetId(), permissionId: "", unitType: o, description: "", id: "", ranges: l, editState: on.OnlyMe, viewState: ls.OthersCanView }; }, Jy = (r, e) => { const s = r.get(L).getCurrentUnitForType(O.UNIVER_SHEET).getActiveSheet(), { unitType: i } = e; return i === At.Worksheet ? { ...e, ranges: [{ startRow: 0, startColumn: 0, endRow: s.getRowCount() - 1, endColumn: s.getColumnCount() - 1, rangeType: j.ALL }] } : e; }, $y = "univer-permission-panel-detail-wrapper", eM = "univer-radio-group-vertical", tM = "univer-sheet-permission-design-person-panel", nM = "univer-sheet-permission-design-person-panel-header", rM = "univer-sheet-permission-design-person-panel-header-add", sM = "univer-sheet-permission-design-person-panel-split", iM = "univer-sheet-permission-design-person-panel-content-item", oM = "univer-sheet-permission-design-person-panel-content-item-name", lM = "univer-sheet-permission-design-person-panel-content-item-select", aM = "univer-sheet-permission-design-person-panel-content", cM = "univer-sheet-permission-user-list-empty", dM = "univer-sheet-permission-user-list-empty-text", uM = "univer-sheet-permission-panel-title", hM = "univer-sheet-permission-panel-footer", mM = "univer-permission-range-selector", fM = "univer-permission-range-selector-error", gM = "univer-sheet-permission-panel-name-input-error", pM = "univer-permission-range-selector-error-text", SM = "univer-sheet-permission-panel-name-input-error-text", nt = { permissionPanelDetailWrapper: $y, radioGroupVertical: eM, sheetPermissionDesignPersonPanel: tM, sheetPermissionDesignPersonPanelHeader: nM, sheetPermissionDesignPersonPanelHeaderAdd: rM, sheetPermissionDesignPersonPanelSplit: sM, sheetPermissionDesignPersonPanelContentItem: iM, sheetPermissionDesignPersonPanelContentItemName: oM, sheetPermissionDesignPersonPanelContentItemSelect: lM, sheetPermissionDesignPersonPanelContent: aM, sheetPermissionUserListEmpty: cM, sheetPermissionUserListEmptyText: dM, sheetPermissionPanelTitle: uM, sheetPermissionPanelFooter: hM, permissionRangeSelector: mM, permissionRangeSelectorError: fM, sheetPermissionPanelNameInputError: gM, permissionRangeSelectorErrorText: pM, sheetPermissionPanelNameInputErrorText: SM }, CM = (r) => { const { viewState: e, editState: t, permissionId: n, ranges: s, rangesErrMsg: i, desc: o, oldRule: l, id: a } = r, c = W(gs), d = W(vs), u = W(bl), h = W(Ee), m = W(F), f = W(Vr), p = W(L).getCurrentUnitForType(O.UNIVER_SHEET), S = p == null ? void 0 : p.getActiveSheet(); if (!p || !S) return null; const b = p.getUnitId(), v = S.getSheetId(); return /* @__PURE__ */ C.jsxs("div", { className: nt.sheetPermissionPanelFooter, children: [ /* @__PURE__ */ C.jsx( fn, { type: "primary", onClick: async () => { if (i) return; const _ = { unitId: b, subUnitId: v, permissionId: n, id: a, viewState: e, editState: t, unitType: At.SelectRange, ranges: s, description: o }; Qy(s, S) && (_.unitType = At.Worksheet, _.ranges = []); let I = f.selectUserList; _.editState === on.OnlyMe && (I = [], f.setSelectUserList([])); const y = { read: _.viewState === ls.OthersCanView ? rn.AllCollaborator : rn.SomeCollaborator, edit: _.editState === on.DesignedUserCanEdit ? rn.SomeCollaborator : rn.OneSelf }; if (_.editState === on.DesignedUserCanEdit && I.length === 0 && (I = [], y.edit = rn.OneSelf), _.permissionId) { const P = Y_(I.filter((x) => x.role === Nt.Editor), f.oldCollaboratorList.filter((x) => x.role === Nt.Editor)), E = (l == null ? void 0 : l.viewState) === _.viewState, T = (l == null ? void 0 : l.editState) === _.editState, A = _.unitType === (l == null ? void 0 : l.unitType) && _.description === l.description && _.ranges === l.ranges, H = !P || !E || !T; if (A && H) await u.update({ objectType: _.unitType, objectID: _.permissionId, unitID: _.unitId, share: void 0, name: "", strategies: [], scope: y, collaborators: { collaborators: I } }); else { let x = _.permissionId; H && (_.unitType === At.Worksheet ? x = await u.create({ worksheetObject: { collaborators: I, unitID: _.unitId, name: "", strategies: [{ role: Nt.Editor, action: de.Edit }, { role: Nt.Reader, action: de.View }], scope: y }, objectType: At.Worksheet }) : x = await u.create({ selectRangeObject: { collaborators: I, unitID: _.unitId, name: "", scope: y }, objectType: At.SelectRange })), m.executeCommand(gC.id, { rule: { ..._, permissionId: x }, oldRule: l }); } } else if (_.unitType === At.Worksheet) { const P = await u.create({ worksheetObject: { collaborators: I, unitID: _.unitId, name: "", strategies: [{ role: Nt.Editor, action: de.Edit }, { role: Nt.Reader, action: de.View }], scope: y }, objectType: At.Worksheet }), { ranges: E = [], ...T } = _; T.permissionId = P, m.executeCommand(Cm.id, { rule: T, unitId: _.unitId }); } else if (_.unitType === At.SelectRange) { const P = await u.create({ selectRangeObject: { collaborators: I, unitID: _.unitId, name: "", scope: y }, objectType: At.SelectRange }); m.executeCommand(pC.id, { rule: _, permissionId: P }); } const M = { header: { title: `${h.t("permission.panel.title")}` }, children: { label: fi, showDetail: !1 }, width: 330 }; d.open(M); }, children: h.t("permission.button.confirm") } ), /* @__PURE__ */ C.jsx( fn, { className: nt.sheetPermissionPanelFooterCancel, onClick: () => { c.reset(), f.reset(), d.close(); }, children: h.t("permission.button.cancel") } ) ] }); }, vM = (r) => { const { ranges: e, onRangesChange: t, rangeSelectorRef: n, desc: s, onDescChange: i, rangesErrMsg: o, isFocusRangeSelector: l, permissionId: a, onFocus: c } = r, d = W(Dn), u = sn(() => d.get(Jm), []), h = W(L), m = W(Ee), f = W(vt), g = h.getCurrentUnitForType(O.UNIVER_SHEET), p = g == null ? void 0 : g.getActiveSheet(); if (!g || !p) return null; const S = g.getUnitId(), b = p.getSheetId(), v = (_) => { const R = _.split(",").map(Fm).map((A) => A.range); if (R.some((A) => !qp(A) || A.endColumn < A.startColumn || A.endRow < A.startRow)) return; const I = h.getCurrentUnitForType(O.UNIVER_SHEET), y = I == null ? void 0 : I.getActiveSheet(); if (!I || !y) return; const M = I.getUnitId(), P = y.getSheetId(), E = R.map((A) => { const H = y.getRowCount(), x = y.getColumnCount(); return SC(A, H, x), A; }), T = tp(f, E, a, M, P); t(E, T); }; return /* @__PURE__ */ C.jsxs(C.Fragment, { children: [ /* @__PURE__ */ C.jsx(To, { className: nt.sheetPermissionPanelTitle, label: m.t("permission.panel.protectedRange"), children: u && /* @__PURE__ */ C.jsx( u, { unitId: S, errorText: o, subUnitId: b, initValue: e == null ? void 0 : e.map((_) => Bm(_)).join(","), onChange: v, onFocus: c, isFocus: l, actions: n.current } ) }), /* @__PURE__ */ C.jsx(To, { className: nt.sheetPermissionPanelTitle, label: m.t("permission.panel.permissionDirection"), children: /* @__PURE__ */ C.jsx( ti, { value: s, onChange: (_) => i(_), placeholder: m.t("permission.panel.permissionDirectionPlaceholder") } ) }) ] }); }, bM = (r) => { var _, R; const { fromSheetBar: e, rule: t, oldRule: n } = r, s = W(vt), i = t ? Jy(s, t) : Ky(s, e), [o, l] = te(i.ranges), [a, c] = te(() => tp(s, i.ranges, i.permissionId, i.unitId, i.subUnitId)), [d, u] = te(i.description), [h, m] = te((_ = i.editState) != null ? _ : on.OnlyMe), [f, g] = te((R = i.viewState) != null ? R : ls.OthersCanView), p = xn({}), [S, b] = te(!1); wo((I) => { var M; const y = (M = p.current) == null ? void 0 : M.handleOutClick; y && y(I, () => b(!1)); }); const v = Gh(Dc); return be(() => { const I = s.get(L), y = s.get(vs), M = I.getCurrentUnitForType(O.UNIVER_SHEET); if (!M) return; const P = M.getActiveSheet().getSheetId(), E = M.activeSheet$.subscribe((T) => { (T == null ? void 0 : T.getSheetId()) !== P && y.close(); }); return () => { E.unsubscribe(); }; }, []), /* @__PURE__ */ C.jsxs("div", { className: nt.permissionPanelDetailWrapper, children: [ /* @__PURE__ */ C.jsx( vM, { onFocus: () => b(!0), permissionId: i.permissionId, ranges: o, onRangesChange: (I, y) => { l(I), c(y); }, isFocusRangeSelector: S, rangesErrMsg: a, desc: d, onDescChange: (I) => u(I), rangeSelectorRef: p } ), /* @__PURE__ */ C.jsx( qh, { components: v, sharedProps: { editState: h, onEditStateChange: (I) => m(I), viewState: f, onViewStateChange: (I) => g(I), permissionId: i.permissionId } }, "user-part" ), /* @__PURE__ */ C.jsx( CM, { permissionId: i.permissionId, id: i.id, ranges: o, rangesErrMsg: a, desc: d, viewState: f, editState: h, oldRule: n } ) ] }); }, _M = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAADxCAYAAAATKWQfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAB4KADAAQAAAABAAAA8QAAAAAQiyznAABAAElEQVR4Aey9e6wnyXXf192/1/397p2ZO7s73If3MWuRSy4pC0uL1oOSrF0lsgXZECVZDBDJiZZ2RMaURIsEKUpKAA9hWLRNmaTWsQ0SCCgFDmBTgCkGQYAgf2gUx69YiUcBKFGm5B1Jq10ud3fe9/V7dOf7OVWnb/363jucfc2dR9XM/VXVOadOVZ/urm+fqurqosghWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFsgWyBbIFqgzJbIFsg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vwE2PNF/lcdd0T86AmcR6An4LCL9uiPwLUSAVfmlPz0+KbVkfSHD6ksv1jp4UnZyeVhcuytJ9viGMtxFtd3qL0lV/7Lq71bzy/qfI8XnartxI8nwkupecMv0cXL5q4sL773PyfWF54bFpYeir38T04RRP+sIdAQ6Ah2BjkBHoCPQEegIdAQ6Ah2BjkBHoCPQEegIdAQ6Ah2BjkBHoCPQEegIdAQ6Ah2BjkBHoCPQEegIdAQ6Ah2BjkBHoCPQEegIdAQ6Ah2BjkBHoCPQEegIdAQ6Ah2BjkBHoCPQEegIdAQ6Ah2BjkBHoCPQEegIdAQ6Ah2BjkBHoCPQEegIdAQ6Ah2BjkBHoCPQEegIdAQ6Ah2BjkBHoCPQEegIdAQ6Ah2BjkBHoCPQEegIdAQ6Ah2BjkBHoCPQEegIdAQ6Ah2BjkBHoCPQEegIdAQ6Ah2BjkBHoCPQEegIdAQ6Ah2BjkBHoCPQEegIdAQ6Ah2BjkBHoCPw5iLw/wCH3cvs3EDhsQAAAABJRU5ErkJggg==", wM = "univer-sheet-permission-list-panel-wrapper", RM = "univer-sheet-permission-list-panel-header", IM = "univer-sheet-permission-list-panel-header-type", yM = "univer-sheet-permission-list-panel-header-type-bottom", MM = "univer-sheet-permission-list-panel-header-select", PM = "univer-sheet-permission-list-item-header-icon", EM = "univer-sheet-permission-list-item", TM = "univer-sheet-permission-list-item-header", xM = "univer-sheet-permission-list-item-header-name", OM = "univer-sheet-permission-list-item-header-operator", AM = "univer-sheet-permission-list-item-split", NM = "univer-sheet-permission-list-item-content-edit", HM = "univer-sheet-permission-list-item-content-view", VM = "univer-sheet-permission-list-item-content-desc", kM = "univer-sheet-permission-list-empty", DM = "univer-sheet-permission-list-empty-text", LM = "univer-sheet-permission-list-item-content-title", WM = "univer-sheet-permission-list-item-content-sub", BM = "univer-sheet-permission-panel-add-wrapper", FM = "univer-sheet-permission-panel-add-button", je = { sheetPermissionListPanelWrapper: wM, sheetPermissionListPanelHeader: RM, sheetPermissionListPanelHeaderType: IM, sheetPermissionListPanelHeaderTypeBottom: yM, sheetPermissionListPanelHeaderSelect: MM, sheetPermissionListItemHeaderIcon: PM, sheetPermissionListItem: EM, sheetPermissionListItemHeader: TM, sheetPermissionListItemHeaderName: xM, sheetPermissionListItemHeaderOperator: OM, sheetPermissionListItemSplit: AM, sheetPermissionListItemContentEdit: NM, sheetPermissionListItemContentView: HM, sheetPermissionListItemContentDesc: VM, sheetPermissionListEmpty: kM, sheetPermissionListEmptyText: DM, sheetPermissionListItemContentTitle: LM, sheetPermissionListItemContentSub: WM, sheetPermissionPanelAddWrapper: BM, sheetPermissionPanelAddButton: FM }, UM = () => { var H; const [r, e] = te(!0), [t, n] = te(!1), s = W(Ee), i = W(Ye), o = W(ft), l = W(L), a = W(F), c = W(vs), d = W(bl), u = W($e), m = W(Dt).getCurrentUser(), [f, g] = te([]), p = W(Vr), S = Yt(o.ruleRefresh$, ""), b = Yt(i.ruleRefresh$, ""), v = l.getCurrentUnitForType(O.UNIVER_SHEET); if (!v) return null; const _ = v == null ? void 0 : v.getUnitId(), R = On(async (x) => { var ve; const k = v.getActiveSheet(), U = v.getUnitId(), V = k.getSheetId(), N = [], X = []; v.getSheets().forEach((G) => { const J = G.getSheetId(); i.getSubunitRuleList(U, J).forEach((Ze) => { Ze.permissionId && N.push(Ze.permissionId); }); const fe = o.getRule(U, J); fe != null && fe.permissionId && X.push(fe.permissionId); }); const Y = [...N, ...X], ie = await d.list({ objectIDs: Y, unitID: U, actions: CC }), he = i.getSubunitRuleList(U, V).map((G) => G.permissionId), ne = (ve = o.getRule(U, V)) == null ? void 0 : ve.permissionId; ne && he.push(ne); const pe = ie.filter((G) => { var J; return he.includes(G.objectID) || G.objectID === ((J = o.getRule(U, V)) == null ? void 0 : J.permissionId); }); return x ? pe : ie; }, []), [I, y] = te([]); be(() => { const x = mt( i.ruleChange$, o.ruleChange$ ).subscribe(async () => { const k = await R(r); y(k); }); return () => { x.unsubscribe(); }; }, [r]), be(() => { const x = v.activeSheet$.pipe( cn((k, U) => (k == null ? void 0 : k.getSheetId()) === (U == null ? void 0 : U.getSheetId())) ).subscribe(async () => { const k = await R(r); y(k); }); return () => { x.unsubscribe(); }; }, [r]), be(() => { (async () => { if (S || b) { const k = await R(!0); y(k); } })(); }, [S, b]); const M = (x) => { const { unitId: k, subUnitId: U, unitType: V } = x; let N; V === Mn.Worksheet ? N = a.executeCommand(Po.id, { unitId: k, subUnitId: U, rule: x }) : V === Mn.SelectRange && (N = a.executeCommand(vC.id, { unitId: k, subUnitId: U, rule: x })), N && (n(!t), x.ranges === f && g([])); }; be(() => { p.reset(); }, []), dI(f); const P = /* @__PURE__ */ new Map(); v.getSheets().forEach((x) => { const k = x.getSheetId(); i.getSubunitRuleList(_, k).forEach((N) => { P.set(N.permissionId, N); }); const V = o.getRule(_, k); V && P.set(V == null ? void 0 : V.permissionId, V); }); const E = (x) => { x.subUnitId !== v.getActiveSheet().getSheetId() && a.executeCommand(et.id, { unitId: x.unitId, subUnitId: x.subUnitId }); const k = { header: { title: "permission.panel.title" }, children: { label: fi, showDetail: !0, rule: se.deepClone(x), oldRule: se.deepClone(x) }, width: 330 }; c.open(k); }, T = (x) => { e(x); }, A = (H = u.getPermissionPoint(new kl(_).id)) == null ? void 0 : H.value; return /* @__PURE__ */ C.jsxs("div", { className: je.sheetPermissionListPanelWrapper, children: [ /* @__PURE__ */ C.jsxs("div", { className: je.sheetPermissionListPanelHeader, children: [ /* @__PURE__ */ C.jsxs("div", { className: je.sheetPermissionListPanelHeaderType, onClick: () => T(!0), children: [ /* @__PURE__ */ C.jsx("div", { className: st({ [je.sheetPermissionListPanelHeaderSelect]: r }), children: s.t("permission.panel.currentSheet") }), r && /* @__PURE__ */ C.jsx("div", { className: je.sheetPermissionListPanelHeaderTypeBottom }) ] }), /* @__PURE__ */ C.jsxs("div", { className: je.sheetPermissionListPanelHeaderType, onClick: () => T(!1), children: [ /* @__PURE__ */ C.jsx("div", { className: st({ [je.sheetPermissionListPanelHeaderSelect]: !r }), children: s.t("permission.panel.allSheet") }), !r && /* @__PURE__ */ C.jsx("div", { className: je.sheetPermissionListPanelHeaderTypeBottom }) ] }) ] }), (I == null ? void 0 : I.length) > 0 ? /* @__PURE__ */ C.jsx("div", { className: je.sheetPermissionListPanelContent, children: I == null ? void 0 : I.map((x) => { var J, le, fe, Ze, lt; const k = P.get(x.objectID); if (!k) return null; const U = x.actions.find((Be) => Be.action === de.Edit), V = U == null ? void 0 : U.allowed, N = x.actions.find((Be) => Be.action === de.View), X = N == null ? void 0 : N.allowed, Y = x.actions.find((Be) => Be.action === de.ManageCollaborator), ie = x.actions.find((Be) => Be.action === de.Delete), he = (Y == null ? void 0 : Y.allowed) || m.userID === ((J = x.creator) == null ? void 0 : J.userID), ne = (ie == null ? void 0 : ie.allowed) || m.userID === ((le = x.creator) == null ? void 0 : le.userID); let pe = ""; const ve = v.getSheetBySheetId(k.subUnitId), G = ve == null ? void 0 : ve.getName(); if (k.unitType === Mn.SelectRange) { const Be = k.ranges, we = Be != null && Be.length ? Be.map((Ve) => { const pt = Bm(Ve); return pt === "NaN" ? "" : pt; }).filter((Ve) => !!Ve).join(",") : ""; pe = `${G}(${we})`; } else k.unitType === Mn.Worksheet && (pe = G || ""); return /* @__PURE__ */ C.jsxs( "div", { className: je.sheetPermissionListItem, onMouseMove: () => { const { subUnitId: Be, unitType: we } = k, Ve = v.getActiveSheet(); if (!Ve) return !1; const pt = Ve.getSheetId(); if (Be !== pt) return !1; if (we === Mn.SelectRange) { const bt = k.ranges || []; bt !== f && g(bt); } else if (we === Mn.Worksheet) { const bt = [{ startRow: 0, endRow: Ve.getRowCount() - 1, startColumn: 0, endColumn: Ve.getColumnCount() - 1 }]; bt !== f && g(bt); } }, onMouseLeave: () => g([]), children: [ /* @__PURE__ */ C.jsxs("div", { className: je.sheetPermissionListItemHeader, children: [ /* @__PURE__ */ C.jsx(Gn, { title: pe, children: /* @__PURE__ */ C.jsx("div", { className: je.sheetPermissionListItemHeaderName, children: pe }) }), (he || ne) && /* @__PURE__ */ C.jsxs("div", { className: je.sheetPermissionListItemHeaderOperator, children: [ he && /* @__PURE__ */ C.jsx(Gn, { title: s.t("permission.panel.edit"), children: /* @__PURE__ */ C.jsx("div", { className: je.sheetPermissionListItemHeaderIcon, onClick: () => E(k), children: /* @__PURE__ */ C.jsx(Zd, {}) }) }), ne && /* @__PURE__ */ C.jsx(Gn, { title: s.t("permission.panel.delete"), children: /* @__PURE__ */ C.jsx("div", { className: je.sheetPermissionListItemHeaderIcon, onClick: () => M(k), children: /* @__PURE__ */ C.jsx(ea, {}) }) }) ] }) ] }), /* @__PURE__ */ C.jsx("div", { className: je.sheetPermissionListItemSplit }), /* @__PURE__ */ C.jsxs("div", { className: je.sheetPermissionListItemContent, children: [ /* @__PURE__ */ C.jsxs("div", { className: je.sheetPermissionListItemContentEdit, children: [ /* @__PURE__ */ C.jsx(Gn, { title: (Ze = (fe = x.creator) == null ? void 0 : fe.name) != null ? Ze : "", children: /* @__PURE__ */ C.jsx("div", { children: /* @__PURE__ */ C.jsx(Pd, { src: (lt = x.creator) == null ? void 0 : lt.avatar, style: { marginRight: 6 }, size: 24 }) }) }), /* @__PURE__ */ C.jsx("span", { className: je.sheetPermissionListItemContentTitle, children: s.t("permission.panel.created") }), /* @__PURE__ */ C.jsx("span", { className: je.sheetPermissionListItemContentSub, children: V ? `${s.t("permission.panel.iCanEdit")}` : `${s.t("permission.panel.iCanNotEdit")}` }) ] }), /* @__PURE__ */ C.jsxs("div", { className: je.sheetPermissionListItemContentView, children: [ /* @__PURE__ */ C.jsx("span", { className: je.sheetPermissionListItemContentTitle, children: s.t("permission.panel.viewPermission") }), /* @__PURE__ */ C.jsx("span", { className: je.sheetPermissionListItemContentSub, children: X ? `${s.t("permission.panel.iCanView")}` : `${s.t("permission.panel.iCanNotView")}` }) ] }), k.description && /* @__PURE__ */ C.jsx(Gn, { title: k.description, children: /* @__PURE__ */ C.jsx("div", { className: je.sheetPermissionListItemContentDesc, children: k.description }) }) ] }) ] }, x.objectID ); }) }) : /* @__PURE__ */ C.jsxs("div", { className: je.sheetPermissionListEmpty, children: [ /* @__PURE__ */ C.jsx("img", { width: 240, height: 120, src: _M, alt: "" }), /* @__PURE__ */ C.jsx("p", { className: je.sheetPermissionListEmptyText, children: s.t("permission.dialog.listEmpty") }) ] }), A && /* @__PURE__ */ C.jsx("div", { className: je.sheetPermissionPanelAddWrapper, children: /* @__PURE__ */ C.jsxs( fn, { className: je.sheetPermissionPanelAddButton, type: "primary", onClick: () => { const x = { header: { title: `${s.t("permission.panel.title")}` }, children: { label: fi, showDetail: !0 }, width: 330 }; c.open(x); }, children: [ /* @__PURE__ */ C.jsx("div", { children: "+ " }), s.t("permission.button.addNewPermission") ] } ) }) ] }); }, jM = ({ showDetail: r, fromSheetBar: e, rule: t, oldRule: n }) => { var u; const s = W(L), i = W($); if (!W(gs).getVisible()) return null; const l = Ue(s); if (!l) return null; const { worksheet: a } = l, d = ((u = i.getCurrentSelections()) == null ? void 0 : u.map((h) => h.range)).reduce((h, m) => h + Wm(a.getName(), m), ""); return r ? /* @__PURE__ */ C.jsx( bM, { fromSheetBar: e, rule: t, oldRule: n }, e ? "sheet-bar" : "normal" ) : /* @__PURE__ */ C.jsx(UM, {}, d); }, XM = "univer-spin-container", zM = "univer-spin-overlay", YM = "univer-spinner", ZM = "univer-spin", GM = "univer-content-blur", io = { spinContainer: XM, spinOverlay: zM, spinner: YM, spin: ZM, contentBlur: GM }, qM = ({ loading: r, children: e }) => /* @__PURE__ */ C.jsxs("div", { className: io.spinContainer, children: [ r && /* @__PURE__ */ C.jsx("div", { className: io.spinOverlay, children: /* @__PURE__ */ C.jsx("div", { className: io.spinner }) }), /* @__PURE__ */ C.jsx("div", { className: r ? io.contentBlur : "", children: e }) ] }), QM = "univer-sheet-permission-dialog-wrapper", KM = "univer-sheet-permission-dialog-split", JM = "univer-sheet-permission-dialog-item", $M = "univer-sheet-permission-user-dialog-footer", eP = "univer-sheet-permission-user-dialog-footer-confirm", tP = "univer-sheet-permission-user-dialog-button", zn = { sheetPermissionDialogWrapper: QM, sheetPermissionDialogSplit: KM, sheetPermissionDialogItem: JM, sheetPermissionUserDialogFooter: $M, sheetPermissionUserDialogFooterConfirm: eP, sheetPermissionUserDialogButton: tP }, nP = () => { const r = W(Ee), e = W(L), t = W(bl), n = W(bC), s = W(bs), i = W($e), o = e.getCurrentUnitForType(O.UNIVER_SHEET), l = o.getActiveSheet(); if (!l) throw new Error("No active sheet found"); const [a, c] = te([]), d = W(F), [u, h] = te(() => !!n.getRule(o.getUnitId(), l.getSheetId())), [m, f] = te(() => Object.keys(eo).reduce((p, S) => (p[S] = { text: r.t(`permission.panel.${eo[Number(S)]}`), allowed: !0 }, p), {})); be(() => { (async () => { const S = o.getUnitId(), b = await t.listCollaborators({ objectID: S, unitID: S }); c(b); })(); }, []), be(() => { (async () => { const S = o.getUnitId(), b = n.getRule(S, l.getSheetId()); if (!b) return; h(!0); const _ = (await t.list({ unitID: o.getUnitId(), objectIDs: [b.permissionId], actions: J_ }))[0].strategies.reduce((R, I) => (eo[I.action] && (R[I.action] = { text: r.t(`permission.panel.${eo[I.action]}`), allowed: I.role !== Nt.Owner }), R), {}); f(_), setTimeout(() => { h(!1); }, 100); })(); }, []); const g = async () => { const p = e.getCurrentUnitForType(O.UNIVER_SHEET), S = p == null ? void 0 : p.getActiveSheet(); if (!S) throw new Error("No active sheet found"); const b = p.getUnitId(), v = S.getSheetId(), _ = n.getRule(b, v), R = Object.keys(m).map((y) => ({ action: Number(y), role: m[y].allowed ? Nt.Editor : Nt.Owner })); let I = _ == null ? void 0 : _.permissionId; I ? t.update({ objectType: Mn.Worksheet, objectID: I, unitID: b, strategies: R, share: void 0, name: "", scope: { read: rn.AllCollaborator, edit: rn.AllCollaborator }, collaborators: void 0 }).then(() => { wC().forEach((y) => { const M = new y(b, v), P = M.subType, E = R.find((T) => T.action === P); E && i.updatePermissionPoint(M.id, E.role === Nt.Editor); }); }) : (I = await t.create({ objectType: Mn.Worksheet, worksheetObject: { unitID: b, collaborators: a, name: "", strategies: R, scope: { read: rn.AllCollaborator, edit: rn.AllCollaborator } } }), d.executeCommand(_C.id, { rule: { permissionId: I, unitId: b, subUnitId: v } })); }; return /* @__PURE__ */ C.jsx(qM, { loading: u, children: /* @__PURE__ */ C.jsxs("div", { className: zn.sheetPermissionDialogWrapper, children: [ /* @__PURE__ */ C.jsx("div", { className: zn.sheetPermissionDialogSplit }), Object.keys(m).map((p) => { const S = m[p], { text: b, allowed: v } = S; return /* @__PURE__ */ C.jsxs("div", { className: zn.sheetPermissionDialogItem, children: [ /* @__PURE__ */ C.jsx("div", { children: b }), /* @__PURE__ */ C.jsx( VC, { defaultChecked: v, onChange: () => { f({ ...m, [p]: { ...S, allowed: !v } }); } } ) ] }, b); }), /* @__PURE__ */ C.jsx("div", { className: zn.sheetPermissionDialogSplit }), /* @__PURE__ */ C.jsxs("div", { className: zn.sheetPermissionUserDialogFooter, children: [ /* @__PURE__ */ C.jsx( fn, { className: zn.sheetPermissionUserDialogButton, onClick: () => { s.close(Yo); }, children: r.t("permission.button.cancel") } ), /* @__PURE__ */ C.jsx( fn, { type: "primary", onClick: () => { g(), s.close(Yo); }, className: st(zn.sheetPermissionUserDialogFooterConfirm, zn.sheetPermissionUserDialogButton), children: r.t("permission.button.confirm") } ) ] }) ] }) }); }, np = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAADwCAYAAADYdbe6AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAB4KADAAQAAAABAAAA8AAAAAAt6wVXAABAAElEQVR4Aey9C5Rm11Xfee/3rEd3V78lWS2p5Qe2sAHxCGYWMMgrK8AAs0LWjDyTNcPDY7CHYTC2CWBw1rg8E3Bggh1kHMbMsGRWEmaWPQ8SB3AIGQsmLCDgxBjLOLZBJautV7f6UV2P73Xvnd9/n7u/OnW7qtVSV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aFifmgpNi1OvSWH7jdcIVBCAAAQg8IoFaXKLAdGV89jbXio7m1k7jtmpPWhVa19TCeFWv6xD6T9rm75P5KLhX42itRfK9l/4j3gHsGQIQgAAE7pLAsrCtjZe2DEJz1+azlj4EIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQgUAn8BrzesdviE5ggAAAAASUVORK5CYII=", rP = "univer-sheet-permission-user-dialog-wrapper", sP = "univer-sheet-permission-user-dialog-search-input", iP = "univer-sheet-permission-user-list", oP = "univer-sheet-permission-user-list-empty", lP = "univer-sheet-permission-user-list-empty-text", aP = "univer-sheet-permission-user-item", cP = "univer-sheet-permission-user-item-name", dP = "univer-sheet-permission-split", uP = "univer-sheet-permission-user-dialog-footer", hP = "univer-sheet-permission-user-dialog-footer-confirm", mP = "univer-sheet-permission-user-dialog-button", Ot = { sheetPermissionUserDialogWrapper: rP, sheetPermissionUserDialogSearchInput: sP, sheetPermissionUserList: iP, sheetPermissionUserListEmpty: oP, sheetPermissionUserListEmptyText: lP, sheetPermissionUserItem: aP, sheetPermissionUserItemName: cP, sheetPermissionSplit: dP, sheetPermissionUserDialogFooter: uP, sheetPermissionUserDialogFooterConfirm: hP, sheetPermissionUserDialogButton: mP }, fP = () => { const [r, e] = od.useState(""), t = W(Ee), n = W(bs), s = W(Vr), o = s.userList.filter((d) => { var u; return ((u = d.subject) == null ? void 0 : u.name.toLocaleLowerCase().includes(r.toLocaleLowerCase())) && d.role === Nt.Editor; }), [l, a] = te(s.selectUserList), c = (d) => { if ((l == null ? void 0 : l.findIndex((h) => { var m, f; return ((m = h.subject) == null ? void 0 : m.userID) === ((f = d.subject) == null ? void 0 : f.userID); })) === -1) { const h = { ...d }; a([...l, h]); } else { const h = l.filter((m) => { var f, g; return ((f = m.subject) == null ? void 0 : f.userID) !== ((g = d.subject) == null ? void 0 : g.userID); }); a(h); } }; return /* @__PURE__ */ C.jsxs("div", { className: Ot.sheetPermissionUserDialogWrapper, children: [ /* @__PURE__ */ C.jsx("div", { className: Ot.sheetPermissionUserDialogSearch, children: /* @__PURE__ */ C.jsx( ti, { placeholder: t.t("permission.dialog.search"), className: Ot.sheetPermissionUserDialogSearchInput, value: r, onChange: (d) => e(d) } ) }), /* @__PURE__ */ C.jsx("div", { className: Ot.sheetPermissionUserList, children: (o == null ? void 0 : o.length) > 0 ? /* @__PURE__ */ C.jsx(C.Fragment, { children: o == null ? void 0 : o.map((d) => { var u, h, m; return /* @__PURE__ */ C.jsxs("div", { className: Ot.sheetPermissionUserItem, onClick: () => c(d), children: [ /* @__PURE__ */ C.jsx(Pd, { src: (u = d.subject) == null ? void 0 : u.avatar, size: 24 }), /* @__PURE__ */ C.jsx("div", { className: Ot.sheetPermissionUserItemName, children: (h = d.subject) == null ? void 0 : h.name }), (l == null ? void 0 : l.findIndex((f) => { var g, p; return ((g = f.subject) == null ? void 0 : g.userID) === ((p = d.subject) == null ? void 0 : p.userID); })) !== -1 && /* @__PURE__ */ C.jsx("div", { children: /* @__PURE__ */ C.jsx(Hn, {}) }) ] }, (m = d.subject) == null ? void 0 : m.userID); }) }) : /* @__PURE__ */ C.jsxs("div", { className: Ot.sheetPermissionUserListEmpty, children: [ /* @__PURE__ */ C.jsx("img", { width: 240, height: 120, src: np, alt: "" }), /* @__PURE__ */ C.jsx("p", { className: Ot.sheetPermissionUserListEmptyText, children: t.t("permission.dialog.userEmpty") }) ] }) }), /* @__PURE__ */ C.jsx("div", { className: Ot.sheetPermissionSplit }), /* @__PURE__ */ C.jsxs("div", { className: Ot.sheetPermissionUserDialogFooter, children: [ /* @__PURE__ */ C.jsx(fn, { className: Ot.sheetPermissionUserDialogButton, onClick: () => n.close(zo), children: t.t("permission.button.cancel") }), /* @__PURE__ */ C.jsx( fn, { type: "primary", onClick: () => { s.setSelectUserList(l), n.close(zo); }, className: st(Ot.sheetPermissionUserDialogFooterConfirm, Ot.sheetPermissionUserDialogButton), children: t.t("permission.button.confirm") } ) ] }) ] }); }, gP = "univer-sheet-permission-alert-dialog", pP = "univer-sheet-permission-alert-dialog-title", SP = "univer-sheet-permission-alert-dialog-button", $a = { sheetPermissionAlertDialog: gP, sheetPermissionAlertDialogTitle: pP, sheetPermissionAlertDialogButton: SP }, CP = ({ errorMsg: r }) => { const e = W(Ee), t = W(bs); return /* @__PURE__ */ C.jsxs("div", { className: $a.sheetPermissionAlertDialog, children: [ /* @__PURE__ */ C.jsx("h1", { className: $a.sheetPermissionAlertDialogTitle, children: e.t("permission.dialog.alert") }), /* @__PURE__ */ C.jsx("p", { children: r || e.t("permission.dialog.alertContent") }), /* @__PURE__ */ C.jsx("div", { className: $a.sheetPermissionAlertDialogButton, children: /* @__PURE__ */ C.jsx( fn, { type: "primary", onClick: () => { t.close(Bc); }, children: e.t("permission.button.confirm") } ) }) ] }); }, rp = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNCIgaGVpZ2h0PSI0IiB2aWV3Qm94PSIwIDAgNCA0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8bWFzayBpZD0ibWFzazBfNzU5XzExMDgiIHN0eWxlPSJtYXNrLXR5cGU6YWxwaGEiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHg9IjAiIHk9IjAiIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjRDZEOEQ5Ii8+CjwvbWFzaz4KPGcgbWFzaz0idXJsKCNtYXNrMF83NTlfMTEwOCkiPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTS0zLjY0MDAyIDMuNDQxNDFMMi4wNzM5NyAtMi4yNzI1OEwyLjc4MTA4IC0xLjU2NTQ4TC0yLjkzMjkxIDQuMTQ4NTJMLTMuNjQwMDIgMy40NDE0MVoiIGZpbGw9IiNENkQ4REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0tMS41MTg2OCA1LjU2Mjc1TDQuMTk1MzEgLTAuMTUxMjQ1TDQuOTAyNDIgMC41NTU4NjJMLTAuODExNTc1IDYuMjY5ODZMLTEuNTE4NjggNS41NjI3NVoiIGZpbGw9IiNENkQ4REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0wLjYwMjY1NiA3LjY4NDAzTDYuMzE2NjUgMS45NzAwM0w3LjAyMzc2IDIuNjc3MTRMMS4zMDk3NiA4LjM5MTEzTDAuNjAyNjU2IDcuNjg0MDNaIiBmaWxsPSIjRDZEOERCIi8+CjwvZz4KPC9zdmc+", sp = "RANGE_PROTECTION_CAN_VIEW_RENDER_EXTENSION_KEY", ip = "RANGE_PROTECTION_CAN_NOT_VIEW_RENDER_EXTENSION_KEY", vP = 25, bP = 80; class op extends Zh { constructor() { super(); w(this, "_pattern", null); w(this, "_img", new Image()); w(this, "renderCache", /* @__PURE__ */ new Set()); this._img.src = rp; } clearCache() { this.renderCache.clear(); } draw(t, n, s) { const { worksheet: i } = s; i && (t.save(), this._pattern || (this._pattern = t.createPattern(this._img, "repeat")), this.renderCache.clear(), co.foreach(s.rowColumnSegment, (o, l) => { if (!i.getRowVisible(o) || !i.getColVisible(l)) return; const { selectionProtection: a = [] } = i.getCell(o, l) || {}; this._pattern && (t.fillStyle = this._pattern, a.forEach((c) => { if (c.ruleId && this.shouldRender(c)) { if (this.renderCache.has(c.ruleId)) return; this.renderCache.add(c.ruleId), c.ranges.forEach((d) => { const u = s.getCellWithCoordByIndex(d.startRow, d.startColumn, !1), h = s.getCellWithCoordByIndex(d.endRow, d.endColumn, !1); t.fillRect(u.startX, u.startY, h.endX - u.startX, h.endY - u.startY); }); } })); }), t.restore()); } } class _P extends op { constructor() { super(); w(this, "uKey", sp); w(this, "Z_INDEX", vP); } shouldRender(t) { return (t == null ? void 0 : t[de.View]) !== !1; } } class wP extends op { constructor() { super(); w(this, "uKey", ip); w(this, "Z_INDEX", bP); } shouldRender(t) { return (t == null ? void 0 : t[de.View]) === !1; } } const lp = "worksheet-protection", Mh = 25, RP = 80; class IP extends Zh { constructor() { super(); w(this, "uKey", lp); w(this, "Z_INDEX", Mh); w(this, "_pattern"); w(this, "_img", new Image()); this._img.src = rp; } draw(t, n, s) { const { worksheet: i } = s; if (!i) return !1; t.save(), this._pattern || (this._pattern = t.createPattern(this._img, "repeat")); const { startRow: o, startColumn: l, endRow: a, endColumn: c } = s.rowColumnSegment, d = s.getCellWithCoordByIndex(o, l, !1), u = s.getCellWithCoordByIndex(a, c, !1), { hasWorksheetRule: h = !1, selectionProtection: m = [] } = i.getCell(o, l) || {}; if (this._pattern) { if (m.length > 0) { const f = m[0]; (f == null ? void 0 : f[de.View]) ? this.setZIndex(Mh) : this.setZIndex(RP); } t.fillStyle = this._pattern, h && t.fillRect(d.startX, d.startY, u.endX - d.startX, u.endY - d.startY), t.restore(); } } setZIndex(t) { this.Z_INDEX = t; } } const yP = (r) => { const { editState: e, onEditStateChange: t, viewState: n, onViewStateChange: s, permissionId: i } = r, o = W(Ee), l = W(bs), a = W(bl), c = W(Vr), d = W(Dt), u = W(L), h = is(c.selectUserList$, c.selectUserList), m = u.getCurrentUnitForType(O.UNIVER_SHEET), f = m == null ? void 0 : m.getActiveSheet(); if (!m || !f) return null; const g = m.getUnitId(), p = async () => { const S = await a.listCollaborators({ objectID: g, unitID: g }), b = d.getCurrentUser(); c.setCanEditUserList(S.filter((v) => { var _; return ((_ = v.subject) == null ? void 0 : _.userID) !== b.userID; })), l.open({ id: zo, title: { title: "" }, children: { label: Qf }, width: 280, destroyOnClose: !0, onClose: () => l.close(zo), className: "sheet-permission-user-dialog" }); }; return be(() => { i ? (async () => { const v = (await a.listCollaborators({ objectID: i, unitID: g })).filter((_) => _.role === Nt.Editor); v.length > 0 && t(on.DesignedUserCanEdit), c.setSelectUserList(v), c.setOldCollaboratorList(v); })() : (c.setSelectUserList([]), c.setOldCollaboratorList([])); }, []), /* @__PURE__ */ C.jsxs(C.Fragment, { children: [ /* @__PURE__ */ C.jsx(To, { className: nt.sheetPermissionPanelTitle, label: o.t("permission.panel.editPermission"), children: /* @__PURE__ */ C.jsxs( vc, { value: e, onChange: (S) => t(S), className: nt.radioGroupVertical, children: [ /* @__PURE__ */ C.jsx(Zr, { value: on.OnlyMe, children: /* @__PURE__ */ C.jsx("span", { className: nt.text, children: o.t("permission.panel.onlyICanEdit") }) }), /* @__PURE__ */ C.jsx(Zr, { value: on.DesignedUserCanEdit, children: /* @__PURE__ */ C.jsx("span", { className: nt.text, children: o.t("permission.panel.designedUserCanEdit") }) }) ] } ) }), e === on.DesignedUserCanEdit && /* @__PURE__ */ C.jsxs("div", { className: nt.sheetPermissionDesignPersonPanel, children: [ /* @__PURE__ */ C.jsxs("div", { className: nt.sheetPermissionDesignPersonPanelHeader, children: [ /* @__PURE__ */ C.jsx("span", { children: o.t("permission.panel.designedPerson") }), /* @__PURE__ */ C.jsx("span", { className: nt.sheetPermissionDesignPersonPanelHeaderAdd, onClick: p, children: o.t("permission.panel.addPerson") }) ] }), /* @__PURE__ */ C.jsx("div", { className: nt.sheetPermissionDesignPersonPanelSplit }), /* @__PURE__ */ C.jsx("div", { className: nt.sheetPermissionDesignPersonPanelContent, children: (h == null ? void 0 : h.length) > 0 ? h.map((S) => { var b, v, _; return /* @__PURE__ */ C.jsxs("div", { className: nt.sheetPermissionDesignPersonPanelContentItem, children: [ /* @__PURE__ */ C.jsx(Pd, { size: 24, src: (b = S.subject) == null ? void 0 : b.avatar }), /* @__PURE__ */ C.jsx("span", { className: nt.sheetPermissionDesignPersonPanelContentItemName, children: (v = S.subject) == null ? void 0 : v.name }), /* @__PURE__ */ C.jsx( Um, { className: nt.sheetPermissionDesignPersonPanelContentItemSelect, value: "edit", onChange: (R) => { R === "delete" && c.setSelectUserList(h.filter((I) => { var y, M; return ((y = I.subject) == null ? void 0 : y.userID) !== ((M = S.subject) == null ? void 0 : M.userID); })); }, options: [ { label: `${o.t("permission.panel.canEdit")}`, value: "edit" }, { label: `${o.t("permission.panel.delete")}`, value: "delete" } ] } ) ] }, (_ = S.subject) == null ? void 0 : _.userID); }) : /* @__PURE__ */ C.jsxs("div", { className: nt.sheetPermissionUserListEmpty, children: [ /* @__PURE__ */ C.jsx("img", { width: 240, height: 120, src: np, alt: "" }), /* @__PURE__ */ C.jsx("p", { className: nt.sheetPermissionUserListEmptyText, children: o.t("permission.dialog.userEmpty") }) ] }) }) ] }), /* @__PURE__ */ C.jsx(To, { className: nt.sheetPermissionPanelTitle, label: o.t("permission.panel.viewPermission"), children: /* @__PURE__ */ C.jsxs( vc, { value: n, onChange: (S) => s(S), className: nt.radioGroupVertical, children: [ /* @__PURE__ */ C.jsx(Zr, { value: ls.OthersCanView, children: /* @__PURE__ */ C.jsx("span", { className: nt.text, children: o.t("permission.panel.othersCanView") }) }), /* @__PURE__ */ C.jsx(Zr, { value: ls.NoOneElseCanView, children: /* @__PURE__ */ C.jsx("span", { className: nt.text, children: o.t("permission.panel.noOneElseCanView") }) }) ] } ) }) ] }); }; var MP = Object.defineProperty, PP = Object.getOwnPropertyDescriptor, tu = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? PP(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && MP(e, t, s), s; }, Ft = (r, e) => (t, n) => e(t, n, r); let yi = class extends ce { constructor(r, e, t) { super(), this._injector = r, this._componentManager = e, this._uiPartsService = t, this._init(); } _init() { this._initComponents(), this._initUiPartComponents(); } _initComponents() { [ [Jf, Xf], [$_, ea], [ew, Zd], [tw, Hn], [$f, Yd], [fi, jM], [Qf, fP], [Kf, nP], [ep, CP] ].forEach(([r, e]) => { this.disposeWithMe(this._componentManager.register( r, e )); }); } _initUiPartComponents() { var t; const e = this._injector.get(xr).getConfig(Pr); (t = e == null ? void 0 : e.customComponents) != null && t.has(Dc) || this.disposeWithMe(this._uiPartsService.registerComponent(Dc, () => Qr(yP, this._injector))); } }; yi = tu([ Ft(0, D(vt)), Ft(1, D(Dn)), Ft(2, D(yl)) ], yi); let il = class extends ce { constructor(e, t, n, s, i) { var l; super(); w(this, "_rangeProtectionCanViewRenderExtension", new _P()); w(this, "_rangeProtectionCanNotViewRenderExtension", new wP()); this._context = e, this._rangeProtectionRuleModel = t, this._sheetSkeletonManagerService = n, this._permissionService = s, this._configService = i; const o = this._configService.getConfig(Pr); (l = o == null ? void 0 : o.customComponents) != null && l.has(qf) || (this._initRender(), this._initSkeleton(), this._rangeProtectionRuleModel.ruleChange$.subscribe((a) => { var c, d; ((c = a.oldRule) != null && c.id && this._rangeProtectionCanViewRenderExtension.renderCache.has(a.oldRule.id) || this._rangeProtectionCanViewRenderExtension.renderCache.has(a.rule.id)) && this._rangeProtectionCanViewRenderExtension.clearCache(), ((d = a.oldRule) != null && d.id && this._rangeProtectionCanNotViewRenderExtension.renderCache.has(a.oldRule.id) || this._rangeProtectionCanNotViewRenderExtension.renderCache.has(a.rule.id)) && this._rangeProtectionCanNotViewRenderExtension.clearCache(); })); } _initRender() { const e = this._context.mainComponent; e && (e.getExtensionByKey(sp) || e.register(this._rangeProtectionCanViewRenderExtension), e.getExtensionByKey(ip) || e.register(this._rangeProtectionCanNotViewRenderExtension)); } _initSkeleton() { const e = () => { var t; this._sheetSkeletonManagerService.reCalculate(), (t = this._context.mainComponent) == null || t.makeDirty(); }; this.disposeWithMe(mt( this._permissionService.permissionPointUpdate$.pipe(tm(300, void 0, { trailing: !0 })), this._rangeProtectionRuleModel.rangeRuleInitStateChange$, this._rangeProtectionRuleModel.ruleChange$ ).pipe().subscribe(e)); } }; il = tu([ Ft(1, D(Ye)), Ft(2, D(me)), Ft(3, $e), Ft(4, xr) ], il); let ol = class extends ce { constructor(e, t, n, s, i, o) { var a; super(); w(this, "_worksheetProtectionRenderExtension", new IP()); this._context = e, this._renderManagerService = t, this._univerInstanceService = n, this._sheetSkeletonManagerService = s, this._worksheetProtectionRuleModel = i, this._configService = o; const l = this._configService.getConfig(Pr); (a = l == null ? void 0 : l.customComponents) != null && a.has(qf) || (this._initRender(), this._initSkeleton()); } _initRender() { const e = this._context.unitId, t = e && this._renderManagerService.getRenderById(e), n = t && t.mainComponent; n && (n.getExtensionByKey(lp) || n.register(this._worksheetProtectionRenderExtension)); } _initSkeleton() { const e = () => { var t; this._sheetSkeletonManagerService.reCalculate(), (t = this._context.mainComponent) == null || t.makeDirty(); }; this.disposeWithMe(mt( this._worksheetProtectionRuleModel.worksheetRuleInitStateChange$ ).pipe().subscribe(e)); } }; ol = tu([ Ft(1, D(Ce)), Ft(2, D(L)), Ft(3, D(me)), Ft(4, D(ft)), Ft(5, D(xr)) ], ol); var EP = Object.defineProperty, TP = Object.getOwnPropertyDescriptor, xP = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? TP(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && EP(e, t, s), s; }, OP = (r, e) => (t, n) => e(t, n, r); let ll = class extends ce { constructor(r, e) { super(), this._context = r, this._formatPainterService = e, this._initialize(); } _initialize() { this._bindFormatPainterStatus(); } _bindFormatPainterStatus() { this.disposeWithMe( Ae(this._formatPainterService.status$.subscribe((r) => { const e = this._context.scene; e && (r !== zt.OFF ? e.setDefaultCursor(Re.CELL) : e.setDefaultCursor(Re.DEFAULT)); })) ); } }; ll = xP([ OP(1, Un) ], ll); var AP = Object.defineProperty, NP = Object.getOwnPropertyDescriptor, HP = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? NP(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && AP(e, t, s), s; }, Ds = (r, e) => (t, n) => e(t, n, r); let Fc = class extends ce { constructor(r, e, t, n, s, i) { super(), this._context = r, this._layoutService = e, this._contextMenuService = t, this._selectionManagerService = n, this._selectionRenderService = s, this._sheetSkeletonManagerService = i, this._init(); } _init() { let r = !1; this.disposeWithMe(this._selectionManagerService.selectionMoveStart$.subscribe(() => r = !0)), this.disposeWithMe(this._selectionManagerService.selectionMoveEnd$.subscribe((e) => { const t = this._sheetSkeletonManagerService.getCurrent().skeleton; if (!t || !e || r === !1) return; r = !1; const n = e[0]; if (!n.primary) return; const s = Pt(n, t), i = n.range.rangeType, { scene: o } = this._context, l = o.getViewport(z.VIEW_MAIN), a = (l == null ? void 0 : l.viewportScrollX) || 0, c = (l == null ? void 0 : l.viewportScrollY) || 0; let d = 0, u = 0; const h = t.rowHeaderWidth, m = this._layoutService.getContentElement().getBoundingClientRect(); switch (i) { case j.NORMAL: d = s.rangeWithCoord.startX + m.left - a, u = s.rangeWithCoord.endY + m.top - c; break; case j.COLUMN: d = s.rangeWithCoord.startX + m.left - a, u = Math.min(m.height / 2, s.rangeWithCoord.endY) + 40; break; case j.ROW: d = (m.width - h) / 2 + 20, u = s.rangeWithCoord.endY + m.top - c; break; case j.ALL: d = s.rangeWithCoord.startX + m.left, u = s.rangeWithCoord.startY + m.top; break; default: d = s.rangeWithCoord.startX + m.left - a, u = s.rangeWithCoord.endY + m.top - c; break; } d = se.clamp(d, h, m.width), u = se.clamp(u, m.top, m.height), this._contextMenuService.triggerContextMenu({ clientX: d, clientY: u, preventDefault: () => { }, stopPropagation: () => { } }, Ct.MAIN_AREA); })); } }; Fc = HP([ Ds(1, _l), Ds(2, Rl), Ds(3, D($)), Ds(4, dt), Ds(5, D(me)) ], Fc); var VP = Object.defineProperty, kP = Object.getOwnPropertyDescriptor, DP = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? kP(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && VP(e, t, s), s; }, jr = (r, e) => (t, n) => e(t, n, r); const LP = [Lt.id, Fn.id]; let Uc = class extends ce { constructor(r, e, t, n, s, i, o) { super(), this._context = r, this._sheetSkeletonManagerService = e, this._commandService = t, this._renderManagerService = n, this._selectionManagerService = s, this._scrollManagerService = i, this._univerInstanceService = o, this._init(); } scrollToRange(r) { let { endRow: e, endColumn: t, startColumn: n, startRow: s } = r; const i = this._getViewportBounding(); if (r.rangeType === j.ROW ? (n = 0, t = 0) : r.rangeType === j.COLUMN && (s = 0, e = 0), i) { const o = i.startRow > e ? s : e, l = i.startColumn > t ? n : t; return this._scrollToCell(o, l); } else return this._scrollToCell(s, n); } _init() { this._initCommandListener(), this._initScrollEventListener(), this._initPointerScrollEvent(), this._initSkeletonListener(); } _initCommandListener() { this.disposeWithMe( this._commandService.onCommandExecuted((r) => { if (LP.includes(r.id)) this._scrollToSelection(); else if (r.id === cd.id) { const e = r.params; this.scrollToRange(e); } else if (r.id === Gt.id) { const e = r.params; this._scrollToSelectionForExpand(e); } }) ); } _scrollToSelectionForExpand(r) { setTimeout(() => { const e = this._selectionManagerService.getCurrentLastSelection(); if (e == null) return; const { startRow: t, startColumn: n, endRow: s, endColumn: i } = e.range, o = this._getViewportBounding(); if (o == null) return; const { startRow: l, startColumn: a, endRow: c, endColumn: d } = o; let u = 0, h = 0; t > l ? u = s : s < c ? u = t : u = l, n > a ? h = i : i < d ? h = n : h = a, r.direction === B.DOWN ? u = s : r.direction === B.UP ? u = t : r.direction === B.RIGHT ? h = i : r.direction === B.LEFT && (h = n), this._scrollToCell(u, h); }, 0); } _getFreeze() { var e; const r = (e = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : e.skeleton.getWorksheetConfig(); if (r != null) return r.freeze; } // eslint-disable-next-line max-lines-per-function _initScrollEventListener() { const { scene: r } = this._context; if (r == null) return; const e = r.getViewport(z.VIEW_MAIN); e && (this.disposeWithMe( Ae( // wheel event --> set-scroll.command('sheet.operation.set-scroll') --> scroll.operation.ts --> // scrollManagerService.setScrollInfoAndEmitEvent ---> scrollManagerService.setScrollInfo(raw value, may be negative) && // _notifyCurrentScrollInfo this._scrollManagerService.rawScrollInfo$.subscribe((t) => { var h; if (t == null) { e.scrollToViewportPos({ viewportScrollX: 0, viewportScrollY: 0 }); return; } const n = (h = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : h.skeleton; if (!n) return; const { sheetViewStartRow: s, sheetViewStartColumn: i, offsetX: o, offsetY: l } = t, { startX: a, startY: c } = n.getCellWithCoordByIndex( s, i, !1 ), d = a + o, u = c + l; e.scrollToViewportPos({ viewportScrollX: d, viewportScrollY: u }); }) ) ), this.disposeWithMe( e.onScrollAfter$.subscribeEvent((t) => { var f; if (!t) return; const n = (f = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : f.skeleton; if (n == null) return; const s = this._getSheetObject(); if (n == null || s == null) return; const { viewportScrollX: i, viewportScrollY: o, scrollX: l, scrollY: a } = t, { row: c, column: d, rowOffset: u, columnOffset: h } = n.getDecomposedOffset( i, o ), m = { sheetViewStartRow: c, sheetViewStartColumn: d, offsetX: h, offsetY: u }; this._scrollManagerService.setScrollStateToCurrSheet(m), this._scrollManagerService.validViewportScrollInfo$.next({ ...m, scrollX: l, scrollY: a, viewportScrollX: i, viewportScrollY: o }); }) ), this.disposeWithMe( e.onScrollByBar$.subscribeEvent((t) => { var h; const n = (h = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : h.skeleton; if (n == null || t.isTrigger === !1) return; const s = this._getSheetObject(); if (n == null || s == null) return; const { viewportScrollX: i = 0, viewportScrollY: o = 0 } = t, l = this._getFreeze(), { row: a, column: c, rowOffset: d, columnOffset: u } = n.getDecomposedOffset( i, o ); this._commandService.executeCommand(un.id, { sheetViewStartRow: a + ((l == null ? void 0 : l.ySplit) || 0), sheetViewStartColumn: c + ((l == null ? void 0 : l.xSplit) || 0), offsetX: u, offsetY: d }); }) )); } _initSkeletonListener() { this.disposeWithMe(Ae( this._sheetSkeletonManagerService.currentSkeletonBefore$.subscribe((r) => { if (r == null) return; const e = { unitId: r.unitId, sheetId: r.sheetId }; this._scrollManagerService.setSearchParam(e); const t = this._getSheetObject(); if (!t) return; const s = t.scene.getViewport(z.VIEW_MAIN), i = this._scrollManagerService.getScrollStateByParam(e), { viewportScrollX: o, viewportScrollY: l } = this._scrollManagerService.calcViewportScrollFromRowColOffset(i); s && (i ? (s.viewportScrollX = o, s.viewportScrollY = l) : (s.viewportScrollX = 0, s.viewportScrollY = 0), this._updateSceneSize(r)); }) )); } /** * for mobile */ // eslint-disable-next-line max-lines-per-function _initPointerScrollEvent() { const r = this._getSheetObject(); if (!r) return; const e = this._scrollManagerService, t = r.scene, n = r.spreadsheet, s = t.getViewport(z.VIEW_MAIN), i = { x: 0, y: 0 }; let o = !1; const l = { x: 0, y: 0 }, a = 0.95; let c = null; const d = () => { if (!s) return; l.x *= a, l.y *= a, i.x += l.x, i.y += l.y; const h = l.x, m = l.y; (m !== 0 || h !== 0) && this._commandService.executeCommand(li.id, { offsetY: m, offsetX: h }), Math.abs(l.x) > 1 || Math.abs(l.y) > 1 ? c = requestAnimationFrame(d) : c = null; }, u = () => { cancelAnimationFrame(c), c = null; }; n.onPointerDown$.subscribeEvent((h, m) => { u(), s && (i.x = h.offsetX, i.y = h.offsetY, o = !0, m.stopPropagation()); }), n.onPointerMove$.subscribeEvent((h, m) => { if (!o || !s) return; const f = h, g = -(f.offsetX - i.x), p = -(f.offsetY - i.y); l.x = -(f.offsetX - i.x), l.y = -(f.offsetY - i.y); const S = g, b = p; (g !== 0 || p !== 0) && (b !== 0 || S !== 0) && this._commandService.executeCommand(li.id, { offsetY: b, offsetX: S }), e.getCurrentScrollState(), i.x = f.offsetX, i.y = f.offsetY, m.stopPropagation(); }), n.onPointerUp$.subscribeEvent((h) => { o = !1, c = requestAnimationFrame(d); }), n.onPointerLeave$.subscribeEvent(() => { o = !1; }), n.onPointerOut$.subscribeEvent(() => { o = !1; }), t.onPointerOut$.subscribeEvent(() => { o = !1; }), t.onPointerCancel$.subscribeEvent(() => { o = !1; }); } _updateSceneSize(r) { var u; if (r == null) return; const { unitId: e } = this._context, { skeleton: t } = r, n = (u = this._renderManagerService.getRenderById(e)) == null ? void 0 : u.scene; if (t == null || n == null) return; const { rowTotalHeight: s, columnTotalWidth: i, rowHeaderWidthAndMarginLeft: o, columnHeaderHeightAndMarginTop: l } = t, c = this._context.unit.getActiveSheet(); if (!c) return; const d = c.getZoomRatio() || 1; n == null || n.setScaleValue(d, d), n == null || n.transformByState({ width: o + i, height: l + s }); } _getSheetObject() { return pn(this._context.unit, this._context); } _scrollToSelectionByDirection(r) { const e = this._getViewportBounding(); if (e == null) return !1; const { startRow: t, startColumn: n, endRow: s, endColumn: i } = e; let o = 0, l = 0; const { startRow: a, startColumn: c, endRow: d, endColumn: u } = r; a >= t && (o = d), d <= s && (o = a), c >= n && (l = u), u <= i && (l = c), this._scrollToCell(o, l); } _scrollToSelection(r = !0) { const e = this._selectionManagerService.getCurrentLastSelection(); if (e == null) return; const { startRow: t, startColumn: n, actualRow: s, actualColumn: i } = e.primary, o = r ? s : t, l = r ? i : n; this._scrollToCell(o, l); } _getViewportBounding() { var n, s; const r = (n = this._getSheetObject()) == null ? void 0 : n.scene; if (r == null) return; const e = r.getViewport(z.VIEW_MAIN); if (e == null) return; const t = (s = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : s.skeleton; if (t != null) return t.getRangeByViewport(e.calcViewportInfo()); } // eslint-disable-next-line max-lines-per-function, complexity _scrollToCell(r, e) { var R, I, y, M; const { rowHeightAccumulation: t, columnWidthAccumulation: n } = (I = (R = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : R.skeleton) != null ? I : {}; if (t == null || n == null) return !1; const s = (y = this._getSheetObject()) == null ? void 0 : y.scene; if (s == null) return !1; const i = s.getViewport(z.VIEW_MAIN); if (i == null || ((M = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : M.skeleton) == null) return !1; const l = this._context.unit.getActiveSheet(); if (!l) return !1; const { startColumn: a, startRow: c, ySplit: d, xSplit: u } = l.getFreeze(), h = this._getViewportBounding(); if (h == null) return !1; const { startRow: m, startColumn: f, endRow: g, endColumn: p } = h; let S, b; if (r >= c && e >= a - u && (r <= m && (S = r), r >= g)) { const P = t[r] - i.height; for (let E = m; E <= r; E++) if (t[E] >= P) { S = E + 1; break; } } if (e >= a && r >= c - d && (e <= f && (b = e), e >= p)) { const P = n[e] - i.width; for (let E = f; E <= e; E++) if (n[E] >= P) { b = E + 1; break; } } if (S === void 0 && b === void 0) return !1; const { offsetX: v, offsetY: _ } = this._scrollManagerService.getCurrentScrollState() || {}; return this._commandService.syncExecuteCommand(un.id, { sheetViewStartRow: S, sheetViewStartColumn: b, offsetX: b === void 0 ? v : 0, offsetY: S === void 0 ? _ : 0 }); } }; Uc = DP([ jr(1, D(me)), jr(2, F), jr(3, Ce), jr(4, D($)), jr(5, D(yt)), jr(6, L) ], Uc); const WP = sr("PRINTING_RANGE"), BP = sr("PRINTING_COMPONENT_COLLECT"); class ap extends ce { constructor() { super(); w(this, "interceptor", new Cs({ PRINTING_RANGE: WP, PRINTING_COMPONENT_COLLECT: BP })); this.disposeWithMe(this.interceptor.intercept(this.interceptor.getInterceptPoints().PRINTING_RANGE, { priority: -1, handler: (t) => t })), this.disposeWithMe(this.interceptor.intercept(this.interceptor.getInterceptPoints().PRINTING_COMPONENT_COLLECT, { priority: -1, handler: (t) => t })); } } class FP extends xd { constructor(t, n, s, i) { super(t, n, s, i); /** * topLeft controlPointer, it is not visible, just transparent, for handling event. */ w(this, "_fillControlTopLeft"); /** * bottomRight controlPointer, it is not visible, just transparent, for handling event. */ w(this, "_fillControlBottomRight"); w(this, "_rangeType", j.NORMAL); this._scene = t, this._zIndex = n, this._themeService = s, this._rangeType = (i == null ? void 0 : i.rangeType) || j.NORMAL, this.initControlPoints(); } initControlPoints() { const t = this.currentStyle, n = t.expandCornerSize || 0, s = (t.expandCornerSize || 0) / 4, i = t.autofillStrokeWidth || 0, o = t.stroke, l = t.autofillStroke, a = this.zIndex; this._fillControlTopLeft = new ge(Ic.fillTopLeft + a, { zIndex: a + 2, width: n, height: n, radius: n / 2, visualWidth: s, visualHeight: s, strokeWidth: i }), this._fillControlBottomRight = new ge(Ic.fillBottomRight + a, { zIndex: a + 2, width: n, height: n, radius: n / 2, visualHeight: s, visualWidth: s, strokeWidth: i }); const c = { fill: o, stroke: l, strokeScaleEnabled: !1 }; this._fillControlTopLeft.setProps({ ...c }), this._fillControlBottomRight.setProps({ ...c }); const d = [ this._fillControlTopLeft, this._fillControlBottomRight ]; switch (this._rangeType) { case j.ROW: this.rowHeaderGroup.addObjects(...d); break; case j.COLUMN: this.columnHeaderGroup.addObjects(...d); break; case j.NORMAL: this.selectionShapeGroup.addObjects(...d); } this.getScene().addObjects(d, Ho); } get fillControlTopLeft() { return this._fillControlTopLeft; } set fillControlTopLeft(t) { this._fillControlTopLeft = t; } get fillControlBottomRight() { return this._fillControlBottomRight; } set fillControlBottomRight(t) { this._fillControlBottomRight = t; } get rangeType() { return this._rangeType; } set rangeType(t) { this._rangeType = t; } dispose() { var t, n; (t = this._fillControlBottomRight) == null || t.dispose(), (n = this._fillControlTopLeft) == null || n.dispose(), super.dispose(); } _updateLayoutOfSelectionControl(t) { var i, o; super._updateLayoutOfSelectionControl(t); const n = this.currentStyle; t == null && (t = n); const { widgets: s = n.widgets } = t; if (this.currentStyle = t, this._enableAutoFill === !0 && !super._hasWidgets(s)) { const { viewportScrollX: l, viewportScrollY: a } = this.getViewportMainScrollInfo(), { endX: c, endY: d } = this.selectionModel; this.transformControlPoint(l, a, c, d), this.fillControlTopLeft.show(), this.fillControlBottomRight.show(); } else (i = this.fillControlTopLeft) == null || i.hide(), (o = this.fillControlBottomRight) == null || o.hide(); } getViewportMainScrollInfo() { const t = this.getScene().getViewport(z.VIEW_MAIN); return { viewportScrollX: (t == null ? void 0 : t.viewportScrollX) || 0, viewportScrollY: (t == null ? void 0 : t.viewportScrollY) || 0, width: (t == null ? void 0 : t.width) || 0, height: (t == null ? void 0 : t.height) || 0 }; } /** * Mainly for row & col selection control point position. update control point position by when scrolling. * @param viewportScrollX viewportScrollX * @param viewportScrollY * @param sheetContentWidth * @param sheetContentHeight max sheet content height, for very short sheet, control pointer shoud not out of sheet */ transformControlPoint(t = 0, n = 0, s = 0, i = 0) { const o = this.currentStyle, l = this.selectionModel.rangeType, a = o.expandCornerSize, { startX: c, startY: d, endX: u, endY: h } = this.selectionModel, m = this.getViewportMainScrollInfo(), f = m.width, g = m.height; switch (l) { case j.NORMAL: this.fillControlTopLeft.transformByState({ left: -a / 2, top: -a / 2 }), this.fillControlBottomRight.transformByState({ left: u - c - a / 2, top: h - d - a / 2 }); break; case j.ROW: { const p = Math.min(f / 2 + t, s), S = -a / 2 + p; this.fillControlTopLeft.transformByState({ left: S, top: -a / 2 }), this.fillControlBottomRight.transformByState({ left: S, top: -a / 2 + h - d }); } break; case j.COLUMN: { const p = Math.min(+g / 2 + n, i), S = -a / 2 + p; this.fillControlTopLeft.transformByState({ left: -a / 2, top: S }), this.fillControlBottomRight.transformByState({ left: -a / 2 + u - c, top: S }); } break; default: console.error("unknown range type"); } } } var UP = Object.defineProperty, jP = Object.getOwnPropertyDescriptor, XP = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? jP(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && UP(e, t, s), s; }, wn = (r, e) => (t, n) => e(t, n, r); let al = class extends ef { constructor(e, t, n, s, i, o, l, a, c, d) { super( t, n, s, o, c ); w(this, "_workbookSelections"); w(this, "_renderDisposable", null); w(this, "_expandingSelection", !1); w(this, "_selectionControls", []); // sheetID:Controls w(this, "expandingControlMode", "bottom-right"); this._context = e, this._logService = l, this._commandService = a, this._contextService = c, this._scrollManagerService = d, this._workbookSelections = i.getWorkbookSelections(this._context.unitId), this._init(); } _init() { const e = this._getSheetObject(); this._initEventListeners(e), this._initSelectionChangeListener(), this._initSkeletonChangeListener(), this._initUserActionSyncListener(), this._updateControlPointWhenScrolling(); } _initSkeletonChangeListener() { this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((e) => { if (e == null) { this._logService.error("[SelectionRenderService]: should not receive null!"); return; } const t = this._context.unitId, { sheetId: n, skeleton: s } = e, { scene: i } = this._context, o = i.getViewport(z.VIEW_MAIN); this._changeRuntime(s, i, o), this._workbookSelections.getCurrentLastSelection() || this._commandService.syncExecuteCommand(He.id, { unitId: t, subUnitId: n, selections: [Od(s)] }); })); } _initSelectionChangeListener() { } _initEventListeners(e) { const { spreadsheetRowHeader: t, spreadsheetColumnHeader: n, spreadsheet: s, spreadsheetLeftTopPlaceholder: i } = e, { scene: o } = this._context; this._initSpreadsheetEvent(e), this.disposeWithMe( t == null ? void 0 : t.onPointerUp$.subscribeEvent((l, a) => { if (this._normalSelectionDisabled()) return; const c = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: d } = Nn(l.offsetX, l.offsetY, o, c); Nf(this._workbookSelections.getCurrentSelections(), d) || (this.createNewSelection(l, (s.zIndex || 1) + 1, j.ROW, this._getActiveViewport(l)), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle())); }) ), this.disposeWithMe( n == null ? void 0 : n.onPointerUp$.subscribeEvent((l, a) => { if (this._normalSelectionDisabled()) return; const c = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: d } = Nn(l.offsetX, l.offsetY, o, c); Hf(this._workbookSelections.getCurrentSelections(), d) || (this.createNewSelection(l, (s.zIndex || 1) + 1, j.COLUMN, this._getActiveViewport(l)), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle())); }) ), this.disposeWithMe(i == null ? void 0 : i.onPointerUp$.subscribeEvent((l, a) => { if (this._normalSelectionDisabled()) return; this._reset(); const c = this._sheetSkeletonManagerService.getCurrent().skeleton, d = tf(c); this._addSelectionControlByModelData(d), this.refreshSelectionMoveStart(), a.stopPropagation(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()); })); } _initSpreadsheetEvent(e) { const { spreadsheet: t } = e; let n; const s = 500, i = { x: 0, y: 0 }, o = () => { clearTimeout(n); }, l = (d, u) => { this.createNewSelection( d, t.zIndex + 1, j.NORMAL, this._getActiveViewport(d) ), u && this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()); }; t == null || t.onPointerMove$.subscribeEvent((d, u) => { (Math.abs(d.offsetX - i.x) > 10 || Math.abs(d.offsetY - i.y) > 10) && o(); }); const a = t == null ? void 0 : t.onPointerDown$.subscribeEvent((d, u) => { i.x = d.offsetX, i.y = d.offsetY, n = setTimeout(() => { l(d, !0); }, s), u.stopPropagation(); }), c = t == null ? void 0 : t.onPointerUp$.subscribeEvent((d, u) => { if (this._normalSelectionDisabled()) return; clearTimeout(n); const h = 10; Math.abs(d.offsetX - i.x) > h || Math.abs(d.offsetY - i.y) > h || (l(d, !1), u.stopPropagation()); }); this.disposeWithMe(Ae(a)), this.disposeWithMe(Ae(c)); } _initUserActionSyncListener() { this.disposeWithMe(this.selectionMoveStart$.subscribe((e) => this._updateSelections(e, Xt.MOVE_START))), this.disposeWithMe(this.selectionMoving$.subscribe((e) => this._updateSelections(e, Xt.MOVING))), this.disposeWithMe(this._contextService.subscribeContextValue$(Js).pipe(Vt(!1), cn()).subscribe((e) => { var t; e ? ((t = this._renderDisposable) == null || t.dispose(), this._renderDisposable = null, this._reset()) : this._renderDisposable = Ae( this.selectionMoveEnd$.subscribe((n) => this._updateSelections(n, Xt.MOVE_END)) ); })); } _updateSelections(e, t) { const n = this._context.unit, s = n.getUnitId(), i = n.getActiveSheet().getSheetId(); e.length !== 0 && this._commandService.executeCommand(He.id, { unitId: s, subUnitId: i, type: t, selections: e.map( (o) => Am(o) ) }); } /** * invoked when pointerup or long press on spreadsheet, or pointerdown on row&col * then move curr selection to cell at cursor * Main purpose to create a new selection, or update curr selection to a new range. * @param evt * @param _zIndex * @param rangeType * @param viewport */ createNewSelection(e, t = 0, n = j.NORMAL, s) { this._rangeType = n; const i = this._skeleton, o = this._scene; if (!o || !i) return; s && (this._activeViewport = s); const { offsetX: l, offsetY: a } = e, c = o.getCoordRelativeToViewport(Oe.FromArray([l, a])), { x: d, y: u } = c; this._startViewportPosX = d, this._startViewportPosY = u; const h = o.getScrollXYInfoByViewport(c), { scaleX: m, scaleY: f } = o.getAncestorScale(), g = this._skeleton.getCellByOffset(d, u, m, f, h); if (!g) return; switch (n) { case j.NORMAL: break; case j.ROW: g.startColumn = 0, g.endColumn = this._skeleton.getColumnCount() - 1; break; case j.COLUMN: g.startRow = 0, g.endRow = this._skeleton.getRowCount() - 1; break; case j.ALL: g.startRow = 0, g.startColumn = 0, g.endRow = this._skeleton.getRowCount() - 1, g.endColumn = this._skeleton.getColumnCount() - 1; } const p = { range: g, primary: g, style: null }; p.range.rangeType = n; const S = Pt(p, this._skeleton); this._startRangeWhenPointerDown = { ...S.rangeWithCoord }; let b = this.getActiveSelectionControl(); const v = { ...S.rangeWithCoord }; for (const _ of this.getSelectionControls()) if (_.model.isEqual(v)) { b = _; break; } (b == null ? void 0 : b.model.rangeType) !== n ? (this._clearAllSelectionControls(), b = this.newSelectionControl(o, i, p)) : b.updateRangeBySelectionWithCoord(S), this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), this._clearUpdatingListeners(), this._expandingSelection = !1; } /** * Not same as PC version, * new selection control for mobile do one more thing: bind event for two control points. * @param scene * @param rangeType */ newSelectionControl(e, t, n) { const s = this.getSelectionControls(), { rowHeaderWidth: i, columnHeaderHeight: o } = t, l = n.range.rangeType, a = new FP(e, s.length, this._themeService, { highlightHeader: this._highlightHeader, rowHeaderWidth: i, columnHeaderHeight: o, rangeType: l }), c = Pt(n, t); a.updateRangeBySelectionWithCoord(c), this._selectionControls.push(a); const { expandingModeForTopLeft: d, expandingModeForBottomRight: u } = (() => { switch (l) { case j.NORMAL: return { expandingModeForTopLeft: "top-left", expandingModeForBottomRight: "bottom-right" /* BOTTOM_RIGHT */ }; case j.ROW: return { expandingModeForTopLeft: "top", expandingModeForBottomRight: "bottom" /* BOTTOM */ }; case j.COLUMN: return { expandingModeForTopLeft: "left", expandingModeForBottomRight: "right" /* RIGHT */ }; case j.ALL: return { expandingModeForTopLeft: "top-left", expandingModeForBottomRight: "bottom-right" /* BOTTOM_RIGHT */ }; default: return { expandingModeForTopLeft: "top-left", expandingModeForBottomRight: "bottom-right" /* BOTTOM_RIGHT */ }; } })(); return a.fillControlTopLeft.onPointerDown$.subscribeEvent((h) => { this._expandingSelection = !0, this.expandingControlMode = d, this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), this._fillControlPointerDownHandler( h, l, this._activeViewport ); }), a.fillControlBottomRight.onPointerDown$.subscribeEvent((h) => { this._expandingSelection = !0, this.expandingControlMode = u, this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), this._fillControlPointerDownHandler( h, l, this._activeViewport ); }), (l === j.ROW || l === j.COLUMN) && !e.getViewport(z.VIEW_MAIN), a; } // same as PC _getActiveViewport(e) { const t = this._getSheetObject(); return t == null ? void 0 : t.scene.getActiveViewportByCoord(Oe.FromArray([e.offsetX, e.offsetY])); } // same as PC _getSheetObject() { return pn(this._context.unit, this._context); } // same as PC _normalSelectionDisabled() { return this._contextService.getContextValue(Js); } getSelectionControls() { return this._selectionControls; } _fillControlPointerDownHandler(e, t = j.NORMAL, n, s = It.ALL) { var u, h, m; const i = this._skeleton, o = this._scene; if (!o || !i) return; n && (this._activeViewport = n); const l = o.getViewport(z.VIEW_MAIN), a = this.getActiveSelectionControl(); if (!a) return; this._changeCurrCellWhenControlPointerDown(), this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), this._clearUpdatingListeners(), this._addEndingListeners(), this._scrollTimer = Kr.create(this._scene, s), this._scrollTimer.startScroll((u = l == null ? void 0 : l.left) != null ? u : 0, (h = l == null ? void 0 : l.top) != null ? h : 0, l), (m = o.getTransformer()) == null || m.clearSelectedObjects(); const c = o.getCoordRelativeToViewport(Oe.FromArray([e.offsetX, e.offsetY])); this._setupPointerMoveListener(l, a, t, s, c.x, c.y); const d = this._shortcutService.forceEscape(); this._scenePointerUpSub = o.onPointerUp$.subscribeEvent((f) => { this.endSelection(), this._expandingSelection = !1, this.expandingControlMode = "bottom-right", this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), d.dispose(); }); } _changeCurrCellWhenControlPointerDown() { const e = this.getActiveSelectionControl(), t = this._skeleton; let n; const { startRow: s, startColumn: i, endRow: o, endColumn: l } = e.model; switch (this.expandingControlMode) { case "top-left": n = t.getCellWithCoordByIndex(o, l); break; case "bottom-right": n = t.getCellWithCoordByIndex(s, i); break; case "left": n = t.getCellWithCoordByIndex(s, l), n.isMerged = !1, n.isMergedMainCell = !1; break; case "right": n = t.getCellWithCoordByIndex(s, i), n.isMerged = !1, n.isMergedMainCell = !1; break; case "top": n = t.getCellWithCoordByIndex(o, i), n.isMerged = !1, n.isMergedMainCell = !1; break; case "bottom": n = t.getCellWithCoordByIndex(s, i), n.isMerged = !1, n.isMergedMainCell = !1; break; default: n = t.getCellWithCoordByIndex(s, i); } return e.updateCurrCell(n), n; } /** * Not same as _moving in PC (base selection render service) * The diff is * In base version, new selection is determined by the cursor cell and _startRangeWhenPointerDown * * In Mobile version, new selection is determined by cursor cell and current of activeSelectionControl.model */ _movingHandler(e, t, n, s) { var M, P, E, T, A, H, x, k, U, V, N, X, Y; this._rangeType = s; const i = this._skeleton, o = this._scene, l = { startRow: n.model.startRow, endRow: n.model.endRow, startColumn: n.model.startColumn, endColumn: n.model.endColumn }, a = o.getViewport(z.VIEW_MAIN), c = (M = this._getViewportByCell(l.endRow, l.endColumn)) != null ? M : a, d = o.getScrollXYInfoByViewport( Oe.FromArray([this._startViewportPosX, this._startViewportPosY]), c ), { scaleX: u, scaleY: h } = o.getAncestorScale(); s === j.ROW ? e = Number.POSITIVE_INFINITY : s === j.COLUMN && (t = Number.POSITIVE_INFINITY); const m = this._getSelectionWithCoordByOffset(e, t, u, h, d); if (!m) return !1; const { rangeWithCoord: f } = m, g = n.model.currentCell, p = (P = g == null ? void 0 : g.mergeInfo.startRow) != null ? P : -1, S = (E = g == null ? void 0 : g.mergeInfo.endRow) != null ? E : -1, b = (T = g == null ? void 0 : g.mergeInfo.startColumn) != null ? T : -1, v = (A = g == null ? void 0 : g.mergeInfo.endColumn) != null ? A : -1; let _ = { startRow: Math.min(f.startRow, p), startColumn: Math.min(f.startColumn, b), endRow: Math.max(f.endRow, S), endColumn: Math.max(f.endColumn, v) }; if (s === j.NORMAL ? _ = i.expandRangeByMerge(_) : s === j.COLUMN ? _ = { startRow: Math.min(f.startRow, (H = g == null ? void 0 : g.actualRow) != null ? H : -1), startColumn: Math.min(f.startColumn, (x = g == null ? void 0 : g.actualColumn) != null ? x : -1), endRow: Math.max(f.endRow, (k = g == null ? void 0 : g.actualRow) != null ? k : -1), endColumn: Math.max(f.endColumn, (U = g == null ? void 0 : g.actualColumn) != null ? U : -1) } : s === j.ROW && (_ = { startRow: Math.min(f.startRow, (V = g == null ? void 0 : g.actualRow) != null ? V : -1), startColumn: Math.min(f.startColumn, (N = g == null ? void 0 : g.actualColumn) != null ? N : -1), endRow: Math.max(f.endRow, (X = g == null ? void 0 : g.actualRow) != null ? X : -1), endColumn: Math.max(f.endColumn, (Y = g == null ? void 0 : g.actualColumn) != null ? Y : -1) }), !_) return !1; const I = Pt({ range: _, style: null, primary: null }, i); (l.startRow !== _.startRow || l.startColumn !== _.startColumn || l.endRow !== _.endRow || l.endColumn !== _.endColumn) && n && (n.updateRangeBySelectionWithCoord(I), this._selectionMoving$.next(this.getSelectionDataWithStyle())); } _updateControlPointWhenScrolling() { const { scene: e } = this._context; if (!e.getViewport(z.VIEW_MAIN)) return; const n = this._scrollManagerService.validViewportScrollInfo$.subscribe((s) => { var h; if (s == null) return; const { viewportScrollX: i, viewportScrollY: o } = s, l = this.getActiveSelectionControl(); if (l == null) return; const a = (h = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : h.skeleton, c = a == null ? void 0 : a.rowTotalHeight, d = a == null ? void 0 : a.columnTotalWidth, u = l.rangeType; u === j.COLUMN ? l.transformControlPoint(0, o, d, c) : u === j.ROW && l.transformControlPoint(i, 0, d, c); }); this.disposeWithMe(Ae(n)); } }; al = XP([ wn(1, D(vt)), wn(2, D(kt)), wn(3, Il), wn(4, D($)), wn(5, D(me)), wn(6, vl), wn(7, F), wn(8, Ne), wn(9, D(yt)) ], al); var cp = Object.defineProperty, zP = Object.getOwnPropertyDescriptor, YP = (r, e, t) => e in r ? cp(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, ZP = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? zP(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && cp(e, t, s), s; }, ec = (r, e) => (t, n) => e(t, n, r), dp = (r, e, t) => YP(r, typeof e != "symbol" ? e + "" : e, t); let cl = class extends Xh { constructor(r = Lc, e, t, n) { super(), this._config = r, this._injector = e, this._renderManagerService = t, this._univerInstanceService = n; } onStarting() { [ [ds], [Sn, { useClass: Bo }], [kr, { useClass: eg }], [Un, { useClass: Fo }], [Hr, { useClass: No }], [ap], [dt, { useClass: al }], [da, { useClass: lg }], [ws, { useClass: Lo }], [Er], [wi], [vi], [bi], [Ad], [Ci], [ri], [_i], [Mr], [nl], [ps], [El, { useClass: Hm }], // permission [gs], [Vr], [ol], [Ii], [Ri], [yi] ].forEach((r) => this._injector.add(r)); } onReady() { this._markSheetAsFocused(), this._registerRenderBasics(), this._injector.get(nl); } onRendered() { this._registerRenderModules(); } _registerRenderBasics() { [ [me], [Xo], [dt, { useClass: al }], [yt] ].forEach((r) => { this.disposeWithMe(this._renderManagerService.registerRenderModule(O.UNIVER_SHEET, r)); }); } // We have to let render basics get bootstrapped before. Because some render controllers relies on // a correct skeleton when they get loaded. _registerRenderModules() { [ // https://github.com/dream-num/univer-pro/issues/669 // HeaderMoveRenderController(HMRC) must be initialized before SelectionRenderController(SRC). // Before HMRC expected selections remain unchanged when user clicks on the header. If we don't initialize HMRC before SRC, // the selections will be changed by SRC first. Maybe we should merge row/col header related render controllers to one class. [mi], [hi], // Caution: ScrollRenderController should placed before ZoomRenderController // because ZoomRenderController would change scrollInfo in currentSkeletonBefore$. [Uc], [ii], [ll], [Qo], [Jo], [tl], [el], [Ko], [$o], [ko], [Fc], [rl], [sl], [il] ].forEach((r) => { this.disposeWithMe(this._renderManagerService.registerRenderModule(O.UNIVER_SHEET, r)); }); } _markSheetAsFocused() { const r = this._univerInstanceService; this.disposeWithMe(r.getCurrentTypeOfUnit$(O.UNIVER_SHEET).pipe(Zm((e) => !!e)).subscribe((e) => { r.focusUnit(e.getUnitId()); })); } }; dp(cl, "pluginName", "SHEET_UI_PLUGIN"); dp(cl, "type", O.UNIVER_SHEET); cl = ZP([ jh(Nm, MS), ec(1, D(vt)), ec(2, Ce), ec(3, L) ], cl); var GP = Object.defineProperty, qP = Object.getOwnPropertyDescriptor, QP = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? qP(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && GP(e, t, s), s; }, tc = (r, e) => (t, n) => e(t, n, r); let dl = class extends ce { constructor(e, t, n) { super(); w(this, "_isPointer", !1); this._hoverManagerService = e, this._commandService = t, this._renderManagerService = n, this._initPointerEvent(), this._initHover(); } get _mainComponent() { var e; return (e = this._renderManagerService.getCurrentTypeOfRenderer(O.UNIVER_SHEET)) == null ? void 0 : e.mainComponent; } _initHover() { this.disposeWithMe(this._hoverManagerService.currentRichText$.subscribe((e) => { var t, n; e != null && e.bullet ? (this._isPointer || (t = this._mainComponent) == null || t.setCursor(Re.POINTER), this._isPointer = !0) : (this._isPointer && ((n = this._mainComponent) == null || n.setCursor(Re.AUTO)), this._isPointer = !1); })); } _initPointerEvent() { this.disposeWithMe(this._hoverManagerService.currentClickedCell$.subscribe((e) => { const { location: t, bullet: n } = e; n && this._commandService.executeCommand(RC.id, { unitId: t.unitId, subUnitId: t.subUnitId, row: t.row, col: t.col, paragraphIndex: n.startIndex }); })); } }; dl = QP([ tc(0, D(Er)), tc(1, F), tc(2, Ce) ], dl); var KP = Object.defineProperty, JP = Object.getOwnPropertyDescriptor, $P = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? JP(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && KP(e, t, s), s; }, Ls = (r, e) => (t, n) => e(t, n, r); let ul = class extends ce { constructor(r, e, t, n, s) { super(), this._selectionManagerService = r, this._themeService = e, this._instanceSrv = t, this._cmdSrv = n, this._definedNamesService = s, this._init(); } _init() { this.disposeWithMe(mt( this._selectionManagerService.selectionMoveStart$, this._selectionManagerService.selectionMoving$, this._selectionManagerService.selectionMoveEnd$, this._selectionManagerService.selectionSet$ ).pipe(Ml((r) => !!r)).subscribe((r) => { this._syncDefinedNameRange(r); })), this.disposeWithMe(this._definedNamesService.focusRange$.subscribe(async (r) => { if (r == null) return; const { unitId: e } = r; let { formulaOrRefString: t } = r; if (t.substring(0, 1) === Xr.EQUALS && (t = t.substring(1)), !Lm(t)) return; const s = this._instanceSrv.getUnit(e), i = await this._getSelections(s, e, t); this._selectionManagerService.setSelections(i), this._cmdSrv.executeCommand(cd.id, i[0].range); })); } _syncDefinedNameRange(r) { if (r.length === 0) return; const e = r[r.length - 1], t = this._instanceSrv.getCurrentUnitForType(O.UNIVER_SHEET), n = t == null ? void 0 : t.getActiveSheet(); n && this._definedNamesService.setCurrentRange({ range: e.range, unitId: t.getUnitId(), sheetId: n.getSheetId() }); } async _getSelections(r, e, t) { const n = t.split(","); let s = r.getActiveSheet(); if (!s) return []; const i = []; for (let o = 0; o < n.length; o++) { const l = n[o].trim(), a = Fm(l.trim()); if (o === 0) { const d = r.getSheetBySheetName(a.sheetName); d && s.getSheetId() !== d.getSheetId() && (s = d, await this._cmdSrv.executeCommand(dd.id, { subUnitId: s.getSheetId(), unitId: e })); } if (s.getName() !== a.sheetName) continue; let c = null; if (o === n.length - 1) { const d = a.range, { startRow: u, startColumn: h, endRow: m, endColumn: f } = d; c = rm({ startRow: u, startColumn: h, endRow: m, endColumn: f }, s); } i.push({ range: a.range, style: yr(this._themeService), primary: c }); } return i; } }; ul = $P([ Ls(0, D($)), Ls(1, D(kt)), Ls(2, L), Ls(3, F), Ls(4, ki) ], ul); var e2 = Object.defineProperty, t2 = Object.getOwnPropertyDescriptor, n2 = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? t2(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && e2(e, t, s), s; }, Rn = (r, e) => (t, n) => e(t, n, r); let Mi = class extends kn { constructor(e, t, n, s, i, o, l, a, c) { super(); w(this, "_loadedMap", /* @__PURE__ */ new WeakSet()); w(this, "_scheduledCallback", -1); this._univerInstanceService = e, this._renderManagerService = t, this._editorBridgeService = n, this._commandService = s, this._contextService = i, this._formulaEditorManagerService = o, this._undoRedoService = l, this._textSelectionManagerService = a, this._editorService = c, this._initialize(); } _initialize() { this._syncEditorSize(), this._listenFxBtnClick(), this._handleContentChange(), this._renderManagerService.currentRender$.pipe(os(this.dispose$)).subscribe((e) => { this._create(e); }), this._create(Te), this.disposeWithMe(this._editorService.focus$.subscribe(() => { var t; ((t = this._editorService.getFocusEditor()) == null ? void 0 : t.getEditorId()) === Te && this._contextService.setContextValue(Ht, !1); })); } _handleContentChange() { this.disposeWithMe( this._commandService.onCommandExecuted((e) => { if (e.id === Eo.id) { const t = e.params, { unitId: n } = t; n === Te && this.autoScroll(); } }) ); } _create(e) { if (e !== Te) return; const t = this._renderManagerService.getRenderById(e); if (t == null) return; const { mainComponent: n } = t; n != null && (this._loadedMap.has(n) || (this._initialMain(e), this._loadedMap.add(n))); } _listenFxBtnClick() { this._formulaEditorManagerService.fxBtnClick$.pipe(os(this.dispose$)).subscribe(() => { var t, n; if (this._contextService.getContextValue(ic) && !this._contextService.getContextValue(Je)) { this._univerInstanceService.setCurrentUnitForType(Te), this._contextService.setContextValue(Ht, !0); const s = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET), i = this._univerInstanceService.getUniverDocInstance( Te ); this._editorBridgeService.isVisible().visible === !1 && this._editorBridgeService.changeVisible({ visible: !0, eventType: Xe.PointerDown, unitId: (t = s == null ? void 0 : s.getUnitId()) != null ? t : "" }); const l = (n = i == null ? void 0 : i.getBody()) == null ? void 0 : n.dataStream; if (l == null) return; let a = l.startsWith("=") ? l : `=${l}`; a = a.replace(/\r\n$/, ""); const c = [ { startOffset: a.length, endOffset: a.length } ], d = { unitId: Te, body: { dataStream: a }, segmentId: "" }; this._commandService.executeCommand(Ap.id, d), this._textSelectionManagerService.replaceDocRanges(c); } }); } _initialMain(e) { const t = this._renderManagerService.getRenderById(e); if (t == null) return; const { mainComponent: n } = t; n != null && this.disposeWithMe( n.onPointerDown$.subscribeEvent(() => { this._editorBridgeService.isVisible().visible === !1 && (this._editorBridgeService.changeVisible({ visible: !0, eventType: Xe.PointerDown, unitId: e }), this._undoRedoService.clearUndoRedo(Te)), this._contextService.setContextValue(Ht, !0); }) ); } // Listen to changes in the size of the formula editor container to set the size of the editor. _syncEditorSize() { const e = this._univerInstanceService.unitAdded$.pipe(Ml((t) => t.getUnitId() === Te)); this.disposeWithMe(ot([this._formulaEditorManagerService.position$, e]).subscribe(([t]) => { if (!t) return this._clearScheduledCallback(); const n = Ed(Te, this._renderManagerService), s = this._univerInstanceService.getUniverDocInstance( Te ); if (n == null || s == null) return this._clearScheduledCallback(); const { width: i, height: o } = t; if (i === 0 || o === 0) return this._clearScheduledCallback(); const { engine: l } = n; s.updateDocumentDataPageSize(i), this.autoScroll(), this._scheduledCallback = requestIdleCallback(() => l.resizeBySize(i, o)); })); } _clearScheduledCallback() { this._scheduledCallback !== -1 && cancelIdleCallback(this._scheduledCallback), this._scheduledCallback = -1; } autoScroll() { var f, g; const e = this._formulaEditorManagerService.getPosition(), t = (f = this._renderManagerService.getRenderById(Te)) == null ? void 0 : f.with(Jn).getSkeleton(), n = this._renderManagerService.getRenderById(Te), s = this._univerInstanceService.getUniverDocInstance( Te ); if (t == null || e == null || n == null || s == null) return; const { marginTop: i = 0, marginBottom: o = 0 } = s.getSnapshot().documentStyle, { scene: l, mainComponent: a } = n; let { actualHeight: c } = t.getActualSize(); c += i + o; const { width: d, height: u } = e, h = l.getViewport(vo.VIEW_MAIN); let m = h == null ? void 0 : h.getScrollBar(); l.transformByState({ width: d, height: c }), a == null || a.resize(d, c), c > u ? m == null ? h && new rd(h, { enableHorizontal: !1, barSize: 8 }) : h == null || h.resetCanvasSizeAndUpdateScroll() : (m = null, h == null || h.scrollToViewportPos({ viewportScrollX: 0, viewportScrollY: 0 }), (g = h == null ? void 0 : h.getScrollBar()) == null || g.dispose()); } }; Mi = n2([ Rn(0, L), Rn(1, Ce), Rn(2, tt), Rn(3, F), Rn(4, Ne), Rn(5, ca), Rn(6, Zt), Rn(7, D(yd)), Rn(8, Ss) ], Mi); var r2 = Object.defineProperty, s2 = Object.getOwnPropertyDescriptor, i2 = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? s2(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && r2(e, t, s), s; }, Yn = (r, e) => (t, n) => e(t, n, r); const o2 = { pageSize: { width: Number.POSITIVE_INFINITY, height: Number.POSITIVE_INFINITY }, documentFlavor: Qp.UNSPECIFIED, marginTop: 5, marginBottom: 5, marginRight: 0, marginLeft: 0, paragraphLineGapDefault: 0, renderConfig: { horizontalAlign: wt.UNSPECIFIED, verticalAlign: an.TOP, centerAngle: 0, vertexAngle: 0, wrapStrategy: Cr.WRAP, isRenderStyle: Qe.FALSE } }; let hl = class extends ce { constructor(r, e, t, n, s, i, o, l) { super(), this._univerInstanceService = r, this._renderManagerService = e, this._editorBridgeService = t, this._commandService = n, this._rangeProtectionRuleModel = s, this._worksheetProtectionRuleModel = i, this._formulaEditorController = o, this._formulaEditorManagerService = l, this._initialize(); } _initialize() { this._syncFormulaEditorContent(), this._commandExecutedListener(); } _getEditorViewModel(r) { var e; return (e = this._renderManagerService.getRenderById(r)) == null ? void 0 : e.with(Jn).getViewModel(); } // Sync cell content to formula editor bar when sheet selection changed. _syncFormulaEditorContent() { this.disposeWithMe(this._editorBridgeService.currentEditCellState$.subscribe((r) => { r == null || this._editorBridgeService.isForceKeepVisible() || !this._rangeProtectionRuleModel.getRangeRuleInitState() || !this._worksheetProtectionRuleModel.getSheetRuleInitState() || this._editorSyncHandler(r); })); } // Sync cell content to formula editor bar when sheet selection changed or visible changed. _editorSyncHandler(r) { var s, i, o; let e = se.deepClone((s = r.documentLayoutObject.documentModel) == null ? void 0 : s.getBody()); const t = se.deepClone((i = r.documentLayoutObject.documentModel) == null ? void 0 : i.drawings), n = se.deepClone((o = r.documentLayoutObject.documentModel) == null ? void 0 : o.getDrawingsOrder()); (!e || r.isInArrayFormulaRange === !0 && this._editorBridgeService.isVisible().eventType === Xe.Dblclick) && (e = { dataStream: `\r `, paragraphs: [ { startIndex: 0 } ], textRuns: [] }), this._syncContentAndRender(Te, e, t, n); } _commandExecutedListener() { const r = [Le, Te]; this.disposeWithMe( this._commandService.onCommandExecuted((t) => { if (t.id === Eo.id) { const n = t.params, { unitId: s, trigger: i, isSync: o } = n; if (o || i === xh.id) return; if (r.includes(s)) { const l = this._univerInstanceService.getUnit(s, O.UNIVER_DOC), a = s === Te ? Le : Te; this._checkAndSetRenderStyleConfig(l), this._syncActionsAndRender(a, n); } } }) ); const e = [Se.id, tr.id]; this.disposeWithMe( this._commandService.onCommandExecuted((t) => { var n, s, i, o, l, a, c; if (e.includes(t.id)) { const d = this._editorBridgeService.getLatestEditCellState(); if (d == null) return; let u = !1; const { row: h, column: m } = d; if (t.id === Se.id && t.params ? (s = (n = t.params.cellValue) == null ? void 0 : n[h]) != null && s[m] && (u = !0) : t.id === tr.id && t.params && (o = (i = t.params.to.value) == null ? void 0 : i[h]) != null && o[m] && (u = !0), u) { const f = se.deepClone((l = d.documentLayoutObject.documentModel) == null ? void 0 : l.getBody()), g = se.deepClone((a = d.documentLayoutObject.documentModel) == null ? void 0 : a.drawings), p = se.deepClone((c = d.documentLayoutObject.documentModel) == null ? void 0 : c.getDrawingsOrder()); if (f == null) return; this._syncContentAndRender(Te, f, g, p); } } }) ); } // Sync actions between cell editor and formula editor, and make `dataStream` and `paragraph` is the same. _syncActionsAndRender(r, e) { var l; const t = [Le, Te], n = this._renderManagerService.getRenderById(r); if (n == null) return; const s = n.with(Jn).getSkeleton(), i = this._univerInstanceService.getUnit(r, O.UNIVER_DOC), o = this._getEditorViewModel(r); i == null || o == null || (this._commandService.syncExecuteCommand(Eo.id, { ...e, textRanges: null, isSync: !0, unitId: r, syncer: e.unitId }), o.reset(i), s.calculate(), t.includes(r) && ((l = n.mainComponent) == null || l.makeDirty())); } _syncContentAndRender(r, e, t, n) { var c, d; r === Te && e.paragraphs && (e.paragraphs = this._clearParagraph(e.paragraphs)); const s = [Le, Te], i = (c = this._renderManagerService.getRenderById(r)) == null ? void 0 : c.with(Jn).getSkeleton(), o = this._univerInstanceService.getUnit(r, O.UNIVER_DOC), l = this._getEditorViewModel(r); if (o == null || l == null || i == null) return; o.getSnapshot().body = e, o.getSnapshot().drawings = t != null ? t : {}, o.getSnapshot().drawingsOrder = n != null ? n : [], this._checkAndSetRenderStyleConfig(o), l.reset(o); const a = this._renderManagerService.getRenderById(r); a != null && (i.calculate(), s.includes(r) && ((d = a.mainComponent) == null || d.makeDirty()), r === Te && this._formulaEditorController.autoScroll()); } _checkAndSetRenderStyleConfig(r) { var i; const e = r.getSnapshot(), { body: t } = e; if (e.id !== Te) return; e.documentStyle = o2; let n = e.documentStyle.renderConfig; n == null && (n = {}, e.documentStyle.renderConfig = n); const s = this._formulaEditorManagerService.getPosition(); if (s) { const o = s.width; e.documentStyle.pageSize = { width: o, height: 1 / 0 }; } ((i = t == null ? void 0 : t.dataStream) != null ? i : "").startsWith("=") ? n.isRenderStyle = Qe.TRUE : n.isRenderStyle = Qe.FALSE; } _clearParagraph(r) { const e = se.deepClone(r); for (const t of e) t.paragraphStyle && (t.paragraphStyle.horizontalAlign = wt.UNSPECIFIED); return e; } }; hl = i2([ Yn(0, L), Yn(1, Ce), Yn(2, tt), Yn(3, F), Yn(4, D(Ye)), Yn(5, D(ft)), Yn(6, D(Mi)), Yn(7, ca) ], hl); var l2 = Object.defineProperty, a2 = Object.getOwnPropertyDescriptor, c2 = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? a2(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && l2(e, t, s), s; }, mr = (r, e) => (t, n) => e(t, n, r); let ml = class extends ce { constructor(r, e, t, n, s, i, o) { super(), this._commandService = r, this._formatPainterService = e, this._univerInstanceService = t, this._renderManagerService = n, this._selectionManagerService = s, this._sheetInterceptorService = i, this._injector = o, this._initialize(); } _initialize() { this._commandExecutedListener(), this._addDefaultHook(); } _commandExecutedListener() { const r = this._renderManagerService.getCurrentTypeOfRenderer(O.UNIVER_SHEET).with(dt); this.disposeWithMe( r.selectionMoveEnd$.subscribe((e) => { var t, n; if (this._formatPainterService.getStatus() !== zt.OFF) { const { rangeWithCoord: s } = e[e.length - 1]; this._commandService.executeCommand(Zl.id, { unitId: ((t = this._univerInstanceService.getFocusedUnit()) == null ? void 0 : t.getUnitId()) || "", subUnitId: ((n = this._univerInstanceService.getFocusedUnit().getActiveSheet()) == null ? void 0 : n.getSheetId()) || "", range: { startRow: s.startRow, startColumn: s.startColumn, endRow: s.endRow, endColumn: s.endColumn } }), this._formatPainterService.getStatus() === zt.ONCE && this._commandService.executeCommand(Bi.id); } }) ); } _addDefaultHook() { const r = { id: "default-format-painter", priority: 0, isDefaultHook: !0, onStatusChange: (e) => { if (e !== zt.OFF) { const t = this._collectSelectionRangeFormat(); t && this._formatPainterService.setSelectionFormat(t); } }, onApply: (e, t, n, s) => this._getUndoRedoMutationInfo(e, t, n, s) }; this._formatPainterService.addHook(r); } _collectSelectionRangeFormat() { const r = this._selectionManagerService.getCurrentLastSelection(), e = r == null ? void 0 : r.range; if (!e) return null; const { startRow: t, endRow: n, startColumn: s, endColumn: i } = e, o = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET), l = o == null ? void 0 : o.getActiveSheet(); if (!l) return null; const a = l.getCellMatrix(), c = o.getStyles(), d = new Ke(), u = []; for (let h = t; h <= n; h++) for (let m = s; m <= i; m++) { const f = a.getValue(h, m); d.setValue(h, m, c.getStyleByCell(f) || {}); const { isMergedMainCell: g, ...p } = l.getCellInfoInMergeData(h, m); g && u.push({ startRow: p.startRow, startColumn: p.startColumn, endRow: p.endRow, endColumn: p.endColumn }); } return { styles: d, merges: u }; } _getUndoRedoMutationInfo(r, e, t, n) { const s = this._sheetInterceptorService, i = this._univerInstanceService, { merges: o, styles: l } = n; if (!l) return { undos: [], redos: [] }; const { startRow: a, startColumn: c, endRow: d, endColumn: u } = l.getDataRange(), h = d - a + 1, m = u - c + 1, f = t.startRow === t.endRow && t.startColumn === t.endColumn ? { startRow: t.startRow, startColumn: t.startColumn, endRow: t.startRow + h - 1, endColumn: t.startColumn + m - 1 } : t, g = Array.from( { length: f.endRow - f.startRow + 1 }, () => Array.from({ length: f.endColumn - f.startColumn + 1 }, () => ({})) ), p = []; g.forEach((N, X) => { N.forEach((Y, ie) => { const he = X % h + a, ne = ie % m + c, pe = l.getValue(he, ne); pe && (g[X][ie].s = Object.keys(pe).length > 0 ? pe : null); }); }), o.forEach((N) => { const X = { startRow: N.startRow - a, startColumn: N.startColumn - c, endRow: N.endRow - a, endColumn: N.endColumn - c }, Y = Math.max(1, Math.floor((f.endRow - f.startRow + 1) / h)), ie = Math.max(1, Math.floor((f.endColumn - f.startColumn + 1) / m)); for (let he = 0; he < Y; he++) for (let ne = 0; ne < ie; ne++) p.push({ startRow: X.startRow + he * h + f.startRow, startColumn: X.startColumn + ne * m + f.startColumn, endRow: X.endRow + he * h + f.startRow, endColumn: X.endColumn + ne * m + f.startColumn }); }); const S = [f], b = new Ke(), v = new Ke(); if (se.isArray(g)) for (let N = 0; N < S.length; N++) { const { startRow: X, startColumn: Y, endRow: ie, endColumn: he } = S[N]; for (let ne = 0; ne <= ie - X; ne++) for (let pe = 0; pe <= he - Y; pe++) b.setValue(ne + X, pe + Y, { s: null }), v.setValue(ne + X, pe + Y, g[ne][pe]); } const _ = { subUnitId: e, unitId: r, cellValue: b.getMatrix() }, R = { subUnitId: e, unitId: r, cellValue: v.getMatrix() }, I = this._injector.invoke( en, _ ), { undos: y, redos: M } = s.onCommandExecute({ id: Ti.id, params: { ...R, range: S } }), P = Al(p), E = [], T = [], A = i.getUnit(r).getSheetBySheetId(e), H = zf(A, P), x = { unitId: r, subUnitId: e, ranges: P }, k = { unitId: r, subUnitId: e, ranges: P }; E.push({ id: Kt.id, params: x }), E.push({ id: Jt.id, params: k }); const U = this._injector.invoke( Ol, x ), V = this._injector.invoke( Nl, k ); if (T.push({ id: Kt.id, params: V }), T.push({ id: Jt.id, params: U }), H) { const N = this._injector.invoke((X) => Yf(X, r, A, P)); E.unshift(...N.redos), T.push(...N.undos); } return { undos: [ { id: Se.id, params: _ }, { id: Se.id, params: I }, ...y, ...T ], redos: [ { id: Se.id, params: _ }, { id: Se.id, params: R }, ...M, ...E ] }; } }; ml = c2([ mr(0, F), mr(1, Un), mr(2, L), mr(3, Ce), mr(4, D($)), mr(5, D(Ln)), mr(6, D(vt)) ], ml); var d2 = Object.defineProperty, u2 = Object.getOwnPropertyDescriptor, h2 = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? u2(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && d2(e, t, s), s; }, nc = (r, e) => (t, n) => e(t, n, r); let jc = class extends ce { constructor(e, t, n, s) { super(); w(this, "_initialize", () => { const e = new St(); this.disposeWithMe( this._selectionManagerService.selectionMoveEnd$.subscribe(() => { e.dispose(), this._selectionRenderService.getSelectionControls().forEach((n) => { e.add( Ae( n.selectionMoveEnd$.subscribe((s) => { if (!s) return; const i = n.model.getRange(), o = { startRow: i.startRow, startColumn: i.startColumn, endRow: i.endRow, endColumn: i.endColumn, rangeType: i.rangeType }, l = { startRow: s.startRow, startColumn: s.startColumn, endRow: s.endRow, endColumn: s.endColumn, // rangeType must equal to fromRange rangeType: i.rangeType }; if (o.startRow === l.startRow && o.startColumn === l.startColumn || l.startRow < 0 || l.startColumn < 0) return; const a = { fromRange: o, toRange: l }; this._commandService.executeCommand(ld.id, a); }) ) ); }); }) ); }); this._context = e, this._selectionRenderService = t, this._selectionManagerService = n, this._commandService = s, this._initialize(); } }; jc = h2([ nc(1, D(dt)), nc(2, D($)), nc(3, D(F)) ], jc); var m2 = Object.defineProperty, f2 = Object.getOwnPropertyDescriptor, g2 = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? f2(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && m2(e, t, s), s; }, rc = (r, e) => (t, n) => e(t, n, r); let Xc = class extends ce { constructor(r, e, t, n) { super(), this._context = r, this._contextMenuService = e, this._selectionManagerService = t, this._selectionRenderService = n, this._init(); } _init() { var l, a; const e = ((a = (l = this._context) == null ? void 0 : l.mainComponent) == null ? void 0 : a.onPointerDown$).subscribeEvent((c) => { if (c.button === 2) { const d = this._selectionManagerService.getCurrentSelections(), u = d == null ? void 0 : d[0]; if (!u) return; const h = u.range.rangeType, m = this._selectionRenderService.getSkeleton(), g = Pt(u, m).rangeWithCoord, p = () => { if (!g) return !1; const b = c.offsetX, v = c.offsetY; switch (h) { case j.ROW: return g.startY <= v && g.endY >= v; case j.COLUMN: return g.startX <= b && g.endX >= b; default: return g.startX <= b && g.endX >= b && g.startY <= v && g.endY >= v; } }, S = (b) => { this._contextMenuService.triggerContextMenu(c, b); }; p() ? h === j.COLUMN ? S(Ct.COL_HEADER) : h === j.ROW ? S(Ct.ROW_HEADER) : S(Ct.MAIN_AREA) : S(Ct.MAIN_AREA); } }); this.disposeWithMe(e); const t = this._context.components.get(qe.COLUMN), s = this._context.components.get(qe.ROW).onPointerDown$.subscribeEvent((c) => { c.button === 2 && this._contextMenuService.triggerContextMenu(c, Ct.ROW_HEADER); }); this.disposeWithMe(s); const o = t.onPointerDown$.subscribeEvent((c) => { c.button === 2 && this._contextMenuService.triggerContextMenu(c, Ct.COL_HEADER); }); this.disposeWithMe(o); } }; Xc = g2([ rc(1, Rl), rc(2, D($)), rc(3, dt) ], Xc); var p2 = Object.defineProperty, S2 = Object.getOwnPropertyDescriptor, C2 = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? S2(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && p2(e, t, s), s; }, In = (r, e) => (t, n) => e(t, n, r); let zc = class extends kn { constructor(e, t, n, s, i, o, l, a, c, d) { super(); w(this, "_d"); this._context = e, this._instanceSrv = t, this._commandService = n, this._editorBridgeService = s, this._selectionManagerService = i, this._rangeSelectorService = o, this._contextService = l, this._renderManagerService = a, this._editorService = c, this._sheetSkeletonManagerService = d, this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(O.UNIVER_SHEET).subscribe((u) => { u && u.getUnitId() === this._context.unitId ? this._d = this._init() : this._disposeCurrent(); })), this._initialRangeSelector(); } _init() { const e = new St(); return this._initSelectionChangeListener(e), this._initEventListener(e), this._commandExecutedListener(e), this._initialKeyboardListener(e), e; } _disposeCurrent() { var e; (e = this._d) == null || e.dispose(), this._d = null; } _initSelectionChangeListener(e) { e.add(mt( this._selectionManagerService.selectionMoveEnd$, this._selectionManagerService.selectionSet$, this._selectionManagerService.selectionMoveStart$ ).subscribe((t) => this._updateEditorPosition(t))); } _updateEditorPosition(e) { var n, s, i; if (this._editorBridgeService.isVisible().visible || this._rangeSelectorService.selectorModalVisible) return; const t = (n = e == null ? void 0 : e[e.length - 1]) == null ? void 0 : n.primary; if (t) { const o = this._getSheetObject(), { scene: l, engine: a } = o, c = this._context.unitId, d = (s = this._context.unit.getActiveSheet()) == null ? void 0 : s.getSheetId(); if (!d) return; const u = (i = this._sheetSkeletonManagerService.getWorksheetSkeleton(d)) == null ? void 0 : i.skeleton.getCellWithCoordByIndex(t.actualRow, t.actualColumn), h = u ? { actualRow: u.actualRow, actualColumn: u.actualColumn, isMerged: u.isMerged, startRow: u.mergeInfo.startRow, startColumn: u.mergeInfo.startColumn, endRow: u.mergeInfo.endRow, endColumn: u.mergeInfo.endColumn, isMergedMainCell: u.isMergedMainCell } : t; this._commandService.executeCommand(Kd.id, { scene: l, engine: a, primary: h, unitId: c, sheetId: d }); } } _initEventListener(e) { const t = this._getSheetObject(), { spreadsheet: n, spreadsheetColumnHeader: s, spreadsheetLeftTopPlaceholder: i, spreadsheetRowHeader: o } = t; e.add(n.onDblclick$.subscribeEvent((l) => { l.button !== 2 && this._commandService.executeCommand(Et.id, { visible: !0, eventType: Xe.Dblclick, unitId: this._context.unitId }); })), e.add(n.onPointerDown$.subscribeEvent({ next: this._tryHideEditor.bind(this), priority: -1 })), e.add(s.onPointerDown$.subscribeEvent({ next: this._tryHideEditor.bind(this), priority: -1 })), e.add(i.onPointerDown$.subscribeEvent({ next: this._tryHideEditor.bind(this), priority: -1 })), e.add(o.onPointerDown$.subscribeEvent({ next: this._tryHideEditor.bind(this), priority: -1 })); } /** * Should activate the editor when the user inputs text. * @param d DisposableCollection */ _initialKeyboardListener(e) { let t = null; const n = (i) => { const o = i.with(Sr); o && (t = Ae(o.onInputBefore$.subscribe((l) => { if (!this._isCurrentSheetFocused()) return; const a = this._contextService.getContextValue(Ht), c = this._contextService.getContextValue(Tt), d = i.unitId; this._editorBridgeService.isVisible().visible || d && c && !a && this._showEditorByKeyboard(l); })), e.add(t)); }, s = this._renderManagerService.getRenderById(Le); s ? n(s) : this.disposeWithMe(this._renderManagerService.created$.pipe(Ml((i) => i.unitId === Le)).subscribe((i) => { t == null || t.dispose(), n(i); })); } _commandExecutedListener(e) { const t = /* @__PURE__ */ new Set([zs.id, Wi.id]); e.add(this._commandService.onCommandExecuted((n) => { if (t.has(n.id)) { if (this._editorBridgeService.isVisible().visible) return; this._editorBridgeService.refreshEditCellState(); } if (n.id === Se.id) { const s = n.params, { cellValue: i, unitId: o, subUnitId: l } = s; if (!i) return; const a = this._editorBridgeService.getEditLocation(); if (a) { const { unitId: c, sheetId: d, row: u, column: h } = a; o === c && l === d && i && i[u] && Object.prototype.hasOwnProperty.call(i[u], h) && this._editorBridgeService.refreshEditCellState(); } } })), e.add(this._commandService.beforeCommandExecuted((n, s) => { s != null && s.fromCollab || n.id === et.id && this._tryHideEditor(); })); } _showEditorByKeyboard(e) { const t = e == null ? void 0 : e.event; e == null || !t.data && t.inputType !== "InsertParagraph" || this._commandService.executeCommand(Et.id, { visible: !0, eventType: Xe.Keyboard, keycode: t.which, unitId: this._context.unitId }); } _tryHideEditor() { this._editorBridgeService.isForceKeepVisible() || this._hideEditor(); } _hideEditor() { this._editorBridgeService.isVisible().visible === !0 && this._commandService.syncExecuteCommand(Et.id, { visible: !1, eventType: Xe.PointerDown, unitId: this._context.unitId }); } _initialRangeSelector() { this.disposeWithMe(this._selectionManagerService.selectionMoving$.subscribe(this._rangeSelector.bind(this))), this.disposeWithMe(this._selectionManagerService.selectionMoveStart$.subscribe(this._rangeSelector.bind(this))), this.disposeWithMe( this._rangeSelectorService.openSelector$.subscribe(() => { const { unitId: e, sheetId: t, sheetName: n } = this._getCurrentUnitIdAndSheetId(); if (!t || !n) return; const s = this._selectionManagerService.getCurrentSelections(), i = s == null ? void 0 : s.map((o) => ({ range: o.range, unitId: e, sheetId: t, sheetName: n })); i && this._rangeSelectorService.selectionChange(i); }) ); } _rangeSelector(e) { if (!e) return; const { unitId: t, sheetId: n, sheetName: s } = this._getCurrentUnitIdAndSheetId(); if (!n || !s) return; const i = e.map((o) => ({ range: o.range, unitId: t, sheetId: n, sheetName: s })); this._rangeSelectorService.selectionChange(i); } _getCurrentUnitIdAndSheetId() { const e = this._context.unit, t = e.getActiveSheet(); return { unitId: e.getUnitId(), sheetId: t == null ? void 0 : t.getSheetId(), sheetName: t == null ? void 0 : t.getName() }; } _getSheetObject() { return pn(this._context.unit, this._context); } _isCurrentSheetFocused() { var e; return ((e = this._instanceSrv.getFocusedUnit()) == null ? void 0 : e.getUnitId()) === this._context.unitId; } }; zc = C2([ In(1, L), In(2, F), In(3, tt), In(4, D($)), In(5, Np), In(6, Ne), In(7, Ce), In(8, Ss), In(9, D(me)) ], zc); var Yc = /* @__PURE__ */ ((r) => (r[r.NORMAL = 0] = "NORMAL", r[r.HIGHLIGHT = 1] = "HIGHLIGHT", r))(Yc || {}); const v2 = "rgba(0, 0, 0, 0.15)", yn = "rgb(0, 0, 0)", oo = "rgb(255, 255, 255, 1)"; class b2 extends sd { constructor(t, n) { super(t, n); w(this, "_size", 12); w(this, "_iconRatio", 0.4); w(this, "_mode", 0); this.setShapeProps(n); } setShapeProps(t) { t != null && t.size && (this._size = t.size), t != null && t.mode && (this._mode = t.mode), this.transformByState({ width: this._size, height: this._size }); } _draw(t) { this._mode === 1 && ge.drawWith(t, { width: this._size, height: this._size, radius: this._size, fill: v2 }); const n = this._size * 0.5 * this._iconRatio, s = Math.PI / 180 * 60, i = n * Math.sin(s), o = n * Math.cos(s); Ws.drawWith(t, { pointsGroup: [ [ { x: -i + this._size / 2, y: -o + this._size / 2 }, { x: i + this._size / 2, y: -o + this._size / 2 }, { x: this._size / 2, y: n + this._size / 2 } ] ], // left: this.left, // top: this.top, fill: yn }); } } var _2 = Object.defineProperty, w2 = Object.getOwnPropertyDescriptor, R2 = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? w2(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && _2(e, t, s), s; }, lo = (r, e) => (t, n) => e(t, n, r); const I2 = "__SpreadsheetHeaderMenuSHAPEControllerShape__", y2 = "__SpreadsheetHeaderMenuMAINControllerShape__", M2 = "rgba(0, 0, 0, 0.1)"; let Zc = class extends ce { constructor(e, t, n, s, i) { super(); w(this, "_hoverRect"); w(this, "_hoverMenu"); w(this, "_currentColumn", Number.POSITIVE_INFINITY); // private _rowHeaderPointerMoveSub: Subscription; // private _colHeaderPointerMoveSub: Subscription; // private _rowHeaderPointerLeaveSub: Subscription; // private _colHeaderPointerLeaveSub: Subscription; // private _rowHeaderPointerEnterSub: Subscription; // private _colHeaderPointerEnterSub: Subscription; w(this, "_headerPointerSubs"); w(this, "_colHeaderPointerSubs"); this._context = e, this._sheetSkeletonManagerService = t, this._contextMenuService = n, this._commandService = s, this._selectionManagerService = i, this._initialize(); } dispose() { var e, t, n; (e = this._hoverRect) == null || e.dispose(), (t = this._hoverMenu) == null || t.dispose(), (n = this._headerPointerSubs) == null || n.unsubscribe(), this._headerPointerSubs = null; } _initialize() { const e = this._context.scene; this._hoverRect = new ge(I2, { fill: M2, evented: !1 }), this._hoverMenu = new b2(y2, { zIndex: 100, visible: !1 }), e.addObjects([this._hoverRect, this._hoverMenu], rr), this._initialHover( 0 /* ROW */ ), this._initialHover( 1 /* COLUMN */ ), this._initialHoverMenu(); } // eslint-disable-next-line max-lines-per-function _initialHover(e = 0) { var u, h, m; const t = this._context.components.get(qe.COLUMN), n = this._context.components.get(qe.ROW), s = e === 0 ? n : t, i = (f) => { var y, M, P; const g = (y = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : y.skeleton; if (g == null) return; const { rowHeaderWidth: p, columnHeaderHeight: S } = g, { startX: b, startY: v, endX: _, endY: R, column: I } = Nn( f.offsetX, f.offsetY, this._context.scene, g ); if (e === 0) (M = this._hoverRect) == null || M.transformByState({ width: p, height: R - v, left: 0, top: v }); else { if (this._currentColumn = I, (P = this._hoverRect) == null || P.transformByState({ width: _ - b, height: S, left: b, top: 0 }), this._hoverMenu == null) return; if (_ - b < S * 2) { this._hoverMenu.hide(); return; } const E = S * 0.8; this._hoverMenu.transformByState({ left: _ - S, top: S / 2 - E / 2 }), this._hoverMenu.setShapeProps({ size: E }), this._hoverMenu.show(); } }, o = () => { var f; (f = this._hoverRect) == null || f.show(); }, l = () => { var f, g; (f = this._hoverRect) == null || f.hide(), (g = this._hoverMenu) == null || g.hide(); }; this._headerPointerSubs = new Kn(); const a = s.onPointerMove$.subscribeEvent(i), c = s.onPointerEnter$.subscribeEvent(o), d = s.onPointerLeave$.subscribeEvent(l); (u = this._headerPointerSubs) == null || u.add(a), (h = this._headerPointerSubs) == null || h.add(c), (m = this._headerPointerSubs) == null || m.add(d); } _initialHoverMenu() { this._hoverMenu != null && (this._hoverMenu.onPointerEnter$.subscribeEvent(() => { this._hoverMenu != null && (this._hoverMenu.setProps({ mode: Yc.HIGHLIGHT, visible: !0 }), this._context.scene.setCursor(Re.POINTER)); }), this._hoverMenu.onPointerLeave$.subscribeEvent(() => { this._hoverMenu != null && (this._hoverMenu.setProps({ mode: Yc.NORMAL, visible: !1 }), this._context.scene.resetCursor()); }), this._hoverMenu.onPointerDown$.subscribeEvent((e) => { var i; const t = this._currentColumn, n = (i = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : i.map((o) => o.range); if (!!!(n != null && n.filter((o) => o.rangeType === j.COLUMN).find((o) => { const { startColumn: l, endColumn: a } = o; return t >= l && t <= a; }))) { const o = this._getSelectionOnColumn(t); this._commandService.syncExecuteCommand(He.id, o); } e.stopPropagation(), e.preventDefault(), this._contextMenuService.triggerContextMenu(e, Ct.COL_HEADER); })); } _getSelectionOnColumn(e) { const t = this._context.unit, n = t.getActiveSheet(); if (!n) throw new Error("No active worksheet"); return { unitId: t.getUnitId(), subUnitId: n.getSheetId(), selections: [ { range: { startRow: 0, startColumn: e, endRow: n.getRowCount() - 1, endColumn: e, rangeType: j.COLUMN }, primary: { startRow: 0, startColumn: e, endRow: 0, endColumn: e, actualRow: 0, actualColumn: e, isMerged: !1, isMergedMainCell: !1 }, style: null } ] }; } }; Zc = R2([ lo(1, D(me)), lo(2, Rl), lo(3, F), lo(4, D($)) ], Zc); var Gc = /* @__PURE__ */ ((r) => (r[r.ROW = 0] = "ROW", r[r.COLUMN = 1] = "COLUMN", r))(Gc || {}); const Us = 12, P2 = 0.4; class Ph extends sd { constructor(t, n, s) { super(t, n); w(this, "_size", Us); w(this, "_iconRatio", P2); w(this, "_hovered", !0); w(this, "_hasPrevious", !0); w(this, "_hasNext", !0); w(this, "_unhideType"); n && this.setShapeProps(n), this.onPointerEnter$.subscribeEvent(() => this.setShapeProps({ hovered: !0 })), this.onPointerLeave$.subscribeEvent(() => this.setShapeProps({ hovered: !1 })), this.onPointerDown$.subscribeEvent(() => s == null ? void 0 : s()); } setShapeProps(t) { t.type !== void 0 && (this._unhideType = t.type), t.hovered !== void 0 && (this._hovered = t.hovered), t.hasPrevious !== void 0 && (this._hasPrevious = t.hasPrevious), t.hasNext !== void 0 && (this._hasNext = t.hasNext), this.transformByState({ width: this._size * (this._unhideType === 1 ? 2 : 1), height: this._size * (this._unhideType === 0 ? 2 : 1) }); } _draw(t) { this._unhideType === 0 ? this._drawOnRow(t) : this._drawOnCol(t); } _drawOnRow(t) { this._hovered && (!this._hasNext || !this._hasPrevious ? ge.drawWith(t, { width: this._size, height: this._size, stroke: yn, fill: oo }) : ge.drawWith(t, { width: this._size, height: 2 * this._size, stroke: yn, fill: oo })); const n = this._size * 0.5 * this._iconRatio, s = Math.PI / 3, i = n * Math.cos(s), o = n * Math.sin(s); if (this._hasPrevious && Ws.drawWith(t, { pointsGroup: [ [ { x: this._size / 2, y: this._size / 2 - o }, { x: this._size / 2 - o, y: this._size / 2 + i }, { x: this._size / 2 + o, y: this._size / 2 + i } ] ], fill: yn }), this._hasNext) { const l = this._hasPrevious ? 3 : 1; Ws.drawWith(t, { pointsGroup: [ [ { x: this._size / 2, y: this._size * l / 2 + o }, { x: this._size / 2 - o, y: this._size * l / 2 - i }, { x: this._size / 2 + o, y: this._size * l / 2 - i } ] ], fill: yn }); } } /** * * @param ctx */ _drawOnCol(t) { this._hovered && (!this._hasNext || !this._hasPrevious ? ge.drawWith(t, { width: this._size, height: this._size, stroke: yn, fill: oo }) : ge.drawWith(t, { width: 2 * this._size, height: this._size, stroke: yn, fill: oo })); const n = this._size * 0.5 * this._iconRatio, s = Math.PI / 3, i = n * Math.cos(s), o = n * Math.sin(s); if (this._hasPrevious && Ws.drawWith(t, { pointsGroup: [ [ { x: -i + this._size / 2, y: this._size / 2 }, { x: this._size / 2 + o, y: this._size / 2 - o }, { x: this._size / 2 + o, y: this._size / 2 + o } ] ], fill: yn }), this._hasNext) { const l = this._hasPrevious ? 3 : 1; Ws.drawWith(t, { pointsGroup: [ [ { x: i + this._size * l / 2, y: this._size / 2 }, { x: -o + this._size * l / 2, y: this._size / 2 - o }, { x: -o + this._size * l / 2, y: this._size / 2 + o } ] ], fill: yn }); } } } var E2 = Object.defineProperty, T2 = Object.getOwnPropertyDescriptor, x2 = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? T2(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && E2(e, t, s), s; }, Eh = (r, e) => (t, n) => e(t, n, r); const Th = "__SpreadsheetHeaderUnhideSHAPEControllerShape__"; Ni.id, Ai.id, Oi.id, xi.id, xl.id, Tl.id, Qt.id, hm.id, Sd.id, Cd.id, vd.id, bd.id; let qc = class extends kn { constructor(e, t, n) { super(); w(this, "_shapes", { cols: [], rows: [] }); this._context = e, this._sheetSkeletonManagerService = t, this._commandService = n, this._init(); } get _workbook() { return this._context.unit; } dispose() { super.dispose(), this._clearShapes(); } _init() { let e = ""; this._context.unit.activeSheet$.pipe(os(this.dispose$)).subscribe((t) => { if (this._clearShapes(), !t) { e = ""; return; } e = t.getSheetId(), this._update(this._workbook, t); }), this.disposeWithMe( this._sheetSkeletonManagerService.currentSkeleton$.subscribe((t) => { if (t) { const { unitId: n, sheetId: s } = t; if (n === this._workbook.getUnitId() && s === e) { const i = this._workbook.getSheetBySheetId(s); i && this._update(this._workbook, i); } } }) ); } _update(e, t) { var h; const n = (h = this._sheetSkeletonManagerService.getWorksheetSkeleton(t.getSheetId())) == null ? void 0 : h.skeleton; if (!n) return; const s = t.getHiddenRows(), i = t.getHiddenCols(), o = this._getSheetObject(), { scene: l } = o, a = t.getRowCount(), c = s.map((m) => { const { startRow: f, endRow: g } = m, p = Nu(f, 0, l, n), S = f !== 0, b = g !== a - 1; return new Ph( Th, { type: Gc.ROW, hovered: !1, hasPrevious: S, hasNext: b, top: p.startY - (S ? Us : 0), left: p.startX - Us }, () => this._commandService.executeCommand( IC.id, { unitId: e.getUnitId(), subUnitId: t.getSheetId(), ranges: [m] } ) ); }), d = t.getColumnCount(), u = i.map((m) => { const { startColumn: f, endColumn: g } = m, p = Nu(0, f, l, n), S = f !== 0, b = g !== d - 1; return new Ph( Th, { type: Gc.COLUMN, hovered: !1, hasPrevious: S, hasNext: b, top: 20 - Us, left: p.startX - (S ? Us : 0) }, () => this._commandService.executeCommand( yC.id, { unitId: e.getUnitId(), subUnitId: t.getSheetId(), ranges: [m] } ) ); }); l.addObjects(u, xu), l.addObjects(c, xu), this._clearShapes(), this._shapes = { cols: u, rows: c }; } _clearShapes() { this._shapes.cols.forEach((e) => e.dispose()), this._shapes.rows.forEach((e) => e.dispose()), this._shapes = { cols: [], rows: [] }; } _getSheetObject() { return pn(this._workbook, this._context); } }; qc = x2([ Eh(1, D(me)), Eh(2, F) ], qc); var O2 = Object.defineProperty, A2 = Object.getOwnPropertyDescriptor, N2 = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? A2(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && O2(e, t, s), s; }, Zn = (r, e) => (t, n) => e(t, n, r); let Qc = class extends ef { constructor(e, t, n, s, i, o, l, a, c) { super( t, n, s, o, c ); w(this, "_workbookSelections"); w(this, "_renderDisposable", null); this._context = e, this._logService = l, this._commandService = a, this._contextService = c, this._workbookSelections = i.getWorkbookSelections(this._context.unitId), this._init(); } _init() { const e = this._getSheetObject(); this._contextService.setContextValue(Yr, !0), this._initEventListeners(e), this._initSelectionModelChangeListener(), this._initThemeChangeListener(), this._initSkeletonChangeListener(), this._initUserActionSyncListener(); } _initEventListeners(e) { const { spreadsheetRowHeader: t, spreadsheetColumnHeader: n, spreadsheet: s, spreadsheetLeftTopPlaceholder: i } = e, { scene: o } = this._context; this.disposeWithMe(s == null ? void 0 : s.onPointerDown$.subscribeEvent((l, a) => { this.isSelectionDisabled() || this.inRefSelectionMode() || (this._onPointerDown(l, s.zIndex + 1, j.NORMAL, this._getActiveViewport(l)), l.button !== 2 && a.stopPropagation()); })), this.disposeWithMe( t == null ? void 0 : t.onPointerDown$.subscribeEvent((l, a) => { if (this.isSelectionDisabled() || this.inRefSelectionMode()) return; const c = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: d } = Nn(l.offsetX, l.offsetY, o, c); Nf(this._workbookSelections.getCurrentSelections(), d) || (this._onPointerDown(l, (s.zIndex || 1) + 1, j.ROW, this._getActiveViewport(l), It.Y), l.button !== 2 && a.stopPropagation()); }) ), this.disposeWithMe(n == null ? void 0 : n.onPointerDown$.subscribeEvent((l, a) => { if (this.isSelectionDisabled() || this.inRefSelectionMode()) return; const c = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: d } = Nn(l.offsetX, l.offsetY, o, c); Hf(this._workbookSelections.getCurrentSelections(), d) || (this._onPointerDown(l, (s.zIndex || 1) + 1, j.COLUMN, this._getActiveViewport(l), It.X), l.button !== 2 && a.stopPropagation()); })), this.disposeWithMe(i == null ? void 0 : i.onPointerDown$.subscribeEvent((l, a) => { if (this.isSelectionDisabled() || this.inRefSelectionMode()) return; this._reset(); const c = this._sheetSkeletonManagerService.getCurrent().skeleton, d = tf(c); this._addSelectionControlByModelData(d), this.refreshSelectionMoveEnd(), l.button !== 2 && a.stopPropagation(); })); } _initThemeChangeListener() { this.disposeWithMe(this._themeService.currentTheme$.subscribe(() => { this._initSelectionThemeFromThemeService(); const e = this._workbookSelections.getCurrentSelections(); e && this.resetSelectionsByModelData(e); })); } /** * Response for selection model changing. */ _initSelectionModelChangeListener() { this.disposeWithMe(mt( this._workbookSelections.selectionMoveEnd$, // triggered by keyboard(e.g. arrow key tab enter) this._workbookSelections.selectionSet$ // shift + arrow key ).subscribe((e) => { this.resetSelectionsByModelData(e); })); } disableSelection() { this._contextService.setContextValue(Yr, !1); } enableSelection() { this._contextService.setContextValue(Yr, !0); } transparentSelection() { this.setSelectionTheme({ primaryColor: "transparent" }); const e = this._workbookSelections.getCurrentSelections(); for (let t = 0; t < e.length; t++) { const n = e[t]; n.style = yr(this._selectionTheme); } this.resetSelectionsByModelData(e); } showSelection() { const e = this._themeService.getCurrentTheme(); this.setSelectionTheme(e); const t = this._workbookSelections.getCurrentSelections(); for (let n = 0; n < t.length; n++) { const s = t[n]; s.style && (s.style = yr(this._selectionTheme)); } this.resetSelectionsByModelData(t); } /** * Handle events in spreadsheet. (e.g. drag and move to make a selection) */ _initUserActionSyncListener() { this.disposeWithMe(this.selectionMoveStart$.subscribe((e) => this._updateSelections(e, Xt.MOVE_START))), this.disposeWithMe(this.selectionMoving$.subscribe((e) => this._updateSelections(e, Xt.MOVING))), this.disposeWithMe(this._contextService.subscribeContextValue$(Js).pipe(Vt(!1), cn()).subscribe((e) => { e && this._reset(); })), this.disposeWithMe(this._contextService.subscribeContextValue$(Yr).pipe(Vt(!0), cn()).subscribe((e) => { var t; e ? this._renderDisposable = Ae( this.selectionMoveEnd$.subscribe((n) => { this._updateSelections(n, Xt.MOVE_END); }) ) : ((t = this._renderDisposable) == null || t.dispose(), this._renderDisposable = null, this._reset()); })); } /** * Update selectionData to selectionDataModel (WorkBookSelections) by SetSelectionsOperation. * * Unlike baseSelectionRenderService@resetSelectionsByModelData, this method is for update WorkbookSelectionModel. * * * @param selectionDataWithStyleList * @param type */ _updateSelections(e, t) { const n = this._context.unit, s = n.getUnitId(), i = n.getActiveSheet().getSheetId(); if (e.length === 0) return; const o = e.map( (l) => Am(l) ); this._commandService.executeCommand(He.id, { unitId: s, subUnitId: i, type: t, selections: o }); } _initSkeletonChangeListener() { this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((e) => { var c, d; if (e == null) { this._logService.error("[SelectionRenderService]: should not receive null!"); return; } const t = this._context.unitId, { sheetId: n, skeleton: s } = e, { scene: i } = this._context, o = i.getViewport(z.VIEW_MAIN), l = (d = (c = this._skeleton) == null ? void 0 : c.worksheet) == null ? void 0 : d.getSheetId(); if (this._changeRuntime(s, i, o), l !== s.worksheet.getSheetId()) { const u = this._workbookSelections.getCurrentSelections(); this._commandService.syncExecuteCommand(He.id, { unitId: t, subUnitId: n, selections: u.length !== 0 ? u : [Od(s)] }); } const a = this._workbookSelections.getCurrentSelections(); a != null && this.resetSelectionsByModelData(a); })); } _getActiveViewport(e) { const t = this._getSheetObject(); return t == null ? void 0 : t.scene.getActiveViewportByCoord(Oe.FromArray([e.offsetX, e.offsetY])); } _getSheetObject() { return pn(this._context.unit, this._context); } /** * Handle pointer down event, bind pointermove & pointerup handler. * then trigger selectionMoveStart$. * * @param evt * @param _zIndex * @param rangeType * @param viewport * @param scrollTimerType */ // eslint-disable-next-line complexity, max-lines-per-function _onPointerDown(e, t = 0, n = j.NORMAL, s, i = It.ALL) { var E, T; this._rangeType = n; const o = this._skeleton, l = this._scene; if (!l || !o) return; s && (this._activeViewport = s); const { offsetX: a, offsetY: c } = e, d = l.getViewport(z.VIEW_MAIN); if (!d) return; const u = l.getCoordRelativeToViewport(Oe.FromArray([a, c])), { x: h, y: m } = u; this._startViewportPosX = h, this._startViewportPosY = m; const f = l.getScrollXYInfoByViewport(u), { scaleX: g, scaleY: p } = l.getAncestorScale(), S = this._skeleton.getCellByOffset(h, m, g, p, f); if (!S) return; switch (n) { case j.NORMAL: break; case j.ROW: S.startColumn = 0, S.endColumn = this._skeleton.getColumnCount() - 1, S.startRow = S.actualRow, S.endRow = S.actualRow; break; case j.COLUMN: S.startRow = 0, S.endRow = this._skeleton.getRowCount() - 1, S.startColumn = S.actualColumn, S.endColumn = S.actualColumn; break; case j.ALL: S.startRow = 0, S.startColumn = 0, S.endRow = this._skeleton.getRowCount() - 1, S.endColumn = this._skeleton.getColumnCount() - 1; } const b = { range: S, primary: S, style: null }; b.range.rangeType = n; const v = Pt(b, this._skeleton); this._startRangeWhenPointerDown = { ...v.rangeWithCoord }; let _ = this.getActiveSelectionControl(); const R = { ...v.rangeWithCoord, rangeType: n }, I = this.getSelectionControls(); for (const A of I) if (e.button === 2 && A.model.isInclude(R)) { _ = A; return; } this._checkClearPreviousControls(e); const y = _ == null ? void 0 : _.model.currentCell, M = e.shiftKey && y, P = this._remainLastEnabled && !e.ctrlKey && !e.shiftKey && !this._skipLastEnabled && !this._singleSelectionEnabled; M && y ? this._makeSelectionByTwoCells( y, R, o, n, _ // Get updated in this method ) : P && _ ? _.updateRangeBySelectionWithCoord(v) : _ = this.newSelectionControl(l, o, b); for (let A = 0; A < this.getSelectionControls().length - 1; A++) this.getSelectionControls()[A].clearHighlight(); l.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (E = l.getTransformer()) == null || E.clearSelectedObjects(), this._setupPointerMoveListener(d, _, n, i, h, m), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), this._scenePointerUpSub = l.onPointerUp$.subscribeEvent(() => { var A; this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (A = this._escapeShortcutDisposable) == null || A.dispose(), this._escapeShortcutDisposable = null; }), (T = this._scene.getEngine()) == null || T.setCapture(); } }; Qc = N2([ Zn(1, D(vt)), Zn(2, D(kt)), Zn(3, Il), Zn(4, D($)), Zn(5, D(me)), Zn(6, vl), Zn(7, F), Zn(8, Ne) ], Qc); var up = Object.defineProperty, H2 = Object.getOwnPropertyDescriptor, V2 = (r, e, t) => e in r ? up(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, k2 = (r, e, t, n) => { for (var s = n > 1 ? void 0 : n ? H2(e, t) : e, i = r.length - 1, o; i >= 0; i--) (o = r[i]) && (s = (n ? o(e, t, s) : o(s)) || s); return n && s && up(e, t, s), s; }, ao = (r, e) => (t, n) => e(t, n, r), hp = (r, e, t) => V2(r, typeof e != "symbol" ? e + "" : e, t); let fl = class extends Xh { /** @ignore */ constructor(r = Lc, e, t, n, s) { super(), this._config = r, this._injector = e, this._renderManagerService = t, this._configService = n, this._univerInstanceService = s; const { menu: i, ...o } = Kp( {}, Lc, this._config ); i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Pr, o); } onStarting() { du(this._injector, Jp([ [ds], [tt, { useClass: yc }], [Sn, { useClass: Bo }], [kr, { useClass: eg }], [Un, { useClass: Fo }], [Fl, { useClass: t1 }], [ca, { useClass: n0 }], [El, { useClass: Hm }], [Hr, { useClass: No }], [ap], [da, { useClass: lg }], [ws, { useClass: Lo }], [Er], [wi], [vi], [bi], [Ad], // controllers [Ci], [ri], [ui], [Mi], [Mr], [qo], [ps], [Vo], [ml], [ul], [hl], [dl], // permission [gs], [Vr], [Ii], [Ri], [yi] ], this._config.override)), Gi(this._injector, [ [gs] ]); } onReady() { this._config.disableAutoFocus || this._initAutoFocus(), du(this._injector, [ [_i] ]), this._registerRenderBasics(), Gi(this._injector, [ [qo], [Mr], [Ci], [Ri] ]); } onRendered() { this._registerRenderModules(), Gi(this._injector, [ [yi], [_i], [Mi], [ul], [ps], [ri], [ui], [hl], [dl] ]); } onSteady() { Gi(this._injector, [ [ml], [Vo], [Ii] ]); } _registerRenderBasics() { [ [me], [Xo], [dt, { useClass: Qc }] ].forEach((r) => { this.disposeWithMe(this._renderManagerService.registerRenderModule(O.UNIVER_SHEET, r)); }); } // We have to let render basics get bootstrapped before. Because some render controllers relies on // a correct skeleton when they get loaded. _registerRenderModules() { var n; const r = [ [mi], [qc], [jo], // Caution: ScrollRenderController should placed before ZoomRenderController. [yt], [ai], [hi], [ii], [Do], [ll], [Qo], [Jo], [tl], [el], [Ko], [$o], [ko], [Xc], [jc], // editor [zc], [Ec], // permission [rl], [sl], [il], [ol] ], e = this._configService.getConfig(Qh); ((n = e == null ? void 0 : e.contextMenu) != null ? n : !0) && r.push([Zc]), r.forEach((s) => { this.disposeWithMe(this._renderManagerService.registerRenderModule(O.UNIVER_SHEET, s)); }); } _initAutoFocus() { const r = this._univerInstanceService; this.disposeWithMe(r.getCurrentTypeOfUnit$(O.UNIVER_SHEET).pipe(Zm((e) => !!e)).subscribe((e) => r.focusUnit(e.getUnitId()))); } }; hp(fl, "pluginName", "SHEET_UI_PLUGIN"); hp(fl, "type", O.UNIVER_SHEET); fl = k2([ jh(Nm), ao(1, D(vt)), ao(2, Ce), ao(3, xr), ao(4, L) ], fl); const D2 = "embedding_formula_editor", lE = (r) => r.includes(D2); function aE(r, e, t, n) { const { from: s, to: i } = t, { column: o, columnOffset: l, row: a, rowOffset: c } = s, { column: d, columnOffset: u, row: h, rowOffset: m } = i, f = n.getOrCreateSkeleton({ sheetId: e }); if (f == null) throw new Error("No current skeleton"); const g = ni(f, { startColumn: o, endColumn: o, startRow: a, endRow: a }), p = ni(f, { startColumn: d, endColumn: d, startRow: h, endRow: h }), { startX: S, startY: b } = g, { startX: v, startY: _ } = p, R = qn(S + l, 1), I = qn(b + c, 1); let y = qn(v + u - R, 1), M = qn(_ + m - I, 1); return g.startX === p.endX && (y = 0), g.startY === p.endY && (M = 0), { unitId: r, subUnitId: e, left: R, top: I, width: y, height: M }; } function cE(r, e, t, n, s, i, o) { const { column: l, columnOffset: a, row: c, rowOffset: d } = t, u = o.getOrCreateSkeleton({ sheetId: e }); if (u == null) throw new Error("No current skeleton"); const h = ni(u, { startColumn: l, endColumn: l, startRow: c, endRow: c }), { startX: m, startY: f } = h, g = qn(m + a, 1), p = qn(f + d, 1), S = i.getCellWithCoordByOffset(g + n, p + s, u); if (S == null) throw new Error("No end selection cell"); const b = { column: S.actualColumn, columnOffset: qn(g + n - S.startX, 1), row: S.actualRow, rowOffset: qn(p + s - S.startY, 1) }; return { unitId: r, subUnitId: e, sheetTransform: { from: { column: l, columnOffset: a, row: c, rowOffset: d }, to: b }, transform: { left: g, top: p, width: n, height: s } }; } export { qm as AFFECT_LAYOUT_STYLES, ke as APPLY_TYPE, es as AddRangeProtectionFromContextMenuCommand, na as AddRangeProtectionFromSheetBarCommand, ta as AddRangeProtectionFromToolbarCommand, Zl as ApplyFormatPainterCommand, si as AutoClearContentCommand, pr as AutoFillCommand, Vo as AutoFillController, No as AutoFillService, ri as AutoHeightController, ui as AutoWidthController, ef as BaseSelectionRenderService, gr as COPY_TYPE, bi as CellAlertManagerService, Ks as CellAlertType, ko as CellCustomRenderController, t1 as CellEditorManagerService, la as ChangeSheetProtectionFromSheetBarCommand, Li as ChangeZoomRatioCommand, ut as DATA_TYPE, Xi as DeleteRangeMoveLeftConfirmCommand, ms as DeleteRangeMoveUpConfirmCommand, ns as DeleteRangeProtectionFromContextMenuCommand, oa as DeleteWorksheetProtectionFormSheetBarCommand, wi as DragManagerService, Ko as DragRenderController, D2 as EMBEDDING_FORMULA_EDITOR, Td as EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY, Ec as EditingRenderController, yc as EditorBridgeService, Gt as ExpandSelectionCommand, Fd as FONT_FAMILY_COMPONENT, Ud as FONT_FAMILY_ITEM_COMPONENT, jd as FONT_SIZE_COMPONENT, zt as FormatPainterStatus, Mi as FormulaEditorController, hi as HeaderFreezeRenderController, mi as HeaderMoveRenderController, jo as HeaderResizeRenderController, jl as HideColConfirmCommand, Ul as HideRowConfirmCommand, Er as HoverManagerService, el as HoverRenderController, Hr as IAutoFillService, Fl as ICellEditorManagerService, tt as IEditorBridgeService, Un as IFormatPainterService, ca as IFormulaEditorManagerService, ws as IMarkSelectionService, Sn as ISheetClipboardService, dt as ISheetSelectionRenderService, fs as InsertRangeMoveDownConfirmCommand, zi as InsertRangeMoveRightConfirmCommand, Bn as JumpOver, Lo as MarkSelectionService, yy as MobileSheetBar, Lt as MoveSelectionCommand, Fn as MoveSelectionEnterAndTabCommand, go as PASTE_SPECIAL_MENU_ID, rt as PREDEFINED_HOOK_NAME, Jm as RANGE_SELECTOR_COMPONENT_KEY, _1 as RANGE_SELECTOR_SYMBOLS, Ll as RefillCommand, pi as RemoveColConfirmCommand, gi as RemoveRowConfirmCommand, sa as RemoveSheetConfirmCommand, aa as RenameSheetOperation, IR as RenderSheetContent, wR as RenderSheetFooter, RR as RenderSheetHeader, Pf as ResetRangeTextColorCommand, nE as ResetScrollCommand, $m as SELECTION_SHAPE_DEPTH, eE as SHEET_UI_PLUGIN_NAME, qe as SHEET_VIEW_KEY, un as ScrollCommand, of as ScrollToCellCommand, lf as ScrollToRangeOperation, Vd as SelectAllCommand, xd as SelectionControl, xd as SelectionShape, Cv as SelectionShapeExtension, Kd as SetActivateCellEditOperation, cs as SetCellEditVisibleArrowOperation, Et as SetCellEditVisibleOperation, Wl as SetCellEditVisibleWithF2Operation, ql as SetColumnFrozenCommand, Yl as SetFormatPainterOperation, Bd as SetInfiniteFormatPainterCommand, Bi as SetOnceFormatPainterCommand, Rs as SetRangeBoldCommand, zl as SetRangeFontFamilyCommand, Xl as SetRangeFontSizeCommand, Is as SetRangeItalicCommand, rs as SetRangeProtectionFromContextMenuCommand, Ms as SetRangeStrickThroughCommand, yf as SetRangeSubscriptCommand, Mf as SetRangeSuperscriptCommand, di as SetRangeTextColorCommand, ys as SetRangeUnderlineCommand, Gl as SetRowFrozenCommand, dn as SetScrollOperation, li as SetScrollRelativeCommand, $n as SetSelectionFrozenCommand, Ql as SetWorksheetColAutoWidthCommand, Wi as SetZoomRatioCommand, $t as SetZoomRatioOperation, aR as SheetBar, vi as SheetCanvasPopManagerService, Do as SheetCellEditorResizeService, Bo as SheetClipboardService, hn as SheetCopyCommand, Rf as SheetCutCommand, _b as SheetMenuPosition, Qs as SheetPasteBesidesBorderCommand, Jr as SheetPasteColWidthCommand, mn as SheetPasteCommand, qs as SheetPasteFormatCommand, xc as SheetPasteShortKeyCommand, Gs as SheetPasteValueCommand, Ri as SheetPermissionCheckUIController, tg as SheetPermissionOpenDialogOperation, Vn as SheetPermissionOpenPanelOperation, Vr as SheetPermissionUserManagerService, ap as SheetPrintInterceptorService, Xo as SheetRenderController, yt as SheetScrollManagerService, Qc as SheetSelectionRenderService, me as SheetSkeletonManagerService, qo as SheetUIController, Mr as SheetsRenderService, ai as SheetsScrollRenderController, oI as SheetsUIMenuSchema, Gm as SheetsUIPart, ia as ShowMenuListCommand, Jd as SidebarDefinedNameOperation, ps as StatusBarController, qf as UNIVER_SHEET_PERMISSION_BACKGROUND, Dc as UNIVER_SHEET_PERMISSION_USER_PART, cl as UniverSheetsMobileUIPlugin, fl as UniverSheetsUIPlugin, ts as ViewSheetPermissionFromContextMenuCommand, ra as ViewSheetPermissionFromSheetBarCommand, xo as attachPrimaryWithCoord, ni as attachRangeWithCoord, Pt as attachSelectionWithCoord, iy as calculateDocSkeletonRects, Uo as checkInHeaderRanges, cE as convertPositionCellToSheetOverGrid, aE as convertPositionSheetOverGridToAbsolute, xt as deriveStateFromActiveSheet$, wr as discreteRangeToRange, yr as genNormalSelectionStyle, bv as genSelectionByRange, tf as getAllSelection, tE as getAutoFillRepeatRange, K_ as getCellRealRange, Nu as getCoordByCell, Nn as getCoordByOffset, bb as getCurrentExclusiveRangeInterest$, ue as getCurrentRangeDisable$, iE as getCustomRangePosition, oE as getEditingCustomRangePosition, Ed as getEditorObject, nb as getMatrixPlainText, Es as getObservableWithExclusiveRange$, sE as getRepeatRange, pn as getSheetObject, Od as getTopLeftSelectionOfCurrSheet, fo as getTransformCoord, lE as isEmbeddingFormulaEditor, w1 as isRangeSelector, Gu as mergeSetRangeValues, Ys as rangeToDiscreteRange, Wn as useActiveWorkbook, J2 as useActiveWorksheet, dI as useHighlightRange, $2 as useWorkbooks, _s as virtualizeDiscreteRanges, rE as whenFormulaEditorActivated, De as whenSheetEditorFocused };