@ckeditor/ckeditor5-revision-history 49.0.0-alpha.3 → 49.0.0-alpha.4

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 (2) hide show
  1. package/dist/index.js +7 -7
  2. package/package.json +10 -10
package/dist/index.js CHANGED
@@ -20,11 +20,11 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{CKEditorError as _0xd1267b,Collection as _0x6e554a,ElementReplacer as _0x511954,FocusTracker as _0x52efcd,KeystrokeHandler as _0x5db944,ObservableMixin as _0x162cec,ResizeObserver as _0x2bc3ba,logWarning as _0x84622c,scrollViewportToShowTarget as _0x465f96,trustedHtml as _0x20e2ae,uid as _0x5ca1c8}from'@ckeditor/ckeditor5-utils';import{cloneDeep as _0x5bf201,isEqual as _0x5031a7,set as _0x5714e4,unset as _0x23f457}from'es-toolkit/compat';import{Command as _0x4898a1,Editor as _0x334d00,ElementApiMixin as _0x2adcfd,PendingActions as _0x37ac32,Plugin as _0x17a398}from'@ckeditor/ckeditor5-core';import{ConfirmMixin as _0x38d5e1,PillView as _0x376167,Users as _0x4b9bd4,getMarkerDomElement as _0x1f622b,reRootOperation as _0x212e1c,reRootPosition as _0x31212b,reRootRange as _0x51272d,sanitizeEditorConfig as _0x47e5a1}from'@ckeditor/ckeditor5-collaboration-core';import{ModelDocumentFragment as _0x30054f,ModelElement as _0x46fa7e,ModelRange as _0x54a8d9,ModelText as _0xbb256d,ViewAttributeElement as _0x58c46d,ViewContainerElement as _0xe956e0,ViewDocumentFragment as _0x503a04,ViewElement as _0x38c443,ViewEmptyElement as _0x24d70d,ViewRawElement as _0x548d8a,ViewText as _0x383dce,ViewUIElement as _0x46d832}from'@ckeditor/ckeditor5-engine';import{IconChevronDown as _0xdd01e2,IconChevronUp as _0x173f8c,IconHistory as _0x4d32d0,IconSparkle as _0x5dc770,IconThreeVerticalDots as _0x19e5e5,IconUndo as _0x217bff,IconUser as _0xc3ee26}from'@ckeditor/ckeditor5-icons';import{BoxedEditorUIView as _0xace1be,ButtonView as _0x1271a8,ContextualBalloon as _0x28b695,CssTransitionDisablerMixin as _0x1f3631,EditorUI as _0x18bfac,IconView as _0x542efe,InlineEditableUIView as tt,LabeledFieldView as it,ListItemView as et,ListView as st,MenuBarMenuListItemButtonView as nt,MenuBarMenuListItemView as ot,MenuBarMenuListView as rt,MenuBarMenuView as at,StickyPanelView as ht,ToolbarSeparatorView as ct,ToolbarView as lt,UIModel as ut,View as dt,addListToDropdown as ft,createDropdown as vt,createLabeledInputText as gt,normalizeToolbarConfig as mt,submitHandler as _t}from'@ckeditor/ckeditor5-ui';import{DateTime as wt}from'luxon';const pt=/* #__PURE__ -- @preserve */
24
- _0x162cec();var yt=class extends pt{['id'];creator;authors;diffData;toVersion;['fromVersion'];['model'];constructor(_0x3581a8){super(),this['id']=_0x3581a8['id']||_0x5ca1c8(),this['creator']=_0x3581a8['creator']||null,this['authors']=_0x3581a8['authors']||[],this['diffData']=_0x3581a8['diffData']||null,this['toVersion']=_0x3581a8['toVersion']||0x0,this['fromVersion']=_0x3581a8['fromVersion']||0x0,this['set']('name',_0x3581a8['name']||''),this['set']('createdAt',_0x3581a8['createdAt']||new Date()),this['set']('attributes',_0x3581a8['attributes']||{});}setName(_0x4abe92){this['_update']({'name':_0x4abe92});}setAttribute(_0x3ebb7a,_0x570e3f){const _0x177851=_0x5bf201(this['attributes']);_0x5714e4(_0x177851,_0x3ebb7a,_0x570e3f),this['_update']({'attributes':_0x177851});}removeAttribute(_0x2e9c7d){const _0x448bfb=_0x5bf201(this['attributes']);_0x23f457(_0x448bfb,_0x2e9c7d),this['_update']({'attributes':_0x448bfb});}_update(_0x27392c,_0x327318=!0x1){let _0x510333=!0x1;const _0x380dfb={'id':this['id']};for(const _0x305922 of['name','createdAt','diffData','authors','attributes','toVersion','fromVersion','creatorId']){const _0x242986=_0x27392c[_0x305922];void 0x0!==_0x242986&&_0x242986!==this[_0x305922]&&(this[_0x305922]=_0x242986,_0x380dfb[_0x305922]=_0x242986,_0x510333=!0x0);}_0x510333&&(_0x380dfb['authors']&&(_0x380dfb['authorsIds']=_0x380dfb['authors']['map'](_0xc170be=>_0xc170be['id']),delete _0x380dfb['authors']),this['fire']('_update',_0x380dfb,_0x327318));}toJSON(){return{'id':this['id'],'name':this['name'],'creatorId':this['creator']?this['creator']['id']:null,'authorsIds':this['authors']['map'](_0x69bfb7=>_0x69bfb7['id']),'diffData':this['diffData'],'createdAt':this['createdAt'],'attributes':this['attributes'],'fromVersion':this['fromVersion'],'toVersion':this['toVersion']};}},bt=class extends _0x17a398{['_revisions'];static get requires(){return[_0x4b9bd4];}static get['pluginName'](){return'RevisionsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get length(){return this['_revisions']['length'];}constructor(_0x22cf99){super(_0x22cf99),this['_revisions']=new _0x6e554a();}afterInit(){!async function(_0x425f3e){const _0xb38ef6='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x5239c9=0xeb829,_0x58f4c0=0x79758,_0x41f360={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x409b94(_0x4d8c2d){const _0xe38173=new window['Promise'](_0x55b825=>{_0x4d8c2d['once']('ready',_0x55b825);}),_0x2c91df=window['Date']['now'](),_0x5093ab=_0x4d8c2d['config']['get']('licenseKey');async function _0x24248a(){let _0x36b7d6,_0x3f44cb=null,_0xb99edc=null;try{return'GPL'==_0x5093ab?'NotAllowed':(_0x36b7d6=_0x18b8fc(),_0x36b7d6?(_0x36b7d6['usageEndpoint']&&(_0xb99edc=_0x56c51a(_0x36b7d6['usageEndpoint'],_0x36b7d6['jti'])),await _0x4aa152()?_0x5cc03e()?_0x1bbb5a()?'Expired':_0x425876()?('evaluation'==_0x36b7d6['licenseType']&&(_0x3f44cb=_0x3f6a1a('EvaluationLimit')),await _0x9e933a()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x1bbb5a(){const _0xcc09e0=['evaluation','trial']['includes'](_0x36b7d6['licenseType'])?_0x2c91df/0x3e8:0xe10*_0x58f4c0;return _0x36b7d6['exp']<_0xcc09e0;}function _0x5cc03e(){const _0x58f7f5=_0x36b7d6['features'];if(!_0x58f7f5)return!0x1;if(_0x58f7f5['includes']('*'))return!0x0;if(_0x58f7f5['includes']('RH'))return!0x0;if(_0x58f7f5['includes']('RRH')){if(_0x5a423c())return!0x0;if(_0x3da69f()||_0x19f37a())return!0x0;}return!0x1;}function _0x425876(){const _0x9f902e=_0x36b7d6['licensedHosts'];if(!_0x9f902e||0x0==_0x9f902e['length'])return!0x0;const {hostname:_0x3ae496}=new URL(window['location']['href']);if(_0x9f902e['includes'](_0x3ae496))return!0x0;const _0x219dd0=_0x3ae496['split']('.');return _0x9f902e['filter'](_0xe741b1=>_0xe741b1['includes']('*'))['map'](_0x591d07=>_0x591d07['split']('.'))['filter'](_0x4e2b63=>_0x4e2b63['length']<=_0x219dd0['length'])['map'](_0x10a8f6=>Array(_0x219dd0['length']-_0x10a8f6['length'])['fill']('*'===_0x10a8f6[0x0]?'*':'')['concat'](_0x10a8f6))['some'](_0x4c6961=>_0x219dd0['every']((_0x652bad,_0x183c8f)=>_0x4c6961[_0x183c8f]===_0x652bad||'*'===_0x4c6961[_0x183c8f]));}function _0x9e933a(){return _0x3f44cb&&_0xb99edc?new window['Promise']((_0x213c81,_0x22f000)=>{_0x3f44cb['then'](_0x213c81,_0x22f000),_0xb99edc['then'](_0x239320=>{'Valid'!=_0x239320&&_0x213c81(_0x239320);},_0x22f000);}):_0x3f44cb||_0xb99edc||'Valid';}}function _0x56c51a(_0x23e87b,_0x5733fe){return new window['Promise'](_0x4cae16=>{if(_0x4e4377())return _0x4cae16('Valid');_0x78a5a9(),_0x4d8c2d['decorate']('_sendUsageRequest');let _0xaad88b=!0x1;const _0x446e7c=_0x5ca1c8();function _0x5d95fd(_0x333484){return!!_0x333484&&('object'==typeof _0x333484||'function'==typeof _0x333484)&&'function'==typeof _0x333484['then']&&'function'==typeof _0x333484['catch'];}function _0x6af47d(_0x581a76){_0x23f92f(_0x581a76)['then'](_0x4d9a26=>_0x4d9a26&&'ok'==_0x4d9a26['status']?_0x1ef06c(_0x2a8549(_0x446e7c+_0x5733fe))!=_0x4d9a26['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x13f2d0=>(_0x85a917(),_0x13f2d0),()=>{const _0x24e5af=_0x31eaac();return null==_0x24e5af?(_0x85a917(),'Valid'):_0x2c91df-_0x24e5af>0x240c8400?'UsageLimit':'Valid';})['then'](_0x4cae16)['catch'](()=>{_0x4cae16('UsageLimit');});const _0x202f88=0x36ee80;function _0x85a917(){const _0x1c5613='llct-'+_0x1ef06c(_0x2a8549(_0x23e87b)),_0x3d81e2=_0x2da9dd(_0x1ef06c(window['Math']['ceil'](_0x2c91df/_0x202f88)));window['localStorage']['setItem'](_0x1c5613,_0x3d81e2);}function _0x31eaac(){const _0x12d67c='llct-'+_0x1ef06c(_0x2a8549(_0x23e87b)),_0x37a00d=window['localStorage']['getItem'](_0x12d67c);return _0x37a00d?window['parseInt'](_0x2da9dd(_0x37a00d),0x10)*_0x202f88:null;}function _0x23f92f(_0xd86717){return new window['Promise']((_0x2b6e61,_0x20d9dd)=>{_0xd86717['then'](_0x2b6e61,_0x20d9dd),window['setTimeout'](_0x20d9dd,0x1d4c0);});}}_0x4d8c2d['on']('_sendUsageRequest',(_0x4ab47a,_0xff3134)=>{if(_0xff3134[0x0]!=_0x23e87b)return _0x4cae16('UsageLimit');_0xff3134[0x1]={..._0xff3134[0x1],'requestId':_0x446e7c};},{'priority':'high'}),_0x4d8c2d['on']('_sendUsageRequest',_0xff16b8=>{_0x5d95fd(_0xff16b8['return'])&&(_0xaad88b=!0x0,_0x6af47d(_0xff16b8['return']));},{'priority':'low'}),_0xe38173['then'](()=>{_0xaad88b||_0x4cae16('UsageLimit');});});function _0x4e4377(){return'auto'==_0x4d8c2d['editing']['view']['_overlayModeHint'];}function _0x78a5a9(){_0x4d8c2d['editing']['view']['_overlayModeHint']='auto';}}function _0x3f6a1a(_0x4ddf07){const _0x5d6eaf=[new window['Promise'](_0x3e7364=>setTimeout(_0x3e7364,0x93ecc)),_0xe38173['then'](()=>new window['Promise'](_0x1df0e1=>{const _0x1d8c0c=0x7,_0x4fb55b=_0x425f3e['_revisions'];function _0x5d34f9(){_0x4fb55b['length']>=_0x1d8c0c&&_0x1df0e1();}_0x5d34f9(),_0x4fb55b['on']('add',_0x5d34f9);})),new window['Promise'](_0x2b49f4=>{function _0x2b1f0d(){for(const _0x1701c7 in window)if(window['Number']['isNaN'](window['Number'](_0x1701c7))&&window[_0x1701c7]==_0x5239c9)return _0x2b49f4();'destroyed'!=_0x4d8c2d['state']&&window['setTimeout'](_0x2b1f0d,0x1388);}_0x1a8e93('RevisionViewer')&&_0x2b1f0d();})];return window['Promise']['race'](_0x5d6eaf)['then'](()=>_0x4ddf07);}async function _0x50f316(){if(await _0xe38173,_0x1a8e93('RevisionViewer')){const _0x105f28=_0x425f3e['getRevision'](0x0),_0x5a4a6b=_0x425f3e['getEarlierVisibleRevision'](_0x105f28['id']),_0x4eea18=_0x476a49('RevisionViewer');return await _0x4eea18['compare'](_0x105f28['id'],_0x5a4a6b?_0x5a4a6b['id']:null,!0x0),_0x4eea18['unbind']('isEnabled'),_0x4eea18['isEnabled']=!0x1,_0x4eea18['compare']=_0x3bfc7e,void(_0x4eea18['_getDiff']=_0x3bfc7e);}if(_0x1a8e93('RevisionTracker')){const _0x596919=_0x476a49('RevisionTracker');_0x596919['unbind']('isEnabled'),_0x596919['isEnabled']=!0x1,_0x596919['update']=_0x3bfc7e,_0x596919['saveRevision']=_0x3bfc7e;}_0x4d8c2d['model']['change']=_0x3bfc7e,_0x4d8c2d['model']['enqueueChange']=_0x3bfc7e,_0x4d8c2d['enableReadOnlyMode']('model');}function _0x5a423c(){return _0x1a8e93('WebSocketGateway')&&'connected'==_0x476a49('WebSocketGateway')['state'];}function _0x3da69f(){return _0x1a8e93('RevisionViewerIntegration');}function _0x19f37a(){return _0x1a8e93('TrackChangesDataGetter');}function _0x3d0801(_0x373646){const _0xca1cbd=_0x568639();_0x4d8c2d[_0xca1cbd]='revisionHistoryLicenseKey'+_0x373646,_0x373646['endsWith']('Limit')&&(window[_0x568639()]=_0x5239c9),'Valid'!=_0x373646&&_0x50f316();}function _0x568639(){const _0x48d823=window['String'](window['performance']['now']())['replace']('.','');let _0x598713='N';for(let _0x32d71a=0x0;_0x32d71a<_0x48d823['length'];_0x32d71a+=0x2){let _0x1c834e=window['parseInt'](_0x48d823['substring'](_0x32d71a,_0x32d71a+0x2));_0x1c834e>=0x3e&&(_0x1c834e-=0x3e),_0x598713+=_0xb38ef6[_0x1c834e];}return _0x598713;}function _0x18b8fc(){const _0x277f76=_0x5093ab['split']('.');if(0x3!=_0x277f76['length'])return null;return _0xb74519(_0x277f76[0x1]);function _0xb74519(_0x571f56){const _0x56f8b5=_0x6d16e6(_0x571f56);return _0x56f8b5&&_0x1c6c87()?_0x56f8b5:null;function _0x1c6c87(){const _0x27a2c5=_0x56f8b5['jti'],_0x3c6b6c=window['parseInt'](_0x27a2c5['substring'](_0x27a2c5['length']-0x8),0x10),_0x513a4f={..._0x56f8b5,'jti':_0x27a2c5['substring'](0x0,_0x27a2c5['length']-0x8)};return delete _0x513a4f['vc'],_0x2a8549(_0x513a4f)==_0x3c6b6c;}}}async function _0x4aa152(){let _0x4dfef8=!0x0;try{const [_0x1ce467,_0x1c72fc,_0x145d22]=_0x5093ab['split']('.');return _0x2611e9(_0x1ce467),await _0x30d61b(_0x1ce467,_0x1c72fc,_0x145d22),_0x4dfef8;}catch{return!0x1;}function _0x2611e9(_0x5dfa23){const _0x3521ce=_0x6d16e6(_0x5dfa23);_0x3521ce&&'ES256'==_0x3521ce['alg']||(_0x4dfef8=!0x1);}async function _0x30d61b(_0x268245,_0x241f55,_0x19b0c1){const _0x5182b2=window['Uint8Array']['from'](_0xa5f114(_0x19b0c1),_0x90b8b6=>_0x90b8b6['charCodeAt'](0x0)),_0x35169d=new window['TextEncoder']()['encode'](_0x268245+'.'+_0x241f55),_0x3ed267=window['crypto']['subtle'];if(!_0x3ed267)return;const _0x8fbb1c=await _0x3ed267['importKey']('jwk',_0x41f360,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x3ed267['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x8fbb1c,_0x5182b2,_0x35169d)||(_0x4dfef8=!0x1);}}function _0x6d16e6(_0x20e75c){return _0x20e75c['startsWith']('ey')?JSON['parse'](_0xa5f114(_0x20e75c)):null;}function _0xa5f114(_0x1e74e9){return window['atob'](_0x1e74e9['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x2a8549(_0x5c47e9){let _0xde6a68=0x1505;function _0x3dcb0f(_0xb7a007){for(let _0x56b112=0x0;_0x56b112<_0xb7a007['length'];_0x56b112++){const _0x14d62b=_0xb7a007['charCodeAt'](_0x56b112);_0xde6a68=(_0xde6a68<<0x5)+_0xde6a68+_0x14d62b,_0xde6a68&=_0xde6a68;}}function _0x35f7a9(_0x440389){Array['isArray'](_0x440389)?_0x440389['forEach'](_0x35f7a9):_0x440389&&'object'==typeof _0x440389?Object['entries'](_0x440389)['sort']()['forEach'](([_0x49598e,_0x18810c])=>{_0x3dcb0f(_0x49598e),_0x35f7a9(_0x18810c);}):_0x3dcb0f(window['String'](_0x440389));}return _0x35f7a9(_0x5c47e9),_0xde6a68>>>0x0;}function _0x1ef06c(_0x35ec9f){return _0x35ec9f['toString'](0x10)['padStart'](0x8,'0');}function _0x2da9dd(_0xda5cf2){return _0xda5cf2['split']('')['reverse']()['join']('');}function _0x1a8e93(_0x3745ac){return _0x4d8c2d['plugins']['has'](_0x3745ac);}function _0x476a49(_0x2dd0cd){return _0x4d8c2d['plugins']['get'](_0x2dd0cd);}function _0x3bfc7e(){}_0x3d0801(await _0x24248a());}_0x409b94(_0x425f3e['editor']);}(this);}createRevision(_0x36f26c){const _0x19ac61=this['editor']['plugins']['get']('Users');return new yt({'id':_0x36f26c['id'],'name':_0x36f26c['name'],'creator':_0x36f26c['creatorId']?_0x19ac61['getUser'](_0x36f26c['creatorId']):null,'diffData':_0x36f26c['diffData']||_0x36f26c['data'],'authors':_0x36f26c['authorsIds']['map'](_0x22862d=>_0x19ac61['getUser'](_0x22862d)),'createdAt':new Date(_0x36f26c['createdAt']),'attributes':_0x36f26c['attributes'],'fromVersion':_0x36f26c['fromVersion'],'toVersion':_0x36f26c['toVersion']});}['addRevision'](_0x532103,_0x245c01=0x0){this['_revisions']['add'](_0x532103,_0x245c01);}getRevision(_0x2383f4){return this['_revisions']['get'](_0x2383f4);}getRevisions(_0x5ccfac={'toJSON':!0x1}){const _0x410785=Array['from'](this['_revisions']);return _0x410785['reverse'](),_0x5ccfac['toJSON']?_0x410785['map'](_0x180837=>_0x180837['toJSON']()):_0x410785;}getIndex(_0x31ab2b){return this['_revisions']['getIndex'](_0x31ab2b);}getEarlierVisibleRevision(_0x99344d){const [,_0x2c8c21]=this['getRevisionsIterator'](_0x99344d,{'direction':'earlier'});return _0x2c8c21;}getLaterVisibleRevision(_0xc95736){const [,_0x3154ac]=this['getRevisionsIterator'](_0xc95736,{'direction':'later'});return _0x3154ac;}getRevisionsInDiff(_0x4321f5){const _0x7a6402=[];for(const _0x23a350 of this['getRevisionsIterator'](_0x4321f5['newRevisionId']))if(_0x7a6402['push'](_0x23a350),_0x23a350['id']===_0x4321f5['oldRevisionId'])break;return _0x7a6402;}*getRevisionsIterator(_0x5e37e0,{direction:_0x1052d2='earlier',filter:_0x425a50=()=>!0x0}={}){const _0x108acc='earlier'===_0x1052d2?0x1:-0x1;let _0x248f04=this['_revisions']['get'](_0x5e37e0),_0x3a1ee2=this['getIndex'](_0x248f04);for(yield _0x248f04;_0x248f04;){if(_0x3a1ee2+=_0x108acc,_0x248f04=this['getRevision'](_0x3a1ee2),!_0x248f04)return;_0x425a50(_0x248f04)&&(yield _0x248f04);}}},Rt=class extends _0x17a398{static get['pluginName'](){return'RevisionHistoryUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_viewClassToTypeChar']=new Map([[_0xe956e0,'c'],[_0x58c46d,'a'],[_0x24d70d,'e'],[_0x548d8a,'r'],[_0x46d832,'u']]);_typeCharToViewClass=new Map([['c',_0xe956e0],['a',_0x58c46d],['e',_0x24d70d],['r',_0x548d8a],['u',_0x46d832]]);async loadRevisionData(_0x519d91,_0x7ac36e){if(_0x519d91['diffData']||!_0x7ac36e)return;const _0x51d052=this['editor']['config']['get']('collaboration.channelId');_0x519d91['diffData']=(await _0x7ac36e['getRevision']({'channelId':_0x51d052,'revisionId':_0x519d91['id']}))['diffData'];}getRevisionDocumentData(_0x5bd471){const _0xc91858={};for(const _0x116993 in _0x5bd471['diffData']){if(_0x5bd471['diffData'][_0x116993]['attachChange']&&!_0x5bd471['diffData'][_0x116993]['attachChange']['isAttached'])continue;const _0x5d3dc9=this['_removeRevisionMarkers'](JSON['parse'](_0x5bd471['diffData'][_0x116993]['insertions'])),_0x2f5566=this['editor']['editing']['view']['document'],_0x42b117=new _0x503a04(_0x2f5566,_0x5d3dc9['map'](_0x55150e=>this['_getViewFromDiffObj'](_0x55150e,!0x1)));this['editor']['data']['processor']['useFillerType']('marked'),_0xc91858[_0x116993]=this['editor']['data']['processor']['toData'](_0x42b117),this['editor']['data']['processor']['useFillerType']('default');}return _0xc91858;}getRevisionRootsAttributes(_0x47ec1f){const _0x4ea63e={};for(const _0x18d3e4 in _0x47ec1f['diffData'])_0x47ec1f['diffData'][_0x18d3e4]['attachChange']&&!_0x47ec1f['diffData'][_0x18d3e4]['attachChange']['isAttached']||(_0x4ea63e[_0x18d3e4]=_0x47ec1f['diffData'][_0x18d3e4]['attributesAfter']||{});return _0x4ea63e;}getRevisionRootsModelElements(_0xb1c34){const _0x57a67f={};for(const _0x4123cd in _0xb1c34['diffData']){if(_0xb1c34['diffData'][_0x4123cd]['attachChange']&&!_0xb1c34['diffData'][_0x4123cd]['attachChange']['isAttached'])continue;const _0x457ebd=_0xb1c34['diffData'][_0x4123cd]['rootElementName'];_0x457ebd&&(_0x57a67f[_0x4123cd]=_0x457ebd);}return _0x57a67f;}_getTypeCharForViewElement(_0x712582){return this['_viewClassToTypeChar']['get'](_0x712582['constructor']);}_getViewFromDiffObj(_0x4e283e,_0x54c3b4){const _0x931ce1=this['editor']['editing']['view']['document'];if('string'==typeof _0x4e283e)return new _0x383dce(_0x931ce1,_0x4e283e);{let _0x319917,_0x309b59;_0x309b59='u'==_0x4e283e['type']||'r'==_0x4e283e['type']?[]:_0x4e283e['children']['map'](_0x27285e=>this['_getViewFromDiffObj'](_0x27285e,_0x54c3b4));const _0x3f8e2=this['_typeCharToViewClass']['get'](_0x4e283e['type'])||_0x38c443,_0x21db77=this['editor']['data']['htmlProcessor']['domConverter'];if(_0x319917=new _0x3f8e2(_0x931ce1,_0x4e283e['name'],_0x4e283e['attributes'],_0x309b59),'u'==_0x4e283e['type']&&_0x4e283e['children'][0x0]){const _0x8b3bf2=_0x4e283e['children'][0x0];if(_0x319917['render']=function(_0xae3f37){const _0x3b3419=_0xae3f37['createElement']('div');return _0x3b3419['innerHTML']=_0x20e2ae(_0x8b3bf2),_0x3b3419['childNodes'][0x0];},_0x54c3b4){const _0x4eaa46=new _0x503a04(_0x931ce1);_0x4eaa46['_appendChild'](_0x319917);const _0x42854e=Array['from'](_0x21db77['viewChildrenToDom'](_0x4eaa46,{'bind':!0x1})),_0x281cfa=_0x21db77['domDocument']['createElement']('div');_0x281cfa['append'](..._0x42854e),_0x319917=Array['from'](_0x21db77['domChildrenToView'](_0x281cfa))[0x0];}}else{if('r'==_0x4e283e['type']&&_0x4e283e['children'][0x0]){const _0x39cf02=_0x4e283e['children'][0x0];if(_0x319917['render']=function(_0x2147ac){_0x2147ac['innerHTML']=_0x20e2ae(_0x39cf02);},_0x54c3b4){const _0x238746=new _0x503a04(_0x931ce1);_0x238746['_appendChild'](_0x319917);const _0x17ae35=Array['from'](_0x21db77['viewChildrenToDom'](_0x238746,{'bind':!0x1})),_0x21fdac=_0x21db77['domDocument']['createElement']('div');_0x21fdac['append'](..._0x17ae35);const _0x2efdbd=Array['from'](_0x21db77['domChildrenToView'](_0x21fdac));_0x2efdbd['length']>0x1?_0x319917['_appendChild'](_0x2efdbd):_0x319917=_0x2efdbd[0x0];}}}if(_0x4e283e['customProperties']){for(const [_0x4b6197,_0x42a302]of _0x4e283e['customProperties'])_0x319917['_setCustomProperty'](_0x4b6197,_0x42a302);}const _0x3447fe=void 0x0===_0x4e283e['fillerOffset']?null:_0x4e283e['fillerOffset'];return null!==_0x3447fe&&(_0x319917['getFillerOffset']=()=>_0x3447fe),_0x319917;}}_makeModelFromViewString(_0x1555db,_0xd41d9a){const _0x48ebdb=JSON['parse'](_0x1555db),_0x522ca5=this['editor']['editing']['view']['document'],_0x236489=new _0x503a04(_0x522ca5,_0x48ebdb['map'](_0x133a00=>this['_getViewFromDiffObj'](_0x133a00,!0x0))),_0x3e5b47=this['editor']['data']['toModel'](_0x236489,_0xd41d9a);return _0x3e5b47['name']=_0xd41d9a,_0x3e5b47;}['_removeRevisionMarkers'](_0x533c22){return(_0x533c22=_0x533c22['filter'](_0x3eff86=>!_0x3eff86['name']||'revision-start'!==_0x3eff86['name']&&'revision-end'!==_0x3eff86['name']))['forEach'](_0x2b5cfa=>{'string'!=typeof _0x2b5cfa&&(_0x2b5cfa['children']=this['_removeRevisionMarkers'](_0x2b5cfa['children']),_0x2b5cfa['attributes']=_0x2b5cfa['attributes']['filter'](_0x33ba9a=>!_0x33ba9a[0x0]['startsWith']('data-revision-')));}),_0x533c22;}};function kt(_0x52ce0e,_0x57525c,_0x47d1eb){const t=_0x52ce0e['t'];switch(_0x57525c){case'Revision\x20history':return t('Revision\x20history');case'Open\x20revision\x20history':return t('Open\x20revision\x20history');case'Restored':return t('Restored');case'Empty\x20document':return t('Empty\x20document');case'Initial\x20revision':return t('Initial\x20revision');case'Suggested\x20by':return t('Suggested\x20by');case'Added\x20by':return t('Added\x20by');case'Removed\x20by':return t('Removed\x20by');case'Show\x20more\x20items':return t('Show\x20more\x20items');case'Compare\x20against\x20selected':return t('Compare\x20against\x20selected');case'Name\x20this\x20revision':return t('Name\x20this\x20revision');case'Restore\x20this\x20revision':return t('Restore\x20this\x20revision');case'Back\x20to\x20editing':return t('Back\x20to\x20editing');case'Loading...':return t('Loading...');case'No\x20changes':return t('No\x20changes');case'NUMBER_OF_CHANGES':return t({'string':'%0\x20change','plural':'%0\x20changes','id':'NUMBER_OF_CHANGES'},_0x47d1eb);case'X_OF_Y_CHANGES':return t({'string':'%0\x20of\x20%1','id':'X_OF_Y_CHANGES'},_0x47d1eb);case'Show\x20previous\x20change':return t('Show\x20previous\x20change');case'Show\x20next\x20change':return t('Show\x20next\x20change');case'EDIT_X_OF_Y_REVISIONS':return t({'string':'Edit','id':'EDIT_X_OF_Y_REVISIONS'});case'Total':return t('Total');case'Revision\x20creator':return t('Revision\x20creator');case'Revision\x20author':return t('Revision\x20author');case'Revision\x20name':return t('Revision\x20name');case'Save\x20current\x20revision':return t('Save\x20current\x20revision');case'Accept':return t('Accept');case'Save':return t('Save');case'Cancel':return t('Cancel');case'Name\x20of\x20the\x20revision':return t('Name\x20of\x20the\x20revision');case'optional':return t('optional');case'PENDING_ACTION_REVISION_HISTORY':return t({'string':'Unsaved\x20change\x20in\x20revision\x20history.','id':'PENDING_ACTION_REVISION_HISTORY'});case'The\x20revision\x20name\x20cannot\x20be\x20empty.':return t('The\x20revision\x20name\x20cannot\x20be\x20empty.');case'Enter\x20the\x20revision\x20name':return t('Enter\x20the\x20revision\x20name');case'REVISION_AI_SOURCE_PILL_LABEL':return t({'string':'Includes\x20AI\x20suggestions','id':'REVISION_AI_SOURCE_PILL_LABEL'});case'AI_SOURCE_REVISION_TOOLTIP':return t({'string':'This\x20revision\x20contains\x20AI-assisted\x20suggestions.','id':'AI_SOURCE_REVISION_TOOLTIP'});case'AI_SOURCE_CHANGE_TOOLTIP':return t({'string':'This\x20change\x20was\x20suggested\x20using\x20AI.','id':'AI_SOURCE_CHANGE_TOOLTIP'});case'AI_SOURCE_ADDED_BY':return t({'string':'Added\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_ADDED_BY'},_0x47d1eb);case'AI_SOURCE_REMOVED_BY':return t({'string':'Removed\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_REMOVED_BY'},_0x47d1eb);case'AI_SOURCE_SUGGESTED_BY':return t({'string':'Suggested\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_SUGGESTED_BY'},_0x47d1eb);case'AI_SOURCE_AI':return t({'string':'AI','id':'AI_SOURCE_AI'});default:return'';}}var At=class extends _0x17a398{['licenseKey'];_licenseKeyCheckInterval;currentRevision=null;repository;adapter=null;_revisionDataBuilder;['_source'];_initialRevisionId;_bufferedUpdates;_utils;_pendingAction;_continueCurrentRevision;_startingVersion;_loadedStateData;static get['pluginName'](){return'RevisionTracker';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_0x4b9bd4,bt,Rt,_0x37ac32];}constructor(_0x5a2830){super(_0x5a2830),this['repository']=this['editor']['plugins']['get']('RevisionsRepository'),this['_utils']=this['editor']['plugins']['get']('RevisionHistoryUtils'),this['_revisionDataBuilder']=new It(this['editor']),this['_initialRevisionId']=this['editor']['config']['get']('collaboration.channelId')||'initial',this['_bufferedUpdates']=new Map(),this['_loadedStateData']=null;const _0x365295=_0x5ca1c8();this['_source']={'history':this['editor']['model']['document']['history'],'getLatestVersion':()=>Promise['resolve'](this['editor']['model']['document']['version']),'getCurrentRevisionId':()=>_0x365295},this['set']('isReady',!0x1),this['set']('isEnabled',!0x0),this['set']('_isPendingUpdate',!0x1),this['editor']['config']['define']('revisionHistory.resumeUnsavedRevision',!0x0),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'revision'});}init(){this['_setConversion'](),this['editor']['data']['on']('ready',()=>{const _0x52e9dd=this['repository']['getRevision'](0x0),_0x5b4a96=_0x52e9dd&&null===_0x52e9dd['creator']?_0x52e9dd:null;if(this['_continueCurrentRevision']=!!_0x5b4a96&&this['editor']['config']['get']('revisionHistory.resumeUnsavedRevision'),this['editor']['plugins']['has']('RealTimeCollaborationClient')){const _0x5be8bc=this['_source']['getCurrentRevisionId'](),_0x4301fc=this['repository']['getRevision'](_0x5be8bc);if(_0x4301fc)this['_startingVersion']=_0x4301fc['fromVersion'],this['_continueCurrentRevision']=!0x1;else{const _0x5d9117=this['_source']['history']['_operations']['find'](_0x4dfc66=>!_0x4dfc66['_isInit']),_0x31fc91=_0x5d9117?_0x5d9117['baseVersion']:this['_source']['history']['version'];_0x52e9dd?(_0x52e9dd['toVersion']<_0x31fc91&&_0x52e9dd['_update']({'toVersion':_0x31fc91}),this['_continueCurrentRevision']?(this['_source']['getCurrentRevisionId']=()=>_0x5b4a96['id'],this['_startingVersion']=_0x5b4a96['fromVersion']):(this['_startingVersion']=_0x52e9dd['toVersion'],this['_continueCurrentRevision']=!0x1)):(this['_startingVersion']=_0x31fc91,this['_continueCurrentRevision']=!0x1);}}else _0x5b4a96&&(this['editor']['model']['document']['history']['version']=Math['max'](_0x5b4a96['toVersion'],this['editor']['model']['document']['history']['version']),_0x5b4a96['fromVersion']===_0x5b4a96['toVersion']?(0x0!==_0x5b4a96['fromVersion']&&(this['_source']['getCurrentRevisionId']=()=>_0x5b4a96['id']),this['_continueCurrentRevision']=!0x1):this['_continueCurrentRevision']&&(this['_source']['getCurrentRevisionId']=()=>_0x5b4a96['id'],this['_startingVersion']=_0x5b4a96['fromVersion'])),this['_continueCurrentRevision']||(this['_startingVersion']=this['editor']['model']['document']['version']);this['_revisionDataBuilder']['init'](this['_source']['history']),this['_createInitialRevision'](this['_startingVersion']),this['_createCurrentRevision'](this['_startingVersion']),this['adapter']&&this['sendBufferedUpdates']();}),this['bind']('isReady')['to'](this,'_isPendingUpdate',_0x239a4d=>!_0x239a4d),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x21b339=[this['editor']];for(const _0x11654c of _0x21b339){let _0x46f471;for(const _0x5d2dc7 in _0x11654c){const _0x2ac93b=_0x5d2dc7,_0x40ca41=_0x11654c[_0x2ac93b];if('revisionHistoryLicenseKeyValid'==_0x40ca41||'revisionHistoryLicenseKeyInvalid'==_0x40ca41||'revisionHistoryLicenseKeyExpired'==_0x40ca41||'revisionHistoryLicenseKeyDomainLimit'==_0x40ca41||'revisionHistoryLicenseKeyNotAllowed'==_0x40ca41||'revisionHistoryLicenseKeyEvaluationLimit'==_0x40ca41||'revisionHistoryLicenseKeyUsageLimit'==_0x40ca41){delete _0x11654c[_0x2ac93b],_0x46f471=_0x40ca41,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'revisionHistoryLicenseKeyInvalid'==_0x46f471&&_0x11654c['_showLicenseError']('invalid'),'revisionHistoryLicenseKeyExpired'==_0x46f471&&_0x11654c['_showLicenseError']('expired'),'revisionHistoryLicenseKeyDomainLimit'==_0x46f471&&_0x11654c['_showLicenseError']('domainLimit'),'revisionHistoryLicenseKeyNotAllowed'==_0x46f471&&_0x11654c['_showLicenseError']('featureNotAllowed','RevisionHistory'),'revisionHistoryLicenseKeyEvaluationLimit'==_0x46f471&&_0x11654c['_showLicenseError']('evaluationLimit'),'revisionHistoryLicenseKeyUsageLimit'==_0x46f471&&_0x11654c['_showLicenseError']('usageLimit');}},0x3e8);}async afterInit(){if(this['repository']['length']>0x0){const _0x932de5=this['repository']['getRevision'](0x0),_0x1a5802=await this['getRevisionDocumentData'](_0x932de5),_0x10e5ea=await this['getRevisionRootsAttributes'](_0x932de5),_0x1ca5f1=this['_utils']['getRevisionRootsModelElements'](_0x932de5);this['_replaceEditorDataWithRevisionData'](_0x1a5802,_0x10e5ea,_0x1ca5f1);}}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}setSource(_0x534802){this['_source']=_0x534802;}async update(){const _0x5920e9=await this['_source']['getLatestVersion']();if(_0x5920e9>this['currentRevision']['toVersion']){await this['_loadState']();const _0x48c9d6=this['buildRevisionData']({'revision':this['currentRevision'],'to':_0x5920e9});_0x48c9d6['authors']=_0x48c9d6['authorsIds']['map'](_0x35baeb=>this['editor']['plugins']['get']('Users')['getUser'](_0x35baeb)),this['currentRevision']['_update'](_0x48c9d6);}}async['saveRevision'](_0x592113={},_0x317f13=null){const _0x33e644=[];await this['_loadState'](),this['_continueCurrentRevision']=!0x1,_0x317f13>this['currentRevision']['toVersion']&&(_0x317f13=null),null===_0x317f13&&(_0x317f13=await this['_source']['getLatestVersion']());const _0x2256d6=this['_getFromVersion'](_0x317f13),_0x90a6e1=this['buildRevisionData']({'from':_0x2256d6,'to':_0x317f13});if(this['currentRevision']['toVersion']<_0x317f13){const _0x3ce455=this['buildRevisionData']({'revision':this['currentRevision'],'from':_0x317f13,'to':_0x317f13});_0x3ce455['authors']=[],_0x3ce455['authorsIds']=[],_0x3ce455['id']=this['currentRevision']['id'],this['currentRevision']['_update'](_0x3ce455,!0x0),delete _0x3ce455['authors'],_0x33e644['push'](_0x3ce455);}const _0x2dd947={..._0x592113,'creatorId':this['editor']['plugins']['get']('Users')['me']['id'],'name':_0x592113['name']||null,'id':_0x592113['id']||_0x5ca1c8(),..._0x90a6e1,'attributes':{..._0x592113['attributes'],..._0x90a6e1['attributes']}},_0x208673=this['addRevisionData'](_0x2dd947);_0x33e644['push'](_0x2dd947);const _0x552213=this['repository']['getIndex'](_0x208673);if(0x0!==_0x552213){const _0x4471c4=this['repository']['getRevision'](_0x552213-0x1);if(_0x4471c4['fromVersion']!==_0x317f13){const _0x20257e=this['_revisionDataBuilder']['getData'](_0x317f13,_0x4471c4['toVersion']),_0x4e7a40={'id':_0x4471c4['id'],'diffData':_0x20257e['diffData'],'authorsIds':_0x20257e['authorsIds'],'authors':_0x20257e['authorsIds']['map'](_0x2356ac=>this['editor']['plugins']['get']('Users')['getUser'](_0x2356ac)),'fromVersion':_0x317f13};this['_stampAiAttribute'](_0x4e7a40,_0x4471c4,!!_0x20257e['hasAIChanges']),_0x4471c4===this['currentRevision']&&(_0x4e7a40['createdAt']=new Date(_0x2dd947['createdAt']['getTime']()+0xa)),_0x4471c4['_update'](_0x4e7a40,!0x0),delete _0x4e7a40['authors'],_0x33e644['push'](_0x4e7a40);}}if(this['adapter']){for(const _0x3673d1 of _0x33e644)this['_bufferUpdate'](_0x3673d1['id'],_0x3673d1,!0x0);this['sendBufferedUpdates']();}return _0x208673;}addRevisionData(_0x487596){const _0x444668=this['repository']['createRevision'](_0x487596);return this['adapter']&&_0x444668['on']('_update',(_0x25fd60,_0x4a4e96,_0x120170)=>{_0x120170||(this['_bufferUpdate'](_0x4a4e96['id'],_0x4a4e96,!0x0),this['sendBufferedUpdates']());}),this['repository']['addRevision'](_0x444668,this['_findInsertionIndex'](_0x444668)),_0x444668;}async getRevisionDocumentData(_0x4e45ad){return await this['_utils']['loadRevisionData'](_0x4e45ad,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x4e45ad);}async getRevisionRootsAttributes(_0x259f42){return await this['_utils']['loadRevisionData'](_0x259f42,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x259f42);}sendBufferedUpdates(){if(0x0===this['_bufferedUpdates']['size'])return;if(this['_isPendingUpdate'])return;let _0x4c21b9=Array['from'](this['_bufferedUpdates']['values']());this['_bufferedUpdates']['clear']();for(let _0x3126b8=0x0;_0x3126b8<_0x4c21b9['length'];_0x3126b8++){const _0x2eb153=_0x4c21b9[_0x3126b8];let _0xef816b=!0x1;for(const _0x5b17f0 of Object['keys'](_0x2eb153))void 0x0===_0x2eb153[_0x5b17f0]?delete _0x2eb153[_0x5b17f0]:'id'!==_0x5b17f0&&(_0xef816b=!0x0);_0xef816b||(_0x4c21b9[_0x3126b8]=null);}if(_0x4c21b9=_0x4c21b9['filter'](_0x583ee2=>null!==_0x583ee2),!_0x4c21b9['length'])return;for(let _0x451623=0x0;_0x451623<_0x4c21b9['length'];_0x451623++){const _0x724296=_0x4c21b9[_0x451623];void 0x0!==_0x724296['fromVersion']&&void 0x0===_0x724296['toVersion']&&(_0x724296['toVersion']=this['repository']['getRevision'](_0x724296['id'])['toVersion']),void 0x0!==_0x724296['toVersion']&&void 0x0===_0x724296['fromVersion']&&(_0x724296['fromVersion']=this['repository']['getRevision'](_0x724296['id'])['fromVersion']);}const _0x31b152=this['editor']['config']['get']('collaboration.channelId');this['_isPendingUpdate']=!0x0,this['_addPendingAction'](),this['adapter']['updateRevisions'](_0x4c21b9,_0x31b152)['finally'](()=>{this['_isPendingUpdate']=!0x1;})['then'](_0x5529ae=>{if(_0x5529ae){for(const _0xd71e4c of _0x5529ae)this['setRevisionData']({'id':_0xd71e4c['id'],'createdAt':_0xd71e4c['createdAt']});}this['_removePendingAction'](),this['sendBufferedUpdates']();});}_stampAiAttribute(_0x116c54,_0x591ef7,_0x343c8a){if(_0x343c8a===(!!_0x591ef7&&!!_0x591ef7['attributes']['@ai']))return;const _0x48f7aa={..._0x591ef7?_0x591ef7['attributes']:{},..._0x116c54['attributes']};_0x343c8a?_0x48f7aa['@ai']=!0x0:delete _0x48f7aa['@ai'],_0x116c54['attributes']=_0x48f7aa;}buildRevisionData({revision:_0xb1a5ce=null,from:_0xb13ab4=null,to:_0x57f052=null}){_0xb13ab4=null!==_0xb13ab4?_0xb13ab4:_0xb1a5ce['fromVersion'],_0x57f052=null!==_0x57f052?_0x57f052:_0xb1a5ce['toVersion'];const _0x49c4ae=this['_revisionDataBuilder']['getData'](_0xb13ab4,_0x57f052),_0x2b85a0={'diffData':_0x49c4ae['diffData'],'authorsIds':_0x49c4ae['authorsIds'],'fromVersion':_0xb13ab4,'toVersion':_0x57f052};if(this['_stampAiAttribute'](_0x2b85a0,_0xb1a5ce,!!_0x49c4ae['hasAIChanges']),!_0xb1a5ce||_0x57f052!==_0xb1a5ce['toVersion']){const _0xbec809=_0x57f052-0x1,_0x4aa0a0=this['_source']['history']['getOperation'](_0xbec809);_0x2b85a0['createdAt']=_0x4aa0a0&&_0x4aa0a0['createdAt']||new Date();}if(this['_loadedStateData']&&_0xb13ab4===this['_loadedStateData']['fromVersion']){for(const _0x61ce83 of this['_loadedStateData']['authors'])_0x2b85a0['authorsIds']['includes'](_0x61ce83['id'])||_0x2b85a0['authorsIds']['push'](_0x61ce83['id']);}return _0x2b85a0;}_bufferUpdate(_0x296b2d,_0x3ab2db,_0x31e58d){if(this['_bufferedUpdates']['has'](_0x296b2d)){const _0x59c556=this['_bufferedUpdates']['get'](_0x296b2d);_0x3ab2db=_0x31e58d?{..._0x59c556,..._0x3ab2db}:{..._0x3ab2db,..._0x59c556};}this['_bufferedUpdates']['set'](_0x296b2d,_0x3ab2db);}setRevisionData(_0x4ee52d){const _0x314549=this['repository']['getRevision'](_0x4ee52d['id']);if(_0x4ee52d['createdAt']&&(_0x4ee52d['createdAt']=new Date(_0x4ee52d['createdAt'])),_0x4ee52d['authorsIds']){const _0x15c39f=this['editor']['plugins']['get']('Users');_0x4ee52d['authors']=_0x4ee52d['authorsIds']['map'](_0x1e8cee=>_0x15c39f['getUser'](_0x1e8cee));}_0x314549['_update'](_0x4ee52d,!0x0);}_createInitialRevision(_0x3c7444){const _0x1ce9a5=this['repository']['getRevision'](this['repository']['length']-0x1);if(_0x1ce9a5)this['_initialRevisionId']=_0x1ce9a5['id'];else{const _0x2502c5=!this['editor']['model']['document']['roots']['find'](_0xb61945=>this['editor']['model']['hasContent'](_0xb61945)),_0x377bac=this['editor']['plugins']['get']('Users')['me']['id'],_0x59c959=kt(this['editor']['locale'],_0x2502c5?'Empty\x20document':'Initial\x20revision');this['_makeRevision']({'from':_0x3c7444,'to':_0x3c7444,'id':this['_initialRevisionId'],'name':_0x59c959,'creatorId':_0x377bac});}}_createCurrentRevision(_0x11eca1){const _0x4d87b1=this['_source']['getCurrentRevisionId']();this['currentRevision']=this['repository']['getRevision'](_0x4d87b1),this['currentRevision']||(this['currentRevision']=this['_makeRevision']({'from':_0x11eca1,'to':_0x11eca1,'id':_0x4d87b1,'name':'','creatorId':null}));}async _loadState(){this['_continueCurrentRevision']&&!this['_loadedStateData']&&(await this['_utils']['loadRevisionData'](this['currentRevision'],this['adapter']),this['_revisionDataBuilder']['loadState'](this['currentRevision']),this['_loadedStateData']={'fromVersion':this['currentRevision']['fromVersion'],'authors':this['currentRevision']['authors']['slice']()});}_replaceEditorDataWithRevisionData(_0xd7ed59,_0x3b297b,_0x149299){const _0x5072eb={},_0x5c3215={},_0x1075f0={},_0x4cbf69=this['editor']['config']['get']('roots')||{};for(const [_0x2ab1f2,_0x208fc5]of Object['entries'](_0x4cbf69))_0x208fc5['lazyLoad']||(_0x5072eb[_0x2ab1f2]=_0x208fc5['initialData']??'',_0x5c3215[_0x2ab1f2]=_0x208fc5['modelAttributes']||{},_0x208fc5['modelElement']&&(_0x1075f0[_0x2ab1f2]=_0x208fc5['modelElement']));for(const _0x149e08 of this['editor']['model']['document']['getRootNames']())_0x5072eb[_0x149e08]??='',_0x5c3215[_0x149e08]??={};let _0x59fe5f=!0x1;const _0x45eed2=Object['keys'](_0x5072eb),_0x5e461e=Object['keys'](_0xd7ed59);for(const _0x3be730 of _0x45eed2){if(_0x5072eb[_0x3be730]!==_0xd7ed59[_0x3be730]&&''!==_0x5072eb[_0x3be730]['trim']()){_0x59fe5f=!0x0;break;}if(!_0x5031a7(_0x5c3215[_0x3be730],_0x3b297b[_0x3be730])&&Object['keys'](_0x5c3215[_0x3be730])['length']>0x0){_0x59fe5f=!0x0;break;}const _0x7bcbf6=_0x1075f0[_0x3be730],_0xc6eb01=_0x149299[_0x3be730];if(_0x7bcbf6&&_0xc6eb01&&_0x7bcbf6!==_0xc6eb01){_0x59fe5f=!0x0;break;}}_0x59fe5f||(_0x59fe5f=_0x5e461e['some'](_0x546eaf=>!this['editor']['model']['document']['getRoot'](_0x546eaf))),_0x59fe5f&&_0x84622c('editor-initial-data-replaced-with-revision-data',{'editorData':_0x5072eb,'editorRootsAttributes':_0x5c3215,'editorRootsModelElements':_0x1075f0,'revisionData':_0xd7ed59,'revisionRootsAttributes':_0x3b297b,'revisionRootsModelElements':_0x149299});for(const [_0x33ff64,_0x1e444b]of Object['entries'](_0xd7ed59))this['editor']['config']['set']('roots.'+_0x33ff64+'.initialData',_0x1e444b);for(const [_0xcd4af7,_0x2e5033]of Object['entries'](_0x3b297b))this['editor']['config']['set']('roots.'+_0xcd4af7+'.modelAttributes',_0x2e5033);const _0x1e5f6a=this['editor']['model']['document'];for(const [_0x2008b7,_0x256a75]of Object['entries'](_0x149299)){this['editor']['config']['set']('roots.'+_0x2008b7+'.modelElement',_0x256a75);const _0x2c768b=_0x1e5f6a['getRoot'](_0x2008b7);_0x2c768b&&_0x2c768b['name']!==_0x256a75&&(_0x1e5f6a['roots']['remove'](_0x2008b7),_0x1e5f6a['createRoot'](_0x256a75,_0x2008b7));}}_addPendingAction(){if(!this['_pendingAction']){const _0x474a05=this['editor']['plugins']['get']('PendingActions');this['_pendingAction']=_0x474a05['add'](kt(this['editor']['locale'],'PENDING_ACTION_REVISION_HISTORY'));}}_removePendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get']('PendingActions')['remove'](this['_pendingAction']),this['_pendingAction']=null);}_findInsertionIndex(_0x1ee55c){const _0x41e10a=this['repository']['getRevisions']();_0x41e10a['reverse']();let _0x5513f=0x0;for(;_0x5513f<_0x41e10a['length'];){const _0x2faa9c=_0x41e10a[_0x5513f];if(_0x2faa9c===this['currentRevision']){_0x5513f++;continue;}if(_0x2faa9c['id']===this['_initialRevisionId'])break;const _0x43a021=_0x1ee55c['toVersion']-_0x2faa9c['toVersion']||_0x1ee55c['fromVersion']-_0x2faa9c['fromVersion'];if(_0x43a021>0x0)break;if(_0x43a021<0x0)_0x5513f++;else{if(!_0x1ee55c['creator']&&_0x2faa9c['creator'])break;if(_0x2faa9c['creator']||!_0x1ee55c['creator']){if(_0x1ee55c['createdAt']>_0x2faa9c['createdAt'])break;_0x5513f++;}else _0x5513f++;}}return _0x5513f;}_getFromVersion(_0x1fdd0e){const _0x6f9f27=this['repository']['getRevisions']();_0x6f9f27['reverse'](),_0x6f9f27['shift']();const _0x2fdf33=_0x6f9f27['find'](_0xf6bd=>_0xf6bd['toVersion']<=_0x1fdd0e)['toVersion'];return _0x2fdf33<this['_startingVersion']?this['_startingVersion']:_0x2fdf33;}['_makeRevision']({name:_0x4182cc,from:_0x1babad,to:_0x3a9f26,creatorId:_0x29eb02,id:_0x11f4d0}){const _0x4bc906=this['buildRevisionData']({'from':_0x1babad,'to':_0x3a9f26});_0x4bc906['name']=_0x4182cc,_0x4bc906['creatorId']=_0x29eb02,_0x4bc906['id']=_0x11f4d0;const _0x454563=this['addRevisionData'](_0x4bc906);return this['adapter']&&this['_bufferUpdate'](_0x4bc906['id'],_0x4bc906,!0x0),_0x454563;}_setConversion(){this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'});}},It=class{editor;['source'];_savedMetaData;_lastFrom;_lastTo;['_markers'];_diffRoots;_diffRootsAttributes;_baseRoots;_baseRootsAttributes;_idsRoots;_baseIdsRoots;_touched;_touchedMarkers;['_aiTouchedMarkers'];_touchedRoots;['_revisionId'];_startingRevisionId;constructor(_0x3fd371){this['editor']=_0x3fd371,this['_savedMetaData']=new Map(),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_markers']=new Map(),this['_diffRoots']=new Map(),this['_diffRootsAttributes']=new Map(),this['_baseRoots']=new Map(),this['_baseRootsAttributes']=new Map(),this['_idsRoots']=new Map(),this['_baseIdsRoots']=new Map(),this['_touched']=new Map(),this['_touchedMarkers']=new Map(),this['_aiTouchedMarkers']=new Map(),this['_touchedRoots']=new Map(),this['_revisionId']=0x1;}init(_0x30b41c){this['source']=_0x30b41c;const _0x410509=new Map(),_0x3c2f55=new Map(),_0x1adb2c=this['editor']['model']['document']['roots']['map'](_0x4b28bf=>_0x4b28bf['rootName']);for(const _0x12a4cc of _0x1adb2c){const _0x2c4cc5=this['editor']['model']['document']['getRoot'](_0x12a4cc),_0x602d5f=St(_0x2c4cc5);_0x410509['set'](_0x12a4cc,_0x602d5f),_0x3c2f55['set'](_0x12a4cc,Object['fromEntries'](_0x2c4cc5['getAttributes']()));}const _0x227aeb=Array['from'](this['editor']['model']['markers'])['map'](_0x29d439=>[_0x29d439['name'],_0x29d439['getRange']()]),_0x928fee=this['source']['version'];this['_saveMetaData'](_0x928fee,_0x410509,_0x227aeb,_0x3c2f55),this['_startingRevisionId']=this['_revisionId'];const _0x38080e=new Map(),_0xd726ef=new Map();for(const _0x237712 of _0x1adb2c){const _0x4a2f68=Et(_0x237712,this['editor']['model']['document']['getRoot'](_0x237712)['name']);_0x38080e['set'](_0x237712,_0x4a2f68),_0xd726ef['set'](_0x237712,{});}this['_saveMetaData'](Number['NEGATIVE_INFINITY'],_0x38080e,[],_0xd726ef);}getData(_0x7188af,_0x116b93){if(this['_lastFrom']===_0x7188af&&this['_lastTo']<=_0x116b93)this['_savedMetaData']['size']>0x1&&this['_removeMetaData'](this['_lastTo']),this['_applyOperations'](this['_lastTo'],_0x116b93,!0x0);else{if(!this['_savedMetaData']['has'](_0x7188af)){const _0x10a9ad=this['_getPreviousFrom'](_0x7188af);this['_calculateMetaData'](_0x10a9ad,_0x7188af,!0x1);}this['_calculateMetaData'](_0x7188af,_0x116b93,!0x0);}return this['_lastFrom']=_0x7188af,this['_lastTo']=_0x116b93,this['_getState']();}loadState(_0xa9bde1){if(!this['_savedMetaData']['has'](_0xa9bde1['fromVersion'])){const _0x4893f6=this['_getPreviousFrom'](_0xa9bde1['fromVersion']);this['_calculateMetaData'](_0x4893f6,_0xa9bde1['fromVersion'],!0x1);}this['_calculateMetaData'](_0xa9bde1['fromVersion'],_0xa9bde1['toVersion'],!0x1);const _0x294357=this['editor']['plugins']['get']('RevisionHistoryUtils');this['_reset'](),this['_lastFrom']=_0xa9bde1['fromVersion'],this['_lastTo']=_0xa9bde1['toVersion'];for(const _0x2081a4 in _0xa9bde1['diffData']){const _0xfbd409=_0xa9bde1['diffData'][_0x2081a4]['attachChange'],_0x115af2=_0x5bf201(_0xa9bde1['diffData'][_0x2081a4]['attributesBefore'])||{},_0x11f2d9=_0xa9bde1['diffData'][_0x2081a4],_0x5f15c1=_0x294357['_makeModelFromViewString'](_0x11f2d9['deletions'],_0x11f2d9['rootElementName']||'$root');_0x5f15c1['rootName']=_0x2081a4,_0x5f15c1['_isAttached']=!_0xfbd409||!_0xfbd409['isAttached'],_0x5f15c1['isAttached']=()=>_0x5f15c1['_isAttached'],this['_baseRoots']['set'](_0x2081a4,_0x5f15c1),this['_baseRootsAttributes']['set'](_0x2081a4,_0x115af2),_0xfbd409&&this['_touchedRoots']['set'](_0x2081a4,_0xfbd409);const _0xb0e296=this['_makeIdsRoot'](_0x5f15c1);this['_baseIdsRoots']['set'](_0x2081a4,_0xb0e296);for(const [_0x348130,_0x5b0f62]of _0x5f15c1['markers']){if(!_0x348130['startsWith']('revision:'))continue;const _0x31c4d6=_0x348130['split'](':')[0x2],_0xe74cf=_0x11f2d9['aiSources']?.[_0x348130]||null;for(const _0xedcc1c of _0x5b0f62['getWalker']({'singleCharacters':!0x0})){const _0x419588=this['_getVidAttributeName'](_0xedcc1c),_0x55308c='elementEnd'==_0xedcc1c['type']?_0xedcc1c['previousPosition']['path']['slice'](0x0,-0x1):_0xedcc1c['previousPosition']['path'],_0x5b695b=_0xb0e296['getNodeByPath'](_0x55308c)['getAttribute'](_0x419588);this['_touched']['set'](_0x5b695b,{'userId':_0x31c4d6,'aiSource':_0xe74cf});}_0x5f15c1['markers']['delete'](_0x348130);}}this['_startingRevisionId']=this['_revisionId'];const _0x14c2b3=[...Array(this['_revisionId'])['keys']()]['slice'](0x1)['filter'](_0x4dbdf3=>!this['_touched']['has'](_0x4dbdf3));let _0x98d4d8=0x0;const _0x5403fc=new Map();for(const _0x20ccec in _0xa9bde1['diffData']){const _0x2b2d10=_0xa9bde1['diffData'][_0x20ccec]['attachChange'],_0x4310f5=_0x5bf201(_0xa9bde1['diffData'][_0x20ccec]['attributesAfter'])||{},_0x21d35b=_0xa9bde1['diffData'][_0x20ccec],_0x6631bc=_0x294357['_makeModelFromViewString'](_0x21d35b['insertions'],_0x21d35b['rootElementName']||'$root');_0x6631bc['rootName']=_0x20ccec,_0x6631bc['_isAttached']=!_0x2b2d10||_0x2b2d10['isAttached'],_0x6631bc['isAttached']=()=>_0x6631bc['_isAttached'],this['_diffRoots']['set'](_0x20ccec,_0x6631bc),this['_diffRootsAttributes']['set'](_0x20ccec,_0x4310f5);const _0x37195f=this['_makeIdsRoot'](_0x6631bc,Number['NEGATIVE_INFINITY']);this['_idsRoots']['set'](_0x20ccec,_0x37195f),_0x5403fc['set'](_0x20ccec,_0x6631bc['isAttached']()?_0x4310f5:{});for(const [_0x835be5,_0xe10dfd]of _0x6631bc['markers']){if(!_0x835be5['startsWith']('revision:'))continue;const _0x3dc0f2=_0x835be5['split'](':')[0x2],_0x12e4ef=_0x21d35b['aiSources']?.[_0x835be5]||null;for(const _0x2665f9 of _0xe10dfd['getWalker']({'singleCharacters':!0x0})){const _0x39146b=this['_getVidAttributeName'](_0x2665f9),_0x36c43e=this['_revisionId']++,_0x19f4ef='elementEnd'==_0x2665f9['type']?_0x2665f9['previousPosition']['path']['slice'](0x0,-0x1):_0x2665f9['previousPosition']['path'];_0x37195f['getNodeByPath'](_0x19f4ef)['_setAttribute'](_0x39146b,_0x36c43e),this['_touched']['set'](_0x36c43e,{'userId':_0x3dc0f2,'aiSource':_0x12e4ef});}_0x6631bc['markers']['delete'](_0x835be5);}for(const _0x27a43d of this['editor']['model']['createRangeIn'](_0x6631bc)['getWalker']({'singleCharacters':!0x0})){const _0xd71567=this['_getVidAttributeName'](_0x27a43d),_0x299f62='elementEnd'==_0x27a43d['type']?_0x27a43d['previousPosition']['path']['slice'](0x0,-0x1):_0x27a43d['previousPosition']['path'],_0xa546cd=_0x37195f['getNodeByPath'](_0x299f62);_0xa546cd['getAttribute'](_0xd71567)>0x0||_0xa546cd['_setAttribute'](_0xd71567,_0x14c2b3[_0x98d4d8++]);}for(const [_0x9b1219,_0x3c028c]of _0x6631bc['markers'])_0x9b1219['startsWith']('revision:')||this['_markers']['set'](_0x9b1219,_0x3c028c);}const {roots:_0x5910b6}=this['_savedMetaData']['get'](_0xa9bde1['fromVersion']),{roots:_0x481f17}=this['_savedMetaData']['get'](_0xa9bde1['toVersion']),_0x6cebfe=St(_0x5910b6['get']('$graveyard'));this['_baseRoots']['set']('$graveyard',_0x6cebfe),this['_baseIdsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x6cebfe,Number['NEGATIVE_INFINITY']));const _0x56aab9=St(_0x481f17['get']('$graveyard'));this['_diffRoots']['set']('$graveyard',_0x56aab9),this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x56aab9));const _0x302288=Array['from'](this['_diffRoots'])['map'](([_0x3ee9b1,_0x2779ba])=>[_0x3ee9b1,St(_0x2779ba)]);this['_saveMetaData'](this['_lastTo'],_0x302288,this['_markers'],_0x5403fc);}reInit(){this['_reset'](),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_savedMetaData']['clear'](),this['init'](this['source']);}_saveMetaData(_0xd363dd,_0x4d765d,_0x260176,_0xc56fed){const _0x25dd59=new Map(_0x4d765d),_0xf6c359=new Map(_0x5bf201(_0xc56fed)),_0x4fbb46=new Map();for(const [_0x46fad4,_0x994c6a]of _0x260176)_0x4fbb46['set'](_0x46fad4,{'start':_0x994c6a['start']['clone'](),'end':_0x994c6a['end']['clone'](),'rootName':_0x994c6a['root']['rootName']});this['_savedMetaData']['set'](_0xd363dd,{'roots':_0x25dd59,'markers':_0x4fbb46,'rootsAttributes':_0xf6c359});}_removeMetaData(_0x5c6137){this['_savedMetaData']['delete'](_0x5c6137);}_reset(){this['_touched']['clear'](),this['_touchedMarkers']['clear'](),this['_aiTouchedMarkers']['clear'](),this['_touchedRoots']['clear'](),this['_diffRoots']['clear'](),this['_diffRootsAttributes']['clear'](),this['_baseRoots']['clear'](),this['_baseRootsAttributes']['clear'](),this['_idsRoots']['clear'](),this['_baseIdsRoots']['clear'](),this['_markers']['clear'](),this['_revisionId']=0x1,this['_startingRevisionId']=this['_revisionId'];}_makeIdsRoot(_0x26d8df,_0xa8fc1e=null){let _0x3004f7=null;_0x26d8df['is']('documentFragment')||(_0x3004f7=new _0x46fa7e(_0x26d8df['name'],{'vid_start':null===_0xa8fc1e?this['_revisionId']++:_0xa8fc1e++}));const _0x2c5959=[];for(const _0x259e9b of _0x26d8df['getChildren']())if(_0x259e9b['is']('element')){_0x2c5959['push'](this['_makeIdsRoot'](_0x259e9b,_0xa8fc1e));const _0x103b5a=_0x2c5959[_0x2c5959['length']-0x1];null!==_0xa8fc1e&&(_0xa8fc1e=_0x103b5a['is']('element','$text')?_0x103b5a['getAttribute']('vid')+0x1:_0x103b5a['getAttribute']('vid_end')+0x1);}else{for(let _0x3fa241=0x0;_0x3fa241<_0x259e9b['offsetSize'];_0x3fa241++)_0x2c5959['push'](new _0x46fa7e('$text',{'vid':null===_0xa8fc1e?this['_revisionId']++:_0xa8fc1e++}));}if(_0x26d8df['is']('documentFragment')){const _0x4e3d4b=Et(_0x26d8df['rootName'],_0x26d8df['name']);return _0x4e3d4b['_insertChild'](0x0,_0x2c5959),_0x4e3d4b;}return _0x3004f7['_setAttribute']('vid_end',null===_0xa8fc1e?this['_revisionId']++:_0xa8fc1e),_0x3004f7['_insertChild'](0x0,_0x2c5959),_0x3004f7;}_calculateMetaData(_0x27919b,_0x20d748,_0x53f3cc){this['_reset']();const {roots:_0x490050,markers:_0x27b490,rootsAttributes:_0x55f321}=this['_savedMetaData']['get'](_0x27919b);this['_baseRoots']=new Map(_0x490050),this['_baseRootsAttributes']=new Map(_0x5bf201(_0x55f321));for(const [_0x475fe1,_0xa54a1e]of this['_baseRoots'])if('$graveyard'!==_0x475fe1&&(this['_diffRoots']['set'](_0x475fe1,St(_0xa54a1e)),this['_diffRootsAttributes']=new Map(_0x5bf201(_0x55f321)),_0x53f3cc)){const _0x578620=this['_revisionId'];this['_idsRoots']['set'](_0x475fe1,this['_makeIdsRoot'](_0xa54a1e)),this['_baseIdsRoots']['set'](_0x475fe1,this['_makeIdsRoot'](_0xa54a1e,_0x578620));}this['_startingRevisionId']=this['_revisionId'],this['_diffRoots']['set']('$graveyard',St(this['_baseRoots']['get']('$graveyard'))),_0x53f3cc&&this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](this['_baseRoots']['get']('$graveyard')));for(const [_0x597fa4,_0x5419f8]of _0x27b490){const _0x4683fb=this['_baseRoots']['get'](_0x5419f8['rootName']),_0xb74cf1=this['_diffRoots']['get'](_0x5419f8['rootName']),_0x1f3ab5=new _0x54a8d9(_0x31212b(_0x5419f8['start'],_0x4683fb),_0x31212b(_0x5419f8['end'],_0x4683fb)),_0x19bfad=_0x51272d(_0x1f3ab5,_0xb74cf1);_0x4683fb['markers']['set'](_0x597fa4,_0x1f3ab5),this['_markers']['set'](_0x597fa4,_0x19bfad);}this['_applyOperations'](_0x27919b,_0x20d748,_0x53f3cc);}_applyOperations(_0xc68b85,_0x2e5bff,_0xab9969){for(const _0x52dae5 of this['source']['getOperations'](_0xc68b85,_0x2e5bff))this['_handleOperation'](_0x52dae5,_0xab9969);for(const _0x401e50 of this['_diffRoots']['values']())_0x401e50['markers']['clear']();for(const [_0x4e643e,_0x2e3b90]of this['_markers'])this['_diffRoots']['get'](_0x2e3b90['root']['rootName'])['markers']['set'](_0x4e643e,_0x2e3b90['clone']());const _0x1e3264=new Map(),_0x165e14=new Map();for(const [_0x3771e2,_0xb27749]of this['_diffRoots'])_0x1e3264['set'](_0x3771e2,St(_0xb27749)),_0x165e14['set'](_0x3771e2,this['_diffRootsAttributes']['get'](_0x3771e2));this['_saveMetaData'](_0x2e5bff,_0x1e3264,this['_markers'],_0x165e14);}_getPreviousFrom(_0xbbe313){const _0x57be0b=Array['from'](this['_savedMetaData']['keys']());_0x57be0b['sort']((_0x7f3bcb,_0x30d089)=>_0x7f3bcb-_0x30d089),_0x57be0b['reverse']();for(const _0x407572 of _0x57be0b)if(_0x407572<_0xbbe313)return _0x407572;return Number['NEGATIVE_INFINITY'];}['_copyMarkers'](_0x2cf988,_0x3bdb12){const _0x56ac91=Array['from'](_0x3bdb12['markers'])['map'](([_0x3e0038,_0x4f5ac8])=>[_0x3e0038,_0x51272d(_0x4f5ac8,_0x2cf988)]);_0x2cf988['markers']=new Map(_0x56ac91);}_transformMarkers(_0x3b18cf){for(const _0x223fc1 of this['_markers']['values']()){const _0x199bf8=_0x223fc1['getTransformedByOperation'](_0x3b18cf),_0x5088c0=_0x54a8d9['_createFromRanges'](_0x199bf8);_0x223fc1['start']=_0x5088c0['start'],_0x223fc1['end']=_0x5088c0['end'];}}_handleOperation(_0x52605a,_0x3bc4e7){if('addRoot'!=_0x52605a['type']&&'detachRoot'!=_0x52605a['type']){if('insert'==_0x52605a['type']){const _0x45e959=_0x52605a['position']['root'],_0x377710=_0x45e959['rootName'],_0x2a9672=_0x45e959['name'];this['_diffRoots']['has'](_0x377710)||(this['_diffRoots']['set'](_0x377710,Et(_0x377710,_0x2a9672,!0x0)),this['_diffRootsAttributes']['set'](_0x377710,{}),_0x3bc4e7&&this['_idsRoots']['set'](_0x377710,Et(_0x377710,_0x2a9672,!0x0)));}else{if('addRootAttribute'==_0x52605a['type']||'removeRootAttribute'==_0x52605a['type']||'changeRootAttribute'==_0x52605a['type'])return void this['_handleRootAttributeOperation'](_0x52605a);'marker'==_0x52605a['type']&&this['_handleMarkerOperation'](_0x52605a);}if('marker'!==_0x52605a['type']){const _0x5d24ff=this['_cloneOperation'](_0x52605a,this['_diffRoots']);_0x5d24ff['_execute'](),this['_transformMarkers'](_0x5d24ff);}if(_0x3bc4e7)switch(_0x52605a['type']){case'insert':this['_handleInsertOperation'](_0x52605a);break;case'move':case'remove':case'reinsert':this['_handleMoveOperation'](_0x52605a);break;case'merge':this['_handleMergeOperation'](_0x52605a);break;case'split':this['_handleSplitOperation'](_0x52605a);}}else this['_handleRootOperation'](_0x52605a,_0x3bc4e7);}_cloneOperation(_0x1666d0,_0x37aefd){const _0x344e3a=_0x1666d0['clone']();return _0x344e3a['_authorId']=_0x1666d0['_authorId'],_0x344e3a['_aiSource']=_0x1666d0['_aiSource'],_0x344e3a['baseVersion']=null,_0x212e1c(_0x344e3a,_0x37aefd),_0x344e3a;}_getBaseVids(_0x2f96af){return _0x2f96af['map'](_0x5ad6f7=>{const _0x418fa6=this['_getVidAttributeName'](_0x5ad6f7);return Number(_0x5ad6f7['item']['getAttribute'](_0x418fa6));});}_generateTape(_0x31021e,_0x1a40ac){if(_0x31021e['is']('element','$text'))_0x1a40ac['push']({'item':_0x31021e,'type':'text'});else{_0x31021e['is']('element')&&_0x1a40ac['push']({'item':_0x31021e,'type':'elementStart'});for(const _0x13926c of _0x31021e['getChildren']())this['_generateTape'](_0x13926c,_0x1a40ac);_0x31021e['is']('element')&&_0x1a40ac['push']({'item':_0x31021e,'type':'elementEnd'});}return _0x1a40ac;}_getState(){const _0x4393fc=new Map(this['_touched']),_0x3a1a55=new Map(_0x4393fc),_0x3d0ef1=new Map(),_0x2b7322={'insertions':{},'deletions':{}},_0x48b4aa={'insertions':{},'deletions':{}},_0x2b2d8d=new Map(),_0x40243e=new Set([...this['_baseRoots']['keys'](),...this['_diffRoots']['keys']()]),_0x2be758=new Map();_0x40243e['delete']('$graveyard');for(const _0xcc8c64 of _0x40243e){const _0x10648c=(this['_diffRoots']['get'](_0xcc8c64)??this['_baseRoots']['get'](_0xcc8c64))['name'],_0x580c41=this['_diffRoots']['get'](_0xcc8c64)||Et(_0xcc8c64,_0x10648c,!0x1),_0x4581f4=this['_baseRoots']['get'](_0xcc8c64)||Et(_0xcc8c64,_0x10648c,!0x1);_0x580c41['isAttached']()||_0x4581f4['isAttached']()?(_0x2be758['set'](_0xcc8c64,_0x10648c),_0x2b7322['insertions'][_0xcc8c64]=St(_0x580c41),_0x2b7322['deletions'][_0xcc8c64]=St(_0x4581f4),this['_copyMarkers'](_0x2b7322['deletions'][_0xcc8c64],_0x4581f4),this['_copyMarkers'](_0x2b7322['insertions'][_0xcc8c64],_0x580c41),_0x48b4aa['insertions'][_0xcc8c64]=this['_generateTape'](this['_idsRoots']['get'](_0xcc8c64),[]),_0x48b4aa['deletions'][_0xcc8c64]=this['_generateTape'](this['_baseIdsRoots']['get'](_0xcc8c64)||Et(_0xcc8c64,_0x10648c,!0x1),[])):_0x40243e['delete'](_0xcc8c64);}for(const _0x5a7097 of _0x40243e){const _0x38662e=_0x48b4aa['insertions'][_0x5a7097];for(const _0x57ad86 of _0x38662e){const _0x52073f=this['_getVidAttributeName'](_0x57ad86),_0x27835d=_0x57ad86['item']['getAttribute'](_0x52073f);_0x3a1a55['delete'](_0x27835d),_0x27835d>=this['_startingRevisionId']&&_0x3d0ef1['set'](_0x27835d,_0x4393fc['get'](_0x27835d));}}for(const _0x487b02 of _0x40243e){const _0x2980dd=_0x48b4aa['insertions'][_0x487b02],_0x3538a8=this['_getBaseVids'](_0x48b4aa['deletions'][_0x487b02]);let _0x1d55fe=0x0;for(const _0x548022 of _0x2980dd){const _0x5d637a=this['_getVidAttributeName'](_0x548022),_0x1c20d3=_0x548022['item']['getAttribute'](_0x5d637a);if(!_0x3d0ef1['has'](_0x1c20d3)&&!_0x2b2d8d['has'](_0x1c20d3)){if(_0x3a1a55['has'](_0x1c20d3))_0x1d55fe++;else{if(_0x1c20d3!=_0x3538a8[_0x1d55fe]){const _0x42b4c5=_0x4393fc['get'](_0x1c20d3)||_0x4393fc['get'](_0x3538a8[_0x1d55fe]);for(;_0x1c20d3!=_0x3538a8[_0x1d55fe];)_0x3a1a55['has'](_0x3538a8[_0x1d55fe])||(_0x2b2d8d['set'](_0x3538a8[_0x1d55fe],_0x42b4c5),_0x4393fc['set'](_0x3538a8[_0x1d55fe],_0x42b4c5)),_0x1d55fe++;}_0x1d55fe++;}}}}for(const _0x1d4397 of _0x40243e){const _0x134a2c=_0x48b4aa['insertions'][_0x1d4397];for(const _0x496ca9 of _0x134a2c){const _0x27d26f=this['_getVidAttributeName'](_0x496ca9),_0x331996=_0x496ca9['item']['getAttribute'](_0x27d26f);if(_0x2b2d8d['has'](_0x331996)){const _0xfbfea4=_0x2b2d8d['get'](_0x331996);_0x3a1a55['has'](_0x331996)||_0x3a1a55['set'](_0x331996,{..._0xfbfea4}),_0x3d0ef1['set'](_0x331996,{..._0xfbfea4});}}}for(const _0x16e1e4 of _0x3a1a55['keys']())_0x16e1e4>=this['_startingRevisionId']&&_0x3a1a55['delete'](_0x16e1e4);const _0x2d7c78=new Map();for(const _0x123894 of _0x40243e){let _0x1f81a2=_0x48b4aa['insertions'][_0x123894];for(const _0x595897 of _0x1f81a2)if(_0x595897['item']['is']('element','tableCell')){const _0x27849c=this['_getVidAttributeName'](_0x595897),_0x5f143f=_0x595897['item']['getAttribute'](_0x27849c);if(_0x3d0ef1['has'](_0x5f143f)){const _0x5e8825=_0x595897['item']['parent']['parent']['getAttribute']('vid_start'),_0x53a3d5=_0x3d0ef1['get'](_0x5f143f),_0x28ecba=_0x2d7c78['get'](_0x5e8825)||{'users':new Set(),'aiSource':null};_0x28ecba['users']['add'](_0x53a3d5['userId']),_0x28ecba['aiSource']=_0x28ecba['aiSource']||_0x53a3d5['aiSource']||null,_0x2d7c78['set'](_0x5e8825,_0x28ecba);}}_0x1f81a2=_0x48b4aa['deletions'][_0x123894];for(const _0x3a919c of _0x1f81a2)if(_0x3a919c['item']['is']('element','tableCell')){const _0x3974d8=this['_getVidAttributeName'](_0x3a919c),_0x192f61=_0x3a919c['item']['getAttribute'](_0x3974d8);if(_0x3a1a55['has'](_0x192f61)){const _0x5ebe75=_0x3a919c['item']['parent']['parent']['getAttribute']('vid_start'),_0x14f34d=_0x3a1a55['get'](_0x192f61),_0x4e4853=_0x2d7c78['get'](_0x5ebe75)||{'users':new Set(),'aiSource':null};_0x4e4853['users']['add'](_0x14f34d['userId']),_0x4e4853['aiSource']=_0x4e4853['aiSource']||_0x14f34d['aiSource']||null,_0x2d7c78['set'](_0x5ebe75,_0x4e4853);}}for(const _0x2eecd7 of _0x2d7c78['keys']())(_0x3d0ef1['has'](_0x2eecd7)||_0x3a1a55['has'](_0x2eecd7))&&_0x2d7c78['delete'](_0x2eecd7);}for(const _0x3c3395 of _0x40243e){const _0x559207=_0x48b4aa['insertions'][_0x3c3395];let _0x44992d=null,_0x26f358=null,_0x166a12=null;for(const _0x5ca9af of _0x559207){const _0x74ac0d=this['_getVidAttributeName'](_0x5ca9af),_0x38d645=_0x5ca9af['item']['getAttribute'](_0x74ac0d),_0x432f80=_0x2d7c78['get'](_0x38d645);if(_0x432f80&&'elementStart'==_0x5ca9af['type']&&(_0x44992d=Array['from'](_0x432f80['users'])[0x0],_0x26f358=_0x432f80['aiSource'],_0x166a12=_0x5ca9af['item']['getAttribute']('vid_end')),_0x44992d){const _0x156278=_0x26f358||_0x3a1a55['get'](_0x38d645)?.['aiSource']||null,_0x38b533=_0x26f358||_0x3d0ef1['get'](_0x38d645)?.['aiSource']||null;_0x3a1a55['set'](_0x38d645,{'userId':_0x44992d,'aiSource':_0x156278}),_0x3d0ef1['set'](_0x38d645,{'userId':_0x44992d,'aiSource':_0x38b533});}_0x38d645==_0x166a12&&(_0x44992d=null,_0x166a12=null);}}const _0x14a6cb={},_0x5ec392=new Set();for(const _0x1fe207 of _0x40243e){const _0x7b00d4=_0x2b7322['deletions'][_0x1fe207],_0x42dc31=_0x2b7322['insertions'][_0x1fe207];for(const {userId:_0x434076}of this['_touchedMarkers']['values']())null!==_0x434076&&_0x5ec392['add'](_0x434076);for(const {userId:_0x103e28}of this['_touchedRoots']['values']())null!==_0x103e28&&_0x5ec392['add'](_0x103e28);const _0x49cad4={};this['_markChanges'](_0x42dc31,_0x48b4aa['insertions'][_0x1fe207],_0x3d0ef1,'insertion',_0x5ec392,_0x49cad4),this['_markChanges'](_0x7b00d4,_0x48b4aa['deletions'][_0x1fe207],_0x3a1a55,'deletion',_0x5ec392,_0x49cad4),this['_collectSuggestionAiSources'](_0x42dc31,_0x49cad4),this['_collectSuggestionAiSources'](_0x7b00d4,_0x49cad4),_0x14a6cb[_0x1fe207]={'insertions':this['_prepareViewToSave'](_0x42dc31),'deletions':this['_prepareViewToSave'](_0x7b00d4),'attachChange':this['_touchedRoots']['get'](_0x1fe207)||null,'attributesBefore':_0x5bf201(this['_baseRootsAttributes']['get'](_0x1fe207))||{},'attributesAfter':_0x5bf201(this['_diffRootsAttributes']['get'](_0x1fe207)),'rootElementName':_0x2be758['get'](_0x1fe207),'aiSources':_0x49cad4};}const _0x4d0f92=Array['from'](_0x3d0ef1['values']())['some'](_0x5a206c=>!(!_0x5a206c||!_0x5a206c['aiSource']))||Array['from'](_0x3a1a55['values']())['some'](_0x2f7f97=>!(!_0x2f7f97||!_0x2f7f97['aiSource']))||Array['from'](this['_touchedMarkers']['keys']())['some'](_0x41866f=>this['_aiTouchedMarkers']['has'](_0x41866f));return{'diffData':_0x14a6cb,'authorsIds':Array['from'](_0x5ec392),'hasAIChanges':_0x4d0f92};}_collectSuggestionAiSources(_0xe1e93c,_0x1e10de){const _0x175f70=_0xe1e93c['markers'];for(const _0x3943fb of _0x175f70['keys']()){if(!_0x3943fb['startsWith']('suggestion:'))continue;if(!this['_touchedMarkers']['has'](_0x3943fb))continue;const _0x5ac1e5=this['_aiTouchedMarkers']['get'](_0x3943fb);_0x5ac1e5&&(_0x1e10de[_0x3943fb]=_0x5ac1e5);}}_processRootBeforeSave(_0x3ecc83){for(const [,_0x4bc06e]of _0x3ecc83['markers']){const _0x387561=_0x4bc06e['start']['getAncestors']()['filter'](_0x4e37b8=>'tableCell'==_0x4e37b8['name']);for(const _0x5df788 of _0x387561)0x1==_0x5df788['childCount']&&_0x5df788['getChild'](0x0)['is']('element','paragraph')&&_0x5df788['getChild'](0x0)['_setAttribute']('keepParagraph',!0x0);}}['_prepareViewToSave'](_0x4cb0f7){this['_processRootBeforeSave'](_0x4cb0f7);const _0x3580a6=this['editor']['data']['toView'](_0x4cb0f7,{}),_0x513e1e=Array['from'](_0x3580a6['getChildren']())['map'](_0x57dece=>this['_getViewJson'](_0x57dece));return JSON['stringify'](_0x513e1e);}_getViewJson(_0x570c20){if(_0x570c20['is']('$text'))return _0x570c20['data'];{const _0x5713d1=this['editor']['plugins']['get']('RevisionHistoryUtils'),_0x15f5af=_0x570c20,_0x15f84d=this['editor']['data']['htmlProcessor']['domConverter'],_0x2b6359={'type':_0x5713d1['_getTypeCharForViewElement'](_0x15f5af),'name':_0x15f5af['name'],'attributes':Array['from'](_0x15f5af['getAttributes']()),'children':Array['from'](_0x15f5af['getChildren']())['map'](_0x4d4af1=>this['_getViewJson'](_0x4d4af1))};if(_0x570c20['is']('uiElement')&&'$comment'!=_0x570c20['name']){const _0x47fdde=_0x570c20['render'](_0x15f84d['domDocument'],_0x15f84d);_0x2b6359['children']['push'](_0x47fdde['outerHTML']);}else{if(_0x570c20['is']('rawElement')){const _0x169d98=_0x15f84d['domDocument']['createElement'](_0x15f5af['name']);_0x570c20['render'](_0x169d98,_0x15f84d),_0x2b6359['children']['push'](_0x169d98['innerHTML']);}}const _0x3d4896=Array['from'](_0x15f5af['getCustomProperties']());_0x3d4896['length']>0x0&&(_0x2b6359['customProperties']=_0x3d4896);const _0x3e5409=_0x15f5af['getFillerOffset']();return null!==_0x3e5409&&(_0x2b6359['fillerOffset']=_0x3e5409),_0x2b6359;}}['_markChanges'](_0x481063,_0x4b9c2f,_0x135b9c,_0x59f9ad,_0x33e581,_0x30cfec){let _0x5d060a=null,_0x11abea=null,_0x4f6928=0x0;const _0x4628ca=this['editor']['model'];for(let _0x58eba2=0x0;_0x58eba2<_0x4b9c2f['length'];_0x58eba2++){const _0x60f2db=this['_getVidAttributeName'](_0x4b9c2f[_0x58eba2]),_0x57aa44=_0x4b9c2f[_0x58eba2]['item']['getAttribute'](_0x60f2db),_0x5e9ca5=_0x135b9c['get'](_0x57aa44),_0x2eb1bd=_0x58eba2==_0x4b9c2f['length']-0x1;!_0x5d060a&&_0x5e9ca5&&(_0x5d060a=_0x5e9ca5,_0x11abea=_0x4b9c2f[_0x58eba2]);const _0x39d633=!!_0x5d060a&&!!_0x5e9ca5&&_0x5e9ca5['userId']!=_0x5d060a['userId'],_0x2be0a6=!!_0x5d060a&&!!_0x5e9ca5&&_0x5e9ca5['aiSource']!=_0x5d060a['aiSource'];_0x5d060a&&(!_0x5e9ca5||_0x39d633||_0x2be0a6)&&(_0x1f4f6c(_0x5e9ca5,Ot(_0x11abea,_0x481063,_0x4628ca),Ot(_0x4b9c2f[_0x58eba2],_0x481063,_0x4628ca)),_0x5d060a=_0x5e9ca5||null,_0x11abea=_0x5e9ca5?_0x4b9c2f[_0x58eba2]:null),_0x5d060a&&_0x2eb1bd&&_0x1f4f6c(_0x5e9ca5,Ot(_0x11abea,_0x481063,_0x4628ca),Ct(_0x4b9c2f[_0x58eba2],_0x481063,_0x4628ca));}function _0x1f4f6c(_0x36e825,_0x23b401,_0x21dec8){const _0x25902d=_0x5d060a['userId'],_0x4bf51d=_0x5d060a['aiSource'],_0x34f034='revision:'+_0x59f9ad+':'+_0x25902d+':'+_0x4f6928++,_0x253915=_0x4628ca['createRange'](_0x23b401,_0x21dec8);_0x481063['markers']['set'](_0x34f034,_0x253915),_0x4bf51d&&(_0x30cfec[_0x34f034]=_0x4bf51d),null!==_0x25902d&&_0x33e581['add'](_0x25902d);}}_getVidAttributeName(_0x21a457){switch(_0x21a457['type']){case'elementStart':return'vid_start';case'elementEnd':return'vid_end';default:return'vid';}}_handleInsertOperation(_0x3a8f43){const _0x359a9c=this['_idsRoots']['get'](_0x3a8f43['position']['root']['rootName']),_0x36e249=_0x31212b(_0x3a8f43['position'],_0x359a9c),_0x195c7c=null===_0x3a8f43['_authorId']?null:_0x3a8f43['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x42a6ce=_0x3a8f43['_aiSource']||null,_0x1d9e9b=_0x36e249['parent'],_0x2ebad2=this['_revisionId'],_0xe3f7ce=[];for(const _0x4674e9 of _0x3a8f43['nodes'])if(_0x4674e9['is']('element'))_0xe3f7ce['push'](this['_makeIdsRoot'](_0x4674e9));else{for(let _0x2bf4ad=0x0;_0x2bf4ad<_0x4674e9['offsetSize'];_0x2bf4ad++)_0xe3f7ce['push'](new _0x46fa7e('$text',{'vid':this['_revisionId']++}));}const _0x37e4c9=this['_revisionId'];for(let _0x26449f=_0x2ebad2;_0x26449f<_0x37e4c9;_0x26449f++)this['_touched']['set'](_0x26449f,{'userId':_0x195c7c,'aiSource':_0x42a6ce});_0x1d9e9b['_insertChild'](_0x36e249['offset'],_0xe3f7ce);}_setTouched(_0x5597c0,_0x523389,_0x847c95){this['_touched']['set'](_0x5597c0,{'userId':_0x523389,'aiSource':_0x847c95||this['_touched']['get'](_0x5597c0)?.['aiSource']||null});}_handleMoveOperation(_0x544eac){(_0x544eac=this['_cloneOperation'](_0x544eac,this['_idsRoots']))['_execute']();const _0x4a46e4=null===_0x544eac['_authorId']?null:_0x544eac['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x915a9d=_0x544eac['_aiSource']||null,_0x2d86a1=_0x544eac['getMovedRangeStart'](),_0x517e29=_0x2d86a1['parent'],_0x1098ab=_0x2d86a1['offset'],_0x5bb0ff=(_0x4270aa,_0x3248ad,_0x361378)=>{for(let _0x352fc1=_0x3248ad;_0x352fc1<_0x361378;_0x352fc1++){const _0x43cb6d=_0x4270aa['getChild'](_0x352fc1);_0x43cb6d['is']('element','$text')?this['_setTouched'](_0x43cb6d['getAttribute']('vid'),_0x4a46e4,_0x915a9d):(this['_setTouched'](_0x43cb6d['getAttribute']('vid_start'),_0x4a46e4,_0x915a9d),_0x5bb0ff(_0x43cb6d,0x0,_0x43cb6d['childCount']),this['_setTouched'](_0x43cb6d['getAttribute']('vid_end'),_0x4a46e4,_0x915a9d));}};_0x5bb0ff(_0x517e29,_0x1098ab,_0x1098ab+_0x544eac['howMany']);}_handleMergeOperation(_0x4f029a){const _0x186415=null===(_0x4f029a=this['_cloneOperation'](_0x4f029a,this['_idsRoots']))['_authorId']?null:_0x4f029a['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x26209b=_0x4f029a['_aiSource']||null,_0x4ad78a=_0x4f029a['targetPosition']['parent'],_0x5200bc=_0x4f029a['sourcePosition']['parent'],_0x5e840e=_0x4ad78a['getAttribute']('vid_end'),_0x4e08ea=_0x5200bc['getAttribute']('vid_start');_0x4ad78a['_setAttribute']('vid_end',_0x5200bc['getAttribute']('vid_end')),_0x5200bc['_setAttribute']('vid_end',_0x5e840e),this['_setTouched'](_0x4e08ea,_0x186415,_0x26209b),this['_setTouched'](_0x5e840e,_0x186415,_0x26209b),_0x4f029a['_execute']();}_handleSplitOperation(_0x12ccb2){const _0x10531d=null===(_0x12ccb2=this['_cloneOperation'](_0x12ccb2,this['_idsRoots']))['_authorId']?null:_0x12ccb2['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x19a14e=_0x12ccb2['_aiSource']||null,_0x525a1c=_0x12ccb2['graveyardPosition'],_0xcd9269=_0x12ccb2['splitPosition']['parent'];_0x12ccb2['_execute']();const _0x4eb6fb=_0xcd9269['getAttribute']('vid_end'),_0x4fcf4e=_0x12ccb2['insertionPosition']['nodeAfter'];if(_0x525a1c){const _0x1e86db=_0x4fcf4e['getAttribute']('vid_end'),_0x4286eb=_0xcd9269['getAttribute']('vid_end');_0xcd9269['_setAttribute']('vid_end',_0x1e86db),_0x4fcf4e['_setAttribute']('vid_end',_0x4286eb),this['_setTouched'](_0xcd9269['getAttribute']('vid_end'),_0x10531d,_0x19a14e),this['_setTouched'](_0x4fcf4e['getAttribute']('vid_start'),_0x10531d,_0x19a14e);}else{const _0x5990ee=this['_revisionId']++,_0x421ea4=this['_revisionId']++;_0xcd9269['_setAttribute']('vid_end',_0x5990ee),_0x4fcf4e['_setAttribute']('vid_start',_0x421ea4),_0x4fcf4e['_setAttribute']('vid_end',_0x4eb6fb),this['_setTouched'](_0x5990ee,_0x10531d,_0x19a14e),this['_setTouched'](_0x421ea4,_0x10531d,_0x19a14e);}}_handleMarkerOperation(_0x50c49e){if(!_0x50c49e['affectsData'])return;const _0x40b7b8=(_0x50c49e=this['_cloneOperation'](_0x50c49e,this['_diffRoots']))['oldRange']?_0x50c49e['oldRange']['root']:null,_0x2648dc=_0x50c49e['newRange']?_0x50c49e['newRange']['root']:null;_0x40b7b8&&this['_markers']['delete'](_0x50c49e['name']),_0x2648dc&&this['_markers']['set'](_0x50c49e['name'],_0x50c49e['newRange']['clone']());const _0x3bfa03=null===_0x50c49e['_authorId']?null:_0x50c49e['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x446fbf=_0x50c49e['name'];if(_0x50c49e['_aiSource']&&this['_aiTouchedMarkers']['set'](_0x446fbf,_0x50c49e['_aiSource']),!this['_touchedMarkers']['has'](_0x446fbf))return void this['_touchedMarkers']['set'](_0x446fbf,{'range':_0x50c49e['oldRange'],'userId':_0x3bfa03});const _0x24c3a0=this['_touchedMarkers']['get'](_0x446fbf),_0x16d237=_0x24c3a0['range'],_0x1c9f74=_0x50c49e['newRange'];null==_0x16d237&&null==_0x1c9f74||_0x16d237&&_0x1c9f74&&_0x16d237['isEqual'](_0x1c9f74)?this['_touchedMarkers']['delete'](_0x50c49e['name']):_0x24c3a0['userId']=_0x3bfa03;}_handleRootOperation(_0x738eca,_0x4c409d){this['_diffRoots']['has'](_0x738eca['rootName'])?this['_diffRoots']['get'](_0x738eca['rootName'])['_isAttached']=_0x738eca['isAdd']:(this['_diffRoots']['set'](_0x738eca['rootName'],Et(_0x738eca['rootName'],_0x738eca['elementName'],!0x0)),this['_diffRootsAttributes']['set'](_0x738eca['rootName'],{}),_0x4c409d&&this['_idsRoots']['set'](_0x738eca['rootName'],Et(_0x738eca['rootName'],_0x738eca['elementName'],!0x0)));const _0x35afcb=null===_0x738eca['_authorId']?null:_0x738eca['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x521e58=this['_touchedRoots']['get'](_0x738eca['rootName']);_0x521e58&&_0x521e58['userId']===_0x35afcb?this['_touchedRoots']['delete'](_0x738eca['rootName']):this['_touchedRoots']['set'](_0x738eca['rootName'],{'userId':_0x35afcb,'isAttached':_0x738eca['isAdd']});}_handleRootAttributeOperation(_0x308e6f){const _0x51b173=this['_diffRootsAttributes']['get'](_0x308e6f['root']['rootName']);null===_0x308e6f['newValue']?delete _0x51b173[_0x308e6f['key']]:_0x51b173[_0x308e6f['key']]=_0x308e6f['newValue'];}};function St(_0x1e671f){const _0x541324=Et(_0x1e671f['rootName'],_0x1e671f['name'],_0x1e671f['isAttached']());for(const _0x4cb1f3 of _0x1e671f['getChildren']()){const _0x142b40=_0x4cb1f3['_clone'](!0x0);_0x541324['_appendChild'](_0x142b40);}return _0x541324;}function Et(_0x43bb99,_0x144745,_0x10956a=!0x0){const _0x152147=new _0x30054f();return _0x152147['rootName']=_0x43bb99,_0x152147['name']=_0x144745,_0x152147['_isAttached']=_0x10956a,_0x152147['isAttached']=()=>_0x152147['_isAttached'],_0x152147;}function Ot(_0x1dbdec,_0x2ff46b,_0x1ced08){const _0x3a1bf6='elementEnd'==_0x1dbdec['type']?_0x1ced08['createPositionAt'](_0x1dbdec['item'],'end'):_0x1ced08['createPositionBefore'](_0x1dbdec['item']);return _0x1ced08['createPositionFromPath'](_0x2ff46b,_0x3a1bf6['path'],_0x3a1bf6['stickiness']);}function Ct(_0x3e846f,_0x26fe10,_0x59f1d8){const _0x3e31bd='elementStart'==_0x3e846f['type']?_0x59f1d8['createPositionAt'](_0x3e846f['item'],0x0):_0x59f1d8['createPositionAfter'](_0x3e846f['item']);return _0x59f1d8['createPositionFromPath'](_0x26fe10,_0x3e31bd['path'],_0x3e31bd['stickiness']);}const Nt=/* #__PURE__ -- @preserve */
25
- _0x1f3631(dt);var xt=class extends Nt{['focusTracker'];keystrokes;revisionNameInputView;constructor(_0x216b88,_0x4f2d32){super(_0x216b88),this['focusTracker']=new _0x52efcd(),this['keystrokes']=new _0x5db944(),this['set']('revisionNameInputValue',''),this['revisionNameInputView']=this['_createRevisionNameInput'](_0x4f2d32),this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-revision-history-save-revision-form','ck-responsive-form'],'tabindex':'-1'},'children':[this['revisionNameInputView']]}),this['initializeCssTransitionDisablerMixin']();}['render'](){super['render'](),_t({'view':this}),this['focusTracker']['add'](this['revisionNameInputView']['element']),this['keystrokes']['listenTo'](this['element']);const _0x1218ba=_0x2316b7=>_0x2316b7['stopPropagation']();this['keystrokes']['set']('arrowright',_0x1218ba),this['keystrokes']['set']('arrowleft',_0x1218ba),this['keystrokes']['set']('arrowup',_0x1218ba),this['keystrokes']['set']('arrowdown',_0x1218ba);}['focus'](){this['revisionNameInputView']['focus']();}get['revisionName'](){return this['revisionNameInputView']['fieldView']['element']['value']['trim']();}set['revisionName'](_0x577277){this['revisionNameInputView']['fieldView']['element']['value']=_0x577277['trim']();}reset(){this['revisionNameInputView']['fieldView']['element']['value']='',this['revisionNameInputView']['errorText']=null;}_createRevisionNameInput(_0x216631){const _0xfcf6e6=new it(this['locale'],gt),_0x2366a5=_0xfcf6e6['fieldView'];_0x2366a5['extendTemplate']({'attributes':{'maxlength':'220'}});let _0x2e271f=kt(this['locale'],'Name\x20of\x20the\x20revision');return!_0x216631&&(_0x2e271f+='\x20('+kt(this['locale'],'optional')+')'),(_0xfcf6e6['label']=_0x2e271f,_0x2366a5['on']('input',()=>{this['revisionNameInputValue']=_0x2366a5['element']['value']['trim']();}),_0xfcf6e6);}},Dt=class extends _0x17a398{static get['pluginName'](){return'RevisionHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[At];}['_saveRevisionFormView'];init(){const _0x574e0d=this['editor'],_0x1862a0=_0x574e0d['plugins']['get']('RevisionTracker');_0x574e0d['ui']['componentFactory']['add']('revisionHistory',_0x56b596=>{const _0x36c747=vt(_0x56b596),_0x44bffd=_0x36c747['panelView']['children'],_0x3c736a=new st(_0x56b596),_0x1a9ed0=new et(_0x56b596),_0x5a188e=this['_createSaveRevisionButton'](_0x1271a8),_0x2c9da6=new et(_0x56b596),_0x498ab3=this['_createOpenRevisionButton'](_0x1271a8);return _0x36c747['bind']('isEnabled')['to'](_0x1862a0,'isReady',_0x1862a0,'isEnabled',_0x574e0d,'isReadOnly',(_0x1c49e2,_0x502553,_0x3aff94)=>_0x1c49e2&&_0x502553&&!_0x3aff94),_0x36c747['buttonView']['set']({'icon':_0x4d32d0,'label':kt(_0x56b596,'Revision\x20history'),'tooltip':!0x0}),_0x5a188e['set']({'withText':!0x0,'role':'menuitem'}),_0x498ab3['set']({'withText':!0x0,'role':'menuitem'}),this['listenTo'](_0x498ab3,'execute',()=>{_0x36c747['isOpen']=!0x1,_0x574e0d['editing']['view']['focus']();},{'priority':'low'}),_0x1a9ed0['children']['add'](_0x5a188e),_0x2c9da6['children']['add'](_0x498ab3),_0x3c736a['role']='menu',_0x3c736a['items']['addMany']([_0x1a9ed0,_0x2c9da6]),_0x44bffd['add'](_0x3c736a),_0x36c747;}),_0x574e0d['ui']['componentFactory']['add']('menuBar:revisionHistory',()=>this['_registerMenuComponent']());}_registerMenuComponent(){const _0x13eb85=this['editor'],_0x104135=_0x13eb85['locale'],_0x32c0b3=_0x13eb85['plugins']['get']('RevisionTracker'),_0x4bc00f=new at(_0x104135),_0x39688a=new rt(_0x104135);_0x4bc00f['bind']('isEnabled')['to'](_0x32c0b3,'isReady',_0x32c0b3,'isEnabled',_0x13eb85,'isReadOnly',(_0x14b20c,_0x47589e,_0x2f3c9d)=>_0x14b20c&&_0x47589e&&!_0x2f3c9d),_0x4bc00f['buttonView']['set']({'icon':_0x4d32d0,'label':kt(_0x104135,'Revision\x20history')});const _0x39df65=new ot(_0x104135,_0x4bc00f),_0x3c0850=this['_createSaveRevisionButton'](nt);_0x3c0850['delegate']('execute')['to'](_0x4bc00f),_0x39df65['children']['add'](_0x3c0850),_0x39688a['items']['add'](_0x39df65);const _0x3bc444=new ot(_0x104135,_0x4bc00f),_0x27dc2d=this['_createOpenRevisionButton'](nt);return _0x27dc2d['delegate']('execute')['to'](_0x4bc00f),_0x3bc444['children']['add'](_0x27dc2d),_0x39688a['items']['add'](_0x3bc444),_0x4bc00f['panelView']['children']['add'](_0x39688a),_0x4bc00f;}_createSaveRevisionButton(_0x101435){const _0x4c32e6=this['editor'],_0x2f09e1=_0x4c32e6['plugins']['get']('RevisionTracker'),_0xfd14db=new _0x101435(_0x4c32e6['locale']);return _0xfd14db['set']({'label':kt(_0x4c32e6['locale'],'Save\x20current\x20revision')}),_0xfd14db['bind']('isEnabled')['to'](_0x2f09e1,'isReady',_0x2f09e1,'isEnabled',_0x4c32e6,'isReadOnly',(_0x515340,_0x1dd070,_0x4b15e6)=>_0x515340&&_0x1dd070&&!_0x4b15e6),this['listenTo'](_0xfd14db,'execute',()=>{this['_showDialog']();}),_0xfd14db;}_createOpenRevisionButton(_0x2f5479){const _0x39f39d=this['editor'],_0x399b15=_0x39f39d['plugins']['get']('RevisionTracker'),_0x3c938b=new _0x2f5479(_0x39f39d['locale']);return _0x3c938b['set']({'label':kt(_0x39f39d['locale'],'Open\x20revision\x20history')}),_0x3c938b['bind']('isEnabled')['to'](_0x399b15,'isReady',_0x39f39d,'isReadOnly',(_0x22ae6b,_0x2194bf)=>_0x22ae6b&&!_0x2194bf),this['listenTo'](_0x3c938b,'execute',()=>{_0x39f39d['config']['get']('revisionHistory')['showRevisionViewerCallback']();}),_0x3c938b;}['_showDialog'](){const _0x3c82a6=this['editor'],_0x41173b=_0x3c82a6['locale'],_0xbdf011=_0x3c82a6['plugins']['get']('Dialog'),_0x23e1e8=_0x3c82a6['plugins']['get']('RevisionTracker');function _0x71954(_0x39b960){_0x3c82a6['config']['get']('revisionHistory.requireRevisionName')&&''===_0x39b960['revisionName']?_0x39b960['revisionNameInputView']['errorText']=kt(_0x41173b,'The\x20revision\x20name\x20cannot\x20be\x20empty.'):(_0x3c82a6['plugins']['get'](At)['saveRevision']({'name':_0x39b960['revisionName']}),_0xbdf011['hide']());}this['_saveRevisionFormView']||(this['_createSaveRevisionFormView'](),this['_saveRevisionFormView']['on']('submit',()=>_0x71954(this['_saveRevisionFormView']))),this['_saveRevisionFormView']['reset'](),_0xbdf011['show']({'id':'revisionSave','title':kt(_0x41173b,'Save\x20current\x20revision'),'isModal':!0x0,'content':this['_saveRevisionFormView'],'actionButtons':[{'label':kt(_0x3c82a6['locale'],'Cancel'),'withText':!0x0,'onExecute':()=>_0xbdf011['hide']()},{'label':kt(_0x3c82a6['locale'],'Accept'),'class':'ck-button-action','withText':!0x0,'onCreate'(_0x5d4c53){_0x5d4c53['bind']('isEnabled')['to'](_0x23e1e8,'isReady',_0x23e1e8,'isEnabled',_0x3c82a6,'isReadOnly',(_0x217d95,_0x319ac5,_0x4667c7)=>_0x217d95&&_0x319ac5&&!_0x4667c7);},'onExecute':()=>_0x71954(this['_saveRevisionFormView'])}]});}_createSaveRevisionFormView(){const _0x4c8aa8=this['editor'],_0x2af1f0=_0x4c8aa8['locale'];this['_saveRevisionFormView']=new xt(_0x2af1f0,_0x4c8aa8['config']['get']('revisionHistory.requireRevisionName')),this['_saveRevisionFormView']['render']();}},Vt=class extends dt{['changeId'];['_model'];constructor(_0x523dd1,_0x58daa6,_0x2a144c=!0x1){super(_0x523dd1),this['_model']=_0x58daa6,this['changeId']=_0x58daa6['id'];const _0x2cfa2a=this['bindTemplate'],_0x40a018=_0x2a144c&&!!_0x58daa6['data']['aiSource'],_0x20c1bf=_0x40a018?this['_createAiIconView'](_0x523dd1):null;this['set']('type',_0x58daa6['type']),this['setTemplate']({'tag':'div','attributes':{'class':['ck-annotation','ck-revision-change',_0x2cfa2a['to']('type',_0x13f6de=>'ck-revision-change__'+_0x13f6de),..._0x40a018?['ck-revision-change_ai']:[]],'tabindex':-0x1},'children':[{'tag':'span','children':_0x40a018?[this['_createAiDescriptionView'](_0x523dd1,_0x58daa6),_0x20c1bf]:this['_getDescriptionChildren'](_0x523dd1,_0x58daa6)}]});}_getDescriptionChildren(_0x237aae,_0x369ec4){let _0x5aa49f='Removed\x20by';return _0x369ec4['data']['isSuggestion']?_0x5aa49f='Suggested\x20by':'add'==_0x369ec4['type']&&(_0x5aa49f='Added\x20by'),[this['_createLabel'](kt(_0x237aae,_0x5aa49f)),{'text':'\x20'+_0x369ec4['author']['name']}];}_createAiDescriptionView(_0x3e34c0,_0x276d1a){let _0x1c846a='AI_SOURCE_REMOVED_BY';_0x276d1a['data']['isSuggestion']?_0x1c846a='AI_SOURCE_SUGGESTED_BY':'add'==_0x276d1a['type']&&(_0x1c846a='AI_SOURCE_ADDED_BY');const _0x20418b=new dt(_0x3e34c0);return _0x20418b['setTemplate']({'tag':'span','attributes':{'class':['ck-revision-change__label']}}),_0x20418b['render'](),_0x20418b['element']['innerHTML']=_0x20e2ae(kt(_0x3e34c0,_0x1c846a,['<span\x20class=\x22ck-revision-change__author\x22></span>','<span\x20class=\x22ck-revision-change__ai-note\x22>'+kt(_0x3e34c0,'AI_SOURCE_AI')+'</span>'])),_0x20418b['element']['querySelector']('.ck-revision-change__author')['textContent']=_0x276d1a['author']['name'],_0x20418b;}_createLabel(_0x37895a){return{'tag':'span','attributes':{'class':['ck-revision-change__label']},'children':[{'text':_0x37895a}]};}_createAiIconView(_0x42f423){const _0x5b422e=new _0x542efe();return _0x5b422e['content']=_0x5dc770,_0x5b422e['extendTemplate']({'attributes':{'class':['ck-revision-change__ai-icon'],'data-cke-tooltip-text':kt(_0x42f423,'AI_SOURCE_CHANGE_TOOLTIP'),'data-cke-tooltip-position':'s'}}),_0x5b422e;}['focus'](){this['element']['focus']();}};const Tt=/* #__PURE__ -- @preserve */
26
- _0x162cec();var Mt=class extends Tt{['id'];author;type;data;rootName;constructor(_0x9cb3d4){super(),this['id']=_0x9cb3d4['id']||_0x5ca1c8(),this['author']=_0x9cb3d4['author'],this['type']=_0x9cb3d4['type'],this['data']=_0x9cb3d4['data']||{},this['rootName']=_0x9cb3d4['rootName'],this['set']('createdAt',_0x9cb3d4['createdAt']);}toJSON(){return{'id':this['id'],'authorId':this['author']['id'],'type':this['type'],'data':this['data'],'createdAt':this['createdAt']};}},Ht=class{['newRevisionId'];['oldRevisionId'];['changes'];constructor(_0x382368,_0xaede0d){this['newRevisionId']=_0x382368,this['oldRevisionId']=_0xaede0d,this['changes']=new _0x6e554a();}_setChanges(_0x3a1377){for(const _0x4e46fb of _0x3a1377)this['changes']['add'](_0x4e46fb);}},Pt=class extends _0x17a398{repository;adapter=null;_getVisibleCommentThreadIds=null;_utils;_activeViewTarget;['_changeView'];['_changeIdToChange'];['_balloon'];_showCommentHighlights;static get['pluginName'](){return'RevisionViewer';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_0x4b9bd4,_0x28b695,bt,Rt];}constructor(_0x29dedd){super(_0x29dedd),this['repository']=this['editor']['plugins']['get']('RevisionsRepository'),this['_utils']=this['editor']['plugins']['get']('RevisionHistoryUtils'),this['set']('activeChange',null),this['set']('activeView',null),this['_activeViewTarget']=null,this['set']('diff',null),this['set']('isReady',!0x1),this['set']('isEnabled',!0x0),this['on']('change:isEnabled',(_0x13f106,_0x193a82,_0x3949e7)=>{this['activeChange']=null,this['activeView']=null,this['editor']['editing']['view']['change'](_0x16e15c=>{for(const _0x518d5b of this['editor']['editing']['view']['document']['roots'])_0x3949e7?_0x16e15c['removeClass']('ck-editor__editable__overlay',_0x518d5b):_0x16e15c['addClass']('ck-editor__editable__overlay',_0x518d5b);});}),this['bind']('isNavigationMode')['to'](this,'activeChange',_0x3a8321=>null!==_0x3a8321),this['bind']('currentChangeNumber')['to'](this,'isReady',this,'diff',this,'activeChange',(_0x2fec7b,_0x4be833,_0x5b94c9)=>_0x2fec7b&&_0x5b94c9?_0x4be833['changes']['getIndex'](_0x5b94c9):0x0),this['bind']('numberOfChanges')['to'](this,'isReady',this,'diff',(_0x19d89d,_0x2868bf)=>_0x19d89d?_0x2868bf['changes']['length']:0x0),this['_changeView']=null,this['_changeIdToChange']=new Map(),this['_balloon']=this['editor']['plugins']['get'](_0x28b695),this['_showCommentHighlights']=this['editor']['config']['get']('revisionHistory.showCommentHighlights');}init(){const _0x10a826=this['editor'],_0x176da0=new $t(_0x10a826,{'direction':'backward'}),_0x26adc5=new $t(_0x10a826,{'direction':'forward'});_0x10a826['commands']['add']('showPreviousChange',_0x176da0),_0x10a826['commands']['add']('showNextChange',_0x26adc5),_0x10a826['commands']['add']('restoreRevision',new Ft(_0x10a826)),this['on']('change:numberOfChanges',()=>{_0x176da0['refresh'](),_0x26adc5['refresh']();}),this['_setConversion'](),this['_initInteractions'](),_0x10a826['enableReadOnlyMode']('revision-viewer'),_0x10a826['plugins']['has']('WidgetToolbarRepository')&&_0x10a826['plugins']['get']('WidgetToolbarRepository')['forceDisabled']('revision-viewer');}async getRevisionDocumentData(_0xdd8da1){return await this['_utils']['loadRevisionData'](_0xdd8da1,this['adapter']),this['_utils']['getRevisionDocumentData'](_0xdd8da1);}async getRevisionRootsAttributes(_0x33ef22){return await this['_utils']['loadRevisionData'](_0x33ef22,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x33ef22);}async['compare'](_0x2e139f,_0x255349,_0x2c22d6=!0x1){if(!this['isEnabled'])return;const _0x119e76=this['diff'],_0x2efaaa=this['repository'],_0x23edad='string'==typeof _0x2e139f?_0x2efaaa['getRevision'](_0x2e139f):_0x2e139f,_0x5baaaa='string'==typeof _0x255349?_0x2efaaa['getRevision'](_0x255349):_0x255349,_0x510fcb=_0x23edad['id'],_0xb98e1d=_0x5baaaa?_0x5baaaa['id']:null;if(!_0x2c22d6&&this['diff']&&this['diff']['newRevisionId']===_0x510fcb&&this['diff']['oldRevisionId']===_0xb98e1d)return Promise['resolve']();this['isReady']=!0x1,this['activeView']=null,this['activeChange']=null,this['diff']=new Ht(_0x510fcb,_0xb98e1d);const _0x5e00a3=this['_getRevisionsRange'](_0x23edad,_0x5baaaa,!0x0)['map'](_0x567b89=>this['_utils']['loadRevisionData'](_0x567b89,this['adapter']));return _0x5e00a3['push'](new Promise(_0x812357=>{setTimeout(_0x812357,0x14);})),Promise['all'](_0x5e00a3)['then'](()=>{if(!this['isEnabled'])return;this['_cleanUp']();const _0x12f7c8=this['_getDiff'](_0x510fcb,_0xb98e1d);this['_cleanUpCommentMarkers'](_0x12f7c8);for(const _0x1e7d36 of _0x12f7c8['changes'])this['_changeIdToChange']['set'](_0x1e7d36['id'],_0x1e7d36);this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x4e1c53=>{for(const _0x462cb0 of this['editor']['model']['document']['getRootNames']())_0x4e1c53['detachRoot'](_0x462cb0);for(const _0x43e1cf of Object['keys'](_0x12f7c8['model'])){const _0x462e5d=_0x12f7c8['model'][_0x43e1cf]['name'],_0x5222f3=_0x4e1c53['addRoot'](_0x43e1cf,_0x462e5d);for(const _0x2a6004 of Object['keys'](_0x12f7c8['attributes'][_0x43e1cf]))_0x4e1c53['setAttribute'](_0x2a6004,_0x12f7c8['attributes'][_0x43e1cf][_0x2a6004],_0x5222f3);_0x4e1c53['insert'](_0x12f7c8['model'][_0x43e1cf],_0x5222f3,0x0);}}),this['diff']['_setChanges'](this['_sortAndFilterDiffChanges'](_0x12f7c8['changes'])),this['isReady']=!0x0;})['catch'](_0x2e4703=>{console['error'](_0x2e4703),this['_cleanUp'](),_0x119e76&&(this['diff']=_0x119e76),this['isReady']=!0x0;});}addRevisionData(_0x579d4b,_0x43e438){const _0x59e740=this['repository']['createRevision'](_0x579d4b);return _0x59e740['on']('_update',(_0x40b49a,_0x41a25c,_0x3a0f58)=>_0x43e438(_0x41a25c,_0x3a0f58,_0x59e740)),this['repository']['addRevision'](_0x59e740),_0x59e740;}['_cleanUp'](){this['activeChange']=null,this['_cleanMarkers'](),this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=null,this['_changeIdToChange']['clear'](),this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x15243b=>{for(const _0x4538b4 of this['editor']['model']['document']['getRootNames']())_0x15243b['detachRoot'](_0x4538b4);});}_cleanUpCommentMarkers(_0x38680c){if(!this['_showCommentHighlights']||!this['_getVisibleCommentThreadIds'])return;const _0x400e29=this['_getVisibleCommentThreadIds']();for(const _0x25ad62 of Object['values'](_0x38680c['model']))for(const _0x1649c0 of Array['from'](_0x25ad62['markers']['keys']()))_0x1649c0['startsWith']('revision-comment:')&&!_0x400e29['has'](Ut(_0x1649c0))&&_0x25ad62['markers']['delete'](_0x1649c0);}_sortAndFilterDiffChanges(_0x104d2f){const _0x3fdf1a=[],_0x7b16d1=new Map();for(const _0x7f9510 of this['editor']['model']['document']['getRootNames']()){const _0x466fa5=this['editor']['editing']['view']['getDomRoot'](_0x7f9510);if(!_0x466fa5)continue;const _0x4966ca=_0x466fa5['getClientRects']()['item'](0x0);_0x4966ca&&(_0x3fdf1a['push'](_0x7f9510),_0x7b16d1['set'](_0x7f9510,_0x4966ca));}return _0x3fdf1a['sort']((_0x188190,_0x4cd7ca)=>{const _0x97de18=_0x7b16d1['get'](_0x188190),_0x2f9325=_0x7b16d1['get'](_0x4cd7ca);return _0x97de18['y']-_0x2f9325['y']||_0x97de18['x']-_0x2f9325['x'];}),(_0x104d2f=_0x104d2f['filter'](_0xc887a9=>_0x3fdf1a['includes'](_0xc887a9['rootName'])))['sort']((_0x41db86,_0x5c5137)=>_0x3fdf1a['indexOf'](_0x41db86['rootName'])-_0x3fdf1a['indexOf'](_0x5c5137['rootName'])),_0x104d2f;}['_makeTape'](_0x5b0789,_0x48fb2b={}){const _0x5415b5=Array['from'](_0x5b0789['markers'])['filter'](([_0x255856,_0x10a807])=>_0x255856['startsWith']('revision:')&&!_0x10a807['isCollapsed']),_0x4d747c=Array['from'](this['editor']['model']['createRangeIn'](_0x5b0789)['getWalker']({'singleCharacters':!0x0}));if(0x0!=_0x5415b5['length'])for(const _0x11282b of _0x4d747c){const [_0x4e85e5,_0x1512c1]=_0x5415b5[0x0],[,_0x3b913f,_0x370cf3]=_0x4e85e5['split'](':'),_0x3582da=_0x48fb2b[_0x4e85e5]||null;if(_0x1512c1['end']['isEqual'](_0x11282b['nextPosition'])&&_0x5415b5['shift'](),(_0x11282b['previousPosition']['isEqual'](_0x1512c1['start'])||_0x11282b['previousPosition']['isAfter'](_0x1512c1['start']))&&('insertion'==_0x3b913f?_0x11282b['isAdded']={'userId':_0x370cf3,'aiSource':_0x3582da}:'deletion'==_0x3b913f&&(_0x11282b['isRemoved']={'userId':_0x370cf3,'aiSource':_0x3582da})),0x0==_0x5415b5['length'])break;}return _0x4d747c;}_refreshStartEndIndex(_0x572578){const _0x446a82=new Map();for(let _0xe74a30=0x0;_0xe74a30<_0x572578['length'];_0xe74a30++)'text'===_0x572578[_0xe74a30]['type']?(_0x572578[_0xe74a30]['item']['startIndex']=_0xe74a30,_0x572578[_0xe74a30]['item']['endIndex']=_0xe74a30):('elementStart'===_0x572578[_0xe74a30]['type']?_0x572578[_0xe74a30]['item']['startIndex']=_0xe74a30:'elementEnd'===_0x572578[_0xe74a30]['type']&&(_0x572578[_0xe74a30]['item']['endIndex']=_0xe74a30),_0x446a82['set'](_0x572578[_0xe74a30]['id'],_0xe74a30));for(const _0x1a69e1 of _0x446a82['values']())'elementStart'===_0x572578[_0x1a69e1]['type']?_0x572578[_0x1a69e1]['item']['endIndex']=_0x446a82['get'](_0x572578[_0x1a69e1]['pairId']):'elementEnd'===_0x572578[_0x1a69e1]['type']&&(_0x572578[_0x1a69e1]['item']['startIndex']=_0x446a82['get'](_0x572578[_0x1a69e1]['pairId']));}['_processTape'](_0x7ec7ca){for(let _0x95a93=0x0;_0x95a93<_0x7ec7ca['length'];_0x95a93++){if('elementStart'===_0x7ec7ca[_0x95a93]['type'])_0x7ec7ca[_0x95a93]['item']['startIndex']=_0x95a93;else{if('elementEnd'===_0x7ec7ca[_0x95a93]['type']){_0x7ec7ca[_0x95a93]['item']['endIndex']=_0x95a93;const _0x23c228=_0x7ec7ca[_0x95a93]['item']['startIndex'];_0x7ec7ca[_0x23c228]['pairId']=_0x7ec7ca[_0x95a93]['id'],_0x7ec7ca[_0x95a93]['pairId']=_0x7ec7ca[_0x23c228]['id'];}else _0x7ec7ca[_0x95a93]['item']['startIndex']=_0x95a93,_0x7ec7ca[_0x95a93]['item']['endIndex']=_0x95a93,_0x7ec7ca[_0x95a93]['pairId']=null;}_0x7ec7ca[_0x95a93]['markersStart']||(_0x7ec7ca[_0x95a93]['markersStart']=[],_0x7ec7ca[_0x95a93]['markersEnd']=[]);}}_markInsertions(_0x29b04a,_0x527fad){const _0x262af6=_0x29b04a['filter'](_0x2a749a=>!_0x2a749a['isAdded']);for(let _0x5e1053=0x0;_0x5e1053<_0x527fad['length'];_0x5e1053++)_0x527fad[_0x5e1053]['isAdded']&&(_0x262af6[_0x5e1053]['isAdded']=_0x527fad[_0x5e1053]['isAdded']);}_getDiff(_0x1b6fca,_0xe4d6d5=null){const _0x24b18b=this['repository']['getRevision'](_0x1b6fca),_0x59916e=_0xe4d6d5?this['repository']['getRevision'](_0xe4d6d5):null,_0x463e2c=this['_getRevisionsRange'](_0x24b18b,_0x59916e),_0x40e53c=_0x463e2c[_0x463e2c['length']-0x1],_0x130153=new Map(),_0x3c08c4={'model':{},'attributes':{},'changes':[]},_0x12adc9=new Set(),_0x5e20fb=new Map();for(let _0x40bfea=_0x463e2c['length']-0x1;_0x40bfea>=0x0;_0x40bfea--){const _0x41dc9e=_0x463e2c[_0x40bfea];for(const _0x4efd30 of Object['keys'](_0x41dc9e['diffData']))if(_0x41dc9e['diffData'][_0x4efd30]['attachChange']){const _0x4204e6=_0x41dc9e['diffData'][_0x4efd30]['attachChange'];_0x4204e6['isAttached']?(_0x12adc9['add'](_0x4efd30),_0x5e20fb['has'](_0x4efd30)&&_0x5e20fb['get'](_0x4efd30)['userId']==_0x4204e6['userId']?_0x5e20fb['delete'](_0x4efd30):_0x5e20fb['set'](_0x4efd30,_0x4204e6)):_0x5e20fb['has'](_0x4efd30)?(_0x12adc9['delete'](_0x4efd30),_0x5e20fb['delete'](_0x4efd30)):(_0x12adc9['add'](_0x4efd30),_0x5e20fb['set'](_0x4efd30,_0x4204e6));}else _0x12adc9['add'](_0x4efd30);}for(const _0x10dd34 of _0x12adc9){const _0x57833b=_0x5e20fb['has'](_0x10dd34)&&!_0x5e20fb['get'](_0x10dd34)['isAttached'];let _0x4f1502=_0x57833b?_0x463e2c['length']-0x1:0x0;const _0x3c8668=_0x57833b?-0x1:0x1;for(;_0x463e2c[_0x4f1502];){const _0xf8460a=_0x463e2c[_0x4f1502];if(_0xf8460a['diffData'][_0x10dd34]){const _0x262a13=_0x57833b?_0xf8460a['diffData'][_0x10dd34]['attributesBefore']:_0xf8460a['diffData'][_0x10dd34]['attributesAfter'];_0x3c08c4['attributes'][_0x10dd34]=_0x262a13?_0x5bf201(_0x262a13):{};break;}_0x4f1502+=_0x3c8668;}}for(const _0x203f3b of _0x463e2c){_0x203f3b['model']={};for(const _0x3f4e83 of _0x203f3b['authors'])_0x130153['set'](_0x3f4e83['id'],_0x3f4e83);for(const _0x575ace of _0x12adc9){const _0xb4ac11=_0x203f3b['diffData'][_0x575ace]?_0x203f3b['diffData'][_0x575ace]['insertions']:'[]',_0x3ccf64=_0x203f3b['diffData'][_0x575ace]?_0x203f3b['diffData'][_0x575ace]['deletions']:'[]',_0x5b2ed6=_0x203f3b['diffData'][_0x575ace]?.['rootElementName']||'$root';_0x203f3b['model'][_0x575ace]={'insertions':this['_utils']['_makeModelFromViewString'](_0xb4ac11,_0x5b2ed6),'deletions':this['_utils']['_makeModelFromViewString'](_0x3ccf64,_0x5b2ed6)};}}for(const _0x33eb26 of _0x12adc9){let _0xa1dcb2=null,_0x4217ca=0x0;const _0x58831a=_0x463e2c['map'](_0x4d771f=>_0x4d771f['diffData'][_0x33eb26]?.['rootElementName'])['find'](_0x2b9bcb=>void 0x0!==_0x2b9bcb)||'$root',_0x45a81f=new Map(Array['from'](_0x24b18b['model'][_0x33eb26]['insertions']['markers'])['filter'](([_0x2e05da])=>!_0x2e05da['startsWith']('revision:')));let _0xbac8fb=0x0;for(const _0x52e8f0 of _0x463e2c){const _0x58b05d=_0x52e8f0['diffData'][_0x33eb26]?.['aiSources']||{},_0x4ccea5=this['_makeTape'](_0x52e8f0['model'][_0x33eb26]['insertions'],_0x58b05d);_0x52e8f0==_0x24b18b?(_0xa1dcb2=_0x4ccea5,_0x4217ca=_0xa1dcb2['length'],_0xa1dcb2['forEach'](_0x12837e=>{_0x12837e['id']=_0xbac8fb++;}),this['_processTape'](_0xa1dcb2)):this['_markInsertions'](_0xa1dcb2,_0x4ccea5);const _0x4ec034=_0xa1dcb2['filter'](_0x1c72a9=>!_0x1c72a9['isAdded'])['map'](_0x4875d5=>_0x4875d5['id']);let _0x295ca1=0x0;const _0x658269=this['_makeTape'](_0x52e8f0['model'][_0x33eb26]['deletions'],_0x58b05d);_0x658269['forEach'](_0x5126cc=>{_0x5126cc['isRemoved']?_0x5126cc['id']=_0x4217ca++:_0x5126cc['id']=_0x4ec034[_0x295ca1++];}),this['_processTape'](_0x658269),this['_setDistance'](_0xa1dcb2,'isAdded'),this['_setDistance'](_0x658269,'isRemoved'),_0x52e8f0==_0x24b18b&&this['_markMarkers'](_0xa1dcb2,_0x45a81f),_0xa1dcb2=this['_joinTapes'](_0xa1dcb2,_0x658269),this['_refreshStartEndIndex'](_0xa1dcb2),this['_setDistance'](_0xa1dcb2,'isRemoved');}_0xa1dcb2=_0xa1dcb2['filter'](_0x5631cd=>!(_0x5631cd['isAdded']&&_0x5631cd['isRemoved']));const _0x4d96b2=new Map(_0x40e53c['model'][_0x33eb26]['deletions']['markers']),_0x358e9e=new Set(_0x45a81f['keys']());for(const _0x4b2327 of _0x4d96b2['keys']())_0x358e9e['delete'](_0x4b2327);const _0x2c93e6=Object['assign']({},..._0x463e2c['map'](_0x44ba19=>_0x44ba19['diffData'][_0x33eb26]?.['aiSources']));this['_markSuggestions'](_0xa1dcb2,_0x358e9e,_0x2c93e6),this['_fixObsoleteTags'](_0xa1dcb2),_0xa1dcb2=this['_removeMissingPairs'](_0xa1dcb2),_0xa1dcb2=this['_markMismatchedRemovedTags'](_0xa1dcb2),_0xa1dcb2=this['_removeUnsupportedChanges'](_0xa1dcb2);const {root:_0x575cb1,changes:_0xc4e810}=this['_makeModelFromTape'](_0xa1dcb2,_0x130153,_0x33eb26,_0x58831a);_0x3c08c4['model'][_0x33eb26]=_0x575cb1;const _0x15b66a=_0x5e20fb['get'](_0x33eb26);if(_0x15b66a){const _0x38d72e=_0x130153['get'](_0x15b66a['userId']),_0x12eae9=new Mt({'author':_0x38d72e,'type':_0x15b66a['isAttached']?'add':'remove','data':{'isOnRoot':!0x0},'createdAt':new Date(),'rootName':_0x33eb26});_0xc4e810['unshift'](_0x12eae9),_0x3c08c4['attributes'][_0x33eb26]['revisionHistoryAttachChange']=_0x12eae9['id'];}_0x3c08c4['changes']=_0x3c08c4['changes']['concat'](_0xc4e810);}return _0x3c08c4;}['_markMarkers'](_0x1f5c49,_0x21b396){for(let _0x927657=0x0;_0x927657<_0x1f5c49['length'];_0x927657++)for(const [_0x36eec9,_0x2b4411]of _0x21b396)!_0x2b4411['isCollapsed']&&_0x2b4411['start']['isEqual'](_0x1f5c49[_0x927657]['previousPosition'])&&_0x1f5c49[_0x927657]['markersStart']['push'](_0x36eec9),_0x2b4411['end']['isEqual'](_0x1f5c49[_0x927657]['nextPosition'])&&_0x1f5c49[_0x927657]['markersEnd']['push'](_0x36eec9);}['_joinTapes'](_0x175914,_0x19777a){let _0x55c725=[],_0x1db844=0x0,_0x689f86=0x0;for(;_0x1db844<_0x175914['length']||_0x689f86<_0x19777a['length'];){const _0x28ae74=_0x175914[_0x1db844]||{},_0xbfd978=_0x19777a[_0x689f86]||{};if(_0x28ae74['id']==_0xbfd978['id'])_0x1db844++,_0x689f86++,_0x55c725['push'](_0x28ae74);else{if(_0xbfd978['isRemoved']&&_0x28ae74['isAdded']){const {commonTape:_0x209835,iEnd:_0x2288c5,jEnd:_0x4f2ca8}=this['_threeWayMerge'](_0x175914,_0x1db844,_0x19777a,_0x689f86);_0x55c725=_0x55c725['concat'](_0x209835),_0x1db844=_0x2288c5,_0x689f86=_0x4f2ca8;}else _0xbfd978['isRemoved']?(_0x689f86++,_0x55c725['push'](_0xbfd978)):(_0x1db844++,_0x55c725['push'](_0x28ae74));}}return _0x55c725;}_markSuggestions(_0x425ef8,_0x1e965e,_0x55386e){const _0x357455=[];for(let _0x1eaad9=0x0;_0x1eaad9<_0x425ef8['length'];_0x1eaad9++){for(let _0x29ae8a=0x0;_0x29ae8a<_0x425ef8[_0x1eaad9]['markersStart']['length'];_0x29ae8a++){const _0x71c480=_0x425ef8[_0x1eaad9]['markersStart'][_0x29ae8a];if(!_0x1e965e['has'](_0x71c480))continue;const {group:_0x1c228e,type:_0x9e3efc,authorId:_0x2621f3}=_0xdd73c5(_0x71c480);if('revision-suggestion'!=_0x1c228e||'insertion'!=_0x9e3efc&&'deletion'!=_0x9e3efc)continue;const _0x2e3853=_0x55386e['suggestion:'+_0x71c480['slice'](0x14)]||null;_0x357455['unshift']({'type':_0x9e3efc,'name':_0x71c480,'userId':_0x2621f3,'aiSource':_0x2e3853}),_0x425ef8[_0x1eaad9]['markersStart']['splice'](_0x29ae8a,0x1),_0x29ae8a--;}_0x1021ba(_0x425ef8[_0x1eaad9]);for(let _0x30449c=0x0;_0x30449c<_0x425ef8[_0x1eaad9]['markersEnd']['length'];_0x30449c++){const _0x43f4e7=_0x425ef8[_0x1eaad9]['markersEnd'][_0x30449c];if(!_0x1e965e['has'](_0x43f4e7))continue;const {group:_0xbf4dca,type:_0x515f8b}=_0xdd73c5(_0x43f4e7);if('revision-suggestion'!=_0xbf4dca||'insertion'!=_0x515f8b&&'deletion'!=_0x515f8b)continue;_0x425ef8[_0x1eaad9]['markersEnd']['splice'](_0x30449c,0x1),_0x30449c--;const _0x55b3d8=_0x357455['findIndex'](_0x3373c8=>_0x3373c8['name']==_0x43f4e7);_0x55b3d8>-0x1&&_0x357455['splice'](_0x55b3d8,0x1);}}function _0xdd73c5(_0x5e1ce3){const _0x31f856=_0x5e1ce3['split'](':');return{'group':_0x31f856[0x0],'type':_0x31f856[0x1],'subType':_0x31f856['length']>=0x5?_0x31f856[0x2]:null,'id':_0x31f856['length']<0x5?_0x31f856[0x2]:_0x31f856[0x3],'authorId':_0x31f856['length']<0x5?_0x31f856[0x3]:_0x31f856[0x4],'markerCount':0x6==_0x31f856['length']?_0x31f856[0x5]:null};}function _0x1021ba(_0xe9d8dc){for(let _0x57c9c1=0x0;_0x57c9c1<_0x357455['length'];_0x57c9c1++){if(_0xe9d8dc['isAdded']&&'insertion'==_0x357455[_0x57c9c1]['type']&&_0xe9d8dc['isAdded']['userId']==_0x357455[_0x57c9c1]['userId'])return _0xe9d8dc['isAddSuggestion']={..._0x357455[_0x57c9c1],'aiSource':_0xe9d8dc['isAdded']['aiSource']||_0x357455[_0x57c9c1]['aiSource']},void delete _0xe9d8dc['isAdded'];if(!_0xe9d8dc['isAdded']&&!_0xe9d8dc['isRemoved']&&'deletion'==_0x357455[_0x57c9c1]['type'])return void(_0xe9d8dc['isRemoveSuggestion']=_0x357455[_0x57c9c1]);}}}_setDistance(_0x8fb6bf,_0x369daf){let _0x1f70ad=0x0,_0xd12097=!0x1;const _0x1fa9d6=new Map();for(const _0x54e0d6 of _0x8fb6bf)_0x54e0d6[_0x369daf]?_0xd12097&&(_0x1f70ad++,_0xd12097=!0x1):(_0x1f70ad++,_0xd12097=!0x0),_0x1fa9d6['set'](_0x54e0d6['id'],_0x1f70ad);for(let _0x4cccb6=0x0;_0x4cccb6<_0x8fb6bf['length'];_0x4cccb6++){if('isRemoved'==_0x369daf&&_0x8fb6bf[_0x4cccb6]['isAdded']||'isAdded'==_0x369daf&&_0x8fb6bf[_0x4cccb6]['isRemoved'])continue;if('text'==_0x8fb6bf[_0x4cccb6]['type']){_0x8fb6bf[_0x4cccb6]['distance']=0x0;continue;}const _0x5a4fc3=_0x1fa9d6['get'](_0x8fb6bf[_0x4cccb6]['pairId']),_0x1ed206=_0x1fa9d6['get'](_0x8fb6bf[_0x4cccb6]['id']);_0x8fb6bf[_0x4cccb6]['distance']=_0x5a4fc3-_0x1ed206;}}_getRevisionsRange(_0x5b3238,_0xe64731,_0x5d93e0=!0x1){const _0x1f6fd1=[];let _0xadbe23=this['repository']['getIndex'](_0x5b3238),_0x3db2cc=this['repository']['getIndex'](_0xe64731);for(-0x1==_0x3db2cc&&(_0x3db2cc=this['repository']['_revisions']['length'],_0x5d93e0=!0x1);_0xadbe23<_0x3db2cc;)_0x1f6fd1['push'](this['repository']['getRevision'](_0xadbe23)),_0xadbe23++;return _0x5d93e0&&_0x1f6fd1['push'](this['repository']['getRevision'](_0xadbe23)),_0x1f6fd1;}_threeWayMerge(_0x43dda5,_0x2cc786,_0x3bf13c,_0x54ffb2){const _0x268f96=this['editor']['model']['schema'];let _0x50a4a5=_0x2cc786;for(;_0x43dda5[_0x50a4a5]&&_0x43dda5[_0x50a4a5]['isAdded'];)_0x50a4a5++;let _0x272fa9=_0x54ffb2;for(;_0x3bf13c[_0x272fa9]&&_0x3bf13c[_0x272fa9]['isRemoved'];)_0x272fa9++;_0x59938f(_0x43dda5,_0x2cc786,_0x50a4a5),_0x59938f(_0x3bf13c,_0x54ffb2,_0x272fa9);const _0x426b13=_0x3bf13c['slice'](_0x54ffb2,_0x272fa9)['concat'](_0x43dda5['slice'](_0x2cc786,_0x50a4a5));return _0x426b13['sort']((_0x8e64e6,_0x21dca9)=>_0x8e64e6['side']!=_0x21dca9['side']?_0x8e64e6['side']-_0x21dca9['side']:_0x8e64e6['level']!=_0x21dca9['level']?_0x8e64e6['level']-_0x21dca9['level']:_0x8e64e6['distance']!=_0x21dca9['distance']?_0x21dca9['distance']-_0x8e64e6['distance']:!!_0x8e64e6['isAdded']!=!!_0x21dca9['isAdded']?-0x1==_0x8e64e6['side']||0x0==_0x8e64e6['side']?_0x8e64e6['isAdded']?-0x1:0x1:_0x8e64e6['isAdded']?0x1:-0x1:_0x8e64e6['index']-_0x21dca9['index']),{'commonTape':_0x426b13,'iEnd':_0x50a4a5,'jEnd':_0x272fa9};function _0x59938f(_0x17a8a6,_0x9f7f58,_0x476cfc){let _0x3cea27=-0x1,_0x3e77f3=Number['POSITIVE_INFINITY'],_0x348b5d=!0x0;for(let _0x24945d=_0x9f7f58;_0x24945d<_0x476cfc;_0x24945d++)if(_0x268f96['isInline'](_0x17a8a6[_0x24945d]['item'])||(_0x348b5d=!0x1),_0x17a8a6[_0x24945d]['item']['startIndex']<_0x9f7f58&&(_0x3cea27=_0x24945d),_0x17a8a6[_0x24945d]['item']['endIndex']>=_0x476cfc){_0x3e77f3=_0x24945d;break;}_0x348b5d&&(_0x3cea27=_0x476cfc-0x1);for(let _0x58acd8=_0x9f7f58;_0x58acd8<_0x476cfc;_0x58acd8++)_0x17a8a6[_0x58acd8]['side']=_0x58acd8<=_0x3cea27?-0x1:_0x58acd8<_0x3e77f3?0x0:0x1,_0x17a8a6[_0x58acd8]['index']=_0x58acd8;let _0x578f98=0x0;for(let _0x2aa989=_0x9f7f58;_0x2aa989<=_0x3cea27;_0x2aa989++)0x0==_0x17a8a6[_0x2aa989]['distance']?_0x17a8a6[_0x2aa989]['level']=_0x578f98:(_0x578f98++,_0x17a8a6[_0x2aa989]['level']=_0x578f98,_0x578f98++);for(let _0x47beb3=_0x9f7f58;_0x47beb3<_0x476cfc;_0x47beb3++)0x0==_0x17a8a6[_0x47beb3]['side']&&(_0x17a8a6[_0x47beb3]['level']=_0x578f98);_0x578f98=0x0;for(let _0x9d415a=_0x476cfc-0x1;_0x9d415a>=_0x3e77f3;_0x9d415a--)0x0==_0x17a8a6[_0x9d415a]['distance']?_0x17a8a6[_0x9d415a]['level']=_0x578f98:(_0x578f98--,_0x17a8a6[_0x9d415a]['level']=_0x578f98,_0x578f98--);}}_fixObsoleteTags(_0x316fa7){const _0x2e843e=new Map(),_0x4e8d4d=this['editor']['model']['schema'];for(let _0x29da32=0x1;_0x29da32<_0x316fa7['length'];_0x29da32++){let _0x43d8e6,_0x1d2c5a,_0x5dca95;const _0x237518=_0x316fa7[_0x29da32],_0x46a9ef=_0x316fa7[_0x29da32-0x1];if('text'==_0x237518['type'])continue;if(_0x237518['type']!=_0x46a9ef['type'])continue;if(!_0x4e8d4d['isBlock'](_0x46a9ef['item'])||_0x4e8d4d['isLimit'](_0x46a9ef['item']))continue;if(!_0x4e8d4d['isBlock'](_0x237518['item'])||_0x4e8d4d['isLimit'](_0x237518['item']))continue;if((_0x316fa7[_0x29da32]['isAdded']||_0x316fa7[_0x29da32]['isAddSuggestion'])&&_0x316fa7[_0x29da32-0x1]['isRemoved'])_0x43d8e6=_0x316fa7[_0x29da32],_0x1d2c5a=_0x316fa7[_0x29da32-0x1],_0x5dca95=_0x29da32-0x1;else{if(!_0x316fa7[_0x29da32]['isRemoved']||!_0x316fa7[_0x29da32-0x1]['isAdded']&&!_0x316fa7[_0x29da32-0x1]['isAddSuggestion'])continue;_0x43d8e6=_0x316fa7[_0x29da32-0x1],_0x1d2c5a=_0x316fa7[_0x29da32],_0x5dca95=_0x29da32;}const _0xfca1eb=_0x43d8e6['level']==_0x1d2c5a['level'],_0x14f33e=Math['abs'](_0x43d8e6['level'])<Math['abs'](_0x1d2c5a['level'])&&0x0==_0x1d2c5a['distance'];(_0xfca1eb||_0x14f33e)&&(_0x2e843e['set'](_0x1d2c5a['id'],_0x43d8e6['id']),_0x316fa7['splice'](_0x5dca95,0x1),_0x29da32--,_0x43d8e6['isAdded']=!0x1);}for(let _0x10ba65=0x0;_0x10ba65<_0x316fa7['length'];_0x10ba65++)_0x2e843e['has'](_0x316fa7[_0x10ba65]['pairId'])&&(_0x316fa7[_0x10ba65]['pairId']=_0x2e843e['get'](_0x316fa7[_0x10ba65]['pairId']));}['_removeMissingPairs'](_0x3f76b7){const _0x710686=new Set(_0x3f76b7['map'](_0x36e101=>_0x36e101['id']));for(let _0x175193=0x0;_0x175193<_0x3f76b7['length'];_0x175193++)_0x710686['has'](_0x3f76b7[_0x175193]['pairId'])||0x0==_0x3f76b7[_0x175193]['distance']||(_0x3f76b7[_0x175193]['isIncorrect']=!0x0);return _0x3f76b7['filter'](_0x1b56d7=>!_0x1b56d7['isIncorrect']);}_markMismatchedRemovedTags(_0x384659){const _0x255853=new Set();for(let _0x5c2d0d=0x0;_0x5c2d0d<_0x384659['length'];_0x5c2d0d++){if(_0x255853['has'](_0x384659[_0x5c2d0d]['id'])&&_0x384659[_0x5c2d0d]['isRemoved']&&(_0x384659[_0x5c2d0d]['isIncorrect']=!0x0),_0x384659[_0x5c2d0d]['isIncorrect'])continue;if(0x0==_0x384659[_0x5c2d0d]['distance'])continue;if('elementStart'!=_0x384659[_0x5c2d0d]['type'])continue;if(null==_0x384659[_0x5c2d0d]['pairId'])continue;let _0x37835c=_0x5c2d0d+0x1,_0x46b5ba=0x0;for(;_0x384659[_0x37835c]['id']!=_0x384659[_0x5c2d0d]['pairId'];)'elementStart'==_0x384659[_0x37835c]['type']?_0x46b5ba++:'elementEnd'==_0x384659[_0x37835c]['type']&&_0x46b5ba--,_0x37835c++;if(0x0!=_0x46b5ba){if(_0x384659[_0x5c2d0d]['isRemoved'])_0x384659[_0x5c2d0d]['isIncorrect']=!0x0;else{for(;_0x37835c!=_0x5c2d0d;)_0x384659[_0x37835c]['isRemoved']&&0x0!=_0x384659[_0x37835c]['distance']&&(_0x384659[_0x37835c]['isIncorrect']=!0x0,_0x255853['add'](_0x384659[_0x37835c]['pairId'])),_0x37835c--;}}}return _0x384659['filter'](_0x132d94=>!_0x132d94['isIncorrect']);}_removeUnsupportedChanges(_0x2bb4b9){const _0x312724=this['editor']['model']['schema'];for(let _0x5411b5=0x0;_0x5411b5<_0x2bb4b9['length'];_0x5411b5++){if(!(_0x2bb4b9[_0x5411b5]['isAdded']||_0x2bb4b9[_0x5411b5]['isAddSuggestion']||_0x2bb4b9[_0x5411b5]['isRemoved']||_0x2bb4b9[_0x5411b5]['isRemoveSuggestion']))continue;if(0x0==_0x2bb4b9[_0x5411b5]['distance'])continue;const _0x3745b6=_0x2bb4b9[_0x5411b5]['item'];_0x312724['isBlock'](_0x3745b6)||_0x312724['isLimit'](_0x3745b6)||(_0x2bb4b9[_0x5411b5]['isAdded']&&delete _0x2bb4b9[_0x5411b5]['isAdded'],_0x2bb4b9[_0x5411b5]['isAddSuggestion']&&delete _0x2bb4b9[_0x5411b5]['isAddSuggestion'],_0x2bb4b9[_0x5411b5]['isRemoveSuggestion']&&delete _0x2bb4b9[_0x5411b5]['isRemoveSuggestion'],_0x2bb4b9[_0x5411b5]['isRemoved']&&(_0x2bb4b9[_0x5411b5]['isIncorrect']=!0x0));}return _0x2bb4b9['filter'](_0x1b60a6=>!_0x1b60a6['isIncorrect']);}['_makeModelFromTape'](_0x1961f5,_0x40dddf,_0x51eefc,_0x31436c){const _0x15d7b7=new _0x30054f(),_0x2741e8=[],_0x296a83=new Map(),_0x880b5d=this['editor']['model'],_0x2efa32=_0x880b5d['schema'],_0x4cde0d=[_0x15d7b7],_0x1220ea={},_0x2da720={'isAdded':[],'isRemoved':[],'isAddSuggestion':[],'isRemoveSuggestion':[]};_0x15d7b7['name']=_0x31436c;let _0x430c4f=null;const _0x39f6f0=[0x0];for(let _0x2dc616=0x0;_0x2dc616<_0x1961f5['length'];_0x2dc616++)if('elementStart'===_0x1961f5[_0x2dc616]['type']){_0x1961f5[_0x2dc616]['previousPosition']=_0x880b5d['createPositionFromPath'](_0x15d7b7,_0x39f6f0);const _0x4de37e=new _0x46fa7e(_0x1961f5[_0x2dc616]['item']['name'],_0x1961f5[_0x2dc616]['item']['getAttributes']());_0x4cde0d[0x0]['_appendChild'](_0x4de37e),_0x39f6f0['push'](0x0),_0x4cde0d['unshift'](_0x4de37e),_0x1961f5[_0x2dc616]['nextPosition']=_0x880b5d['createPositionFromPath'](_0x15d7b7,_0x39f6f0);}else'elementEnd'===_0x1961f5[_0x2dc616]['type']?(_0x4cde0d['shift'](),_0x1961f5[_0x2dc616]['previousPosition']=_0x880b5d['createPositionFromPath'](_0x15d7b7,_0x39f6f0),_0x39f6f0['pop'](),_0x39f6f0[_0x39f6f0['length']-0x1]++,_0x1961f5[_0x2dc616]['nextPosition']=_0x880b5d['createPositionFromPath'](_0x15d7b7,_0x39f6f0)):(_0x1961f5[_0x2dc616]['previousPosition']=_0x880b5d['createPositionFromPath'](_0x15d7b7,_0x39f6f0),_0x430c4f?_0x430c4f['_data']+=_0x1961f5[_0x2dc616]['item']['data']:_0x430c4f=new _0xbb256d(_0x1961f5[_0x2dc616]['item']['data'],_0x1961f5[_0x2dc616]['item']['getAttributes']()),_0x1961f5[_0x2dc616+0x1]&&'text'===_0x1961f5[_0x2dc616+0x1]['type']&&_0x43a989(_0x430c4f,_0x1961f5[_0x2dc616+0x1]['item'])||(_0x4cde0d[0x0]['_appendChild'](_0x430c4f),_0x430c4f=null),_0x39f6f0[_0x39f6f0['length']-0x1]+=_0x1961f5[_0x2dc616]['item']['offsetSize'],_0x1961f5[_0x2dc616]['nextPosition']=_0x880b5d['createPositionFromPath'](_0x15d7b7,_0x39f6f0));for(let _0x2b3961=0x0;_0x2b3961<_0x1961f5['length'];_0x2b3961++){const _0x18f6e2=_0x1961f5[_0x2b3961]['previousPosition'],_0x28fe31=_0x1961f5[_0x2b3961]['nextPosition'];for(const _0x67149c of _0x1961f5[_0x2b3961]['markersStart'])_0x296a83['set'](_0x67149c,{'start':_0x18f6e2,'end':null});_0x3f6642('isRemoveSuggestion',_0x2b3961,_0x18f6e2,_0x28fe31),_0x3f6642('isAddSuggestion',_0x2b3961,_0x18f6e2,_0x28fe31),_0x3f6642('isRemoved',_0x2b3961,_0x18f6e2,_0x28fe31),_0x3f6642('isAdded',_0x2b3961,_0x18f6e2,_0x28fe31);for(const _0x2ab12c of _0x1961f5[_0x2b3961]['markersEnd']){const _0x2d8c81=_0x296a83['get'](_0x2ab12c);_0x2d8c81?_0x2d8c81['end']=_0x28fe31:_0x296a83['set'](_0x2ab12c,{'start':_0x28fe31,'end':_0x28fe31});}}for(const [_0x240980,_0x44742d]of _0x296a83){const _0x26dbcb=this['editor']['model']['createRange'](_0x44742d['start'],_0x44742d['end']);_0x15d7b7['markers']['set'](_0x240980,_0x26dbcb);}return _0x2741e8['sort']((_0x5c3c6d,_0x20cf13)=>{const _0x36236f=_0x15d7b7['markers']['get']('revision:'+_0x5c3c6d['id']),_0x4ce807=_0x15d7b7['markers']['get']('revision:'+_0x20cf13['id']);return _0x36236f['start']['isBefore'](_0x4ce807['start'])?-0x1:_0x36236f['start']['isAfter'](_0x4ce807['start'])?0x1:_0x36236f['end']['isBefore'](_0x4ce807['end'])?-0x1:_0x36236f['end']['isAfter'](_0x4ce807['end'])?0x1:'add'===_0x5c3c6d['type']?-0x1:0x1;}),{'root':_0x15d7b7,'changes':_0x2741e8};function _0x3f6642(_0x4c6164,_0x350dd8,_0x3d0a45,_0x189dea){const _0x3388c6=!!_0x1961f5[_0x350dd8][_0x4c6164],_0x29f335=_0x3388c6?_0x1961f5[_0x350dd8][_0x4c6164]['userId']:null,_0x11201d=_0x3388c6&&_0x1961f5[_0x350dd8][_0x4c6164]['aiSource']||null,_0x228711=_0x350dd8===_0x1961f5['length']-0x1,_0x19a0b2=_0x2da720[_0x4c6164][0x0],_0x3dd714=_0x2efa32['isObject'](_0x1961f5[_0x350dd8]['item']);!_0x1220ea[_0x4c6164]&&_0x3388c6?_0x1220ea[_0x4c6164]={'start':_0x3d0a45,'tapeItem':_0x1961f5[_0x350dd8],'userId':_0x29f335,'aiSource':_0x11201d,'type':_0x4c6164}:_0x1220ea[_0x4c6164]&&!_0x3388c6?(_0x1220ea[_0x4c6164]['end']=_0x3d0a45,_0x173663(_0x1220ea[_0x4c6164]),_0x1220ea[_0x4c6164]=null):_0x1220ea[_0x4c6164]&&_0x3388c6&&(_0x1220ea[_0x4c6164]['userId']!==_0x29f335||_0x1220ea[_0x4c6164]['aiSource']!==_0x11201d)&&(_0x1220ea[_0x4c6164]['end']=_0x3d0a45,_0x19a0b2&&_0x19a0b2['userId']===_0x1220ea[_0x4c6164]['userId']?_0x19a0b2['change']['aiSource']=_0x19a0b2['change']['aiSource']||_0x1220ea[_0x4c6164]['aiSource']:_0x173663(_0x1220ea[_0x4c6164]),_0x1220ea[_0x4c6164]={'start':_0x3d0a45,'tapeItem':_0x1961f5[_0x350dd8],'userId':_0x29f335,'aiSource':_0x11201d,'type':_0x4c6164}),_0x1220ea[_0x4c6164]&&_0x3dd714&&('elementStart'!==_0x1961f5[_0x350dd8]['type']||_0x19a0b2&&_0x19a0b2['userId']===_0x29f335||_0x2da720[_0x4c6164]['unshift']({'userId':_0x29f335,'object':_0x1961f5[_0x350dd8]['item'],'change':_0x1220ea[_0x4c6164]}),'elementEnd'===_0x1961f5[_0x350dd8]['type']&&_0x19a0b2&&_0x19a0b2['object']===_0x1961f5[_0x350dd8]['item']&&(_0x2da720[_0x4c6164]['shift'](),_0x1220ea[_0x4c6164]=_0x19a0b2['change'])),_0x1220ea[_0x4c6164]&&_0x228711&&(_0x1220ea[_0x4c6164]['end']=_0x189dea,_0x173663(_0x1220ea[_0x4c6164]),_0x1220ea[_0x4c6164]=null);}function _0x173663({start:_0x33d67f,end:_0xca22fb,tapeItem:_0x51736d,userId:_0x4a7737,aiSource:_0x2b58ed,type:_0x42a9a5}){const _0x5f4644=_0x51736d['item'],_0x3ac3d9=_0x880b5d['schema']['isBlock'](_0x5f4644)&&!_0x880b5d['schema']['isLimit'](_0x5f4644),_0x319520=_0x33d67f['nodeAfter']==_0xca22fb['parent']&&_0xca22fb['isAtStart'];if(_0x3ac3d9&&_0x319520)return;const _0x5042ba=_0x880b5d['createRange'](_0x33d67f,_0xca22fb),_0x4f4f43=_0x40dddf['get'](_0x4a7737),_0x2eaff1=new Mt({'author':_0x4f4f43,'type':'isAdded'==_0x42a9a5||'isAddSuggestion'==_0x42a9a5?'add':'remove','data':{'isSuggestion':'isAddSuggestion'==_0x42a9a5||'isRemoveSuggestion'==_0x42a9a5,'aiSource':_0x2b58ed||null},'createdAt':new Date(),'rootName':_0x51eefc});_0x2741e8['push'](_0x2eaff1),_0x15d7b7['markers']['set']('revision:'+_0x2eaff1['id'],_0x5042ba);}function _0x43a989(_0x10e99e,_0x4cfbf6){const _0x1514af=_0x10e99e['getAttributes'](),_0x49c78f=_0x4cfbf6['getAttributes']();for(const _0x16976f of _0x1514af){if(_0x16976f[0x1]!==_0x4cfbf6['getAttribute'](_0x16976f[0x0]))return!0x1;_0x49c78f['next']();}return _0x49c78f['next']()['done'];}}_setConversion(){this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'revision'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision','view':_0x2027b3=>{const _0x5e70b4=_0x2027b3['markerName']['split'](':')[0x1],_0x2fc2db=this['_getChangeFromId'](_0x5e70b4);if(!_0x2fc2db)return null;const _0x281279='add'==_0x2fc2db['type']?'insertion':'deletion',_0x57d5f4=['ck-suggestion-marker','ck-suggestion-marker-'+_0x281279];return _0x2fc2db['data']['isSuggestion']&&_0x57d5f4['push']('ck-suggestion-marker-'+_0x281279+'-new'),this['activeChange']==_0x2fc2db&&_0x57d5f4['push']('ck-suggestion-marker--active'),{'classes':_0x57d5f4,'attributes':{'data-change-id':_0x5e70b4}};}}),this['editor']['conversion']['for']('upcast')['add'](_0x17b0d1=>{_0x17b0d1['on']('element:pre',(_0x2ce7fe,_0x4ac8a6,_0x3f5a4a)=>{const _0x39b0b1=_0x4ac8a6['viewItem']['getChild'](0x0);if(!_0x39b0b1||!_0x39b0b1['is']('element','code'))return;if(!_0x3f5a4a['consumable']['consume'](_0x39b0b1,{'attributes':['vid_start','vid_end']}))return;const _0x4b5afd=_0x4ac8a6['modelRange']['start']['nodeAfter'];_0x3f5a4a['writer']['setAttribute']('vid_start',_0x39b0b1['getAttribute']('vid_start'),_0x4b5afd),_0x3f5a4a['writer']['setAttribute']('vid_end',_0x39b0b1['getAttribute']('vid_end'),_0x4b5afd);},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['add'](_0x3446a5=>{_0x3446a5['on']('element',(_0x342301,_0x2796f1,_0x523de0)=>{if(!_0x523de0['consumable']['consume'](_0x2796f1['viewItem'],{'attributes':['vid_start','vid_end']}))return;if(_0x2796f1['modelRange']['isCollapsed'])return;const _0xfa9304=_0x2796f1['modelRange']['start']['nodeAfter'];_0xfa9304['hasAttribute']('vid_start')||_0xfa9304['hasAttribute']('vid')||(_0x523de0['writer']['setAttribute']('vid_start',_0x2796f1['viewItem']['getAttribute']('vid_start'),_0xfa9304),_0x523de0['writer']['setAttribute']('vid_end',_0x2796f1['viewItem']['getAttribute']('vid_end'),_0xfa9304));},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['elementToAttribute']({'view':{'name':'span','attributes':{'vid':!0x0}},'model':{'key':'vid','value':_0x55795a=>_0x55795a['getAttribute']('vid')}}),this['editor']['model']['schema']['on']('checkAttribute',(_0x14e822,[,_0x179c8b])=>{['vid_start','vid_end','vid']['includes'](_0x179c8b)&&(_0x14e822['return']=!0x0,_0x14e822['stop']());},{'priority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x255fd0=>{_0x255fd0['on']('attribute:vid',(_0x2eaab2,_0x509658,_0x52e2ec)=>{if('\x20'!=_0x509658['item']['data']||_0x509658['item']['parent']['maxOffset']>0x1)return;if(!_0x52e2ec['consumable']['consume'](_0x509658['item'],_0x2eaab2['name']))return;const _0x284104=_0x52e2ec['writer'],_0x54e6bb=_0x52e2ec['mapper']['toViewRange'](_0x509658['range']);_0x284104['wrap'](_0x54e6bb,_0x284104['createAttributeElement']('span'));});}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',function(_0x38124a){const _0x949ea6=_0x38124a['plugins']['get']('RevisionViewer');return(_0x4e93c6,_0x559aeb,_0x288177)=>{const _0x541c6e=_0x559aeb['markerName']['split'](':')[0x1],_0x559b83=_0x949ea6['_getChangeFromId'](_0x541c6e);if(!_0x559b83)return null;const _0x45139c='add'==_0x559b83['type']?'split':'merge';if(!_0x288177['consumable']['test'](_0x559aeb['markerRange'],_0x4e93c6['name']))return;const _0x49a755=_0x559aeb['markerRange']['getWalker'](),_0x1d0ddb=_0x559aeb['markerRange']['start'],_0x2385cc=_0x38124a['model']['schema'];let _0x46482c=null,_0x4bc608=null,_0x44dd1f=!0x1,_0x20b0c4=!0x1;for(const _0x18e555 of _0x49a755){const _0x486508=_0x18e555['item'];_0x44dd1f=_0x44dd1f||_0x2385cc['isContent'](_0x486508);const _0x453f2a=_0x288177['mapper']['toViewElement'](_0x486508);if(_0x453f2a&&_0x453f2a['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x18e555['type']&&(_0x2385cc['isBlock'](_0x486508)&&!_0x2385cc['isLimit'](_0x486508)&&(_0x486508['nextSibling']||_0x1d0ddb['isAtEnd']?_0x46482c&&_0x46482c['parent']==_0x486508||(_0x46482c=_0x486508,_0x4f339e(_0x18e555['previousPosition']),_0x20b0c4=!0x0):_0x4bc608=_0x4bc608||_0x18e555['previousPosition']));}function _0x4f339e(_0xc21f95){const _0x591791=_0x288177['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x45139c}),_0x6b8841=_0x288177['mapper']['toViewPosition'](_0xc21f95);_0x559b83['data']['isSuggestion']&&_0x288177['writer']['addClass']('ck-suggestion-marker-'+_0x45139c+'-new',_0x591791),_0x949ea6['activeChange']==_0x559b83&&_0x288177['writer']['addClass']('ck-suggestion-marker--active',_0x591791),_0x288177['writer']['insert'](_0x6b8841,_0x591791),_0x288177['mapper']['bindElementToMarker'](_0x591791,_0x559aeb['markerName']);}_0x44dd1f||_0x20b0c4||!_0x4bc608||_0x4f339e(_0x4bc608);};}(this['editor']),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision',(_0x552ed5,_0x2d2edc,_0x3b66ba)=>{const _0x29b74a=_0x3b66ba['mapper']['markerNameToElements'](_0x2d2edc['markerName']);if(_0x29b74a){for(const _0x486bb0 of _0x29b74a)(_0x486bb0['hasClass']('ck-suggestion-marker-split')||_0x486bb0['hasClass']('ck-suggestion-marker-merge'))&&(_0x3b66ba['mapper']['unbindElementFromMarkerName'](_0x486bb0,_0x2d2edc['markerName']),_0x3b66ba['writer']['remove'](_0x486bb0));}},{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',(_0x88e843,_0x325350,_0x35199f)=>{const _0x4ed39c=_0x325350['markerName']['split'](':')[0x1],_0x31f1d1=this['_getChangeFromId'](_0x4ed39c);if(!_0x31f1d1)return null;const _0x2ac4a8='add'==_0x31f1d1['type']?'split':'merge';if(_0x35199f['consumable']['test'](_0x325350['markerRange'],_0x88e843['name']))for(const _0x36b828 of _0x325350['markerRange']['getItems']()){if(!_0x36b828['is']('element','softBreak'))continue;const _0x23b943=_0x35199f['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x2ac4a8}),_0x5bb7b7=_0x35199f['mapper']['toViewPosition'](this['editor']['model']['createPositionBefore'](_0x36b828));_0x31f1d1['data']['isSuggestion']&&_0x35199f['writer']['addClass']('ck-suggestion-marker-'+_0x2ac4a8+'-new',_0x23b943),this['activeChange']==_0x31f1d1&&_0x35199f['writer']['addClass']('ck-suggestion-marker--active',_0x23b943),_0x35199f['writer']['insert'](_0x5bb7b7,_0x23b943),_0x35199f['mapper']['bindElementToMarker'](_0x23b943,_0x325350['markerName']);}},{'priority':'high'}),this['editor']['model']['document']['on']('change',()=>{this['editor']['editing']['view']['change'](_0x133dd4=>{for(const _0x519316 of this['editor']['model']['document']['getRootNames']()){const _0x47ef5d=this['editor']['model']['document']['getRoot'](_0x519316),_0x34b9f2=this['editor']['editing']['view']['document']['getRoot'](_0x519316);if(_0x34b9f2){const _0x6b4334=_0x47ef5d['getAttribute']('revisionHistoryAttachChange');if(_0x133dd4['removeAttribute']('data-change-id',_0x34b9f2),_0x133dd4['removeClass']('ck-revision-history-root-add',_0x34b9f2),_0x133dd4['removeClass']('ck-revision-history-root-remove',_0x34b9f2),_0x133dd4['removeClass']('ck-revision-history-root--active',_0x34b9f2),_0x6b4334){const _0x5e3686=this['_getChangeFromId'](_0x6b4334);if(!_0x5e3686)return null;_0x133dd4['setAttribute']('data-change-id',_0x6b4334,_0x34b9f2),_0x133dd4['addClass']('ck-revision-history-root-'+_0x5e3686['type'],_0x34b9f2),this['activeChange']==_0x5e3686&&_0x133dd4['addClass']('ck-revision-history-root--active',_0x34b9f2);}}}});}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'comment','model':_0xf35082=>'revision-comment:'+_0xf35082,'converterPriority':'highest'}),this['_showCommentHighlights']&&this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-comment','view':_0x218860=>({'classes':['ck-comment-marker'],'attributes':{'data-comment':Ut(_0x218860['markerName'])}})}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'suggestion','model':_0x3af1c3=>'revision-suggestion:'+_0x3af1c3,'converterPriority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision-suggestion','view':_0x219abd=>({'name':'suggestion:'+_0x219abd,'group':'revision-suggestion'}),'converterPriority':'highest'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-suggestion','view':_0xa3063d=>{const _0x36df32=_0xa3063d['markerName']['split'](':')[0x1];return'insertion'!=_0x36df32&&'deletion'!=_0x36df32?null:{'classes':['ck-suggestion-preview-marker','ck-suggestion-preview-marker-'+_0x36df32]};}}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:deletion',Lt(this['editor'],'merge'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:insertion',Lt(this['editor'],'split'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision-suggestion',(_0x4cb149,_0x2a1ba0,_0x11fbc6)=>{const _0x223ffa=_0x11fbc6['mapper']['markerNameToElements'](_0x2a1ba0['markerName']);if(_0x223ffa){for(const _0x5adf90 of _0x223ffa)_0x5adf90['is']('uiElement')&&(_0x11fbc6['mapper']['unbindElementFromMarkerName'](_0x5adf90,_0x2a1ba0['markerName']),_0x11fbc6['writer']['remove'](_0x5adf90));}},{'priority':'high'});}_getChangeFromId(_0x37047a){return this['_changeIdToChange']['get'](_0x37047a);}_getViewForChange(_0x3f368a){return this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=new Vt(this['editor']['locale'],_0x3f368a,'pill'===this['editor']['config']['get']('revisionHistory.showAISource')),this['_changeView'];}_initInteractions(){this['editor']['model']['document']['selection']['observeMarkers']('revision'),this['on']('change:activeView',(_0x467623,_0x5ec4ea,_0x5af601,_0xb49070)=>{_0xb49070&&this['_balloon']['remove'](_0xb49070),_0x5af601&&(this['_balloon']['add']({'view':_0x5af601,'stackId':'revisionHistoryLabel','position':{'target':()=>{const _0x2e81c4=this['editor']['editing'],_0x5acb11=this['_getChangeFromId'](_0x5af601['changeId']);let _0x1f6474;if(_0x5acb11['data']['isOnRoot']){const _0x29f1a5=_0x2e81c4['view']['getDomRoot'](_0x5acb11['rootName']);_0x1f6474=Array['from'](_0x29f1a5['getClientRects']());}else{const _0x505c7e=this['editor']['model']['markers']['get']('revision:'+_0x5af601['changeId']);_0x1f6474=Array['from'](_0x2e81c4['mapper']['markerNameToElements'](_0x505c7e['name']))['map'](_0x327338=>_0x2e81c4['view']['domConverter']['mapViewToDom'](_0x327338))['map'](_0x1b3ed3=>Array['from'](_0x1b3ed3['getClientRects']()))['flat']();}return this['_activeViewTarget']&&_0x1f6474['find'](_0x3d4cba=>_0x3d4cba['top']-0x3<=this['_activeViewTarget']['y']&&_0x3d4cba['bottom']+0x3>=this['_activeViewTarget']['y']&&_0x3d4cba['left']-0x3<=this['_activeViewTarget']['x']&&_0x3d4cba['right']+0x3>=this['_activeViewTarget']['x'])||_0x1f6474[0x0];}}}),this['_balloon']['showStack']('revisionHistoryLabel'));}),this['on']('change:activeChange',(_0x5ece84,_0x1c3c3b,_0x38b57a,_0x821d41)=>{this['activeView']=_0x38b57a?this['_getViewForChange'](_0x38b57a):null,this['editor']['model']['change'](()=>{const _0x40e9af=this['editor']['editing'];_0x821d41&&(_0x821d41['data']['isOnRoot']?_0x40e9af['view']['change'](_0x41d87b=>{_0x41d87b['removeClass']('ck-revision-history-root--active',_0x40e9af['view']['document']['getRoot'](_0x821d41['rootName']));}):_0x40e9af['reconvertMarker']('revision:'+_0x821d41['id'])),_0x38b57a&&(_0x38b57a['data']['isOnRoot']?_0x40e9af['view']['change'](_0x388340=>{_0x388340['addClass']('ck-revision-history-root--active',_0x40e9af['view']['document']['getRoot'](_0x38b57a['rootName']));}):_0x40e9af['reconvertMarker']('revision:'+_0x38b57a['id']));});}),this['listenTo'](this['editor']['editing']['view']['document'],'mouseover',(_0x4cc0f4,_0x11b108)=>{if(this['activeChange'])return;const _0x8065d7=this['_findChangeIdFromDomTarget'](_0x11b108['target']),_0x5941a5=this['_changeIdToChange']['get'](_0x8065d7);_0x5941a5?(this['_activeViewTarget']={'x':_0x11b108['domEvent']['x'],'y':_0x11b108['domEvent']['y']},this['activeView']=this['_getViewForChange'](_0x5941a5)):(this['_activeViewTarget']=null,this['activeView']=null);}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',(_0x5ba6d8,_0x11f726)=>{const _0x860bd3=this['_findChangeIdFromDomTarget'](_0x11f726['target']),_0x566925=this['_changeIdToChange']['get'](_0x860bd3);_0x566925?(this['_activeViewTarget']={'x':_0x11f726['domEvent']['x'],'y':_0x11f726['domEvent']['y']},_0x566925===this['activeChange']?this['_balloon']['updatePosition']():this['activeChange']=_0x566925):(this['_activeViewTarget']=null,this['activeChange']=null);});}_findChangeIdFromDomTarget(_0x1e452b){do{const _0x5806c4=_0x1e452b['getAttribute']('data-change-id');if(_0x5806c4)return _0x5806c4;_0x1e452b=_0x1e452b['parent'];}while(_0x1e452b);return null;}['_cleanMarkers'](){this['editor']['model']['change'](_0x1a88ba=>{for(const _0x2cf4dc of this['editor']['model']['markers'])_0x1a88ba['removeMarker'](_0x2cf4dc);});}};function Ut(_0x3348da){return _0x3348da['split'](':')[0x1];}function Lt(_0x5471be,_0x32c827){return(_0x141105,_0x4a1f0e,_0x4e16d0)=>{if(!_0x4e16d0['consumable']['test'](_0x4a1f0e['markerRange'],_0x141105['name']))return;const _0x4f1fc0=_0x4a1f0e['markerRange']['getWalker'](),_0x28281d=_0x4a1f0e['markerRange']['start'],_0x3e39df=_0x5471be['model']['schema'];let _0x44cd9d=null,_0x4bdb2d=null,_0x1b325e=!0x1,_0x4387ee=!0x1;for(const _0x11df57 of _0x4f1fc0){const _0x4df3de=_0x11df57['item'];_0x1b325e=_0x1b325e||_0x3e39df['isContent'](_0x4df3de);const _0xf33ea=_0x4e16d0['mapper']['toViewElement'](_0x4df3de);if(_0xf33ea&&_0xf33ea['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x11df57['type']&&(_0x3e39df['isBlock'](_0x4df3de)&&!_0x3e39df['isLimit'](_0x4df3de)&&(_0x4df3de['nextSibling']||_0x28281d['isAtEnd']?_0x44cd9d&&_0x44cd9d['parent']==_0x4df3de||(_0x44cd9d=_0x4df3de,_0x309e04(_0x11df57['previousPosition']),_0x4387ee=!0x0):_0x4bdb2d=_0x4bdb2d||_0x11df57['previousPosition']));}function _0x309e04(_0x292da9){const _0x1c1646=_0x4e16d0['mapper']['toViewPosition'](_0x292da9),_0x1b0c3a=_0x4e16d0['writer']['createUIElement']('span',{'class':'ck-suggestion-preview-marker-'+_0x32c827});_0x4e16d0['writer']['insert'](_0x1c1646,_0x1b0c3a),_0x4e16d0['mapper']['bindElementToMarker'](_0x1b0c3a,_0x4a1f0e['markerName']);}_0x1b325e||_0x4387ee||!_0x4bdb2d||_0x309e04(_0x4bdb2d);};}var Ft=class extends _0x4898a1{constructor(_0x22ba82){super(_0x22ba82);const _0x2deda2=_0x22ba82['plugins']['get'](Pt);this['affectsData']=!0x1,this['listenTo'](_0x2deda2,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x2deda2,'change:isEnabled',()=>this['refresh']());}execute(){const _0x58e45c=this['editor'],_0x4766f4=_0x58e45c['plugins']['get'](Pt),_0x14f70f=_0x4766f4['isReady']?_0x4766f4['diff']['newRevisionId']:null;_0x58e45c['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x14f70f);}['refresh'](){const {isReady:_0x50b883,isEnabled:_0x4816e0,repository:_0x3a30dc,diff:_0x310b1d}=this['editor']['plugins']['get'](Pt),_0x1ca2be=_0x310b1d&&_0x3a30dc['getLaterVisibleRevision'](_0x310b1d['newRevisionId']);this['isEnabled']=_0x50b883&&_0x4816e0&&Boolean(_0x1ca2be);}},$t=class extends _0x4898a1{_step;constructor(_0x3b29f1,{direction:_0x4a6dfe}){super(_0x3b29f1);const _0x598153=_0x3b29f1['plugins']['get'](Pt);this['affectsData']=!0x1,this['_step']='forward'===_0x4a6dfe?0x1:-0x1,this['listenTo'](_0x598153,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x598153,'change:isEnabled',()=>this['refresh']()),this['listenTo'](_0x598153,'change:activeChange',()=>this['refresh']());}execute(){const _0x447643=this['editor'],_0x173cac=_0x447643['plugins']['get'](Pt),{isNavigationMode:_0x461408,currentChangeNumber:_0x8e098c}=_0x173cac;let _0x596d8a;if(_0x173cac['activeChange']=_0x461408?_0x173cac['diff']['changes']['get'](_0x8e098c+this['_step']):_0x173cac['diff']['changes']['first'],_0x173cac['activeChange']['data']['isOnRoot'])_0x596d8a=_0x447643['editing']['view']['getDomRoot'](_0x173cac['activeChange']['rootName']);else{const _0x84977f=_0x447643['model']['markers']['get']('revision:'+_0x173cac['activeChange']['id']);_0x596d8a=_0x1f622b(_0x447643['editing'],_0x84977f);}_0x465f96({'target':_0x596d8a,'viewportOffset':0x28});}['refresh'](){const {isNavigationMode:_0x327538,currentChangeNumber:_0x515598,numberOfChanges:_0x394979,isReady:_0x2465b6,isEnabled:_0x214e02}=this['editor']['plugins']['get'](Pt);this['isEnabled']=!!(_0x214e02&&_0x2465b6&&_0x394979)&&(!_0x327538||(0x1===this['_step']?_0x515598<_0x394979-0x1:_0x515598>0x0));}},Bt=class extends dt{constructor(_0x2550e1){super(_0x2550e1);const _0x300999=this['bindTemplate'],_0xe05fce=new _0x1271a8(_0x2550e1),_0x16643c=new _0x1271a8(_0x2550e1);this['set']('isNavigationMode',!0x1),this['set']('isReady',!0x1),this['set']('currentChangeNumber',0x0),this['set']('numberOfChanges',0x0),this['set']('isForwardNavigationEnabled',!0x1),this['set']('isBackwardNavigationEnabled',!0x1),this['bind']('_isStatusLabelVisible')['to'](this,'isReady',this,'numberOfChanges',(_0x53d3b0,_0x612b58)=>_0x53d3b0&&_0x612b58>0x0),this['bind']('_statusText')['to'](this,'isReady',this,'currentChangeNumber',this,'numberOfChanges',this,'isNavigationMode',(_0x3dc5c0,_0x66e1a7,_0x47c322,_0x1f4039)=>{if(!_0x3dc5c0)return kt(_0x2550e1,'Loading...');if(!_0x47c322)return kt(_0x2550e1,'No\x20changes');const _0x5c927d=kt(_0x2550e1,'NUMBER_OF_CHANGES',_0x47c322);return _0x1f4039?kt(_0x2550e1,'X_OF_Y_CHANGES',[_0x66e1a7+0x1,_0x47c322]):_0x5c927d;}),_0xe05fce['set']({'label':kt(_0x2550e1,'Show\x20previous\x20change'),'tooltip':!0x0,'icon':_0x173f8c}),_0x16643c['set']({'label':kt(_0x2550e1,'Show\x20next\x20change'),'tooltip':!0x0,'icon':_0xdd01e2}),_0xe05fce['bind']('isEnabled')['to'](this,'isBackwardNavigationEnabled'),_0x16643c['bind']('isEnabled')['to'](this,'isForwardNavigationEnabled'),_0xe05fce['on']('execute',()=>this['fire']('execute','backward')),_0x16643c['on']('execute',()=>this['fire']('execute','forward')),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-revision-history-ui','ck-revision-history-ui__changes-navigation']},'children':[{'tag':'span','attributes':{'class':['ck-revision-history-ui__changes-navigation__wrapper']},'children':[{'tag':'span','attributes':{'class':['ck-revision-history-ui__changes-navigation__label',_0x300999['if']('_isStatusLabelVisible','ck-hidden',_0x452133=>!_0x452133)]},'children':[{'text':_0x300999['to']('isNavigationMode',_0x2dd35a=>_0x2dd35a?kt(_0x2550e1,'EDIT_X_OF_Y_REVISIONS')+':\x20':kt(_0x2550e1,'Total')+':\x20')}]},{'text':_0x300999['to']('_statusText')}]},new ct(),{'tag':'div','attributes':{'class':['ck-revision-history-ui__changes-navigation__navigation']},'children':[_0xe05fce,_0x16643c]}]});}};const jt='ck-editor__editable__loading-overlay';var Gt=class extends _0x17a398{static get['pluginName'](){return'RevisionViewerLoadingOverlay';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['show'](){const _0x1b3a41=this['editor']['editing']['view'];_0x1b3a41['change'](_0xc2644a=>{for(const _0x1fb9b1 of _0x1b3a41['document']['roots'])_0xc2644a['addClass'](jt,_0x1fb9b1);});}['hide'](){const _0x359118=this['editor']['editing']['view'];_0x359118['change'](_0x29ee84=>{for(const _0x2b2492 of _0x359118['document']['roots'])_0x29ee84['removeClass'](jt,_0x2b2492);});}},Kt=class extends _0x17a398{static get['pluginName'](){return'RevisionViewerUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Pt,Gt];}init(){const _0x1d25f7=this['editor'],_0x30b91b=_0x1d25f7['plugins']['get'](Pt),_0x547f2d=_0x1d25f7['plugins']['get'](Gt);_0x1d25f7['ui']['componentFactory']['add']('exitToEditing',_0x443bbc=>{const _0x520ae=new _0x1271a8(_0x443bbc);return _0x520ae['set']({'label':kt(_0x443bbc,'Back\x20to\x20editing'),'icon':_0x217bff,'withText':!0x0,'tooltip':!0x0,'class':'ck-revision-history-ui__back-to-editing'}),this['listenTo'](_0x520ae,'execute',()=>{_0x1d25f7['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}),_0x520ae;}),_0x1d25f7['ui']['componentFactory']['add']('restoreRevision',_0x2bc56f=>{const _0x3e2e07=new _0x1271a8(_0x2bc56f);return _0x3e2e07['set']({'label':kt(_0x2bc56f,'Restore\x20this\x20revision'),'withText':!0x0,'tooltip':!0x0}),_0x3e2e07['bind']('isEnabled')['to'](_0x1d25f7['commands']['get']('restoreRevision')),this['listenTo'](_0x3e2e07,'execute',()=>_0x1d25f7['execute']('restoreRevision')),_0x3e2e07;}),_0x1d25f7['ui']['componentFactory']['add']('changesNavigation',_0x11a91a=>{const _0x4b3055=new Bt(_0x11a91a),_0x4cdb82=_0x1d25f7['commands']['get']('showPreviousChange'),_0x5a6eac=_0x1d25f7['commands']['get']('showNextChange');return _0x4b3055['bind']('isBackwardNavigationEnabled')['to'](_0x4cdb82,'isEnabled'),_0x4b3055['bind']('isForwardNavigationEnabled')['to'](_0x5a6eac,'isEnabled'),_0x4b3055['bind']('isReady','currentChangeNumber','numberOfChanges','isNavigationMode')['to'](_0x30b91b),this['listenTo'](_0x4b3055,'execute',(_0x1aff4c,_0x10f4d6)=>{_0x1d25f7['execute']('forward'===_0x10f4d6?'showNextChange':'showPreviousChange');}),_0x4b3055;}),_0x547f2d['show'](),_0x30b91b['on']('change:isReady',(_0x3dd0f2,_0x4a83d0,_0x5daef8)=>{_0x5daef8?_0x547f2d['hide']():_0x547f2d['show']();});}},qt=class extends it{['_resizeObserver']=null;constructor(_0x1b7138,_0x2ae433){super(_0x1b7138,_0x2ae433);const _0x19d30e=this['bindTemplate'];this['set']({'label':kt(_0x1b7138,'Revision\x20name'),'_tooltipString':''}),this['fieldView']['placeholder']=kt(_0x1b7138,'Enter\x20the\x20revision\x20name'),this['extendTemplate']({'tag':'span','attributes':{'class':['ck-revision-history-sidebar__revision-name'],'data-cke-tooltip-text':_0x19d30e['to']('_tooltipString'),'data-cke-tooltip-position':'s','data-cke-tooltip-class':'ck-tooltip_multi-line'}});}['render'](){super['render'](),this['_resizeObserver']=new _0x2bc3ba(this['fieldView']['element'],()=>this['_updateTooltipText']()),this['listenTo'](this['fieldView'],'input',()=>this['_updateTooltipText']());}destroy(){super['destroy'](),this['_resizeObserver']&&this['_resizeObserver']['destroy']();}_updateTooltipText(){const _0x5c1197=this['fieldView']['element'];this['_tooltipString']=_0x5c1197['scrollWidth']>_0x5c1197['clientWidth']&&_0x5c1197['value']||'';}},Yt=class extends dt{constructor(_0x41d8f2,_0x5003c4,_0x3f9c11){super(_0x41d8f2);const _0x39dd4c=new _0x542efe();_0x39dd4c['set']({'content':_0xc3ee26,'viewBox':'0\x200\x2011\x2010'});const _0x5dc881=['ck','ck-revision-history-sidebar__revision-author'];_0x3f9c11&&_0x5dc881['push']('ck-revision-history-sidebar__revision-author_creator');const _0x5b1927=[{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__revision-author__name'],'title':kt(_0x41d8f2,_0x3f9c11?'Revision\x20creator':'Revision\x20author')},'children':[_0x39dd4c,_0x5003c4['name']]}];this['setTemplate']({'tag':'li','attributes':{'class':_0x5dc881},'children':_0x5b1927});}};function Jt(_0x1850eb,_0x34037a){const _0x40fc62=_0x1850eb['bindTemplate'],_0x405de=_0x1850eb['locale'],_0x275f77=vt(_0x405de);_0x275f77['panelPosition']='sw';const _0x26b102=function(_0xf62b14,_0x366b7e){const _0x55afab=function(_0x514f14,_0x23db80){const _0x48be4a=_0x514f14['locale'],_0x38c1ac={'Compare\x20against\x20selected':kt(_0x48be4a,'Compare\x20against\x20selected'),'Name\x20this\x20revision':kt(_0x48be4a,'Name\x20this\x20revision'),'Restore\x20this\x20revision':kt(_0x48be4a,'Restore\x20this\x20revision')};return _0x23db80['map'](_0x46fe29=>{const _0x32ab86=_0x38c1ac[_0x46fe29['name']];return _0x32ab86&&_0x32ab86!==_0x46fe29['name']&&(_0x46fe29['name']=_0x32ab86),_0x46fe29;});}(_0xf62b14,_0x366b7e),_0xbae6e4=new _0x6e554a();for(const _0x21b1c7 of _0x55afab){const _0x2d3571={'type':'button','model':new ut({'label':_0x21b1c7['name'],'class':_0x21b1c7['class'],'withText':!0x0,'role':'menuitem','_action':_0x21b1c7['action']})};_0x2d3571['model']['bind']('isEnabled')['to'](_0xf62b14,'isActionsDropdownOpen',_0x76ad22=>'function'!=typeof _0x21b1c7['isEnabled']||(!_0x76ad22||_0x21b1c7['isEnabled'](_0xf62b14))),_0xbae6e4['add'](_0x2d3571);}return _0xbae6e4;}(_0x1850eb,_0x34037a);return _0x1850eb['bind']('isActionsDropdownOpen')['to'](_0x275f77,'isOpen'),_0x275f77['buttonView']['set']({'label':kt(_0x405de,'Show\x20more\x20items'),'tooltip':!0x0,'tooltipPosition':'sw','icon':_0x19e5e5}),_0x275f77['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision__actions',_0x40fc62['if']('isActionsDropdownOpen','ck-on')]},'on':{'click':_0x40fc62['to'](_0x22c224=>_0x22c224['stopPropagation']())}}),_0x275f77['on']('execute',_0x5145d9=>{_0x1850eb['isReady']&&'function'==typeof _0x5145d9['source']['_action']&&_0x5145d9['source']['_action'](_0x1850eb);}),ft(_0x275f77,_0x26b102,{'role':'menu'}),_0x275f77['listenTo'](_0x1850eb,'change:isActionsDropdownOpen',(_0x4c5520,_0x45ce11,_0x3fa84a)=>{if(_0x3fa84a)for(const _0x529e4e of _0x275f77['listView']['items']){const _0x312e06=_0x529e4e['children']['first'],_0x18fb12=_0x34037a['find'](_0x5ef35a=>_0x5ef35a['action']===_0x312e06['_action'])['isVisible'];_0x529e4e['isVisible']=void 0x0===_0x18fb12||_0x18fb12(_0x1850eb);}}),_0x275f77;}const Wt=/* #__PURE__ -- @preserve */
27
- _0x38d5e1(dt);var Xt=class extends Wt{['id'];['revisionNameView'];revisionActionsView;['_revision'];_requireRevisionName;['_aiPillView'];constructor(_0x638cd2,_0x2b61b1,_0x356233,_0x54f019,_0x21ecef=!0x1){super(_0x638cd2);const _0x331a3f=this['bindTemplate'],_0x3c61ef=function(_0x4595ad,_0x2b9ec9){const _0x4b6deb=Array['from'](_0x2b9ec9['authors'])['filter'](_0x32f348=>_0x32f348!=_0x2b9ec9['creator']);return _0x2b9ec9['creator']&&_0x4b6deb['unshift'](_0x2b9ec9['creator']),_0x4b6deb['map'](_0x54a702=>new Yt(_0x4595ad,_0x54a702,_0x54a702==_0x2b9ec9['creator']));}(_0x638cd2,_0x2b61b1);this['id']=_0x2b61b1['id'],this['_revision']=_0x2b61b1,this['_requireRevisionName']=_0x54f019,this['bind']('_isAiGenerated')['to'](_0x2b61b1,'attributes',_0x4d3c4c=>!(!_0x4d3c4c||!_0x4d3c4c['@ai'])),this['bind']('name','createdAt')['to'](_0x2b61b1),this['bind']('_createdAtFormatted')['to'](this,'createdAt',_0x33f5a1=>{return _0x505837=_0x638cd2['uiLanguage'],(_0xfd7d54=_0x33f5a1)['toLocaleDateString'](_0x505837,{'month':'long','day':'numeric'})+',\x20'+_0xfd7d54['toLocaleTimeString'](_0x505837,{'hour':'numeric','minute':'numeric'});var _0x505837,_0xfd7d54;}),this['set']('isSelected',!0x1),this['set']('isHighlighted',!0x1),this['set']('isActionsDropdownOpen',!0x1),this['set']('isReady',!0x1),this['set']('isEnabled',!0x1),this['revisionNameView']=new qt(_0x638cd2,gt),this['revisionNameView']['fieldView']['extendTemplate']({'attributes':{'maxlength':'220'}}),this['revisionNameView']['fieldView']['bind']('value')['to'](this,'name',_0x5617ec=>_0x5617ec||this['_createdAtFormatted']),this['revisionNameView']['bind']('isEnabled')['to'](this,'isSelected',this,'isEnabled',(_0x115e30,_0x285dd2)=>_0x115e30&&_0x285dd2),this['revisionActionsView']=_0x356233&&_0x356233['length']?Jt(this,_0x356233):'',this['revisionActionsView']&&this['revisionActionsView']['bind']('isEnabled')['to'](this),this['_aiPillView']=_0x21ecef?this['_createAiPillView'](_0x638cd2):null,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision-wrapper',_0x331a3f['if']('isConfirm','ck-revision-history-sidebar__revision-wrapper_confirmation_visible')]},'children':[{'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision',_0x331a3f['if']('isEnabled','ck-disabled',_0x42f526=>!_0x42f526),_0x331a3f['if']('isSelected','ck-revision-history-sidebar__revision_selected'),_0x331a3f['if']('isHighlighted','ck-revision-history-sidebar__revision_highlighted'),_0x331a3f['if']('isActionsDropdownOpen','ck-revision-history-sidebar__actions_dropdown_open')]},'children':[this['revisionNameView'],{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__revision__date']},'children':[{'text':_0x331a3f['to']('_createdAtFormatted')}]},{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__revision__controls-wrapper']},'children':[{'tag':'ul','attributes':{'class':['ck','ck-revision-history-sidebar__revision-authors']},'children':_0x3c61ef}]},..._0x21ecef?[{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__revision-ai-pill-row',_0x331a3f['if']('_isAiGenerated','ck-hidden',_0x3ce1c0=>!_0x3ce1c0)]},'children':[this['_aiPillView']]}]:[],this['revisionActionsView']],'on':{'click':_0x331a3f['to'](_0x185247=>{_0x185247['srcElement']['closest']('.ck-confirm-view')||this['isReady']&&this['isEnabled']&&this['fire']('select',{'id':this['id']});})}}]});}_createAiPillView(_0x166e65){const _0x356431=new _0x376167(_0x166e65);return _0x356431['set']({'icon':_0x5dc770,'label':kt(_0x166e65,'REVISION_AI_SOURCE_PILL_LABEL'),'tooltip':kt(_0x166e65,'AI_SOURCE_REVISION_TOOLTIP'),'tooltipPosition':'s','size':'small','class':'ck-pill_ai'}),_0x356431['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision-ai-pill']}}),_0x356431;}['render'](){super['render']();const _0x45da91=this['revisionNameView']['fieldView']['element'];this['listenTo'](_0x45da91,'change',()=>{this['_requireRevisionName']&&!_0x45da91['value']||this['fire']('setName',{'id':this['id'],'name':_0x45da91['value']}),_0x45da91['value']||(_0x45da91['value']=this['name']?this['name']:this['_createdAtFormatted']);});}select(){this['isSelected']=!0x0;}deselect(){this['isSelected']=!0x1;}highlight(){this['isHighlighted']=!0x0;}unhighlight(){this['isHighlighted']=!0x1;}};function Qt(_0x15b475,_0x74c653){const _0x9adb1c=wt['fromJSDate'](_0x15b475)['setLocale'](_0x74c653),_0x4a128e=wt['local'](),_0x50137d=_0x4a128e['minus']({'days':0x1})['startOf']('day');let _0x480b7f,_0x2825b7;return _0x9adb1c['hasSame'](_0x4a128e,'day')?(_0x480b7f=_0x9adb1c['startOf']('day')['toJSDate'](),_0x2825b7=_0x9adb1c['toRelativeCalendar']()):_0x9adb1c['hasSame'](_0x50137d,'day')?(_0x480b7f=_0x50137d['toJSDate'](),_0x2825b7=_0x9adb1c['toRelativeCalendar']()):_0x9adb1c['hasSame'](_0x4a128e,'week')?(_0x480b7f=_0x9adb1c['startOf']('week')['toJSDate'](),_0x2825b7=_0x9adb1c['weekdayLong']||''):_0x9adb1c['hasSame'](_0x4a128e,'year')?(_0x480b7f=_0x9adb1c['startOf']('month')['toJSDate'](),_0x2825b7=_0x9adb1c['monthLong']||''):(_0x480b7f=_0x9adb1c['startOf']('year')['toJSDate'](),_0x2825b7=String(_0x9adb1c['year'])),{'startDate':_0x480b7f,'localizedPeriodName':_0x2825b7};}var zt=class extends dt{startDate;['revisionViews'];_revisionActions;_requireRevisionName;['_showAISource'];constructor(_0x1978dd,_0x1f31db,_0x573850,_0x3f6b86,_0x4e8f9a){super(_0x1978dd);const _0x42b99e=Qt(_0x1f31db,this['locale']['uiLanguage'])['localizedPeriodName'];this['startDate']=_0x1f31db,this['revisionViews']=this['createCollection'](),this['_revisionActions']=_0x573850,this['_requireRevisionName']=_0x3f6b86,this['_showAISource']=_0x4e8f9a,this['revisionViews']['delegate']('select')['to'](this),this['revisionViews']['delegate']('setName')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__time-period']},'children':[{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__time-period__label']},'children':[{'text':_0x42b99e}]},{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__time-period__revisions']},'children':this['revisionViews']}]});}['addRevision'](_0x24f78c){const _0xf05b7=new Xt(this['locale'],_0x24f78c,this['_revisionActions'],this['_requireRevisionName'],this['_showAISource']);this['revisionViews']['add'](_0xf05b7);}['removeRevision'](_0x397542){const _0x5d5e62=this['revisionViews']['find'](_0x5942ea=>_0x5942ea['id']===_0x397542['id']);this['revisionViews']['remove'](_0x5d5e62);}},Zt=class extends dt{constructor(_0x21db76){super(_0x21db76);const _0x24ad24=new _0x542efe();_0x24ad24['content']=_0x4d32d0,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-revision-history-sidebar__header']},'children':[_0x24ad24,{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__header__label']},'children':[kt(_0x21db76,'Revision\x20history')]}]});}},ti=class extends dt{timePeriodViews;['_revisions'];_revisionActions;_requireRevisionName;['_showAISource'];constructor(_0x2f3703,_0x5b4f17,_0x2c9b37,_0x418241,_0x4c4ecf){super(_0x2f3703);const _0x509270=this['bindTemplate'];this['timePeriodViews']=this['createCollection'](),this['timePeriodViews']['delegate']('select')['to'](this),this['timePeriodViews']['delegate']('setName')['to'](this),this['_revisions']=_0x5b4f17,this['_revisionActions']=_0x2c9b37,this['_requireRevisionName']=_0x418241,this['_showAISource']=_0x4c4ecf,this['on']('select',(_0x4f250f,_0x1bf5eb)=>{this['fire']('revisionSelected',_0x1bf5eb);}),this['on']('setName',(_0x4799cc,_0x2e92c7)=>{this['fire']('revisionSetName',_0x2e92c7);}),this['set']('isEnabled',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-rounded-corners','ck-revision-history-sidebar']},'children':[new Zt(_0x2f3703),{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__timeline',_0x509270['if']('isEnabled','ck-disabled',_0x515a0e=>!_0x515a0e)]},'children':this['timePeriodViews']}]});}['render'](){super['render']();for(const _0x5dd348 of this['_revisions'])this['_addRevision'](_0x5dd348);this['_revisions']['on']('add',(_0x6ed850,_0x3f4048)=>{this['_addRevision'](_0x3f4048);}),this['_revisions']['on']('remove',(_0x54c418,_0x43e641)=>{this['_removeRevision'](_0x43e641);});}get['revisionViews'](){return this['timePeriodViews']['map'](_0x523cc5=>_0x523cc5['revisionViews']['map'](_0x5dd216=>_0x5dd216))['flat']();}selectRevision(_0x526ba2){for(const _0x5be856 of this['revisionViews'])_0x526ba2&&_0x526ba2['id']===_0x5be856['id']?_0x5be856['select']():_0x5be856['deselect']();}highlightRevisions(_0x2c117f){for(const _0x2f6c46 of this['revisionViews'])_0x2c117f['some'](({id:_0x39ef07})=>_0x39ef07===_0x2f6c46['id'])?_0x2f6c46['highlight']():_0x2f6c46['unhighlight']();}['_addRevision'](_0x47959a){const _0xb0da02=Qt(_0x47959a['createdAt'],this['locale']['uiLanguage'])['startDate'];let _0x2348f1=this['_getTimePeriodViewByStartDate'](_0xb0da02);_0x2348f1||(_0x2348f1=new zt(this['locale'],_0xb0da02,this['_revisionActions'],this['_requireRevisionName'],this['_showAISource']),this['timePeriodViews']['add'](_0x2348f1)),_0x2348f1['addRevision'](_0x47959a);}['_removeRevision'](_0x5915b1){const _0x491ad1=Qt(_0x5915b1['createdAt'],this['locale']['uiLanguage'])['startDate'];this['_getTimePeriodViewByStartDate'](_0x491ad1)['removeRevision'](_0x5915b1);}_getTimePeriodViewByStartDate(_0xf68bd5){return this['timePeriodViews']['find'](_0x358cd5=>_0x358cd5['startDate']['getTime']()===_0xf68bd5['getTime']());}},ii=class RevisionsSidebar extends _0x17a398{['_revisionViewer'];_revisionsRepository;['_sidebarView'];static defaultRevisionActions=/* #__PURE__ -- @preserve */
23
+ import{CKEditorError as _0x3b4618,Collection as _0x374b4a,ElementReplacer as _0x4351f3,FocusTracker as _0x1eaccb,KeystrokeHandler as _0x345931,ObservableMixin as _0x5a3a2d,ResizeObserver as _0x1952cf,logWarning as _0x156ae5,scrollViewportToShowTarget as _0x273e11,trustedHtml as _0x17b295,uid as _0x37fc40}from'@ckeditor/ckeditor5-utils';import{cloneDeep as _0x1ebade,isEqual as _0x5278fa,set as _0x5a115b,unset as _0x125751}from'es-toolkit/compat';import{Command as _0x321013,Editor as _0xf023ba,ElementApiMixin as _0x2cc9cf,PendingActions as _0x10cae8,Plugin as _0x20938f}from'@ckeditor/ckeditor5-core';import{ConfirmMixin as _0x138cee,PillView as _0x5a0a33,Users as _0x410d48,getMarkerDomElement as _0x445e6f,reRootOperation as _0x5d5705,reRootPosition as _0x21a19e,reRootRange as _0x46d417,sanitizeEditorConfig as _0x41f144}from'@ckeditor/ckeditor5-collaboration-core';import{ModelDocumentFragment as _0x49656a,ModelElement as _0xf48e9f,ModelRange as _0x2ea5f,ModelText as _0x339e9d,ViewAttributeElement as _0x4c2c4a,ViewContainerElement as _0xf13054,ViewDocumentFragment as _0x3e0e5f,ViewElement as _0x30ba26,ViewEmptyElement as _0x2cb063,ViewRawElement as _0x1165c8,ViewText as _0x2d3da,ViewUIElement as _0x171be4}from'@ckeditor/ckeditor5-engine';import{IconChevronDown as _0xec47db,IconChevronUp as _0x1e827e,IconHistory as _0x37eac0,IconSparkle as _0x2b2e7d,IconThreeVerticalDots as _0x35fa28,IconUndo as _0x174cc5,IconUser as _0x329dc5}from'@ckeditor/ckeditor5-icons';import{BoxedEditorUIView as _0x308d14,ButtonView as _0x17c303,ContextualBalloon as _0x4aa69b,CssTransitionDisablerMixin as _0x4c8802,EditorUI as _0x16e3a5,IconView as _0x1af692,InlineEditableUIView as tt,LabeledFieldView as it,ListItemView as et,ListView as st,MenuBarMenuListItemButtonView as nt,MenuBarMenuListItemView as ot,MenuBarMenuListView as rt,MenuBarMenuView as at,StickyPanelView as ht,ToolbarSeparatorView as ct,ToolbarView as lt,UIModel as ut,View as dt,addListToDropdown as ft,createDropdown as vt,createLabeledInputText as gt,normalizeToolbarConfig as mt,submitHandler as _t}from'@ckeditor/ckeditor5-ui';import{DateTime as wt}from'luxon';const pt=/* #__PURE__ -- @preserve */
24
+ _0x5a3a2d();var yt=class extends pt{['id'];creator;authors;diffData;toVersion;['fromVersion'];['model'];constructor(_0x7c0c58){super(),this['id']=_0x7c0c58['id']||_0x37fc40(),this['creator']=_0x7c0c58['creator']||null,this['authors']=_0x7c0c58['authors']||[],this['diffData']=_0x7c0c58['diffData']||null,this['toVersion']=_0x7c0c58['toVersion']||0x0,this['fromVersion']=_0x7c0c58['fromVersion']||0x0,this['set']('name',_0x7c0c58['name']||''),this['set']('createdAt',_0x7c0c58['createdAt']||new Date()),this['set']('attributes',_0x7c0c58['attributes']||{});}setName(_0x22b577){this['_update']({'name':_0x22b577});}setAttribute(_0x36ad87,_0xc9fb13){const _0x56273b=_0x1ebade(this['attributes']);_0x5a115b(_0x56273b,_0x36ad87,_0xc9fb13),this['_update']({'attributes':_0x56273b});}removeAttribute(_0x431ecf){const _0x7476a1=_0x1ebade(this['attributes']);_0x125751(_0x7476a1,_0x431ecf),this['_update']({'attributes':_0x7476a1});}_update(_0x448eff,_0x5141ca=!0x1){let _0x6e3b8c=!0x1;const _0x3adc2a={'id':this['id']};for(const _0x4ef0a3 of['name','createdAt','diffData','authors','attributes','toVersion','fromVersion','creatorId']){const _0x37eb00=_0x448eff[_0x4ef0a3];void 0x0!==_0x37eb00&&_0x37eb00!==this[_0x4ef0a3]&&(this[_0x4ef0a3]=_0x37eb00,_0x3adc2a[_0x4ef0a3]=_0x37eb00,_0x6e3b8c=!0x0);}_0x6e3b8c&&(_0x3adc2a['authors']&&(_0x3adc2a['authorsIds']=_0x3adc2a['authors']['map'](_0x256489=>_0x256489['id']),delete _0x3adc2a['authors']),this['fire']('_update',_0x3adc2a,_0x5141ca));}toJSON(){return{'id':this['id'],'name':this['name'],'creatorId':this['creator']?this['creator']['id']:null,'authorsIds':this['authors']['map'](_0x51cfa9=>_0x51cfa9['id']),'diffData':this['diffData'],'createdAt':this['createdAt'],'attributes':this['attributes'],'fromVersion':this['fromVersion'],'toVersion':this['toVersion']};}},bt=class extends _0x20938f{['_revisions'];static get requires(){return[_0x410d48];}static get['pluginName'](){return'RevisionsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get length(){return this['_revisions']['length'];}constructor(_0x3c9e87){super(_0x3c9e87),this['_revisions']=new _0x374b4a();}afterInit(){!async function(_0x52b406){const _0x463341='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x42006f=0xeb829,_0x33cc5a=0x79770,_0x30c9d0={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x54d41a(_0x5c8cc4){const _0x1d0a00=new window['Promise'](_0x455e6c=>{_0x5c8cc4['once']('ready',_0x455e6c);}),_0x43a225=window['Date']['now'](),_0x1d3d4d=_0x5c8cc4['config']['get']('licenseKey');async function _0x5a2060(){let _0x3b4b68,_0x1ee3f8=null,_0x3cffc9=null;try{return'GPL'==_0x1d3d4d?'NotAllowed':(_0x3b4b68=_0x2e243e(),_0x3b4b68?(_0x3b4b68['usageEndpoint']&&(_0x3cffc9=_0x433fbe(_0x3b4b68['usageEndpoint'],_0x3b4b68['jti'])),await _0x200701()?_0x1629e0()?_0x6bb42f()?'Expired':_0xb70dc5()?('evaluation'==_0x3b4b68['licenseType']&&(_0x1ee3f8=_0x37cc98('EvaluationLimit')),await _0x4f4703()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x6bb42f(){const _0x37c320=['evaluation','trial']['includes'](_0x3b4b68['licenseType'])?_0x43a225/0x3e8:0xe10*_0x33cc5a;return _0x3b4b68['exp']<_0x37c320;}function _0x1629e0(){const _0x5dd680=_0x3b4b68['features'];if(!_0x5dd680)return!0x1;if(_0x5dd680['includes']('*'))return!0x0;if(_0x5dd680['includes']('RH'))return!0x0;if(_0x5dd680['includes']('RRH')){if(_0x2dd851())return!0x0;if(_0x56a0b3()||_0x3a2018())return!0x0;}return!0x1;}function _0xb70dc5(){const _0x12f4cc=_0x3b4b68['licensedHosts'];if(!_0x12f4cc||0x0==_0x12f4cc['length'])return!0x0;const {hostname:_0x1871a1}=new URL(window['location']['href']);if(_0x12f4cc['includes'](_0x1871a1))return!0x0;const _0x39089d=_0x1871a1['split']('.');return _0x12f4cc['filter'](_0x62574f=>_0x62574f['includes']('*'))['map'](_0x3aaa3d=>_0x3aaa3d['split']('.'))['filter'](_0x25eeba=>_0x25eeba['length']<=_0x39089d['length'])['map'](_0x490cde=>Array(_0x39089d['length']-_0x490cde['length'])['fill']('*'===_0x490cde[0x0]?'*':'')['concat'](_0x490cde))['some'](_0x2761ab=>_0x39089d['every']((_0x11aa0a,_0x1ecc72)=>_0x2761ab[_0x1ecc72]===_0x11aa0a||'*'===_0x2761ab[_0x1ecc72]));}function _0x4f4703(){return _0x1ee3f8&&_0x3cffc9?new window['Promise']((_0x288c6e,_0xb15ab6)=>{_0x1ee3f8['then'](_0x288c6e,_0xb15ab6),_0x3cffc9['then'](_0x5e9812=>{'Valid'!=_0x5e9812&&_0x288c6e(_0x5e9812);},_0xb15ab6);}):_0x1ee3f8||_0x3cffc9||'Valid';}}function _0x433fbe(_0xe09679,_0x59bedd){return new window['Promise'](_0x59c5cf=>{if(_0x122fbe())return _0x59c5cf('Valid');_0x16d9f6(),_0x5c8cc4['decorate']('_sendUsageRequest');let _0x10c4ee=!0x1;const _0x254ac0=_0x37fc40();function _0x59d9af(_0x183d39){return!!_0x183d39&&('object'==typeof _0x183d39||'function'==typeof _0x183d39)&&'function'==typeof _0x183d39['then']&&'function'==typeof _0x183d39['catch'];}function _0x485818(_0x1ef5fc){_0xfc8328(_0x1ef5fc)['then'](_0x2e7d52=>_0x2e7d52&&'ok'==_0x2e7d52['status']?_0x17b4e2(_0x2f9933(_0x254ac0+_0x59bedd))!=_0x2e7d52['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x3e04c3=>(_0x4655b6(),_0x3e04c3),()=>{const _0x5bc6d3=_0x18525d();return null==_0x5bc6d3?(_0x4655b6(),'Valid'):_0x43a225-_0x5bc6d3>0x240c8400?'UsageLimit':'Valid';})['then'](_0x59c5cf)['catch'](()=>{_0x59c5cf('UsageLimit');});const _0x1d8a0f=0x36ee80;function _0x4655b6(){const _0x3eee86='llct-'+_0x17b4e2(_0x2f9933(_0xe09679)),_0x37ebbd=_0x38476d(_0x17b4e2(window['Math']['ceil'](_0x43a225/_0x1d8a0f)));window['localStorage']['setItem'](_0x3eee86,_0x37ebbd);}function _0x18525d(){const _0x4cb2bc='llct-'+_0x17b4e2(_0x2f9933(_0xe09679)),_0x308634=window['localStorage']['getItem'](_0x4cb2bc);return _0x308634?window['parseInt'](_0x38476d(_0x308634),0x10)*_0x1d8a0f:null;}function _0xfc8328(_0x35cde8){return new window['Promise']((_0x3797ad,_0x588b10)=>{_0x35cde8['then'](_0x3797ad,_0x588b10),window['setTimeout'](_0x588b10,0x1d4c0);});}}_0x5c8cc4['on']('_sendUsageRequest',(_0x1a2359,_0xe36125)=>{if(_0xe36125[0x0]!=_0xe09679)return _0x59c5cf('UsageLimit');_0xe36125[0x1]={..._0xe36125[0x1],'requestId':_0x254ac0};},{'priority':'high'}),_0x5c8cc4['on']('_sendUsageRequest',_0x44ac82=>{_0x59d9af(_0x44ac82['return'])&&(_0x10c4ee=!0x0,_0x485818(_0x44ac82['return']));},{'priority':'low'}),_0x1d0a00['then'](()=>{_0x10c4ee||_0x59c5cf('UsageLimit');});});function _0x122fbe(){return'auto'==_0x5c8cc4['editing']['view']['_overlayModeHint'];}function _0x16d9f6(){_0x5c8cc4['editing']['view']['_overlayModeHint']='auto';}}function _0x37cc98(_0x20c562){const _0x242809=[new window['Promise'](_0x4dafbe=>setTimeout(_0x4dafbe,0x93ecc)),_0x1d0a00['then'](()=>new window['Promise'](_0x2f6b22=>{const _0x420b6c=0x7,_0x2af553=_0x52b406['_revisions'];function _0xca1d91(){_0x2af553['length']>=_0x420b6c&&_0x2f6b22();}_0xca1d91(),_0x2af553['on']('add',_0xca1d91);})),new window['Promise'](_0x3a8613=>{function _0x28b294(){for(const _0x53d308 in window)if(window['Number']['isNaN'](window['Number'](_0x53d308))&&window[_0x53d308]==_0x42006f)return _0x3a8613();'destroyed'!=_0x5c8cc4['state']&&window['setTimeout'](_0x28b294,0x1388);}_0x553d62('RevisionViewer')&&_0x28b294();})];return window['Promise']['race'](_0x242809)['then'](()=>_0x20c562);}async function _0x3d5542(){if(await _0x1d0a00,_0x553d62('RevisionViewer')){const _0x52363f=_0x52b406['getRevision'](0x0),_0xc96cb3=_0x52b406['getEarlierVisibleRevision'](_0x52363f['id']),_0x1f3043=_0x1a0003('RevisionViewer');return await _0x1f3043['compare'](_0x52363f['id'],_0xc96cb3?_0xc96cb3['id']:null,!0x0),_0x1f3043['unbind']('isEnabled'),_0x1f3043['isEnabled']=!0x1,_0x1f3043['compare']=_0x2cd6f0,void(_0x1f3043['_getDiff']=_0x2cd6f0);}if(_0x553d62('RevisionTracker')){const _0xfe23e3=_0x1a0003('RevisionTracker');_0xfe23e3['unbind']('isEnabled'),_0xfe23e3['isEnabled']=!0x1,_0xfe23e3['update']=_0x2cd6f0,_0xfe23e3['saveRevision']=_0x2cd6f0;}_0x5c8cc4['model']['change']=_0x2cd6f0,_0x5c8cc4['model']['enqueueChange']=_0x2cd6f0,_0x5c8cc4['enableReadOnlyMode']('model');}function _0x2dd851(){return _0x553d62('WebSocketGateway')&&'connected'==_0x1a0003('WebSocketGateway')['state'];}function _0x56a0b3(){return _0x553d62('RevisionViewerIntegration');}function _0x3a2018(){return _0x553d62('TrackChangesDataGetter');}function _0xc898(_0x5ae58d){const _0x2091ed=_0x1e79c5();_0x5c8cc4[_0x2091ed]='revisionHistoryLicenseKey'+_0x5ae58d,_0x5ae58d['endsWith']('Limit')&&(window[_0x1e79c5()]=_0x42006f),'Valid'!=_0x5ae58d&&_0x3d5542();}function _0x1e79c5(){const _0x1a073f=window['String'](window['performance']['now']())['replace']('.','');let _0x185af0='N';for(let _0x520e63=0x0;_0x520e63<_0x1a073f['length'];_0x520e63+=0x2){let _0x378b50=window['parseInt'](_0x1a073f['substring'](_0x520e63,_0x520e63+0x2));_0x378b50>=0x3e&&(_0x378b50-=0x3e),_0x185af0+=_0x463341[_0x378b50];}return _0x185af0;}function _0x2e243e(){const _0x33e78a=_0x1d3d4d['split']('.');if(0x3!=_0x33e78a['length'])return null;return _0xf9df7d(_0x33e78a[0x1]);function _0xf9df7d(_0x1a8b1a){const _0x9986ce=_0x408944(_0x1a8b1a);return _0x9986ce&&_0x103c3e()?_0x9986ce:null;function _0x103c3e(){const _0x2f1b50=_0x9986ce['jti'],_0x805db4=window['parseInt'](_0x2f1b50['substring'](_0x2f1b50['length']-0x8),0x10),_0x46ca98={..._0x9986ce,'jti':_0x2f1b50['substring'](0x0,_0x2f1b50['length']-0x8)};return delete _0x46ca98['vc'],_0x2f9933(_0x46ca98)==_0x805db4;}}}async function _0x200701(){let _0x109edd=!0x0;try{const [_0x3dc63a,_0x331650,_0x67830e]=_0x1d3d4d['split']('.');return _0x2eeef8(_0x3dc63a),await _0x31f8b9(_0x3dc63a,_0x331650,_0x67830e),_0x109edd;}catch{return!0x1;}function _0x2eeef8(_0x2c5a40){const _0x28706c=_0x408944(_0x2c5a40);_0x28706c&&'ES256'==_0x28706c['alg']||(_0x109edd=!0x1);}async function _0x31f8b9(_0x1b0e4a,_0x1bb119,_0x37442b){const _0x4586ea=window['Uint8Array']['from'](_0x1143cd(_0x37442b),_0x3ae863=>_0x3ae863['charCodeAt'](0x0)),_0x258b2e=new window['TextEncoder']()['encode'](_0x1b0e4a+'.'+_0x1bb119),_0x3d91d3=window['crypto']['subtle'];if(!_0x3d91d3)return;const _0x3ee2dd=await _0x3d91d3['importKey']('jwk',_0x30c9d0,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x3d91d3['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x3ee2dd,_0x4586ea,_0x258b2e)||(_0x109edd=!0x1);}}function _0x408944(_0x1ca50a){return _0x1ca50a['startsWith']('ey')?JSON['parse'](_0x1143cd(_0x1ca50a)):null;}function _0x1143cd(_0x18732e){return window['atob'](_0x18732e['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x2f9933(_0x14b425){let _0xbe489=0x1505;function _0x5b5f0a(_0x1e8cb8){for(let _0x3e56c4=0x0;_0x3e56c4<_0x1e8cb8['length'];_0x3e56c4++){const _0x2f409c=_0x1e8cb8['charCodeAt'](_0x3e56c4);_0xbe489=(_0xbe489<<0x5)+_0xbe489+_0x2f409c,_0xbe489&=_0xbe489;}}function _0x1fc405(_0x4521ac){Array['isArray'](_0x4521ac)?_0x4521ac['forEach'](_0x1fc405):_0x4521ac&&'object'==typeof _0x4521ac?Object['entries'](_0x4521ac)['sort']()['forEach'](([_0x417d84,_0x2a691e])=>{_0x5b5f0a(_0x417d84),_0x1fc405(_0x2a691e);}):_0x5b5f0a(window['String'](_0x4521ac));}return _0x1fc405(_0x14b425),_0xbe489>>>0x0;}function _0x17b4e2(_0x2ffe7a){return _0x2ffe7a['toString'](0x10)['padStart'](0x8,'0');}function _0x38476d(_0x3b0105){return _0x3b0105['split']('')['reverse']()['join']('');}function _0x553d62(_0x47bf54){return _0x5c8cc4['plugins']['has'](_0x47bf54);}function _0x1a0003(_0x63d93b){return _0x5c8cc4['plugins']['get'](_0x63d93b);}function _0x2cd6f0(){}_0xc898(await _0x5a2060());}_0x54d41a(_0x52b406['editor']);}(this);}createRevision(_0x48b870){const _0x1a9071=this['editor']['plugins']['get']('Users');return new yt({'id':_0x48b870['id'],'name':_0x48b870['name'],'creator':_0x48b870['creatorId']?_0x1a9071['getUser'](_0x48b870['creatorId']):null,'diffData':_0x48b870['diffData']||_0x48b870['data'],'authors':_0x48b870['authorsIds']['map'](_0x5ac76f=>_0x1a9071['getUser'](_0x5ac76f)),'createdAt':new Date(_0x48b870['createdAt']),'attributes':_0x48b870['attributes'],'fromVersion':_0x48b870['fromVersion'],'toVersion':_0x48b870['toVersion']});}['addRevision'](_0xbce82d,_0x169e4a=0x0){this['_revisions']['add'](_0xbce82d,_0x169e4a);}getRevision(_0x14f708){return this['_revisions']['get'](_0x14f708);}getRevisions(_0x59505a={'toJSON':!0x1}){const _0xc65675=Array['from'](this['_revisions']);return _0xc65675['reverse'](),_0x59505a['toJSON']?_0xc65675['map'](_0x514d77=>_0x514d77['toJSON']()):_0xc65675;}getIndex(_0x2b918a){return this['_revisions']['getIndex'](_0x2b918a);}getEarlierVisibleRevision(_0x1cc6d3){const [,_0x286c09]=this['getRevisionsIterator'](_0x1cc6d3,{'direction':'earlier'});return _0x286c09;}getLaterVisibleRevision(_0x2641e4){const [,_0x2a9926]=this['getRevisionsIterator'](_0x2641e4,{'direction':'later'});return _0x2a9926;}getRevisionsInDiff(_0x37afde){const _0x22e2cb=[];for(const _0x123ec2 of this['getRevisionsIterator'](_0x37afde['newRevisionId']))if(_0x22e2cb['push'](_0x123ec2),_0x123ec2['id']===_0x37afde['oldRevisionId'])break;return _0x22e2cb;}*getRevisionsIterator(_0x2c80d9,{direction:_0x3fcc5f='earlier',filter:_0x5ad91c=()=>!0x0}={}){const _0x266553='earlier'===_0x3fcc5f?0x1:-0x1;let _0x17c47f=this['_revisions']['get'](_0x2c80d9),_0x201419=this['getIndex'](_0x17c47f);for(yield _0x17c47f;_0x17c47f;){if(_0x201419+=_0x266553,_0x17c47f=this['getRevision'](_0x201419),!_0x17c47f)return;_0x5ad91c(_0x17c47f)&&(yield _0x17c47f);}}},Rt=class extends _0x20938f{static get['pluginName'](){return'RevisionHistoryUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_viewClassToTypeChar']=new Map([[_0xf13054,'c'],[_0x4c2c4a,'a'],[_0x2cb063,'e'],[_0x1165c8,'r'],[_0x171be4,'u']]);_typeCharToViewClass=new Map([['c',_0xf13054],['a',_0x4c2c4a],['e',_0x2cb063],['r',_0x1165c8],['u',_0x171be4]]);async loadRevisionData(_0x411740,_0xa33c1d){if(_0x411740['diffData']||!_0xa33c1d)return;const _0x518dd4=this['editor']['config']['get']('collaboration.channelId');_0x411740['diffData']=(await _0xa33c1d['getRevision']({'channelId':_0x518dd4,'revisionId':_0x411740['id']}))['diffData'];}getRevisionDocumentData(_0x17ed0f){const _0x499611={};for(const _0x16f4b4 in _0x17ed0f['diffData']){if(_0x17ed0f['diffData'][_0x16f4b4]['attachChange']&&!_0x17ed0f['diffData'][_0x16f4b4]['attachChange']['isAttached'])continue;const _0x4a5522=this['_removeRevisionMarkers'](JSON['parse'](_0x17ed0f['diffData'][_0x16f4b4]['insertions'])),_0x14e891=this['editor']['editing']['view']['document'],_0x3ccd03=new _0x3e0e5f(_0x14e891,_0x4a5522['map'](_0x253b8b=>this['_getViewFromDiffObj'](_0x253b8b,!0x1)));this['editor']['data']['processor']['useFillerType']('marked'),_0x499611[_0x16f4b4]=this['editor']['data']['processor']['toData'](_0x3ccd03),this['editor']['data']['processor']['useFillerType']('default');}return _0x499611;}getRevisionRootsAttributes(_0x393108){const _0x108c59={};for(const _0xb2552d in _0x393108['diffData'])_0x393108['diffData'][_0xb2552d]['attachChange']&&!_0x393108['diffData'][_0xb2552d]['attachChange']['isAttached']||(_0x108c59[_0xb2552d]=_0x393108['diffData'][_0xb2552d]['attributesAfter']||{});return _0x108c59;}getRevisionRootsModelElements(_0x296684){const _0x134c6e={};for(const _0x350f83 in _0x296684['diffData']){if(_0x296684['diffData'][_0x350f83]['attachChange']&&!_0x296684['diffData'][_0x350f83]['attachChange']['isAttached'])continue;const _0x54d08f=_0x296684['diffData'][_0x350f83]['rootElementName'];_0x54d08f&&(_0x134c6e[_0x350f83]=_0x54d08f);}return _0x134c6e;}_getTypeCharForViewElement(_0x131b5f){return this['_viewClassToTypeChar']['get'](_0x131b5f['constructor']);}_getViewFromDiffObj(_0x147271,_0xb2615d){const _0x33fe0b=this['editor']['editing']['view']['document'];if('string'==typeof _0x147271)return new _0x2d3da(_0x33fe0b,_0x147271);{let _0x569196,_0x542bf4;_0x542bf4='u'==_0x147271['type']||'r'==_0x147271['type']?[]:_0x147271['children']['map'](_0x30b8b9=>this['_getViewFromDiffObj'](_0x30b8b9,_0xb2615d));const _0x21d192=this['_typeCharToViewClass']['get'](_0x147271['type'])||_0x30ba26,_0x5ac358=this['editor']['data']['htmlProcessor']['domConverter'];if(_0x569196=new _0x21d192(_0x33fe0b,_0x147271['name'],_0x147271['attributes'],_0x542bf4),'u'==_0x147271['type']&&_0x147271['children'][0x0]){const _0x18653d=_0x147271['children'][0x0];if(_0x569196['render']=function(_0x5b8c99){const _0x203c6e=_0x5b8c99['createElement']('div');return _0x203c6e['innerHTML']=_0x17b295(_0x18653d),_0x203c6e['childNodes'][0x0];},_0xb2615d){const _0x46e25b=new _0x3e0e5f(_0x33fe0b);_0x46e25b['_appendChild'](_0x569196);const _0x23d644=Array['from'](_0x5ac358['viewChildrenToDom'](_0x46e25b,{'bind':!0x1})),_0x4dd9cd=_0x5ac358['domDocument']['createElement']('div');_0x4dd9cd['append'](..._0x23d644),_0x569196=Array['from'](_0x5ac358['domChildrenToView'](_0x4dd9cd))[0x0];}}else{if('r'==_0x147271['type']&&_0x147271['children'][0x0]){const _0x52da84=_0x147271['children'][0x0];if(_0x569196['render']=function(_0x25a367){_0x25a367['innerHTML']=_0x17b295(_0x52da84);},_0xb2615d){const _0x3614d2=new _0x3e0e5f(_0x33fe0b);_0x3614d2['_appendChild'](_0x569196);const _0x4b54fd=Array['from'](_0x5ac358['viewChildrenToDom'](_0x3614d2,{'bind':!0x1})),_0x24ff9f=_0x5ac358['domDocument']['createElement']('div');_0x24ff9f['append'](..._0x4b54fd);const _0x462d49=Array['from'](_0x5ac358['domChildrenToView'](_0x24ff9f));_0x462d49['length']>0x1?_0x569196['_appendChild'](_0x462d49):_0x569196=_0x462d49[0x0];}}}if(_0x147271['customProperties']){for(const [_0x533115,_0x85dcd2]of _0x147271['customProperties'])_0x569196['_setCustomProperty'](_0x533115,_0x85dcd2);}const _0x231927=void 0x0===_0x147271['fillerOffset']?null:_0x147271['fillerOffset'];return null!==_0x231927&&(_0x569196['getFillerOffset']=()=>_0x231927),_0x569196;}}_makeModelFromViewString(_0x290570,_0x1334cf){const _0xed911f=JSON['parse'](_0x290570),_0x444b08=this['editor']['editing']['view']['document'],_0x590370=new _0x3e0e5f(_0x444b08,_0xed911f['map'](_0x42a87c=>this['_getViewFromDiffObj'](_0x42a87c,!0x0))),_0x3613e7=this['editor']['data']['toModel'](_0x590370,_0x1334cf);return _0x3613e7['name']=_0x1334cf,_0x3613e7;}['_removeRevisionMarkers'](_0x471c03){return(_0x471c03=_0x471c03['filter'](_0x59fcd0=>!_0x59fcd0['name']||'revision-start'!==_0x59fcd0['name']&&'revision-end'!==_0x59fcd0['name']))['forEach'](_0x173152=>{'string'!=typeof _0x173152&&(_0x173152['children']=this['_removeRevisionMarkers'](_0x173152['children']),_0x173152['attributes']=_0x173152['attributes']['filter'](_0x404be9=>!_0x404be9[0x0]['startsWith']('data-revision-')));}),_0x471c03;}};function kt(_0x19b376,_0x30f2f6,_0xf8513a){const t=_0x19b376['t'];switch(_0x30f2f6){case'Revision\x20history':return t('Revision\x20history');case'Open\x20revision\x20history':return t('Open\x20revision\x20history');case'Restored':return t('Restored');case'Empty\x20document':return t('Empty\x20document');case'Initial\x20revision':return t('Initial\x20revision');case'Suggested\x20by':return t('Suggested\x20by');case'Added\x20by':return t('Added\x20by');case'Removed\x20by':return t('Removed\x20by');case'Show\x20more\x20items':return t('Show\x20more\x20items');case'Compare\x20against\x20selected':return t('Compare\x20against\x20selected');case'Name\x20this\x20revision':return t('Name\x20this\x20revision');case'Restore\x20this\x20revision':return t('Restore\x20this\x20revision');case'Back\x20to\x20editing':return t('Back\x20to\x20editing');case'Loading...':return t('Loading...');case'No\x20changes':return t('No\x20changes');case'NUMBER_OF_CHANGES':return t({'string':'%0\x20change','plural':'%0\x20changes','id':'NUMBER_OF_CHANGES'},_0xf8513a);case'X_OF_Y_CHANGES':return t({'string':'%0\x20of\x20%1','id':'X_OF_Y_CHANGES'},_0xf8513a);case'Show\x20previous\x20change':return t('Show\x20previous\x20change');case'Show\x20next\x20change':return t('Show\x20next\x20change');case'EDIT_X_OF_Y_REVISIONS':return t({'string':'Edit','id':'EDIT_X_OF_Y_REVISIONS'});case'Total':return t('Total');case'Revision\x20creator':return t('Revision\x20creator');case'Revision\x20author':return t('Revision\x20author');case'Revision\x20name':return t('Revision\x20name');case'Save\x20current\x20revision':return t('Save\x20current\x20revision');case'Accept':return t('Accept');case'Save':return t('Save');case'Cancel':return t('Cancel');case'Name\x20of\x20the\x20revision':return t('Name\x20of\x20the\x20revision');case'optional':return t('optional');case'PENDING_ACTION_REVISION_HISTORY':return t({'string':'Unsaved\x20change\x20in\x20revision\x20history.','id':'PENDING_ACTION_REVISION_HISTORY'});case'The\x20revision\x20name\x20cannot\x20be\x20empty.':return t('The\x20revision\x20name\x20cannot\x20be\x20empty.');case'Enter\x20the\x20revision\x20name':return t('Enter\x20the\x20revision\x20name');case'REVISION_AI_SOURCE_PILL_LABEL':return t({'string':'Includes\x20AI\x20suggestions','id':'REVISION_AI_SOURCE_PILL_LABEL'});case'AI_SOURCE_REVISION_TOOLTIP':return t({'string':'This\x20revision\x20contains\x20AI-assisted\x20suggestions.','id':'AI_SOURCE_REVISION_TOOLTIP'});case'AI_SOURCE_CHANGE_TOOLTIP':return t({'string':'This\x20change\x20was\x20suggested\x20using\x20AI.','id':'AI_SOURCE_CHANGE_TOOLTIP'});case'AI_SOURCE_ADDED_BY':return t({'string':'Added\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_ADDED_BY'},_0xf8513a);case'AI_SOURCE_REMOVED_BY':return t({'string':'Removed\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_REMOVED_BY'},_0xf8513a);case'AI_SOURCE_SUGGESTED_BY':return t({'string':'Suggested\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_SUGGESTED_BY'},_0xf8513a);case'AI_SOURCE_AI':return t({'string':'AI','id':'AI_SOURCE_AI'});default:return'';}}var At=class extends _0x20938f{['licenseKey'];_licenseKeyCheckInterval;currentRevision=null;repository;adapter=null;_revisionDataBuilder;['_source'];_initialRevisionId;_bufferedUpdates;_utils;_pendingAction;_continueCurrentRevision;_startingVersion;_loadedStateData;static get['pluginName'](){return'RevisionTracker';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_0x410d48,bt,Rt,_0x10cae8];}constructor(_0x108e1e){super(_0x108e1e),this['repository']=this['editor']['plugins']['get']('RevisionsRepository'),this['_utils']=this['editor']['plugins']['get']('RevisionHistoryUtils'),this['_revisionDataBuilder']=new It(this['editor']),this['_initialRevisionId']=this['editor']['config']['get']('collaboration.channelId')||'initial',this['_bufferedUpdates']=new Map(),this['_loadedStateData']=null;const _0x1203a4=_0x37fc40();this['_source']={'history':this['editor']['model']['document']['history'],'getLatestVersion':()=>Promise['resolve'](this['editor']['model']['document']['version']),'getCurrentRevisionId':()=>_0x1203a4},this['set']('isReady',!0x1),this['set']('isEnabled',!0x0),this['set']('_isPendingUpdate',!0x1),this['editor']['config']['define']('revisionHistory.resumeUnsavedRevision',!0x0),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'revision'});}init(){this['_setConversion'](),this['editor']['data']['on']('ready',()=>{const _0x262033=this['repository']['getRevision'](0x0),_0xf53642=_0x262033&&null===_0x262033['creator']?_0x262033:null;if(this['_continueCurrentRevision']=!!_0xf53642&&this['editor']['config']['get']('revisionHistory.resumeUnsavedRevision'),this['editor']['plugins']['has']('RealTimeCollaborationClient')){const _0x53dd4a=this['_source']['getCurrentRevisionId'](),_0x1c0352=this['repository']['getRevision'](_0x53dd4a);if(_0x1c0352)this['_startingVersion']=_0x1c0352['fromVersion'],this['_continueCurrentRevision']=!0x1;else{const _0x2a7321=this['_source']['history']['_operations']['find'](_0x4bfd08=>!_0x4bfd08['_isInit']),_0x272469=_0x2a7321?_0x2a7321['baseVersion']:this['_source']['history']['version'];_0x262033?(_0x262033['toVersion']<_0x272469&&_0x262033['_update']({'toVersion':_0x272469}),this['_continueCurrentRevision']?(this['_source']['getCurrentRevisionId']=()=>_0xf53642['id'],this['_startingVersion']=_0xf53642['fromVersion']):(this['_startingVersion']=_0x262033['toVersion'],this['_continueCurrentRevision']=!0x1)):(this['_startingVersion']=_0x272469,this['_continueCurrentRevision']=!0x1);}}else _0xf53642&&(this['editor']['model']['document']['history']['version']=Math['max'](_0xf53642['toVersion'],this['editor']['model']['document']['history']['version']),_0xf53642['fromVersion']===_0xf53642['toVersion']?(0x0!==_0xf53642['fromVersion']&&(this['_source']['getCurrentRevisionId']=()=>_0xf53642['id']),this['_continueCurrentRevision']=!0x1):this['_continueCurrentRevision']&&(this['_source']['getCurrentRevisionId']=()=>_0xf53642['id'],this['_startingVersion']=_0xf53642['fromVersion'])),this['_continueCurrentRevision']||(this['_startingVersion']=this['editor']['model']['document']['version']);this['_revisionDataBuilder']['init'](this['_source']['history']),this['_createInitialRevision'](this['_startingVersion']),this['_createCurrentRevision'](this['_startingVersion']),this['adapter']&&this['sendBufferedUpdates']();}),this['bind']('isReady')['to'](this,'_isPendingUpdate',_0x4bee55=>!_0x4bee55),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x36dd0e=[this['editor']];for(const _0x2ec073 of _0x36dd0e){let _0x1e7049;for(const _0x1f9cd2 in _0x2ec073){const _0x503b06=_0x1f9cd2,_0x4d712b=_0x2ec073[_0x503b06];if('revisionHistoryLicenseKeyValid'==_0x4d712b||'revisionHistoryLicenseKeyInvalid'==_0x4d712b||'revisionHistoryLicenseKeyExpired'==_0x4d712b||'revisionHistoryLicenseKeyDomainLimit'==_0x4d712b||'revisionHistoryLicenseKeyNotAllowed'==_0x4d712b||'revisionHistoryLicenseKeyEvaluationLimit'==_0x4d712b||'revisionHistoryLicenseKeyUsageLimit'==_0x4d712b){delete _0x2ec073[_0x503b06],_0x1e7049=_0x4d712b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'revisionHistoryLicenseKeyInvalid'==_0x1e7049&&_0x2ec073['_showLicenseError']('invalid'),'revisionHistoryLicenseKeyExpired'==_0x1e7049&&_0x2ec073['_showLicenseError']('expired'),'revisionHistoryLicenseKeyDomainLimit'==_0x1e7049&&_0x2ec073['_showLicenseError']('domainLimit'),'revisionHistoryLicenseKeyNotAllowed'==_0x1e7049&&_0x2ec073['_showLicenseError']('featureNotAllowed','RevisionHistory'),'revisionHistoryLicenseKeyEvaluationLimit'==_0x1e7049&&_0x2ec073['_showLicenseError']('evaluationLimit'),'revisionHistoryLicenseKeyUsageLimit'==_0x1e7049&&_0x2ec073['_showLicenseError']('usageLimit');}},0x3e8);}async afterInit(){if(this['repository']['length']>0x0){const _0x2f3e3b=this['repository']['getRevision'](0x0),_0x172189=await this['getRevisionDocumentData'](_0x2f3e3b),_0x14faca=await this['getRevisionRootsAttributes'](_0x2f3e3b),_0x19c6f8=this['_utils']['getRevisionRootsModelElements'](_0x2f3e3b);this['_replaceEditorDataWithRevisionData'](_0x172189,_0x14faca,_0x19c6f8);}}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}setSource(_0x126c7b){this['_source']=_0x126c7b;}async update(){const _0x5dce57=await this['_source']['getLatestVersion']();if(_0x5dce57>this['currentRevision']['toVersion']){await this['_loadState']();const _0x8860e0=this['buildRevisionData']({'revision':this['currentRevision'],'to':_0x5dce57});_0x8860e0['authors']=_0x8860e0['authorsIds']['map'](_0x1a47b8=>this['editor']['plugins']['get']('Users')['getUser'](_0x1a47b8)),this['currentRevision']['_update'](_0x8860e0);}}async['saveRevision'](_0x3b90c5={},_0x976d2=null){const _0x2ab4f0=[];await this['_loadState'](),this['_continueCurrentRevision']=!0x1,_0x976d2>this['currentRevision']['toVersion']&&(_0x976d2=null),null===_0x976d2&&(_0x976d2=await this['_source']['getLatestVersion']());const _0x34f04b=this['_getFromVersion'](_0x976d2),_0x1d7da5=this['buildRevisionData']({'from':_0x34f04b,'to':_0x976d2});if(this['currentRevision']['toVersion']<_0x976d2){const _0x587abd=this['buildRevisionData']({'revision':this['currentRevision'],'from':_0x976d2,'to':_0x976d2});_0x587abd['authors']=[],_0x587abd['authorsIds']=[],_0x587abd['id']=this['currentRevision']['id'],this['currentRevision']['_update'](_0x587abd,!0x0),delete _0x587abd['authors'],_0x2ab4f0['push'](_0x587abd);}const _0x4ec353={..._0x3b90c5,'creatorId':this['editor']['plugins']['get']('Users')['me']['id'],'name':_0x3b90c5['name']||null,'id':_0x3b90c5['id']||_0x37fc40(),..._0x1d7da5,'attributes':{..._0x3b90c5['attributes'],..._0x1d7da5['attributes']}},_0x39fa39=this['addRevisionData'](_0x4ec353);_0x2ab4f0['push'](_0x4ec353);const _0x26c565=this['repository']['getIndex'](_0x39fa39);if(0x0!==_0x26c565){const _0x38950e=this['repository']['getRevision'](_0x26c565-0x1);if(_0x38950e['fromVersion']!==_0x976d2){const _0xafed94=this['_revisionDataBuilder']['getData'](_0x976d2,_0x38950e['toVersion']),_0x1f5140={'id':_0x38950e['id'],'diffData':_0xafed94['diffData'],'authorsIds':_0xafed94['authorsIds'],'authors':_0xafed94['authorsIds']['map'](_0x2c732b=>this['editor']['plugins']['get']('Users')['getUser'](_0x2c732b)),'fromVersion':_0x976d2};this['_stampAiAttribute'](_0x1f5140,_0x38950e,!!_0xafed94['hasAIChanges']),_0x38950e===this['currentRevision']&&(_0x1f5140['createdAt']=new Date(_0x4ec353['createdAt']['getTime']()+0xa)),_0x38950e['_update'](_0x1f5140,!0x0),delete _0x1f5140['authors'],_0x2ab4f0['push'](_0x1f5140);}}if(this['adapter']){for(const _0x5e38cc of _0x2ab4f0)this['_bufferUpdate'](_0x5e38cc['id'],_0x5e38cc,!0x0);this['sendBufferedUpdates']();}return _0x39fa39;}addRevisionData(_0x57477e){const _0x2fa02a=this['repository']['createRevision'](_0x57477e);return this['adapter']&&_0x2fa02a['on']('_update',(_0x15de5d,_0x571aa4,_0x507eea)=>{_0x507eea||(this['_bufferUpdate'](_0x571aa4['id'],_0x571aa4,!0x0),this['sendBufferedUpdates']());}),this['repository']['addRevision'](_0x2fa02a,this['_findInsertionIndex'](_0x2fa02a)),_0x2fa02a;}async getRevisionDocumentData(_0x21465b){return await this['_utils']['loadRevisionData'](_0x21465b,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x21465b);}async getRevisionRootsAttributes(_0x31c931){return await this['_utils']['loadRevisionData'](_0x31c931,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x31c931);}sendBufferedUpdates(){if(0x0===this['_bufferedUpdates']['size'])return;if(this['_isPendingUpdate'])return;let _0x53fa7f=Array['from'](this['_bufferedUpdates']['values']());this['_bufferedUpdates']['clear']();for(let _0x10b63b=0x0;_0x10b63b<_0x53fa7f['length'];_0x10b63b++){const _0x86df9d=_0x53fa7f[_0x10b63b];let _0x231e4b=!0x1;for(const _0x1a43b6 of Object['keys'](_0x86df9d))void 0x0===_0x86df9d[_0x1a43b6]?delete _0x86df9d[_0x1a43b6]:'id'!==_0x1a43b6&&(_0x231e4b=!0x0);_0x231e4b||(_0x53fa7f[_0x10b63b]=null);}if(_0x53fa7f=_0x53fa7f['filter'](_0x59ec14=>null!==_0x59ec14),!_0x53fa7f['length'])return;for(let _0x585963=0x0;_0x585963<_0x53fa7f['length'];_0x585963++){const _0x538bb3=_0x53fa7f[_0x585963];void 0x0!==_0x538bb3['fromVersion']&&void 0x0===_0x538bb3['toVersion']&&(_0x538bb3['toVersion']=this['repository']['getRevision'](_0x538bb3['id'])['toVersion']),void 0x0!==_0x538bb3['toVersion']&&void 0x0===_0x538bb3['fromVersion']&&(_0x538bb3['fromVersion']=this['repository']['getRevision'](_0x538bb3['id'])['fromVersion']);}const _0x256958=this['editor']['config']['get']('collaboration.channelId');this['_isPendingUpdate']=!0x0,this['_addPendingAction'](),this['adapter']['updateRevisions'](_0x53fa7f,_0x256958)['finally'](()=>{this['_isPendingUpdate']=!0x1;})['then'](_0x310c4d=>{if(_0x310c4d){for(const _0x15b503 of _0x310c4d)this['setRevisionData']({'id':_0x15b503['id'],'createdAt':_0x15b503['createdAt']});}this['_removePendingAction'](),this['sendBufferedUpdates']();});}_stampAiAttribute(_0x13595f,_0x3e4ad,_0x4af7e4){if(_0x4af7e4===(!!_0x3e4ad&&!!_0x3e4ad['attributes']['@ai']))return;const _0x11a4b8={..._0x3e4ad?_0x3e4ad['attributes']:{},..._0x13595f['attributes']};_0x4af7e4?_0x11a4b8['@ai']=!0x0:delete _0x11a4b8['@ai'],_0x13595f['attributes']=_0x11a4b8;}buildRevisionData({revision:_0x21052=null,from:_0x47d127=null,to:_0x1c0c59=null}){_0x47d127=null!==_0x47d127?_0x47d127:_0x21052['fromVersion'],_0x1c0c59=null!==_0x1c0c59?_0x1c0c59:_0x21052['toVersion'];const _0x515d57=this['_revisionDataBuilder']['getData'](_0x47d127,_0x1c0c59),_0x363aee={'diffData':_0x515d57['diffData'],'authorsIds':_0x515d57['authorsIds'],'fromVersion':_0x47d127,'toVersion':_0x1c0c59};if(this['_stampAiAttribute'](_0x363aee,_0x21052,!!_0x515d57['hasAIChanges']),!_0x21052||_0x1c0c59!==_0x21052['toVersion']){const _0x4a560f=_0x1c0c59-0x1,_0x22a6b0=this['_source']['history']['getOperation'](_0x4a560f);_0x363aee['createdAt']=_0x22a6b0&&_0x22a6b0['createdAt']||new Date();}if(this['_loadedStateData']&&_0x47d127===this['_loadedStateData']['fromVersion']){for(const _0x50ca13 of this['_loadedStateData']['authors'])_0x363aee['authorsIds']['includes'](_0x50ca13['id'])||_0x363aee['authorsIds']['push'](_0x50ca13['id']);}return _0x363aee;}_bufferUpdate(_0x1b9653,_0x137abb,_0x1cc3a0){if(this['_bufferedUpdates']['has'](_0x1b9653)){const _0x2a0982=this['_bufferedUpdates']['get'](_0x1b9653);_0x137abb=_0x1cc3a0?{..._0x2a0982,..._0x137abb}:{..._0x137abb,..._0x2a0982};}this['_bufferedUpdates']['set'](_0x1b9653,_0x137abb);}setRevisionData(_0xdbdf1c){const _0x5d3192=this['repository']['getRevision'](_0xdbdf1c['id']);if(_0xdbdf1c['createdAt']&&(_0xdbdf1c['createdAt']=new Date(_0xdbdf1c['createdAt'])),_0xdbdf1c['authorsIds']){const _0x21d591=this['editor']['plugins']['get']('Users');_0xdbdf1c['authors']=_0xdbdf1c['authorsIds']['map'](_0x3e9b44=>_0x21d591['getUser'](_0x3e9b44));}_0x5d3192['_update'](_0xdbdf1c,!0x0);}_createInitialRevision(_0x4be21a){const _0x48a986=this['repository']['getRevision'](this['repository']['length']-0x1);if(_0x48a986)this['_initialRevisionId']=_0x48a986['id'];else{const _0x172091=!this['editor']['model']['document']['roots']['find'](_0x538ace=>this['editor']['model']['hasContent'](_0x538ace)),_0x10f3d8=this['editor']['plugins']['get']('Users')['me']['id'],_0xf3f997=kt(this['editor']['locale'],_0x172091?'Empty\x20document':'Initial\x20revision');this['_makeRevision']({'from':_0x4be21a,'to':_0x4be21a,'id':this['_initialRevisionId'],'name':_0xf3f997,'creatorId':_0x10f3d8});}}_createCurrentRevision(_0x1cdd67){const _0x27f978=this['_source']['getCurrentRevisionId']();this['currentRevision']=this['repository']['getRevision'](_0x27f978),this['currentRevision']||(this['currentRevision']=this['_makeRevision']({'from':_0x1cdd67,'to':_0x1cdd67,'id':_0x27f978,'name':'','creatorId':null}));}async _loadState(){this['_continueCurrentRevision']&&!this['_loadedStateData']&&(await this['_utils']['loadRevisionData'](this['currentRevision'],this['adapter']),this['_revisionDataBuilder']['loadState'](this['currentRevision']),this['_loadedStateData']={'fromVersion':this['currentRevision']['fromVersion'],'authors':this['currentRevision']['authors']['slice']()});}_replaceEditorDataWithRevisionData(_0x1b4d6c,_0x396d66,_0x270626){const _0x10cb8b={},_0x49d9ce={},_0x261cd9={},_0x47689e=this['editor']['config']['get']('roots')||{};for(const [_0x4f9ba3,_0x5640f6]of Object['entries'](_0x47689e))_0x5640f6['lazyLoad']||(_0x10cb8b[_0x4f9ba3]=_0x5640f6['initialData']??'',_0x49d9ce[_0x4f9ba3]=_0x5640f6['modelAttributes']||{},_0x5640f6['modelElement']&&(_0x261cd9[_0x4f9ba3]=_0x5640f6['modelElement']));for(const _0x640847 of this['editor']['model']['document']['getRootNames']())_0x10cb8b[_0x640847]??='',_0x49d9ce[_0x640847]??={};let _0x5a468c=!0x1;const _0x469d36=Object['keys'](_0x10cb8b),_0x2dc589=Object['keys'](_0x1b4d6c);for(const _0x1e167e of _0x469d36){if(_0x10cb8b[_0x1e167e]!==_0x1b4d6c[_0x1e167e]&&''!==_0x10cb8b[_0x1e167e]['trim']()){_0x5a468c=!0x0;break;}if(!_0x5278fa(_0x49d9ce[_0x1e167e],_0x396d66[_0x1e167e])&&Object['keys'](_0x49d9ce[_0x1e167e])['length']>0x0){_0x5a468c=!0x0;break;}const _0x7e4575=_0x261cd9[_0x1e167e],_0x3dc19c=_0x270626[_0x1e167e];if(_0x7e4575&&_0x3dc19c&&_0x7e4575!==_0x3dc19c){_0x5a468c=!0x0;break;}}_0x5a468c||(_0x5a468c=_0x2dc589['some'](_0x560492=>!this['editor']['model']['document']['getRoot'](_0x560492))),_0x5a468c&&_0x156ae5('editor-initial-data-replaced-with-revision-data',{'editorData':_0x10cb8b,'editorRootsAttributes':_0x49d9ce,'editorRootsModelElements':_0x261cd9,'revisionData':_0x1b4d6c,'revisionRootsAttributes':_0x396d66,'revisionRootsModelElements':_0x270626});for(const [_0x56c944,_0x3e932d]of Object['entries'](_0x1b4d6c))this['editor']['config']['set']('roots.'+_0x56c944+'.initialData',_0x3e932d);for(const [_0x44d051,_0x52d500]of Object['entries'](_0x396d66))this['editor']['config']['set']('roots.'+_0x44d051+'.modelAttributes',_0x52d500);const _0xdace2=this['editor']['model']['document'];for(const [_0x5debbc,_0x2574be]of Object['entries'](_0x270626)){this['editor']['config']['set']('roots.'+_0x5debbc+'.modelElement',_0x2574be);const _0x333ea1=_0xdace2['getRoot'](_0x5debbc);_0x333ea1&&_0x333ea1['name']!==_0x2574be&&(_0xdace2['roots']['remove'](_0x5debbc),_0xdace2['createRoot'](_0x2574be,_0x5debbc));}}_addPendingAction(){if(!this['_pendingAction']){const _0x372b44=this['editor']['plugins']['get']('PendingActions');this['_pendingAction']=_0x372b44['add'](kt(this['editor']['locale'],'PENDING_ACTION_REVISION_HISTORY'));}}_removePendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get']('PendingActions')['remove'](this['_pendingAction']),this['_pendingAction']=null);}_findInsertionIndex(_0x535ad9){const _0x3073ee=this['repository']['getRevisions']();_0x3073ee['reverse']();let _0x52bcc6=0x0;for(;_0x52bcc6<_0x3073ee['length'];){const _0x55c92e=_0x3073ee[_0x52bcc6];if(_0x55c92e===this['currentRevision']){_0x52bcc6++;continue;}if(_0x55c92e['id']===this['_initialRevisionId'])break;const _0x31ee37=_0x535ad9['toVersion']-_0x55c92e['toVersion']||_0x535ad9['fromVersion']-_0x55c92e['fromVersion'];if(_0x31ee37>0x0)break;if(_0x31ee37<0x0)_0x52bcc6++;else{if(!_0x535ad9['creator']&&_0x55c92e['creator'])break;if(_0x55c92e['creator']||!_0x535ad9['creator']){if(_0x535ad9['createdAt']>_0x55c92e['createdAt'])break;_0x52bcc6++;}else _0x52bcc6++;}}return _0x52bcc6;}_getFromVersion(_0x35ebce){const _0x22baf6=this['repository']['getRevisions']();_0x22baf6['reverse'](),_0x22baf6['shift']();const _0x28fc60=_0x22baf6['find'](_0x276e99=>_0x276e99['toVersion']<=_0x35ebce)['toVersion'];return _0x28fc60<this['_startingVersion']?this['_startingVersion']:_0x28fc60;}['_makeRevision']({name:_0x47ef5a,from:_0x1269c4,to:_0x347bdb,creatorId:_0x1291a6,id:_0x5d898f}){const _0x37ee4a=this['buildRevisionData']({'from':_0x1269c4,'to':_0x347bdb});_0x37ee4a['name']=_0x47ef5a,_0x37ee4a['creatorId']=_0x1291a6,_0x37ee4a['id']=_0x5d898f;const _0x203979=this['addRevisionData'](_0x37ee4a);return this['adapter']&&this['_bufferUpdate'](_0x37ee4a['id'],_0x37ee4a,!0x0),_0x203979;}_setConversion(){this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'});}},It=class{editor;['source'];_savedMetaData;_lastFrom;_lastTo;['_markers'];_diffRoots;_diffRootsAttributes;_baseRoots;_baseRootsAttributes;_idsRoots;_baseIdsRoots;_touched;_touchedMarkers;['_aiTouchedMarkers'];_touchedRoots;['_revisionId'];_startingRevisionId;constructor(_0x576832){this['editor']=_0x576832,this['_savedMetaData']=new Map(),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_markers']=new Map(),this['_diffRoots']=new Map(),this['_diffRootsAttributes']=new Map(),this['_baseRoots']=new Map(),this['_baseRootsAttributes']=new Map(),this['_idsRoots']=new Map(),this['_baseIdsRoots']=new Map(),this['_touched']=new Map(),this['_touchedMarkers']=new Map(),this['_aiTouchedMarkers']=new Map(),this['_touchedRoots']=new Map(),this['_revisionId']=0x1;}init(_0x257a38){this['source']=_0x257a38;const _0x3dc3c4=new Map(),_0x5c3c42=new Map(),_0x2ac20b=this['editor']['model']['document']['roots']['map'](_0xad5747=>_0xad5747['rootName']);for(const _0x22f2f5 of _0x2ac20b){const _0x4e4c2b=this['editor']['model']['document']['getRoot'](_0x22f2f5),_0xd82071=St(_0x4e4c2b);_0x3dc3c4['set'](_0x22f2f5,_0xd82071),_0x5c3c42['set'](_0x22f2f5,Object['fromEntries'](_0x4e4c2b['getAttributes']()));}const _0x157626=Array['from'](this['editor']['model']['markers'])['map'](_0x13c8c4=>[_0x13c8c4['name'],_0x13c8c4['getRange']()]),_0x12bc39=this['source']['version'];this['_saveMetaData'](_0x12bc39,_0x3dc3c4,_0x157626,_0x5c3c42),this['_startingRevisionId']=this['_revisionId'];const _0x1b54d6=new Map(),_0x64035e=new Map();for(const _0x10cc4b of _0x2ac20b){const _0x1b4b6e=Et(_0x10cc4b,this['editor']['model']['document']['getRoot'](_0x10cc4b)['name']);_0x1b54d6['set'](_0x10cc4b,_0x1b4b6e),_0x64035e['set'](_0x10cc4b,{});}this['_saveMetaData'](Number['NEGATIVE_INFINITY'],_0x1b54d6,[],_0x64035e);}getData(_0x2e9111,_0xbb0eb6){if(this['_lastFrom']===_0x2e9111&&this['_lastTo']<=_0xbb0eb6)this['_savedMetaData']['size']>0x1&&this['_removeMetaData'](this['_lastTo']),this['_applyOperations'](this['_lastTo'],_0xbb0eb6,!0x0);else{if(!this['_savedMetaData']['has'](_0x2e9111)){const _0x59c0c7=this['_getPreviousFrom'](_0x2e9111);this['_calculateMetaData'](_0x59c0c7,_0x2e9111,!0x1);}this['_calculateMetaData'](_0x2e9111,_0xbb0eb6,!0x0);}return this['_lastFrom']=_0x2e9111,this['_lastTo']=_0xbb0eb6,this['_getState']();}loadState(_0x4a8687){if(!this['_savedMetaData']['has'](_0x4a8687['fromVersion'])){const _0x4b88d3=this['_getPreviousFrom'](_0x4a8687['fromVersion']);this['_calculateMetaData'](_0x4b88d3,_0x4a8687['fromVersion'],!0x1);}this['_calculateMetaData'](_0x4a8687['fromVersion'],_0x4a8687['toVersion'],!0x1);const _0x16243d=this['editor']['plugins']['get']('RevisionHistoryUtils');this['_reset'](),this['_lastFrom']=_0x4a8687['fromVersion'],this['_lastTo']=_0x4a8687['toVersion'];for(const _0x151fe5 in _0x4a8687['diffData']){const _0x3106fe=_0x4a8687['diffData'][_0x151fe5]['attachChange'],_0x43005e=_0x1ebade(_0x4a8687['diffData'][_0x151fe5]['attributesBefore'])||{},_0xfc1df2=_0x4a8687['diffData'][_0x151fe5],_0x1fcb0b=_0x16243d['_makeModelFromViewString'](_0xfc1df2['deletions'],_0xfc1df2['rootElementName']||'$root');_0x1fcb0b['rootName']=_0x151fe5,_0x1fcb0b['_isAttached']=!_0x3106fe||!_0x3106fe['isAttached'],_0x1fcb0b['isAttached']=()=>_0x1fcb0b['_isAttached'],this['_baseRoots']['set'](_0x151fe5,_0x1fcb0b),this['_baseRootsAttributes']['set'](_0x151fe5,_0x43005e),_0x3106fe&&this['_touchedRoots']['set'](_0x151fe5,_0x3106fe);const _0x204906=this['_makeIdsRoot'](_0x1fcb0b);this['_baseIdsRoots']['set'](_0x151fe5,_0x204906);for(const [_0x401521,_0x341b49]of _0x1fcb0b['markers']){if(!_0x401521['startsWith']('revision:'))continue;const _0x5305ea=_0x401521['split'](':')[0x2],_0x3cabe=_0xfc1df2['aiSources']?.[_0x401521]||null;for(const _0x42b508 of _0x341b49['getWalker']({'singleCharacters':!0x0})){const _0x32c9ba=this['_getVidAttributeName'](_0x42b508),_0xdcac6b='elementEnd'==_0x42b508['type']?_0x42b508['previousPosition']['path']['slice'](0x0,-0x1):_0x42b508['previousPosition']['path'],_0x2bce00=_0x204906['getNodeByPath'](_0xdcac6b)['getAttribute'](_0x32c9ba);this['_touched']['set'](_0x2bce00,{'userId':_0x5305ea,'aiSource':_0x3cabe});}_0x1fcb0b['markers']['delete'](_0x401521);}}this['_startingRevisionId']=this['_revisionId'];const _0x447def=[...Array(this['_revisionId'])['keys']()]['slice'](0x1)['filter'](_0x5329ae=>!this['_touched']['has'](_0x5329ae));let _0x23d710=0x0;const _0x3ba2ef=new Map();for(const _0x362848 in _0x4a8687['diffData']){const _0x18fe00=_0x4a8687['diffData'][_0x362848]['attachChange'],_0x50d110=_0x1ebade(_0x4a8687['diffData'][_0x362848]['attributesAfter'])||{},_0x2b672c=_0x4a8687['diffData'][_0x362848],_0x389604=_0x16243d['_makeModelFromViewString'](_0x2b672c['insertions'],_0x2b672c['rootElementName']||'$root');_0x389604['rootName']=_0x362848,_0x389604['_isAttached']=!_0x18fe00||_0x18fe00['isAttached'],_0x389604['isAttached']=()=>_0x389604['_isAttached'],this['_diffRoots']['set'](_0x362848,_0x389604),this['_diffRootsAttributes']['set'](_0x362848,_0x50d110);const _0x33335c=this['_makeIdsRoot'](_0x389604,Number['NEGATIVE_INFINITY']);this['_idsRoots']['set'](_0x362848,_0x33335c),_0x3ba2ef['set'](_0x362848,_0x389604['isAttached']()?_0x50d110:{});for(const [_0x3b002b,_0x189ce1]of _0x389604['markers']){if(!_0x3b002b['startsWith']('revision:'))continue;const _0x25588e=_0x3b002b['split'](':')[0x2],_0x157876=_0x2b672c['aiSources']?.[_0x3b002b]||null;for(const _0x3620ab of _0x189ce1['getWalker']({'singleCharacters':!0x0})){const _0x64a7ce=this['_getVidAttributeName'](_0x3620ab),_0x32bb54=this['_revisionId']++,_0x29ed70='elementEnd'==_0x3620ab['type']?_0x3620ab['previousPosition']['path']['slice'](0x0,-0x1):_0x3620ab['previousPosition']['path'];_0x33335c['getNodeByPath'](_0x29ed70)['_setAttribute'](_0x64a7ce,_0x32bb54),this['_touched']['set'](_0x32bb54,{'userId':_0x25588e,'aiSource':_0x157876});}_0x389604['markers']['delete'](_0x3b002b);}for(const _0x1aa2fe of this['editor']['model']['createRangeIn'](_0x389604)['getWalker']({'singleCharacters':!0x0})){const _0x26277d=this['_getVidAttributeName'](_0x1aa2fe),_0x40a254='elementEnd'==_0x1aa2fe['type']?_0x1aa2fe['previousPosition']['path']['slice'](0x0,-0x1):_0x1aa2fe['previousPosition']['path'],_0x14f5d5=_0x33335c['getNodeByPath'](_0x40a254);_0x14f5d5['getAttribute'](_0x26277d)>0x0||_0x14f5d5['_setAttribute'](_0x26277d,_0x447def[_0x23d710++]);}for(const [_0x3900b5,_0x552972]of _0x389604['markers'])_0x3900b5['startsWith']('revision:')||this['_markers']['set'](_0x3900b5,_0x552972);}const {roots:_0x138b0f}=this['_savedMetaData']['get'](_0x4a8687['fromVersion']),{roots:_0x24e2bf}=this['_savedMetaData']['get'](_0x4a8687['toVersion']),_0x25dcff=St(_0x138b0f['get']('$graveyard'));this['_baseRoots']['set']('$graveyard',_0x25dcff),this['_baseIdsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x25dcff,Number['NEGATIVE_INFINITY']));const _0x58c6c2=St(_0x24e2bf['get']('$graveyard'));this['_diffRoots']['set']('$graveyard',_0x58c6c2),this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x58c6c2));const _0x49c445=Array['from'](this['_diffRoots'])['map'](([_0x1c3d40,_0x2c2d02])=>[_0x1c3d40,St(_0x2c2d02)]);this['_saveMetaData'](this['_lastTo'],_0x49c445,this['_markers'],_0x3ba2ef);}reInit(){this['_reset'](),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_savedMetaData']['clear'](),this['init'](this['source']);}_saveMetaData(_0x4aab16,_0xf72183,_0xc6fa01,_0x80630b){const _0x48dca0=new Map(_0xf72183),_0x3ffaec=new Map(_0x1ebade(_0x80630b)),_0x22da7f=new Map();for(const [_0x47697d,_0x1567a1]of _0xc6fa01)_0x22da7f['set'](_0x47697d,{'start':_0x1567a1['start']['clone'](),'end':_0x1567a1['end']['clone'](),'rootName':_0x1567a1['root']['rootName']});this['_savedMetaData']['set'](_0x4aab16,{'roots':_0x48dca0,'markers':_0x22da7f,'rootsAttributes':_0x3ffaec});}_removeMetaData(_0x1a1d03){this['_savedMetaData']['delete'](_0x1a1d03);}_reset(){this['_touched']['clear'](),this['_touchedMarkers']['clear'](),this['_aiTouchedMarkers']['clear'](),this['_touchedRoots']['clear'](),this['_diffRoots']['clear'](),this['_diffRootsAttributes']['clear'](),this['_baseRoots']['clear'](),this['_baseRootsAttributes']['clear'](),this['_idsRoots']['clear'](),this['_baseIdsRoots']['clear'](),this['_markers']['clear'](),this['_revisionId']=0x1,this['_startingRevisionId']=this['_revisionId'];}_makeIdsRoot(_0x31ab9c,_0x3c3375=null){let _0x53f830=null;_0x31ab9c['is']('documentFragment')||(_0x53f830=new _0xf48e9f(_0x31ab9c['name'],{'vid_start':null===_0x3c3375?this['_revisionId']++:_0x3c3375++}));const _0x141cd1=[];for(const _0x46ff3c of _0x31ab9c['getChildren']())if(_0x46ff3c['is']('element')){_0x141cd1['push'](this['_makeIdsRoot'](_0x46ff3c,_0x3c3375));const _0x442126=_0x141cd1[_0x141cd1['length']-0x1];null!==_0x3c3375&&(_0x3c3375=_0x442126['is']('element','$text')?_0x442126['getAttribute']('vid')+0x1:_0x442126['getAttribute']('vid_end')+0x1);}else{for(let _0x4e7f05=0x0;_0x4e7f05<_0x46ff3c['offsetSize'];_0x4e7f05++)_0x141cd1['push'](new _0xf48e9f('$text',{'vid':null===_0x3c3375?this['_revisionId']++:_0x3c3375++}));}if(_0x31ab9c['is']('documentFragment')){const _0x1d01d0=Et(_0x31ab9c['rootName'],_0x31ab9c['name']);return _0x1d01d0['_insertChild'](0x0,_0x141cd1),_0x1d01d0;}return _0x53f830['_setAttribute']('vid_end',null===_0x3c3375?this['_revisionId']++:_0x3c3375),_0x53f830['_insertChild'](0x0,_0x141cd1),_0x53f830;}_calculateMetaData(_0x299554,_0x5d5fe1,_0x449301){this['_reset']();const {roots:_0x5e13bb,markers:_0x381c1d,rootsAttributes:_0x580154}=this['_savedMetaData']['get'](_0x299554);this['_baseRoots']=new Map(_0x5e13bb),this['_baseRootsAttributes']=new Map(_0x1ebade(_0x580154));for(const [_0x92b8ca,_0x1a66ea]of this['_baseRoots'])if('$graveyard'!==_0x92b8ca&&(this['_diffRoots']['set'](_0x92b8ca,St(_0x1a66ea)),this['_diffRootsAttributes']=new Map(_0x1ebade(_0x580154)),_0x449301)){const _0x1e69cb=this['_revisionId'];this['_idsRoots']['set'](_0x92b8ca,this['_makeIdsRoot'](_0x1a66ea)),this['_baseIdsRoots']['set'](_0x92b8ca,this['_makeIdsRoot'](_0x1a66ea,_0x1e69cb));}this['_startingRevisionId']=this['_revisionId'],this['_diffRoots']['set']('$graveyard',St(this['_baseRoots']['get']('$graveyard'))),_0x449301&&this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](this['_baseRoots']['get']('$graveyard')));for(const [_0x319995,_0x2a48d1]of _0x381c1d){const _0x80fc87=this['_baseRoots']['get'](_0x2a48d1['rootName']),_0x191a99=this['_diffRoots']['get'](_0x2a48d1['rootName']),_0x385675=new _0x2ea5f(_0x21a19e(_0x2a48d1['start'],_0x80fc87),_0x21a19e(_0x2a48d1['end'],_0x80fc87)),_0x32ac9d=_0x46d417(_0x385675,_0x191a99);_0x80fc87['markers']['set'](_0x319995,_0x385675),this['_markers']['set'](_0x319995,_0x32ac9d);}this['_applyOperations'](_0x299554,_0x5d5fe1,_0x449301);}_applyOperations(_0xe56e07,_0x2c1f18,_0xfe92b3){for(const _0x58502c of this['source']['getOperations'](_0xe56e07,_0x2c1f18))this['_handleOperation'](_0x58502c,_0xfe92b3);for(const _0x385ab8 of this['_diffRoots']['values']())_0x385ab8['markers']['clear']();for(const [_0xb713c,_0x146a75]of this['_markers'])this['_diffRoots']['get'](_0x146a75['root']['rootName'])['markers']['set'](_0xb713c,_0x146a75['clone']());const _0x1d4169=new Map(),_0x5011d9=new Map();for(const [_0x1aa833,_0x2d3028]of this['_diffRoots'])_0x1d4169['set'](_0x1aa833,St(_0x2d3028)),_0x5011d9['set'](_0x1aa833,this['_diffRootsAttributes']['get'](_0x1aa833));this['_saveMetaData'](_0x2c1f18,_0x1d4169,this['_markers'],_0x5011d9);}_getPreviousFrom(_0x15eb3b){const _0x559ce3=Array['from'](this['_savedMetaData']['keys']());_0x559ce3['sort']((_0x3a604a,_0x50233b)=>_0x3a604a-_0x50233b),_0x559ce3['reverse']();for(const _0x42ca11 of _0x559ce3)if(_0x42ca11<_0x15eb3b)return _0x42ca11;return Number['NEGATIVE_INFINITY'];}['_copyMarkers'](_0x447f0c,_0x26a21a){const _0xb54cea=Array['from'](_0x26a21a['markers'])['map'](([_0xee69c1,_0x1dbc05])=>[_0xee69c1,_0x46d417(_0x1dbc05,_0x447f0c)]);_0x447f0c['markers']=new Map(_0xb54cea);}_transformMarkers(_0x28faeb){for(const _0x74d632 of this['_markers']['values']()){const _0x5b84b8=_0x74d632['getTransformedByOperation'](_0x28faeb),_0x2b021b=_0x2ea5f['_createFromRanges'](_0x5b84b8);_0x74d632['start']=_0x2b021b['start'],_0x74d632['end']=_0x2b021b['end'];}}_handleOperation(_0x47f402,_0x156028){if('addRoot'!=_0x47f402['type']&&'detachRoot'!=_0x47f402['type']){if('insert'==_0x47f402['type']){const _0x83a5dd=_0x47f402['position']['root'],_0x19ec9f=_0x83a5dd['rootName'],_0x5b108f=_0x83a5dd['name'];this['_diffRoots']['has'](_0x19ec9f)||(this['_diffRoots']['set'](_0x19ec9f,Et(_0x19ec9f,_0x5b108f,!0x0)),this['_diffRootsAttributes']['set'](_0x19ec9f,{}),_0x156028&&this['_idsRoots']['set'](_0x19ec9f,Et(_0x19ec9f,_0x5b108f,!0x0)));}else{if('addRootAttribute'==_0x47f402['type']||'removeRootAttribute'==_0x47f402['type']||'changeRootAttribute'==_0x47f402['type'])return void this['_handleRootAttributeOperation'](_0x47f402);'marker'==_0x47f402['type']&&this['_handleMarkerOperation'](_0x47f402);}if('marker'!==_0x47f402['type']){const _0x102ae5=this['_cloneOperation'](_0x47f402,this['_diffRoots']);_0x102ae5['_execute'](),this['_transformMarkers'](_0x102ae5);}if(_0x156028)switch(_0x47f402['type']){case'insert':this['_handleInsertOperation'](_0x47f402);break;case'move':case'remove':case'reinsert':this['_handleMoveOperation'](_0x47f402);break;case'merge':this['_handleMergeOperation'](_0x47f402);break;case'split':this['_handleSplitOperation'](_0x47f402);}}else this['_handleRootOperation'](_0x47f402,_0x156028);}_cloneOperation(_0x14c037,_0x5765cb){const _0x4f129b=_0x14c037['clone']();return _0x4f129b['_authorId']=_0x14c037['_authorId'],_0x4f129b['_aiSource']=_0x14c037['_aiSource'],_0x4f129b['baseVersion']=null,_0x5d5705(_0x4f129b,_0x5765cb),_0x4f129b;}_getBaseVids(_0x1bba74){return _0x1bba74['map'](_0x3cae15=>{const _0x235e93=this['_getVidAttributeName'](_0x3cae15);return Number(_0x3cae15['item']['getAttribute'](_0x235e93));});}_generateTape(_0x5b9b04,_0xec90ce){if(_0x5b9b04['is']('element','$text'))_0xec90ce['push']({'item':_0x5b9b04,'type':'text'});else{_0x5b9b04['is']('element')&&_0xec90ce['push']({'item':_0x5b9b04,'type':'elementStart'});for(const _0x1ab50c of _0x5b9b04['getChildren']())this['_generateTape'](_0x1ab50c,_0xec90ce);_0x5b9b04['is']('element')&&_0xec90ce['push']({'item':_0x5b9b04,'type':'elementEnd'});}return _0xec90ce;}_getState(){const _0x5b7783=new Map(this['_touched']),_0x253733=new Map(_0x5b7783),_0x5d0b2a=new Map(),_0x1f1647={'insertions':{},'deletions':{}},_0x15839e={'insertions':{},'deletions':{}},_0x48473b=new Map(),_0x57a5ec=new Set([...this['_baseRoots']['keys'](),...this['_diffRoots']['keys']()]),_0x1d2cf4=new Map();_0x57a5ec['delete']('$graveyard');for(const _0xc1cd84 of _0x57a5ec){const _0x1bb597=(this['_diffRoots']['get'](_0xc1cd84)??this['_baseRoots']['get'](_0xc1cd84))['name'],_0xc45fc3=this['_diffRoots']['get'](_0xc1cd84)||Et(_0xc1cd84,_0x1bb597,!0x1),_0x4265e7=this['_baseRoots']['get'](_0xc1cd84)||Et(_0xc1cd84,_0x1bb597,!0x1);_0xc45fc3['isAttached']()||_0x4265e7['isAttached']()?(_0x1d2cf4['set'](_0xc1cd84,_0x1bb597),_0x1f1647['insertions'][_0xc1cd84]=St(_0xc45fc3),_0x1f1647['deletions'][_0xc1cd84]=St(_0x4265e7),this['_copyMarkers'](_0x1f1647['deletions'][_0xc1cd84],_0x4265e7),this['_copyMarkers'](_0x1f1647['insertions'][_0xc1cd84],_0xc45fc3),_0x15839e['insertions'][_0xc1cd84]=this['_generateTape'](this['_idsRoots']['get'](_0xc1cd84),[]),_0x15839e['deletions'][_0xc1cd84]=this['_generateTape'](this['_baseIdsRoots']['get'](_0xc1cd84)||Et(_0xc1cd84,_0x1bb597,!0x1),[])):_0x57a5ec['delete'](_0xc1cd84);}for(const _0xbcb21 of _0x57a5ec){const _0x63e470=_0x15839e['insertions'][_0xbcb21];for(const _0x5ef9fc of _0x63e470){const _0xca41f9=this['_getVidAttributeName'](_0x5ef9fc),_0x2c3e40=_0x5ef9fc['item']['getAttribute'](_0xca41f9);_0x253733['delete'](_0x2c3e40),_0x2c3e40>=this['_startingRevisionId']&&_0x5d0b2a['set'](_0x2c3e40,_0x5b7783['get'](_0x2c3e40));}}for(const _0x59f0ec of _0x57a5ec){const _0x19e277=_0x15839e['insertions'][_0x59f0ec],_0x2c41f8=this['_getBaseVids'](_0x15839e['deletions'][_0x59f0ec]);let _0x111dfd=0x0;for(const _0x20f378 of _0x19e277){const _0xdcf597=this['_getVidAttributeName'](_0x20f378),_0x2c4c6a=_0x20f378['item']['getAttribute'](_0xdcf597);if(!_0x5d0b2a['has'](_0x2c4c6a)&&!_0x48473b['has'](_0x2c4c6a)){if(_0x253733['has'](_0x2c4c6a))_0x111dfd++;else{if(_0x2c4c6a!=_0x2c41f8[_0x111dfd]){const _0x46c8dc=_0x5b7783['get'](_0x2c4c6a)||_0x5b7783['get'](_0x2c41f8[_0x111dfd]);for(;_0x2c4c6a!=_0x2c41f8[_0x111dfd];)_0x253733['has'](_0x2c41f8[_0x111dfd])||(_0x48473b['set'](_0x2c41f8[_0x111dfd],_0x46c8dc),_0x5b7783['set'](_0x2c41f8[_0x111dfd],_0x46c8dc)),_0x111dfd++;}_0x111dfd++;}}}}for(const _0x182643 of _0x57a5ec){const _0x17d181=_0x15839e['insertions'][_0x182643];for(const _0x271d16 of _0x17d181){const _0x23003f=this['_getVidAttributeName'](_0x271d16),_0x3907fc=_0x271d16['item']['getAttribute'](_0x23003f);if(_0x48473b['has'](_0x3907fc)){const _0x4facd2=_0x48473b['get'](_0x3907fc);_0x253733['has'](_0x3907fc)||_0x253733['set'](_0x3907fc,{..._0x4facd2}),_0x5d0b2a['set'](_0x3907fc,{..._0x4facd2});}}}for(const _0x25a8b9 of _0x253733['keys']())_0x25a8b9>=this['_startingRevisionId']&&_0x253733['delete'](_0x25a8b9);const _0x40adb3=new Map();for(const _0x1491cb of _0x57a5ec){let _0x23d14c=_0x15839e['insertions'][_0x1491cb];for(const _0x2df14b of _0x23d14c)if(_0x2df14b['item']['is']('element','tableCell')){const _0x4464a7=this['_getVidAttributeName'](_0x2df14b),_0x443322=_0x2df14b['item']['getAttribute'](_0x4464a7);if(_0x5d0b2a['has'](_0x443322)){const _0x372213=_0x2df14b['item']['parent']['parent']['getAttribute']('vid_start'),_0x237cfe=_0x5d0b2a['get'](_0x443322),_0x47b8a5=_0x40adb3['get'](_0x372213)||{'users':new Set(),'aiSource':null};_0x47b8a5['users']['add'](_0x237cfe['userId']),_0x47b8a5['aiSource']=_0x47b8a5['aiSource']||_0x237cfe['aiSource']||null,_0x40adb3['set'](_0x372213,_0x47b8a5);}}_0x23d14c=_0x15839e['deletions'][_0x1491cb];for(const _0x265a83 of _0x23d14c)if(_0x265a83['item']['is']('element','tableCell')){const _0xc1f97e=this['_getVidAttributeName'](_0x265a83),_0x5a21a8=_0x265a83['item']['getAttribute'](_0xc1f97e);if(_0x253733['has'](_0x5a21a8)){const _0x4c3101=_0x265a83['item']['parent']['parent']['getAttribute']('vid_start'),_0x5dd653=_0x253733['get'](_0x5a21a8),_0x22166c=_0x40adb3['get'](_0x4c3101)||{'users':new Set(),'aiSource':null};_0x22166c['users']['add'](_0x5dd653['userId']),_0x22166c['aiSource']=_0x22166c['aiSource']||_0x5dd653['aiSource']||null,_0x40adb3['set'](_0x4c3101,_0x22166c);}}for(const _0xb5d579 of _0x40adb3['keys']())(_0x5d0b2a['has'](_0xb5d579)||_0x253733['has'](_0xb5d579))&&_0x40adb3['delete'](_0xb5d579);}for(const _0x4f1947 of _0x57a5ec){const _0x184d2d=_0x15839e['insertions'][_0x4f1947];let _0x772e53=null,_0x5b3216=null,_0x5a02a1=null;for(const _0x28f734 of _0x184d2d){const _0x37e038=this['_getVidAttributeName'](_0x28f734),_0x36ff34=_0x28f734['item']['getAttribute'](_0x37e038),_0x370a92=_0x40adb3['get'](_0x36ff34);if(_0x370a92&&'elementStart'==_0x28f734['type']&&(_0x772e53=Array['from'](_0x370a92['users'])[0x0],_0x5b3216=_0x370a92['aiSource'],_0x5a02a1=_0x28f734['item']['getAttribute']('vid_end')),_0x772e53){const _0x4551a2=_0x5b3216||_0x253733['get'](_0x36ff34)?.['aiSource']||null,_0x5bc68f=_0x5b3216||_0x5d0b2a['get'](_0x36ff34)?.['aiSource']||null;_0x253733['set'](_0x36ff34,{'userId':_0x772e53,'aiSource':_0x4551a2}),_0x5d0b2a['set'](_0x36ff34,{'userId':_0x772e53,'aiSource':_0x5bc68f});}_0x36ff34==_0x5a02a1&&(_0x772e53=null,_0x5a02a1=null);}}const _0x2c1428={},_0x4f7aa3=new Set();for(const _0x3253b8 of _0x57a5ec){const _0x222e83=_0x1f1647['deletions'][_0x3253b8],_0x34ddd1=_0x1f1647['insertions'][_0x3253b8];for(const {userId:_0x1bbd20}of this['_touchedMarkers']['values']())null!==_0x1bbd20&&_0x4f7aa3['add'](_0x1bbd20);for(const {userId:_0x5a28e0}of this['_touchedRoots']['values']())null!==_0x5a28e0&&_0x4f7aa3['add'](_0x5a28e0);const _0x47709a={};this['_markChanges'](_0x34ddd1,_0x15839e['insertions'][_0x3253b8],_0x5d0b2a,'insertion',_0x4f7aa3,_0x47709a),this['_markChanges'](_0x222e83,_0x15839e['deletions'][_0x3253b8],_0x253733,'deletion',_0x4f7aa3,_0x47709a),this['_collectSuggestionAiSources'](_0x34ddd1,_0x47709a),this['_collectSuggestionAiSources'](_0x222e83,_0x47709a),_0x2c1428[_0x3253b8]={'insertions':this['_prepareViewToSave'](_0x34ddd1),'deletions':this['_prepareViewToSave'](_0x222e83),'attachChange':this['_touchedRoots']['get'](_0x3253b8)||null,'attributesBefore':_0x1ebade(this['_baseRootsAttributes']['get'](_0x3253b8))||{},'attributesAfter':_0x1ebade(this['_diffRootsAttributes']['get'](_0x3253b8)),'rootElementName':_0x1d2cf4['get'](_0x3253b8),'aiSources':_0x47709a};}const _0x47c829=Array['from'](_0x5d0b2a['values']())['some'](_0x1671de=>!(!_0x1671de||!_0x1671de['aiSource']))||Array['from'](_0x253733['values']())['some'](_0x38c516=>!(!_0x38c516||!_0x38c516['aiSource']))||Array['from'](this['_touchedMarkers']['keys']())['some'](_0x35fe18=>this['_aiTouchedMarkers']['has'](_0x35fe18));return{'diffData':_0x2c1428,'authorsIds':Array['from'](_0x4f7aa3),'hasAIChanges':_0x47c829};}_collectSuggestionAiSources(_0x5255de,_0xfe0b02){const _0x1cf2fe=_0x5255de['markers'];for(const _0x1b9b98 of _0x1cf2fe['keys']()){if(!_0x1b9b98['startsWith']('suggestion:'))continue;if(!this['_touchedMarkers']['has'](_0x1b9b98))continue;const _0x23a479=this['_aiTouchedMarkers']['get'](_0x1b9b98);_0x23a479&&(_0xfe0b02[_0x1b9b98]=_0x23a479);}}_processRootBeforeSave(_0x1e2a5b){for(const [,_0x1de366]of _0x1e2a5b['markers']){const _0x2c66ee=_0x1de366['start']['getAncestors']()['filter'](_0x144de6=>'tableCell'==_0x144de6['name']);for(const _0x165cc1 of _0x2c66ee)0x1==_0x165cc1['childCount']&&_0x165cc1['getChild'](0x0)['is']('element','paragraph')&&_0x165cc1['getChild'](0x0)['_setAttribute']('keepParagraph',!0x0);}}['_prepareViewToSave'](_0x12d4ca){this['_processRootBeforeSave'](_0x12d4ca);const _0x53be3c=this['editor']['data']['toView'](_0x12d4ca,{}),_0x1b2ac8=Array['from'](_0x53be3c['getChildren']())['map'](_0x2457ee=>this['_getViewJson'](_0x2457ee));return JSON['stringify'](_0x1b2ac8);}_getViewJson(_0xc9a1e6){if(_0xc9a1e6['is']('$text'))return _0xc9a1e6['data'];{const _0x26b6ad=this['editor']['plugins']['get']('RevisionHistoryUtils'),_0x5e30f7=_0xc9a1e6,_0x5dc891=this['editor']['data']['htmlProcessor']['domConverter'],_0x1c03a7={'type':_0x26b6ad['_getTypeCharForViewElement'](_0x5e30f7),'name':_0x5e30f7['name'],'attributes':Array['from'](_0x5e30f7['getAttributes']()),'children':Array['from'](_0x5e30f7['getChildren']())['map'](_0x10db89=>this['_getViewJson'](_0x10db89))};if(_0xc9a1e6['is']('uiElement')&&'$comment'!=_0xc9a1e6['name']){const _0x4989f4=_0xc9a1e6['render'](_0x5dc891['domDocument'],_0x5dc891);_0x1c03a7['children']['push'](_0x4989f4['outerHTML']);}else{if(_0xc9a1e6['is']('rawElement')){const _0x518e77=_0x5dc891['domDocument']['createElement'](_0x5e30f7['name']);_0xc9a1e6['render'](_0x518e77,_0x5dc891),_0x1c03a7['children']['push'](_0x518e77['innerHTML']);}}const _0x46a4ed=Array['from'](_0x5e30f7['getCustomProperties']());_0x46a4ed['length']>0x0&&(_0x1c03a7['customProperties']=_0x46a4ed);const _0x57375b=_0x5e30f7['getFillerOffset']();return null!==_0x57375b&&(_0x1c03a7['fillerOffset']=_0x57375b),_0x1c03a7;}}['_markChanges'](_0x402815,_0x2de0fa,_0x5d06ac,_0x12126c,_0x7fe86c,_0x204817){let _0xd33c8=null,_0x421fdb=null,_0xe63a47=0x0;const _0x2b5ca9=this['editor']['model'];for(let _0x2e7c6e=0x0;_0x2e7c6e<_0x2de0fa['length'];_0x2e7c6e++){const _0x1972ef=this['_getVidAttributeName'](_0x2de0fa[_0x2e7c6e]),_0x351c71=_0x2de0fa[_0x2e7c6e]['item']['getAttribute'](_0x1972ef),_0xfd37c0=_0x5d06ac['get'](_0x351c71),_0x2ba8e8=_0x2e7c6e==_0x2de0fa['length']-0x1;!_0xd33c8&&_0xfd37c0&&(_0xd33c8=_0xfd37c0,_0x421fdb=_0x2de0fa[_0x2e7c6e]);const _0x2d4844=!!_0xd33c8&&!!_0xfd37c0&&_0xfd37c0['userId']!=_0xd33c8['userId'],_0x4141ce=!!_0xd33c8&&!!_0xfd37c0&&_0xfd37c0['aiSource']!=_0xd33c8['aiSource'];_0xd33c8&&(!_0xfd37c0||_0x2d4844||_0x4141ce)&&(_0x3c8de3(_0xfd37c0,Ot(_0x421fdb,_0x402815,_0x2b5ca9),Ot(_0x2de0fa[_0x2e7c6e],_0x402815,_0x2b5ca9)),_0xd33c8=_0xfd37c0||null,_0x421fdb=_0xfd37c0?_0x2de0fa[_0x2e7c6e]:null),_0xd33c8&&_0x2ba8e8&&_0x3c8de3(_0xfd37c0,Ot(_0x421fdb,_0x402815,_0x2b5ca9),Ct(_0x2de0fa[_0x2e7c6e],_0x402815,_0x2b5ca9));}function _0x3c8de3(_0x377801,_0x33e5b6,_0x56fe95){const _0xd633c7=_0xd33c8['userId'],_0x4972e3=_0xd33c8['aiSource'],_0x3a7fe1='revision:'+_0x12126c+':'+_0xd633c7+':'+_0xe63a47++,_0x54b5a9=_0x2b5ca9['createRange'](_0x33e5b6,_0x56fe95);_0x402815['markers']['set'](_0x3a7fe1,_0x54b5a9),_0x4972e3&&(_0x204817[_0x3a7fe1]=_0x4972e3),null!==_0xd633c7&&_0x7fe86c['add'](_0xd633c7);}}_getVidAttributeName(_0x5dde23){switch(_0x5dde23['type']){case'elementStart':return'vid_start';case'elementEnd':return'vid_end';default:return'vid';}}_handleInsertOperation(_0x112c81){const _0x5d8291=this['_idsRoots']['get'](_0x112c81['position']['root']['rootName']),_0x3cdb44=_0x21a19e(_0x112c81['position'],_0x5d8291),_0x4d738c=null===_0x112c81['_authorId']?null:_0x112c81['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x574914=_0x112c81['_aiSource']||null,_0x104331=_0x3cdb44['parent'],_0x1710c4=this['_revisionId'],_0x51e5a1=[];for(const _0x4ab7e1 of _0x112c81['nodes'])if(_0x4ab7e1['is']('element'))_0x51e5a1['push'](this['_makeIdsRoot'](_0x4ab7e1));else{for(let _0x388cdd=0x0;_0x388cdd<_0x4ab7e1['offsetSize'];_0x388cdd++)_0x51e5a1['push'](new _0xf48e9f('$text',{'vid':this['_revisionId']++}));}const _0x104f2c=this['_revisionId'];for(let _0x181cf0=_0x1710c4;_0x181cf0<_0x104f2c;_0x181cf0++)this['_touched']['set'](_0x181cf0,{'userId':_0x4d738c,'aiSource':_0x574914});_0x104331['_insertChild'](_0x3cdb44['offset'],_0x51e5a1);}_setTouched(_0x33a47f,_0x1afc23,_0x191f35){this['_touched']['set'](_0x33a47f,{'userId':_0x1afc23,'aiSource':_0x191f35||this['_touched']['get'](_0x33a47f)?.['aiSource']||null});}_handleMoveOperation(_0x25ad3c){(_0x25ad3c=this['_cloneOperation'](_0x25ad3c,this['_idsRoots']))['_execute']();const _0x28fcb6=null===_0x25ad3c['_authorId']?null:_0x25ad3c['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x5d008a=_0x25ad3c['_aiSource']||null,_0xbcba37=_0x25ad3c['getMovedRangeStart'](),_0x5eb0cf=_0xbcba37['parent'],_0xe19030=_0xbcba37['offset'],_0x2dd6ac=(_0x411b4f,_0xad5010,_0x5a7c35)=>{for(let _0x292024=_0xad5010;_0x292024<_0x5a7c35;_0x292024++){const _0x58f38a=_0x411b4f['getChild'](_0x292024);_0x58f38a['is']('element','$text')?this['_setTouched'](_0x58f38a['getAttribute']('vid'),_0x28fcb6,_0x5d008a):(this['_setTouched'](_0x58f38a['getAttribute']('vid_start'),_0x28fcb6,_0x5d008a),_0x2dd6ac(_0x58f38a,0x0,_0x58f38a['childCount']),this['_setTouched'](_0x58f38a['getAttribute']('vid_end'),_0x28fcb6,_0x5d008a));}};_0x2dd6ac(_0x5eb0cf,_0xe19030,_0xe19030+_0x25ad3c['howMany']);}_handleMergeOperation(_0x11f411){const _0x2226a1=null===(_0x11f411=this['_cloneOperation'](_0x11f411,this['_idsRoots']))['_authorId']?null:_0x11f411['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x36a398=_0x11f411['_aiSource']||null,_0x51855d=_0x11f411['targetPosition']['parent'],_0x5240d1=_0x11f411['sourcePosition']['parent'],_0x37d090=_0x51855d['getAttribute']('vid_end'),_0x2d91c4=_0x5240d1['getAttribute']('vid_start');_0x51855d['_setAttribute']('vid_end',_0x5240d1['getAttribute']('vid_end')),_0x5240d1['_setAttribute']('vid_end',_0x37d090),this['_setTouched'](_0x2d91c4,_0x2226a1,_0x36a398),this['_setTouched'](_0x37d090,_0x2226a1,_0x36a398),_0x11f411['_execute']();}_handleSplitOperation(_0x2751db){const _0x4a9156=null===(_0x2751db=this['_cloneOperation'](_0x2751db,this['_idsRoots']))['_authorId']?null:_0x2751db['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x4636c2=_0x2751db['_aiSource']||null,_0x45ed23=_0x2751db['graveyardPosition'],_0x2f20b4=_0x2751db['splitPosition']['parent'];_0x2751db['_execute']();const _0x37e13b=_0x2f20b4['getAttribute']('vid_end'),_0x46389c=_0x2751db['insertionPosition']['nodeAfter'];if(_0x45ed23){const _0x3c8b28=_0x46389c['getAttribute']('vid_end'),_0x5c02b9=_0x2f20b4['getAttribute']('vid_end');_0x2f20b4['_setAttribute']('vid_end',_0x3c8b28),_0x46389c['_setAttribute']('vid_end',_0x5c02b9),this['_setTouched'](_0x2f20b4['getAttribute']('vid_end'),_0x4a9156,_0x4636c2),this['_setTouched'](_0x46389c['getAttribute']('vid_start'),_0x4a9156,_0x4636c2);}else{const _0x3fb54a=this['_revisionId']++,_0x4bd67d=this['_revisionId']++;_0x2f20b4['_setAttribute']('vid_end',_0x3fb54a),_0x46389c['_setAttribute']('vid_start',_0x4bd67d),_0x46389c['_setAttribute']('vid_end',_0x37e13b),this['_setTouched'](_0x3fb54a,_0x4a9156,_0x4636c2),this['_setTouched'](_0x4bd67d,_0x4a9156,_0x4636c2);}}_handleMarkerOperation(_0x4b1fa5){if(!_0x4b1fa5['affectsData'])return;const _0x2985ac=(_0x4b1fa5=this['_cloneOperation'](_0x4b1fa5,this['_diffRoots']))['oldRange']?_0x4b1fa5['oldRange']['root']:null,_0x2f0c33=_0x4b1fa5['newRange']?_0x4b1fa5['newRange']['root']:null;_0x2985ac&&this['_markers']['delete'](_0x4b1fa5['name']),_0x2f0c33&&this['_markers']['set'](_0x4b1fa5['name'],_0x4b1fa5['newRange']['clone']());const _0x4087f6=null===_0x4b1fa5['_authorId']?null:_0x4b1fa5['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0xb3a4b0=_0x4b1fa5['name'];if(_0x4b1fa5['_aiSource']&&this['_aiTouchedMarkers']['set'](_0xb3a4b0,_0x4b1fa5['_aiSource']),!this['_touchedMarkers']['has'](_0xb3a4b0))return void this['_touchedMarkers']['set'](_0xb3a4b0,{'range':_0x4b1fa5['oldRange'],'userId':_0x4087f6});const _0x799f19=this['_touchedMarkers']['get'](_0xb3a4b0),_0xfd948=_0x799f19['range'],_0x73b697=_0x4b1fa5['newRange'];null==_0xfd948&&null==_0x73b697||_0xfd948&&_0x73b697&&_0xfd948['isEqual'](_0x73b697)?this['_touchedMarkers']['delete'](_0x4b1fa5['name']):_0x799f19['userId']=_0x4087f6;}_handleRootOperation(_0x12559f,_0x12caa0){this['_diffRoots']['has'](_0x12559f['rootName'])?this['_diffRoots']['get'](_0x12559f['rootName'])['_isAttached']=_0x12559f['isAdd']:(this['_diffRoots']['set'](_0x12559f['rootName'],Et(_0x12559f['rootName'],_0x12559f['elementName'],!0x0)),this['_diffRootsAttributes']['set'](_0x12559f['rootName'],{}),_0x12caa0&&this['_idsRoots']['set'](_0x12559f['rootName'],Et(_0x12559f['rootName'],_0x12559f['elementName'],!0x0)));const _0x111545=null===_0x12559f['_authorId']?null:_0x12559f['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x4afc17=this['_touchedRoots']['get'](_0x12559f['rootName']);_0x4afc17&&_0x4afc17['userId']===_0x111545?this['_touchedRoots']['delete'](_0x12559f['rootName']):this['_touchedRoots']['set'](_0x12559f['rootName'],{'userId':_0x111545,'isAttached':_0x12559f['isAdd']});}_handleRootAttributeOperation(_0x1a79ef){const _0x346499=this['_diffRootsAttributes']['get'](_0x1a79ef['root']['rootName']);null===_0x1a79ef['newValue']?delete _0x346499[_0x1a79ef['key']]:_0x346499[_0x1a79ef['key']]=_0x1a79ef['newValue'];}};function St(_0x561ef7){const _0x8dc3f5=Et(_0x561ef7['rootName'],_0x561ef7['name'],_0x561ef7['isAttached']());for(const _0x9e29f1 of _0x561ef7['getChildren']()){const _0x142840=_0x9e29f1['_clone'](!0x0);_0x8dc3f5['_appendChild'](_0x142840);}return _0x8dc3f5;}function Et(_0x2f33aa,_0x1d636a,_0x4b78d3=!0x0){const _0x30bc00=new _0x49656a();return _0x30bc00['rootName']=_0x2f33aa,_0x30bc00['name']=_0x1d636a,_0x30bc00['_isAttached']=_0x4b78d3,_0x30bc00['isAttached']=()=>_0x30bc00['_isAttached'],_0x30bc00;}function Ot(_0x5383fa,_0x20a679,_0x374f4b){const _0x5b38af='elementEnd'==_0x5383fa['type']?_0x374f4b['createPositionAt'](_0x5383fa['item'],'end'):_0x374f4b['createPositionBefore'](_0x5383fa['item']);return _0x374f4b['createPositionFromPath'](_0x20a679,_0x5b38af['path'],_0x5b38af['stickiness']);}function Ct(_0x342440,_0x30357a,_0x74d4c4){const _0x4de84f='elementStart'==_0x342440['type']?_0x74d4c4['createPositionAt'](_0x342440['item'],0x0):_0x74d4c4['createPositionAfter'](_0x342440['item']);return _0x74d4c4['createPositionFromPath'](_0x30357a,_0x4de84f['path'],_0x4de84f['stickiness']);}const Nt=/* #__PURE__ -- @preserve */
25
+ _0x4c8802(dt);var xt=class extends Nt{['focusTracker'];keystrokes;revisionNameInputView;constructor(_0x439d68,_0x4ff673){super(_0x439d68),this['focusTracker']=new _0x1eaccb(),this['keystrokes']=new _0x345931(),this['set']('revisionNameInputValue',''),this['revisionNameInputView']=this['_createRevisionNameInput'](_0x4ff673),this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-revision-history-save-revision-form','ck-responsive-form'],'tabindex':'-1'},'children':[this['revisionNameInputView']]}),this['initializeCssTransitionDisablerMixin']();}['render'](){super['render'](),_t({'view':this}),this['focusTracker']['add'](this['revisionNameInputView']['element']),this['keystrokes']['listenTo'](this['element']);const _0x1b4a69=_0x54c17f=>_0x54c17f['stopPropagation']();this['keystrokes']['set']('arrowright',_0x1b4a69),this['keystrokes']['set']('arrowleft',_0x1b4a69),this['keystrokes']['set']('arrowup',_0x1b4a69),this['keystrokes']['set']('arrowdown',_0x1b4a69);}['focus'](){this['revisionNameInputView']['focus']();}get['revisionName'](){return this['revisionNameInputView']['fieldView']['element']['value']['trim']();}set['revisionName'](_0x1f1c35){this['revisionNameInputView']['fieldView']['element']['value']=_0x1f1c35['trim']();}reset(){this['revisionNameInputView']['fieldView']['element']['value']='',this['revisionNameInputView']['errorText']=null;}_createRevisionNameInput(_0x3348ae){const _0x2c9e3e=new it(this['locale'],gt),_0x4151a2=_0x2c9e3e['fieldView'];_0x4151a2['extendTemplate']({'attributes':{'maxlength':'220'}});let _0x556412=kt(this['locale'],'Name\x20of\x20the\x20revision');return!_0x3348ae&&(_0x556412+='\x20('+kt(this['locale'],'optional')+')'),(_0x2c9e3e['label']=_0x556412,_0x4151a2['on']('input',()=>{this['revisionNameInputValue']=_0x4151a2['element']['value']['trim']();}),_0x2c9e3e);}},Dt=class extends _0x20938f{static get['pluginName'](){return'RevisionHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[At];}['_saveRevisionFormView'];init(){const _0x8650f1=this['editor'],_0xb2ca40=_0x8650f1['plugins']['get']('RevisionTracker');_0x8650f1['ui']['componentFactory']['add']('revisionHistory',_0x3c8443=>{const _0x25ce14=vt(_0x3c8443),_0x3ce06f=_0x25ce14['panelView']['children'],_0x36d851=new st(_0x3c8443),_0x518d2f=new et(_0x3c8443),_0x3fe710=this['_createSaveRevisionButton'](_0x17c303),_0x4ed55c=new et(_0x3c8443),_0x3b0cb2=this['_createOpenRevisionButton'](_0x17c303);return _0x25ce14['bind']('isEnabled')['to'](_0xb2ca40,'isReady',_0xb2ca40,'isEnabled',_0x8650f1,'isReadOnly',(_0x3b3502,_0x344562,_0x23bcfc)=>_0x3b3502&&_0x344562&&!_0x23bcfc),_0x25ce14['buttonView']['set']({'icon':_0x37eac0,'label':kt(_0x3c8443,'Revision\x20history'),'tooltip':!0x0}),_0x3fe710['set']({'withText':!0x0,'role':'menuitem'}),_0x3b0cb2['set']({'withText':!0x0,'role':'menuitem'}),this['listenTo'](_0x3b0cb2,'execute',()=>{_0x25ce14['isOpen']=!0x1,_0x8650f1['editing']['view']['focus']();},{'priority':'low'}),_0x518d2f['children']['add'](_0x3fe710),_0x4ed55c['children']['add'](_0x3b0cb2),_0x36d851['role']='menu',_0x36d851['items']['addMany']([_0x518d2f,_0x4ed55c]),_0x3ce06f['add'](_0x36d851),_0x25ce14;}),_0x8650f1['ui']['componentFactory']['add']('menuBar:revisionHistory',()=>this['_registerMenuComponent']());}_registerMenuComponent(){const _0x1e3e0e=this['editor'],_0x297f34=_0x1e3e0e['locale'],_0x30a78f=_0x1e3e0e['plugins']['get']('RevisionTracker'),_0x229aa4=new at(_0x297f34),_0x36fcea=new rt(_0x297f34);_0x229aa4['bind']('isEnabled')['to'](_0x30a78f,'isReady',_0x30a78f,'isEnabled',_0x1e3e0e,'isReadOnly',(_0x3ab10b,_0x2b3ea2,_0x23b8dd)=>_0x3ab10b&&_0x2b3ea2&&!_0x23b8dd),_0x229aa4['buttonView']['set']({'icon':_0x37eac0,'label':kt(_0x297f34,'Revision\x20history')});const _0x3492c4=new ot(_0x297f34,_0x229aa4),_0x4688e3=this['_createSaveRevisionButton'](nt);_0x4688e3['delegate']('execute')['to'](_0x229aa4),_0x3492c4['children']['add'](_0x4688e3),_0x36fcea['items']['add'](_0x3492c4);const _0x4e3559=new ot(_0x297f34,_0x229aa4),_0x12c310=this['_createOpenRevisionButton'](nt);return _0x12c310['delegate']('execute')['to'](_0x229aa4),_0x4e3559['children']['add'](_0x12c310),_0x36fcea['items']['add'](_0x4e3559),_0x229aa4['panelView']['children']['add'](_0x36fcea),_0x229aa4;}_createSaveRevisionButton(_0x4e90d4){const _0x4a3c25=this['editor'],_0x896b3=_0x4a3c25['plugins']['get']('RevisionTracker'),_0x1f4086=new _0x4e90d4(_0x4a3c25['locale']);return _0x1f4086['set']({'label':kt(_0x4a3c25['locale'],'Save\x20current\x20revision')}),_0x1f4086['bind']('isEnabled')['to'](_0x896b3,'isReady',_0x896b3,'isEnabled',_0x4a3c25,'isReadOnly',(_0x438554,_0x242a7e,_0x26aef2)=>_0x438554&&_0x242a7e&&!_0x26aef2),this['listenTo'](_0x1f4086,'execute',()=>{this['_showDialog']();}),_0x1f4086;}_createOpenRevisionButton(_0x4ef571){const _0x287ed9=this['editor'],_0x245599=_0x287ed9['plugins']['get']('RevisionTracker'),_0x35d8d7=new _0x4ef571(_0x287ed9['locale']);return _0x35d8d7['set']({'label':kt(_0x287ed9['locale'],'Open\x20revision\x20history')}),_0x35d8d7['bind']('isEnabled')['to'](_0x245599,'isReady',_0x287ed9,'isReadOnly',(_0x32f6f7,_0x171f13)=>_0x32f6f7&&!_0x171f13),this['listenTo'](_0x35d8d7,'execute',()=>{_0x287ed9['config']['get']('revisionHistory')['showRevisionViewerCallback']();}),_0x35d8d7;}['_showDialog'](){const _0x2a5154=this['editor'],_0x5ed145=_0x2a5154['locale'],_0x388d57=_0x2a5154['plugins']['get']('Dialog'),_0x3ca593=_0x2a5154['plugins']['get']('RevisionTracker');function _0x24bd42(_0x1726d8){_0x2a5154['config']['get']('revisionHistory.requireRevisionName')&&''===_0x1726d8['revisionName']?_0x1726d8['revisionNameInputView']['errorText']=kt(_0x5ed145,'The\x20revision\x20name\x20cannot\x20be\x20empty.'):(_0x2a5154['plugins']['get'](At)['saveRevision']({'name':_0x1726d8['revisionName']}),_0x388d57['hide']());}this['_saveRevisionFormView']||(this['_createSaveRevisionFormView'](),this['_saveRevisionFormView']['on']('submit',()=>_0x24bd42(this['_saveRevisionFormView']))),this['_saveRevisionFormView']['reset'](),_0x388d57['show']({'id':'revisionSave','title':kt(_0x5ed145,'Save\x20current\x20revision'),'isModal':!0x0,'content':this['_saveRevisionFormView'],'actionButtons':[{'label':kt(_0x2a5154['locale'],'Cancel'),'withText':!0x0,'onExecute':()=>_0x388d57['hide']()},{'label':kt(_0x2a5154['locale'],'Accept'),'class':'ck-button-action','withText':!0x0,'onCreate'(_0x1b4251){_0x1b4251['bind']('isEnabled')['to'](_0x3ca593,'isReady',_0x3ca593,'isEnabled',_0x2a5154,'isReadOnly',(_0x58022e,_0x4909f3,_0x329f30)=>_0x58022e&&_0x4909f3&&!_0x329f30);},'onExecute':()=>_0x24bd42(this['_saveRevisionFormView'])}]});}_createSaveRevisionFormView(){const _0x4dafbf=this['editor'],_0x5b1f67=_0x4dafbf['locale'];this['_saveRevisionFormView']=new xt(_0x5b1f67,_0x4dafbf['config']['get']('revisionHistory.requireRevisionName')),this['_saveRevisionFormView']['render']();}},Vt=class extends dt{['changeId'];['_model'];constructor(_0x1bd179,_0x69d60e,_0x302796=!0x1){super(_0x1bd179),this['_model']=_0x69d60e,this['changeId']=_0x69d60e['id'];const _0x316111=this['bindTemplate'],_0x5075fb=_0x302796&&!!_0x69d60e['data']['aiSource'],_0x24752f=_0x5075fb?this['_createAiIconView'](_0x1bd179):null;this['set']('type',_0x69d60e['type']),this['setTemplate']({'tag':'div','attributes':{'class':['ck-annotation','ck-revision-change',_0x316111['to']('type',_0x47f623=>'ck-revision-change__'+_0x47f623),..._0x5075fb?['ck-revision-change_ai']:[]],'tabindex':-0x1},'children':[{'tag':'span','children':_0x5075fb?[this['_createAiDescriptionView'](_0x1bd179,_0x69d60e),_0x24752f]:this['_getDescriptionChildren'](_0x1bd179,_0x69d60e)}]});}_getDescriptionChildren(_0x16c7ec,_0x577e68){let _0x530cca='Removed\x20by';return _0x577e68['data']['isSuggestion']?_0x530cca='Suggested\x20by':'add'==_0x577e68['type']&&(_0x530cca='Added\x20by'),[this['_createLabel'](kt(_0x16c7ec,_0x530cca)),{'text':'\x20'+_0x577e68['author']['name']}];}_createAiDescriptionView(_0x492e7b,_0x253c55){let _0x5260ca='AI_SOURCE_REMOVED_BY';_0x253c55['data']['isSuggestion']?_0x5260ca='AI_SOURCE_SUGGESTED_BY':'add'==_0x253c55['type']&&(_0x5260ca='AI_SOURCE_ADDED_BY');const _0x1a75c1=new dt(_0x492e7b);return _0x1a75c1['setTemplate']({'tag':'span','attributes':{'class':['ck-revision-change__label']}}),_0x1a75c1['render'](),_0x1a75c1['element']['innerHTML']=_0x17b295(kt(_0x492e7b,_0x5260ca,['<span\x20class=\x22ck-revision-change__author\x22></span>','<span\x20class=\x22ck-revision-change__ai-note\x22>'+kt(_0x492e7b,'AI_SOURCE_AI')+'</span>'])),_0x1a75c1['element']['querySelector']('.ck-revision-change__author')['textContent']=_0x253c55['author']['name'],_0x1a75c1;}_createLabel(_0x201217){return{'tag':'span','attributes':{'class':['ck-revision-change__label']},'children':[{'text':_0x201217}]};}_createAiIconView(_0x25d51c){const _0x66b358=new _0x1af692();return _0x66b358['content']=_0x2b2e7d,_0x66b358['extendTemplate']({'attributes':{'class':['ck-revision-change__ai-icon'],'data-cke-tooltip-text':kt(_0x25d51c,'AI_SOURCE_CHANGE_TOOLTIP'),'data-cke-tooltip-position':'s'}}),_0x66b358;}['focus'](){this['element']['focus']();}};const Tt=/* #__PURE__ -- @preserve */
26
+ _0x5a3a2d();var Mt=class extends Tt{['id'];author;type;data;rootName;constructor(_0x1b847d){super(),this['id']=_0x1b847d['id']||_0x37fc40(),this['author']=_0x1b847d['author'],this['type']=_0x1b847d['type'],this['data']=_0x1b847d['data']||{},this['rootName']=_0x1b847d['rootName'],this['set']('createdAt',_0x1b847d['createdAt']);}toJSON(){return{'id':this['id'],'authorId':this['author']['id'],'type':this['type'],'data':this['data'],'createdAt':this['createdAt']};}},Ht=class{['newRevisionId'];['oldRevisionId'];['changes'];constructor(_0x257f21,_0x2cc5f1){this['newRevisionId']=_0x257f21,this['oldRevisionId']=_0x2cc5f1,this['changes']=new _0x374b4a();}_setChanges(_0xd9f150){for(const _0x5dc1bc of _0xd9f150)this['changes']['add'](_0x5dc1bc);}},Pt=class extends _0x20938f{repository;adapter=null;_getVisibleCommentThreadIds=null;_utils;_activeViewTarget;['_changeView'];['_changeIdToChange'];['_balloon'];_showCommentHighlights;static get['pluginName'](){return'RevisionViewer';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_0x410d48,_0x4aa69b,bt,Rt];}constructor(_0x47c2ad){super(_0x47c2ad),this['repository']=this['editor']['plugins']['get']('RevisionsRepository'),this['_utils']=this['editor']['plugins']['get']('RevisionHistoryUtils'),this['set']('activeChange',null),this['set']('activeView',null),this['_activeViewTarget']=null,this['set']('diff',null),this['set']('isReady',!0x1),this['set']('isEnabled',!0x0),this['on']('change:isEnabled',(_0x3a0620,_0x2c64a1,_0xa8c8db)=>{this['activeChange']=null,this['activeView']=null,this['editor']['editing']['view']['change'](_0x243eba=>{for(const _0x5dc502 of this['editor']['editing']['view']['document']['roots'])_0xa8c8db?_0x243eba['removeClass']('ck-editor__editable__overlay',_0x5dc502):_0x243eba['addClass']('ck-editor__editable__overlay',_0x5dc502);});}),this['bind']('isNavigationMode')['to'](this,'activeChange',_0x451a73=>null!==_0x451a73),this['bind']('currentChangeNumber')['to'](this,'isReady',this,'diff',this,'activeChange',(_0x55a5ed,_0x3814e6,_0xe1764e)=>_0x55a5ed&&_0xe1764e?_0x3814e6['changes']['getIndex'](_0xe1764e):0x0),this['bind']('numberOfChanges')['to'](this,'isReady',this,'diff',(_0x26c0dc,_0x2dd738)=>_0x26c0dc?_0x2dd738['changes']['length']:0x0),this['_changeView']=null,this['_changeIdToChange']=new Map(),this['_balloon']=this['editor']['plugins']['get'](_0x4aa69b),this['_showCommentHighlights']=this['editor']['config']['get']('revisionHistory.showCommentHighlights');}init(){const _0x1be060=this['editor'],_0xcdeda8=new $t(_0x1be060,{'direction':'backward'}),_0x137733=new $t(_0x1be060,{'direction':'forward'});_0x1be060['commands']['add']('showPreviousChange',_0xcdeda8),_0x1be060['commands']['add']('showNextChange',_0x137733),_0x1be060['commands']['add']('restoreRevision',new Ft(_0x1be060)),this['on']('change:numberOfChanges',()=>{_0xcdeda8['refresh'](),_0x137733['refresh']();}),this['_setConversion'](),this['_initInteractions'](),_0x1be060['enableReadOnlyMode']('revision-viewer'),_0x1be060['plugins']['has']('WidgetToolbarRepository')&&_0x1be060['plugins']['get']('WidgetToolbarRepository')['forceDisabled']('revision-viewer');}async getRevisionDocumentData(_0x1e65ce){return await this['_utils']['loadRevisionData'](_0x1e65ce,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x1e65ce);}async getRevisionRootsAttributes(_0x2c690a){return await this['_utils']['loadRevisionData'](_0x2c690a,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x2c690a);}async['compare'](_0x4bae93,_0x461db8,_0x15dc69=!0x1){if(!this['isEnabled'])return;const _0x2db491=this['diff'],_0x30d1a1=this['repository'],_0x4be0c4='string'==typeof _0x4bae93?_0x30d1a1['getRevision'](_0x4bae93):_0x4bae93,_0x382a9d='string'==typeof _0x461db8?_0x30d1a1['getRevision'](_0x461db8):_0x461db8,_0x507137=_0x4be0c4['id'],_0x30f7a9=_0x382a9d?_0x382a9d['id']:null;if(!_0x15dc69&&this['diff']&&this['diff']['newRevisionId']===_0x507137&&this['diff']['oldRevisionId']===_0x30f7a9)return Promise['resolve']();this['isReady']=!0x1,this['activeView']=null,this['activeChange']=null,this['diff']=new Ht(_0x507137,_0x30f7a9);const _0x2547ce=this['_getRevisionsRange'](_0x4be0c4,_0x382a9d,!0x0)['map'](_0x45a84d=>this['_utils']['loadRevisionData'](_0x45a84d,this['adapter']));return _0x2547ce['push'](new Promise(_0x4556b1=>{setTimeout(_0x4556b1,0x14);})),Promise['all'](_0x2547ce)['then'](()=>{if(!this['isEnabled'])return;this['_cleanUp']();const _0x694a76=this['_getDiff'](_0x507137,_0x30f7a9);this['_cleanUpCommentMarkers'](_0x694a76);for(const _0x4126d4 of _0x694a76['changes'])this['_changeIdToChange']['set'](_0x4126d4['id'],_0x4126d4);this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x2cb5cc=>{for(const _0x35e9e1 of this['editor']['model']['document']['getRootNames']())_0x2cb5cc['detachRoot'](_0x35e9e1);for(const _0x979364 of Object['keys'](_0x694a76['model'])){const _0x2b09fd=_0x694a76['model'][_0x979364]['name'],_0x2c61b2=_0x2cb5cc['addRoot'](_0x979364,_0x2b09fd);for(const _0x4fd357 of Object['keys'](_0x694a76['attributes'][_0x979364]))_0x2cb5cc['setAttribute'](_0x4fd357,_0x694a76['attributes'][_0x979364][_0x4fd357],_0x2c61b2);_0x2cb5cc['insert'](_0x694a76['model'][_0x979364],_0x2c61b2,0x0);}}),this['diff']['_setChanges'](this['_sortAndFilterDiffChanges'](_0x694a76['changes'])),this['isReady']=!0x0;})['catch'](_0x93ca92=>{console['error'](_0x93ca92),this['_cleanUp'](),_0x2db491&&(this['diff']=_0x2db491),this['isReady']=!0x0;});}addRevisionData(_0x2e371f,_0x13abd1){const _0x5d395e=this['repository']['createRevision'](_0x2e371f);return _0x5d395e['on']('_update',(_0x4fab35,_0x5d9ded,_0x465c18)=>_0x13abd1(_0x5d9ded,_0x465c18,_0x5d395e)),this['repository']['addRevision'](_0x5d395e),_0x5d395e;}['_cleanUp'](){this['activeChange']=null,this['_cleanMarkers'](),this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=null,this['_changeIdToChange']['clear'](),this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x5d542f=>{for(const _0x342abd of this['editor']['model']['document']['getRootNames']())_0x5d542f['detachRoot'](_0x342abd);});}_cleanUpCommentMarkers(_0xcf648a){if(!this['_showCommentHighlights']||!this['_getVisibleCommentThreadIds'])return;const _0xd28727=this['_getVisibleCommentThreadIds']();for(const _0x184d7c of Object['values'](_0xcf648a['model']))for(const _0x51fd65 of Array['from'](_0x184d7c['markers']['keys']()))_0x51fd65['startsWith']('revision-comment:')&&!_0xd28727['has'](Ut(_0x51fd65))&&_0x184d7c['markers']['delete'](_0x51fd65);}_sortAndFilterDiffChanges(_0x43841b){const _0x4a7711=[],_0x3e12d2=new Map();for(const _0x2738f3 of this['editor']['model']['document']['getRootNames']()){const _0x2c2fcd=this['editor']['editing']['view']['getDomRoot'](_0x2738f3);if(!_0x2c2fcd)continue;const _0x569225=_0x2c2fcd['getClientRects']()['item'](0x0);_0x569225&&(_0x4a7711['push'](_0x2738f3),_0x3e12d2['set'](_0x2738f3,_0x569225));}return _0x4a7711['sort']((_0x53ff85,_0x581573)=>{const _0x30f534=_0x3e12d2['get'](_0x53ff85),_0x2b3747=_0x3e12d2['get'](_0x581573);return _0x30f534['y']-_0x2b3747['y']||_0x30f534['x']-_0x2b3747['x'];}),(_0x43841b=_0x43841b['filter'](_0x2006db=>_0x4a7711['includes'](_0x2006db['rootName'])))['sort']((_0x485f4f,_0x542140)=>_0x4a7711['indexOf'](_0x485f4f['rootName'])-_0x4a7711['indexOf'](_0x542140['rootName'])),_0x43841b;}['_makeTape'](_0x1a35bd,_0x230072={}){const _0x55294a=Array['from'](_0x1a35bd['markers'])['filter'](([_0x3e0c50,_0x2387e4])=>_0x3e0c50['startsWith']('revision:')&&!_0x2387e4['isCollapsed']),_0x4f9c2f=Array['from'](this['editor']['model']['createRangeIn'](_0x1a35bd)['getWalker']({'singleCharacters':!0x0}));if(0x0!=_0x55294a['length'])for(const _0x5c44b0 of _0x4f9c2f){const [_0x1a0c8b,_0x354eb7]=_0x55294a[0x0],[,_0x37ad7b,_0x22942f]=_0x1a0c8b['split'](':'),_0x5d92c0=_0x230072[_0x1a0c8b]||null;if(_0x354eb7['end']['isEqual'](_0x5c44b0['nextPosition'])&&_0x55294a['shift'](),(_0x5c44b0['previousPosition']['isEqual'](_0x354eb7['start'])||_0x5c44b0['previousPosition']['isAfter'](_0x354eb7['start']))&&('insertion'==_0x37ad7b?_0x5c44b0['isAdded']={'userId':_0x22942f,'aiSource':_0x5d92c0}:'deletion'==_0x37ad7b&&(_0x5c44b0['isRemoved']={'userId':_0x22942f,'aiSource':_0x5d92c0})),0x0==_0x55294a['length'])break;}return _0x4f9c2f;}_refreshStartEndIndex(_0x4ef047){const _0x227824=new Map();for(let _0x1172f5=0x0;_0x1172f5<_0x4ef047['length'];_0x1172f5++)'text'===_0x4ef047[_0x1172f5]['type']?(_0x4ef047[_0x1172f5]['item']['startIndex']=_0x1172f5,_0x4ef047[_0x1172f5]['item']['endIndex']=_0x1172f5):('elementStart'===_0x4ef047[_0x1172f5]['type']?_0x4ef047[_0x1172f5]['item']['startIndex']=_0x1172f5:'elementEnd'===_0x4ef047[_0x1172f5]['type']&&(_0x4ef047[_0x1172f5]['item']['endIndex']=_0x1172f5),_0x227824['set'](_0x4ef047[_0x1172f5]['id'],_0x1172f5));for(const _0x56fadb of _0x227824['values']())'elementStart'===_0x4ef047[_0x56fadb]['type']?_0x4ef047[_0x56fadb]['item']['endIndex']=_0x227824['get'](_0x4ef047[_0x56fadb]['pairId']):'elementEnd'===_0x4ef047[_0x56fadb]['type']&&(_0x4ef047[_0x56fadb]['item']['startIndex']=_0x227824['get'](_0x4ef047[_0x56fadb]['pairId']));}['_processTape'](_0xc9eccc){for(let _0x3485d2=0x0;_0x3485d2<_0xc9eccc['length'];_0x3485d2++){if('elementStart'===_0xc9eccc[_0x3485d2]['type'])_0xc9eccc[_0x3485d2]['item']['startIndex']=_0x3485d2;else{if('elementEnd'===_0xc9eccc[_0x3485d2]['type']){_0xc9eccc[_0x3485d2]['item']['endIndex']=_0x3485d2;const _0x2d1714=_0xc9eccc[_0x3485d2]['item']['startIndex'];_0xc9eccc[_0x2d1714]['pairId']=_0xc9eccc[_0x3485d2]['id'],_0xc9eccc[_0x3485d2]['pairId']=_0xc9eccc[_0x2d1714]['id'];}else _0xc9eccc[_0x3485d2]['item']['startIndex']=_0x3485d2,_0xc9eccc[_0x3485d2]['item']['endIndex']=_0x3485d2,_0xc9eccc[_0x3485d2]['pairId']=null;}_0xc9eccc[_0x3485d2]['markersStart']||(_0xc9eccc[_0x3485d2]['markersStart']=[],_0xc9eccc[_0x3485d2]['markersEnd']=[]);}}_markInsertions(_0x319825,_0x2cfa4e){const _0x12f77c=_0x319825['filter'](_0x464973=>!_0x464973['isAdded']);for(let _0x4b5f1c=0x0;_0x4b5f1c<_0x2cfa4e['length'];_0x4b5f1c++)_0x2cfa4e[_0x4b5f1c]['isAdded']&&(_0x12f77c[_0x4b5f1c]['isAdded']=_0x2cfa4e[_0x4b5f1c]['isAdded']);}_getDiff(_0x4d4052,_0x2fa46f=null){const _0x11b80f=this['repository']['getRevision'](_0x4d4052),_0x42fcec=_0x2fa46f?this['repository']['getRevision'](_0x2fa46f):null,_0x467387=this['_getRevisionsRange'](_0x11b80f,_0x42fcec),_0x164c84=_0x467387[_0x467387['length']-0x1],_0x3d86cf=new Map(),_0x176bb0={'model':{},'attributes':{},'changes':[]},_0x3ce5ee=new Set(),_0x5786f6=new Map();for(let _0x2a3a20=_0x467387['length']-0x1;_0x2a3a20>=0x0;_0x2a3a20--){const _0x590ebf=_0x467387[_0x2a3a20];for(const _0x489fbf of Object['keys'](_0x590ebf['diffData']))if(_0x590ebf['diffData'][_0x489fbf]['attachChange']){const _0x571ceb=_0x590ebf['diffData'][_0x489fbf]['attachChange'];_0x571ceb['isAttached']?(_0x3ce5ee['add'](_0x489fbf),_0x5786f6['has'](_0x489fbf)&&_0x5786f6['get'](_0x489fbf)['userId']==_0x571ceb['userId']?_0x5786f6['delete'](_0x489fbf):_0x5786f6['set'](_0x489fbf,_0x571ceb)):_0x5786f6['has'](_0x489fbf)?(_0x3ce5ee['delete'](_0x489fbf),_0x5786f6['delete'](_0x489fbf)):(_0x3ce5ee['add'](_0x489fbf),_0x5786f6['set'](_0x489fbf,_0x571ceb));}else _0x3ce5ee['add'](_0x489fbf);}for(const _0x39d862 of _0x3ce5ee){const _0x44999f=_0x5786f6['has'](_0x39d862)&&!_0x5786f6['get'](_0x39d862)['isAttached'];let _0x5383fb=_0x44999f?_0x467387['length']-0x1:0x0;const _0x3f92db=_0x44999f?-0x1:0x1;for(;_0x467387[_0x5383fb];){const _0x456bca=_0x467387[_0x5383fb];if(_0x456bca['diffData'][_0x39d862]){const _0x3453c1=_0x44999f?_0x456bca['diffData'][_0x39d862]['attributesBefore']:_0x456bca['diffData'][_0x39d862]['attributesAfter'];_0x176bb0['attributes'][_0x39d862]=_0x3453c1?_0x1ebade(_0x3453c1):{};break;}_0x5383fb+=_0x3f92db;}}for(const _0x2535f2 of _0x467387){_0x2535f2['model']={};for(const _0x30fd40 of _0x2535f2['authors'])_0x3d86cf['set'](_0x30fd40['id'],_0x30fd40);for(const _0x3c3f39 of _0x3ce5ee){const _0x754d6b=_0x2535f2['diffData'][_0x3c3f39]?_0x2535f2['diffData'][_0x3c3f39]['insertions']:'[]',_0x10dd3c=_0x2535f2['diffData'][_0x3c3f39]?_0x2535f2['diffData'][_0x3c3f39]['deletions']:'[]',_0x467c17=_0x2535f2['diffData'][_0x3c3f39]?.['rootElementName']||'$root';_0x2535f2['model'][_0x3c3f39]={'insertions':this['_utils']['_makeModelFromViewString'](_0x754d6b,_0x467c17),'deletions':this['_utils']['_makeModelFromViewString'](_0x10dd3c,_0x467c17)};}}for(const _0x53ad40 of _0x3ce5ee){let _0x59419f=null,_0x5679cd=0x0;const _0x25568e=_0x467387['map'](_0x19fd75=>_0x19fd75['diffData'][_0x53ad40]?.['rootElementName'])['find'](_0x3e9ac6=>void 0x0!==_0x3e9ac6)||'$root',_0x5bb2b7=new Map(Array['from'](_0x11b80f['model'][_0x53ad40]['insertions']['markers'])['filter'](([_0x41e33a])=>!_0x41e33a['startsWith']('revision:')));let _0x55247d=0x0;for(const _0x37e5a1 of _0x467387){const _0x53b97a=_0x37e5a1['diffData'][_0x53ad40]?.['aiSources']||{},_0x4e77d3=this['_makeTape'](_0x37e5a1['model'][_0x53ad40]['insertions'],_0x53b97a);_0x37e5a1==_0x11b80f?(_0x59419f=_0x4e77d3,_0x5679cd=_0x59419f['length'],_0x59419f['forEach'](_0x35d1b6=>{_0x35d1b6['id']=_0x55247d++;}),this['_processTape'](_0x59419f)):this['_markInsertions'](_0x59419f,_0x4e77d3);const _0x1795a4=_0x59419f['filter'](_0x124c64=>!_0x124c64['isAdded'])['map'](_0x4603f0=>_0x4603f0['id']);let _0x54232a=0x0;const _0xb5c3a7=this['_makeTape'](_0x37e5a1['model'][_0x53ad40]['deletions'],_0x53b97a);_0xb5c3a7['forEach'](_0x9191a4=>{_0x9191a4['isRemoved']?_0x9191a4['id']=_0x5679cd++:_0x9191a4['id']=_0x1795a4[_0x54232a++];}),this['_processTape'](_0xb5c3a7),this['_setDistance'](_0x59419f,'isAdded'),this['_setDistance'](_0xb5c3a7,'isRemoved'),_0x37e5a1==_0x11b80f&&this['_markMarkers'](_0x59419f,_0x5bb2b7),_0x59419f=this['_joinTapes'](_0x59419f,_0xb5c3a7),this['_refreshStartEndIndex'](_0x59419f),this['_setDistance'](_0x59419f,'isRemoved');}_0x59419f=_0x59419f['filter'](_0x1c5eb4=>!(_0x1c5eb4['isAdded']&&_0x1c5eb4['isRemoved']));const _0x2deea7=new Map(_0x164c84['model'][_0x53ad40]['deletions']['markers']),_0x298036=new Set(_0x5bb2b7['keys']());for(const _0x549ff5 of _0x2deea7['keys']())_0x298036['delete'](_0x549ff5);const _0x1236aa=Object['assign']({},..._0x467387['map'](_0x4a9049=>_0x4a9049['diffData'][_0x53ad40]?.['aiSources']));this['_markSuggestions'](_0x59419f,_0x298036,_0x1236aa),this['_fixObsoleteTags'](_0x59419f),_0x59419f=this['_removeMissingPairs'](_0x59419f),_0x59419f=this['_markMismatchedRemovedTags'](_0x59419f),_0x59419f=this['_removeUnsupportedChanges'](_0x59419f);const {root:_0x4de46a,changes:_0x16f39d}=this['_makeModelFromTape'](_0x59419f,_0x3d86cf,_0x53ad40,_0x25568e);_0x176bb0['model'][_0x53ad40]=_0x4de46a;const _0x2662fc=_0x5786f6['get'](_0x53ad40);if(_0x2662fc){const _0x118774=_0x3d86cf['get'](_0x2662fc['userId']),_0xcd21a6=new Mt({'author':_0x118774,'type':_0x2662fc['isAttached']?'add':'remove','data':{'isOnRoot':!0x0},'createdAt':new Date(),'rootName':_0x53ad40});_0x16f39d['unshift'](_0xcd21a6),_0x176bb0['attributes'][_0x53ad40]['revisionHistoryAttachChange']=_0xcd21a6['id'];}_0x176bb0['changes']=_0x176bb0['changes']['concat'](_0x16f39d);}return _0x176bb0;}['_markMarkers'](_0x26b89a,_0x223414){for(let _0x2261bf=0x0;_0x2261bf<_0x26b89a['length'];_0x2261bf++)for(const [_0x2b35c5,_0x38fdff]of _0x223414)!_0x38fdff['isCollapsed']&&_0x38fdff['start']['isEqual'](_0x26b89a[_0x2261bf]['previousPosition'])&&_0x26b89a[_0x2261bf]['markersStart']['push'](_0x2b35c5),_0x38fdff['end']['isEqual'](_0x26b89a[_0x2261bf]['nextPosition'])&&_0x26b89a[_0x2261bf]['markersEnd']['push'](_0x2b35c5);}['_joinTapes'](_0xfa9a1,_0x2221c3){let _0x3f948a=[],_0x2362ed=0x0,_0xe988a4=0x0;for(;_0x2362ed<_0xfa9a1['length']||_0xe988a4<_0x2221c3['length'];){const _0x2f9d92=_0xfa9a1[_0x2362ed]||{},_0x322186=_0x2221c3[_0xe988a4]||{};if(_0x2f9d92['id']==_0x322186['id'])_0x2362ed++,_0xe988a4++,_0x3f948a['push'](_0x2f9d92);else{if(_0x322186['isRemoved']&&_0x2f9d92['isAdded']){const {commonTape:_0x398710,iEnd:_0x8ae0a8,jEnd:_0xbe19a4}=this['_threeWayMerge'](_0xfa9a1,_0x2362ed,_0x2221c3,_0xe988a4);_0x3f948a=_0x3f948a['concat'](_0x398710),_0x2362ed=_0x8ae0a8,_0xe988a4=_0xbe19a4;}else _0x322186['isRemoved']?(_0xe988a4++,_0x3f948a['push'](_0x322186)):(_0x2362ed++,_0x3f948a['push'](_0x2f9d92));}}return _0x3f948a;}_markSuggestions(_0x4168aa,_0xbf9893,_0x4e7810){const _0x13e628=[];for(let _0x375b60=0x0;_0x375b60<_0x4168aa['length'];_0x375b60++){for(let _0x3be4f7=0x0;_0x3be4f7<_0x4168aa[_0x375b60]['markersStart']['length'];_0x3be4f7++){const _0x317fad=_0x4168aa[_0x375b60]['markersStart'][_0x3be4f7];if(!_0xbf9893['has'](_0x317fad))continue;const {group:_0x434dbd,type:_0x577af1,authorId:_0x555f1a}=_0x212d8d(_0x317fad);if('revision-suggestion'!=_0x434dbd||'insertion'!=_0x577af1&&'deletion'!=_0x577af1)continue;const _0x439b62=_0x4e7810['suggestion:'+_0x317fad['slice'](0x14)]||null;_0x13e628['unshift']({'type':_0x577af1,'name':_0x317fad,'userId':_0x555f1a,'aiSource':_0x439b62}),_0x4168aa[_0x375b60]['markersStart']['splice'](_0x3be4f7,0x1),_0x3be4f7--;}_0x16e0ac(_0x4168aa[_0x375b60]);for(let _0x922f26=0x0;_0x922f26<_0x4168aa[_0x375b60]['markersEnd']['length'];_0x922f26++){const _0x3570ff=_0x4168aa[_0x375b60]['markersEnd'][_0x922f26];if(!_0xbf9893['has'](_0x3570ff))continue;const {group:_0x30de37,type:_0x383ecd}=_0x212d8d(_0x3570ff);if('revision-suggestion'!=_0x30de37||'insertion'!=_0x383ecd&&'deletion'!=_0x383ecd)continue;_0x4168aa[_0x375b60]['markersEnd']['splice'](_0x922f26,0x1),_0x922f26--;const _0x1a5ab7=_0x13e628['findIndex'](_0x3a44b0=>_0x3a44b0['name']==_0x3570ff);_0x1a5ab7>-0x1&&_0x13e628['splice'](_0x1a5ab7,0x1);}}function _0x212d8d(_0x3c8024){const _0x7be001=_0x3c8024['split'](':');return{'group':_0x7be001[0x0],'type':_0x7be001[0x1],'subType':_0x7be001['length']>=0x5?_0x7be001[0x2]:null,'id':_0x7be001['length']<0x5?_0x7be001[0x2]:_0x7be001[0x3],'authorId':_0x7be001['length']<0x5?_0x7be001[0x3]:_0x7be001[0x4],'markerCount':0x6==_0x7be001['length']?_0x7be001[0x5]:null};}function _0x16e0ac(_0x1389b7){for(let _0x2b600f=0x0;_0x2b600f<_0x13e628['length'];_0x2b600f++){if(_0x1389b7['isAdded']&&'insertion'==_0x13e628[_0x2b600f]['type']&&_0x1389b7['isAdded']['userId']==_0x13e628[_0x2b600f]['userId'])return _0x1389b7['isAddSuggestion']={..._0x13e628[_0x2b600f],'aiSource':_0x1389b7['isAdded']['aiSource']||_0x13e628[_0x2b600f]['aiSource']},void delete _0x1389b7['isAdded'];if(!_0x1389b7['isAdded']&&!_0x1389b7['isRemoved']&&'deletion'==_0x13e628[_0x2b600f]['type'])return void(_0x1389b7['isRemoveSuggestion']=_0x13e628[_0x2b600f]);}}}_setDistance(_0x530ab9,_0x599aba){let _0x3476fc=0x0,_0x9582aa=!0x1;const _0x50b165=new Map();for(const _0x132b6f of _0x530ab9)_0x132b6f[_0x599aba]?_0x9582aa&&(_0x3476fc++,_0x9582aa=!0x1):(_0x3476fc++,_0x9582aa=!0x0),_0x50b165['set'](_0x132b6f['id'],_0x3476fc);for(let _0x2e5e72=0x0;_0x2e5e72<_0x530ab9['length'];_0x2e5e72++){if('isRemoved'==_0x599aba&&_0x530ab9[_0x2e5e72]['isAdded']||'isAdded'==_0x599aba&&_0x530ab9[_0x2e5e72]['isRemoved'])continue;if('text'==_0x530ab9[_0x2e5e72]['type']){_0x530ab9[_0x2e5e72]['distance']=0x0;continue;}const _0x1ce8a8=_0x50b165['get'](_0x530ab9[_0x2e5e72]['pairId']),_0x17e58c=_0x50b165['get'](_0x530ab9[_0x2e5e72]['id']);_0x530ab9[_0x2e5e72]['distance']=_0x1ce8a8-_0x17e58c;}}_getRevisionsRange(_0x161f07,_0x1d6cd3,_0x39ef60=!0x1){const _0x34c453=[];let _0x482887=this['repository']['getIndex'](_0x161f07),_0x5eaf7e=this['repository']['getIndex'](_0x1d6cd3);for(-0x1==_0x5eaf7e&&(_0x5eaf7e=this['repository']['_revisions']['length'],_0x39ef60=!0x1);_0x482887<_0x5eaf7e;)_0x34c453['push'](this['repository']['getRevision'](_0x482887)),_0x482887++;return _0x39ef60&&_0x34c453['push'](this['repository']['getRevision'](_0x482887)),_0x34c453;}_threeWayMerge(_0x40ea91,_0x4bec68,_0x32f2b2,_0x203a92){const _0x417a24=this['editor']['model']['schema'];let _0x46f666=_0x4bec68;for(;_0x40ea91[_0x46f666]&&_0x40ea91[_0x46f666]['isAdded'];)_0x46f666++;let _0x24c57d=_0x203a92;for(;_0x32f2b2[_0x24c57d]&&_0x32f2b2[_0x24c57d]['isRemoved'];)_0x24c57d++;_0x50c7e5(_0x40ea91,_0x4bec68,_0x46f666),_0x50c7e5(_0x32f2b2,_0x203a92,_0x24c57d);const _0x3b1b82=_0x32f2b2['slice'](_0x203a92,_0x24c57d)['concat'](_0x40ea91['slice'](_0x4bec68,_0x46f666));return _0x3b1b82['sort']((_0x5b87b2,_0x49a551)=>_0x5b87b2['side']!=_0x49a551['side']?_0x5b87b2['side']-_0x49a551['side']:_0x5b87b2['level']!=_0x49a551['level']?_0x5b87b2['level']-_0x49a551['level']:_0x5b87b2['distance']!=_0x49a551['distance']?_0x49a551['distance']-_0x5b87b2['distance']:!!_0x5b87b2['isAdded']!=!!_0x49a551['isAdded']?-0x1==_0x5b87b2['side']||0x0==_0x5b87b2['side']?_0x5b87b2['isAdded']?-0x1:0x1:_0x5b87b2['isAdded']?0x1:-0x1:_0x5b87b2['index']-_0x49a551['index']),{'commonTape':_0x3b1b82,'iEnd':_0x46f666,'jEnd':_0x24c57d};function _0x50c7e5(_0x4b28eb,_0x289f81,_0x351112){let _0x267de6=-0x1,_0x59009f=Number['POSITIVE_INFINITY'],_0x5d5d12=!0x0;for(let _0x2e9a30=_0x289f81;_0x2e9a30<_0x351112;_0x2e9a30++)if(_0x417a24['isInline'](_0x4b28eb[_0x2e9a30]['item'])||(_0x5d5d12=!0x1),_0x4b28eb[_0x2e9a30]['item']['startIndex']<_0x289f81&&(_0x267de6=_0x2e9a30),_0x4b28eb[_0x2e9a30]['item']['endIndex']>=_0x351112){_0x59009f=_0x2e9a30;break;}_0x5d5d12&&(_0x267de6=_0x351112-0x1);for(let _0xb11850=_0x289f81;_0xb11850<_0x351112;_0xb11850++)_0x4b28eb[_0xb11850]['side']=_0xb11850<=_0x267de6?-0x1:_0xb11850<_0x59009f?0x0:0x1,_0x4b28eb[_0xb11850]['index']=_0xb11850;let _0x1c8ba3=0x0;for(let _0xffe27c=_0x289f81;_0xffe27c<=_0x267de6;_0xffe27c++)0x0==_0x4b28eb[_0xffe27c]['distance']?_0x4b28eb[_0xffe27c]['level']=_0x1c8ba3:(_0x1c8ba3++,_0x4b28eb[_0xffe27c]['level']=_0x1c8ba3,_0x1c8ba3++);for(let _0xd5bdcd=_0x289f81;_0xd5bdcd<_0x351112;_0xd5bdcd++)0x0==_0x4b28eb[_0xd5bdcd]['side']&&(_0x4b28eb[_0xd5bdcd]['level']=_0x1c8ba3);_0x1c8ba3=0x0;for(let _0x28b23a=_0x351112-0x1;_0x28b23a>=_0x59009f;_0x28b23a--)0x0==_0x4b28eb[_0x28b23a]['distance']?_0x4b28eb[_0x28b23a]['level']=_0x1c8ba3:(_0x1c8ba3--,_0x4b28eb[_0x28b23a]['level']=_0x1c8ba3,_0x1c8ba3--);}}_fixObsoleteTags(_0x4956e1){const _0x2fdf71=new Map(),_0xb21a23=this['editor']['model']['schema'];for(let _0x182f02=0x1;_0x182f02<_0x4956e1['length'];_0x182f02++){let _0x96507c,_0x3e3bee,_0x5d644c;const _0x134923=_0x4956e1[_0x182f02],_0x51a28d=_0x4956e1[_0x182f02-0x1];if('text'==_0x134923['type'])continue;if(_0x134923['type']!=_0x51a28d['type'])continue;if(!_0xb21a23['isBlock'](_0x51a28d['item'])||_0xb21a23['isLimit'](_0x51a28d['item']))continue;if(!_0xb21a23['isBlock'](_0x134923['item'])||_0xb21a23['isLimit'](_0x134923['item']))continue;if((_0x4956e1[_0x182f02]['isAdded']||_0x4956e1[_0x182f02]['isAddSuggestion'])&&_0x4956e1[_0x182f02-0x1]['isRemoved'])_0x96507c=_0x4956e1[_0x182f02],_0x3e3bee=_0x4956e1[_0x182f02-0x1],_0x5d644c=_0x182f02-0x1;else{if(!_0x4956e1[_0x182f02]['isRemoved']||!_0x4956e1[_0x182f02-0x1]['isAdded']&&!_0x4956e1[_0x182f02-0x1]['isAddSuggestion'])continue;_0x96507c=_0x4956e1[_0x182f02-0x1],_0x3e3bee=_0x4956e1[_0x182f02],_0x5d644c=_0x182f02;}const _0x571082=_0x96507c['level']==_0x3e3bee['level'],_0x39211d=Math['abs'](_0x96507c['level'])<Math['abs'](_0x3e3bee['level'])&&0x0==_0x3e3bee['distance'];(_0x571082||_0x39211d)&&(_0x2fdf71['set'](_0x3e3bee['id'],_0x96507c['id']),_0x4956e1['splice'](_0x5d644c,0x1),_0x182f02--,_0x96507c['isAdded']=!0x1);}for(let _0x400922=0x0;_0x400922<_0x4956e1['length'];_0x400922++)_0x2fdf71['has'](_0x4956e1[_0x400922]['pairId'])&&(_0x4956e1[_0x400922]['pairId']=_0x2fdf71['get'](_0x4956e1[_0x400922]['pairId']));}['_removeMissingPairs'](_0x11abdf){const _0xda0a11=new Set(_0x11abdf['map'](_0x188d82=>_0x188d82['id']));for(let _0x1af0f8=0x0;_0x1af0f8<_0x11abdf['length'];_0x1af0f8++)_0xda0a11['has'](_0x11abdf[_0x1af0f8]['pairId'])||0x0==_0x11abdf[_0x1af0f8]['distance']||(_0x11abdf[_0x1af0f8]['isIncorrect']=!0x0);return _0x11abdf['filter'](_0x351cd5=>!_0x351cd5['isIncorrect']);}_markMismatchedRemovedTags(_0x51c066){const _0x17480f=new Set();for(let _0x4ccaf1=0x0;_0x4ccaf1<_0x51c066['length'];_0x4ccaf1++){if(_0x17480f['has'](_0x51c066[_0x4ccaf1]['id'])&&_0x51c066[_0x4ccaf1]['isRemoved']&&(_0x51c066[_0x4ccaf1]['isIncorrect']=!0x0),_0x51c066[_0x4ccaf1]['isIncorrect'])continue;if(0x0==_0x51c066[_0x4ccaf1]['distance'])continue;if('elementStart'!=_0x51c066[_0x4ccaf1]['type'])continue;if(null==_0x51c066[_0x4ccaf1]['pairId'])continue;let _0x57bd9c=_0x4ccaf1+0x1,_0x319692=0x0;for(;_0x51c066[_0x57bd9c]['id']!=_0x51c066[_0x4ccaf1]['pairId'];)'elementStart'==_0x51c066[_0x57bd9c]['type']?_0x319692++:'elementEnd'==_0x51c066[_0x57bd9c]['type']&&_0x319692--,_0x57bd9c++;if(0x0!=_0x319692){if(_0x51c066[_0x4ccaf1]['isRemoved'])_0x51c066[_0x4ccaf1]['isIncorrect']=!0x0;else{for(;_0x57bd9c!=_0x4ccaf1;)_0x51c066[_0x57bd9c]['isRemoved']&&0x0!=_0x51c066[_0x57bd9c]['distance']&&(_0x51c066[_0x57bd9c]['isIncorrect']=!0x0,_0x17480f['add'](_0x51c066[_0x57bd9c]['pairId'])),_0x57bd9c--;}}}return _0x51c066['filter'](_0x385035=>!_0x385035['isIncorrect']);}_removeUnsupportedChanges(_0x35f652){const _0x2aca18=this['editor']['model']['schema'];for(let _0x52d368=0x0;_0x52d368<_0x35f652['length'];_0x52d368++){if(!(_0x35f652[_0x52d368]['isAdded']||_0x35f652[_0x52d368]['isAddSuggestion']||_0x35f652[_0x52d368]['isRemoved']||_0x35f652[_0x52d368]['isRemoveSuggestion']))continue;if(0x0==_0x35f652[_0x52d368]['distance'])continue;const _0x197d1c=_0x35f652[_0x52d368]['item'];_0x2aca18['isBlock'](_0x197d1c)||_0x2aca18['isLimit'](_0x197d1c)||(_0x35f652[_0x52d368]['isAdded']&&delete _0x35f652[_0x52d368]['isAdded'],_0x35f652[_0x52d368]['isAddSuggestion']&&delete _0x35f652[_0x52d368]['isAddSuggestion'],_0x35f652[_0x52d368]['isRemoveSuggestion']&&delete _0x35f652[_0x52d368]['isRemoveSuggestion'],_0x35f652[_0x52d368]['isRemoved']&&(_0x35f652[_0x52d368]['isIncorrect']=!0x0));}return _0x35f652['filter'](_0x3184b0=>!_0x3184b0['isIncorrect']);}['_makeModelFromTape'](_0x4b39f5,_0x3126eb,_0x3d4e65,_0x9eaa74){const _0xfe6f4b=new _0x49656a(),_0x1229bb=[],_0x54028b=new Map(),_0x16ed4d=this['editor']['model'],_0x32dff7=_0x16ed4d['schema'],_0x4db71a=[_0xfe6f4b],_0x2960bc={},_0x38a984={'isAdded':[],'isRemoved':[],'isAddSuggestion':[],'isRemoveSuggestion':[]};_0xfe6f4b['name']=_0x9eaa74;let _0x2e518e=null;const _0x1c9cc9=[0x0];for(let _0x382cd2=0x0;_0x382cd2<_0x4b39f5['length'];_0x382cd2++)if('elementStart'===_0x4b39f5[_0x382cd2]['type']){_0x4b39f5[_0x382cd2]['previousPosition']=_0x16ed4d['createPositionFromPath'](_0xfe6f4b,_0x1c9cc9);const _0x577929=new _0xf48e9f(_0x4b39f5[_0x382cd2]['item']['name'],_0x4b39f5[_0x382cd2]['item']['getAttributes']());_0x4db71a[0x0]['_appendChild'](_0x577929),_0x1c9cc9['push'](0x0),_0x4db71a['unshift'](_0x577929),_0x4b39f5[_0x382cd2]['nextPosition']=_0x16ed4d['createPositionFromPath'](_0xfe6f4b,_0x1c9cc9);}else'elementEnd'===_0x4b39f5[_0x382cd2]['type']?(_0x4db71a['shift'](),_0x4b39f5[_0x382cd2]['previousPosition']=_0x16ed4d['createPositionFromPath'](_0xfe6f4b,_0x1c9cc9),_0x1c9cc9['pop'](),_0x1c9cc9[_0x1c9cc9['length']-0x1]++,_0x4b39f5[_0x382cd2]['nextPosition']=_0x16ed4d['createPositionFromPath'](_0xfe6f4b,_0x1c9cc9)):(_0x4b39f5[_0x382cd2]['previousPosition']=_0x16ed4d['createPositionFromPath'](_0xfe6f4b,_0x1c9cc9),_0x2e518e?_0x2e518e['_data']+=_0x4b39f5[_0x382cd2]['item']['data']:_0x2e518e=new _0x339e9d(_0x4b39f5[_0x382cd2]['item']['data'],_0x4b39f5[_0x382cd2]['item']['getAttributes']()),_0x4b39f5[_0x382cd2+0x1]&&'text'===_0x4b39f5[_0x382cd2+0x1]['type']&&_0x49914e(_0x2e518e,_0x4b39f5[_0x382cd2+0x1]['item'])||(_0x4db71a[0x0]['_appendChild'](_0x2e518e),_0x2e518e=null),_0x1c9cc9[_0x1c9cc9['length']-0x1]+=_0x4b39f5[_0x382cd2]['item']['offsetSize'],_0x4b39f5[_0x382cd2]['nextPosition']=_0x16ed4d['createPositionFromPath'](_0xfe6f4b,_0x1c9cc9));for(let _0x52534f=0x0;_0x52534f<_0x4b39f5['length'];_0x52534f++){const _0xb67c0f=_0x4b39f5[_0x52534f]['previousPosition'],_0xc1d29e=_0x4b39f5[_0x52534f]['nextPosition'];for(const _0xfb8946 of _0x4b39f5[_0x52534f]['markersStart'])_0x54028b['set'](_0xfb8946,{'start':_0xb67c0f,'end':null});_0x3a2d50('isRemoveSuggestion',_0x52534f,_0xb67c0f,_0xc1d29e),_0x3a2d50('isAddSuggestion',_0x52534f,_0xb67c0f,_0xc1d29e),_0x3a2d50('isRemoved',_0x52534f,_0xb67c0f,_0xc1d29e),_0x3a2d50('isAdded',_0x52534f,_0xb67c0f,_0xc1d29e);for(const _0x22d00e of _0x4b39f5[_0x52534f]['markersEnd']){const _0xc2b40b=_0x54028b['get'](_0x22d00e);_0xc2b40b?_0xc2b40b['end']=_0xc1d29e:_0x54028b['set'](_0x22d00e,{'start':_0xc1d29e,'end':_0xc1d29e});}}for(const [_0x4d55bb,_0x51da79]of _0x54028b){const _0x4859f4=this['editor']['model']['createRange'](_0x51da79['start'],_0x51da79['end']);_0xfe6f4b['markers']['set'](_0x4d55bb,_0x4859f4);}return _0x1229bb['sort']((_0x4d8c4c,_0x4461fe)=>{const _0x25e85b=_0xfe6f4b['markers']['get']('revision:'+_0x4d8c4c['id']),_0x938cdc=_0xfe6f4b['markers']['get']('revision:'+_0x4461fe['id']);return _0x25e85b['start']['isBefore'](_0x938cdc['start'])?-0x1:_0x25e85b['start']['isAfter'](_0x938cdc['start'])?0x1:_0x25e85b['end']['isBefore'](_0x938cdc['end'])?-0x1:_0x25e85b['end']['isAfter'](_0x938cdc['end'])?0x1:'add'===_0x4d8c4c['type']?-0x1:0x1;}),{'root':_0xfe6f4b,'changes':_0x1229bb};function _0x3a2d50(_0x5d8b49,_0x465edd,_0x48e460,_0x2e75f2){const _0x137e9c=!!_0x4b39f5[_0x465edd][_0x5d8b49],_0x44883d=_0x137e9c?_0x4b39f5[_0x465edd][_0x5d8b49]['userId']:null,_0x378814=_0x137e9c&&_0x4b39f5[_0x465edd][_0x5d8b49]['aiSource']||null,_0xc12155=_0x465edd===_0x4b39f5['length']-0x1,_0x1060ea=_0x38a984[_0x5d8b49][0x0],_0x15eefd=_0x32dff7['isObject'](_0x4b39f5[_0x465edd]['item']);!_0x2960bc[_0x5d8b49]&&_0x137e9c?_0x2960bc[_0x5d8b49]={'start':_0x48e460,'tapeItem':_0x4b39f5[_0x465edd],'userId':_0x44883d,'aiSource':_0x378814,'type':_0x5d8b49}:_0x2960bc[_0x5d8b49]&&!_0x137e9c?(_0x2960bc[_0x5d8b49]['end']=_0x48e460,_0x2f2dbd(_0x2960bc[_0x5d8b49]),_0x2960bc[_0x5d8b49]=null):_0x2960bc[_0x5d8b49]&&_0x137e9c&&(_0x2960bc[_0x5d8b49]['userId']!==_0x44883d||_0x2960bc[_0x5d8b49]['aiSource']!==_0x378814)&&(_0x2960bc[_0x5d8b49]['end']=_0x48e460,_0x1060ea&&_0x1060ea['userId']===_0x2960bc[_0x5d8b49]['userId']?_0x1060ea['change']['aiSource']=_0x1060ea['change']['aiSource']||_0x2960bc[_0x5d8b49]['aiSource']:_0x2f2dbd(_0x2960bc[_0x5d8b49]),_0x2960bc[_0x5d8b49]={'start':_0x48e460,'tapeItem':_0x4b39f5[_0x465edd],'userId':_0x44883d,'aiSource':_0x378814,'type':_0x5d8b49}),_0x2960bc[_0x5d8b49]&&_0x15eefd&&('elementStart'!==_0x4b39f5[_0x465edd]['type']||_0x1060ea&&_0x1060ea['userId']===_0x44883d||_0x38a984[_0x5d8b49]['unshift']({'userId':_0x44883d,'object':_0x4b39f5[_0x465edd]['item'],'change':_0x2960bc[_0x5d8b49]}),'elementEnd'===_0x4b39f5[_0x465edd]['type']&&_0x1060ea&&_0x1060ea['object']===_0x4b39f5[_0x465edd]['item']&&(_0x38a984[_0x5d8b49]['shift'](),_0x2960bc[_0x5d8b49]=_0x1060ea['change'])),_0x2960bc[_0x5d8b49]&&_0xc12155&&(_0x2960bc[_0x5d8b49]['end']=_0x2e75f2,_0x2f2dbd(_0x2960bc[_0x5d8b49]),_0x2960bc[_0x5d8b49]=null);}function _0x2f2dbd({start:_0x333b02,end:_0x493b3e,tapeItem:_0x2145df,userId:_0x6ccc10,aiSource:_0x4a4b21,type:_0x3d5d5b}){const _0x4ce36a=_0x2145df['item'],_0x2d3c03=_0x16ed4d['schema']['isBlock'](_0x4ce36a)&&!_0x16ed4d['schema']['isLimit'](_0x4ce36a),_0x3a58f4=_0x333b02['nodeAfter']==_0x493b3e['parent']&&_0x493b3e['isAtStart'];if(_0x2d3c03&&_0x3a58f4)return;const _0x6a2449=_0x16ed4d['createRange'](_0x333b02,_0x493b3e),_0x11181d=_0x3126eb['get'](_0x6ccc10),_0x4c4062=new Mt({'author':_0x11181d,'type':'isAdded'==_0x3d5d5b||'isAddSuggestion'==_0x3d5d5b?'add':'remove','data':{'isSuggestion':'isAddSuggestion'==_0x3d5d5b||'isRemoveSuggestion'==_0x3d5d5b,'aiSource':_0x4a4b21||null},'createdAt':new Date(),'rootName':_0x3d4e65});_0x1229bb['push'](_0x4c4062),_0xfe6f4b['markers']['set']('revision:'+_0x4c4062['id'],_0x6a2449);}function _0x49914e(_0x41d7cd,_0x45ad5f){const _0x4623f1=_0x41d7cd['getAttributes'](),_0x26f96a=_0x45ad5f['getAttributes']();for(const _0x5e3c51 of _0x4623f1){if(_0x5e3c51[0x1]!==_0x45ad5f['getAttribute'](_0x5e3c51[0x0]))return!0x1;_0x26f96a['next']();}return _0x26f96a['next']()['done'];}}_setConversion(){this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'revision'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision','view':_0x345139=>{const _0x190d19=_0x345139['markerName']['split'](':')[0x1],_0x9ed92c=this['_getChangeFromId'](_0x190d19);if(!_0x9ed92c)return null;const _0x30b39a='add'==_0x9ed92c['type']?'insertion':'deletion',_0x3763b4=['ck-suggestion-marker','ck-suggestion-marker-'+_0x30b39a];return _0x9ed92c['data']['isSuggestion']&&_0x3763b4['push']('ck-suggestion-marker-'+_0x30b39a+'-new'),this['activeChange']==_0x9ed92c&&_0x3763b4['push']('ck-suggestion-marker--active'),{'classes':_0x3763b4,'attributes':{'data-change-id':_0x190d19}};}}),this['editor']['conversion']['for']('upcast')['add'](_0x622943=>{_0x622943['on']('element:pre',(_0xf25128,_0x462500,_0x3ace47)=>{const _0x3734c7=_0x462500['viewItem']['getChild'](0x0);if(!_0x3734c7||!_0x3734c7['is']('element','code'))return;if(!_0x3ace47['consumable']['consume'](_0x3734c7,{'attributes':['vid_start','vid_end']}))return;const _0x14a375=_0x462500['modelRange']['start']['nodeAfter'];_0x3ace47['writer']['setAttribute']('vid_start',_0x3734c7['getAttribute']('vid_start'),_0x14a375),_0x3ace47['writer']['setAttribute']('vid_end',_0x3734c7['getAttribute']('vid_end'),_0x14a375);},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['add'](_0x108035=>{_0x108035['on']('element',(_0x26b1a6,_0x5bd226,_0x2ccc23)=>{if(!_0x2ccc23['consumable']['consume'](_0x5bd226['viewItem'],{'attributes':['vid_start','vid_end']}))return;if(_0x5bd226['modelRange']['isCollapsed'])return;const _0xcb2d7b=_0x5bd226['modelRange']['start']['nodeAfter'];_0xcb2d7b['hasAttribute']('vid_start')||_0xcb2d7b['hasAttribute']('vid')||(_0x2ccc23['writer']['setAttribute']('vid_start',_0x5bd226['viewItem']['getAttribute']('vid_start'),_0xcb2d7b),_0x2ccc23['writer']['setAttribute']('vid_end',_0x5bd226['viewItem']['getAttribute']('vid_end'),_0xcb2d7b));},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['elementToAttribute']({'view':{'name':'span','attributes':{'vid':!0x0}},'model':{'key':'vid','value':_0x43bb36=>_0x43bb36['getAttribute']('vid')}}),this['editor']['model']['schema']['on']('checkAttribute',(_0x6b642c,[,_0x5c4f84])=>{['vid_start','vid_end','vid']['includes'](_0x5c4f84)&&(_0x6b642c['return']=!0x0,_0x6b642c['stop']());},{'priority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x3963a8=>{_0x3963a8['on']('attribute:vid',(_0x2516e4,_0x2fbb64,_0x1a80bf)=>{if('\x20'!=_0x2fbb64['item']['data']||_0x2fbb64['item']['parent']['maxOffset']>0x1)return;if(!_0x1a80bf['consumable']['consume'](_0x2fbb64['item'],_0x2516e4['name']))return;const _0x5cda11=_0x1a80bf['writer'],_0x22a1c0=_0x1a80bf['mapper']['toViewRange'](_0x2fbb64['range']);_0x5cda11['wrap'](_0x22a1c0,_0x5cda11['createAttributeElement']('span'));});}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',function(_0x1d4421){const _0x11e43f=_0x1d4421['plugins']['get']('RevisionViewer');return(_0x93453b,_0x2ac4a2,_0x5424e1)=>{const _0x5e1a70=_0x2ac4a2['markerName']['split'](':')[0x1],_0x43f010=_0x11e43f['_getChangeFromId'](_0x5e1a70);if(!_0x43f010)return null;const _0x2a8650='add'==_0x43f010['type']?'split':'merge';if(!_0x5424e1['consumable']['test'](_0x2ac4a2['markerRange'],_0x93453b['name']))return;const _0x537d58=_0x2ac4a2['markerRange']['getWalker'](),_0x449c5e=_0x2ac4a2['markerRange']['start'],_0x832dcf=_0x1d4421['model']['schema'];let _0x14a84c=null,_0x541b60=null,_0x395aed=!0x1,_0x2361d5=!0x1;for(const _0x4b7650 of _0x537d58){const _0x3bf6db=_0x4b7650['item'];_0x395aed=_0x395aed||_0x832dcf['isContent'](_0x3bf6db);const _0x5d5068=_0x5424e1['mapper']['toViewElement'](_0x3bf6db);if(_0x5d5068&&_0x5d5068['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x4b7650['type']&&(_0x832dcf['isBlock'](_0x3bf6db)&&!_0x832dcf['isLimit'](_0x3bf6db)&&(_0x3bf6db['nextSibling']||_0x449c5e['isAtEnd']?_0x14a84c&&_0x14a84c['parent']==_0x3bf6db||(_0x14a84c=_0x3bf6db,_0x38347b(_0x4b7650['previousPosition']),_0x2361d5=!0x0):_0x541b60=_0x541b60||_0x4b7650['previousPosition']));}function _0x38347b(_0x1dad00){const _0x5e8b6c=_0x5424e1['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x2a8650}),_0x167703=_0x5424e1['mapper']['toViewPosition'](_0x1dad00);_0x43f010['data']['isSuggestion']&&_0x5424e1['writer']['addClass']('ck-suggestion-marker-'+_0x2a8650+'-new',_0x5e8b6c),_0x11e43f['activeChange']==_0x43f010&&_0x5424e1['writer']['addClass']('ck-suggestion-marker--active',_0x5e8b6c),_0x5424e1['writer']['insert'](_0x167703,_0x5e8b6c),_0x5424e1['mapper']['bindElementToMarker'](_0x5e8b6c,_0x2ac4a2['markerName']);}_0x395aed||_0x2361d5||!_0x541b60||_0x38347b(_0x541b60);};}(this['editor']),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision',(_0x111e80,_0x26e8f4,_0x4cf99b)=>{const _0x588b46=_0x4cf99b['mapper']['markerNameToElements'](_0x26e8f4['markerName']);if(_0x588b46){for(const _0xb42d2 of _0x588b46)(_0xb42d2['hasClass']('ck-suggestion-marker-split')||_0xb42d2['hasClass']('ck-suggestion-marker-merge'))&&(_0x4cf99b['mapper']['unbindElementFromMarkerName'](_0xb42d2,_0x26e8f4['markerName']),_0x4cf99b['writer']['remove'](_0xb42d2));}},{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',(_0x352f53,_0x485931,_0x16e4e4)=>{const _0x1b0a07=_0x485931['markerName']['split'](':')[0x1],_0x3b1841=this['_getChangeFromId'](_0x1b0a07);if(!_0x3b1841)return null;const _0x48d731='add'==_0x3b1841['type']?'split':'merge';if(_0x16e4e4['consumable']['test'](_0x485931['markerRange'],_0x352f53['name']))for(const _0x10dd4a of _0x485931['markerRange']['getItems']()){if(!_0x10dd4a['is']('element','softBreak'))continue;const _0x45a51e=_0x16e4e4['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x48d731}),_0x25e738=_0x16e4e4['mapper']['toViewPosition'](this['editor']['model']['createPositionBefore'](_0x10dd4a));_0x3b1841['data']['isSuggestion']&&_0x16e4e4['writer']['addClass']('ck-suggestion-marker-'+_0x48d731+'-new',_0x45a51e),this['activeChange']==_0x3b1841&&_0x16e4e4['writer']['addClass']('ck-suggestion-marker--active',_0x45a51e),_0x16e4e4['writer']['insert'](_0x25e738,_0x45a51e),_0x16e4e4['mapper']['bindElementToMarker'](_0x45a51e,_0x485931['markerName']);}},{'priority':'high'}),this['editor']['model']['document']['on']('change',()=>{this['editor']['editing']['view']['change'](_0x39a34f=>{for(const _0x5203b6 of this['editor']['model']['document']['getRootNames']()){const _0xd54f54=this['editor']['model']['document']['getRoot'](_0x5203b6),_0x8f1b73=this['editor']['editing']['view']['document']['getRoot'](_0x5203b6);if(_0x8f1b73){const _0x42c0fb=_0xd54f54['getAttribute']('revisionHistoryAttachChange');if(_0x39a34f['removeAttribute']('data-change-id',_0x8f1b73),_0x39a34f['removeClass']('ck-revision-history-root-add',_0x8f1b73),_0x39a34f['removeClass']('ck-revision-history-root-remove',_0x8f1b73),_0x39a34f['removeClass']('ck-revision-history-root--active',_0x8f1b73),_0x42c0fb){const _0x332ccf=this['_getChangeFromId'](_0x42c0fb);if(!_0x332ccf)return null;_0x39a34f['setAttribute']('data-change-id',_0x42c0fb,_0x8f1b73),_0x39a34f['addClass']('ck-revision-history-root-'+_0x332ccf['type'],_0x8f1b73),this['activeChange']==_0x332ccf&&_0x39a34f['addClass']('ck-revision-history-root--active',_0x8f1b73);}}}});}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'comment','model':_0x1677a6=>'revision-comment:'+_0x1677a6,'converterPriority':'highest'}),this['_showCommentHighlights']&&this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-comment','view':_0x4f9516=>({'classes':['ck-comment-marker'],'attributes':{'data-comment':Ut(_0x4f9516['markerName'])}})}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'suggestion','model':_0x49889b=>'revision-suggestion:'+_0x49889b,'converterPriority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision-suggestion','view':_0x26edb1=>({'name':'suggestion:'+_0x26edb1,'group':'revision-suggestion'}),'converterPriority':'highest'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-suggestion','view':_0x5b1dd0=>{const _0x4c6c4d=_0x5b1dd0['markerName']['split'](':')[0x1];return'insertion'!=_0x4c6c4d&&'deletion'!=_0x4c6c4d?null:{'classes':['ck-suggestion-preview-marker','ck-suggestion-preview-marker-'+_0x4c6c4d]};}}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:deletion',Lt(this['editor'],'merge'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:insertion',Lt(this['editor'],'split'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision-suggestion',(_0x4ba268,_0x21b1f7,_0x30c4ca)=>{const _0x4ab847=_0x30c4ca['mapper']['markerNameToElements'](_0x21b1f7['markerName']);if(_0x4ab847){for(const _0x41ec85 of _0x4ab847)_0x41ec85['is']('uiElement')&&(_0x30c4ca['mapper']['unbindElementFromMarkerName'](_0x41ec85,_0x21b1f7['markerName']),_0x30c4ca['writer']['remove'](_0x41ec85));}},{'priority':'high'});}_getChangeFromId(_0x32b618){return this['_changeIdToChange']['get'](_0x32b618);}_getViewForChange(_0x41a2b5){return this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=new Vt(this['editor']['locale'],_0x41a2b5,'pill'===this['editor']['config']['get']('revisionHistory.showAISource')),this['_changeView'];}_initInteractions(){this['editor']['model']['document']['selection']['observeMarkers']('revision'),this['on']('change:activeView',(_0x594645,_0x22c2cc,_0x4a86c6,_0x2cab2d)=>{_0x2cab2d&&this['_balloon']['remove'](_0x2cab2d),_0x4a86c6&&(this['_balloon']['add']({'view':_0x4a86c6,'stackId':'revisionHistoryLabel','position':{'target':()=>{const _0xb77098=this['editor']['editing'],_0x353cee=this['_getChangeFromId'](_0x4a86c6['changeId']);let _0xf6abc7;if(_0x353cee['data']['isOnRoot']){const _0x347069=_0xb77098['view']['getDomRoot'](_0x353cee['rootName']);_0xf6abc7=Array['from'](_0x347069['getClientRects']());}else{const _0x14b898=this['editor']['model']['markers']['get']('revision:'+_0x4a86c6['changeId']);_0xf6abc7=Array['from'](_0xb77098['mapper']['markerNameToElements'](_0x14b898['name']))['map'](_0x1c3b90=>_0xb77098['view']['domConverter']['mapViewToDom'](_0x1c3b90))['map'](_0x59ee3c=>Array['from'](_0x59ee3c['getClientRects']()))['flat']();}return this['_activeViewTarget']&&_0xf6abc7['find'](_0x5b64ed=>_0x5b64ed['top']-0x3<=this['_activeViewTarget']['y']&&_0x5b64ed['bottom']+0x3>=this['_activeViewTarget']['y']&&_0x5b64ed['left']-0x3<=this['_activeViewTarget']['x']&&_0x5b64ed['right']+0x3>=this['_activeViewTarget']['x'])||_0xf6abc7[0x0];}}}),this['_balloon']['showStack']('revisionHistoryLabel'));}),this['on']('change:activeChange',(_0xb1b9f8,_0x4a1e3c,_0x2ceca6,_0x3fbcd)=>{this['activeView']=_0x2ceca6?this['_getViewForChange'](_0x2ceca6):null,this['editor']['model']['change'](()=>{const _0x474da5=this['editor']['editing'];_0x3fbcd&&(_0x3fbcd['data']['isOnRoot']?_0x474da5['view']['change'](_0x344a3e=>{_0x344a3e['removeClass']('ck-revision-history-root--active',_0x474da5['view']['document']['getRoot'](_0x3fbcd['rootName']));}):_0x474da5['reconvertMarker']('revision:'+_0x3fbcd['id'])),_0x2ceca6&&(_0x2ceca6['data']['isOnRoot']?_0x474da5['view']['change'](_0x1732e9=>{_0x1732e9['addClass']('ck-revision-history-root--active',_0x474da5['view']['document']['getRoot'](_0x2ceca6['rootName']));}):_0x474da5['reconvertMarker']('revision:'+_0x2ceca6['id']));});}),this['listenTo'](this['editor']['editing']['view']['document'],'mouseover',(_0x418831,_0x22a938)=>{if(this['activeChange'])return;const _0x59c17e=this['_findChangeIdFromDomTarget'](_0x22a938['target']),_0x540c30=this['_changeIdToChange']['get'](_0x59c17e);_0x540c30?(this['_activeViewTarget']={'x':_0x22a938['domEvent']['x'],'y':_0x22a938['domEvent']['y']},this['activeView']=this['_getViewForChange'](_0x540c30)):(this['_activeViewTarget']=null,this['activeView']=null);}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',(_0x533bd4,_0x53ceec)=>{const _0x388467=this['_findChangeIdFromDomTarget'](_0x53ceec['target']),_0x16c6cc=this['_changeIdToChange']['get'](_0x388467);_0x16c6cc?(this['_activeViewTarget']={'x':_0x53ceec['domEvent']['x'],'y':_0x53ceec['domEvent']['y']},_0x16c6cc===this['activeChange']?this['_balloon']['updatePosition']():this['activeChange']=_0x16c6cc):(this['_activeViewTarget']=null,this['activeChange']=null);});}_findChangeIdFromDomTarget(_0x8fdeeb){do{const _0x59913f=_0x8fdeeb['getAttribute']('data-change-id');if(_0x59913f)return _0x59913f;_0x8fdeeb=_0x8fdeeb['parent'];}while(_0x8fdeeb);return null;}['_cleanMarkers'](){this['editor']['model']['change'](_0x3246e7=>{for(const _0x216435 of this['editor']['model']['markers'])_0x3246e7['removeMarker'](_0x216435);});}};function Ut(_0x196665){return _0x196665['split'](':')[0x1];}function Lt(_0x31f4c6,_0x11b641){return(_0x5390a3,_0x2149b1,_0x1bd616)=>{if(!_0x1bd616['consumable']['test'](_0x2149b1['markerRange'],_0x5390a3['name']))return;const _0x4a2dd5=_0x2149b1['markerRange']['getWalker'](),_0xea215c=_0x2149b1['markerRange']['start'],_0x5cbd5a=_0x31f4c6['model']['schema'];let _0x444f2c=null,_0x5bcd6c=null,_0x483cdc=!0x1,_0x1dc2d6=!0x1;for(const _0x82143 of _0x4a2dd5){const _0x2d93c1=_0x82143['item'];_0x483cdc=_0x483cdc||_0x5cbd5a['isContent'](_0x2d93c1);const _0x20d33e=_0x1bd616['mapper']['toViewElement'](_0x2d93c1);if(_0x20d33e&&_0x20d33e['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x82143['type']&&(_0x5cbd5a['isBlock'](_0x2d93c1)&&!_0x5cbd5a['isLimit'](_0x2d93c1)&&(_0x2d93c1['nextSibling']||_0xea215c['isAtEnd']?_0x444f2c&&_0x444f2c['parent']==_0x2d93c1||(_0x444f2c=_0x2d93c1,_0x76818f(_0x82143['previousPosition']),_0x1dc2d6=!0x0):_0x5bcd6c=_0x5bcd6c||_0x82143['previousPosition']));}function _0x76818f(_0x3120ef){const _0x3aacff=_0x1bd616['mapper']['toViewPosition'](_0x3120ef),_0x749051=_0x1bd616['writer']['createUIElement']('span',{'class':'ck-suggestion-preview-marker-'+_0x11b641});_0x1bd616['writer']['insert'](_0x3aacff,_0x749051),_0x1bd616['mapper']['bindElementToMarker'](_0x749051,_0x2149b1['markerName']);}_0x483cdc||_0x1dc2d6||!_0x5bcd6c||_0x76818f(_0x5bcd6c);};}var Ft=class extends _0x321013{constructor(_0x345f58){super(_0x345f58);const _0x3d2c65=_0x345f58['plugins']['get'](Pt);this['affectsData']=!0x1,this['listenTo'](_0x3d2c65,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x3d2c65,'change:isEnabled',()=>this['refresh']());}execute(){const _0x1bda4a=this['editor'],_0x15cd81=_0x1bda4a['plugins']['get'](Pt),_0x12f377=_0x15cd81['isReady']?_0x15cd81['diff']['newRevisionId']:null;_0x1bda4a['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x12f377);}['refresh'](){const {isReady:_0x514985,isEnabled:_0x3e4803,repository:_0x351cd7,diff:_0x154b25}=this['editor']['plugins']['get'](Pt),_0x4d468f=_0x154b25&&_0x351cd7['getLaterVisibleRevision'](_0x154b25['newRevisionId']);this['isEnabled']=_0x514985&&_0x3e4803&&Boolean(_0x4d468f);}},$t=class extends _0x321013{_step;constructor(_0x13ea60,{direction:_0x510023}){super(_0x13ea60);const _0x146475=_0x13ea60['plugins']['get'](Pt);this['affectsData']=!0x1,this['_step']='forward'===_0x510023?0x1:-0x1,this['listenTo'](_0x146475,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x146475,'change:isEnabled',()=>this['refresh']()),this['listenTo'](_0x146475,'change:activeChange',()=>this['refresh']());}execute(){const _0x4e7f6d=this['editor'],_0x4dccf8=_0x4e7f6d['plugins']['get'](Pt),{isNavigationMode:_0x2f0db3,currentChangeNumber:_0x149c53}=_0x4dccf8;let _0x481200;if(_0x4dccf8['activeChange']=_0x2f0db3?_0x4dccf8['diff']['changes']['get'](_0x149c53+this['_step']):_0x4dccf8['diff']['changes']['first'],_0x4dccf8['activeChange']['data']['isOnRoot'])_0x481200=_0x4e7f6d['editing']['view']['getDomRoot'](_0x4dccf8['activeChange']['rootName']);else{const _0x9bf710=_0x4e7f6d['model']['markers']['get']('revision:'+_0x4dccf8['activeChange']['id']);_0x481200=_0x445e6f(_0x4e7f6d['editing'],_0x9bf710);}_0x273e11({'target':_0x481200,'viewportOffset':0x28});}['refresh'](){const {isNavigationMode:_0x50bfb6,currentChangeNumber:_0x166899,numberOfChanges:_0x5cd554,isReady:_0x49e64e,isEnabled:_0x2e239e}=this['editor']['plugins']['get'](Pt);this['isEnabled']=!!(_0x2e239e&&_0x49e64e&&_0x5cd554)&&(!_0x50bfb6||(0x1===this['_step']?_0x166899<_0x5cd554-0x1:_0x166899>0x0));}},Bt=class extends dt{constructor(_0x3708d9){super(_0x3708d9);const _0x1c8bb4=this['bindTemplate'],_0xb7243a=new _0x17c303(_0x3708d9),_0xcae676=new _0x17c303(_0x3708d9);this['set']('isNavigationMode',!0x1),this['set']('isReady',!0x1),this['set']('currentChangeNumber',0x0),this['set']('numberOfChanges',0x0),this['set']('isForwardNavigationEnabled',!0x1),this['set']('isBackwardNavigationEnabled',!0x1),this['bind']('_isStatusLabelVisible')['to'](this,'isReady',this,'numberOfChanges',(_0x1190dd,_0x1f1966)=>_0x1190dd&&_0x1f1966>0x0),this['bind']('_statusText')['to'](this,'isReady',this,'currentChangeNumber',this,'numberOfChanges',this,'isNavigationMode',(_0x4eaee6,_0x103158,_0x4a2dfd,_0x18363e)=>{if(!_0x4eaee6)return kt(_0x3708d9,'Loading...');if(!_0x4a2dfd)return kt(_0x3708d9,'No\x20changes');const _0x4ca68e=kt(_0x3708d9,'NUMBER_OF_CHANGES',_0x4a2dfd);return _0x18363e?kt(_0x3708d9,'X_OF_Y_CHANGES',[_0x103158+0x1,_0x4a2dfd]):_0x4ca68e;}),_0xb7243a['set']({'label':kt(_0x3708d9,'Show\x20previous\x20change'),'tooltip':!0x0,'icon':_0x1e827e}),_0xcae676['set']({'label':kt(_0x3708d9,'Show\x20next\x20change'),'tooltip':!0x0,'icon':_0xec47db}),_0xb7243a['bind']('isEnabled')['to'](this,'isBackwardNavigationEnabled'),_0xcae676['bind']('isEnabled')['to'](this,'isForwardNavigationEnabled'),_0xb7243a['on']('execute',()=>this['fire']('execute','backward')),_0xcae676['on']('execute',()=>this['fire']('execute','forward')),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-revision-history-ui','ck-revision-history-ui__changes-navigation']},'children':[{'tag':'span','attributes':{'class':['ck-revision-history-ui__changes-navigation__wrapper']},'children':[{'tag':'span','attributes':{'class':['ck-revision-history-ui__changes-navigation__label',_0x1c8bb4['if']('_isStatusLabelVisible','ck-hidden',_0x2a0802=>!_0x2a0802)]},'children':[{'text':_0x1c8bb4['to']('isNavigationMode',_0x41445d=>_0x41445d?kt(_0x3708d9,'EDIT_X_OF_Y_REVISIONS')+':\x20':kt(_0x3708d9,'Total')+':\x20')}]},{'text':_0x1c8bb4['to']('_statusText')}]},new ct(),{'tag':'div','attributes':{'class':['ck-revision-history-ui__changes-navigation__navigation']},'children':[_0xb7243a,_0xcae676]}]});}};const jt='ck-editor__editable__loading-overlay';var Gt=class extends _0x20938f{static get['pluginName'](){return'RevisionViewerLoadingOverlay';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['show'](){const _0x5a0929=this['editor']['editing']['view'];_0x5a0929['change'](_0x44862c=>{for(const _0x3b5200 of _0x5a0929['document']['roots'])_0x44862c['addClass'](jt,_0x3b5200);});}['hide'](){const _0x1e0f20=this['editor']['editing']['view'];_0x1e0f20['change'](_0x5a7db6=>{for(const _0x58eec0 of _0x1e0f20['document']['roots'])_0x5a7db6['removeClass'](jt,_0x58eec0);});}},Kt=class extends _0x20938f{static get['pluginName'](){return'RevisionViewerUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Pt,Gt];}init(){const _0x5569a9=this['editor'],_0x4f6bc4=_0x5569a9['plugins']['get'](Pt),_0x468371=_0x5569a9['plugins']['get'](Gt);_0x5569a9['ui']['componentFactory']['add']('exitToEditing',_0x54a01d=>{const _0x295834=new _0x17c303(_0x54a01d);return _0x295834['set']({'label':kt(_0x54a01d,'Back\x20to\x20editing'),'icon':_0x174cc5,'withText':!0x0,'tooltip':!0x0,'class':'ck-revision-history-ui__back-to-editing'}),this['listenTo'](_0x295834,'execute',()=>{_0x5569a9['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}),_0x295834;}),_0x5569a9['ui']['componentFactory']['add']('restoreRevision',_0x1939d9=>{const _0x2baf37=new _0x17c303(_0x1939d9);return _0x2baf37['set']({'label':kt(_0x1939d9,'Restore\x20this\x20revision'),'withText':!0x0,'tooltip':!0x0}),_0x2baf37['bind']('isEnabled')['to'](_0x5569a9['commands']['get']('restoreRevision')),this['listenTo'](_0x2baf37,'execute',()=>_0x5569a9['execute']('restoreRevision')),_0x2baf37;}),_0x5569a9['ui']['componentFactory']['add']('changesNavigation',_0x43c4f3=>{const _0x1d22e9=new Bt(_0x43c4f3),_0x49da97=_0x5569a9['commands']['get']('showPreviousChange'),_0x7e9a36=_0x5569a9['commands']['get']('showNextChange');return _0x1d22e9['bind']('isBackwardNavigationEnabled')['to'](_0x49da97,'isEnabled'),_0x1d22e9['bind']('isForwardNavigationEnabled')['to'](_0x7e9a36,'isEnabled'),_0x1d22e9['bind']('isReady','currentChangeNumber','numberOfChanges','isNavigationMode')['to'](_0x4f6bc4),this['listenTo'](_0x1d22e9,'execute',(_0x2053ae,_0x50d0e0)=>{_0x5569a9['execute']('forward'===_0x50d0e0?'showNextChange':'showPreviousChange');}),_0x1d22e9;}),_0x468371['show'](),_0x4f6bc4['on']('change:isReady',(_0x113ff6,_0x3f0ad3,_0x4ca0b8)=>{_0x4ca0b8?_0x468371['hide']():_0x468371['show']();});}},qt=class extends it{['_resizeObserver']=null;constructor(_0x4b7862,_0x561daa){super(_0x4b7862,_0x561daa);const _0x1d2012=this['bindTemplate'];this['set']({'label':kt(_0x4b7862,'Revision\x20name'),'_tooltipString':''}),this['fieldView']['placeholder']=kt(_0x4b7862,'Enter\x20the\x20revision\x20name'),this['extendTemplate']({'tag':'span','attributes':{'class':['ck-revision-history-sidebar__revision-name'],'data-cke-tooltip-text':_0x1d2012['to']('_tooltipString'),'data-cke-tooltip-position':'s','data-cke-tooltip-class':'ck-tooltip_multi-line'}});}['render'](){super['render'](),this['_resizeObserver']=new _0x1952cf(this['fieldView']['element'],()=>this['_updateTooltipText']()),this['listenTo'](this['fieldView'],'input',()=>this['_updateTooltipText']());}destroy(){super['destroy'](),this['_resizeObserver']&&this['_resizeObserver']['destroy']();}_updateTooltipText(){const _0xeca549=this['fieldView']['element'];this['_tooltipString']=_0xeca549['scrollWidth']>_0xeca549['clientWidth']&&_0xeca549['value']||'';}},Yt=class extends dt{constructor(_0x4a2be6,_0x3d36be,_0x127000){super(_0x4a2be6);const _0x1c5ad0=new _0x1af692();_0x1c5ad0['set']({'content':_0x329dc5,'viewBox':'0\x200\x2011\x2010'});const _0x2a182e=['ck','ck-revision-history-sidebar__revision-author'];_0x127000&&_0x2a182e['push']('ck-revision-history-sidebar__revision-author_creator');const _0x4fc5d6=[{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__revision-author__name'],'title':kt(_0x4a2be6,_0x127000?'Revision\x20creator':'Revision\x20author')},'children':[_0x1c5ad0,_0x3d36be['name']]}];this['setTemplate']({'tag':'li','attributes':{'class':_0x2a182e},'children':_0x4fc5d6});}};function Jt(_0x3daade,_0x555730){const _0x2a6464=_0x3daade['bindTemplate'],_0xc0946c=_0x3daade['locale'],_0x1b89ed=vt(_0xc0946c);_0x1b89ed['panelPosition']='sw';const _0x23c5af=function(_0x84ef7f,_0x2f902e){const _0x46280c=function(_0x14f80a,_0x46bc26){const _0x34e4d7=_0x14f80a['locale'],_0x175444={'Compare\x20against\x20selected':kt(_0x34e4d7,'Compare\x20against\x20selected'),'Name\x20this\x20revision':kt(_0x34e4d7,'Name\x20this\x20revision'),'Restore\x20this\x20revision':kt(_0x34e4d7,'Restore\x20this\x20revision')};return _0x46bc26['map'](_0x86f970=>{const _0x10f332=_0x175444[_0x86f970['name']];return _0x10f332&&_0x10f332!==_0x86f970['name']&&(_0x86f970['name']=_0x10f332),_0x86f970;});}(_0x84ef7f,_0x2f902e),_0x47feab=new _0x374b4a();for(const _0x108835 of _0x46280c){const _0x4a523a={'type':'button','model':new ut({'label':_0x108835['name'],'class':_0x108835['class'],'withText':!0x0,'role':'menuitem','_action':_0x108835['action']})};_0x4a523a['model']['bind']('isEnabled')['to'](_0x84ef7f,'isActionsDropdownOpen',_0x35d0d9=>'function'!=typeof _0x108835['isEnabled']||(!_0x35d0d9||_0x108835['isEnabled'](_0x84ef7f))),_0x47feab['add'](_0x4a523a);}return _0x47feab;}(_0x3daade,_0x555730);return _0x3daade['bind']('isActionsDropdownOpen')['to'](_0x1b89ed,'isOpen'),_0x1b89ed['buttonView']['set']({'label':kt(_0xc0946c,'Show\x20more\x20items'),'tooltip':!0x0,'tooltipPosition':'sw','icon':_0x35fa28}),_0x1b89ed['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision__actions',_0x2a6464['if']('isActionsDropdownOpen','ck-on')]},'on':{'click':_0x2a6464['to'](_0x49c6e0=>_0x49c6e0['stopPropagation']())}}),_0x1b89ed['on']('execute',_0x1bc7aa=>{_0x3daade['isReady']&&'function'==typeof _0x1bc7aa['source']['_action']&&_0x1bc7aa['source']['_action'](_0x3daade);}),ft(_0x1b89ed,_0x23c5af,{'role':'menu'}),_0x1b89ed['listenTo'](_0x3daade,'change:isActionsDropdownOpen',(_0x5f0fd0,_0x559557,_0x29b252)=>{if(_0x29b252)for(const _0x1a0412 of _0x1b89ed['listView']['items']){const _0x1cb65a=_0x1a0412['children']['first'],_0x3c93fa=_0x555730['find'](_0x5667eb=>_0x5667eb['action']===_0x1cb65a['_action'])['isVisible'];_0x1a0412['isVisible']=void 0x0===_0x3c93fa||_0x3c93fa(_0x3daade);}}),_0x1b89ed;}const Wt=/* #__PURE__ -- @preserve */
27
+ _0x138cee(dt);var Xt=class extends Wt{['id'];['revisionNameView'];revisionActionsView;['_revision'];_requireRevisionName;['_aiPillView'];constructor(_0x4affc0,_0x1a12f4,_0x580b0e,_0x369144,_0x325300=!0x1){super(_0x4affc0);const _0x2844fe=this['bindTemplate'],_0x405746=function(_0x449928,_0x181aa3){const _0x244173=Array['from'](_0x181aa3['authors'])['filter'](_0x5ed029=>_0x5ed029!=_0x181aa3['creator']);return _0x181aa3['creator']&&_0x244173['unshift'](_0x181aa3['creator']),_0x244173['map'](_0x392a11=>new Yt(_0x449928,_0x392a11,_0x392a11==_0x181aa3['creator']));}(_0x4affc0,_0x1a12f4);this['id']=_0x1a12f4['id'],this['_revision']=_0x1a12f4,this['_requireRevisionName']=_0x369144,this['bind']('_isAiGenerated')['to'](_0x1a12f4,'attributes',_0x23c0ca=>!(!_0x23c0ca||!_0x23c0ca['@ai'])),this['bind']('name','createdAt')['to'](_0x1a12f4),this['bind']('_createdAtFormatted')['to'](this,'createdAt',_0x32a0ce=>{return _0x3f985f=_0x4affc0['uiLanguage'],(_0x4786ee=_0x32a0ce)['toLocaleDateString'](_0x3f985f,{'month':'long','day':'numeric'})+',\x20'+_0x4786ee['toLocaleTimeString'](_0x3f985f,{'hour':'numeric','minute':'numeric'});var _0x3f985f,_0x4786ee;}),this['set']('isSelected',!0x1),this['set']('isHighlighted',!0x1),this['set']('isActionsDropdownOpen',!0x1),this['set']('isReady',!0x1),this['set']('isEnabled',!0x1),this['revisionNameView']=new qt(_0x4affc0,gt),this['revisionNameView']['fieldView']['extendTemplate']({'attributes':{'maxlength':'220'}}),this['revisionNameView']['fieldView']['bind']('value')['to'](this,'name',_0x1b8225=>_0x1b8225||this['_createdAtFormatted']),this['revisionNameView']['bind']('isEnabled')['to'](this,'isSelected',this,'isEnabled',(_0x235ef9,_0xca5158)=>_0x235ef9&&_0xca5158),this['revisionActionsView']=_0x580b0e&&_0x580b0e['length']?Jt(this,_0x580b0e):'',this['revisionActionsView']&&this['revisionActionsView']['bind']('isEnabled')['to'](this),this['_aiPillView']=_0x325300?this['_createAiPillView'](_0x4affc0):null,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision-wrapper',_0x2844fe['if']('isConfirm','ck-revision-history-sidebar__revision-wrapper_confirmation_visible')]},'children':[{'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision',_0x2844fe['if']('isEnabled','ck-disabled',_0xd588ec=>!_0xd588ec),_0x2844fe['if']('isSelected','ck-revision-history-sidebar__revision_selected'),_0x2844fe['if']('isHighlighted','ck-revision-history-sidebar__revision_highlighted'),_0x2844fe['if']('isActionsDropdownOpen','ck-revision-history-sidebar__actions_dropdown_open')]},'children':[this['revisionNameView'],{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__revision__date']},'children':[{'text':_0x2844fe['to']('_createdAtFormatted')}]},{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__revision__controls-wrapper']},'children':[{'tag':'ul','attributes':{'class':['ck','ck-revision-history-sidebar__revision-authors']},'children':_0x405746}]},..._0x325300?[{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__revision-ai-pill-row',_0x2844fe['if']('_isAiGenerated','ck-hidden',_0x36f29f=>!_0x36f29f)]},'children':[this['_aiPillView']]}]:[],this['revisionActionsView']],'on':{'click':_0x2844fe['to'](_0x109e08=>{_0x109e08['srcElement']['closest']('.ck-confirm-view')||this['isReady']&&this['isEnabled']&&this['fire']('select',{'id':this['id']});})}}]});}_createAiPillView(_0x1d44cd){const _0x24d096=new _0x5a0a33(_0x1d44cd);return _0x24d096['set']({'icon':_0x2b2e7d,'label':kt(_0x1d44cd,'REVISION_AI_SOURCE_PILL_LABEL'),'tooltip':kt(_0x1d44cd,'AI_SOURCE_REVISION_TOOLTIP'),'tooltipPosition':'s','size':'small','class':'ck-pill_ai'}),_0x24d096['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision-ai-pill']}}),_0x24d096;}['render'](){super['render']();const _0x1e5048=this['revisionNameView']['fieldView']['element'];this['listenTo'](_0x1e5048,'change',()=>{this['_requireRevisionName']&&!_0x1e5048['value']||this['fire']('setName',{'id':this['id'],'name':_0x1e5048['value']}),_0x1e5048['value']||(_0x1e5048['value']=this['name']?this['name']:this['_createdAtFormatted']);});}select(){this['isSelected']=!0x0;}deselect(){this['isSelected']=!0x1;}highlight(){this['isHighlighted']=!0x0;}unhighlight(){this['isHighlighted']=!0x1;}};function Qt(_0x1e7826,_0x4f39d2){const _0x3de411=wt['fromJSDate'](_0x1e7826)['setLocale'](_0x4f39d2),_0x39f27d=wt['local'](),_0x4aa45a=_0x39f27d['minus']({'days':0x1})['startOf']('day');let _0x4f4859,_0x19a115;return _0x3de411['hasSame'](_0x39f27d,'day')?(_0x4f4859=_0x3de411['startOf']('day')['toJSDate'](),_0x19a115=_0x3de411['toRelativeCalendar']()):_0x3de411['hasSame'](_0x4aa45a,'day')?(_0x4f4859=_0x4aa45a['toJSDate'](),_0x19a115=_0x3de411['toRelativeCalendar']()):_0x3de411['hasSame'](_0x39f27d,'week')?(_0x4f4859=_0x3de411['startOf']('week')['toJSDate'](),_0x19a115=_0x3de411['weekdayLong']||''):_0x3de411['hasSame'](_0x39f27d,'year')?(_0x4f4859=_0x3de411['startOf']('month')['toJSDate'](),_0x19a115=_0x3de411['monthLong']||''):(_0x4f4859=_0x3de411['startOf']('year')['toJSDate'](),_0x19a115=String(_0x3de411['year'])),{'startDate':_0x4f4859,'localizedPeriodName':_0x19a115};}var zt=class extends dt{startDate;['revisionViews'];_revisionActions;_requireRevisionName;['_showAISource'];constructor(_0x49b607,_0x3383a8,_0x14f728,_0x2b32d1,_0x45bf7b){super(_0x49b607);const _0x472b04=Qt(_0x3383a8,this['locale']['uiLanguage'])['localizedPeriodName'];this['startDate']=_0x3383a8,this['revisionViews']=this['createCollection'](),this['_revisionActions']=_0x14f728,this['_requireRevisionName']=_0x2b32d1,this['_showAISource']=_0x45bf7b,this['revisionViews']['delegate']('select')['to'](this),this['revisionViews']['delegate']('setName')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__time-period']},'children':[{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__time-period__label']},'children':[{'text':_0x472b04}]},{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__time-period__revisions']},'children':this['revisionViews']}]});}['addRevision'](_0x591e8a){const _0x1241b4=new Xt(this['locale'],_0x591e8a,this['_revisionActions'],this['_requireRevisionName'],this['_showAISource']);this['revisionViews']['add'](_0x1241b4);}['removeRevision'](_0x9a3ba1){const _0x41878e=this['revisionViews']['find'](_0xf69349=>_0xf69349['id']===_0x9a3ba1['id']);this['revisionViews']['remove'](_0x41878e);}},Zt=class extends dt{constructor(_0x344922){super(_0x344922);const _0x411c5a=new _0x1af692();_0x411c5a['content']=_0x37eac0,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-revision-history-sidebar__header']},'children':[_0x411c5a,{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__header__label']},'children':[kt(_0x344922,'Revision\x20history')]}]});}},ti=class extends dt{timePeriodViews;['_revisions'];_revisionActions;_requireRevisionName;['_showAISource'];constructor(_0x458f5f,_0x1926cc,_0x245050,_0x1530dd,_0x28d8a3){super(_0x458f5f);const _0x30b7fc=this['bindTemplate'];this['timePeriodViews']=this['createCollection'](),this['timePeriodViews']['delegate']('select')['to'](this),this['timePeriodViews']['delegate']('setName')['to'](this),this['_revisions']=_0x1926cc,this['_revisionActions']=_0x245050,this['_requireRevisionName']=_0x1530dd,this['_showAISource']=_0x28d8a3,this['on']('select',(_0x1b7455,_0x598ccf)=>{this['fire']('revisionSelected',_0x598ccf);}),this['on']('setName',(_0xb216f4,_0x527119)=>{this['fire']('revisionSetName',_0x527119);}),this['set']('isEnabled',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-rounded-corners','ck-revision-history-sidebar']},'children':[new Zt(_0x458f5f),{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__timeline',_0x30b7fc['if']('isEnabled','ck-disabled',_0x4e5f69=>!_0x4e5f69)]},'children':this['timePeriodViews']}]});}['render'](){super['render']();for(const _0x3e3413 of this['_revisions'])this['_addRevision'](_0x3e3413);this['_revisions']['on']('add',(_0x43a5d6,_0x209b88)=>{this['_addRevision'](_0x209b88);}),this['_revisions']['on']('remove',(_0x3b8845,_0x3a0ff5)=>{this['_removeRevision'](_0x3a0ff5);});}get['revisionViews'](){return this['timePeriodViews']['map'](_0x58b9fb=>_0x58b9fb['revisionViews']['map'](_0x2fd9b0=>_0x2fd9b0))['flat']();}selectRevision(_0x70f6e4){for(const _0x252507 of this['revisionViews'])_0x70f6e4&&_0x70f6e4['id']===_0x252507['id']?_0x252507['select']():_0x252507['deselect']();}highlightRevisions(_0x81598d){for(const _0x249c03 of this['revisionViews'])_0x81598d['some'](({id:_0x4e9422})=>_0x4e9422===_0x249c03['id'])?_0x249c03['highlight']():_0x249c03['unhighlight']();}['_addRevision'](_0x82753c){const _0xce1057=Qt(_0x82753c['createdAt'],this['locale']['uiLanguage'])['startDate'];let _0x598dab=this['_getTimePeriodViewByStartDate'](_0xce1057);_0x598dab||(_0x598dab=new zt(this['locale'],_0xce1057,this['_revisionActions'],this['_requireRevisionName'],this['_showAISource']),this['timePeriodViews']['add'](_0x598dab)),_0x598dab['addRevision'](_0x82753c);}['_removeRevision'](_0x5a0176){const _0x177c61=Qt(_0x5a0176['createdAt'],this['locale']['uiLanguage'])['startDate'];this['_getTimePeriodViewByStartDate'](_0x177c61)['removeRevision'](_0x5a0176);}_getTimePeriodViewByStartDate(_0x244ca7){return this['timePeriodViews']['find'](_0x1692d5=>_0x1692d5['startDate']['getTime']()===_0x244ca7['getTime']());}},ii=class RevisionsSidebar extends _0x20938f{['_revisionViewer'];_revisionsRepository;['_sidebarView'];static defaultRevisionActions=/* #__PURE__ -- @preserve */
28
28
  ((()=>['compareAgainstSelected','restoreRevision','nameRevision'])());static availableRevisionActions=/* #__PURE__ -- @preserve */
29
- ei();static get['pluginName'](){return'RevisionsSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Pt];}constructor(_0x21f803){super(_0x21f803),this['_revisionViewer']=_0x21f803['plugins']['get'](Pt),this['_revisionsRepository']=this['_revisionViewer']['repository'],this['_sidebarView']=null;}init(){const _0x3d30de=this['_revisionsRepository']['_revisions'],_0x5d48c8=this['_createRevisionActions'](),_0x4d8789=this['editor']['config']['get']('revisionHistory.viewerSidebarContainer');this['_sidebarView']=new ti(this['editor']['locale'],_0x3d30de,_0x5d48c8,this['editor']['config']['get']('revisionHistory.requireRevisionName'),'pill'===this['editor']['config']['get']('revisionHistory.showAISource')),this['_sidebarView']['on']('revisionSelected',this['_handleRevisionSelected']['bind'](this)),this['_sidebarView']['on']('revisionSetName',this['_handleRevisionSetName']['bind'](this)),this['_sidebarView']['bind']('isEnabled')['to'](this['_revisionViewer']),this['_sidebarView']['timePeriodViews']['on']('add',(_0x39d354,_0x336536)=>{_0x336536['revisionViews']['on']('add',(_0x2d871a,_0x648692)=>{_0x648692['bind']('isEnabled','isReady')['to'](this['_revisionViewer']);});}),this['_sidebarView']['render'](),this['listenTo'](this['editor']['data'],'ready',this['_handleEditorDataReady']['bind'](this)),this['listenTo'](this['_revisionViewer'],'change:diff',this['_handleDiffChange']['bind'](this)),_0x4d8789['appendChild'](this['_sidebarView']['element']);}destroy(){this['_sidebarView']['element']['remove'](),this['_sidebarView']['destroy']();}_handleEditorDataReady(){const _0x21e491=this['_revisionsRepository']['getRevision'](0x0);if(_0x21e491){const _0x55f424=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x21e491['id']);this['_revisionViewer']['compare'](_0x21e491,_0x55f424);}}_handleRevisionSelected(_0x6b87a2,_0x3986c2){const _0x31bae2=this['_revisionsRepository']['getRevision'](_0x3986c2['id']),_0x4c97b9=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x31bae2['id']);this['_revisionViewer']['compare'](_0x31bae2,_0x4c97b9);}_handleRevisionSetName(_0xe88104,_0x38bfc2){this['_revisionsRepository']['getRevision'](_0x38bfc2['id'])['setName'](_0x38bfc2['name']);}['_handleDiffChange'](_0x21858a,_0x1c967d,_0x4ed270){const _0x2a19d1=this['_revisionsRepository']['getRevisionsInDiff'](_0x4ed270);_0x2a19d1['length']>0x2?(this['_sidebarView']['highlightRevisions'](_0x2a19d1),this['_sidebarView']['selectRevision'](null)):(this['_sidebarView']['highlightRevisions']([]),this['_sidebarView']['selectRevision'](_0x2a19d1[0x0]));}_createRevisionActions(){const _0x8f62ab=this['editor'],_0x41fd04=RevisionsSidebar['availableRevisionActions'],_0x5adf5a=_0x8f62ab['config']['get']('revisionHistory.revisionActions')||RevisionsSidebar['defaultRevisionActions'];if(_0x5adf5a['length'])return _0x5adf5a['map'](_0x58e574=>{const _0x3b3d06='string'==typeof _0x58e574?Object['assign']({},_0x41fd04[_0x58e574]):_0x58e574;return _0x3b3d06['action']=_0x3b3d06['action']['bind'](this,_0x8f62ab),_0x3b3d06['isVisible']&&(_0x3b3d06['isVisible']=_0x3b3d06['isVisible']['bind'](this,_0x8f62ab)),_0x3b3d06;});}};function ei(){return{'compareAgainstSelected':{'name':'Compare\x20against\x20selected','action':({plugins:_0x452ae3},_0x37a994)=>{const _0x323dc4=_0x452ae3['get'](Pt),_0x42b67f=_0x323dc4['repository'];let _0x5e8100=_0x323dc4['diff']['newRevisionId'],_0x134469=_0x37a994['id'];_0x42b67f['getIndex'](_0x5e8100)>_0x42b67f['getIndex'](_0x134469)&&([_0x5e8100,_0x134469]=[_0x134469,_0x5e8100]),_0x323dc4['compare'](_0x5e8100,_0x134469);},'isVisible':({plugins:_0x3240b1},_0x59e42e)=>{const _0x20dbcf=_0x3240b1['get'](Pt);return!(_0x20dbcf['repository']['getRevisionsInDiff'](_0x20dbcf['diff'])['length']>0x2)&&!_0x59e42e['isSelected'];}},'restoreRevision':{'name':'Restore\x20this\x20revision','action':(_0x51594c,{id:_0x385951})=>{_0x51594c['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x385951);},'isVisible':({plugins:_0x31be91},_0x3991f0)=>!!_0x31be91['get'](Pt)['repository']['getLaterVisibleRevision'](_0x3991f0['id'])},'nameRevision':{'name':'Name\x20this\x20revision','action':({plugins:_0x3083f5},{id:_0x27d45d,revisionNameView:_0x31dee5})=>{const _0x591e12=_0x3083f5['get'](Pt),_0x1faad9=_0x591e12['repository']['getEarlierVisibleRevision'](_0x27d45d);_0x591e12['compare'](_0x27d45d,_0x1faad9),_0x31dee5['focus'](),_0x31dee5['fieldView']['select']();}}};}var si=class extends _0x18bfac{['_view'];_toolbarConfig;_elementReplacer;get['view'](){return this['_view'];}constructor(_0x3c0148,_0x2ba9b5){super(_0x3c0148),this['_view']=_0x2ba9b5,this['_toolbarConfig']=mt(_0x3c0148['config']['get']('toolbar')),this['_elementReplacer']=new _0x511954();}get element(){return this['view']['element'];}init(_0x31da66){const _0xd1fb26=this['editor'],_0x1a1aad=this['view'],_0x2c2d02=_0xd1fb26['editing']['view'],_0x1c3c8e=_0x1a1aad['editable'];_0x1c3c8e['name']=_0x2c2d02['document']['getRoot']()['rootName'],_0x1a1aad['render']();const _0x37089c=_0x1c3c8e['element'];this['setEditableElement'](_0x1c3c8e['name'],_0x37089c),_0x1a1aad['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x2c2d02['attachDomRoot'](_0x37089c),this['_elementReplacer']['replace'](_0x31da66,this['element']),this['_initToolbar'](),this['fire']('ready');}destroy(){super['destroy']();const _0x2cf44b=this['view'],_0x5b2177=this['editor']['editing']['view'];this['_elementReplacer']['restore'](),_0x5b2177['detachDomRoot'](_0x2cf44b['editable']['name']),_0x2cf44b['destroy']();}_initToolbar(){const _0x31f249=this['view'];_0x31f249['stickyPanel']['bind']('isActive')['to'](this['focusTracker'],'isFocused'),_0x31f249['stickyPanel']['limiterElement']=_0x31f249['element'],_0x31f249['stickyPanel']['bind']('viewportTopOffset')['to'](this,'viewportOffset',({top:_0x50e7a9})=>_0x50e7a9),_0x31f249['toolbar']['fillFromConfig'](this['_toolbarConfig'],this['componentFactory']),this['addToolbar'](_0x31f249['toolbar']);}},ni=class extends _0xace1be{_editable;stickyPanel;toolbar;get editable(){return this['_editable'];}constructor(_0x402280,_0x8fbc91,_0x3f8813={}){super(_0x402280),this['stickyPanel']=new ht(_0x402280),this['toolbar']=new lt(_0x402280,{'shouldGroupWhenFull':_0x3f8813['shouldToolbarGroupWhenFull']}),this['_editable']=new tt(_0x402280,_0x8fbc91);}['render'](){super['render'](),this['stickyPanel']['content']['add'](this['toolbar']),this['top']['add'](this['stickyPanel']),this['main']['add'](this['editable']);}};const oi=/* #__PURE__ -- @preserve */
30
- _0x2adcfd(_0x334d00);var ri=class extends oi{['_ui'];get['ui'](){return this['_ui'];}constructor(_0x2ed7a8,_0x2ff080){super(_0x2ff080),this['sourceElement']=_0x2ed7a8,this['model']['document']['createRoot']();const _0x2a6bee=new ni(this['locale'],this['editing']['view'],{'shouldToolbarGroupWhenFull':!0x0});this['_ui']=new si(this,_0x2a6bee);}destroy(){return this['updateSourceElement'](),this['ui']['destroy'](),super['destroy']();}static async create(_0x59600,_0x259d5d){const _0xa54ccb=new this(_0x59600,_0x259d5d);return await _0xa54ccb['initPlugins'](),await _0xa54ccb['ui']['init'](_0x59600),await _0xa54ccb['data']['init'](_0xa54ccb['config']['get']('initialData')||''),_0xa54ccb['fire']('ready'),_0xa54ccb;}};const ai=['RevisionHistoryUI','RestrictedEditingMode'];var hi=class extends _0x17a398{result;static get['pluginName'](){return'RevisionViewerIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1b78a5){super(_0x1b78a5),this['result']='end',_0x1b78a5['editing']['view']['_overlayModeHint']='auto',_0x1b78a5['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}},ci=class extends _0x17a398{_viewerEditor;static get['pluginName'](){return'RevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[At,Dt];}constructor(_0x41c74f){if(super(_0x41c74f),!this['editor']['config']['get']('revisionHistory'))throw new _0xd1267b('revision-history-missing-configuration',this);this['_viewerEditor']=null,this['set']('isRevisionViewerOpen',!0x1),this['editor']['config']['define']('revisionHistory.showRevisionViewerCallback',_0x338440=>this['_showRevisionViewer']({..._0x338440,'translations':this['editor']['locale']['translations']})),this['editor']['config']['define']('revisionHistory.closeRevisionViewerCallback',_0x41f986=>this['_closeRevisionViewer'](_0x41f986)),this['editor']['config']['define']('revisionHistory.restoreRevisionCallback',_0x460b40=>this['_restoreRevision'](_0x460b40)),this['editor']['config']['define']('revisionHistory.requireRevisionName',!0x1),this['editor']['config']['define']('revisionHistory.showCommentHighlights',!0x1),this['_enhanceShowRevisionViewerCallback'](),this['_enhanceCloseRevisionViewerCallback']();}set adapter(_0x69e0c){this['editor']['plugins']['get']('RevisionTracker')['adapter']=_0x69e0c;}get adapter(){return this['editor']['plugins']['get']('RevisionTracker')['adapter'];}addRevisionData(_0x1c728b){return this['editor']['plugins']['get']('RevisionTracker')['addRevisionData'](_0x1c728b);}getRevision(_0x256501){return this['editor']['plugins']['get']('RevisionsRepository')['getRevision'](_0x256501);}getRevisions(_0x3dd5e0){return this['editor']['plugins']['get']('RevisionsRepository')['getRevisions'](_0x3dd5e0||{'toJSON':!0x1});}_getRevisionViewerEditorConfig(){const _0x2e823f=this['editor'],_0x1d1a5d=_0x47e5a1(_0x2e823f,ai),_0x4b567c=_0x2e823f['plugins']['get']('RevisionTracker'),_0x4bfbc2=_0x2e823f['plugins']['get'](_0x4b9bd4)['users'];return _0x1d1a5d['toolbar']=['exitToEditing','restoreRevision','changesNavigation'],delete _0x1d1a5d['lazyRoots'],(_0x1d1a5d['plugins']['push'](hi,Pt,Kt,class RevisionViewerInit extends _0x17a398{static get requires(){return[Pt,_0x4b9bd4];}init(){const _0x1717ce=this['editor']['plugins']['get'](_0x4b9bd4);for(const _0x1872da of _0x4bfbc2)_0x1872da['isAnonymous']||_0x1717ce['getUser'](_0x1872da['id'])||_0x1717ce['addUser'](_0x1872da);const _0xa3e071=_0x4b567c['repository']['getRevisions']();let _0x5f0176=null;const _0x3eda54=this['editor']['plugins']['get']('RevisionViewer');if(_0x3eda54['adapter']=_0x4b567c['adapter'],_0x3eda54['bind']('isEnabled')['to'](_0x4b567c),_0x2e823f['plugins']['has']('CommentsRepository')){const _0x40c9a2=_0x2e823f['plugins']['get']('CommentsRepository');_0x3eda54['_getVisibleCommentThreadIds']=()=>new Set(_0x40c9a2['getCommentThreads']()['filter'](_0x30ded6=>!_0x30ded6['isResolved'])['map'](_0x2accfa=>_0x2accfa['id']));}this['editor']['commands']['get']('restoreRevision')['bind']('isEnabled')['to'](_0x2e823f,'isReadOnly',_0x7cea8a=>!_0x7cea8a);for(const _0x3f3940 of _0xa3e071){const _0x1da780=null===_0x3f3940['creator'];if(_0x1da780&&_0x3f3940['toVersion']===_0x3f3940['fromVersion'])continue;const _0x17ad12=_0x3f3940['toJSON']();_0x3eda54['addRevisionData'](_0x17ad12,(_0x156310,_0x526de9,_0x48d71a)=>{if(_0x1da780){if(_0x5f0176)_0x5f0176['_update'](_0x156310,_0x526de9);else{if(!_0x526de9){const _0x17f2c5=_0x48d71a['toJSON']();_0x17f2c5['id']=_0x5ca1c8(),_0x4b567c['saveRevision'](_0x17f2c5,_0x48d71a['toVersion'])['then'](_0x11bf79=>{_0x5f0176=_0x11bf79;});}}}else _0x3f3940['_update'](_0x156310,_0x526de9);});}}},ii),_0x1d1a5d);}['_enhanceShowRevisionViewerCallback'](){const _0x3137a3=this['editor']['config']['get']('revisionHistory')['showRevisionViewerCallback'];this['editor']['config']['set']('revisionHistory.showRevisionViewerCallback',async()=>{this['editor']['enableReadOnlyMode']('revision-history-viewer-opened');const _0x5197cb=this['editor']['plugins']['get']('RevisionTracker');if(this['editor']['plugins']['has']('Autosave')?await this['editor']['plugins']['get']('Autosave')['save']():await _0x5197cb['update'](),this['editor']['plugins']['has']('PaginationLookup')&&this['editor']['plugins']['get']('PaginationLookup')['_recalculatePageBreaks'](),this['editor']['plugins']['has']('Dialog')){const _0x1f630b=this['editor']['plugins']['get']('Dialog');_0x1f630b['isOpen']&&_0x1f630b['hide']();}if(this['editor']['plugins']['has']('AITabs')){const _0x3064bd=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x5cbc98 of _0x3064bd)_0x5cbc98['class']=_0x5cbc98['class']?_0x5cbc98['class']+'\x20ck-tab-panel_disabled':'ck-tab-panel_disabled';if(this['editor']['plugins']['has']('AIChat')){const _0x53cf7a=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x53cf7a&&_0x53cf7a['setAttribute']('tabindex','-1');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x5e3ae4=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x5e3ae4&&_0x5e3ae4['setAttribute']('tabindex','-1');}}const _0x335b0d=this['_getRevisionViewerEditorConfig']();return _0x3137a3(_0x335b0d)['then'](_0x2e8e1c=>(this['_viewerEditor']=_0x2e8e1c,this['editor']['plugins']['has']('Annotations')&&this['editor']['plugins']['get']('Annotations')['refreshVisibility'](),this['editor']['plugins']['has']('DocumentOutline')&&(this['editor']['plugins']['get']('DocumentOutlineUI')['view']['element']['style']['display']='none'),_0x2e8e1c))['catch'](_0x471f68=>(console['error'](_0x471f68),this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),null));});}['_enhanceCloseRevisionViewerCallback'](){const _0x4b6861=this['editor']['config']['get']('revisionHistory')['closeRevisionViewerCallback'];this['editor']['config']['set']('revisionHistory.closeRevisionViewerCallback',()=>{if(this['editor']['plugins']['has']('PaginationLookup')&&this['editor']['plugins']['get']('PaginationLookup')['_recalculatePageBreaks'](),this['editor']['plugins']['has']('DocumentOutline')&&(this['editor']['plugins']['get']('DocumentOutlineUI')['view']['element']['style']['display']=''),this['editor']['plugins']['has']('AITabs')){const _0x2fcb47=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x108aa8 of _0x2fcb47)_0x108aa8['class']='ck-tab-panel_disabled'===_0x108aa8['class']?'':_0x108aa8['class']['replace']('\x20ck-tab-panel_disabled','');if(this['editor']['plugins']['has']('AIChat')){const _0x375a4a=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x375a4a&&_0x375a4a['removeAttribute']('tabindex');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x174b06=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x174b06&&_0x174b06['removeAttribute']('tabindex');}}return this['_viewerEditor']['plugins']['get']('RevisionViewer')['_cleanUp'](),_0x4b6861(this['_viewerEditor'])['then'](()=>{if(this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),this['_viewerEditor']=null,this['editor']['plugins']['has']('Annotations')){const _0x4e6815=this['editor']['plugins']['get']('Annotations');_0x4e6815['refreshVisibility'](),_0x4e6815['refreshPositioning']();}});});}['_showRevisionViewer'](_0x274ee3){const _0xa90d4b=this['editor']['config']['get']('revisionHistory.editorContainer'),_0x5a3f66=this['editor']['config']['get']('revisionHistory.viewerContainer'),_0x4771f1=this['editor']['config']['get']('revisionHistory.viewerEditorElement');return ri['create'](_0x4771f1,_0x274ee3)['then'](_0x312519=>(_0x5a3f66['style']['display']='block',_0xa90d4b['style']['display']='none',this['isRevisionViewerOpen']=!0x0,_0x312519));}['_closeRevisionViewer'](_0x3f467f){const _0x330d84=this['editor']['config']['get']('revisionHistory.editorContainer');return this['editor']['config']['get']('revisionHistory.viewerContainer')['style']['display']='none',_0x330d84['style']['display']='',this['isRevisionViewerOpen']=!0x1,_0x3f467f['destroy']();}async _restoreRevision(_0x2e97c3){const _0xbfc5e7=this['editor'],_0x226d29=this['_viewerEditor']['plugins']['get']('RevisionViewer'),_0x2709bc=_0xbfc5e7['plugins']['get']('RevisionTracker'),_0x4896b7=_0xbfc5e7['plugins']['get']('RevisionHistoryUtils'),_0x1f928b=_0x226d29['repository']['getRevision'](_0x2e97c3);let _0x2b0e7b,_0x699258,_0x5d5852;try{await _0x4896b7['loadRevisionData'](_0x1f928b,this['adapter']),_0x2b0e7b=_0x4896b7['getRevisionDocumentData'](_0x1f928b),_0x699258=_0x4896b7['getRevisionRootsAttributes'](_0x1f928b);}catch(_0x5520d4){return void console['error'](_0x5520d4);}_0xbfc5e7['model']['change'](_0x11de0a=>{for(const _0x451fe6 of Array['from'](_0xbfc5e7['model']['markers']['getMarkersGroup']('restrictedEditingException')))_0x11de0a['removeMarker'](_0x451fe6);}),_0x226d29['isReady']=!0x1,_0xbfc5e7['model']['enqueueChange'](_0x1ce6b2=>{_0x1ce6b2['setSelection'](null),_0x1ce6b2['removeSelectionAttribute'](_0xbfc5e7['model']['document']['selection']['getAttributeKeys']());const _0x396de9=Object['keys'](_0x2b0e7b);for(const _0x6070cf of _0xbfc5e7['model']['document']['roots'])'$graveyard'!=_0x6070cf['rootName']&&_0x6070cf['isAttached']()&&!_0x396de9['includes'](_0x6070cf['rootName'])&&_0x1ce6b2['detachRoot'](_0x6070cf);for(const _0x4f2c8e of _0x396de9){let _0x34799f=_0xbfc5e7['model']['document']['getRoot'](_0x4f2c8e);if(!_0x34799f||!_0x34799f['isAttached']()){const _0x52075c=_0x1f928b['diffData']?.[_0x4f2c8e]?.['rootElementName']||'$root';_0x34799f=_0x1ce6b2['addRoot'](_0x4f2c8e,_0x52075c);}const _0xfed306=_0x699258[_0x4f2c8e],_0x4b3fb2=Object['keys'](_0xfed306),_0x558059=_0x2b0e7b[_0x4f2c8e];for(const _0x4f5ea4 of _0x34799f['getAttributeKeys']())_0x4b3fb2['includes'](_0x4f5ea4)||_0x1ce6b2['removeAttribute'](_0x4f5ea4,_0x34799f);for(const _0x301aa4 of _0x4b3fb2)_0x1ce6b2['setAttribute'](_0x301aa4,_0x699258[_0x4f2c8e][_0x301aa4],_0x34799f);_0x1ce6b2['remove'](_0x1ce6b2['createRangeIn'](_0x34799f)),_0x1ce6b2['insert'](_0xbfc5e7['data']['parse'](_0x558059,_0x34799f),_0x34799f,0x0);}});const _0x283ccc=kt(_0xbfc5e7['locale'],'Restored');if(_0x1f928b['name'])_0x5d5852=-0x1==_0x1f928b['name']['indexOf'](_0x283ccc)?_0x283ccc+':\x20'+_0x1f928b['name']:_0x1f928b['name'];else _0x5d5852=_0x283ccc+':\x20'+(_0x1f928b['createdAt']['toLocaleDateString'](_0xbfc5e7['locale']['uiLanguage'],{'month':'long','day':'numeric'})+',\x20'+_0x1f928b['createdAt']['toLocaleTimeString'](_0xbfc5e7['locale']['uiLanguage'],{'hour':'numeric','minute':'numeric'}));return await _0x2709bc['saveRevision']({'name':_0x5d5852}),_0x226d29['isReady']=!0x0,_0xbfc5e7['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}};export{Ft as RestoreRevisionCommand,yt as Revision,ci as RevisionHistory,Dt as RevisionHistoryUI,Rt as RevisionHistoryUtils,At as RevisionTracker,Pt as RevisionViewer,ri as RevisionViewerEditor,hi as RevisionViewerIntegration,Gt as RevisionViewerLoadingOverlay,Kt as RevisionViewerUI,bt as RevisionsRepository,ii as RevisionsSidebar,$t as ShowChangeCommand};
29
+ ei();static get['pluginName'](){return'RevisionsSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Pt];}constructor(_0x220039){super(_0x220039),this['_revisionViewer']=_0x220039['plugins']['get'](Pt),this['_revisionsRepository']=this['_revisionViewer']['repository'],this['_sidebarView']=null;}init(){const _0x14455c=this['_revisionsRepository']['_revisions'],_0x25dc05=this['_createRevisionActions'](),_0x55909e=this['editor']['config']['get']('revisionHistory.viewerSidebarContainer');this['_sidebarView']=new ti(this['editor']['locale'],_0x14455c,_0x25dc05,this['editor']['config']['get']('revisionHistory.requireRevisionName'),'pill'===this['editor']['config']['get']('revisionHistory.showAISource')),this['_sidebarView']['on']('revisionSelected',this['_handleRevisionSelected']['bind'](this)),this['_sidebarView']['on']('revisionSetName',this['_handleRevisionSetName']['bind'](this)),this['_sidebarView']['bind']('isEnabled')['to'](this['_revisionViewer']),this['_sidebarView']['timePeriodViews']['on']('add',(_0x5597aa,_0x308b59)=>{_0x308b59['revisionViews']['on']('add',(_0x2fa207,_0x418077)=>{_0x418077['bind']('isEnabled','isReady')['to'](this['_revisionViewer']);});}),this['_sidebarView']['render'](),this['listenTo'](this['editor']['data'],'ready',this['_handleEditorDataReady']['bind'](this)),this['listenTo'](this['_revisionViewer'],'change:diff',this['_handleDiffChange']['bind'](this)),_0x55909e['appendChild'](this['_sidebarView']['element']);}destroy(){this['_sidebarView']['element']['remove'](),this['_sidebarView']['destroy']();}_handleEditorDataReady(){const _0x305901=this['_revisionsRepository']['getRevision'](0x0);if(_0x305901){const _0x8eab3c=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x305901['id']);this['_revisionViewer']['compare'](_0x305901,_0x8eab3c);}}_handleRevisionSelected(_0x5b0902,_0xa0b5bf){const _0xfee851=this['_revisionsRepository']['getRevision'](_0xa0b5bf['id']),_0x414638=this['_revisionsRepository']['getEarlierVisibleRevision'](_0xfee851['id']);this['_revisionViewer']['compare'](_0xfee851,_0x414638);}_handleRevisionSetName(_0xe37996,_0x2bb747){this['_revisionsRepository']['getRevision'](_0x2bb747['id'])['setName'](_0x2bb747['name']);}['_handleDiffChange'](_0x32ba60,_0x3f464b,_0x4ac0eb){const _0x5ef6de=this['_revisionsRepository']['getRevisionsInDiff'](_0x4ac0eb);_0x5ef6de['length']>0x2?(this['_sidebarView']['highlightRevisions'](_0x5ef6de),this['_sidebarView']['selectRevision'](null)):(this['_sidebarView']['highlightRevisions']([]),this['_sidebarView']['selectRevision'](_0x5ef6de[0x0]));}_createRevisionActions(){const _0x230d63=this['editor'],_0x47ab23=RevisionsSidebar['availableRevisionActions'],_0x2d479d=_0x230d63['config']['get']('revisionHistory.revisionActions')||RevisionsSidebar['defaultRevisionActions'];if(_0x2d479d['length'])return _0x2d479d['map'](_0x1ea22a=>{const _0x4d27aa='string'==typeof _0x1ea22a?Object['assign']({},_0x47ab23[_0x1ea22a]):_0x1ea22a;return _0x4d27aa['action']=_0x4d27aa['action']['bind'](this,_0x230d63),_0x4d27aa['isVisible']&&(_0x4d27aa['isVisible']=_0x4d27aa['isVisible']['bind'](this,_0x230d63)),_0x4d27aa;});}};function ei(){return{'compareAgainstSelected':{'name':'Compare\x20against\x20selected','action':({plugins:_0x1e41c6},_0x3e9867)=>{const _0xfc1b86=_0x1e41c6['get'](Pt),_0x3ea476=_0xfc1b86['repository'];let _0xd95087=_0xfc1b86['diff']['newRevisionId'],_0x3d33a0=_0x3e9867['id'];_0x3ea476['getIndex'](_0xd95087)>_0x3ea476['getIndex'](_0x3d33a0)&&([_0xd95087,_0x3d33a0]=[_0x3d33a0,_0xd95087]),_0xfc1b86['compare'](_0xd95087,_0x3d33a0);},'isVisible':({plugins:_0x441144},_0xdd1777)=>{const _0x2fd385=_0x441144['get'](Pt);return!(_0x2fd385['repository']['getRevisionsInDiff'](_0x2fd385['diff'])['length']>0x2)&&!_0xdd1777['isSelected'];}},'restoreRevision':{'name':'Restore\x20this\x20revision','action':(_0x45e7a9,{id:_0x28ff4c})=>{_0x45e7a9['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x28ff4c);},'isVisible':({plugins:_0x3547da},_0x4a330d)=>!!_0x3547da['get'](Pt)['repository']['getLaterVisibleRevision'](_0x4a330d['id'])},'nameRevision':{'name':'Name\x20this\x20revision','action':({plugins:_0x36cec2},{id:_0xa6af18,revisionNameView:_0x311562})=>{const _0x9e64fa=_0x36cec2['get'](Pt),_0x257a10=_0x9e64fa['repository']['getEarlierVisibleRevision'](_0xa6af18);_0x9e64fa['compare'](_0xa6af18,_0x257a10),_0x311562['focus'](),_0x311562['fieldView']['select']();}}};}var si=class extends _0x16e3a5{['_view'];_toolbarConfig;_elementReplacer;get['view'](){return this['_view'];}constructor(_0xc4c06a,_0x108471){super(_0xc4c06a),this['_view']=_0x108471,this['_toolbarConfig']=mt(_0xc4c06a['config']['get']('toolbar')),this['_elementReplacer']=new _0x4351f3();}get element(){return this['view']['element'];}init(_0x1c0327){const _0x2406c5=this['editor'],_0xd83559=this['view'],_0xacb21b=_0x2406c5['editing']['view'],_0xa01036=_0xd83559['editable'];_0xa01036['name']=_0xacb21b['document']['getRoot']()['rootName'],_0xd83559['render']();const _0xaae869=_0xa01036['element'];this['setEditableElement'](_0xa01036['name'],_0xaae869),_0xd83559['editable']['bind']('isFocused')['to'](this['focusTracker']),_0xacb21b['attachDomRoot'](_0xaae869),this['_elementReplacer']['replace'](_0x1c0327,this['element']),this['_initToolbar'](),this['fire']('ready');}destroy(){super['destroy']();const _0x574a1a=this['view'],_0x38b7a9=this['editor']['editing']['view'];this['_elementReplacer']['restore'](),_0x38b7a9['detachDomRoot'](_0x574a1a['editable']['name']),_0x574a1a['destroy']();}_initToolbar(){const _0x125bac=this['view'];_0x125bac['stickyPanel']['bind']('isActive')['to'](this['focusTracker'],'isFocused'),_0x125bac['stickyPanel']['limiterElement']=_0x125bac['element'],_0x125bac['stickyPanel']['bind']('viewportTopOffset')['to'](this,'viewportOffset',({top:_0x2a1d88})=>_0x2a1d88),_0x125bac['toolbar']['fillFromConfig'](this['_toolbarConfig'],this['componentFactory']),this['addToolbar'](_0x125bac['toolbar']);}},ni=class extends _0x308d14{_editable;stickyPanel;toolbar;get editable(){return this['_editable'];}constructor(_0x5420ab,_0x3ad766,_0x53e608={}){super(_0x5420ab),this['stickyPanel']=new ht(_0x5420ab),this['toolbar']=new lt(_0x5420ab,{'shouldGroupWhenFull':_0x53e608['shouldToolbarGroupWhenFull']}),this['_editable']=new tt(_0x5420ab,_0x3ad766);}['render'](){super['render'](),this['stickyPanel']['content']['add'](this['toolbar']),this['top']['add'](this['stickyPanel']),this['main']['add'](this['editable']);}};const oi=/* #__PURE__ -- @preserve */
30
+ _0x2cc9cf(_0xf023ba);var ri=class extends oi{['_ui'];get['ui'](){return this['_ui'];}constructor(_0x483dd1,_0x56c4f){super(_0x56c4f),this['sourceElement']=_0x483dd1,this['model']['document']['createRoot']();const _0x42cd89=new ni(this['locale'],this['editing']['view'],{'shouldToolbarGroupWhenFull':!0x0});this['_ui']=new si(this,_0x42cd89);}destroy(){return this['updateSourceElement'](),this['ui']['destroy'](),super['destroy']();}static async create(_0x4702fd,_0x1f0b42){const _0x4dbd84=new this(_0x4702fd,_0x1f0b42);return await _0x4dbd84['initPlugins'](),await _0x4dbd84['ui']['init'](_0x4702fd),await _0x4dbd84['data']['init'](_0x4dbd84['config']['get']('initialData')||''),_0x4dbd84['fire']('ready'),_0x4dbd84;}};const ai=['RevisionHistoryUI','RestrictedEditingMode'];var hi=class extends _0x20938f{result;static get['pluginName'](){return'RevisionViewerIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1e4362){super(_0x1e4362),this['result']='end',_0x1e4362['editing']['view']['_overlayModeHint']='auto',_0x1e4362['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}},ci=class extends _0x20938f{_viewerEditor;static get['pluginName'](){return'RevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[At,Dt];}constructor(_0x1bdde4){if(super(_0x1bdde4),!this['editor']['config']['get']('revisionHistory'))throw new _0x3b4618('revision-history-missing-configuration',this);this['_viewerEditor']=null,this['set']('isRevisionViewerOpen',!0x1),this['editor']['config']['define']('revisionHistory.showRevisionViewerCallback',_0x18692a=>this['_showRevisionViewer']({..._0x18692a,'translations':this['editor']['locale']['translations']})),this['editor']['config']['define']('revisionHistory.closeRevisionViewerCallback',_0x34a23c=>this['_closeRevisionViewer'](_0x34a23c)),this['editor']['config']['define']('revisionHistory.restoreRevisionCallback',_0x123c7f=>this['_restoreRevision'](_0x123c7f)),this['editor']['config']['define']('revisionHistory.requireRevisionName',!0x1),this['editor']['config']['define']('revisionHistory.showCommentHighlights',!0x1),this['_enhanceShowRevisionViewerCallback'](),this['_enhanceCloseRevisionViewerCallback']();}set adapter(_0x37f47a){this['editor']['plugins']['get']('RevisionTracker')['adapter']=_0x37f47a;}get adapter(){return this['editor']['plugins']['get']('RevisionTracker')['adapter'];}addRevisionData(_0x36a647){return this['editor']['plugins']['get']('RevisionTracker')['addRevisionData'](_0x36a647);}getRevision(_0x5249e1){return this['editor']['plugins']['get']('RevisionsRepository')['getRevision'](_0x5249e1);}getRevisions(_0x39fb28){return this['editor']['plugins']['get']('RevisionsRepository')['getRevisions'](_0x39fb28||{'toJSON':!0x1});}_getRevisionViewerEditorConfig(){const _0x520df4=this['editor'],_0x501ae0=_0x41f144(_0x520df4,ai),_0x2edad=_0x520df4['plugins']['get']('RevisionTracker'),_0x46050d=_0x520df4['plugins']['get'](_0x410d48)['users'];return _0x501ae0['toolbar']=['exitToEditing','restoreRevision','changesNavigation'],delete _0x501ae0['lazyRoots'],(_0x501ae0['plugins']['push'](hi,Pt,Kt,class RevisionViewerInit extends _0x20938f{static get requires(){return[Pt,_0x410d48];}init(){const _0x474ea0=this['editor']['plugins']['get'](_0x410d48);for(const _0x3d7fc5 of _0x46050d)_0x3d7fc5['isAnonymous']||_0x474ea0['getUser'](_0x3d7fc5['id'])||_0x474ea0['addUser'](_0x3d7fc5);const _0x57036b=_0x2edad['repository']['getRevisions']();let _0x5d16df=null;const _0x431cba=this['editor']['plugins']['get']('RevisionViewer');if(_0x431cba['adapter']=_0x2edad['adapter'],_0x431cba['bind']('isEnabled')['to'](_0x2edad),_0x520df4['plugins']['has']('CommentsRepository')){const _0x502e2b=_0x520df4['plugins']['get']('CommentsRepository');_0x431cba['_getVisibleCommentThreadIds']=()=>new Set(_0x502e2b['getCommentThreads']()['filter'](_0x27e0a1=>!_0x27e0a1['isResolved'])['map'](_0x16f592=>_0x16f592['id']));}this['editor']['commands']['get']('restoreRevision')['bind']('isEnabled')['to'](_0x520df4,'isReadOnly',_0x100831=>!_0x100831);for(const _0x4c81b0 of _0x57036b){const _0x1bcdc8=null===_0x4c81b0['creator'];if(_0x1bcdc8&&_0x4c81b0['toVersion']===_0x4c81b0['fromVersion'])continue;const _0x384363=_0x4c81b0['toJSON']();_0x431cba['addRevisionData'](_0x384363,(_0x560e01,_0x280667,_0x54b947)=>{if(_0x1bcdc8){if(_0x5d16df)_0x5d16df['_update'](_0x560e01,_0x280667);else{if(!_0x280667){const _0x514e86=_0x54b947['toJSON']();_0x514e86['id']=_0x37fc40(),_0x2edad['saveRevision'](_0x514e86,_0x54b947['toVersion'])['then'](_0x4736da=>{_0x5d16df=_0x4736da;});}}}else _0x4c81b0['_update'](_0x560e01,_0x280667);});}}},ii),_0x501ae0);}['_enhanceShowRevisionViewerCallback'](){const _0x21dc96=this['editor']['config']['get']('revisionHistory')['showRevisionViewerCallback'];this['editor']['config']['set']('revisionHistory.showRevisionViewerCallback',async()=>{this['editor']['enableReadOnlyMode']('revision-history-viewer-opened');const _0x587b62=this['editor']['plugins']['get']('RevisionTracker');if(this['editor']['plugins']['has']('Autosave')?await this['editor']['plugins']['get']('Autosave')['save']():await _0x587b62['update'](),this['editor']['plugins']['has']('PaginationLookup')&&this['editor']['plugins']['get']('PaginationLookup')['_recalculatePageBreaks'](),this['editor']['plugins']['has']('Dialog')){const _0x5ec0cc=this['editor']['plugins']['get']('Dialog');_0x5ec0cc['isOpen']&&_0x5ec0cc['hide']();}if(this['editor']['plugins']['has']('AITabs')){const _0x41bfad=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x43dfc7 of _0x41bfad)_0x43dfc7['class']=_0x43dfc7['class']?_0x43dfc7['class']+'\x20ck-tab-panel_disabled':'ck-tab-panel_disabled';if(this['editor']['plugins']['has']('AIChat')){const _0x18b1d1=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x18b1d1&&_0x18b1d1['setAttribute']('tabindex','-1');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x574438=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x574438&&_0x574438['setAttribute']('tabindex','-1');}}const _0x2a2765=this['_getRevisionViewerEditorConfig']();return _0x21dc96(_0x2a2765)['then'](_0x5ae022=>(this['_viewerEditor']=_0x5ae022,this['editor']['plugins']['has']('Annotations')&&this['editor']['plugins']['get']('Annotations')['refreshVisibility'](),this['editor']['plugins']['has']('DocumentOutline')&&(this['editor']['plugins']['get']('DocumentOutlineUI')['view']['element']['style']['display']='none'),_0x5ae022))['catch'](_0x591fb8=>(console['error'](_0x591fb8),this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),null));});}['_enhanceCloseRevisionViewerCallback'](){const _0x51606d=this['editor']['config']['get']('revisionHistory')['closeRevisionViewerCallback'];this['editor']['config']['set']('revisionHistory.closeRevisionViewerCallback',()=>{if(this['editor']['plugins']['has']('PaginationLookup')&&this['editor']['plugins']['get']('PaginationLookup')['_recalculatePageBreaks'](),this['editor']['plugins']['has']('DocumentOutline')&&(this['editor']['plugins']['get']('DocumentOutlineUI')['view']['element']['style']['display']=''),this['editor']['plugins']['has']('AITabs')){const _0x738be=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x1cd623 of _0x738be)_0x1cd623['class']='ck-tab-panel_disabled'===_0x1cd623['class']?'':_0x1cd623['class']['replace']('\x20ck-tab-panel_disabled','');if(this['editor']['plugins']['has']('AIChat')){const _0x32232f=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x32232f&&_0x32232f['removeAttribute']('tabindex');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x576ce8=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x576ce8&&_0x576ce8['removeAttribute']('tabindex');}}return this['_viewerEditor']['plugins']['get']('RevisionViewer')['_cleanUp'](),_0x51606d(this['_viewerEditor'])['then'](()=>{if(this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),this['_viewerEditor']=null,this['editor']['plugins']['has']('Annotations')){const _0x15746e=this['editor']['plugins']['get']('Annotations');_0x15746e['refreshVisibility'](),_0x15746e['refreshPositioning']();}});});}['_showRevisionViewer'](_0x50a63c){const _0x156e20=this['editor']['config']['get']('revisionHistory.editorContainer'),_0x3fd983=this['editor']['config']['get']('revisionHistory.viewerContainer'),_0x292405=this['editor']['config']['get']('revisionHistory.viewerEditorElement');return ri['create'](_0x292405,_0x50a63c)['then'](_0x173066=>(_0x3fd983['style']['display']='block',_0x156e20['style']['display']='none',this['isRevisionViewerOpen']=!0x0,_0x173066));}['_closeRevisionViewer'](_0x103625){const _0x35aa95=this['editor']['config']['get']('revisionHistory.editorContainer');return this['editor']['config']['get']('revisionHistory.viewerContainer')['style']['display']='none',_0x35aa95['style']['display']='',this['isRevisionViewerOpen']=!0x1,_0x103625['destroy']();}async _restoreRevision(_0x3c09b7){const _0x4c1e29=this['editor'],_0x4603b2=this['_viewerEditor']['plugins']['get']('RevisionViewer'),_0x40c610=_0x4c1e29['plugins']['get']('RevisionTracker'),_0x2cfae1=_0x4c1e29['plugins']['get']('RevisionHistoryUtils'),_0x40bb40=_0x4603b2['repository']['getRevision'](_0x3c09b7);let _0x26aa57,_0x4e1002,_0x3d0d6e;try{await _0x2cfae1['loadRevisionData'](_0x40bb40,this['adapter']),_0x26aa57=_0x2cfae1['getRevisionDocumentData'](_0x40bb40),_0x4e1002=_0x2cfae1['getRevisionRootsAttributes'](_0x40bb40);}catch(_0x413ac2){return void console['error'](_0x413ac2);}_0x4c1e29['model']['change'](_0x518821=>{for(const _0x5b8b96 of Array['from'](_0x4c1e29['model']['markers']['getMarkersGroup']('restrictedEditingException')))_0x518821['removeMarker'](_0x5b8b96);}),_0x4603b2['isReady']=!0x1,_0x4c1e29['model']['enqueueChange'](_0x1a7d1e=>{_0x1a7d1e['setSelection'](null),_0x1a7d1e['removeSelectionAttribute'](_0x4c1e29['model']['document']['selection']['getAttributeKeys']());const _0x468309=Object['keys'](_0x26aa57);for(const _0x58e88e of _0x4c1e29['model']['document']['roots'])'$graveyard'!=_0x58e88e['rootName']&&_0x58e88e['isAttached']()&&!_0x468309['includes'](_0x58e88e['rootName'])&&_0x1a7d1e['detachRoot'](_0x58e88e);for(const _0x2e7c1b of _0x468309){let _0x958a9c=_0x4c1e29['model']['document']['getRoot'](_0x2e7c1b);if(!_0x958a9c||!_0x958a9c['isAttached']()){const _0x1417c2=_0x40bb40['diffData']?.[_0x2e7c1b]?.['rootElementName']||'$root';_0x958a9c=_0x1a7d1e['addRoot'](_0x2e7c1b,_0x1417c2);}const _0xec8ad4=_0x4e1002[_0x2e7c1b],_0x4b7399=Object['keys'](_0xec8ad4),_0x548e73=_0x26aa57[_0x2e7c1b];for(const _0x21c946 of _0x958a9c['getAttributeKeys']())_0x4b7399['includes'](_0x21c946)||_0x1a7d1e['removeAttribute'](_0x21c946,_0x958a9c);for(const _0x14c043 of _0x4b7399)_0x1a7d1e['setAttribute'](_0x14c043,_0x4e1002[_0x2e7c1b][_0x14c043],_0x958a9c);_0x1a7d1e['remove'](_0x1a7d1e['createRangeIn'](_0x958a9c)),_0x1a7d1e['insert'](_0x4c1e29['data']['parse'](_0x548e73,_0x958a9c),_0x958a9c,0x0);}});const _0x9ee743=kt(_0x4c1e29['locale'],'Restored');if(_0x40bb40['name'])_0x3d0d6e=-0x1==_0x40bb40['name']['indexOf'](_0x9ee743)?_0x9ee743+':\x20'+_0x40bb40['name']:_0x40bb40['name'];else _0x3d0d6e=_0x9ee743+':\x20'+(_0x40bb40['createdAt']['toLocaleDateString'](_0x4c1e29['locale']['uiLanguage'],{'month':'long','day':'numeric'})+',\x20'+_0x40bb40['createdAt']['toLocaleTimeString'](_0x4c1e29['locale']['uiLanguage'],{'hour':'numeric','minute':'numeric'}));return await _0x40c610['saveRevision']({'name':_0x3d0d6e}),_0x4603b2['isReady']=!0x0,_0x4c1e29['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}};export{Ft as RestoreRevisionCommand,yt as Revision,ci as RevisionHistory,Dt as RevisionHistoryUI,Rt as RevisionHistoryUtils,At as RevisionTracker,Pt as RevisionViewer,ri as RevisionViewerEditor,hi as RevisionViewerIntegration,Gt as RevisionViewerLoadingOverlay,Kt as RevisionViewerUI,bt as RevisionsRepository,ii as RevisionsSidebar,$t as ShowChangeCommand};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-revision-history",
3
- "version": "49.0.0-alpha.3",
3
+ "version": "49.0.0-alpha.4",
4
4
  "description": "Document revision history feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -34,15 +34,15 @@
34
34
  "./package.json": "./package.json"
35
35
  },
36
36
  "dependencies": {
37
- "@ckeditor/ckeditor5-autosave": "49.0.0-alpha.3",
38
- "@ckeditor/ckeditor5-collaboration-core": "49.0.0-alpha.3",
39
- "@ckeditor/ckeditor5-comments": "49.0.0-alpha.3",
40
- "@ckeditor/ckeditor5-core": "49.0.0-alpha.3",
41
- "@ckeditor/ckeditor5-engine": "49.0.0-alpha.3",
42
- "@ckeditor/ckeditor5-icons": "49.0.0-alpha.3",
43
- "@ckeditor/ckeditor5-ui": "49.0.0-alpha.3",
44
- "@ckeditor/ckeditor5-utils": "49.0.0-alpha.3",
45
- "@ckeditor/ckeditor5-widget": "49.0.0-alpha.3",
37
+ "@ckeditor/ckeditor5-autosave": "49.0.0-alpha.4",
38
+ "@ckeditor/ckeditor5-collaboration-core": "49.0.0-alpha.4",
39
+ "@ckeditor/ckeditor5-comments": "49.0.0-alpha.4",
40
+ "@ckeditor/ckeditor5-core": "49.0.0-alpha.4",
41
+ "@ckeditor/ckeditor5-engine": "49.0.0-alpha.4",
42
+ "@ckeditor/ckeditor5-icons": "49.0.0-alpha.4",
43
+ "@ckeditor/ckeditor5-ui": "49.0.0-alpha.4",
44
+ "@ckeditor/ckeditor5-utils": "49.0.0-alpha.4",
45
+ "@ckeditor/ckeditor5-widget": "49.0.0-alpha.4",
46
46
  "@types/luxon": "3.6.2",
47
47
  "es-toolkit": "1.52.0",
48
48
  "luxon": "3.6.1"