@univerjs-pro/collaboration-client 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +2 -0
  2. package/lib/cjs/facade.js +1 -1
  3. package/lib/cjs/index.js +1 -1
  4. package/lib/cjs/locale/ar-SA.js +1 -1
  5. package/lib/cjs/locale/ca-ES.js +1 -1
  6. package/lib/cjs/locale/de-DE.js +1 -1
  7. package/lib/cjs/locale/en-US.js +1 -1
  8. package/lib/cjs/locale/es-ES.js +1 -1
  9. package/lib/cjs/locale/fa-IR.js +1 -1
  10. package/lib/cjs/locale/fr-FR.js +1 -1
  11. package/lib/cjs/locale/id-ID.js +1 -1
  12. package/lib/cjs/locale/it-IT.js +1 -1
  13. package/lib/cjs/locale/ja-JP.js +1 -1
  14. package/lib/cjs/locale/ko-KR.js +1 -1
  15. package/lib/cjs/locale/pl-PL.js +1 -1
  16. package/lib/cjs/locale/pt-BR.js +1 -1
  17. package/lib/cjs/locale/ru-RU.js +1 -1
  18. package/lib/cjs/locale/sk-SK.js +1 -1
  19. package/lib/cjs/locale/vi-VN.js +1 -1
  20. package/lib/cjs/locale/zh-CN.js +1 -1
  21. package/lib/cjs/locale/zh-HK.js +1 -1
  22. package/lib/cjs/locale/zh-TW.js +1 -1
  23. package/lib/es/facade.js +1 -1
  24. package/lib/es/index.js +1 -1
  25. package/lib/es/locale/ar-SA.js +1 -1
  26. package/lib/es/locale/ca-ES.js +1 -1
  27. package/lib/es/locale/de-DE.js +1 -1
  28. package/lib/es/locale/en-US.js +1 -1
  29. package/lib/es/locale/es-ES.js +1 -1
  30. package/lib/es/locale/fa-IR.js +1 -1
  31. package/lib/es/locale/fr-FR.js +1 -1
  32. package/lib/es/locale/id-ID.js +1 -1
  33. package/lib/es/locale/it-IT.js +1 -1
  34. package/lib/es/locale/ja-JP.js +1 -1
  35. package/lib/es/locale/ko-KR.js +1 -1
  36. package/lib/es/locale/pl-PL.js +1 -1
  37. package/lib/es/locale/pt-BR.js +1 -1
  38. package/lib/es/locale/ru-RU.js +1 -1
  39. package/lib/es/locale/sk-SK.js +1 -1
  40. package/lib/es/locale/vi-VN.js +1 -1
  41. package/lib/es/locale/zh-CN.js +1 -1
  42. package/lib/es/locale/zh-HK.js +1 -1
  43. package/lib/es/locale/zh-TW.js +1 -1
  44. package/lib/facade.js +1 -1
  45. package/lib/index.js +1 -1
  46. package/lib/locale/ar-SA.js +1 -1
  47. package/lib/locale/ca-ES.js +1 -1
  48. package/lib/locale/de-DE.js +1 -1
  49. package/lib/locale/en-US.js +1 -1
  50. package/lib/locale/es-ES.js +1 -1
  51. package/lib/locale/fa-IR.js +1 -1
  52. package/lib/locale/fr-FR.js +1 -1
  53. package/lib/locale/id-ID.js +1 -1
  54. package/lib/locale/it-IT.js +1 -1
  55. package/lib/locale/ja-JP.js +1 -1
  56. package/lib/locale/ko-KR.js +1 -1
  57. package/lib/locale/pl-PL.js +1 -1
  58. package/lib/locale/pt-BR.js +1 -1
  59. package/lib/locale/ru-RU.js +1 -1
  60. package/lib/locale/sk-SK.js +1 -1
  61. package/lib/locale/vi-VN.js +1 -1
  62. package/lib/locale/zh-CN.js +1 -1
  63. package/lib/locale/zh-HK.js +1 -1
  64. package/lib/locale/zh-TW.js +1 -1
  65. package/lib/types/config/config.d.ts +19 -0
  66. package/lib/types/controllers/collaboration/changeset-submitter.d.ts +132 -0
  67. package/lib/types/controllers/collaboration/collaboration-entity.d.ts +28 -1
  68. package/lib/types/controllers/collaboration/collaboration-state.d.ts +162 -70
  69. package/lib/types/controllers/collaboration/collaboration.controller.d.ts +7 -0
  70. package/lib/types/controllers/collaboration/utils/changeset-utils.d.ts +7 -3
  71. package/lib/types/facade/f-collaboration.d.ts +17 -0
  72. package/lib/types/facade/f-event.d.ts +87 -2
  73. package/lib/types/index.d.ts +5 -3
  74. package/lib/types/services/collaboration-session/collaboration-session.d.ts +4 -8
  75. package/lib/types/services/collaboration-session/collaboration-session.service.d.ts +1 -1
  76. package/lib/types/services/collaboration-ui-event/collaboration-ui-event.d.ts +8 -0
  77. package/lib/types/services/socket/collaboration-socket.service.d.ts +10 -2
  78. package/lib/types/services/undoredo/collaborative-undoredo.service.d.ts +5 -0
  79. package/lib/umd/facade.js +1 -1
  80. package/lib/umd/index.js +1 -1
  81. package/lib/umd/locale/ar-SA.js +1 -1
  82. package/lib/umd/locale/ca-ES.js +1 -1
  83. package/lib/umd/locale/de-DE.js +1 -1
  84. package/lib/umd/locale/en-US.js +1 -1
  85. package/lib/umd/locale/es-ES.js +1 -1
  86. package/lib/umd/locale/fa-IR.js +1 -1
  87. package/lib/umd/locale/fr-FR.js +1 -1
  88. package/lib/umd/locale/id-ID.js +1 -1
  89. package/lib/umd/locale/it-IT.js +1 -1
  90. package/lib/umd/locale/ja-JP.js +1 -1
  91. package/lib/umd/locale/ko-KR.js +1 -1
  92. package/lib/umd/locale/pl-PL.js +1 -1
  93. package/lib/umd/locale/pt-BR.js +1 -1
  94. package/lib/umd/locale/ru-RU.js +1 -1
  95. package/lib/umd/locale/sk-SK.js +1 -1
  96. package/lib/umd/locale/vi-VN.js +1 -1
  97. package/lib/umd/locale/zh-CN.js +1 -1
  98. package/lib/umd/locale/zh-HK.js +1 -1
  99. package/lib/umd/locale/zh-TW.js +1 -1
  100. package/package.json +15 -15
@@ -1,6 +1,5 @@
1
- import type { IChangeset, RevisionService } from '@univerjs-pro/collaboration';
1
+ import type { IChangeset, IRevertRevisionMutationParams, RevisionService } from '@univerjs-pro/collaboration';
2
2
  import type { IMutationInfo, IUniverInstanceService, UserManagerService } from '@univerjs/core';
3
- import type { Observable } from 'rxjs';
4
3
  export interface IAssembledChangeset {
5
4
  changeset: IChangeset;
6
5
  pendingMutations: IMutationInfo[];
@@ -23,4 +22,9 @@ export declare const assemblePdfChangeset: typeof assembleMutationChangeset;
23
22
  export declare function assembleBaseChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, userManagerService: UserManagerService): IAssembledChangeset;
24
23
  export declare function assembleSlideChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, userManagerService: UserManagerService): IAssembledChangeset;
25
24
  export declare function assembleDocChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, userManagerService: UserManagerService): IAssembledChangeset;
26
- export declare function createTimerObservable$<T>(ms: number, options: T): Observable<T>;
25
+ /**
26
+ * The revert of `unitID` carried by a remote changeset, if any. A revert is executed on the server: the next revision
27
+ * is the restored snapshot, so the local copy cannot transform it and has to be reloaded. Reverts of other units are
28
+ * ordinary changesets.
29
+ */
30
+ export declare function findRemoteRevert(changeset: IChangeset, unitID: string): IRevertRevisionMutationParams | null;
@@ -160,6 +160,23 @@ export declare class FCollaboration extends FBase {
160
160
  * ```
161
161
  */
162
162
  getCollaborationStatus(unitId?: string): CollaborationStatus;
163
+ /**
164
+ * Whether a unit has local edits that the server has not acknowledged yet, including edits that are
165
+ * waiting to be sent, sent and awaiting acknowledgement, or cached while offline.
166
+ *
167
+ * @param {string} [unitId] Optional unit ID. If omitted, uses the focused unit.
168
+ * @returns {boolean} `true` when there are unacknowledged local edits.
169
+ *
170
+ * @example
171
+ * ```typescript
172
+ * window.addEventListener('beforeunload', (event) => {
173
+ * if (univerAPI.getCollaboration().hasWritePending()) {
174
+ * event.preventDefault();
175
+ * }
176
+ * });
177
+ * ```
178
+ */
179
+ hasWritePending(unitId?: string): boolean;
163
180
  /**
164
181
  * Wait until all currently queued collaboration changes for a unit are synchronized.
165
182
  *
@@ -1,5 +1,33 @@
1
- import type { CollaborationStatus } from '@univerjs-pro/collaboration-client';
1
+ import type { ChangesetResendReason, CollaborationStatus, ConflictReason, IRemoteRevertInfo, IUnitCacheData } from '@univerjs-pro/collaboration-client';
2
2
  import type { IEventBase } from '@univerjs/core/facade';
3
+ /**
4
+ * Fired once when a unit enters `CollaborationStatus.CONFLICT`, after its offline cache has been cleared. Carries the
5
+ * reason and the local edits the server has not acknowledged.
6
+ */
7
+ export interface ICollaborationConflictEventParams extends IEventBase {
8
+ /** The unit ID that entered the conflict status */
9
+ unitId: string;
10
+ /**
11
+ * - `transform_failed`: a remote changeset could not be transformed against the local edits
12
+ * - `apply_failed`: a remote changeset was transformed but one of its mutations failed to execute
13
+ * - `changeset_rejected`: the server rejected the local changeset
14
+ * - `permission_rejected`: the server rejected the local changeset for lack of permission
15
+ * - `remote_revert`: another collaborator reverted the unit to a historical revision
16
+ */
17
+ reason: ConflictReason;
18
+ /** The error message, when the conflict was caused by an error */
19
+ message?: string;
20
+ /** The revert that caused the conflict, when `reason` is `remote_revert` */
21
+ revert?: IRemoteRevertInfo;
22
+ /**
23
+ * The local edits the server has not acknowledged, in the format of the offline cache, or `null` when there
24
+ * are none. Not available after this event. `awaitingChangeset` has been sent; whether the server applied it is
25
+ * unknown.
26
+ */
27
+ localChanges: IUnitCacheData | null;
28
+ /** Whether the offline cache of the unit was cleared. When `false`, a page reload replays the cached edits. */
29
+ cacheCleared: boolean;
30
+ }
3
31
  /**
4
32
  * Event triggered when collaboration status changes for a unit
5
33
  */
@@ -9,10 +37,36 @@ export interface ICollaborationStatusChangedEventParams extends IEventBase {
9
37
  */
10
38
  unitId: string;
11
39
  /**
12
- * The new collaboration status
40
+ * The new collaboration status. When it is `CONFLICT`, the `CollaborationConflict` event follows with the reason
41
+ * and the unacknowledged local edits.
13
42
  */
14
43
  status: CollaborationStatus;
15
44
  }
45
+ /**
46
+ * Event triggered every time a changeset is sent to the server again because it was not acknowledged.
47
+ * The first send of a changeset does not trigger it.
48
+ */
49
+ export interface ICollaborationChangesetResendEventParams extends IEventBase {
50
+ /** The unit ID whose changeset was resent */
51
+ unitId: string;
52
+ /** The request ID of the changeset within the current editing session */
53
+ reqId: number;
54
+ /**
55
+ * Why the changeset was resent:
56
+ * - `ack_timeout`: no acknowledgement arrived in time
57
+ * - `should_retry`: the server asked for the changeset to be resent
58
+ * - `reconnect`: the connection was restored or the changeset was restored from the local cache
59
+ */
60
+ reason: ChangesetResendReason;
61
+ /** How many times the changeset has been resent, counting this one */
62
+ attempt: number;
63
+ /** Milliseconds since the changeset was first sent */
64
+ elapsedMs: number;
65
+ /** Local mutations the server has not acknowledged yet, including those not sent yet */
66
+ unsyncedMutationCount: number;
67
+ /** Milliseconds until the next resend if the server stays silent */
68
+ nextDelayMs: number;
69
+ }
16
70
  /**
17
71
  * Collaboration event name mixin interface
18
72
  * @ignore
@@ -34,6 +88,35 @@ export interface IFCollaborationEventNameMixin {
34
88
  * ```
35
89
  */
36
90
  readonly CollaborationStatusChanged: 'CollaborationStatusChanged';
91
+ /**
92
+ * Event triggered once per conflict, after the unit's offline cache was cleared: the reason and the local edits
93
+ * the server has not acknowledged
94
+ * @see {@link ICollaborationConflictEventParams}
95
+ * @example
96
+ * ```typescript
97
+ * univerAPI.addEvent(univerAPI.Event.CollaborationConflict, (event) => {
98
+ * const { unitId, reason, localChanges, cacheCleared } = event;
99
+ * if (localChanges) saveSomewhere(unitId, localChanges);
100
+ * if (reason === 'permission_rejected') return showNoPermission(unitId);
101
+ * if (cacheCleared) window.location.reload();
102
+ * });
103
+ * ```
104
+ */
105
+ readonly CollaborationConflict: 'CollaborationConflict';
106
+ /**
107
+ * Event triggered every time a changeset is resent because the server did not acknowledge it
108
+ * @see {@link ICollaborationChangesetResendEventParams}
109
+ * @example
110
+ * ```typescript
111
+ * univerAPI.addEvent(univerAPI.Event.CollaborationChangesetResend, (event) => {
112
+ * const { unitId, reason, attempt, unsyncedMutationCount, elapsedMs } = event;
113
+ * if (reason === 'ack_timeout' && attempt >= 2) {
114
+ * console.warn(`${unsyncedMutationCount} unsaved mutations of ${unitId} for ${Math.round(elapsedMs / 1000)}s`);
115
+ * }
116
+ * });
117
+ * ```
118
+ */
119
+ readonly CollaborationChangesetResend: 'CollaborationChangesetResend';
37
120
  }
38
121
  /**
39
122
  * Collaboration event parameter configuration
@@ -41,6 +124,8 @@ export interface IFCollaborationEventNameMixin {
41
124
  */
42
125
  export interface ICollaborationEventParamConfig {
43
126
  CollaborationStatusChanged: ICollaborationStatusChangedEventParams;
127
+ CollaborationConflict: ICollaborationConflictEventParams;
128
+ CollaborationChangesetResend: ICollaborationChangesetResendEventParams;
44
129
  }
45
130
  declare module '@univerjs/core/facade' {
46
131
  interface FEventName extends IFCollaborationEventNameMixin {
@@ -2,10 +2,12 @@ export { DEFAULT_WS_SESSION_TICKET_URL, HEARTBEAT_INTERVAL_KEY, HEARTBEAT_TIMEOU
2
2
  export { DEFAULT_COLLAB_WEB_SOCKET_URL, DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT, REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY, } from './config/config';
3
3
  export type { IUniverCollaborationClientConfig } from './config/config';
4
4
  export { COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY } from './config/config';
5
+ export { ChangesetSubmitter, DEFAULT_ACK_TIMEOUT, MAX_ACK_TIMEOUT } from './controllers/collaboration/changeset-submitter';
6
+ export type { ChangesetResendReason, IChangesetResendEvent, IChangesetSubmitterOptions, IChangesetSubmitterSource, SendChangeset } from './controllers/collaboration/changeset-submitter';
5
7
  export { BaseCollaborationEntity, BoardCollaborationEntity, CollaborationEntity, DocCollaborationEntity, PdfCollaborationEntity, SheetCollaborationEntity, SlideCollaborationEntity, } from './controllers/collaboration/collaboration-entity';
6
- export type { IDocCollaborationEntityCallback } from './controllers/collaboration/collaboration-entity';
8
+ export type { ICollaborationConflictEvent, IDocCollaborationEntityCallback } from './controllers/collaboration/collaboration-entity';
7
9
  export { AwaitingState, AwaitingWithPendingState, CollaborationStatus, ConflictState, FetchingMissState, OfflineState, PendingState, SyncedState, } from './controllers/collaboration/collaboration-state';
8
- export type { ISelectionTransformTransaction } from './controllers/collaboration/collaboration-state';
10
+ export type { ConflictReason, IConflictInfo, IRemoteRevertInfo, ISelectionTransformTransaction, } from './controllers/collaboration/collaboration-state';
9
11
  export { CollaborationController } from './controllers/collaboration/collaboration.controller';
10
12
  export { UniverCollaborationClientPlugin } from './plugin';
11
13
  export { CollaborationAttachmentIoService, IAttachmentIoService, } from './services/attachment-remote/attachment-io.service';
@@ -27,7 +29,7 @@ export { INetworkConditionService } from './services/network-condition/network-c
27
29
  export { SheetTransformSelectionsService } from './services/range-selection/sheet-transform-selections.service';
28
30
  export { ISingleActiveUnitService, UnitStatus } from './services/single-active-unit/single-active-unit.service';
29
31
  export { SnapshotServerOverHTTPService } from './services/snapshot-server/snapshot-server.service';
30
- export type { ICollaborationSocket } from './services/socket/collaboration-socket.service';
32
+ export type { ICollaborationSendOptions, ICollaborationSocket } from './services/socket/collaboration-socket.service';
31
33
  export { CollaborationSocketService, ICollaborationSocketService, } from './services/socket/collaboration-socket.service';
32
34
  export { deserializeToCombResponse, serializeCombRequest } from './services/socket/serialize';
33
35
  export { CollaborativeUndoRedoService } from './services/undoredo/collaborative-undoredo.service';
@@ -1,9 +1,9 @@
1
1
  import type { ICollaborationEvent } from '@univerjs-pro/collaboration';
2
2
  import type { IDisposable, Nullable } from '@univerjs/core';
3
3
  import type { Observable } from 'rxjs';
4
- import type { ICollaborationSocket } from '../socket/collaboration-socket.service';
4
+ import type { ICollaborationSendOptions, ICollaborationSocket } from '../socket/collaboration-socket.service';
5
5
  import type { ICollaborationSessionIdentity } from './collaboration-client-adapter';
6
- import { IConfigService, ILogService, RxDisposable } from '@univerjs/core';
6
+ import { ILogService, RxDisposable } from '@univerjs/core';
7
7
  import { ITelemetryService } from '@univerjs/telemetry';
8
8
  import { CollaborationUIEventService } from '../collaboration-ui-event/collaboration-ui-event';
9
9
  import { CommentService } from '../comment/comment.service';
@@ -29,7 +29,6 @@ export declare const FailedReason: {
29
29
  export declare class CollaborationSession extends RxDisposable implements IDisposable {
30
30
  private readonly _identity;
31
31
  private readonly _logService;
32
- private readonly _configService;
33
32
  private readonly _memberService;
34
33
  private readonly _commentService;
35
34
  private readonly _collaborationUIEventService;
@@ -41,7 +40,7 @@ export declare class CollaborationSession extends RxDisposable implements IDispo
41
40
  readonly event$: Observable<ICollaborationEvent>;
42
41
  private _socket;
43
42
  private _socketMessageSubscription;
44
- constructor(_identity: ICollaborationSessionIdentity, socket$: Observable<Nullable<ICollaborationSocket>>, _logService: ILogService, _configService: IConfigService, _memberService: MemberService, _commentService: CommentService, _collaborationUIEventService: CollaborationUIEventService, _telemetryService?: ITelemetryService | undefined);
43
+ constructor(_identity: ICollaborationSessionIdentity, socket$: Observable<Nullable<ICollaborationSocket>>, _logService: ILogService, _memberService: MemberService, _commentService: CommentService, _collaborationUIEventService: CollaborationUIEventService, _telemetryService?: ITelemetryService | undefined);
45
44
  getMemberID(): string | null;
46
45
  dispose(): void;
47
46
  close(): void;
@@ -54,10 +53,7 @@ export declare class CollaborationSession extends RxDisposable implements IDispo
54
53
  /**
55
54
  * Send event to the collaboration server.
56
55
  */
57
- send(event: ICollaborationEvent, _unitID: string): Promise<void>;
58
- private _collaborationTimeoutTimer;
59
- private _scheduleCollaborationTimeoutTimer;
60
- private _clearCollaborationTimeoutTimer;
56
+ send(event: ICollaborationEvent, _unitID: string, options?: ICollaborationSendOptions): Promise<void>;
61
57
  private _shouldReportTelemetry;
62
58
  private _telemetryInfo;
63
59
  private _startTelemetryCollaborationNewChangeset;
@@ -1,7 +1,7 @@
1
1
  import type { Nullable, UniverInstanceType } from '@univerjs/core';
2
+ import { Disposable, IConfigService, ILogService, Injector } from '@univerjs/core';
2
3
  import type { ICollaborationSocket } from '../socket/collaboration-socket.service';
3
4
  import type { ICollaborationClientAdapter } from './collaboration-client-adapter';
4
- import { Disposable, IConfigService, ILogService, Injector } from '@univerjs/core';
5
5
  import { CollaborationUIEventService } from '../collaboration-ui-event/collaboration-ui-event';
6
6
  import { ICollaborationSocketService } from '../socket/collaboration-socket.service';
7
7
  import { CollaborationSession, SessionStatus } from './collaboration-session';
@@ -6,14 +6,22 @@ export interface ICollaborationUIEvent {
6
6
  }
7
7
  export declare enum CollaborationUIEventId {
8
8
  OTHER_CLIENT_EDITING = "OTHER_CLIENT_EDITING",
9
+ /** @deprecated No longer emitted. Use `CollaborationEntity.conflict$` or the `CollaborationConflict` facade event. */
9
10
  PERMISSION_DENIED = "PERMISSION_DENIED",
11
+ /** A unit entered the conflict state; `unitID` is set. */
10
12
  CONFLICT_PROCESSING = "CONFLICT_PROCESSING",
13
+ /** Clearing the offline cache of a conflicted unit failed; `unitID` and `userId` are set. */
11
14
  CONFLICT_CACHE_CLEAR_FAILED = "CONFLICT_CACHE_CLEAR_FAILED",
15
+ /** @deprecated No longer emitted. Use `CollaborationEntity.conflict$` or the `CollaborationConflict` facade event. */
12
16
  CONFLICT = "CONFLICT",
13
17
  CLOSE_ROOM = "CLOSE_ROOM",
14
18
  JOIN_ROOM_FAILED = "JOIN_ROOM_FAILED",
15
19
  SOCKET_FAILED_RETRY = "SOCKET_FAILED_RETRY",
16
20
  SOCKET_FAILED = "SOCKET_FAILED",
21
+ /**
22
+ * @deprecated No longer emitted. Unacknowledged changesets are resent automatically; subscribe to
23
+ * `CollaborationEntity.changesetResend$` (or the `CollaborationChangesetResend` facade event) instead.
24
+ */
17
25
  SUBMIT_CHANGESET_TIMEOUT = "SUBMIT_CHANGESET_TIMEOUT"
18
26
  }
19
27
  export declare class CollaborationUIEventService {
@@ -10,10 +10,18 @@ import { HTTPService } from '@univerjs/network';
10
10
  * A special wrapper around of the original {@link ISocket} implementation to
11
11
  * for collaboration.
12
12
  */
13
+ export interface ICollaborationSendOptions {
14
+ /** How long the server may take to answer the request, in milliseconds. Only used for submitted changesets. */
15
+ timeout?: number;
16
+ }
13
17
  export interface ICollaborationSocket extends Pick<ISocket, 'open$' | 'error$' | 'close$'> {
14
18
  memberID: string;
15
19
  message$: Observable<ICombResponseEvent>;
16
- send: (event: ICombRequestEvent) => void;
20
+ /**
21
+ * Send an event to the server. For a submitted changeset the returned promise resolves when the server
22
+ * answered the HTTP request and rejects when the request failed or timed out; other events return nothing.
23
+ */
24
+ send: (event: ICombRequestEvent, options?: ICollaborationSendOptions) => void | Promise<void>;
17
25
  close: () => void;
18
26
  }
19
27
  /**
@@ -39,6 +47,6 @@ export declare abstract class CollaborationSocketService extends Disposable impl
39
47
  * @param URL The URL of the remote server.
40
48
  */
41
49
  protected _doCreateSocket(URL: string): Nullable<ICollaborationSocket>;
42
- protected _submitChangeset(socket: ICollaborationSocket, event: ISubmitChangesetEvent): Promise<void>;
50
+ protected _submitChangeset(socket: ICollaborationSocket, event: ISubmitChangesetEvent, timeoutMs: number): Promise<void>;
43
51
  protected _fetchMissChangesets(event: IFetchingMissEvent): Promise<IChangeset[]>;
44
52
  }
@@ -18,4 +18,9 @@ export declare class CollaborativeUndoRedoService extends LocalUndoRedoService i
18
18
  private _substituteUndoStack;
19
19
  private _substituteRedoStack;
20
20
  private _transformStack;
21
+ private _transformHistoryMutations;
22
+ private _rebaseParagraphHistory;
23
+ private _rebaseUnchangedAttributes;
24
+ private _invertDocumentHistory;
25
+ private _filterTableActions;
21
26
  }
package/lib/umd/facade.js CHANGED
@@ -1 +1 @@
1
- function _0x128c(){const _0x360678=['7732182JtusmM','NOT_COLLAB','object','CollaborationController','CONFLICT','IUniverInstanceService','readyForCollab','getFocusedUnit','disposeWithMe','loadDocAsync','entityInit$','CollaborationStatus','MemberService','UNIVER_SHEET','loadUnit','_collaborationController','waitForRoom$','getWorkbook','6190940lTMfgH','UniverProCollaborationClientFacade','add','flush','6408832DdYOPn','1vNdgxw','switchMap','_univerInstanceService','Event','@univerjs-pro/collaboration-client','2452154eLHuiL','Injector','status','@univerjs/core/facade','getOwnPropertyDescriptor','_resolveUnitId','getPdf','FEventName','reject','loadBoardAsync','UniverProCollaborationClient','DataLoaderService','UNIVER_DOC','createInstance','loadServerUnit','26071398mbDfQe','toDisposable','length','getCollabEntity','unsubscribe','92925dOoRpP','rxjs','getBoard','10787637GkqnAH','FBase','UniverCoreFacade','pipe','[FCollaboration]:\x20Cannot\x20flush\x20unit\x20\x22','state','\x22\x20is\x20not\x20in\x20collaboration\x20mode.','loadPdfAsync','\x22\x20after\x20','DisposableCollection','CollaborationStatusChanged','UNIVER_PDF','_dataLoaderService','defineProperty','loadBaseAsync','status$','FCollaboration','_handler','loadUnitOfRevision','\x22\x20while\x20collaboration\x20status\x20is\x20','UNIVER_BOARD','toStringTag','Module','subscribe','function','resolve','get','UniverInstanceType','FEnum','Inject','SYNCED','24MXrhDG','from','[FCollaboration]:\x20Unit\x20\x22','getBase','UNIVER_BASE','@univerjs/core','decorate','loadSheetAsync','extend','subscribeCollaborators','amd','loadServerUnitOfRevision','members$','unitID','getPresentation','_injector','registerEventHandler'];_0x128c=function(){return _0x360678;};return _0x128c();}function _0x3b1b(_0x514561,_0x53dfd4){_0x514561=_0x514561-0x136;const _0x128c2a=_0x128c();let _0x3b1ba4=_0x128c2a[_0x514561];return _0x3b1ba4;}(function(_0x33c55c,_0x1b55a9){const _0x55dee1=_0x3b1b,_0x3aade2=_0x33c55c();while(!![]){try{const _0x4c0a9e=-parseInt(_0x55dee1(0x154))/0x1*(parseInt(_0x55dee1(0x159))/0x2)+-parseInt(_0x55dee1(0x16d))/0x3*(-parseInt(_0x55dee1(0x18f))/0x4)+parseInt(_0x55dee1(0x14f))/0x5+parseInt(_0x55dee1(0x13d))/0x6+parseInt(_0x55dee1(0x170))/0x7+parseInt(_0x55dee1(0x153))/0x8+-parseInt(_0x55dee1(0x168))/0x9;if(_0x4c0a9e===_0x1b55a9)break;else _0x3aade2['push'](_0x3aade2['shift']());}catch(_0x3e5dc7){_0x3aade2['push'](_0x3aade2['shift']());}}}(_0x128c,0xe38bf),function(_0x4325e1,_0x4cca04){const _0x129dd9=_0x3b1b;typeof exports==_0x129dd9(0x13f)&&typeof module<'u'?_0x4cca04(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs/core/facade'),require('@univerjs/core'),require('rxjs')):typeof define==_0x129dd9(0x188)&&define[_0x129dd9(0x136)]?define(['exports',_0x129dd9(0x158),_0x129dd9(0x15c),_0x129dd9(0x194),'rxjs'],_0x4cca04):(_0x4325e1=typeof globalThis<'u'?globalThis:_0x4325e1||self,_0x4cca04(_0x4325e1[_0x129dd9(0x150)]={},_0x4325e1[_0x129dd9(0x163)],_0x4325e1[_0x129dd9(0x172)],_0x4325e1['UniverCore'],_0x4325e1[_0x129dd9(0x16e)]));}(this,function(_0x1d5524,_0x23fd0b,_0x35a254,_0x43e644,_0x2aa361){const _0x2dd743=_0x3b1b;Object[_0x2dd743(0x17d)](_0x1d5524,Symbol[_0x2dd743(0x185)],{'value':_0x2dd743(0x186)});var _0x560aec=class extends _0x35a254[_0x2dd743(0x18c)]{get[_0x2dd743(0x148)](){const _0x6919ab=_0x2dd743;return _0x23fd0b[_0x6919ab(0x148)];}};_0x35a254[_0x2dd743(0x18c)][_0x2dd743(0x197)](_0x560aec);var _0x562c24=class extends _0x35a254[_0x2dd743(0x160)]{get['CollaborationStatusChanged'](){const _0x1f3463=_0x2dd743;return _0x1f3463(0x17a);}};_0x35a254[_0x2dd743(0x160)]['extend'](_0x562c24);function _0x1d1bb8(_0x2ca686,_0x116160){return function(_0x396941,_0x3065fd){_0x116160(_0x396941,_0x3065fd,_0x2ca686);};}function _0x598a38(_0x16fd5d,_0x384e64,_0x4ddaea,_0x1c54d9){const _0x52d387=_0x2dd743;var _0x3efc6d=arguments[_0x52d387(0x16a)],_0x53e171=_0x3efc6d<0x3?_0x384e64:_0x1c54d9===null?_0x1c54d9=Object[_0x52d387(0x15d)](_0x384e64,_0x4ddaea):_0x1c54d9,_0x48dd96;if(typeof Reflect=='object'&&typeof Reflect['decorate']==_0x52d387(0x188))_0x53e171=Reflect[_0x52d387(0x195)](_0x16fd5d,_0x384e64,_0x4ddaea,_0x1c54d9);else{for(var _0x53f12e=_0x16fd5d['length']-0x1;_0x53f12e>=0x0;_0x53f12e--)(_0x48dd96=_0x16fd5d[_0x53f12e])&&(_0x53e171=(_0x3efc6d<0x3?_0x48dd96(_0x53e171):_0x3efc6d>0x3?_0x48dd96(_0x384e64,_0x4ddaea,_0x53e171):_0x48dd96(_0x384e64,_0x4ddaea))||_0x53e171);}return _0x3efc6d>0x3&&_0x53e171&&Object['defineProperty'](_0x384e64,_0x4ddaea,_0x53e171),_0x53e171;}let _0x36cb72=class extends _0x35a254[_0x2dd743(0x171)]{constructor(_0x2cda6d,_0x56e978,_0x3a99f8,_0xeadb36,_0x3bae3b){const _0x317ae8=_0x2dd743;super(),this['_handler']=_0x2cda6d,this[_0x317ae8(0x13b)]=_0x56e978,this['_univerInstanceService']=_0x3a99f8,this[_0x317ae8(0x17c)]=_0xeadb36,this[_0x317ae8(0x14c)]=_0x3bae3b;}async[_0x2dd743(0x196)](_0x4cd708,_0xed34f3){const _0x488f14=_0x2dd743;return await this[_0x488f14(0x17c)]['loadUnit'](_0x4cd708,_0x43e644[_0x488f14(0x18b)][_0x488f14(0x14a)],void 0x0,_0xed34f3)?(await this[_0x488f14(0x14c)][_0x488f14(0x143)](_0x4cd708),this[_0x488f14(0x181)][_0x488f14(0x14e)](_0x4cd708)):null;}async[_0x2dd743(0x146)](_0x486264,_0x49b879){const _0x11518d=_0x2dd743;return await this[_0x11518d(0x17c)][_0x11518d(0x14b)](_0x486264,_0x43e644['UniverInstanceType'][_0x11518d(0x165)],void 0x0,_0x49b879)?(await this['_collaborationController'][_0x11518d(0x143)](_0x486264),this[_0x11518d(0x181)]['getDocument'](_0x486264)):null;}async[_0x2dd743(0x17e)](_0x2d4afe,_0x1a57ee){const _0x2baec6=_0x2dd743;return await this[_0x2baec6(0x17c)][_0x2baec6(0x14b)](_0x2d4afe,_0x43e644['UniverInstanceType'][_0x2baec6(0x193)],void 0x0,_0x1a57ee)?(await this[_0x2baec6(0x14c)]['readyForCollab'](_0x2d4afe),this[_0x2baec6(0x181)][_0x2baec6(0x192)](_0x2d4afe)):null;}async['loadSlideAsync'](_0x311b63,_0x5372e1){const _0x8de62c=_0x2dd743;return await this[_0x8de62c(0x17c)][_0x8de62c(0x14b)](_0x311b63,_0x43e644[_0x8de62c(0x18b)]['UNIVER_SLIDE'],void 0x0,_0x5372e1)?(await this[_0x8de62c(0x14c)][_0x8de62c(0x143)](_0x311b63),this[_0x8de62c(0x181)][_0x8de62c(0x13a)](_0x311b63)):null;}async[_0x2dd743(0x162)](_0x36af75,_0x2675b9){const _0x1cec0b=_0x2dd743;return await this['_dataLoaderService'][_0x1cec0b(0x14b)](_0x36af75,_0x43e644[_0x1cec0b(0x18b)][_0x1cec0b(0x184)],void 0x0,_0x2675b9)?(await this[_0x1cec0b(0x14c)][_0x1cec0b(0x143)](_0x36af75),this['_handler'][_0x1cec0b(0x16f)](_0x36af75)):null;}async[_0x2dd743(0x177)](_0x19dcde,_0x40a754){const _0x2b4089=_0x2dd743;return await this[_0x2b4089(0x17c)][_0x2b4089(0x14b)](_0x19dcde,_0x43e644[_0x2b4089(0x18b)][_0x2b4089(0x17b)],void 0x0,_0x40a754)?(await this[_0x2b4089(0x14c)]['readyForCollab'](_0x19dcde),this[_0x2b4089(0x181)][_0x2b4089(0x15f)](_0x19dcde)):null;}[_0x2dd743(0x198)](_0x39ad9a,_0x4b278d){const _0x16a217=_0x2dd743;let _0x294ad6=this['_injector'][_0x16a217(0x18a)](_0x23fd0b[_0x16a217(0x149)])[_0x16a217(0x14d)](_0x39ad9a)[_0x16a217(0x173)]((0x0,_0x2aa361[_0x16a217(0x155)])(_0x506b3a=>_0x506b3a[_0x16a217(0x138)]))['subscribe'](_0x4a2c77=>_0x4b278d(Array[_0x16a217(0x190)](_0x4a2c77['values']())));return(0x0,_0x43e644['toDisposable'])(_0x294ad6);}['getCollaborationStatus'](_0x39c8e3){const _0x3e99fe=_0x2dd743;let _0x106b7a=this[_0x3e99fe(0x15e)](_0x39c8e3);if(!_0x106b7a)return _0x23fd0b['CollaborationStatus'][_0x3e99fe(0x13e)];let _0x109d08=this[_0x3e99fe(0x14c)][_0x3e99fe(0x16b)](_0x106b7a);return(_0x109d08==null?void 0x0:_0x109d08[_0x3e99fe(0x175)][_0x3e99fe(0x15b)])??_0x23fd0b[_0x3e99fe(0x148)][_0x3e99fe(0x13e)];}[_0x2dd743(0x152)](_0x50dfdb,_0x4a0220={}){const _0x4ebc1b=_0x2dd743;let _0xf50fe7=this[_0x4ebc1b(0x15e)](_0x50dfdb);if(!_0xf50fe7)return Promise[_0x4ebc1b(0x161)](Error('[FCollaboration]:\x20Cannot\x20flush\x20because\x20no\x20unit\x20is\x20focused\x20or\x20specified.'));let _0x7a4a45=this[_0x4ebc1b(0x14c)][_0x4ebc1b(0x16b)](_0xf50fe7);if(!_0x7a4a45)return Promise[_0x4ebc1b(0x161)](Error(_0x4ebc1b(0x191)+_0xf50fe7+_0x4ebc1b(0x176)));let _0x2a0678=_0x7a4a45[_0x4ebc1b(0x175)][_0x4ebc1b(0x15b)];if(_0x2a0678===_0x23fd0b[_0x4ebc1b(0x148)][_0x4ebc1b(0x18e)])return Promise[_0x4ebc1b(0x189)]();let _0x37d58d=_0x5ec889(_0xf50fe7,_0x2a0678);if(_0x37d58d)return Promise['reject'](_0x37d58d);let _0x25e9ff=_0x4a0220['timeout']??0x7530;return new Promise((_0x18664e,_0x34400d)=>{const _0x518b86=_0x4ebc1b;let _0x117992=!0x1,_0x1a873e=null,_0x152f7b=setTimeout(()=>{const _0x1676f2=_0x3b1b;_0x117992=!0x0,_0x1a873e==null||_0x1a873e[_0x1676f2(0x16c)](),_0x34400d(Error('[FCollaboration]:\x20Timed\x20out\x20flushing\x20unit\x20\x22'+_0xf50fe7+_0x1676f2(0x178)+_0x25e9ff+'ms.'));},_0x25e9ff),_0x1834f3=()=>{const _0x27fef5=_0x3b1b;_0x117992=!0x0,clearTimeout(_0x152f7b),_0x1a873e==null||_0x1a873e[_0x27fef5(0x16c)]();};_0x1a873e=_0x7a4a45[_0x518b86(0x17f)][_0x518b86(0x187)](_0x2e5b6f=>{const _0x5a2066=_0x518b86;if(_0x117992)return;if(_0x2e5b6f===_0x23fd0b[_0x5a2066(0x148)]['SYNCED']){_0x1834f3(),_0x18664e();return;}let _0x12ad62=_0x5ec889(_0xf50fe7,_0x2e5b6f);_0x12ad62&&(_0x1834f3(),_0x34400d(_0x12ad62));});});}[_0x2dd743(0x15e)](_0x15b8f7){const _0x55015c=_0x2dd743;var _0x20bca3;return _0x15b8f7||((_0x20bca3=this[_0x55015c(0x156)][_0x55015c(0x144)]())==null?void 0x0:_0x20bca3['getUnitId']());}};_0x36cb72=_0x598a38([_0x1d1bb8(0x1,(0x0,_0x43e644[_0x2dd743(0x18d)])(_0x43e644[_0x2dd743(0x15a)])),_0x1d1bb8(0x2,_0x43e644[_0x2dd743(0x142)]),_0x1d1bb8(0x3,(0x0,_0x43e644[_0x2dd743(0x18d)])(_0x23fd0b[_0x2dd743(0x164)])),_0x1d1bb8(0x4,(0x0,_0x43e644['Inject'])(_0x23fd0b[_0x2dd743(0x140)]))],_0x36cb72);function _0x5ec889(_0x45b850,_0x12d8de){const _0x4cf263=_0x2dd743;return _0x12d8de===_0x23fd0b['CollaborationStatus'][_0x4cf263(0x141)]||_0x12d8de===_0x23fd0b[_0x4cf263(0x148)]['NOT_COLLAB']?Error(_0x4cf263(0x174)+_0x45b850+_0x4cf263(0x183)+_0x12d8de+'.'):null;}var _0x24a4b5=class extends _0x35a254['FUniver']{['_initialize'](_0x520664){const _0x405076=_0x2dd743;let _0x7fba16=_0x520664['get'](_0x23fd0b[_0x405076(0x140)]);this[_0x405076(0x145)](this[_0x405076(0x13c)](this[_0x405076(0x157)]['CollaborationStatusChanged'],()=>{const _0x4a16a1=_0x405076;let _0x450461=new _0x43e644[(_0x4a16a1(0x179))](),_0x195f42=_0x7fba16[_0x4a16a1(0x147)][_0x4a16a1(0x187)](_0xec8592=>{const _0x3367ed=_0x4a16a1;let _0x59b9e7=_0xec8592['status$'][_0x3367ed(0x187)](_0xe2805b=>{const _0x498c7f=_0x3367ed;let _0x4adf7b={'unitId':_0xec8592[_0x498c7f(0x139)],'status':_0xe2805b};this['fireEvent'](this['Event']['CollaborationStatusChanged'],_0x4adf7b);});_0x450461['add']((0x0,_0x43e644['toDisposable'])(_0x59b9e7));});return _0x450461[_0x4a16a1(0x151)]((0x0,_0x43e644[_0x4a16a1(0x169)])(_0x195f42)),_0x450461;}));}['getCollaboration'](){const _0x2e23f0=_0x2dd743;return this[_0x2e23f0(0x13b)][_0x2e23f0(0x166)](_0x36cb72,{'getWorkbook':_0xad1d66=>this[_0x2e23f0(0x14e)](_0xad1d66),'getDocument':_0x5948a1=>this['getDocument'](_0x5948a1),'getPresentation':_0x315c9a=>this[_0x2e23f0(0x13a)](_0x315c9a),'getBase':_0xa177ff=>this[_0x2e23f0(0x192)](_0xa177ff),'getBoard':_0xc448c2=>this[_0x2e23f0(0x16f)](_0xc448c2),'getPdf':_0x3fbbc2=>this[_0x2e23f0(0x15f)](_0x3fbbc2)});}[_0x2dd743(0x167)](_0x33f262,_0x3ef435,_0x523005){const _0xce3e7a=_0x2dd743;return this[_0xce3e7a(0x13b)][_0xce3e7a(0x18a)](_0x23fd0b['DataLoaderService'])[_0xce3e7a(0x14b)](_0x33f262,_0x3ef435,_0x523005);}[_0x2dd743(0x137)](_0x4a7e0e,_0x5db160,_0x179f21){const _0xbb9c82=_0x2dd743;return this[_0xbb9c82(0x13b)]['get'](_0x23fd0b['DataLoaderService'])[_0xbb9c82(0x182)](_0x4a7e0e,_0x5db160,_0x179f21);}};_0x35a254['FUniver'][_0x2dd743(0x197)](_0x24a4b5),Object[_0x2dd743(0x17d)](_0x1d5524,_0x2dd743(0x180),{'enumerable':!0x0,'get':function(){return _0x36cb72;}});}));
1
+ function _0x1cd3(_0x16583b,_0x2b71db){_0x16583b=_0x16583b-0x65;const _0x1bc693=_0x1bc6();let _0x1cd3c4=_0x1bc693[_0x16583b];return _0x1cd3c4;}(function(_0x4e89f7,_0x16e981){const _0x20bd6f=_0x1cd3,_0x2e6630=_0x4e89f7();while(!![]){try{const _0x477958=parseInt(_0x20bd6f(0x73))/0x1*(parseInt(_0x20bd6f(0xd0))/0x2)+-parseInt(_0x20bd6f(0x8b))/0x3*(parseInt(_0x20bd6f(0x78))/0x4)+-parseInt(_0x20bd6f(0x6f))/0x5+parseInt(_0x20bd6f(0x99))/0x6*(parseInt(_0x20bd6f(0xdf))/0x7)+parseInt(_0x20bd6f(0xba))/0x8*(parseInt(_0x20bd6f(0x79))/0x9)+-parseInt(_0x20bd6f(0xab))/0xa*(-parseInt(_0x20bd6f(0x8d))/0xb)+-parseInt(_0x20bd6f(0xc6))/0xc;if(_0x477958===_0x16e981)break;else _0x2e6630['push'](_0x2e6630['shift']());}catch(_0x498982){_0x2e6630['push'](_0x2e6630['shift']());}}}(_0x1bc6,0x982c0),function(_0x22f909,_0x389c51){const _0x5d88df=_0x1cd3;typeof exports==_0x5d88df(0x67)&&typeof module<'u'?_0x389c51(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs/core/facade'),require('@univerjs/core'),require('rxjs')):typeof define==_0x5d88df(0xa5)&&define[_0x5d88df(0x9a)]?define([_0x5d88df(0x93),_0x5d88df(0xd4),_0x5d88df(0x83),'@univerjs/core',_0x5d88df(0xcf)],_0x389c51):(_0x22f909=typeof globalThis<'u'?globalThis:_0x22f909||self,_0x389c51(_0x22f909['UniverProCollaborationClientFacade']={},_0x22f909[_0x5d88df(0xb8)],_0x22f909[_0x5d88df(0xa6)],_0x22f909['UniverCore'],_0x22f909['rxjs']));}(this,function(_0x5f2bc9,_0x42eff0,_0x2db56a,_0x18b349,_0x4a3183){const _0xbf0c54=_0x1cd3;Object[_0xbf0c54(0x69)](_0x5f2bc9,Symbol[_0xbf0c54(0xda)],{'value':_0xbf0c54(0x6b)});var _0x4c8507=class extends _0x2db56a[_0xbf0c54(0xa3)]{get[_0xbf0c54(0x88)](){const _0x1fbc73=_0xbf0c54;return _0x42eff0[_0x1fbc73(0x88)];}};_0x2db56a[_0xbf0c54(0xa3)]['extend'](_0x4c8507);var _0x47cade=class extends _0x2db56a[_0xbf0c54(0xe0)]{get[_0xbf0c54(0xbe)](){return'CollaborationStatusChanged';}get[_0xbf0c54(0x7a)](){const _0x489fb5=_0xbf0c54;return _0x489fb5(0x7a);}get[_0xbf0c54(0xdb)](){const _0x49a8b8=_0xbf0c54;return _0x49a8b8(0xdb);}};_0x2db56a['FEventName'][_0xbf0c54(0xb2)](_0x47cade);function _0x2c160c(_0x12f4a0,_0x2062df){return function(_0x4a01ce,_0x25bbec){_0x2062df(_0x4a01ce,_0x25bbec,_0x12f4a0);};}function _0x3cb5b7(_0x599f43,_0x37696e,_0x290715,_0xaa97a5){const _0x461421=_0xbf0c54;var _0x2f5340=arguments[_0x461421(0xad)],_0x497a9d=_0x2f5340<0x3?_0x37696e:_0xaa97a5===null?_0xaa97a5=Object[_0x461421(0x77)](_0x37696e,_0x290715):_0xaa97a5,_0x38203a;if(typeof Reflect==_0x461421(0x67)&&typeof Reflect[_0x461421(0xc3)]=='function')_0x497a9d=Reflect['decorate'](_0x599f43,_0x37696e,_0x290715,_0xaa97a5);else{for(var _0x44e7d5=_0x599f43[_0x461421(0xad)]-0x1;_0x44e7d5>=0x0;_0x44e7d5--)(_0x38203a=_0x599f43[_0x44e7d5])&&(_0x497a9d=(_0x2f5340<0x3?_0x38203a(_0x497a9d):_0x2f5340>0x3?_0x38203a(_0x37696e,_0x290715,_0x497a9d):_0x38203a(_0x37696e,_0x290715))||_0x497a9d);}return _0x2f5340>0x3&&_0x497a9d&&Object[_0x461421(0x69)](_0x37696e,_0x290715,_0x497a9d),_0x497a9d;}let _0x50f853=class extends _0x2db56a[_0xbf0c54(0x91)]{constructor(_0x1be74d,_0x446077,_0x5be445,_0x54678f,_0x3a19ea){const _0x389786=_0xbf0c54;super(),this[_0x389786(0xb0)]=_0x1be74d,this[_0x389786(0x7f)]=_0x446077,this[_0x389786(0xac)]=_0x5be445,this[_0x389786(0xdd)]=_0x54678f,this[_0x389786(0xae)]=_0x3a19ea;}async[_0xbf0c54(0x87)](_0x4548be,_0x5a71b5){const _0x1e7d9a=_0xbf0c54;return await this[_0x1e7d9a(0xdd)]['loadUnit'](_0x4548be,_0x18b349[_0x1e7d9a(0xa7)][_0x1e7d9a(0xbb)],void 0x0,_0x5a71b5)?(await this[_0x1e7d9a(0xae)][_0x1e7d9a(0xd5)](_0x4548be),this[_0x1e7d9a(0xb0)][_0x1e7d9a(0x65)](_0x4548be)):null;}async[_0xbf0c54(0x6d)](_0x418fbe,_0x3c4e94){const _0x11a14b=_0xbf0c54;return await this[_0x11a14b(0xdd)][_0x11a14b(0x75)](_0x418fbe,_0x18b349[_0x11a14b(0xa7)][_0x11a14b(0x74)],void 0x0,_0x3c4e94)?(await this[_0x11a14b(0xae)][_0x11a14b(0xd5)](_0x418fbe),this[_0x11a14b(0xb0)]['getDocument'](_0x418fbe)):null;}async['loadBaseAsync'](_0x2fa50f,_0x432baf){const _0x5989ae=_0xbf0c54;return await this[_0x5989ae(0xdd)][_0x5989ae(0x75)](_0x2fa50f,_0x18b349[_0x5989ae(0xa7)][_0x5989ae(0xdc)],void 0x0,_0x432baf)?(await this['_collaborationController'][_0x5989ae(0xd5)](_0x2fa50f),this['_handler']['getBase'](_0x2fa50f)):null;}async['loadSlideAsync'](_0x13ccc2,_0x2215ad){const _0x525567=_0xbf0c54;return await this['_dataLoaderService'][_0x525567(0x75)](_0x13ccc2,_0x18b349[_0x525567(0xa7)][_0x525567(0xc5)],void 0x0,_0x2215ad)?(await this['_collaborationController'][_0x525567(0xd5)](_0x13ccc2),this['_handler'][_0x525567(0xc1)](_0x13ccc2)):null;}async[_0xbf0c54(0xc4)](_0x367ab3,_0x20d1a9){const _0x308b89=_0xbf0c54;return await this['_dataLoaderService'][_0x308b89(0x75)](_0x367ab3,_0x18b349[_0x308b89(0xa7)][_0x308b89(0x96)],void 0x0,_0x20d1a9)?(await this[_0x308b89(0xae)][_0x308b89(0xd5)](_0x367ab3),this[_0x308b89(0xb0)][_0x308b89(0xd8)](_0x367ab3)):null;}async[_0xbf0c54(0x94)](_0x100cb0,_0x3a57cd){const _0x13d134=_0xbf0c54;return await this[_0x13d134(0xdd)][_0x13d134(0x75)](_0x100cb0,_0x18b349[_0x13d134(0xa7)][_0x13d134(0xa0)],void 0x0,_0x3a57cd)?(await this[_0x13d134(0xae)]['readyForCollab'](_0x100cb0),this[_0x13d134(0xb0)]['getPdf'](_0x100cb0)):null;}[_0xbf0c54(0xce)](_0x21851d,_0x256b85){const _0x7b915b=_0xbf0c54;let _0x2e88e2=this[_0x7b915b(0x7f)][_0x7b915b(0xbc)](_0x42eff0[_0x7b915b(0x76)])[_0x7b915b(0xb9)](_0x21851d)['pipe']((0x0,_0x4a3183[_0x7b915b(0x6c)])(_0x50a3bd=>_0x50a3bd[_0x7b915b(0x82)]))['subscribe'](_0x309c00=>_0x256b85(Array[_0x7b915b(0x81)](_0x309c00[_0x7b915b(0xc7)]())));return(0x0,_0x18b349['toDisposable'])(_0x2e88e2);}[_0xbf0c54(0x98)](_0x1276c5){const _0x2363d8=_0xbf0c54;let _0x52ef64=this['_resolveUnitId'](_0x1276c5);if(!_0x52ef64)return _0x42eff0[_0x2363d8(0x88)][_0x2363d8(0x7d)];let _0x672b1d=this[_0x2363d8(0xae)][_0x2363d8(0x68)](_0x52ef64);return(_0x672b1d==null?void 0x0:_0x672b1d[_0x2363d8(0xb3)][_0x2363d8(0xa8)])??_0x42eff0[_0x2363d8(0x88)][_0x2363d8(0x7d)];}[_0xbf0c54(0x90)](_0x1d1219){const _0x1c3044=_0xbf0c54;let _0x52896b=this[_0x1c3044(0x6e)](_0x1d1219);return _0x52896b?this[_0x1c3044(0xae)][_0x1c3044(0x90)](_0x52896b):!0x1;}[_0xbf0c54(0xb4)](_0x148086,_0x53edc8={}){const _0x283abf=_0xbf0c54;let _0x341759=this[_0x283abf(0x6e)](_0x148086);if(!_0x341759)return Promise['reject'](Error('[FCollaboration]:\x20Cannot\x20flush\x20because\x20no\x20unit\x20is\x20focused\x20or\x20specified.'));let _0xa2ff1c=this[_0x283abf(0xae)][_0x283abf(0x68)](_0x341759);if(!_0xa2ff1c)return Promise[_0x283abf(0x66)](Error(_0x283abf(0xbf)+_0x341759+_0x283abf(0x85)));let _0x43bf95=_0xa2ff1c[_0x283abf(0xb3)][_0x283abf(0xa8)];if(_0x43bf95===_0x42eff0['CollaborationStatus'][_0x283abf(0xaa)])return Promise[_0x283abf(0x6a)]();let _0x1cef8e=_0x5acb6a(_0x341759,_0x43bf95);if(_0x1cef8e)return Promise[_0x283abf(0x66)](_0x1cef8e);let _0x2571a7=_0x53edc8[_0x283abf(0x9b)]??0x7530;return new Promise((_0x5caa5c,_0x5ac876)=>{const _0x52aac8=_0x283abf;let _0x2d6aeb=!0x1,_0x9d6ad3=null,_0x35136a=setTimeout(()=>{const _0x2a8065=_0x1cd3;_0x2d6aeb=!0x0,_0x9d6ad3==null||_0x9d6ad3[_0x2a8065(0x70)](),_0x5ac876(Error(_0x2a8065(0xd7)+_0x341759+_0x2a8065(0xa4)+_0x2571a7+_0x2a8065(0xd9)));},_0x2571a7),_0x4825a7=()=>{const _0x53baac=_0x1cd3;_0x2d6aeb=!0x0,clearTimeout(_0x35136a),_0x9d6ad3==null||_0x9d6ad3[_0x53baac(0x70)]();};_0x9d6ad3=_0xa2ff1c[_0x52aac8(0xc2)][_0x52aac8(0x9c)](_0x51c83f=>{const _0x240191=_0x52aac8;if(_0x2d6aeb)return;if(_0x51c83f===_0x42eff0[_0x240191(0x88)][_0x240191(0xaa)]){_0x4825a7(),_0x5caa5c();return;}let _0x488a4a=_0x5acb6a(_0x341759,_0x51c83f);_0x488a4a&&(_0x4825a7(),_0x5ac876(_0x488a4a));});});}['_resolveUnitId'](_0x294c0b){const _0x58d32f=_0xbf0c54;var _0x29bb68;return _0x294c0b||((_0x29bb68=this['_univerInstanceService']['getFocusedUnit']())==null?void 0x0:_0x29bb68[_0x58d32f(0x95)]());}};_0x50f853=_0x3cb5b7([_0x2c160c(0x1,(0x0,_0x18b349[_0xbf0c54(0x8e)])(_0x18b349[_0xbf0c54(0x7b)])),_0x2c160c(0x2,_0x18b349[_0xbf0c54(0xd6)]),_0x2c160c(0x3,(0x0,_0x18b349[_0xbf0c54(0x8e)])(_0x42eff0[_0xbf0c54(0x84)])),_0x2c160c(0x4,(0x0,_0x18b349[_0xbf0c54(0x8e)])(_0x42eff0[_0xbf0c54(0xb5)]))],_0x50f853);function _0x5acb6a(_0x40a592,_0x2b60ba){const _0x3395c4=_0xbf0c54;return _0x2b60ba===_0x42eff0[_0x3395c4(0x88)][_0x3395c4(0x80)]||_0x2b60ba===_0x42eff0['CollaborationStatus']['NOT_COLLAB']?Error(_0x3395c4(0xcd)+_0x40a592+_0x3395c4(0xcc)+_0x2b60ba+'.'):null;}var _0x2951a7=class extends _0x2db56a[_0xbf0c54(0x9f)]{[_0xbf0c54(0xa2)](_0x172df4){const _0x8ba8e4=_0xbf0c54;let _0x29e1fc=_0x172df4[_0x8ba8e4(0xbc)](_0x42eff0[_0x8ba8e4(0xb5)]);this[_0x8ba8e4(0xd1)](this[_0x8ba8e4(0xd2)](this[_0x8ba8e4(0x92)][_0x8ba8e4(0xbe)],()=>{const _0x5f07ed=_0x8ba8e4;let _0x2a82b1=new _0x18b349[(_0x5f07ed(0x8a))](),_0x446831=_0xfe9e90=>{const _0x210b1e=_0x5f07ed;let _0x389563=_0xfe9e90['status$'][_0x210b1e(0xb6)]((0x0,_0x4a3183[_0x210b1e(0x72)])())[_0x210b1e(0x9c)](_0x400e3d=>{const _0x319a7e=_0x210b1e;let _0x407517={'unitId':_0xfe9e90[_0x319a7e(0x86)],'status':_0x400e3d};this[_0x319a7e(0xb7)](this['Event']['CollaborationStatusChanged'],_0x407517);});_0x2a82b1[_0x210b1e(0x8f)]((0x0,_0x18b349[_0x210b1e(0x9e)])(_0x389563));};return _0x29e1fc[_0x5f07ed(0xa9)]()[_0x5f07ed(0xc8)](_0x446831),_0x2a82b1[_0x5f07ed(0x8f)]((0x0,_0x18b349[_0x5f07ed(0x9e)])(_0x29e1fc[_0x5f07ed(0x71)][_0x5f07ed(0x9c)](_0x446831))),_0x2a82b1;})),this[_0x8ba8e4(0xd1)](this[_0x8ba8e4(0xd2)](this[_0x8ba8e4(0x92)]['CollaborationConflict'],()=>{const _0x309c20=_0x8ba8e4;let _0x5d2ab2=new _0x18b349[(_0x309c20(0x8a))](),_0x11451b=_0x1232d0=>{const _0x22a571=_0x309c20;let _0x3c2e74=_0x1232d0[_0x22a571(0xde)]['subscribe'](_0x1ece67=>{const _0x3b9987=_0x22a571;let _0xcf0d31={'unitId':_0x1ece67[_0x3b9987(0x86)],'reason':_0x1ece67[_0x3b9987(0xb1)],'message':_0x1ece67[_0x3b9987(0x89)],'revert':_0x1ece67[_0x3b9987(0x7e)],'localChanges':_0x1ece67[_0x3b9987(0x7c)],'cacheCleared':_0x1ece67[_0x3b9987(0x8c)]};this[_0x3b9987(0xb7)](this['Event'][_0x3b9987(0x7a)],_0xcf0d31);});_0x5d2ab2[_0x22a571(0x8f)]((0x0,_0x18b349[_0x22a571(0x9e)])(_0x3c2e74));};return _0x29e1fc['getCollabEntities']()[_0x309c20(0xc8)](_0x11451b),_0x5d2ab2[_0x309c20(0x8f)]((0x0,_0x18b349[_0x309c20(0x9e)])(_0x29e1fc['entityInit$'][_0x309c20(0x9c)](_0x11451b))),_0x5d2ab2;})),this[_0x8ba8e4(0xd1)](this['registerEventHandler'](this[_0x8ba8e4(0x92)][_0x8ba8e4(0xdb)],()=>{const _0x1c81e0=_0x8ba8e4;let _0x526a33=new _0x18b349[(_0x1c81e0(0x8a))](),_0x41dded=_0x5d4ec4=>{const _0x327270=_0x1c81e0;let _0x143aaa=_0x5d4ec4['changesetResend$'][_0x327270(0x9c)](_0x221acc=>{const _0x4f1018=_0x327270;let _0x196f86={'unitId':_0x221acc['unitID'],'reqId':_0x221acc[_0x4f1018(0xc9)],'reason':_0x221acc[_0x4f1018(0xb1)],'attempt':_0x221acc[_0x4f1018(0xa1)],'elapsedMs':_0x221acc['elapsedMs'],'unsyncedMutationCount':_0x221acc[_0x4f1018(0xca)],'nextDelayMs':_0x221acc['nextDelayMs']};this['fireEvent'](this[_0x4f1018(0x92)][_0x4f1018(0xdb)],_0x196f86);});_0x526a33[_0x327270(0x8f)]((0x0,_0x18b349[_0x327270(0x9e)])(_0x143aaa));};return _0x29e1fc[_0x1c81e0(0xa9)]()[_0x1c81e0(0xc8)](_0x41dded),_0x526a33['add']((0x0,_0x18b349[_0x1c81e0(0x9e)])(_0x29e1fc['entityInit$'][_0x1c81e0(0x9c)](_0x41dded))),_0x526a33;}));}[_0xbf0c54(0xaf)](){const _0x1a6519=_0xbf0c54;return this[_0x1a6519(0x7f)][_0x1a6519(0xcb)](_0x50f853,{'getWorkbook':_0x12db00=>this[_0x1a6519(0x65)](_0x12db00),'getDocument':_0x215e1f=>this[_0x1a6519(0xbd)](_0x215e1f),'getPresentation':_0x2f2c58=>this[_0x1a6519(0xc1)](_0x2f2c58),'getBase':_0x1105ce=>this[_0x1a6519(0xd3)](_0x1105ce),'getBoard':_0x7b3951=>this[_0x1a6519(0xd8)](_0x7b3951),'getPdf':_0x1f63e5=>this[_0x1a6519(0x97)](_0x1f63e5)});}['loadServerUnit'](_0x14964f,_0x36643a,_0x4afa86){const _0x20e976=_0xbf0c54;return this['_injector'][_0x20e976(0xbc)](_0x42eff0[_0x20e976(0x84)])['loadUnit'](_0x14964f,_0x36643a,_0x4afa86);}[_0xbf0c54(0xc0)](_0x1c0013,_0x360a1b,_0x264fdb){const _0x4d337e=_0xbf0c54;return this[_0x4d337e(0x7f)][_0x4d337e(0xbc)](_0x42eff0[_0x4d337e(0x84)])['loadUnitOfRevision'](_0x1c0013,_0x360a1b,_0x264fdb);}};_0x2db56a['FUniver'][_0xbf0c54(0xb2)](_0x2951a7),Object['defineProperty'](_0x5f2bc9,_0xbf0c54(0x9d),{'enumerable':!0x0,'get':function(){return _0x50f853;}});}));function _0x1bc6(){const _0x3b85df=['121122CDbaGd','CollaborationConflict','Injector','localChanges','NOT_COLLAB','revert','_injector','CONFLICT','from','members$','@univerjs/core/facade','DataLoaderService','\x22\x20is\x20not\x20in\x20collaboration\x20mode.','unitID','loadSheetAsync','CollaborationStatus','message','DisposableCollection','1795485BrBjjo','cacheCleared','6280087AOdVlM','Inject','add','hasWritePending','FBase','Event','exports','loadPdfAsync','getUnitId','UNIVER_BOARD','getPdf','getCollaborationStatus','6VEwyOb','amd','timeout','subscribe','FCollaboration','toDisposable','FUniver','UNIVER_PDF','attempt','_initialize','FEnum','\x22\x20after\x20','function','UniverCoreFacade','UniverInstanceType','status','getCollabEntities','SYNCED','20bDKAda','_univerInstanceService','length','_collaborationController','getCollaboration','_handler','reason','extend','state','flush','CollaborationController','pipe','fireEvent','UniverProCollaborationClient','waitForRoom$','688eUwJXi','UNIVER_SHEET','get','getDocument','CollaborationStatusChanged','[FCollaboration]:\x20Unit\x20\x22','loadServerUnitOfRevision','getPresentation','status$','decorate','loadBoardAsync','UNIVER_SLIDE','13422876MRdLhK','values','forEach','reqId','unsyncedMutationCount','createInstance','\x22\x20while\x20collaboration\x20status\x20is\x20','[FCollaboration]:\x20Cannot\x20flush\x20unit\x20\x22','subscribeCollaborators','rxjs','1024pziyCm','disposeWithMe','registerEventHandler','getBase','@univerjs-pro/collaboration-client','readyForCollab','IUniverInstanceService','[FCollaboration]:\x20Timed\x20out\x20flushing\x20unit\x20\x22','getBoard','ms.','toStringTag','CollaborationChangesetResend','UNIVER_BASE','_dataLoaderService','conflict$','5726147tLtEWs','FEventName','getWorkbook','reject','object','getCollabEntity','defineProperty','resolve','Module','switchMap','loadDocAsync','_resolveUnitId','3904875bPnnOL','unsubscribe','entityInit$','distinctUntilChanged','8JOvtgF','UNIVER_DOC','loadUnit','MemberService','getOwnPropertyDescriptor','4sKbVIP'];_0x1bc6=function(){return _0x3b85df;};return _0x1bc6();}