@ckeditor/ckeditor5-real-time-collaboration 36.0.1 → 37.0.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 (48) hide show
  1. package/build/real-time-collaboration.js +1 -1
  2. package/package.json +22 -5
  3. package/src/augmentation.d.ts +57 -0
  4. package/src/augmentation.js +23 -0
  5. package/src/common-translations.d.ts +5 -0
  6. package/src/common-translations.js +1 -1
  7. package/src/config.d.ts +33 -0
  8. package/src/config.js +23 -0
  9. package/src/index.d.ts +9 -0
  10. package/src/index.js +1 -1
  11. package/src/presencelist/presencelistui.d.ts +38 -0
  12. package/src/presencelist/presencelistui.js +1 -1
  13. package/src/presencelist/view/presencecounterview.d.ts +7 -0
  14. package/src/presencelist/view/presencecounterview.js +1 -1
  15. package/src/presencelist/view/presencedropdownlistitemview.d.ts +7 -0
  16. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  17. package/src/presencelist/view/presencedropdownlistview.d.ts +6 -0
  18. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  19. package/src/presencelist/view/presenceinlinelistitemview.d.ts +14 -0
  20. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  21. package/src/presencelist/view/presenceinlinelistview.d.ts +7 -0
  22. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  23. package/src/presencelist/view/presencelistview.d.ts +11 -0
  24. package/src/presencelist/view/presencelistview.js +1 -1
  25. package/src/presencelist.d.ts +22 -0
  26. package/src/presencelist.js +1 -1
  27. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.d.ts +42 -0
  28. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +1 -1
  29. package/src/realtimecollaborativecomments.d.ts +29 -0
  30. package/src/realtimecollaborativecomments.js +1 -1
  31. package/src/realtimecollaborativeediting/realtimecollaborationclient.d.ts +119 -0
  32. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +1 -1
  33. package/src/realtimecollaborativeediting/sessions.d.ts +114 -0
  34. package/src/realtimecollaborativeediting/sessions.js +1 -1
  35. package/src/realtimecollaborativeediting/usermarkers.d.ts +31 -0
  36. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  37. package/src/realtimecollaborativeediting/websocketgateway.d.ts +51 -0
  38. package/src/realtimecollaborativeediting/websocketgateway.js +1 -1
  39. package/src/realtimecollaborativeediting.d.ts +21 -0
  40. package/src/realtimecollaborativeediting.js +1 -1
  41. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.d.ts +38 -0
  42. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +1 -1
  43. package/src/realtimecollaborativerevisionhistory.d.ts +23 -0
  44. package/src/realtimecollaborativerevisionhistory.js +1 -1
  45. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.d.ts +34 -0
  46. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +1 -1
  47. package/src/realtimecollaborativetrackchanges.d.ts +21 -0
  48. package/src/realtimecollaborativetrackchanges.js +1 -1
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var __webpack_modules__={357:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class s extends Error{constructor(e,t,s=null,r={}){super("cloud-services-internal-error: "+e),this.context=t,this.code=s,this.data=r,this.name="CKEditorError"}static fromPublicError(e){return new s(function(e){let t="cloud-services-error: "+e.message;return e.explanation&&(t+="\nExplanation: "+e.explanation),e.action&&(t+="\nAction: "+e.action),e.traceId&&(t+="\nTraceId: "+e.traceId),e.code&&(t+="\nCode: "+e.code),t}(e),e)}}t.default=s},8801:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class s extends Error{constructor(e,t){super(),this.name="CKEditorCloudServicesServerError",this.stack=void 0,this.message=e,this.code=t.code,this.traceId=t.traceId,this.data=t.data}static fromPublicError(e){return new s(function(e){let t="cloud-services-server-error: "+e.message;return e.explanation&&(t+="\nExplanation: "+e.explanation),e.action&&(t+="\nAction: "+e.action),e.traceId&&(t+="\nTraceId: "+e.traceId),e.code&&(t+="\nCode: "+e.code),t}(e),e)}}t.default=s},7622:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const n=s(5003),i=s(2209),o=r(s(3596)),a=r(s(7026)),c=r(s(7839)),u=r(s(5132)),d=r(s(4148)),l=r(s(223)),h=r(s(2968)),f=r(s(7158)),p=r(s(357)),y=r(s(6314)),m=r(s(6148)),v=r(s(961));t._SERVICE=1;class g{constructor(e,t){if(!e)throw new TypeError('Param "bundleVersion" must be provided.');this._id=null!=t?t:(0,n.v4)(),this._isConnected=!1,this._bundleVersion=e}getId(){return this._id}isConnected(){return this._isConnected}connect(e,t={buffers:[],types:[]},s){const r=new c.default(this.getId(),t.buffers,t.types,this._bundleVersion,s);return this._connect(e,r)}reconnect(e,t){if(this.isConnected())throw new p.default("Cannot reconnect to already connected service.",e);return this._connect(e,new d.default(this.getId(),t,this._bundleVersion))}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._connectedSessions&&(this._connectedSessions.disconnect(),this._connectedSessions=void 0),this.fire("disconnected"),this.stopListening())}async getDocumentDetails(){const e=new v.default(this.getId());if(!this._wsGateway)throw new y.default("Collaborative Editing",this);const s=await this._wsGateway._sendRequest(t._SERVICE,v.default.TYPE,o.default.encode(e));return o.default.decode(s,m.default)}async sendOperations(e,s,r){if(!e||!e.types||!e.types.length)throw new p.default("Cannot send empty update.",this._wsGateway);const n="number"==typeof s?s:parseInt(s);if(!Number.isInteger(n)||n<0)throw new p.default("Base version not provided.",this._wsGateway);const i=new u.default(this.getId(),e.buffers,e.types,n,[],r);if(!this._wsGateway||!this._isConnected)throw new y.default("Collaborative Editing",this);const a=await this._wsGateway._sendRequest(t._SERVICE,u.default.TYPE,o.default.encode(i));return o.default.decode(a,l.default)}async getConnectedSessions(){if(!this._isConnected)throw new y.default("Collaborative Editing",this);return this._connectedSessions||(this._connectedSessions=await a.default.getConnectedSessions(this._wsGateway,this._id,t._SERVICE)),this._connectedSessions}static getConnectedSessions(e,s){return a.default.getConnectedSessions(e,s,t._SERVICE)}async _connect(e,s){if(this.isConnected())return;if(e.state!==f.default.STATE_CONNECTED)throw new p.default("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const r=await e._sendRequest(t._SERVICE,s.constructor.TYPE,o.default.encode(s)),n=o.default.decode(r,h.default);return this.listenTo(e,"change:state",((e,t,s)=>this._onWsGatewayStateChange(s)),{priority:f.default._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,n.channel),this._isConnected=!0,this.fire("connected"),n}_connectToChannel(e,s){this._channel=e._getChannel(t._SERVICE,s),this.listenTo(this._channel,this._channel.getEventName(u.default.TYPE),((e,t)=>{const s=o.default.decode(t,u.default);this.fire("operationsReceived",s.baseVersion,s.data,s.metadata)}))}_onWsGatewayStateChange(e){e===f.default.STATE_DISCONNECTED&&this.disconnect()}}g._SERVICE=t._SERVICE,(0,i.mix)(g,i.EmitterMixin),t.default=g},8677:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(5945));class i extends n.default{static toJSON({createdAt:e,...t}){const s={...t};return(null==e?void 0:e.toISOString)&&(s.createdAt=e.toISOString()),s}static fromJSON({createdAt:e,...t}){const s={...t};return e&&(s.createdAt=new Date(e)),s}}t.default=i,i.DESCRIPTOR_NAME="OperationMetadataDescriptor",i.DESCRIPTOR={fields:{userId:{type:"string",id:1},type:{type:"string",id:2},createdAt:{type:"string",id:3}}}},6685:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{static prepareMetadataForOperations(e,t){if(!(e&&e.length&&t&&t.length))return[];const s=[];let r=0;for(const n of e)if(0!==n){if(!t[r])throw new Error("Missing metadata for a operation");s.push(t[r]),r++}else s.push(s[s.length-1]);return s}static removeUnnecessaryMetadata(e,t){if(!(e&&e.length&&t&&t.length))return[];const s=[];for(let r=0;r<e.length;r++)if(0!==e[r]){if(!t[r])throw new Error("Missing metadata for a operation");s.push(t[r])}return s}}},7839:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t,s,r,n=""){super(),this.id=e,this.buffers=t,this.types=s,this.bundleVersion=r,this.lastOperationId=n}toJSON(){return{id:this.id,buffers:this.buffers,types:this.types,bundleVersion:this.bundleVersion,lastOperationId:this.lastOperationId}}static fromJSON(e){return new i(e.id,e.buffers,e.types,e.bundleVersion,e.lastOperationId)}}t.default=i,i.TYPE="11",i.READABLE_TYPE_NAME="connectToDocument",i.DESCRIPTOR_NAME="CollaborativeEditingConnectMessage",i.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},buffers:{rule:"repeated",type:"bytes",id:3},types:{rule:"repeated",type:"uint32",id:4},lastOperationId:{type:"string",id:5}}}},4148:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t,s){super(),this.id=e,this.lastKnowVersion=t,this.bundleVersion=s}toJSON(){return{id:this.id,bundleVersion:this.bundleVersion,lastKnowVersion:this.lastKnowVersion}}static fromJSON(e){return new i(e.id,e.lastKnowVersion,e.bundleVersion)}}t.default=i,i.TYPE="12",i.READABLE_TYPE_NAME="reconnectToDocument",i.DESCRIPTOR_NAME="CollaborativeEditingReconnectMessage",i.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},lastKnowVersion:{type:"uint32",id:3}}}},5132:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545)),i=r(s(6685)),o=r(s(8677));class a extends n.default{constructor(e,t,s,r,n=[],i=""){super(),this.id=e,this.buffers=t,this.types=s,this.baseVersion=r,this.metadata=n,this.lastOperationId=i}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.baseVersion,lastOperationId:this.lastOperationId}}toJSON(){return{id:this.id,buffers:this.buffers,types:this.types,baseVersion:this.baseVersion,metadata:i.default.removeUnnecessaryMetadata(this.types,this.metadata).map(o.default.toJSON),lastOperationId:this.lastOperationId}}static fromJSON(e){return new a(e.id,e.buffers,e.types,e.baseVersion,i.default.prepareMetadataForOperations(e.types,e.metadata).map(o.default.fromJSON),e.lastOperationId)}}t.default=a,a.TYPE="13",a.READABLE_TYPE_NAME="updateDocument",a.DESCRIPTOR_NAME="CollaborativeEditingUpdateMessage",a.DESCRIPTOR={fields:{id:{type:"string",id:1},baseVersion:{type:"uint32",id:2},buffers:{rule:"repeated",type:"bytes",id:3},types:{rule:"repeated",type:"uint32",id:4},metadata:{rule:"repeated",type:"OperationMetadataDescriptor",id:6},lastOperationId:{type:"string",id:7}}}},961:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e){super(),this.documentId=e}get data(){return{documentId:this.documentId}}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new i(e.documentId)}}t.default=i,i.TYPE="14",i.READABLE_TYPE_NAME="getDocumentDetails",i.DESCRIPTOR_NAME="GetDocumentDetailsMessage",i.DESCRIPTOR={fields:{documentId:{type:"string",id:1},environmentId:{type:"string",id:2}}}},2968:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545)),i=r(s(6685)),o=r(s(8677));class a extends n.default{constructor(e,t,s=[],r=[],n=0,i=[],o=null,a="",c="",u=null){super(),this.channel=e,this.version=t,this.buffers=s,this.types=r,this.offset=n,this.metadata=i,this.initData=o,this.sessionId=a,this.lastOperationId=c,this.sessionCreatedAt=u}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt}}get wereChangesApplied(){var e;return!(null===(e=this.types)||void 0===e?void 0:e.length)&&null===this.initData}toJSON(){var e;return{channel:this.channel,version:this.version,sessionId:this.sessionId,buffers:this.buffers,types:this.types,offset:this.offset,metadata:i.default.removeUnnecessaryMetadata(this.types,this.metadata).map(o.default.toJSON),initData:null!==(e=this.initData)&&void 0!==e?e:"",isInitialized:"string"==typeof this.initData,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt?this.sessionCreatedAt.toISOString():null}}static create(e){return new a(e.channel,e.version,e.buffers,e.types,e.offset,e.metadata,e.initData,e.sessionId,e.lastOperationId,e.sessionCreatedAt)}static fromJSON(e){var t;let s=null;return!0===e.isInitialized?s=null!==(t=e.initData)&&void 0!==t?t:"":"boolean"!=typeof e.isInitialized&&e.initData&&(s=e.initData),a.create({channel:e.channel,version:e.version,buffers:e.buffers,types:e.types,offset:e.offset,metadata:i.default.prepareMetadataForOperations(e.types,e.metadata).map(o.default.fromJSON),initData:s,sessionId:e.sessionId,lastOperationId:e.lastOperationId,sessionCreatedAt:e.sessionCreatedAt?new Date(e.sessionCreatedAt):null})}}t.default=a,a.DESCRIPTOR_NAME="CollaborativeEditingConnectResponse",a.DESCRIPTOR={fields:{channel:{type:"string",id:1},offset:{type:"uint32",id:2},version:{type:"uint32",id:3},buffers:{rule:"repeated",type:"bytes",id:4},types:{rule:"repeated",type:"uint32",id:5},metadata:{rule:"repeated",type:o.default.DESCRIPTOR_NAME,id:7},initData:{type:"string",id:8},isInitialized:{type:"bool",id:9},sessionId:{type:"string",id:10},lastOperationId:{type:"string",id:11},sessionCreatedAt:{type:"string",id:12}}}},223:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545)),i=r(s(6685)),o=r(s(8677));class a extends n.default{constructor(e,t=[],s=[],r=[],n="",i=null){super(),this.version=e,this.buffers=t,this.types=s,this.metadata=r,this.lastOperationId=n,this.lastOperationAcceptedAt=i}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt}}get wereChangesApplied(){var e;return!(null===(e=this.types)||void 0===e?void 0:e.length)}toJSON(){return{version:this.version,buffers:this.buffers,types:this.types,metadata:i.default.removeUnnecessaryMetadata(this.types,this.metadata).map(o.default.toJSON),lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt instanceof Date?this.lastOperationAcceptedAt.toISOString():this.lastOperationAcceptedAt}}static fromJSON(e){return new a(e.version,e.buffers,e.types,i.default.prepareMetadataForOperations(e.types,e.metadata).map(o.default.fromJSON),e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}static create(e){return new a(e.version,e.buffers,e.types,e.metadata,e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}}t.default=a,a.DESCRIPTOR_NAME="CollaborativeEditingResponse",a.DESCRIPTOR={fields:{version:{type:"uint32",id:1},buffers:{rule:"repeated",type:"bytes",id:2},types:{rule:"repeated",type:"uint32",id:3},metadata:{rule:"repeated",type:"OperationMetadataDescriptor",id:5},lastOperationId:{type:"string",id:6},lastOperationAcceptedAt:{type:"string",id:7}}}},6148:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t){super(),this.lastDocumentSession=e,this.currentDocumentSession=t}get data(){var e,t,s,r,n;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.lastOperationId}}toJSON(){var e,t,s,r,n;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.lastOperationId}}static fromJSON(e){const t=e.lastDocumentSessionId?{id:e.lastDocumentSessionId,lastOperationId:e.lastDocumentSessionOperationId}:void 0,s=e.currentDocumentSessionId?{lastOperationId:e.currentDocumentSessionOperationId,version:e.currentDocumentSessionVersion,id:e.currentDocumentSessionId}:void 0;return new i(t,s)}}t.default=i,i.DESCRIPTOR_NAME="GetDocumentDetailsResponse",i.DESCRIPTOR={fields:{lastDocumentSessionId:{type:"string",id:1},lastDocumentSessionOperationId:{type:"string",id:2},currentDocumentSessionId:{type:"string",id:3},currentDocumentSessionVersion:{type:"uint32",id:4},currentDocumentSessionOperationId:{type:"string",id:5}}}},6042:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const a=s(2209),c=o(s(3596)),u=o(s(5420)),d=o(s(2280)),l=o(s(6376)),h=o(s(7608)),f=o(s(6178)),p=o(s(5711)),y=o(s(7955)),m=o(s(939)),v=o(s(6523)),g=o(s(1926)),x=o(s(7952)),_=i(s(7158)),b=o(s(357)),w=o(s(7026)),O=o(s(6314)),E=o(s(8801)),S=o(s(5373)),T=o(s(7073)),k=o(s(3118)),A=o(s(8742)),C=o(s(4396));t._SERVICE=9;class I{constructor(e){this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==_.WEB_SOCKET_GATEWAY_STATES.CONNECTED)throw new b.default("WebSocket Gateway is not connected.",e);const s=new l.default(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const r=await e._sendRequest(t._SERVICE,l.default.TYPE,c.default.encode(s)),{channel:n,threads:i}=c.default.decode(r,h.default);return this.listenTo(e,"change:state",((e,t,s)=>this._onWsGatewayStateChange(s)),{priority:_.default._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,n),this._isConnected=!0,this.fire("connected"),i}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._connectedSessions&&(this._connectedSessions.disconnect(),this._connectedSessions=void 0),this.fire("disconnected"),this.stopListening())}async addComment(e,t,s,r){const n=new u.default(this._documentId,e,s,t,void 0,void 0,r),i=await this._sendRequest(u.default.TYPE,n);return c.default.decode(i,d.default)}async updateComment(e,t,s,r){const n=void 0!==r,i=new y.default(this._documentId,e,t,s,r,n);await this._sendRequest(y.default.TYPE,i)}async removeComment(e,t){const s=new f.default(this._documentId,e,t);await this._sendRequest(f.default.TYPE,s)}async removeCommentThread(e){const t=new p.default(this._documentId,e);await this._sendRequest(p.default.TYPE,t)}async addCommentThread(e){const t=new T.default(this._documentId,e.commentThreadId,e.comments.map((t=>({...t,documentId:this._documentId,commentThreadId:e.commentThreadId}))),e.context,e.resolvedBy,e.createdAt,e.resolvedAt,e.deletedAt,e.attributes),s=await this._sendRequest(T.default.TYPE,t);return c.default.decode(s,S.default)}async resolveCommentThread(e){const t=new k.default(e,this._documentId);await this._sendRequest(k.default.TYPE,t)}async reopenCommentThread(e){const t=new A.default(e,this._documentId);await this._sendRequest(A.default.TYPE,t)}async updatedCommentThread(e){const t=new C.default(e.commentThreadId,this._documentId,e.context,e.attributes);await this._sendRequest(C.default.TYPE,t)}async getCommentThread(e,t=1){const s=new m.default(e,this._documentId);try{const e=await this._sendRequest(m.default.TYPE,s),{comments:t,commentThreadId:r}=c.default.decode(e,v.default);return{comments:t,commentThreadId:r}}catch(s){if("CKEditorCloudServicesServerError"===s.name&&"404"===s.code&&t<5)return await(r=100*t,new Promise((e=>{setTimeout(e,r)}))),this.getCommentThread(e,t+1);if("CKEditorCloudServicesServerError"===s.name)throw s;throw E.default.fromPublicError(s)}var r}async getDocumentThreads(){const e=new g.default(this._documentId),t=await this._sendRequest(g.default.TYPE,e),{threads:s}=c.default.decode(t,x.default);return{threads:s}}async getConnectedSessions(){if(!this._isConnected)throw new O.default("Comments",this);return this._connectedSessions||(this._connectedSessions=await w.default.getConnectedSessions(this._wsGateway,this._documentId,t._SERVICE)),this._connectedSessions}_connectToChannel(e,t){this._channel=e._getChannel(I._SERVICE,t),this._channel&&(this.listenTo(this._channel,this._channel.getEventName(u.default.TYPE),((e,t)=>{const s=c.default.decode(t,u.default);this.fire("commentAdded",s)})),this.listenTo(this._channel,this._channel.getEventName(f.default.TYPE),((e,t)=>{const s=c.default.decode(t,f.default);this.fire("commentRemoved",s)})),this.listenTo(this._channel,this._channel.getEventName(y.default.TYPE),((e,t)=>{const s=c.default.decode(t,y.default);this.fire("commentUpdated",s)})),this.listenTo(this._channel,this._channel.getEventName(p.default.TYPE),((e,t)=>{const s=c.default.decode(t,p.default);this.fire("commentThreadRemoved",s)})))}_onWsGatewayStateChange(e){e===_.WEB_SOCKET_GATEWAY_STATES.DISCONNECTED&&this.disconnect()}_sendRequest(e,s){if(!this._wsGateway||!this._isConnected)throw new O.default("Comments",this);return this._wsGateway._sendRequest(t._SERVICE,e,c.default.encode(s))}}I._SERVICE=t._SERVICE,(0,a.mix)(I,a.EmitterMixin),t.default=I},2529:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(5945));class i extends n.default{static toJSON(e){var t;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null}}static fromJSON(e){return{...e,createdAt:new Date(e.createdAt),attributes:e.attributes?JSON.parse(e.attributes):null}}}t.default=i,i.DESCRIPTOR_NAME="CommentDescriptor",i.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},commentThreadId:{id:2,type:"string"},userId:{id:3,type:"string"},content:{id:4,type:"string"},documentId:{id:5,type:"string"},createdAt:{id:6,type:"string"},attributes:{id:7,type:"string"}}}},1578:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(5945)),i=r(s(2529));class o extends n.default{static toJSON(e){var t,s,r,n;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),deletedAt:null===(s=e.deletedAt)||void 0===s?void 0:s.toISOString(),resolvedAt:null===(r=e.resolvedAt)||void 0===r?void 0:r.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null,comments:null===(n=e.comments)||void 0===n?void 0:n.map(i.default.toJSON)}}static fromJSON(e){var t;return{...e,createdAt:e.createdAt?new Date(e.createdAt):void 0,deletedAt:e.deletedAt?new Date(e.deletedAt):void 0,resolvedAt:e.resolvedAt?new Date(e.resolvedAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):null,comments:null===(t=e.comments)||void 0===t?void 0:t.map(i.default.fromJSON)}}}t.default=o,o.DESCRIPTOR_NAME="CommentsThreadDescriptor",o.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},comments:{type:"CommentDescriptor",rule:"repeated",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4},context:{type:"string",id:5},createdAt:{type:"string",id:6},deletedAt:{type:"string",id:7},attributes:{type:"string",id:8}}}},5420:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545)),i=r(s(1578));class o extends n.default{constructor(e,t,s,r="",n,i="",o=null,a){super(),this.documentId=e,this.commentThreadId=t,this.content=s,this.commentId=r,this.userId=i,this.attributes=o,this.commentThread=a,this.createdAt=n?new Date(n):""}toJSON(){return{commentThreadId:this.commentThreadId,content:this.content,documentId:this.documentId,commentId:this.commentId,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,userId:this.userId,attributes:JSON.stringify(this.attributes),commentThread:this.commentThread?i.default.toJSON(this.commentThread):void 0}}static fromJSON(e){return new o(e.documentId,e.commentThreadId,e.content,e.commentId?e.commentId:void 0,e.createdAt?new Date(e.createdAt):void 0,e.userId?e.userId:void 0,e.attributes?JSON.parse(e.attributes):{},e.commentThread?i.default.fromJSON(e.commentThread):void 0)}}t.default=o,o.TYPE="91",o.READABLE_TYPE_NAME="addComment",o.DESCRIPTOR_NAME="CommentsV2AddCommentMessage",o.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},content:{type:"string",id:2},documentId:{type:"string",id:3},commentId:{type:"string",id:4},createdAt:{type:"string",id:5},userId:{type:"string",id:6},attributes:{type:"string",id:7},commentThread:{type:"CommentsThreadDescriptor",id:8}}}},7073:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545)),i=r(s(2529));class o extends n.default{constructor(e,t,s=[],r="",n=null,i=null,o=null,a=null,c=null){super(),this.documentId=e,this.commentThreadId=t,this.comments=s,this.context=r,this.resolvedBy=n,this.attributes=c,this.createdAt=i?new Date(i):"",this.resolvedAt=o?new Date(o):"",this.deletedAt=a?new Date(a):""}toJSON(){return{commentThreadId:this.commentThreadId,context:this.context,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt instanceof Date?this.resolvedAt.toISOString():this.resolvedAt,deletedAt:this.deletedAt instanceof Date?this.deletedAt.toISOString():this.deletedAt,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,attributes:JSON.stringify(this.attributes),comments:this.comments.map((e=>i.default.toJSON(e)))}}static fromJSON(e){return new o(e.documentId,e.commentThreadId,e.comments.map((t=>i.default.fromJSON({...t,documentId:e.documentId,commentThreadId:e.commentThreadId}))),e.context,e.resolvedBy,e.createdAt?new Date(e.createdAt):void 0,e.resolvedAt?new Date(e.resolvedAt):void 0,e.deletedAt?new Date(e.deletedAt):void 0,e.attributes?JSON.parse(e.attributes):{})}}t.default=o,o.TYPE="140",o.READABLE_TYPE_NAME="addCommentThread",o.DESCRIPTOR_NAME="CommentsV2AddCommentThreadMessage",o.DESCRIPTOR={fields:{documentId:{type:"string",id:1},commentThreadId:{type:"string",id:2},context:{type:"string",id:3},createdAt:{type:"string",id:4},resolvedAt:{type:"string",id:5},resolvedBy:{type:"string",id:6},attributes:{type:"string",id:7},deletedAt:{type:"string",id:8},comments:{type:"CommentDescriptor",rule:"repeated",id:9}}}},8742:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new i(e.commentThreadId,e.documentId)}}t.default=i,i.TYPE="141",i.READABLE_TYPE_NAME="reopenCommentThread",i.DESCRIPTOR_NAME="CommentsV2ReopenCommentThreadMessage",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}}},3118:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new i(e.commentThreadId,e.documentId)}}t.default=i,i.TYPE="142",i.READABLE_TYPE_NAME="resolveCommentThread",i.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadMessage",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}}},4396:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t,s,r=null){super(),this.commentThreadId=e,this.documentId=t,this.context=s,this.attributes=r}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,context:this.context,attributes:this.attributes?JSON.stringify(this.attributes):null}}static fromJSON(e){return new i(e.commentThreadId,e.documentId,e.context,e.attributes?JSON.parse(e.attributes):null)}}t.default=i,i.TYPE="143",i.READABLE_TYPE_NAME="updateCommentThread",i.DESCRIPTOR_NAME="CommentsV2UpdateCommentThreadMessage",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},context:{type:"string",id:3},attributes:{type:"string",id:4}}}},6376:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new i(e.documentId)}}t.default=i,i.TYPE="92",i.READABLE_TYPE_NAME="connectToComment",i.DESCRIPTOR_NAME="CommentsV2ConnectMessage",i.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},939:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId}}static fromJSON(e){return new i(e.commentThreadId,e.documentId)}}t.default=i,i.TYPE="93",i.READABLE_TYPE_NAME="getComment",i.DESCRIPTOR_NAME="CommentsV2GetCommentThreadMessage",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}}},1926:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new i(e.documentId)}}t.default=i,i.TYPE="94",i.READABLE_TYPE_NAME="getDocumentThreads",i.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsMessage",i.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},6178:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t,s){super(),this.documentId=e,this.commentThreadId=t,this.commentId=s}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,commentId:this.commentId}}static fromJSON(e){return new i(e.documentId,e.commentThreadId,e.commentId)}}t.default=i,i.TYPE="95",i.READABLE_TYPE_NAME="removeComment",i.DESCRIPTOR_NAME="CommentsV2RemoveCommentMessage",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},documentId:{type:"string",id:3}}}},5711:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t){super(),this.documentId=e,this.commentThreadId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new i(e.documentId,e.commentThreadId)}}t.default=i,i.TYPE="97",i.READABLE_TYPE_NAME="removeCommentThread",i.DESCRIPTOR_NAME="CommentsV2RemoveCommentThreadMessage",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}}},7955:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545)),i=r(s(1578));class o extends n.default{constructor(e,t,s,r,n=null,i=!1,o){super(),this.documentId=e,this.commentThreadId=t,this.commentId=s,this.content=r,this.attributes=n,this.isAttributesUpdated=i,this.commentThread=o}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,commentId:this.commentId,content:this.content,attributes:this.attributes?JSON.stringify(this.attributes):null,isAttributesUpdated:this.isAttributesUpdated,commentThread:this.commentThread?i.default.toJSON(this.commentThread):void 0}}static fromJSON(e){return new o(e.documentId,e.commentThreadId,e.commentId,e.content,e.attributes?JSON.parse(e.attributes):null,e.isAttributesUpdated,e.commentThread?i.default.fromJSON(e.commentThread):void 0)}}t.default=o,o.TYPE="96",o.READABLE_TYPE_NAME="updateComment",o.DESCRIPTOR_NAME="CommentsV2UpdateCommentMessage",o.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},content:{type:"string",id:3},documentId:{type:"string",id:4},attributes:{type:"string",id:5},isAttributesUpdated:{type:"bool",id:6},commentThread:{type:"CommentsThreadDescriptor",id:7}}}},2280:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t,s){super(),this.commentThreadId=e,this.commentId=t,this.createdAt=new Date(s)}toJSON(){return{commentThreadId:this.commentThreadId,commentId:this.commentId,createdAt:this.createdAt.toISOString()}}static fromJSON(e){return new i(e.commentThreadId,e.commentId,e.createdAt)}}t.default=i,i.DESCRIPTOR_NAME="CommentsV2AddCommentResponse",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},createdAt:{type:"string",id:3}}}},5373:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t){super(),this.commentThreadId=e,this.createdAt=new Date(t)}toJSON(){return{commentThreadId:this.commentThreadId,createdAt:this.createdAt.toISOString()}}static fromJSON(e){return new i(e.commentThreadId,e.createdAt)}}t.default=i,i.DESCRIPTOR_NAME="CommentsV2AddCommentThreadResponse",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},createdAt:{type:"string",id:2}}}},7608:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545)),i=r(s(1578));class o extends n.default{constructor(e,t,s){super(),this.channel=e,this._threads=t,this._threadsV2=s,this.threads=(null==s?void 0:s.length)?s:t}toJSON(){var e,t;return{channel:this.channel,threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(i.default.toJSON)}}static fromJSON(e){var t,s;return new o(e.channel,null===(t=e.threads)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(s=e.threadsV2)||void 0===s?void 0:s.map(i.default.fromJSON))}}t.default=o,o.DESCRIPTOR_NAME="CommentsV2ConnectResponse",o.DESCRIPTOR={fields:{channel:{type:"string",id:1},threads:{type:"string",rule:"repeated",id:2},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:3}}}},6523:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545)),i=r(s(2529));class o extends n.default{constructor(e,t,s,r,n,i,o,a,c){super(),this.commentThreadId=e,this._comments=t,this._commentsV2=s,this.attributes=r,this.resolvedBy=n,this.context=i,this.comments=(null==s?void 0:s.length)?s:t,this.createdAt=o?new Date(o):void 0,this.deletedAt="string"==typeof a?new Date(a):a,this.resolvedAt="string"==typeof c?new Date(c):c}toJSON(){var e,t,s,r,n;return{commentThreadId:this.commentThreadId,comments:null===(e=this._comments)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),commentsV2:null===(t=this._commentsV2)||void 0===t?void 0:t.map(i.default.toJSON),attributes:this.attributes,resolvedBy:this.resolvedBy,context:this.context,createdAt:null===(s=this.createdAt)||void 0===s?void 0:s.toISOString(),deletedAt:null===(r=this.deletedAt)||void 0===r?void 0:r.toISOString(),resolvedAt:null===(n=this.resolvedAt)||void 0===n?void 0:n.toISOString()}}static fromJSON(e){var t,s;return new o(e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((e=>function(e){const t=JSON.parse(e);return{...t,createdAt:new Date(t.createdAt)}}(e))),null===(s=e.commentsV2)||void 0===s?void 0:s.map(i.default.fromJSON),e.attributes,e.resolvedBy,e.context,e.createdAt,e.deletedAt,e.resolvedAt)}}t.default=o,o.DESCRIPTOR_NAME="CommentsV2GetCommentThreadResponse",o.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},comments:{type:"string",rule:"repeated",id:2},commentsV2:{type:"CommentDescriptor",rule:"repeated",id:3},resolvedAt:{type:"string",id:4},resolvedBy:{type:"string",id:5},context:{type:"string",id:6},createdAt:{type:"string",id:7},deletedAt:{type:"string",id:8},attributes:{type:"string",id:9}}}},7952:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545)),i=r(s(1578));class o extends n.default{constructor(e,t){super(),this._threads=e,this._threadsV2=t,this.threads=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(i.default.toJSON)}}static fromJSON(e){var t,s;return new o(null===(t=e.threads)||void 0===t?void 0:t.map((e=>function(e){var t;const s=JSON.parse(e),r={...s};return s.comments&&(r.comments=null===(t=s.comments)||void 0===t?void 0:t.map((e=>({...e,createdAt:new Date(e.createdAt)})))),r}(e))),null===(s=e.threadsV2)||void 0===s?void 0:s.map(i.default.fromJSON))}}t.default=o,o.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsResponse",o.DESCRIPTOR={fields:{threads:{type:"string",rule:"repeated",id:1},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:2}}}},5945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(...e){}}},6345:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(5945));class i extends n.default{}t.default=i,i.DESCRIPTOR_NAME="KeyValueDescriptor",i.DESCRIPTOR={fields:{key:{type:"string",id:1},value:{type:"string",id:2}}}},8689:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const n=s(2209),i=r(s(3596)),o=s(7158),a=r(s(6052)),c=r(s(4910)),u=r(s(357));t._SERVICE=13;class d{static async isBundleUploaded(e,t){const s=new a.default(t);if(e.state!==o.WEB_SOCKET_GATEWAY_STATES.CONNECTED)throw new u.default("WebSocket Gateway is not connected.",e);const r=await e._sendRequest(d._SERVICE,a.default.TYPE,i.default.encode(s));return i.default.decode(r,c.default).isUploaded}}d._SERVICE=t._SERVICE,(0,n.mix)(d,n.EmitterMixin),t.default=d},6052:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e){super(),this.bundleVersion=e}toJSON(){return{bundleVersion:this.bundleVersion}}static fromJSON(e){return new i(e.bundleVersion)}}t.default=i,i.TYPE="131",i.READABLE_TYPE_NAME="isEditorBundleUploaded",i.DESCRIPTOR_NAME="IsEditorBundleUploadedMessage",i.DESCRIPTOR={fields:{bundleVersion:{type:"string",id:1}}}},4910:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e){super(),this.isUploaded=e}toJSON(){return{isUploaded:this.isUploaded}}static fromJSON(e){return new i(e.isUploaded)}}t.default=i,i.DESCRIPTOR_NAME="IsEditorBundleUploadedResponse",i.DESCRIPTOR={fields:{isUploaded:{type:"bool",id:1}}}},6314:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(357));class i extends n.default{constructor(e,t){super(e+" Service is not connected.",t)}}t.default=i},3545:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(5945));class i extends n.default{constructor(...e){super()}static fromJSON(e){throw new TypeError("Must be implemented in a child class!")}}t.default=i,i.TYPE="1000"},3596:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(s(6154)),c=o(s(6783)),u=o(s(8677)),d=o(s(6345)),l=o(s(7618)),h=o(s(2529)),f=o(s(1578)),p=o(s(1706)),y=o(s(9883)),m=[d.default,c.default,u.default,l.default,h.default,f.default,p.default,y.default],v=a.Root.fromJSON({nested:m.reduce(((e,t)=>(e[t.DESCRIPTOR_NAME]=t.DESCRIPTOR,e)),{})});function g(e){return t=e,v.lookup(t.DESCRIPTOR_NAME)||v.addJSON({[t.DESCRIPTOR_NAME]:t.DESCRIPTOR}),v.lookupType(e.DESCRIPTOR_NAME);var t}t.default=class{static decode(e,t){const s=g(t).decode("undefined"==typeof window?e:new Uint8Array(e));return t.fromJSON({...s})}static encode(e){const t=g(e.constructor),s=e.toJSON(),r=t.verify(s);if(r)throw Error(r);return t.encode(t.create(s)).finish()}}},9883:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(5945));class i extends n.default{static create(e){return{revisionId:e.id,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.stringify(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds}}static toJSON(e){var t;return{revisionId:e.revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.stringify(e.authorsIds):void 0,diffData:e.diffData,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static fromJSON(e){return{revisionId:(e={...e}).revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.parse(e.authorsIds):void 0,diffData:e.diffData,createdAt:e.createdAt?new Date(e.createdAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static toObject(e){return function(e){for(const[t,s]of Object.entries(e))void 0===s&&delete e[t];return e}({id:e.revisionId,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.parse(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds})}}t.default=i,i.DESCRIPTOR_NAME="RevisionDescriptor",i.DESCRIPTOR={fields:{revisionId:{type:"string",id:1},name:{type:"string",id:2},creatorId:{type:"string",id:3},authorsIds:{type:"string",id:4},diffData:{type:"string",id:5},createdAt:{type:"string",id:6},attributes:{type:"string",id:7},toVersion:{type:"uint32",id:8},fromVersion:{type:"uint32",id:9},isEmptyCurrent:{type:"bool",id:10}}}},801:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new i(e.documentId)}}t.default=i,i.TYPE="121",i.READABLE_TYPE_NAME="connectToRevisionHistory",i.DESCRIPTOR_NAME="RevisionHistoryConnectMessage",i.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},3667:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t){super(),this.documentId=e,this.revisionId=t}toJSON(){return{documentId:this.documentId,revisionId:this.revisionId}}static fromJSON(e){return new i(e.documentId,e.revisionId)}}t.default=i,i.TYPE="123",i.READABLE_TYPE_NAME="getRevision",i.DESCRIPTOR_NAME="RevisionHistoryGetRevisionMessage",i.DESCRIPTOR={fields:{documentId:{type:"string",id:1},revisionId:{type:"string",id:2}}}},8702:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t){super(),this.documentId=e,this.requestId=t}toJSON(){return{documentId:this.documentId,requestId:this.requestId}}static fromJSON(e){return new i(e.documentId,e.requestId)}}t.default=i,i.TYPE="122",i.READABLE_TYPE_NAME="reconnectToRevisionHistory",i.DESCRIPTOR_NAME="RevisionHistoryReconnectMessage",i.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2}}}},6120:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545)),i=r(s(9883));class o extends n.default{constructor(e,t,s){super(),this.documentId=e,this.requestId=t,this.revisions=s}toJSON(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(i.default.toJSON)}}toObject(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(i.default.toObject)}}static create(e){return new o(e.documentId,e.requestId,e.revisions.map(i.default.create))}static fromJSON(e){return new o(e.documentId,e.requestId,e.revisions.map(i.default.fromJSON))}}t.default=o,o.TYPE="124",o.READABLE_TYPE_NAME="updateRevisions",o.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsMessage",o.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}}},5218:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545)),i=r(s(9883));class o extends n.default{constructor(e,t,s){super(),this.channel=e,this.requestId=t,this.revisions=s}toJSON(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(i.default.toJSON)}}toObject(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(i.default.toObject)}}static fromJSON(e){return new o(e.channel,e.requestId,e.revisions.map(i.default.fromJSON))}}t.default=o,o.DESCRIPTOR_NAME="RevisionHistoryConnectResponse",o.DESCRIPTOR={fields:{channel:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}}},6311:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545)),i=r(s(9883));class o extends n.default{constructor(e,t,s,r,n,i,o,a,c,u){super(),this.revisionId=e,this.name=t,this.creatorId=s,this.authorsIds=r,this.createdAt=n,this.diffData=i,this.attributes=o,this.fromVersion=a,this.toVersion=c,this.isEmptyCurrent=u}toJSON(){return i.default.toJSON(this)}toObject(){return i.default.toObject(this)}static create(e){return new o(e.revisionId,e.name,e.creatorId,e.authorsIds,e.createdAt,e.diffData,e.attributes,e.fromVersion,e.toVersion,e.isEmptyCurrent)}static fromJSON(e){return new o(e.revisionId,e.name,e.creatorId,e.authorsIds?JSON.parse(e.authorsIds):void 0,e.createdAt?new Date(e.createdAt):void 0,e.diffData,e.attributes?JSON.parse(e.attributes):void 0,e.fromVersion,e.toVersion,e.isEmptyCurrent)}}t.default=o,o.DESCRIPTOR_NAME="RevisionHistoryGetRevisionResponse",o.DESCRIPTOR=i.default.DESCRIPTOR},1655:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e){super(),this.requestId=e}toJSON(){return{requestId:this.requestId}}static fromJSON(e){return new i(e.requestId)}}t.default=i,i.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsResponse",i.DESCRIPTOR={fields:{requestId:{type:"uint32",id:1}}}},8811:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const a=s(2209),c=o(s(3596)),u=o(s(3667)),d=o(s(6311)),l=o(s(6120)),h=o(s(1655)),f=o(s(801)),p=o(s(5218)),y=o(s(8702)),m=o(s(357)),v=i(s(7158)),g=o(s(6314));t._SERVICE=12;class x{constructor(e){this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}connect(e){return this._isConnected?Promise.resolve():this._connect(e,new f.default(this._documentId))}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this.fire("disconnected"),this.stopListening())}reconnect(e,t){if(this.isConnected)throw new m.default("Cannot reconnect to already connected service.",e);return this._connect(e,new y.default(this._documentId,t))}async updateRevisions(e,t){const s=l.default.create({documentId:this._documentId,requestId:t,revisions:e}),r=await this._sendRequest(l.default.TYPE,s),{requestId:n}=c.default.decode(r,h.default);return n}async getRevision(e){const t=new u.default(this._documentId,e),s=await this._sendRequest(u.default.TYPE,t);return c.default.decode(s,d.default).toObject()}async _connect(e,s){if(e.state!==v.WEB_SOCKET_GATEWAY_STATES.CONNECTED)throw new m.default("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const r=await e._sendRequest(t._SERVICE,s.constructor.TYPE,c.default.encode(s)),{channel:n,requestId:i,revisions:o}=c.default.decode(r,p.default).toObject();return this.listenTo(e,"change:state",((e,t,s)=>this._onWsGatewayStateChange(s)),{priority:v.default._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,n),this._isConnected=!0,this.fire("connected"),{revisions:o,requestId:i}}_connectToChannel(e,t){this._channel=e._getChannel(x._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(l.default.TYPE),((e,t)=>{const{documentId:s,requestId:r,revisions:n}=c.default.decode(t,l.default).toObject();this.fire("revisionsUpdated",{documentId:s,requestId:r,revisionsData:n})}))}_onWsGatewayStateChange(e){e===v.WEB_SOCKET_GATEWAY_STATES.DISCONNECTED&&this.disconnect()}_sendRequest(e,s){if(!this._wsGateway||!this._isConnected)throw new g.default("Revision History",this);return this._wsGateway._sendRequest(t._SERVICE,e,c.default.encode(s))}}x._SERVICE=t._SERVICE,(0,a.mix)(x,a.EmitterMixin),t.default=x},6783:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(5945));class i extends n.default{}t.default=i,i.DESCRIPTOR_NAME="SessionsSocketDescriptor",i.DESCRIPTOR={fields:{session:{type:"string",id:1},user:{type:"string",id:2},role:{id:3,type:"string"},permissions:{rule:"repeated",type:"string",id:4}}}},2366:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t){super(),this.id=e,this.sessionType=t}toJSON(){return{id:this.id,sessionType:this.sessionType}}static fromJSON(e){return new i(e.id,e.sessionType)}}t.default=i,i.TYPE="31",i.READABLE_TYPE_NAME="getConnectedSockets",i.DESCRIPTOR_NAME="SessionsConnectMessage",i.DESCRIPTOR={fields:{id:{type:"string",id:1},sessionType:{type:"uint32",id:2}}}},2414:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t,s,r){super(),this.id=e,this.userId=t,this.role=s,this.permissions=r}toJSON(){var e,t,s;return{id:this.id,userId:null!==(e=this.userId)&&void 0!==e?e:void 0,role:null!==(t=this.role)&&void 0!==t?t:void 0,permissions:null!==(s=this.permissions)&&void 0!==s?s:void 0}}static fromJSON(e){return new i(e.id,e.userId,e.role,e.permissions)}}t.default=i,i.TYPE="32",i.READABLE_TYPE_NAME="connectSocket",i.DESCRIPTOR_NAME="SocketConnectMessage",i.DESCRIPTOR={fields:{id:{type:"string",id:1},userId:{type:"string",id:2},role:{type:"string",id:3},permissions:{rule:"repeated",type:"string",id:4}}}},4194:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new i(e.id)}}t.default=i,i.TYPE="33",i.READABLE_TYPE_NAME="disconnectSocket",i.DESCRIPTOR_NAME="SocketDisconnectMessage",i.DESCRIPTOR={fields:{id:{type:"string",id:1}}}},6145:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t=[]){super(),this.channel=e,this.sockets=t}toJSON(){return{channel:this.channel,sockets:this.sockets.map((e=>({user:e.userId,session:e.id,role:e.role,permissions:e.permissions})))}}static fromJSON(e){return new i(e.channel,e.sockets.map((e=>({id:e.session,userId:e.user,role:e.role,permissions:e.permissions}))))}}t.default=i,i.DESCRIPTOR_NAME="SessionsConnectResponse",i.DESCRIPTOR={fields:{channel:{type:"string",id:1},sockets:{rule:"repeated",type:"SessionsSocketDescriptor",id:2}}}},2690:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=s(2209),i=s(7026),o=r(s(7530)),a=r(s(7158)),c=r(s(6145)),u=r(s(2366)),d=r(s(2414)),l=r(s(4194)),h=r(s(3596));class f extends n.Collection{constructor(e,t){super({idProperty:"id"}),this._id=e,this._sessionType=t,this._handlers=new Map,this._eventsQueue=[],this._isRunning=!1}async connect(e){this._wsGateway=e,this.stopListening(e,"change:state");const t=new u.default(this._id,this._sessionType);let s;try{const e=await this._wsGateway._sendRequest(i._SERVICE,u.default.TYPE,h.default.encode(t));s=h.default.decode(e,c.default)}catch(e){s=new c.default(this._id,[])}this._connectToChannel(this._wsGateway,s.channel,this._sessionType);const r=await async function(e,t){const s=t.map((e=>e.userId)),r=s.length?await o.default.getMany(e,s):[];return t.map((e=>{const t={id:e.id,role:e.role,permissions:e.permissions};return t.user=e.userId&&r.find((t=>t.id===e.userId))||new o.default,t}))}(this._wsGateway,s.sockets);for(const e of r)super.add(e);this._connected=!0,this.fire("connected"),this.listenTo(this._wsGateway,"change:state",((e,t,s)=>this._onWsGatewayStateChange(s)),{priority:a.default._CHANGE_STATE_EVENT_PRIORITY}),await this._runQueue()}disconnect(e=!0){if(this._connected){for(this._connected=!1,this._eventsQueue=[];this.length;)super.remove(0);this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._wsGateway&&e&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this.fire("disconnected"),e&&this.stopListening()}}add(e,t){throw new TypeError("The collection is read-only.")}remove(e){throw new TypeError("The collection is read-only.")}_connectToChannel(e,t,s){this._channel=e._getChannel(s,t),this._channel&&(this._addHandler(this._channel,d.default.TYPE,(async t=>{const s=h.default.decode(t,d.default);if(-1===this.getIndex(s.id)){const t={id:s.id,role:s.role,permissions:s.permissions};s.userId&&(t.user=await o.default.get(e,s.userId)),super.add(t)}})),this._addHandler(this._channel,l.default.TYPE,(e=>{const t=h.default.decode(e,l.default);-1!==this.getIndex(t.id)&&super.remove(t.id)})))}async _onWsGatewayStateChange(e){e===a.default.STATE_DISCONNECTED&&this.disconnect(!1),e===a.default.STATE_CONNECTED&&await this.connect(this._wsGateway)}async _runQueue(){if(this._isRunning||!this._connected)return;let e;for(this._isRunning=!0;e=this._eventsQueue.shift();){const t=this._handlers.get(e.eventName);t&&await t(e.data)}this._isRunning=!1}_addHandler(e,t,s){const r=e.getEventName(t,!0);this.listenTo(e,r,(async(e,t)=>{const s=e.name;this._eventsQueue.push({eventName:s,data:t}),await this._runQueue()})),this._handlers.set(r,s)}}t.default=f},7026:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const n=r(s(2690));t._SERVICE=3,t.default=class{static async getConnectedSessions(e,t,s){const r=new n.default(t,s);return await r.connect(e),r}}},1706:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(5945));class i extends n.default{static toJSON(e){var t;return{...e,data:e.data?JSON.stringify(e.data):e.data,attributes:e.attributes?JSON.stringify(e.attributes):e.attributes,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{...e,data:e.data?JSON.parse(e.data):e.data,attributes:e.attributes?JSON.parse(e.attributes):e.attributes,createdAt:e.createdAt?new Date(e.createdAt):void 0}}}t.default=i,i.DESCRIPTOR_NAME="SuggestionDescriptor",i.DESCRIPTOR={fields:{id:{id:1,type:"string"},authorId:{id:2,type:"string"},type:{id:3,type:"string"},createdAt:{id:4,type:"string"},data:{id:5,type:"string"},hasComments:{id:6,type:"bool"},state:{id:7,type:"string"},attributes:{id:8,type:"string"}}}},597:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t,s,r={},n=null,i=null){super(),this.id=e,this.documentId=t,this.type=s,this.data=r,this.originalSuggestionId=n,this.attributes=i}toJSON(){return{id:this.id,documentId:this.documentId,type:this.type,data:JSON.stringify(this.data),originalSuggestionId:this.originalSuggestionId,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){var t;return new i(e.id,e.documentId,e.type,JSON.parse(e.data),null!==(t=e.originalSuggestionId)&&void 0!==t?t:null,e.attributes?JSON.parse(e.attributes):null)}}t.default=i,i.TYPE="101",i.READABLE_TYPE_NAME="addSuggestion",i.DESCRIPTOR_NAME="TrackChangesAddSuggestionMessage",i.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2},type:{type:"string",id:3},data:{type:"string",id:4},originalSuggestionId:{type:"string",id:5},attributes:{type:"string",id:6}}}},3268:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t,s){super(),this.ids=e,this.documentId=t,this.state=s}toJSON(){return{ids:this.ids,documentId:this.documentId,state:this.state}}static fromJSON(e){return new i(e.ids,e.documentId,e.state)}}t.default=i,i.TYPE="106",i.READABLE_TYPE_NAME="batchUpdateSuggestionsState",i.DESCRIPTOR_NAME="TrackChangesBatchUpdateSuggestionsStateMessage",i.DESCRIPTOR={fields:{ids:{type:"string",rule:"repeated",id:1},documentId:{type:"string",id:2},state:{type:"string",id:3}}}},144:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new i(e.documentId)}}t.default=i,i.TYPE="105",i.READABLE_TYPE_NAME="connectToSuggestions",i.DESCRIPTOR_NAME="TrackChangesConnectMessage",i.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},2679:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new i(e.documentId)}}t.default=i,i.TYPE="102",i.READABLE_TYPE_NAME="getAllSuggestions",i.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionMessage",i.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},1659:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t){super(),this.id=e,this.documentId=t}toJSON(){return{id:this.id,documentId:this.documentId}}static fromJSON(e){return new i(e.id,e.documentId)}}t.default=i,i.TYPE="103",i.READABLE_TYPE_NAME="getSuggestion",i.DESCRIPTOR_NAME="TrackChangesGetSuggestionMessage",i.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2}}}},598:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t,s,r,n,i=null){super(),this.id=e,this.documentId=t,this.hasComments=s,this.isHasCommentsModified=r,this.state=n,this.attributes=i}toJSON(){return{id:this.id,documentId:this.documentId,hasComments:this.hasComments,isHasCommentsModified:this.isHasCommentsModified,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new i(e.id,e.documentId,e.hasComments,e.isHasCommentsModified,e.state,e.attributes?JSON.parse(e.attributes):null)}}t.default=i,i.TYPE="104",i.READABLE_TYPE_NAME="updateSuggestion",i.DESCRIPTOR_NAME="TrackChangesUpdateSuggestionMessage",i.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2},hasComments:{type:"bool",id:3},isHasCommentsModified:{type:"bool",id:4},state:{type:"string",id:5},attributes:{type:"string",id:6}}}},3111:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t,s,r,n,i,o={},a=null){super(),this.id=e,this.authorId=t,this.type=s,this.hasComments=n,this.state=i,this.data=o,this.attributes=a,this.createdAt=r?new Date(r):void 0}toJSON(){var e;return{id:this.id,authorId:this.authorId,type:this.type,createdAt:null===(e=this.createdAt)||void 0===e?void 0:e.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new i(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}t.default=i,i.DESCRIPTOR_NAME="TrackChangesAddSuggestionResponse",i.DESCRIPTOR={fields:{id:{type:"string",id:1},authorId:{type:"string",id:2},type:{type:"string",id:3},createdAt:{type:"string",id:4},data:{type:"string",id:5},hasComments:{type:"bool",id:6},state:{type:"string",id:7},attributes:{type:"string",id:8}}}},701:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545)),i=r(s(1706));class o extends n.default{constructor(e,t,s){super(),this.channel=e,this._suggestions=t,this._suggestionsV2=s,this.suggestions=(null==s?void 0:s.length)?s:t}toJSON(){var e,t;return{channel:this.channel,suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(i.default.toJSON)}}static fromJSON(e){var t,s;return new o(e.channel,null===(t=e.suggestions)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(s=e.suggestionsV2)||void 0===s?void 0:s.map(i.default.fromJSON))}}t.default=o,o.DESCRIPTOR_NAME="TrackChangesConnectResponse",o.DESCRIPTOR={fields:{channel:{type:"string",id:1},suggestions:{type:"string",rule:"repeated",id:2},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:3}}}},3390:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545)),i=r(s(1706));class o extends n.default{constructor(e,t){super(),this._suggestions=e,this._suggestionsV2=t,this.suggestions=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(i.default.toJSON)}}static fromJSON(e){var t,s;return new o(null===(t=e.suggestions)||void 0===t?void 0:t.map(a),null===(s=e.suggestionsV2)||void 0===s?void 0:s.map(i.default.fromJSON))}}function a(e){const t=JSON.parse(e);return t.createdAt=t.createdAt?new Date(t.createdAt):void 0,t}t.default=o,o.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionsResponse",o.DESCRIPTOR={fields:{suggestions:{type:"string",rule:"repeated",id:1},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:2}}}},5930:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t,s,r,n,i,o={},a=null){super(),this.id=e,this.authorId=t,this.type=s,this.hasComments=n,this.state=i,this.data=o,this.attributes=a,this.createdAt=new Date(r)}toJSON(){return{id:this.id,authorId:this.authorId,type:this.type,createdAt:this.createdAt.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new i(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}t.default=i,i.DESCRIPTOR_NAME="TrackChangesGetSuggestionResponse",i.DESCRIPTOR={fields:{id:{type:"string",id:1},authorId:{type:"string",id:2},type:{type:"string",id:3},createdAt:{type:"string",id:4},data:{type:"string",id:5},hasComments:{type:"bool",id:6},state:{type:"string",id:7},attributes:{type:"string",id:8}}}},125:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const a=s(2209),c=o(s(3596)),u=o(s(597)),d=o(s(3111)),l=o(s(1659)),h=o(s(5930)),f=o(s(2679)),p=o(s(3390)),y=o(s(598)),m=o(s(144)),v=o(s(701)),g=o(s(357)),x=i(s(7158)),_=o(s(6314)),b=o(s(8801)),w=o(s(3268));t._SERVICE=10;class O{constructor(e){this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==x.WEB_SOCKET_GATEWAY_STATES.CONNECTED)throw new g.default("WebSocket Gateway is not connected.",e);const s=new m.default(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const r=await e._sendRequest(t._SERVICE,m.default.TYPE,c.default.encode(s)),n=c.default.decode(r,v.default);return this.listenTo(e,"change:state",((e,t,s)=>this._onWsGatewayStateChange(s)),{priority:x.default._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,n.channel),this._isConnected=!0,this.fire("connected"),n.suggestions}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this.fire("disconnected"),this.stopListening())}async add(e,t,s,r=null,n){const i=new u.default(e,this._documentId,t,s,r,n),o=await this._sendRequest(u.default.TYPE,i);return c.default.decode(o,d.default)}async get(e,t=1){const s=new l.default(e,this._documentId);try{const e=await this._sendRequest(l.default.TYPE,s);return c.default.decode(e,h.default)}catch(s){if("CKEditorCloudServicesServerError"===s.name&&"404"===s.code&&t<5)return await(r=100*t,new Promise((e=>{setTimeout(e,r)}))),this.get(e,t+1);if("CKEditorCloudServicesServerError"===s.name)throw s;throw b.default.fromPublicError(s)}var r}async getAll(){const e=new f.default(this._documentId),t=await this._sendRequest(f.default.TYPE,e),{suggestions:s}=c.default.decode(t,p.default);return s}async update(e,t={}){const{hasComments:s,state:r,attributes:n}=t,i=void 0!==s,o=new y.default(e,this._documentId,s,i,r,n);await this._sendRequest(y.default.TYPE,o)}async batchUpdateState(e){const t=new w.default(e.ids,this._documentId,e.state);await this._sendRequest(w.default.TYPE,t)}_connectToChannel(e,t){this._channel=e._getChannel(O._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(y.default.TYPE),((e,t)=>{const s=c.default.decode(t,y.default);this.fire("suggestionUpdated",s)}))}_onWsGatewayStateChange(e){e===x.WEB_SOCKET_GATEWAY_STATES.DISCONNECTED&&this.disconnect()}_sendRequest(e,s){if(!this._wsGateway||!this._isConnected)throw new _.default("Track Changes",this);return this._wsGateway._sendRequest(t._SERVICE,e,c.default.encode(s))}}O._SERVICE=t._SERVICE,(0,a.mix)(O,a.EmitterMixin),t.default=O},7618:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(5945));class i extends n.default{}t.default=i,i.DESCRIPTOR_NAME="UserDescriptor",i.DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}}},7204:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e){super(),this.ids=e}toJSON(){return{ids:this.ids}}static fromJSON(e){return new i(e.ids)}}t.default=i,i.TYPE="22",i.READABLE_TYPE_NAME="getManyUsers",i.DESCRIPTOR_NAME="GetManyUsersMessage",i.DESCRIPTOR={fields:{ids:{id:1,type:"string",rule:"repeated"}}}},1779:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new i(e.id)}}t.default=i,i.TYPE="21",i.READABLE_TYPE_NAME="getUser",i.DESCRIPTOR_NAME="GetUserMessage",i.DESCRIPTOR={fields:{id:{type:"string",id:1}}}},624:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e){super(),this.users=e}toJSON(){return{users:this.users.map(o)}}static fromJSON(e){return new i(e.users.map(a))}}function o(e){return{attributes:Object.keys(e).map((t=>({key:t,value:JSON.stringify(e[t])})))}}function a(e){return e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{})}t.default=i,i.DESCRIPTOR_NAME="GetManyUsersResponse",i.DESCRIPTOR={fields:{users:{rule:"repeated",type:"UserDescriptor",id:1}}}},2184:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e){super(),this.attributes=e}toJSON(){return{attributes:Object.keys(this.attributes).map((e=>({key:e,value:JSON.stringify(this.attributes[e])})))}}static fromJSON(e){const t=e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{});return new i(t)}}t.default=i,i.DESCRIPTOR_NAME="GetUserResponse",i.DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}}},7530:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(1779)),i=r(s(2184)),o=r(s(3596)),a=r(s(7204)),c=r(s(624));class u{constructor(e={}){this._attributes=new Map;for(const t of Object.keys(e))"id"!==t?(this._attributes.set(t,e[t]),Object.defineProperty(this,t,{enumerable:!0,configurable:!1,get:()=>this._attributes.get(t)})):this.id=e.id}static fromData(e){return new u(e)}static async get(e,t){const s=new n.default(t);try{const t=await e._sendRequest(u._SERVICE,n.default.TYPE,o.default.encode(s)),r=o.default.decode(t,i.default);return new u(r.attributes)}catch(e){return new u({id:t})}}static async getMany(e,t){const s=new a.default(t);try{const t=await e._sendRequest(u._SERVICE,a.default.TYPE,o.default.encode(s));return o.default.decode(t,c.default).users.map((e=>new u(e)))}catch(e){return t.map((e=>new u({id:e})))}}}u._SERVICE=2,t.default=u},6754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="42.0.0"},1573:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=s(2209),i=r(s(3554)),o=r(s(3596));class a{constructor(e,t,s){this._channelName=e,this._wsGateway=t,this._socket=s,this._subscribeToChannel()}remove(){this._socket.off(this._channelName)}getEventName(e,t=!1){let s="";return t&&(s+="all:"),s+="event",e&&(s+=":"+e),s}_subscribeToChannel(){this._socket.on(this._channelName,(e=>{const t=o.default.decode(e,i.default);this.fire(this.getEventName(t.type,!0),t.data,t.socketId),t.socketId!==this._wsGateway.socketId&&this.fire(this.getEventName(t.type),t.data,t.socketId)}))}}(0,n.mix)(a,n.EmitterMixin),t.default=a},3554:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t,s){super(),this.type=e,this.socketId=t,this.data=s}toJSON(){return{type:this.type,socketId:this.socketId,data:this.data}}static fromJSON(e){return new i(e.type,e.socketId,e.data)}}t.default=i,i.DESCRIPTOR_NAME="ChannelMessage",i.DESCRIPTOR={fields:{type:{type:"uint32",id:1},socketId:{type:"string",id:2},data:{type:"bytes",id:3}}}},8735:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(4990)),i=r(s(3596));t.default=class{encode(e,t,s,r="/",o={}){if(t.length>2)throw new Error("PacketParser supports only 2 elements in data");const a={type:e,data:t,id:s,nsp:r};return i.default.encode(n.default.create(a,o))}decode(e){const t=i.default.decode(e,n.default);return{packet:{id:t.id,type:t.type,data:t.packetData,nsp:t.nsp},options:{flags:t.options.flags,rooms:t.options.rooms,except:t.options.except}}}}},2854:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(s(799)),c=i(s(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.BUFFER,c.MessageDataTypes.BUFFER),u.DESCRIPTOR_NAME="BytesBytesPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"bytes",id:1},data1:{type:"bytes",id:2}}}},4253:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(s(799)),c=i(s(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.NUMBER,c.MessageDataTypes.BUFFER),u.DESCRIPTOR_NAME="NumberBytesPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"bytes",id:2}}}},1433:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(s(799)),c=i(s(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.NUMBER,c.MessageDataTypes.NUMBER),u.DESCRIPTOR_NAME="NumberNumberPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"uint32",id:2}}}},2272:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(s(799)),c=i(s(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new u(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.NUMBER,c.MessageDataTypes.OBJECT),u.DESCRIPTOR_NAME="NumberObjectPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}}},1692:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(s(799)),c=i(s(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.NUMBER,c.MessageDataTypes.STRING),u.DESCRIPTOR_NAME="NumberStringPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}}},7239:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(s(799)),c=i(s(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1}}static fromJSON(e){return new u(e.data&&JSON.parse(e.data),e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.OBJECT,c.MessageDataTypes.BUFFER),u.DESCRIPTOR_NAME="ObjectBufferPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}}},9075:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(s(799)),c=i(s(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new u(e.data&&JSON.parse(e.data),e.data1&&JSON.parse(e.data1))}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.OBJECT,c.MessageDataTypes.OBJECT),u.DESCRIPTOR_NAME="ObjectObjectPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}}},799:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{static create(e,t){throw new TypeError("Must be implemented in a child class!")}}t.default=i,e.exports=i},4990:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3596)),i=r(s(3545)),o=r(s(338)),a=r(s(817)),c=r(s(4253)),u=r(s(6335)),d=r(s(2854)),l=r(s(9769)),h=r(s(2272)),f=r(s(9075)),p=r(s(7239)),y=r(s(1797)),m=r(s(1694)),v=r(s(1433)),g=r(s(1692)),x=[c.default,u.default,d.default,l.default,h.default,f.default,p.default,y.default,m.default,v.default,g.default].reduce(((e,t)=>(e[t.TYPE]=t,e)),{});class _ extends i.default{constructor(e,t,s,r="/",n=new o.default){super(),this.type=e,this.data=t,this.id=s,this.nsp=r,this.options=n}get packetData(){return void 0===this.data.data&&void 0===this.data.data1?[]:this.data.data&&void 0===this.data.data1?[this.data.data]:[this.data.data,this.data.data1]}toJSON(){const e=n.default.encode(this.options),t=n.default.encode(this.data);return{type:this.type+10*this.data.constructor.TYPE,id:this.id,nsp:"/"===this.nsp?void 0:this.nsp,data:t,options:e}}static fromJSON(e){const t=Math.floor(e.type/10);return new _(e.type-10*t,n.default.decode(e.data,x[t]),e.id,e.nsp,e.options?n.default.decode(e.options,o.default):new o.default)}static create(e,t={}){var s;const r=a.default.getPacketType(a.default.getType(e.data[0]),a.default.getType(null!==(s=e.data[1])&&void 0!==s?s:e.data[0]));return new _(e.type,x[r].create(e.data[0],e.data[1]),e.id,e.nsp,new o.default(t.flags,t.rooms,t.except))}}t.default=_,_.TYPE=10,_.DESCRIPTOR_NAME="PacketMessage",_.DESCRIPTOR={fields:{type:{type:"uint32",id:1},id:{type:"uint32",id:2},nsp:{type:"string",id:3},data:{type:"bytes",id:4},options:{type:"bytes",id:5}}}},338:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(3545));class i extends n.default{constructor(e,t=[],s=[]){super(),this.flags=e,this.rooms=t,this.except=s}toJSON(){var e,t;return{flags:this.flags?JSON.stringify(this.flags):void 0,rooms:(null===(e=this.rooms)||void 0===e?void 0:e.length)?this.rooms:void 0,except:(null===(t=this.except)||void 0===t?void 0:t.length)?this.except:void 0}}static fromJSON(e){return new i(e.flags&&JSON.parse(e.flags),e.rooms,e.except)}}t.default=i,i.TYPE=11,i.DESCRIPTOR_NAME="PacketOptionsMessage",i.DESCRIPTOR={fields:{flags:{type:"string",id:1},rooms:{type:"string",id:2,rule:"repeated"},except:{type:"string",id:3,rule:"repeated"}}}},6335:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(s(799)),c=i(s(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.STRING,c.MessageDataTypes.BUFFER),u.DESCRIPTOR_NAME="StringBytesPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}}},1694:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(s(799)),c=i(s(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.STRING,c.MessageDataTypes.NUMBER),u.DESCRIPTOR_NAME="StringNumberPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"uint32",id:2}}}},9769:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(s(799)),c=i(s(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new u(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.STRING,c.MessageDataTypes.OBJECT),u.DESCRIPTOR_NAME="StringObjectPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}}},1797:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(s(799)),c=i(s(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.STRING,c.MessageDataTypes.STRING),u.DESCRIPTOR_NAME="StringStringPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}}},2069:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=t.ENCODED_TYPES=void 0;const n=s(9881),i=r(s(8735)),o=r(s(817));t.ENCODED_TYPES=[n.PacketType.EVENT,n.PacketType.ACK,n.PacketType.BINARY_ACK,n.PacketType.BINARY_EVENT];class a extends n.Encoder{constructor(e=new i.default){super(),this._packetParser=e}encode(e){if(t.ENCODED_TYPES.includes(e.type))try{return[this._packetParser.encode(e.type,e.data,e.id,e.nsp)]}catch(e){console.error("Can not properly serialize or deserialize messages. Check the original error.",{originalError:{message:e.message}})}return super.encode(e)}}t.Encoder=a;class c extends n.Decoder{constructor(e=new i.default){super(),this._packetParser=e}add(e){if(!o.default.isBuffer(e))return super.add(e);let t;try{t=this._packetParser.decode(e).packet}catch(t){return super.add(e)}super.emitReserved("decoded",t)}}t.Decoder=c},817:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageDataTypes=void 0;const s=!("undefined"==typeof process||!process.versions||!process.versions.node);var r,n;(n=r=t.MessageDataTypes||(t.MessageDataTypes={}))[n.BUFFER=1]="BUFFER",n[n.STRING=2]="STRING",n[n.NUMBER=3]="NUMBER",n[n.OBJECT=4]="OBJECT";class i{static getPacketType(...e){let t=0;for(let s=0;s<e.length;s++)t+=e[s]*Math.pow(10,e.length-s-1);return t}static getType(e){if(i.isBuffer(e))return r.BUFFER;const t=typeof e;return"string"===t?r.STRING:"number"===t?r.NUMBER:r.OBJECT}static isBuffer(e){return s&&Buffer.isBuffer(e)||e instanceof ArrayBuffer||e instanceof Uint8Array||this._isBufferView(e)}static _isBufferView(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}}t.default=i},1113:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(s(357));class i{constructor(e,t){this._context=e,this._deferredPromise=function(){let e,t;const s=new Promise(((s,r)=>{e=s,t=r}));return{resolve:e,reject:t,promise:s}}(),this.timeout=setTimeout((()=>this.error(new n.default("Request timeout.",this._context))),t)}get promise(){return this._deferredPromise.promise}response(e){this._deferredPromise.resolve(e)}error(e){this._deferredPromise.reject(e)}}t.default=class{constructor(e){this._context=e,this._requests=new Set}async send(e,t=45e3){const s=this._createRequest(t);try{return e(s),await s.promise}finally{this._finishRequest(s)}}errorAll(e){for(const t of this._requests)t.error(e)}waitForAllRequests(e=45e3){return this._waitForRequests(e)}_createRequest(e){const t=new i(this._context,e);return this._requests.add(t),t}_finishRequest(e){this._requests.delete(e),clearTimeout(e.timeout)}async _waitForRequests(e=5e3,t=0){return!this._requests.size||t>=e/500?Promise.resolve():(await new Promise((e=>{setTimeout(e,500)})),this._waitForRequests(e,t++))}}},7158:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WEB_SOCKET_GATEWAY_STATES=void 0;const n=s(8623),i=r(s(9655)),o=s(2209),a=r(s(1573)),c=r(s(7530)),u=r(s(6754)),d=r(s(357)),l=r(s(8801)),h=s(2069),f=r(s(1113));var p,y;(y=p=t.WEB_SOCKET_GATEWAY_STATES||(t.WEB_SOCKET_GATEWAY_STATES={})).DISCONNECTED="disconnected",y.CONNECTING="connecting",y.CONNECTED="connected";class m{constructor(e,t,s={},r=n.io,o=c.default.get){if(this._token=t,this._options=s,this._connectionProvider=r,this._userFactory=o,this._requestsManager=new f.default(this),this._channels=new Map,this._connectionAttempt=0,!e)throw new TypeError("Api address must be provided.");if(!this._token)throw new TypeError("Token must be provided.");this._options.requestTimeout||(this._options.requestTimeout=2e4),this._url=(0,i.default)(e.replace(/^(?!(?:\w+:)?\/\/)/,"https://")),this.set("state","disconnected"),this.set("socketId",void 0),this.set("me",void 0),this.on("change:state",(async(e,t,s)=>{var r;if(this._debugEvent("ws-gw:change:state",s),s!==m.STATE_CONNECTED){if(s===m.STATE_DISCONNECTED)return this._requestsManager.errorAll(new d.default("Not connected.",this))}else try{this.me=await this._userFactory.call(c.default,this,null===(r=this._socketAuth)||void 0===r?void 0:r.userId)}catch(e){}}),{priority:m._CHANGE_STATE_EVENT_PRIORITY}),this.on("error",((e,t)=>{this._options.onError?this._options.onError(t):console.error(t)}))}get sessionId(){return this.socketId}waitForAllRequests(e){return this._requestsManager.waitForAllRequests(e)}disconnect(){var e;this.state!==p.DISCONNECTED&&(null===(e=this._socket)||void 0===e||e.disconnect(),this._socket=void 0,this.state=p.DISCONNECTED)}async reconnect(){this._socket||this.state!==p.DISCONNECTED||(await this._token.refreshToken(),await this._connect())}static async connect(e,t="local.cs.dev:443/ws-v2",s={},r=n.io,i=c.default.get){const o=new m(t,e,s,r,i);return await o._connect(),o}_sendRequest(e,t,s){if(!e)throw new d.default("`serviceName` must be provided.",this);if(this.state!==m.STATE_CONNECTED)throw new d.default("Not connected.",this);if(!this._socketAuth||!this._socketAuth.isAuthenticated)throw new d.default("Not authenticated.",this);const r=new ArrayBuffer(s.length+2),n=new Uint8Array(r);return n[0]=e,n[1]=parseInt(t),n.set(s,2),this._emit(1,n)}_getChannel(e,t){const s=""+e+t;return!this._channels.has(s)&&this._socket&&this._channels.set(s,new a.default(s,this,this._socket)),this._channels.get(s)}_connect(){return new Promise(((e,t)=>{const s=this._setupSocket();!this.socketId&&s.io.on("reconnect_error",(()=>{this._debugEvent("reconnect_error"),this._reconnectionAttemptError(t)})),s.once("connect",(async()=>{this._debugEvent("once-connect");try{await this._onConnect(),e()}catch(e){t(e)}})),s.connect()}))}_getPortByProtocol(e){return["http:","ws:"].includes(e)?80:443}_setupSocket(){var e;if(this._socket)return this._socket;const t=this._url.port||this._getPortByProtocol(this._url.protocol),s=(this._url.protocol||"https:")+"//"+this._url.hostname+":"+t,r=this._connectionProvider(s,{parser:{Encoder:h.Encoder,Decoder:h.Decoder},path:"/ws-v2/ws",transports:["websocket"],timeout:void 0!==this._options.timeout?this._options.timeout:5e3,reconnection:void 0===this._options.autoReconnect||this._options.autoReconnect,reconnectionDelay:1e3,reconnectionDelayMax:5e3,rejectUnauthorized:void 0===this._options.rejectUnauthorized||this._options.rejectUnauthorized,query:{version:u.default},agent:null!==(e=this._options.agent)&&void 0!==e&&e,closeOnBeforeunload:!1});return this.state=p.CONNECTING,r.on("connect",(()=>{this._debugEvent("connect"),this.socketId=r.id})),r.on("connect_error",(e=>{this._debugEvent("connect_error",e)})),r.on("disconnect",(()=>{this._debugEvent("disconnect"),this._onDisconnect()})),r.io.on("reconnect",(async()=>{this._debugEvent("reconnect"),await this._onReconnect()})),r.io.on("reconnect_attempt",(e=>{this._debugEvent("reconnect_attempt",e),this.state=p.CONNECTING,this._connectionAttempt=e})),r.on("unauthorized",(e=>{this._debugEvent("unauthorized"),this._onUnauthorized(e)})),r.on("authenticationRequest",(async e=>{this._debugEvent("authenticationRequest",e.attempt),await this._onReconnect()})),this._socket=r,r}_emit(e,t){const s=this._socket;return this._requestsManager.send((r=>{s.emit(e,t,((e,t)=>{if(e)return r.error(l.default.fromPublicError(e));r.response(t)}))}),this._options.requestTimeout)}_addAuthData(e,t){this._socketAuth={environmentId:e,userId:t,isAuthenticated:!0}}_removeAuthData(){this._socketAuth=void 0}async _onConnect(){await this._authenticate(this._token.value),this.state=p.CONNECTED;const e=async(e,t,s)=>{this._debugEvent("token:value:change");try{await this._authenticate(s)}catch(e){}};this._token.on("change:value",e),this._socket.io.off("reconnect_error"),this.on("disconnect",(()=>{this._token.off("change:value",e)}))}async _onReconnect(){await this._token.refreshToken(),await this._onConnect()}_onDisconnect(){this.state=p.DISCONNECTED,this._connectionAttempt=0,this.fire("disconnect");for(const e of this._channels.values())e.remove();this._channels.clear(),void 0===this._options.autoReconnect||this._options.autoReconnect||(this._socket=void 0)}_debugEvent(e,t){if(!this._isDebugModeEnabled())return;const s=void 0!==t?", data: "+t:"";console.info((new Date).toLocaleString()+" "+e+s)}_reconnectionAttemptError(e){this._connectionAttempt>=2&&(this.disconnect(),e(d.default.fromPublicError({message:"The number of initial connection attempts exceeded.",explanation:"Three initial connection attempts failed. It can be caused by a missing or blocked Internet connection.",action:"Please verify the stability of your Internet connection and ensure that no antivirus or firewall software blocks the Web Socket protocol connections."})))}_onUnauthorized({error:e}){this._removeAuthData(),this.fire("error",l.default.fromPublicError(e))}async _authenticate(e){try{this._debugEvent("authenticate:start");const t=await this._emit(2,{token:e});this._debugEvent("authenticate:success","envId: "+t.environmentId+", userId: "+t.userId),this._addAuthData(t.environmentId,t.userId)}catch(e){throw this._debugEvent("authenticate:error",e.message),this._removeAuthData(),e}}_isDebugModeEnabled(){var e;return!!o.global.window.localStorage&&"true"===(null!==(e=o.global.window.localStorage.getItem("csClientDebugMode"))&&void 0!==e?e:"false").toLowerCase()}}m.STATE_DISCONNECTED=p.DISCONNECTED,m.STATE_CONNECTING=p.CONNECTING,m.STATE_CONNECTED=p.CONNECTED,m._CHANGE_STATE_EVENT_PRIORITY=o.priorities.get("highest")+999999,(0,o.mix)(m,o.ObservableMixin),t.default=m},9933:(e,t,s)=>{"use strict";e.exports=s(6386)},2777:(e,t,s)=>{"use strict";var r=t,n=s(238),i=s(7886);function o(e,t,s,r){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(d%s){",r);for(var i=t.resolvedType.values,o=Object.keys(i),a=0;a<o.length;++a)t.repeated&&i[o[a]]===t.typeDefault&&e("default:"),e("case%j:",o[a])("case %i:",i[o[a]])("m%s=%j",r,i[o[a]])("break");e("}")}else e('if(typeof d%s!=="object")',r)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",r,s,r);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",r,r);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",r,r);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",r,r);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",r,r,c)('else if(typeof d%s==="string")',r)("m%s=parseInt(d%s,10)",r,r)('else if(typeof d%s==="number")',r)("m%s=d%s",r,r)('else if(typeof d%s==="object")',r)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",r,r,r,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',r)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",r,r,r)("else if(d%s.length)",r)("m%s=d%s",r,r);break;case"string":e("m%s=String(d%s)",r,r);break;case"bool":e("m%s=Boolean(d%s)",r,r)}}return e}function a(e,t,s,r){if(t.resolvedType)t.resolvedType instanceof n?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",r,s,r,r):e("d%s=types[%i].toObject(m%s,o)",r,s,r);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,r,r,r);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',r)("d%s=o.longs===String?String(m%s):m%s",r,r,r)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",r,r,r,r,i?"true":"",r);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",r,r,r,r,r);break;default:e("d%s=m%s",r,r)}}return e}r.fromObject=function(e){var t=e.fieldsArray,s=i.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return s("return new this.ctor");s("var m=new this.ctor");for(var r=0;r<t.length;++r){var a=t[r].resolve(),c=i.safeProp(a.name);a.map?(s("if(d%s){",c)('if(typeof d%s!=="object")',c)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",c)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",c),o(s,a,r,c+"[ks[i]]")("}")("}")):a.repeated?(s("if(d%s){",c)("if(!Array.isArray(d%s))",c)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",c)("for(var i=0;i<d%s.length;++i){",c),o(s,a,r,c+"[i]")("}")("}")):(a.resolvedType instanceof n||s("if(d%s!=null){",c),o(s,a,r,c),a.resolvedType instanceof n||s("}"))}return s("return m")},r.toObject=function(e){var t=e.fieldsArray.slice().sort(i.compareFieldsById);if(!t.length)return i.codegen()("return {}");for(var s=i.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),r=[],o=[],c=[],u=0;u<t.length;++u)t[u].partOf||(t[u].resolve().repeated?r:t[u].map?o:c).push(t[u]);if(r.length){for(s("if(o.arrays||o.defaults){"),u=0;u<r.length;++u)s("d%s=[]",i.safeProp(r[u].name));s("}")}if(o.length){for(s("if(o.objects||o.defaults){"),u=0;u<o.length;++u)s("d%s={}",i.safeProp(o[u].name));s("}")}if(c.length){for(s("if(o.defaults){"),u=0;u<c.length;++u){var d=c[u],l=i.safeProp(d.name);if(d.resolvedType instanceof n)s("d%s=o.enums===String?%j:%j",l,d.resolvedType.valuesById[d.typeDefault],d.typeDefault);else if(d.long)s("if(util.Long){")("var n=new util.Long(%i,%i,%j)",d.typeDefault.low,d.typeDefault.high,d.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",l)("}else")("d%s=o.longs===String?%j:%i",l,d.typeDefault.toString(),d.typeDefault.toNumber());else if(d.bytes){var h="["+Array.prototype.slice.call(d.typeDefault).join(",")+"]";s("if(o.bytes===String)d%s=%j",l,String.fromCharCode.apply(String,d.typeDefault))("else{")("d%s=%s",l,h)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",l,l)("}")}else s("d%s=%j",l,d.typeDefault)}s("}")}var f=!1;for(u=0;u<t.length;++u){d=t[u];var p=e._fieldsArray.indexOf(d);l=i.safeProp(d.name);d.map?(f||(f=!0,s("var ks2")),s("if(m%s&&(ks2=Object.keys(m%s)).length){",l,l)("d%s={}",l)("for(var j=0;j<ks2.length;++j){"),a(s,d,p,l+"[ks2[j]]")("}")):d.repeated?(s("if(m%s&&m%s.length){",l,l)("d%s=[]",l)("for(var j=0;j<m%s.length;++j){",l),a(s,d,p,l+"[j]")("}")):(s("if(m%s!=null&&m.hasOwnProperty(%j)){",l,d.name),a(s,d,p,l),d.partOf&&s("if(o.oneofs)")("d%s=%j",i.safeProp(d.partOf.name),d.name)),s("}")}return s("return d")}},8159:(e,t,s)=>{"use strict";e.exports=function(e){var t=i.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break");t("switch(t>>>3){");for(var s=0;s<e.fieldsArray.length;++s){var a=e._fieldsArray[s].resolve(),c=a.resolvedType instanceof r?"int32":a.type,u="m"+i.safeProp(a.name);t("case %i:",a.id),a.map?(t("if(%s===util.emptyObject)",u)("%s={}",u)("var c2 = r.uint32()+r.pos"),void 0!==n.defaults[a.keyType]?t("k=%j",n.defaults[a.keyType]):t("k=null"),void 0!==n.defaults[c]?t("value=%j",n.defaults[c]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===n.basic[c]?t("value=types[%i].decode(r,r.uint32())",s):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==n.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):a.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==n.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",u,c)("}else"),void 0===n.basic[c]?t(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",u,s):t("%s.push(r.%s())",u,c)):void 0===n.basic[c]?t(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",u,s):t("%s=r.%s()",u,c),t("break")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),s=0;s<e._fieldsArray.length;++s){var d=e._fieldsArray[s];d.required&&t("if(!m.hasOwnProperty(%j))",d.name)("throw util.ProtocolError(%j,{instance:m})",o(d))}return t("return m")};var r=s(238),n=s(8372),i=s(7886);function o(e){return"missing required '"+e.name+"'"}},8357:(e,t,s)=>{"use strict";e.exports=function(e){for(var t,s=i.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(i.compareFieldsById),c=0;c<a.length;++c){var u=a[c].resolve(),d=e._fieldsArray.indexOf(u),l=u.resolvedType instanceof r?"int32":u.type,h=n.basic[l];t="m"+i.safeProp(u.name),u.map?(s("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,u.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(u.id<<3|2)>>>0,8|n.mapKey[u.keyType],u.keyType),void 0===h?s("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",d,t):s(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,l,t),s("}")("}")):u.repeated?(s("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==n.packed[l]?s("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",l,t)("w.ldelim()"):(s("for(var i=0;i<%s.length;++i)",t),void 0===h?o(s,u,d,t+"[i]"):s("w.uint32(%i).%s(%s[i])",(u.id<<3|h)>>>0,l,t)),s("}")):(u.optional&&s("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===h?o(s,u,d,t):s("w.uint32(%i).%s(%s)",(u.id<<3|h)>>>0,l,t))}return s("return w")};var r=s(238),n=s(8372),i=s(7886);function o(e,t,s,r){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",s,r,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",s,r,(t.id<<3|2)>>>0)}},238:(e,t,s)=>{"use strict";e.exports=o;var r=s(6913);((o.prototype=Object.create(r.prototype)).constructor=o).className="Enum";var n=s(9587),i=s(7886);function o(e,t,s,n,i){if(r.call(this,e,s),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=i||{},this.reserved=void 0,t)for(var o=Object.keys(t),a=0;a<o.length;++a)"number"==typeof t[o[a]]&&(this.valuesById[this.values[o[a]]=t[o[a]]]=o[a])}o.fromJSON=function(e,t){var s=new o(e,t.values,t.options,t.comment,t.comments);return s.reserved=t.reserved,s},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},o.prototype.add=function(e,t,s){if(!i.isString(e))throw TypeError("name must be a string");if(!i.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=s||null,this},o.prototype.remove=function(e){if(!i.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},o.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},o.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)}},5263:(e,t,s)=>{"use strict";e.exports=u;var r=s(6913);((u.prototype=Object.create(r.prototype)).constructor=u).className="Field";var n,i=s(238),o=s(8372),a=s(7886),c=/^required|optional|repeated$/;function u(e,t,s,n,i,u,d){if(a.isObject(n)?(d=i,u=n,n=i=void 0):a.isObject(i)&&(d=u,u=i,i=void 0),r.call(this,e,u),!a.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!a.isString(s))throw TypeError("type must be a string");if(void 0!==n&&!c.test(n=n.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==i&&!a.isString(i))throw TypeError("extend must be a string");"proto3_optional"===n&&(n="optional"),this.rule=n&&"optional"!==n?n:void 0,this.type=s,this.id=t,this.extend=i||void 0,this.required="required"===n,this.optional=!this.required,this.repeated="repeated"===n,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!a.Long&&void 0!==o.long[s],this.bytes="bytes"===s,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=d}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,s){return"packed"===e&&(this._packed=null),r.prototype.setOption.call(this,e,t,s)},u.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=o.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof n?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof i&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof i)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof n&&(this.parent.ctor.prototype[this.name]=this.defaultValue),r.prototype.resolve.call(this)},u.d=function(e,t,s,r){return"function"==typeof t?t=a.decorateType(t).name:t&&"object"==typeof t&&(t=a.decorateEnum(t).name),function(n,i){a.decorateType(n.constructor).add(new u(i,e,t,s,{default:r}))}},u._configure=function(e){n=e}},6386:(e,t,s)=>{"use strict";var r=e.exports=s(2877);r.build="light",r.load=function(e,t,s){return"function"==typeof t?(s=t,t=new r.Root):t||(t=new r.Root),t.load(e,s)},r.loadSync=function(e,t){return t||(t=new r.Root),t.loadSync(e)},r.encoder=s(8357),r.decoder=s(8159),r.verifier=s(5669),r.converter=s(2777),r.ReflectionObject=s(6913),r.Namespace=s(9587),r.Root=s(6720),r.Enum=s(238),r.Type=s(396),r.Field=s(5263),r.OneOf=s(8930),r.MapField=s(6977),r.Service=s(5280),r.Method=s(9455),r.Message=s(5986),r.wrappers=s(2016),r.types=s(8372),r.util=s(7886),r.ReflectionObject._configure(r.Root),r.Namespace._configure(r.Type,r.Service,r.Enum),r.Root._configure(r.Type),r.Field._configure(r.Type)},2877:(e,t,s)=>{"use strict";var r=t;function n(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=s(3117),r.BufferWriter=s(4766),r.Reader=s(9924),r.BufferReader=s(6515),r.util=s(4652),r.rpc=s(8607),r.roots=s(9188),r.configure=n,n()},6977:(e,t,s)=>{"use strict";e.exports=o;var r=s(5263);((o.prototype=Object.create(r.prototype)).constructor=o).className="MapField";var n=s(8372),i=s(7886);function o(e,t,s,n,o,a){if(r.call(this,e,t,n,void 0,void 0,o,a),!i.isString(s))throw TypeError("keyType must be a string");this.keyType=s,this.resolvedKeyType=null,this.map=!0}o.fromJSON=function(e,t){return new o(e,t.id,t.keyType,t.type,t.options,t.comment)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},o.prototype.resolve=function(){if(this.resolved)return this;if(void 0===n.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return r.prototype.resolve.call(this)},o.d=function(e,t,s){return"function"==typeof s?s=i.decorateType(s).name:s&&"object"==typeof s&&(s=i.decorateEnum(s).name),function(r,n){i.decorateType(r.constructor).add(new o(n,e,t,s))}}},5986:(e,t,s)=>{"use strict";e.exports=n;var r=s(4652);function n(e){if(e)for(var t=Object.keys(e),s=0;s<t.length;++s)this[t[s]]=e[t[s]]}n.create=function(e){return this.$type.create(e)},n.encode=function(e,t){return this.$type.encode(e,t)},n.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},n.decode=function(e){return this.$type.decode(e)},n.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},n.verify=function(e){return this.$type.verify(e)},n.fromObject=function(e){return this.$type.fromObject(e)},n.toObject=function(e,t){return this.$type.toObject(e,t)},n.prototype.toJSON=function(){return this.$type.toObject(this,r.toJSONOptions)}},9455:(e,t,s)=>{"use strict";e.exports=i;var r=s(6913);((i.prototype=Object.create(r.prototype)).constructor=i).className="Method";var n=s(7886);function i(e,t,s,i,o,a,c,u,d){if(n.isObject(o)?(c=o,o=a=void 0):n.isObject(a)&&(c=a,a=void 0),void 0!==t&&!n.isString(t))throw TypeError("type must be a string");if(!n.isString(s))throw TypeError("requestType must be a string");if(!n.isString(i))throw TypeError("responseType must be a string");r.call(this,e,c),this.type=t||"rpc",this.requestType=s,this.requestStream=!!o||void 0,this.responseType=i,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=d}i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return n.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),r.prototype.resolve.call(this))}},9587:(e,t,s)=>{"use strict";e.exports=l;var r=s(6913);((l.prototype=Object.create(r.prototype)).constructor=l).className="Namespace";var n,i,o,a=s(5263),c=s(8930),u=s(7886);function d(e,t){if(e&&e.length){for(var s={},r=0;r<e.length;++r)s[e[r].name]=e[r].toJSON(t);return s}}function l(e,t){r.call(this,e,t),this.nested=void 0,this._nestedArray=null}function h(e){return e._nestedArray=null,e}l.fromJSON=function(e,t){return new l(e,t.options).addJSON(t.nested)},l.arrayToJSON=d,l.isReservedId=function(e,t){if(e)for(var s=0;s<e.length;++s)if("string"!=typeof e[s]&&e[s][0]<=t&&e[s][1]>t)return!0;return!1},l.isReservedName=function(e,t){if(e)for(var s=0;s<e.length;++s)if(e[s]===t)return!0;return!1},Object.defineProperty(l.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=u.toArray(this.nested))}}),l.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",d(this.nestedArray,e)])},l.prototype.addJSON=function(e){if(e)for(var t,s=Object.keys(e),r=0;r<s.length;++r)t=e[s[r]],this.add((void 0!==t.fields?n.fromJSON:void 0!==t.values?o.fromJSON:void 0!==t.methods?i.fromJSON:void 0!==t.id?a.fromJSON:l.fromJSON)(s[r],t));return this},l.prototype.get=function(e){return this.nested&&this.nested[e]||null},l.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof o)return this.nested[e].values;throw Error("no such enum: "+e)},l.prototype.add=function(e){if(!(e instanceof a&&void 0!==e.extend||e instanceof n||e instanceof o||e instanceof i||e instanceof l||e instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof l&&e instanceof l)||t instanceof n||t instanceof i)throw Error("duplicate name '"+e.name+"' in "+this);for(var s=t.nestedArray,r=0;r<s.length;++r)e.add(s[r]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),h(this)},l.prototype.remove=function(e){if(!(e instanceof r))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),h(this)},l.prototype.define=function(e,t){if(u.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var s=this;e.length>0;){var r=e.shift();if(s.nested&&s.nested[r]){if(!((s=s.nested[r])instanceof l))throw Error("path conflicts with non-namespace objects")}else s.add(s=new l(r))}return t&&s.addJSON(t),s},l.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof l?e[t++].resolveAll():e[t++].resolve();return this.resolve()},l.prototype.lookup=function(e,t,s){if("boolean"==typeof t?(s=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),u.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var r=this.get(e[0]);if(r){if(1===e.length){if(!t||t.indexOf(r.constructor)>-1)return r}else if(r instanceof l&&(r=r.lookup(e.slice(1),t,!0)))return r}else for(var n=0;n<this.nestedArray.length;++n)if(this._nestedArray[n]instanceof l&&(r=this._nestedArray[n].lookup(e,t,!0)))return r;return null===this.parent||s?null:this.parent.lookup(e,t)},l.prototype.lookupType=function(e){var t=this.lookup(e,[n]);if(!t)throw Error("no such type: "+e);return t},l.prototype.lookupEnum=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},l.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[n,o]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},l.prototype.lookupService=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},l._configure=function(e,t,s){n=e,i=t,o=s}},6913:(e,t,s)=>{"use strict";e.exports=i,i.className="ReflectionObject";var r,n=s(7886);function i(e,t){if(!n.isString(e))throw TypeError("name must be a string");if(t&&!n.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(i.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),i.prototype.toJSON=function(){throw Error()},i.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof r&&t._handleAdd(this)},i.prototype.onRemove=function(e){var t=e.root;t instanceof r&&t._handleRemove(this),this.parent=null,this.resolved=!1},i.prototype.resolve=function(){return this.resolved||this.root instanceof r&&(this.resolved=!0),this},i.prototype.getOption=function(e){if(this.options)return this.options[e]},i.prototype.setOption=function(e,t,s){return s&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},i.prototype.setParsedOption=function(e,t,s){this.parsedOptions||(this.parsedOptions=[]);var r=this.parsedOptions;if(s){var i=r.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(i){var o=i[e];n.setProperty(o,s,t)}else(i={})[e]=n.setProperty({},s,t),r.push(i)}else{var a={};a[e]=t,r.push(a)}return this},i.prototype.setOptions=function(e,t){if(e)for(var s=Object.keys(e),r=0;r<s.length;++r)this.setOption(s[r],e[s[r]],t);return this},i.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},i._configure=function(e){r=e}},8930:(e,t,s)=>{"use strict";e.exports=o;var r=s(6913);((o.prototype=Object.create(r.prototype)).constructor=o).className="OneOf";var n=s(5263),i=s(7886);function o(e,t,s,n){if(Array.isArray(t)||(s=t,t=void 0),r.call(this,e,s),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=n}function a(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}o.fromJSON=function(e,t){return new o(e,t.oneof,t.options,t.comment)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},o.prototype.add=function(e){if(!(e instanceof n))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,a(this),this},o.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},o.prototype.onAdd=function(e){r.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var s=e.get(this.oneof[t]);s&&!s.partOf&&(s.partOf=this,this.fieldsArray.push(s))}a(this)},o.prototype.onRemove=function(e){for(var t,s=0;s<this.fieldsArray.length;++s)(t=this.fieldsArray[s]).parent&&t.parent.remove(t);r.prototype.onRemove.call(this,e)},o.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,s){i.decorateType(t.constructor).add(new o(s,e)),Object.defineProperty(t,s,{get:i.oneOfGetter(e),set:i.oneOfSetter(e)})}}},9924:(e,t,s)=>{"use strict";e.exports=c;var r,n=s(4652),i=n.LongBits,o=n.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,d="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return n.Buffer?function(e){return(c.create=function(e){return n.Buffer.isBuffer(e)?new r(e):d(e)})(e)}:d};function h(){var e=new i(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function f(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw a(this,8);return new i(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return f(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|f(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,s=this.pos+e;if(s>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,s):t===s?new this.buf.constructor(0):this._slice.call(this.buf,t,s)},c.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){r=e,c.create=l(),r._configure();var t=n.Long?"toLong":"toNumber";n.merge(c.prototype,{int64:function(){return h.call(this)[t](!1)},uint64:function(){return h.call(this)[t](!0)},sint64:function(){return h.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},6515:(e,t,s)=>{"use strict";e.exports=i;var r=s(9924);(i.prototype=Object.create(r.prototype)).constructor=i;var n=s(4652);function i(e){r.call(this,e)}i._configure=function(){n.Buffer&&(i.prototype._slice=n.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()},6720:(e,t,s)=>{"use strict";e.exports=l;var r=s(9587);((l.prototype=Object.create(r.prototype)).constructor=l).className="Root";var n,i,o,a=s(5263),c=s(238),u=s(8930),d=s(7886);function l(e){r.call(this,"",e),this.deferred=[],this.files=[]}function h(){}l.fromJSON=function(e,t){return t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},l.prototype.resolvePath=d.path.resolve,l.prototype.fetch=d.fetch,l.prototype.load=function e(t,s,r){"function"==typeof s&&(r=s,s=void 0);var n=this;if(!r)return d.asPromise(e,n,t,s);var a=r===h;function c(e,t){if(r){var s=r;if(r=null,a)throw e;s(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var s=e.substring(t);if(s in o)return s}return null}function l(e,t){try{if(d.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),d.isString(t)){i.filename=e;var r,o=i(t,n,s),l=0;if(o.imports)for(;l<o.imports.length;++l)(r=u(o.imports[l])||n.resolvePath(e,o.imports[l]))&&f(r);if(o.weakImports)for(l=0;l<o.weakImports.length;++l)(r=u(o.weakImports[l])||n.resolvePath(e,o.weakImports[l]))&&f(r,!0)}else n.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}a||p||c(null,n)}function f(e,t){if(!(n.files.indexOf(e)>-1))if(n.files.push(e),e in o)a?l(e,o[e]):(++p,setTimeout((function(){--p,l(e,o[e])})));else if(a){var s;try{s=d.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}l(e,s)}else++p,n.fetch(e,(function(s,i){--p,r&&(s?t?p||c(null,n):c(s):l(e,i))}))}var p=0;d.isString(t)&&(t=[t]);for(var y,m=0;m<t.length;++m)(y=n.resolvePath("",t[m]))&&f(y);if(a)return n;p||c(null,n)},l.prototype.loadSync=function(e,t){if(!d.isNode)throw Error("not supported");return this.load(e,t,h)},l.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return r.prototype.resolveAll.call(this)};var f=/^[A-Z]/;function p(e,t){var s=t.parent.lookup(t.extend);if(s){var r=new a(t.fullName,t.id,t.type,t.rule,void 0,t.options);return r.declaringField=t,t.extensionField=r,s.add(r),!0}return!1}l.prototype._handleAdd=function(e){if(e instanceof a)void 0===e.extend||e.extensionField||p(0,e)||this.deferred.push(e);else if(e instanceof c)f.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof u)){if(e instanceof n)for(var t=0;t<this.deferred.length;)p(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var s=0;s<e.nestedArray.length;++s)this._handleAdd(e._nestedArray[s]);f.test(e.name)&&(e.parent[e.name]=e)}},l.prototype._handleRemove=function(e){if(e instanceof a){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof c)f.test(e.name)&&delete e.parent[e.name];else if(e instanceof r){for(var s=0;s<e.nestedArray.length;++s)this._handleRemove(e._nestedArray[s]);f.test(e.name)&&delete e.parent[e.name]}},l._configure=function(e,t,s){n=e,i=t,o=s}},9188:e=>{"use strict";e.exports={}},8607:(e,t,s)=>{"use strict";t.Service=s(8887)},8887:(e,t,s)=>{"use strict";e.exports=n;var r=s(4652);function n(e,t,s){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(s)}(n.prototype=Object.create(r.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function e(t,s,n,i,o){if(!i)throw TypeError("request must be specified");var a=this;if(!o)return r.asPromise(e,a,t,s,n,i);if(a.rpcImpl)try{return a.rpcImpl(t,s[a.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,s){if(e)return a.emit("error",e,t),o(e);if(null!==s){if(!(s instanceof n))try{s=n[a.responseDelimited?"decodeDelimited":"decode"](s)}catch(e){return a.emit("error",e,t),o(e)}return a.emit("data",s,t),o(null,s)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){o(e)}),0)}else setTimeout((function(){o(Error("already ended"))}),0)},n.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},5280:(e,t,s)=>{"use strict";e.exports=a;var r=s(9587);((a.prototype=Object.create(r.prototype)).constructor=a).className="Service";var n=s(9455),i=s(7886),o=s(8607);function a(e,t){r.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}a.fromJSON=function(e,t){var s=new a(e,t.options);if(t.methods)for(var r=Object.keys(t.methods),i=0;i<r.length;++i)s.add(n.fromJSON(r[i],t.methods[r[i]]));return t.nested&&s.addJSON(t.nested),s.comment=t.comment,s},a.prototype.toJSON=function(e){var t=r.prototype.toJSON.call(this,e),s=!!e&&Boolean(e.keepComments);return i.toObject(["options",t&&t.options||void 0,"methods",r.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",s?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=i.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||r.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return r.prototype.resolve.call(this)},a.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof n?(this.methods[e.name]=e,e.parent=this,c(this)):r.prototype.add.call(this,e)},a.prototype.remove=function(e){if(e instanceof n){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,c(this)}return r.prototype.remove.call(this,e)},a.prototype.create=function(e,t,s){for(var r,n=new o.Service(e,t,s),a=0;a<this.methodsArray.length;++a){var c=i.lcFirst((r=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");n[c]=i.codegen(["r","c"],i.isReserved(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:r,q:r.resolvedRequestType.ctor,s:r.resolvedResponseType.ctor})}return n}},396:(e,t,s)=>{"use strict";e.exports=g;var r=s(9587);((g.prototype=Object.create(r.prototype)).constructor=g).className="Type";var n=s(238),i=s(8930),o=s(5263),a=s(6977),c=s(5280),u=s(5986),d=s(9924),l=s(3117),h=s(7886),f=s(8357),p=s(8159),y=s(5669),m=s(2777),v=s(2016);function g(e,t){r.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function x(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(g.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var s=this.fields[e[t]],r=s.id;if(this._fieldsById[r])throw Error("duplicate id "+r+" in "+this);this._fieldsById[r]=s}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=h.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=h.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=g.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof u||((e.prototype=new u).constructor=e,h.merge(e.prototype,t)),e.$type=e.prototype.$type=this,h.merge(e,u,!0),this._ctor=e;for(var s=0;s<this.fieldsArray.length;++s)this._fieldsArray[s].resolve();var r={};for(s=0;s<this.oneofsArray.length;++s)r[this._oneofsArray[s].resolve().name]={get:h.oneOfGetter(this._oneofsArray[s].oneof),set:h.oneOfSetter(this._oneofsArray[s].oneof)};s&&Object.defineProperties(e.prototype,r)}}}),g.generateConstructor=function(e){for(var t,s=h.codegen(["p"],e.name),r=0;r<e.fieldsArray.length;++r)(t=e._fieldsArray[r]).map?s("this%s={}",h.safeProp(t.name)):t.repeated&&s("this%s=[]",h.safeProp(t.name));return s("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},g.fromJSON=function(e,t){var s=new g(e,t.options);s.extensions=t.extensions,s.reserved=t.reserved;for(var u=Object.keys(t.fields),d=0;d<u.length;++d)s.add((void 0!==t.fields[u[d]].keyType?a.fromJSON:o.fromJSON)(u[d],t.fields[u[d]]));if(t.oneofs)for(u=Object.keys(t.oneofs),d=0;d<u.length;++d)s.add(i.fromJSON(u[d],t.oneofs[u[d]]));if(t.nested)for(u=Object.keys(t.nested),d=0;d<u.length;++d){var l=t.nested[u[d]];s.add((void 0!==l.id?o.fromJSON:void 0!==l.fields?g.fromJSON:void 0!==l.values?n.fromJSON:void 0!==l.methods?c.fromJSON:r.fromJSON)(u[d],l))}return t.extensions&&t.extensions.length&&(s.extensions=t.extensions),t.reserved&&t.reserved.length&&(s.reserved=t.reserved),t.group&&(s.group=!0),t.comment&&(s.comment=t.comment),s},g.prototype.toJSON=function(e){var t=r.prototype.toJSON.call(this,e),s=!!e&&Boolean(e.keepComments);return h.toObject(["options",t&&t.options||void 0,"oneofs",r.arrayToJSON(this.oneofsArray,e),"fields",r.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",s?this.comment:void 0])},g.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var s=this.oneofsArray;for(t=0;t<s.length;)s[t++].resolve();return r.prototype.resolveAll.call(this)},g.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},g.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof o&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),x(this)}return e instanceof i?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),x(this)):r.prototype.add.call(this,e)},g.prototype.remove=function(e){if(e instanceof o&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),x(this)}if(e instanceof i){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),x(this)}return r.prototype.remove.call(this,e)},g.prototype.isReservedId=function(e){return r.isReservedId(this.reserved,e)},g.prototype.isReservedName=function(e){return r.isReservedName(this.reserved,e)},g.prototype.create=function(e){return new this.ctor(e)},g.prototype.setup=function(){for(var e=this.fullName,t=[],s=0;s<this.fieldsArray.length;++s)t.push(this._fieldsArray[s].resolve().resolvedType);this.encode=f(this)({Writer:l,types:t,util:h}),this.decode=p(this)({Reader:d,types:t,util:h}),this.verify=y(this)({types:t,util:h}),this.fromObject=m.fromObject(this)({types:t,util:h}),this.toObject=m.toObject(this)({types:t,util:h});var r=v[e];if(r){var n=Object.create(this);n.fromObject=this.fromObject,this.fromObject=r.fromObject.bind(n),n.toObject=this.toObject,this.toObject=r.toObject.bind(n)}return this},g.prototype.encode=function(e,t){return this.setup().encode(e,t)},g.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},g.prototype.decode=function(e,t){return this.setup().decode(e,t)},g.prototype.decodeDelimited=function(e){return e instanceof d||(e=d.create(e)),this.decode(e,e.uint32())},g.prototype.verify=function(e){return this.setup().verify(e)},g.prototype.fromObject=function(e){return this.setup().fromObject(e)},g.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},g.d=function(e){return function(t){h.decorateType(t,e)}}},8372:(e,t,s)=>{"use strict";var r=t,n=s(7886),i=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function o(e,t){var s=0,r={};for(t|=0;s<e.length;)r[i[s+t]]=e[s++];return r}r.basic=o([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),r.defaults=o([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",n.emptyArray,null]),r.long=o([0,0,0,1,1],7),r.mapKey=o([0,0,0,5,5,0,0,0,1,1,0,2],2),r.packed=o([1,5,0,0,0,5,5,0,0,0,1,1,0])},7886:(e,t,s)=>{"use strict";var r,n,i=e.exports=s(4652),o=s(9188);i.codegen=s(6348),i.fetch=s(7803),i.path=s(1272),i.fs=i.inquire("fs"),i.toArray=function(e){if(e){for(var t=Object.keys(e),s=new Array(t.length),r=0;r<t.length;)s[r]=e[t[r++]];return s}return[]},i.toObject=function(e){for(var t={},s=0;s<e.length;){var r=e[s++],n=e[s++];void 0!==n&&(t[r]=n)}return t};var a=/\\/g,c=/"/g;i.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},i.safeProp=function(e){return!/^[$\w_]+$/.test(e)||i.isReserved(e)?'["'+e.replace(a,"\\\\").replace(c,'\\"')+'"]':"."+e},i.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var u=/_([a-z])/g;i.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(u,(function(e,t){return t.toUpperCase()}))},i.compareFieldsById=function(e,t){return e.id-t.id},i.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(i.decorateRoot.remove(e.$type),e.$type.name=t,i.decorateRoot.add(e.$type)),e.$type;r||(r=s(396));var n=new r(t||e.name);return i.decorateRoot.add(n),n.ctor=e,Object.defineProperty(e,"$type",{value:n,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:n,enumerable:!1}),n};var d=0;i.decorateEnum=function(e){if(e.$type)return e.$type;n||(n=s(238));var t=new n("Enum"+d++,e);return i.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},i.setProperty=function(e,t,s){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,s,r){var n=s.shift();if("__proto__"===n)return t;if(s.length>0)t[n]=e(t[n]||{},s,r);else{var i=t[n];i&&(r=[].concat(i).concat(r)),t[n]=r}return t}(e,t=t.split("."),s)},Object.defineProperty(i,"decorateRoot",{get:function(){return o.decorated||(o.decorated=new(s(6720)))}})},1427:(e,t,s)=>{"use strict";e.exports=n;var r=s(4652);function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=n.zero=new n(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var o=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var s=e>>>0,r=(e-s)/4294967296>>>0;return t&&(r=~r>>>0,s=~s>>>0,++s>4294967295&&(s=0,++r>4294967295&&(r=0))),new n(s,r)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if(r.isString(e)){if(!r.Long)return n.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):i},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,s=~this.hi>>>0;return t||(s=s+1>>>0),-(t+4294967296*s)}return this.lo+4294967296*this.hi},n.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;n.fromHash=function(e){return e===o?i:new n((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},n.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},n.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},n.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,s=this.hi>>>24;return 0===s?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:s<128?9:10}},4652:function(e,t,s){"use strict";var r=t;function n(e,t,s){for(var r=Object.keys(t),n=0;n<r.length;++n)void 0!==e[r[n]]&&s||(e[r[n]]=t[r[n]]);return e}function i(e){function t(e,s){if(!(this instanceof t))return new t(e,s);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),s&&n(this,s)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}r.asPromise=s(537),r.base64=s(9745),r.EventEmitter=s(4459),r.float=s(897),r.inquire=s(3229),r.utf8=s(113),r.pool=s(7986),r.LongBits=s(1427),r.isNode=Boolean(void 0!==s.g&&s.g&&s.g.process&&s.g.process.versions&&s.g.process.versions.node),r.global=r.isNode&&s.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var s=e[t];return!(null==s||!e.hasOwnProperty(t))&&("object"!=typeof s||(Array.isArray(s)?s.length:Object.keys(s).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var s=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(s.lo,s.hi,t):s.toNumber(Boolean(t))},r.merge=n,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=i,r.ProtocolError=i("ProtocolError"),r.oneOfGetter=function(e){for(var t={},s=0;s<e.length;++s)t[e[s]]=1;return function(){for(var e=Object.keys(this),s=e.length-1;s>-1;--s)if(1===t[e[s]]&&void 0!==this[e[s]]&&null!==this[e[s]])return e[s]}},r.oneOfSetter=function(e){return function(t){for(var s=0;s<e.length;++s)e[s]!==t&&delete this[e[s]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,s){return new e(t,s)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},5669:(e,t,s)=>{"use strict";e.exports=function(e){var t=n.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),s=e.oneofsArray,r={};s.length&&t("var p={}");for(var c=0;c<e.fieldsArray.length;++c){var u=e._fieldsArray[c].resolve(),d="m"+n.safeProp(u.name);if(u.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",d,u.name),u.map)t("if(!util.isObject(%s))",d)("return%j",i(u,"object"))("var k=Object.keys(%s)",d)("for(var i=0;i<k.length;++i){"),a(t,u,"k[i]"),o(t,u,c,d+"[k[i]]")("}");else if(u.repeated)t("if(!Array.isArray(%s))",d)("return%j",i(u,"array"))("for(var i=0;i<%s.length;++i){",d),o(t,u,c,d+"[i]")("}");else{if(u.partOf){var l=n.safeProp(u.partOf.name);1===r[u.partOf.name]&&t("if(p%s===1)",l)("return%j",u.partOf.name+": multiple values"),r[u.partOf.name]=1,t("p%s=1",l)}o(t,u,c,d)}u.optional&&t("}")}return t("return null")};var r=s(238),n=s(7886);function i(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function o(e,t,s,n){if(t.resolvedType)if(t.resolvedType instanceof r){e("switch(%s){",n)("default:")("return%j",i(t,"enum value"));for(var o=Object.keys(t.resolvedType.values),a=0;a<o.length;++a)e("case %i:",t.resolvedType.values[o[a]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",s,n)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",n)("return%j",i(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",n,n,n,n)("return%j",i(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',n)("return%j",i(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',n)("return%j",i(t,"boolean"));break;case"string":e("if(!util.isString(%s))",n)("return%j",i(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',n,n,n)("return%j",i(t,"buffer"))}return e}function a(e,t,s){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",s)("return%j",i(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",s)("return%j",i(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",s)("return%j",i(t,"boolean key"))}return e}},2016:(e,t,s)=>{"use strict";var r=t,n=s(5986);r[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),s=this.lookup(t);if(s){var r="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return-1===r.indexOf("/")&&(r="/"+r),this.create({type_url:r,value:s.encode(s.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var s="",r="";if(t&&t.json&&e.type_url&&e.value){r=e.type_url.substring(e.type_url.lastIndexOf("/")+1),s=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var i=this.lookup(r);i&&(e=i.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof n){var o=e.$type.toObject(e,t);return""===s&&(s="type.googleapis.com/"),r=s+("."===e.$type.fullName[0]?e.$type.fullName.substr(1):e.$type.fullName),o["@type"]=r,o}return this.toObject(e,t)}}},3117:(e,t,s)=>{"use strict";e.exports=l;var r,n=s(4652),i=n.LongBits,o=n.base64,a=n.utf8;function c(e,t,s){this.fn=e,this.len=t,this.next=void 0,this.val=s}function u(){}function d(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var h=function(){return n.Buffer?function(){return(l.create=function(){return new r})()}:function(){return new l}};function f(e,t,s){t[s]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function y(e,t,s){for(;e.hi;)t[s++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[s++]=127&e.lo|128,e.lo=e.lo>>>7;t[s++]=e.lo}function m(e,t,s){t[s]=255&e,t[s+1]=e>>>8&255,t[s+2]=e>>>16&255,t[s+3]=e>>>24}l.create=h(),l.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(l.alloc=n.pool(l.alloc,n.Array.prototype.subarray)),l.prototype._push=function(e,t,s){return this.tail=this.tail.next=new c(e,t,s),this.len+=t,this},p.prototype=Object.create(c.prototype),p.prototype.fn=function(e,t,s){for(;e>127;)t[s++]=127&e|128,e>>>=7;t[s]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(y,10,i.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=i.from(e);return this._push(y,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(y,t.length(),t)},l.prototype.bool=function(e){return this._push(f,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(m,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=i.from(e);return this._push(m,4,t.lo)._push(m,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var v=n.Array.prototype.set?function(e,t,s){t.set(e,s)}:function(e,t,s){for(var r=0;r<e.length;++r)t[s+r]=e[r]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(n.isString(e)){var s=l.alloc(t=o.length(e));o.decode(e,s,0),e=s}return this.uint32(t)._push(v,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(f,1,0)},l.prototype.fork=function(){return this.states=new d(this),this.head=this.tail=new c(u,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,s=this.len;return this.reset().uint32(s),s&&(this.tail.next=e.next,this.tail=t,this.len+=s),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),s=0;e;)e.fn(e.val,t,s),s+=e.len,e=e.next;return t},l._configure=function(e){r=e,l.create=h(),r._configure()}},4766:(e,t,s)=>{"use strict";e.exports=i;var r=s(3117);(i.prototype=Object.create(r.prototype)).constructor=i;var n=s(4652);function i(){r.call(this)}function o(e,t,s){e.length<40?n.utf8.write(e,t,s):t.utf8Write?t.utf8Write(e,s):t.write(e,s)}i._configure=function(){i.alloc=n._Buffer_allocUnsafe,i.writeBytesBuffer=n.Buffer&&n.Buffer.prototype instanceof Uint8Array&&"set"===n.Buffer.prototype.set.name?function(e,t,s){t.set(e,s)}:function(e,t,s){if(e.copy)e.copy(t,s,0,e.length);else for(var r=0;r<e.length;)t[s++]=e[r++]}},i.prototype.bytes=function(e){n.isString(e)&&(e=n._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.string=function(e){var t=n.Buffer.byteLength(e);return this.uint32(t),t&&this._push(o,t,e),this},i._configure()},537:e=>{"use strict";e.exports=function(e,t){var s=new Array(arguments.length-1),r=0,n=2,i=!0;for(;n<arguments.length;)s[r++]=arguments[n++];return new Promise((function(n,o){s[r]=function(e){if(i)if(i=!1,e)o(e);else{for(var t=new Array(arguments.length-1),s=0;s<t.length;)t[s++]=arguments[s];n.apply(null,t)}};try{e.apply(t||null,s)}catch(e){i&&(i=!1,o(e))}}))}},9745:(e,t)=>{"use strict";var s=t;s.length=function(e){var t=e.length;if(!t)return 0;for(var s=0;--t%4>1&&"="===e.charAt(t);)++s;return Math.ceil(3*e.length)/4-s};for(var r=new Array(64),n=new Array(123),i=0;i<64;)n[r[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;s.encode=function(e,t,s){for(var n,i=null,o=[],a=0,c=0;t<s;){var u=e[t++];switch(c){case 0:o[a++]=r[u>>2],n=(3&u)<<4,c=1;break;case 1:o[a++]=r[n|u>>4],n=(15&u)<<2,c=2;break;case 2:o[a++]=r[n|u>>6],o[a++]=r[63&u],c=0}a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),a=0)}return c&&(o[a++]=r[n],o[a++]=61,1===c&&(o[a++]=61)),i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join("")):String.fromCharCode.apply(String,o.slice(0,a))};var o="invalid encoding";s.decode=function(e,t,s){for(var r,i=s,a=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&a>1)break;if(void 0===(u=n[u]))throw Error(o);switch(a){case 0:r=u,a=1;break;case 1:t[s++]=r<<2|(48&u)>>4,r=u,a=2;break;case 2:t[s++]=(15&r)<<4|(60&u)>>2,r=u,a=3;break;case 3:t[s++]=(3&r)<<6|u,a=0}}if(1===a)throw Error(o);return s-i},s.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},6348:e=>{"use strict";function t(e,s){"string"==typeof e&&(s=e,e=void 0);var r=[];function n(e){if("string"!=typeof e){var s=i();if(t.verbose&&console.log("codegen: "+s),s="return "+s,e){for(var o=Object.keys(e),a=new Array(o.length+1),c=new Array(o.length),u=0;u<o.length;)a[u]=o[u],c[u]=e[o[u++]];return a[u]=s,Function.apply(null,a).apply(null,c)}return Function(s)()}for(var d=new Array(arguments.length-1),l=0;l<d.length;)d[l]=arguments[++l];if(l=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var s=d[l++];switch(t){case"d":case"f":return String(Number(s));case"i":return String(Math.floor(s));case"j":return JSON.stringify(s);case"s":return String(s)}return"%"})),l!==d.length)throw Error("parameter count mismatch");return r.push(e),n}function i(t){return"function "+(t||s||"")+"("+(e&&e.join(",")||"")+"){\n "+r.join("\n ")+"\n}"}return n.toString=i,n}e.exports=t,t.verbose=!1},4459:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,s){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:s||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var s=this._listeners[e],r=0;r<s.length;)s[r].fn===t?s.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var s=[],r=1;r<arguments.length;)s.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,s)}return this}},7803:(e,t,s)=>{"use strict";e.exports=i;var r=s(537),n=s(3229)("fs");function i(e,t,s){return"function"==typeof t?(s=t,t={}):t||(t={}),s?!t.xhr&&n&&n.readFile?n.readFile(e,(function(r,n){return r&&"undefined"!=typeof XMLHttpRequest?i.xhr(e,t,s):r?s(r):s(null,t.binary?n:n.toString("utf8"))})):i.xhr(e,t,s):r(i,this,e,t)}i.xhr=function(e,t,s){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(4===r.readyState){if(0!==r.status&&200!==r.status)return s(Error("status "+r.status));if(t.binary){var e=r.response;if(!e){e=[];for(var n=0;n<r.responseText.length;++n)e.push(255&r.responseText.charCodeAt(n))}return s(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return s(null,r.responseText)}},t.binary&&("overrideMimeType"in r&&r.overrideMimeType("text/plain; charset=x-user-defined"),r.responseType="arraybuffer"),r.open("GET",e),r.send()}},897:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),s=new Uint8Array(t.buffer),r=128===s[3];function n(e,r,n){t[0]=e,r[n]=s[0],r[n+1]=s[1],r[n+2]=s[2],r[n+3]=s[3]}function i(e,r,n){t[0]=e,r[n]=s[3],r[n+1]=s[2],r[n+2]=s[1],r[n+3]=s[0]}function o(e,r){return s[0]=e[r],s[1]=e[r+1],s[2]=e[r+2],s[3]=e[r+3],t[0]}function a(e,r){return s[3]=e[r],s[2]=e[r+1],s[1]=e[r+2],s[0]=e[r+3],t[0]}e.writeFloatLE=r?n:i,e.writeFloatBE=r?i:n,e.readFloatLE=r?o:a,e.readFloatBE=r?a:o}():function(){function t(e,t,s,r){var n=t<0?1:0;if(n&&(t=-t),0===t)e(1/t>0?0:2147483648,s,r);else if(isNaN(t))e(2143289344,s,r);else if(t>34028234663852886e22)e((n<<31|2139095040)>>>0,s,r);else if(t<11754943508222875e-54)e((n<<31|Math.round(t/1401298464324817e-60))>>>0,s,r);else{var i=Math.floor(Math.log(t)/Math.LN2);e((n<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,s,r)}}function o(e,t,s){var r=e(t,s),n=2*(r>>31)+1,i=r>>>23&255,o=8388607&r;return 255===i?o?NaN:n*(1/0):0===i?1401298464324817e-60*n*o:n*Math.pow(2,i-150)*(o+8388608)}e.writeFloatLE=t.bind(null,s),e.writeFloatBE=t.bind(null,r),e.readFloatLE=o.bind(null,n),e.readFloatBE=o.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),s=new Uint8Array(t.buffer),r=128===s[7];function n(e,r,n){t[0]=e,r[n]=s[0],r[n+1]=s[1],r[n+2]=s[2],r[n+3]=s[3],r[n+4]=s[4],r[n+5]=s[5],r[n+6]=s[6],r[n+7]=s[7]}function i(e,r,n){t[0]=e,r[n]=s[7],r[n+1]=s[6],r[n+2]=s[5],r[n+3]=s[4],r[n+4]=s[3],r[n+5]=s[2],r[n+6]=s[1],r[n+7]=s[0]}function o(e,r){return s[0]=e[r],s[1]=e[r+1],s[2]=e[r+2],s[3]=e[r+3],s[4]=e[r+4],s[5]=e[r+5],s[6]=e[r+6],s[7]=e[r+7],t[0]}function a(e,r){return s[7]=e[r],s[6]=e[r+1],s[5]=e[r+2],s[4]=e[r+3],s[3]=e[r+4],s[2]=e[r+5],s[1]=e[r+6],s[0]=e[r+7],t[0]}e.writeDoubleLE=r?n:i,e.writeDoubleBE=r?i:n,e.readDoubleLE=r?o:a,e.readDoubleBE=r?a:o}():function(){function t(e,t,s,r,n,i){var o=r<0?1:0;if(o&&(r=-r),0===r)e(0,n,i+t),e(1/r>0?0:2147483648,n,i+s);else if(isNaN(r))e(0,n,i+t),e(2146959360,n,i+s);else if(r>17976931348623157e292)e(0,n,i+t),e((o<<31|2146435072)>>>0,n,i+s);else{var a;if(r<22250738585072014e-324)e((a=r/5e-324)>>>0,n,i+t),e((o<<31|a/4294967296)>>>0,n,i+s);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=r*Math.pow(2,-c))>>>0,n,i+t),e((o<<31|c+1023<<20|1048576*a&1048575)>>>0,n,i+s)}}}function o(e,t,s,r,n){var i=e(r,n+t),o=e(r,n+s),a=2*(o>>31)+1,c=o>>>20&2047,u=4294967296*(1048575&o)+i;return 2047===c?u?NaN:a*(1/0):0===c?5e-324*a*u:a*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,s,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=o.bind(null,n,0,4),e.readDoubleBE=o.bind(null,i,4,0)}(),e}function s(e,t,s){t[s]=255&e,t[s+1]=e>>>8&255,t[s+2]=e>>>16&255,t[s+3]=e>>>24}function r(e,t,s){t[s]=e>>>24,t[s+1]=e>>>16&255,t[s+2]=e>>>8&255,t[s+3]=255&e}function n(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function i(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},3229:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},1272:(e,t)=>{"use strict";var s=t,r=s.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},n=s.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),s=r(e),n="";s&&(n=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):s?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return n+t.join("/")};s.resolve=function(e,t,s){return s||(t=n(t)),r(t)?t:(s||(e=n(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?n(e+"/"+t):t)}},7986:e=>{"use strict";e.exports=function(e,t,s){var r=s||8192,n=r>>>1,i=null,o=r;return function(s){if(s<1||s>n)return e(s);o+s>r&&(i=e(r),o=0);var a=t.call(i,o,o+=s);return 7&o&&(o=1+(7|o)),a}}},113:(e,t)=>{"use strict";var s=t;s.length=function(e){for(var t=0,s=0,r=0;r<e.length;++r)(s=e.charCodeAt(r))<128?t+=1:s<2048?t+=2:55296==(64512&s)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},s.read=function(e,t,s){if(s-t<1)return"";for(var r,n=null,i=[],o=0;t<s;)(r=e[t++])<128?i[o++]=r:r>191&&r<224?i[o++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[o++]=55296+(r>>10),i[o++]=56320+(1023&r)):i[o++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,i)),o=0);return n?(o&&n.push(String.fromCharCode.apply(String,i.slice(0,o))),n.join("")):String.fromCharCode.apply(String,i.slice(0,o))},s.write=function(e,t,s){for(var r,n,i=s,o=0;o<e.length;++o)(r=e.charCodeAt(o))<128?t[s++]=r:r<2048?(t[s++]=r>>6|192,t[s++]=63&r|128):55296==(64512&r)&&56320==(64512&(n=e.charCodeAt(o+1)))?(r=65536+((1023&r)<<10)+(1023&n),++o,t[s++]=r>>18|240,t[s++]=r>>12&63|128,t[s++]=r>>6&63|128,t[s++]=63&r|128):(t[s++]=r>>12|224,t[s++]=r>>6&63|128,t[s++]=63&r|128);return s-i}},3286:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});var r=s(7758),n=s.n(r)()((function(e){return e[1]}));n.push([e.id,".ck.ck-balloon-panel.ck-tooltip{pointer-events:none;z-index:calc(var(--ck-z-modal) + 100)}:root{--ck-color-presence-list-dropdown-background:#fff;--ck-color-presence-list-dropdown-arrow-border:#ebebeb;--ck-presence-list-dropdown-list-max-width:250px;--ck-presence-list-dropdown-list-min-width:180px;--ck-presence-list-users-tooltip-max-width:120px;--ck-presence-list-users-tooltip-min-width:25px}.ck.ck-presence-list{align-items:center;display:flex;font-size:var(--ck-font-size-base);margin-right:var(--ck-spacing-standard);transition:margin-right .2s ease-in-out}.ck.ck-presence-list *{box-sizing:border-box}.ck.ck-presence-list__list{display:flex;justify-content:flex-end}.ck.ck-presence-list__counter{color:var(--ck-color-base-text)}.ck.ck-presence-list__counter--hidden{display:none}.ck.ck-presence-list__list-item{background:none;border:0;color:inherit;font:inherit;margin-left:var(--ck-spacing-standard);outline:none;padding:0;position:relative}.ck.ck-tooltip.ck-presence-list__list-item__tooltip>.ck-tooltip__text{display:inline-block;max-width:var(--ck-presence-list-users-tooltip-max-width);overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__marker{display:block;height:3px;margin-top:3px;position:relative;width:100%}.ck.ck-presence-list--collapsed .ck-presence-list__list{margin-left:var(--ck-spacing-standard);min-width:calc(var(--ck-user-avatar-size)*1.5)}.ck.ck-presence-list--collapsed .ck-presence-list__list *{cursor:pointer;transition:all .4s ease-in-out}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item{margin-left:calc(var(--ck-user-avatar-size)*-1 + 5px)}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(5){opacity:.15}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(4){opacity:.35}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(3){opacity:.55}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(2){opacity:.75}.ck.ck-presence-list__balloon{--ck-color-panel-border:var(--ck-color-presence-list-dropdown-arrow-border);--ck-color-panel-background:var(--ck-color-presence-list-dropdown-background);animation:fadeIn .3s ease-in-out;background-color:var(--ck-color-presence-list-dropdown-background);border:0;opacity:1}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-wrapper{border-radius:var(--ck-border-radius);max-height:80vh;max-width:var(--ck-presence-list-dropdown-list-max-width);min-width:var(--ck-presence-list-dropdown-list-min-width);overflow-x:hidden;overflow-y:auto}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item{align-items:center;background:none;border:0;color:inherit;display:flex;font:inherit;outline:none;padding:0;padding:var(--ck-spacing-standard);position:relative}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:first-of-type .ck-presence-list__marker{border-top-left-radius:var(--ck-border-radius)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:last-of-type .ck-presence-list__marker{border-bottom-left-radius:var(--ck-border-radius)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list .ck-user__full-name{color:var(--ck-color-base-text);margin-left:var(--ck-spacing-standard);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list .ck.ck-presence-list__marker{height:100%;left:0;margin:0;position:absolute;width:3px}.ck-presence-list__balloon button.ck-presence-list__dropdown-list-item *,.ck-presence-list__list button.ck-presence-list__list-item *{cursor:pointer}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}",""]);const i=n},9940:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});var r=s(7758),n=s.n(r)()((function(e){return e[1]}));n.push([e.id,".ck .ck-user__marker{cursor:default;display:inline;position:relative}.ck .ck-user__marker:after{color:#fff;content:attr(data-name);display:none;font-family:Georgia,sans-serif;font-size:var(--ck-font-size-base);font-style:normal;font-weight:400;left:0;line-height:1;opacity:0;padding:var(--ck-spacing-small);position:absolute;top:-20px;transition:opacity .2s linear,transform .3s ease-in-out;white-space:nowrap;z-index:99999}.ck .ck-user__marker:hover .ck-user__marker-dot{width:0}.ck .ck-user__marker:hover:after{animation:fadeInLeft .3s ease-in-out;display:block;opacity:1}.ck .ck-user__marker-line{bottom:0;height:100%;position:absolute;width:0}.ck .ck-user__marker-dot{border-radius:50%;cursor:default;display:block;height:var(--ck-user-dot-size);left:50%;position:absolute;top:calc((var(--ck-user-dot-size)/2)*-1);transform:translate(-50%,-50%);width:var(--ck-user-dot-size)}.ck .ck-placeholder .ck-user__marker{display:none}@keyframes fadeInLeft{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}",""]);const i=n},7758:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var s=e(t);return t[2]?"@media ".concat(t[2]," {").concat(s,"}"):s})).join("")},t.i=function(e,s,r){"string"==typeof e&&(e=[[null,e,""]]);var n={};if(r)for(var i=0;i<this.length;i++){var o=this[i][0];null!=o&&(n[o]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);r&&n[c[0]]||(s&&(c[2]?c[2]="".concat(s," and ").concat(c[2]):c[2]=s),t.push(c))}},t}},7154:e=>{var t=1e3,s=60*t,r=60*s,n=24*r,i=7*n,o=365.25*n;function a(e,t,s,r){var n=t>=1.5*s;return Math.round(e/s)+" "+r+(n?"s":"")}e.exports=function(e,c){c=c||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*n;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*s;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&isFinite(e))return c.long?function(e){var i=Math.abs(e);if(i>=n)return a(e,i,n,"day");if(i>=r)return a(e,i,r,"hour");if(i>=s)return a(e,i,s,"minute");if(i>=t)return a(e,i,t,"second");return e+" ms"}(e):function(e){var i=Math.abs(e);if(i>=n)return Math.round(e/n)+"d";if(i>=r)return Math.round(e/r)+"h";if(i>=s)return Math.round(e/s)+"m";if(i>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},5579:(e,t,s)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const s="color: "+this.color;t.splice(1,0,s,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(n=r))})),t.splice(n,0,s)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=s(3847)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},3847:(e,t,s)=>{e.exports=function(e){function t(e){let s,n,i,o=null;function a(...e){if(!a.enabled)return;const r=a,n=Number(new Date),i=n-(s||n);r.diff=i,r.prev=s,r.curr=n,s=n,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((s,n)=>{if("%%"===s)return"%";o++;const i=t.formatters[n];if("function"==typeof i){const t=e[o];s=i.call(r,t),e.splice(o,1),o--}return s})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(n!==t.namespaces&&(n=t.namespaces,i=t.enabled(e)),i),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,s){const r=t(this.namespace+(void 0===s?":":s)+e);return r.log=this.log,r}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(n),...t.skips.map(n).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let s;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),n=r.length;for(s=0;s<n;s++)r[s]&&("-"===(e=r[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let s,r;for(s=0,r=t.skips.length;s<r;s++)if(t.skips[s].test(e))return!1;for(s=0,r=t.names.length;s<r;s++)if(t.names[s].test(e))return!0;return!1},t.humanize=s(7154),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((s=>{t[s]=e[s]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let s=0;for(let t=0;t<e.length;t++)s=(s<<5)-s+e.charCodeAt(t),s|=0;return t.colors[Math.abs(s)%t.colors.length]},t.enable(t.load()),t}},6154:(e,t,s)=>{"use strict";e.exports=s(7278)},6274:(e,t,s)=>{"use strict";var r=t,n=s(4937),i=s(7572);function o(e,t,s,r){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(d%s){",r);for(var i=t.resolvedType.values,o=Object.keys(i),a=0;a<o.length;++a)t.repeated&&i[o[a]]===t.typeDefault&&e("default:"),e("case%j:",o[a])("case %i:",i[o[a]])("m%s=%j",r,i[o[a]])("break");e("}")}else e('if(typeof d%s!=="object")',r)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",r,s,r);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",r,r);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",r,r);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",r,r);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",r,r,c)('else if(typeof d%s==="string")',r)("m%s=parseInt(d%s,10)",r,r)('else if(typeof d%s==="number")',r)("m%s=d%s",r,r)('else if(typeof d%s==="object")',r)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",r,r,r,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',r)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",r,r,r)("else if(d%s.length >= 0)",r)("m%s=d%s",r,r);break;case"string":e("m%s=String(d%s)",r,r);break;case"bool":e("m%s=Boolean(d%s)",r,r)}}return e}function a(e,t,s,r){if(t.resolvedType)t.resolvedType instanceof n?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",r,s,r,r):e("d%s=types[%i].toObject(m%s,o)",r,s,r);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,r,r,r);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',r)("d%s=o.longs===String?String(m%s):m%s",r,r,r)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",r,r,r,r,i?"true":"",r);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",r,r,r,r,r);break;default:e("d%s=m%s",r,r)}}return e}r.fromObject=function(e){var t=e.fieldsArray,s=i.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return s("return new this.ctor");s("var m=new this.ctor");for(var r=0;r<t.length;++r){var a=t[r].resolve(),c=i.safeProp(a.name);a.map?(s("if(d%s){",c)('if(typeof d%s!=="object")',c)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",c)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",c),o(s,a,r,c+"[ks[i]]")("}")("}")):a.repeated?(s("if(d%s){",c)("if(!Array.isArray(d%s))",c)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",c)("for(var i=0;i<d%s.length;++i){",c),o(s,a,r,c+"[i]")("}")("}")):(a.resolvedType instanceof n||s("if(d%s!=null){",c),o(s,a,r,c),a.resolvedType instanceof n||s("}"))}return s("return m")},r.toObject=function(e){var t=e.fieldsArray.slice().sort(i.compareFieldsById);if(!t.length)return i.codegen()("return {}");for(var s=i.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),r=[],o=[],c=[],u=0;u<t.length;++u)t[u].partOf||(t[u].resolve().repeated?r:t[u].map?o:c).push(t[u]);if(r.length){for(s("if(o.arrays||o.defaults){"),u=0;u<r.length;++u)s("d%s=[]",i.safeProp(r[u].name));s("}")}if(o.length){for(s("if(o.objects||o.defaults){"),u=0;u<o.length;++u)s("d%s={}",i.safeProp(o[u].name));s("}")}if(c.length){for(s("if(o.defaults){"),u=0;u<c.length;++u){var d=c[u],l=i.safeProp(d.name);if(d.resolvedType instanceof n)s("d%s=o.enums===String?%j:%j",l,d.resolvedType.valuesById[d.typeDefault],d.typeDefault);else if(d.long)s("if(util.Long){")("var n=new util.Long(%i,%i,%j)",d.typeDefault.low,d.typeDefault.high,d.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",l)("}else")("d%s=o.longs===String?%j:%i",l,d.typeDefault.toString(),d.typeDefault.toNumber());else if(d.bytes){var h="["+Array.prototype.slice.call(d.typeDefault).join(",")+"]";s("if(o.bytes===String)d%s=%j",l,String.fromCharCode.apply(String,d.typeDefault))("else{")("d%s=%s",l,h)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",l,l)("}")}else s("d%s=%j",l,d.typeDefault)}s("}")}var f=!1;for(u=0;u<t.length;++u){d=t[u];var p=e._fieldsArray.indexOf(d);l=i.safeProp(d.name);d.map?(f||(f=!0,s("var ks2")),s("if(m%s&&(ks2=Object.keys(m%s)).length){",l,l)("d%s={}",l)("for(var j=0;j<ks2.length;++j){"),a(s,d,p,l+"[ks2[j]]")("}")):d.repeated?(s("if(m%s&&m%s.length){",l,l)("d%s=[]",l)("for(var j=0;j<m%s.length;++j){",l),a(s,d,p,l+"[j]")("}")):(s("if(m%s!=null&&m.hasOwnProperty(%j)){",l,d.name),a(s,d,p,l),d.partOf&&s("if(o.oneofs)")("d%s=%j",i.safeProp(d.partOf.name),d.name)),s("}")}return s("return d")}},4799:(e,t,s)=>{"use strict";e.exports=function(e){var t=i.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break");t("switch(t>>>3){");for(var s=0;s<e.fieldsArray.length;++s){var a=e._fieldsArray[s].resolve(),c=a.resolvedType instanceof r?"int32":a.type,u="m"+i.safeProp(a.name);t("case %i: {",a.id),a.map?(t("if(%s===util.emptyObject)",u)("%s={}",u)("var c2 = r.uint32()+r.pos"),void 0!==n.defaults[a.keyType]?t("k=%j",n.defaults[a.keyType]):t("k=null"),void 0!==n.defaults[c]?t("value=%j",n.defaults[c]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===n.basic[c]?t("value=types[%i].decode(r,r.uint32())",s):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==n.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):a.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==n.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",u,c)("}else"),void 0===n.basic[c]?t(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",u,s):t("%s.push(r.%s())",u,c)):void 0===n.basic[c]?t(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",u,s):t("%s=r.%s()",u,c),t("break")("}")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),s=0;s<e._fieldsArray.length;++s){var d=e._fieldsArray[s];d.required&&t("if(!m.hasOwnProperty(%j))",d.name)("throw util.ProtocolError(%j,{instance:m})",o(d))}return t("return m")};var r=s(4937),n=s(8997),i=s(7572);function o(e){return"missing required '"+e.name+"'"}},6382:(e,t,s)=>{"use strict";e.exports=function(e){for(var t,s=i.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(i.compareFieldsById),c=0;c<a.length;++c){var u=a[c].resolve(),d=e._fieldsArray.indexOf(u),l=u.resolvedType instanceof r?"int32":u.type,h=n.basic[l];t="m"+i.safeProp(u.name),u.map?(s("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,u.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(u.id<<3|2)>>>0,8|n.mapKey[u.keyType],u.keyType),void 0===h?s("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",d,t):s(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,l,t),s("}")("}")):u.repeated?(s("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==n.packed[l]?s("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",l,t)("w.ldelim()"):(s("for(var i=0;i<%s.length;++i)",t),void 0===h?o(s,u,d,t+"[i]"):s("w.uint32(%i).%s(%s[i])",(u.id<<3|h)>>>0,l,t)),s("}")):(u.optional&&s("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===h?o(s,u,d,t):s("w.uint32(%i).%s(%s)",(u.id<<3|h)>>>0,l,t))}return s("return w")};var r=s(4937),n=s(8997),i=s(7572);function o(e,t,s,r){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",s,r,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",s,r,(t.id<<3|2)>>>0)}},4937:(e,t,s)=>{"use strict";e.exports=o;var r=s(4154);((o.prototype=Object.create(r.prototype)).constructor=o).className="Enum";var n=s(512),i=s(7572);function o(e,t,s,n,i){if(r.call(this,e,s),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=i||{},this.reserved=void 0,t)for(var o=Object.keys(t),a=0;a<o.length;++a)"number"==typeof t[o[a]]&&(this.valuesById[this.values[o[a]]=t[o[a]]]=o[a])}o.fromJSON=function(e,t){var s=new o(e,t.values,t.options,t.comment,t.comments);return s.reserved=t.reserved,s},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},o.prototype.add=function(e,t,s){if(!i.isString(e))throw TypeError("name must be a string");if(!i.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=s||null,this},o.prototype.remove=function(e){if(!i.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},o.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},o.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)}},5891:(e,t,s)=>{"use strict";e.exports=u;var r=s(4154);((u.prototype=Object.create(r.prototype)).constructor=u).className="Field";var n,i=s(4937),o=s(8997),a=s(7572),c=/^required|optional|repeated$/;function u(e,t,s,n,i,u,d){if(a.isObject(n)?(d=i,u=n,n=i=void 0):a.isObject(i)&&(d=u,u=i,i=void 0),r.call(this,e,u),!a.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!a.isString(s))throw TypeError("type must be a string");if(void 0!==n&&!c.test(n=n.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==i&&!a.isString(i))throw TypeError("extend must be a string");"proto3_optional"===n&&(n="optional"),this.rule=n&&"optional"!==n?n:void 0,this.type=s,this.id=t,this.extend=i||void 0,this.required="required"===n,this.optional=!this.required,this.repeated="repeated"===n,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!a.Long&&void 0!==o.long[s],this.bytes="bytes"===s,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=d}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,s){return"packed"===e&&(this._packed=null),r.prototype.setOption.call(this,e,t,s)},u.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=o.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof n?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof i&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof i)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof n&&(this.parent.ctor.prototype[this.name]=this.defaultValue),r.prototype.resolve.call(this)},u.d=function(e,t,s,r){return"function"==typeof t?t=a.decorateType(t).name:t&&"object"==typeof t&&(t=a.decorateEnum(t).name),function(n,i){a.decorateType(n.constructor).add(new u(i,e,t,s,{default:r}))}},u._configure=function(e){n=e}},7278:(e,t,s)=>{"use strict";var r=e.exports=s(3278);r.build="light",r.load=function(e,t,s){return"function"==typeof t?(s=t,t=new r.Root):t||(t=new r.Root),t.load(e,s)},r.loadSync=function(e,t){return t||(t=new r.Root),t.loadSync(e)},r.encoder=s(6382),r.decoder=s(4799),r.verifier=s(8600),r.converter=s(6274),r.ReflectionObject=s(4154),r.Namespace=s(512),r.Root=s(2613),r.Enum=s(4937),r.Type=s(4560),r.Field=s(5891),r.OneOf=s(3044),r.MapField=s(8911),r.Service=s(877),r.Method=s(4935),r.Message=s(4777),r.wrappers=s(3375),r.types=s(8997),r.util=s(7572),r.ReflectionObject._configure(r.Root),r.Namespace._configure(r.Type,r.Service,r.Enum),r.Root._configure(r.Type),r.Field._configure(r.Type)},3278:(e,t,s)=>{"use strict";var r=t;function n(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=s(2944),r.BufferWriter=s(2178),r.Reader=s(9867),r.BufferReader=s(2676),r.util=s(4155),r.rpc=s(3290),r.roots=s(284),r.configure=n,n()},8911:(e,t,s)=>{"use strict";e.exports=o;var r=s(5891);((o.prototype=Object.create(r.prototype)).constructor=o).className="MapField";var n=s(8997),i=s(7572);function o(e,t,s,n,o,a){if(r.call(this,e,t,n,void 0,void 0,o,a),!i.isString(s))throw TypeError("keyType must be a string");this.keyType=s,this.resolvedKeyType=null,this.map=!0}o.fromJSON=function(e,t){return new o(e,t.id,t.keyType,t.type,t.options,t.comment)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},o.prototype.resolve=function(){if(this.resolved)return this;if(void 0===n.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return r.prototype.resolve.call(this)},o.d=function(e,t,s){return"function"==typeof s?s=i.decorateType(s).name:s&&"object"==typeof s&&(s=i.decorateEnum(s).name),function(r,n){i.decorateType(r.constructor).add(new o(n,e,t,s))}}},4777:(e,t,s)=>{"use strict";e.exports=n;var r=s(4155);function n(e){if(e)for(var t=Object.keys(e),s=0;s<t.length;++s)this[t[s]]=e[t[s]]}n.create=function(e){return this.$type.create(e)},n.encode=function(e,t){return this.$type.encode(e,t)},n.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},n.decode=function(e){return this.$type.decode(e)},n.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},n.verify=function(e){return this.$type.verify(e)},n.fromObject=function(e){return this.$type.fromObject(e)},n.toObject=function(e,t){return this.$type.toObject(e,t)},n.prototype.toJSON=function(){return this.$type.toObject(this,r.toJSONOptions)}},4935:(e,t,s)=>{"use strict";e.exports=i;var r=s(4154);((i.prototype=Object.create(r.prototype)).constructor=i).className="Method";var n=s(7572);function i(e,t,s,i,o,a,c,u,d){if(n.isObject(o)?(c=o,o=a=void 0):n.isObject(a)&&(c=a,a=void 0),void 0!==t&&!n.isString(t))throw TypeError("type must be a string");if(!n.isString(s))throw TypeError("requestType must be a string");if(!n.isString(i))throw TypeError("responseType must be a string");r.call(this,e,c),this.type=t||"rpc",this.requestType=s,this.requestStream=!!o||void 0,this.responseType=i,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=d}i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return n.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),r.prototype.resolve.call(this))}},512:(e,t,s)=>{"use strict";e.exports=d;var r=s(4154);((d.prototype=Object.create(r.prototype)).constructor=d).className="Namespace";var n,i,o,a=s(5891),c=s(7572);function u(e,t){if(e&&e.length){for(var s={},r=0;r<e.length;++r)s[e[r].name]=e[r].toJSON(t);return s}}function d(e,t){r.call(this,e,t),this.nested=void 0,this._nestedArray=null}function l(e){return e._nestedArray=null,e}d.fromJSON=function(e,t){return new d(e,t.options).addJSON(t.nested)},d.arrayToJSON=u,d.isReservedId=function(e,t){if(e)for(var s=0;s<e.length;++s)if("string"!=typeof e[s]&&e[s][0]<=t&&e[s][1]>t)return!0;return!1},d.isReservedName=function(e,t){if(e)for(var s=0;s<e.length;++s)if(e[s]===t)return!0;return!1},Object.defineProperty(d.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=c.toArray(this.nested))}}),d.prototype.toJSON=function(e){return c.toObject(["options",this.options,"nested",u(this.nestedArray,e)])},d.prototype.addJSON=function(e){if(e)for(var t,s=Object.keys(e),r=0;r<s.length;++r)t=e[s[r]],this.add((void 0!==t.fields?n.fromJSON:void 0!==t.values?o.fromJSON:void 0!==t.methods?i.fromJSON:void 0!==t.id?a.fromJSON:d.fromJSON)(s[r],t));return this},d.prototype.get=function(e){return this.nested&&this.nested[e]||null},d.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof o)return this.nested[e].values;throw Error("no such enum: "+e)},d.prototype.add=function(e){if(!(e instanceof a&&void 0!==e.extend||e instanceof n||e instanceof o||e instanceof i||e instanceof d))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof d&&e instanceof d)||t instanceof n||t instanceof i)throw Error("duplicate name '"+e.name+"' in "+this);for(var s=t.nestedArray,r=0;r<s.length;++r)e.add(s[r]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),l(this)},d.prototype.remove=function(e){if(!(e instanceof r))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),l(this)},d.prototype.define=function(e,t){if(c.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var s=this;e.length>0;){var r=e.shift();if(s.nested&&s.nested[r]){if(!((s=s.nested[r])instanceof d))throw Error("path conflicts with non-namespace objects")}else s.add(s=new d(r))}return t&&s.addJSON(t),s},d.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof d?e[t++].resolveAll():e[t++].resolve();return this.resolve()},d.prototype.lookup=function(e,t,s){if("boolean"==typeof t?(s=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),c.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var r=this.get(e[0]);if(r){if(1===e.length){if(!t||t.indexOf(r.constructor)>-1)return r}else if(r instanceof d&&(r=r.lookup(e.slice(1),t,!0)))return r}else for(var n=0;n<this.nestedArray.length;++n)if(this._nestedArray[n]instanceof d&&(r=this._nestedArray[n].lookup(e,t,!0)))return r;return null===this.parent||s?null:this.parent.lookup(e,t)},d.prototype.lookupType=function(e){var t=this.lookup(e,[n]);if(!t)throw Error("no such type: "+e);return t},d.prototype.lookupEnum=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},d.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[n,o]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},d.prototype.lookupService=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},d._configure=function(e,t,s){n=e,i=t,o=s}},4154:(e,t,s)=>{"use strict";e.exports=i,i.className="ReflectionObject";var r,n=s(7572);function i(e,t){if(!n.isString(e))throw TypeError("name must be a string");if(t&&!n.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(i.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),i.prototype.toJSON=function(){throw Error()},i.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof r&&t._handleAdd(this)},i.prototype.onRemove=function(e){var t=e.root;t instanceof r&&t._handleRemove(this),this.parent=null,this.resolved=!1},i.prototype.resolve=function(){return this.resolved||this.root instanceof r&&(this.resolved=!0),this},i.prototype.getOption=function(e){if(this.options)return this.options[e]},i.prototype.setOption=function(e,t,s){return s&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},i.prototype.setParsedOption=function(e,t,s){this.parsedOptions||(this.parsedOptions=[]);var r=this.parsedOptions;if(s){var i=r.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(i){var o=i[e];n.setProperty(o,s,t)}else(i={})[e]=n.setProperty({},s,t),r.push(i)}else{var a={};a[e]=t,r.push(a)}return this},i.prototype.setOptions=function(e,t){if(e)for(var s=Object.keys(e),r=0;r<s.length;++r)this.setOption(s[r],e[s[r]],t);return this},i.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},i._configure=function(e){r=e}},3044:(e,t,s)=>{"use strict";e.exports=o;var r=s(4154);((o.prototype=Object.create(r.prototype)).constructor=o).className="OneOf";var n=s(5891),i=s(7572);function o(e,t,s,n){if(Array.isArray(t)||(s=t,t=void 0),r.call(this,e,s),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=n}function a(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}o.fromJSON=function(e,t){return new o(e,t.oneof,t.options,t.comment)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},o.prototype.add=function(e){if(!(e instanceof n))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,a(this),this},o.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},o.prototype.onAdd=function(e){r.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var s=e.get(this.oneof[t]);s&&!s.partOf&&(s.partOf=this,this.fieldsArray.push(s))}a(this)},o.prototype.onRemove=function(e){for(var t,s=0;s<this.fieldsArray.length;++s)(t=this.fieldsArray[s]).parent&&t.parent.remove(t);r.prototype.onRemove.call(this,e)},o.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,s){i.decorateType(t.constructor).add(new o(s,e)),Object.defineProperty(t,s,{get:i.oneOfGetter(e),set:i.oneOfSetter(e)})}}},9867:(e,t,s)=>{"use strict";e.exports=c;var r,n=s(4155),i=n.LongBits,o=n.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,d="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return n.Buffer?function(e){return(c.create=function(e){return n.Buffer.isBuffer(e)?new r(e):d(e)})(e)}:d};function h(){var e=new i(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function f(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw a(this,8);return new i(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return f(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|f(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,s=this.pos+e;if(s>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,s):t===s?new this.buf.constructor(0):this._slice.call(this.buf,t,s)},c.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){r=e,c.create=l(),r._configure();var t=n.Long?"toLong":"toNumber";n.merge(c.prototype,{int64:function(){return h.call(this)[t](!1)},uint64:function(){return h.call(this)[t](!0)},sint64:function(){return h.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},2676:(e,t,s)=>{"use strict";e.exports=i;var r=s(9867);(i.prototype=Object.create(r.prototype)).constructor=i;var n=s(4155);function i(e){r.call(this,e)}i._configure=function(){n.Buffer&&(i.prototype._slice=n.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()},2613:(e,t,s)=>{"use strict";e.exports=l;var r=s(512);((l.prototype=Object.create(r.prototype)).constructor=l).className="Root";var n,i,o,a=s(5891),c=s(4937),u=s(3044),d=s(7572);function l(e){r.call(this,"",e),this.deferred=[],this.files=[]}function h(){}l.fromJSON=function(e,t){return t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},l.prototype.resolvePath=d.path.resolve,l.prototype.fetch=d.fetch,l.prototype.load=function e(t,s,r){"function"==typeof s&&(r=s,s=void 0);var n=this;if(!r)return d.asPromise(e,n,t,s);var a=r===h;function c(e,t){if(r){var s=r;if(r=null,a)throw e;s(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var s=e.substring(t);if(s in o)return s}return null}function l(e,t){try{if(d.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),d.isString(t)){i.filename=e;var r,o=i(t,n,s),l=0;if(o.imports)for(;l<o.imports.length;++l)(r=u(o.imports[l])||n.resolvePath(e,o.imports[l]))&&f(r);if(o.weakImports)for(l=0;l<o.weakImports.length;++l)(r=u(o.weakImports[l])||n.resolvePath(e,o.weakImports[l]))&&f(r,!0)}else n.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}a||p||c(null,n)}function f(e,t){if(!(n.files.indexOf(e)>-1))if(n.files.push(e),e in o)a?l(e,o[e]):(++p,setTimeout((function(){--p,l(e,o[e])})));else if(a){var s;try{s=d.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}l(e,s)}else++p,n.fetch(e,(function(s,i){--p,r&&(s?t?p||c(null,n):c(s):l(e,i))}))}var p=0;d.isString(t)&&(t=[t]);for(var y,m=0;m<t.length;++m)(y=n.resolvePath("",t[m]))&&f(y);if(a)return n;p||c(null,n)},l.prototype.loadSync=function(e,t){if(!d.isNode)throw Error("not supported");return this.load(e,t,h)},l.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return r.prototype.resolveAll.call(this)};var f=/^[A-Z]/;function p(e,t){var s=t.parent.lookup(t.extend);if(s){var r=new a(t.fullName,t.id,t.type,t.rule,void 0,t.options);return r.declaringField=t,t.extensionField=r,s.add(r),!0}return!1}l.prototype._handleAdd=function(e){if(e instanceof a)void 0===e.extend||e.extensionField||p(0,e)||this.deferred.push(e);else if(e instanceof c)f.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof u)){if(e instanceof n)for(var t=0;t<this.deferred.length;)p(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var s=0;s<e.nestedArray.length;++s)this._handleAdd(e._nestedArray[s]);f.test(e.name)&&(e.parent[e.name]=e)}},l.prototype._handleRemove=function(e){if(e instanceof a){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof c)f.test(e.name)&&delete e.parent[e.name];else if(e instanceof r){for(var s=0;s<e.nestedArray.length;++s)this._handleRemove(e._nestedArray[s]);f.test(e.name)&&delete e.parent[e.name]}},l._configure=function(e,t,s){n=e,i=t,o=s}},284:e=>{"use strict";e.exports={}},3290:(e,t,s)=>{"use strict";t.Service=s(979)},979:(e,t,s)=>{"use strict";e.exports=n;var r=s(4155);function n(e,t,s){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(s)}(n.prototype=Object.create(r.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function e(t,s,n,i,o){if(!i)throw TypeError("request must be specified");var a=this;if(!o)return r.asPromise(e,a,t,s,n,i);if(a.rpcImpl)try{return a.rpcImpl(t,s[a.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,s){if(e)return a.emit("error",e,t),o(e);if(null!==s){if(!(s instanceof n))try{s=n[a.responseDelimited?"decodeDelimited":"decode"](s)}catch(e){return a.emit("error",e,t),o(e)}return a.emit("data",s,t),o(null,s)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){o(e)}),0)}else setTimeout((function(){o(Error("already ended"))}),0)},n.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},877:(e,t,s)=>{"use strict";e.exports=a;var r=s(512);((a.prototype=Object.create(r.prototype)).constructor=a).className="Service";var n=s(4935),i=s(7572),o=s(3290);function a(e,t){r.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}a.fromJSON=function(e,t){var s=new a(e,t.options);if(t.methods)for(var r=Object.keys(t.methods),i=0;i<r.length;++i)s.add(n.fromJSON(r[i],t.methods[r[i]]));return t.nested&&s.addJSON(t.nested),s.comment=t.comment,s},a.prototype.toJSON=function(e){var t=r.prototype.toJSON.call(this,e),s=!!e&&Boolean(e.keepComments);return i.toObject(["options",t&&t.options||void 0,"methods",r.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",s?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=i.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||r.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return r.prototype.resolve.call(this)},a.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof n?(this.methods[e.name]=e,e.parent=this,c(this)):r.prototype.add.call(this,e)},a.prototype.remove=function(e){if(e instanceof n){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,c(this)}return r.prototype.remove.call(this,e)},a.prototype.create=function(e,t,s){for(var r,n=new o.Service(e,t,s),a=0;a<this.methodsArray.length;++a){var c=i.lcFirst((r=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");n[c]=i.codegen(["r","c"],i.isReserved(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:r,q:r.resolvedRequestType.ctor,s:r.resolvedResponseType.ctor})}return n}},4560:(e,t,s)=>{"use strict";e.exports=g;var r=s(512);((g.prototype=Object.create(r.prototype)).constructor=g).className="Type";var n=s(4937),i=s(3044),o=s(5891),a=s(8911),c=s(877),u=s(4777),d=s(9867),l=s(2944),h=s(7572),f=s(6382),p=s(4799),y=s(8600),m=s(6274),v=s(3375);function g(e,t){r.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function x(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(g.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var s=this.fields[e[t]],r=s.id;if(this._fieldsById[r])throw Error("duplicate id "+r+" in "+this);this._fieldsById[r]=s}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=h.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=h.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=g.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof u||((e.prototype=new u).constructor=e,h.merge(e.prototype,t)),e.$type=e.prototype.$type=this,h.merge(e,u,!0),this._ctor=e;for(var s=0;s<this.fieldsArray.length;++s)this._fieldsArray[s].resolve();var r={};for(s=0;s<this.oneofsArray.length;++s)r[this._oneofsArray[s].resolve().name]={get:h.oneOfGetter(this._oneofsArray[s].oneof),set:h.oneOfSetter(this._oneofsArray[s].oneof)};s&&Object.defineProperties(e.prototype,r)}}}),g.generateConstructor=function(e){for(var t,s=h.codegen(["p"],e.name),r=0;r<e.fieldsArray.length;++r)(t=e._fieldsArray[r]).map?s("this%s={}",h.safeProp(t.name)):t.repeated&&s("this%s=[]",h.safeProp(t.name));return s("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},g.fromJSON=function(e,t){var s=new g(e,t.options);s.extensions=t.extensions,s.reserved=t.reserved;for(var u=Object.keys(t.fields),d=0;d<u.length;++d)s.add((void 0!==t.fields[u[d]].keyType?a.fromJSON:o.fromJSON)(u[d],t.fields[u[d]]));if(t.oneofs)for(u=Object.keys(t.oneofs),d=0;d<u.length;++d)s.add(i.fromJSON(u[d],t.oneofs[u[d]]));if(t.nested)for(u=Object.keys(t.nested),d=0;d<u.length;++d){var l=t.nested[u[d]];s.add((void 0!==l.id?o.fromJSON:void 0!==l.fields?g.fromJSON:void 0!==l.values?n.fromJSON:void 0!==l.methods?c.fromJSON:r.fromJSON)(u[d],l))}return t.extensions&&t.extensions.length&&(s.extensions=t.extensions),t.reserved&&t.reserved.length&&(s.reserved=t.reserved),t.group&&(s.group=!0),t.comment&&(s.comment=t.comment),s},g.prototype.toJSON=function(e){var t=r.prototype.toJSON.call(this,e),s=!!e&&Boolean(e.keepComments);return h.toObject(["options",t&&t.options||void 0,"oneofs",r.arrayToJSON(this.oneofsArray,e),"fields",r.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",s?this.comment:void 0])},g.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var s=this.oneofsArray;for(t=0;t<s.length;)s[t++].resolve();return r.prototype.resolveAll.call(this)},g.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},g.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof o&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),x(this)}return e instanceof i?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),x(this)):r.prototype.add.call(this,e)},g.prototype.remove=function(e){if(e instanceof o&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),x(this)}if(e instanceof i){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),x(this)}return r.prototype.remove.call(this,e)},g.prototype.isReservedId=function(e){return r.isReservedId(this.reserved,e)},g.prototype.isReservedName=function(e){return r.isReservedName(this.reserved,e)},g.prototype.create=function(e){return new this.ctor(e)},g.prototype.setup=function(){for(var e=this.fullName,t=[],s=0;s<this.fieldsArray.length;++s)t.push(this._fieldsArray[s].resolve().resolvedType);this.encode=f(this)({Writer:l,types:t,util:h}),this.decode=p(this)({Reader:d,types:t,util:h}),this.verify=y(this)({types:t,util:h}),this.fromObject=m.fromObject(this)({types:t,util:h}),this.toObject=m.toObject(this)({types:t,util:h});var r=v[e];if(r){var n=Object.create(this);n.fromObject=this.fromObject,this.fromObject=r.fromObject.bind(n),n.toObject=this.toObject,this.toObject=r.toObject.bind(n)}return this},g.prototype.encode=function(e,t){return this.setup().encode(e,t)},g.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},g.prototype.decode=function(e,t){return this.setup().decode(e,t)},g.prototype.decodeDelimited=function(e){return e instanceof d||(e=d.create(e)),this.decode(e,e.uint32())},g.prototype.verify=function(e){return this.setup().verify(e)},g.prototype.fromObject=function(e){return this.setup().fromObject(e)},g.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},g.d=function(e){return function(t){h.decorateType(t,e)}}},8997:(e,t,s)=>{"use strict";var r=t,n=s(7572),i=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function o(e,t){var s=0,r={};for(t|=0;s<e.length;)r[i[s+t]]=e[s++];return r}r.basic=o([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),r.defaults=o([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",n.emptyArray,null]),r.long=o([0,0,0,1,1],7),r.mapKey=o([0,0,0,5,5,0,0,0,1,1,0,2],2),r.packed=o([1,5,0,0,0,5,5,0,0,0,1,1,0])},7572:(e,t,s)=>{"use strict";var r,n,i=e.exports=s(4155),o=s(284);i.codegen=s(6348),i.fetch=s(7803),i.path=s(1272),i.fs=i.inquire("fs"),i.toArray=function(e){if(e){for(var t=Object.keys(e),s=new Array(t.length),r=0;r<t.length;)s[r]=e[t[r++]];return s}return[]},i.toObject=function(e){for(var t={},s=0;s<e.length;){var r=e[s++],n=e[s++];void 0!==n&&(t[r]=n)}return t};var a=/\\/g,c=/"/g;i.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},i.safeProp=function(e){return!/^[$\w_]+$/.test(e)||i.isReserved(e)?'["'+e.replace(a,"\\\\").replace(c,'\\"')+'"]':"."+e},i.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var u=/_([a-z])/g;i.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(u,(function(e,t){return t.toUpperCase()}))},i.compareFieldsById=function(e,t){return e.id-t.id},i.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(i.decorateRoot.remove(e.$type),e.$type.name=t,i.decorateRoot.add(e.$type)),e.$type;r||(r=s(4560));var n=new r(t||e.name);return i.decorateRoot.add(n),n.ctor=e,Object.defineProperty(e,"$type",{value:n,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:n,enumerable:!1}),n};var d=0;i.decorateEnum=function(e){if(e.$type)return e.$type;n||(n=s(4937));var t=new n("Enum"+d++,e);return i.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},i.setProperty=function(e,t,s){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,s,r){var n=s.shift();if("__proto__"===n)return t;if(s.length>0)t[n]=e(t[n]||{},s,r);else{var i=t[n];i&&(r=[].concat(i).concat(r)),t[n]=r}return t}(e,t=t.split("."),s)},Object.defineProperty(i,"decorateRoot",{get:function(){return o.decorated||(o.decorated=new(s(2613)))}})},8950:(e,t,s)=>{"use strict";e.exports=n;var r=s(4155);function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=n.zero=new n(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var o=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var s=e>>>0,r=(e-s)/4294967296>>>0;return t&&(r=~r>>>0,s=~s>>>0,++s>4294967295&&(s=0,++r>4294967295&&(r=0))),new n(s,r)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if(r.isString(e)){if(!r.Long)return n.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):i},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,s=~this.hi>>>0;return t||(s=s+1>>>0),-(t+4294967296*s)}return this.lo+4294967296*this.hi},n.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;n.fromHash=function(e){return e===o?i:new n((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},n.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},n.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},n.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,s=this.hi>>>24;return 0===s?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:s<128?9:10}},4155:function(e,t,s){"use strict";var r=t;function n(e,t,s){for(var r=Object.keys(t),n=0;n<r.length;++n)void 0!==e[r[n]]&&s||(e[r[n]]=t[r[n]]);return e}function i(e){function t(e,s){if(!(this instanceof t))return new t(e,s);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),s&&n(this,s)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:()=>e,set:void 0,enumerable:!1,configurable:!0},toString:{value(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}r.asPromise=s(537),r.base64=s(9745),r.EventEmitter=s(4459),r.float=s(897),r.inquire=s(3229),r.utf8=s(113),r.pool=s(7986),r.LongBits=s(8950),r.isNode=Boolean(void 0!==s.g&&s.g&&s.g.process&&s.g.process.versions&&s.g.process.versions.node),r.global=r.isNode&&s.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var s=e[t];return!(null==s||!e.hasOwnProperty(t))&&("object"!=typeof s||(Array.isArray(s)?s.length:Object.keys(s).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var s=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(s.lo,s.hi,t):s.toNumber(Boolean(t))},r.merge=n,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=i,r.ProtocolError=i("ProtocolError"),r.oneOfGetter=function(e){for(var t={},s=0;s<e.length;++s)t[e[s]]=1;return function(){for(var e=Object.keys(this),s=e.length-1;s>-1;--s)if(1===t[e[s]]&&void 0!==this[e[s]]&&null!==this[e[s]])return e[s]}},r.oneOfSetter=function(e){return function(t){for(var s=0;s<e.length;++s)e[s]!==t&&delete this[e[s]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,s){return new e(t,s)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},8600:(e,t,s)=>{"use strict";e.exports=function(e){var t=n.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),s=e.oneofsArray,r={};s.length&&t("var p={}");for(var c=0;c<e.fieldsArray.length;++c){var u=e._fieldsArray[c].resolve(),d="m"+n.safeProp(u.name);if(u.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",d,u.name),u.map)t("if(!util.isObject(%s))",d)("return%j",i(u,"object"))("var k=Object.keys(%s)",d)("for(var i=0;i<k.length;++i){"),a(t,u,"k[i]"),o(t,u,c,d+"[k[i]]")("}");else if(u.repeated)t("if(!Array.isArray(%s))",d)("return%j",i(u,"array"))("for(var i=0;i<%s.length;++i){",d),o(t,u,c,d+"[i]")("}");else{if(u.partOf){var l=n.safeProp(u.partOf.name);1===r[u.partOf.name]&&t("if(p%s===1)",l)("return%j",u.partOf.name+": multiple values"),r[u.partOf.name]=1,t("p%s=1",l)}o(t,u,c,d)}u.optional&&t("}")}return t("return null")};var r=s(4937),n=s(7572);function i(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function o(e,t,s,n){if(t.resolvedType)if(t.resolvedType instanceof r){e("switch(%s){",n)("default:")("return%j",i(t,"enum value"));for(var o=Object.keys(t.resolvedType.values),a=0;a<o.length;++a)e("case %i:",t.resolvedType.values[o[a]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",s,n)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",n)("return%j",i(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",n,n,n,n)("return%j",i(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',n)("return%j",i(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',n)("return%j",i(t,"boolean"));break;case"string":e("if(!util.isString(%s))",n)("return%j",i(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',n,n,n)("return%j",i(t,"buffer"))}return e}function a(e,t,s){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",s)("return%j",i(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",s)("return%j",i(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",s)("return%j",i(t,"boolean key"))}return e}},3375:(e,t,s)=>{"use strict";var r=t,n=s(4777);r[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),s=this.lookup(t);if(s){var r="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===r.indexOf("/")&&(r="/"+r),this.create({type_url:r,value:s.encode(s.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var s="",r="";if(t&&t.json&&e.type_url&&e.value){r=e.type_url.substring(e.type_url.lastIndexOf("/")+1),s=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var i=this.lookup(r);i&&(e=i.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof n){var o=e.$type.toObject(e,t);return""===s&&(s="type.googleapis.com/"),r=s+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),o["@type"]=r,o}return this.toObject(e,t)}}},2944:(e,t,s)=>{"use strict";e.exports=l;var r,n=s(4155),i=n.LongBits,o=n.base64,a=n.utf8;function c(e,t,s){this.fn=e,this.len=t,this.next=void 0,this.val=s}function u(){}function d(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var h=function(){return n.Buffer?function(){return(l.create=function(){return new r})()}:function(){return new l}};function f(e,t,s){t[s]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function y(e,t,s){for(;e.hi;)t[s++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[s++]=127&e.lo|128,e.lo=e.lo>>>7;t[s++]=e.lo}function m(e,t,s){t[s]=255&e,t[s+1]=e>>>8&255,t[s+2]=e>>>16&255,t[s+3]=e>>>24}l.create=h(),l.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(l.alloc=n.pool(l.alloc,n.Array.prototype.subarray)),l.prototype._push=function(e,t,s){return this.tail=this.tail.next=new c(e,t,s),this.len+=t,this},p.prototype=Object.create(c.prototype),p.prototype.fn=function(e,t,s){for(;e>127;)t[s++]=127&e|128,e>>>=7;t[s]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(y,10,i.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=i.from(e);return this._push(y,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(y,t.length(),t)},l.prototype.bool=function(e){return this._push(f,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(m,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=i.from(e);return this._push(m,4,t.lo)._push(m,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var v=n.Array.prototype.set?function(e,t,s){t.set(e,s)}:function(e,t,s){for(var r=0;r<e.length;++r)t[s+r]=e[r]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(n.isString(e)){var s=l.alloc(t=o.length(e));o.decode(e,s,0),e=s}return this.uint32(t)._push(v,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(f,1,0)},l.prototype.fork=function(){return this.states=new d(this),this.head=this.tail=new c(u,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,s=this.len;return this.reset().uint32(s),s&&(this.tail.next=e.next,this.tail=t,this.len+=s),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),s=0;e;)e.fn(e.val,t,s),s+=e.len,e=e.next;return t},l._configure=function(e){r=e,l.create=h(),r._configure()}},2178:(e,t,s)=>{"use strict";e.exports=i;var r=s(2944);(i.prototype=Object.create(r.prototype)).constructor=i;var n=s(4155);function i(){r.call(this)}function o(e,t,s){e.length<40?n.utf8.write(e,t,s):t.utf8Write?t.utf8Write(e,s):t.write(e,s)}i._configure=function(){i.alloc=n._Buffer_allocUnsafe,i.writeBytesBuffer=n.Buffer&&n.Buffer.prototype instanceof Uint8Array&&"set"===n.Buffer.prototype.set.name?function(e,t,s){t.set(e,s)}:function(e,t,s){if(e.copy)e.copy(t,s,0,e.length);else for(var r=0;r<e.length;)t[s++]=e[r++]}},i.prototype.bytes=function(e){n.isString(e)&&(e=n._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.string=function(e){var t=n.Buffer.byteLength(e);return this.uint32(t),t&&this._push(o,t,e),this},i._configure()},1829:(e,t)=>{"use strict";var s,r=Object.prototype.hasOwnProperty;function n(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function i(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var n,o,a=[];for(o in"string"!=typeof t&&(t="?"),e)if(r.call(e,o)){if((n=e[o])||null!==n&&n!==s&&!isNaN(n)||(n=""),o=i(o),n=i(n),null===o||null===n)continue;a.push(o+"="+n)}return a.length?t+a.join("&"):""},t.parse=function(e){for(var t,s=/([^=?#&]+)=?([^&]*)/g,r={};t=s.exec(e);){var i=n(t[1]),o=n(t[2]);null===i||null===o||i in r||(r[i]=o)}return r}},3722:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},7594:(e,t,s)=>{"use strict";var r,n=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},i=function(){var e={};return function(t){if(void 0===e[t]){var s=document.querySelector(t);if(window.HTMLIFrameElement&&s instanceof window.HTMLIFrameElement)try{s=s.contentDocument.head}catch(e){s=null}e[t]=s}return e[t]}}(),o=[];function a(e){for(var t=-1,s=0;s<o.length;s++)if(o[s].identifier===e){t=s;break}return t}function c(e,t){for(var s={},r=[],n=0;n<e.length;n++){var i=e[n],c=t.base?i[0]+t.base:i[0],u=s[c]||0,d="".concat(c," ").concat(u);s[c]=u+1;var l=a(d),h={css:i[1],media:i[2],sourceMap:i[3]};-1!==l?(o[l].references++,o[l].updater(h)):o.push({identifier:d,updater:m(h,t),references:1}),r.push(d)}return r}function u(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var n=s.nc;n&&(r.nonce=n)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var o=i(e.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(t)}return t}var d,l=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function h(e,t,s,r){var n=s?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=l(t,n);else{var i=document.createTextNode(n),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(i,o[t]):e.appendChild(i)}}function f(e,t,s){var r=s.css,n=s.media,i=s.sourceMap;if(n?e.setAttribute("media",n):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var p=null,y=0;function m(e,t){var s,r,n;if(t.singleton){var i=y++;s=p||(p=u(t)),r=h.bind(null,s,i,!1),n=h.bind(null,s,i,!0)}else s=u(t),r=f.bind(null,s,t),n=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(s)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else n()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=n());var s=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<s.length;r++){var n=a(s[r]);o[n].references--}for(var i=c(e,t),u=0;u<s.length;u++){var d=a(s[u]);0===o[d].references&&(o[d].updater(),o.splice(d,1))}s=i}}}},9655:(e,t,s)=>{"use strict";var r=s(3722),n=s(1829),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,d=/^[a-zA-Z]:/;function l(e){return(e||"").toString().replace(i,"")}var h=[["#","hash"],["?","query"],function(e,t){return y(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],f={hash:1,query:1};function p(e){var t,r=("undefined"!=typeof window?window:void 0!==s.g?s.g:"undefined"!=typeof self?self:{}).location||{},n={},i=typeof(e=e||r);if("blob:"===e.protocol)n=new v(unescape(e.pathname),{});else if("string"===i)for(t in n=new v(e,{}),f)delete n[t];else if("object"===i){for(t in e)t in f||(n[t]=e[t]);void 0===n.slashes&&(n.slashes=a.test(e.href))}return n}function y(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function m(e,t){e=(e=l(e)).replace(o,""),t=t||{};var s,r=u.exec(e),n=r[1]?r[1].toLowerCase():"",i=!!r[2],a=!!r[3],c=0;return i?a?(s=r[2]+r[3]+r[4],c=r[2].length+r[3].length):(s=r[2]+r[4],c=r[2].length):a?(s=r[3]+r[4],c=r[3].length):s=r[4],"file:"===n?c>=2&&(s=s.slice(2)):y(n)?s=r[4]:n?i&&(s=s.slice(2)):c>=2&&y(t.protocol)&&(s=r[4]),{protocol:n,slashes:i||y(n),slashesCount:c,rest:s}}function v(e,t,s){if(e=(e=l(e)).replace(o,""),!(this instanceof v))return new v(e,t,s);var i,a,c,u,f,g,x=h.slice(),_=typeof t,b=this,w=0;for("object"!==_&&"string"!==_&&(s=t,t=null),s&&"function"!=typeof s&&(s=n.parse),i=!(a=m(e||"",t=p(t))).protocol&&!a.slashes,b.slashes=a.slashes||i&&t.slashes,b.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||d.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!y(b.protocol)))&&(x[3]=[/(.*)/,"pathname"]);w<x.length;w++)"function"!=typeof(u=x[w])?(c=u[0],g=u[1],c!=c?b[g]=e:"string"==typeof c?~(f="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof u[2]?(b[g]=e.slice(0,f),e=e.slice(f+u[2])):(b[g]=e.slice(f),e=e.slice(0,f))):(f=c.exec(e))&&(b[g]=f[1],e=e.slice(0,f.index)),b[g]=b[g]||i&&u[3]&&t[g]||"",u[4]&&(b[g]=b[g].toLowerCase())):e=u(e,b);s&&(b.query=s(b.query)),i&&t.slashes&&"/"!==b.pathname.charAt(0)&&(""!==b.pathname||""!==t.pathname)&&(b.pathname=function(e,t){if(""===e)return t;for(var s=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=s.length,n=s[r-1],i=!1,o=0;r--;)"."===s[r]?s.splice(r,1):".."===s[r]?(s.splice(r,1),o++):o&&(0===r&&(i=!0),s.splice(r,1),o--);return i&&s.unshift(""),"."!==n&&".."!==n||s.push(""),s.join("/")}(b.pathname,t.pathname)),"/"!==b.pathname.charAt(0)&&y(b.protocol)&&(b.pathname="/"+b.pathname),r(b.port,b.protocol)||(b.host=b.hostname,b.port=""),b.username=b.password="",b.auth&&(~(f=b.auth.indexOf(":"))?(b.username=b.auth.slice(0,f),b.username=encodeURIComponent(decodeURIComponent(b.username)),b.password=b.auth.slice(f+1),b.password=encodeURIComponent(decodeURIComponent(b.password))):b.username=encodeURIComponent(decodeURIComponent(b.auth)),b.auth=b.password?b.username+":"+b.password:b.username),b.origin="file:"!==b.protocol&&y(b.protocol)&&b.host?b.protocol+"//"+b.host:"null",b.href=b.toString()}v.prototype={set:function(e,t,s){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(s||n.parse)(t)),i[e]=t;break;case"port":i[e]=t,r(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,c.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!s;break;case"pathname":case"hash":if(t){var o="pathname"===e?"/":"#";i[e]=t.charAt(0)!==o?o+t:t}else i[e]=t;break;case"username":case"password":i[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(i.username=t.slice(0,a),i.username=encodeURIComponent(decodeURIComponent(i.username)),i.password=t.slice(a+1),i.password=encodeURIComponent(decodeURIComponent(i.password))):i.username=encodeURIComponent(decodeURIComponent(t))}for(var u=0;u<h.length;u++){var d=h[u];d[4]&&(i[d[1]]=i[d[1]].toLowerCase())}return i.auth=i.password?i.username+":"+i.password:i.username,i.origin="file:"!==i.protocol&&y(i.protocol)&&i.host?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=n.stringify);var t,s=this,r=s.host,i=s.protocol;i&&":"!==i.charAt(i.length-1)&&(i+=":");var o=i+(s.protocol&&s.slashes||y(s.protocol)?"//":"");return s.username?(o+=s.username,s.password&&(o+=":"+s.password),o+="@"):s.password?(o+=":"+s.password,o+="@"):"file:"!==s.protocol&&y(s.protocol)&&!r&&"/"!==s.pathname&&(o+="@"),(":"===r[r.length-1]||c.test(s.hostname)&&!s.port)&&(r+=":"),o+=r+s.pathname,(t="object"==typeof s.query?e(s.query):s.query)&&(o+="?"!==t.charAt(0)?"?"+t:t),s.hash&&(o+=s.hash),o}},v.extractProtocol=m,v.location=p,v.trimLeft=l,v.qs=n,e.exports=v},5003:(e,t,s)=>{"use strict";var r;s.r(t),s.d(t,{NIL:()=>P,parse:()=>m,stringify:()=>d,v1:()=>y,v3:()=>A,v4:()=>C,v5:()=>j,validate:()=>a,version:()=>D});var n=new Uint8Array(16);function i(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(n)}const o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const a=function(e){return"string"==typeof e&&o.test(e)};for(var c=[],u=0;u<256;++u)c.push((u+256).toString(16).substr(1));const d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=(c[e[t+0]]+c[e[t+1]]+c[e[t+2]]+c[e[t+3]]+"-"+c[e[t+4]]+c[e[t+5]]+"-"+c[e[t+6]]+c[e[t+7]]+"-"+c[e[t+8]]+c[e[t+9]]+"-"+c[e[t+10]]+c[e[t+11]]+c[e[t+12]]+c[e[t+13]]+c[e[t+14]]+c[e[t+15]]).toLowerCase();if(!a(s))throw TypeError("Stringified UUID is invalid");return s};var l,h,f=0,p=0;const y=function(e,t,s){var r=t&&s||0,n=t||new Array(16),o=(e=e||{}).node||l,a=void 0!==e.clockseq?e.clockseq:h;if(null==o||null==a){var c=e.random||(e.rng||i)();null==o&&(o=l=[1|c[0],c[1],c[2],c[3],c[4],c[5]]),null==a&&(a=h=16383&(c[6]<<8|c[7]))}var u=void 0!==e.msecs?e.msecs:Date.now(),y=void 0!==e.nsecs?e.nsecs:p+1,m=u-f+(y-p)/1e4;if(m<0&&void 0===e.clockseq&&(a=a+1&16383),(m<0||u>f)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=u,p=y,h=a;var v=(1e4*(268435455&(u+=122192928e5))+y)%4294967296;n[r++]=v>>>24&255,n[r++]=v>>>16&255,n[r++]=v>>>8&255,n[r++]=255&v;var g=u/4294967296*1e4&268435455;n[r++]=g>>>8&255,n[r++]=255&g,n[r++]=g>>>24&15|16,n[r++]=g>>>16&255,n[r++]=a>>>8|128,n[r++]=255&a;for(var x=0;x<6;++x)n[r+x]=o[x];return t||d(n)};const m=function(e){if(!a(e))throw TypeError("Invalid UUID");var t,s=new Uint8Array(16);return s[0]=(t=parseInt(e.slice(0,8),16))>>>24,s[1]=t>>>16&255,s[2]=t>>>8&255,s[3]=255&t,s[4]=(t=parseInt(e.slice(9,13),16))>>>8,s[5]=255&t,s[6]=(t=parseInt(e.slice(14,18),16))>>>8,s[7]=255&t,s[8]=(t=parseInt(e.slice(19,23),16))>>>8,s[9]=255&t,s[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,s[11]=t/4294967296&255,s[12]=t>>>24&255,s[13]=t>>>16&255,s[14]=t>>>8&255,s[15]=255&t,s};var v="6ba7b810-9dad-11d1-80b4-00c04fd430c8",g="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function x(e,t,s){function r(e,r,n,i){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],s=0;s<e.length;++s)t.push(e.charCodeAt(s));return t}(e)),"string"==typeof r&&(r=m(r)),16!==r.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var o=new Uint8Array(16+e.length);if(o.set(r),o.set(e,r.length),(o=s(o))[6]=15&o[6]|t,o[8]=63&o[8]|128,n){i=i||0;for(var a=0;a<16;++a)n[i+a]=o[a];return n}return d(o)}try{r.name=e}catch(e){}return r.DNS=v,r.URL=g,r}function _(e){return 14+(e+64>>>9<<4)+1}function b(e,t){var s=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(s>>16)<<16|65535&s}function w(e,t,s,r,n,i){return b((o=b(b(t,e),b(r,i)))<<(a=n)|o>>>32-a,s);var o,a}function O(e,t,s,r,n,i,o){return w(t&s|~t&r,e,t,n,i,o)}function E(e,t,s,r,n,i,o){return w(t&r|s&~r,e,t,n,i,o)}function S(e,t,s,r,n,i,o){return w(t^s^r,e,t,n,i,o)}function T(e,t,s,r,n,i,o){return w(s^(t|~r),e,t,n,i,o)}const k=function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var s=0;s<t.length;++s)e[s]=t.charCodeAt(s)}return function(e){for(var t=[],s=32*e.length,r="0123456789abcdef",n=0;n<s;n+=8){var i=e[n>>5]>>>n%32&255,o=parseInt(r.charAt(i>>>4&15)+r.charAt(15&i),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[_(t)-1]=t;for(var s=1732584193,r=-271733879,n=-1732584194,i=271733878,o=0;o<e.length;o+=16){var a=s,c=r,u=n,d=i;s=O(s,r,n,i,e[o],7,-680876936),i=O(i,s,r,n,e[o+1],12,-389564586),n=O(n,i,s,r,e[o+2],17,606105819),r=O(r,n,i,s,e[o+3],22,-1044525330),s=O(s,r,n,i,e[o+4],7,-176418897),i=O(i,s,r,n,e[o+5],12,1200080426),n=O(n,i,s,r,e[o+6],17,-1473231341),r=O(r,n,i,s,e[o+7],22,-45705983),s=O(s,r,n,i,e[o+8],7,1770035416),i=O(i,s,r,n,e[o+9],12,-1958414417),n=O(n,i,s,r,e[o+10],17,-42063),r=O(r,n,i,s,e[o+11],22,-1990404162),s=O(s,r,n,i,e[o+12],7,1804603682),i=O(i,s,r,n,e[o+13],12,-40341101),n=O(n,i,s,r,e[o+14],17,-1502002290),s=E(s,r=O(r,n,i,s,e[o+15],22,1236535329),n,i,e[o+1],5,-165796510),i=E(i,s,r,n,e[o+6],9,-1069501632),n=E(n,i,s,r,e[o+11],14,643717713),r=E(r,n,i,s,e[o],20,-373897302),s=E(s,r,n,i,e[o+5],5,-701558691),i=E(i,s,r,n,e[o+10],9,38016083),n=E(n,i,s,r,e[o+15],14,-660478335),r=E(r,n,i,s,e[o+4],20,-405537848),s=E(s,r,n,i,e[o+9],5,568446438),i=E(i,s,r,n,e[o+14],9,-1019803690),n=E(n,i,s,r,e[o+3],14,-187363961),r=E(r,n,i,s,e[o+8],20,1163531501),s=E(s,r,n,i,e[o+13],5,-1444681467),i=E(i,s,r,n,e[o+2],9,-51403784),n=E(n,i,s,r,e[o+7],14,1735328473),s=S(s,r=E(r,n,i,s,e[o+12],20,-1926607734),n,i,e[o+5],4,-378558),i=S(i,s,r,n,e[o+8],11,-2022574463),n=S(n,i,s,r,e[o+11],16,1839030562),r=S(r,n,i,s,e[o+14],23,-35309556),s=S(s,r,n,i,e[o+1],4,-1530992060),i=S(i,s,r,n,e[o+4],11,1272893353),n=S(n,i,s,r,e[o+7],16,-155497632),r=S(r,n,i,s,e[o+10],23,-1094730640),s=S(s,r,n,i,e[o+13],4,681279174),i=S(i,s,r,n,e[o],11,-358537222),n=S(n,i,s,r,e[o+3],16,-722521979),r=S(r,n,i,s,e[o+6],23,76029189),s=S(s,r,n,i,e[o+9],4,-640364487),i=S(i,s,r,n,e[o+12],11,-421815835),n=S(n,i,s,r,e[o+15],16,530742520),s=T(s,r=S(r,n,i,s,e[o+2],23,-995338651),n,i,e[o],6,-198630844),i=T(i,s,r,n,e[o+7],10,1126891415),n=T(n,i,s,r,e[o+14],15,-1416354905),r=T(r,n,i,s,e[o+5],21,-57434055),s=T(s,r,n,i,e[o+12],6,1700485571),i=T(i,s,r,n,e[o+3],10,-1894986606),n=T(n,i,s,r,e[o+10],15,-1051523),r=T(r,n,i,s,e[o+1],21,-2054922799),s=T(s,r,n,i,e[o+8],6,1873313359),i=T(i,s,r,n,e[o+15],10,-30611744),n=T(n,i,s,r,e[o+6],15,-1560198380),r=T(r,n,i,s,e[o+13],21,1309151649),s=T(s,r,n,i,e[o+4],6,-145523070),i=T(i,s,r,n,e[o+11],10,-1120210379),n=T(n,i,s,r,e[o+2],15,718787259),r=T(r,n,i,s,e[o+9],21,-343485551),s=b(s,a),r=b(r,c),n=b(n,u),i=b(i,d)}return[s,r,n,i]}(function(e){if(0===e.length)return[];for(var t=8*e.length,s=new Uint32Array(_(t)),r=0;r<t;r+=8)s[r>>5]|=(255&e[r/8])<<r%32;return s}(e),8*e.length))};const A=x("v3",48,k);const C=function(e,t,s){var r=(e=e||{}).random||(e.rng||i)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){s=s||0;for(var n=0;n<16;++n)t[s+n]=r[n];return t}return d(r)};function I(e,t,s,r){switch(e){case 0:return t&s^~t&r;case 1:case 3:return t^s^r;case 2:return t&s^t&r^s&r}}function R(e,t){return e<<t|e>>>32-t}const N=function(e){var t=[1518500249,1859775393,2400959708,3395469782],s=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var r=unescape(encodeURIComponent(e));e=[];for(var n=0;n<r.length;++n)e.push(r.charCodeAt(n))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var i=e.length/4+2,o=Math.ceil(i/16),a=new Array(o),c=0;c<o;++c){for(var u=new Uint32Array(16),d=0;d<16;++d)u[d]=e[64*c+4*d]<<24|e[64*c+4*d+1]<<16|e[64*c+4*d+2]<<8|e[64*c+4*d+3];a[c]=u}a[o-1][14]=8*(e.length-1)/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=8*(e.length-1)&4294967295;for(var l=0;l<o;++l){for(var h=new Uint32Array(80),f=0;f<16;++f)h[f]=a[l][f];for(var p=16;p<80;++p)h[p]=R(h[p-3]^h[p-8]^h[p-14]^h[p-16],1);for(var y=s[0],m=s[1],v=s[2],g=s[3],x=s[4],_=0;_<80;++_){var b=Math.floor(_/20),w=R(y,5)+I(b,m,v,g)+x+t[b]+h[_]>>>0;x=g,g=v,v=R(m,30)>>>0,m=y,y=w}s[0]=s[0]+y>>>0,s[1]=s[1]+m>>>0,s[2]=s[2]+v>>>0,s[3]=s[3]+g>>>0,s[4]=s[4]+x>>>0}return[s[0]>>24&255,s[0]>>16&255,s[0]>>8&255,255&s[0],s[1]>>24&255,s[1]>>16&255,s[1]>>8&255,255&s[1],s[2]>>24&255,s[2]>>16&255,s[2]>>8&255,255&s[2],s[3]>>24&255,s[3]>>16&255,s[3]>>8&255,255&s[3],s[4]>>24&255,s[4]>>16&255,s[4]>>8&255,255&s[4]]};const j=x("v5",80,N),P="00000000-0000-0000-0000-000000000000";const D=function(e){if(!a(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},2417:(e,t,s)=>{e.exports=s(7720)("./src/collaboration-core.js")},2704:(e,t,s)=>{e.exports=s(7079)("./src/core.js")},1492:(e,t,s)=>{e.exports=s(7079)("./src/engine.js")},9273:(e,t,s)=>{e.exports=s(7079)("./src/ui.js")},2209:(e,t,s)=>{e.exports=s(7079)("./src/utils.js")},7720:e=>{"use strict";e.exports=CKEditor5.collaborationDll},7079:e=>{"use strict";e.exports=CKEditor5.dll},1053:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reconstructPacket=t.deconstructPacket=void 0;const r=s(1669);function n(e,t){if(!e)return e;if(r.isBinary(e)){const s={_placeholder:!0,num:t.length};return t.push(e),s}if(Array.isArray(e)){const s=new Array(e.length);for(let r=0;r<e.length;r++)s[r]=n(e[r],t);return s}if("object"==typeof e&&!(e instanceof Date)){const s={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(s[r]=n(e[r],t));return s}return e}function i(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let s=0;s<e.length;s++)e[s]=i(e[s],t);else if("object"==typeof e)for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(e[s]=i(e[s],t));return e}t.deconstructPacket=function(e){const t=[],s=e.data,r=e;return r.data=n(s,t),r.attachments=t.length,{packet:r,buffers:t}},t.reconstructPacket=function(e,t){return e.data=i(e.data,t),e.attachments=void 0,e}},9881:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=t.PacketType=t.protocol=void 0;const r=s(5867),n=s(1053),i=s(1669),o=s(5579).default("socket.io-parser");var a;t.protocol=5,function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(a=t.PacketType||(t.PacketType={}));t.Encoder=class{constructor(e){this.replacer=e}encode(e){return o("encoding packet %j",e),e.type!==a.EVENT&&e.type!==a.ACK||!i.hasBinary(e)?[this.encodeAsString(e)]:(e.type=e.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,this.encodeAsBinary(e))}encodeAsString(e){let t=""+e.type;return e.type!==a.BINARY_EVENT&&e.type!==a.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),o("encoded %j as %s",e,t),t}encodeAsBinary(e){const t=n.deconstructPacket(e),s=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(s),r}};class c extends r.Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e),t.type===a.BINARY_EVENT||t.type===a.BINARY_ACK?(this.reconstructor=new u(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!i.isBinary(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const s={type:Number(e.charAt(0))};if(void 0===a[s.type])throw new Error("unknown packet type "+s.type);if(s.type===a.BINARY_EVENT||s.type===a.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const n=e.substring(r,t);if(n!=Number(n)||"-"!==e.charAt(t))throw new Error("Illegal attachments");s.attachments=Number(n)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}s.nsp=e.substring(r,t)}else s.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const s=e.charAt(t);if(null==s||Number(s)!=s){--t;break}if(t===e.length)break}s.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!c.isPayloadValid(s.type,r))throw new Error("invalid payload");s.data=r}return o("decoded %s as %j",e,s),s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case a.CONNECT:return"object"==typeof t;case a.DISCONNECT:return void 0===t;case a.CONNECT_ERROR:return"string"==typeof t||"object"==typeof t;case a.EVENT:case a.BINARY_EVENT:return Array.isArray(t)&&t.length>0;case a.ACK:case a.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}t.Decoder=c;class u{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=n.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}},1669:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasBinary=t.isBinary=void 0;const s="function"==typeof ArrayBuffer,r=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,n=Object.prototype.toString,i="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===n.call(Blob),o="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===n.call(File);function a(e){return s&&(e instanceof ArrayBuffer||r(e))||i&&e instanceof Blob||o&&e instanceof File}t.isBinary=a,t.hasBinary=function e(t,s){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let s=0,r=t.length;s<r;s++)if(e(t[s]))return!0;return!1}if(a(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&e(t[s]))return!0;return!1}},6051:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasCORS=void 0;let s=!1;try{s="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}t.hasCORS=s},8573:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0,t.encode=function(e){let t="";for(let s in e)e.hasOwnProperty(s)&&(t.length&&(t+="&"),t+=encodeURIComponent(s)+"="+encodeURIComponent(e[s]));return t},t.decode=function(e){let t={},s=e.split("&");for(let e=0,r=s.length;e<r;e++){let r=s[e].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}},8736:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const s=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.parse=function(e){const t=e,n=e.indexOf("["),i=e.indexOf("]");-1!=n&&-1!=i&&(e=e.substring(0,n)+e.substring(n,i).replace(/:/g,";")+e.substring(i,e.length));let o=s.exec(e||""),a={},c=14;for(;c--;)a[r[c]]=o[c]||"";return-1!=n&&-1!=i&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=function(e,t){const s=/\/{2,9}/g,r=t.replace(s,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,a.path),a.queryKey=function(e,t){const s={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(s[t]=r)})),s}(0,a.query),a}},7058:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.yeast=t.decode=t.encode=void 0;const s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),r=64,n={};let i,o=0,a=0;function c(e){let t="";do{t=s[e%r]+t,e=Math.floor(e/r)}while(e>0);return t}for(t.encode=c,t.decode=function(e){let t=0;for(a=0;a<e.length;a++)t=t*r+n[e.charAt(a)];return t},t.yeast=function(){const e=c(+new Date);return e!==i?(o=0,i=e):e+"."+c(o++)};a<r;a++)n[s[a]]=a},66:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.globalThisShim=void 0,t.globalThisShim="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")()},5769:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nextTick=t.parse=t.installTimerFunctions=t.transports=t.Transport=t.protocol=t.Socket=void 0;const r=s(1187);Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return r.Socket}}),t.protocol=r.Socket.protocol;var n=s(4291);Object.defineProperty(t,"Transport",{enumerable:!0,get:function(){return n.Transport}});var i=s(6449);Object.defineProperty(t,"transports",{enumerable:!0,get:function(){return i.transports}});var o=s(102);Object.defineProperty(t,"installTimerFunctions",{enumerable:!0,get:function(){return o.installTimerFunctions}});var a=s(8736);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return a.parse}});var c=s(9233);Object.defineProperty(t,"nextTick",{enumerable:!0,get:function(){return c.nextTick}})},1187:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=void 0;const n=s(6449),i=s(102),o=s(8573),a=s(8736),c=r(s(5579)),u=s(5867),d=s(4755),l=(0,c.default)("engine.io-client:socket");class h extends u.Emitter{constructor(e,t={}){super(),e&&"object"==typeof e&&(t=e,e=null),e?(e=(0,a.parse)(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=(0,a.parse)(t.host).host),(0,i.installTimerFunctions)(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"==typeof this.opts.query&&(this.opts.query=(0,o.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){l('creating transport "%s"',e);const t=Object.assign({},this.opts.query);t.EIO=d.protocol,t.transport=e,this.id&&(t.sid=this.id);const s=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return l("options: %j",s),new n.transports[e](s)}open(){let e;if(this.opts.rememberUpgrade&&h.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return l("error while creating transport: %s",e),this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){l("setting transport %s",e.name),this.transport&&(l("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){l('probing transport "%s"',e);let t=this.createTransport(e),s=!1;h.priorWebsocketSuccess=!1;const r=()=>{s||(l('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(r=>{if(!s)if("pong"===r.type&&"probe"===r.data){if(l('probe transport "%s" pong',e),this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;h.priorWebsocketSuccess="websocket"===t.name,l('pausing current transport "%s"',this.transport.name),this.transport.pause((()=>{s||"closed"!==this.readyState&&(l("changing transport and sending upgrade packet"),u(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{l('probe transport "%s" failed',e);const s=new Error("probe error");s.transport=t.name,this.emitReserved("upgradeError",s)}})))};function n(){s||(s=!0,u(),t.close(),t=null)}const i=s=>{const r=new Error("probe error: "+s);r.transport=t.name,n(),l('probe transport "%s" failed because of error: %s',e,s),this.emitReserved("upgradeError",r)};function o(){i("transport closed")}function a(){i("socket closed")}function c(e){t&&e.name!==t.name&&(l('"%s" works - aborting "%s"',e.name,t.name),n())}const u=()=>{t.removeListener("open",r),t.removeListener("error",i),t.removeListener("close",o),this.off("close",a),this.off("upgrading",c)};t.once("open",r),t.once("error",i),t.once("close",o),this.once("close",a),this.once("upgrading",c),t.open()}onOpen(){if(l("socket open"),this.readyState="open",h.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){l("starting upgrade probes");let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(l('socket receive: type "%s", data "%s"',e.type,e.data),this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}else l('packet received with socket readyState "%s"',this.readyState)}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();l("flushing %d packets in socket",e.length),this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){const s=this.writeBuffer[t].data;if(s&&(e+=(0,i.byteLength)(s)),t>0&&e>this.maxPayload)return l("only send %d out of %d packets",t,this.writeBuffer.length),this.writeBuffer.slice(0,t);e+=2}return l("payload size is %d (max: %d)",e,this.maxPayload),this.writeBuffer}write(e,t,s){return this.sendPacket("message",e,t,s),this}send(e,t,s){return this.sendPacket("message",e,t,s),this}sendPacket(e,t,s,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof s&&(r=s,s=null),"closing"===this.readyState||"closed"===this.readyState)return;(s=s||{}).compress=!1!==s.compress;const n={type:e,data:t,options:s};this.emitReserved("packetCreate",n),this.writeBuffer.push(n),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),l("socket closing - telling transport to close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?s():e()})):this.upgrading?s():e()),this}onError(e){l("socket error %j",e),h.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(l('socket close with reason: "%s"',e),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let s=0;const r=e.length;for(;s<r;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}}t.Socket=h,h.protocol=d.protocol},4291:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Transport=void 0;const n=s(4755),i=s(5867),o=s(102),a=(0,r(s(5579)).default)("engine.io-client:transport");class c extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}}class u extends i.Emitter{constructor(e){super(),this.writable=!1,(0,o.installTimerFunctions)(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t,s){return super.emitReserved("error",new c(e,t,s)),this}open(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState?this.write(e):a("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=(0,n.decodePacket)(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}t.Transport=u},6449:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transports=void 0;const r=s(3737),n=s(4199);t.transports={websocket:n.WS,polling:r.Polling}},3737:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Request=t.Polling=void 0;const n=s(4291),i=r(s(5579)),o=s(7058),a=s(8573),c=s(4755),u=s(4582),d=s(5867),l=s(102),h=s(66),f=(0,i.default)("engine.io-client:polling");function p(){}const y=null!=new u.XHR({xdomain:!1}).responseType;class m extends n.Transport{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let s=location.port;s||(s=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||s!==e.port,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=y&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{f("paused"),this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(f("we are currently polling - waiting to pause"),e++,this.once("pollComplete",(function(){f("pre-pause polling complete"),--e||t()}))),this.writable||(f("we are currently writing - waiting to pause"),e++,this.once("drain",(function(){f("pre-pause writing complete"),--e||t()})))}else t()}poll(){f("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){f("polling got data %s",e);(0,c.decodePayload)(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState?this.poll():f('ignoring poll - transport state "%s"',this.readyState))}doClose(){const e=()=>{f("writing close packet"),this.write([{type:"close"}])};"open"===this.readyState?(f("transport open - closing"),e()):(f("transport not open - deferring close"),this.once("open",e))}write(e){this.writable=!1,(0,c.encodePayload)(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let s="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=(0,o.yeast)()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(s=":"+this.opts.port);const r=(0,a.encode)(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+s+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new v(this.uri(),e)}doWrite(e,t){const s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){f("xhr poll");const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}t.Polling=m;class v extends d.Emitter{constructor(e,t){super(),(0,l.installTimerFunctions)(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.create()}create(){const e=(0,l.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new u.XHR(e);try{f("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&t.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof t.status?t.status:0)}),0))},f("xhr data %s",this.data),t.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}"undefined"!=typeof document&&(this.index=v.requestsCount++,v.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=p,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete v.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(t.Request=v,v.requestsCount=0,v.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",g);else if("function"==typeof addEventListener){const e="onpagehide"in h.globalThisShim?"pagehide":"unload";addEventListener(e,g,!1)}function g(){for(let e in v.requests)v.requests.hasOwnProperty(e)&&v.requests[e].abort()}},9233:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultBinaryType=t.usingBrowserWebSocket=t.WebSocket=t.nextTick=void 0;const r=s(66);t.nextTick="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),t.WebSocket=r.globalThisShim.WebSocket||r.globalThisShim.MozWebSocket,t.usingBrowserWebSocket=!0,t.defaultBinaryType="arraybuffer"},4199:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WS=void 0;const n=s(4291),i=s(8573),o=s(7058),a=s(102),c=s(9233),u=r(s(5579)),d=s(4755),l=(0,u.default)("engine.io-client:websocket"),h="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class f extends n.Transport{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,s=h?{}:(0,a.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=c.usingBrowserWebSocket&&!h?t?new c.WebSocket(e,t):new c.WebSocket(e):new c.WebSocket(e,t,s)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType||c.defaultBinaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const s=e[t],r=t===e.length-1;(0,d.encodePacket)(s,this.supportsBinary,(e=>{const t={};if(!c.usingBrowserWebSocket&&(s.options&&(t.compress=s.options.compress),this.opts.perMessageDeflate)){("string"==typeof e?Buffer.byteLength(e):e.length)<this.opts.perMessageDeflate.threshold&&(t.compress=!1)}try{c.usingBrowserWebSocket?this.ws.send(e):this.ws.send(e,t)}catch(e){l("websocket closed before onclose event")}r&&(0,c.nextTick)((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let s="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(s=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=(0,o.yeast)()),this.supportsBinary||(e.b64=1);const r=(0,i.encode)(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+s+this.opts.path+(r.length?"?"+r:"")}check(){return!!c.WebSocket}}t.WS=f},4582:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XHR=void 0;const r=s(6051),n=s(66);t.XHR=function(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||r.hasCORS))return new XMLHttpRequest}catch(e){}if(!t)try{return new(n.globalThisShim[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}},102:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.byteLength=t.installTimerFunctions=t.pick=void 0;const r=s(66);t.pick=function(e,...t){return t.reduce(((t,s)=>(e.hasOwnProperty(s)&&(t[s]=e[s]),t)),{})};const n=setTimeout,i=clearTimeout;t.installTimerFunctions=function(e,t){t.useNativeTimers?(e.setTimeoutFn=n.bind(r.globalThisShim),e.clearTimeoutFn=i.bind(r.globalThisShim)):(e.setTimeoutFn=setTimeout.bind(r.globalThisShim),e.clearTimeoutFn=clearTimeout.bind(r.globalThisShim))};const o=1.33;t.byteLength=function(e){return"string"==typeof e?function(e){let t=0,s=0;for(let r=0,n=e.length;r<n;r++)t=e.charCodeAt(r),t<128?s+=1:t<2048?s+=2:t<55296||t>=57344?s+=3:(r++,s+=4);return s}(e):Math.ceil((e.byteLength||e.size)*o)}},9782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_PACKET=t.PACKET_TYPES_REVERSE=t.PACKET_TYPES=void 0;const s=Object.create(null);t.PACKET_TYPES=s,s.open="0",s.close="1",s.ping="2",s.pong="3",s.message="4",s.upgrade="5",s.noop="6";const r=Object.create(null);t.PACKET_TYPES_REVERSE=r,Object.keys(s).forEach((e=>{r[s[e]]=e}));t.ERROR_PACKET={type:"error",data:"parser error"}},6502:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0;const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<s.length;e++)r[s.charCodeAt(e)]=e;t.encode=e=>{let t,r=new Uint8Array(e),n=r.length,i="";for(t=0;t<n;t+=3)i+=s[r[t]>>2],i+=s[(3&r[t])<<4|r[t+1]>>4],i+=s[(15&r[t+1])<<2|r[t+2]>>6],i+=s[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i};t.decode=e=>{let t,s,n,i,o,a=.75*e.length,c=e.length,u=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);const d=new ArrayBuffer(a),l=new Uint8Array(d);for(t=0;t<c;t+=4)s=r[e.charCodeAt(t)],n=r[e.charCodeAt(t+1)],i=r[e.charCodeAt(t+2)],o=r[e.charCodeAt(t+3)],l[u++]=s<<2|n>>4,l[u++]=(15&n)<<4|i>>2,l[u++]=(3&i)<<6|63&o;return d}},3108:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=s(9782),n=s(6502),i="function"==typeof ArrayBuffer,o=(e,t)=>{if(i){const s=(0,n.decode)(e);return a(s,t)}return{base64:!0,data:e}},a=(e,t)=>"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e;t.default=(e,t)=>{if("string"!=typeof e)return{type:"message",data:a(e,t)};const s=e.charAt(0);if("b"===s)return{type:"message",data:o(e.substring(1),t)};return r.PACKET_TYPES_REVERSE[s]?e.length>1?{type:r.PACKET_TYPES_REVERSE[s],data:e.substring(1)}:{type:r.PACKET_TYPES_REVERSE[s]}:r.ERROR_PACKET}},4895:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=s(9782),n="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),i="function"==typeof ArrayBuffer,o=(e,t)=>{const s=new FileReader;return s.onload=function(){const e=s.result.split(",")[1];t("b"+(e||""))},s.readAsDataURL(e)};t.default=({type:e,data:t},s,a)=>{return n&&t instanceof Blob?s?a(t):o(t,a):i&&(t instanceof ArrayBuffer||(c=t,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(c):c&&c.buffer instanceof ArrayBuffer))?s?a(t):o(new Blob([t]),a):a(r.PACKET_TYPES[e]+(t||""));var c}},4755:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodePayload=t.decodePacket=t.encodePayload=t.encodePacket=t.protocol=void 0;const r=s(4895);t.encodePacket=r.default;const n=s(3108);t.decodePacket=n.default;const i=String.fromCharCode(30);t.encodePayload=(e,t)=>{const s=e.length,n=new Array(s);let o=0;e.forEach(((e,a)=>{(0,r.default)(e,!1,(e=>{n[a]=e,++o===s&&t(n.join(i))}))}))};t.decodePayload=(e,t)=>{const s=e.split(i),r=[];for(let e=0;e<s.length;e++){const i=(0,n.default)(s[e],t);if(r.push(i),"error"===i.type)break}return r},t.protocol=4},1067:(e,t)=>{"use strict";function s(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Object.defineProperty(t,"__esModule",{value:!0}),t.Backoff=void 0,t.Backoff=s,s.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),s=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-s:e+s}return 0|Math.min(e,this.max)},s.prototype.reset=function(){this.attempts=0},s.prototype.setMin=function(e){this.ms=e},s.prototype.setMax=function(e){this.max=e},s.prototype.setJitter=function(e){this.jitter=e}},8623:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.connect=t.io=t.Socket=t.Manager=t.protocol=void 0;const n=s(4197),i=s(3288);Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return i.Manager}});const o=s(3232);Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return o.Socket}});const a=r(s(5579)).default("socket.io-client"),c={};function u(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};const s=n.url(e,t.path||"/socket.io"),r=s.source,o=s.id,u=s.path,d=c[o]&&u in c[o].nsps;let l;return t.forceNew||t["force new connection"]||!1===t.multiplex||d?(a("ignoring socket cache for %s",r),l=new i.Manager(r,t)):(c[o]||(a("new io instance for %s",r),c[o]=new i.Manager(r,t)),l=c[o]),s.query&&!t.query&&(t.query=s.queryKey),l.socket(s.path,t)}t.io=u,t.connect=u,t.default=u,Object.assign(u,{Manager:i.Manager,Socket:o.Socket,io:u,connect:u});var d=s(170);Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return d.protocol}}),e.exports=u},3288:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Manager=void 0;const a=s(5769),c=s(3232),u=i(s(170)),d=s(6263),l=s(1067),h=s(5867),f=o(s(5579)).default("socket.io-client:manager");class p extends h.Emitter{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,a.installTimerFunctions(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(s=t.randomizationFactor)&&void 0!==s?s:.5),this.backoff=new l.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||u;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(f("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;f("opening %s",this.uri),this.engine=new a.Socket(this.uri,this.opts);const t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const r=d.on(t,"open",(function(){s.onopen(),e&&e()})),n=d.on(t,"error",(t=>{f("error"),s.cleanup(),s._readyState="closed",this.emitReserved("error",t),e?e(t):s.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;f("connect attempt will timeout after %d",e),0===e&&r();const s=this.setTimeoutFn((()=>{f("connect attempt timed out after %d",e),r(),t.close(),t.emit("error",new Error("timeout"))}),e);this.opts.autoUnref&&s.unref(),this.subs.push((function(){clearTimeout(s)}))}return this.subs.push(r),this.subs.push(n),this}connect(e){return this.open(e)}onopen(){f("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(d.on(e,"ping",this.onping.bind(this)),d.on(e,"data",this.ondata.bind(this)),d.on(e,"error",this.onerror.bind(this)),d.on(e,"close",this.onclose.bind(this)),d.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){a.nextTick((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){f("error",e),this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s||(s=new c.Socket(this,e,t),this.nsps[e]=s),s}_destroy(e){const t=Object.keys(this.nsps);for(const e of t){if(this.nsps[e].active)return void f("socket %s is still active, skipping close",e)}this._close()}_packet(e){f("writing packet %j",e);const t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){f("cleanup"),this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){f("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){f("closed due to %s",e),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)f("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();f("will wait %dms before reconnect attempt",t),this._reconnecting=!0;const s=this.setTimeoutFn((()=>{e.skipReconnect||(f("attempting reconnect"),this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(f("reconnect attempt error"),e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):(f("reconnect success"),e.onreconnect())})))}),t);this.opts.autoUnref&&s.unref(),this.subs.push((function(){clearTimeout(s)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}t.Manager=p},6263:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.on=void 0,t.on=function(e,t,s){return e.on(t,s),function(){e.off(t,s)}}},3232:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=void 0;const n=s(170),i=s(6263),o=s(5867),a=r(s(5579)).default("socket.io-client:socket"),c=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class u extends o.Emitter{constructor(e,t,s){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[i.on(e,"open",this.onopen.bind(this)),i.on(e,"packet",this.onpacket.bind(this)),i.on(e,"error",this.onerror.bind(this)),i.on(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(c.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');t.unshift(e);const s={type:n.PacketType.EVENT,data:t,options:{}};if(s.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++;a("emitting packet with ack id %d",e);const r=t.pop();this._registerAckCallback(e,r),s.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)?a("discard packet as the transport is not currently writable"):this.connected?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s),this.flags={},this}_registerAckCallback(e,t){const s=this.flags.timeout;if(void 0===s)return void(this.acks[e]=t);const r=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&(a("removing packet with ack id %d from the buffer",e),this.sendBuffer.splice(t,1));a("event with ack id %d has timed out after %d ms",e,s),t.call(this,new Error("operation has timed out"))}),s);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(r),t.apply(this,[null,...e])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){a("transport is open - connecting"),"function"==typeof this.auth?this.auth((e=>{this.packet({type:n.PacketType.CONNECT,data:e})})):this.packet({type:n.PacketType.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){a("close (%s)",e),this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case n.PacketType.CONNECT:if(e.data&&e.data.sid){const t=e.data.sid;this.onconnect(t)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case n.PacketType.EVENT:case n.PacketType.BINARY_EVENT:this.onevent(e);break;case n.PacketType.ACK:case n.PacketType.BINARY_ACK:this.onack(e);break;case n.PacketType.DISCONNECT:this.ondisconnect();break;case n.PacketType.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];a("emitting event %j",t),null!=e.id&&(a("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const s of t)s.apply(this,e)}super.emit.apply(this,e)}ack(e){const t=this;let s=!1;return function(...r){s||(s=!0,a("sending ack %j",r),t.packet({type:n.PacketType.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t?(a("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):a("bad ack %s",e.id)}onconnect(e){a("socket connected with id %s",e),this.id=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){a("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(a("performing disconnect (%s)",this.nsp),this.packet({type:n.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const s of t)s.apply(this,e.data)}}}t.Socket=u},4197:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.url=void 0;const n=s(5769),i=r(s(5579)).default("socket.io-client:url");t.url=function(e,t="",s){let r=e;s=s||"undefined"!=typeof location&&location,null==e&&(e=s.protocol+"//"+s.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?s.protocol+e:s.host+e),/^(https?|wss?):\/\//.test(e)||(i("protocol-less url %s",e),e=void 0!==s?s.protocol+"//"+e:"https://"+e),i("parse %s",e),r=n.parse(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(s&&s.port===r.port?"":":"+r.port),r}},2830:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reconstructPacket=t.deconstructPacket=void 0;const r=s(3980);function n(e,t){if(!e)return e;if((0,r.isBinary)(e)){const s={_placeholder:!0,num:t.length};return t.push(e),s}if(Array.isArray(e)){const s=new Array(e.length);for(let r=0;r<e.length;r++)s[r]=n(e[r],t);return s}if("object"==typeof e&&!(e instanceof Date)){const s={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(s[r]=n(e[r],t));return s}return e}function i(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let s=0;s<e.length;s++)e[s]=i(e[s],t);else if("object"==typeof e)for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(e[s]=i(e[s],t));return e}t.deconstructPacket=function(e){const t=[],s=e.data,r=e;return r.data=n(s,t),r.attachments=t.length,{packet:r,buffers:t}},t.reconstructPacket=function(e,t){return e.data=i(e.data,t),delete e.attachments,e}},170:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=t.PacketType=t.protocol=void 0;const r=s(5867),n=s(2830),i=s(3980),o=(0,s(5579).default)("socket.io-parser");var a;t.protocol=5,function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(a=t.PacketType||(t.PacketType={}));t.Encoder=class{constructor(e){this.replacer=e}encode(e){return o("encoding packet %j",e),e.type!==a.EVENT&&e.type!==a.ACK||!(0,i.hasBinary)(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==a.BINARY_EVENT&&e.type!==a.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),o("encoded %j as %s",e,t),t}encodeAsBinary(e){const t=(0,n.deconstructPacket)(e),s=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(s),r}};class c extends r.Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const s=t.type===a.BINARY_EVENT;s||t.type===a.BINARY_ACK?(t.type=s?a.EVENT:a.ACK,this.reconstructor=new u(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!(0,i.isBinary)(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const s={type:Number(e.charAt(0))};if(void 0===a[s.type])throw new Error("unknown packet type "+s.type);if(s.type===a.BINARY_EVENT||s.type===a.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const n=e.substring(r,t);if(n!=Number(n)||"-"!==e.charAt(t))throw new Error("Illegal attachments");s.attachments=Number(n)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}s.nsp=e.substring(r,t)}else s.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const s=e.charAt(t);if(null==s||Number(s)!=s){--t;break}if(t===e.length)break}s.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!c.isPayloadValid(s.type,r))throw new Error("invalid payload");s.data=r}return o("decoded %s as %j",e,s),s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case a.CONNECT:return"object"==typeof t;case a.DISCONNECT:return void 0===t;case a.CONNECT_ERROR:return"string"==typeof t||"object"==typeof t;case a.EVENT:case a.BINARY_EVENT:return Array.isArray(t)&&t.length>0;case a.ACK:case a.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}t.Decoder=c;class u{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=(0,n.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}},3980:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasBinary=t.isBinary=void 0;const s="function"==typeof ArrayBuffer,r=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,n=Object.prototype.toString,i="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===n.call(Blob),o="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===n.call(File);function a(e){return s&&(e instanceof ArrayBuffer||r(e))||i&&e instanceof Blob||o&&e instanceof File}t.isBinary=a,t.hasBinary=function e(t,s){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let s=0,r=t.length;s<r;s++)if(e(t[s]))return!0;return!1}if(a(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&e(t[s]))return!0;return!1}},5867:(e,t,s)=>{"use strict";function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}s.r(t),s.d(t,{Emitter:()=>r}),r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function s(){this.off(e,s),t.apply(this,arguments)}return s.fn=t,this.on(e,s),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var s,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var n=0;n<r.length;n++)if((s=r[n])===t||s.fn===t){r.splice(n,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),s=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(s){r=0;for(var n=(s=s.slice(0)).length;r<n;++r)s[r].apply(this,t)}return this},r.prototype.emitReserved=r.prototype.emit,r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var s=__webpack_module_cache__[e]={id:e,exports:{}};return __webpack_modules__[e].call(s.exports,s,s.exports,__webpack_require__),s.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var s in t)__webpack_require__.o(t,s)&&!__webpack_require__.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nc=void 0;var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CloudServicesCommentsAdapter:()=>$o,CloudServicesRevisionHistoryAdapter:()=>wa,CloudServicesTrackChangesAdapter:()=>ta,PresenceList:()=>Sc,RealTimeCollaborativeComments:()=>ca,RealTimeCollaborativeEditing:()=>Jo,RealTimeCollaborativeRevisionHistory:()=>Aa,RealTimeCollaborativeTrackChanges:()=>fa});var e=__webpack_require__(2704),t=__webpack_require__(2209),s=__webpack_require__(1492),r=__webpack_require__(9273),n=__webpack_require__(2417),i=__webpack_require__(7158),o=__webpack_require__.n(i);const a=["_isBrowserOffline","pluginName","function","reconnect","cloudServices.requestTimeout","add","change:me","stopListening","error","connection","then","disconnect","listenTo","showWarning","all","The limit of maximum concurrent connections that the collaboration server can handle has been reached. Try opening the document again in a few minutes. Please contact your system administrator if the problem persists.","cloudservices-init","state","code","connecting","cloudservices-reconnection-error","disconnected","token","websocketgateway-invalid-plugin-interface","_reconnectionStack","set","from","get","cloudServices.connectionTimeout","WebSocketGateway","CloudServices","webSocketUrl","initialReconnectionInterval","_domEmitter","offline","context","init","addToReconnectionStack","_reconnect","delete","websocketgateway-missing-websocket-url","_shouldPluginsReconnect","constructor","removeFromReconnectionStack","create","limitExceeded","real-time-collaboration","connected","define","requires","isInReconnectionStack","websocketgateway-plugin-already-registered","catch","connect","destroy","config"];var c,u;c=a,u=442,function(e){for(;--e;)c.push(c.shift())}(++u);const d=function(e,t){return a[e-=0]};class l extends e.ContextPlugin{static get[d("0x37")](){return[d("0x24"),r.Notification]}static get[d("0x7")](){return"WebSocketGateway"}[d("0x2a")](){const e=this.context,s=e.plugins[d("0x21")](d("0x24")),n=e.plugins[d("0x21")](r.Notification);if(!s[d("0x1c")])throw new t.CKEditorError("websocketgateway-missing-token",this);if(!s[d("0x25")])throw new t.CKEditorError(d("0x2e"),this);return this[d("0x1f")](d("0x17"),"connecting"),this[d("0x1f")](d("0x6"),!1),this._reconnectionStack=new Set,this[d("0x2f")]=!1,this[d("0x27")]=Object[d("0x32")](t.DomEmitterMixin),this[d("0x27")][d("0x12")](window,d("0x28"),(()=>this[d("0x6")]=!0)),this[d("0x27")].listenTo(window,"online",(()=>this[d("0x6")]=!1)),this.context[d("0x5")][d("0x36")](d("0x22"),10),this[d("0x29")][d("0x5")][d("0x36")](d("0xa"),20),l[d("0x23")][d("0x3")](s[d("0x1c")],s[d("0x25")],{disconnectOnUnload:!1,timeout:1e3*this[d("0x29")][d("0x5")][d("0x21")]("cloudServices.connectionTimeout"),requestTimeout:1e3*this.context[d("0x5")][d("0x21")](d("0xa"))})[d("0x10")]((e=>{if(this[d("0xf")]=e,this.bind(d("0x17")).to(e,d("0x17"),this,d("0x6"),((e,t)=>(d("0x35")!==e&&(this[d("0x2f")]=!0),t||d("0x35")!==e?d("0x1b"):d("0x1b")==this[d("0x17")]&&this[d("0x2f")]?(this._shouldPluginsReconnect=!1,this[d("0x2c")](),d("0x19")):"connected"))),this[d("0xf")].on(d("0xe"),((e,s)=>{if(d("0x33")!==s[d("0x18")])throw console.error(s),new t.CKEditorError(d("0x16"),null,{originalError:s});n[d("0x13")](d("0x15"),{title:"Connected users limit exceeded",namespace:d("0x34")})})),!e.me)return new Promise((t=>e.on(d("0xc"),t)))})).catch((e=>{throw console[d("0xe")](e),new t.CKEditorError("cloudservices-init",null,{originalError:e})}))}[d("0x2b")](e){if(d("0x8")!=typeof e[d("0x9")])throw new t.CKEditorError(d("0x1d"),this);if(this[d("0x0")](e))throw new t.CKEditorError(d("0x1"),this,{name:e[d("0x30")].pluginName});this._reconnectionStack[d("0xb")](e)}[d("0x31")](e){this[d("0x1e")][d("0x2d")](e)}[d("0x0")](e){return this[d("0x1e")].has(e)}_reconnect(){return this.connection[d("0x9")]()[d("0x10")]((()=>Promise[d("0x14")](Array[d("0x20")](this[d("0x1e")],(e=>e[d("0x9")]())))))[d("0x10")]((()=>this[d("0x17")]=d("0x35")))[d("0x2")]((e=>{throw console[d("0xe")](e),new t.CKEditorError(d("0x1a"),this[d("0x29")])}))}[d("0x4")](){this.connection&&this[d("0xf")][d("0x11")](),this[d("0x17")]=d("0x1b"),this[d("0x27")][d("0xd")](),super[d("0x4")]()}}l[d("0x23")]=o(),l[d("0x26")]=1e3;const h=["unregister","state","_handleSessionRemove","remove","set","stopListening","connection","plugins","forEach","add","_registeredSessions","listenTo","values","delete","pluginName","assign","_uniqueUsersCount","sessionId","sessions-unregister-not-exist","getUserSessions","user","allConnectedUsers","orderNumber","sessions-register-already-registered","sessionAdd:","context","channelSessions","_createUser","size","get","connected","clear","channelConnectedUsers","has","init","mySessionId","_users","_handleSessionAdd"];var f,p;f=h,p=153,function(e){for(;--e;)f.push(f.shift())}(++p);const y=function(e,t){return h[e-=0]};class m extends e.ContextPlugin{static get[y("0xd")](){return"Sessions"}static get requires(){return[l,n.Users]}[y("0x21")](){const e=this[y("0x18")],s=e[y("0x6")][y("0x1c")](l);this[y("0x19")]=new Map,this.channelConnectedUsers=new Map,this[y("0x14")]=new t.Collection,this[y("0x9")]=new Map,this[y("0xf")]=0,this[y("0x23")]=e.plugins[y("0x1c")](n.Users),this[y("0xa")](s,"change:state",((e,t,s)=>{if(y("0x1d")!==s)this[y("0x19")][y("0x7")]((e=>e[y("0x1e")]())),this.channelConnectedUsers[y("0x7")]((e=>e[y("0x1e")]())),this[y("0x14")][y("0x1e")]();else for(const[e,t]of this[y("0x9")])for(const s of t)this[y("0x24")](e,s)})),this[y("0x1a")](s[y("0x5")].me,!0)}register(e,s){if(this[y("0x9")].has(e))throw new t.CKEditorError(y("0x16"),null,{channelId:e});this[y("0x9")][y("0x3")](e,s),this[y("0x19")][y("0x3")](e,new t.Collection),this[y("0x1f")][y("0x3")](e,new t.Collection),this[y("0xa")](s,"add",((t,s)=>this[y("0x24")](e,s))),this[y("0xa")](s,y("0x2"),((t,s)=>this[y("0x1")](e,s)));for(const t of s)this._handleSessionAdd(e,t)}[y("0x25")](e){if(!this._registeredSessions[y("0x20")](e))throw new t.CKEditorError(y("0x11"),null,{channelId:e});const s=this[y("0x9")][y("0x1c")](e);this[y("0x4")](s);for(const t of s)y("0x1d")===this[y("0x18")][y("0x6")][y("0x1c")](l)[y("0x0")]&&this._handleSessionRemove(e,t);this[y("0x9")][y("0xc")](e),this.channelSessions.delete(e),this[y("0x1f")][y("0xc")](e)}get[y("0x22")](){return this.context[y("0x6")][y("0x1c")](l)[y("0x5")][y("0x10")]}getUserBySessionId(e){for(const t of this[y("0x19")][y("0xb")]())for(const s of t)if(s.id===e)return s[y("0x13")]}[y("0x12")](e,t){const s=t?[this[y("0x19")][y("0x1c")](t)]:this[y("0x19")][y("0xb")](),r=new Set;for(const t of s)for(const s of t)s[y("0x13")].id===e.id&&r[y("0x8")](s.id);return r}getUserRole(e){for(const t of this.channelSessions[y("0xb")]())for(const s of t)if(s.user===e)return s.role}[y("0x24")](e,t){if(y("0x1d")!==this.context.plugins[y("0x1c")](l)[y("0x0")])return;const s=t.user,r=this[y("0x23")].getUser(s.id)||this[y("0x1a")](s),n=Object[y("0xe")]({},t,{user:r});this.channelSessions[y("0x1c")](e)[y("0x8")](n);const i=this[y("0x1f")].get(e);i[y("0x20")](r.id)||i[y("0x8")](r),this[y("0x14")][y("0x20")](r.id)||this[y("0x14")][y("0x8")](r),this.fire(y("0x17")+e,{channelId:e,session:n})}[y("0x1")](e,t){if(y("0x1d")!==this[y("0x18")][y("0x6")][y("0x1c")](l)[y("0x0")])return;const s=this[y("0x1f")][y("0x1c")](e),r=t.user;this.channelSessions[y("0x1c")](e).remove(t.id),s[y("0x20")](r.id)&&!this[y("0x12")](r,e)[y("0x1b")]&&s[y("0x2")](r.id),this.allConnectedUsers[y("0x1c")](r.id)&&!this[y("0x12")](r)[y("0x1b")]&&this.allConnectedUsers[y("0x2")](r.id)}[y("0x1a")](e,t){const s=this[y("0x23")].addUser(e);return t&&this[y("0x23")].defineMe(e.id),s[y("0x15")]=this[y("0xf")]++,s}}var v=__webpack_require__(7594),g=__webpack_require__.n(v),x=__webpack_require__(9940),_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};g()(x.Z,_);x.Z.locals;const b=["delete","getAttribute","getStart","createUIElement","getUserBySessionId","markerName","mySessionId","getCustomProperty","markers","type","enqueueChange","parent","model","editingDowncast","$graveyard","applyOperation","document","getNearestSelectionRange","for","orderNumber","toDomElement","change:range","editor","createRange","getContainedElement","clear","user:range:","root","user:position","selection","deletionPosition","batch","addMarker","startsWith","view","getFirstRange","removeMarker","oldRange","init","reconvertMarker","isLimit","conversion","name","has","$text","user:","userPositionMarker","isSimilar","isObject","undo","updateMarker","marker","setCustomProperty","split","toRange","start","newRange","checkChild","editing",'&#8203;<span class="ck-user__marker-line"><span class="ck-user__marker-dot"></span></span>',"user:range","size","isInline","rootName","tableCell","requires","getSelectionClass","nodeAfter","get","getMarkerClass","end","detach","afterInit","user:position:","data-session-id","getRange","ck-user__marker ","plugins","schema","getPositions","color","markerToHighlight","update:user:range"];var w,O;w=b,O=267,function(e){for(;--e;)w.push(w.shift())}(++O);const E=function(e,t){return b[e-=0]};class S extends e.Plugin{static get[E("0x2f")](){return[m]}static get pluginName(){return"UserMarkers"}[E("0x14")](){const e=this.editor,t=e[E("0x3b")][E("0x32")](m);e.conversion[E("0x0")](E("0x4e")).markerToElement({model:E("0xa"),view:(s,{writer:r})=>function(e,t,s,r){const n=e[E("0x46")][E("0x23")](":")[2],i=s[E("0x45")](n);if(!i||n===s[E("0x47")])return;if(!r[E("0x4d")][E("0x3c")][E("0x27")](e.markerRange[E("0x25")],E("0x1a")))return;const o={class:E("0x3a")+i[E("0x3e")][E("0x33")](),"data-name":i[E("0x18")],"data-session-id":n},a=r[E("0x4d")].markers.get(e.markerName)[E("0x43")](),c=a[E("0x31")],u=r[E("0x4d")][E("0x3c")];if(c&&u[E("0x1e")](c)&&u[E("0x2c")](c)&&!r[E("0x4d")][E("0x49")].get(E("0x8")+n)[E("0x39")]().isCollapsed)return;const d=a[E("0x4c")];r[E("0x4d")][E("0x3c")][E("0x16")](d)&&!r[E("0x4d")].hasContent(d)&&(o.contenteditable=!1);const l=function(e,t){const s=e[E("0x44")]("span",t);return e[E("0x22")](E("0x1c"),!0,s),s.render=function(e){const t=this[E("0x2")](e);return t.innerHTML=E("0x29"),t},s[E("0x1d")]=function(e){return this.getCustomProperty(E("0x1c"))&&e[E("0x48")](E("0x1c"))&&this.getAttribute(E("0x38"))==e[E("0x42")](E("0x38"))},s}(t,o);return l.priority=1e3+i[E("0x1")],l}(s,r,t,e)}),e[E("0x17")][E("0x0")](E("0x4e"))[E("0x3f")]({model:E("0x2a"),view:e=>function(e,t){const s=e[E("0x46")][E("0x23")](":")[2];if(s===t[E("0x47")])return;const r=t.getUserBySessionId(s);return r?{id:s,classes:["ck-user__selection",r[E("0x3e")][E("0x30")]()],attributes:{"data-session-id":s},priority:2e3+r[E("0x1")]}:{id:s}}(e,t)}),function(e){const t=e[E("0x4d")],r=new Map,n=e[E("0x3b")][E("0x32")](m);t[E("0x49")].on(E("0x40"),((i,o,a,c)=>{if(!c&&r.get(o[E("0x18")]))return r[E("0x32")](o[E("0x18")])[E("0x35")](),void r[E("0x41")](o[E("0x18")]);const u=o[E("0x18")].split(":")[2];if(u===n[E("0x47")])return;const d=E("0x37")+u;t[E("0x49")][E("0x19")](d)&&e.editing[E("0x15")](d),o.on(E("0x3"),((e,n,i)=>{if(E("0x4f")!=n[E("0x9")][E("0x2d")]&&E("0x4f")==o[E("0x39")]()[E("0x9")][E("0x2d")]&&!r[E("0x19")](o.name)){const e=t.schema.getNearestSelectionRange(i[E("0xc")]);if(e){const n=s.LiveRange.fromRange(e);r.set(o[E("0x18")],n),n.on(E("0x3"),((e,s,i)=>{if(E("0x4f")==n.root[E("0x2d")]){const e=t.schema[E("0x52")](i[E("0xc")]);e?(n[E("0x25")]=e[E("0x25")],n[E("0x34")]=e.end):(r[E("0x41")](o.name),n[E("0x35")]())}}))}}}))})),t[E("0x51")].on("change",(()=>{r[E("0x2b")]>0&&t[E("0x4b")]({isUndoable:!1},(e=>{for(const[s,n]of r)E("0x4f")==t[E("0x49")][E("0x32")](s)[E("0x39")]()[E("0x9")][E("0x2d")]&&(T(s[E("0x23")](":")[2],n[E("0x24")](),t,e),n[E("0x35")]());r[E("0x7")]()}))}))}(e)}[E("0x36")](){const e=this[E("0x4")],t=e.commands[E("0x32")](E("0x1f"));t&&e[E("0x4d")].on(E("0x50"),((s,r)=>{const n=r[0];if(E("0x21")!=n[E("0x4a")]||!n[E("0x18")][E("0xf")](E("0x1b")))return;const i=n[E("0xd")];t._createdBatches[E("0x19")](i)&&(n[E("0x26")]=n.oldRange?e[E("0x4d")][E("0x5")](n.oldRange[E("0x25")],n[E("0x13")].end):null)}),{priority:"highest"})}createUserMarkerOperations(){const e=this[E("0x4")],t=e[E("0x4d")][E("0x51")],s=e.plugins[E("0x32")](m);e[E("0x4d")][E("0x4b")]({isUndoable:!1},(r=>{const n=E("0x8")+s.mySessionId,i=E("0x37")+s[E("0x47")],o=e.model[E("0x49")][E("0x19")](n);e[E("0x28")][E("0x10")].hasDomSelection?T(s[E("0x47")],t[E("0xb")][E("0x11")](),e.model,r):o&&(r[E("0x12")](n),r.removeMarker(i))}))}}function T(e,t,s,r){const n=E("0x8")+e,i="user:position:"+e,o=t[E("0x6")]();let a=t[E("0x25")];o&&o.is("element",E("0x2e"))&&(a=function(e,t){for(const s of e[E("0x3d")]())if(t[E("0x3c")][E("0x27")](s,E("0x1a")))return s}(t,s),t=r[E("0x5")](a)),a=r.createRange(a),s[E("0x49")][E("0x19")](n)?(r[E("0x20")](n,{range:t}),r[E("0x20")](i,{range:a})):(r[E("0xe")](n,{range:t,usingOperation:!0}),r[E("0xe")](i,{range:a,usingOperation:!0}))}function k(e,t,s){const r=e.t;switch(t){case"PENDING_ACTION_SENDING_DATA":return r({string:"Sending data to the server.",id:"PENDING_ACTION_SENDING_DATA"});case"The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.":return r("The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.");case"The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.":return r("The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.");case"The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.":return r("The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.");case"The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.":return r("The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.");case"Synchronization issue":return r("Synchronization issue");case"PENDING_ACTION_REVISION_HISTORY":return r({string:"Unsaved change in revision history.",id:"PENDING_ACTION_REVISION_HISTORY"});case"CONNECTED_USERS":return r({string:"1 connected user (me)",plural:"%0 connected users",id:"CONNECTED_USERS"},s)}}var A=__webpack_require__(9933),C=__webpack_require__.n(A);const I=function(){this.__data__=[],this.size=0};const R=function(e,t){return e===t||e!=e&&t!=t};const N=function(e,t){for(var s=e.length;s--;)if(R(e[s][0],t))return s;return-1};var j=Array.prototype.splice;const P=function(e){var t=this.__data__,s=N(t,e);return!(s<0)&&(s==t.length-1?t.pop():j.call(t,s,1),--this.size,!0)};const D=function(e){var t=this.__data__,s=N(t,e);return s<0?void 0:t[s][1]};const M=function(e){return N(this.__data__,e)>-1};const B=function(e,t){var s=this.__data__,r=N(s,e);return r<0?(++this.size,s.push([e,t])):s[r][1]=t,this};function J(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var r=e[t];this.set(r[0],r[1])}}J.prototype.clear=I,J.prototype.delete=P,J.prototype.get=D,J.prototype.has=M,J.prototype.set=B;const V=J;const U=function(){this.__data__=new V,this.size=0};const F=function(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s};const q=function(e){return this.__data__.get(e)};const L=function(e){return this.__data__.has(e)};const Y="object"==typeof global&&global&&global.Object===Object&&global;var z="object"==typeof self&&self&&self.Object===Object&&self;const G=Y||z||Function("return this")();const $=G.Symbol;var W=Object.prototype,K=W.hasOwnProperty,H=W.toString,Z=$?$.toStringTag:void 0;const X=function(e){var t=K.call(e,Z),s=e[Z];try{e[Z]=void 0;var r=!0}catch(e){}var n=H.call(e);return r&&(t?e[Z]=s:delete e[Z]),n};var Q=Object.prototype.toString;const ee=function(e){return Q.call(e)};var te="[object Null]",se="[object Undefined]",re=$?$.toStringTag:void 0;const ne=function(e){return null==e?void 0===e?se:te:re&&re in Object(e)?X(e):ee(e)};const ie=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var oe="[object AsyncFunction]",ae="[object Function]",ce="[object GeneratorFunction]",ue="[object Proxy]";const de=function(e){if(!ie(e))return!1;var t=ne(e);return t==ae||t==ce||t==oe||t==ue};const le=G["__core-js_shared__"];var he,fe=(he=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||""))?"Symbol(src)_1."+he:"";const pe=function(e){return!!fe&&fe in e};var ye=Function.prototype.toString;const me=function(e){if(null!=e){try{return ye.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var ve=/^\[object .+?Constructor\]$/,ge=Function.prototype,xe=Object.prototype,_e=ge.toString,be=xe.hasOwnProperty,we=RegExp("^"+_e.call(be).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Oe=function(e){return!(!ie(e)||pe(e))&&(de(e)?we:ve).test(me(e))};const Ee=function(e,t){return null==e?void 0:e[t]};const Se=function(e,t){var s=Ee(e,t);return Oe(s)?s:void 0};const Te=Se(G,"Map");const ke=Se(Object,"create");const Ae=function(){this.__data__=ke?ke(null):{},this.size=0};const Ce=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var Ie="__lodash_hash_undefined__",Re=Object.prototype.hasOwnProperty;const Ne=function(e){var t=this.__data__;if(ke){var s=t[e];return s===Ie?void 0:s}return Re.call(t,e)?t[e]:void 0};var je=Object.prototype.hasOwnProperty;const Pe=function(e){var t=this.__data__;return ke?void 0!==t[e]:je.call(t,e)};var De="__lodash_hash_undefined__";const Me=function(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=ke&&void 0===t?De:t,this};function Be(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var r=e[t];this.set(r[0],r[1])}}Be.prototype.clear=Ae,Be.prototype.delete=Ce,Be.prototype.get=Ne,Be.prototype.has=Pe,Be.prototype.set=Me;const Je=Be;const Ve=function(){this.size=0,this.__data__={hash:new Je,map:new(Te||V),string:new Je}};const Ue=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const Fe=function(e,t){var s=e.__data__;return Ue(t)?s["string"==typeof t?"string":"hash"]:s.map};const qe=function(e){var t=Fe(this,e).delete(e);return this.size-=t?1:0,t};const Le=function(e){return Fe(this,e).get(e)};const Ye=function(e){return Fe(this,e).has(e)};const ze=function(e,t){var s=Fe(this,e),r=s.size;return s.set(e,t),this.size+=s.size==r?0:1,this};function Ge(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var r=e[t];this.set(r[0],r[1])}}Ge.prototype.clear=Ve,Ge.prototype.delete=qe,Ge.prototype.get=Le,Ge.prototype.has=Ye,Ge.prototype.set=ze;const $e=Ge;var We=200;const Ke=function(e,t){var s=this.__data__;if(s instanceof V){var r=s.__data__;if(!Te||r.length<We-1)return r.push([e,t]),this.size=++s.size,this;s=this.__data__=new $e(r)}return s.set(e,t),this.size=s.size,this};function He(e){var t=this.__data__=new V(e);this.size=t.size}He.prototype.clear=U,He.prototype.delete=F,He.prototype.get=q,He.prototype.has=L,He.prototype.set=Ke;const Ze=He;const Xe=function(e,t){for(var s=-1,r=null==e?0:e.length;++s<r&&!1!==t(e[s],s,e););return e};const Qe=function(){try{var e=Se(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const et=function(e,t,s){"__proto__"==t&&Qe?Qe(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s};var tt=Object.prototype.hasOwnProperty;const st=function(e,t,s){var r=e[t];tt.call(e,t)&&R(r,s)&&(void 0!==s||t in e)||et(e,t,s)};const rt=function(e,t,s,r){var n=!s;s||(s={});for(var i=-1,o=t.length;++i<o;){var a=t[i],c=r?r(s[a],e[a],a,s,e):void 0;void 0===c&&(c=e[a]),n?et(s,a,c):st(s,a,c)}return s};const nt=function(e,t){for(var s=-1,r=Array(e);++s<e;)r[s]=t(s);return r};const it=function(e){return null!=e&&"object"==typeof e};var ot="[object Arguments]";const at=function(e){return it(e)&&ne(e)==ot};var ct=Object.prototype,ut=ct.hasOwnProperty,dt=ct.propertyIsEnumerable;const lt=at(function(){return arguments}())?at:function(e){return it(e)&&ut.call(e,"callee")&&!dt.call(e,"callee")};const ht=Array.isArray;const ft=function(){return!1};var pt="object"==typeof exports&&exports&&!exports.nodeType&&exports,yt=pt&&"object"==typeof module&&module&&!module.nodeType&&module,mt=yt&&yt.exports===pt?G.Buffer:void 0;const vt=(mt?mt.isBuffer:void 0)||ft;var gt=9007199254740991,xt=/^(?:0|[1-9]\d*)$/;const _t=function(e,t){var s=typeof e;return!!(t=null==t?gt:t)&&("number"==s||"symbol"!=s&&xt.test(e))&&e>-1&&e%1==0&&e<t};var bt=9007199254740991;const wt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=bt};var Ot={};Ot["[object Float32Array]"]=Ot["[object Float64Array]"]=Ot["[object Int8Array]"]=Ot["[object Int16Array]"]=Ot["[object Int32Array]"]=Ot["[object Uint8Array]"]=Ot["[object Uint8ClampedArray]"]=Ot["[object Uint16Array]"]=Ot["[object Uint32Array]"]=!0,Ot["[object Arguments]"]=Ot["[object Array]"]=Ot["[object ArrayBuffer]"]=Ot["[object Boolean]"]=Ot["[object DataView]"]=Ot["[object Date]"]=Ot["[object Error]"]=Ot["[object Function]"]=Ot["[object Map]"]=Ot["[object Number]"]=Ot["[object Object]"]=Ot["[object RegExp]"]=Ot["[object Set]"]=Ot["[object String]"]=Ot["[object WeakMap]"]=!1;const Et=function(e){return it(e)&&wt(e.length)&&!!Ot[ne(e)]};const St=function(e){return function(t){return e(t)}};var Tt="object"==typeof exports&&exports&&!exports.nodeType&&exports,kt=Tt&&"object"==typeof module&&module&&!module.nodeType&&module,At=kt&&kt.exports===Tt&&Y.process;const Ct=function(){try{var e=kt&&kt.require&&kt.require("util").types;return e||At&&At.binding&&At.binding("util")}catch(e){}}();var It=Ct&&Ct.isTypedArray;const Rt=It?St(It):Et;var Nt=Object.prototype.hasOwnProperty;const jt=function(e,t){var s=ht(e),r=!s&&lt(e),n=!s&&!r&&vt(e),i=!s&&!r&&!n&&Rt(e),o=s||r||n||i,a=o?nt(e.length,String):[],c=a.length;for(var u in e)!t&&!Nt.call(e,u)||o&&("length"==u||n&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||_t(u,c))||a.push(u);return a};var Pt=Object.prototype;const Dt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Pt)};const Mt=function(e,t){return function(s){return e(t(s))}};const Bt=Mt(Object.keys,Object);var Jt=Object.prototype.hasOwnProperty;const Vt=function(e){if(!Dt(e))return Bt(e);var t=[];for(var s in Object(e))Jt.call(e,s)&&"constructor"!=s&&t.push(s);return t};const Ut=function(e){return null!=e&&wt(e.length)&&!de(e)};const Ft=function(e){return Ut(e)?jt(e):Vt(e)};const qt=function(e,t){return e&&rt(t,Ft(t),e)};const Lt=function(e){var t=[];if(null!=e)for(var s in Object(e))t.push(s);return t};var Yt=Object.prototype.hasOwnProperty;const zt=function(e){if(!ie(e))return Lt(e);var t=Dt(e),s=[];for(var r in e)("constructor"!=r||!t&&Yt.call(e,r))&&s.push(r);return s};const Gt=function(e){return Ut(e)?jt(e,!0):zt(e)};const $t=function(e,t){return e&&rt(t,Gt(t),e)};var Wt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Kt=Wt&&"object"==typeof module&&module&&!module.nodeType&&module,Ht=Kt&&Kt.exports===Wt?G.Buffer:void 0,Zt=Ht?Ht.allocUnsafe:void 0;const Xt=function(e,t){if(t)return e.slice();var s=e.length,r=Zt?Zt(s):new e.constructor(s);return e.copy(r),r};const Qt=function(e,t){var s=-1,r=e.length;for(t||(t=Array(r));++s<r;)t[s]=e[s];return t};const es=function(e,t){for(var s=-1,r=null==e?0:e.length,n=0,i=[];++s<r;){var o=e[s];t(o,s,e)&&(i[n++]=o)}return i};const ts=function(){return[]};var ss=Object.prototype.propertyIsEnumerable,rs=Object.getOwnPropertySymbols;const ns=rs?function(e){return null==e?[]:(e=Object(e),es(rs(e),(function(t){return ss.call(e,t)})))}:ts;const is=function(e,t){return rt(e,ns(e),t)};const os=function(e,t){for(var s=-1,r=t.length,n=e.length;++s<r;)e[n+s]=t[s];return e};const as=Mt(Object.getPrototypeOf,Object);const cs=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)os(t,ns(e)),e=as(e);return t}:ts;const us=function(e,t){return rt(e,cs(e),t)};const ds=function(e,t,s){var r=t(e);return ht(e)?r:os(r,s(e))};const ls=function(e){return ds(e,Ft,ns)};const hs=function(e){return ds(e,Gt,cs)};const fs=Se(G,"DataView");const ps=Se(G,"Promise");const ys=Se(G,"Set");const ms=Se(G,"WeakMap");var vs="[object Map]",gs="[object Promise]",xs="[object Set]",_s="[object WeakMap]",bs="[object DataView]",ws=me(fs),Os=me(Te),Es=me(ps),Ss=me(ys),Ts=me(ms),ks=ne;(fs&&ks(new fs(new ArrayBuffer(1)))!=bs||Te&&ks(new Te)!=vs||ps&&ks(ps.resolve())!=gs||ys&&ks(new ys)!=xs||ms&&ks(new ms)!=_s)&&(ks=function(e){var t=ne(e),s="[object Object]"==t?e.constructor:void 0,r=s?me(s):"";if(r)switch(r){case ws:return bs;case Os:return vs;case Es:return gs;case Ss:return xs;case Ts:return _s}return t});const As=ks;var Cs=Object.prototype.hasOwnProperty;const Is=function(e){var t=e.length,s=new e.constructor(t);return t&&"string"==typeof e[0]&&Cs.call(e,"index")&&(s.index=e.index,s.input=e.input),s};const Rs=G.Uint8Array;const Ns=function(e){var t=new e.constructor(e.byteLength);return new Rs(t).set(new Rs(e)),t};const js=function(e,t){var s=t?Ns(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)};var Ps=/\w*$/;const Ds=function(e){var t=new e.constructor(e.source,Ps.exec(e));return t.lastIndex=e.lastIndex,t};var Ms=$?$.prototype:void 0,Bs=Ms?Ms.valueOf:void 0;const Js=function(e){return Bs?Object(Bs.call(e)):{}};const Vs=function(e,t){var s=t?Ns(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)};var Us="[object Boolean]",Fs="[object Date]",qs="[object Map]",Ls="[object Number]",Ys="[object RegExp]",zs="[object Set]",Gs="[object String]",$s="[object Symbol]",Ws="[object ArrayBuffer]",Ks="[object DataView]",Hs="[object Float32Array]",Zs="[object Float64Array]",Xs="[object Int8Array]",Qs="[object Int16Array]",er="[object Int32Array]",tr="[object Uint8Array]",sr="[object Uint8ClampedArray]",rr="[object Uint16Array]",nr="[object Uint32Array]";const ir=function(e,t,s){var r=e.constructor;switch(t){case Ws:return Ns(e);case Us:case Fs:return new r(+e);case Ks:return js(e,s);case Hs:case Zs:case Xs:case Qs:case er:case tr:case sr:case rr:case nr:return Vs(e,s);case qs:return new r;case Ls:case Gs:return new r(e);case Ys:return Ds(e);case zs:return new r;case $s:return Js(e)}};var or=Object.create;const ar=function(){function e(){}return function(t){if(!ie(t))return{};if(or)return or(t);e.prototype=t;var s=new e;return e.prototype=void 0,s}}();const cr=function(e){return"function"!=typeof e.constructor||Dt(e)?{}:ar(as(e))};var ur="[object Map]";const dr=function(e){return it(e)&&As(e)==ur};var lr=Ct&&Ct.isMap;const hr=lr?St(lr):dr;var fr="[object Set]";const pr=function(e){return it(e)&&As(e)==fr};var yr=Ct&&Ct.isSet;const mr=yr?St(yr):pr;var vr=1,gr=2,xr=4,_r="[object Arguments]",br="[object Function]",wr="[object GeneratorFunction]",Or="[object Object]",Er={};Er[_r]=Er["[object Array]"]=Er["[object ArrayBuffer]"]=Er["[object DataView]"]=Er["[object Boolean]"]=Er["[object Date]"]=Er["[object Float32Array]"]=Er["[object Float64Array]"]=Er["[object Int8Array]"]=Er["[object Int16Array]"]=Er["[object Int32Array]"]=Er["[object Map]"]=Er["[object Number]"]=Er[Or]=Er["[object RegExp]"]=Er["[object Set]"]=Er["[object String]"]=Er["[object Symbol]"]=Er["[object Uint8Array]"]=Er["[object Uint8ClampedArray]"]=Er["[object Uint16Array]"]=Er["[object Uint32Array]"]=!0,Er["[object Error]"]=Er[br]=Er["[object WeakMap]"]=!1;const Sr=function e(t,s,r,n,i,o){var a,c=s&vr,u=s&gr,d=s&xr;if(r&&(a=i?r(t,n,i,o):r(t)),void 0!==a)return a;if(!ie(t))return t;var l=ht(t);if(l){if(a=Is(t),!c)return Qt(t,a)}else{var h=As(t),f=h==br||h==wr;if(vt(t))return Xt(t,c);if(h==Or||h==_r||f&&!i){if(a=u||f?{}:cr(t),!c)return u?us(t,$t(a,t)):is(t,qt(a,t))}else{if(!Er[h])return i?t:{};a=ir(t,h,c)}}o||(o=new Ze);var p=o.get(t);if(p)return p;o.set(t,a),mr(t)?t.forEach((function(n){a.add(e(n,s,r,n,t,o))})):hr(t)&&t.forEach((function(n,i){a.set(i,e(n,s,r,i,t,o))}));var y=l?void 0:(d?u?hs:ls:u?Gt:Ft)(t);return Xe(y||t,(function(n,i){y&&(n=t[i=n]),st(a,i,e(n,s,r,i,t,o))})),a};var Tr=1,kr=4;const Ar=function(e){return Sr(e,Tr|kr)},Cr=["registerDescriptor","toObject","lookupType","encode","_description","_protobufRoot","nested","create","getDescriptor","decompress","_protobuf","decode","Root"];var Ir,Rr;Ir=Cr,Rr=151,function(e){for(;--e;)Ir.push(Ir.shift())}(++Rr);const Nr=function(e,t){return Cr[e-=0]};class jr{constructor(){this[Nr("0x9")]={nested:{}}}[Nr("0x5")](e,t){this._description[Nr("0xb")][e]=Ar(t)}build(){this[Nr("0xa")]=C()[Nr("0x4")].fromJSON(this._description)}[Nr("0x0")](e){if(!this[Nr("0xa")])throw new t.CKEditorError("protobuffactory-cannot-get-descriptor-before-build",this);return new Pr(this[Nr("0xa")][Nr("0x7")](e))}}class Pr{constructor(e){this._protobuf=e}compress(e){const t=this[Nr("0x2")].verify(e);if(t)throw Error(t);return this._protobuf[Nr("0x8")](this[Nr("0x2")][Nr("0xc")](e)).finish()}[Nr("0x1")](e){return this[Nr("0x2")][Nr("0x6")](this._protobuf[Nr("0x3")](e),{oneofs:!0})}}var Dr,Mr,Br=["repeated","Element","string","Position","bool"];Dr=Br,Mr=471,function(e){for(;--e;)Dr.push(Dr.shift())}(++Mr);var Jr=function(e,t){return Br[e-=0]};const Vr={Position:{fields:{root:{type:"string",id:1},rootMain:{type:Jr("0x3"),id:2},rootGraveyard:{type:Jr("0x3"),id:3},path:{rule:Jr("0x4"),type:"uint32",id:4},stickiness:{type:"string",id:5}}},Range:{fields:{start:{type:Jr("0x2"),id:1},end:{type:Jr("0x2"),id:2}}},Element:{fields:{name:{type:Jr("0x1"),id:1},children:{rule:Jr("0x4"),type:Jr("0x0"),id:2},data:{type:Jr("0x1"),id:3},attributesBoolean:{keyType:Jr("0x1"),type:"bool",id:4},attributesJson:{type:Jr("0x1"),id:5}}}};var Ur="__lodash_hash_undefined__";const Fr=function(e){return this.__data__.set(e,Ur),this};const qr=function(e){return this.__data__.has(e)};function Lr(e){var t=-1,s=null==e?0:e.length;for(this.__data__=new $e;++t<s;)this.add(e[t])}Lr.prototype.add=Lr.prototype.push=Fr,Lr.prototype.has=qr;const Yr=Lr;const zr=function(e,t){for(var s=-1,r=null==e?0:e.length;++s<r;)if(t(e[s],s,e))return!0;return!1};const Gr=function(e,t){return e.has(t)};var $r=1,Wr=2;const Kr=function(e,t,s,r,n,i){var o=s&$r,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var u=i.get(e),d=i.get(t);if(u&&d)return u==t&&d==e;var l=-1,h=!0,f=s&Wr?new Yr:void 0;for(i.set(e,t),i.set(t,e);++l<a;){var p=e[l],y=t[l];if(r)var m=o?r(y,p,l,t,e,i):r(p,y,l,e,t,i);if(void 0!==m){if(m)continue;h=!1;break}if(f){if(!zr(t,(function(e,t){if(!Gr(f,t)&&(p===e||n(p,e,s,r,i)))return f.push(t)}))){h=!1;break}}else if(p!==y&&!n(p,y,s,r,i)){h=!1;break}}return i.delete(e),i.delete(t),h};const Hr=function(e){var t=-1,s=Array(e.size);return e.forEach((function(e,r){s[++t]=[r,e]})),s};const Zr=function(e){var t=-1,s=Array(e.size);return e.forEach((function(e){s[++t]=e})),s};var Xr=1,Qr=2,en="[object Boolean]",tn="[object Date]",sn="[object Error]",rn="[object Map]",nn="[object Number]",on="[object RegExp]",an="[object Set]",cn="[object String]",un="[object Symbol]",dn="[object ArrayBuffer]",ln="[object DataView]",hn=$?$.prototype:void 0,fn=hn?hn.valueOf:void 0;const pn=function(e,t,s,r,n,i,o){switch(s){case ln:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case dn:return!(e.byteLength!=t.byteLength||!i(new Rs(e),new Rs(t)));case en:case tn:case nn:return R(+e,+t);case sn:return e.name==t.name&&e.message==t.message;case on:case cn:return e==t+"";case rn:var a=Hr;case an:var c=r&Xr;if(a||(a=Zr),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;r|=Qr,o.set(e,t);var d=Kr(a(e),a(t),r,n,i,o);return o.delete(e),d;case un:if(fn)return fn.call(e)==fn.call(t)}return!1};var yn=1,mn=Object.prototype.hasOwnProperty;const vn=function(e,t,s,r,n,i){var o=s&yn,a=ls(e),c=a.length;if(c!=ls(t).length&&!o)return!1;for(var u=c;u--;){var d=a[u];if(!(o?d in t:mn.call(t,d)))return!1}var l=i.get(e),h=i.get(t);if(l&&h)return l==t&&h==e;var f=!0;i.set(e,t),i.set(t,e);for(var p=o;++u<c;){var y=e[d=a[u]],m=t[d];if(r)var v=o?r(m,y,d,t,e,i):r(y,m,d,e,t,i);if(!(void 0===v?y===m||n(y,m,s,r,i):v)){f=!1;break}p||(p="constructor"==d)}if(f&&!p){var g=e.constructor,x=t.constructor;g==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof x&&x instanceof x||(f=!1)}return i.delete(e),i.delete(t),f};var gn=1,xn="[object Arguments]",_n="[object Array]",bn="[object Object]",wn=Object.prototype.hasOwnProperty;const On=function(e,t,s,r,n,i){var o=ht(e),a=ht(t),c=o?_n:As(e),u=a?_n:As(t),d=(c=c==xn?bn:c)==bn,l=(u=u==xn?bn:u)==bn,h=c==u;if(h&&vt(e)){if(!vt(t))return!1;o=!0,d=!1}if(h&&!d)return i||(i=new Ze),o||Rt(e)?Kr(e,t,s,r,n,i):pn(e,t,c,s,r,n,i);if(!(s&gn)){var f=d&&wn.call(e,"__wrapped__"),p=l&&wn.call(t,"__wrapped__");if(f||p){var y=f?e.value():e,m=p?t.value():t;return i||(i=new Ze),n(y,m,s,r,i)}}return!!h&&(i||(i=new Ze),vn(e,t,s,r,n,i))};const En=function e(t,s,r,n,i){return t===s||(null==t||null==s||!it(t)&&!it(s)?t!=t&&s!=s:On(t,s,r,n,e,i))};const Sn=function(e,t){return En(e,t)},Tn=["rootGraveyard","main","$graveyard","root","nodes","path","rootMain","length"];var kn,An;kn=Tn,An=455,function(e){for(;--e;)kn.push(kn.shift())}(++An);const Cn=function(e,t){return Tn[e-=0]};function In(e,t){const s=Ar(e);return s[Cn("0x6")][s[Cn("0x6")][Cn("0x0")]-1]+=t,s}function Rn(e,t){return e[Cn("0x4")]===t[Cn("0x4")]&&Sn(e.path,t.path)}function Nn(e){Pn(e,(e=>(Cn("0x2")==e.root?(e[Cn("0x7")]=!0,delete e.root):Cn("0x3")==e[Cn("0x4")]&&(e[Cn("0x1")]=!0,delete e[Cn("0x4")]),e)))}function jn(e){Pn(e,(e=>(e[Cn("0x7")]?(e[Cn("0x4")]=Cn("0x2"),delete e[Cn("0x7")]):e[Cn("0x1")]&&(e[Cn("0x4")]=Cn("0x3"),delete e.rootGraveyard),e)))}function Pn(e,t){for(const s in e){const r=e[s];Cn("0x5")!==s&&ie(r)&&(r[Cn("0x6")]&&(r[Cn("0x4")]||r.rootMain||r[Cn("0x1")])?e[s]=t(r):Pn(r,t))}return e}const Dn=["decompress","compress","types","push","buffers","shift","__className","_protobufDescriptor","operationName"];var Mn,Bn;Mn=Dn,Bn=465,function(e){for(;--e;)Mn.push(Mn.shift())}(++Bn);const Jn=function(e,t){return Dn[e-=0]};class Vn{constructor(e,t,s){this.id=e,this.operationName=t,this[Jn("0x1")]=s}[Jn("0x4")](e,t){const s=t.shift();Nn(s),e.buffers[Jn("0x6")](this[Jn("0x1")][Jn("0x4")](s)),e[Jn("0x5")][Jn("0x6")](this.id)}[Jn("0x3")](e,t){t[Jn("0x5")].shift();const s=this[Jn("0x1")][Jn("0x3")](t[Jn("0x7")][Jn("0x8")]());jn(s),s[Jn("0x0")]=this[Jn("0x2")],e[Jn("0x6")](s)}}const Un=["shift","Json","description","decompress","bool","push","newValue","__className","_protobufDescriptor","Boolean","parse","string","types","compress"];var Fn,qn;Fn=Un,qn=284,function(e){for(;--e;)Fn.push(Fn.shift())}(++qn);const Ln=function(e,t){return Un[e-=0]};class Yn extends Vn{static get[Ln("0xc")](){return{fields:{range:{type:"Range",id:1},key:{type:"string",id:2},oldValueBoolean:{type:"bool",id:3},oldValueJson:{type:Ln("0x7"),id:4},newValueBoolean:{type:Ln("0x0"),id:5},newValueJson:{type:Ln("0x7"),id:6},wasUndone:{type:Ln("0x0"),id:7}}}}compress(e,t){const s=t[Ln("0xa")]();zn("oldValue",s),zn(Ln("0x2"),s),Nn(s),e.buffers[Ln("0x1")](this[Ln("0x4")][Ln("0x9")](s)),e[Ln("0x8")][Ln("0x1")](this.id)}[Ln("0xd")](e,t){const{types:s,buffers:r}=t,n=this._protobufDescriptor[Ln("0xd")](r[Ln("0xa")]());s[Ln("0xa")](),Gn("oldValue",n),Gn(Ln("0x2"),n),jn(n),n[Ln("0x3")]=this.operationName,e[Ln("0x1")](n)}}function zn(e,t){const s=t[e];"boolean"==typeof s?t[e+Ln("0x5")]=s:t[e+"Json"]=JSON.stringify(s)}function Gn(e,t){const s=e+Ln("0xb");t[s]?(t[e]=JSON[Ln("0x6")](t[s]),delete t[s]):(t[e]=t[e+Ln("0x5")],delete t[e+Ln("0x5")])}const $n=["keys","bool","_protobufDescriptor","every","nodes","boolean","shift","decompress","parse","attributesBoolean","buffers","compress","push","__className","attributes","children","repeated","stringify","attributesJson","Element"];var Wn,Kn;Wn=$n,Kn=193,function(e){for(;--e;)Wn.push(Wn.shift())}(++Kn);const Hn=function(e,t){return $n[e-=0]};class Zn extends Vn{static get description(){return{fields:{position:{type:"Position",id:1},nodes:{rule:Hn("0x3"),type:Hn("0x6"),id:2},shouldReceiveAttributes:{type:Hn("0x8"),id:3},wasUndone:{type:Hn("0x8"),id:4}}}}compress(e,t){const s=t[Hn("0xd")]();Xn(s[Hn("0xb")]),Nn(s),e[Hn("0x11")][Hn("0x13")](this[Hn("0x9")][Hn("0x12")](s)),e.types[Hn("0x13")](this.id)}decompress(e,t){const{types:s,buffers:r}=t,n=this[Hn("0x9")][Hn("0xe")](r[Hn("0xd")]());s.shift(),n.nodes||(n[Hn("0xb")]=[]),Qn(n.nodes),jn(n),n[Hn("0x0")]=this.operationName,e.push(n)}}function Xn(e){for(const t of e){if(t[Hn("0x1")]){const e=t[Hn("0x1")];ei(e)?t[Hn("0x10")]=e:t[Hn("0x5")]=JSON[Hn("0x4")](e)}t.children&&Xn(t[Hn("0x2")])}}function Qn(e){for(const t of e)(t[Hn("0x10")]||t[Hn("0x5")])&&(t[Hn("0x10")]?(t[Hn("0x1")]=t[Hn("0x10")],delete t[Hn("0x10")]):(t[Hn("0x1")]=JSON[Hn("0xf")](t.attributesJson),delete t[Hn("0x5")])),t[Hn("0x2")]&&Qn(t[Hn("0x2")])}function ei(e){return Object[Hn("0x7")](e)[Hn("0xa")]((t=>Hn("0xc")==typeof e[t]))}const ti=["Range","newRange","length","oldRange","string","decompress","bool"];var si,ri;si=ti,ri=317,function(e){for(;--e;)si.push(si.shift())}(++ri);const ni=function(e,t){return ti[e-=0]};class ii extends Vn{static get description(){return{fields:{name:{type:ni("0x2"),id:1},oldRange:{type:ni("0x5"),id:2},newRange:{type:ni("0x5"),id:3},affectsData:{type:ni("0x4"),id:4},wasUndone:{type:ni("0x4"),id:5}}}}[ni("0x3")](e,t){super[ni("0x3")](e,t);const s=e[e[ni("0x0")]-1];s[ni("0x1")]||(s[ni("0x1")]=null),s.newRange||(s[ni("0x6")]=null)}}var oi,ai,ci=["description","Position","uint32","bool"];oi=ci,ai=492,function(e){for(;--e;)oi.push(oi.shift())}(++ai);var ui=function(e,t){return ci[e-=0]};class di extends Vn{static get[ui("0x0")](){return{fields:{sourcePosition:{type:ui("0x1"),id:1},targetPosition:{type:ui("0x1"),id:2},graveyardPosition:{type:"Position",id:3},howMany:{type:ui("0x2"),id:4},wasUndone:{type:ui("0x3"),id:5}}}}}var li,hi,fi=["uint32","bool"];li=fi,hi=152,function(e){for(;--e;)li.push(li.shift())}(++hi);var pi=function(e,t){return fi[e-=0]};class yi extends Vn{static get description(){return{fields:{sourcePosition:{type:"Position",id:1},howMany:{type:pi("0x0"),id:2},targetPosition:{type:"Position",id:3},wasUndone:{type:pi("0x1"),id:4}}}}}var mi,vi,gi=["description","Position","bool","string"];mi=gi,vi=255,function(e){for(;--e;)mi.push(mi.shift())}(++vi);var xi=function(e,t){return gi[e-=0]};class _i extends Vn{static get[xi("0x1")](){return{fields:{position:{type:xi("0x2"),id:1},oldName:{type:xi("0x0"),id:2},newName:{type:xi("0x0"),id:3},wasUndone:{type:xi("0x3"),id:4}}}}}const bi=["description","root","fields","range"];var wi,Oi;wi=bi,Oi=301,function(e){for(;--e;)wi.push(wi.shift())}(++Oi);const Ei=function(e,t){return bi[e-=0]};class Si extends Yn{static get[Ei("0x3")](){const e=Yn[Ei("0x3")];return delete e[Ei("0x1")][Ei("0x2")],e[Ei("0x1")][Ei("0x0")]={type:"string",id:1},e}}var Ti,ki,Ai=["bool","description","Position"];Ti=Ai,ki=193,function(e){for(;--e;)Ti.push(Ti.shift())}(++ki);var Ci=function(e,t){return Ai[e-=0]};class Ii extends Vn{static get[Ci("0x0")](){return{fields:{splitPosition:{type:Ci("0x1"),id:1},graveyardPosition:{type:Ci("0x1"),id:2},howMany:{type:"uint32",id:3},insertionPosition:{type:Ci("0x1"),id:4},wasUndone:{type:Ci("0x2"),id:5}}}}}var Ri,Ni,ji=["decompress","shift","push","operationName","types"];Ri=ji,Ni=254,function(e){for(;--e;)Ri.push(Ri.shift())}(++Ni);var Pi=function(e,t){return ji[e-=0]};class Di extends Vn{compress(e,t){t.shift(),e[Pi("0x0")][Pi("0x3")](this.id)}[Pi("0x1")](e,t){t.types[Pi("0x2")](),e[Pi("0x3")]({__className:this[Pi("0x4")]})}}const Mi=["startsWith","_omittedNamespace","name","compress","__className","decompress"];var Bi,Ji;Bi=Mi,Ji=409,function(e){for(;--e;)Bi.push(Bi.shift())}(++Ji);const Vi=function(e,t){return Mi[e-=0]};class Ui extends ii{constructor(e,t,s,r){super(e,t,s),this[Vi("0x0")]=r+":"}[Vi("0x2")](e,t){return!("MarkerOperation"!=t[0][Vi("0x3")]||!t[0].name[Vi("0x5")](this[Vi("0x0")])||(t[0].name=t[0][Vi("0x1")].replace(new RegExp("^"+this._omittedNamespace),""),super[Vi("0x2")](e,t),0))}[Vi("0x4")](e,t){super[Vi("0x4")](e,t);const s=e[e.length-1];s[Vi("0x1")]=this[Vi("0x0")]+s[Vi("0x1")]}}const Fi=["compress","_splitCurrent","buffers","decompress","types","shift","_context","_decompressSingleOperation","push","_combineNext"];var qi,Li;qi=Fi,Li=137,function(e){for(;--e;)qi.push(qi.shift())}(++Li);const Yi=function(e,t){return Fi[e-=0]};class zi{constructor(e,t){this.id=e,this[Yi("0x9")]=t}[Yi("0x3")](e,t){let s;for(;t.length>1&&this._compareOperations(t[0],t[1]);)s?(s=this._combineNext(t[Yi("0x8")](),s),e[Yi("0x7")].push(0)):(s=Ar(t[Yi("0x8")]()),e[Yi("0x7")][Yi("0x1")](this.id));return!!s&&(s=this[Yi("0x2")](t[Yi("0x8")](),s),e[Yi("0x7")][Yi("0x1")](0),e[Yi("0x5")][Yi("0x1")](this._compressSingleOperation(s)),!0)}[Yi("0x6")](e,t){const s=this[Yi("0x0")](t);for(;0==t[Yi("0x7")][0];)t[Yi("0x7")][Yi("0x8")](),e[Yi("0x1")](this[Yi("0x4")](s));e.push(s)}}const Gi=["data","next","_compressSingleOperation","attributes","decompress","wasUndone","length","_decompressSingleOperation","_getCompressorByName","nodes","value","buffers","_context","InsertOperation","every","_combineNext","position","_compareOperations","keys","substr"];var $i,Wi;$i=Gi,Wi=356,function(e){for(;--e;)$i.push($i.shift())}(++Wi);const Ki=function(e,t){return Gi[e-=0]};class Hi extends zi{[Ki("0x13")](e,t){return t[Ki("0xd")][0][Ki("0x4")]+=e[Ki("0xd")][0][Ki("0x4")],t}_splitCurrent(e){const t=Ar(e),s=t[Ki("0xd")][0],r=e[Ki("0xd")][0],n=r.data[Symbol.iterator]()[Ki("0x5")]()[Ki("0xe")],i=n[Ki("0xa")];return s[Ki("0x4")]=n,r[Ki("0x4")]=r[Ki("0x4")][Ki("0x3")](i),e[Ki("0x0")]=In(e[Ki("0x0")],i),t}[Ki("0x1")](e,t){if(Zi(e)&&Zi(t)){const s=e.nodes[0][Ki("0x4")][Ki("0xa")],r=Rn(In(e[Ki("0x0")],s),t[Ki("0x0")]),n=e.nodes[0],i=t[Ki("0xd")][0];return r&&function(e,t){const s=Object[Ki("0x2")](e[Ki("0x7")]||{}),r=Object.keys(t.attributes||{});return s[Ki("0xa")]===r[Ki("0xa")]&&s[Ki("0x12")]((s=>t[Ki("0x7")][s]&&t[Ki("0x7")][s]===e[Ki("0x7")][s]))}(n,i)}return!1}[Ki("0x6")](e){const t={types:[],buffers:[],baseVersion:0};return this[Ki("0x10")][Ki("0xc")]("InsertOperation").compress(t,[e]),t[Ki("0xf")][0]}[Ki("0xb")](e){const t=[];return this[Ki("0x10")]._getCompressorByName(Ki("0x11"))[Ki("0x8")](t,e),t[0]}}function Zi(e){return Ki("0x11")==e.__className&&1==e[Ki("0xd")].length&&e[Ki("0xd")][0].data&&!e[Ki("0x9")]&&1==Array.from(e[Ki("0xd")][0][Ki("0x4")]).length}const Xi=["$graveyard","MoveOperation","root","sourcePosition","compress","_compareOperations","_context","_splitCurrent","targetPosition","_compressSingleOperation","_getCompressorByName","howMany","__className","buffers"];var Qi,eo;Qi=Xi,eo=255,function(e){for(;--e;)Qi.push(Qi.shift())}(++eo);const to=function(e,t){return Xi[e-=0]};class so extends zi{_combineNext(e,t){return t[to("0x8")]++,t[to("0x0")]=Ar(e[to("0x0")]),t}[to("0x4")](e){const t=Ar(e);return e[to("0x8")]--,t[to("0x8")]=1,t[to("0x0")]=In(t[to("0x0")],e[to("0x8")]),t}[to("0x2")](e,t){return!(!ro(e)||!ro(t))&&Rn(In(e[to("0x0")],-1),t[to("0x0")])&&Rn(e[to("0x5")],t[to("0x5")])}[to("0x6")](e){const t={types:[],buffers:[],baseVersion:0};return this[to("0x3")][to("0x7")](to("0xc"))[to("0x1")](t,[e]),t[to("0xa")][0]}_decompressSingleOperation(e){const t=[];return this._context[to("0x7")]("MoveOperation").decompress(t,e),t[0]}}function ro(e){return to("0xc")==e[to("0x9")]&&to("0xb")==e.targetPosition[to("0xd")]&&1==e[to("0x8")]&&!e.wasUndone}const no=["_decompressSingleOperation","howMany","_combineNext","decompress","MoveOperation","sourcePosition","_splitCurrent","wasUndone","_compareOperations","_compressSingleOperation","_context","compress","root","buffers","targetPosition","$graveyard"];var io,oo;io=no,oo=426,function(e){for(;--e;)io.push(io.shift())}(++oo);const ao=function(e,t){return no[e-=0]};class co extends zi{[ao("0x8")](e,t){return t[ao("0x7")]++,t}[ao("0xc")](e){const t=Ar(e);return t[ao("0x7")]=1,e[ao("0x7")]--,t}[ao("0xe")](e,t){return!(!uo(e)||!uo(t))&&Rn(e[ao("0xb")],t.sourcePosition)&&Rn(e[ao("0x4")],t[ao("0x4")])}[ao("0xf")](e){const t={types:[],buffers:[],baseVersion:0};return this[ao("0x0")]._getCompressorByName(ao("0xa"))[ao("0x1")](t,[e]),t[ao("0x3")][0]}[ao("0x6")](e){const t=[];return this[ao("0x0")]._getCompressorByName(ao("0xa"))[ao("0x9")](t,e),t[0]}}function uo(e){return ao("0xa")==e.__className&&ao("0x5")==e[ao("0x4")][ao("0x2")]&&1==e[ao("0x7")]&&!e[ao("0xd")]}const lo=["buffers","_context","MarkerOperation","_compressSingleOperation","__className","toNone","push","decompress","types","end","oldRange","name","startsWith","stickiness","user:","shift","_decompressSingleOperation","start","newRange","compress","_getCompressorByName"];var ho,fo;ho=lo,fo=372,function(e){for(;--e;)ho.push(ho.shift())}(++fo);const po=function(e,t){return lo[e-=0]};class yo extends zi{[po("0x4")](e,t){if(s=t[0],r=t[1],!(s&&r&&po("0x8")==s[po("0xa")]&&po("0x8")==r[po("0xa")]&&s[po("0x11")][po("0x12")]("user:")&&r[po("0x11")][po("0x12")](po("0x14"))&&s[po("0x11")]!=r.name))return!1;var s,r;const n=t.shift();return n[po("0x10")]=null,n.newRange&&Rn(n.newRange[po("0x2")],n[po("0x3")][po("0xf")])&&(n[po("0x3")].end=null),t[po("0x0")](),e.types[po("0xc")](this.id),e[po("0xe")].push(0),e[po("0x6")][po("0xc")](this[po("0x9")](n)),!0}decompress(e,t){const s=this[po("0x1")](t);s[po("0x3")]&&!s[po("0x3")][po("0xf")]&&(s[po("0x3")][po("0xf")]=Ar(s[po("0x3")][po("0x2")]));const r=Ar(s);r[po("0x3")]&&(r[po("0x3")][po("0x2")][po("0x13")]=po("0xb"),r.newRange.end=Ar(r.newRange[po("0x2")])),r[po("0x11")]="user:position:"+r[po("0x11")].split(":")[2],t[po("0xe")][po("0x0")](),e[po("0xc")](s),e.push(r)}[po("0x9")](e){const t={types:[],buffers:[],baseVersion:0};return this._context[po("0x5")]("MarkerOperation")[po("0x4")](t,[e]),t[po("0x6")][0]}[po("0x1")](e){const t=[];return this[po("0x7")][po("0x5")](po("0x8"))[po("0xd")](t,e),t[0]}}const mo=["RootAttributeOperation","registerDescriptor","_compressorById","baseVersion","_registerActionCompressor","Position","SuggestionMarkerOperation","RenameOperation","_registerOperationCompressor","UserSelectionAction","MoveOperation","get","AttributeOperation","description","compress","__className","DeletingAction","length","TypingAction","_getCompressorByName","decompress","comment","build","types","suggestion","Element","_protobufFactory","SplitOperation","set","MarkerOperation","_registerCompressor","_compressorByName","no-operations-provided","InsertOperation","CommentMarkerOperation","forEach","ForwardDeletingAction"];var vo,go;vo=mo,go=358,function(e){for(;--e;)vo.push(vo.shift())}(++go);const xo=function(e,t){return mo[e-=0]};class _o{constructor(){this._compressorById=new Map,this[xo("0x6")]=new Map,this._protobufFactory=new jr,this[xo("0x1")][xo("0xd")](xo("0x11"),Vr[xo("0x11")]),this._protobufFactory.registerDescriptor("Range",Vr.Range),this[xo("0x1")][xo("0xd")](xo("0x0"),Vr[xo("0x0")]),this[xo("0x1")][xo("0xd")](xo("0x18"),Yn[xo("0x19")]),this[xo("0x1")][xo("0xd")](xo("0x8"),Zn.description),this._protobufFactory[xo("0xd")](xo("0x4"),ii[xo("0x19")]),this[xo("0x1")].registerDescriptor("MergeOperation",di[xo("0x19")]),this[xo("0x1")][xo("0xd")](xo("0x16"),yi.description),this._protobufFactory[xo("0xd")](xo("0x13"),_i.description),this[xo("0x1")][xo("0xd")](xo("0xc"),Si[xo("0x19")]),this[xo("0x1")][xo("0xd")](xo("0x2"),Ii[xo("0x19")]),this._protobufFactory[xo("0x22")](),this[xo("0x5")](1,"NoOperation",new Di(1,"NoOperation")),this[xo("0x14")](10,xo("0x18"),Yn),this[xo("0x14")](11,xo("0x8"),Zn),this[xo("0x14")](12,xo("0x4"),ii),this[xo("0x14")](13,"MergeOperation",di),this[xo("0x14")](14,xo("0x16"),yi),this[xo("0x14")](15,"RenameOperation",_i),this[xo("0x14")](16,xo("0xc"),Si),this._registerOperationCompressor(17,xo("0x2"),Ii);const e=this[xo("0x1")].getDescriptor(xo("0x4"));this[xo("0x5")](18,xo("0x9"),new Ui(18,xo("0x4"),e,xo("0x21"))),this[xo("0x5")](19,xo("0x12"),new Ui(19,xo("0x4"),e,xo("0x24"))),this[xo("0x10")](100,xo("0x1e"),Hi),this[xo("0x10")](101,"DeletingAction",so),this[xo("0x10")](102,"ForwardDeletingAction",co),this[xo("0x10")](103,"UserSelectionAction",yo)}[xo("0x14")](e,t,s){const r=new s(e,t,this[xo("0x1")].getDescriptor(t));this[xo("0x5")](e,t,r)}_registerActionCompressor(e,t,s){const r=new s(e,this);this._registerCompressor(e,t,r)}[xo("0x5")](e,t,s){this[xo("0xe")].set(e,s),this[xo("0x6")][xo("0x3")](t,s)}[xo("0x1f")](e){return this[xo("0x6")].get(e)}compress(e){if(!e||!e[0])throw new t.CKEditorError(xo("0x7"),this);const s={types:[],buffers:[],baseVersion:e[0][xo("0xf")]};for(;e[xo("0x1d")];)this._getCompressorByName(xo("0x15"))[xo("0x1a")](s,e)||this[xo("0x1f")]("TypingAction")[xo("0x1a")](s,e)||this[xo("0x1f")](xo("0x1c"))[xo("0x1a")](s,e)||this[xo("0x1f")](xo("0xb"))[xo("0x1a")](s,e)||this[xo("0x1f")](xo("0x9"))[xo("0x1a")](s,e)||this[xo("0x1f")](xo("0x12"))[xo("0x1a")](s,e)||this[xo("0x1f")](e[0][xo("0x1b")])[xo("0x1a")](s,e);return s}[xo("0x20")](e){const t=[];for(;e[xo("0x23")][xo("0x1d")];)this[xo("0xe")][xo("0x17")](e[xo("0x23")][0])[xo("0x20")](t,e);return t[xo("0xa")](((t,s)=>t[xo("0xf")]=e.baseVersion+s)),t}}var bo=__webpack_require__(7622),wo=__webpack_require__.n(bo),Oo=__webpack_require__(7530),Eo=__webpack_require__.n(Oo);const So=["addUser","setPermissions","getRoot","start","applyOperation","type","CollaborativeEditingService","404","_pendingAction","code","permissions","add","high","_isPendingUpdate","cloud-services-internal-error: Not connected.","fire","lastDocumentSession","_operationToId","addToReconnectionStack","metadata","operationsReceived","Notification","sendOperations","stop","isEnabled","has","slice","return","getDocumentDetails","_lastSyncedOperationId","getIdOfTheLastOperation","markers","compress","toJSON","_assignOperationsMetaData","error","map","_currentBufferDelay","_offset","reconnection: flushed session","round","_document","lastOperationAcceptedAt","baseVersion","_isDisconnection","includes","disconnect","CommentsOnly","getOperations","_setUpDataInit","_lastServerVersion","_baseBufferDelay","realtimecollaborationclient-init-document-already-initialized","remove","createUserMarkerOperations","RealTimeCollaborationClient","cloudDocumentVersion","requires","The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.","_sendBufferedOperations","string","cloud-services-internal-error: Collaborative Editing Service is not connected.","filter","connect","affectsData","_initSessionsHandling","document","change:hasDomSelection","decompress","_initThrowingOnDataSet","sessionAdd:","enableReadOnlyMode","_handleReconnectionResponse","locale","_refreshUserSelectionMarkers","lastOperationId","reset","_handleInitialConnectionData","model","sessionCreatedAt","then","_decompressOperations","initData","realtimecollaborationclient-init-non-existent-root","wasUndone","_saveOperationInBuffer","from","batch","destroy","_sendBufferedOperationsDelayed","setIdForTheLastOperation","_shouldSendSelectionUpdate","createdAt","set","_operationIdentifier","createRange","wereChangesApplied","_isConnected","unregister","forEach","realtimecollaborationclient-initservice-internal-error","catch","apply","_bufferedOperations","_clearPendingAction","selection","The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.","message","listenTo","marker","reconnect","_handleExternalOperations","collaboration-missing-channelid","editor","disableReadOnlyMode","409","_handleSendingSelectionMarkers","suppressErrorInCollaboration","_setPendingAction","_shouldSendUpdate","_disconnectionOperations","connected","sessionId","plugins","view","realtimecollaborationclient-handleserverresponse","_sendBufferedOperationsDelayId","realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration","getUser","_handleReconnectionError","_channelId","isDocumentOperation","rtc-destroyed","_isEditingAllowed","length","version","addOperation","showWarning","roots","_compressOperations","config","Permissions","init","userId","real-time-collaboration","register","_handleReceivedOperations","_service","_isInit","cloudServices.bundleVersion","_hasSynchronizationProblem","editing","removeFromReconnectionStack","mySessionId","get","startsWith","cs:removeUser","_connectAfterSessionHasBeenFlushed","finally","getConnectedSessions","bind","data","channelSessions","offset","isReadOnly","connection","_applyOperationsSet","_disconnectService","collaboration.channelId","rtc-offline","end","_fetchMissingUsers","_crash","_handleServerResponse","_hasSelectionChanged","Synchronization issue","document:write","serverHistory","_ignoredOperations","push","_sendBufferedOperationsDelay","history","realtimecollaborationclient-sendbufferedoperations","change:range","keys","_knownOperations","path","_compressor","getMany","size","disconnected","_connectService","_authorId","The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.","enqueueChange","isUndoneOperation","_getOperationsFromInitData","collaboration","_updateServerHistory"];var To,ko;To=So,ko=235,function(e){for(;--e;)To.push(To.shift())}(++ko);const Ao=function(e,t){return So[e-=0]};let Co=1;class Io extends e.Plugin{static get[Ao("0x15")](){return[l,m,S,e.PendingActions,n.Users,r.Notification]}static get pluginName(){return Ao("0x13")}get[Ao("0x14")](){return this[Ao("0xe")]+this[Ao("0x2")]}get _lastServerVersion(){return this[Ao("0x8d")].version-this[Ao("0x2")]}get lastSyncVersion(){const e=this[Ao("0x8d")][Ao("0xc")]();for(let t=e[Ao("0x62")]-1;t>=0;t--){const s=e[t];if(!this[Ao("0x54")][Ao("0xbc")](s))return s.baseVersion+1-this._offset}return 0}[Ao("0x6a")](){const e=this[Ao("0x4d")],r=e[Ao("0x57")][Ao("0x76")](n.Users),i=e[Ao("0x57")][Ao("0x76")](l);if(this[Ao("0x2")]=0,this.sessionId=null,this[Ao("0x8d")]=new s.History,this[Ao("0x4d")][Ao("0x68")].define(Ao("0xa1"),{}),this[Ao("0x5e")]=e[Ao("0x68")][Ao("0x76")](Ao("0x84")),!this[Ao("0x5e")])throw new t.CKEditorError(Ao("0x4c"),this);this.listenTo(r,"getOperationAuthor",((e,t)=>{const s=t[0];s[Ao("0x9c")]&&(e[Ao("0xbe")]=r[Ao("0x5c")](s[Ao("0x9c")]),e.stop()),null===s[Ao("0x9c")]&&(e[Ao("0xbe")]=null,e[Ao("0xba")]())}),{priority:Ao("0xaf")});const o=e[Ao("0x68")].get(Ao("0x71"))||t.version;this[Ao("0x6f")]=new(Io[Ao("0xa9")])(o,this[Ao("0x5e")]),this[Ao("0x5")]=this.editor.model[Ao("0x1e")],this._compressor=new _o,this._bufferedOperations=[],this[Ao("0x95")]=new WeakSet,this[Ao("0x39")](Ao("0xb0"),!1),this[Ao("0x39")](Ao("0x72"),!1),this[Ao("0xab")]=null,this._hasSelectionChanged=!1,this._sendBufferedOperationsDelayId=null,this[Ao("0xf")]=300,this._currentBufferDelay=this._baseBufferDelay,this[Ao("0xc0")]=null,this[Ao("0x54")]=new WeakSet,this[Ao("0x3a")]=new jo(this._disconnectionOperations),this[Ao("0x48")](e[Ao("0x2a")][Ao("0x1e")][Ao("0x45")],Ao("0x93"),((e,t)=>{t.directChange&&this[Ao("0x26")]()})),this.listenTo(e[Ao("0x73")][Ao("0x58")],Ao("0x1f"),(()=>{this[Ao("0x26")]()})),this[Ao("0x21")](),e.model.on("applyOperation",((e,t)=>{const s=t[0];s[Ao("0x5f")]&&(this[Ao("0x31")](s),this[Ao("0x53")]()&&this[Ao("0x35")]())})),this[Ao("0xd")](),this[Ao("0x7c")](Ao("0x61")).to(i,"state",this,Ao("0x72"),((e,t)=>Ao("0x55")===e&&!t)),this.on("change:_isEditingAllowed",(()=>{this[Ao("0x61")]?e[Ao("0x4e")]("rtc-offline"):e[Ao("0x23")]("rtc-offline")})),this._isEditingAllowed?e[Ao("0x4e")]("rtc-offline"):e.enableReadOnlyMode(Ao("0x85")),this[Ao("0x39")](Ao("0x3d"),!1)}async[Ao("0x4a")](){const e=this[Ao("0x4d")].plugins[Ao("0x76")](m),t=this[Ao("0x4d")][Ao("0x57")].get(l);try{this._isPendingUpdate=!0,e[Ao("0x3e")](this[Ao("0x5e")]);const s=await this._service.reconnect(t[Ao("0x81")],this.lastSyncVersion);await this._handleReconnectionResponse(s)&&(this[Ao("0xb0")]=!1,this[Ao("0x44")]());const r=await this[Ao("0x6f")][Ao("0x7b")]();e.register(this[Ao("0x5e")],r),this[Ao("0x50")](),this[Ao("0x3d")]=!0}catch(e){if(r=e,Ao("0xaa")===r[Ao("0xac")]&&this[Ao("0x56")])await this[Ao("0x79")]();else if(s=e,Ao("0x4f")===s[Ao("0xac")]){const e=k(this.editor[Ao("0x25")],"The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.");this[Ao("0x5d")](e)}else{if(!(e instanceof Ro))throw e;this[Ao("0x5d")]()}}var s,r}[Ao("0x34")](){const e=this.editor[Ao("0x57")].get(l),t=this[Ao("0x4d")][Ao("0x57")][Ao("0x76")](m);this.editor[Ao("0x23")](Ao("0x60")),t[Ao("0x7e")].has(this[Ao("0x5e")])&&t.unregister(this[Ao("0x5e")]),e[Ao("0x74")](this),this[Ao("0x83")](),super.destroy()}async[Ao("0x24")](e){if(this[Ao("0x56")]!==e[Ao("0x56")]&&this[Ao("0xc0")]!==e[Ao("0x27")])throw new Ro;return this[Ao("0x56")]=e[Ao("0x56")],this._handleServerResponse([],{...e,wereChangesApplied:!1,data:e[Ao("0x7d")]},"reconnect")}async[Ao("0x9b")](e,t=!1){const{connection:s}=this.editor[Ao("0x57")][Ao("0x76")](l);Io[Ao("0xa9")][Ao("0x7b")](s,this[Ao("0x5e")])[Ao("0x2c")]((e=>this[Ao("0x1d")](e))).catch((e=>{this[Ao("0x88")]("realtimecollaborationclient-init-session-connection-error",e)})),this[Ao("0x48")](this[Ao("0x6f")],Ao("0xb7"),this[Ao("0x6e")][Ao("0x7c")](this)),this[Ao("0x48")](this[Ao("0x6f")],Ao("0xc6"),((e,t)=>{this[Ao("0x88")](Ao("0x40"),t)})),this.listenTo(this[Ao("0x6f")],Ao("0x9a"),(()=>{this[Ao("0x3d")]=!1}));const r=this[Ao("0x3a")][Ao("0xc1")](e),n=await this[Ao("0x6f")][Ao("0x1b")](s,this._compressOperations(e),r);if(this[Ao("0x56")]=n[Ao("0x56")],n[Ao("0x3c")]&&(this[Ao("0xb0")]=!1,this[Ao("0x44")]()),t){if(!n[Ao("0x3c")])return void this[Ao("0x5d")]();this[Ao("0x8d")][Ao("0x28")](),this._offset=n[Ao("0x7f")],this[Ao("0x8d")][Ao("0x63")]=this[Ao("0x2")],await this._handleServerResponse(e,n,Ao("0x3"))}else await this[Ao("0x29")](n,e);this[Ao("0x50")](),this._isConnected=!0}[Ao("0x50")](){const e=this[Ao("0x4d")].plugins[Ao("0x76")](m),t=this[Ao("0x4d")][Ao("0x57")][Ao("0x76")](S),s=e[Ao("0x7e")][Ao("0x76")](this[Ao("0x5e")]);s&&s[Ao("0x62")]>1?t[Ao("0x12")]():this[Ao("0x48")](e,"sessionAdd:"+this[Ao("0x5e")],(()=>{2===e[Ao("0x7e")][Ao("0x76")](this[Ao("0x5e")])[Ao("0x62")]&&t.createUserMarkerOperations()}))}async _handleReceivedOperations(e,t,s,r){if(!this._isPendingUpdate&&this[Ao("0x5")][Ao("0x63")]==t){const e=this[Ao("0x2d")](s,r);await this._fetchMissingUsers(e),this._handleExternalOperations(e,t,s[Ao("0x27")])||this[Ao("0x88")]("realtimecollaborationclient-initservice-incorrect-server-operation")}}async[Ao("0x79")](){this[Ao("0x83")]();const{locale:e}=this[Ao("0x4d")];let t;try{t=await this[Ao("0x6f")][Ao("0xbf")]()}catch(t){const s=k(e,Ao("0x16"));return void this._handleReconnectionError(s)}const s=t.currentDocumentSession||t[Ao("0xb3")];if(this._lastSyncedOperationId===s[Ao("0x27")])await this._connectService(this[Ao("0x4d")][Ao("0x2a")][Ao("0x1e")][Ao("0x91")][Ao("0xc")](),!0);else{const t=k(e,Ao("0x46"));this[Ao("0x5d")](t)}}[Ao("0x83")](){this._service[Ao("0xa")](),this[Ao("0x43")]=[],clearTimeout(this[Ao("0x90")]),this.stopListening(this[Ao("0x6f")])}[Ao("0x1d")](e){const t=this[Ao("0x4d")][Ao("0x57")][Ao("0x76")](m);this.listenTo(t,Ao("0x22")+this._channelId,((e,{session:s})=>{if(s.id===t[Ao("0x75")]){e.off();const t=this[Ao("0x4d")][Ao("0x57")].has(Ao("0xb"))&&this[Ao("0x4d")][Ao("0x57")][Ao("0x76")](Ao("0xb"));let r=s[Ao("0xad")];t&&t[Ao("0xbb")]&&(r=r.filter((e=>Ao("0x8c")!==e))),this[Ao("0x4d")][Ao("0x57")][Ao("0x76")](Ao("0x69"))[Ao("0xa4")](r,this[Ao("0x5e")])}})),t[Ao("0x6d")](this[Ao("0x5e")],e)}[Ao("0x21")](){const e=this[Ao("0x4d")].data[Ao("0x39")];this[Ao("0x4d")][Ao("0x7d")][Ao("0x39")]=(...s)=>{if(!s[s[Ao("0x62")]-1][Ao("0x51")])throw new t.CKEditorError(Ao("0x5b"),this);e[Ao("0x42")](this[Ao("0x4d")][Ao("0x7d")],s)}}[Ao("0xd")](){this[Ao("0x4d")][Ao("0x7d")].on(Ao("0x6a"),((e,[s])=>{if(this[Ao("0x5")][Ao("0x63")])throw new t.CKEditorError(Ao("0x10"),this);e.stop(),this[Ao("0x52")]();const r=this._getOperationsFromInitData(s);e[Ao("0xbe")]=this[Ao("0x9b")](r)[Ao("0x2c")]((()=>{this[Ao("0x4d")].plugins.get(l)[Ao("0xb5")](this),this.editor.data[Ao("0xb2")]("ready")})).catch((e=>this[Ao("0x88")]("realtimecollaborationclient-init-connection-failed",e)))[Ao("0x7a")]((()=>this[Ao("0x44")]()))}),{priority:Ao("0xaf")})}async _fetchMissingUsers(e){const t=this[Ao("0x4d")][Ao("0x57")][Ao("0x76")](n.Users),{connection:s}=this[Ao("0x4d")][Ao("0x57")][Ao("0x76")](l),r=new Set;for(const s of e){const e=s[Ao("0x9c")];e&&!t.getUser(e)&&r[Ao("0xae")](e)}if(0===r[Ao("0x99")])return;const i=await Eo()[Ao("0x98")](s,Array[Ao("0x32")](r));for(const e of i)t[Ao("0x5c")](e.id)||t[Ao("0xa3")](e)}[Ao("0xa0")](e){const r=this[Ao("0x4d")][Ao("0x2a")],n=[];let i=0;const o=Ao("0x18")==typeof e?{main:e}:e;for(const e of Object[Ao("0x94")](o)){if(!this._document[Ao("0x66")][Ao("0xbc")](e))throw new t.CKEditorError(Ao("0x2f"),this);const a=this[Ao("0x4d")][Ao("0x7d")].parse(o[e]),c=this[Ao("0x5")][Ao("0xa5")](e),u=new s.InsertOperation(r.createPositionAt(c,0),a,i++);n[Ao("0x8f")](u);for(const[e,t]of a[Ao("0xc2")]){const o=r[Ao("0x3b")](r.createPositionFromPath(c,t[Ao("0xa6")].path[Ao("0xbd")]()),r.createPositionFromPath(c,t[Ao("0x86")][Ao("0x96")][Ao("0xbd")]())),a=new s.MarkerOperation(e,null,o,r[Ao("0xc2")],!0,i++);n.push(a)}}return n}async[Ao("0x29")](e,t){let s;this[Ao("0x2")]=e[Ao("0x7f")];const r=e[Ao("0x3c")]&&!e.initData,n=r?0:e[Ao("0x7d")][Ao("0x7")];if(r)s=t,s[Ao("0x3f")]((t=>{t.createdAt=e[Ao("0x2b")],t[Ao("0x70")]=!0,t[Ao("0x9c")]=null})),this[Ao("0x82")](s,r);else{if(e[Ao("0x2e")]){const t=this[Ao("0xa0")](e[Ao("0x2e")]);this._document[Ao("0x91")][Ao("0x63")]=-t[Ao("0x62")],t.forEach((s=>{s[Ao("0x7")]-=t[Ao("0x62")],s[Ao("0x38")]=e[Ao("0x2b")],s[Ao("0x70")]=!0,s[Ao("0x9c")]=null})),this[Ao("0x82")](t,!0),this.serverHistory[Ao("0x63")]=-t[Ao("0x62")]+this[Ao("0x2")],this[Ao("0xa2")](t)}this[Ao("0x5")][Ao("0x91")].version=n,s=this[Ao("0x2d")](e[Ao("0x7d")],e[Ao("0xb6")]),await this[Ao("0x87")](s),this[Ao("0x82")](s,r)}e[Ao("0x27")]&&(this[Ao("0x3a")][Ao("0x36")](s,e.lastOperationId),this[Ao("0xc0")]=e[Ao("0x27")]),this.serverHistory[Ao("0x63")]=n+this._offset,this._updateServerHistory(s)}[Ao("0x88")](e,s){throw this[Ao("0xb0")]=!0,s&&console[Ao("0xc6")](s),new t.CKEditorError(e,this.editor)}[Ao("0x31")](e){this[Ao("0x95")][Ao("0xbc")](e)||(this._knownOperations.add(e),this[Ao("0x43")].push(e),this[Ao("0xab")]||Ao("0x49")==e[Ao("0xa8")]&&!e[Ao("0x1c")]||this[Ao("0x52")]())}_sendBufferedOperationsDelayed(e=!1){!e&&this._isPendingUpdate||(this[Ao("0xb0")]=!0,clearTimeout(this._sendBufferedOperationsDelayId),this._sendBufferedOperationsDelayId=setTimeout((()=>{this[Ao("0x17")]()[Ao("0x2c")]((e=>{e&&(this._clearPendingAction(),this._isPendingUpdate=!1)}))[Ao("0x41")]((e=>{if(this._clearPendingAction(),this[Ao("0xb0")]=!1,!((t=e)[Ao("0x47")].startsWith(Ao("0xb1"))||t.message[Ao("0x77")](Ao("0x19"))||t.message.startsWith("cloud-services-internal-error: Request timeout.")))throw e;var t}))}),this[Ao("0x1")]))}async[Ao("0x17")](){const e=this[Ao("0x4d")][Ao("0x57")][Ao("0x76")](S);if(this._shouldSendSelectionUpdate()&&(e.createUserMarkerOperations(),this[Ao("0x8a")]=!1),!this._shouldSendUpdate())return!0;const t=[...this[Ao("0x43")]];for(const e of t)e.wasUndone=this._document[Ao("0x91")][Ao("0x9f")](e);const s=this[Ao("0x3a")][Ao("0xc1")](t),r=Co++,n=this[Ao("0x67")](t),i=await this[Ao("0x6f")][Ao("0xb9")](n,n.baseVersion,s);try{return await this[Ao("0x89")](t,i,r)}catch(e){return this._crash(Ao("0x92"),e)}}async _handleServerResponse(e,t,s){if(t[Ao("0xc6")])throw t[Ao("0xc6")];let r=!1;if(t.wereChangesApplied){t.lastOperationId&&(this[Ao("0xc0")]=t.lastOperationId),this[Ao("0x43")]=this._bufferedOperations[Ao("0x1a")]((t=>!e[Ao("0x9")](t)));for(const s of e)s[Ao("0x38")]=t[Ao("0x6")];this._updateServerHistory(e),r=!0,this._currentBufferDelay=this[Ao("0xf")]}else{const e=this[Ao("0x2d")](t[Ao("0x7d")],t.metadata)[Ao("0x1a")]((e=>e[Ao("0x7")]>=this[Ao("0xe")]));await this[Ao("0x87")](e),r=this[Ao("0x4b")](e,t[Ao("0x63")],t.lastOperationId),this[Ao("0x1")]=Math[Ao("0x4")](this._currentBufferDelay/2)}return r?!this[Ao("0x53")]()||(this[Ao("0x35")](!0),!1):this[Ao("0x88")](Ao("0x59"))}[Ao("0x4b")](e,t,r){try{const n={document:this[Ao("0x5")],useRelations:!1,padWithNoOps:!0},{operationsA:i,operationsB:o,originalOperations:a}=(0,s.transformSets)(e,this[Ao("0x43")],n);No(i,this[Ao("0x5")][Ao("0x63")]),No(o,t);for(const e of i){const t=a[Ao("0x76")](e);e[Ao("0x9c")]=t?t[Ao("0x9c")]:null}r&&(this[Ao("0x3a")][Ao("0x36")](e,r),this[Ao("0xc0")]=r),this._bufferedOperations=[...o],this[Ao("0x82")](i),this[Ao("0xa2")](e)}catch(e){return console[Ao("0xc6")](e),!1}return!0}_applyOperationsSet(e,t=!1){this[Ao("0x4d")][Ao("0x2a")][Ao("0x9e")]({isUndoable:!1,isLocal:!1},(t=>{for(const s of e)this._knownOperations[Ao("0xae")](s),t[Ao("0x33")][Ao("0x64")](s),this[Ao("0x4d")].model[Ao("0xa7")](s)}))}_updateServerHistory(e){e[Ao("0x3f")]((e=>{const t=e.clone();t._authorId=e[Ao("0x9c")],t[Ao("0x70")]=!!e[Ao("0x70")],t[Ao("0x38")]=e[Ao("0x38")],t[Ao("0x7")]+=this._offset,e[Ao("0x8")]&&this[Ao("0x54")][Ao("0xae")](t),this[Ao("0x8d")].addOperation(t)}))}[Ao("0x5d")](e){const t=this.editor.plugins[Ao("0x76")](Ao("0xb8")),s=this.editor[Ao("0x25")];e||(e=k(s,Ao("0x9d"))),t[Ao("0x65")](e,{title:k(s,Ao("0x8b")),namespace:Ao("0x6c")}),this[Ao("0x72")]=!0,clearTimeout(this[Ao("0x5a")]),this[Ao("0x43")]=[],this[Ao("0x4d")][Ao("0x57")][Ao("0x76")](l)[Ao("0x34")]()}_setPendingAction(){this._pendingAction||(this[Ao("0xab")]=this[Ao("0x4d")][Ao("0x57")][Ao("0x76")](e.PendingActions)[Ao("0xae")](k(this[Ao("0x4d")][Ao("0x25")],"PENDING_ACTION_SENDING_DATA")))}[Ao("0x44")](){this._pendingAction&&(this[Ao("0x4d")][Ao("0x57")][Ao("0x76")](e.PendingActions)[Ao("0x11")](this._pendingAction),this[Ao("0xab")]=null)}_compressOperations(e){const t=e[Ao("0x0")]((e=>e[Ao("0xc4")]()));return this[Ao("0x97")][Ao("0xc3")](t)}[Ao("0x2d")](e,t){const r=this[Ao("0x97")][Ao("0x20")](e).map(((e,r)=>{const n=s.OperationFactory.fromJSON(e,this[Ao("0x5")]);return n[Ao("0x30")]=e[Ao("0x30")],Ao("0x78")===t[r][Ao("0xa8")]&&(n[Ao("0x8")]=!0),n}));return this[Ao("0xc5")](r,t),r}[Ao("0xc5")](e,t){for(let s=0;s<e[Ao("0x62")];s++)Ao("0x6a")==t[s][Ao("0xa8")]?(e[s][Ao("0x70")]=!0,e[s][Ao("0x9c")]=null):(e[s][Ao("0x70")]=!1,e[s][Ao("0x9c")]=t[s][Ao("0x6b")]),e[s][Ao("0x38")]=t[s][Ao("0x38")]}[Ao("0x26")](){this[Ao("0x8a")]=!0,this[Ao("0x37")]()?this[Ao("0x35")]():this[Ao("0x8a")]=!1}[Ao("0x37")](){const e=this[Ao("0x4d")][Ao("0x57")].get(m)[Ao("0x7e")][Ao("0x76")](this[Ao("0x5e")]);return!this[Ao("0x4d")][Ao("0x80")]&&e&&e[Ao("0x62")]>1&&this[Ao("0x8a")]}[Ao("0x53")](){return this[Ao("0x43")][Ao("0x62")]>0||this[Ao("0x37")]()}}class Ro extends Error{}function No(e,t){for(const s of e)s[Ao("0x7")]=t++}Io[Ao("0xa9")]=wo();class jo{constructor(e){this._ignoredOperations=e,this[Ao("0xb4")]=new WeakMap}getIdOfTheLastOperation(e){let s=e[Ao("0x62")];for(;s--;){const r=e[s];if(!this._ignoredOperations[Ao("0xbc")](r)){if(!this[Ao("0xb4")][Ao("0xbc")](r)){const e=(0,t.uid)()[Ao("0xbd")](1,18);this._operationToId[Ao("0x39")](r,e)}return this[Ao("0xb4")][Ao("0x76")](r)}}}[Ao("0x36")](e,t){if(!t)return;let s=e.length;for(;s--;){const r=e[s];this[Ao("0x8e")][Ao("0xbc")](r)||this._operationToId[Ao("0x39")](r,t)}}}var Po,Do,Mo=["pluginName","requires","RealTimeCollaborativeEditing"];Po=Mo,Do=483,function(e){for(;--e;)Po.push(Po.shift())}(++Do);var Bo=function(e,t){return Mo[e-=0]};class Jo extends e.Plugin{static get[Bo("0x1")](){return[Io]}static get[Bo("0x0")](){return Bo("0x2")}}var Vo=__webpack_require__(125),Uo=__webpack_require__.n(Vo),Fo=__webpack_require__(6042),qo=__webpack_require__.n(Fo);const Lo=["hasCommentThread","add","startsWith","listenTo","connect","reconnect","collaboration.channelId","removeComment","getConnectedSessions","has","size","plugins","remove","keys","updateComment","map","register","_terminateService","unregister","_connectService","cloudservicescommentsadapter-connect-already-connected","getCommentThreads","requires","content","CommentsRepository","getUser","permissions","commentAdded","cloudservicescommentsadapter-disconnect-not-exist","off","sessionAdd:","update","message","_services","removeCommentThread","destroy","CommentsService","code","cloud-services-internal-error: Not connected.","_setUpService","_getService","commentId","addComment","disconnect","delete","cloud-services-internal-error: Comments Service is not connected.","attributes","createdAt","catch","getMany","Permissions","_fetchMissingUsersForThreads","getComment","cloud-services-internal-error: Request timeout.","addCommentThread","404","from","commentUpdated","context","assign","cloudservicescommentsadapter-service-not-exist","get","adapter","commentRemoved","getCommentThread","mySessionId","config","userId","comments","commentThreadId"];var Yo,zo;Yo=Lo,zo=293,function(e){for(;--e;)Yo.push(Yo.shift())}(++zo);const Go=function(e,t){return Lo[e-=0]};class $o extends e.ContextPlugin{static get[Go("0x9")](){return[l,"CommentsRepository",m,n.Users]}constructor(e){super(e),this[Go("0x14")]=new Map}async init(){const t=this[Go("0x2d")],s=t[Go("0x44")][Go("0x30")]("CommentsRepository");if(t.plugins[Go("0x30")](l).addToReconnectionStack(this),s[Go("0x31")]={getCommentThread:async({channelId:e,threadId:t})=>{const s=await this[Go("0x1b")](e)[Go("0x33")](t).catch(Ko);return await this._fetchMissingUsersForThreads([s]),{threadId:s[Go("0x38")],comments:s[Go("0x37")][Go("0x2")](Ho)}},removeCommentThread:({channelId:e,threadId:t})=>this[Go("0x1b")](e)[Go("0x15")](t)[Go("0x23")](Wo).catch(Ko),addComment:({channelId:e,threadId:t,commentId:s,content:r,attributes:n})=>this[Go("0x1b")](e)[Go("0x1d")](t,s,r,n)[Go("0x23")](Ko),updateComment:({channelId:e,threadId:t,commentId:s,content:r,attributes:n})=>this[Go("0x1b")](e)[Go("0x1")](t,s,r,n)[Go("0x23")](Wo)[Go("0x23")](Ko),removeComment:({channelId:e,threadId:t,commentId:s})=>this[Go("0x1b")](e)[Go("0x40")](t,s)[Go("0x23")](Wo).catch(Ko)},t instanceof e.Context){const e=t[Go("0x35")][Go("0x30")]("collaboration.channelId"),s=t[Go("0x44")][Go("0x30")](m);await this[Go("0x1a")](e);const r=await this[Go("0x14")][Go("0x30")](e).getConnectedSessions();this.listenTo(s,Go("0x11")+e,((t,{session:r})=>{r.id===s[Go("0x34")]&&(t[Go("0x10")](),this.context[Go("0x44")][Go("0x30")](Go("0x25")).setPermissions(r[Go("0xd")],e))})),s.register(e,r)}}async[Go("0x1a")](e){if(this[Go("0x14")][Go("0x42")](e))throw new t.CKEditorError(Go("0x7"),null,{channelId:e});const s=this[Go("0x2d")][Go("0x44")][Go("0x30")](Go("0xb")),r=new($o[Go("0x17")])(e);this[Go("0x14")].set(e,r),this[Go("0x3c")](r,"commentThreadRemoved",((e,{commentThreadId:t})=>{const r=s.getCommentThread(t);r&&r[Go("0x45")]({isFromAdapter:!0})})),this[Go("0x3c")](r,Go("0xe"),((t,r)=>{const n=r[Go("0x38")];s[Go("0x39")](n)||s[Go("0x29")]({channelId:e,threadId:n,isFromAdapter:!0});const i=s[Go("0x33")](n);i&&i[Go("0x1d")](Object.assign(Ho(r),{isFromAdapter:!0}))})),this[Go("0x3c")](r,Go("0x2c"),((e,{commentThreadId:t,commentId:r,content:n,attributes:i})=>{const o=s[Go("0x33")](t);if(o){const e=o.getComment(r);e&&e[Go("0x12")]({content:n,attributes:i,isFromAdapter:!0})}})),this[Go("0x3c")](r,Go("0x32"),((e,{commentThreadId:t,commentId:r})=>{const n=s.getCommentThread(t);if(n){const e=n.getComment(r);e&&e.remove({isFromAdapter:!0})}})),await this[Go("0x6")](e)}[Go("0x16")](){if(this[Go("0x2d")]instanceof e.Context){const e=this[Go("0x2d")][Go("0x35")][Go("0x30")](Go("0x3f"));this[Go("0x4")](e)}}[Go("0x4")](e){if(!this[Go("0x14")][Go("0x42")](e))throw new t.CKEditorError(Go("0xf"),null,{channelId:e});this[Go("0x1b")](e)[Go("0x1e")](),this[Go("0x14")][Go("0x1f")](e)}async[Go("0x3e")](){for(const e of this[Go("0x14")][Go("0x0")]())await this._connectService(e);if(this.context instanceof e.Context){const e=this.context[Go("0x35")].get(Go("0x3f")),t=this.context.plugins[Go("0x30")](m);t[Go("0x5")](e);const s=await this[Go("0x14")][Go("0x30")](e)[Go("0x41")]();t[Go("0x3")](e,s)}}async[Go("0x6")](e){const{connection:t}=this[Go("0x2d")][Go("0x44")][Go("0x30")](l),s=this[Go("0x2d")][Go("0x44")][Go("0x30")](Go("0xb")),r=this[Go("0x14")][Go("0x30")](e),n=await r[Go("0x3d")](t);await this[Go("0x26")](n);const i=new Set(Array[Go("0x2b")](s[Go("0x8")]({channelId:e}),(e=>e.id)));for(const e of n)i[Go("0x1f")](e[Go("0x38")]);for(const e of i)s.getCommentThread(e)[Go("0x45")]({isFromAdapter:!0});for(const t of n){let r=s[Go("0x33")](t[Go("0x38")]);r||(r=s.addCommentThread({channelId:e,threadId:t[Go("0x38")],isFromAdapter:!0}));const n=new Set(Array[Go("0x2b")](r.comments,(e=>e.id)));for(const e of t[Go("0x37")])n[Go("0x1f")](e[Go("0x1c")]);for(const e of n)r[Go("0x27")](e)[Go("0x45")]({isFromAdapter:!0});for(const e of t[Go("0x37")]){const t=r[Go("0x27")](e[Go("0x1c")]);t?t[Go("0xa")]!==e[Go("0xa")]&&t[Go("0x12")]({content:e[Go("0xa")],isFromAdapter:!0}):r[Go("0x1d")](Object[Go("0x2e")](Ho(e),{isFromAdapter:!0}))}}}_getService(e){if(!this[Go("0x14")][Go("0x42")](e))throw new t.CKEditorError(Go("0x2f"),null,{channelId:e});return this[Go("0x14")][Go("0x30")](e)}async[Go("0x26")](e){const t=this.context.plugins[Go("0x30")](n.Users),{connection:s}=this[Go("0x2d")][Go("0x44")].get(l),r=new Set;for(const{comments:s}of e)for(const{userId:e}of s)t[Go("0xc")](e)||r[Go("0x3a")](e);if(0===r[Go("0x43")])return;const i=await Eo()[Go("0x24")](s,Array.from(r));for(const e of i)t.getUser(e.id)||t.addUser(e)}}async function Wo(e){if(Go("0x2a")!==e[Go("0x18")])throw e}function Ko(e){if((t=e)[Go("0x13")][Go("0x3b")](Go("0x20"))||t[Go("0x13")].startsWith(Go("0x19"))||t.message[Go("0x3b")](Go("0x28")))return new Promise((()=>{}));var t;throw e}function Ho(e){return{threadId:e.commentThreadId,commentId:e[Go("0x1c")],content:e[Go("0xa")],createdAt:e[Go("0x22")],authorId:e[Go("0x36")],attributes:e[Go("0x21")]}}$o.CommentsService=qo();const Zo=["_bufferedRequests","open","editor","attributes","cloud-services-internal-error: Not connected.","catch","find","size","TrackChangesService","off","getUser","reconnect","listenTo","hasSuggestion","data","set","_saved","collaboration.channelId","init","cloud-services-internal-error: Request timeout.","connect","originalSuggestionId","_trackChangesService","values","type","addUser","adapter","add","connected","requires","TrackChangesEditing","getMany","_waitForServiceReady","_fetchMissingUsersForThreads","plugins","get","from","message","config","addToReconnectionStack","addSuggestionData"];var Xo,Qo;Xo=Zo,Qo=258,function(e){for(;--e;)Xo.push(Xo.shift())}(++Qo);const ea=function(e,t){return Zo[e-=0]};class ta extends e.Plugin{static get[ea("0x11")](){return[$o,"TrackChangesEditing",l]}constructor(e){super(e),this._bufferedRequests=new Map}[ea("0x6")](){const e=this.editor[ea("0x16")][ea("0x17")](l),t=this[ea("0x1f")][ea("0x16")].get(ea("0x12")),s=this[ea("0x1f")][ea("0x1a")][ea("0x17")](ea("0x5"));return this[ea("0xa")]=new(ta[ea("0x25")])(s),t[ea("0xe")]={getSuggestion:async e=>{await this[ea("0x14")]();const t=await this[ea("0xa")][ea("0x17")](e)[ea("0x22")](sa);return await this._fetchMissingUsersForThreads([t]),t},addSuggestion:async({id:e,type:t,data:s,originalSuggestionId:r,attributes:n})=>{await this._waitForServiceReady();const i={id:e,type:t,data:s,originalSuggestionId:r,attributes:n},o=await this._trackChangesService[ea("0xf")](e,t,s,r,n)[ea("0x22")]((t=>{if(ra(t))return new Promise((t=>{this[ea("0x1d")][ea("0x3")](e,{resolve:t,suggestionData:i})}));throw t}));return this._bufferedRequests.delete(e),o},updateSuggestion:async(e,t)=>{if(await this[ea("0x14")](),ea("0x1e")!==t.state)return this[ea("0xa")].update(e,t)[ea("0x22")](sa)}},this[ea("0x0")](this._trackChangesService,"suggestionUpdated",((e,s)=>{t[ea("0x1")](s.id)&&(t.getSuggestion(s.id)[ea("0x20")]=s[ea("0x20")])})),this[ea("0xa")][ea("0x8")](e.connection).then((s=>(e[ea("0x1b")](this),this[ea("0x15")](s).then((()=>{for(const e of s)t[ea("0x1c")](e)[ea("0x4")]=!0})))))}async[ea("0x28")](){const e=this[ea("0x1f")].plugins[ea("0x17")]("TrackChangesEditing"),{connection:t}=this.editor[ea("0x16")].get(l),s=await this._trackChangesService[ea("0x8")](t);await this[ea("0x15")](s);for(const{suggestionData:e,resolve:t}of this._bufferedRequests[ea("0xb")]()){let r=s[ea("0x23")]((t=>t.id===e.id));r||(r=await this[ea("0xa")].add(e.id,e[ea("0xc")],e[ea("0x2")],e[ea("0x9")])),t(r)}for(const t of s)e.hasSuggestion(t.id)||e[ea("0x1c")](t)}async[ea("0x14")](){this[ea("0xa")].isConnected||await new Promise((e=>{this[ea("0x0")](this[ea("0xa")],ea("0x10"),(t=>{t[ea("0x26")](),e()}))}))}async _fetchMissingUsersForThreads(e){const t=this[ea("0x1f")][ea("0x16")].get(n.Users),{connection:s}=this[ea("0x1f")][ea("0x16")].get(l),r=new Set;for(const{authorId:s}of e)t.getUser(s)||r[ea("0xf")](s);if(0===r[ea("0x24")])return;const i=await Eo()[ea("0x13")](s,Array[ea("0x18")](r));for(const e of i)t[ea("0x27")](e.id)||t[ea("0xd")](e)}}function sa(e){if(ra(e))return new Promise((()=>{}));throw e}function ra(e){return e[ea("0x19")].startsWith(ea("0x21"))||e.message.startsWith(ea("0x7"))}ta[ea("0x25")]=Uo();const na=["ready","switchReadOnly","init","config","_setUpService","_terminateService","connected","CommentsEditing","CommentsRepository","change:state","collaboration.channelId","get","Comments","once","RealTimeCollaborativeComments","data","requires","isThreadsLoadingPaused","plugins","pluginName","editor"];var ia,oa;ia=na,oa=211,function(e){for(;--e;)ia.push(ia.shift())}(++oa);const aa=function(e,t){return na[e-=0]};class ca extends e.Plugin{static get[aa("0xf")](){return[aa("0xb"),$o,Jo,l]}static get[aa("0x12")](){return aa("0xd")}[aa("0x1")](){const e=this[aa("0x13")][aa("0x11")][aa("0xa")](l),t=this[aa("0x13")].plugins.get(aa("0x6")),s=this[aa("0x13")][aa("0x11")][aa("0xa")]($o);return this.editor[aa("0xe")][aa("0xc")](aa("0x14"),(()=>{this.listenTo(e,aa("0x8"),((e,s,r)=>{t[aa("0x10")]=aa("0x5")!==r}))})),this.listenTo(e,"change:state",((e,t,s)=>{this[aa("0x13")][aa("0x11")][aa("0xa")](aa("0x7"))[aa("0x0")](aa("0x5")!==s)})),s[aa("0x3")](this.editor[aa("0x2")][aa("0xa")](aa("0x9")))}destroy(){this[aa("0x13")][aa("0x11")][aa("0xa")]($o)[aa("0x4")](this[aa("0x13")][aa("0x2")][aa("0xa")](aa("0x9"))),super.destroy()}}var ua,da,la=["requires","RealTimeCollaborativeTrackChanges","pluginName","TrackChanges"];ua=la,da=164,function(e){for(;--e;)ua.push(ua.shift())}(++da);var ha=function(e,t){return la[e-=0]};class fa extends e.Plugin{static get[ha("0x0")](){return[ca,ta,ha("0x3")]}static get[ha("0x2")](){return ha("0x1")}}var pa=__webpack_require__(8811),ya=__webpack_require__.n(pa),ma=__webpack_require__(8689),va=__webpack_require__.n(ma);const ga=["affectsData","size","_lastRequestId","_revisionDataBuilder","data","remove","getUser","_waitForServiceReady","connected","_revisionTracker","_domEmitter","once","isEnabled","addRevisionData","plugins","repository","fromVersion","authorsIds","400","cloudServices.bundleVersion","Users","_revisions","setSource","RevisionHistoryService","then","cloud-services-internal-error: Not connected.","collaboration.channelId","requires","_handleReconnectionError","_preventResendingRevisionData","buildRevisionData","init","map","baseVersion","cloud-services-internal-error: Request timeout.","code","diffData","getRevisions","_bufferUpdate","_isPendingUpdate","_update","setRevisionData","reverse","length","serverHistory","_getLatestVersion","revisionsUpdated","_startingVersion","_fixRevision","reInit","editor","stopListening","getRevision","change:_isPendingUpdate","_getLatestVersionFromServerOperations","connect","get","catch","_bufferedUpdates","reconnect","change:_isConnected","keys","marker","_revisionHistoryService","isEmptyCurrent","_oldOffset","off","addToReconnectionStack","_offset","message","_isConnected","destroy","listenTo","updateRevisions","creatorId","currentRevision","max","_handleRevisionsUpdate","connection","RevisionTracker","type","wrongRequestId","cloud-services-internal-error: Revision History Service is not connected.","toVersion","config","_createCurrentRevision"];var xa,_a;xa=ga,_a=373,function(e){for(;--e;)xa.push(xa.shift())}(++_a);const ba=function(e,t){return ga[e-=0]};class wa extends e.Plugin{static get[ba("0x54")](){return[l,Io,ba("0x32"),m,n.Users]}async[ba("0x2")](){this[ba("0x3b")]=null,this[ba("0x42")]=this[ba("0x15")][ba("0x47")][ba("0x1b")](ba("0x32"));const e=this.editor.plugins[ba("0x1b")](Io),s=e[ba("0xf")],r=this[ba("0x15")][ba("0x47")].get(l),n=this[ba("0x15")][ba("0x37")][ba("0x1b")](ba("0x53"));this[ba("0x22")]=new(wa[ba("0x50")])(n),this[ba("0x42")][ba("0x4f")]({history:s,getLatestVersion:()=>this._getLatestVersion(),getCurrentRevisionId:()=>e.sessionId});const i=this[ba("0x15")][ba("0x37")].get(ba("0x4c"))||t.version,o=await va().isBundleUploaded(r[ba("0x31")],i);this[ba("0x42")].adapter={getRevision:async({revisionId:e})=>(await this[ba("0x40")](),await this[ba("0x22")].getRevision(e)),updateRevisions:async e=>{await this._waitForServiceReady();const t=this._revisionTracker[ba("0x2e")];if(!o||1!==e[ba("0xe")]||e[0].id!==t.id){for(const s of e)s.id===t.id&&(s[ba("0x23")]=s.fromVersion===s[ba("0x36")]);return this[ba("0x22")][ba("0x2c")](e,this._lastRequestId)[ba("0x51")]((e=>{this[ba("0x3b")]=e}))[ba("0x1c")]((t=>{if(!(Oa(t)||ba("0x4b")===t[ba("0x6")]&&void 0!==t[ba("0x3d")][ba("0x34")]))throw t;for(const t of e)!this[ba("0x42")][ba("0x48")][ba("0x17")](t.id)||this[ba("0x42")]._bufferUpdate(t.id,t,!1);if(Oa(t))throw t}))}}},this[ba("0x2b")](this[ba("0x22")],ba("0x11"),((e,{revisionsData:t,requestId:s})=>{Math[ba("0x2f")](...t.map((e=>e[ba("0x36")])))>this._getLatestVersionFromServerOperations()-1?this[ba("0x10")]()[ba("0x51")]((()=>{this[ba("0x30")](t,s)})):this._handleRevisionsUpdate(t,s)}));const{revisions:a,requestId:c}=await this[ba("0x22")][ba("0x1a")](r.connection);r[ba("0x26")](this),this._lastRequestId=c,await this._fetchMissingUsers(a);for(const e of a)this[ba("0x42")][ba("0x46")](e);this.listenTo(e,ba("0x1f"),((t,s,r)=>{r&&(this[ba("0x24")]=e[ba("0x27")],t[ba("0x25")]())})),this[ba("0x42")].bind(ba("0x45")).to(r,"state",(e=>ba("0x41")===e))}async[ba("0x1e")](){const e=this[ba("0x15")][ba("0x47")][ba("0x1b")](l),t=this[ba("0x15")][ba("0x47")][ba("0x1b")](Io),s=async()=>{const s=this[ba("0x42")].currentRevision,r=s.id,n=r!==t.sessionId;if(n){const e=t._offset-this._oldOffset,n=this[ba("0x19")]();if(this[ba("0x42")][ba("0x3c")][ba("0x14")](),s[ba("0x36")]+e!==n){const t=s[ba("0x49")]+e,r=this.editor[ba("0x47")][ba("0x1b")](ba("0x4d")),i=this[ba("0x42")].buildRevisionData({currentRevision:s,from:t,to:n});i.id=s.id;const o=i[ba("0x4a")][ba("0x3")]((e=>r[ba("0x3f")](e)));s[ba("0xb")]({...i,authors:o},!0),this._revisionTracker[ba("0x9")](s.id,i,!0)}this._revisionTracker[ba("0x12")]=n,s[ba("0x36")]===s[ba("0x49")]&&!this[ba("0x42")][ba("0x1d")].has(r)&&this[ba("0x42")][ba("0x48")][ba("0x4e")][ba("0x3e")](r),this[ba("0x42")][ba("0x38")](n)}const{revisions:i,requestId:o}=await this._revisionHistoryService[ba("0x1e")](e.connection,this[ba("0x3b")]);n&&i[ba("0xe")]>0?t[ba("0x55")]():(await this._fetchMissingUsers(i),this[ba("0x30")](i,o),this[ba("0x42")].sendBufferedUpdates())};return t[ba("0x29")]?s():new Promise(((e,r)=>{t[ba("0x44")](ba("0x1f"),(()=>{s()[ba("0x51")](e)[ba("0x1c")](r)}))}))}destroy(){this[ba("0x43")]&&this[ba("0x43")][ba("0x16")](),super[ba("0x2a")]()}async[ba("0x40")](){this[ba("0x22")].isConnected||await new Promise((e=>{this[ba("0x2b")](this[ba("0x22")],ba("0x41"),(t=>{t.off(),e()}))}))}[ba("0x19")](){const e=this.editor[ba("0x47")][ba("0x1b")](Io).serverHistory;for(const t of e.getOperations()[ba("0xd")]())if(ba("0x21")!==t[ba("0x33")]||t[ba("0x39")])return t[ba("0x4")]+1}_getLatestVersion(){const e=this[ba("0x15")][ba("0x47")][ba("0x1b")](Io);return new Promise((t=>{e[ba("0xa")]?e[ba("0x44")](ba("0x18"),(()=>{t(this[ba("0x19")]())})):t(this._getLatestVersionFromServerOperations())}))}[ba("0x30")](e,t){const s=this[ba("0x42")][ba("0x48")];this._lastRequestId=t;for(const t of e){const e=s[ba("0x17")](t.id);if(e){if((t[ba("0x49")]||t[ba("0x36")])&&(t.diffData=null),e===this[ba("0x42")][ba("0x2e")]){const s=Math.max(e.toVersion,t[ba("0x36")]),r=Math.max(e.fromVersion,t[ba("0x49")]);let n;e.toVersion===t[ba("0x36")]&&e[ba("0x49")]===t[ba("0x49")]?(n=!0,this[ba("0x0")](t)):t[ba("0x36")]===s&&t[ba("0x49")]===r?n=!1:(e.toVersion===s&&e[ba("0x49")]===r||this[ba("0x13")]({revision:e,from:r,to:s}),n=!0),n&&(delete t[ba("0x49")],delete t[ba("0x36")],delete t[ba("0x7")],delete t.createdAt,delete t[ba("0x4a")])}this[ba("0x42")][ba("0xc")](t),this[ba("0x0")](t)}else this[ba("0x42")][ba("0x46")](t)}const r=s[ba("0x8")]();r[ba("0xd")]();for(let e=0;e<r[ba("0xe")]-1;e++){const t=r[e],s=r[e+1];if(t.fromVersion<s[ba("0x36")]){const e=s[ba("0x36")],r=Math[ba("0x2f")](e,t[ba("0x36")]);this._fixRevision({revision:t,from:e,to:r})}}}_fixRevision({revision:e,from:t,to:s}={}){const r=this[ba("0x15")][ba("0x47")].get(ba("0x4d")),n=this[ba("0x42")][ba("0x1")]({revision:e,from:t,to:s});n.authors=n[ba("0x4a")][ba("0x3")]((e=>r[ba("0x3f")](e))),e[ba("0xb")](n)}[ba("0x0")](e){const t={};t.id=e.id;for(const s of Object[ba("0x20")](e))"id"!==s&&(t[s]=void 0);this._revisionTracker._bufferUpdate(t.id,t,!0)}async _fetchMissingUsers(e){const t=this[ba("0x15")].plugins[ba("0x1b")](n.Users),{connection:s}=this[ba("0x15")][ba("0x47")][ba("0x1b")](l),r=new Set;for(const t of e){for(const e of t[ba("0x4a")])o(e);t[ba("0x2d")]&&o(t[ba("0x2d")])}if(0===r[ba("0x3a")])return;const i=await Eo().getMany(s,Array.from(r));for(const e of i)t[ba("0x3f")](e.id)||t.addUser(e);function o(e){t[ba("0x3f")](e)||r.add(e)}}}function Oa(e){return e[ba("0x28")].startsWith(ba("0x35"))||e[ba("0x28")].startsWith(ba("0x52"))||e[ba("0x28")].startsWith(ba("0x5"))}wa[ba("0x50")]=ya();var Ea,Sa,Ta=["RevisionHistory","requires"];Ea=Ta,Sa=209,function(e){for(;--e;)Ea.push(Ea.shift())}(++Sa);var ka=function(e,t){return Ta[e-=0]};class Aa extends e.Plugin{static get[ka("0x0")](){return[ka("0x1"),wa,Jo]}static get pluginName(){return"RealTimeCollaborativeRevisionHistory"}}var Ca="[object Object]",Ia=Function.prototype,Ra=Object.prototype,Na=Ia.toString,ja=Ra.hasOwnProperty,Pa=Na.call(Object);const Da=function(e){if(!it(e)||ne(e)!=Ca)return!1;var t=as(e);if(null===t)return!0;var s=ja.call(t,"constructor")&&t.constructor;return"function"==typeof s&&s instanceof s&&Na.call(s)==Pa};const Ma=function(e){return it(e)&&1===e.nodeType&&!Da(e)},Ba=["set","ck-presence-list__counter","ck-presence-list__counter--hidden","bindTemplate","usersCount","div","setTemplate","isHidden","CONNECTED_USERS"];var Ja,Va;Ja=Ba,Va=133,function(e){for(;--e;)Ja.push(Ja.shift())}(++Va);const Ua=function(e,t){return Ba[e-=0]};class Fa extends r.View{constructor(e){super(e);const t=this[Ua("0x5")];this[Ua("0x2")](Ua("0x6"),0),this[Ua("0x2")](Ua("0x0"),!0),this[Ua("0x8")]({tag:Ua("0x7"),attributes:{class:["ck",Ua("0x3"),t.if(Ua("0x0"),Ua("0x4"))]},children:[{text:t.to(Ua("0x6"),(t=>k(e,Ua("0x1"),t)))}]})}}const qa=["items","setTemplate","bindTemplate","div"];var La,Ya;La=qa,Ya=252,function(e){for(;--e;)La.push(La.shift())}(++Ya);const za=function(e,t){return qa[e-=0]};class Ga extends r.View{constructor(e){super(e),this[za("0x0")]=this.createCollection();const t=this[za("0x2")];this[za("0x1")]({tag:za("0x3"),attributes:{class:["ck","ck-presence-list__list"]},children:this.items,on:{click:t.to((()=>this.fire("execute")))}})}}var $a=__webpack_require__(3286),Wa={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};g()($a.Z,Wa);$a.Z.locals;const Ka=["ck-reset","inlineListView","listenTo","change","ck-presence-list--collapsed","setTemplate","div","first","items","bindTemplate","isCollapsed","ck-rounded-corners","set","counterView"];var Ha,Za;Ha=Ka,Za=189,function(e){for(;--e;)Ha.push(Ha.shift())}(++Za);const Xa=function(e,t){return Ka[e-=0]};class Qa extends r.View{constructor(e){super(e);const t=this[Xa("0x2")];this[Xa("0x5")](Xa("0x3"),!0),this[Xa("0x6")]=new Fa(this.locale),this[Xa("0x8")]=new Ga(e),this[Xa("0x9")](this[Xa("0x8")][Xa("0x1")],Xa("0xa"),(()=>{for(const e of this[Xa("0x8")][Xa("0x1")])e.tooltipPosition="s";this[Xa("0x8")][Xa("0x1")][Xa("0x0")]&&(this[Xa("0x8")][Xa("0x1")][Xa("0x0")].tooltipPosition="se")})),this[Xa("0xc")]({tag:Xa("0xd"),attributes:{class:["ck","ck-presence-list",Xa("0x7"),Xa("0x4"),t.if(Xa("0x3"),Xa("0xb"))]},children:[this[Xa("0x6")],this[Xa("0x8")]]})}}var ec,tc,sc=["ck-presence-list__dropdown-list","setTemplate","items","ck-presence-list__dropdown-list-wrapper","div","createCollection"];ec=sc,tc=268,function(e){for(;--e;)ec.push(ec.shift())}(++tc);var rc=function(e,t){return sc[e-=0]};class nc extends r.View{constructor(e){super(e),this[rc("0x4")]=this[rc("0x1")](),this[rc("0x3")]({tag:rc("0x0"),attributes:{class:["ck",rc("0x2")]},children:[{tag:rc("0x0"),attributes:{class:["ck",rc("0x5")]},children:this[rc("0x4")]}]})}}const ic=["div","userView","ck-presence-list__marker","bindTemplate","execute","setTemplate","true","color","span","ck-presence-list__dropdown-list-item","fire","ck-user__full-name"];var oc,ac;oc=ic,ac=267,function(e){for(;--e;)oc.push(oc.shift())}(++ac);const cc=function(e,t){return ic[e-=0]};class uc extends r.View{constructor(e,t,s){super(e);const r=this[cc("0x0")];this[cc("0xa")]=new n.UserView(e,t);const i={tag:cc("0x9"),attributes:{class:["ck",cc("0x6")]},children:[this[cc("0xa")],{tag:cc("0x5"),attributes:{class:["ck",cc("0x8")]},children:[{text:t.name}]},{tag:"span",attributes:{class:["ck",cc("0xb"),t[cc("0x4")].getBackgroundColorClass()],"aria-hidden":cc("0x3")}}]};s&&(i.tag="button",i.on={click:r.to((()=>this[cc("0x7")](cc("0x1"))))}),this[cc("0x2")](i)}}const dc=["fire","span","hasTooltip","button","markerView","tag","set","ck-presence-list__marker","ck-presence-list__list-item__tooltip","setTemplate","tooltipPosition","div","color","ck-presence-list__list-item","true","userView","getBackgroundColorClass"];var lc,hc;lc=dc,hc=382,function(e){for(;--e;)lc.push(lc.shift())}(++hc);const fc=function(e,t){return dc[e-=0]};class pc extends r.View{constructor(e,t,s){super(e);const r=this.bindTemplate;this.set(fc("0xb"),!0),this[fc("0xf")]("tooltipPosition",""),this[fc("0x7")]=new n.UserView(e,t),this[fc("0xd")]=new yc(e,t);const i={tag:fc("0x3"),attributes:{class:["ck",fc("0x5")],"data-cke-tooltip-text":this[fc("0x7")].name,"data-cke-tooltip-position":r.to(fc("0x2")),"data-cke-tooltip-disabled":r.to(fc("0xb"),(e=>!e)),"data-cke-tooltip-class":fc("0x0")},children:[this[fc("0x7")],this.markerView]};s&&(i[fc("0xe")]=fc("0xc"),i.on={click:r.to((()=>this[fc("0x9")]("execute")))}),this.setTemplate(i)}}class yc extends r.View{constructor(e,t){super(e),this[fc("0x1")]({tag:fc("0xa"),attributes:{class:["ck",fc("0x10"),t[fc("0x4")][fc("0x8")]()],"aria-hidden":fc("0x6")}})}}const mc=["balloonPanelView","pin","bindTo","bodyCollection","render","_handleUserRemove","config","listenTo","showDropdown","ck ck-presence-list__balloon","get","init","presencelist-missing-container","onClick","isVisible","view","presencelist-collapseat-invalid-format","items","hideDropdown","counterView","isRendered","isCollapsed","presenceList","remove","attachToDom","usersCount","element","_allConnectedUsers","locale","plugins","define","number","add","hasTooltip","bind","inlineListView","execute","content","class","unpin","presenceDropdownView","_createView","lastConnectedUsers","destroy","presenceList.container","length","detachFromDom","context","presenceList.collapseAt","_handleUserAdd"];var vc,gc;vc=mc,gc=216,function(e){for(;--e;)vc.push(vc.shift())}(++gc);const xc=function(e,t){return mc[e-=0]};class _c extends e.ContextPlugin{constructor(e){super(e),e[xc("0x28")][xc("0xe")](xc("0x6"),{collapseAt:6});const s=e[xc("0x28")].get(xc("0x20"));if(xc("0xf")!=typeof s)throw new t.CKEditorError(xc("0x0"),this);if(s<1)throw new t.CKEditorError(xc("0x0"),this)}static get requires(){return[m]}[xc("0x2d")](){const e=this[xc("0x1f")];this._allConnectedUsers=e[xc("0xd")].get(m).allConnectedUsers,this.set("usersCount",0),this[xc("0x1a")]=new t.Collection,this[xc("0x22")]=new r.BalloonPanelView,this[xc("0x22")][xc("0x16")]=xc("0x2b"),this[xc("0x31")]=this[xc("0x19")](),this.presenceDropdownView=void 0;for(const e of this[xc("0xb")])this[xc("0x21")](e);this[xc("0x29")](this[xc("0xb")],xc("0x10"),((e,t)=>{this[xc("0x21")](t)})),this.listenTo(this[xc("0xb")],xc("0x7"),((e,t)=>{this[xc("0x27")](t)}))}[xc("0x19")](){const e=this.context,s=new Qa(this[xc("0x1f")][xc("0xc")]),n=this.balloonPanelView;if(!Ma(e.config[xc("0x2c")](xc("0x1c"))))throw new t.CKEditorError(xc("0x2e"),this);return s[xc("0x3")].bind("usersCount").to(this),s.bind("isCollapsed").to(this,xc("0x9"),(t=>{const r=t>=e[xc("0x28")][xc("0x2c")](xc("0x20"));return s[xc("0x3")].isHidden=!(1==t||r),r||this.hideDropdown(),r})),s[xc("0x13")][xc("0x1")][xc("0x24")](this[xc("0x1a")]).using((t=>{const r=e[xc("0x28")].get(xc("0x6")),n=new pc(e.locale,t,r[xc("0x2f")]);return n[xc("0x12")](xc("0x11")).to(s,xc("0x5"),(e=>!e)),r[xc("0x2f")]&&this[xc("0x29")](n,xc("0x14"),(()=>{this[xc("0x31")].isCollapsed||r[xc("0x2f")](t,n[xc("0xa")])})),n})),this[xc("0x29")](s[xc("0x13")],xc("0x14"),(()=>{this.presenceDropdownView?this[xc("0x2")]():this[xc("0x31")][xc("0x5")]&&this[xc("0x2a")]()})),s[xc("0x26")](),n[xc("0x26")](),(0,r.clickOutsideHandler)({emitter:s,activator:()=>n[xc("0x30")],contextElements:[n[xc("0xa")],s[xc("0x13")][xc("0xa")]],callback:()=>this[xc("0x2")]()}),e[xc("0x28")][xc("0x2c")](xc("0x1c")).appendChild(s[xc("0xa")]),this[xc("0x25")]=new r.BodyCollection(this[xc("0x1f")].locale),this[xc("0x25")][xc("0x8")](),this[xc("0x25")][xc("0x10")](n),s}[xc("0x21")](e){this.usersCount++,5==this[xc("0x1a")][xc("0x1d")]&&this[xc("0x1a")].remove(0),this[xc("0x1a")][xc("0x10")](e)}[xc("0x27")](e){if(this[xc("0x9")]--,this[xc("0x1a")].get(e.id)&&(this[xc("0x1a")][xc("0x7")](e.id),this.lastConnectedUsers[xc("0x1d")]<this[xc("0x9")]))for(const e of Array.from(this._allConnectedUsers).reverse())if(!this[xc("0x1a")][xc("0x2c")](e.id))return void this[xc("0x1a")][xc("0x10")](e,0)}[xc("0x2a")](){if(this.presenceDropdownView)return;this.presenceDropdownView=new nc;const e=this[xc("0x1f")][xc("0x28")][xc("0x2c")](xc("0x6"));this[xc("0x18")][xc("0x1")][xc("0x24")](this[xc("0xb")]).using((t=>{const s=new uc(this[xc("0x1f")][xc("0xc")],t,!!e[xc("0x2f")]);return e[xc("0x2f")]&&this[xc("0x29")](s,xc("0x14"),(()=>{e.onClick(t,s[xc("0xa")])})),s})),this[xc("0x22")][xc("0x15")].add(this[xc("0x18")]),this[xc("0x22")][xc("0x23")]({target:this[xc("0x31")][xc("0x13")][xc("0xa")]})}hideDropdown(){this.presenceDropdownView&&(this.balloonPanelView[xc("0x17")](),this.balloonPanelView[xc("0x15")][xc("0x7")](this[xc("0x18")]),this.presenceDropdownView.destroy(),this.presenceDropdownView=void 0)}[xc("0x1b")](){super[xc("0x1b")](),this[xc("0x31")]&&this[xc("0x31")][xc("0x4")]&&this[xc("0x31")][xc("0x1b")](),this[xc("0x25")]&&this[xc("0x25")][xc("0x1e")]()}}var bc,wc,Oc=["PresenceList","pluginName","requires"];bc=Oc,wc=146,function(e){for(;--e;)bc.push(bc.shift())}(++wc);var Ec=function(e,t){return Oc[e-=0]};class Sc extends e.ContextPlugin{static get[Ec("0x0")](){return[m,_c]}static get[Ec("0x2")](){return Ec("0x1")}}})(),(window.CKEditor5=window.CKEditor5||{}).realTimeCollaboration=__webpack_exports__})();
5
+ */(()=>{var __webpack_modules__={357:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e,t,n=null,r={}){super("cloud-services-internal-error: "+e),this.context=t,this.code=n,this.data=r,this.name="CKEditorError"}static fromPublicError(e){return new n(function(e){let t="cloud-services-error: "+e.message;return e.explanation&&(t+="\nExplanation: "+e.explanation),e.action&&(t+="\nAction: "+e.action),e.traceId&&(t+="\nTraceId: "+e.traceId),e.code&&(t+="\nCode: "+e.code),t}(e),e)}}t.default=n},8801:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e,t){super(),this.name="CKEditorCloudServicesServerError",this.stack=void 0,this.message=e,this.code=t.code,this.traceId=t.traceId,this.data=t.data}static fromPublicError(e){return new n(function(e){let t="cloud-services-server-error: "+e.message;return e.explanation&&(t+="\nExplanation: "+e.explanation),e.action&&(t+="\nAction: "+e.action),e.traceId&&(t+="\nTraceId: "+e.traceId),e.code&&(t+="\nCode: "+e.code),t}(e),e)}}t.default=n},7622:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const o=n(5003),s=n(2209),i=r(n(3596)),a=r(n(7026)),c=r(n(7839)),u=r(n(5132)),d=r(n(4148)),l=r(n(223)),p=r(n(2968)),h=r(n(7158)),f=r(n(357)),m=r(n(6314)),y=r(n(6148)),g=r(n(961));t._SERVICE=1;class b{constructor(e,t){if(!e)throw new TypeError('Param "bundleVersion" must be provided.');this._id=null!=t?t:(0,o.v4)(),this._isConnected=!1,this._bundleVersion=e}getId(){return this._id}isConnected(){return this._isConnected}connect(e,t={buffers:[],types:[]},n){const r=new c.default(this.getId(),t.buffers,t.types,this._bundleVersion,n);return this._connect(e,r)}reconnect(e,t){if(this.isConnected())throw new f.default("Cannot reconnect to already connected service.",e);return this._connect(e,new d.default(this.getId(),t,this._bundleVersion))}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._connectedSessions&&(this._connectedSessions.disconnect(),this._connectedSessions=void 0),this.fire("disconnected"),this.stopListening())}async getDocumentDetails(){const e=new g.default(this.getId());if(!this._wsGateway)throw new m.default("Collaborative Editing",this);const n=await this._wsGateway._sendRequest(t._SERVICE,g.default.TYPE,i.default.encode(e));return i.default.decode(n,y.default)}async sendOperations(e,n,r){if(!e||!e.types||!e.types.length)throw new f.default("Cannot send empty update.",this._wsGateway);const o="number"==typeof n?n:parseInt(n);if(!Number.isInteger(o)||o<0)throw new f.default("Base version not provided.",this._wsGateway);const s=new u.default(this.getId(),e.buffers,e.types,o,[],r);if(!this._wsGateway||!this._isConnected)throw new m.default("Collaborative Editing",this);const a=await this._wsGateway._sendRequest(t._SERVICE,u.default.TYPE,i.default.encode(s));return i.default.decode(a,l.default)}async getConnectedSessions(){if(!this._isConnected)throw new m.default("Collaborative Editing",this);return this._connectedSessions||(this._connectedSessions=await a.default.getConnectedSessions(this._wsGateway,this._id,t._SERVICE)),this._connectedSessions}static getConnectedSessions(e,n){return a.default.getConnectedSessions(e,n,t._SERVICE)}async _connect(e,n){if(this.isConnected())return;if(e.state!==h.default.STATE_CONNECTED)throw new f.default("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const r=await e._sendRequest(t._SERVICE,n.constructor.TYPE,i.default.encode(n)),o=i.default.decode(r,p.default);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:h.default._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,o.channel),this._isConnected=!0,this.fire("connected"),o}_connectToChannel(e,n){this._channel=e._getChannel(t._SERVICE,n),this.listenTo(this._channel,this._channel.getEventName(u.default.TYPE),((e,t)=>{const n=i.default.decode(t,u.default);this.fire("operationsReceived",n.baseVersion,n.data,n.metadata)}))}_onWsGatewayStateChange(e){e===h.default.STATE_DISCONNECTED&&this.disconnect()}}b._SERVICE=t._SERVICE,(0,s.mix)(b,s.EmitterMixin),t.default=b},8677:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(5945));class s extends o.default{static toJSON({createdAt:e,...t}){const n={...t};return(null==e?void 0:e.toISOString)&&(n.createdAt=e.toISOString()),n}static fromJSON({createdAt:e,...t}){const n={...t};return e&&(n.createdAt=new Date(e)),n}}t.default=s,s.DESCRIPTOR_NAME="OperationMetadataDescriptor",s.DESCRIPTOR={fields:{userId:{type:"string",id:1},type:{type:"string",id:2},createdAt:{type:"string",id:3}}}},6685:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{static prepareMetadataForOperations(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];let r=0;for(const o of e)if(0!==o){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r]),r++}else n.push(n[n.length-1]);return n}static removeUnnecessaryMetadata(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];for(let r=0;r<e.length;r++)if(0!==e[r]){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r])}return n}}},7839:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r,o=""){super(),this.id=e,this.buffers=t,this.types=n,this.bundleVersion=r,this.lastOperationId=o}toJSON(){return{id:this.id,buffers:this.buffers,types:this.types,bundleVersion:this.bundleVersion,lastOperationId:this.lastOperationId}}static fromJSON(e){return new s(e.id,e.buffers,e.types,e.bundleVersion,e.lastOperationId)}}t.default=s,s.TYPE="11",s.READABLE_TYPE_NAME="connectToDocument",s.DESCRIPTOR_NAME="CollaborativeEditingConnectMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},buffers:{rule:"repeated",type:"bytes",id:3},types:{rule:"repeated",type:"uint32",id:4},lastOperationId:{type:"string",id:5}}}},4148:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n){super(),this.id=e,this.lastKnowVersion=t,this.bundleVersion=n}toJSON(){return{id:this.id,bundleVersion:this.bundleVersion,lastKnowVersion:this.lastKnowVersion}}static fromJSON(e){return new s(e.id,e.lastKnowVersion,e.bundleVersion)}}t.default=s,s.TYPE="12",s.READABLE_TYPE_NAME="reconnectToDocument",s.DESCRIPTOR_NAME="CollaborativeEditingReconnectMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},lastKnowVersion:{type:"uint32",id:3}}}},5132:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(6685)),i=r(n(8677));class a extends o.default{constructor(e,t,n,r,o=[],s=""){super(),this.id=e,this.buffers=t,this.types=n,this.baseVersion=r,this.metadata=o,this.lastOperationId=s}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.baseVersion,lastOperationId:this.lastOperationId}}toJSON(){return{id:this.id,buffers:this.buffers,types:this.types,baseVersion:this.baseVersion,metadata:s.default.removeUnnecessaryMetadata(this.types,this.metadata).map(i.default.toJSON),lastOperationId:this.lastOperationId}}static fromJSON(e){return new a(e.id,e.buffers,e.types,e.baseVersion,s.default.prepareMetadataForOperations(e.types,e.metadata).map(i.default.fromJSON),e.lastOperationId)}}t.default=a,a.TYPE="13",a.READABLE_TYPE_NAME="updateDocument",a.DESCRIPTOR_NAME="CollaborativeEditingUpdateMessage",a.DESCRIPTOR={fields:{id:{type:"string",id:1},baseVersion:{type:"uint32",id:2},buffers:{rule:"repeated",type:"bytes",id:3},types:{rule:"repeated",type:"uint32",id:4},metadata:{rule:"repeated",type:"OperationMetadataDescriptor",id:6},lastOperationId:{type:"string",id:7}}}},961:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.documentId=e}get data(){return{documentId:this.documentId}}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="14",s.READABLE_TYPE_NAME="getDocumentDetails",s.DESCRIPTOR_NAME="GetDocumentDetailsMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1},environmentId:{type:"string",id:2}}}},2968:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(6685)),i=r(n(8677));class a extends o.default{constructor(e,t,n=[],r=[],o=0,s=[],i=null,a="",c="",u=null){super(),this.channel=e,this.version=t,this.buffers=n,this.types=r,this.offset=o,this.metadata=s,this.initData=i,this.sessionId=a,this.lastOperationId=c,this.sessionCreatedAt=u}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt}}get wereChangesApplied(){var e;return!(null===(e=this.types)||void 0===e?void 0:e.length)&&null===this.initData}toJSON(){var e;return{channel:this.channel,version:this.version,sessionId:this.sessionId,buffers:this.buffers,types:this.types,offset:this.offset,metadata:s.default.removeUnnecessaryMetadata(this.types,this.metadata).map(i.default.toJSON),initData:null!==(e=this.initData)&&void 0!==e?e:"",isInitialized:"string"==typeof this.initData,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt?this.sessionCreatedAt.toISOString():null}}static create(e){return new a(e.channel,e.version,e.buffers,e.types,e.offset,e.metadata,e.initData,e.sessionId,e.lastOperationId,e.sessionCreatedAt)}static fromJSON(e){var t;let n=null;return!0===e.isInitialized?n=null!==(t=e.initData)&&void 0!==t?t:"":"boolean"!=typeof e.isInitialized&&e.initData&&(n=e.initData),a.create({channel:e.channel,version:e.version,buffers:e.buffers,types:e.types,offset:e.offset,metadata:s.default.prepareMetadataForOperations(e.types,e.metadata).map(i.default.fromJSON),initData:n,sessionId:e.sessionId,lastOperationId:e.lastOperationId,sessionCreatedAt:e.sessionCreatedAt?new Date(e.sessionCreatedAt):null})}}t.default=a,a.DESCRIPTOR_NAME="CollaborativeEditingConnectResponse",a.DESCRIPTOR={fields:{channel:{type:"string",id:1},offset:{type:"uint32",id:2},version:{type:"uint32",id:3},buffers:{rule:"repeated",type:"bytes",id:4},types:{rule:"repeated",type:"uint32",id:5},metadata:{rule:"repeated",type:i.default.DESCRIPTOR_NAME,id:7},initData:{type:"string",id:8},isInitialized:{type:"bool",id:9},sessionId:{type:"string",id:10},lastOperationId:{type:"string",id:11},sessionCreatedAt:{type:"string",id:12}}}},223:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(6685)),i=r(n(8677));class a extends o.default{constructor(e,t=[],n=[],r=[],o="",s=null){super(),this.version=e,this.buffers=t,this.types=n,this.metadata=r,this.lastOperationId=o,this.lastOperationAcceptedAt=s}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt}}get wereChangesApplied(){var e;return!(null===(e=this.types)||void 0===e?void 0:e.length)}toJSON(){return{version:this.version,buffers:this.buffers,types:this.types,metadata:s.default.removeUnnecessaryMetadata(this.types,this.metadata).map(i.default.toJSON),lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt instanceof Date?this.lastOperationAcceptedAt.toISOString():this.lastOperationAcceptedAt}}static fromJSON(e){return new a(e.version,e.buffers,e.types,s.default.prepareMetadataForOperations(e.types,e.metadata).map(i.default.fromJSON),e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}static create(e){return new a(e.version,e.buffers,e.types,e.metadata,e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}}t.default=a,a.DESCRIPTOR_NAME="CollaborativeEditingResponse",a.DESCRIPTOR={fields:{version:{type:"uint32",id:1},buffers:{rule:"repeated",type:"bytes",id:2},types:{rule:"repeated",type:"uint32",id:3},metadata:{rule:"repeated",type:"OperationMetadataDescriptor",id:5},lastOperationId:{type:"string",id:6},lastOperationAcceptedAt:{type:"string",id:7}}}},6148:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t){super(),this.lastDocumentSession=e,this.currentDocumentSession=t}get data(){var e,t,n,r,o;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(o=this.currentDocumentSession)||void 0===o?void 0:o.lastOperationId}}toJSON(){var e,t,n,r,o;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(o=this.currentDocumentSession)||void 0===o?void 0:o.lastOperationId}}static fromJSON(e){const t=e.lastDocumentSessionId?{id:e.lastDocumentSessionId,lastOperationId:e.lastDocumentSessionOperationId}:void 0,n=e.currentDocumentSessionId?{lastOperationId:e.currentDocumentSessionOperationId,version:e.currentDocumentSessionVersion,id:e.currentDocumentSessionId}:void 0;return new s(t,n)}}t.default=s,s.DESCRIPTOR_NAME="GetDocumentDetailsResponse",s.DESCRIPTOR={fields:{lastDocumentSessionId:{type:"string",id:1},lastDocumentSessionOperationId:{type:"string",id:2},currentDocumentSessionId:{type:"string",id:3},currentDocumentSessionVersion:{type:"uint32",id:4},currentDocumentSessionOperationId:{type:"string",id:5}}}},6042:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const a=n(2209),c=i(n(3596)),u=i(n(5420)),d=i(n(2280)),l=i(n(6376)),p=i(n(7608)),h=i(n(6178)),f=i(n(5711)),m=i(n(7955)),y=i(n(939)),g=i(n(6523)),b=i(n(1926)),O=i(n(7952)),v=s(n(7158)),w=i(n(357)),x=i(n(7026)),_=i(n(6314)),I=i(n(8801)),S=i(n(5373)),P=i(n(7073)),T=i(n(3118)),A=i(n(8742)),k=i(n(4396)),C=i(n(2282));t._SERVICE=9;class j{constructor(e){this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==v.WEB_SOCKET_GATEWAY_STATES.CONNECTED)throw new w.default("WebSocket Gateway is not connected.",e);const n=new l.default(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const r=await e._sendRequest(t._SERVICE,l.default.TYPE,c.default.encode(n)),{channel:o,threads:s}=c.default.decode(r,p.default);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:v.default._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,o),this._isConnected=!0,this.fire("connected"),s}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._connectedSessions&&(this._connectedSessions.disconnect(),this._connectedSessions=void 0),this.fire("disconnected"),this.stopListening())}async addComment(e,t,n,r){const o=new u.default(this._documentId,e,n,t,void 0,void 0,r),s=await this._sendRequest(u.default.TYPE,o);return c.default.decode(s,d.default)}async updateComment(e,t,n,r){const o=void 0!==r,s=new m.default(this._documentId,e,t,n,r,o);await this._sendRequest(m.default.TYPE,s)}async removeComment(e,t){const n=new h.default(this._documentId,e,t);await this._sendRequest(h.default.TYPE,n)}async removeCommentThread(e){const t=new f.default(this._documentId,e);await this._sendRequest(f.default.TYPE,t)}async addCommentThread(e){var t;const n=new P.default(this._documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>({...t,documentId:this._documentId,commentThreadId:e.commentThreadId}))),e.context,e.resolvedBy,e.createdAt,e.resolvedAt,e.deletedAt,e.attributes),r=await this._sendRequest(P.default.TYPE,n);return c.default.decode(r,S.default)}async resolveCommentThread(e){const t=new T.default(e,this._documentId),n=await this._sendRequest(T.default.TYPE,t);return c.default.decode(n,C.default)}async reopenCommentThread(e){const t=new A.default(e,this._documentId);await this._sendRequest(A.default.TYPE,t)}async updateCommentThread(e){const t=new k.default(e.commentThreadId,this._documentId,e.context,e.attributes);await this._sendRequest(k.default.TYPE,t)}async getCommentThread(e,t=1){const n=new y.default(e,this._documentId);try{const e=await this._sendRequest(y.default.TYPE,n),t=c.default.decode(e,g.default);return{commentThreadId:t.commentThreadId,comments:t.comments,attributes:t.attributes,context:t.context,resolvedAt:t.resolvedAt,resolvedBy:t.resolvedBy,deletedAt:t.deletedAt}}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&t<5)return await(r=100*t,new Promise((e=>{setTimeout(e,r)}))),this.getCommentThread(e,t+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw I.default.fromPublicError(n)}var r}async getDocumentThreads(){const e=new b.default(this._documentId),t=await this._sendRequest(b.default.TYPE,e),{threads:n}=c.default.decode(t,O.default);return{threads:n}}async getConnectedSessions(){if(!this._isConnected)throw new _.default("Comments",this);return this._connectedSessions||(this._connectedSessions=await x.default.getConnectedSessions(this._wsGateway,this._documentId,t._SERVICE)),this._connectedSessions}_connectToChannel(e,t){this._channel=e._getChannel(j._SERVICE,t),this._channel&&(this.listenTo(this._channel,this._channel.getEventName(u.default.TYPE),((e,t)=>{const n=c.default.decode(t,u.default);this.fire("commentAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(h.default.TYPE),((e,t)=>{const n=c.default.decode(t,h.default);this.fire("commentRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(m.default.TYPE),((e,t)=>{const n=c.default.decode(t,m.default);this.fire("commentUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(f.default.TYPE),((e,t)=>{const n=c.default.decode(t,f.default);this.fire("commentThreadRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(P.default.TYPE),((e,t)=>{const n=c.default.decode(t,P.default);this.fire("commentThreadAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(k.default.TYPE),((e,t)=>{const n=c.default.decode(t,k.default);this.fire("commentThreadUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(T.default.TYPE),((e,t)=>{const n=c.default.decode(t,T.default);this.fire("commentThreadResolved",n)})),this.listenTo(this._channel,this._channel.getEventName(A.default.TYPE),((e,t)=>{const n=c.default.decode(t,A.default);this.fire("commentThreadReopened",n)})))}_onWsGatewayStateChange(e){e===v.WEB_SOCKET_GATEWAY_STATES.DISCONNECTED&&this.disconnect()}_sendRequest(e,n){if(!this._wsGateway||!this._isConnected)throw new _.default("Comments",this);return this._wsGateway._sendRequest(t._SERVICE,e,c.default.encode(n))}}j._SERVICE=t._SERVICE,(0,a.mix)(j,a.EmitterMixin),t.default=j},2529:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(5945));class s extends o.default{static toJSON(e){var t;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null}}static fromJSON(e){return{...e,createdAt:new Date(e.createdAt),attributes:e.attributes?JSON.parse(e.attributes):null}}}t.default=s,s.DESCRIPTOR_NAME="CommentDescriptor",s.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},commentThreadId:{id:2,type:"string"},userId:{id:3,type:"string"},content:{id:4,type:"string"},documentId:{id:5,type:"string"},createdAt:{id:6,type:"string"},attributes:{id:7,type:"string"}}}},1578:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(5945)),s=r(n(2529));class i extends o.default{static toJSON(e){var t,n,r,o;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),deletedAt:null===(n=e.deletedAt)||void 0===n?void 0:n.toISOString(),resolvedAt:null===(r=e.resolvedAt)||void 0===r?void 0:r.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null,context:e.context?JSON.stringify(e.context):e.context,comments:null===(o=e.comments)||void 0===o?void 0:o.map(s.default.toJSON)}}static fromJSON(e){var t;return{...e,createdAt:e.createdAt?new Date(e.createdAt):void 0,deletedAt:e.deletedAt?new Date(e.deletedAt):void 0,resolvedAt:e.resolvedAt?new Date(e.resolvedAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):null,context:e.context?JSON.parse(e.context):void 0,comments:null===(t=e.comments)||void 0===t?void 0:t.map(s.default.fromJSON)}}}t.default=i,i.DESCRIPTOR_NAME="CommentsThreadDescriptor",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},comments:{type:"CommentDescriptor",rule:"repeated",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4},context:{type:"string",id:5},createdAt:{type:"string",id:6},deletedAt:{type:"string",id:7},attributes:{type:"string",id:8}}}},309:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(5945));class s extends o.default{static toJSON(e){var t;return{commentId:e.commentId,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{commentId:e.commentId,createdAt:new Date(e.createdAt)}}}t.default=s,s.DESCRIPTOR_NAME="CommentThreadAddedCommentDescriptor",s.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},createdAt:{id:2,type:"string"}}}},5420:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(1578));class i extends o.default{constructor(e,t,n,r="",o,s="",i=null,a){super(),this.documentId=e,this.commentThreadId=t,this.content=n,this.commentId=r,this.userId=s,this.attributes=i,this.commentThread=a,this.createdAt=o?new Date(o):""}toJSON(){return{commentThreadId:this.commentThreadId,content:this.content,documentId:this.documentId,commentId:this.commentId,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,userId:this.userId,attributes:JSON.stringify(this.attributes),commentThread:this.commentThread?s.default.toJSON(this.commentThread):void 0}}static fromJSON(e){return new i(e.documentId,e.commentThreadId,e.content,e.commentId?e.commentId:void 0,e.createdAt?new Date(e.createdAt):void 0,e.userId?e.userId:void 0,e.attributes?JSON.parse(e.attributes):{},e.commentThread?s.default.fromJSON(e.commentThread):void 0)}}t.default=i,i.TYPE="91",i.READABLE_TYPE_NAME="addComment",i.DESCRIPTOR_NAME="CommentsV2AddCommentMessage",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},content:{type:"string",id:2},documentId:{type:"string",id:3},commentId:{type:"string",id:4},createdAt:{type:"string",id:5},userId:{type:"string",id:6},attributes:{type:"string",id:7},commentThread:{type:"CommentsThreadDescriptor",id:8}}}},7073:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(2529));class i extends o.default{constructor(e,t,n=[],r,o=null,s=null,i=null,a=null,c=null){super(),this.documentId=e,this.commentThreadId=t,this.comments=n,this.context=r,this.resolvedBy=o,this.attributes=c,this.createdAt=s?new Date(s):"",this.resolvedAt=i?new Date(i):"",this.deletedAt=a?new Date(a):""}toJSON(){var e;return{commentThreadId:this.commentThreadId,context:this.context?JSON.stringify(this.context):this.context,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt instanceof Date?this.resolvedAt.toISOString():this.resolvedAt,deletedAt:this.deletedAt instanceof Date?this.deletedAt.toISOString():this.deletedAt,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,comments:null===(e=this.comments)||void 0===e?void 0:e.map((e=>s.default.toJSON(e)))}}static fromJSON(e){var t;return new i(e.documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>s.default.fromJSON({...t,documentId:e.documentId,commentThreadId:e.commentThreadId}))),e.context?JSON.parse(e.context):e.context,e.resolvedBy,e.createdAt?new Date(e.createdAt):void 0,e.resolvedAt?new Date(e.resolvedAt):void 0,e.deletedAt?new Date(e.deletedAt):void 0,e.attributes?JSON.parse(e.attributes):e.attributes)}}t.default=i,i.TYPE="140",i.READABLE_TYPE_NAME="addCommentThread",i.DESCRIPTOR_NAME="CommentsV2AddCommentThreadMessage",i.DESCRIPTOR={fields:{documentId:{type:"string",id:1},commentThreadId:{type:"string",id:2},context:{type:"string",id:3},createdAt:{type:"string",id:4},resolvedAt:{type:"string",id:5},resolvedBy:{type:"string",id:6},attributes:{type:"string",id:7},deletedAt:{type:"string",id:8},comments:{type:"CommentDescriptor",rule:"repeated",id:9}}}},8742:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new s(e.commentThreadId,e.documentId)}}t.default=s,s.TYPE="141",s.READABLE_TYPE_NAME="reopenCommentThread",s.DESCRIPTOR_NAME="CommentsV2ReopenCommentThreadMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}}},3118:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=r?new Date(r):void 0}toJSON(){var e;return{documentId:this.documentId,commentThreadId:this.commentThreadId,resolvedBy:this.resolvedBy,resolvedAt:null===(e=this.resolvedAt)||void 0===e?void 0:e.toISOString()}}static fromJSON(e){return new s(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}t.default=s,s.TYPE="142",s.READABLE_TYPE_NAME="resolveCommentThread",s.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedBy:{type:"string",id:3},resolvedAt:{type:"string",id:4}}}},4396:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r=null){super(),this.commentThreadId=e,this.documentId=t,this.context=n,this.attributes=r}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,context:this.context?JSON.stringify(this.context):this.context,attributes:this.attributes?JSON.stringify(this.attributes):null}}static fromJSON(e){return new s(e.commentThreadId,e.documentId,e.context?JSON.parse(e.context):e.context,e.attributes?JSON.parse(e.attributes):null)}}t.default=s,s.TYPE="143",s.READABLE_TYPE_NAME="updateCommentThread",s.DESCRIPTOR_NAME="CommentsV2UpdateCommentThreadMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},context:{type:"string",id:3},attributes:{type:"string",id:4}}}},6376:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="92",s.READABLE_TYPE_NAME="connectToComment",s.DESCRIPTOR_NAME="CommentsV2ConnectMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},939:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId}}static fromJSON(e){return new s(e.commentThreadId,e.documentId)}}t.default=s,s.TYPE="93",s.READABLE_TYPE_NAME="getComment",s.DESCRIPTOR_NAME="CommentsV2GetCommentThreadMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}}},1926:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="94",s.READABLE_TYPE_NAME="getDocumentThreads",s.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},6178:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n){super(),this.documentId=e,this.commentThreadId=t,this.commentId=n}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,commentId:this.commentId}}static fromJSON(e){return new s(e.documentId,e.commentThreadId,e.commentId)}}t.default=s,s.TYPE="95",s.READABLE_TYPE_NAME="removeComment",s.DESCRIPTOR_NAME="CommentsV2RemoveCommentMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},documentId:{type:"string",id:3}}}},5711:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t){super(),this.documentId=e,this.commentThreadId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new s(e.documentId,e.commentThreadId)}}t.default=s,s.TYPE="97",s.READABLE_TYPE_NAME="removeCommentThread",s.DESCRIPTOR_NAME="CommentsV2RemoveCommentThreadMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}}},7955:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(1578));class i extends o.default{constructor(e,t,n,r,o=null,s=!1,i){super(),this.documentId=e,this.commentThreadId=t,this.commentId=n,this.content=r,this.attributes=o,this.isAttributesUpdated=s,this.commentThread=i}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,commentId:this.commentId,content:this.content,attributes:this.attributes?JSON.stringify(this.attributes):null,isAttributesUpdated:this.isAttributesUpdated,commentThread:this.commentThread?s.default.toJSON(this.commentThread):void 0}}static fromJSON(e){return new i(e.documentId,e.commentThreadId,e.commentId,e.content,e.attributes?JSON.parse(e.attributes):null,e.isAttributesUpdated,e.commentThread?s.default.fromJSON(e.commentThread):void 0)}}t.default=i,i.TYPE="96",i.READABLE_TYPE_NAME="updateComment",i.DESCRIPTOR_NAME="CommentsV2UpdateCommentMessage",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},content:{type:"string",id:3},documentId:{type:"string",id:4},attributes:{type:"string",id:5},isAttributesUpdated:{type:"bool",id:6},commentThread:{type:"CommentsThreadDescriptor",id:7}}}},2280:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n){super(),this.commentThreadId=e,this.commentId=t,this.createdAt=new Date(n)}toJSON(){return{commentThreadId:this.commentThreadId,commentId:this.commentId,createdAt:this.createdAt.toISOString()}}static fromJSON(e){return new s(e.commentThreadId,e.commentId,e.createdAt)}}t.default=s,s.DESCRIPTOR_NAME="CommentsV2AddCommentResponse",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},createdAt:{type:"string",id:3}}}},5373:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(309));class i extends o.default{constructor(e,t,n=[]){super(),this.commentThreadId=e,this.comments=n,this.createdAt=new Date(t)}toJSON(){return{commentThreadId:this.commentThreadId,createdAt:this.createdAt.toISOString(),comments:this.comments.map((e=>s.default.toJSON(e)))}}static fromJSON(e){return new i(e.commentThreadId,e.createdAt,e.comments.map((e=>s.default.fromJSON(e))))}}t.default=i,i.DESCRIPTOR_NAME="CommentsV2AddCommentThreadResponse",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},createdAt:{type:"string",id:2},comments:{type:"CommentThreadAddedCommentDescriptor",rule:"repeated",id:3}}}},2282:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=new Date(r)}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt.toISOString()}}static fromJSON(e){return new s(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}t.default=s,s.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadResponse",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4}}}},7608:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(1578));class i extends o.default{constructor(e,t,n){super(),this.channel=e,this._threads=t,this._threadsV2=n,this.threads=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(s.default.toJSON)}}static fromJSON(e){var t,n;return new i(e.channel,null===(t=e.threads)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(s.default.fromJSON))}}t.default=i,i.DESCRIPTOR_NAME="CommentsV2ConnectResponse",i.DESCRIPTOR={fields:{channel:{type:"string",id:1},threads:{type:"string",rule:"repeated",id:2},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:3}}}},6523:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(2529));class i extends o.default{constructor(e,t,n,r,o,s,i,a,c){super(),this.commentThreadId=e,this._comments=t,this._commentsV2=n,this.resolvedBy=o,this.comments=(null==n?void 0:n.length)?n:t,this.createdAt=i?new Date(i):void 0,this.deletedAt="string"==typeof a?new Date(a):a,this.resolvedAt="string"==typeof c?new Date(c):c,this.attributes="string"==typeof r?JSON.parse(r):r,this.context="string"==typeof s?JSON.parse(s):s}toJSON(){var e,t,n,r,o;return{commentThreadId:this.commentThreadId,comments:null===(e=this._comments)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),commentsV2:null===(t=this._commentsV2)||void 0===t?void 0:t.map(s.default.toJSON),attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,context:this.context?JSON.stringify(this.context):this.context,resolvedBy:this.resolvedBy,createdAt:null===(n=this.createdAt)||void 0===n?void 0:n.toISOString(),deletedAt:null===(r=this.deletedAt)||void 0===r?void 0:r.toISOString(),resolvedAt:null===(o=this.resolvedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(e){var t,n;return new i(e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((e=>function(e){const t=JSON.parse(e);return{...t,createdAt:new Date(t.createdAt)}}(e))),null===(n=e.commentsV2)||void 0===n?void 0:n.map(s.default.fromJSON),e.attributes?JSON.parse(e.attributes):e.attributes,e.resolvedBy,e.context?JSON.parse(e.context):e.context,e.createdAt,e.deletedAt,e.resolvedAt)}}t.default=i,i.DESCRIPTOR_NAME="CommentsV2GetCommentThreadResponse",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},comments:{type:"string",rule:"repeated",id:2},commentsV2:{type:"CommentDescriptor",rule:"repeated",id:3},resolvedAt:{type:"string",id:4},resolvedBy:{type:"string",id:5},context:{type:"string",id:6},createdAt:{type:"string",id:7},deletedAt:{type:"string",id:8},attributes:{type:"string",id:9}}}},7952:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(1578));class i extends o.default{constructor(e,t){super(),this._threads=e,this._threadsV2=t,this.threads=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(s.default.toJSON)}}static fromJSON(e){var t,n;return new i(null===(t=e.threads)||void 0===t?void 0:t.map((e=>function(e){var t;const n=JSON.parse(e),r={...n};return n.comments&&(r.comments=null===(t=n.comments)||void 0===t?void 0:t.map((e=>({...e,createdAt:new Date(e.createdAt)})))),r}(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(s.default.fromJSON))}}t.default=i,i.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsResponse",i.DESCRIPTOR={fields:{threads:{type:"string",rule:"repeated",id:1},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:2}}}},6398:(e,t,n)=>{var r,o,s,i;i=function(e){"use strict";var t=e.Reader,n=e.Writer,r=e.util,o=e.roots.default||(e.roots.default={});return o.OperationMetadataDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.userId="",s.prototype.type="",s.prototype.createdAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(18).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(26).string(e.createdAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.OperationMetadataDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.userId=e.string();break;case 2:s.type=e.string();break;case 3:s.createdAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.userId&&e.hasOwnProperty("userId")&&!r.isString(e.userId)?"userId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null},s.fromObject=function(e){if(e instanceof o.OperationMetadataDescriptor)return e;var t=new o.OperationMetadataDescriptor;return null!=e.userId&&(t.userId=String(e.userId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.userId="",n.type="",n.createdAt=""),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/OperationMetadataDescriptor"},s}(),o.CollaborativeEditingConnectMessage=function(){function s(e){if(this.buffers=[],this.types=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.bundleVersion="",s.prototype.buffers=r.emptyArray,s.prototype.types=r.emptyArray,s.prototype.lastOperationId="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(18).string(e.bundleVersion),null!=e.buffers&&e.buffers.length)for(var r=0;r<e.buffers.length;++r)t.uint32(26).bytes(e.buffers[r]);if(null!=e.types&&e.types.length){for(t.uint32(34).fork(),r=0;r<e.types.length;++r)t.uint32(e.types[r]);t.ldelim()}return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(42).string(e.lastOperationId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CollaborativeEditingConnectMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.bundleVersion=e.string();break;case 3:s.buffers&&s.buffers.length||(s.buffers=[]),s.buffers.push(e.bytes());break;case 4:if(s.types&&s.types.length||(s.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)s.types.push(e.uint32());else s.types.push(e.uint32());break;case 5:s.lastOperationId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id))return"id: string expected";if(null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!r.isString(e.bundleVersion))return"bundleVersion: string expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||r.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(t=0;t<e.types.length;++t)if(!r.isInteger(e.types[t]))return"types: integer[] expected"}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!r.isString(e.lastOperationId)?"lastOperationId: string expected":null},s.fromObject=function(e){if(e instanceof o.CollaborativeEditingConnectMessage)return e;var t=new o.CollaborativeEditingConnectMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingConnectMessage.buffers: array expected");t.buffers=[];for(var n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?r.base64.decode(e.buffers[n],t.buffers[n]=r.newBuffer(r.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectMessage.types: array expected");for(t.types=[],n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[]),t.defaults&&(n.id="",n.bundleVersion="",n.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),e.buffers&&e.buffers.length){n.buffers=[];for(var o=0;o<e.buffers.length;++o)n.buffers[o]=t.bytes===String?r.base64.encode(e.buffers[o],0,e.buffers[o].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[o]):e.buffers[o]}if(e.types&&e.types.length)for(n.types=[],o=0;o<e.types.length;++o)n.types[o]=e.types[o];return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectMessage"},s}(),o.CollaborativeEditingReconnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.bundleVersion="",s.prototype.lastKnowVersion=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(18).string(e.bundleVersion),null!=e.lastKnowVersion&&Object.hasOwnProperty.call(e,"lastKnowVersion")&&t.uint32(24).uint32(e.lastKnowVersion),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CollaborativeEditingReconnectMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.bundleVersion=e.string();break;case 3:s.lastKnowVersion=e.uint32();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!r.isString(e.bundleVersion)?"bundleVersion: string expected":null!=e.lastKnowVersion&&e.hasOwnProperty("lastKnowVersion")&&!r.isInteger(e.lastKnowVersion)?"lastKnowVersion: integer expected":null},s.fromObject=function(e){if(e instanceof o.CollaborativeEditingReconnectMessage)return e;var t=new o.CollaborativeEditingReconnectMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),null!=e.lastKnowVersion&&(t.lastKnowVersion=e.lastKnowVersion>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.bundleVersion="",n.lastKnowVersion=0),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),null!=e.lastKnowVersion&&e.hasOwnProperty("lastKnowVersion")&&(n.lastKnowVersion=e.lastKnowVersion),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingReconnectMessage"},s}(),o.CollaborativeEditingUpdateMessage=function(){function s(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.baseVersion=0,s.prototype.buffers=r.emptyArray,s.prototype.types=r.emptyArray,s.prototype.metadata=r.emptyArray,s.prototype.lastOperationId="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.baseVersion&&Object.hasOwnProperty.call(e,"baseVersion")&&t.uint32(16).uint32(e.baseVersion),null!=e.buffers&&e.buffers.length)for(var r=0;r<e.buffers.length;++r)t.uint32(26).bytes(e.buffers[r]);if(null!=e.types&&e.types.length){for(t.uint32(34).fork(),r=0;r<e.types.length;++r)t.uint32(e.types[r]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(r=0;r<e.metadata.length;++r)o.OperationMetadataDescriptor.encode(e.metadata[r],t.uint32(50).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(58).string(e.lastOperationId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CollaborativeEditingUpdateMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.baseVersion=e.uint32();break;case 3:s.buffers&&s.buffers.length||(s.buffers=[]),s.buffers.push(e.bytes());break;case 4:if(s.types&&s.types.length||(s.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)s.types.push(e.uint32());else s.types.push(e.uint32());break;case 6:s.metadata&&s.metadata.length||(s.metadata=[]),s.metadata.push(o.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 7:s.lastOperationId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id))return"id: string expected";if(null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&!r.isInteger(e.baseVersion))return"baseVersion: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||r.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(t=0;t<e.types.length;++t)if(!r.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(t=0;t<e.metadata.length;++t){var n=o.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!r.isString(e.lastOperationId)?"lastOperationId: string expected":null},s.fromObject=function(e){if(e instanceof o.CollaborativeEditingUpdateMessage)return e;var t=new o.CollaborativeEditingUpdateMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.baseVersion&&(t.baseVersion=e.baseVersion>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingUpdateMessage.buffers: array expected");t.buffers=[];for(var n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?r.base64.decode(e.buffers[n],t.buffers[n]=r.newBuffer(r.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingUpdateMessage.types: array expected");for(t.types=[],n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingUpdateMessage.metadata: array expected");for(t.metadata=[],n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingUpdateMessage.metadata: object expected");t.metadata[n]=o.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.id="",n.baseVersion=0,n.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&(n.baseVersion=e.baseVersion),e.buffers&&e.buffers.length){n.buffers=[];for(var s=0;s<e.buffers.length;++s)n.buffers[s]=t.bytes===String?r.base64.encode(e.buffers[s],0,e.buffers[s].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[s]):e.buffers[s]}if(e.types&&e.types.length)for(n.types=[],s=0;s<e.types.length;++s)n.types[s]=e.types[s];if(e.metadata&&e.metadata.length)for(n.metadata=[],s=0;s<e.metadata.length;++s)n.metadata[s]=o.OperationMetadataDescriptor.toObject(e.metadata[s],t);return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingUpdateMessage"},s}(),o.GetDocumentDetailsMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.environmentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.environmentId&&Object.hasOwnProperty.call(e,"environmentId")&&t.uint32(18).string(e.environmentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetDocumentDetailsMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.documentId=e.string();break;case 2:s.environmentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.environmentId&&e.hasOwnProperty("environmentId")&&!r.isString(e.environmentId)?"environmentId: string expected":null},s.fromObject=function(e){if(e instanceof o.GetDocumentDetailsMessage)return e;var t=new o.GetDocumentDetailsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.environmentId&&(t.environmentId=String(e.environmentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId="",n.environmentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.environmentId&&e.hasOwnProperty("environmentId")&&(n.environmentId=e.environmentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsMessage"},s}(),o.CollaborativeEditingConnectResponse=function(){function s(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.offset=0,s.prototype.version=0,s.prototype.buffers=r.emptyArray,s.prototype.types=r.emptyArray,s.prototype.metadata=r.emptyArray,s.prototype.initData="",s.prototype.isInitialized=!1,s.prototype.sessionId="",s.prototype.lastOperationId="",s.prototype.sessionCreatedAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.offset&&Object.hasOwnProperty.call(e,"offset")&&t.uint32(16).uint32(e.offset),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(24).uint32(e.version),null!=e.buffers&&e.buffers.length)for(var r=0;r<e.buffers.length;++r)t.uint32(34).bytes(e.buffers[r]);if(null!=e.types&&e.types.length){for(t.uint32(42).fork(),r=0;r<e.types.length;++r)t.uint32(e.types[r]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(r=0;r<e.metadata.length;++r)o.OperationMetadataDescriptor.encode(e.metadata[r],t.uint32(58).fork()).ldelim();return null!=e.initData&&Object.hasOwnProperty.call(e,"initData")&&t.uint32(66).string(e.initData),null!=e.isInitialized&&Object.hasOwnProperty.call(e,"isInitialized")&&t.uint32(72).bool(e.isInitialized),null!=e.sessionId&&Object.hasOwnProperty.call(e,"sessionId")&&t.uint32(82).string(e.sessionId),null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(90).string(e.lastOperationId),null!=e.sessionCreatedAt&&Object.hasOwnProperty.call(e,"sessionCreatedAt")&&t.uint32(98).string(e.sessionCreatedAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CollaborativeEditingConnectResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.channel=e.string();break;case 2:s.offset=e.uint32();break;case 3:s.version=e.uint32();break;case 4:s.buffers&&s.buffers.length||(s.buffers=[]),s.buffers.push(e.bytes());break;case 5:if(s.types&&s.types.length||(s.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)s.types.push(e.uint32());else s.types.push(e.uint32());break;case 7:s.metadata&&s.metadata.length||(s.metadata=[]),s.metadata.push(o.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 8:s.initData=e.string();break;case 9:s.isInitialized=e.bool();break;case 10:s.sessionId=e.string();break;case 11:s.lastOperationId=e.string();break;case 12:s.sessionCreatedAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!r.isString(e.channel))return"channel: string expected";if(null!=e.offset&&e.hasOwnProperty("offset")&&!r.isInteger(e.offset))return"offset: integer expected";if(null!=e.version&&e.hasOwnProperty("version")&&!r.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||r.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(t=0;t<e.types.length;++t)if(!r.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(t=0;t<e.metadata.length;++t){var n=o.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.initData&&e.hasOwnProperty("initData")&&!r.isString(e.initData)?"initData: string expected":null!=e.isInitialized&&e.hasOwnProperty("isInitialized")&&"boolean"!=typeof e.isInitialized?"isInitialized: boolean expected":null!=e.sessionId&&e.hasOwnProperty("sessionId")&&!r.isString(e.sessionId)?"sessionId: string expected":null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!r.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&!r.isString(e.sessionCreatedAt)?"sessionCreatedAt: string expected":null},s.fromObject=function(e){if(e instanceof o.CollaborativeEditingConnectResponse)return e;var t=new o.CollaborativeEditingConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),null!=e.offset&&(t.offset=e.offset>>>0),null!=e.version&&(t.version=e.version>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingConnectResponse.buffers: array expected");t.buffers=[];for(var n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?r.base64.decode(e.buffers[n],t.buffers[n]=r.newBuffer(r.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectResponse.types: array expected");for(t.types=[],n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingConnectResponse.metadata: array expected");for(t.metadata=[],n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingConnectResponse.metadata: object expected");t.metadata[n]=o.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.initData&&(t.initData=String(e.initData)),null!=e.isInitialized&&(t.isInitialized=Boolean(e.isInitialized)),null!=e.sessionId&&(t.sessionId=String(e.sessionId)),null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),null!=e.sessionCreatedAt&&(t.sessionCreatedAt=String(e.sessionCreatedAt)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.channel="",n.offset=0,n.version=0,n.initData="",n.isInitialized=!1,n.sessionId="",n.lastOperationId="",n.sessionCreatedAt=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),null!=e.offset&&e.hasOwnProperty("offset")&&(n.offset=e.offset),null!=e.version&&e.hasOwnProperty("version")&&(n.version=e.version),e.buffers&&e.buffers.length){n.buffers=[];for(var s=0;s<e.buffers.length;++s)n.buffers[s]=t.bytes===String?r.base64.encode(e.buffers[s],0,e.buffers[s].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[s]):e.buffers[s]}if(e.types&&e.types.length)for(n.types=[],s=0;s<e.types.length;++s)n.types[s]=e.types[s];if(e.metadata&&e.metadata.length)for(n.metadata=[],s=0;s<e.metadata.length;++s)n.metadata[s]=o.OperationMetadataDescriptor.toObject(e.metadata[s],t);return null!=e.initData&&e.hasOwnProperty("initData")&&(n.initData=e.initData),null!=e.isInitialized&&e.hasOwnProperty("isInitialized")&&(n.isInitialized=e.isInitialized),null!=e.sessionId&&e.hasOwnProperty("sessionId")&&(n.sessionId=e.sessionId),null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&(n.sessionCreatedAt=e.sessionCreatedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectResponse"},s}(),o.CollaborativeEditingResponse=function(){function s(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.version=0,s.prototype.buffers=r.emptyArray,s.prototype.types=r.emptyArray,s.prototype.metadata=r.emptyArray,s.prototype.lastOperationId="",s.prototype.lastOperationAcceptedAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(8).uint32(e.version),null!=e.buffers&&e.buffers.length)for(var r=0;r<e.buffers.length;++r)t.uint32(18).bytes(e.buffers[r]);if(null!=e.types&&e.types.length){for(t.uint32(26).fork(),r=0;r<e.types.length;++r)t.uint32(e.types[r]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(r=0;r<e.metadata.length;++r)o.OperationMetadataDescriptor.encode(e.metadata[r],t.uint32(42).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(50).string(e.lastOperationId),null!=e.lastOperationAcceptedAt&&Object.hasOwnProperty.call(e,"lastOperationAcceptedAt")&&t.uint32(58).string(e.lastOperationAcceptedAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CollaborativeEditingResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.version=e.uint32();break;case 2:s.buffers&&s.buffers.length||(s.buffers=[]),s.buffers.push(e.bytes());break;case 3:if(s.types&&s.types.length||(s.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)s.types.push(e.uint32());else s.types.push(e.uint32());break;case 5:s.metadata&&s.metadata.length||(s.metadata=[]),s.metadata.push(o.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 6:s.lastOperationId=e.string();break;case 7:s.lastOperationAcceptedAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.version&&e.hasOwnProperty("version")&&!r.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||r.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(t=0;t<e.types.length;++t)if(!r.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(t=0;t<e.metadata.length;++t){var n=o.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!r.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&!r.isString(e.lastOperationAcceptedAt)?"lastOperationAcceptedAt: string expected":null},s.fromObject=function(e){if(e instanceof o.CollaborativeEditingResponse)return e;var t=new o.CollaborativeEditingResponse;if(null!=e.version&&(t.version=e.version>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingResponse.buffers: array expected");t.buffers=[];for(var n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?r.base64.decode(e.buffers[n],t.buffers[n]=r.newBuffer(r.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingResponse.types: array expected");for(t.types=[],n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingResponse.metadata: array expected");for(t.metadata=[],n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingResponse.metadata: object expected");t.metadata[n]=o.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),null!=e.lastOperationAcceptedAt&&(t.lastOperationAcceptedAt=String(e.lastOperationAcceptedAt)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.version=0,n.lastOperationId="",n.lastOperationAcceptedAt=""),null!=e.version&&e.hasOwnProperty("version")&&(n.version=e.version),e.buffers&&e.buffers.length){n.buffers=[];for(var s=0;s<e.buffers.length;++s)n.buffers[s]=t.bytes===String?r.base64.encode(e.buffers[s],0,e.buffers[s].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[s]):e.buffers[s]}if(e.types&&e.types.length)for(n.types=[],s=0;s<e.types.length;++s)n.types[s]=e.types[s];if(e.metadata&&e.metadata.length)for(n.metadata=[],s=0;s<e.metadata.length;++s)n.metadata[s]=o.OperationMetadataDescriptor.toObject(e.metadata[s],t);return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&(n.lastOperationAcceptedAt=e.lastOperationAcceptedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingResponse"},s}(),o.GetDocumentDetailsResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.lastDocumentSessionId="",s.prototype.lastDocumentSessionOperationId="",s.prototype.currentDocumentSessionId="",s.prototype.currentDocumentSessionVersion=0,s.prototype.currentDocumentSessionOperationId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.lastDocumentSessionId&&Object.hasOwnProperty.call(e,"lastDocumentSessionId")&&t.uint32(10).string(e.lastDocumentSessionId),null!=e.lastDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"lastDocumentSessionOperationId")&&t.uint32(18).string(e.lastDocumentSessionOperationId),null!=e.currentDocumentSessionId&&Object.hasOwnProperty.call(e,"currentDocumentSessionId")&&t.uint32(26).string(e.currentDocumentSessionId),null!=e.currentDocumentSessionVersion&&Object.hasOwnProperty.call(e,"currentDocumentSessionVersion")&&t.uint32(32).uint32(e.currentDocumentSessionVersion),null!=e.currentDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"currentDocumentSessionOperationId")&&t.uint32(42).string(e.currentDocumentSessionOperationId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetDocumentDetailsResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.lastDocumentSessionId=e.string();break;case 2:s.lastDocumentSessionOperationId=e.string();break;case 3:s.currentDocumentSessionId=e.string();break;case 4:s.currentDocumentSessionVersion=e.uint32();break;case 5:s.currentDocumentSessionOperationId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.lastDocumentSessionId&&e.hasOwnProperty("lastDocumentSessionId")&&!r.isString(e.lastDocumentSessionId)?"lastDocumentSessionId: string expected":null!=e.lastDocumentSessionOperationId&&e.hasOwnProperty("lastDocumentSessionOperationId")&&!r.isString(e.lastDocumentSessionOperationId)?"lastDocumentSessionOperationId: string expected":null!=e.currentDocumentSessionId&&e.hasOwnProperty("currentDocumentSessionId")&&!r.isString(e.currentDocumentSessionId)?"currentDocumentSessionId: string expected":null!=e.currentDocumentSessionVersion&&e.hasOwnProperty("currentDocumentSessionVersion")&&!r.isInteger(e.currentDocumentSessionVersion)?"currentDocumentSessionVersion: integer expected":null!=e.currentDocumentSessionOperationId&&e.hasOwnProperty("currentDocumentSessionOperationId")&&!r.isString(e.currentDocumentSessionOperationId)?"currentDocumentSessionOperationId: string expected":null},s.fromObject=function(e){if(e instanceof o.GetDocumentDetailsResponse)return e;var t=new o.GetDocumentDetailsResponse;return null!=e.lastDocumentSessionId&&(t.lastDocumentSessionId=String(e.lastDocumentSessionId)),null!=e.lastDocumentSessionOperationId&&(t.lastDocumentSessionOperationId=String(e.lastDocumentSessionOperationId)),null!=e.currentDocumentSessionId&&(t.currentDocumentSessionId=String(e.currentDocumentSessionId)),null!=e.currentDocumentSessionVersion&&(t.currentDocumentSessionVersion=e.currentDocumentSessionVersion>>>0),null!=e.currentDocumentSessionOperationId&&(t.currentDocumentSessionOperationId=String(e.currentDocumentSessionOperationId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.lastDocumentSessionId="",n.lastDocumentSessionOperationId="",n.currentDocumentSessionId="",n.currentDocumentSessionVersion=0,n.currentDocumentSessionOperationId=""),null!=e.lastDocumentSessionId&&e.hasOwnProperty("lastDocumentSessionId")&&(n.lastDocumentSessionId=e.lastDocumentSessionId),null!=e.lastDocumentSessionOperationId&&e.hasOwnProperty("lastDocumentSessionOperationId")&&(n.lastDocumentSessionOperationId=e.lastDocumentSessionOperationId),null!=e.currentDocumentSessionId&&e.hasOwnProperty("currentDocumentSessionId")&&(n.currentDocumentSessionId=e.currentDocumentSessionId),null!=e.currentDocumentSessionVersion&&e.hasOwnProperty("currentDocumentSessionVersion")&&(n.currentDocumentSessionVersion=e.currentDocumentSessionVersion),null!=e.currentDocumentSessionOperationId&&e.hasOwnProperty("currentDocumentSessionOperationId")&&(n.currentDocumentSessionOperationId=e.currentDocumentSessionOperationId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsResponse"},s}(),o.CommentDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentId="",s.prototype.commentThreadId="",s.prototype.userId="",s.prototype.content="",s.prototype.documentId="",s.prototype.createdAt="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(10).string(e.commentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(18).string(e.commentThreadId),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(26).string(e.userId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(34).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(42).string(e.documentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentId=e.string();break;case 2:s.commentThreadId=e.string();break;case 3:s.userId=e.string();break;case 4:s.content=e.string();break;case 5:s.documentId=e.string();break;case 6:s.createdAt=e.string();break;case 7:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId)?"commentId: string expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.userId&&e.hasOwnProperty("userId")&&!r.isString(e.userId)?"userId: string expected":null!=e.content&&e.hasOwnProperty("content")&&!r.isString(e.content)?"content: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentDescriptor)return e;var t=new o.CommentDescriptor;return null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentId="",n.commentThreadId="",n.userId="",n.content="",n.documentId="",n.createdAt="",n.attributes=""),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentDescriptor"},s}(),o.CommentsThreadDescriptor=function(){function s(e){if(this.comments=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.comments=r.emptyArray,s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.context="",s.prototype.createdAt="",s.prototype.deletedAt="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(var r=0;r<e.comments.length;++r)o.CommentDescriptor.encode(e.comments[r],t.uint32(18).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(34).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(42).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(58).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsThreadDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.comments&&s.comments.length||(s.comments=[]),s.comments.push(o.CommentDescriptor.decode(e,e.uint32()));break;case 3:s.resolvedAt=e.string();break;case 4:s.resolvedBy=e.string();break;case 5:s.context=e.string();break;case 6:s.createdAt=e.string();break;case 7:s.deletedAt=e.string();break;case 8:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t){var n=o.CommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!r.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!r.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!r.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!r.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsThreadDescriptor)return e;var t=new o.CommentsThreadDescriptor;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsThreadDescriptor.comments: array expected");t.comments=[];for(var n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsThreadDescriptor.comments: object expected");t.comments[n]=o.CommentDescriptor.fromObject(e.comments[n])}}return null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),e.comments&&e.comments.length){n.comments=[];for(var r=0;r<e.comments.length;++r)n.comments[r]=o.CommentDescriptor.toObject(e.comments[r],t)}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsThreadDescriptor"},s}(),o.CommentThreadAddedCommentDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentId="",s.prototype.createdAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(10).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(18).string(e.createdAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentThreadAddedCommentDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentId=e.string();break;case 2:s.createdAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentThreadAddedCommentDescriptor)return e;var t=new o.CommentThreadAddedCommentDescriptor;return null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentId="",n.createdAt=""),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentThreadAddedCommentDescriptor"},s}(),o.CommentsV2AddCommentMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.content="",s.prototype.documentId="",s.prototype.commentId="",s.prototype.createdAt="",s.prototype.userId="",s.prototype.attributes="",s.prototype.commentThread=null,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(18).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(26).string(e.documentId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(34).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(42).string(e.createdAt),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(50).string(e.userId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&o.CommentsThreadDescriptor.encode(e.commentThread,t.uint32(66).fork()).ldelim(),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2AddCommentMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.content=e.string();break;case 3:s.documentId=e.string();break;case 4:s.commentId=e.string();break;case 5:s.createdAt=e.string();break;case 6:s.userId=e.string();break;case 7:s.attributes=e.string();break;case 8:s.commentThread=o.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!r.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId))return"documentId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId))return"commentId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt))return"createdAt: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!r.isString(e.userId))return"userId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes))return"attributes: string expected";if(null!=e.commentThread&&e.hasOwnProperty("commentThread")){var t=o.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2AddCommentMessage)return e;var t=new o.CommentsV2AddCommentMessage;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.commentThread){if("object"!=typeof e.commentThread)throw TypeError(".CommentsV2AddCommentMessage.commentThread: object expected");t.commentThread=o.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.content="",n.documentId="",n.commentId="",n.createdAt="",n.userId="",n.attributes="",n.commentThread=null),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.commentThread&&e.hasOwnProperty("commentThread")&&(n.commentThread=o.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentMessage"},s}(),o.CommentsV2AddCommentThreadMessage=function(){function s(e){if(this.comments=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.commentThreadId="",s.prototype.context="",s.prototype.createdAt="",s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.attributes="",s.prototype.deletedAt="",s.prototype.comments=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(18).string(e.commentThreadId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(26).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(42).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(50).string(e.resolvedBy),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(66).string(e.deletedAt),null!=e.comments&&e.comments.length)for(var r=0;r<e.comments.length;++r)o.CommentDescriptor.encode(e.comments[r],t.uint32(74).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2AddCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.documentId=e.string();break;case 2:s.commentThreadId=e.string();break;case 3:s.context=e.string();break;case 4:s.createdAt=e.string();break;case 5:s.resolvedAt=e.string();break;case 6:s.resolvedBy=e.string();break;case 7:s.attributes=e.string();break;case 8:s.deletedAt=e.string();break;case 9:s.comments&&s.comments.length||(s.comments=[]),s.comments.push(o.CommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId))return"documentId: string expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.context&&e.hasOwnProperty("context")&&!r.isString(e.context))return"context: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt))return"createdAt: string expected";if(null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!r.isString(e.resolvedAt))return"resolvedAt: string expected";if(null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!r.isString(e.resolvedBy))return"resolvedBy: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes))return"attributes: string expected";if(null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!r.isString(e.deletedAt))return"deletedAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t){var n=o.CommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2AddCommentThreadMessage)return e;var t=new o.CommentsV2AddCommentThreadMessage;if(null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2AddCommentThreadMessage.comments: array expected");t.comments=[];for(var n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadMessage.comments: object expected");t.comments[n]=o.CommentDescriptor.fromObject(e.comments[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.documentId="",n.commentThreadId="",n.context="",n.createdAt="",n.resolvedAt="",n.resolvedBy="",n.attributes="",n.deletedAt=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),e.comments&&e.comments.length){n.comments=[];for(var r=0;r<e.comments.length;++r)n.comments[r]=o.CommentDescriptor.toObject(e.comments[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadMessage"},s}(),o.CommentsV2ReopenCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2ReopenCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2ReopenCommentThreadMessage)return e;var t=new o.CommentsV2ReopenCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ReopenCommentThreadMessage"},s}(),o.CommentsV2ResolveCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.resolvedBy="",s.prototype.resolvedAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(26).string(e.resolvedBy),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(34).string(e.resolvedAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2ResolveCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;case 3:s.resolvedBy=e.string();break;case 4:s.resolvedAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!r.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!r.isString(e.resolvedAt)?"resolvedAt: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2ResolveCommentThreadMessage)return e;var t=new o.CommentsV2ResolveCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedBy="",n.resolvedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadMessage"},s}(),o.CommentsV2UpdateCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.context="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(26).string(e.context),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(34).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2UpdateCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;case 3:s.context=e.string();break;case 4:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.context&&e.hasOwnProperty("context")&&!r.isString(e.context)?"context: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2UpdateCommentThreadMessage)return e;var t=new o.CommentsV2UpdateCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.context&&(t.context=String(e.context)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.context="",n.attributes=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentThreadMessage"},s}(),o.CommentsV2ConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2ConnectMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.documentId=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2ConnectMessage)return e;var t=new o.CommentsV2ConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectMessage"},s}(),o.CommentsV2GetCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2GetCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2GetCommentThreadMessage)return e;var t=new o.CommentsV2GetCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadMessage"},s}(),o.CommentsV2GetDocumentThreadsMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2GetDocumentThreadsMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.documentId=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2GetDocumentThreadsMessage)return e;var t=new o.CommentsV2GetDocumentThreadsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsMessage"},s}(),o.CommentsV2RemoveCommentMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(26).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2RemoveCommentMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.commentId=e.string();break;case 3:s.documentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId)?"commentId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2RemoveCommentMessage)return e;var t=new o.CommentsV2RemoveCommentMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentMessage"},s}(),o.CommentsV2RemoveCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2RemoveCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2RemoveCommentThreadMessage)return e;var t=new o.CommentsV2RemoveCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentThreadMessage"},s}(),o.CommentsV2UpdateCommentMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.content="",s.prototype.documentId="",s.prototype.attributes="",s.prototype.isAttributesUpdated=!1,s.prototype.commentThread=null,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(26).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(34).string(e.documentId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(42).string(e.attributes),null!=e.isAttributesUpdated&&Object.hasOwnProperty.call(e,"isAttributesUpdated")&&t.uint32(48).bool(e.isAttributesUpdated),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&o.CommentsThreadDescriptor.encode(e.commentThread,t.uint32(58).fork()).ldelim(),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2UpdateCommentMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.commentId=e.string();break;case 3:s.content=e.string();break;case 4:s.documentId=e.string();break;case 5:s.attributes=e.string();break;case 6:s.isAttributesUpdated=e.bool();break;case 7:s.commentThread=o.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId))return"commentId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!r.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId))return"documentId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes))return"attributes: string expected";if(null!=e.isAttributesUpdated&&e.hasOwnProperty("isAttributesUpdated")&&"boolean"!=typeof e.isAttributesUpdated)return"isAttributesUpdated: boolean expected";if(null!=e.commentThread&&e.hasOwnProperty("commentThread")){var t=o.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2UpdateCommentMessage)return e;var t=new o.CommentsV2UpdateCommentMessage;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.isAttributesUpdated&&(t.isAttributesUpdated=Boolean(e.isAttributesUpdated)),null!=e.commentThread){if("object"!=typeof e.commentThread)throw TypeError(".CommentsV2UpdateCommentMessage.commentThread: object expected");t.commentThread=o.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.content="",n.documentId="",n.attributes="",n.isAttributesUpdated=!1,n.commentThread=null),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.isAttributesUpdated&&e.hasOwnProperty("isAttributesUpdated")&&(n.isAttributesUpdated=e.isAttributesUpdated),null!=e.commentThread&&e.hasOwnProperty("commentThread")&&(n.commentThread=o.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentMessage"},s}(),o.CommentsV2AddCommentResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.createdAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(26).string(e.createdAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2AddCommentResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.commentId=e.string();break;case 3:s.createdAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2AddCommentResponse)return e;var t=new o.CommentsV2AddCommentResponse;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.createdAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentResponse"},s}(),o.CommentsV2AddCommentThreadResponse=function(){function s(e){if(this.comments=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.createdAt="",s.prototype.comments=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(18).string(e.createdAt),null!=e.comments&&e.comments.length)for(var r=0;r<e.comments.length;++r)o.CommentThreadAddedCommentDescriptor.encode(e.comments[r],t.uint32(26).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2AddCommentThreadResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.createdAt=e.string();break;case 3:s.comments&&s.comments.length||(s.comments=[]),s.comments.push(o.CommentThreadAddedCommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt))return"createdAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t){var n=o.CommentThreadAddedCommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2AddCommentThreadResponse)return e;var t=new o.CommentsV2AddCommentThreadResponse;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2AddCommentThreadResponse.comments: array expected");t.comments=[];for(var n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadResponse.comments: object expected");t.comments[n]=o.CommentThreadAddedCommentDescriptor.fromObject(e.comments[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.commentThreadId="",n.createdAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),e.comments&&e.comments.length){n.comments=[];for(var r=0;r<e.comments.length;++r)n.comments[r]=o.CommentThreadAddedCommentDescriptor.toObject(e.comments[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadResponse"},s}(),o.CommentsV2ResolveCommentThreadResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(34).string(e.resolvedBy),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2ResolveCommentThreadResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;case 3:s.resolvedAt=e.string();break;case 4:s.resolvedBy=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!r.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!r.isString(e.resolvedBy)?"resolvedBy: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2ResolveCommentThreadResponse)return e;var t=new o.CommentsV2ResolveCommentThreadResponse;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedAt="",n.resolvedBy=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadResponse"},s}(),o.CommentsV2ConnectResponse=function(){function s(e){if(this.threads=[],this.threadsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.threads=r.emptyArray,s.prototype.threadsV2=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.threads&&e.threads.length)for(var r=0;r<e.threads.length;++r)t.uint32(18).string(e.threads[r]);if(null!=e.threadsV2&&e.threadsV2.length)for(r=0;r<e.threadsV2.length;++r)o.CommentsThreadDescriptor.encode(e.threadsV2[r],t.uint32(26).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2ConnectResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.channel=e.string();break;case 2:s.threads&&s.threads.length||(s.threads=[]),s.threads.push(e.string());break;case 3:s.threadsV2&&s.threadsV2.length||(s.threadsV2=[]),s.threadsV2.push(o.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!r.isString(e.channel))return"channel: string expected";if(null!=e.threads&&e.hasOwnProperty("threads")){if(!Array.isArray(e.threads))return"threads: array expected";for(var t=0;t<e.threads.length;++t)if(!r.isString(e.threads[t]))return"threads: string[] expected"}if(null!=e.threadsV2&&e.hasOwnProperty("threadsV2")){if(!Array.isArray(e.threadsV2))return"threadsV2: array expected";for(t=0;t<e.threadsV2.length;++t){var n=o.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(n)return"threadsV2."+n}}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2ConnectResponse)return e;var t=new o.CommentsV2ConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.threads){if(!Array.isArray(e.threads))throw TypeError(".CommentsV2ConnectResponse.threads: array expected");t.threads=[];for(var n=0;n<e.threads.length;++n)t.threads[n]=String(e.threads[n])}if(e.threadsV2){if(!Array.isArray(e.threadsV2))throw TypeError(".CommentsV2ConnectResponse.threadsV2: array expected");for(t.threadsV2=[],n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2ConnectResponse.threadsV2: object expected");t.threadsV2[n]=o.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.threads=[],n.threadsV2=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.threads&&e.threads.length){n.threads=[];for(var r=0;r<e.threads.length;++r)n.threads[r]=e.threads[r]}if(e.threadsV2&&e.threadsV2.length)for(n.threadsV2=[],r=0;r<e.threadsV2.length;++r)n.threadsV2[r]=o.CommentsThreadDescriptor.toObject(e.threadsV2[r],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectResponse"},s}(),o.CommentsV2GetCommentThreadResponse=function(){function s(e){if(this.comments=[],this.commentsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.comments=r.emptyArray,s.prototype.commentsV2=r.emptyArray,s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.context="",s.prototype.createdAt="",s.prototype.deletedAt="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(var r=0;r<e.comments.length;++r)t.uint32(18).string(e.comments[r]);if(null!=e.commentsV2&&e.commentsV2.length)for(r=0;r<e.commentsV2.length;++r)o.CommentDescriptor.encode(e.commentsV2[r],t.uint32(26).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(34).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(42).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(50).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(58).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(66).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(74).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2GetCommentThreadResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.comments&&s.comments.length||(s.comments=[]),s.comments.push(e.string());break;case 3:s.commentsV2&&s.commentsV2.length||(s.commentsV2=[]),s.commentsV2.push(o.CommentDescriptor.decode(e,e.uint32()));break;case 4:s.resolvedAt=e.string();break;case 5:s.resolvedBy=e.string();break;case 6:s.context=e.string();break;case 7:s.createdAt=e.string();break;case 8:s.deletedAt=e.string();break;case 9:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t)if(!r.isString(e.comments[t]))return"comments: string[] expected"}if(null!=e.commentsV2&&e.hasOwnProperty("commentsV2")){if(!Array.isArray(e.commentsV2))return"commentsV2: array expected";for(t=0;t<e.commentsV2.length;++t){var n=o.CommentDescriptor.verify(e.commentsV2[t]);if(n)return"commentsV2."+n}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!r.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!r.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!r.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!r.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2GetCommentThreadResponse)return e;var t=new o.CommentsV2GetCommentThreadResponse;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2GetCommentThreadResponse.comments: array expected");t.comments=[];for(var n=0;n<e.comments.length;++n)t.comments[n]=String(e.comments[n])}if(e.commentsV2){if(!Array.isArray(e.commentsV2))throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: array expected");for(t.commentsV2=[],n=0;n<e.commentsV2.length;++n){if("object"!=typeof e.commentsV2[n])throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: object expected");t.commentsV2[n]=o.CommentDescriptor.fromObject(e.commentsV2[n])}}return null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.comments=[],n.commentsV2=[]),t.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),e.comments&&e.comments.length){n.comments=[];for(var r=0;r<e.comments.length;++r)n.comments[r]=e.comments[r]}if(e.commentsV2&&e.commentsV2.length)for(n.commentsV2=[],r=0;r<e.commentsV2.length;++r)n.commentsV2[r]=o.CommentDescriptor.toObject(e.commentsV2[r],t);return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadResponse"},s}(),o.CommentsV2GetDocumentThreadsResponse=function(){function s(e){if(this.threads=[],this.threadsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.threads=r.emptyArray,s.prototype.threadsV2=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.threads&&e.threads.length)for(var r=0;r<e.threads.length;++r)t.uint32(10).string(e.threads[r]);if(null!=e.threadsV2&&e.threadsV2.length)for(r=0;r<e.threadsV2.length;++r)o.CommentsThreadDescriptor.encode(e.threadsV2[r],t.uint32(18).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2GetDocumentThreadsResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.threads&&s.threads.length||(s.threads=[]),s.threads.push(e.string());break;case 2:s.threadsV2&&s.threadsV2.length||(s.threadsV2=[]),s.threadsV2.push(o.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.threads&&e.hasOwnProperty("threads")){if(!Array.isArray(e.threads))return"threads: array expected";for(var t=0;t<e.threads.length;++t)if(!r.isString(e.threads[t]))return"threads: string[] expected"}if(null!=e.threadsV2&&e.hasOwnProperty("threadsV2")){if(!Array.isArray(e.threadsV2))return"threadsV2: array expected";for(t=0;t<e.threadsV2.length;++t){var n=o.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(n)return"threadsV2."+n}}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2GetDocumentThreadsResponse)return e;var t=new o.CommentsV2GetDocumentThreadsResponse;if(e.threads){if(!Array.isArray(e.threads))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threads: array expected");t.threads=[];for(var n=0;n<e.threads.length;++n)t.threads[n]=String(e.threads[n])}if(e.threadsV2){if(!Array.isArray(e.threadsV2))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: array expected");for(t.threadsV2=[],n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: object expected");t.threadsV2[n]=o.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.threads=[],n.threadsV2=[]),e.threads&&e.threads.length){n.threads=[];for(var r=0;r<e.threads.length;++r)n.threads[r]=e.threads[r]}if(e.threadsV2&&e.threadsV2.length)for(n.threadsV2=[],r=0;r<e.threadsV2.length;++r)n.threadsV2[r]=o.CommentsThreadDescriptor.toObject(e.threadsV2[r],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsResponse"},s}(),o.KeyValueDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.key="",s.prototype.value="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(10).string(e.key),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).string(e.value),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.KeyValueDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.key=e.string();break;case 2:s.value=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!r.isString(e.key)?"key: string expected":null!=e.value&&e.hasOwnProperty("value")&&!r.isString(e.value)?"value: string expected":null},s.fromObject=function(e){if(e instanceof o.KeyValueDescriptor)return e;var t=new o.KeyValueDescriptor;return null!=e.key&&(t.key=String(e.key)),null!=e.value&&(t.value=String(e.value)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.key="",n.value=""),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.value&&e.hasOwnProperty("value")&&(n.value=e.value),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/KeyValueDescriptor"},s}(),o.IsEditorBundleUploadedMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.bundleVersion="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(10).string(e.bundleVersion),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.IsEditorBundleUploadedMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.bundleVersion=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!r.isString(e.bundleVersion)?"bundleVersion: string expected":null},s.fromObject=function(e){if(e instanceof o.IsEditorBundleUploadedMessage)return e;var t=new o.IsEditorBundleUploadedMessage;return null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.bundleVersion=""),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedMessage"},s}(),o.IsEditorBundleUploadedResponse=function(){function r(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return r.prototype.isUploaded=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=n.create()),null!=e.isUploaded&&Object.hasOwnProperty.call(e,"isUploaded")&&t.uint32(8).bool(e.isUploaded),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.IsEditorBundleUploadedResponse;e.pos<r;){var i=e.uint32();i>>>3==1?s.isUploaded=e.bool():e.skipType(7&i)}return s},r.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.isUploaded&&e.hasOwnProperty("isUploaded")&&"boolean"!=typeof e.isUploaded?"isUploaded: boolean expected":null},r.fromObject=function(e){if(e instanceof o.IsEditorBundleUploadedResponse)return e;var t=new o.IsEditorBundleUploadedResponse;return null!=e.isUploaded&&(t.isUploaded=Boolean(e.isUploaded)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.isUploaded=!1),null!=e.isUploaded&&e.hasOwnProperty("isUploaded")&&(n.isUploaded=e.isUploaded),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedResponse"},r}(),o.RevisionDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.revisionId="",s.prototype.name="",s.prototype.creatorId="",s.prototype.authorsIds="",s.prototype.diffData="",s.prototype.createdAt="",s.prototype.attributes="",s.prototype.toVersion=0,s.prototype.fromVersion=0,s.prototype.isEmptyCurrent=!1,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&t.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&t.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&t.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&t.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&t.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&t.uint32(80).bool(e.isEmptyCurrent),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.revisionId=e.string();break;case 2:s.name=e.string();break;case 3:s.creatorId=e.string();break;case 4:s.authorsIds=e.string();break;case 5:s.diffData=e.string();break;case 6:s.createdAt=e.string();break;case 7:s.attributes=e.string();break;case 8:s.toVersion=e.uint32();break;case 9:s.fromVersion=e.uint32();break;case 10:s.isEmptyCurrent=e.bool();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!r.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!r.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!r.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!r.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!r.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!r.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!r.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},s.fromObject=function(e){if(e instanceof o.RevisionDescriptor)return e;var t=new o.RevisionDescriptor;return null!=e.revisionId&&(t.revisionId=String(e.revisionId)),null!=e.name&&(t.name=String(e.name)),null!=e.creatorId&&(t.creatorId=String(e.creatorId)),null!=e.authorsIds&&(t.authorsIds=String(e.authorsIds)),null!=e.diffData&&(t.diffData=String(e.diffData)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.toVersion&&(t.toVersion=e.toVersion>>>0),null!=e.fromVersion&&(t.fromVersion=e.fromVersion>>>0),null!=e.isEmptyCurrent&&(t.isEmptyCurrent=Boolean(e.isEmptyCurrent)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.revisionId="",n.name="",n.creatorId="",n.authorsIds="",n.diffData="",n.createdAt="",n.attributes="",n.toVersion=0,n.fromVersion=0,n.isEmptyCurrent=!1),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.creatorId&&e.hasOwnProperty("creatorId")&&(n.creatorId=e.creatorId),null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&(n.authorsIds=e.authorsIds),null!=e.diffData&&e.hasOwnProperty("diffData")&&(n.diffData=e.diffData),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.toVersion&&e.hasOwnProperty("toVersion")&&(n.toVersion=e.toVersion),null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&(n.fromVersion=e.fromVersion),null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=e.isEmptyCurrent),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionDescriptor"},s}(),o.RevisionHistoryConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryConnectMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.documentId=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryConnectMessage)return e;var t=new o.RevisionHistoryConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectMessage"},s}(),o.RevisionHistoryGetRevisionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.revisionId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(18).string(e.revisionId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryGetRevisionMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.documentId=e.string();break;case 2:s.revisionId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!r.isString(e.revisionId)?"revisionId: string expected":null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryGetRevisionMessage)return e;var t=new o.RevisionHistoryGetRevisionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.revisionId&&(t.revisionId=String(e.revisionId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId="",n.revisionId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionMessage"},s}(),o.RevisionHistoryReconnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.requestId=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryReconnectMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.documentId=e.string();break;case 2:s.requestId=e.uint32();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!r.isInteger(e.requestId)?"requestId: integer expected":null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryReconnectMessage)return e;var t=new o.RevisionHistoryReconnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.requestId&&(t.requestId=e.requestId>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId="",n.requestId=0),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryReconnectMessage"},s}(),o.RevisionHistoryUpdateRevisionsMessage=function(){function s(e){if(this.revisions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.requestId=0,s.prototype.revisions=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(var r=0;r<e.revisions.length;++r)o.RevisionDescriptor.encode(e.revisions[r],t.uint32(26).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryUpdateRevisionsMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.documentId=e.string();break;case 2:s.requestId=e.uint32();break;case 3:s.revisions&&s.revisions.length||(s.revisions=[]),s.revisions.push(o.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId))return"documentId: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!r.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(var t=0;t<e.revisions.length;++t){var n=o.RevisionDescriptor.verify(e.revisions[t]);if(n)return"revisions."+n}}return null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryUpdateRevisionsMessage)return e;var t=new o.RevisionHistoryUpdateRevisionsMessage;if(null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.requestId&&(t.requestId=e.requestId>>>0),e.revisions){if(!Array.isArray(e.revisions))throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: array expected");t.revisions=[];for(var n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: object expected");t.revisions[n]=o.RevisionDescriptor.fromObject(e.revisions[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.revisions=[]),t.defaults&&(n.documentId="",n.requestId=0),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),e.revisions&&e.revisions.length){n.revisions=[];for(var r=0;r<e.revisions.length;++r)n.revisions[r]=o.RevisionDescriptor.toObject(e.revisions[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsMessage"},s}(),o.RevisionHistoryConnectResponse=function(){function s(e){if(this.revisions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.requestId=0,s.prototype.revisions=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(var r=0;r<e.revisions.length;++r)o.RevisionDescriptor.encode(e.revisions[r],t.uint32(26).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryConnectResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.channel=e.string();break;case 2:s.requestId=e.uint32();break;case 3:s.revisions&&s.revisions.length||(s.revisions=[]),s.revisions.push(o.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!r.isString(e.channel))return"channel: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!r.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(var t=0;t<e.revisions.length;++t){var n=o.RevisionDescriptor.verify(e.revisions[t]);if(n)return"revisions."+n}}return null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryConnectResponse)return e;var t=new o.RevisionHistoryConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),null!=e.requestId&&(t.requestId=e.requestId>>>0),e.revisions){if(!Array.isArray(e.revisions))throw TypeError(".RevisionHistoryConnectResponse.revisions: array expected");t.revisions=[];for(var n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryConnectResponse.revisions: object expected");t.revisions[n]=o.RevisionDescriptor.fromObject(e.revisions[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.revisions=[]),t.defaults&&(n.channel="",n.requestId=0),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),e.revisions&&e.revisions.length){n.revisions=[];for(var r=0;r<e.revisions.length;++r)n.revisions[r]=o.RevisionDescriptor.toObject(e.revisions[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectResponse"},s}(),o.RevisionHistoryGetRevisionResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.revisionId="",s.prototype.name="",s.prototype.creatorId="",s.prototype.authorsIds="",s.prototype.diffData="",s.prototype.createdAt="",s.prototype.attributes="",s.prototype.toVersion=0,s.prototype.fromVersion=0,s.prototype.isEmptyCurrent=!1,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&t.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&t.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&t.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&t.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&t.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&t.uint32(80).bool(e.isEmptyCurrent),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryGetRevisionResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.revisionId=e.string();break;case 2:s.name=e.string();break;case 3:s.creatorId=e.string();break;case 4:s.authorsIds=e.string();break;case 5:s.diffData=e.string();break;case 6:s.createdAt=e.string();break;case 7:s.attributes=e.string();break;case 8:s.toVersion=e.uint32();break;case 9:s.fromVersion=e.uint32();break;case 10:s.isEmptyCurrent=e.bool();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!r.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!r.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!r.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!r.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!r.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!r.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!r.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryGetRevisionResponse)return e;var t=new o.RevisionHistoryGetRevisionResponse;return null!=e.revisionId&&(t.revisionId=String(e.revisionId)),null!=e.name&&(t.name=String(e.name)),null!=e.creatorId&&(t.creatorId=String(e.creatorId)),null!=e.authorsIds&&(t.authorsIds=String(e.authorsIds)),null!=e.diffData&&(t.diffData=String(e.diffData)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.toVersion&&(t.toVersion=e.toVersion>>>0),null!=e.fromVersion&&(t.fromVersion=e.fromVersion>>>0),null!=e.isEmptyCurrent&&(t.isEmptyCurrent=Boolean(e.isEmptyCurrent)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.revisionId="",n.name="",n.creatorId="",n.authorsIds="",n.diffData="",n.createdAt="",n.attributes="",n.toVersion=0,n.fromVersion=0,n.isEmptyCurrent=!1),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.creatorId&&e.hasOwnProperty("creatorId")&&(n.creatorId=e.creatorId),null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&(n.authorsIds=e.authorsIds),null!=e.diffData&&e.hasOwnProperty("diffData")&&(n.diffData=e.diffData),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.toVersion&&e.hasOwnProperty("toVersion")&&(n.toVersion=e.toVersion),null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&(n.fromVersion=e.fromVersion),null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=e.isEmptyCurrent),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionResponse"},s}(),o.RevisionHistoryUpdateRevisionsResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.requestId=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(8).uint32(e.requestId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryUpdateRevisionsResponse;e.pos<r;){var i=e.uint32();i>>>3==1?s.requestId=e.uint32():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!r.isInteger(e.requestId)?"requestId: integer expected":null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryUpdateRevisionsResponse)return e;var t=new o.RevisionHistoryUpdateRevisionsResponse;return null!=e.requestId&&(t.requestId=e.requestId>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.requestId=0),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsResponse"},s}(),o.SessionsSocketDescriptor=function(){function s(e){if(this.permissions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.session="",s.prototype.user="",s.prototype.role="",s.prototype.permissions=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.session&&Object.hasOwnProperty.call(e,"session")&&t.uint32(10).string(e.session),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(18).string(e.user),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&t.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(var r=0;r<e.permissions.length;++r)t.uint32(34).string(e.permissions[r]);return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SessionsSocketDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.session=e.string();break;case 2:s.user=e.string();break;case 3:s.role=e.string();break;case 4:s.permissions&&s.permissions.length||(s.permissions=[]),s.permissions.push(e.string());break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.session&&e.hasOwnProperty("session")&&!r.isString(e.session))return"session: string expected";if(null!=e.user&&e.hasOwnProperty("user")&&!r.isString(e.user))return"user: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!r.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(var t=0;t<e.permissions.length;++t)if(!r.isString(e.permissions[t]))return"permissions: string[] expected"}return null},s.fromObject=function(e){if(e instanceof o.SessionsSocketDescriptor)return e;var t=new o.SessionsSocketDescriptor;if(null!=e.session&&(t.session=String(e.session)),null!=e.user&&(t.user=String(e.user)),null!=e.role&&(t.role=String(e.role)),e.permissions){if(!Array.isArray(e.permissions))throw TypeError(".SessionsSocketDescriptor.permissions: array expected");t.permissions=[];for(var n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.permissions=[]),t.defaults&&(n.session="",n.user="",n.role=""),null!=e.session&&e.hasOwnProperty("session")&&(n.session=e.session),null!=e.user&&e.hasOwnProperty("user")&&(n.user=e.user),null!=e.role&&e.hasOwnProperty("role")&&(n.role=e.role),e.permissions&&e.permissions.length){n.permissions=[];for(var r=0;r<e.permissions.length;++r)n.permissions[r]=e.permissions[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsSocketDescriptor"},s}(),o.SessionsConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.sessionType=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.sessionType&&Object.hasOwnProperty.call(e,"sessionType")&&t.uint32(16).uint32(e.sessionType),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SessionsConnectMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.sessionType=e.uint32();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.sessionType&&e.hasOwnProperty("sessionType")&&!r.isInteger(e.sessionType)?"sessionType: integer expected":null},s.fromObject=function(e){if(e instanceof o.SessionsConnectMessage)return e;var t=new o.SessionsConnectMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.sessionType&&(t.sessionType=e.sessionType>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.sessionType=0),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.sessionType&&e.hasOwnProperty("sessionType")&&(n.sessionType=e.sessionType),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectMessage"},s}(),o.SocketConnectMessage=function(){function s(e){if(this.permissions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.userId="",s.prototype.role="",s.prototype.permissions=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&t.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(var r=0;r<e.permissions.length;++r)t.uint32(34).string(e.permissions[r]);return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SocketConnectMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.userId=e.string();break;case 3:s.role=e.string();break;case 4:s.permissions&&s.permissions.length||(s.permissions=[]),s.permissions.push(e.string());break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id))return"id: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!r.isString(e.userId))return"userId: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!r.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(var t=0;t<e.permissions.length;++t)if(!r.isString(e.permissions[t]))return"permissions: string[] expected"}return null},s.fromObject=function(e){if(e instanceof o.SocketConnectMessage)return e;var t=new o.SocketConnectMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.role&&(t.role=String(e.role)),e.permissions){if(!Array.isArray(e.permissions))throw TypeError(".SocketConnectMessage.permissions: array expected");t.permissions=[];for(var n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.permissions=[]),t.defaults&&(n.id="",n.userId="",n.role=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.role&&e.hasOwnProperty("role")&&(n.role=e.role),e.permissions&&e.permissions.length){n.permissions=[];for(var r=0;r<e.permissions.length;++r)n.permissions[r]=e.permissions[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketConnectMessage"},s}(),o.SocketDisconnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SocketDisconnectMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.id=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null},s.fromObject=function(e){if(e instanceof o.SocketDisconnectMessage)return e;var t=new o.SocketDisconnectMessage;return null!=e.id&&(t.id=String(e.id)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketDisconnectMessage"},s}(),o.SessionsConnectResponse=function(){function s(e){if(this.sockets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.sockets=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.sockets&&e.sockets.length)for(var r=0;r<e.sockets.length;++r)o.SessionsSocketDescriptor.encode(e.sockets[r],t.uint32(18).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SessionsConnectResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.channel=e.string();break;case 2:s.sockets&&s.sockets.length||(s.sockets=[]),s.sockets.push(o.SessionsSocketDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!r.isString(e.channel))return"channel: string expected";if(null!=e.sockets&&e.hasOwnProperty("sockets")){if(!Array.isArray(e.sockets))return"sockets: array expected";for(var t=0;t<e.sockets.length;++t){var n=o.SessionsSocketDescriptor.verify(e.sockets[t]);if(n)return"sockets."+n}}return null},s.fromObject=function(e){if(e instanceof o.SessionsConnectResponse)return e;var t=new o.SessionsConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.sockets){if(!Array.isArray(e.sockets))throw TypeError(".SessionsConnectResponse.sockets: array expected");t.sockets=[];for(var n=0;n<e.sockets.length;++n){if("object"!=typeof e.sockets[n])throw TypeError(".SessionsConnectResponse.sockets: object expected");t.sockets[n]=o.SessionsSocketDescriptor.fromObject(e.sockets[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.sockets=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.sockets&&e.sockets.length){n.sockets=[];for(var r=0;r<e.sockets.length;++r)n.sockets[r]=o.SessionsSocketDescriptor.toObject(e.sockets[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectResponse"},s}(),o.SuggestionDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.authorId="",s.prototype.type="",s.prototype.createdAt="",s.prototype.data="",s.prototype.hasComments=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SuggestionDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.authorId=e.string();break;case 3:s.type=e.string();break;case 4:s.createdAt=e.string();break;case 5:s.data=e.string();break;case 6:s.hasComments=e.bool();break;case 7:s.state=e.string();break;case 8:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!r.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!r.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.SuggestionDescriptor)return e;var t=new o.SuggestionDescriptor;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SuggestionDescriptor"},s}(),o.TrackChangesAddSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.documentId="",s.prototype.type="",s.prototype.data="",s.prototype.originalSuggestionId="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).string(e.data),null!=e.originalSuggestionId&&Object.hasOwnProperty.call(e,"originalSuggestionId")&&t.uint32(42).string(e.originalSuggestionId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(50).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesAddSuggestionMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.documentId=e.string();break;case 3:s.type=e.string();break;case 4:s.data=e.string();break;case 5:s.originalSuggestionId=e.string();break;case 6:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isString(e.type)?"type: string expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.originalSuggestionId&&e.hasOwnProperty("originalSuggestionId")&&!r.isString(e.originalSuggestionId)?"originalSuggestionId: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesAddSuggestionMessage)return e;var t=new o.TrackChangesAddSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.type&&(t.type=String(e.type)),null!=e.data&&(t.data=String(e.data)),null!=e.originalSuggestionId&&(t.originalSuggestionId=String(e.originalSuggestionId)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.documentId="",n.type="",n.data="",n.originalSuggestionId="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.originalSuggestionId&&e.hasOwnProperty("originalSuggestionId")&&(n.originalSuggestionId=e.originalSuggestionId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionMessage"},s}(),o.TrackChangesBatchUpdateSuggestionsStateMessage=function(){function s(e){if(this.ids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.ids=r.emptyArray,s.prototype.documentId="",s.prototype.state="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.ids&&e.ids.length)for(var r=0;r<e.ids.length;++r)t.uint32(10).string(e.ids[r]);return null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(26).string(e.state),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesBatchUpdateSuggestionsStateMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.ids&&s.ids.length||(s.ids=[]),s.ids.push(e.string());break;case 2:s.documentId=e.string();break;case 3:s.state=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.ids&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(var t=0;t<e.ids.length;++t)if(!r.isString(e.ids[t]))return"ids: string[] expected"}return null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.state&&e.hasOwnProperty("state")&&!r.isString(e.state)?"state: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesBatchUpdateSuggestionsStateMessage)return e;var t=new o.TrackChangesBatchUpdateSuggestionsStateMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".TrackChangesBatchUpdateSuggestionsStateMessage.ids: array expected");t.ids=[];for(var n=0;n<e.ids.length;++n)t.ids[n]=String(e.ids[n])}return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.state&&(t.state=String(e.state)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.ids=[]),t.defaults&&(n.documentId="",n.state=""),e.ids&&e.ids.length){n.ids=[];for(var r=0;r<e.ids.length;++r)n.ids[r]=e.ids[r]}return null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesBatchUpdateSuggestionsStateMessage"},s}(),o.TrackChangesConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesConnectMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.documentId=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesConnectMessage)return e;var t=new o.TrackChangesConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectMessage"},s}(),o.TrackChangesGetAllSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesGetAllSuggestionMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.documentId=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesGetAllSuggestionMessage)return e;var t=new o.TrackChangesGetAllSuggestionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionMessage"},s}(),o.TrackChangesGetSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesGetSuggestionMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.documentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesGetSuggestionMessage)return e;var t=new o.TrackChangesGetSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.documentId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionMessage"},s}(),o.TrackChangesUpdateSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.documentId="",s.prototype.hasComments=!1,s.prototype.isHasCommentsModified=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(24).bool(e.hasComments),null!=e.isHasCommentsModified&&Object.hasOwnProperty.call(e,"isHasCommentsModified")&&t.uint32(32).bool(e.isHasCommentsModified),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(42).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(50).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesUpdateSuggestionMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.documentId=e.string();break;case 3:s.hasComments=e.bool();break;case 4:s.isHasCommentsModified=e.bool();break;case 5:s.state=e.string();break;case 6:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.isHasCommentsModified&&e.hasOwnProperty("isHasCommentsModified")&&"boolean"!=typeof e.isHasCommentsModified?"isHasCommentsModified: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!r.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesUpdateSuggestionMessage)return e;var t=new o.TrackChangesUpdateSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.isHasCommentsModified&&(t.isHasCommentsModified=Boolean(e.isHasCommentsModified)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.documentId="",n.hasComments=!1,n.isHasCommentsModified=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.isHasCommentsModified&&e.hasOwnProperty("isHasCommentsModified")&&(n.isHasCommentsModified=e.isHasCommentsModified),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesUpdateSuggestionMessage"},s}(),o.TrackChangesAddSuggestionResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.authorId="",s.prototype.type="",s.prototype.createdAt="",s.prototype.data="",s.prototype.hasComments=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesAddSuggestionResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.authorId=e.string();break;case 3:s.type=e.string();break;case 4:s.createdAt=e.string();break;case 5:s.data=e.string();break;case 6:s.hasComments=e.bool();break;case 7:s.state=e.string();break;case 8:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!r.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!r.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesAddSuggestionResponse)return e;var t=new o.TrackChangesAddSuggestionResponse;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionResponse"},s}(),o.TrackChangesConnectResponse=function(){function s(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.suggestions=r.emptyArray,s.prototype.suggestionsV2=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.suggestions&&e.suggestions.length)for(var r=0;r<e.suggestions.length;++r)t.uint32(18).string(e.suggestions[r]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(r=0;r<e.suggestionsV2.length;++r)o.SuggestionDescriptor.encode(e.suggestionsV2[r],t.uint32(26).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesConnectResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.channel=e.string();break;case 2:s.suggestions&&s.suggestions.length||(s.suggestions=[]),s.suggestions.push(e.string());break;case 3:s.suggestionsV2&&s.suggestionsV2.length||(s.suggestionsV2=[]),s.suggestionsV2.push(o.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!r.isString(e.channel))return"channel: string expected";if(null!=e.suggestions&&e.hasOwnProperty("suggestions")){if(!Array.isArray(e.suggestions))return"suggestions: array expected";for(var t=0;t<e.suggestions.length;++t)if(!r.isString(e.suggestions[t]))return"suggestions: string[] expected"}if(null!=e.suggestionsV2&&e.hasOwnProperty("suggestionsV2")){if(!Array.isArray(e.suggestionsV2))return"suggestionsV2: array expected";for(t=0;t<e.suggestionsV2.length;++t){var n=o.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(n)return"suggestionsV2."+n}}return null},s.fromObject=function(e){if(e instanceof o.TrackChangesConnectResponse)return e;var t=new o.TrackChangesConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.suggestions){if(!Array.isArray(e.suggestions))throw TypeError(".TrackChangesConnectResponse.suggestions: array expected");t.suggestions=[];for(var n=0;n<e.suggestions.length;++n)t.suggestions[n]=String(e.suggestions[n])}if(e.suggestionsV2){if(!Array.isArray(e.suggestionsV2))throw TypeError(".TrackChangesConnectResponse.suggestionsV2: array expected");for(t.suggestionsV2=[],n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesConnectResponse.suggestionsV2: object expected");t.suggestionsV2[n]=o.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.suggestions&&e.suggestions.length){n.suggestions=[];for(var r=0;r<e.suggestions.length;++r)n.suggestions[r]=e.suggestions[r]}if(e.suggestionsV2&&e.suggestionsV2.length)for(n.suggestionsV2=[],r=0;r<e.suggestionsV2.length;++r)n.suggestionsV2[r]=o.SuggestionDescriptor.toObject(e.suggestionsV2[r],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectResponse"},s}(),o.TrackChangesGetAllSuggestionsResponse=function(){function s(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.suggestions=r.emptyArray,s.prototype.suggestionsV2=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.suggestions&&e.suggestions.length)for(var r=0;r<e.suggestions.length;++r)t.uint32(10).string(e.suggestions[r]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(r=0;r<e.suggestionsV2.length;++r)o.SuggestionDescriptor.encode(e.suggestionsV2[r],t.uint32(18).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesGetAllSuggestionsResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.suggestions&&s.suggestions.length||(s.suggestions=[]),s.suggestions.push(e.string());break;case 2:s.suggestionsV2&&s.suggestionsV2.length||(s.suggestionsV2=[]),s.suggestionsV2.push(o.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.suggestions&&e.hasOwnProperty("suggestions")){if(!Array.isArray(e.suggestions))return"suggestions: array expected";for(var t=0;t<e.suggestions.length;++t)if(!r.isString(e.suggestions[t]))return"suggestions: string[] expected"}if(null!=e.suggestionsV2&&e.hasOwnProperty("suggestionsV2")){if(!Array.isArray(e.suggestionsV2))return"suggestionsV2: array expected";for(t=0;t<e.suggestionsV2.length;++t){var n=o.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(n)return"suggestionsV2."+n}}return null},s.fromObject=function(e){if(e instanceof o.TrackChangesGetAllSuggestionsResponse)return e;var t=new o.TrackChangesGetAllSuggestionsResponse;if(e.suggestions){if(!Array.isArray(e.suggestions))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestions: array expected");t.suggestions=[];for(var n=0;n<e.suggestions.length;++n)t.suggestions[n]=String(e.suggestions[n])}if(e.suggestionsV2){if(!Array.isArray(e.suggestionsV2))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: array expected");for(t.suggestionsV2=[],n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: object expected");t.suggestionsV2[n]=o.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),e.suggestions&&e.suggestions.length){n.suggestions=[];for(var r=0;r<e.suggestions.length;++r)n.suggestions[r]=e.suggestions[r]}if(e.suggestionsV2&&e.suggestionsV2.length)for(n.suggestionsV2=[],r=0;r<e.suggestionsV2.length;++r)n.suggestionsV2[r]=o.SuggestionDescriptor.toObject(e.suggestionsV2[r],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionsResponse"},s}(),o.TrackChangesGetSuggestionResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.authorId="",s.prototype.type="",s.prototype.createdAt="",s.prototype.data="",s.prototype.hasComments=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesGetSuggestionResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.authorId=e.string();break;case 3:s.type=e.string();break;case 4:s.createdAt=e.string();break;case 5:s.data=e.string();break;case 6:s.hasComments=e.bool();break;case 7:s.state=e.string();break;case 8:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!r.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!r.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesGetSuggestionResponse)return e;var t=new o.TrackChangesGetSuggestionResponse;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionResponse"},s}(),o.UserDescriptor=function(){function s(e){if(this.attributes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.attributes=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.attributes&&e.attributes.length)for(var r=0;r<e.attributes.length;++r)o.KeyValueDescriptor.encode(e.attributes[r],t.uint32(10).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.UserDescriptor;e.pos<r;){var i=e.uint32();i>>>3==1?(s.attributes&&s.attributes.length||(s.attributes=[]),s.attributes.push(o.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")){if(!Array.isArray(e.attributes))return"attributes: array expected";for(var t=0;t<e.attributes.length;++t){var n=o.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},s.fromObject=function(e){if(e instanceof o.UserDescriptor)return e;var t=new o.UserDescriptor;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".UserDescriptor.attributes: array expected");t.attributes=[];for(var n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".UserDescriptor.attributes: object expected");t.attributes[n]=o.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(var r=0;r<e.attributes.length;++r)n.attributes[r]=o.KeyValueDescriptor.toObject(e.attributes[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/UserDescriptor"},s}(),o.GetManyUsersMessage=function(){function s(e){if(this.ids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.ids=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.ids&&e.ids.length)for(var r=0;r<e.ids.length;++r)t.uint32(10).string(e.ids[r]);return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetManyUsersMessage;e.pos<r;){var i=e.uint32();i>>>3==1?(s.ids&&s.ids.length||(s.ids=[]),s.ids.push(e.string())):e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.ids&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(var t=0;t<e.ids.length;++t)if(!r.isString(e.ids[t]))return"ids: string[] expected"}return null},s.fromObject=function(e){if(e instanceof o.GetManyUsersMessage)return e;var t=new o.GetManyUsersMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".GetManyUsersMessage.ids: array expected");t.ids=[];for(var n=0;n<e.ids.length;++n)t.ids[n]=String(e.ids[n])}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.ids=[]),e.ids&&e.ids.length){n.ids=[];for(var r=0;r<e.ids.length;++r)n.ids[r]=e.ids[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersMessage"},s}(),o.GetUserMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetUserMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.id=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null},s.fromObject=function(e){if(e instanceof o.GetUserMessage)return e;var t=new o.GetUserMessage;return null!=e.id&&(t.id=String(e.id)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserMessage"},s}(),o.GetManyUsersResponse=function(){function s(e){if(this.users=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.users=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.users&&e.users.length)for(var r=0;r<e.users.length;++r)o.UserDescriptor.encode(e.users[r],t.uint32(10).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetManyUsersResponse;e.pos<r;){var i=e.uint32();i>>>3==1?(s.users&&s.users.length||(s.users=[]),s.users.push(o.UserDescriptor.decode(e,e.uint32()))):e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.users&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(var t=0;t<e.users.length;++t){var n=o.UserDescriptor.verify(e.users[t]);if(n)return"users."+n}}return null},s.fromObject=function(e){if(e instanceof o.GetManyUsersResponse)return e;var t=new o.GetManyUsersResponse;if(e.users){if(!Array.isArray(e.users))throw TypeError(".GetManyUsersResponse.users: array expected");t.users=[];for(var n=0;n<e.users.length;++n){if("object"!=typeof e.users[n])throw TypeError(".GetManyUsersResponse.users: object expected");t.users[n]=o.UserDescriptor.fromObject(e.users[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.users=[]),e.users&&e.users.length){n.users=[];for(var r=0;r<e.users.length;++r)n.users[r]=o.UserDescriptor.toObject(e.users[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersResponse"},s}(),o.GetUserResponse=function(){function s(e){if(this.attributes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.attributes=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.attributes&&e.attributes.length)for(var r=0;r<e.attributes.length;++r)o.KeyValueDescriptor.encode(e.attributes[r],t.uint32(10).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetUserResponse;e.pos<r;){var i=e.uint32();i>>>3==1?(s.attributes&&s.attributes.length||(s.attributes=[]),s.attributes.push(o.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")){if(!Array.isArray(e.attributes))return"attributes: array expected";for(var t=0;t<e.attributes.length;++t){var n=o.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},s.fromObject=function(e){if(e instanceof o.GetUserResponse)return e;var t=new o.GetUserResponse;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".GetUserResponse.attributes: array expected");t.attributes=[];for(var n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".GetUserResponse.attributes: object expected");t.attributes[n]=o.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(var r=0;r<e.attributes.length;++r)n.attributes[r]=o.KeyValueDescriptor.toObject(e.attributes[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserResponse"},s}(),o.ChannelMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.type=0,s.prototype.socketId="",s.prototype.data=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).uint32(e.type),null!=e.socketId&&Object.hasOwnProperty.call(e,"socketId")&&t.uint32(18).string(e.socketId),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).bytes(e.data),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.ChannelMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.type=e.uint32();break;case 2:s.socketId=e.string();break;case 3:s.data=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isInteger(e.type)?"type: integer expected":null!=e.socketId&&e.hasOwnProperty("socketId")&&!r.isString(e.socketId)?"socketId: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||r.isString(e.data))?"data: buffer expected":null},s.fromObject=function(e){if(e instanceof o.ChannelMessage)return e;var t=new o.ChannelMessage;return null!=e.type&&(t.type=e.type>>>0),null!=e.socketId&&(t.socketId=String(e.socketId)),null!=e.data&&("string"==typeof e.data?r.base64.decode(e.data,t.data=r.newBuffer(r.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.type=0,n.socketId="",t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=r.newBuffer(n.data)))),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.socketId&&e.hasOwnProperty("socketId")&&(n.socketId=e.socketId),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?r.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ChannelMessage"},s}(),o.BytesBytesPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=r.newBuffer([]),s.prototype.data1=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).bytes(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.BytesBytesPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.bytes();break;case 2:s.data1=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||r.isString(e.data))?"data: buffer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||r.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof o.BytesBytesPacketDataMessage)return e;var t=new o.BytesBytesPacketDataMessage;return null!=e.data&&("string"==typeof e.data?r.base64.decode(e.data,t.data=r.newBuffer(r.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.data1&&("string"==typeof e.data1?r.base64.decode(e.data1,t.data1=r.newBuffer(r.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=r.newBuffer(n.data))),t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=r.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?r.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?r.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/BytesBytesPacketDataMessage"},s}(),o.NumberBytesPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.NumberBytesPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.uint32();break;case 2:s.data1=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||r.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof o.NumberBytesPacketDataMessage)return e;var t=new o.NumberBytesPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&("string"==typeof e.data1?r.base64.decode(e.data1,t.data1=r.newBuffer(r.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data=0,t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=r.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?r.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberBytesPacketDataMessage"},s}(),o.NumberNumberPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(16).uint32(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.NumberNumberPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.uint32();break;case 2:s.data1=e.uint32();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isInteger(e.data1)?"data1: integer expected":null},s.fromObject=function(e){if(e instanceof o.NumberNumberPacketDataMessage)return e;var t=new o.NumberNumberPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=e.data1>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data=0,n.data1=0),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberNumberPacketDataMessage"},s}(),o.NumberObjectPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.NumberObjectPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.uint32();break;case 2:s.data1=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof o.NumberObjectPacketDataMessage)return e;var t=new o.NumberObjectPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data=0,n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberObjectPacketDataMessage"},s}(),o.NumberStringPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.NumberStringPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.uint32();break;case 2:s.data1=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof o.NumberStringPacketDataMessage)return e;var t=new o.NumberStringPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data=0,n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberStringPacketDataMessage"},s}(),o.ObjectBufferPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.ObjectBufferPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||r.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof o.ObjectBufferPacketDataMessage)return e;var t=new o.ObjectBufferPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?r.base64.decode(e.data1,t.data1=r.newBuffer(r.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=r.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?r.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectBufferPacketDataMessage"},s}(),o.ObjectObjectPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.ObjectObjectPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof o.ObjectObjectPacketDataMessage)return e;var t=new o.ObjectObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectObjectPacketDataMessage"},s}(),o.PacketMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.type=0,s.prototype.id=0,s.prototype.nsp="",s.prototype.data=r.newBuffer([]),s.prototype.options=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).uint32(e.type),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(16).uint32(e.id),null!=e.nsp&&Object.hasOwnProperty.call(e,"nsp")&&t.uint32(26).string(e.nsp),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).bytes(e.data),null!=e.options&&Object.hasOwnProperty.call(e,"options")&&t.uint32(42).bytes(e.options),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.PacketMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.type=e.uint32();break;case 2:s.id=e.uint32();break;case 3:s.nsp=e.string();break;case 4:s.data=e.bytes();break;case 5:s.options=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isInteger(e.type)?"type: integer expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isInteger(e.id)?"id: integer expected":null!=e.nsp&&e.hasOwnProperty("nsp")&&!r.isString(e.nsp)?"nsp: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||r.isString(e.data))?"data: buffer expected":null!=e.options&&e.hasOwnProperty("options")&&!(e.options&&"number"==typeof e.options.length||r.isString(e.options))?"options: buffer expected":null},s.fromObject=function(e){if(e instanceof o.PacketMessage)return e;var t=new o.PacketMessage;return null!=e.type&&(t.type=e.type>>>0),null!=e.id&&(t.id=e.id>>>0),null!=e.nsp&&(t.nsp=String(e.nsp)),null!=e.data&&("string"==typeof e.data?r.base64.decode(e.data,t.data=r.newBuffer(r.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.options&&("string"==typeof e.options?r.base64.decode(e.options,t.options=r.newBuffer(r.base64.length(e.options)),0):e.options.length>=0&&(t.options=e.options)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.type=0,n.id=0,n.nsp="",t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=r.newBuffer(n.data))),t.bytes===String?n.options="":(n.options=[],t.bytes!==Array&&(n.options=r.newBuffer(n.options)))),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.nsp&&e.hasOwnProperty("nsp")&&(n.nsp=e.nsp),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?r.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.options&&e.hasOwnProperty("options")&&(n.options=t.bytes===String?r.base64.encode(e.options,0,e.options.length):t.bytes===Array?Array.prototype.slice.call(e.options):e.options),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketMessage"},s}(),o.PacketOptionsMessage=function(){function s(e){if(this.rooms=[],this.except=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.flags="",s.prototype.rooms=r.emptyArray,s.prototype.except=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.flags&&Object.hasOwnProperty.call(e,"flags")&&t.uint32(10).string(e.flags),null!=e.rooms&&e.rooms.length)for(var r=0;r<e.rooms.length;++r)t.uint32(18).string(e.rooms[r]);if(null!=e.except&&e.except.length)for(r=0;r<e.except.length;++r)t.uint32(26).string(e.except[r]);return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.PacketOptionsMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.flags=e.string();break;case 2:s.rooms&&s.rooms.length||(s.rooms=[]),s.rooms.push(e.string());break;case 3:s.except&&s.except.length||(s.except=[]),s.except.push(e.string());break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.flags&&e.hasOwnProperty("flags")&&!r.isString(e.flags))return"flags: string expected";if(null!=e.rooms&&e.hasOwnProperty("rooms")){if(!Array.isArray(e.rooms))return"rooms: array expected";for(var t=0;t<e.rooms.length;++t)if(!r.isString(e.rooms[t]))return"rooms: string[] expected"}if(null!=e.except&&e.hasOwnProperty("except")){if(!Array.isArray(e.except))return"except: array expected";for(t=0;t<e.except.length;++t)if(!r.isString(e.except[t]))return"except: string[] expected"}return null},s.fromObject=function(e){if(e instanceof o.PacketOptionsMessage)return e;var t=new o.PacketOptionsMessage;if(null!=e.flags&&(t.flags=String(e.flags)),e.rooms){if(!Array.isArray(e.rooms))throw TypeError(".PacketOptionsMessage.rooms: array expected");t.rooms=[];for(var n=0;n<e.rooms.length;++n)t.rooms[n]=String(e.rooms[n])}if(e.except){if(!Array.isArray(e.except))throw TypeError(".PacketOptionsMessage.except: array expected");for(t.except=[],n=0;n<e.except.length;++n)t.except[n]=String(e.except[n])}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.rooms=[],n.except=[]),t.defaults&&(n.flags=""),null!=e.flags&&e.hasOwnProperty("flags")&&(n.flags=e.flags),e.rooms&&e.rooms.length){n.rooms=[];for(var r=0;r<e.rooms.length;++r)n.rooms[r]=e.rooms[r]}if(e.except&&e.except.length)for(n.except=[],r=0;r<e.except.length;++r)n.except[r]=e.except[r];return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketOptionsMessage"},s}(),o.StringBytesPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.StringBytesPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||r.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof o.StringBytesPacketDataMessage)return e;var t=new o.StringBytesPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?r.base64.decode(e.data1,t.data1=r.newBuffer(r.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=r.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?r.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringBytesPacketDataMessage"},s}(),o.StringNumberPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(16).uint32(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.StringNumberPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.uint32();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isInteger(e.data1)?"data1: integer expected":null},s.fromObject=function(e){if(e instanceof o.StringNumberPacketDataMessage)return e;var t=new o.StringNumberPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=e.data1>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",n.data1=0),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringNumberPacketDataMessage"},s}(),o.StringObjectPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.StringObjectPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof o.StringObjectPacketDataMessage)return e;var t=new o.StringObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringObjectPacketDataMessage"},s}(),o.StringStringPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.StringStringPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof o.StringStringPacketDataMessage)return e;var t=new o.StringStringPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringStringPacketDataMessage"},s}(),o},o=[n(6386)],void 0===(s="function"==typeof(r=i)?r.apply(t,o):r)||(e.exports=s)},5945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(...e){}}},8689:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const o=n(2209),s=r(n(3596)),i=n(7158),a=r(n(6052)),c=r(n(4910)),u=r(n(357));t._SERVICE=13;class d{static async isBundleUploaded(e,t){const n=new a.default(t);if(e.state!==i.WEB_SOCKET_GATEWAY_STATES.CONNECTED)throw new u.default("WebSocket Gateway is not connected.",e);const r=await e._sendRequest(d._SERVICE,a.default.TYPE,s.default.encode(n));return s.default.decode(r,c.default).isUploaded}}d._SERVICE=t._SERVICE,(0,o.mix)(d,o.EmitterMixin),t.default=d},6052:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.bundleVersion=e}toJSON(){return{bundleVersion:this.bundleVersion}}static fromJSON(e){return new s(e.bundleVersion)}}t.default=s,s.TYPE="131",s.READABLE_TYPE_NAME="isEditorBundleUploaded",s.DESCRIPTOR_NAME="IsEditorBundleUploadedMessage",s.DESCRIPTOR={fields:{bundleVersion:{type:"string",id:1}}}},4910:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.isUploaded=e}toJSON(){return{isUploaded:this.isUploaded}}static fromJSON(e){return new s(e.isUploaded)}}t.default=s,s.DESCRIPTOR_NAME="IsEditorBundleUploadedResponse",s.DESCRIPTOR={fields:{isUploaded:{type:"bool",id:1}}}},6314:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(357));class s extends o.default{constructor(e,t){super(e+" Service is not connected.",t)}}t.default=s},3545:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(5945));class s extends o.default{constructor(...e){super()}static fromJSON(e){throw new TypeError("Must be implemented in a child class!")}}t.default=s,s.TYPE="1000"},3596:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(6398));function s(e){return o.default[e.DESCRIPTOR_NAME]}t.default=class{static decode(e,t){const n=s(t).decode("undefined"==typeof window?e:new Uint8Array(e));return t.fromJSON({...n})}static encode(e){const t=s(e.constructor),n=e.toJSON(),r=t.verify(n);if(r)throw Error(r);return t.encode(t.create(n)).finish()}}},9883:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(5945));class s extends o.default{static create(e){return{revisionId:e.id,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.stringify(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds}}static toJSON(e){var t;return{revisionId:e.revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.stringify(e.authorsIds):void 0,diffData:e.diffData,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static fromJSON(e){return{revisionId:(e={...e}).revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.parse(e.authorsIds):void 0,diffData:e.diffData,createdAt:e.createdAt?new Date(e.createdAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static toObject(e){return function(e){for(const[t,n]of Object.entries(e))void 0===n&&delete e[t];return e}({id:e.revisionId,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.parse(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds})}}t.default=s,s.DESCRIPTOR_NAME="RevisionDescriptor",s.DESCRIPTOR={fields:{revisionId:{type:"string",id:1},name:{type:"string",id:2},creatorId:{type:"string",id:3},authorsIds:{type:"string",id:4},diffData:{type:"string",id:5},createdAt:{type:"string",id:6},attributes:{type:"string",id:7},toVersion:{type:"uint32",id:8},fromVersion:{type:"uint32",id:9},isEmptyCurrent:{type:"bool",id:10}}}},801:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="121",s.READABLE_TYPE_NAME="connectToRevisionHistory",s.DESCRIPTOR_NAME="RevisionHistoryConnectMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},3667:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t){super(),this.documentId=e,this.revisionId=t}toJSON(){return{documentId:this.documentId,revisionId:this.revisionId}}static fromJSON(e){return new s(e.documentId,e.revisionId)}}t.default=s,s.TYPE="123",s.READABLE_TYPE_NAME="getRevision",s.DESCRIPTOR_NAME="RevisionHistoryGetRevisionMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1},revisionId:{type:"string",id:2}}}},8702:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t){super(),this.documentId=e,this.requestId=t}toJSON(){return{documentId:this.documentId,requestId:this.requestId}}static fromJSON(e){return new s(e.documentId,e.requestId)}}t.default=s,s.TYPE="122",s.READABLE_TYPE_NAME="reconnectToRevisionHistory",s.DESCRIPTOR_NAME="RevisionHistoryReconnectMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2}}}},6120:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(9883));class i extends o.default{constructor(e,t,n){super(),this.documentId=e,this.requestId=t,this.revisions=n}toJSON(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(s.default.toJSON)}}toObject(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(s.default.toObject)}}static create(e){return new i(e.documentId,e.requestId,e.revisions.map(s.default.create))}static fromJSON(e){return new i(e.documentId,e.requestId,e.revisions.map(s.default.fromJSON))}}t.default=i,i.TYPE="124",i.READABLE_TYPE_NAME="updateRevisions",i.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsMessage",i.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}}},5218:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(9883));class i extends o.default{constructor(e,t,n){super(),this.channel=e,this.requestId=t,this.revisions=n}toJSON(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(s.default.toJSON)}}toObject(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(s.default.toObject)}}static fromJSON(e){return new i(e.channel,e.requestId,e.revisions.map(s.default.fromJSON))}}t.default=i,i.DESCRIPTOR_NAME="RevisionHistoryConnectResponse",i.DESCRIPTOR={fields:{channel:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}}},6311:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(9883));class i extends o.default{constructor(e,t,n,r,o,s,i,a,c,u){super(),this.revisionId=e,this.name=t,this.creatorId=n,this.authorsIds=r,this.createdAt=o,this.diffData=s,this.attributes=i,this.fromVersion=a,this.toVersion=c,this.isEmptyCurrent=u}toJSON(){return s.default.toJSON(this)}toObject(){return s.default.toObject(this)}static create(e){return new i(e.revisionId,e.name,e.creatorId,e.authorsIds,e.createdAt,e.diffData,e.attributes,e.fromVersion,e.toVersion,e.isEmptyCurrent)}static fromJSON(e){return new i(e.revisionId,e.name,e.creatorId,e.authorsIds?JSON.parse(e.authorsIds):void 0,e.createdAt?new Date(e.createdAt):void 0,e.diffData,e.attributes?JSON.parse(e.attributes):void 0,e.fromVersion,e.toVersion,e.isEmptyCurrent)}}t.default=i,i.DESCRIPTOR_NAME="RevisionHistoryGetRevisionResponse",i.DESCRIPTOR=s.default.DESCRIPTOR},1655:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.requestId=e}toJSON(){return{requestId:this.requestId}}static fromJSON(e){return new s(e.requestId)}}t.default=s,s.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsResponse",s.DESCRIPTOR={fields:{requestId:{type:"uint32",id:1}}}},8811:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const a=n(2209),c=i(n(3596)),u=i(n(3667)),d=i(n(6311)),l=i(n(6120)),p=i(n(1655)),h=i(n(801)),f=i(n(5218)),m=i(n(8702)),y=i(n(357)),g=s(n(7158)),b=i(n(6314));t._SERVICE=12;class O{constructor(e){this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}connect(e){return this._isConnected?Promise.resolve():this._connect(e,new h.default(this._documentId))}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this.fire("disconnected"),this.stopListening())}reconnect(e,t){if(this.isConnected)throw new y.default("Cannot reconnect to already connected service.",e);return this._connect(e,new m.default(this._documentId,t))}async updateRevisions(e,t){const n=l.default.create({documentId:this._documentId,requestId:t,revisions:e}),r=await this._sendRequest(l.default.TYPE,n),{requestId:o}=c.default.decode(r,p.default);return o}async getRevision(e){const t=new u.default(this._documentId,e),n=await this._sendRequest(u.default.TYPE,t);return c.default.decode(n,d.default).toObject()}async _connect(e,n){if(e.state!==g.WEB_SOCKET_GATEWAY_STATES.CONNECTED)throw new y.default("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const r=await e._sendRequest(t._SERVICE,n.constructor.TYPE,c.default.encode(n)),{channel:o,requestId:s,revisions:i}=c.default.decode(r,f.default).toObject();return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:g.default._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,o),this._isConnected=!0,this.fire("connected"),{revisions:i,requestId:s}}_connectToChannel(e,t){this._channel=e._getChannel(O._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(l.default.TYPE),((e,t)=>{const{documentId:n,requestId:r,revisions:o}=c.default.decode(t,l.default).toObject();this.fire("revisionsUpdated",{documentId:n,requestId:r,revisionsData:o})}))}_onWsGatewayStateChange(e){e===g.WEB_SOCKET_GATEWAY_STATES.DISCONNECTED&&this.disconnect()}_sendRequest(e,n){if(!this._wsGateway||!this._isConnected)throw new b.default("Revision History",this);return this._wsGateway._sendRequest(t._SERVICE,e,c.default.encode(n))}}O._SERVICE=t._SERVICE,(0,a.mix)(O,a.EmitterMixin),t.default=O},2366:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t){super(),this.id=e,this.sessionType=t}toJSON(){return{id:this.id,sessionType:this.sessionType}}static fromJSON(e){return new s(e.id,e.sessionType)}}t.default=s,s.TYPE="31",s.READABLE_TYPE_NAME="getConnectedSockets",s.DESCRIPTOR_NAME="SessionsConnectMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},sessionType:{type:"uint32",id:2}}}},2414:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r){super(),this.id=e,this.userId=t,this.role=n,this.permissions=r}toJSON(){var e,t,n;return{id:this.id,userId:null!==(e=this.userId)&&void 0!==e?e:void 0,role:null!==(t=this.role)&&void 0!==t?t:void 0,permissions:null!==(n=this.permissions)&&void 0!==n?n:void 0}}static fromJSON(e){return new s(e.id,e.userId,e.role,e.permissions)}}t.default=s,s.TYPE="32",s.READABLE_TYPE_NAME="connectSocket",s.DESCRIPTOR_NAME="SocketConnectMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},userId:{type:"string",id:2},role:{type:"string",id:3},permissions:{rule:"repeated",type:"string",id:4}}}},4194:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new s(e.id)}}t.default=s,s.TYPE="33",s.READABLE_TYPE_NAME="disconnectSocket",s.DESCRIPTOR_NAME="SocketDisconnectMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1}}}},6145:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t=[]){super(),this.channel=e,this.sockets=t}toJSON(){return{channel:this.channel,sockets:this.sockets.map((e=>({user:e.userId,session:e.id,role:e.role,permissions:e.permissions})))}}static fromJSON(e){return new s(e.channel,e.sockets.map((e=>({id:e.session,userId:e.user,role:e.role,permissions:e.permissions}))))}}t.default=s,s.DESCRIPTOR_NAME="SessionsConnectResponse",s.DESCRIPTOR={fields:{channel:{type:"string",id:1},sockets:{rule:"repeated",type:"SessionsSocketDescriptor",id:2}}}},2690:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(2209),s=n(7026),i=r(n(7530)),a=r(n(7158)),c=r(n(6145)),u=r(n(2366)),d=r(n(2414)),l=r(n(4194)),p=r(n(3596));class h extends o.Collection{constructor(e,t){super({idProperty:"id"}),this._id=e,this._sessionType=t,this._handlers=new Map,this._eventsQueue=[],this._isRunning=!1}async connect(e){this._wsGateway=e,this.stopListening(e,"change:state");const t=new u.default(this._id,this._sessionType);let n;try{const e=await this._wsGateway._sendRequest(s._SERVICE,u.default.TYPE,p.default.encode(t));n=p.default.decode(e,c.default)}catch(e){n=new c.default(this._id,[])}this._connectToChannel(this._wsGateway,n.channel,this._sessionType);const r=await async function(e,t){const n=t.map((e=>e.userId)),r=n.length?await i.default.getMany(e,n):[];return t.map((e=>{const t={id:e.id,role:e.role,permissions:e.permissions};return t.user=e.userId&&r.find((t=>t.id===e.userId))||new i.default,t}))}(this._wsGateway,n.sockets);for(const e of r)super.add(e);this._connected=!0,this.fire("connected"),this.listenTo(this._wsGateway,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:a.default._CHANGE_STATE_EVENT_PRIORITY}),await this._runQueue()}disconnect(e=!0){if(this._connected){for(this._connected=!1,this._eventsQueue=[];this.length;)super.remove(0);this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._wsGateway&&e&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this.fire("disconnected"),e&&this.stopListening()}}add(e,t){throw new TypeError("The collection is read-only.")}remove(e){throw new TypeError("The collection is read-only.")}_connectToChannel(e,t,n){this._channel=e._getChannel(n,t),this._channel&&(this._addHandler(this._channel,d.default.TYPE,(async t=>{const n=p.default.decode(t,d.default);if(-1===this.getIndex(n.id)){const t={id:n.id,role:n.role,permissions:n.permissions};n.userId&&(t.user=await i.default.get(e,n.userId)),super.add(t)}})),this._addHandler(this._channel,l.default.TYPE,(e=>{const t=p.default.decode(e,l.default);-1!==this.getIndex(t.id)&&super.remove(t.id)})))}async _onWsGatewayStateChange(e){e===a.default.STATE_DISCONNECTED&&this.disconnect(!1),e===a.default.STATE_CONNECTED&&await this.connect(this._wsGateway)}async _runQueue(){if(this._isRunning||!this._connected)return;let e;for(this._isRunning=!0;e=this._eventsQueue.shift();){const t=this._handlers.get(e.eventName);t&&await t(e.data)}this._isRunning=!1}_addHandler(e,t,n){const r=e.getEventName(t,!0);this.listenTo(e,r,(async(e,t)=>{const n=e.name;this._eventsQueue.push({eventName:n,data:t}),await this._runQueue()})),this._handlers.set(r,n)}}t.default=h},7026:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const o=r(n(2690));t._SERVICE=3,t.default=class{static async getConnectedSessions(e,t,n){const r=new o.default(t,n);return await r.connect(e),r}}},1706:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(5945));class s extends o.default{static toJSON(e){var t;return{...e,data:e.data?JSON.stringify(e.data):e.data,attributes:e.attributes?JSON.stringify(e.attributes):e.attributes,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{...e,data:e.data?JSON.parse(e.data):e.data,attributes:e.attributes?JSON.parse(e.attributes):e.attributes,createdAt:e.createdAt?new Date(e.createdAt):void 0}}}t.default=s,s.DESCRIPTOR_NAME="SuggestionDescriptor",s.DESCRIPTOR={fields:{id:{id:1,type:"string"},authorId:{id:2,type:"string"},type:{id:3,type:"string"},createdAt:{id:4,type:"string"},data:{id:5,type:"string"},hasComments:{id:6,type:"bool"},state:{id:7,type:"string"},attributes:{id:8,type:"string"}}}},597:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r={},o=null,s=null){super(),this.id=e,this.documentId=t,this.type=n,this.data=r,this.originalSuggestionId=o,this.attributes=s}toJSON(){return{id:this.id,documentId:this.documentId,type:this.type,data:JSON.stringify(this.data),originalSuggestionId:this.originalSuggestionId,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){var t;return new s(e.id,e.documentId,e.type,JSON.parse(e.data),null!==(t=e.originalSuggestionId)&&void 0!==t?t:null,e.attributes?JSON.parse(e.attributes):null)}}t.default=s,s.TYPE="101",s.READABLE_TYPE_NAME="addSuggestion",s.DESCRIPTOR_NAME="TrackChangesAddSuggestionMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2},type:{type:"string",id:3},data:{type:"string",id:4},originalSuggestionId:{type:"string",id:5},attributes:{type:"string",id:6}}}},3268:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n){super(),this.ids=e,this.documentId=t,this.state=n}toJSON(){return{ids:this.ids,documentId:this.documentId,state:this.state}}static fromJSON(e){return new s(e.ids,e.documentId,e.state)}}t.default=s,s.TYPE="106",s.READABLE_TYPE_NAME="batchUpdateSuggestionsState",s.DESCRIPTOR_NAME="TrackChangesBatchUpdateSuggestionsStateMessage",s.DESCRIPTOR={fields:{ids:{type:"string",rule:"repeated",id:1},documentId:{type:"string",id:2},state:{type:"string",id:3}}}},144:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="105",s.READABLE_TYPE_NAME="connectToSuggestions",s.DESCRIPTOR_NAME="TrackChangesConnectMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},2679:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="102",s.READABLE_TYPE_NAME="getAllSuggestions",s.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},1659:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t){super(),this.id=e,this.documentId=t}toJSON(){return{id:this.id,documentId:this.documentId}}static fromJSON(e){return new s(e.id,e.documentId)}}t.default=s,s.TYPE="103",s.READABLE_TYPE_NAME="getSuggestion",s.DESCRIPTOR_NAME="TrackChangesGetSuggestionMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2}}}},598:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r,o,s=null){super(),this.id=e,this.documentId=t,this.hasComments=n,this.isHasCommentsModified=r,this.state=o,this.attributes=s}toJSON(){return{id:this.id,documentId:this.documentId,hasComments:this.hasComments,isHasCommentsModified:this.isHasCommentsModified,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new s(e.id,e.documentId,e.hasComments,e.isHasCommentsModified,e.state,e.attributes?JSON.parse(e.attributes):null)}}t.default=s,s.TYPE="104",s.READABLE_TYPE_NAME="updateSuggestion",s.DESCRIPTOR_NAME="TrackChangesUpdateSuggestionMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2},hasComments:{type:"bool",id:3},isHasCommentsModified:{type:"bool",id:4},state:{type:"string",id:5},attributes:{type:"string",id:6}}}},3111:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r,o,s,i={},a=null){super(),this.id=e,this.authorId=t,this.type=n,this.hasComments=o,this.state=s,this.data=i,this.attributes=a,this.createdAt=r?new Date(r):void 0}toJSON(){var e;return{id:this.id,authorId:this.authorId,type:this.type,createdAt:null===(e=this.createdAt)||void 0===e?void 0:e.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new s(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}t.default=s,s.DESCRIPTOR_NAME="TrackChangesAddSuggestionResponse",s.DESCRIPTOR={fields:{id:{type:"string",id:1},authorId:{type:"string",id:2},type:{type:"string",id:3},createdAt:{type:"string",id:4},data:{type:"string",id:5},hasComments:{type:"bool",id:6},state:{type:"string",id:7},attributes:{type:"string",id:8}}}},701:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(1706));class i extends o.default{constructor(e,t,n){super(),this.channel=e,this._suggestions=t,this._suggestionsV2=n,this.suggestions=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(s.default.toJSON)}}static fromJSON(e){var t,n;return new i(e.channel,null===(t=e.suggestions)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(s.default.fromJSON))}}t.default=i,i.DESCRIPTOR_NAME="TrackChangesConnectResponse",i.DESCRIPTOR={fields:{channel:{type:"string",id:1},suggestions:{type:"string",rule:"repeated",id:2},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:3}}}},3390:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(1706));class i extends o.default{constructor(e,t){super(),this._suggestions=e,this._suggestionsV2=t,this.suggestions=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(s.default.toJSON)}}static fromJSON(e){var t,n;return new i(null===(t=e.suggestions)||void 0===t?void 0:t.map(a),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(s.default.fromJSON))}}function a(e){const t=JSON.parse(e);return t.createdAt=t.createdAt?new Date(t.createdAt):void 0,t}t.default=i,i.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionsResponse",i.DESCRIPTOR={fields:{suggestions:{type:"string",rule:"repeated",id:1},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:2}}}},5930:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r,o,s,i={},a=null){super(),this.id=e,this.authorId=t,this.type=n,this.hasComments=o,this.state=s,this.data=i,this.attributes=a,this.createdAt=new Date(r)}toJSON(){return{id:this.id,authorId:this.authorId,type:this.type,createdAt:this.createdAt.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new s(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}t.default=s,s.DESCRIPTOR_NAME="TrackChangesGetSuggestionResponse",s.DESCRIPTOR={fields:{id:{type:"string",id:1},authorId:{type:"string",id:2},type:{type:"string",id:3},createdAt:{type:"string",id:4},data:{type:"string",id:5},hasComments:{type:"bool",id:6},state:{type:"string",id:7},attributes:{type:"string",id:8}}}},125:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const a=n(2209),c=i(n(3596)),u=i(n(597)),d=i(n(3111)),l=i(n(1659)),p=i(n(5930)),h=i(n(2679)),f=i(n(3390)),m=i(n(598)),y=i(n(144)),g=i(n(701)),b=i(n(357)),O=s(n(7158)),v=i(n(6314)),w=i(n(8801)),x=i(n(3268));t._SERVICE=10;class _{constructor(e){this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==O.WEB_SOCKET_GATEWAY_STATES.CONNECTED)throw new b.default("WebSocket Gateway is not connected.",e);const n=new y.default(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const r=await e._sendRequest(t._SERVICE,y.default.TYPE,c.default.encode(n)),o=c.default.decode(r,g.default);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:O.default._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,o.channel),this._isConnected=!0,this.fire("connected"),o.suggestions}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this.fire("disconnected"),this.stopListening())}async add(e,t,n,r=null,o){const s=new u.default(e,this._documentId,t,n,r,o),i=await this._sendRequest(u.default.TYPE,s);return c.default.decode(i,d.default)}async get(e,t=1){const n=new l.default(e,this._documentId);try{const e=await this._sendRequest(l.default.TYPE,n);return c.default.decode(e,p.default)}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&t<5)return await(r=100*t,new Promise((e=>{setTimeout(e,r)}))),this.get(e,t+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw w.default.fromPublicError(n)}var r}async getAll(){const e=new h.default(this._documentId),t=await this._sendRequest(h.default.TYPE,e),{suggestions:n}=c.default.decode(t,f.default);return n}async update(e,t={}){const{hasComments:n,state:r,attributes:o}=t,s=void 0!==n,i=new m.default(e,this._documentId,n,s,r,o);await this._sendRequest(m.default.TYPE,i)}async batchUpdateState(e){const t=new x.default(e.ids,this._documentId,e.state);await this._sendRequest(x.default.TYPE,t)}_connectToChannel(e,t){this._channel=e._getChannel(_._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(m.default.TYPE),((e,t)=>{const n=c.default.decode(t,m.default);this.fire("suggestionUpdated",n)}))}_onWsGatewayStateChange(e){e===O.WEB_SOCKET_GATEWAY_STATES.DISCONNECTED&&this.disconnect()}_sendRequest(e,n){if(!this._wsGateway||!this._isConnected)throw new v.default("Track Changes",this);return this._wsGateway._sendRequest(t._SERVICE,e,c.default.encode(n))}}_._SERVICE=t._SERVICE,(0,a.mix)(_,a.EmitterMixin),t.default=_},7204:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.ids=e}toJSON(){return{ids:this.ids}}static fromJSON(e){return new s(e.ids)}}t.default=s,s.TYPE="22",s.READABLE_TYPE_NAME="getManyUsers",s.DESCRIPTOR_NAME="GetManyUsersMessage",s.DESCRIPTOR={fields:{ids:{id:1,type:"string",rule:"repeated"}}}},1779:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new s(e.id)}}t.default=s,s.TYPE="21",s.READABLE_TYPE_NAME="getUser",s.DESCRIPTOR_NAME="GetUserMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1}}}},624:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.users=e}toJSON(){return{users:this.users.map(i)}}static fromJSON(e){return new s(e.users.map(a))}}function i(e){return{attributes:Object.keys(e).map((t=>({key:t,value:JSON.stringify(e[t])})))}}function a(e){return e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{})}t.default=s,s.DESCRIPTOR_NAME="GetManyUsersResponse",s.DESCRIPTOR={fields:{users:{rule:"repeated",type:"UserDescriptor",id:1}}}},2184:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.attributes=e}toJSON(){return{attributes:Object.keys(this.attributes).map((e=>({key:e,value:JSON.stringify(this.attributes[e])})))}}static fromJSON(e){const t=e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{});return new s(t)}}t.default=s,s.DESCRIPTOR_NAME="GetUserResponse",s.DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}}},7530:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(1779)),s=r(n(2184)),i=r(n(3596)),a=r(n(7204)),c=r(n(624));class u{constructor(e={}){this._attributes=new Map;for(const t of Object.keys(e))"id"!==t?(this._attributes.set(t,e[t]),Object.defineProperty(this,t,{enumerable:!0,configurable:!1,get:()=>this._attributes.get(t)})):this.id=e.id}static fromData(e){return new u(e)}static async get(e,t){const n=new o.default(t);try{const t=await e._sendRequest(u._SERVICE,o.default.TYPE,i.default.encode(n)),r=i.default.decode(t,s.default);return new u(r.attributes)}catch(e){return new u({id:t})}}static async getMany(e,t){const n=new a.default(t);try{const t=await e._sendRequest(u._SERVICE,a.default.TYPE,i.default.encode(n));return i.default.decode(t,c.default).users.map((e=>new u(e)))}catch(e){return t.map((e=>new u({id:e})))}}}u._SERVICE=2,t.default=u},6754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="43.0.0"},1573:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(2209),s=r(n(3554)),i=r(n(3596));class a{constructor(e,t,n){this._channelName=e,this._wsGateway=t,this._socket=n,this._subscribeToChannel()}remove(){this._socket.off(this._channelName)}getEventName(e,t=!1){let n="";return t&&(n+="all:"),n+="event",e&&(n+=":"+e),n}_subscribeToChannel(){this._socket.on(this._channelName,(e=>{const t=i.default.decode(e,s.default);this.fire(this.getEventName(t.type,!0),t.data,t.socketId),t.socketId!==this._wsGateway.socketId&&this.fire(this.getEventName(t.type),t.data,t.socketId)}))}}(0,o.mix)(a,o.EmitterMixin),t.default=a},3554:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n){super(),this.type=e,this.socketId=t,this.data=n}toJSON(){return{type:this.type,socketId:this.socketId,data:this.data}}static fromJSON(e){return new s(e.type,e.socketId,e.data)}}t.default=s,s.DESCRIPTOR_NAME="ChannelMessage",s.DESCRIPTOR={fields:{type:{type:"uint32",id:1},socketId:{type:"string",id:2},data:{type:"bytes",id:3}}}},8735:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(4990)),s=r(n(3596));t.default=class{encode(e,t,n,r="/",i={}){if(t.length>2)throw new Error("PacketParser supports only 2 elements in data");const a={type:e,data:t,id:n,nsp:r};return s.default.encode(o.default.create(a,i))}decode(e){const t=s.default.decode(e,o.default);return{packet:{id:t.id,type:t.type,data:t.packetData,nsp:t.nsp},options:{flags:t.options.flags,rooms:t.options.rooms,except:t.options.except}}}}},2854:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.BUFFER,c.MessageDataTypes.BUFFER),u.DESCRIPTOR_NAME="BytesBytesPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"bytes",id:1},data1:{type:"bytes",id:2}}}},4253:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.NUMBER,c.MessageDataTypes.BUFFER),u.DESCRIPTOR_NAME="NumberBytesPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"bytes",id:2}}}},1433:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.NUMBER,c.MessageDataTypes.NUMBER),u.DESCRIPTOR_NAME="NumberNumberPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"uint32",id:2}}}},2272:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new u(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.NUMBER,c.MessageDataTypes.OBJECT),u.DESCRIPTOR_NAME="NumberObjectPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}}},1692:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.NUMBER,c.MessageDataTypes.STRING),u.DESCRIPTOR_NAME="NumberStringPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}}},7239:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1}}static fromJSON(e){return new u(e.data&&JSON.parse(e.data),e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.OBJECT,c.MessageDataTypes.BUFFER),u.DESCRIPTOR_NAME="ObjectBufferPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}}},9075:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new u(e.data&&JSON.parse(e.data),e.data1&&JSON.parse(e.data1))}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.OBJECT,c.MessageDataTypes.OBJECT),u.DESCRIPTOR_NAME="ObjectObjectPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}}},799:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{static create(e,t){throw new TypeError("Must be implemented in a child class!")}}t.default=s,e.exports=s},4990:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3596)),s=r(n(3545)),i=r(n(338)),a=r(n(817)),c=r(n(4253)),u=r(n(6335)),d=r(n(2854)),l=r(n(9769)),p=r(n(2272)),h=r(n(9075)),f=r(n(7239)),m=r(n(1797)),y=r(n(1694)),g=r(n(1433)),b=r(n(1692)),O=[c.default,u.default,d.default,l.default,p.default,h.default,f.default,m.default,y.default,g.default,b.default].reduce(((e,t)=>(e[t.TYPE]=t,e)),{});class v extends s.default{constructor(e,t,n,r="/",o=new i.default){super(),this.type=e,this.data=t,this.id=n,this.nsp=r,this.options=o}get packetData(){return void 0===this.data.data&&void 0===this.data.data1?[]:this.data.data&&void 0===this.data.data1?[this.data.data]:[this.data.data,this.data.data1]}toJSON(){const e=o.default.encode(this.options),t=o.default.encode(this.data);return{type:this.type+10*this.data.constructor.TYPE,id:this.id,nsp:"/"===this.nsp?void 0:this.nsp,data:t,options:e}}static fromJSON(e){const t=Math.floor(e.type/10);return new v(e.type-10*t,o.default.decode(e.data,O[t]),e.id,e.nsp,e.options?o.default.decode(e.options,i.default):new i.default)}static create(e,t={}){var n;const r=a.default.getPacketType(a.default.getType(e.data[0]),a.default.getType(null!==(n=e.data[1])&&void 0!==n?n:e.data[0]));return new v(e.type,O[r].create(e.data[0],e.data[1]),e.id,e.nsp,new i.default(t.flags,t.rooms,t.except))}}t.default=v,v.TYPE=10,v.DESCRIPTOR_NAME="PacketMessage",v.DESCRIPTOR={fields:{type:{type:"uint32",id:1},id:{type:"uint32",id:2},nsp:{type:"string",id:3},data:{type:"bytes",id:4},options:{type:"bytes",id:5}}}},338:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t=[],n=[]){super(),this.flags=e,this.rooms=t,this.except=n}toJSON(){var e,t;return{flags:this.flags?JSON.stringify(this.flags):void 0,rooms:(null===(e=this.rooms)||void 0===e?void 0:e.length)?this.rooms:void 0,except:(null===(t=this.except)||void 0===t?void 0:t.length)?this.except:void 0}}static fromJSON(e){return new s(e.flags&&JSON.parse(e.flags),e.rooms,e.except)}}t.default=s,s.TYPE=11,s.DESCRIPTOR_NAME="PacketOptionsMessage",s.DESCRIPTOR={fields:{flags:{type:"string",id:1},rooms:{type:"string",id:2,rule:"repeated"},except:{type:"string",id:3,rule:"repeated"}}}},6335:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.STRING,c.MessageDataTypes.BUFFER),u.DESCRIPTOR_NAME="StringBytesPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}}},1694:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.STRING,c.MessageDataTypes.NUMBER),u.DESCRIPTOR_NAME="StringNumberPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"uint32",id:2}}}},9769:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new u(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.STRING,c.MessageDataTypes.OBJECT),u.DESCRIPTOR_NAME="StringObjectPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}}},1797:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.STRING,c.MessageDataTypes.STRING),u.DESCRIPTOR_NAME="StringStringPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}}},2069:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=t.ENCODED_TYPES=void 0;const o=n(9881),s=r(n(8735)),i=r(n(817));t.ENCODED_TYPES=[o.PacketType.EVENT,o.PacketType.ACK,o.PacketType.BINARY_ACK,o.PacketType.BINARY_EVENT];class a extends o.Encoder{constructor(e=new s.default){super(),this._packetParser=e}encode(e){if(t.ENCODED_TYPES.includes(e.type))try{return[this._packetParser.encode(e.type,e.data,e.id,e.nsp)]}catch(e){console.error("Can not properly serialize or deserialize messages. Check the original error.",{originalError:{message:e.message}})}return super.encode(e)}}t.Encoder=a;class c extends o.Decoder{constructor(e=new s.default){super(),this._packetParser=e}add(e){if(!i.default.isBuffer(e))return super.add(e);let t;try{t=this._packetParser.decode(e).packet}catch(t){return super.add(e)}super.emitReserved("decoded",t)}}t.Decoder=c},817:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageDataTypes=void 0;const n=!("undefined"==typeof process||!process.versions||!process.versions.node);var r,o;(o=r=t.MessageDataTypes||(t.MessageDataTypes={}))[o.BUFFER=1]="BUFFER",o[o.STRING=2]="STRING",o[o.NUMBER=3]="NUMBER",o[o.OBJECT=4]="OBJECT";class s{static getPacketType(...e){let t=0;for(let n=0;n<e.length;n++)t+=e[n]*Math.pow(10,e.length-n-1);return t}static getType(e){if(s.isBuffer(e))return r.BUFFER;const t=typeof e;return"string"===t?r.STRING:"number"===t?r.NUMBER:r.OBJECT}static isBuffer(e){return n&&Buffer.isBuffer(e)||e instanceof ArrayBuffer||e instanceof Uint8Array||this._isBufferView(e)}static _isBufferView(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}}t.default=s},1113:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(357));class s{constructor(e,t){this._context=e,this._deferredPromise=function(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return{resolve:e,reject:t,promise:n}}(),this.timeout=setTimeout((()=>this.error(new o.default("Request timeout.",this._context))),t)}get promise(){return this._deferredPromise.promise}response(e){this._deferredPromise.resolve(e)}error(e){this._deferredPromise.reject(e)}}t.default=class{constructor(e){this._context=e,this._requests=new Set}async send(e,t=45e3){const n=this._createRequest(t);try{return e(n),await n.promise}finally{this._finishRequest(n)}}errorAll(e){for(const t of this._requests)t.error(e)}waitForAllRequests(e=45e3){return this._waitForRequests(e)}_createRequest(e){const t=new s(this._context,e);return this._requests.add(t),t}_finishRequest(e){this._requests.delete(e),clearTimeout(e.timeout)}async _waitForRequests(e=5e3,t=0){return!this._requests.size||t>=e/500?Promise.resolve():(await new Promise((e=>{setTimeout(e,500)})),this._waitForRequests(e,t++))}}},7158:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WEB_SOCKET_GATEWAY_STATES=void 0;const o=n(8623),s=r(n(9655)),i=n(2209),a=r(n(1573)),c=r(n(7530)),u=r(n(6754)),d=r(n(357)),l=r(n(8801)),p=n(2069),h=r(n(1113));var f,m;(m=f=t.WEB_SOCKET_GATEWAY_STATES||(t.WEB_SOCKET_GATEWAY_STATES={})).DISCONNECTED="disconnected",m.CONNECTING="connecting",m.CONNECTED="connected";class y{constructor(e,t,n={},r=o.io,i=c.default.get){if(this._token=t,this._options=n,this._connectionProvider=r,this._userFactory=i,this._requestsManager=new h.default(this),this._channels=new Map,this._connectionAttempt=0,!e)throw new TypeError("Api address must be provided.");if(!this._token)throw new TypeError("Token must be provided.");this._options.requestTimeout||(this._options.requestTimeout=2e4),this._url=(0,s.default)(e.replace(/^(?!(?:\w+:)?\/\/)/,"https://")),this.set("state","disconnected"),this.set("socketId",void 0),this.set("me",void 0),this.on("change:state",(async(e,t,n)=>{var r;if(this._debugEvent("ws-gw:change:state",n),n!==y.STATE_CONNECTED){if(n===y.STATE_DISCONNECTED)return this._requestsManager.errorAll(new d.default("Not connected.",this))}else try{this.me=await this._userFactory.call(c.default,this,null===(r=this._socketAuth)||void 0===r?void 0:r.userId)}catch(e){}}),{priority:y._CHANGE_STATE_EVENT_PRIORITY}),this.on("error",((e,t)=>{this._options.onError?this._options.onError(t):console.error(t)}))}get sessionId(){return this.socketId}waitForAllRequests(e){return this._requestsManager.waitForAllRequests(e)}disconnect(){var e;this.state!==f.DISCONNECTED&&(null===(e=this._socket)||void 0===e||e.disconnect(),this._socket=void 0,this.state=f.DISCONNECTED)}async reconnect(){this._socket||this.state!==f.DISCONNECTED||(await this._token.refreshToken(),await this._connect())}static async connect(e,t="local.cs.dev:443/ws-v2",n={},r=o.io,s=c.default.get){const i=new y(t,e,n,r,s);return await i._connect(),i}_sendRequest(e,t,n){if(!e)throw new d.default("`serviceName` must be provided.",this);if(this.state!==y.STATE_CONNECTED)throw new d.default("Not connected.",this);if(!this._socketAuth||!this._socketAuth.isAuthenticated)throw new d.default("Not authenticated.",this);const r=new ArrayBuffer(n.length+2),o=new Uint8Array(r);return o[0]=e,o[1]=parseInt(t),o.set(n,2),this._emit(1,o)}_getChannel(e,t){const n=""+e+t;return!this._channels.has(n)&&this._socket&&this._channels.set(n,new a.default(n,this,this._socket)),this._channels.get(n)}_connect(){return new Promise(((e,t)=>{const n=this._setupSocket();!this.socketId&&n.io.on("reconnect_error",(()=>{this._debugEvent("reconnect_error"),this._reconnectionAttemptError(t)})),n.once("connect",(async()=>{this._debugEvent("once-connect");try{await this._onConnect(),e()}catch(e){t(e)}})),n.connect()}))}_getPortByProtocol(e){return["http:","ws:"].includes(e)?80:443}_setupSocket(){var e;if(this._socket)return this._socket;const t=this._url.port||this._getPortByProtocol(this._url.protocol),n=(this._url.protocol||"https:")+"//"+this._url.hostname+":"+t,r=this._url.pathname.match(/^\/.*\/ws/)?this._url.pathname.split("/ws")[0]:"",o=this._connectionProvider(n,{parser:{Encoder:p.Encoder,Decoder:p.Decoder},path:r+"/ws-v2/ws",transports:["websocket"],timeout:void 0!==this._options.timeout?this._options.timeout:5e3,reconnection:void 0===this._options.autoReconnect||this._options.autoReconnect,reconnectionDelay:1e3,reconnectionDelayMax:5e3,rejectUnauthorized:void 0===this._options.rejectUnauthorized||this._options.rejectUnauthorized,query:{version:u.default},agent:null!==(e=this._options.agent)&&void 0!==e&&e,closeOnBeforeunload:!1});return this.state=f.CONNECTING,o.on("connect",(()=>{this._debugEvent("connect"),this.socketId=o.id})),o.on("connect_error",(e=>{this._debugEvent("connect_error",e)})),o.on("disconnect",(()=>{this._debugEvent("disconnect"),this._onDisconnect()})),o.io.on("reconnect",(async()=>{this._debugEvent("reconnect"),await this._onReconnect()})),o.io.on("reconnect_attempt",(e=>{this._debugEvent("reconnect_attempt",e),this.state=f.CONNECTING,this._connectionAttempt=e})),o.on("unauthorized",(e=>{this._debugEvent("unauthorized"),this._onUnauthorized(e)})),o.on("authenticationRequest",(async e=>{this._debugEvent("authenticationRequest",e.attempt),await this._onReconnect()})),this._socket=o,o}_emit(e,t){const n=this._socket;return this._requestsManager.send((r=>{n.emit(e,t,((e,t)=>{if(e)return r.error(l.default.fromPublicError(e));r.response(t)}))}),this._options.requestTimeout)}_addAuthData(e,t){this._socketAuth={environmentId:e,userId:t,isAuthenticated:!0}}_removeAuthData(){this._socketAuth=void 0}async _onConnect(){await this._authenticate(this._token.value),this.state=f.CONNECTED;const e=async(e,t,n)=>{this._debugEvent("token:value:change");try{await this._authenticate(n)}catch(e){}};this._token.on("change:value",e),this._socket.io.off("reconnect_error"),this.on("disconnect",(()=>{this._token.off("change:value",e)}))}async _onReconnect(){await this._token.refreshToken(),await this._onConnect()}_onDisconnect(){this.state=f.DISCONNECTED,this._connectionAttempt=0,this.fire("disconnect");for(const e of this._channels.values())e.remove();this._channels.clear(),void 0===this._options.autoReconnect||this._options.autoReconnect||(this._socket=void 0)}_debugEvent(e,t){if(!this._isDebugModeEnabled())return;const n=void 0!==t?", data: "+t:"";console.info((new Date).toLocaleString()+" "+e+n)}_reconnectionAttemptError(e){this._connectionAttempt>=2&&(this.disconnect(),e(d.default.fromPublicError({message:"The number of initial connection attempts exceeded.",explanation:"Three initial connection attempts failed. It can be caused by a missing or blocked Internet connection.",action:"Please verify the stability of your Internet connection and ensure that no antivirus or firewall software blocks the Web Socket protocol connections."})))}_onUnauthorized({error:e}){this._removeAuthData(),this.fire("error",l.default.fromPublicError(e))}async _authenticate(e){try{this._debugEvent("authenticate:start");const t=await this._emit(2,{token:e});this._debugEvent("authenticate:success","envId: "+t.environmentId+", userId: "+t.userId),this._addAuthData(t.environmentId,t.userId)}catch(e){throw this._debugEvent("authenticate:error",e.message),this._removeAuthData(),e}}_isDebugModeEnabled(){var e;return!!i.global.window.localStorage&&"true"===(null!==(e=i.global.window.localStorage.getItem("csClientDebugMode"))&&void 0!==e?e:"false").toLowerCase()}}y.STATE_DISCONNECTED=f.DISCONNECTED,y.STATE_CONNECTING=f.CONNECTING,y.STATE_CONNECTED=f.CONNECTED,y._CHANGE_STATE_EVENT_PRIORITY=i.priorities.get("highest")+999999,(0,i.mix)(y,i.ObservableMixin),t.default=y},1993:(e,t,n)=>{"use strict";e.exports=n(7484)},7484:(e,t,n)=>{"use strict";var r=t;function o(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(5394),r.BufferWriter=n(6743),r.Reader=n(9967),r.BufferReader=n(6609),r.util=n(1439),r.rpc=n(5698),r.roots=n(2083),r.configure=o,o()},9967:(e,t,n)=>{"use strict";e.exports=c;var r,o=n(1439),s=o.LongBits,i=o.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,d="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return o.Buffer?function(e){return(c.create=function(e){return o.Buffer.isBuffer(e)?new r(e):d(e)})(e)}:d};function p(){var e=new s(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new s(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},c.prototype.string=function(){var e=this.bytes();return i.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){r=e,c.create=l(),r._configure();var t=o.Long?"toLong":"toNumber";o.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},6609:(e,t,n)=>{"use strict";e.exports=s;var r=n(9967);(s.prototype=Object.create(r.prototype)).constructor=s;var o=n(1439);function s(e){r.call(this,e)}s._configure=function(){o.Buffer&&(s.prototype._slice=o.Buffer.prototype.slice)},s.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},s._configure()},2083:e=>{"use strict";e.exports={}},5698:(e,t,n)=>{"use strict";t.Service=n(1754)},1754:(e,t,n)=>{"use strict";e.exports=o;var r=n(1439);function o(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(o.prototype=Object.create(r.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,n,o,s,i){if(!s)throw TypeError("request must be specified");var a=this;if(!i)return r.asPromise(e,a,t,n,o,s);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](s).finish(),(function(e,n){if(e)return a.emit("error",e,t),i(e);if(null!==n){if(!(n instanceof o))try{n=o[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),i(e)}return a.emit("data",n,t),i(null,n)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){i(e)}),0)}else setTimeout((function(){i(Error("already ended"))}),0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},5015:(e,t,n)=>{"use strict";e.exports=o;var r=n(1439);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=o.zero=new o(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var i=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new o(n,r)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(r.isString(e)){if(!r.Long)return o.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):s},o.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;o.fromHash=function(e){return e===i?s:new o((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},o.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},o.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},1439:function(e,t,n){"use strict";var r=t;function o(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;++o)void 0!==e[r[o]]&&n||(e[r[o]]=t[r[o]]);return e}function s(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&o(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}r.asPromise=n(537),r.base64=n(9745),r.EventEmitter=n(4459),r.float=n(897),r.inquire=n(3229),r.utf8=n(113),r.pool=n(7986),r.LongBits=n(5015),r.isNode=Boolean(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),r.global=r.isNode&&n.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=o,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=s,r.ProtocolError=s("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},5394:(e,t,n)=>{"use strict";e.exports=l;var r,o=n(1439),s=o.LongBits,i=o.base64,a=o.utf8;function c(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function u(){}function d(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return o.Buffer?function(){return(l.create=function(){return new r})()}:function(){return new l}};function h(e,t,n){t[n]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function y(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}l.create=p(),l.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(l.alloc=o.pool(l.alloc,o.Array.prototype.subarray)),l.prototype._push=function(e,t,n){return this.tail=this.tail.next=new c(e,t,n),this.len+=t,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(m,10,s.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=s.from(e);return this._push(m,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(m,t.length(),t)},l.prototype.bool=function(e){return this._push(h,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=s.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var g=o.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(o.isString(e)){var n=l.alloc(t=i.length(e));i.decode(e,n,0),e=n}return this.uint32(t)._push(g,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},l.prototype.fork=function(){return this.states=new d(this),this.head=this.tail=new c(u,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},l._configure=function(e){r=e,l.create=p(),r._configure()}},6743:(e,t,n)=>{"use strict";e.exports=s;var r=n(5394);(s.prototype=Object.create(r.prototype)).constructor=s;var o=n(1439);function s(){r.call(this)}function i(e,t,n){e.length<40?o.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}s._configure=function(){s.alloc=o._Buffer_allocUnsafe,s.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},s.prototype.bytes=function(e){o.isString(e)&&(e=o._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(s.writeBytesBuffer,t,e),this},s.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this._push(i,t,e),this},s._configure()},537:e=>{"use strict";e.exports=function(e,t){var n=new Array(arguments.length-1),r=0,o=2,s=!0;for(;o<arguments.length;)n[r++]=arguments[o++];return new Promise((function(o,i){n[r]=function(e){if(s)if(s=!1,e)i(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];o.apply(null,t)}};try{e.apply(t||null,n)}catch(e){s&&(s=!1,i(e))}}))}},9745:(e,t)=>{"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),o=new Array(123),s=0;s<64;)o[r[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;n.encode=function(e,t,n){for(var o,s=null,i=[],a=0,c=0;t<n;){var u=e[t++];switch(c){case 0:i[a++]=r[u>>2],o=(3&u)<<4,c=1;break;case 1:i[a++]=r[o|u>>4],o=(15&u)<<2,c=2;break;case 2:i[a++]=r[o|u>>6],i[a++]=r[63&u],c=0}a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,i)),a=0)}return c&&(i[a++]=r[o],i[a++]=61,1===c&&(i[a++]=61)),s?(a&&s.push(String.fromCharCode.apply(String,i.slice(0,a))),s.join("")):String.fromCharCode.apply(String,i.slice(0,a))};var i="invalid encoding";n.decode=function(e,t,n){for(var r,s=n,a=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&a>1)break;if(void 0===(u=o[u]))throw Error(i);switch(a){case 0:r=u,a=1;break;case 1:t[n++]=r<<2|(48&u)>>4,r=u,a=2;break;case 2:t[n++]=(15&r)<<4|(60&u)>>2,r=u,a=3;break;case 3:t[n++]=(3&r)<<6|u,a=0}}if(1===a)throw Error(i);return n-s},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},4459:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},897:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3]}function s(e,r,o){t[0]=e,r[o]=n[3],r[o+1]=n[2],r[o+2]=n[1],r[o+3]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function a(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?o:s,e.writeFloatBE=r?s:o,e.readFloatLE=r?i:a,e.readFloatBE=r?a:i}():function(){function t(e,t,n,r){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var s=Math.floor(Math.log(t)/Math.LN2);e((o<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,n,r)}}function i(e,t,n){var r=e(t,n),o=2*(r>>31)+1,s=r>>>23&255,i=8388607&r;return 255===s?i?NaN:o*(1/0):0===s?1401298464324817e-60*o*i:o*Math.pow(2,s-150)*(i+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=i.bind(null,o),e.readFloatBE=i.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function s(e,r,o){t[0]=e,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function a(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?o:s,e.writeDoubleBE=r?s:o,e.readDoubleLE=r?i:a,e.readDoubleBE=r?a:i}():function(){function t(e,t,n,r,o,s){var i=r<0?1:0;if(i&&(r=-r),0===r)e(0,o,s+t),e(1/r>0?0:2147483648,o,s+n);else if(isNaN(r))e(0,o,s+t),e(2146959360,o,s+n);else if(r>17976931348623157e292)e(0,o,s+t),e((i<<31|2146435072)>>>0,o,s+n);else{var a;if(r<22250738585072014e-324)e((a=r/5e-324)>>>0,o,s+t),e((i<<31|a/4294967296)>>>0,o,s+n);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=r*Math.pow(2,-c))>>>0,o,s+t),e((i<<31|c+1023<<20|1048576*a&1048575)>>>0,o,s+n)}}}function i(e,t,n,r,o){var s=e(r,o+t),i=e(r,o+n),a=2*(i>>31)+1,c=i>>>20&2047,u=4294967296*(1048575&i)+s;return 2047===c?u?NaN:a*(1/0):0===c?5e-324*a*u:a*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=i.bind(null,o,0,4),e.readDoubleBE=i.bind(null,s,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},3229:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},7986:e=>{"use strict";e.exports=function(e,t,n){var r=n||8192,o=r>>>1,s=null,i=r;return function(n){if(n<1||n>o)return e(n);i+n>r&&(s=e(r),i=0);var a=t.call(s,i,i+=n);return 7&i&&(i=1+(7|i)),a}}},113:(e,t)=>{"use strict";var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,o=null,s=[],i=0;t<n;)(r=e[t++])<128?s[i++]=r:r>191&&r<224?s[i++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[i++]=55296+(r>>10),s[i++]=56320+(1023&r)):s[i++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],i>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),i=0);return o?(i&&o.push(String.fromCharCode.apply(String,s.slice(0,i))),o.join("")):String.fromCharCode.apply(String,s.slice(0,i))},n.write=function(e,t,n){for(var r,o,s=n,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(o=e.charCodeAt(i+1)))?(r=65536+((1023&r)<<10)+(1023&o),++i,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-s}},3286:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(7758),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".ck.ck-balloon-panel.ck-tooltip{pointer-events:none;z-index:calc(var(--ck-z-modal) + 100)}:root{--ck-color-presence-list-dropdown-background:#fff;--ck-color-presence-list-dropdown-arrow-border:#ebebeb;--ck-presence-list-dropdown-list-max-width:250px;--ck-presence-list-dropdown-list-min-width:180px;--ck-presence-list-users-tooltip-max-width:120px;--ck-presence-list-users-tooltip-min-width:25px}.ck.ck-presence-list{align-items:center;display:flex;font-size:var(--ck-font-size-base);margin-right:var(--ck-spacing-standard);transition:margin-right .2s ease-in-out}.ck.ck-presence-list *{box-sizing:border-box}.ck.ck-presence-list__list{display:flex;justify-content:flex-end}.ck.ck-presence-list__counter{color:var(--ck-color-base-text)}.ck.ck-presence-list__counter--hidden{display:none}.ck.ck-presence-list__list-item{background:none;border:0;color:inherit;font:inherit;margin-left:var(--ck-spacing-standard);outline:none;padding:0;position:relative}.ck.ck-tooltip.ck-presence-list__list-item__tooltip>.ck-tooltip__text{display:inline-block;max-width:var(--ck-presence-list-users-tooltip-max-width);overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__marker{display:block;height:3px;margin-top:3px;position:relative;width:100%}.ck.ck-presence-list--collapsed .ck-presence-list__list{margin-left:var(--ck-spacing-standard);min-width:calc(var(--ck-user-avatar-size)*1.5)}.ck.ck-presence-list--collapsed .ck-presence-list__list *{cursor:pointer;transition:all .4s ease-in-out}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item{margin-left:calc(var(--ck-user-avatar-size)*-1 + 5px)}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(5){opacity:.15}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(4){opacity:.35}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(3){opacity:.55}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(2){opacity:.75}.ck.ck-presence-list__balloon{--ck-color-panel-border:var(--ck-color-presence-list-dropdown-arrow-border);--ck-color-panel-background:var(--ck-color-presence-list-dropdown-background);animation:fadeIn .3s ease-in-out;background-color:var(--ck-color-presence-list-dropdown-background);border:0;opacity:1}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-wrapper{border-radius:var(--ck-border-radius);max-height:80vh;max-width:var(--ck-presence-list-dropdown-list-max-width);min-width:var(--ck-presence-list-dropdown-list-min-width);overflow-x:hidden;overflow-y:auto}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item{align-items:center;background:none;border:0;color:inherit;display:flex;font:inherit;outline:none;padding:0;padding:var(--ck-spacing-standard);position:relative}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:first-of-type .ck-presence-list__marker{border-top-left-radius:var(--ck-border-radius)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:last-of-type .ck-presence-list__marker{border-bottom-left-radius:var(--ck-border-radius)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list .ck-user__full-name{color:var(--ck-color-base-text);margin-left:var(--ck-spacing-standard);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list .ck.ck-presence-list__marker{height:100%;left:0;margin:0;position:absolute;width:3px}.ck-presence-list__balloon button.ck-presence-list__dropdown-list-item *,.ck-presence-list__list button.ck-presence-list__list-item *{cursor:pointer}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}",""]);const s=o},9940:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(7758),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".ck .ck-user__marker{cursor:default;display:inline;position:relative}.ck .ck-user__marker:after{color:#fff;content:attr(data-name);display:none;font-family:Georgia,sans-serif;font-size:var(--ck-font-size-base);font-style:normal;font-weight:400;left:0;line-height:1;opacity:0;padding:var(--ck-spacing-small);position:absolute;top:-20px;transition:opacity .2s linear,transform .3s ease-in-out;white-space:nowrap;z-index:99999}.ck .ck-user__marker:hover .ck-user__marker-dot{width:0}.ck .ck-user__marker:hover:after{animation:fadeInLeft .3s ease-in-out;display:block;opacity:1}.ck .ck-user__marker-line{bottom:0;height:100%;position:absolute;width:0}.ck .ck-user__marker-dot{border-radius:50%;cursor:default;display:block;height:var(--ck-user-dot-size);left:50%;position:absolute;top:calc((var(--ck-user-dot-size)/2)*-1);transform:translate(-50%,-50%);width:var(--ck-user-dot-size)}.ck .ck-placeholder .ck-user__marker{display:none}@keyframes fadeInLeft{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}",""]);const s=o},7758:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var s=0;s<this.length;s++){var i=this[s][0];null!=i&&(o[i]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);r&&o[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},7154:e=>{var t=1e3,n=60*t,r=60*n,o=24*r,s=7*o,i=365.25*o;function a(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,c){c=c||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*i;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*o;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&isFinite(e))return c.long?function(e){var s=Math.abs(e);if(s>=o)return a(e,s,o,"day");if(s>=r)return a(e,s,r,"hour");if(s>=n)return a(e,s,n,"minute");if(s>=t)return a(e,s,t,"second");return e+" ms"}(e):function(e){var s=Math.abs(e);if(s>=o)return Math.round(e/o)+"d";if(s>=r)return Math.round(e/r)+"h";if(s>=n)return Math.round(e/n)+"m";if(s>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},5579:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(3847)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},3847:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,s,i=null;function a(...e){if(!a.enabled)return;const r=a,o=Number(new Date),s=o-(n||o);r.diff=s,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";i++;const s=t.formatters[o];if("function"==typeof s){const t=e[i];n=s.call(r,t),e.splice(i,1),i--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(o!==t.namespaces&&(o=t.namespaces,s=t.enabled(e)),s),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(7154),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},6386:(e,t,n)=>{"use strict";e.exports=n(3278)},3278:(e,t,n)=>{"use strict";var r=t;function o(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(2944),r.BufferWriter=n(2178),r.Reader=n(9867),r.BufferReader=n(2676),r.util=n(4155),r.rpc=n(3290),r.roots=n(284),r.configure=o,o()},9867:(e,t,n)=>{"use strict";e.exports=c;var r,o=n(4155),s=o.LongBits,i=o.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,d="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return o.Buffer?function(e){return(c.create=function(e){return o.Buffer.isBuffer(e)?new r(e):d(e)})(e)}:d};function p(){var e=new s(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new s(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},c.prototype.string=function(){var e=this.bytes();return i.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){r=e,c.create=l(),r._configure();var t=o.Long?"toLong":"toNumber";o.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},2676:(e,t,n)=>{"use strict";e.exports=s;var r=n(9867);(s.prototype=Object.create(r.prototype)).constructor=s;var o=n(4155);function s(e){r.call(this,e)}s._configure=function(){o.Buffer&&(s.prototype._slice=o.Buffer.prototype.slice)},s.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},s._configure()},284:e=>{"use strict";e.exports={}},3290:(e,t,n)=>{"use strict";t.Service=n(979)},979:(e,t,n)=>{"use strict";e.exports=o;var r=n(4155);function o(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(o.prototype=Object.create(r.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,n,o,s,i){if(!s)throw TypeError("request must be specified");var a=this;if(!i)return r.asPromise(e,a,t,n,o,s);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](s).finish(),(function(e,n){if(e)return a.emit("error",e,t),i(e);if(null!==n){if(!(n instanceof o))try{n=o[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),i(e)}return a.emit("data",n,t),i(null,n)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){i(e)}),0)}else setTimeout((function(){i(Error("already ended"))}),0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},8950:(e,t,n)=>{"use strict";e.exports=o;var r=n(4155);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=o.zero=new o(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var i=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new o(n,r)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(r.isString(e)){if(!r.Long)return o.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):s},o.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;o.fromHash=function(e){return e===i?s:new o((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},o.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},o.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},4155:function(e,t,n){"use strict";var r=t;function o(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;++o)void 0!==e[r[o]]&&n||(e[r[o]]=t[r[o]]);return e}function s(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&o(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:()=>e,set:void 0,enumerable:!1,configurable:!0},toString:{value(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}r.asPromise=n(537),r.base64=n(9745),r.EventEmitter=n(4459),r.float=n(897),r.inquire=n(3229),r.utf8=n(113),r.pool=n(7986),r.LongBits=n(8950),r.isNode=Boolean(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),r.global=r.isNode&&n.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=o,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=s,r.ProtocolError=s("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},2944:(e,t,n)=>{"use strict";e.exports=l;var r,o=n(4155),s=o.LongBits,i=o.base64,a=o.utf8;function c(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function u(){}function d(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return o.Buffer?function(){return(l.create=function(){return new r})()}:function(){return new l}};function h(e,t,n){t[n]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function y(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}l.create=p(),l.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(l.alloc=o.pool(l.alloc,o.Array.prototype.subarray)),l.prototype._push=function(e,t,n){return this.tail=this.tail.next=new c(e,t,n),this.len+=t,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(m,10,s.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=s.from(e);return this._push(m,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(m,t.length(),t)},l.prototype.bool=function(e){return this._push(h,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=s.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var g=o.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(o.isString(e)){var n=l.alloc(t=i.length(e));i.decode(e,n,0),e=n}return this.uint32(t)._push(g,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},l.prototype.fork=function(){return this.states=new d(this),this.head=this.tail=new c(u,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},l._configure=function(e){r=e,l.create=p(),r._configure()}},2178:(e,t,n)=>{"use strict";e.exports=s;var r=n(2944);(s.prototype=Object.create(r.prototype)).constructor=s;var o=n(4155);function s(){r.call(this)}function i(e,t,n){e.length<40?o.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}s._configure=function(){s.alloc=o._Buffer_allocUnsafe,s.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},s.prototype.bytes=function(e){o.isString(e)&&(e=o._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(s.writeBytesBuffer,t,e),this},s.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this._push(i,t,e),this},s._configure()},1829:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function o(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var r,s,i=[];for(s in"string"!=typeof t&&(t="?"),e)if(n.call(e,s)){if((r=e[s])||null!=r&&!isNaN(r)||(r=""),s=o(s),r=o(r),null===s||null===r)continue;i.push(s+"="+r)}return i.length?t+i.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,o={};t=n.exec(e);){var s=r(t[1]),i=r(t[2]);null===s||null===i||s in o||(o[s]=i)}return o}},3722:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},7594:(e,t,n)=>{"use strict";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},s=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function a(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},r=[],o=0;o<e.length;o++){var s=e[o],c=t.base?s[0]+t.base:s[0],u=n[c]||0,d="".concat(c," ").concat(u);n[c]=u+1;var l=a(d),p={css:s[1],media:s[2],sourceMap:s[3]};-1!==l?(i[l].references++,i[l].updater(p)):i.push({identifier:d,updater:y(p,t),references:1}),r.push(d)}return r}function u(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var i=s(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var d,l=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function p(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=l(t,o);else{var s=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(s,i[t]):e.appendChild(s)}}function h(e,t,n){var r=n.css,o=n.media,s=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var f=null,m=0;function y(e,t){var n,r,o;if(t.singleton){var s=m++;n=f||(f=u(t)),r=p.bind(null,n,s,!1),o=p.bind(null,n,s,!0)}else n=u(t),r=h.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=a(n[r]);i[o].references--}for(var s=c(e,t),u=0;u<n.length;u++){var d=a(n[u]);0===i[d].references&&(i[d].updater(),i.splice(d,1))}n=s}}}},9655:(e,t,n)=>{"use strict";var r=n(3722),o=n(1829),s=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,d=/^[a-zA-Z]:/;function l(e){return(e||"").toString().replace(s,"")}var p=[["#","hash"],["?","query"],function(e,t){return m(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function f(e){var t,r=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},o={},s=typeof(e=e||r);if("blob:"===e.protocol)o=new g(unescape(e.pathname),{});else if("string"===s)for(t in o=new g(e,{}),h)delete o[t];else if("object"===s){for(t in e)t in h||(o[t]=e[t]);void 0===o.slashes&&(o.slashes=a.test(e.href))}return o}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function y(e,t){e=(e=l(e)).replace(i,""),t=t||{};var n,r=u.exec(e),o=r[1]?r[1].toLowerCase():"",s=!!r[2],a=!!r[3],c=0;return s?a?(n=r[2]+r[3]+r[4],c=r[2].length+r[3].length):(n=r[2]+r[4],c=r[2].length):a?(n=r[3]+r[4],c=r[3].length):n=r[4],"file:"===o?c>=2&&(n=n.slice(2)):m(o)?n=r[4]:o?s&&(n=n.slice(2)):c>=2&&m(t.protocol)&&(n=r[4]),{protocol:o,slashes:s||m(o),slashesCount:c,rest:n}}function g(e,t,n){if(e=(e=l(e)).replace(i,""),!(this instanceof g))return new g(e,t,n);var s,a,c,u,h,b,O=p.slice(),v=typeof t,w=this,x=0;for("object"!==v&&"string"!==v&&(n=t,t=null),n&&"function"!=typeof n&&(n=o.parse),s=!(a=y(e||"",t=f(t))).protocol&&!a.slashes,w.slashes=a.slashes||s&&t.slashes,w.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||d.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(w.protocol)))&&(O[3]=[/(.*)/,"pathname"]);x<O.length;x++)"function"!=typeof(u=O[x])?(c=u[0],b=u[1],c!=c?w[b]=e:"string"==typeof c?~(h="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof u[2]?(w[b]=e.slice(0,h),e=e.slice(h+u[2])):(w[b]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(w[b]=h[1],e=e.slice(0,h.index)),w[b]=w[b]||s&&u[3]&&t[b]||"",u[4]&&(w[b]=w[b].toLowerCase())):e=u(e,w);n&&(w.query=n(w.query)),s&&t.slashes&&"/"!==w.pathname.charAt(0)&&(""!==w.pathname||""!==t.pathname)&&(w.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,o=n[r-1],s=!1,i=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),i++):i&&(0===r&&(s=!0),n.splice(r,1),i--);return s&&n.unshift(""),"."!==o&&".."!==o||n.push(""),n.join("/")}(w.pathname,t.pathname)),"/"!==w.pathname.charAt(0)&&m(w.protocol)&&(w.pathname="/"+w.pathname),r(w.port,w.protocol)||(w.host=w.hostname,w.port=""),w.username=w.password="",w.auth&&(~(h=w.auth.indexOf(":"))?(w.username=w.auth.slice(0,h),w.username=encodeURIComponent(decodeURIComponent(w.username)),w.password=w.auth.slice(h+1),w.password=encodeURIComponent(decodeURIComponent(w.password))):w.username=encodeURIComponent(decodeURIComponent(w.auth)),w.auth=w.password?w.username+":"+w.password:w.username),w.origin="file:"!==w.protocol&&m(w.protocol)&&w.host?w.protocol+"//"+w.host:"null",w.href=w.toString()}g.prototype={set:function(e,t,n){var s=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||o.parse)(t)),s[e]=t;break;case"port":s[e]=t,r(t,s.protocol)?t&&(s.host=s.hostname+":"+t):(s.host=s.hostname,s[e]="");break;case"hostname":s[e]=t,s.port&&(t+=":"+s.port),s.host=t;break;case"host":s[e]=t,c.test(t)?(t=t.split(":"),s.port=t.pop(),s.hostname=t.join(":")):(s.hostname=t,s.port="");break;case"protocol":s.protocol=t.toLowerCase(),s.slashes=!n;break;case"pathname":case"hash":if(t){var i="pathname"===e?"/":"#";s[e]=t.charAt(0)!==i?i+t:t}else s[e]=t;break;case"username":case"password":s[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(s.username=t.slice(0,a),s.username=encodeURIComponent(decodeURIComponent(s.username)),s.password=t.slice(a+1),s.password=encodeURIComponent(decodeURIComponent(s.password))):s.username=encodeURIComponent(decodeURIComponent(t))}for(var u=0;u<p.length;u++){var d=p[u];d[4]&&(s[d[1]]=s[d[1]].toLowerCase())}return s.auth=s.password?s.username+":"+s.password:s.username,s.origin="file:"!==s.protocol&&m(s.protocol)&&s.host?s.protocol+"//"+s.host:"null",s.href=s.toString(),s},toString:function(e){e&&"function"==typeof e||(e=o.stringify);var t,n=this,r=n.host,s=n.protocol;s&&":"!==s.charAt(s.length-1)&&(s+=":");var i=s+(n.protocol&&n.slashes||m(n.protocol)?"//":"");return n.username?(i+=n.username,n.password&&(i+=":"+n.password),i+="@"):n.password?(i+=":"+n.password,i+="@"):"file:"!==n.protocol&&m(n.protocol)&&!r&&"/"!==n.pathname&&(i+="@"),(":"===r[r.length-1]||c.test(n.hostname)&&!n.port)&&(r+=":"),i+=r+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},g.extractProtocol=y,g.location=f,g.trimLeft=l,g.qs=o,e.exports=g},5003:(e,t,n)=>{"use strict";var r;n.r(t),n.d(t,{NIL:()=>E,parse:()=>y,stringify:()=>d,v1:()=>m,v3:()=>P,v4:()=>T,v5:()=>j,validate:()=>a,version:()=>D});var o=new Uint8Array(16);function s(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}const i=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const a=function(e){return"string"==typeof e&&i.test(e)};for(var c=[],u=0;u<256;++u)c.push((u+256).toString(16).substr(1));const d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(c[e[t+0]]+c[e[t+1]]+c[e[t+2]]+c[e[t+3]]+"-"+c[e[t+4]]+c[e[t+5]]+"-"+c[e[t+6]]+c[e[t+7]]+"-"+c[e[t+8]]+c[e[t+9]]+"-"+c[e[t+10]]+c[e[t+11]]+c[e[t+12]]+c[e[t+13]]+c[e[t+14]]+c[e[t+15]]).toLowerCase();if(!a(n))throw TypeError("Stringified UUID is invalid");return n};var l,p,h=0,f=0;const m=function(e,t,n){var r=t&&n||0,o=t||new Array(16),i=(e=e||{}).node||l,a=void 0!==e.clockseq?e.clockseq:p;if(null==i||null==a){var c=e.random||(e.rng||s)();null==i&&(i=l=[1|c[0],c[1],c[2],c[3],c[4],c[5]]),null==a&&(a=p=16383&(c[6]<<8|c[7]))}var u=void 0!==e.msecs?e.msecs:Date.now(),m=void 0!==e.nsecs?e.nsecs:f+1,y=u-h+(m-f)/1e4;if(y<0&&void 0===e.clockseq&&(a=a+1&16383),(y<0||u>h)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");h=u,f=m,p=a;var g=(1e4*(268435455&(u+=122192928e5))+m)%4294967296;o[r++]=g>>>24&255,o[r++]=g>>>16&255,o[r++]=g>>>8&255,o[r++]=255&g;var b=u/4294967296*1e4&268435455;o[r++]=b>>>8&255,o[r++]=255&b,o[r++]=b>>>24&15|16,o[r++]=b>>>16&255,o[r++]=a>>>8|128,o[r++]=255&a;for(var O=0;O<6;++O)o[r+O]=i[O];return t||d(o)};const y=function(e){if(!a(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};function g(e,t,n){function r(e,r,o,s){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=y(r)),16!==r.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var i=new Uint8Array(16+e.length);if(i.set(r),i.set(e,r.length),(i=n(i))[6]=15&i[6]|t,i[8]=63&i[8]|128,o){s=s||0;for(var a=0;a<16;++a)o[s+a]=i[a];return o}return d(i)}try{r.name=e}catch(e){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function b(e){return 14+(e+64>>>9<<4)+1}function O(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function v(e,t,n,r,o,s){return O((i=O(O(t,e),O(r,s)))<<(a=o)|i>>>32-a,n);var i,a}function w(e,t,n,r,o,s,i){return v(t&n|~t&r,e,t,o,s,i)}function x(e,t,n,r,o,s,i){return v(t&r|n&~r,e,t,o,s,i)}function _(e,t,n,r,o,s,i){return v(t^n^r,e,t,o,s,i)}function I(e,t,n,r,o,s,i){return v(n^(t|~r),e,t,o,s,i)}const S=function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){for(var t=[],n=32*e.length,r="0123456789abcdef",o=0;o<n;o+=8){var s=e[o>>5]>>>o%32&255,i=parseInt(r.charAt(s>>>4&15)+r.charAt(15&s),16);t.push(i)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[b(t)-1]=t;for(var n=1732584193,r=-271733879,o=-1732584194,s=271733878,i=0;i<e.length;i+=16){var a=n,c=r,u=o,d=s;n=w(n,r,o,s,e[i],7,-680876936),s=w(s,n,r,o,e[i+1],12,-389564586),o=w(o,s,n,r,e[i+2],17,606105819),r=w(r,o,s,n,e[i+3],22,-1044525330),n=w(n,r,o,s,e[i+4],7,-176418897),s=w(s,n,r,o,e[i+5],12,1200080426),o=w(o,s,n,r,e[i+6],17,-1473231341),r=w(r,o,s,n,e[i+7],22,-45705983),n=w(n,r,o,s,e[i+8],7,1770035416),s=w(s,n,r,o,e[i+9],12,-1958414417),o=w(o,s,n,r,e[i+10],17,-42063),r=w(r,o,s,n,e[i+11],22,-1990404162),n=w(n,r,o,s,e[i+12],7,1804603682),s=w(s,n,r,o,e[i+13],12,-40341101),o=w(o,s,n,r,e[i+14],17,-1502002290),n=x(n,r=w(r,o,s,n,e[i+15],22,1236535329),o,s,e[i+1],5,-165796510),s=x(s,n,r,o,e[i+6],9,-1069501632),o=x(o,s,n,r,e[i+11],14,643717713),r=x(r,o,s,n,e[i],20,-373897302),n=x(n,r,o,s,e[i+5],5,-701558691),s=x(s,n,r,o,e[i+10],9,38016083),o=x(o,s,n,r,e[i+15],14,-660478335),r=x(r,o,s,n,e[i+4],20,-405537848),n=x(n,r,o,s,e[i+9],5,568446438),s=x(s,n,r,o,e[i+14],9,-1019803690),o=x(o,s,n,r,e[i+3],14,-187363961),r=x(r,o,s,n,e[i+8],20,1163531501),n=x(n,r,o,s,e[i+13],5,-1444681467),s=x(s,n,r,o,e[i+2],9,-51403784),o=x(o,s,n,r,e[i+7],14,1735328473),n=_(n,r=x(r,o,s,n,e[i+12],20,-1926607734),o,s,e[i+5],4,-378558),s=_(s,n,r,o,e[i+8],11,-2022574463),o=_(o,s,n,r,e[i+11],16,1839030562),r=_(r,o,s,n,e[i+14],23,-35309556),n=_(n,r,o,s,e[i+1],4,-1530992060),s=_(s,n,r,o,e[i+4],11,1272893353),o=_(o,s,n,r,e[i+7],16,-155497632),r=_(r,o,s,n,e[i+10],23,-1094730640),n=_(n,r,o,s,e[i+13],4,681279174),s=_(s,n,r,o,e[i],11,-358537222),o=_(o,s,n,r,e[i+3],16,-722521979),r=_(r,o,s,n,e[i+6],23,76029189),n=_(n,r,o,s,e[i+9],4,-640364487),s=_(s,n,r,o,e[i+12],11,-421815835),o=_(o,s,n,r,e[i+15],16,530742520),n=I(n,r=_(r,o,s,n,e[i+2],23,-995338651),o,s,e[i],6,-198630844),s=I(s,n,r,o,e[i+7],10,1126891415),o=I(o,s,n,r,e[i+14],15,-1416354905),r=I(r,o,s,n,e[i+5],21,-57434055),n=I(n,r,o,s,e[i+12],6,1700485571),s=I(s,n,r,o,e[i+3],10,-1894986606),o=I(o,s,n,r,e[i+10],15,-1051523),r=I(r,o,s,n,e[i+1],21,-2054922799),n=I(n,r,o,s,e[i+8],6,1873313359),s=I(s,n,r,o,e[i+15],10,-30611744),o=I(o,s,n,r,e[i+6],15,-1560198380),r=I(r,o,s,n,e[i+13],21,1309151649),n=I(n,r,o,s,e[i+4],6,-145523070),s=I(s,n,r,o,e[i+11],10,-1120210379),o=I(o,s,n,r,e[i+2],15,718787259),r=I(r,o,s,n,e[i+9],21,-343485551),n=O(n,a),r=O(r,c),o=O(o,u),s=O(s,d)}return[n,r,o,s]}(function(e){if(0===e.length)return[];for(var t=8*e.length,n=new Uint32Array(b(t)),r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))};const P=g("v3",48,S);const T=function(e,t,n){var r=(e=e||{}).random||(e.rng||s)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return d(r)};function A(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function k(e,t){return e<<t|e>>>32-t}const C=function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var r=unescape(encodeURIComponent(e));e=[];for(var o=0;o<r.length;++o)e.push(r.charCodeAt(o))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var s=e.length/4+2,i=Math.ceil(s/16),a=new Array(i),c=0;c<i;++c){for(var u=new Uint32Array(16),d=0;d<16;++d)u[d]=e[64*c+4*d]<<24|e[64*c+4*d+1]<<16|e[64*c+4*d+2]<<8|e[64*c+4*d+3];a[c]=u}a[i-1][14]=8*(e.length-1)/Math.pow(2,32),a[i-1][14]=Math.floor(a[i-1][14]),a[i-1][15]=8*(e.length-1)&4294967295;for(var l=0;l<i;++l){for(var p=new Uint32Array(80),h=0;h<16;++h)p[h]=a[l][h];for(var f=16;f<80;++f)p[f]=k(p[f-3]^p[f-8]^p[f-14]^p[f-16],1);for(var m=n[0],y=n[1],g=n[2],b=n[3],O=n[4],v=0;v<80;++v){var w=Math.floor(v/20),x=k(m,5)+A(w,y,g,b)+O+t[w]+p[v]>>>0;O=b,b=g,g=k(y,30)>>>0,y=m,m=x}n[0]=n[0]+m>>>0,n[1]=n[1]+y>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+b>>>0,n[4]=n[4]+O>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]};const j=g("v5",80,C),E="00000000-0000-0000-0000-000000000000";const D=function(e){if(!a(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},2417:(e,t,n)=>{e.exports=n(7720)("./src/collaboration-core.js")},2704:(e,t,n)=>{e.exports=n(7079)("./src/core.js")},1492:(e,t,n)=>{e.exports=n(7079)("./src/engine.js")},9273:(e,t,n)=>{e.exports=n(7079)("./src/ui.js")},2209:(e,t,n)=>{e.exports=n(7079)("./src/utils.js")},7720:e=>{"use strict";e.exports=CKEditor5.collaborationDll},7079:e=>{"use strict";e.exports=CKEditor5.dll},1053:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reconstructPacket=t.deconstructPacket=void 0;const r=n(1669);function o(e,t){if(!e)return e;if(r.isBinary(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=o(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=o(e[r],t));return n}return e}function s(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=s(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=s(e[n],t));return e}t.deconstructPacket=function(e){const t=[],n=e.data,r=e;return r.data=o(n,t),r.attachments=t.length,{packet:r,buffers:t}},t.reconstructPacket=function(e,t){return e.data=s(e.data,t),e.attachments=void 0,e}},9881:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=t.PacketType=t.protocol=void 0;const r=n(5867),o=n(1053),s=n(1669),i=n(5579).default("socket.io-parser");var a;t.protocol=5,function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(a=t.PacketType||(t.PacketType={}));t.Encoder=class{constructor(e){this.replacer=e}encode(e){return i("encoding packet %j",e),e.type!==a.EVENT&&e.type!==a.ACK||!s.hasBinary(e)?[this.encodeAsString(e)]:(e.type=e.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,this.encodeAsBinary(e))}encodeAsString(e){let t=""+e.type;return e.type!==a.BINARY_EVENT&&e.type!==a.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),i("encoded %j as %s",e,t),t}encodeAsBinary(e){const t=o.deconstructPacket(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}};class c extends r.Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e),t.type===a.BINARY_EVENT||t.type===a.BINARY_ACK?(this.reconstructor=new u(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!s.isBinary(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===a[n.type])throw new Error("unknown packet type "+n.type);if(n.type===a.BINARY_EVENT||n.type===a.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const o=e.substring(r,t);if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!c.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return i("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case a.CONNECT:return"object"==typeof t;case a.DISCONNECT:return void 0===t;case a.CONNECT_ERROR:return"string"==typeof t||"object"==typeof t;case a.EVENT:case a.BINARY_EVENT:return Array.isArray(t)&&t.length>0;case a.ACK:case a.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}t.Decoder=c;class u{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=o.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}},1669:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasBinary=t.isBinary=void 0;const n="function"==typeof ArrayBuffer,r=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,o=Object.prototype.toString,s="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===o.call(Blob),i="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===o.call(File);function a(e){return n&&(e instanceof ArrayBuffer||r(e))||s&&e instanceof Blob||i&&e instanceof File}t.isBinary=a,t.hasBinary=function e(t,n){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(e(t[n]))return!0;return!1}if(a(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return!0;return!1}},6051:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasCORS=void 0;let n=!1;try{n="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}t.hasCORS=n},8573:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0,t.encode=function(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},t.decode=function(e){let t={},n=e.split("&");for(let e=0,r=n.length;e<r;e++){let r=n[e].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}},8736:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.parse=function(e){const t=e,o=e.indexOf("["),s=e.indexOf("]");-1!=o&&-1!=s&&(e=e.substring(0,o)+e.substring(o,s).replace(/:/g,";")+e.substring(s,e.length));let i=n.exec(e||""),a={},c=14;for(;c--;)a[r[c]]=i[c]||"";return-1!=o&&-1!=s&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,a.path),a.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,a.query),a}},7058:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.yeast=t.decode=t.encode=void 0;const n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),r=64,o={};let s,i=0,a=0;function c(e){let t="";do{t=n[e%r]+t,e=Math.floor(e/r)}while(e>0);return t}for(t.encode=c,t.decode=function(e){let t=0;for(a=0;a<e.length;a++)t=t*r+o[e.charAt(a)];return t},t.yeast=function(){const e=c(+new Date);return e!==s?(i=0,s=e):e+"."+c(i++)};a<r;a++)o[n[a]]=a},66:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.globalThisShim=void 0,t.globalThisShim="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")()},5769:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nextTick=t.parse=t.installTimerFunctions=t.transports=t.Transport=t.protocol=t.Socket=void 0;const r=n(1187);Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return r.Socket}}),t.protocol=r.Socket.protocol;var o=n(4291);Object.defineProperty(t,"Transport",{enumerable:!0,get:function(){return o.Transport}});var s=n(6449);Object.defineProperty(t,"transports",{enumerable:!0,get:function(){return s.transports}});var i=n(102);Object.defineProperty(t,"installTimerFunctions",{enumerable:!0,get:function(){return i.installTimerFunctions}});var a=n(8736);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return a.parse}});var c=n(9233);Object.defineProperty(t,"nextTick",{enumerable:!0,get:function(){return c.nextTick}})},1187:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=void 0;const o=n(6449),s=n(102),i=n(8573),a=n(8736),c=r(n(5579)),u=n(5867),d=n(4755),l=(0,c.default)("engine.io-client:socket");class p extends u.Emitter{constructor(e,t={}){super(),e&&"object"==typeof e&&(t=e,e=null),e?(e=(0,a.parse)(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=(0,a.parse)(t.host).host),(0,s.installTimerFunctions)(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"==typeof this.opts.query&&(this.opts.query=(0,i.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){l('creating transport "%s"',e);const t=Object.assign({},this.opts.query);t.EIO=d.protocol,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return l("options: %j",n),new o.transports[e](n)}open(){let e;if(this.opts.rememberUpgrade&&p.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return l("error while creating transport: %s",e),this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){l("setting transport %s",e.name),this.transport&&(l("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){l('probing transport "%s"',e);let t=this.createTransport(e),n=!1;p.priorWebsocketSuccess=!1;const r=()=>{n||(l('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(r=>{if(!n)if("pong"===r.type&&"probe"===r.data){if(l('probe transport "%s" pong',e),this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;p.priorWebsocketSuccess="websocket"===t.name,l('pausing current transport "%s"',this.transport.name),this.transport.pause((()=>{n||"closed"!==this.readyState&&(l("changing transport and sending upgrade packet"),u(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{l('probe transport "%s" failed',e);const n=new Error("probe error");n.transport=t.name,this.emitReserved("upgradeError",n)}})))};function o(){n||(n=!0,u(),t.close(),t=null)}const s=n=>{const r=new Error("probe error: "+n);r.transport=t.name,o(),l('probe transport "%s" failed because of error: %s',e,n),this.emitReserved("upgradeError",r)};function i(){s("transport closed")}function a(){s("socket closed")}function c(e){t&&e.name!==t.name&&(l('"%s" works - aborting "%s"',e.name,t.name),o())}const u=()=>{t.removeListener("open",r),t.removeListener("error",s),t.removeListener("close",i),this.off("close",a),this.off("upgrading",c)};t.once("open",r),t.once("error",s),t.once("close",i),this.once("close",a),this.once("upgrading",c),t.open()}onOpen(){if(l("socket open"),this.readyState="open",p.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){l("starting upgrade probes");let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(l('socket receive: type "%s", data "%s"',e.type,e.data),this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}else l('packet received with socket readyState "%s"',this.readyState)}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();l("flushing %d packets in socket",e.length),this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){const n=this.writeBuffer[t].data;if(n&&(e+=(0,s.byteLength)(n)),t>0&&e>this.maxPayload)return l("only send %d out of %d packets",t,this.writeBuffer.length),this.writeBuffer.slice(0,t);e+=2}return l("payload size is %d (max: %d)",e,this.maxPayload),this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),l("socket closing - telling transport to close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){l("socket error %j",e),p.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(l('socket close with reason: "%s"',e),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n<r;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}t.Socket=p,p.protocol=d.protocol},4291:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Transport=void 0;const o=n(4755),s=n(5867),i=n(102),a=(0,r(n(5579)).default)("engine.io-client:transport");class c extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class u extends s.Emitter{constructor(e){super(),this.writable=!1,(0,i.installTimerFunctions)(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new c(e,t,n)),this}open(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState?this.write(e):a("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=(0,o.decodePacket)(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}t.Transport=u},6449:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transports=void 0;const r=n(3737),o=n(4199);t.transports={websocket:o.WS,polling:r.Polling}},3737:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Request=t.Polling=void 0;const o=n(4291),s=r(n(5579)),i=n(7058),a=n(8573),c=n(4755),u=n(4582),d=n(5867),l=n(102),p=n(66),h=(0,s.default)("engine.io-client:polling");function f(){}const m=null!=new u.XHR({xdomain:!1}).responseType;class y extends o.Transport{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=m&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{h("paused"),this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(h("we are currently polling - waiting to pause"),e++,this.once("pollComplete",(function(){h("pre-pause polling complete"),--e||t()}))),this.writable||(h("we are currently writing - waiting to pause"),e++,this.once("drain",(function(){h("pre-pause writing complete"),--e||t()})))}else t()}poll(){h("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){h("polling got data %s",e);(0,c.decodePayload)(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState?this.poll():h('ignoring poll - transport state "%s"',this.readyState))}doClose(){const e=()=>{h("writing close packet"),this.write([{type:"close"}])};"open"===this.readyState?(h("transport open - closing"),e()):(h("transport not open - deferring close"),this.once("open",e))}write(e){this.writable=!1,(0,c.encodePayload)(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=(0,i.yeast)()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const r=(0,a.encode)(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new g(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){h("xhr poll");const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}t.Polling=y;class g extends d.Emitter{constructor(e,t){super(),(0,l.installTimerFunctions)(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.create()}create(){const e=(0,l.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new u.XHR(e);try{h("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&t.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof t.status?t.status:0)}),0))},h("xhr data %s",this.data),t.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}"undefined"!=typeof document&&(this.index=g.requestsCount++,g.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=f,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete g.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(t.Request=g,g.requestsCount=0,g.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",b);else if("function"==typeof addEventListener){const e="onpagehide"in p.globalThisShim?"pagehide":"unload";addEventListener(e,b,!1)}function b(){for(let e in g.requests)g.requests.hasOwnProperty(e)&&g.requests[e].abort()}},9233:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultBinaryType=t.usingBrowserWebSocket=t.WebSocket=t.nextTick=void 0;const r=n(66);t.nextTick="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),t.WebSocket=r.globalThisShim.WebSocket||r.globalThisShim.MozWebSocket,t.usingBrowserWebSocket=!0,t.defaultBinaryType="arraybuffer"},4199:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WS=void 0;const o=n(4291),s=n(8573),i=n(7058),a=n(102),c=n(9233),u=r(n(5579)),d=n(4755),l=(0,u.default)("engine.io-client:websocket"),p="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class h extends o.Transport{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=p?{}:(0,a.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=c.usingBrowserWebSocket&&!p?t?new c.WebSocket(e,t):new c.WebSocket(e):new c.WebSocket(e,t,n)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType||c.defaultBinaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;(0,d.encodePacket)(n,this.supportsBinary,(e=>{const t={};if(!c.usingBrowserWebSocket&&(n.options&&(t.compress=n.options.compress),this.opts.perMessageDeflate)){("string"==typeof e?Buffer.byteLength(e):e.length)<this.opts.perMessageDeflate.threshold&&(t.compress=!1)}try{c.usingBrowserWebSocket?this.ws.send(e):this.ws.send(e,t)}catch(e){l("websocket closed before onclose event")}r&&(0,c.nextTick)((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=(0,i.yeast)()),this.supportsBinary||(e.b64=1);const r=(0,s.encode)(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!c.WebSocket}}t.WS=h},4582:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XHR=void 0;const r=n(6051),o=n(66);t.XHR=function(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||r.hasCORS))return new XMLHttpRequest}catch(e){}if(!t)try{return new(o.globalThisShim[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}},102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.byteLength=t.installTimerFunctions=t.pick=void 0;const r=n(66);t.pick=function(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})};const o=setTimeout,s=clearTimeout;t.installTimerFunctions=function(e,t){t.useNativeTimers?(e.setTimeoutFn=o.bind(r.globalThisShim),e.clearTimeoutFn=s.bind(r.globalThisShim)):(e.setTimeoutFn=setTimeout.bind(r.globalThisShim),e.clearTimeoutFn=clearTimeout.bind(r.globalThisShim))};t.byteLength=function(e){return"string"==typeof e?function(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))}},9782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_PACKET=t.PACKET_TYPES_REVERSE=t.PACKET_TYPES=void 0;const n=Object.create(null);t.PACKET_TYPES=n,n.open="0",n.close="1",n.ping="2",n.pong="3",n.message="4",n.upgrade="5",n.noop="6";const r=Object.create(null);t.PACKET_TYPES_REVERSE=r,Object.keys(n).forEach((e=>{r[n[e]]=e}));t.ERROR_PACKET={type:"error",data:"parser error"}},6502:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0;const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<n.length;e++)r[n.charCodeAt(e)]=e;t.encode=e=>{let t,r=new Uint8Array(e),o=r.length,s="";for(t=0;t<o;t+=3)s+=n[r[t]>>2],s+=n[(3&r[t])<<4|r[t+1]>>4],s+=n[(15&r[t+1])<<2|r[t+2]>>6],s+=n[63&r[t+2]];return o%3==2?s=s.substring(0,s.length-1)+"=":o%3==1&&(s=s.substring(0,s.length-2)+"=="),s};t.decode=e=>{let t,n,o,s,i,a=.75*e.length,c=e.length,u=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);const d=new ArrayBuffer(a),l=new Uint8Array(d);for(t=0;t<c;t+=4)n=r[e.charCodeAt(t)],o=r[e.charCodeAt(t+1)],s=r[e.charCodeAt(t+2)],i=r[e.charCodeAt(t+3)],l[u++]=n<<2|o>>4,l[u++]=(15&o)<<4|s>>2,l[u++]=(3&s)<<6|63&i;return d}},3108:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9782),o=n(6502),s="function"==typeof ArrayBuffer,i=(e,t)=>{if(s){const n=(0,o.decode)(e);return a(n,t)}return{base64:!0,data:e}},a=(e,t)=>"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e;t.default=(e,t)=>{if("string"!=typeof e)return{type:"message",data:a(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:i(e.substring(1),t)};return r.PACKET_TYPES_REVERSE[n]?e.length>1?{type:r.PACKET_TYPES_REVERSE[n],data:e.substring(1)}:{type:r.PACKET_TYPES_REVERSE[n]}:r.ERROR_PACKET}},4895:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9782),o="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),s="function"==typeof ArrayBuffer,i=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};t.default=({type:e,data:t},n,a)=>{return o&&t instanceof Blob?n?a(t):i(t,a):s&&(t instanceof ArrayBuffer||(c=t,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(c):c&&c.buffer instanceof ArrayBuffer))?n?a(t):i(new Blob([t]),a):a(r.PACKET_TYPES[e]+(t||""));var c}},4755:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodePayload=t.decodePacket=t.encodePayload=t.encodePacket=t.protocol=void 0;const r=n(4895);t.encodePacket=r.default;const o=n(3108);t.decodePacket=o.default;const s=String.fromCharCode(30);t.encodePayload=(e,t)=>{const n=e.length,o=new Array(n);let i=0;e.forEach(((e,a)=>{(0,r.default)(e,!1,(e=>{o[a]=e,++i===n&&t(o.join(s))}))}))};t.decodePayload=(e,t)=>{const n=e.split(s),r=[];for(let e=0;e<n.length;e++){const s=(0,o.default)(n[e],t);if(r.push(s),"error"===s.type)break}return r},t.protocol=4},1067:(e,t)=>{"use strict";function n(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Object.defineProperty(t,"__esModule",{value:!0}),t.Backoff=void 0,t.Backoff=n,n.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(e){this.ms=e},n.prototype.setMax=function(e){this.max=e},n.prototype.setJitter=function(e){this.jitter=e}},8623:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.connect=t.io=t.Socket=t.Manager=t.protocol=void 0;const o=n(4197),s=n(3288);Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return s.Manager}});const i=n(3232);Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return i.Socket}});const a=r(n(5579)).default("socket.io-client"),c={};function u(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};const n=o.url(e,t.path||"/socket.io"),r=n.source,i=n.id,u=n.path,d=c[i]&&u in c[i].nsps;let l;return t.forceNew||t["force new connection"]||!1===t.multiplex||d?(a("ignoring socket cache for %s",r),l=new s.Manager(r,t)):(c[i]||(a("new io instance for %s",r),c[i]=new s.Manager(r,t)),l=c[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}t.io=u,t.connect=u,t.default=u,Object.assign(u,{Manager:s.Manager,Socket:i.Socket,io:u,connect:u});var d=n(170);Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return d.protocol}}),e.exports=u},3288:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Manager=void 0;const a=n(5769),c=n(3232),u=s(n(170)),d=n(6263),l=n(1067),p=n(5867),h=i(n(5579)).default("socket.io-client:manager");class f extends p.Emitter{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,a.installTimerFunctions(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new l.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||u;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(h("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;h("opening %s",this.uri),this.engine=new a.Socket(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=d.on(t,"open",(function(){n.onopen(),e&&e()})),o=d.on(t,"error",(t=>{h("error"),n.cleanup(),n._readyState="closed",this.emitReserved("error",t),e?e(t):n.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;h("connect attempt will timeout after %d",e),0===e&&r();const n=this.setTimeoutFn((()=>{h("connect attempt timed out after %d",e),r(),t.close(),t.emit("error",new Error("timeout"))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){h("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(d.on(e,"ping",this.onping.bind(this)),d.on(e,"data",this.ondata.bind(this)),d.on(e,"error",this.onerror.bind(this)),d.on(e,"close",this.onclose.bind(this)),d.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){a.nextTick((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){h("error",e),this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n||(n=new c.Socket(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const e of t){if(this.nsps[e].active)return void h("socket %s is still active, skipping close",e)}this._close()}_packet(e){h("writing packet %j",e);const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){h("cleanup"),this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){h("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){h("closed due to %s",e),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)h("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();h("will wait %dms before reconnect attempt",t),this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(h("attempting reconnect"),this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(h("reconnect attempt error"),e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):(h("reconnect success"),e.onreconnect())})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}t.Manager=f},6263:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.on=void 0,t.on=function(e,t,n){return e.on(t,n),function(){e.off(t,n)}}},3232:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=void 0;const o=n(170),s=n(6263),i=n(5867),a=r(n(5579)).default("socket.io-client:socket"),c=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class u extends i.Emitter{constructor(e,t,n){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[s.on(e,"open",this.onopen.bind(this)),s.on(e,"packet",this.onpacket.bind(this)),s.on(e,"error",this.onerror.bind(this)),s.on(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(c.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');t.unshift(e);const n={type:o.PacketType.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++;a("emitting packet with ack id %d",e);const r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)?a("discard packet as the transport is not currently writable"):this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n),this.flags={},this}_registerAckCallback(e,t){const n=this.flags.timeout;if(void 0===n)return void(this.acks[e]=t);const r=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&(a("removing packet with ack id %d from the buffer",e),this.sendBuffer.splice(t,1));a("event with ack id %d has timed out after %d ms",e,n),t.call(this,new Error("operation has timed out"))}),n);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(r),t.apply(this,[null,...e])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){a("transport is open - connecting"),"function"==typeof this.auth?this.auth((e=>{this.packet({type:o.PacketType.CONNECT,data:e})})):this.packet({type:o.PacketType.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){a("close (%s)",e),this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case o.PacketType.CONNECT:if(e.data&&e.data.sid){const t=e.data.sid;this.onconnect(t)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case o.PacketType.EVENT:case o.PacketType.BINARY_EVENT:this.onevent(e);break;case o.PacketType.ACK:case o.PacketType.BINARY_ACK:this.onack(e);break;case o.PacketType.DISCONNECT:this.ondisconnect();break;case o.PacketType.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];a("emitting event %j",t),null!=e.id&&(a("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e)}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,a("sending ack %j",r),t.packet({type:o.PacketType.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t?(a("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):a("bad ack %s",e.id)}onconnect(e){a("socket connected with id %s",e),this.id=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){a("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(a("performing disconnect (%s)",this.nsp),this.packet({type:o.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}t.Socket=u},4197:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.url=void 0;const o=n(5769),s=r(n(5579)).default("socket.io-client:url");t.url=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(s("protocol-less url %s",e),e=void 0!==n?n.protocol+"//"+e:"https://"+e),s("parse %s",e),r=o.parse(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}},2830:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reconstructPacket=t.deconstructPacket=void 0;const r=n(3980);function o(e,t){if(!e)return e;if((0,r.isBinary)(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=o(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=o(e[r],t));return n}return e}function s(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=s(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=s(e[n],t));return e}t.deconstructPacket=function(e){const t=[],n=e.data,r=e;return r.data=o(n,t),r.attachments=t.length,{packet:r,buffers:t}},t.reconstructPacket=function(e,t){return e.data=s(e.data,t),delete e.attachments,e}},170:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=t.PacketType=t.protocol=void 0;const r=n(5867),o=n(2830),s=n(3980),i=(0,n(5579).default)("socket.io-parser");var a;t.protocol=5,function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(a=t.PacketType||(t.PacketType={}));t.Encoder=class{constructor(e){this.replacer=e}encode(e){return i("encoding packet %j",e),e.type!==a.EVENT&&e.type!==a.ACK||!(0,s.hasBinary)(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==a.BINARY_EVENT&&e.type!==a.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),i("encoded %j as %s",e,t),t}encodeAsBinary(e){const t=(0,o.deconstructPacket)(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}};class c extends r.Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===a.BINARY_EVENT;n||t.type===a.BINARY_ACK?(t.type=n?a.EVENT:a.ACK,this.reconstructor=new u(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!(0,s.isBinary)(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===a[n.type])throw new Error("unknown packet type "+n.type);if(n.type===a.BINARY_EVENT||n.type===a.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const o=e.substring(r,t);if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!c.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return i("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case a.CONNECT:return"object"==typeof t;case a.DISCONNECT:return void 0===t;case a.CONNECT_ERROR:return"string"==typeof t||"object"==typeof t;case a.EVENT:case a.BINARY_EVENT:return Array.isArray(t)&&t.length>0;case a.ACK:case a.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}t.Decoder=c;class u{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=(0,o.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}},3980:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasBinary=t.isBinary=void 0;const n="function"==typeof ArrayBuffer,r=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,o=Object.prototype.toString,s="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===o.call(Blob),i="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===o.call(File);function a(e){return n&&(e instanceof ArrayBuffer||r(e))||s&&e instanceof Blob||i&&e instanceof File}t.isBinary=a,t.hasBinary=function e(t,n){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(e(t[n]))return!0;return!1}if(a(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return!0;return!1}},5867:(e,t,n)=>{"use strict";function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}n.r(t),n.d(t,{Emitter:()=>r}),r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},r.prototype.emitReserved=r.prototype.emit,r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nc=void 0;var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CloudServicesCommentsAdapter:()=>vo,CloudServicesRevisionHistoryAdapter:()=>Wo,CloudServicesTrackChangesAdapter:()=>Ao,PresenceList:()=>Xs,RealTimeCollaborativeComments:()=>No,RealTimeCollaborativeEditing:()=>lo,RealTimeCollaborativeRevisionHistory:()=>ts,RealTimeCollaborativeTrackChanges:()=>Jo});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{AttributeOperation:()=>R,Element:()=>Y,InsertOperation:()=>N,MarkerOperation:()=>M,MergeOperation:()=>V,MoveOperation:()=>B,Position:()=>G,Range:()=>F,RenameOperation:()=>U,RootAttributeOperation:()=>J,RootOperation:()=>q,SplitOperation:()=>L,default:()=>D});var t=__webpack_require__(2704),n=__webpack_require__(2209),r=__webpack_require__(9273),o=__webpack_require__(1492),s=__webpack_require__(7158),i=__webpack_require__.n(s);const a=["define","then","isInReconnectionStack","bind","has","WebSocketGateway","disconnect","add","state","pluginName","limitExceeded","online","_reconnect","DISCONNECTED","cloudservices-reconnection-error","function","websocketgateway-missing-token","addToReconnectionStack","requires","_reconnectionStack","connect","plugins","constructor","error","removeFromReconnectionStack","connected","change:me","CONNECTED","connection","create","real-time-collaboration","offline","initialReconnectionInterval","code","cloudservices-init","CloudServices","context","webSocketUrl","destroy","websocketgateway-missing-websocket-url","_domEmitter","cloudServices.connectionTimeout","all","token","_shouldPluginsReconnect","cloudServices.requestTimeout","get","_isBrowserOffline","CONNECTING","config","from","delete","init","Connected users limit exceeded","listenTo","websocketgateway-plugin-already-registered","catch","reconnect","websocketgateway-invalid-plugin-interface"];var c,u;c=a,u=196,function(e){for(;--e;)c.push(c.shift())}(++u);const d=function(e,t){return a[e-=0]};class l extends t.ContextPlugin{static get[d("0x3a")](){return[d("0x10"),r.Notification]}static get[d("0x31")](){return d("0x2d")}constructor(e){super(e),this.set(d("0x30"),s.WEB_SOCKET_GATEWAY_STATES[d("0x8")]),this.set(d("0x1c"),!1),this[d("0x0")]=new Set,this[d("0x19")]=!1,this[d("0x15")]=Object[d("0xa")](n.DomEmitterMixin)}[d("0x21")](){const e=this[d("0x11")],t=e.plugins.get("CloudServices"),o=e[d("0x2")][d("0x1b")](r.Notification);if(!t[d("0x18")])throw new n.CKEditorError(d("0x38"),this);if(!t[d("0x12")])throw new n.CKEditorError(d("0x14"),this);return this[d("0x15")][d("0x23")](window,d("0xc"),(()=>this[d("0x1c")]=!0)),this[d("0x15")][d("0x23")](window,d("0x33"),(()=>this._isBrowserOffline=!1)),this[d("0x11")][d("0x1e")].define(d("0x16"),10),this[d("0x11")][d("0x1e")][d("0x28")](d("0x1a"),20),l[d("0x2d")][d("0x1")](t[d("0x18")],t[d("0x12")],{timeout:1e3*this.context.config[d("0x1b")](d("0x16")),requestTimeout:1e3*this[d("0x11")][d("0x1e")][d("0x1b")]("cloudServices.requestTimeout")})[d("0x29")]((e=>{if(this.connection=e,this[d("0x2b")](d("0x30")).to(e,"state",this,d("0x1c"),((e,t)=>(d("0x6")!==e&&(this[d("0x19")]=!0),t||e!==s.WEB_SOCKET_GATEWAY_STATES.CONNECTED?s.WEB_SOCKET_GATEWAY_STATES[d("0x35")]:this[d("0x30")]==s.WEB_SOCKET_GATEWAY_STATES[d("0x35")]&&this[d("0x19")]?(this[d("0x19")]=!1,this[d("0x34")](),s.WEB_SOCKET_GATEWAY_STATES[d("0x1d")]):s.WEB_SOCKET_GATEWAY_STATES[d("0x8")]))),this.connection.on("error",((e,t)=>{if(d("0x32")!==t[d("0xe")])throw console.error(t),new n.CKEditorError(d("0xf"),null,{originalError:t});o.showWarning("The limit of maximum concurrent connections that the collaboration server can handle has been reached. Try opening the document again in a few minutes. Please contact your system administrator if the problem persists.",{title:d("0x22"),namespace:d("0xb")})})),!e.me)return new Promise((t=>e.on(d("0x7"),t)))}))[d("0x25")]((e=>{throw console.error(e),new n.CKEditorError(d("0xf"),null,{originalError:e})}))}[d("0x39")](e){if(d("0x37")!=typeof e[d("0x26")])throw new n.CKEditorError(d("0x27"),this);if(this[d("0x2a")](e))throw new n.CKEditorError(d("0x24"),this,{name:e[d("0x3")][d("0x31")]});this[d("0x0")][d("0x2f")](e)}[d("0x5")](e){this[d("0x0")][d("0x20")](e)}isInReconnectionStack(e){return this._reconnectionStack[d("0x2c")](e)}[d("0x34")](){return this[d("0x9")][d("0x26")]()[d("0x29")]((()=>Promise[d("0x17")](Array[d("0x1f")](this[d("0x0")],(e=>e[d("0x26")]())))))[d("0x29")]((()=>this[d("0x30")]=s.WEB_SOCKET_GATEWAY_STATES[d("0x8")]))[d("0x25")]((e=>{throw console[d("0x4")](e),new n.CKEditorError(d("0x36"),this[d("0x11")])}))}[d("0x13")](){this[d("0x9")]&&this[d("0x9")][d("0x2e")](),this[d("0x30")]=s.WEB_SOCKET_GATEWAY_STATES[d("0x35")],this[d("0x15")].stopListening(),super.destroy()}}l[d("0x2d")]=i(),l[d("0xd")]=1e3;var p=__webpack_require__(2417);const h=["size","stopListening","_registeredSessions","remove","getUserSessions","set","channelSessions","getUser","clear","channelConnectedUsers","role","addUser","Sessions","add","orderNumber","_uniqueUsersCount","register","getUserBySessionId","get","_handleSessionRemove","sessions-register-already-registered","allConnectedUsers","pluginName","state","requires","connection","sessionAdd:","context","defineMe","getUserRole","connected","plugins","forEach","_createUser","listenTo","fire","_handleSessionAdd","delete","change:state","unregister","sessions-unregister-not-exist","user","init","has","mySessionId","_users","values"];var f,m;f=h,m=499,function(e){for(;--e;)f.push(f.shift())}(++m);const y=function(e,t){return h[e-=0]};class g extends t.ContextPlugin{static get[y("0x28")](){return y("0x1e")}static get[y("0x2a")](){return[l,p.Users]}constructor(e){super(e),this[y("0x18")]=new Map,this[y("0x1b")]=new Map,this[y("0x27")]=new n.Collection,this[y("0x14")]=new Map,this[y("0x21")]=0,this[y("0x10")]=this[y("0x2d")].plugins[y("0x24")](p.Users)}[y("0xd")](){const e=this[y("0x2d")].plugins[y("0x24")](l);this.listenTo(e,y("0x9"),((e,t,n)=>{if(y("0x1")!==n)this.channelSessions[y("0x3")]((e=>e[y("0x1a")]())),this.channelConnectedUsers[y("0x3")]((e=>e[y("0x1a")]())),this[y("0x27")][y("0x1a")]();else for(const[e,t]of this[y("0x14")])for(const n of t)this[y("0x7")](e,n)})),this[y("0x4")](e[y("0x2b")].me,!0)}[y("0x22")](e,t){if(this[y("0x14")][y("0xe")](e))throw new n.CKEditorError(y("0x26"),null,{channelId:e});this[y("0x14")][y("0x17")](e,t),this[y("0x18")].set(e,new n.Collection),this[y("0x1b")][y("0x17")](e,new n.Collection),this[y("0x5")](t,"add",((t,n)=>this[y("0x7")](e,n))),this[y("0x5")](t,y("0x15"),((t,n)=>this._handleSessionRemove(e,n)));for(const n of t)this[y("0x7")](e,n)}[y("0xa")](e){if(!this._registeredSessions[y("0xe")](e))throw new n.CKEditorError(y("0xb"),null,{channelId:e});const t=this[y("0x14")].get(e);this[y("0x13")](t);for(const n of t)y("0x1")===this.context[y("0x2")].get(l)[y("0x29")]&&this[y("0x25")](e,n);this[y("0x14")][y("0x8")](e),this[y("0x18")][y("0x8")](e),this.channelConnectedUsers[y("0x8")](e)}get[y("0xf")](){return this[y("0x2d")][y("0x2")].get(l).connection.sessionId}[y("0x23")](e){for(const t of this.channelSessions.values())for(const n of t)if(n.id===e)return n[y("0xc")]}[y("0x16")](e,t){const n=t?[this[y("0x18")][y("0x24")](t)]:this.channelSessions[y("0x11")](),r=new Set;for(const t of n)for(const n of t)n[y("0xc")].id===e.id&&r.add(n.id);return r}[y("0x0")](e){for(const t of this[y("0x18")][y("0x11")]())for(const n of t)if(n.user===e)return n[y("0x1c")]}_handleSessionAdd(e,t){if("connected"!==this[y("0x2d")][y("0x2")][y("0x24")](l)[y("0x29")])return;const n=t.user,r=this[y("0x10")][y("0x19")](n.id)||this[y("0x4")](n),o=Object.assign({},t,{user:r});this[y("0x18")].get(e)[y("0x1f")](o);const s=this[y("0x1b")][y("0x24")](e);s[y("0xe")](r.id)||s[y("0x1f")](r),this.allConnectedUsers[y("0xe")](r.id)||this[y("0x27")][y("0x1f")](r),this[y("0x6")](y("0x2c")+e,{channelId:e,session:o})}_handleSessionRemove(e,t){if(y("0x1")!==this[y("0x2d")][y("0x2")].get(l)[y("0x29")])return;const n=this.channelConnectedUsers[y("0x24")](e),r=t[y("0xc")];r.id&&(this.channelSessions[y("0x24")](e)[y("0x15")](t.id),n[y("0xe")](r.id)&&!this.getUserSessions(r,e).size&&n[y("0x15")](r.id),this.allConnectedUsers[y("0x24")](r.id)&&!this[y("0x16")](r)[y("0x12")]&&this[y("0x27")][y("0x15")](r.id))}[y("0x4")](e,t){const n=this[y("0x10")][y("0x1d")](e);return t&&this[y("0x10")][y("0x2e")](e.id),n[y("0x20")]=this[y("0x21")]++,n}}var b=__webpack_require__(7594),O=__webpack_require__.n(b),v=__webpack_require__(9940),w={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};O()(v.Z,w);v.Z.locals;const x=["marker","updateMarker","getMarkerClass","$text","newRange","plugins","fromRange","editing","end","getRange","isInline","pluginName","ck-user__selection","getPositions","set","start","schema","span","isObject","user:","conversion","for","startsWith","hasContent","editor","user:range:","element","addMarker","applyOperation","markerName","get","change","view","color","requires","createUIElement","change:range","markerRange","isLimit","hasDomSelection","afterInit","getNearestSelectionRange","UserMarkers","type",'&#8203;<span class="ck-user__marker-line"><span class="ck-user__marker-dot"></span></span>',"highest","model","editingDowncast","_createdBatches","user:range","getFirstRange","enqueueChange","name","render","setCustomProperty","document","userPositionMarker","reconvertMarker","has","createRange","getSelectionClass","getAttribute","init","ck-user__marker ","orderNumber","deletionPosition","getContainedElement","toRange","split","batch","$graveyard","removeMarker","data-session-id","toDomElement","selection","root","contenteditable","detach","oldRange","undo","checkChild","isCollapsed","rootName","createUserMarkerOperations","getStart","markers","user:position:","isSimilar","parent","nodeAfter","tableCell","clear","delete","getUserBySessionId","mySessionId"];var _,I;_=x,I=126,function(e){for(;--e;)_.push(_.shift())}(++I);const S=function(e,t){return x[e-=0]};class P extends t.Plugin{static get[S("0x3")](){return[g]}static get[S("0x4b")](){return S("0xb")}[S("0x1f")](){const e=this[S("0x58")],t=e.plugins.get(g);e[S("0x54")][S("0x55")](S("0x10")).markerToElement({model:"user:position",view:(n,{writer:r})=>function(e,t,n,r){const o=e[S("0x5d")][S("0x25")](":")[2],s=n[S("0x3e")](o);if(!s||o===n[S("0x3f")])return;if(!r.model[S("0x50")][S("0x31")](e[S("0x6")][S("0x4f")],S("0x43")))return;const i={class:S("0x20")+s[S("0x2")][S("0x42")](),"data-name":s[S("0x15")],"data-session-id":o},a=r[S("0xf")][S("0x36")][S("0x5e")](e[S("0x5d")])[S("0x35")](),c=a[S("0x3a")],u=r[S("0xf")][S("0x50")];if(c&&u[S("0x52")](c)&&u[S("0x4a")](c)&&!r[S("0xf")][S("0x36")][S("0x5e")](S("0x59")+o)[S("0x49")]()[S("0x32")])return;const d=a[S("0x39")];return r[S("0xf")][S("0x50")][S("0x7")](d)&&!r[S("0xf")][S("0x57")](d)&&(i[S("0x2d")]=!1),function(e,t){const n=e[S("0x4")](S("0x51"),t);return e[S("0x17")](S("0x19"),!0,n),n[S("0x16")]=function(e){const t=this[S("0x2a")](e);return t.innerHTML=S("0xd"),t},n[S("0x38")]=function(e){return!(!this.getCustomProperty(S("0x19"))||!e.getCustomProperty(S("0x19"))||this[S("0x1e")](S("0x29"))!=e[S("0x1e")](S("0x29")))},n}(t,i)}(n,r,t,e)}),e[S("0x54")][S("0x55")](S("0x10")).markerToHighlight({model:S("0x12"),view:e=>function(e,t){const n=e.markerName.split(":")[2];if(n===t.mySessionId)return null;const r=t[S("0x3e")](n);return r?{id:n,classes:[S("0x4c"),r[S("0x2")][S("0x1d")]()],attributes:{"data-session-id":n},priority:2e3+r[S("0x21")]}:{id:n,classes:[]}}(e,t)}),function(e){const t=e[S("0xf")],n=new Map,r=e.plugins[S("0x5e")](g);t[S("0x36")].on("update:user:range",((s,i,a,c)=>{if(!c&&n[S("0x5e")](i[S("0x15")]))return n.get(i[S("0x15")]).detach(),void n[S("0x3d")](i[S("0x15")]);const u=i[S("0x15")][S("0x25")](":")[2];if(u===r[S("0x3f")])return;const d=S("0x37")+u;t[S("0x36")].has(d)&&e[S("0x47")][S("0x1a")](d),i.on(S("0x5"),((e,r,s)=>{if(S("0x27")!=r.root[S("0x33")]&&S("0x27")==i.getRange()[S("0x2c")][S("0x33")]&&!n[S("0x1b")](i[S("0x15")])){const e=t[S("0x50")][S("0xa")](s[S("0x22")]);if(e){const r=o.LiveRange[S("0x46")](e);n[S("0x4e")](i[S("0x15")],r),r.on(S("0x5"),((e,o,s)=>{if("$graveyard"==r[S("0x2c")][S("0x33")]){const e=t.schema.getNearestSelectionRange(s[S("0x22")]);e?(r[S("0x4f")]=e[S("0x4f")],r[S("0x48")]=e[S("0x48")]):(n[S("0x3d")](i[S("0x15")]),r[S("0x2e")]())}}))}}}))})),t[S("0x18")].on(S("0x0"),(()=>{n.size>0&&t.enqueueChange({isUndoable:!1},(e=>{for(const[r,o]of n)S("0x27")==t[S("0x36")][S("0x5e")](r)[S("0x49")]().root[S("0x33")]&&(T(r[S("0x25")](":")[2],o[S("0x24")](),t,e),o.detach());n[S("0x3c")]()}))}))}(e)}[S("0x9")](){const e=this[S("0x58")],t=e.commands[S("0x5e")](S("0x30"));t&&e[S("0xf")].on(S("0x5c"),((n,r)=>{const o=r[0];if(S("0x40")!=o[S("0xc")]||!o.name[S("0x56")](S("0x53")))return;const s=o[S("0x26")];t[S("0x11")][S("0x1b")](s)&&(o[S("0x44")]=o.oldRange?e[S("0xf")].createRange(o[S("0x2f")][S("0x4f")],o[S("0x2f")][S("0x48")]):null)}),{priority:S("0xe")})}[S("0x34")](){const e=this[S("0x58")],t=e[S("0xf")][S("0x18")],n=e[S("0x45")][S("0x5e")](g);e[S("0xf")][S("0x14")]({isUndoable:!1},(r=>{const o="user:range:"+n[S("0x3f")],s=S("0x37")+n[S("0x3f")],i=e[S("0xf")][S("0x36")].has(o);e.editing[S("0x1")][S("0x8")]?T(n[S("0x3f")],t[S("0x2b")][S("0x13")](),e[S("0xf")],r):i&&(r[S("0x28")](o),r.removeMarker(s))}))}}function T(e,t,n,r){const o=S("0x59")+e,s=S("0x37")+e,i=t[S("0x23")]();let a=t.start;i&&i.is(S("0x5a"),S("0x3b"))&&(a=function(e,t){for(const n of e[S("0x4d")]())if(t[S("0x50")][S("0x31")](n,S("0x43")))return n}(t,n),t=r.createRange(a));const c=r[S("0x1c")](a);n[S("0x36")][S("0x1b")](o)?(r[S("0x41")](o,{range:t}),r[S("0x41")](s,{range:c})):(r[S("0x5b")](o,{range:t,usingOperation:!0}),r[S("0x5b")](s,{range:c,usingOperation:!0}))}function A(e,t,n){const r=e.t;switch(t){case"PENDING_ACTION_SENDING_DATA":return r({string:"Sending data to the server.",id:"PENDING_ACTION_SENDING_DATA"});case"The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.":return r("The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.");case"The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.":return r("The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.");case"The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.":return r("The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.");case"The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.":return r("The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.");case"Synchronization issue":return r("Synchronization issue");case"PENDING_ACTION_REVISION_HISTORY":return r({string:"Unsaved change in revision history.",id:"PENDING_ACTION_REVISION_HISTORY"});case"CONNECTED_USERS":return r({string:"1 connected user (me)",plural:"%0 connected users",id:"CONNECTED_USERS"},n);default:return""}}var k=__webpack_require__(1993);const C=k.Reader,j=k.Writer,E=k.util,D=k.roots.default||(k.roots.default={}),R=D.AttributeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.range=null,e.prototype.key="",e.prototype.oldValueBoolean=!1,e.prototype.oldValueJson="",e.prototype.newValueBoolean=!1,e.prototype.newValueJson="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=j.create()),null!=e.range&&Object.hasOwnProperty.call(e,"range")&&D.Range.encode(e.range,t.uint32(10).fork()).ldelim(),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&t.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&t.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&t.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&t.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(56).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new D.AttributeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.range=D.Range.decode(e,e.uint32());break;case 2:r.key=e.string();break;case 3:r.oldValueBoolean=e.bool();break;case 4:r.oldValueJson=e.string();break;case 5:r.newValueBoolean=e.bool();break;case 6:r.newValueJson=e.string();break;case 7:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.range&&e.hasOwnProperty("range")){let t=D.Range.verify(e.range);if(t)return"range."+t}return null!=e.key&&e.hasOwnProperty("key")&&!E.isString(e.key)?"key: string expected":null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof e.oldValueBoolean?"oldValueBoolean: boolean expected":null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&!E.isString(e.oldValueJson)?"oldValueJson: string expected":null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof e.newValueBoolean?"newValueBoolean: boolean expected":null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&!E.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof D.AttributeOperation)return e;let t=new D.AttributeOperation;if(null!=e.range){if("object"!=typeof e.range)throw TypeError(".AttributeOperation.range: object expected");t.range=D.Range.fromObject(e.range)}return null!=e.key&&(t.key=String(e.key)),null!=e.oldValueBoolean&&(t.oldValueBoolean=Boolean(e.oldValueBoolean)),null!=e.oldValueJson&&(t.oldValueJson=String(e.oldValueJson)),null!=e.newValueBoolean&&(t.newValueBoolean=Boolean(e.newValueBoolean)),null!=e.newValueJson&&(t.newValueJson=String(e.newValueJson)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.range=null,n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=e.range&&e.hasOwnProperty("range")&&(n.range=D.Range.toObject(e.range,t)),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=e.oldValueBoolean),null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&(n.oldValueJson=e.oldValueJson),null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=e.newValueBoolean),null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&(n.newValueJson=e.newValueJson),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,k.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/AttributeOperation"},e})(),N=D.InsertOperation=(()=>{function e(e){if(this.nodes=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.position=null,e.prototype.nodes=E.emptyArray,e.prototype.shouldReceiveAttributes=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=j.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&D.Position.encode(e.position,t.uint32(10).fork()).ldelim(),null!=e.nodes&&e.nodes.length)for(let n=0;n<e.nodes.length;++n)D.Element.encode(e.nodes[n],t.uint32(18).fork()).ldelim();return null!=e.shouldReceiveAttributes&&Object.hasOwnProperty.call(e,"shouldReceiveAttributes")&&t.uint32(24).bool(e.shouldReceiveAttributes),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new D.InsertOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.position=D.Position.decode(e,e.uint32());break;case 2:r.nodes&&r.nodes.length||(r.nodes=[]),r.nodes.push(D.Element.decode(e,e.uint32()));break;case 3:r.shouldReceiveAttributes=e.bool();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")){let t=D.Position.verify(e.position);if(t)return"position."+t}if(null!=e.nodes&&e.hasOwnProperty("nodes")){if(!Array.isArray(e.nodes))return"nodes: array expected";for(let t=0;t<e.nodes.length;++t){let n=D.Element.verify(e.nodes[t]);if(n)return"nodes."+n}}return null!=e.shouldReceiveAttributes&&e.hasOwnProperty("shouldReceiveAttributes")&&"boolean"!=typeof e.shouldReceiveAttributes?"shouldReceiveAttributes: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof D.InsertOperation)return e;let t=new D.InsertOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".InsertOperation.position: object expected");t.position=D.Position.fromObject(e.position)}if(e.nodes){if(!Array.isArray(e.nodes))throw TypeError(".InsertOperation.nodes: array expected");t.nodes=[];for(let n=0;n<e.nodes.length;++n){if("object"!=typeof e.nodes[n])throw TypeError(".InsertOperation.nodes: object expected");t.nodes[n]=D.Element.fromObject(e.nodes[n])}}return null!=e.shouldReceiveAttributes&&(t.shouldReceiveAttributes=Boolean(e.shouldReceiveAttributes)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.nodes=[]),t.defaults&&(n.position=null,n.shouldReceiveAttributes=!1,n.wasUndone=!1),null!=e.position&&e.hasOwnProperty("position")&&(n.position=D.Position.toObject(e.position,t)),e.nodes&&e.nodes.length){n.nodes=[];for(let r=0;r<e.nodes.length;++r)n.nodes[r]=D.Element.toObject(e.nodes[r],t)}return null!=e.shouldReceiveAttributes&&e.hasOwnProperty("shouldReceiveAttributes")&&(n.shouldReceiveAttributes=e.shouldReceiveAttributes),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,k.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/InsertOperation"},e})(),M=D.MarkerOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.oldRange=null,e.prototype.newRange=null,e.prototype.affectsData=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=j.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.oldRange&&Object.hasOwnProperty.call(e,"oldRange")&&D.Range.encode(e.oldRange,t.uint32(18).fork()).ldelim(),null!=e.newRange&&Object.hasOwnProperty.call(e,"newRange")&&D.Range.encode(e.newRange,t.uint32(26).fork()).ldelim(),null!=e.affectsData&&Object.hasOwnProperty.call(e,"affectsData")&&t.uint32(32).bool(e.affectsData),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new D.MarkerOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.name=e.string();break;case 2:r.oldRange=D.Range.decode(e,e.uint32());break;case 3:r.newRange=D.Range.decode(e,e.uint32());break;case 4:r.affectsData=e.bool();break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!E.isString(e.name))return"name: string expected";if(null!=e.oldRange&&e.hasOwnProperty("oldRange")){let t=D.Range.verify(e.oldRange);if(t)return"oldRange."+t}if(null!=e.newRange&&e.hasOwnProperty("newRange")){let t=D.Range.verify(e.newRange);if(t)return"newRange."+t}return null!=e.affectsData&&e.hasOwnProperty("affectsData")&&"boolean"!=typeof e.affectsData?"affectsData: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof D.MarkerOperation)return e;let t=new D.MarkerOperation;if(null!=e.name&&(t.name=String(e.name)),null!=e.oldRange){if("object"!=typeof e.oldRange)throw TypeError(".MarkerOperation.oldRange: object expected");t.oldRange=D.Range.fromObject(e.oldRange)}if(null!=e.newRange){if("object"!=typeof e.newRange)throw TypeError(".MarkerOperation.newRange: object expected");t.newRange=D.Range.fromObject(e.newRange)}return null!=e.affectsData&&(t.affectsData=Boolean(e.affectsData)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.name="",n.oldRange=null,n.newRange=null,n.affectsData=!1,n.wasUndone=!1),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.oldRange&&e.hasOwnProperty("oldRange")&&(n.oldRange=D.Range.toObject(e.oldRange,t)),null!=e.newRange&&e.hasOwnProperty("newRange")&&(n.newRange=D.Range.toObject(e.newRange,t)),null!=e.affectsData&&e.hasOwnProperty("affectsData")&&(n.affectsData=e.affectsData),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,k.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MarkerOperation"},e})(),V=D.MergeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sourcePosition=null,e.prototype.targetPosition=null,e.prototype.graveyardPosition=null,e.prototype.howMany=0,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=j.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&D.Position.encode(e.sourcePosition,t.uint32(10).fork()).ldelim(),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&D.Position.encode(e.targetPosition,t.uint32(18).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&D.Position.encode(e.graveyardPosition,t.uint32(26).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(32).uint32(e.howMany),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new D.MergeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.sourcePosition=D.Position.decode(e,e.uint32());break;case 2:r.targetPosition=D.Position.decode(e,e.uint32());break;case 3:r.graveyardPosition=D.Position.decode(e,e.uint32());break;case 4:r.howMany=e.uint32();break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")){let t=D.Position.verify(e.sourcePosition);if(t)return"sourcePosition."+t}if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")){let t=D.Position.verify(e.targetPosition);if(t)return"targetPosition."+t}if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")){let t=D.Position.verify(e.graveyardPosition);if(t)return"graveyardPosition."+t}return null!=e.howMany&&e.hasOwnProperty("howMany")&&!E.isInteger(e.howMany)?"howMany: integer expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof D.MergeOperation)return e;let t=new D.MergeOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MergeOperation.sourcePosition: object expected");t.sourcePosition=D.Position.fromObject(e.sourcePosition)}if(null!=e.targetPosition){if("object"!=typeof e.targetPosition)throw TypeError(".MergeOperation.targetPosition: object expected");t.targetPosition=D.Position.fromObject(e.targetPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".MergeOperation.graveyardPosition: object expected");t.graveyardPosition=D.Position.fromObject(e.graveyardPosition)}return null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.sourcePosition=null,n.targetPosition=null,n.graveyardPosition=null,n.howMany=0,n.wasUndone=!1),null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(n.sourcePosition=D.Position.toObject(e.sourcePosition,t)),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=D.Position.toObject(e.targetPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=D.Position.toObject(e.graveyardPosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,k.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MergeOperation"},e})(),B=D.MoveOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sourcePosition=null,e.prototype.howMany=0,e.prototype.targetPosition=null,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=j.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&D.Position.encode(e.sourcePosition,t.uint32(10).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(16).uint32(e.howMany),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&D.Position.encode(e.targetPosition,t.uint32(26).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new D.MoveOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.sourcePosition=D.Position.decode(e,e.uint32());break;case 2:r.howMany=e.uint32();break;case 3:r.targetPosition=D.Position.decode(e,e.uint32());break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")){let t=D.Position.verify(e.sourcePosition);if(t)return"sourcePosition."+t}if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!E.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")){let t=D.Position.verify(e.targetPosition);if(t)return"targetPosition."+t}return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof D.MoveOperation)return e;let t=new D.MoveOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MoveOperation.sourcePosition: object expected");t.sourcePosition=D.Position.fromObject(e.sourcePosition)}if(null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.targetPosition){if("object"!=typeof e.targetPosition)throw TypeError(".MoveOperation.targetPosition: object expected");t.targetPosition=D.Position.fromObject(e.targetPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.sourcePosition=null,n.howMany=0,n.targetPosition=null,n.wasUndone=!1),null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(n.sourcePosition=D.Position.toObject(e.sourcePosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=D.Position.toObject(e.targetPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,k.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MoveOperation"},e})(),U=D.RenameOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.position=null,e.prototype.oldName="",e.prototype.newName="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=j.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&D.Position.encode(e.position,t.uint32(10).fork()).ldelim(),null!=e.oldName&&Object.hasOwnProperty.call(e,"oldName")&&t.uint32(18).string(e.oldName),null!=e.newName&&Object.hasOwnProperty.call(e,"newName")&&t.uint32(26).string(e.newName),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new D.RenameOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.position=D.Position.decode(e,e.uint32());break;case 2:r.oldName=e.string();break;case 3:r.newName=e.string();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")){let t=D.Position.verify(e.position);if(t)return"position."+t}return null!=e.oldName&&e.hasOwnProperty("oldName")&&!E.isString(e.oldName)?"oldName: string expected":null!=e.newName&&e.hasOwnProperty("newName")&&!E.isString(e.newName)?"newName: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof D.RenameOperation)return e;let t=new D.RenameOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".RenameOperation.position: object expected");t.position=D.Position.fromObject(e.position)}return null!=e.oldName&&(t.oldName=String(e.oldName)),null!=e.newName&&(t.newName=String(e.newName)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.position=null,n.oldName="",n.newName="",n.wasUndone=!1),null!=e.position&&e.hasOwnProperty("position")&&(n.position=D.Position.toObject(e.position,t)),null!=e.oldName&&e.hasOwnProperty("oldName")&&(n.oldName=e.oldName),null!=e.newName&&e.hasOwnProperty("newName")&&(n.newName=e.newName),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,k.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RenameOperation"},e})(),J=D.RootAttributeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.root="",e.prototype.key="",e.prototype.oldValueBoolean=!1,e.prototype.oldValueJson="",e.prototype.newValueBoolean=!1,e.prototype.newValueJson="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=j.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&t.uint32(10).string(e.root),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&t.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&t.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&t.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&t.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(56).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new D.RootAttributeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.root=e.string();break;case 2:r.key=e.string();break;case 3:r.oldValueBoolean=e.bool();break;case 4:r.oldValueJson=e.string();break;case 5:r.newValueBoolean=e.bool();break;case 6:r.newValueJson=e.string();break;case 7:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.root&&e.hasOwnProperty("root")&&!E.isString(e.root)?"root: string expected":null!=e.key&&e.hasOwnProperty("key")&&!E.isString(e.key)?"key: string expected":null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof e.oldValueBoolean?"oldValueBoolean: boolean expected":null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&!E.isString(e.oldValueJson)?"oldValueJson: string expected":null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof e.newValueBoolean?"newValueBoolean: boolean expected":null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&!E.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof D.RootAttributeOperation)return e;let t=new D.RootAttributeOperation;return null!=e.root&&(t.root=String(e.root)),null!=e.key&&(t.key=String(e.key)),null!=e.oldValueBoolean&&(t.oldValueBoolean=Boolean(e.oldValueBoolean)),null!=e.oldValueJson&&(t.oldValueJson=String(e.oldValueJson)),null!=e.newValueBoolean&&(t.newValueBoolean=Boolean(e.newValueBoolean)),null!=e.newValueJson&&(t.newValueJson=String(e.newValueJson)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.root="",n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=e.root&&e.hasOwnProperty("root")&&(n.root=e.root),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=e.oldValueBoolean),null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&(n.oldValueJson=e.oldValueJson),null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=e.newValueBoolean),null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&(n.newValueJson=e.newValueJson),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,k.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootAttributeOperation"},e})(),q=D.RootOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.rootName="",e.prototype.elementName="",e.prototype.isAdd=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=j.create()),null!=e.rootName&&Object.hasOwnProperty.call(e,"rootName")&&t.uint32(10).string(e.rootName),null!=e.elementName&&Object.hasOwnProperty.call(e,"elementName")&&t.uint32(18).string(e.elementName),null!=e.isAdd&&Object.hasOwnProperty.call(e,"isAdd")&&t.uint32(24).bool(e.isAdd),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new D.RootOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.rootName=e.string();break;case 2:r.elementName=e.string();break;case 3:r.isAdd=e.bool();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.rootName&&e.hasOwnProperty("rootName")&&!E.isString(e.rootName)?"rootName: string expected":null!=e.elementName&&e.hasOwnProperty("elementName")&&!E.isString(e.elementName)?"elementName: string expected":null!=e.isAdd&&e.hasOwnProperty("isAdd")&&"boolean"!=typeof e.isAdd?"isAdd: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof D.RootOperation)return e;let t=new D.RootOperation;return null!=e.rootName&&(t.rootName=String(e.rootName)),null!=e.elementName&&(t.elementName=String(e.elementName)),null!=e.isAdd&&(t.isAdd=Boolean(e.isAdd)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.rootName="",n.elementName="",n.isAdd=!1,n.wasUndone=!1),null!=e.rootName&&e.hasOwnProperty("rootName")&&(n.rootName=e.rootName),null!=e.elementName&&e.hasOwnProperty("elementName")&&(n.elementName=e.elementName),null!=e.isAdd&&e.hasOwnProperty("isAdd")&&(n.isAdd=e.isAdd),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,k.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootOperation"},e})(),L=D.SplitOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.splitPosition=null,e.prototype.graveyardPosition=null,e.prototype.howMany=0,e.prototype.insertionPosition=null,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=j.create()),null!=e.splitPosition&&Object.hasOwnProperty.call(e,"splitPosition")&&D.Position.encode(e.splitPosition,t.uint32(10).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&D.Position.encode(e.graveyardPosition,t.uint32(18).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(24).uint32(e.howMany),null!=e.insertionPosition&&Object.hasOwnProperty.call(e,"insertionPosition")&&D.Position.encode(e.insertionPosition,t.uint32(34).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new D.SplitOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.splitPosition=D.Position.decode(e,e.uint32());break;case 2:r.graveyardPosition=D.Position.decode(e,e.uint32());break;case 3:r.howMany=e.uint32();break;case 4:r.insertionPosition=D.Position.decode(e,e.uint32());break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.splitPosition&&e.hasOwnProperty("splitPosition")){let t=D.Position.verify(e.splitPosition);if(t)return"splitPosition."+t}if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")){let t=D.Position.verify(e.graveyardPosition);if(t)return"graveyardPosition."+t}if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!E.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")){let t=D.Position.verify(e.insertionPosition);if(t)return"insertionPosition."+t}return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof D.SplitOperation)return e;let t=new D.SplitOperation;if(null!=e.splitPosition){if("object"!=typeof e.splitPosition)throw TypeError(".SplitOperation.splitPosition: object expected");t.splitPosition=D.Position.fromObject(e.splitPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".SplitOperation.graveyardPosition: object expected");t.graveyardPosition=D.Position.fromObject(e.graveyardPosition)}if(null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.insertionPosition){if("object"!=typeof e.insertionPosition)throw TypeError(".SplitOperation.insertionPosition: object expected");t.insertionPosition=D.Position.fromObject(e.insertionPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.splitPosition=null,n.graveyardPosition=null,n.howMany=0,n.insertionPosition=null,n.wasUndone=!1),null!=e.splitPosition&&e.hasOwnProperty("splitPosition")&&(n.splitPosition=D.Position.toObject(e.splitPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=D.Position.toObject(e.graveyardPosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")&&(n.insertionPosition=D.Position.toObject(e.insertionPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,k.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SplitOperation"},e})(),G=D.Position=(()=>{function e(e){if(this.path=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.root="",e.prototype.rootMain=!1,e.prototype.rootGraveyard=!1,e.prototype.path=E.emptyArray,e.prototype.stickiness="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=j.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&t.uint32(10).string(e.root),null!=e.rootMain&&Object.hasOwnProperty.call(e,"rootMain")&&t.uint32(16).bool(e.rootMain),null!=e.rootGraveyard&&Object.hasOwnProperty.call(e,"rootGraveyard")&&t.uint32(24).bool(e.rootGraveyard),null!=e.path&&e.path.length){t.uint32(34).fork();for(let n=0;n<e.path.length;++n)t.uint32(e.path[n]);t.ldelim()}return null!=e.stickiness&&Object.hasOwnProperty.call(e,"stickiness")&&t.uint32(42).string(e.stickiness),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new D.Position;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.root=e.string();break;case 2:r.rootMain=e.bool();break;case 3:r.rootGraveyard=e.bool();break;case 4:if(r.path&&r.path.length||(r.path=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.path.push(e.uint32())}else r.path.push(e.uint32());break;case 5:r.stickiness=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.root&&e.hasOwnProperty("root")&&!E.isString(e.root))return"root: string expected";if(null!=e.rootMain&&e.hasOwnProperty("rootMain")&&"boolean"!=typeof e.rootMain)return"rootMain: boolean expected";if(null!=e.rootGraveyard&&e.hasOwnProperty("rootGraveyard")&&"boolean"!=typeof e.rootGraveyard)return"rootGraveyard: boolean expected";if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(let t=0;t<e.path.length;++t)if(!E.isInteger(e.path[t]))return"path: integer[] expected"}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&!E.isString(e.stickiness)?"stickiness: string expected":null},e.fromObject=function(e){if(e instanceof D.Position)return e;let t=new D.Position;if(null!=e.root&&(t.root=String(e.root)),null!=e.rootMain&&(t.rootMain=Boolean(e.rootMain)),null!=e.rootGraveyard&&(t.rootGraveyard=Boolean(e.rootGraveyard)),e.path){if(!Array.isArray(e.path))throw TypeError(".Position.path: array expected");t.path=[];for(let n=0;n<e.path.length;++n)t.path[n]=e.path[n]>>>0}return null!=e.stickiness&&(t.stickiness=String(e.stickiness)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.path=[]),t.defaults&&(n.root="",n.rootMain=!1,n.rootGraveyard=!1,n.stickiness=""),null!=e.root&&e.hasOwnProperty("root")&&(n.root=e.root),null!=e.rootMain&&e.hasOwnProperty("rootMain")&&(n.rootMain=e.rootMain),null!=e.rootGraveyard&&e.hasOwnProperty("rootGraveyard")&&(n.rootGraveyard=e.rootGraveyard),e.path&&e.path.length){n.path=[];for(let t=0;t<e.path.length;++t)n.path[t]=e.path[t]}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&(n.stickiness=e.stickiness),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,k.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Position"},e})(),F=D.Range=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.start=null,e.prototype.end=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=j.create()),null!=e.start&&Object.hasOwnProperty.call(e,"start")&&D.Position.encode(e.start,t.uint32(10).fork()).ldelim(),null!=e.end&&Object.hasOwnProperty.call(e,"end")&&D.Position.encode(e.end,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new D.Range;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.start=D.Position.decode(e,e.uint32());break;case 2:r.end=D.Position.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.start&&e.hasOwnProperty("start")){let t=D.Position.verify(e.start);if(t)return"start."+t}if(null!=e.end&&e.hasOwnProperty("end")){let t=D.Position.verify(e.end);if(t)return"end."+t}return null},e.fromObject=function(e){if(e instanceof D.Range)return e;let t=new D.Range;if(null!=e.start){if("object"!=typeof e.start)throw TypeError(".Range.start: object expected");t.start=D.Position.fromObject(e.start)}if(null!=e.end){if("object"!=typeof e.end)throw TypeError(".Range.end: object expected");t.end=D.Position.fromObject(e.end)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.start=null,n.end=null),null!=e.start&&e.hasOwnProperty("start")&&(n.start=D.Position.toObject(e.start,t)),null!=e.end&&e.hasOwnProperty("end")&&(n.end=D.Position.toObject(e.end,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,k.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Range"},e})(),Y=D.Element=(()=>{function e(e){if(this.children=[],this.attributesBoolean={},e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.children=E.emptyArray,e.prototype.data="",e.prototype.attributesBoolean=E.emptyObject,e.prototype.attributesJson="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=j.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.children&&e.children.length)for(let n=0;n<e.children.length;++n)D.Element.encode(e.children[n],t.uint32(18).fork()).ldelim();if(null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).string(e.data),null!=e.attributesBoolean&&Object.hasOwnProperty.call(e,"attributesBoolean"))for(let n=Object.keys(e.attributesBoolean),r=0;r<n.length;++r)t.uint32(34).fork().uint32(10).string(n[r]).uint32(16).bool(e.attributesBoolean[n[r]]).ldelim();return null!=e.attributesJson&&Object.hasOwnProperty.call(e,"attributesJson")&&t.uint32(42).string(e.attributesJson),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n,r,o=void 0===t?e.len:e.pos+t,s=new D.Element;for(;e.pos<o;){let t=e.uint32();switch(t>>>3){case 1:s.name=e.string();break;case 2:s.children&&s.children.length||(s.children=[]),s.children.push(D.Element.decode(e,e.uint32()));break;case 3:s.data=e.string();break;case 4:{s.attributesBoolean===E.emptyObject&&(s.attributesBoolean={});let t=e.uint32()+e.pos;for(n="",r=!1;e.pos<t;){let t=e.uint32();switch(t>>>3){case 1:n=e.string();break;case 2:r=e.bool();break;default:e.skipType(7&t)}}s.attributesBoolean[n]=r;break}case 5:s.attributesJson=e.string();break;default:e.skipType(7&t)}}return s},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!E.isString(e.name))return"name: string expected";if(null!=e.children&&e.hasOwnProperty("children")){if(!Array.isArray(e.children))return"children: array expected";for(let t=0;t<e.children.length;++t){let n=D.Element.verify(e.children[t]);if(n)return"children."+n}}if(null!=e.data&&e.hasOwnProperty("data")&&!E.isString(e.data))return"data: string expected";if(null!=e.attributesBoolean&&e.hasOwnProperty("attributesBoolean")){if(!E.isObject(e.attributesBoolean))return"attributesBoolean: object expected";let t=Object.keys(e.attributesBoolean);for(let n=0;n<t.length;++n)if("boolean"!=typeof e.attributesBoolean[t[n]])return"attributesBoolean: boolean{k:string} expected"}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&!E.isString(e.attributesJson)?"attributesJson: string expected":null},e.fromObject=function(e){if(e instanceof D.Element)return e;let t=new D.Element;if(null!=e.name&&(t.name=String(e.name)),e.children){if(!Array.isArray(e.children))throw TypeError(".Element.children: array expected");t.children=[];for(let n=0;n<e.children.length;++n){if("object"!=typeof e.children[n])throw TypeError(".Element.children: object expected");t.children[n]=D.Element.fromObject(e.children[n])}}if(null!=e.data&&(t.data=String(e.data)),e.attributesBoolean){if("object"!=typeof e.attributesBoolean)throw TypeError(".Element.attributesBoolean: object expected");t.attributesBoolean={};for(let n=Object.keys(e.attributesBoolean),r=0;r<n.length;++r)t.attributesBoolean[n[r]]=Boolean(e.attributesBoolean[n[r]])}return null!=e.attributesJson&&(t.attributesJson=String(e.attributesJson)),t},e.toObject=function(e,t){t||(t={});let n,r={};if((t.arrays||t.defaults)&&(r.children=[]),(t.objects||t.defaults)&&(r.attributesBoolean={}),t.defaults&&(r.name="",r.data="",r.attributesJson=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),e.children&&e.children.length){r.children=[];for(let n=0;n<e.children.length;++n)r.children[n]=D.Element.toObject(e.children[n],t)}if(null!=e.data&&e.hasOwnProperty("data")&&(r.data=e.data),e.attributesBoolean&&(n=Object.keys(e.attributesBoolean)).length){r.attributesBoolean={};for(let t=0;t<n.length;++t)r.attributesBoolean[n[t]]=e.attributesBoolean[n[t]]}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&(r.attributesJson=e.attributesJson),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,k.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Element"},e})();class z{constructor(){this._protobufRoot=e}getDescriptor(e){return new H(this._protobufRoot[e])}}class H{constructor(e){this._protobuf=e}compress(e){const t=this._protobuf.verify(e);if(t)throw Error(t);return this._protobuf.encode(this._protobuf.create(e)).finish()}decompress(e){return this._protobuf.toObject(this._protobuf.decode(e),{oneofs:!0})}}const K=function(){this.__data__=[],this.size=0};const W=function(e,t){return e===t||e!=e&&t!=t};const $=function(e,t){for(var n=e.length;n--;)if(W(e[n][0],t))return n;return-1};var X=Array.prototype.splice;const Z=function(e){var t=this.__data__,n=$(t,e);return!(n<0)&&(n==t.length-1?t.pop():X.call(t,n,1),--this.size,!0)};const Q=function(e){var t=this.__data__,n=$(t,e);return n<0?void 0:t[n][1]};const ee=function(e){return $(this.__data__,e)>-1};const te=function(e,t){var n=this.__data__,r=$(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function ne(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ne.prototype.clear=K,ne.prototype.delete=Z,ne.prototype.get=Q,ne.prototype.has=ee,ne.prototype.set=te;const re=ne;const oe=function(){this.__data__=new re,this.size=0};const se=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const ie=function(e){return this.__data__.get(e)};const ae=function(e){return this.__data__.has(e)};const ce="object"==typeof global&&global&&global.Object===Object&&global;var ue="object"==typeof self&&self&&self.Object===Object&&self;const de=ce||ue||Function("return this")();const le=de.Symbol;var pe=Object.prototype,he=pe.hasOwnProperty,fe=pe.toString,me=le?le.toStringTag:void 0;const ye=function(e){var t=he.call(e,me),n=e[me];try{e[me]=void 0;var r=!0}catch(e){}var o=fe.call(e);return r&&(t?e[me]=n:delete e[me]),o};var ge=Object.prototype.toString;const be=function(e){return ge.call(e)};var Oe=le?le.toStringTag:void 0;const ve=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Oe&&Oe in Object(e)?ye(e):be(e)};const we=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const xe=function(e){if(!we(e))return!1;var t=ve(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const _e=de["__core-js_shared__"];var Ie,Se=(Ie=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||""))?"Symbol(src)_1."+Ie:"";const Pe=function(e){return!!Se&&Se in e};var Te=Function.prototype.toString;const Ae=function(e){if(null!=e){try{return Te.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var ke=/^\[object .+?Constructor\]$/,Ce=Function.prototype,je=Object.prototype,Ee=Ce.toString,De=je.hasOwnProperty,Re=RegExp("^"+Ee.call(De).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Ne=function(e){return!(!we(e)||Pe(e))&&(xe(e)?Re:ke).test(Ae(e))};const Me=function(e,t){return null==e?void 0:e[t]};const Ve=function(e,t){var n=Me(e,t);return Ne(n)?n:void 0};const Be=Ve(de,"Map");const Ue=Ve(Object,"create");const Je=function(){this.__data__=Ue?Ue(null):{},this.size=0};const qe=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var Le=Object.prototype.hasOwnProperty;const Ge=function(e){var t=this.__data__;if(Ue){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Le.call(t,e)?t[e]:void 0};var Fe=Object.prototype.hasOwnProperty;const Ye=function(e){var t=this.__data__;return Ue?void 0!==t[e]:Fe.call(t,e)};const ze=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ue&&void 0===t?"__lodash_hash_undefined__":t,this};function He(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}He.prototype.clear=Je,He.prototype.delete=qe,He.prototype.get=Ge,He.prototype.has=Ye,He.prototype.set=ze;const Ke=He;const We=function(){this.size=0,this.__data__={hash:new Ke,map:new(Be||re),string:new Ke}};const $e=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const Xe=function(e,t){var n=e.__data__;return $e(t)?n["string"==typeof t?"string":"hash"]:n.map};const Ze=function(e){var t=Xe(this,e).delete(e);return this.size-=t?1:0,t};const Qe=function(e){return Xe(this,e).get(e)};const et=function(e){return Xe(this,e).has(e)};const tt=function(e,t){var n=Xe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function nt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}nt.prototype.clear=We,nt.prototype.delete=Ze,nt.prototype.get=Qe,nt.prototype.has=et,nt.prototype.set=tt;const rt=nt;const ot=function(e,t){var n=this.__data__;if(n instanceof re){var r=n.__data__;if(!Be||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new rt(r)}return n.set(e,t),this.size=n.size,this};function st(e){var t=this.__data__=new re(e);this.size=t.size}st.prototype.clear=oe,st.prototype.delete=se,st.prototype.get=ie,st.prototype.has=ae,st.prototype.set=ot;const it=st;const at=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e};const ct=function(){try{var e=Ve(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const ut=function(e,t,n){"__proto__"==t&&ct?ct(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var dt=Object.prototype.hasOwnProperty;const lt=function(e,t,n){var r=e[t];dt.call(e,t)&&W(r,n)&&(void 0!==n||t in e)||ut(e,t,n)};const pt=function(e,t,n,r){var o=!n;n||(n={});for(var s=-1,i=t.length;++s<i;){var a=t[s],c=r?r(n[a],e[a],a,n,e):void 0;void 0===c&&(c=e[a]),o?ut(n,a,c):lt(n,a,c)}return n};const ht=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};const ft=function(e){return null!=e&&"object"==typeof e};const mt=function(e){return ft(e)&&"[object Arguments]"==ve(e)};var yt=Object.prototype,gt=yt.hasOwnProperty,bt=yt.propertyIsEnumerable;const Ot=mt(function(){return arguments}())?mt:function(e){return ft(e)&&gt.call(e,"callee")&&!bt.call(e,"callee")};const vt=Array.isArray;const wt=function(){return!1};var xt="object"==typeof exports&&exports&&!exports.nodeType&&exports,_t=xt&&"object"==typeof module&&module&&!module.nodeType&&module,It=_t&&_t.exports===xt?de.Buffer:void 0;const St=(It?It.isBuffer:void 0)||wt;var Pt=/^(?:0|[1-9]\d*)$/;const Tt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Pt.test(e))&&e>-1&&e%1==0&&e<t};const At=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var kt={};kt["[object Float32Array]"]=kt["[object Float64Array]"]=kt["[object Int8Array]"]=kt["[object Int16Array]"]=kt["[object Int32Array]"]=kt["[object Uint8Array]"]=kt["[object Uint8ClampedArray]"]=kt["[object Uint16Array]"]=kt["[object Uint32Array]"]=!0,kt["[object Arguments]"]=kt["[object Array]"]=kt["[object ArrayBuffer]"]=kt["[object Boolean]"]=kt["[object DataView]"]=kt["[object Date]"]=kt["[object Error]"]=kt["[object Function]"]=kt["[object Map]"]=kt["[object Number]"]=kt["[object Object]"]=kt["[object RegExp]"]=kt["[object Set]"]=kt["[object String]"]=kt["[object WeakMap]"]=!1;const Ct=function(e){return ft(e)&&At(e.length)&&!!kt[ve(e)]};const jt=function(e){return function(t){return e(t)}};var Et="object"==typeof exports&&exports&&!exports.nodeType&&exports,Dt=Et&&"object"==typeof module&&module&&!module.nodeType&&module,Rt=Dt&&Dt.exports===Et&&ce.process;const Nt=function(){try{var e=Dt&&Dt.require&&Dt.require("util").types;return e||Rt&&Rt.binding&&Rt.binding("util")}catch(e){}}();var Mt=Nt&&Nt.isTypedArray;const Vt=Mt?jt(Mt):Ct;var Bt=Object.prototype.hasOwnProperty;const Ut=function(e,t){var n=vt(e),r=!n&&Ot(e),o=!n&&!r&&St(e),s=!n&&!r&&!o&&Vt(e),i=n||r||o||s,a=i?ht(e.length,String):[],c=a.length;for(var u in e)!t&&!Bt.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Tt(u,c))||a.push(u);return a};var Jt=Object.prototype;const qt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Jt)};const Lt=function(e,t){return function(n){return e(t(n))}};const Gt=Lt(Object.keys,Object);var Ft=Object.prototype.hasOwnProperty;const Yt=function(e){if(!qt(e))return Gt(e);var t=[];for(var n in Object(e))Ft.call(e,n)&&"constructor"!=n&&t.push(n);return t};const zt=function(e){return null!=e&&At(e.length)&&!xe(e)};const Ht=function(e){return zt(e)?Ut(e):Yt(e)};const Kt=function(e,t){return e&&pt(t,Ht(t),e)};const Wt=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var $t=Object.prototype.hasOwnProperty;const Xt=function(e){if(!we(e))return Wt(e);var t=qt(e),n=[];for(var r in e)("constructor"!=r||!t&&$t.call(e,r))&&n.push(r);return n};const Zt=function(e){return zt(e)?Ut(e,!0):Xt(e)};const Qt=function(e,t){return e&&pt(t,Zt(t),e)};var en="object"==typeof exports&&exports&&!exports.nodeType&&exports,tn=en&&"object"==typeof module&&module&&!module.nodeType&&module,nn=tn&&tn.exports===en?de.Buffer:void 0,rn=nn?nn.allocUnsafe:void 0;const on=function(e,t){if(t)return e.slice();var n=e.length,r=rn?rn(n):new e.constructor(n);return e.copy(r),r};const sn=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};const an=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,s=[];++n<r;){var i=e[n];t(i,n,e)&&(s[o++]=i)}return s};const cn=function(){return[]};var un=Object.prototype.propertyIsEnumerable,dn=Object.getOwnPropertySymbols;const ln=dn?function(e){return null==e?[]:(e=Object(e),an(dn(e),(function(t){return un.call(e,t)})))}:cn;const pn=function(e,t){return pt(e,ln(e),t)};const hn=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e};const fn=Lt(Object.getPrototypeOf,Object);const mn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)hn(t,ln(e)),e=fn(e);return t}:cn;const yn=function(e,t){return pt(e,mn(e),t)};const gn=function(e,t,n){var r=t(e);return vt(e)?r:hn(r,n(e))};const bn=function(e){return gn(e,Ht,ln)};const On=function(e){return gn(e,Zt,mn)};const vn=Ve(de,"DataView");const wn=Ve(de,"Promise");const xn=Ve(de,"Set");const _n=Ve(de,"WeakMap");var In="[object Map]",Sn="[object Promise]",Pn="[object Set]",Tn="[object WeakMap]",An="[object DataView]",kn=Ae(vn),Cn=Ae(Be),jn=Ae(wn),En=Ae(xn),Dn=Ae(_n),Rn=ve;(vn&&Rn(new vn(new ArrayBuffer(1)))!=An||Be&&Rn(new Be)!=In||wn&&Rn(wn.resolve())!=Sn||xn&&Rn(new xn)!=Pn||_n&&Rn(new _n)!=Tn)&&(Rn=function(e){var t=ve(e),n="[object Object]"==t?e.constructor:void 0,r=n?Ae(n):"";if(r)switch(r){case kn:return An;case Cn:return In;case jn:return Sn;case En:return Pn;case Dn:return Tn}return t});const Nn=Rn;var Mn=Object.prototype.hasOwnProperty;const Vn=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Mn.call(e,"index")&&(n.index=e.index,n.input=e.input),n};const Bn=de.Uint8Array;const Un=function(e){var t=new e.constructor(e.byteLength);return new Bn(t).set(new Bn(e)),t};const Jn=function(e,t){var n=t?Un(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var qn=/\w*$/;const Ln=function(e){var t=new e.constructor(e.source,qn.exec(e));return t.lastIndex=e.lastIndex,t};var Gn=le?le.prototype:void 0,Fn=Gn?Gn.valueOf:void 0;const Yn=function(e){return Fn?Object(Fn.call(e)):{}};const zn=function(e,t){var n=t?Un(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const Hn=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return Un(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return Jn(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return zn(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return Ln(e);case"[object Symbol]":return Yn(e)}};var Kn=Object.create;const Wn=function(){function e(){}return function(t){if(!we(t))return{};if(Kn)return Kn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const $n=function(e){return"function"!=typeof e.constructor||qt(e)?{}:Wn(fn(e))};const Xn=function(e){return ft(e)&&"[object Map]"==Nn(e)};var Zn=Nt&&Nt.isMap;const Qn=Zn?jt(Zn):Xn;const er=function(e){return ft(e)&&"[object Set]"==Nn(e)};var tr=Nt&&Nt.isSet;const nr=tr?jt(tr):er;var rr="[object Arguments]",or="[object Function]",sr="[object Object]",ir={};ir[rr]=ir["[object Array]"]=ir["[object ArrayBuffer]"]=ir["[object DataView]"]=ir["[object Boolean]"]=ir["[object Date]"]=ir["[object Float32Array]"]=ir["[object Float64Array]"]=ir["[object Int8Array]"]=ir["[object Int16Array]"]=ir["[object Int32Array]"]=ir["[object Map]"]=ir["[object Number]"]=ir[sr]=ir["[object RegExp]"]=ir["[object Set]"]=ir["[object String]"]=ir["[object Symbol]"]=ir["[object Uint8Array]"]=ir["[object Uint8ClampedArray]"]=ir["[object Uint16Array]"]=ir["[object Uint32Array]"]=!0,ir["[object Error]"]=ir[or]=ir["[object WeakMap]"]=!1;const ar=function e(t,n,r,o,s,i){var a,c=1&n,u=2&n,d=4&n;if(r&&(a=s?r(t,o,s,i):r(t)),void 0!==a)return a;if(!we(t))return t;var l=vt(t);if(l){if(a=Vn(t),!c)return sn(t,a)}else{var p=Nn(t),h=p==or||"[object GeneratorFunction]"==p;if(St(t))return on(t,c);if(p==sr||p==rr||h&&!s){if(a=u||h?{}:$n(t),!c)return u?yn(t,Qt(a,t)):pn(t,Kt(a,t))}else{if(!ir[p])return s?t:{};a=Hn(t,p,c)}}i||(i=new it);var f=i.get(t);if(f)return f;i.set(t,a),nr(t)?t.forEach((function(o){a.add(e(o,n,r,o,t,i))})):Qn(t)&&t.forEach((function(o,s){a.set(s,e(o,n,r,s,t,i))}));var m=l?void 0:(d?u?On:bn:u?Zt:Ht)(t);return at(m||t,(function(o,s){m&&(o=t[s=o]),lt(a,s,e(o,n,r,s,t,i))})),a};const cr=function(e){return ar(e,5)};const ur=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const dr=function(e){return this.__data__.has(e)};function lr(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new rt;++t<n;)this.add(e[t])}lr.prototype.add=lr.prototype.push=ur,lr.prototype.has=dr;const pr=lr;const hr=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};const fr=function(e,t){return e.has(t)};const mr=function(e,t,n,r,o,s){var i=1&n,a=e.length,c=t.length;if(a!=c&&!(i&&c>a))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var l=-1,p=!0,h=2&n?new pr:void 0;for(s.set(e,t),s.set(t,e);++l<a;){var f=e[l],m=t[l];if(r)var y=i?r(m,f,l,t,e,s):r(f,m,l,e,t,s);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!hr(t,(function(e,t){if(!fr(h,t)&&(f===e||o(f,e,n,r,s)))return h.push(t)}))){p=!1;break}}else if(f!==m&&!o(f,m,n,r,s)){p=!1;break}}return s.delete(e),s.delete(t),p};const yr=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};const gr=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var br=le?le.prototype:void 0,Or=br?br.valueOf:void 0;const vr=function(e,t,n,r,o,s,i){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new Bn(e),new Bn(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return W(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=yr;case"[object Set]":var c=1&r;if(a||(a=gr),e.size!=t.size&&!c)return!1;var u=i.get(e);if(u)return u==t;r|=2,i.set(e,t);var d=mr(a(e),a(t),r,o,s,i);return i.delete(e),d;case"[object Symbol]":if(Or)return Or.call(e)==Or.call(t)}return!1};var wr=Object.prototype.hasOwnProperty;const xr=function(e,t,n,r,o,s){var i=1&n,a=bn(e),c=a.length;if(c!=bn(t).length&&!i)return!1;for(var u=c;u--;){var d=a[u];if(!(i?d in t:wr.call(t,d)))return!1}var l=s.get(e),p=s.get(t);if(l&&p)return l==t&&p==e;var h=!0;s.set(e,t),s.set(t,e);for(var f=i;++u<c;){var m=e[d=a[u]],y=t[d];if(r)var g=i?r(y,m,d,t,e,s):r(m,y,d,e,t,s);if(!(void 0===g?m===y||o(m,y,n,r,s):g)){h=!1;break}f||(f="constructor"==d)}if(h&&!f){var b=e.constructor,O=t.constructor;b==O||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof O&&O instanceof O||(h=!1)}return s.delete(e),s.delete(t),h};var _r="[object Arguments]",Ir="[object Array]",Sr="[object Object]",Pr=Object.prototype.hasOwnProperty;const Tr=function(e,t,n,r,o,s){var i=vt(e),a=vt(t),c=i?Ir:Nn(e),u=a?Ir:Nn(t),d=(c=c==_r?Sr:c)==Sr,l=(u=u==_r?Sr:u)==Sr,p=c==u;if(p&&St(e)){if(!St(t))return!1;i=!0,d=!1}if(p&&!d)return s||(s=new it),i||Vt(e)?mr(e,t,n,r,o,s):vr(e,t,c,n,r,o,s);if(!(1&n)){var h=d&&Pr.call(e,"__wrapped__"),f=l&&Pr.call(t,"__wrapped__");if(h||f){var m=h?e.value():e,y=f?t.value():t;return s||(s=new it),o(m,y,n,r,s)}}return!!p&&(s||(s=new it),xr(e,t,n,r,o,s))};const Ar=function e(t,n,r,o,s){return t===n||(null==t||null==n||!ft(t)&&!ft(n)?t!=t&&n!=n:Tr(t,n,r,o,e,s))};const kr=function(e,t){return Ar(e,t)};function Cr(e,t){const n=cr(e);return n.path[n.path.length-1]+=t,n}function jr(e,t){return e.root===t.root&&kr(e.path,t.path)}function Er(e){Rr(e,(e=>("main"==e.root?(e.rootMain=!0,delete e.root):"$graveyard"==e.root&&(e.rootGraveyard=!0,delete e.root),e)))}function Dr(e){Rr(e,(e=>(e.rootMain?(e.root="main",delete e.rootMain):e.rootGraveyard&&(e.root="$graveyard",delete e.rootGraveyard),e)))}function Rr(e,t){for(const n in e){const r=e[n];"nodes"!==n&&we(r)&&(r.path&&(r.root||r.rootMain||r.rootGraveyard)?e[n]=t(r):Rr(r,t))}return e}class Nr{constructor(e,t,n){this._id=e,this._operationName=t,this._protobufDescriptor=n}compress(e,t){const n=t.shift();return Er(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){t.types.shift();const n=this._protobufDescriptor.decompress(t.buffers.shift());Dr(n),n.__className=this._operationName,e.push(n)}}class Mr extends Nr{compress(e,t){const n=t.shift();return this._serializeOneOf("oldValue",n),this._serializeOneOf("newValue",n),Er(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){const{types:n,buffers:r}=t,o=this._protobufDescriptor.decompress(r.shift());n.shift(),this._deserializeOneOf("oldValue",o),this._deserializeOneOf("newValue",o),Dr(o),o.__className=this._operationName,e.push(o)}_serializeOneOf(e,t){const n=t[e];"boolean"==typeof n?t[`${e}Boolean`]=n:t[`${e}Json`]=JSON.stringify(n)}_deserializeOneOf(e,t){const n=`${e}Json`;t[n]?(t[e]=JSON.parse(t[n]),delete t[n]):(t[e]=t[`${e}Boolean`],delete t[`${e}Boolean`])}}class Vr extends Nr{compress(e,t){const n=t.shift();return this._serializeNodesAttributes(n.nodes),Er(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){const{types:n,buffers:r}=t,o=this._protobufDescriptor.decompress(r.shift());n.shift(),o.nodes||(o.nodes=[]),this._deserializeNodesAttributes(o.nodes),Dr(o),o.__className=this._operationName,e.push(o)}_serializeNodesAttributes(e){for(const t of e){if(t.attributes){const e=t.attributes;this._areValuesBoolean(e)?t.attributesBoolean=e:t.attributesJson=JSON.stringify(e)}t.children&&this._serializeNodesAttributes(t.children)}}_deserializeNodesAttributes(e){for(const t of e)(t.attributesBoolean||t.attributesJson)&&(t.attributesBoolean?(t.attributes=t.attributesBoolean,delete t.attributesBoolean):(t.attributes=JSON.parse(t.attributesJson),delete t.attributesJson)),t.children&&this._deserializeNodesAttributes(t.children)}_areValuesBoolean(e){return Object.keys(e).every((t=>"boolean"==typeof e[t]))}}class Br extends Nr{decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.oldRange||(n.oldRange=null),n.newRange||(n.newRange=null)}}class Ur extends Nr{compress(e,t){return t.shift(),e.types.push(this._id),!0}decompress(e,t){t.types.shift(),e.push({__className:this._operationName})}}class Jr extends Br{constructor(e,t,n,r){super(e,t,n),this._omittedNamespace=r+":"}compress(e,t){return!("MarkerOperation"!=t[0].__className||!t[0].name.startsWith(this._omittedNamespace))&&(t[0].name=t[0].name.replace(new RegExp("^"+this._omittedNamespace),""),super.compress(e,t),!0)}decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.name=this._omittedNamespace+n.name}}class qr{constructor(e,t){this._id=e,this._context=t}compress(e,t){let n;for(;t.length>1&&this._compareOperations(t[0],t[1]);)n?(n=this._combineNext(t.shift(),n),e.types.push(0)):(n=cr(t.shift()),e.types.push(this._id));return!!n&&(n=this._combineNext(t.shift(),n),e.types.push(0),e.buffers.push(this._compressSingleOperation(n)),!0)}decompress(e,t){const n=this._decompressSingleOperation(t);for(;0==t.types[0];)t.types.shift(),e.push(this._splitCurrent(n));e.push(n)}}class Lr extends qr{_combineNext(e,t){return t.nodes[0].data+=e.nodes[0].data,t}_splitCurrent(e){const t=cr(e),n=t.nodes[0],r=e.nodes[0],o=r.data[Symbol.iterator]().next().value,s=o.length;return n.data=o,r.data=r.data.substr(s),e.position=Cr(e.position,s),t}_compareOperations(e,t){if(this._checkOperation(e)&&this._checkOperation(t)){const n=e.nodes[0].data.length,r=jr(Cr(e.position,n),t.position),o=e.nodes[0],s=t.nodes[0];return r&&this._compareAttributes(o,s)}return!1}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("InsertOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("InsertOperation").decompress(t,e),t[0]}_checkOperation(e){return"InsertOperation"==e.__className&&1==e.nodes.length&&e.nodes[0].data&&!e.wasUndone&&1==Array.from(e.nodes[0].data).length}_compareAttributes(e,t){const n=Object.keys(e.attributes||{}),r=Object.keys(t.attributes||{});return n.length===r.length&&n.every((n=>t.attributes[n]&&t.attributes[n]===e.attributes[n]))}}class Gr extends qr{_combineNext(e,t){return t.howMany++,t.sourcePosition=cr(e.sourcePosition),t}_splitCurrent(e){const t=cr(e);return e.howMany--,t.howMany=1,t.sourcePosition=Cr(t.sourcePosition,e.howMany),t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(jr(Cr(e.sourcePosition,-1),t.sourcePosition)&&jr(e.targetPosition,t.targetPosition))}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MoveOperation").decompress(t,e),t[0]}_checkOperation(e){return"MoveOperation"==e.__className&&"$graveyard"==e.targetPosition.root&&1==e.howMany&&!e.wasUndone}}class Fr extends qr{_combineNext(e,t){return t.howMany++,t}_splitCurrent(e){const t=cr(e);return t.howMany=1,e.howMany--,t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(jr(e.sourcePosition,t.sourcePosition)&&jr(e.targetPosition,t.targetPosition))}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MoveOperation").decompress(t,e),t[0]}_checkOperation(e){return"MoveOperation"==e.__className&&"$graveyard"==e.targetPosition.root&&1==e.howMany&&!e.wasUndone}}class Yr extends qr{compress(e,t){if(!this._compareOperations(t[0],t[1]))return!1;const n=t.shift();return n.oldRange=null,n.newRange&&jr(n.newRange.start,n.newRange.end)&&(n.newRange.end=null),t.shift(),e.types.push(this._id),e.types.push(0),e.buffers.push(this._compressSingleOperation(n)),!0}decompress(e,t){const n=this._decompressSingleOperation(t);n.newRange&&!n.newRange.end&&(n.newRange.end=cr(n.newRange.start));const r=cr(n);r.newRange&&(r.newRange.start.stickiness="toNone",r.newRange.end=cr(r.newRange.start)),r.name="user:position:"+r.name.split(":")[2],t.types.shift(),e.push(n),e.push(r)}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MarkerOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MarkerOperation").decompress(t,e),t[0]}_compareOperations(e,t){return!(!e||!t)&&("MarkerOperation"==e.__className&&"MarkerOperation"==t.__className&&!(!e.name.startsWith("user:")||!t.name.startsWith("user:")||e.name==t.name))}}class zr{constructor(){this._compressorById=new Map,this._compressorByName=new Map,this._protobufFactory=new z;const e=this._protobufFactory.getDescriptor("MarkerOperation");this._registerCompressor(1,"NoOperation",new Ur(1,"NoOperation",void 0)),this._registerOperationCompressor(10,"AttributeOperation",Mr),this._registerOperationCompressor(11,"InsertOperation",Vr),this._registerOperationCompressor(12,"MarkerOperation",Br),this._registerOperationCompressor(13,"MergeOperation",Nr),this._registerOperationCompressor(14,"MoveOperation",Nr),this._registerOperationCompressor(15,"RenameOperation",Nr),this._registerOperationCompressor(16,"RootAttributeOperation",Mr),this._registerOperationCompressor(17,"SplitOperation",Nr),this._registerCompressor(18,"CommentMarkerOperation",new Jr(18,"MarkerOperation",e,"comment")),this._registerCompressor(19,"SuggestionMarkerOperation",new Jr(19,"MarkerOperation",e,"suggestion")),this._registerOperationCompressor(20,"RootOperation",Nr),this._registerActionCompressor(100,"TypingAction",Lr),this._registerActionCompressor(101,"DeletingAction",Gr),this._registerActionCompressor(102,"ForwardDeletingAction",Fr),this._registerActionCompressor(103,"UserSelectionAction",Yr)}compress(e){if(!e||!e[0])throw new n.CKEditorError("no-operations-provided",this);const t={types:[],buffers:[],baseVersion:e[0].baseVersion};for(;e.length;)this._getCompressorByName("UserSelectionAction").compress(t,e)||this._getCompressorByName("TypingAction").compress(t,e)||this._getCompressorByName("DeletingAction").compress(t,e)||this._getCompressorByName("ForwardDeletingAction").compress(t,e)||this._getCompressorByName("CommentMarkerOperation").compress(t,e)||this._getCompressorByName("SuggestionMarkerOperation").compress(t,e)||this._getCompressorByName(e[0].__className).compress(t,e);return t}decompress(e){const t=[];for(;e.types.length;){this._compressorById.get(e.types[0]).decompress(t,e)}return t.forEach(((t,n)=>t.baseVersion=e.baseVersion+n)),t}_getCompressorByName(e){return this._compressorByName.get(e)}_registerOperationCompressor(e,t,n){const r=new n(e,t,this._protobufFactory.getDescriptor(t));this._registerCompressor(e,t,r)}_registerActionCompressor(e,t,n){const r=new n(e,this);this._registerCompressor(e,t,r)}_registerCompressor(e,t,n){this._compressorById.set(e,n),this._compressorByName.set(t,n)}}var Hr=__webpack_require__(7622),Kr=__webpack_require__.n(Hr),Wr=__webpack_require__(7530),$r=__webpack_require__.n(Wr);const Xr=["showWarning","_isEditingAllowed","realtimecollaborationclient-handleserverresponse","_currentBufferDelay","$root","_handleSendingSelectionMarkers","rootsAttributes","multi-root-editor-root-attributes-no-root","_sendBufferedOperationsDelayId","lastDocumentSession","init","ready","_disconnectService","_clearPendingAction","then","change:_isEditingAllowed","_document","includes","getMany","realtimecollaborationclient-init-document-already-initialized","rtc-offline","_ignoredOperations","createRange","mySessionId","_lastServerVersion","filter","isReadOnly","_sendBufferedOperationsDelayed","_isDisconnection","disconnect","_decompressOperations","RootOperation","string","isEnabled","has","startsWith","lastOperationId","_compressor","baseVersion","realtimecollaborationclient-init-non-existent-root","cloud-services-internal-error: Collaborative Editing Service is not connected.","reconnect","RealTimeCollaborationClient","collaboration.channelId","_disconnectionOperations","data","requires","metadata","getUser","_shouldSendSelectionUpdate","high","cloud-services-internal-error: Request timeout.","clone","permissions","_hasSelectionChanged","cs:removeUser","apply","enqueueChange","_bufferedOperations","map","_channelId","root","_isPendingUpdate","affectsData","getConnectedSessions","_authorId","_initSessionsHandling","type","_setUpDataInit","message","Notification","_connectAfterSessionHasBeenFlushed","_handleReceivedOperations","position","_operationToId","batch","realtimecollaborationclient-sendbufferedoperations","wereChangesApplied","currentDocumentSession","change:hasDomSelection","lastSyncVersion","sendOperations","_refreshUserSelectionMarkers","disconnected","_initThrowingOnDataSet","sessionAdd:","CollaborativeEditingService","editor","get","path","__className","from","Permissions","_lastSyncedOperationId","size","initData","error","cloudServices.bundleVersion","state","set","register","real-time-collaboration","_isConnected","round","userId","stop","isAdd","getIdOfTheLastOperation","end","connect","unregister","connection","add","enableReadOnlyMode","_knownOperations","_sendBufferedOperations","destroy","createPositionFromPath","plugins","finally","setIdForTheLastOperation","realtimecollaborationclient-initservice-incorrect-server-operation","_service","404","sessionCreatedAt","version","change:range","forEach","_connectService","catch","stopListening","directChange","document","addToReconnectionStack","editing","offset","_handleReconnectionResponse","_pendingAction","markers","config","_shouldSendUpdate","_saveOperationInBuffer","return","suppressErrorInCollaboration","createUserMarkerOperations","remove","_handleExternalOperations","_offset","Synchronization issue","compress","push","reset","_handleServerResponse","decompress","_hasSynchronizationProblem","define","CommentsOnly","disableReadOnlyMode","length","off","_handleInitialConnectionData","rootName","addOperation","_operationIdentifier","_crash","_updateServerHistory","bufferOperation","bind","isAttached","realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration","_handleReconnectionError","getOperations","reconnection: flushed session","rtc-destroyed","_fetchMissingUsers","getDocumentDetails","wasUndone","_setPendingAction","_compressOperations","locale","isDocumentOperation","realtimecollaborationclient-init-connection-failed","_applyOperationsSet","_getOperationsFromInitData","collaboration-missing-channelid","getOperationAuthor","operationsReceived","history","_isInit","getRoot","isUndoneOperation","model","serverHistory","sessionId","fire","entries","applyOperation","channelSessions","listenTo","roots","createdAt","marker"];var Zr,Qr;Zr=Xr,Qr=129,function(e){for(;--e;)Zr.push(Zr.shift())}(++Qr);const eo=function(e,t){return Xr[e-=0]};let to=1;class no extends t.Plugin{static get[eo("0x77")](){return[l,g,P,t.PendingActions,p.Users,r.Notification]}static get pluginName(){return eo("0x73")}get cloudDocumentVersion(){return this[eo("0x61")]+this._offset}get _lastServerVersion(){return this.serverHistory[eo("0xc6")]-this[eo("0x12")]}get[eo("0x99")](){const e=this[eo("0x3f")][eo("0x2a")]();for(let t=e.length-1;t>=0;t--){const n=e[t];if(!this[eo("0x75")][eo("0x6b")](n))return n[eo("0x6f")]+1-this[eo("0x12")]}return 0}constructor(e){if(super(e),this[eo("0x12")]=0,this.sessionId=null,this[eo("0x3f")]=new o.History,this[eo("0xa0")][eo("0xa")][eo("0x1a")]("collaboration",{}),this[eo("0x85")]=this[eo("0xa0")][eo("0xa")][eo("0xa1")](eo("0x74")),!this[eo("0x85")])throw new n.CKEditorError(eo("0x37"),this);const t=e[eo("0xa")][eo("0xa1")](eo("0xaa"))||n.version;this._service=new(no[eo("0x9f")])(t,this[eo("0x85")]),this[eo("0x59")]=this[eo("0xa0")].model.document,this._compressor=new zr,this[eo("0x83")]=[],this[eo("0xbb")]=new WeakSet,this[eo("0xac")](eo("0x87"),!1),this[eo("0xac")]("_hasSynchronizationProblem",!1),this[eo("0x8")]=null,this[eo("0x7f")]=!1,this[eo("0x51")]=null,this._baseBufferDelay=300,this[eo("0x4c")]=this._baseBufferDelay,this._lastSyncedOperationId=null,this[eo("0x75")]=new WeakSet,this._operationIdentifier=new so(this._disconnectionOperations)}[eo("0x53")](){const e=this[eo("0xa0")],t=e.plugins.get(p.Users),n=e.plugins[eo("0xa1")](l);this[eo("0x45")](t,eo("0x38"),((e,n)=>{const r=n[0];r[eo("0x8a")]&&(e[eo("0xd")]=t.getUser(r._authorId),e[eo("0xb2")]()),null===r[eo("0x8a")]&&(e[eo("0xd")]=null,e[eo("0xb2")]())}),{priority:eo("0x7b")}),this[eo("0x45")](e[eo("0x3e")][eo("0x3")].selection,eo("0xc7"),((e,t)=>{t[eo("0x2")]&&this._refreshUserSelectionMarkers()})),this[eo("0x45")](e[eo("0x5")].view,eo("0x98"),(()=>{this._refreshUserSelectionMarkers()})),this[eo("0x9d")](),e[eo("0x3e")].on("applyOperation",((e,t)=>{const n=t[0];n[eo("0x33")]&&(this[eo("0xc")](n),this[eo("0xb")]()&&this._sendBufferedOperationsDelayed())})),this._setUpDataInit(),this[eo("0x26")]("_isEditingAllowed").to(n,eo("0xab"),this,eo("0x19"),((e,t)=>"connected"===e&&!t)),this.on(eo("0x58"),(()=>{this[eo("0x4a")]?e[eo("0x1c")](eo("0x5d")):e.enableReadOnlyMode("rtc-offline")})),this[eo("0x4a")]?e.disableReadOnlyMode(eo("0x5d")):e[eo("0xba")](eo("0x5d")),this[eo("0xac")](eo("0xaf"),!1)}async[eo("0x72")](){const e=this[eo("0xa0")][eo("0xbf")][eo("0xa1")](g),t=this[eo("0xa0")].plugins[eo("0xa1")](l);try{this[eo("0x87")]=!0,e[eo("0xb7")](this[eo("0x85")]);const n=await this[eo("0xc3")].reconnect(t[eo("0xb8")],this[eo("0x99")]);await this[eo("0x7")](n)&&(this[eo("0x87")]=!1,this[eo("0x56")]());const r=await this[eo("0xc3")][eo("0x89")]();e[eo("0xad")](this._channelId,r),this._handleSendingSelectionMarkers(),this[eo("0xaf")]=!0}catch(e){if(n=e,eo("0xc4")===n.code&&this[eo("0x40")])await this._connectAfterSessionHasBeenFlushed();else if("409"===e.code){const e=A(this[eo("0xa0")][eo("0x32")],"The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.");this[eo("0x29")](e)}else{if(!(e instanceof ro))throw e;this[eo("0x29")]()}}var n}[eo("0xbd")](){const e=this[eo("0xa0")][eo("0xbf")][eo("0xa1")](l),t=this.editor[eo("0xbf")][eo("0xa1")](g);this[eo("0xa0")].enableReadOnlyMode(eo("0x2c")),t.channelSessions[eo("0x6b")](this._channelId)&&t[eo("0xb7")](this._channelId),e.removeFromReconnectionStack(this),this[eo("0x55")](),super[eo("0xbd")]()}async _handleReconnectionResponse(e){if(this[eo("0x40")]!==e.sessionId&&this._lastSyncedOperationId!==e[eo("0x6d")])throw new ro;return this[eo("0x40")]=e[eo("0x40")],this[eo("0x17")]([],{...e,wereChangesApplied:!1,data:e[eo("0x76")]},eo("0x72"))}async[eo("0xc9")](e,t=!1){const{connection:n}=this[eo("0xa0")][eo("0xbf")].get(l);no[eo("0x9f")].getConnectedSessions(n,this[eo("0x85")])[eo("0x57")]((e=>this._initSessionsHandling(e)))[eo("0x0")]((e=>{this[eo("0x23")]("realtimecollaborationclient-init-session-connection-error",e)})),this[eo("0x45")](this._service,eo("0x39"),this[eo("0x91")][eo("0x26")](this)),this[eo("0x45")](this[eo("0xc3")],eo("0xa9"),((e,t)=>{this[eo("0x23")]("realtimecollaborationclient-initservice-internal-error",t)})),this[eo("0x45")](this[eo("0xc3")],eo("0x9c"),(()=>{this[eo("0xaf")]=!1}));const r=this._operationIdentifier.getIdOfTheLastOperation(e),o=await this[eo("0xc3")][eo("0xb6")](n,this[eo("0x31")](e),r);if(this[eo("0x40")]=o[eo("0x40")],o.wereChangesApplied&&(this[eo("0x87")]=!1,this._clearPendingAction()),t){if(!o[eo("0x96")])return void this[eo("0x29")]();this[eo("0x3f")][eo("0x16")](),this[eo("0x12")]=o[eo("0x6")],this[eo("0x3f")][eo("0xc6")]=this._offset,await this[eo("0x17")](e,o,eo("0x2b"))}else await this[eo("0x1f")](o,e);this._handleSendingSelectionMarkers(),this[eo("0xaf")]=!0}[eo("0x4e")](){const e=this[eo("0xa0")][eo("0xbf")][eo("0xa1")](g),t=this.editor[eo("0xbf")].get(P),n=e[eo("0x44")][eo("0xa1")](this[eo("0x85")]);n&&n[eo("0x1d")]>1?t[eo("0xf")]():this[eo("0x45")](e,eo("0x9e")+this[eo("0x85")],(()=>{2===e[eo("0x44")][eo("0xa1")](this[eo("0x85")])[eo("0x1d")]&&t[eo("0xf")]()}))}async[eo("0x91")](e,t,n,r){if(!this[eo("0x87")]&&this[eo("0x59")].version==t){const e=this[eo("0x67")](n,r);await this._fetchMissingUsers(e),this._handleExternalOperations(e,t,n[eo("0x6d")])||this._crash(eo("0xc2"))}}async[eo("0x90")](){this._disconnectService();const{locale:e}=this[eo("0xa0")];let t;try{t=await this[eo("0xc3")][eo("0x2e")]()}catch(t){const n=A(e,"The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.");return void this[eo("0x29")](n)}const n=t[eo("0x97")]||t[eo("0x52")];if(this[eo("0xa6")]===n[eo("0x6d")])await this[eo("0xc9")](this[eo("0xa0")][eo("0x3e")].document[eo("0x3a")][eo("0x2a")](),!0);else{const t=A(e,"The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.");this[eo("0x29")](t)}}[eo("0x55")](){this[eo("0xc3")][eo("0x66")](),this[eo("0x83")]=[],clearTimeout(this[eo("0x51")]),this[eo("0x1")](this[eo("0xc3")])}[eo("0x8b")](e){const t=this[eo("0xa0")][eo("0xbf")][eo("0xa1")](g);this[eo("0x45")](t,eo("0x9e")+this[eo("0x85")],((e,{session:n})=>{if(n.id===t[eo("0x60")]){e[eo("0x1e")]();const t=this[eo("0xa0")][eo("0xbf")][eo("0x6b")]("CommentsOnly")&&this[eo("0xa0")][eo("0xbf")][eo("0xa1")](eo("0x1b"));let r=n[eo("0x7e")];t&&t[eo("0x6a")]&&(r=r.filter((e=>"document:write"!==e))),this.editor[eo("0xbf")][eo("0xa1")](eo("0xa5")).setPermissions(r,this[eo("0x85")])}})),t.register(this[eo("0x85")],e)}[eo("0x9d")](){const e=this.editor[eo("0x76")][eo("0xac")];this[eo("0xa0")][eo("0x76")].set=(...t)=>{if(!t[t[eo("0x1d")]-1][eo("0xe")])throw new n.CKEditorError(eo("0x28"),this);e[eo("0x81")](this[eo("0xa0")][eo("0x76")],t)}}[eo("0x8d")](){this[eo("0xa0")].data.on(eo("0x53"),((e,[t])=>{if(this[eo("0x59")][eo("0xc6")])throw new n.CKEditorError(eo("0x5c"),this);e[eo("0xb2")](),this[eo("0x30")]();const r=this[eo("0xa0")][eo("0xa")][eo("0xa1")](eo("0x4f")),o=this[eo("0x36")](t,r);e[eo("0xd")]=this[eo("0xc9")](o).then((()=>{this[eo("0xa0")][eo("0xbf")].get(l)[eo("0x4")](this),this[eo("0xa0")][eo("0x76")][eo("0x41")](eo("0x54"))}))[eo("0x0")]((e=>this[eo("0x23")](eo("0x34"),e)))[eo("0xc0")]((()=>this[eo("0x56")]()))}),{priority:eo("0x7b")})}async _fetchMissingUsers(e){const t=this[eo("0xa0")][eo("0xbf")][eo("0xa1")](p.Users),{connection:n}=this[eo("0xa0")][eo("0xbf")].get(l),r=new Set;for(const n of e){const e=n[eo("0x8a")];e&&!t.getUser(e)&&r[eo("0xb9")](e)}if(0===r[eo("0xa7")])return;const o=await $r()[eo("0x5b")](n,Array[eo("0xa4")](r));for(const e of o)t[eo("0x79")](e.id)||t.addUser(e)}_getOperationsFromInitData(e,t={}){const r=this[eo("0xa0")].model,s=[];let i=0;const a=eo("0x69")==typeof e?{main:e}:e;for(const e of Object.keys(a)){if(!this[eo("0x59")][eo("0x46")][eo("0x6b")](e))throw new n.CKEditorError(eo("0x70"),this);const t=this[eo("0xa0")].data.parse(a[e]),c=this[eo("0x59")].getRoot(e),u=new o.InsertOperation(r.createPositionAt(c,0),t,i++);s[eo("0x15")](u);for(const[e,n]of t.markers){const t=r[eo("0x5f")](r[eo("0xbe")](c,n.start[eo("0xa2")].slice()),r[eo("0xbe")](c,n[eo("0xb5")].path.slice())),a=new o.MarkerOperation(e,null,t,r[eo("0x9")],!0,i++);s[eo("0x15")](a)}}if(t)for(const[e,a]of Object[eo("0x42")](t)){const t=r[eo("0x3")][eo("0x3c")](e);if(!t)throw new n.CKEditorError(eo("0x50"),null);for(const[e,n]of Object[eo("0x42")](a))if(null!==n){const r=new o.RootAttributeOperation(t,e,null,n,i++);s[eo("0x15")](r)}}return s}async[eo("0x1f")](e,t){let n;this._offset=e[eo("0x6")];const r=e.wereChangesApplied&&!e[eo("0xa8")],o=r?0:e[eo("0x76")][eo("0x6f")];if(r)n=t,n.forEach((t=>{t[eo("0x47")]=e[eo("0xc5")],t._isInit=!0,t[eo("0x8a")]=null})),this[eo("0x35")](n,r);else{if(e[eo("0xa8")]){const t=this[eo("0x36")](e[eo("0xa8")]);this._document.history[eo("0xc6")]=-t.length,t[eo("0xc8")]((n=>{n[eo("0x6f")]-=t[eo("0x1d")],n[eo("0x47")]=e[eo("0xc5")],n[eo("0x3b")]=!0,n[eo("0x8a")]=null})),this[eo("0x35")](t,!0),this[eo("0x3f")][eo("0xc6")]=-t[eo("0x1d")]+this[eo("0x12")],this._updateServerHistory(t)}this[eo("0x59")].history.version=o,n=this[eo("0x67")](e[eo("0x76")],e.metadata),await this[eo("0x2d")](n),this._applyOperationsSet(n,r)}e[eo("0x6d")]&&(this[eo("0x22")][eo("0xc1")](n,e[eo("0x6d")]),this[eo("0xa6")]=e[eo("0x6d")]),this[eo("0x3f")].version=o+this[eo("0x12")],this[eo("0x24")](n)}[eo("0x23")](e,t){throw this[eo("0x87")]=!0,t&&console[eo("0xa9")](t),new n.CKEditorError(e,this[eo("0xa0")])}[eo("0xc")](e){this._knownOperations[eo("0x6b")](e)||(this[eo("0xbb")][eo("0xb9")](e),this._bufferedOperations[eo("0x15")](e),this[eo("0x8")]||eo("0x48")==e[eo("0x8c")]&&!e[eo("0x88")]||this[eo("0x30")]())}[eo("0x64")](e=!1){!e&&this[eo("0x87")]||(this[eo("0x87")]=!0,clearTimeout(this[eo("0x51")]),this[eo("0x51")]=setTimeout((()=>{this._sendBufferedOperations()[eo("0x57")]((e=>{e&&(this._clearPendingAction(),this._isPendingUpdate=!1)}))[eo("0x0")]((e=>{if(this[eo("0x56")](),this[eo("0x87")]=!1,!((t=e)[eo("0x8e")].startsWith("cloud-services-internal-error: Not connected.")||t[eo("0x8e")][eo("0x6c")](eo("0x71"))||t.message.startsWith(eo("0x7c"))))throw e;var t}))}),this[eo("0x4c")]))}async[eo("0xbc")](){const e=this.editor[eo("0xbf")][eo("0xa1")](P);if(this[eo("0x7a")]()&&(e[eo("0xf")](),this[eo("0x7f")]=!1),!this._shouldSendUpdate())return!0;const t=[...this[eo("0x83")]];for(const e of t)e[eo("0x2f")]=this._document.history[eo("0x3d")](e);const n=this[eo("0x22")][eo("0xb4")](t),r=to++,o=this[eo("0x31")](t),s=await this[eo("0xc3")][eo("0x9a")](o,o[eo("0x6f")],n);try{return await this[eo("0x17")](t,s,r)}catch(e){return this[eo("0x23")](eo("0x95"),e)}}async[eo("0x17")](e,t,n){if(eo("0xa9")in t)throw t[eo("0xa9")];let r=!1;if(t.wereChangesApplied){t[eo("0x6d")]&&(this._lastSyncedOperationId=t[eo("0x6d")]),this[eo("0x83")]=this._bufferedOperations[eo("0x62")]((t=>!e[eo("0x5a")](t)));for(const n of e)n[eo("0x47")]="lastOperationAcceptedAt"in t&&t.lastOperationAcceptedAt||void 0;this[eo("0x24")](e),r=!0,this[eo("0x4c")]=this._baseBufferDelay}else{const e=this[eo("0x67")](t.data,t[eo("0x78")]).filter((e=>e[eo("0x6f")]>=this[eo("0x61")]));await this._fetchMissingUsers(e),r=this._handleExternalOperations(e,t[eo("0xc6")],t[eo("0x6d")]),this._currentBufferDelay=Math[eo("0xb0")](this[eo("0x4c")]/2)}return r?!this[eo("0xb")]()||(this[eo("0x64")](!0),!1):this[eo("0x23")](eo("0x4b"))}[eo("0x11")](e,t,n){try{const r={document:this[eo("0x59")],useRelations:!1,padWithNoOps:!0},{operationsA:s,operationsB:i,originalOperations:a}=(0,o.transformSets)(e,this[eo("0x83")],r);oo(s,this[eo("0x59")].version),oo(i,t);for(const e of s){const t=a[eo("0xa1")](e);e[eo("0x8a")]=t?t[eo("0x8a")]:null}n&&(this[eo("0x22")][eo("0xc1")](e,n),this._lastSyncedOperationId=n),this[eo("0x83")]=[...i],this[eo("0x35")](s),this[eo("0x24")](e)}catch(e){return console[eo("0xa9")](e),!1}return!0}[eo("0x35")](e,t=!1){this[eo("0xa0")][eo("0x3e")][eo("0x82")]({isUndoable:!1,isLocal:!1},(t=>{for(const n of e)this[eo("0xbb")][eo("0xb9")](n),t[eo("0x94")].addOperation(n),this[eo("0xa0")][eo("0x3e")][eo("0x43")](n)}))}[eo("0x24")](e){e[eo("0xc8")]((e=>{const t=e[eo("0x7d")]();t[eo("0x8a")]=e._authorId,t[eo("0x3b")]=!!e[eo("0x3b")],t[eo("0x47")]=e[eo("0x47")],t[eo("0x6f")]+=this[eo("0x12")],e[eo("0x65")]&&this[eo("0x75")][eo("0xb9")](t),this[eo("0x3f")][eo("0x21")](t)}))}_handleReconnectionError(e){const t=this.editor.plugins[eo("0xa1")](eo("0x8f")),n=this[eo("0xa0")].locale;e||(e=A(n,"The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.")),t[eo("0x49")](e,{title:A(n,eo("0x13")),namespace:eo("0xae")}),this._hasSynchronizationProblem=!0,clearTimeout(this[eo("0x51")]),this[eo("0x83")]=[],this.editor.plugins.get(l)[eo("0xbd")]()}[eo("0x30")](){this[eo("0x8")]||(this[eo("0x8")]=this.editor[eo("0xbf")][eo("0xa1")](t.PendingActions)[eo("0xb9")](A(this[eo("0xa0")][eo("0x32")],"PENDING_ACTION_SENDING_DATA")))}[eo("0x56")](){this._pendingAction&&(this[eo("0xa0")].plugins[eo("0xa1")](t.PendingActions)[eo("0x10")](this[eo("0x8")]),this[eo("0x8")]=null)}[eo("0x31")](e){const t=e.map((e=>e.toJSON()));return this[eo("0x6e")][eo("0x14")](t)}[eo("0x67")](e,t){return this[eo("0x6e")][eo("0x18")](e)[eo("0x84")](((e,n)=>{const r=eo("0x53")==t[n][eo("0x8c")];if(r&&"InsertOperation"==e[eo("0xa3")]){const t=e[eo("0x92")][eo("0x86")];if(!this._document[eo("0x3c")](t)){const e=new o.RootOperation(t,eo("0x4d"),!0,this[eo("0x59")],null);this[eo("0x59")].getRoot(t)._isAttached=!0,this[eo("0x59")].differ[eo("0x25")](e)}}else if(eo("0x68")==e[eo("0xa3")]&&e[eo("0xb3")]){const t=this[eo("0x59")].getRoot(e[eo("0x20")]);t&&t[eo("0x27")]()&&(t._isAttached=!1)}const s=o.OperationFactory.fromJSON(e,this[eo("0x59")]);return s[eo("0x2f")]=e[eo("0x2f")],s[eo("0x3b")]=r,s[eo("0x8a")]=r?null:t[n][eo("0xb1")],s[eo("0x65")]=eo("0x80")===t[n].type,s[eo("0x47")]=t[n][eo("0x47")],s}))}[eo("0x9b")](){this[eo("0x7f")]=!0,this[eo("0x7a")]()?this[eo("0x64")]():this[eo("0x7f")]=!1}[eo("0x7a")](){const e=this[eo("0xa0")].plugins[eo("0xa1")](g)[eo("0x44")][eo("0xa1")](this[eo("0x85")]);return Boolean(!this[eo("0xa0")][eo("0x63")]&&e&&e.length>1&&this[eo("0x7f")])}[eo("0xb")](){return this[eo("0x83")][eo("0x1d")]>0||this[eo("0x7a")]()}}no[eo("0x9f")]=Kr();class ro extends Error{}function oo(e,t){for(const n of e)n[eo("0x6f")]=t++}class so{constructor(e){this[eo("0x5e")]=e,this[eo("0x93")]=new WeakMap}[eo("0xb4")](e){let t=e[eo("0x1d")];for(;t--;){const r=e[t];if(!this[eo("0x5e")][eo("0x6b")](r)){if(!this[eo("0x93")][eo("0x6b")](r)){const e=(0,n.uid)().slice(1,18);this._operationToId[eo("0xac")](r,e)}return this._operationToId.get(r)}}}[eo("0xc1")](e,t){if(!t)return;let n=e[eo("0x1d")];for(;n--;){const r=e[n];this[eo("0x5e")][eo("0x6b")](r)||this[eo("0x93")][eo("0xac")](r,t)}}}var io,ao,co=["pluginName","RealTimeCollaborativeEditing","requires"];io=co,ao=349,function(e){for(;--e;)io.push(io.shift())}(++ao);var uo=function(e,t){return co[e-=0]};class lo extends t.Plugin{static get[uo("0x1")](){return[no]}static get[uo("0x2")](){return uo("0x0")}}var po=__webpack_require__(125),ho=__webpack_require__.n(po),fo=__webpack_require__(6042),mo=__webpack_require__.n(fo);const yo=["comments","resolve","userId","permissions","commentThreadId","cloud-services-internal-error: Comments Service is not connected.","getUser","CommentsService","_fetchMissingUsersForThreads","commentThreadReopened","delete","map","commentRemoved","addToReconnectionStack","commentThreadRemoved","plugins","get","destroy","content","_getService","reopen","addCommentThread","commentUpdated","createdAt","commentThreadResolved","_connectService","off","remove","keys","message","init","Permissions","commentAdded","CommentsRepository","updateCommentThread","reopenCommentThread","context","resolvedBy","cloudservicescommentsadapter-service-not-exist","adapter","unregister","has","_terminateService","addComment","_services","cloud-services-internal-error: Request timeout.","resolvedAt","cloud-services-internal-error: Not connected.","getCommentThread","reconnect","update","addUser","commentId","catch","listenTo","connect","cloudservicescommentsadapter-connect-already-connected","sessionAdd:","authorId","startsWith","from","cloudservicescommentsadapter-disconnect-not-exist","commentThreadUpdated","getCommentThreads","config","resolveCommentThread","getConnectedSessions","attributes","getMany","mySessionId","register","add","removeCommentThread","collaboration.channelId","disconnect","404","getComment","_setUpService"];var go,bo;go=yo,bo=168,function(e){for(;--e;)go.push(go.shift())}(++bo);const Oo=function(e,t){return yo[e-=0]};class vo extends t.ContextPlugin{static get requires(){return[l,"CommentsRepository",g,p.Users]}constructor(e){super(e),this[Oo("0x20")]=new Map}async[Oo("0x12")](){const e=this.context,n=e[Oo("0x3")][Oo("0x4")](Oo("0x15"));if(e[Oo("0x3")].get(l)[Oo("0x1")](this),n[Oo("0x1b")]={addCommentThread:async({channelId:e,threadId:t,comments:n,resolvedAt:r,resolvedBy:o,context:s,attributes:i})=>{const a=await this[Oo("0x7")](e)[Oo("0x9")]({commentThreadId:t,comments:n[Oo("0x4d")]((n=>{return o=e,{commentThreadId:t,commentId:(r=n)[Oo("0x28")],userId:r[Oo("0x2e")],content:r.content,documentId:o,createdAt:r[Oo("0xb")],attributes:r[Oo("0x37")]||{}};var r,o})),resolvedAt:r,resolvedBy:o,context:s,attributes:i})[Oo("0x29")](xo);return{threadId:a.commentThreadId,comments:a[Oo("0x42")]}},getCommentThread:async({channelId:e,threadId:t})=>{const n=await this._getService(e).getCommentThread(t)[Oo("0x29")](xo);return await this[Oo("0x4a")]([n]),{threadId:n[Oo("0x46")],comments:n.comments[Oo("0x4d")](_o),context:n[Oo("0x18")],resolvedAt:n[Oo("0x22")],resolvedBy:n[Oo("0x19")],attributes:n[Oo("0x37")]||{}}},updateCommentThread:async({channelId:e,threadId:t,context:n,attributes:r})=>this[Oo("0x7")](e)[Oo("0x16")]({commentThreadId:t,context:n,attributes:r})[Oo("0x29")](wo)[Oo("0x29")](xo),resolveCommentThread:async({channelId:e,threadId:t})=>{const n=await this[Oo("0x7")](e)[Oo("0x35")](t)[Oo("0x29")](wo)[Oo("0x29")](xo);return{threadId:n.commentThreadId,resolvedAt:n[Oo("0x22")],resolvedBy:n[Oo("0x19")]}},reopenCommentThread:async({channelId:e,threadId:t})=>this._getService(e)[Oo("0x17")](t)[Oo("0x29")](wo).catch(xo),removeCommentThread:({channelId:e,threadId:t})=>this._getService(e)[Oo("0x3c")](t)[Oo("0x29")](wo).catch(xo),addComment:({channelId:e,threadId:t,commentId:n,content:r,attributes:o})=>this[Oo("0x7")](e)[Oo("0x1f")](t,n,r,o)[Oo("0x29")](xo),updateComment:({channelId:e,threadId:t,commentId:n,content:r,attributes:o})=>this._getService(e).updateComment(t,n,r,o)[Oo("0x29")](wo)[Oo("0x29")](xo),removeComment:({channelId:e,threadId:t,commentId:n})=>this[Oo("0x7")](e).removeComment(t,n)[Oo("0x29")](wo)[Oo("0x29")](xo)},e instanceof t.Context){const t=e[Oo("0x34")][Oo("0x4")](Oo("0x3d")),n=e[Oo("0x3")][Oo("0x4")](g);await this._setUpService(t);const r=await this[Oo("0x20")].get(t)[Oo("0x36")]();this[Oo("0x2a")](n,Oo("0x2d")+t,((e,{session:r})=>{r.id===n[Oo("0x39")]&&(e[Oo("0xe")](),this[Oo("0x18")][Oo("0x3")][Oo("0x4")](Oo("0x13")).setPermissions(r[Oo("0x45")],t))})),n[Oo("0x3a")](t,r)}}async[Oo("0x41")](e){if(this[Oo("0x20")].has(e))throw new n.CKEditorError(Oo("0x2c"),null,{channelId:e});const t=this[Oo("0x18")][Oo("0x3")][Oo("0x4")]("CommentsRepository"),r=new vo.CommentsService(e);this[Oo("0x20")].set(e,r),this[Oo("0x2a")](r,"commentThreadAdded",((e,n)=>{const{commentThreadId:r,documentId:o,context:s,attributes:i,resolvedAt:a,resolvedBy:c,comments:u}=n;t[Oo("0x24")](r)||t[Oo("0x9")]({threadId:r,channelId:o,comments:u?u[Oo("0x4d")](_o):[],context:s,attributes:i,resolvedAt:a,resolvedBy:c,isFromAdapter:!0})})),this[Oo("0x2a")](r,Oo("0x32"),((e,{commentThreadId:n,documentId:r,context:o,attributes:s})=>{t[Oo("0x24")](n)&&t[Oo("0x16")]({threadId:n,channelId:r,context:o,attributes:s,isFromAdapter:!0})})),this[Oo("0x2a")](r,Oo("0xc"),((e,{commentThreadId:n,resolvedBy:r,resolvedAt:o})=>{const s=t.getCommentThread(n);s&&s[Oo("0x43")]({resolvedBy:r,resolvedAt:o,isFromAdapter:!0})})),this.listenTo(r,Oo("0x4b"),((e,{commentThreadId:n})=>{const r=t.getCommentThread(n);r&&r[Oo("0x8")]({isFromAdapter:!0})})),this.listenTo(r,Oo("0x2"),((e,{commentThreadId:n})=>{const r=t[Oo("0x24")](n);r&&r[Oo("0xf")]({isFromAdapter:!0})})),this[Oo("0x2a")](r,Oo("0x14"),((e,n)=>{const r=n[Oo("0x46")],o=t.getCommentThread(r);o&&o[Oo("0x1f")]({..._o(n),isFromAdapter:!0})})),this[Oo("0x2a")](r,Oo("0xa"),((e,{commentThreadId:n,commentId:r,content:o,attributes:s})=>{const i=t[Oo("0x24")](n);if(i){const e=i[Oo("0x40")](r);e&&e[Oo("0x26")]({content:o,attributes:s,isFromAdapter:!0})}})),this.listenTo(r,Oo("0x0"),((e,{commentThreadId:n,commentId:r})=>{const o=t.getCommentThread(n);if(o){const e=o[Oo("0x40")](r);e&&e[Oo("0xf")]({isFromAdapter:!0})}})),await this[Oo("0xd")](e)}[Oo("0x5")](){if(this.context instanceof t.Context){const e=this.context.config[Oo("0x4")](Oo("0x3d"));this._terminateService(e)}}[Oo("0x1e")](e){if(!this[Oo("0x20")][Oo("0x1d")](e))throw new n.CKEditorError(Oo("0x31"),null,{channelId:e});this[Oo("0x7")](e)[Oo("0x3e")](),this._services.delete(e)}async[Oo("0x25")](){for(const e of this._services[Oo("0x10")]())await this[Oo("0xd")](e);if(this[Oo("0x18")]instanceof t.Context){const e=this[Oo("0x18")][Oo("0x34")].get("collaboration.channelId"),t=this[Oo("0x18")].plugins[Oo("0x4")](g);t[Oo("0x1c")](e);const n=await this[Oo("0x20")][Oo("0x4")](e)[Oo("0x36")]();t.register(e,n)}}async[Oo("0xd")](e){const{connection:t}=this[Oo("0x18")][Oo("0x3")][Oo("0x4")](l),n=this[Oo("0x18")][Oo("0x3")][Oo("0x4")](Oo("0x15")),r=this[Oo("0x20")].get(e),o=await r[Oo("0x2b")](t);await this._fetchMissingUsersForThreads(o);const s=new Set(Array[Oo("0x30")](n[Oo("0x33")]({channelId:e}),(e=>e.id)));for(const e of o)s[Oo("0x4c")](e[Oo("0x46")]);for(const e of s)n[Oo("0x24")](e).remove({isFromAdapter:!0});for(const t of o){let r=n[Oo("0x24")](t.commentThreadId);const{commentThreadId:o,context:s,attributes:i,resolvedBy:a,resolvedAt:c}=t;r||(r=n[Oo("0x9")]({channelId:e,threadId:o,context:s,attributes:i,resolvedBy:a,resolvedAt:c,isFromAdapter:!0}));const u=new Set(Array[Oo("0x30")](r[Oo("0x42")],(e=>e.id)));for(const e of t[Oo("0x42")])u.delete(e[Oo("0x28")]);for(const e of u)r[Oo("0x40")](e)[Oo("0xf")]({isFromAdapter:!0});for(const e of t[Oo("0x42")]){const t=r[Oo("0x40")](e[Oo("0x28")]);t?t.content!==e[Oo("0x6")]&&t[Oo("0x26")]({content:e.content,isFromAdapter:!0}):r.addComment(Object.assign(_o(e),{isFromAdapter:!0}))}}}[Oo("0x7")](e){if(!this._services.has(e))throw new n.CKEditorError(Oo("0x1a"),null,{channelId:e});return this[Oo("0x20")][Oo("0x4")](e)}async[Oo("0x4a")](e){const t=this.context[Oo("0x3")][Oo("0x4")](p.Users),{connection:n}=this[Oo("0x18")][Oo("0x3")][Oo("0x4")](l),r=new Set;for(const{resolvedBy:n,comments:o}of e){n&&!t[Oo("0x48")](n)&&r.add(n);for(const{userId:e}of o)t[Oo("0x48")](e)||r[Oo("0x3b")](e)}if(0===r.size)return;const o=await $r()[Oo("0x38")](n,Array[Oo("0x30")](r));for(const e of o)t[Oo("0x48")](e.id)||t[Oo("0x27")](e)}}async function wo(e){if(Oo("0x3f")!==e.code)throw e}function xo(e){if((t=e)[Oo("0x11")][Oo("0x2f")](Oo("0x47"))||t[Oo("0x11")][Oo("0x2f")](Oo("0x23"))||t[Oo("0x11")][Oo("0x2f")](Oo("0x21")))return new Promise((()=>{}));var t;throw e}function _o(e){return{threadId:e[Oo("0x46")],commentId:e[Oo("0x28")],content:e.content,createdAt:e[Oo("0xb")],authorId:e[Oo("0x44")],attributes:e[Oo("0x37")]||{}}}vo[Oo("0x49")]=mo();const Io=["type","reconnect","_waitForServiceReady","cloud-services-internal-error: Not connected.","init","then","TrackChangesEditing","config","attributes","add","_saved","isConnected","message","update","hasSuggestion","getSuggestion","_trackChangesService","open","plugins","addUser","originalSuggestionId","getUser","addToReconnectionStack","size","state","connected","catch","_bufferedRequests","requires","delete","startsWith","editor","connect","TrackChangesService","get","find","_fetchMissingUsersForThreads","suggestionUpdated","getMany","data","set","cloud-services-internal-error: Request timeout.","addSuggestionData"];var So,Po;So=Io,Po=258,function(e){for(;--e;)So.push(So.shift())}(++Po);const To=function(e,t){return Io[e-=0]};class Ao extends t.Plugin{static get[To("0x1c")](){return[vo,"TrackChangesEditing",l]}constructor(e){super(e);const t=this[To("0x1f")][To("0x7")].get("collaboration.channelId");this[To("0x1b")]=new Map,this[To("0x10")]=new Ao.TrackChangesService(t)}[To("0x4")](){const e=this.editor.plugins.get(l),t=this[To("0x1f")][To("0x12")].get(To("0x6"));return t.adapter={getSuggestion:async e=>{await this[To("0x2")]();const t=await this[To("0x10")][To("0x22")](e)[To("0x1a")](ko);return await this[To("0x24")]([t]),t},addSuggestion:async({id:e,type:t,data:n,originalSuggestionId:r,attributes:o})=>{await this[To("0x2")]();const s={id:e,type:t,data:n,originalSuggestionId:r,attributes:o},i=await this[To("0x10")][To("0x9")](e,t,n,r,o)[To("0x1a")]((t=>{if(Co(t))return new Promise((t=>{this[To("0x1b")][To("0x28")](e,{resolve:t,suggestionData:s})}));throw t}));return this[To("0x1b")][To("0x1d")](e),i},updateSuggestion:async(e,t)=>{if(await this[To("0x2")](),To("0x11")!==t[To("0x18")])return this._trackChangesService[To("0xd")](e,t).catch(ko)}},this.listenTo(this[To("0x10")],To("0x25"),((e,n)=>{t[To("0xe")](n.id)&&(t[To("0xf")](n.id).attributes=n[To("0x8")])})),this._trackChangesService[To("0x20")](e.connection).then((n=>(e[To("0x16")](this),this[To("0x24")](n)[To("0x5")]((()=>{for(const e of n)t[To("0x2a")](e)[To("0xa")]=!0})))))}async[To("0x1")](){const e=this[To("0x1f")][To("0x12")][To("0x22")]("TrackChangesEditing"),{connection:t}=this.editor.plugins.get(l),n=await this[To("0x10")][To("0x20")](t);await this[To("0x24")](n);for(const{suggestionData:e,resolve:t}of this._bufferedRequests.values()){let r=n[To("0x23")]((t=>t.id===e.id));r||(r=await this._trackChangesService[To("0x9")](e.id,e[To("0x0")],e[To("0x27")],e[To("0x14")])),t(r)}for(const t of n)e.hasSuggestion(t.id)||e.addSuggestionData(t)}async _waitForServiceReady(){this[To("0x10")][To("0xb")]||await new Promise((e=>{this.listenTo(this[To("0x10")],To("0x19"),(t=>{t.off(),e()}))}))}async[To("0x24")](e){const t=this[To("0x1f")][To("0x12")].get(p.Users),{connection:n}=this[To("0x1f")][To("0x12")][To("0x22")](l),r=new Set;for(const{authorId:n}of e)t[To("0x15")](n)||r.add(n);if(0===r[To("0x17")])return;const o=await $r()[To("0x26")](n,Array.from(r));for(const e of o)t[To("0x15")](e.id)||t[To("0x13")](e)}}function ko(e){if(Co(e))return new Promise((()=>{}));throw e}function Co(e){return e[To("0xc")].startsWith(To("0x3"))||e[To("0xc")][To("0x1e")](To("0x29"))}Ao[To("0x21")]=ho();const jo=["change:state","requires","collaboration.channelId","_setUpService","_terminateService","switchReadOnly","data","CommentsEditing","Comments","once","CommentsRepository","plugins","connected","config","ready","pluginName","get","RealTimeCollaborativeComments","editor"];var Eo,Do;Eo=jo,Do=195,function(e){for(;--e;)Eo.push(Eo.shift())}(++Do);const Ro=function(e,t){return jo[e-=0]};class No extends t.Plugin{static get[Ro("0xf")](){return[Ro("0x3"),vo,lo,l]}static get[Ro("0xa")](){return Ro("0xc")}init(){const e=this[Ro("0xd")][Ro("0x6")][Ro("0xb")](l),t=this.editor.plugins[Ro("0xb")](Ro("0x2")),n=this[Ro("0xd")].plugins[Ro("0xb")](vo);return this.editor[Ro("0x1")][Ro("0x4")](Ro("0x9"),(()=>{this.listenTo(e,"change:state",((e,n,r)=>{t.isThreadsLoadingPaused=Ro("0x7")!==r}))})),this.listenTo(e,Ro("0xe"),((e,t,n)=>{this[Ro("0xd")][Ro("0x6")][Ro("0xb")](Ro("0x5"))[Ro("0x0")](Ro("0x7")!==n)})),n[Ro("0x11")](this.editor[Ro("0x8")][Ro("0xb")](Ro("0x10")))}destroy(){this[Ro("0xd")][Ro("0x6")][Ro("0xb")](vo)[Ro("0x12")](this[Ro("0xd")][Ro("0x8")][Ro("0xb")](Ro("0x10"))),super.destroy()}}var Mo,Vo,Bo=["requires","TrackChanges","RealTimeCollaborativeTrackChanges"];Mo=Bo,Vo=309,function(e){for(;--e;)Mo.push(Mo.shift())}(++Vo);var Uo=function(e,t){return Bo[e-=0]};class Jo extends t.Plugin{static get[Uo("0x0")](){return[No,Ao,Uo("0x1")]}static get pluginName(){return Uo("0x2")}}var qo=__webpack_require__(8811),Lo=__webpack_require__.n(qo),Go=__webpack_require__(8689),Fo=__webpack_require__.n(Go);const Yo=["RevisionHistoryService","get","init","sendBufferedUpdates","_fixRevision","buildRevisionData","cloudServices.bundleVersion","isEmptyCurrent","setRevisionData","_fetchMissingUsers","once","getOperations","plugins","isConnected","length","connect","_isConnected","then","_preventResendingRevisionData","repository","reconnect","requires","editor","adapter","type","sessionId","authors","getRevision","revisionsUpdated","startsWith","creatorId","diffData","off","reverse","addUser","_waitForServiceReady","from","fromVersion","setSource","map","keys","_startingVersion","max","bind","_update","_revisionTracker","data","currentRevision","getUser","config","listenTo","collaboration.channelId","addToReconnectionStack","serverHistory","_revisionDataBuilder","_bufferUpdate","message","_handleRevisionsUpdate","CONNECTED","_bufferedUpdates","_lastRequestId","add","updateRevisions","state","code","400","_getLatestVersionFromServerOperations","_revisionHistoryService","marker","toVersion","_getLatestVersion","RevisionTracker","change:_isPendingUpdate","_isPendingUpdate","connection","createdAt","authorsIds","connected","_offset"];var zo,Ho;zo=Yo,Ho=185,function(e){for(;--e;)zo.push(zo.shift())}(++Ho);const Ko=function(e,t){return Yo[e-=0]};class Wo extends t.Plugin{static get[Ko("0x49")](){return[l,no,"RevisionTracker",g,p.Users]}constructor(e){super(e);const t=this[Ko("0x4a")][Ko("0x16")].get(Ko("0x18"));this[Ko("0x21")]=null,this._revisionTracker=this.editor[Ko("0x40")].get(Ko("0x2c")),this[Ko("0x28")]=new(Wo[Ko("0x34")])(t)}async[Ko("0x36")](){const e=this[Ko("0x4a")][Ko("0x40")][Ko("0x35")](no),t=e[Ko("0x1a")],r=this.editor.plugins.get(l);this._revisionTracker[Ko("0xb")]({history:t,getLatestVersion:()=>this[Ko("0x2b")](),getCurrentRevisionId:()=>e[Ko("0x4d")]});const o=this[Ko("0x4a")][Ko("0x16")][Ko("0x35")](Ko("0x3a"))||n.version,i=await Fo().isBundleUploaded(r[Ko("0x2f")],o);this._revisionTracker[Ko("0x4b")]={getRevision:async({revisionId:e})=>(await this[Ko("0x8")](),await this._revisionHistoryService.getRevision(e)),updateRevisions:async e=>{await this[Ko("0x8")]();const t=this._revisionTracker[Ko("0x14")];if(i&&1===e[Ko("0x42")]&&e[0].id===t.id)return e;for(const n of e)n.id===t.id&&(n[Ko("0x3b")]=n[Ko("0xa")]===n.toVersion);return this[Ko("0x28")][Ko("0x23")](e,this[Ko("0x21")])[Ko("0x45")]((t=>(this[Ko("0x21")]=t,e))).catch((t=>{if($o(t)||Ko("0x26")===t[Ko("0x25")]&&void 0!==t[Ko("0x13")].wrongRequestId){for(const t of e)!this[Ko("0x12")].repository[Ko("0x0")](t.id)||this[Ko("0x12")][Ko("0x1c")](t.id,t,!1);if($o(t))throw t;return e}throw t}))}},this[Ko("0x17")](this[Ko("0x28")],Ko("0x1"),((e,{revisionsData:t,requestId:n})=>{Math[Ko("0xf")](...t[Ko("0xc")]((e=>e.toVersion)))>this._getLatestVersionFromServerOperations()-1?this[Ko("0x2b")]()[Ko("0x45")]((()=>{this[Ko("0x1e")](t,n)})):this[Ko("0x1e")](t,n)}));const{revisions:a,requestId:c}=await this[Ko("0x28")][Ko("0x43")](r.connection);r[Ko("0x19")](this),this._lastRequestId=c,await this._fetchMissingUsers(a);for(const e of a)this._revisionTracker.addRevisionData(e);this[Ko("0x17")](e,"change:_isConnected",((t,n,r)=>{r&&(this._oldOffset=e[Ko("0x33")],t[Ko("0x5")]())})),this._revisionTracker[Ko("0x10")]("isEnabled").to(r,Ko("0x24"),(e=>e===s.WEB_SOCKET_GATEWAY_STATES[Ko("0x1f")]))}async[Ko("0x48")](){const e=this[Ko("0x4a")][Ko("0x40")][Ko("0x35")](l),t=this[Ko("0x4a")].plugins[Ko("0x35")](no),n=async()=>{const n=this[Ko("0x12")][Ko("0x14")],r=n.id,o=r!==t.sessionId;if(o){const e=t[Ko("0x33")]-this._oldOffset,o=this[Ko("0x27")]();if(this[Ko("0x12")][Ko("0x1b")].reInit(),n[Ko("0x2a")]+e!==o){const t=n[Ko("0xa")]+e,r=this.editor.plugins[Ko("0x35")](p.Users),s=this._revisionTracker.buildRevisionData({revision:n,from:t,to:o});s.id=n.id;const i=s[Ko("0x31")][Ko("0xc")]((e=>r.getUser(e)));n[Ko("0x11")]({...s,authors:i},!0),this[Ko("0x12")][Ko("0x1c")](n.id,s,!0)}this._revisionTracker[Ko("0xe")]=o,n[Ko("0x2a")]===n[Ko("0xa")]&&!this[Ko("0x12")][Ko("0x20")].has(r)&&this[Ko("0x12")][Ko("0x47")]._revisions.remove(r),this[Ko("0x12")]._createCurrentRevision(o)}const{revisions:s,requestId:i}=await this._revisionHistoryService.reconnect(e.connection,this._lastRequestId);o&&s.length>0?t._handleReconnectionError():(await this[Ko("0x3d")](s),this[Ko("0x1e")](s,i),this[Ko("0x12")][Ko("0x37")]())};return t[Ko("0x44")]?n():new Promise(((e,r)=>{t[Ko("0x3e")]("change:_isConnected",(()=>{n()[Ko("0x45")](e).catch(r)}))}))}destroy(){super.destroy()}async _waitForServiceReady(){this[Ko("0x28")][Ko("0x41")]||await new Promise((e=>{this[Ko("0x17")](this[Ko("0x28")],Ko("0x32"),(t=>{t[Ko("0x5")](),e()}))}))}[Ko("0x27")](){const e=this[Ko("0x4a")].plugins[Ko("0x35")](no).serverHistory[Ko("0x3f")]()[Ko("0x6")]();for(const t of e)if(Ko("0x29")!==t[Ko("0x4c")]||t.affectsData)return t.baseVersion+1}[Ko("0x2b")](){const e=this[Ko("0x4a")][Ko("0x40")][Ko("0x35")](no);return new Promise((t=>{e[Ko("0x2e")]?e[Ko("0x3e")](Ko("0x2d"),(()=>{t(this._getLatestVersionFromServerOperations())})):t(this[Ko("0x27")]())}))}[Ko("0x1e")](e,t){const n=this[Ko("0x12")].repository;this[Ko("0x21")]=t;for(const t of e){const e=n.getRevision(t.id);if(e){if((t[Ko("0xa")]||t[Ko("0x2a")])&&(t[Ko("0x4")]=null),e===this._revisionTracker[Ko("0x14")]){const n=Math[Ko("0xf")](e[Ko("0x2a")],t[Ko("0x2a")]),r=Math.max(e[Ko("0xa")],t[Ko("0xa")]);let o;e[Ko("0x2a")]===t.toVersion&&e[Ko("0xa")]===t[Ko("0xa")]?(o=!0,this[Ko("0x46")](t)):t[Ko("0x2a")]===n&&t[Ko("0xa")]===r?o=!1:(e[Ko("0x2a")]===n&&e[Ko("0xa")]===r||this[Ko("0x38")]({revision:e,from:r,to:n}),o=!0),o&&(delete t.fromVersion,delete t.toVersion,delete t.diffData,delete t[Ko("0x30")],delete t[Ko("0x31")])}this[Ko("0x12")][Ko("0x3c")](t),this[Ko("0x46")](t)}else this[Ko("0x12")].addRevisionData(t)}const r=n.getRevisions();r[Ko("0x6")]();for(let e=0;e<r.length-1;e++){const t=r[e],n=r[e+1];if(t[Ko("0xa")]<n[Ko("0x2a")]){const e=n[Ko("0x2a")],r=Math[Ko("0xf")](e,t[Ko("0x2a")]);this._fixRevision({revision:t,from:e,to:r})}}}_fixRevision({revision:e,from:t,to:n}={}){const r=this[Ko("0x4a")][Ko("0x40")].get(p.Users),o=this[Ko("0x12")][Ko("0x39")]({revision:e,from:t,to:n});o[Ko("0x4e")]=o[Ko("0x31")].map((e=>r[Ko("0x15")](e))),e[Ko("0x11")](o)}[Ko("0x46")](e){const t={};t.id=e.id;for(const n of Object[Ko("0xd")](e))"id"!==n&&(t[n]=void 0);this[Ko("0x12")]._bufferUpdate(t.id,t,!0)}async[Ko("0x3d")](e){const t=this[Ko("0x4a")][Ko("0x40")].get(p.Users),{connection:n}=this[Ko("0x4a")].plugins[Ko("0x35")](l),r=new Set;for(const t of e){for(const e of t[Ko("0x31")])s(e);t[Ko("0x3")]&&s(t[Ko("0x3")])}if(0===r.size)return;const o=await $r().getMany(n,Array[Ko("0x9")](r));for(const e of o)t[Ko("0x15")](e.id)||t[Ko("0x7")](e);function s(e){t[Ko("0x15")](e)||r[Ko("0x22")](e)}}}function $o(e){return e[Ko("0x1d")][Ko("0x2")]("cloud-services-internal-error: Revision History Service is not connected.")||e[Ko("0x1d")][Ko("0x2")]("cloud-services-internal-error: Not connected.")||e[Ko("0x1d")][Ko("0x2")]("cloud-services-internal-error: Request timeout.")}Wo[Ko("0x34")]=Lo();var Xo,Zo,Qo=["RevisionHistory","pluginName","RealTimeCollaborativeRevisionHistory","requires"];Xo=Qo,Zo=186,function(e){for(;--e;)Xo.push(Xo.shift())}(++Zo);var es=function(e,t){return Qo[e-=0]};class ts extends t.Plugin{static get[es("0x1")](){return[es("0x2"),Wo,lo]}static get[es("0x3")](){return es("0x0")}}var ns=Function.prototype,rs=Object.prototype,os=ns.toString,ss=rs.hasOwnProperty,is=os.call(Object);const as=function(e){if(!ft(e)||"[object Object]"!=ve(e))return!1;var t=fn(e);if(null===t)return!0;var n=ss.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&os.call(n)==is};const cs=function(e){return ft(e)&&1===e.nodeType&&!as(e)},us=["isHidden","CONNECTED_USERS","ck-presence-list__counter","usersCount","div","set","bindTemplate"];var ds,ls;ds=us,ls=275,function(e){for(;--e;)ds.push(ds.shift())}(++ls);const ps=function(e,t){return us[e-=0]};class hs extends r.View{constructor(e){super(e);const t=this[ps("0x4")];this[ps("0x3")](ps("0x1"),0),this.set(ps("0x5"),!0),this.setTemplate({tag:ps("0x2"),attributes:{class:["ck",ps("0x0"),t.if(ps("0x5"),"ck-presence-list__counter--hidden")]},children:[{text:t.to(ps("0x1"),(t=>A(e,ps("0x6"),t)))}]})}}const fs=["bindTemplate","ck-presence-list__list","items","execute","setTemplate","createCollection"];var ms,ys;ms=fs,ys=360,function(e){for(;--e;)ms.push(ms.shift())}(++ys);const gs=function(e,t){return fs[e-=0]};class bs extends r.View{constructor(e){super(e),this[gs("0x2")]=this[gs("0x5")]();const t=this[gs("0x0")];this[gs("0x4")]({tag:"div",attributes:{class:["ck",gs("0x1")]},children:this[gs("0x2")],on:{click:t.to((()=>this.fire(gs("0x3"))))}})}}var Os=__webpack_require__(3286),vs={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};O()(Os.Z,vs);Os.Z.locals;const ws=["listenTo","isCollapsed","locale","setTemplate","ck-presence-list--collapsed","div","change","set","inlineListView","first","counterView","bindTemplate","items"];var xs,_s;xs=ws,_s=446,function(e){for(;--e;)xs.push(xs.shift())}(++_s);const Is=function(e,t){return ws[e-=0]};class Ss extends r.View{constructor(e){super(e);const t=this[Is("0x7")];this[Is("0x3")](Is("0xa"),!0),this[Is("0x6")]=new hs(this[Is("0xb")]),this[Is("0x4")]=new bs(e),this[Is("0x9")](this[Is("0x4")][Is("0x8")],Is("0x2"),(()=>{for(const e of this[Is("0x4")][Is("0x8")])e.tooltipPosition="s";this[Is("0x4")][Is("0x8")][Is("0x5")]&&(this.inlineListView[Is("0x8")][Is("0x5")].tooltipPosition="se")})),this[Is("0xc")]({tag:Is("0x1"),attributes:{class:["ck","ck-presence-list","ck-reset","ck-rounded-corners",t.if("isCollapsed",Is("0x0"))]},children:[this[Is("0x6")],this.inlineListView]})}}var Ps,Ts,As=["items","createCollection","div","setTemplate","ck-presence-list__dropdown-list","ck-presence-list__dropdown-list-wrapper"];Ps=As,Ts=154,function(e){for(;--e;)Ps.push(Ps.shift())}(++Ts);var ks=function(e,t){return As[e-=0]};class Cs extends r.View{constructor(e){super(e),this[ks("0x2")]=this[ks("0x3")](),this[ks("0x5")]({tag:ks("0x4"),attributes:{class:["ck",ks("0x0")]},children:[{tag:ks("0x4"),attributes:{class:["ck",ks("0x1")]},children:this[ks("0x2")]}]})}}const js=["true","userView","execute","name","span","div","color","ck-presence-list__dropdown-list-item","ck-presence-list__marker","bindTemplate","ck-user__full-name","getBackgroundColorClass"];var Es,Ds;Es=js,Ds=407,function(e){for(;--e;)Es.push(Es.shift())}(++Ds);const Rs=function(e,t){return js[e-=0]};class Ns extends r.View{constructor(e,t,n){super(e);const r=this[Rs("0xa")];this[Rs("0x2")]=new p.UserView(e,t);const o={tag:Rs("0x6"),attributes:{class:["ck",Rs("0x8")]},children:[this[Rs("0x2")],{tag:Rs("0x5"),attributes:{class:["ck",Rs("0xb")]},children:[{text:t[Rs("0x4")]}]},{tag:"span",attributes:{class:["ck",Rs("0x9"),t[Rs("0x7")][Rs("0x0")]()],"aria-hidden":Rs("0x1")}}]};n&&(o.tag="button",o.on={click:r.to((()=>this.fire(Rs("0x3"))))}),this.setTemplate(o)}}const Ms=["execute","getBackgroundColorClass","span","bindTemplate","setTemplate","userView","true","set","fire","markerView","ck-presence-list__list-item","div","ck-presence-list__marker","name","button","hasTooltip","tooltipPosition","tag"];var Vs,Bs;Vs=Ms,Bs=355,function(e){for(;--e;)Vs.push(Vs.shift())}(++Bs);const Us=function(e,t){return Ms[e-=0]};class Js extends r.View{constructor(e,t,n){super(e);const r=this[Us("0x8")];this[Us("0xc")](Us("0x2"),!0),this.set("tooltipPosition",""),this[Us("0xa")]=new p.UserView(e,t),this[Us("0xe")]=new qs(e,t);const o={tag:Us("0x10"),attributes:{class:["ck",Us("0xf")],"data-cke-tooltip-text":this[Us("0xa")][Us("0x0")],"data-cke-tooltip-position":r.to(Us("0x3")),"data-cke-tooltip-disabled":r.to("hasTooltip",(e=>!e)),"data-cke-tooltip-class":"ck-presence-list__list-item__tooltip"},children:[this[Us("0xa")],this[Us("0xe")]]};n&&(o[Us("0x4")]=Us("0x1"),o.on={click:r.to((()=>this[Us("0xd")](Us("0x5"))))}),this[Us("0x9")](o)}}class qs extends r.View{constructor(e,t){super(e),this[Us("0x9")]({tag:Us("0x7"),attributes:{class:["ck",Us("0x11"),t.color[Us("0x6")]()],"aria-hidden":Us("0xb")}})}}const Ls=["locale","context","config","balloonPanelView","presenceList.container","presenceList","onClick","add","_allConnectedUsers","execute","presencelist-collapseat-invalid-format","items","lastConnectedUsers","number","isRendered","isCollapsed","hideDropdown","reverse","pin","destroy","set","content","remove","hasTooltip","detachFromDom","_createView","from","attachToDom","usersCount","presenceDropdownView","showDropdown","isVisible","appendChild","element","bindTo","counterView","using","_handleUserRemove","ck ck-presence-list__balloon","inlineListView","init","_handleUserAdd","get","plugins","length","bind","define","listenTo","view","isHidden","presenceList.collapseAt","bodyCollection"];var Gs,Fs;Gs=Ls,Fs=479,function(e){for(;--e;)Gs.push(Gs.shift())}(++Fs);const Ys=function(e,t){return Ls[e-=0]};class zs extends t.ContextPlugin{constructor(e){super(e),this[Ys("0x2a")][Ys("0x2b")][Ys("0x23")](Ys("0x2e"),{collapseAt:6});const t=e[Ys("0x2b")][Ys("0x1f")](Ys("0x27"));if(Ys("0x2")!=typeof t)throw new n.CKEditorError("presencelist-collapseat-invalid-format",this);if(t<1)throw new n.CKEditorError(Ys("0x33"),this);this._allConnectedUsers=this[Ys("0x2a")][Ys("0x20")].get(g).allConnectedUsers,this[Ys("0x9")](Ys("0x11"),0),this.lastConnectedUsers=new n.Collection,this.balloonPanelView=new r.BalloonPanelView,this.balloonPanelView.class=Ys("0x1b"),this[Ys("0x25")]=this[Ys("0xe")](),this[Ys("0x12")]=void 0}static get requires(){return[g]}[Ys("0x1d")](){for(const e of this[Ys("0x31")])this[Ys("0x1e")](e);this.listenTo(this[Ys("0x31")],Ys("0x30"),((e,t)=>{this._handleUserAdd(t)})),this[Ys("0x24")](this[Ys("0x31")],Ys("0xb"),((e,t)=>{this[Ys("0x1a")](t)}))}_createView(){const e=this.context,t=new Ss(this[Ys("0x2a")][Ys("0x29")]),o=this.balloonPanelView;if(!cs(e[Ys("0x2b")][Ys("0x1f")](Ys("0x2d"))))throw new n.CKEditorError("presencelist-missing-container",this);return t[Ys("0x18")][Ys("0x22")](Ys("0x11")).to(this),t[Ys("0x22")](Ys("0x4")).to(this,Ys("0x11"),(n=>{const r=n>=e[Ys("0x2b")][Ys("0x1f")]("presenceList.collapseAt");return t.counterView[Ys("0x26")]=!(1==n||r),r||this[Ys("0x5")](),r})),t[Ys("0x1c")][Ys("0x0")][Ys("0x17")](this[Ys("0x1")])[Ys("0x19")]((n=>{const r=e[Ys("0x2b")].get(Ys("0x2e")),o=new Js(e[Ys("0x29")],n,!!r[Ys("0x2f")]);return o[Ys("0x22")](Ys("0xc")).to(t,Ys("0x4"),(e=>!e)),r[Ys("0x2f")]&&this.listenTo(o,Ys("0x32"),(()=>{this.view[Ys("0x4")]||r[Ys("0x2f")](n,o.element)})),o})),this.listenTo(t.inlineListView,Ys("0x32"),(()=>{this[Ys("0x12")]?this[Ys("0x5")]():this[Ys("0x25")][Ys("0x4")]&&this[Ys("0x13")]()})),t.render(),o.render(),(0,r.clickOutsideHandler)({emitter:t,activator:()=>o[Ys("0x14")],contextElements:[o[Ys("0x16")],t[Ys("0x1c")][Ys("0x16")]],callback:()=>this[Ys("0x5")]()}),e[Ys("0x2b")].get(Ys("0x2d"))[Ys("0x15")](t[Ys("0x16")]),this[Ys("0x28")]=new r.BodyCollection(this[Ys("0x2a")][Ys("0x29")]),this[Ys("0x28")][Ys("0x10")](),this[Ys("0x28")][Ys("0x30")](o),t}_handleUserAdd(e){this[Ys("0x11")]++,5==this.lastConnectedUsers.length&&this[Ys("0x1")][Ys("0xb")](0),this[Ys("0x1")][Ys("0x30")](e)}[Ys("0x1a")](e){if(this[Ys("0x11")]--,this[Ys("0x1")][Ys("0x1f")](e.id)&&(this[Ys("0x1")].remove(e.id),this[Ys("0x1")][Ys("0x21")]<this[Ys("0x11")]))for(const e of Array[Ys("0xf")](this[Ys("0x31")])[Ys("0x6")]())if(!this[Ys("0x1")][Ys("0x1f")](e.id))return void this[Ys("0x1")][Ys("0x30")](e,0)}[Ys("0x13")](){if(this[Ys("0x12")])return;this[Ys("0x12")]=new Cs(this.context[Ys("0x29")]);const e=this[Ys("0x2a")][Ys("0x2b")][Ys("0x1f")](Ys("0x2e"));this[Ys("0x12")].items[Ys("0x17")](this[Ys("0x31")])[Ys("0x19")]((t=>{const n=new Ns(this.context[Ys("0x29")],t,!!e[Ys("0x2f")]);return e[Ys("0x2f")]&&this[Ys("0x24")](n,Ys("0x32"),(()=>{e[Ys("0x2f")](t,n[Ys("0x16")])})),n})),this[Ys("0x2c")][Ys("0xa")][Ys("0x30")](this.presenceDropdownView),this[Ys("0x2c")][Ys("0x7")]({target:this[Ys("0x25")].inlineListView[Ys("0x16")]})}[Ys("0x5")](){this[Ys("0x12")]&&(this[Ys("0x2c")].unpin(),this[Ys("0x2c")][Ys("0xa")].remove(this.presenceDropdownView),this.presenceDropdownView[Ys("0x8")](),this[Ys("0x12")]=void 0)}destroy(){super[Ys("0x8")](),this[Ys("0x25")]&&this[Ys("0x25")][Ys("0x3")]&&this[Ys("0x25")][Ys("0x8")](),this.bodyCollection&&this.bodyCollection[Ys("0xd")]()}}var Hs,Ks,Ws=["requires","PresenceList"];Hs=Ws,Ks=183,function(e){for(;--e;)Hs.push(Hs.shift())}(++Ks);var $s=function(e,t){return Ws[e-=0]};class Xs extends t.ContextPlugin{static get[$s("0x1")](){return[g,zs]}static get pluginName(){return $s("0x0")}}class Zs extends((0,n.ObservableMixin)()){constructor(e,t={}){if(super(),!e)throw new CKEditorError("token-missing-token-url",this);t.initValue&&this._validateTokenValue(t.initValue),this.set("value",t.initValue),this._refresh="function"==typeof e?e:()=>{return e,new Promise(((e,n)=>{const r=new XMLHttpRequest;r.open("GET",t),r.addEventListener("load",(()=>{const t=r.status,o=r.response;return t<200||t>299?n(new CKEditorError("token-cannot-download-new-token",null)):e(o)})),r.addEventListener("error",(()=>n(new Error("Network Error")))),r.addEventListener("abort",(()=>n(new Error("Abort")))),r.send()}));var t},this._options={...DEFAULT_OPTIONS,...t}}init(){return new Promise(((e,t)=>{this.value?(this._options.autoRefresh&&this._registerRefreshTokenTimeout(),e(this)):this.refreshToken().then(e).catch(t)}))}refreshToken(){return this._refresh().then((e=>(this._validateTokenValue(e),this.set("value",e),this._options.autoRefresh&&this._registerRefreshTokenTimeout(),this)))}destroy(){clearTimeout(this._tokenRefreshTimeout)}_validateTokenValue(e){const t="string"==typeof e,n=!/^".*"$/.test(e),r=t&&3===e.split(".").length;if(!n||!r)throw new CKEditorError("token-not-in-jwt-format",this)}_registerRefreshTokenTimeout(){const e=this._getTokenRefreshTimeoutTime();clearTimeout(this._tokenRefreshTimeout),this._tokenRefreshTimeout=setTimeout((()=>{this.refreshToken()}),e)}_getTokenRefreshTimeoutTime(){try{const[,e]=this.value.split("."),{exp:t}=JSON.parse(atob(e));if(!t)return DEFAULT_TOKEN_REFRESH_TIMEOUT_TIME;return Math.floor((1e3*t-Date.now())/2)}catch(e){return DEFAULT_TOKEN_REFRESH_TIMEOUT_TIME}}static create(e,t={}){return new Zs(e,t).init()}}class Qs extends((0,n.EmitterMixin)()){constructor(e,t,n){if(super(),!e)throw new CKEditorError("fileuploader-missing-file",null);if(!t)throw new CKEditorError("fileuploader-missing-token",null);if(!n)throw new CKEditorError("fileuploader-missing-api-address",null);this.file=function(e){if("string"!=typeof e)return!1;const t=e.match(BASE64_HEADER_REG_EXP);return!(!t||!t.length)}(e)?function(e,t=512){try{const n=e.match(BASE64_HEADER_REG_EXP)[1],r=atob(e.replace(BASE64_HEADER_REG_EXP,"")),o=[];for(let e=0;e<r.length;e+=t){const n=r.slice(e,e+t),s=new Array(n.length);for(let e=0;e<n.length;e++)s[e]=n.charCodeAt(e);o.push(new Uint8Array(s))}return new Blob(o,{type:n})}catch(e){throw new CKEditorError("fileuploader-decoding-image-data-error",null)}}(e):e,this._token=t,this._apiAddress=n}onProgress(e){return this.on("progress",((t,n)=>e(n))),this}onError(e){return this.once("error",((t,n)=>e(n))),this}abort(){this.xhr.abort()}send(){return this._prepareRequest(),this._attachXHRListeners(),this._sendRequest()}_prepareRequest(){const e=new XMLHttpRequest;e.open("POST",this._apiAddress),e.setRequestHeader("Authorization",this._token.value),e.responseType="json",this.xhr=e}_attachXHRListeners(){const e=this.xhr,t=e=>()=>this.fire("error",e);e.addEventListener("error",t("Network Error")),e.addEventListener("abort",t("Abort")),e.upload&&e.upload.addEventListener("progress",(e=>{e.lengthComputable&&this.fire("progress",{total:e.total,uploaded:e.loaded})})),e.addEventListener("load",(()=>{const t=e.status,n=e.response;if(t<200||t>299)return this.fire("error",n.message||n.error)}))}_sendRequest(){const e=new FormData,t=this.xhr;return e.append("file",this.file),new Promise(((n,r)=>{t.addEventListener("load",(()=>{const e=t.status,o=t.response;return e<200||e>299?o.message?r(new CKEditorError("fileuploader-uploading-data-failed",this,{message:o.message})):r(o.error):n(o)})),t.addEventListener("error",(()=>r(new Error("Network Error")))),t.addEventListener("abort",(()=>r(new Error("Abort")))),t.send(e)}))}}})(),(window.CKEditor5=window.CKEditor5||{}).realTimeCollaboration=__webpack_exports__})();