@ckeditor/ckeditor5-revision-history
Version:
Document revision history feature for CKEditor 5.
24 lines • 162 kB
JavaScript
/*
* Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
*
*
*
*
* +---------------------------------------------------------------------------------+
* | |
* | Hello stranger! |
* | |
* | |
* | What you're currently looking at is the source code of a legally protected, |
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
* | are forbidden and will result in legal consequences. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
import{CKEditorError as _0x16b9f2,Collection as _0xe1aaa7,ElementReplacer as _0x3c5642,FocusTracker as _0x8acf98,KeystrokeHandler as _0x142511,ObservableMixin as _0x3c8f7b,ResizeObserver as _0x33c34e,logWarning as _0x5bea80,scrollViewportToShowTarget as _0x5b653f,uid as _0x551659}from'@ckeditor/ckeditor5-utils';import{cloneDeep as _0x28481c,isEqual as _0x5a02ed,set as _0x4ce8c3,unset as _0x4bb046}from'es-toolkit/compat';import{Command as _0xe8c052,Editor as _0x354082,ElementApiMixin as _0xbf5d60,PendingActions as _0x5ec6e7,Plugin as _0x592ef7}from'@ckeditor/ckeditor5-core';import{ConfirmMixin as _0x54da09,Users as _0x20176c,getMarkerDomElement as _0x358092,sanitizeEditorConfig as _0x1292c3}from'@ckeditor/ckeditor5-collaboration-core';import{ModelDocumentFragment as _0x2136fb,ModelElement as _0x5ebea3,ModelPosition as _0x2779d2,ModelRange as _0x830771,ModelText as _0x26fa72,ViewAttributeElement as _0x4a7a04,ViewContainerElement as _0x510376,ViewDocumentFragment as _0xf18515,ViewElement as _0x474ff1,ViewEmptyElement as _0xdb2f8d,ViewRawElement as _0xbeeaa5,ViewText as _0xb883c0,ViewUIElement as _0x796ee2}from'@ckeditor/ckeditor5-engine';import{IconChevronDown as _0x445035,IconChevronUp as _0x20110a,IconHistory as _0x5fc2b3,IconThreeVerticalDots as _0xff9c52,IconUndo as _0x53d4c9,IconUser as _0x320df2}from'@ckeditor/ckeditor5-icons';import{BoxedEditorUIView as _0x21ca49,ButtonView as _0x5ab628,ContextualBalloon as _0x3e4519,CssTransitionDisablerMixin as _0x735ba7,EditorUI as _0x3a737f,IconView as _0x52ff68,InlineEditableUIView as _0x27b5d1,LabeledFieldView as _0x1a4e29,ListItemView as _0x3ab91f,ListView as _0x37c124,MenuBarMenuListItemButtonView as _0x5b83fc,MenuBarMenuListItemView as tt,MenuBarMenuListView as it,MenuBarMenuView as et,StickyPanelView as st,ToolbarSeparatorView as nt,ToolbarView as ot,UIModel as rt,View as at,addListToDropdown as ht,createDropdown as ct,createLabeledInputText as lt,normalizeToolbarConfig as ut,submitHandler as dt}from'@ckeditor/ckeditor5-ui';import{DateTime as ft}from'luxon';const vt=/* #__PURE__ -- @preserve */
_0x3c8f7b();var gt=class extends vt{['id'];['creator'];['authors'];['diffData'];['toVersion'];['fromVersion'];['model'];constructor(_0x480cd2){super(),this['id']=_0x480cd2['id']||_0x551659(),this['creator']=_0x480cd2['creator']||null,this['authors']=_0x480cd2['authors']||[],this['diffData']=_0x480cd2['diffData']||null,this['toVersion']=_0x480cd2['toVersion']||0x0,this['fromVersion']=_0x480cd2['fromVersion']||0x0,this['set']('name',_0x480cd2['name']||''),this['set']('createdAt',_0x480cd2['createdAt']||new Date()),this['set']('attributes',_0x480cd2['attributes']||{});}['setName'](_0x1ece2d){this['_update']({'name':_0x1ece2d});}['setAttribute'](_0x41ea21,_0x3c16a8){const _0x17661c=_0x28481c(this['attributes']);_0x4ce8c3(_0x17661c,_0x41ea21,_0x3c16a8),this['_update']({'attributes':_0x17661c});}['removeAttribute'](_0x5db762){const _0x247f1c=_0x28481c(this['attributes']);_0x4bb046(_0x247f1c,_0x5db762),this['_update']({'attributes':_0x247f1c});}['_update'](_0xbdcd2f,_0x43d92f=!0x1){let _0x160a52=!0x1;const _0x1d268a={'id':this['id']};for(const _0x1a16f2 of['name','createdAt','diffData','authors','attributes','toVersion','fromVersion','creatorId']){const _0x1c0ad4=_0xbdcd2f[_0x1a16f2];void 0x0!==_0x1c0ad4&&_0x1c0ad4!==this[_0x1a16f2]&&(this[_0x1a16f2]=_0x1c0ad4,_0x1d268a[_0x1a16f2]=_0x1c0ad4,_0x160a52=!0x0);}_0x160a52&&(_0x1d268a['authors']&&(_0x1d268a['authorsIds']=_0x1d268a['authors']['map'](_0x2b3147=>_0x2b3147['id']),delete _0x1d268a['authors']),this['fire']('_update',_0x1d268a,_0x43d92f));}['toJSON'](){return{'id':this['id'],'name':this['name'],'creatorId':this['creator']?this['creator']['id']:null,'authorsIds':this['authors']['map'](_0x19706f=>_0x19706f['id']),'diffData':this['diffData'],'createdAt':this['createdAt'],'attributes':this['attributes'],'fromVersion':this['fromVersion'],'toVersion':this['toVersion']};}},mt=class extends _0x592ef7{['_revisions'];static get['requires'](){return[_0x20176c];}static get['pluginName'](){return'RevisionsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['length'](){return this['_revisions']['length'];}constructor(_0x48782e){super(_0x48782e),this['_revisions']=new _0xe1aaa7();}['afterInit'](){!async function(_0x5138de){const _0x5ab9d8='vsmL4TPpuR53MlqSj2VXwH9oEAN8FxJtGUOdbDCZ01ihyfkBQY6acgz7rIeWKn',_0x27c358=0xeb829,_0x2606b5=0x78e88,_0x4aac75=window['Date']['now'](),_0xafa962=_0x5138de['editor'],_0x1c4e99=new window['Promise'](_0x4075b1=>{_0xafa962['once']('ready',_0x4075b1);}),_0x2012dd={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x4979da=_0xafa962['config']['get']('licenseKey');async function _0x239eb3(){let _0x4dd921,_0x5b0df8=null,_0xed885c=null;try{return'GPL'==_0x4979da?'NotAllowed':(_0x4dd921=_0x4f95c9(),_0x4dd921?(_0x4dd921['usageEndpoint']&&(_0xed885c=_0xe25b44(_0x4dd921['usageEndpoint'],_0x4dd921['jti'])),await _0xafd3ac()?_0x435b6e()?_0x50f64d()?'Expired':_0x4722e2()?('evaluation'==_0x4dd921['licenseType']&&(_0x5b0df8=_0x1e0821('EvaluationLimit')),await _0x5e39c7()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x50f64d(){const _0x47e046=['evaluation','trial']['includes'](_0x4dd921['licenseType'])?_0x4aac75/0x3e8:0xe10*_0x2606b5;return _0x4dd921['exp']<_0x47e046;}function _0x435b6e(){const _0x157c3f=_0x4dd921['features'];if(!_0x157c3f)return!0x1;if(_0x157c3f['includes']('*'))return!0x0;if(_0x157c3f['includes']('RH'))return!0x0;if(_0x157c3f['includes']('RRH')){if(_0x5337d1())return!0x0;if(_0x360213()||_0x5b55ff())return!0x0;}return!0x1;}function _0x4722e2(){const _0x2d0955=_0x4dd921['licensedHosts'];if(!_0x2d0955||0x0==_0x2d0955['length'])return!0x0;const {hostname:_0xf92e75}=new URL(window['location']['href']);if(_0x2d0955['includes'](_0xf92e75))return!0x0;const _0x10a163=_0xf92e75['split']('.');return _0x2d0955['filter'](_0x2b7f15=>_0x2b7f15['includes']('*'))['map'](_0x4091dd=>_0x4091dd['split']('.'))['filter'](_0x5df8aa=>_0x5df8aa['length']<=_0x10a163['length'])['map'](_0x1a3de9=>Array(_0x10a163['length']-_0x1a3de9['length'])['fill']('*'===_0x1a3de9[0x0]?'*':'')['concat'](_0x1a3de9))['some'](_0x13072c=>_0x10a163['every']((_0xdba86d,_0x21bdd6)=>_0x13072c[_0x21bdd6]===_0xdba86d||'*'===_0x13072c[_0x21bdd6]));}function _0x5e39c7(){return _0x5b0df8&&_0xed885c?new window['Promise']((_0x149547,_0x1ca553)=>{_0x5b0df8['then'](_0x149547,_0x1ca553),_0xed885c['then'](_0x284025=>{'Valid'!=_0x284025&&_0x149547(_0x284025);},_0x1ca553);}):_0x5b0df8||_0xed885c||'Valid';}}function _0xe25b44(_0x2207b9,_0x364b48){return new window['Promise'](_0x154d6b=>{if(_0x599dc9())return _0x154d6b('Valid');_0xe1317e(),_0xafa962['decorate']('_sendUsageRequest');let _0x3a29bd=!0x1;const _0x4d9b7d=_0x551659();function _0x377c85(_0x227d38){return!!_0x227d38&&('object'==typeof _0x227d38||'function'==typeof _0x227d38)&&'function'==typeof _0x227d38['then']&&'function'==typeof _0x227d38['catch'];}function _0x365b21(_0x44c551){_0x31ec17(_0x44c551)['then'](_0x1bf375=>_0x1bf375&&'ok'==_0x1bf375['status']?_0x5630fd(_0x207ab0(_0x4d9b7d+_0x364b48))!=_0x1bf375['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x758a2=>(_0x42bf65(),_0x758a2),()=>{const _0x29ebe8=_0x25ed2a();return null==_0x29ebe8?(_0x42bf65(),'Valid'):_0x4aac75-_0x29ebe8>0x240c8400?'UsageLimit':'Valid';})['then'](_0x154d6b)['catch'](()=>{_0x154d6b('UsageLimit');});const _0x1cab2b=0x36ee80;function _0x42bf65(){const _0x4671ab='llct-'+_0x5630fd(_0x207ab0(_0x2207b9)),_0x51c907=_0x21269c(_0x5630fd(window['Math']['ceil'](_0x4aac75/_0x1cab2b)));window['localStorage']['setItem'](_0x4671ab,_0x51c907);}function _0x25ed2a(){const _0x312b7e='llct-'+_0x5630fd(_0x207ab0(_0x2207b9)),_0x152fdc=window['localStorage']['getItem'](_0x312b7e);return _0x152fdc?window['parseInt'](_0x21269c(_0x152fdc),0x10)*_0x1cab2b:null;}function _0x31ec17(_0x5204c){return new window['Promise']((_0x42f8df,_0x12e805)=>{_0x5204c['then'](_0x42f8df,_0x12e805),window['setTimeout'](_0x12e805,0x1d4c0);});}}_0xafa962['on']('_sendUsageRequest',(_0x49bba5,_0x58bdf5)=>{if(_0x58bdf5[0x0]!=_0x2207b9)return _0x154d6b('UsageLimit');_0x58bdf5[0x1]={..._0x58bdf5[0x1],'requestId':_0x4d9b7d};},{'priority':'high'}),_0xafa962['on']('_sendUsageRequest',_0x512eec=>{_0x377c85(_0x512eec['return'])&&(_0x3a29bd=!0x0,_0x365b21(_0x512eec['return']));},{'priority':'low'}),_0x1c4e99['then'](()=>{_0x3a29bd||_0x154d6b('UsageLimit');});});function _0x599dc9(){return'auto'==_0xafa962['editing']['view']['_overlayModeHint'];}function _0xe1317e(){_0xafa962['editing']['view']['_overlayModeHint']='auto';}}function _0x1e0821(_0x192a2b){const _0xf127c=[new window['Promise'](_0x30b434=>setTimeout(_0x30b434,0x93ecc)),_0x1c4e99['then'](()=>new window['Promise'](_0x5078d2=>{const _0xfe9de=0x7,_0x2fada0=_0x5138de['_revisions'];function _0x266096(){_0x2fada0['length']>=_0xfe9de&&_0x5078d2();}_0x266096(),_0x2fada0['on']('add',_0x266096);})),new window['Promise'](_0x510807=>{function _0x193f89(){for(const _0xbd76a1 in window)if(window['Number']['isNaN'](window['Number'](_0xbd76a1))&&window[_0xbd76a1]==_0x27c358)return _0x510807();'destroyed'!=_0xafa962['state']&&window['setTimeout'](_0x193f89,0x1388);}_0x18d230('RevisionViewer')&&_0x193f89();})];return window['Promise']['race'](_0xf127c)['then'](()=>_0x192a2b);}async function _0xd3d94a(){if(await _0x1c4e99,_0x18d230('RevisionViewer')){const _0x48049d=_0x5138de['getRevision'](0x0),_0x26f9ea=_0x5138de['getEarlierVisibleRevision'](_0x48049d['id']),_0x1e69a1=_0x5a91cb('RevisionViewer');return await _0x1e69a1['compare'](_0x48049d['id'],_0x26f9ea?_0x26f9ea['id']:null,!0x0),_0x1e69a1['unbind']('isEnabled'),_0x1e69a1['isEnabled']=!0x1,_0x1e69a1['compare']=_0x270320,void(_0x1e69a1['_getDiff']=_0x270320);}if(_0x18d230('RevisionTracker')){const _0xadd4e7=_0x5a91cb('RevisionTracker');_0xadd4e7['unbind']('isEnabled'),_0xadd4e7['isEnabled']=!0x1,_0xadd4e7['update']=_0x270320,_0xadd4e7['saveRevision']=_0x270320;}_0xafa962['model']['change']=_0x270320,_0xafa962['model']['enqueueChange']=_0x270320,_0xafa962['enableReadOnlyMode']('model');}function _0x5337d1(){return _0x18d230('WebSocketGateway')&&'connected'==_0x5a91cb('WebSocketGateway')['state'];}function _0x360213(){return _0x18d230('RevisionViewerIntegration');}function _0x5b55ff(){return _0x18d230('TrackChangesDataGetter');}function _0x37c008(_0xb6b714){const _0x44d200=_0x116920();_0xafa962[_0x44d200]='revisionHistoryLicenseKey'+_0xb6b714,_0xb6b714['endsWith']('Limit')&&(window[_0x116920()]=_0x27c358),'Valid'!=_0xb6b714&&_0xd3d94a();}function _0x116920(){const _0x4ae3e3=window['String'](window['performance']['now']())['replace']('.','');let _0x4b33f9='v';for(let _0x50a8c4=0x0;_0x50a8c4<_0x4ae3e3['length'];_0x50a8c4+=0x2){let _0x254ba1=window['parseInt'](_0x4ae3e3['substring'](_0x50a8c4,_0x50a8c4+0x2));_0x254ba1>=0x3e&&(_0x254ba1-=0x3e),_0x4b33f9+=_0x5ab9d8[_0x254ba1];}return _0x4b33f9;}function _0x4f95c9(){const _0x4e045f=_0x4979da['split']('.');if(0x3!=_0x4e045f['length'])return null;return _0x517ee7(_0x4e045f[0x1]);function _0x517ee7(_0x2b4329){const _0x4cc1b1=_0x3127bf(_0x2b4329);return _0x4cc1b1&&_0x15b4b8()?_0x4cc1b1:null;function _0x15b4b8(){const _0x1bb1fb=_0x4cc1b1['jti'],_0x1fc126=window['parseInt'](_0x1bb1fb['substring'](_0x1bb1fb['length']-0x8),0x10),_0x4b682a={..._0x4cc1b1,'jti':_0x1bb1fb['substring'](0x0,_0x1bb1fb['length']-0x8)};return delete _0x4b682a['vc'],_0x207ab0(_0x4b682a)==_0x1fc126;}}}async function _0xafd3ac(){let _0x5c9378=!0x0;try{const [_0x48badf,_0x4b77f9,_0xab3393]=_0x4979da['split']('.');return _0x437989(_0x48badf),await _0x574003(_0x48badf,_0x4b77f9,_0xab3393),_0x5c9378;}catch{return!0x1;}function _0x437989(_0x54c66d){const _0x4f7249=_0x3127bf(_0x54c66d);_0x4f7249&&'ES256'==_0x4f7249['alg']||(_0x5c9378=!0x1);}async function _0x574003(_0x135f4c,_0x4893b5,_0x41add3){const _0x30462b=window['Uint8Array']['from'](_0x1badaf(_0x41add3),_0x1e9ffa=>_0x1e9ffa['charCodeAt'](0x0)),_0x1044aa=new window['TextEncoder']()['encode'](_0x135f4c+'.'+_0x4893b5),_0x2391fa=window['crypto']['subtle'];if(!_0x2391fa)return;const _0x35f299=await _0x2391fa['importKey']('jwk',_0x2012dd,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x2391fa['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x35f299,_0x30462b,_0x1044aa)||(_0x5c9378=!0x1);}}function _0x3127bf(_0x1fd9f1){return _0x1fd9f1['startsWith']('ey')?JSON['parse'](_0x1badaf(_0x1fd9f1)):null;}function _0x1badaf(_0x24b490){return window['atob'](_0x24b490['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x207ab0(_0xba12cb){let _0x2b5541=0x1505;function _0x5e731b(_0x2561e5){for(let _0x3bddbc=0x0;_0x3bddbc<_0x2561e5['length'];_0x3bddbc++){const _0x23188b=_0x2561e5['charCodeAt'](_0x3bddbc);_0x2b5541=(_0x2b5541<<0x5)+_0x2b5541+_0x23188b,_0x2b5541&=_0x2b5541;}}function _0x125a00(_0xc9fbb2){Array['isArray'](_0xc9fbb2)?_0xc9fbb2['forEach'](_0x125a00):_0xc9fbb2&&'object'==typeof _0xc9fbb2?Object['entries'](_0xc9fbb2)['sort']()['forEach'](([_0x3c6b4d,_0x1c8c4b])=>{_0x5e731b(_0x3c6b4d),_0x125a00(_0x1c8c4b);}):_0x5e731b(window['String'](_0xc9fbb2));}return _0x125a00(_0xba12cb),_0x2b5541>>>0x0;}function _0x5630fd(_0x147aa5){return _0x147aa5['toString'](0x10)['padStart'](0x8,'0');}function _0x21269c(_0x1fd517){return _0x1fd517['split']('')['reverse']()['join']('');}function _0x18d230(_0x26b1db){return _0xafa962['plugins']['has'](_0x26b1db);}function _0x5a91cb(_0x23f5a8){return _0xafa962['plugins']['get'](_0x23f5a8);}function _0x270320(){}_0x37c008(await _0x239eb3());}(this);}['createRevision'](_0xd1e31b){const _0x13b4b7=this['editor']['plugins']['get']('Users');return new gt({'id':_0xd1e31b['id'],'name':_0xd1e31b['name'],'creator':_0xd1e31b['creatorId']?_0x13b4b7['getUser'](_0xd1e31b['creatorId']):null,'diffData':_0xd1e31b['diffData']||_0xd1e31b['data'],'authors':_0xd1e31b['authorsIds']['map'](_0x1550fa=>_0x13b4b7['getUser'](_0x1550fa)),'createdAt':new Date(_0xd1e31b['createdAt']),'attributes':_0xd1e31b['attributes'],'fromVersion':_0xd1e31b['fromVersion'],'toVersion':_0xd1e31b['toVersion']});}['addRevision'](_0x490c91,_0x1fcab7=0x0){this['_revisions']['add'](_0x490c91,_0x1fcab7);}['getRevision'](_0x3b65d1){return this['_revisions']['get'](_0x3b65d1);}['getRevisions'](_0x3f189f={'toJSON':!0x1}){const _0x512f1b=Array['from'](this['_revisions']);return _0x512f1b['reverse'](),_0x3f189f['toJSON']?_0x512f1b['map'](_0x4840cd=>_0x4840cd['toJSON']()):_0x512f1b;}['getIndex'](_0x116b5c){return this['_revisions']['getIndex'](_0x116b5c);}['getEarlierVisibleRevision'](_0x30de49){const [,_0x478cd6]=this['getRevisionsIterator'](_0x30de49,{'direction':'earlier'});return _0x478cd6;}['getLaterVisibleRevision'](_0x167198){const [,_0x1a5040]=this['getRevisionsIterator'](_0x167198,{'direction':'later'});return _0x1a5040;}['getRevisionsInDiff'](_0x10cfe9){const _0xe861ae=[];for(const _0x57f215 of this['getRevisionsIterator'](_0x10cfe9['newRevisionId']))if(_0xe861ae['push'](_0x57f215),_0x57f215['id']===_0x10cfe9['oldRevisionId'])break;return _0xe861ae;}*['getRevisionsIterator'](_0x4ef927,{direction:_0x37359c='earlier',filter:_0x4b3e9a=()=>!0x0}={}){const _0x5a42c1='earlier'===_0x37359c?0x1:-0x1;let _0x188587=this['_revisions']['get'](_0x4ef927),_0xb1898=this['getIndex'](_0x188587);for(yield _0x188587;_0x188587;){if(_0xb1898+=_0x5a42c1,_0x188587=this['getRevision'](_0xb1898),!_0x188587)return;_0x4b3e9a(_0x188587)&&(yield _0x188587);}}},wt=class extends _0x592ef7{static get['pluginName'](){return'RevisionHistoryUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_viewClassToTypeChar']=new Map([[_0x510376,'c'],[_0x4a7a04,'a'],[_0xdb2f8d,'e'],[_0xbeeaa5,'r'],[_0x796ee2,'u']]);['_typeCharToViewClass']=new Map([['c',_0x510376],['a',_0x4a7a04],['e',_0xdb2f8d],['r',_0xbeeaa5],['u',_0x796ee2]]);async['loadRevisionData'](_0x1a3e55,_0x30f6a9){if(_0x1a3e55['diffData']||!_0x30f6a9)return;const _0x2d457f=this['editor']['config']['get']('collaboration.channelId');_0x1a3e55['diffData']=(await _0x30f6a9['getRevision']({'channelId':_0x2d457f,'revisionId':_0x1a3e55['id']}))['diffData'];}['getRevisionDocumentData'](_0x14a4db){const _0x34ceed={};for(const _0x80ab59 in _0x14a4db['diffData']){if(_0x14a4db['diffData'][_0x80ab59]['attachChange']&&!_0x14a4db['diffData'][_0x80ab59]['attachChange']['isAttached'])continue;const _0x11796d=this['_removeRevisionMarkers'](JSON['parse'](_0x14a4db['diffData'][_0x80ab59]['insertions'])),_0x166332=this['editor']['editing']['view']['document'],_0x252d8b=new _0xf18515(_0x166332,_0x11796d['map'](_0x747c5b=>this['_getViewFromDiffObj'](_0x747c5b,!0x1)));this['editor']['data']['processor']['useFillerType']('marked'),_0x34ceed[_0x80ab59]=this['editor']['data']['processor']['toData'](_0x252d8b),this['editor']['data']['processor']['useFillerType']('default');}return _0x34ceed;}['getRevisionRootsAttributes'](_0x5b97dc){const _0xbc53c7={};for(const _0x571a62 in _0x5b97dc['diffData'])_0x5b97dc['diffData'][_0x571a62]['attachChange']&&!_0x5b97dc['diffData'][_0x571a62]['attachChange']['isAttached']||(_0xbc53c7[_0x571a62]=_0x5b97dc['diffData'][_0x571a62]['attributesAfter']||{});return _0xbc53c7;}['getRevisionRootsModelElements'](_0x4feaec){const _0x5a2692={};for(const _0x156579 in _0x4feaec['diffData']){if(_0x4feaec['diffData'][_0x156579]['attachChange']&&!_0x4feaec['diffData'][_0x156579]['attachChange']['isAttached'])continue;const _0x21de39=_0x4feaec['diffData'][_0x156579]['rootElementName'];_0x21de39&&(_0x5a2692[_0x156579]=_0x21de39);}return _0x5a2692;}['_getTypeCharForViewElement'](_0x1b316d){return this['_viewClassToTypeChar']['get'](_0x1b316d['constructor']);}['_getViewFromDiffObj'](_0x2bf8c2,_0x240d1d){const _0x38fab9=this['editor']['editing']['view']['document'];if('string'==typeof _0x2bf8c2)return new _0xb883c0(_0x38fab9,_0x2bf8c2);{let _0x56248b,_0x51609a;_0x51609a='u'==_0x2bf8c2['type']||'r'==_0x2bf8c2['type']?[]:_0x2bf8c2['children']['map'](_0xa4e087=>this['_getViewFromDiffObj'](_0xa4e087,_0x240d1d));const _0x428362=this['_typeCharToViewClass']['get'](_0x2bf8c2['type'])||_0x474ff1,_0x220435=this['editor']['data']['htmlProcessor']['domConverter'];if(_0x56248b=new _0x428362(_0x38fab9,_0x2bf8c2['name'],_0x2bf8c2['attributes'],_0x51609a),'u'==_0x2bf8c2['type']&&_0x2bf8c2['children'][0x0]){const _0x12b39c=_0x2bf8c2['children'][0x0];if(_0x56248b['render']=function(_0x205900){const _0x4dc9fb=_0x205900['createElement']('div');return _0x4dc9fb['innerHTML']=_0x12b39c,_0x4dc9fb['childNodes'][0x0];},_0x240d1d){const _0x9aa0db=new _0xf18515(_0x38fab9);_0x9aa0db['_appendChild'](_0x56248b);const _0x45af94=Array['from'](_0x220435['viewChildrenToDom'](_0x9aa0db,{'bind':!0x1})),_0x545136=_0x220435['domDocument']['createElement']('div');_0x545136['append'](..._0x45af94),_0x56248b=Array['from'](_0x220435['domChildrenToView'](_0x545136))[0x0];}}else{if('r'==_0x2bf8c2['type']&&_0x2bf8c2['children'][0x0]){const _0x1785bf=_0x2bf8c2['children'][0x0];if(_0x56248b['render']=function(_0x3b9865){_0x3b9865['innerHTML']=_0x1785bf;},_0x240d1d){const _0x13c4ad=new _0xf18515(_0x38fab9);_0x13c4ad['_appendChild'](_0x56248b);const _0xac7cc7=Array['from'](_0x220435['viewChildrenToDom'](_0x13c4ad,{'bind':!0x1})),_0x3be223=_0x220435['domDocument']['createElement']('div');_0x3be223['append'](..._0xac7cc7);const _0x274600=Array['from'](_0x220435['domChildrenToView'](_0x3be223));_0x274600['length']>0x1?_0x56248b['_appendChild'](_0x274600):_0x56248b=_0x274600[0x0];}}}if(_0x2bf8c2['customProperties']){for(const [_0xd7a26f,_0x3deaae]of _0x2bf8c2['customProperties'])_0x56248b['_setCustomProperty'](_0xd7a26f,_0x3deaae);}const _0xa01d57=void 0x0===_0x2bf8c2['fillerOffset']?null:_0x2bf8c2['fillerOffset'];return null!==_0xa01d57&&(_0x56248b['getFillerOffset']=()=>_0xa01d57),_0x56248b;}}['_makeModelFromViewString'](_0x533ff0,_0x519e78){const _0x427a55=JSON['parse'](_0x533ff0),_0x26079d=this['editor']['editing']['view']['document'],_0x30c0d0=new _0xf18515(_0x26079d,_0x427a55['map'](_0x35f8cf=>this['_getViewFromDiffObj'](_0x35f8cf,!0x0))),_0x4fa88d=this['editor']['data']['toModel'](_0x30c0d0,_0x519e78);return _0x4fa88d['name']=_0x519e78,_0x4fa88d;}['_removeRevisionMarkers'](_0x2fd75a){return(_0x2fd75a=_0x2fd75a['filter'](_0x180a50=>!_0x180a50['name']||'revision-start'!==_0x180a50['name']&&'revision-end'!==_0x180a50['name']))['forEach'](_0x3f278d=>{'string'!=typeof _0x3f278d&&(_0x3f278d['children']=this['_removeRevisionMarkers'](_0x3f278d['children']),_0x3f278d['attributes']=_0x3f278d['attributes']['filter'](_0xb5b406=>!_0xb5b406[0x0]['startsWith']('data-revision-')));}),_0x2fd75a;}};function pt(_0x792c52,_0x16dad9,_0x2072d4){const t=_0x792c52['t'];switch(_0x16dad9){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'},_0x2072d4);case'X_OF_Y_CHANGES':return t({'string':'%0\x20of\x20%1','id':'X_OF_Y_CHANGES'},_0x2072d4);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');default:return'';}}var _t=class extends _0x592ef7{['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[_0x20176c,mt,wt,_0x5ec6e7];}constructor(_0x512618){super(_0x512618),this['repository']=this['editor']['plugins']['get']('RevisionsRepository'),this['_utils']=this['editor']['plugins']['get']('RevisionHistoryUtils'),this['_revisionDataBuilder']=new yt(this['editor']),this['_initialRevisionId']=this['editor']['config']['get']('collaboration.channelId')||'initial',this['_bufferedUpdates']=new Map(),this['_loadedStateData']=null;const _0x208512=_0x551659();this['_source']={'history':this['editor']['model']['document']['history'],'getLatestVersion':()=>Promise['resolve'](this['editor']['model']['document']['version']),'getCurrentRevisionId':()=>_0x208512},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 _0x266481=this['repository']['getRevision'](0x0),_0x5d67b5=_0x266481&&null===_0x266481['creator']?_0x266481:null;if(this['_continueCurrentRevision']=!!_0x5d67b5&&this['editor']['config']['get']('revisionHistory.resumeUnsavedRevision'),this['editor']['plugins']['has']('RealTimeCollaborationClient')){const _0x521601=this['_source']['getCurrentRevisionId'](),_0x3b3ff7=this['repository']['getRevision'](_0x521601);if(_0x3b3ff7)this['_startingVersion']=_0x3b3ff7['fromVersion'],this['_continueCurrentRevision']=!0x1;else{const _0x22a864=this['_source']['history']['_operations']['find'](_0x215f6e=>!_0x215f6e['_isInit']),_0x52d6b9=_0x22a864?_0x22a864['baseVersion']:this['_source']['history']['version'];_0x266481?(_0x266481['toVersion']<_0x52d6b9&&_0x266481['_update']({'toVersion':_0x52d6b9}),this['_continueCurrentRevision']?(this['_source']['getCurrentRevisionId']=()=>_0x5d67b5['id'],this['_startingVersion']=_0x5d67b5['fromVersion']):(this['_startingVersion']=_0x266481['toVersion'],this['_continueCurrentRevision']=!0x1)):(this['_startingVersion']=_0x52d6b9,this['_continueCurrentRevision']=!0x1);}}else _0x5d67b5&&(this['editor']['model']['document']['history']['version']=Math['max'](_0x5d67b5['toVersion'],this['editor']['model']['document']['history']['version']),_0x5d67b5['fromVersion']===_0x5d67b5['toVersion']?(0x0!==_0x5d67b5['fromVersion']&&(this['_source']['getCurrentRevisionId']=()=>_0x5d67b5['id']),this['_continueCurrentRevision']=!0x1):this['_continueCurrentRevision']&&(this['_source']['getCurrentRevisionId']=()=>_0x5d67b5['id'],this['_startingVersion']=_0x5d67b5['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',_0xed9968=>!_0xed9968),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x115a85=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x4b58a5;for(const _0x3b29cb in _0x115a85){const _0x29300e=_0x3b29cb,_0x2e7f2b=_0x115a85[_0x29300e];if('revisionHistoryLicenseKeyValid'==_0x2e7f2b||'revisionHistoryLicenseKeyInvalid'==_0x2e7f2b||'revisionHistoryLicenseKeyExpired'==_0x2e7f2b||'revisionHistoryLicenseKeyDomainLimit'==_0x2e7f2b||'revisionHistoryLicenseKeyNotAllowed'==_0x2e7f2b||'revisionHistoryLicenseKeyEvaluationLimit'==_0x2e7f2b||'revisionHistoryLicenseKeyUsageLimit'==_0x2e7f2b){delete _0x115a85[_0x29300e],_0x4b58a5=_0x2e7f2b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'revisionHistoryLicenseKeyInvalid'==_0x4b58a5&&_0x115a85['_showLicenseError']('invalid'),'revisionHistoryLicenseKeyExpired'==_0x4b58a5&&_0x115a85['_showLicenseError']('expired'),'revisionHistoryLicenseKeyDomainLimit'==_0x4b58a5&&_0x115a85['_showLicenseError']('domainLimit'),'revisionHistoryLicenseKeyNotAllowed'==_0x4b58a5&&_0x115a85['_showLicenseError']('featureNotAllowed','RevisionHistory'),'revisionHistoryLicenseKeyEvaluationLimit'==_0x4b58a5&&_0x115a85['_showLicenseError']('evaluationLimit'),'revisionHistoryLicenseKeyUsageLimit'==_0x4b58a5&&_0x115a85['_showLicenseError']('usageLimit');},0x3e8);}async['afterInit'](){if(this['repository']['length']>0x0){const _0x41c297=this['repository']['getRevision'](0x0),_0x237cee=await this['getRevisionDocumentData'](_0x41c297),_0x593cf4=await this['getRevisionRootsAttributes'](_0x41c297),_0x1c2a13=this['_utils']['getRevisionRootsModelElements'](_0x41c297);this['_replaceEditorDataWithRevisionData'](_0x237cee,_0x593cf4,_0x1c2a13);}}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['setSource'](_0x17ee4b){this['_source']=_0x17ee4b;}async['update'](){const _0x1ed0c9=await this['_source']['getLatestVersion']();if(_0x1ed0c9>this['currentRevision']['toVersion']){await this['_loadState']();const _0x7bd263=this['buildRevisionData']({'revision':this['currentRevision'],'to':_0x1ed0c9});_0x7bd263['authors']=_0x7bd263['authorsIds']['map'](_0xefe28a=>this['editor']['plugins']['get']('Users')['getUser'](_0xefe28a)),this['currentRevision']['_update'](_0x7bd263);}}async['saveRevision'](_0x5d0606={},_0x2be6a7=null){const _0x11b74b=[];await this['_loadState'](),this['_continueCurrentRevision']=!0x1,_0x2be6a7>this['currentRevision']['toVersion']&&(_0x2be6a7=null),null===_0x2be6a7&&(_0x2be6a7=await this['_source']['getLatestVersion']());const _0x698a1c=this['_getFromVersion'](_0x2be6a7),_0x4aa778=this['buildRevisionData']({'from':_0x698a1c,'to':_0x2be6a7});if(this['currentRevision']['toVersion']<_0x2be6a7){const _0x4431b1=this['buildRevisionData']({'revision':this['currentRevision'],'from':_0x2be6a7,'to':_0x2be6a7});_0x4431b1['authors']=[],_0x4431b1['authorsIds']=[],_0x4431b1['id']=this['currentRevision']['id'],this['currentRevision']['_update'](_0x4431b1,!0x0),delete _0x4431b1['authors'],_0x11b74b['push'](_0x4431b1);}_0x5d0606['creatorId']=this['editor']['plugins']['get']('Users')['me']['id'],_0x5d0606['name']=_0x5d0606['name']||null,_0x5d0606['id']=_0x5d0606['id']||_0x551659(),_0x5d0606={..._0x5d0606,..._0x4aa778};const _0x440277=this['addRevisionData'](_0x5d0606);_0x11b74b['push'](_0x5d0606);const _0x2eddfa=this['repository']['getIndex'](_0x440277);if(0x0!==_0x2eddfa){const _0x164956=this['repository']['getRevision'](_0x2eddfa-0x1);if(_0x164956['fromVersion']!==_0x2be6a7){const _0x3cdd29=this['_revisionDataBuilder']['getData'](_0x2be6a7,_0x164956['toVersion']),_0x3c7304={'id':_0x164956['id'],'diffData':_0x3cdd29['diffData'],'authorsIds':_0x3cdd29['authorsIds'],'authors':_0x3cdd29['authorsIds']['map'](_0x3c134a=>this['editor']['plugins']['get']('Users')['getUser'](_0x3c134a)),'fromVersion':_0x2be6a7};_0x164956===this['currentRevision']&&(_0x3c7304['createdAt']=new Date(_0x5d0606['createdAt']['getTime']()+0xa)),_0x164956['_update'](_0x3c7304,!0x0),delete _0x3c7304['authors'],_0x11b74b['push'](_0x3c7304);}}if(this['adapter']){for(const _0x4ae784 of _0x11b74b)this['_bufferUpdate'](_0x4ae784['id'],_0x4ae784,!0x0);this['sendBufferedUpdates']();}return _0x440277;}['addRevisionData'](_0x2ca9c6){const _0x6026d6=this['repository']['createRevision'](_0x2ca9c6);return this['adapter']&&_0x6026d6['on']('_update',(_0x4ca9f6,_0x55afec,_0x165df7)=>{_0x165df7||(this['_bufferUpdate'](_0x55afec['id'],_0x55afec,!0x0),this['sendBufferedUpdates']());}),this['repository']['addRevision'](_0x6026d6,this['_findInsertionIndex'](_0x6026d6)),_0x6026d6;}async['getRevisionDocumentData'](_0x500c21){return await this['_utils']['loadRevisionData'](_0x500c21,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x500c21);}async['getRevisionRootsAttributes'](_0x42555f){return await this['_utils']['loadRevisionData'](_0x42555f,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x42555f);}['sendBufferedUpdates'](){if(0x0===this['_bufferedUpdates']['size'])return;if(this['_isPendingUpdate'])return;let _0x49fb78=Array['from'](this['_bufferedUpdates']['values']());this['_bufferedUpdates']['clear']();for(let _0x1edd29=0x0;_0x1edd29<_0x49fb78['length'];_0x1edd29++){const _0x3c8877=_0x49fb78[_0x1edd29];let _0x13eadc=!0x1;for(const _0x36232f of Object['keys'](_0x3c8877))void 0x0===_0x3c8877[_0x36232f]?delete _0x3c8877[_0x36232f]:'id'!==_0x36232f&&(_0x13eadc=!0x0);_0x13eadc||(_0x49fb78[_0x1edd29]=null);}if(_0x49fb78=_0x49fb78['filter'](_0x2bd582=>null!==_0x2bd582),!_0x49fb78['length'])return;for(let _0x1a14a4=0x0;_0x1a14a4<_0x49fb78['length'];_0x1a14a4++){const _0xc490be=_0x49fb78[_0x1a14a4];void 0x0!==_0xc490be['fromVersion']&&void 0x0===_0xc490be['toVersion']&&(_0xc490be['toVersion']=this['repository']['getRevision'](_0xc490be['id'])['toVersion']),void 0x0!==_0xc490be['toVersion']&&void 0x0===_0xc490be['fromVersion']&&(_0xc490be['fromVersion']=this['repository']['getRevision'](_0xc490be['id'])['fromVersion']);}const _0x38778e=this['editor']['config']['get']('collaboration.channelId');this['_isPendingUpdate']=!0x0,this['_addPendingAction'](),this['adapter']['updateRevisions'](_0x49fb78,_0x38778e)['finally'](()=>{this['_isPendingUpdate']=!0x1;})['then'](_0x1893d5=>{if(_0x1893d5){for(const _0x181fca of _0x1893d5)this['setRevisionData']({'id':_0x181fca['id'],'createdAt':_0x181fca['createdAt']});}this['_removePendingAction'](),this['sendBufferedUpdates']();});}['buildRevisionData']({revision:_0x4fd60c=null,from:_0x4ea67d=null,to:_0x5f3db2=null}){_0x4ea67d=null!==_0x4ea67d?_0x4ea67d:_0x4fd60c['fromVersion'],_0x5f3db2=null!==_0x5f3db2?_0x5f3db2:_0x4fd60c['toVersion'];const _0x5bd6b6=this['_revisionDataBuilder']['getData'](_0x4ea67d,_0x5f3db2),_0x266fbe={'diffData':_0x5bd6b6['diffData'],'authorsIds':_0x5bd6b6['authorsIds'],'fromVersion':_0x4ea67d,'toVersion':_0x5f3db2};if(!_0x4fd60c||_0x5f3db2!==_0x4fd60c['toVersion']){const _0x1e375c=_0x5f3db2-0x1,_0x7609e1=this['_source']['history']['getOperation'](_0x1e375c);_0x266fbe['createdAt']=_0x7609e1&&_0x7609e1['createdAt']||new Date();}if(this['_loadedStateData']&&_0x4ea67d===this['_loadedStateData']['fromVersion']){for(const _0x22c88d of this['_loadedStateData']['authors'])_0x266fbe['authorsIds']['includes'](_0x22c88d['id'])||_0x266fbe['authorsIds']['push'](_0x22c88d['id']);}return _0x266fbe;}['_bufferUpdate'](_0x5ef383,_0x516eb9,_0x1157ef){if(this['_bufferedUpdates']['has'](_0x5ef383)){const _0x1763ce=this['_bufferedUpdates']['get'](_0x5ef383);_0x516eb9=_0x1157ef?{..._0x1763ce,..._0x516eb9}:{..._0x516eb9,..._0x1763ce};}this['_bufferedUpdates']['set'](_0x5ef383,_0x516eb9);}['setRevisionData'](_0x551468){const _0x49373f=this['repository']['getRevision'](_0x551468['id']);if(_0x551468['createdAt']&&(_0x551468['createdAt']=new Date(_0x551468['createdAt'])),_0x551468['authorsIds']){const _0x3af043=this['editor']['plugins']['get']('Users');_0x551468['authors']=_0x551468['authorsIds']['map'](_0x2dd865=>_0x3af043['getUser'](_0x2dd865));}_0x49373f['_update'](_0x551468,!0x0);}['_createInitialRevision'](_0x710b20){const _0x58d647=this['repository']['getRevision'](this['repository']['length']-0x1);if(_0x58d647)this['_initialRevisionId']=_0x58d647['id'];else{const _0x181edb=!this['editor']['model']['document']['roots']['find'](_0x5c5541=>this['editor']['model']['hasContent'](_0x5c5541)),_0x5a1e4f=this['editor']['plugins']['get']('Users')['me']['id'],_0x474f64=pt(this['editor']['locale'],_0x181edb?'Empty\x20document':'Initial\x20revision');this['_makeRevision']({'from':_0x710b20,'to':_0x710b20,'id':this['_initialRevisionId'],'name':_0x474f64,'creatorId':_0x5a1e4f});}}['_createCurrentRevision'](_0x1e90a0){const _0x278a7c=this['_source']['getCurrentRevisionId']();this['currentRevision']=this['repository']['getRevision'](_0x278a7c),this['currentRevision']||(this['currentRevision']=this['_makeRevision']({'from':_0x1e90a0,'to':_0x1e90a0,'id':_0x278a7c,'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'](_0x45cc4c,_0x4c1f57,_0x41654e){const _0x4bf325={},_0x1d3edc={},_0x4d1c38={},_0x5846bc=this['editor']['config']['get']('roots')||{};for(const [_0x327645,_0xfebdf1]of Object['entries'](_0x5846bc))_0xfebdf1['lazyLoad']||(_0x4bf325[_0x327645]=_0xfebdf1['initialData']??'',_0x1d3edc[_0x327645]=_0xfebdf1['modelAttributes']||{},_0xfebdf1['modelElement']&&(_0x4d1c38[_0x327645]=_0xfebdf1['modelElement']));for(const _0x43e55c of this['editor']['model']['document']['getRootNames']())_0x4bf325[_0x43e55c]??='',_0x1d3edc[_0x43e55c]??={};let _0xfd847e=!0x1;const _0x43dcec=Object['keys'](_0x4bf325),_0x3a7041=Object['keys'](_0x45cc4c);for(const _0xd97a95 of _0x43dcec){if(_0x4bf325[_0xd97a95]!==_0x45cc4c[_0xd97a95]&&''!==_0x4bf325[_0xd97a95]['trim']()){_0xfd847e=!0x0;break;}if(!_0x5a02ed(_0x1d3edc[_0xd97a95],_0x4c1f57[_0xd97a95])&&Object['keys'](_0x1d3edc[_0xd97a95])['length']>0x0){_0xfd847e=!0x0;break;}const _0x12707f=_0x4d1c38[_0xd97a95],_0x49ddf1=_0x41654e[_0xd97a95];if(_0x12707f&&_0x49ddf1&&_0x12707f!==_0x49ddf1){_0xfd847e=!0x0;break;}}_0xfd847e||(_0xfd847e=_0x3a7041['some'](_0x3c9e5a=>!this['editor']['model']['document']['getRoot'](_0x3c9e5a))),_0xfd847e&&_0x5bea80('editor-initial-data-replaced-with-revision-data',{'editorData':_0x4bf325,'editorRootsAttributes':_0x1d3edc,'editorRootsModelElements':_0x4d1c38,'revisionData':_0x45cc4c,'revisionRootsAttributes':_0x4c1f57,'revisionRootsModelElements':_0x41654e});for(const [_0x2c4c02,_0x2dc4f9]of Object['entries'](_0x45cc4c))this['editor']['config']['set']('roots.'+_0x2c4c02+'.initialData',_0x2dc4f9);for(const [_0x2ee9ba,_0x44bcc7]of Object['entries'](_0x4c1f57))this['editor']['config']['set']('roots.'+_0x2ee9ba+'.modelAttributes',_0x44bcc7);const _0x277eba=this['editor']['model']['document'];for(const [_0x292058,_0x4baf7d]of Object['entries'](_0x41654e)){this['editor']['config']['set']('roots.'+_0x292058+'.modelElement',_0x4baf7d);const _0x328306=_0x277eba['getRoot'](_0x292058);_0x328306&&_0x328306['name']!==_0x4baf7d&&(_0x277eba['roots']['remove'](_0x292058),_0x277eba['createRoot'](_0x4baf7d,_0x292058));}}['_addPendingAction'](){if(!this['_pendingAction']){const _0x22a411=this['editor']['plugins']['get']('PendingActions');this['_pendingAction']=_0x22a411['add'](pt(this['editor']['locale'],'PENDING_ACTION_REVISION_HISTORY'));}}['_removePendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get']('PendingActions')['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_findInsertionIndex'](_0x297d33){const _0x1288d4=this['repository']['getRevisions']();_0x1288d4['reverse']();let _0xd8325=0x0;for(;_0xd8325<_0x1288d4['length'];){const _0x17ae40=_0x1288d4[_0xd8325];if(_0x17ae40===this['currentRevision']){_0xd8325++;continue;}if(_0x17ae40['id']===this['_initialRevisionId'])break;const _0x1047fa=_0x297d33['toVersion']-_0x17ae40['toVersion']||_0x297d33['fromVersion']-_0x17ae40['fromVersion'];if(_0x1047fa>0x0)break;if(_0x1047fa<0x0)_0xd8325++;else{if(!_0x297d33['creator']&&_0x17ae40['creator'])break;if(_0x17ae40['creator']||!_0x297d33['creator']){if(_0x297d33['createdAt']>_0x17ae40['createdAt'])break;_0xd8325++;}else _0xd8325++;}}return _0xd8325;}['_getFromVersion'](_0x56894f){const _0x572b15=this['repository']['getRevisions']();_0x572b15['reverse'](),_0x572b15['shift']();const _0x31fbb3=_0x572b15['find'](_0x1eb229=>_0x1eb229['toVersion']<=_0x56894f)['toVersion'];return _0x31fbb3<this['_startingVersion']?this['_startingVersion']:_0x31fbb3;}['_makeRevision']({name:_0x2e452b,from:_0x561642,to:_0x5f0f51,creatorId:_0xb6ffc4,id:_0x2867bf}){const _0x5d79c7=this['buildRevisionData']({'from':_0x561642,'to':_0x5f0f51});_0x5d79c7['name']=_0x2e452b,_0x5d79c7['creatorId']=_0xb6ffc4,_0x5d79c7['id']=_0x2867bf;const _0x439e92=this['addRevisionData'](_0x5d79c7);return this['adapter']&&this['_bufferUpdate'](_0x5d79c7['id'],_0x5d79c7,!0x0),_0x439e92;}['_setConversion'](){this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'});}},yt=class{['editor'];['source'];['_savedMetaData'];['_lastFrom'];['_lastTo'];['_markers'];['_diffRoots'];['_diffRootsAttributes'];['_baseRoots'];['_baseRootsAttributes'];['_idsRoots'];['_baseIdsRoots'];['_touched'];['_touchedMarkers'];['_touchedRoots'];['_revisionId'];['_startingRevisionId'];constructor(_0x5184fb){this['editor']=_0x5184fb,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['_touchedRoots']=new Map(),this['_revisionId']=0x1;}['init'](_0x3faf84){this['source']=_0x3faf84;const _0x1f08d3=new Map(),_0x59ae01=new Map(),_0x4240da=this['editor']['model']['document']['roots']['map'](_0x4975ff=>_0x4975ff['rootName']);for(const _0x480970 of _0x4240da){const _0x280895=this['editor']['model']['document']['getRoot'](_0x480970),_0x1fa3a3=bt(_0x280895);_0x1f08d3['set'](_0x480970,_0x1fa3a3),_0x59ae01['set'](_0x480970,Object['fromEntries'](_0x280895['getAttributes']()));}const _0x2c9308=Array['from'](this['editor']['model']['markers'])['map'](_0x3a3294=>[_0x3a3294['name'],_0x3a3294['getRange']()]),_0x4cec5f=this['source']['version'];this['_saveMetaData'](_0x4cec5f,_0x1f08d3,_0x2c9308,_0x59ae01),this['_startingRevisionId']=this['_revisionId'];const _0x58fa16=new Map(),_0x3c9ff8=new Map();for(const _0x26c751 of _0x4240da){const _0x1fea7e=Rt(_0x26c751,this['editor']['model']['document']['getRoot'](_0x26c751)['name']);_0x58fa16['set'](_0x26c751,_0x1fea7e),_0x3c9ff8['set'](_0x26c751,{});}this['_saveMetaData'](Number['NEGATIVE_INFINITY'],_0x58fa16,[],_0x3c9ff8);}['getData'](_0x593c09,_0x22edbd){if(this['_lastFrom']===_0x593c09&&this['_lastTo']<=_0x22edbd)this['_savedMetaData']['size']>0x1&&this['_removeMetaData'](this['_lastTo']),this['_applyOperations'](this['_lastTo'],_0x22edbd,!0x0);else{if(!this['_savedMetaData']['has'](_0x593c09)){const _0x3006c5=this['_getPreviousFrom'](_0x593c09);this['_calculateMetaData'](_0x3006c5,_0x593c09,!0x1);}this['_calculateMetaData'](_0x593c09,_0x22edbd,!0x0);}return this['_lastFrom']=_0x593c09,this['_lastTo']=_0x22edbd,this['_getState']();}['loadState'](_0x4dc660){if(!this['_savedMetaData']['has'](_0x4dc660['fromVersion'])){const _0x5b9c14=this['_getPreviousFrom'](_0x4dc660['fromVersion']);this['_calculateMetaData'](_0x5b9c14,_0x4dc660['fromVersion'],!0x1);}this['_calculateMetaData'](_0x4dc660['fromVersion'],_0x4dc660['toVersion'],!0x1);const _0x14bd90=this['editor']['plugins']['get']('RevisionHistoryUtils');this['_reset'](),this['_lastFrom']=_0x4dc660['fromVersion'],this['_lastTo']=_0x4dc660['toVersion'];for(const _0x1f8ae2 in _0x4dc660['diffData']){const _0x2d088a=_0x4dc660['diffData'][_0x1f8ae2]['attachChange'],_0x457588=_0x28481c(_0x4dc660['diffData'][_0x1f8ae2]['attributesBefore'])||{},_0x37ea14=_0x4dc660['diffData'][_0x1f8ae2],_0x33089b=_0x14bd90['_makeModelFromViewString'](_0x37ea14['deletions'],_0x37ea14['rootElementName']||'$root');_0x33089b['rootName']=_0x1f8ae2,_0x33089b['_isAttached']=!_0x2d088a||!_0x2d088a['isAttached'],_0x33089b['isAttached']=()=>_0x33089b['_isAttached'],this['_baseRoots']['set'](_0x1f8ae2,_0x33089b),this['_baseRootsAttributes']['set'](_0x1f8ae2,_0x457588),_0x2d088a&&this['_touchedRoots']['set'](_0x1f8ae2,_0x2d088a);const _0x3e8dd1=this['_makeIdsRoot'](_0x33089b);this['_baseIdsRoots']['set'](_0x1f8ae2,_0x3e8dd1);for(const [_0xa5c1ec,_0xb4ce97]of _0x33089b['markers']){if(!_0xa5c1ec['startsWith']('revision:'))continue;const _0x5148a0=_0xa5c1ec['split'](':')[0x2];for(const _0x3a0a28 of _0xb4ce97['getWalker']({'singleCharacters':!0x0})){const _0x36cb7b=this['_getVidAttributeName'](_0x3a0a28),_0x4f1cbd='elementEnd'==_0x3a0a28['type']?_0x3a0a28['previousPosition']['path']['slice'](0x0,-0x1):_0x3a0a28['previousPosition']['path'],_0x3fc410=_0x3e8dd1['getNodeByPath'](_0x4f1cbd)['getAttribute'](_0x36cb7b);this['_touched']['set'](_0x3fc410,{'userId':_0x5148a0});}_0x33089b['markers']['delete'](_0xa5c1ec);}}this['_startingRevisionId']=this['_revisionId'];const _0x88caf9=[...Array(this['_revisionId'])['keys']()]['slice'](0x1)['filter'](_0xde9064=>!this['_touched']['has'](_0xde9064));let _0x58a725=0x0;const _0x17ad1f=new Map();for(const _0x5c9eb0 in _0x4dc660['diffData']){const _0x173814=_0x4dc660['diffData'][_0x5c9eb0]['attachChange'],_0x5137ee=_0x28481c(_0x4dc660['diffData'][_0x5c9eb0]['attributesAfter'])||{},_0x3d08ae=_0x4dc660['diffData'][_0x5c9eb0],_0x4fcb37=_0x14bd90['_makeModelFromViewString'](_0x3d08ae['insertions'],_0x3d08ae['rootElementName']||'$root');_0x4fcb37['rootName']=_0x5c9eb0,_0x4fcb37['_isAttached']=!_0x173814||_0x173814['isAttached'],_0x4fcb37['isAttached']=()=>_0x4fcb37['_isAttached'],this['_diffRoots']['set'](_0x5c9eb0,_0x4fcb37),this['_diffRootsAttributes']['set'](_0x5c9eb0,_0x5137ee);const _0x4a1919=this['_makeIdsRoot'](_0x4fcb37,Number['NEGATIVE_INFINITY']);this['_idsRoots']['set'](_0x5c9eb0,_0x4a1919),_0x17ad1f['set'](_0x5c9eb0,_0x4fcb37['isAttached']()?_0x5137ee:{});for(const [_0x43357b,_0x2e8389]of _0x4fcb37['markers']){if(!_0x43357b['startsWith']('revision:'))continue;const _0x2ff519=_0x43357b['split'](':')[0x2];for(const _0xe576c0 of _0x2e8389['getWalker']({'singleCharacters':!0x0})){const _0x38288e=this['_getVidAttributeName'](_0xe576c0),_0x522013=this['_revisionId']++,_0x2c35ec='elementEnd'==_0xe576c0['type']?_0xe576c0['previousPosition']['path']['slice'](0x0,-0x1):_0xe576c0['previousPosition']['path'];_0x4a1919['getNodeByPath'](_0x2c35ec)['_setAttribute'](_0x38288e,_0x522013),this['_touched']['set'](_0x522013,{'userId':_0x2ff519});}_0x4fcb37['markers']['delete'](_0x43357b);}for(const _0x19d456 of this['editor']['model']['createRangeIn'](_0x4fcb37)['getWalker']({'singleCharacters':!0x0})){const _0x21f6ef=this['_getVidAttributeName'](_0x19d456),_0x245345='elementEnd'==_0x19d456['type']?_0x19d456['previousPosition']['path']['slice'](0x0,-0x1):_0x19d456['previousPosition']['path'],_0x4f7ef0=_0x4a1919['getNodeByPath'](_0x245345);_0x4f7ef0['getAttribute'](_0x21f6ef)>0x0||_0x4f7ef0['_setAttribute'](_0x21f6ef,_0x88caf9[_0x58a725++]);}for(const [_0x1f0927,_0x3a2856]of _0x4fcb37['markers'])_0x1f0927['startsWith']('revision:')||this['_markers']['set'](_0x1f0927,_0x3a2856);}const {roots:_0x350e72}=this['_savedMetaData']['get'](_0x4dc660['fromVersion']),{roots:_0x5021ba}=this['_savedMetaData']['get'](_0x4dc660['toVersion']),_0x480a11=bt(_0x350e72['get']('$graveyard'));this['_baseRoots']['set']('$graveyard',_0x480a11),this['_baseIdsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x480a11,Number['NEGATIVE_INFINITY']));const _0x163583=bt(_0x5021ba['get']('$graveyard'));this['_diffRoots']['set']('$graveyard',_0x163583),this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x163583));const _0x5bada7=Array['from'](this['_diffRoots'])['map'](([_0x3b280f,_0x462d41])=>[_0x3b280f,bt(_0x462d41)]);this['_saveMetaData'](this['_lastTo'],_0x5bada7,this['_markers'],_0x17ad1f);}['reInit'](){this['_reset'](),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_savedMetaData']['clear'](),this['init'](this['source']);}['_saveMetaData'](_0x45315a,_0x515374,_0x582283,_0x377bd8){const _0x590519=new Map(_0x515374),_0x3d2f68=new Map(_0x28481c(_0x377bd8)),_0x314dbc=new Map();for(const [_0x265276,_0x4ea9cd]of _0x582283)_0x314dbc['set'](_0x265276,{'start':_0x4ea9cd['start']['clone'](),'end':_0x4ea9cd['end']['clone'](),'rootName':_0x4ea9cd['root']['rootName']});this['_savedMetaData']['set'](_0x45315a,{'roots':_0x590519,'markers':_0x314dbc,'rootsAttributes':_0x3d2f68});}['_removeMetaData'](_0x20311b){this['_savedMetaData']['delete'](_0x20311b);}['_reset'](){this['_touched']['clear'](),this['_touchedMarkers']['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'](_0x46d3d7,_0x5403ea=null){let _0x362ceb=null;_0x46d3d7['is']('documentFragment')||(_0x362ceb=new _0x5ebea3(_0x46d3d7['name'],{'vid_start':null===_0x5403ea?this['_revisionId']++:_0x5403ea++}));const _0x2907c0=[];for(const _0xfc5efc of _0x46d3d7['getChildren']())if(_0xfc5efc['is']('element')){_0x2907c0['push'](this['_makeIdsRoot'](_0xfc5efc,_0x5403ea));const _0x10f22b=_0x2907c0[_0x2907c0['length']-0x1];null!==_0x5403ea&&(_0x5403ea=_0x10f22b['is']('element','$text')?_0x10f22b['getAttribute']('vid')+0x1:_0x10f22b['getAttribute']('vid_end')+0x1);}else{for(let _0x4ef7fa=0x0;_0x4ef7fa<_0xfc5efc['offsetSize'];_0x4ef7fa++)_0x2907c0['push'](new _0x5ebea3('$text',{'vid':null===_0x5403ea?this['_revisionId']++:_0x5403ea++}));}if(_0x46d3d7['is']('documentFragment')){const _0x2a1b6b=Rt(_0x46d3d7['rootName'],_0x46d3d7['name']);return _0x2a1b6b['_insertChild'](0x0,_0x2907c0),_0x2a1b6b;}return _0x362ceb['_setAttribute']('vid_end',null===_0x5403ea?this['_revisionI