@ckeditor/ckeditor5-revision-history 48.4.0-alpha.3 → 48.4.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.
- package/dist/index.js +7 -7
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{CKEditorError as
|
|
24
|
-
_0x452013();var gt=class extends vt{['id'];creator;authors;diffData;toVersion;['fromVersion'];['model'];constructor(_0x153a58){super(),this['id']=_0x153a58['id']||_0x57bf97(),this['creator']=_0x153a58['creator']||null,this['authors']=_0x153a58['authors']||[],this['diffData']=_0x153a58['diffData']||null,this['toVersion']=_0x153a58['toVersion']||0x0,this['fromVersion']=_0x153a58['fromVersion']||0x0,this['set']('name',_0x153a58['name']||''),this['set']('createdAt',_0x153a58['createdAt']||new Date()),this['set']('attributes',_0x153a58['attributes']||{});}setName(_0x2623c7){this['_update']({'name':_0x2623c7});}setAttribute(_0x20318e,_0x1677cd){const _0x143a3d=_0x4dfa2c(this['attributes']);_0x182717(_0x143a3d,_0x20318e,_0x1677cd),this['_update']({'attributes':_0x143a3d});}removeAttribute(_0x3cbe43){const _0x45a025=_0x4dfa2c(this['attributes']);_0x308d55(_0x45a025,_0x3cbe43),this['_update']({'attributes':_0x45a025});}_update(_0x8deee8,_0x5d2d0d=!0x1){let _0x475d54=!0x1;const _0x2555b9={'id':this['id']};for(const _0x1075a3 of['name','createdAt','diffData','authors','attributes','toVersion','fromVersion','creatorId']){const _0x232b4b=_0x8deee8[_0x1075a3];void 0x0!==_0x232b4b&&_0x232b4b!==this[_0x1075a3]&&(this[_0x1075a3]=_0x232b4b,_0x2555b9[_0x1075a3]=_0x232b4b,_0x475d54=!0x0);}_0x475d54&&(_0x2555b9['authors']&&(_0x2555b9['authorsIds']=_0x2555b9['authors']['map'](_0x4356cc=>_0x4356cc['id']),delete _0x2555b9['authors']),this['fire']('_update',_0x2555b9,_0x5d2d0d));}toJSON(){return{'id':this['id'],'name':this['name'],'creatorId':this['creator']?this['creator']['id']:null,'authorsIds':this['authors']['map'](_0x3c4e79=>_0x3c4e79['id']),'diffData':this['diffData'],'createdAt':this['createdAt'],'attributes':this['attributes'],'fromVersion':this['fromVersion'],'toVersion':this['toVersion']};}},mt=class extends _0x1e8181{['_revisions'];static get requires(){return[_0x5182c9];}static get['pluginName'](){return'RevisionsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get length(){return this['_revisions']['length'];}constructor(_0x335052){super(_0x335052),this['_revisions']=new _0x2d7d2b();}afterInit(){!async function(_0x139af1){const _0x59e0e7='vsmL4TPpuR53MlqSj2VXwH9oEAN8FxJtGUOdbDCZ01ihyfkBQY6acgz7rIeWKn',_0x386210=0xeb829,_0x20d35a=0x79170,_0xf13e45=window['Date']['now'](),_0x44c6a3=_0x139af1['editor'],_0x15fccd=new window['Promise'](_0x57815b=>{_0x44c6a3['once']('ready',_0x57815b);}),_0x55f2b7={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x5875fa=_0x44c6a3['config']['get']('licenseKey');async function _0x5c5529(){let _0x455e51,_0x1efc32=null,_0x2fcd5f=null;try{return'GPL'==_0x5875fa?'NotAllowed':(_0x455e51=_0x7aef11(),_0x455e51?(_0x455e51['usageEndpoint']&&(_0x2fcd5f=_0x21efb6(_0x455e51['usageEndpoint'],_0x455e51['jti'])),await _0x1b7c6b()?_0x1126fe()?_0x5aa8c6()?'Expired':_0x3a11a8()?('evaluation'==_0x455e51['licenseType']&&(_0x1efc32=_0x51df9a('EvaluationLimit')),await _0x5cc80d()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x5aa8c6(){const _0x392814=['evaluation','trial']['includes'](_0x455e51['licenseType'])?_0xf13e45/0x3e8:0xe10*_0x20d35a;return _0x455e51['exp']<_0x392814;}function _0x1126fe(){const _0x443380=_0x455e51['features'];if(!_0x443380)return!0x1;if(_0x443380['includes']('*'))return!0x0;if(_0x443380['includes']('RH'))return!0x0;if(_0x443380['includes']('RRH')){if(_0x15f9fc())return!0x0;if(_0x4e17f1()||_0x2d9175())return!0x0;}return!0x1;}function _0x3a11a8(){const _0x562bd3=_0x455e51['licensedHosts'];if(!_0x562bd3||0x0==_0x562bd3['length'])return!0x0;const {hostname:_0x208ada}=new URL(window['location']['href']);if(_0x562bd3['includes'](_0x208ada))return!0x0;const _0x208a79=_0x208ada['split']('.');return _0x562bd3['filter'](_0x29412f=>_0x29412f['includes']('*'))['map'](_0x16629c=>_0x16629c['split']('.'))['filter'](_0x34f5ea=>_0x34f5ea['length']<=_0x208a79['length'])['map'](_0x43fef5=>Array(_0x208a79['length']-_0x43fef5['length'])['fill']('*'===_0x43fef5[0x0]?'*':'')['concat'](_0x43fef5))['some'](_0x329b37=>_0x208a79['every']((_0x41ba22,_0x3c9410)=>_0x329b37[_0x3c9410]===_0x41ba22||'*'===_0x329b37[_0x3c9410]));}function _0x5cc80d(){return _0x1efc32&&_0x2fcd5f?new window['Promise']((_0x15fe98,_0x3f72fc)=>{_0x1efc32['then'](_0x15fe98,_0x3f72fc),_0x2fcd5f['then'](_0x333d61=>{'Valid'!=_0x333d61&&_0x15fe98(_0x333d61);},_0x3f72fc);}):_0x1efc32||_0x2fcd5f||'Valid';}}function _0x21efb6(_0x46e9d2,_0x170dc0){return new window['Promise'](_0x413ba0=>{if(_0x4f1e4a())return _0x413ba0('Valid');_0x34f968(),_0x44c6a3['decorate']('_sendUsageRequest');let _0x5e5ef1=!0x1;const _0x5d6c88=_0x57bf97();function _0x52b53c(_0x101b58){return!!_0x101b58&&('object'==typeof _0x101b58||'function'==typeof _0x101b58)&&'function'==typeof _0x101b58['then']&&'function'==typeof _0x101b58['catch'];}function _0x5b3263(_0x136d45){_0x1fcb7f(_0x136d45)['then'](_0x45a78c=>_0x45a78c&&'ok'==_0x45a78c['status']?_0x582723(_0x5e44ec(_0x5d6c88+_0x170dc0))!=_0x45a78c['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x29ab2f=>(_0x19be03(),_0x29ab2f),()=>{const _0x36222d=_0x13e59d();return null==_0x36222d?(_0x19be03(),'Valid'):_0xf13e45-_0x36222d>0x240c8400?'UsageLimit':'Valid';})['then'](_0x413ba0)['catch'](()=>{_0x413ba0('UsageLimit');});const _0x16fc05=0x36ee80;function _0x19be03(){const _0x2a9de9='llct-'+_0x582723(_0x5e44ec(_0x46e9d2)),_0x3a03e6=_0x2a02e2(_0x582723(window['Math']['ceil'](_0xf13e45/_0x16fc05)));window['localStorage']['setItem'](_0x2a9de9,_0x3a03e6);}function _0x13e59d(){const _0x46be9c='llct-'+_0x582723(_0x5e44ec(_0x46e9d2)),_0x420a80=window['localStorage']['getItem'](_0x46be9c);return _0x420a80?window['parseInt'](_0x2a02e2(_0x420a80),0x10)*_0x16fc05:null;}function _0x1fcb7f(_0x8e28a1){return new window['Promise']((_0x1e4a59,_0x25adfe)=>{_0x8e28a1['then'](_0x1e4a59,_0x25adfe),window['setTimeout'](_0x25adfe,0x1d4c0);});}}_0x44c6a3['on']('_sendUsageRequest',(_0x559604,_0x4f3a22)=>{if(_0x4f3a22[0x0]!=_0x46e9d2)return _0x413ba0('UsageLimit');_0x4f3a22[0x1]={..._0x4f3a22[0x1],'requestId':_0x5d6c88};},{'priority':'high'}),_0x44c6a3['on']('_sendUsageRequest',_0xc0363e=>{_0x52b53c(_0xc0363e['return'])&&(_0x5e5ef1=!0x0,_0x5b3263(_0xc0363e['return']));},{'priority':'low'}),_0x15fccd['then'](()=>{_0x5e5ef1||_0x413ba0('UsageLimit');});});function _0x4f1e4a(){return'auto'==_0x44c6a3['editing']['view']['_overlayModeHint'];}function _0x34f968(){_0x44c6a3['editing']['view']['_overlayModeHint']='auto';}}function _0x51df9a(_0x9a72f6){const _0x5010d2=[new window['Promise'](_0x3aee5f=>setTimeout(_0x3aee5f,0x93ecc)),_0x15fccd['then'](()=>new window['Promise'](_0x474434=>{const _0x35a68f=0x7,_0x53325b=_0x139af1['_revisions'];function _0x14bb49(){_0x53325b['length']>=_0x35a68f&&_0x474434();}_0x14bb49(),_0x53325b['on']('add',_0x14bb49);})),new window['Promise'](_0x5e0d98=>{function _0x3ff9dd(){for(const _0x41f9de in window)if(window['Number']['isNaN'](window['Number'](_0x41f9de))&&window[_0x41f9de]==_0x386210)return _0x5e0d98();'destroyed'!=_0x44c6a3['state']&&window['setTimeout'](_0x3ff9dd,0x1388);}_0x255458('RevisionViewer')&&_0x3ff9dd();})];return window['Promise']['race'](_0x5010d2)['then'](()=>_0x9a72f6);}async function _0x22c56c(){if(await _0x15fccd,_0x255458('RevisionViewer')){const _0x548d20=_0x139af1['getRevision'](0x0),_0x55b833=_0x139af1['getEarlierVisibleRevision'](_0x548d20['id']),_0x2667f6=_0x4f24b6('RevisionViewer');return await _0x2667f6['compare'](_0x548d20['id'],_0x55b833?_0x55b833['id']:null,!0x0),_0x2667f6['unbind']('isEnabled'),_0x2667f6['isEnabled']=!0x1,_0x2667f6['compare']=_0x1b746c,void(_0x2667f6['_getDiff']=_0x1b746c);}if(_0x255458('RevisionTracker')){const _0x3d278e=_0x4f24b6('RevisionTracker');_0x3d278e['unbind']('isEnabled'),_0x3d278e['isEnabled']=!0x1,_0x3d278e['update']=_0x1b746c,_0x3d278e['saveRevision']=_0x1b746c;}_0x44c6a3['model']['change']=_0x1b746c,_0x44c6a3['model']['enqueueChange']=_0x1b746c,_0x44c6a3['enableReadOnlyMode']('model');}function _0x15f9fc(){return _0x255458('WebSocketGateway')&&'connected'==_0x4f24b6('WebSocketGateway')['state'];}function _0x4e17f1(){return _0x255458('RevisionViewerIntegration');}function _0x2d9175(){return _0x255458('TrackChangesDataGetter');}function _0x547ff1(_0x1a82eb){const _0x516302=_0x3e38b1();_0x44c6a3[_0x516302]='revisionHistoryLicenseKey'+_0x1a82eb,_0x1a82eb['endsWith']('Limit')&&(window[_0x3e38b1()]=_0x386210),'Valid'!=_0x1a82eb&&_0x22c56c();}function _0x3e38b1(){const _0x45f52d=window['String'](window['performance']['now']())['replace']('.','');let _0x5671ab='v';for(let _0xe4a54c=0x0;_0xe4a54c<_0x45f52d['length'];_0xe4a54c+=0x2){let _0x3770e4=window['parseInt'](_0x45f52d['substring'](_0xe4a54c,_0xe4a54c+0x2));_0x3770e4>=0x3e&&(_0x3770e4-=0x3e),_0x5671ab+=_0x59e0e7[_0x3770e4];}return _0x5671ab;}function _0x7aef11(){const _0x3bd797=_0x5875fa['split']('.');if(0x3!=_0x3bd797['length'])return null;return _0x29515f(_0x3bd797[0x1]);function _0x29515f(_0x4c23ee){const _0x27898c=_0x434968(_0x4c23ee);return _0x27898c&&_0x3c8d4a()?_0x27898c:null;function _0x3c8d4a(){const _0x102efe=_0x27898c['jti'],_0x2daf11=window['parseInt'](_0x102efe['substring'](_0x102efe['length']-0x8),0x10),_0xa43fda={..._0x27898c,'jti':_0x102efe['substring'](0x0,_0x102efe['length']-0x8)};return delete _0xa43fda['vc'],_0x5e44ec(_0xa43fda)==_0x2daf11;}}}async function _0x1b7c6b(){let _0x272d85=!0x0;try{const [_0x2154f7,_0x1e1861,_0x48f032]=_0x5875fa['split']('.');return _0x1c940e(_0x2154f7),await _0x421bca(_0x2154f7,_0x1e1861,_0x48f032),_0x272d85;}catch{return!0x1;}function _0x1c940e(_0x465832){const _0x59f104=_0x434968(_0x465832);_0x59f104&&'ES256'==_0x59f104['alg']||(_0x272d85=!0x1);}async function _0x421bca(_0x679611,_0x4c2c88,_0x2dc026){const _0x5add8e=window['Uint8Array']['from'](_0xcc2084(_0x2dc026),_0x526121=>_0x526121['charCodeAt'](0x0)),_0x71d982=new window['TextEncoder']()['encode'](_0x679611+'.'+_0x4c2c88),_0x330aca=window['crypto']['subtle'];if(!_0x330aca)return;const _0x27eefc=await _0x330aca['importKey']('jwk',_0x55f2b7,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x330aca['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x27eefc,_0x5add8e,_0x71d982)||(_0x272d85=!0x1);}}function _0x434968(_0x21a838){return _0x21a838['startsWith']('ey')?JSON['parse'](_0xcc2084(_0x21a838)):null;}function _0xcc2084(_0x23e29b){return window['atob'](_0x23e29b['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5e44ec(_0x58cf50){let _0xae79d3=0x1505;function _0x24578b(_0x5640cd){for(let _0x28cd8e=0x0;_0x28cd8e<_0x5640cd['length'];_0x28cd8e++){const _0x31996f=_0x5640cd['charCodeAt'](_0x28cd8e);_0xae79d3=(_0xae79d3<<0x5)+_0xae79d3+_0x31996f,_0xae79d3&=_0xae79d3;}}function _0x1cf989(_0x41757c){Array['isArray'](_0x41757c)?_0x41757c['forEach'](_0x1cf989):_0x41757c&&'object'==typeof _0x41757c?Object['entries'](_0x41757c)['sort']()['forEach'](([_0x26a751,_0x5ea752])=>{_0x24578b(_0x26a751),_0x1cf989(_0x5ea752);}):_0x24578b(window['String'](_0x41757c));}return _0x1cf989(_0x58cf50),_0xae79d3>>>0x0;}function _0x582723(_0x51c6f3){return _0x51c6f3['toString'](0x10)['padStart'](0x8,'0');}function _0x2a02e2(_0x176a6c){return _0x176a6c['split']('')['reverse']()['join']('');}function _0x255458(_0x531063){return _0x44c6a3['plugins']['has'](_0x531063);}function _0x4f24b6(_0xa3f404){return _0x44c6a3['plugins']['get'](_0xa3f404);}function _0x1b746c(){}_0x547ff1(await _0x5c5529());}(this);}createRevision(_0xc67f70){const _0x2098d1=this['editor']['plugins']['get']('Users');return new gt({'id':_0xc67f70['id'],'name':_0xc67f70['name'],'creator':_0xc67f70['creatorId']?_0x2098d1['getUser'](_0xc67f70['creatorId']):null,'diffData':_0xc67f70['diffData']||_0xc67f70['data'],'authors':_0xc67f70['authorsIds']['map'](_0x479df5=>_0x2098d1['getUser'](_0x479df5)),'createdAt':new Date(_0xc67f70['createdAt']),'attributes':_0xc67f70['attributes'],'fromVersion':_0xc67f70['fromVersion'],'toVersion':_0xc67f70['toVersion']});}['addRevision'](_0x2059a7,_0x47c858=0x0){this['_revisions']['add'](_0x2059a7,_0x47c858);}getRevision(_0x4c8999){return this['_revisions']['get'](_0x4c8999);}getRevisions(_0x580e68={'toJSON':!0x1}){const _0x315978=Array['from'](this['_revisions']);return _0x315978['reverse'](),_0x580e68['toJSON']?_0x315978['map'](_0x5dcb9a=>_0x5dcb9a['toJSON']()):_0x315978;}getIndex(_0x4cf76f){return this['_revisions']['getIndex'](_0x4cf76f);}getEarlierVisibleRevision(_0x48066b){const [,_0x329ecf]=this['getRevisionsIterator'](_0x48066b,{'direction':'earlier'});return _0x329ecf;}getLaterVisibleRevision(_0x1f5943){const [,_0x1d122d]=this['getRevisionsIterator'](_0x1f5943,{'direction':'later'});return _0x1d122d;}getRevisionsInDiff(_0x32e07c){const _0x5259cd=[];for(const _0x3eb0ae of this['getRevisionsIterator'](_0x32e07c['newRevisionId']))if(_0x5259cd['push'](_0x3eb0ae),_0x3eb0ae['id']===_0x32e07c['oldRevisionId'])break;return _0x5259cd;}*getRevisionsIterator(_0x2aa34b,{direction:_0x1e2a0e='earlier',filter:_0x31d9ed=()=>!0x0}={}){const _0x2236c2='earlier'===_0x1e2a0e?0x1:-0x1;let _0x4e315b=this['_revisions']['get'](_0x2aa34b),_0x1d057c=this['getIndex'](_0x4e315b);for(yield _0x4e315b;_0x4e315b;){if(_0x1d057c+=_0x2236c2,_0x4e315b=this['getRevision'](_0x1d057c),!_0x4e315b)return;_0x31d9ed(_0x4e315b)&&(yield _0x4e315b);}}},wt=class extends _0x1e8181{static get['pluginName'](){return'RevisionHistoryUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_viewClassToTypeChar']=new Map([[_0x4fc014,'c'],[_0xed3245,'a'],[_0x30e839,'e'],[_0x1f4b04,'r'],[_0x21bdcf,'u']]);_typeCharToViewClass=new Map([['c',_0x4fc014],['a',_0xed3245],['e',_0x30e839],['r',_0x1f4b04],['u',_0x21bdcf]]);async loadRevisionData(_0x33ed81,_0x3183b9){if(_0x33ed81['diffData']||!_0x3183b9)return;const _0x3a9843=this['editor']['config']['get']('collaboration.channelId');_0x33ed81['diffData']=(await _0x3183b9['getRevision']({'channelId':_0x3a9843,'revisionId':_0x33ed81['id']}))['diffData'];}getRevisionDocumentData(_0x3c1f68){const _0x2c86be={};for(const _0x5d2042 in _0x3c1f68['diffData']){if(_0x3c1f68['diffData'][_0x5d2042]['attachChange']&&!_0x3c1f68['diffData'][_0x5d2042]['attachChange']['isAttached'])continue;const _0x269b5b=this['_removeRevisionMarkers'](JSON['parse'](_0x3c1f68['diffData'][_0x5d2042]['insertions'])),_0x1b1a1b=this['editor']['editing']['view']['document'],_0x42758d=new _0x5f5d25(_0x1b1a1b,_0x269b5b['map'](_0x1aac05=>this['_getViewFromDiffObj'](_0x1aac05,!0x1)));this['editor']['data']['processor']['useFillerType']('marked'),_0x2c86be[_0x5d2042]=this['editor']['data']['processor']['toData'](_0x42758d),this['editor']['data']['processor']['useFillerType']('default');}return _0x2c86be;}getRevisionRootsAttributes(_0x5dccd8){const _0x1ddb98={};for(const _0x596ac4 in _0x5dccd8['diffData'])_0x5dccd8['diffData'][_0x596ac4]['attachChange']&&!_0x5dccd8['diffData'][_0x596ac4]['attachChange']['isAttached']||(_0x1ddb98[_0x596ac4]=_0x5dccd8['diffData'][_0x596ac4]['attributesAfter']||{});return _0x1ddb98;}getRevisionRootsModelElements(_0x235a24){const _0x111f3c={};for(const _0x33a741 in _0x235a24['diffData']){if(_0x235a24['diffData'][_0x33a741]['attachChange']&&!_0x235a24['diffData'][_0x33a741]['attachChange']['isAttached'])continue;const _0x2b8cc0=_0x235a24['diffData'][_0x33a741]['rootElementName'];_0x2b8cc0&&(_0x111f3c[_0x33a741]=_0x2b8cc0);}return _0x111f3c;}_getTypeCharForViewElement(_0x34e562){return this['_viewClassToTypeChar']['get'](_0x34e562['constructor']);}_getViewFromDiffObj(_0x2b9ba1,_0x3d279a){const _0x4c335d=this['editor']['editing']['view']['document'];if('string'==typeof _0x2b9ba1)return new _0x585fc8(_0x4c335d,_0x2b9ba1);{let _0x80e3b7,_0x59e55;_0x59e55='u'==_0x2b9ba1['type']||'r'==_0x2b9ba1['type']?[]:_0x2b9ba1['children']['map'](_0x1aca2a=>this['_getViewFromDiffObj'](_0x1aca2a,_0x3d279a));const _0x25e24d=this['_typeCharToViewClass']['get'](_0x2b9ba1['type'])||_0x17cafd,_0x4bcc43=this['editor']['data']['htmlProcessor']['domConverter'];if(_0x80e3b7=new _0x25e24d(_0x4c335d,_0x2b9ba1['name'],_0x2b9ba1['attributes'],_0x59e55),'u'==_0x2b9ba1['type']&&_0x2b9ba1['children'][0x0]){const _0x50e205=_0x2b9ba1['children'][0x0];if(_0x80e3b7['render']=function(_0xc7caf3){const _0x30802f=_0xc7caf3['createElement']('div');return _0x30802f['innerHTML']=_0x50e205,_0x30802f['childNodes'][0x0];},_0x3d279a){const _0x261442=new _0x5f5d25(_0x4c335d);_0x261442['_appendChild'](_0x80e3b7);const _0x1bbe09=Array['from'](_0x4bcc43['viewChildrenToDom'](_0x261442,{'bind':!0x1})),_0x53d938=_0x4bcc43['domDocument']['createElement']('div');_0x53d938['append'](..._0x1bbe09),_0x80e3b7=Array['from'](_0x4bcc43['domChildrenToView'](_0x53d938))[0x0];}}else{if('r'==_0x2b9ba1['type']&&_0x2b9ba1['children'][0x0]){const _0x23b0f9=_0x2b9ba1['children'][0x0];if(_0x80e3b7['render']=function(_0x5c2af2){_0x5c2af2['innerHTML']=_0x23b0f9;},_0x3d279a){const _0x1db93b=new _0x5f5d25(_0x4c335d);_0x1db93b['_appendChild'](_0x80e3b7);const _0x16f0c3=Array['from'](_0x4bcc43['viewChildrenToDom'](_0x1db93b,{'bind':!0x1})),_0x322796=_0x4bcc43['domDocument']['createElement']('div');_0x322796['append'](..._0x16f0c3);const _0x173484=Array['from'](_0x4bcc43['domChildrenToView'](_0x322796));_0x173484['length']>0x1?_0x80e3b7['_appendChild'](_0x173484):_0x80e3b7=_0x173484[0x0];}}}if(_0x2b9ba1['customProperties']){for(const [_0x5eb7dd,_0x1167e4]of _0x2b9ba1['customProperties'])_0x80e3b7['_setCustomProperty'](_0x5eb7dd,_0x1167e4);}const _0x149890=void 0x0===_0x2b9ba1['fillerOffset']?null:_0x2b9ba1['fillerOffset'];return null!==_0x149890&&(_0x80e3b7['getFillerOffset']=()=>_0x149890),_0x80e3b7;}}_makeModelFromViewString(_0x43ea16,_0x10ab96){const _0x3c0e1c=JSON['parse'](_0x43ea16),_0x3bf0f2=this['editor']['editing']['view']['document'],_0x15ee3e=new _0x5f5d25(_0x3bf0f2,_0x3c0e1c['map'](_0x26b0cf=>this['_getViewFromDiffObj'](_0x26b0cf,!0x0))),_0xc4b9c5=this['editor']['data']['toModel'](_0x15ee3e,_0x10ab96);return _0xc4b9c5['name']=_0x10ab96,_0xc4b9c5;}['_removeRevisionMarkers'](_0x18e43f){return(_0x18e43f=_0x18e43f['filter'](_0x53cb0f=>!_0x53cb0f['name']||'revision-start'!==_0x53cb0f['name']&&'revision-end'!==_0x53cb0f['name']))['forEach'](_0x590036=>{'string'!=typeof _0x590036&&(_0x590036['children']=this['_removeRevisionMarkers'](_0x590036['children']),_0x590036['attributes']=_0x590036['attributes']['filter'](_0x5a05d9=>!_0x5a05d9[0x0]['startsWith']('data-revision-')));}),_0x18e43f;}};function pt(_0x45788e,_0x377c55,_0x28bc73){const t=_0x45788e['t'];switch(_0x377c55){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'},_0x28bc73);case'X_OF_Y_CHANGES':return t({'string':'%0\x20of\x20%1','id':'X_OF_Y_CHANGES'},_0x28bc73);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 _0x1e8181{['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[_0x5182c9,mt,wt,_0x4fd9bc];}constructor(_0x2e1cda){super(_0x2e1cda),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 _0x3ecc94=_0x57bf97();this['_source']={'history':this['editor']['model']['document']['history'],'getLatestVersion':()=>Promise['resolve'](this['editor']['model']['document']['version']),'getCurrentRevisionId':()=>_0x3ecc94},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 _0xdb1d6b=this['repository']['getRevision'](0x0),_0x2ed21c=_0xdb1d6b&&null===_0xdb1d6b['creator']?_0xdb1d6b:null;if(this['_continueCurrentRevision']=!!_0x2ed21c&&this['editor']['config']['get']('revisionHistory.resumeUnsavedRevision'),this['editor']['plugins']['has']('RealTimeCollaborationClient')){const _0x35b403=this['_source']['getCurrentRevisionId'](),_0x2ac1ca=this['repository']['getRevision'](_0x35b403);if(_0x2ac1ca)this['_startingVersion']=_0x2ac1ca['fromVersion'],this['_continueCurrentRevision']=!0x1;else{const _0x47ed4d=this['_source']['history']['_operations']['find'](_0x1840b4=>!_0x1840b4['_isInit']),_0x286685=_0x47ed4d?_0x47ed4d['baseVersion']:this['_source']['history']['version'];_0xdb1d6b?(_0xdb1d6b['toVersion']<_0x286685&&_0xdb1d6b['_update']({'toVersion':_0x286685}),this['_continueCurrentRevision']?(this['_source']['getCurrentRevisionId']=()=>_0x2ed21c['id'],this['_startingVersion']=_0x2ed21c['fromVersion']):(this['_startingVersion']=_0xdb1d6b['toVersion'],this['_continueCurrentRevision']=!0x1)):(this['_startingVersion']=_0x286685,this['_continueCurrentRevision']=!0x1);}}else _0x2ed21c&&(this['editor']['model']['document']['history']['version']=Math['max'](_0x2ed21c['toVersion'],this['editor']['model']['document']['history']['version']),_0x2ed21c['fromVersion']===_0x2ed21c['toVersion']?(0x0!==_0x2ed21c['fromVersion']&&(this['_source']['getCurrentRevisionId']=()=>_0x2ed21c['id']),this['_continueCurrentRevision']=!0x1):this['_continueCurrentRevision']&&(this['_source']['getCurrentRevisionId']=()=>_0x2ed21c['id'],this['_startingVersion']=_0x2ed21c['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',_0x48247e=>!_0x48247e),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4ab210=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3a7c4a;for(const _0x2cf112 in _0x4ab210){const _0x24e6b9=_0x2cf112,_0x33aaa9=_0x4ab210[_0x24e6b9];if('revisionHistoryLicenseKeyValid'==_0x33aaa9||'revisionHistoryLicenseKeyInvalid'==_0x33aaa9||'revisionHistoryLicenseKeyExpired'==_0x33aaa9||'revisionHistoryLicenseKeyDomainLimit'==_0x33aaa9||'revisionHistoryLicenseKeyNotAllowed'==_0x33aaa9||'revisionHistoryLicenseKeyEvaluationLimit'==_0x33aaa9||'revisionHistoryLicenseKeyUsageLimit'==_0x33aaa9){delete _0x4ab210[_0x24e6b9],_0x3a7c4a=_0x33aaa9,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'revisionHistoryLicenseKeyInvalid'==_0x3a7c4a&&_0x4ab210['_showLicenseError']('invalid'),'revisionHistoryLicenseKeyExpired'==_0x3a7c4a&&_0x4ab210['_showLicenseError']('expired'),'revisionHistoryLicenseKeyDomainLimit'==_0x3a7c4a&&_0x4ab210['_showLicenseError']('domainLimit'),'revisionHistoryLicenseKeyNotAllowed'==_0x3a7c4a&&_0x4ab210['_showLicenseError']('featureNotAllowed','RevisionHistory'),'revisionHistoryLicenseKeyEvaluationLimit'==_0x3a7c4a&&_0x4ab210['_showLicenseError']('evaluationLimit'),'revisionHistoryLicenseKeyUsageLimit'==_0x3a7c4a&&_0x4ab210['_showLicenseError']('usageLimit');},0x3e8);}async afterInit(){if(this['repository']['length']>0x0){const _0xf67e2c=this['repository']['getRevision'](0x0),_0x43e4ff=await this['getRevisionDocumentData'](_0xf67e2c),_0x58eb0c=await this['getRevisionRootsAttributes'](_0xf67e2c),_0x881748=this['_utils']['getRevisionRootsModelElements'](_0xf67e2c);this['_replaceEditorDataWithRevisionData'](_0x43e4ff,_0x58eb0c,_0x881748);}}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}setSource(_0x2d8575){this['_source']=_0x2d8575;}async update(){const _0x2bdc09=await this['_source']['getLatestVersion']();if(_0x2bdc09>this['currentRevision']['toVersion']){await this['_loadState']();const _0xfc8fb=this['buildRevisionData']({'revision':this['currentRevision'],'to':_0x2bdc09});_0xfc8fb['authors']=_0xfc8fb['authorsIds']['map'](_0x506ec2=>this['editor']['plugins']['get']('Users')['getUser'](_0x506ec2)),this['currentRevision']['_update'](_0xfc8fb);}}async['saveRevision'](_0x1347d6={},_0x3da9df=null){const _0x59d02b=[];await this['_loadState'](),this['_continueCurrentRevision']=!0x1,_0x3da9df>this['currentRevision']['toVersion']&&(_0x3da9df=null),null===_0x3da9df&&(_0x3da9df=await this['_source']['getLatestVersion']());const _0xe22cb1=this['_getFromVersion'](_0x3da9df),_0x546973=this['buildRevisionData']({'from':_0xe22cb1,'to':_0x3da9df});if(this['currentRevision']['toVersion']<_0x3da9df){const _0x33bfc2=this['buildRevisionData']({'revision':this['currentRevision'],'from':_0x3da9df,'to':_0x3da9df});_0x33bfc2['authors']=[],_0x33bfc2['authorsIds']=[],_0x33bfc2['id']=this['currentRevision']['id'],this['currentRevision']['_update'](_0x33bfc2,!0x0),delete _0x33bfc2['authors'],_0x59d02b['push'](_0x33bfc2);}_0x1347d6['creatorId']=this['editor']['plugins']['get']('Users')['me']['id'],_0x1347d6['name']=_0x1347d6['name']||null,_0x1347d6['id']=_0x1347d6['id']||_0x57bf97(),_0x1347d6={..._0x1347d6,..._0x546973};const _0x3f1ea1=this['addRevisionData'](_0x1347d6);_0x59d02b['push'](_0x1347d6);const _0x3758f1=this['repository']['getIndex'](_0x3f1ea1);if(0x0!==_0x3758f1){const _0x1da489=this['repository']['getRevision'](_0x3758f1-0x1);if(_0x1da489['fromVersion']!==_0x3da9df){const _0x3abeee=this['_revisionDataBuilder']['getData'](_0x3da9df,_0x1da489['toVersion']),_0x402be4={'id':_0x1da489['id'],'diffData':_0x3abeee['diffData'],'authorsIds':_0x3abeee['authorsIds'],'authors':_0x3abeee['authorsIds']['map'](_0x264284=>this['editor']['plugins']['get']('Users')['getUser'](_0x264284)),'fromVersion':_0x3da9df};_0x1da489===this['currentRevision']&&(_0x402be4['createdAt']=new Date(_0x1347d6['createdAt']['getTime']()+0xa)),_0x1da489['_update'](_0x402be4,!0x0),delete _0x402be4['authors'],_0x59d02b['push'](_0x402be4);}}if(this['adapter']){for(const _0x534578 of _0x59d02b)this['_bufferUpdate'](_0x534578['id'],_0x534578,!0x0);this['sendBufferedUpdates']();}return _0x3f1ea1;}addRevisionData(_0x5e9976){const _0x2f57ae=this['repository']['createRevision'](_0x5e9976);return this['adapter']&&_0x2f57ae['on']('_update',(_0x52866a,_0x2d04d7,_0x19471b)=>{_0x19471b||(this['_bufferUpdate'](_0x2d04d7['id'],_0x2d04d7,!0x0),this['sendBufferedUpdates']());}),this['repository']['addRevision'](_0x2f57ae,this['_findInsertionIndex'](_0x2f57ae)),_0x2f57ae;}async getRevisionDocumentData(_0x487bd7){return await this['_utils']['loadRevisionData'](_0x487bd7,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x487bd7);}async getRevisionRootsAttributes(_0xed1386){return await this['_utils']['loadRevisionData'](_0xed1386,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0xed1386);}sendBufferedUpdates(){if(0x0===this['_bufferedUpdates']['size'])return;if(this['_isPendingUpdate'])return;let _0x34bef0=Array['from'](this['_bufferedUpdates']['values']());this['_bufferedUpdates']['clear']();for(let _0x1aa826=0x0;_0x1aa826<_0x34bef0['length'];_0x1aa826++){const _0x50313f=_0x34bef0[_0x1aa826];let _0x29553a=!0x1;for(const _0x52b6c9 of Object['keys'](_0x50313f))void 0x0===_0x50313f[_0x52b6c9]?delete _0x50313f[_0x52b6c9]:'id'!==_0x52b6c9&&(_0x29553a=!0x0);_0x29553a||(_0x34bef0[_0x1aa826]=null);}if(_0x34bef0=_0x34bef0['filter'](_0x3353d6=>null!==_0x3353d6),!_0x34bef0['length'])return;for(let _0x80690b=0x0;_0x80690b<_0x34bef0['length'];_0x80690b++){const _0xb41cce=_0x34bef0[_0x80690b];void 0x0!==_0xb41cce['fromVersion']&&void 0x0===_0xb41cce['toVersion']&&(_0xb41cce['toVersion']=this['repository']['getRevision'](_0xb41cce['id'])['toVersion']),void 0x0!==_0xb41cce['toVersion']&&void 0x0===_0xb41cce['fromVersion']&&(_0xb41cce['fromVersion']=this['repository']['getRevision'](_0xb41cce['id'])['fromVersion']);}const _0x59f5c3=this['editor']['config']['get']('collaboration.channelId');this['_isPendingUpdate']=!0x0,this['_addPendingAction'](),this['adapter']['updateRevisions'](_0x34bef0,_0x59f5c3)['finally'](()=>{this['_isPendingUpdate']=!0x1;})['then'](_0x2da85b=>{if(_0x2da85b){for(const _0x43393c of _0x2da85b)this['setRevisionData']({'id':_0x43393c['id'],'createdAt':_0x43393c['createdAt']});}this['_removePendingAction'](),this['sendBufferedUpdates']();});}buildRevisionData({revision:_0x1c4556=null,from:_0x233b56=null,to:_0x5641b8=null}){_0x233b56=null!==_0x233b56?_0x233b56:_0x1c4556['fromVersion'],_0x5641b8=null!==_0x5641b8?_0x5641b8:_0x1c4556['toVersion'];const _0x13f361=this['_revisionDataBuilder']['getData'](_0x233b56,_0x5641b8),_0x2c828b={'diffData':_0x13f361['diffData'],'authorsIds':_0x13f361['authorsIds'],'fromVersion':_0x233b56,'toVersion':_0x5641b8};if(!_0x1c4556||_0x5641b8!==_0x1c4556['toVersion']){const _0x48b3cd=_0x5641b8-0x1,_0x53e573=this['_source']['history']['getOperation'](_0x48b3cd);_0x2c828b['createdAt']=_0x53e573&&_0x53e573['createdAt']||new Date();}if(this['_loadedStateData']&&_0x233b56===this['_loadedStateData']['fromVersion']){for(const _0x5a2e27 of this['_loadedStateData']['authors'])_0x2c828b['authorsIds']['includes'](_0x5a2e27['id'])||_0x2c828b['authorsIds']['push'](_0x5a2e27['id']);}return _0x2c828b;}_bufferUpdate(_0x562da3,_0x4e4c15,_0xfdec27){if(this['_bufferedUpdates']['has'](_0x562da3)){const _0x355c7b=this['_bufferedUpdates']['get'](_0x562da3);_0x4e4c15=_0xfdec27?{..._0x355c7b,..._0x4e4c15}:{..._0x4e4c15,..._0x355c7b};}this['_bufferedUpdates']['set'](_0x562da3,_0x4e4c15);}setRevisionData(_0x209fb0){const _0x5ff497=this['repository']['getRevision'](_0x209fb0['id']);if(_0x209fb0['createdAt']&&(_0x209fb0['createdAt']=new Date(_0x209fb0['createdAt'])),_0x209fb0['authorsIds']){const _0xcb7b07=this['editor']['plugins']['get']('Users');_0x209fb0['authors']=_0x209fb0['authorsIds']['map'](_0x532777=>_0xcb7b07['getUser'](_0x532777));}_0x5ff497['_update'](_0x209fb0,!0x0);}_createInitialRevision(_0x498aaa){const _0x5e072c=this['repository']['getRevision'](this['repository']['length']-0x1);if(_0x5e072c)this['_initialRevisionId']=_0x5e072c['id'];else{const _0x465e11=!this['editor']['model']['document']['roots']['find'](_0x1dc58e=>this['editor']['model']['hasContent'](_0x1dc58e)),_0x5be7d5=this['editor']['plugins']['get']('Users')['me']['id'],_0x465919=pt(this['editor']['locale'],_0x465e11?'Empty\x20document':'Initial\x20revision');this['_makeRevision']({'from':_0x498aaa,'to':_0x498aaa,'id':this['_initialRevisionId'],'name':_0x465919,'creatorId':_0x5be7d5});}}_createCurrentRevision(_0x887881){const _0x29ab4d=this['_source']['getCurrentRevisionId']();this['currentRevision']=this['repository']['getRevision'](_0x29ab4d),this['currentRevision']||(this['currentRevision']=this['_makeRevision']({'from':_0x887881,'to':_0x887881,'id':_0x29ab4d,'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(_0x3a9a17,_0x4c4ce9,_0x3128a7){const _0x3ec623={},_0x2df7a5={},_0xd0d681={},_0x5a7ef2=this['editor']['config']['get']('roots')||{};for(const [_0x3c12bd,_0x185989]of Object['entries'](_0x5a7ef2))_0x185989['lazyLoad']||(_0x3ec623[_0x3c12bd]=_0x185989['initialData']??'',_0x2df7a5[_0x3c12bd]=_0x185989['modelAttributes']||{},_0x185989['modelElement']&&(_0xd0d681[_0x3c12bd]=_0x185989['modelElement']));for(const _0x341cc4 of this['editor']['model']['document']['getRootNames']())_0x3ec623[_0x341cc4]??='',_0x2df7a5[_0x341cc4]??={};let _0x155d69=!0x1;const _0x223f17=Object['keys'](_0x3ec623),_0x57e1ec=Object['keys'](_0x3a9a17);for(const _0x4acb52 of _0x223f17){if(_0x3ec623[_0x4acb52]!==_0x3a9a17[_0x4acb52]&&''!==_0x3ec623[_0x4acb52]['trim']()){_0x155d69=!0x0;break;}if(!_0x3234cf(_0x2df7a5[_0x4acb52],_0x4c4ce9[_0x4acb52])&&Object['keys'](_0x2df7a5[_0x4acb52])['length']>0x0){_0x155d69=!0x0;break;}const _0x23ab5e=_0xd0d681[_0x4acb52],_0x2b97dd=_0x3128a7[_0x4acb52];if(_0x23ab5e&&_0x2b97dd&&_0x23ab5e!==_0x2b97dd){_0x155d69=!0x0;break;}}_0x155d69||(_0x155d69=_0x57e1ec['some'](_0x39709b=>!this['editor']['model']['document']['getRoot'](_0x39709b))),_0x155d69&&_0x19d36f('editor-initial-data-replaced-with-revision-data',{'editorData':_0x3ec623,'editorRootsAttributes':_0x2df7a5,'editorRootsModelElements':_0xd0d681,'revisionData':_0x3a9a17,'revisionRootsAttributes':_0x4c4ce9,'revisionRootsModelElements':_0x3128a7});for(const [_0x389769,_0xcad9c0]of Object['entries'](_0x3a9a17))this['editor']['config']['set']('roots.'+_0x389769+'.initialData',_0xcad9c0);for(const [_0x137e54,_0xa37bbe]of Object['entries'](_0x4c4ce9))this['editor']['config']['set']('roots.'+_0x137e54+'.modelAttributes',_0xa37bbe);const _0x24e5f7=this['editor']['model']['document'];for(const [_0x2f4feb,_0x37f189]of Object['entries'](_0x3128a7)){this['editor']['config']['set']('roots.'+_0x2f4feb+'.modelElement',_0x37f189);const _0x4c2d7b=_0x24e5f7['getRoot'](_0x2f4feb);_0x4c2d7b&&_0x4c2d7b['name']!==_0x37f189&&(_0x24e5f7['roots']['remove'](_0x2f4feb),_0x24e5f7['createRoot'](_0x37f189,_0x2f4feb));}}_addPendingAction(){if(!this['_pendingAction']){const _0xe07f1=this['editor']['plugins']['get']('PendingActions');this['_pendingAction']=_0xe07f1['add'](pt(this['editor']['locale'],'PENDING_ACTION_REVISION_HISTORY'));}}_removePendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get']('PendingActions')['remove'](this['_pendingAction']),this['_pendingAction']=null);}_findInsertionIndex(_0x50f637){const _0x197299=this['repository']['getRevisions']();_0x197299['reverse']();let _0x32d07e=0x0;for(;_0x32d07e<_0x197299['length'];){const _0x218881=_0x197299[_0x32d07e];if(_0x218881===this['currentRevision']){_0x32d07e++;continue;}if(_0x218881['id']===this['_initialRevisionId'])break;const _0x4b6dde=_0x50f637['toVersion']-_0x218881['toVersion']||_0x50f637['fromVersion']-_0x218881['fromVersion'];if(_0x4b6dde>0x0)break;if(_0x4b6dde<0x0)_0x32d07e++;else{if(!_0x50f637['creator']&&_0x218881['creator'])break;if(_0x218881['creator']||!_0x50f637['creator']){if(_0x50f637['createdAt']>_0x218881['createdAt'])break;_0x32d07e++;}else _0x32d07e++;}}return _0x32d07e;}_getFromVersion(_0x277760){const _0xeac0d3=this['repository']['getRevisions']();_0xeac0d3['reverse'](),_0xeac0d3['shift']();const _0xd55bf0=_0xeac0d3['find'](_0x1ba079=>_0x1ba079['toVersion']<=_0x277760)['toVersion'];return _0xd55bf0<this['_startingVersion']?this['_startingVersion']:_0xd55bf0;}['_makeRevision']({name:_0x36d64b,from:_0x3d4cf4,to:_0x49ed7e,creatorId:_0x55d6b9,id:_0xd5aebf}){const _0x522b08=this['buildRevisionData']({'from':_0x3d4cf4,'to':_0x49ed7e});_0x522b08['name']=_0x36d64b,_0x522b08['creatorId']=_0x55d6b9,_0x522b08['id']=_0xd5aebf;const _0x299a5c=this['addRevisionData'](_0x522b08);return this['adapter']&&this['_bufferUpdate'](_0x522b08['id'],_0x522b08,!0x0),_0x299a5c;}_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(_0x586f35){this['editor']=_0x586f35,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(_0x43439f){this['source']=_0x43439f;const _0x4006b8=new Map(),_0x555570=new Map(),_0x1d9bc1=this['editor']['model']['document']['roots']['map'](_0x512c85=>_0x512c85['rootName']);for(const _0x3e6dd4 of _0x1d9bc1){const _0x104b7d=this['editor']['model']['document']['getRoot'](_0x3e6dd4),_0x23da86=bt(_0x104b7d);_0x4006b8['set'](_0x3e6dd4,_0x23da86),_0x555570['set'](_0x3e6dd4,Object['fromEntries'](_0x104b7d['getAttributes']()));}const _0x3c70da=Array['from'](this['editor']['model']['markers'])['map'](_0x2e756d=>[_0x2e756d['name'],_0x2e756d['getRange']()]),_0x31b9f4=this['source']['version'];this['_saveMetaData'](_0x31b9f4,_0x4006b8,_0x3c70da,_0x555570),this['_startingRevisionId']=this['_revisionId'];const _0x50acd5=new Map(),_0x8c3051=new Map();for(const _0x89a20b of _0x1d9bc1){const _0x119054=Rt(_0x89a20b,this['editor']['model']['document']['getRoot'](_0x89a20b)['name']);_0x50acd5['set'](_0x89a20b,_0x119054),_0x8c3051['set'](_0x89a20b,{});}this['_saveMetaData'](Number['NEGATIVE_INFINITY'],_0x50acd5,[],_0x8c3051);}getData(_0x5f2c6e,_0x2bb946){if(this['_lastFrom']===_0x5f2c6e&&this['_lastTo']<=_0x2bb946)this['_savedMetaData']['size']>0x1&&this['_removeMetaData'](this['_lastTo']),this['_applyOperations'](this['_lastTo'],_0x2bb946,!0x0);else{if(!this['_savedMetaData']['has'](_0x5f2c6e)){const _0x10fbc8=this['_getPreviousFrom'](_0x5f2c6e);this['_calculateMetaData'](_0x10fbc8,_0x5f2c6e,!0x1);}this['_calculateMetaData'](_0x5f2c6e,_0x2bb946,!0x0);}return this['_lastFrom']=_0x5f2c6e,this['_lastTo']=_0x2bb946,this['_getState']();}loadState(_0x581b49){if(!this['_savedMetaData']['has'](_0x581b49['fromVersion'])){const _0x41b909=this['_getPreviousFrom'](_0x581b49['fromVersion']);this['_calculateMetaData'](_0x41b909,_0x581b49['fromVersion'],!0x1);}this['_calculateMetaData'](_0x581b49['fromVersion'],_0x581b49['toVersion'],!0x1);const _0x29d9a0=this['editor']['plugins']['get']('RevisionHistoryUtils');this['_reset'](),this['_lastFrom']=_0x581b49['fromVersion'],this['_lastTo']=_0x581b49['toVersion'];for(const _0x8e9742 in _0x581b49['diffData']){const _0x349811=_0x581b49['diffData'][_0x8e9742]['attachChange'],_0x53d53b=_0x4dfa2c(_0x581b49['diffData'][_0x8e9742]['attributesBefore'])||{},_0x4abdbd=_0x581b49['diffData'][_0x8e9742],_0x828353=_0x29d9a0['_makeModelFromViewString'](_0x4abdbd['deletions'],_0x4abdbd['rootElementName']||'$root');_0x828353['rootName']=_0x8e9742,_0x828353['_isAttached']=!_0x349811||!_0x349811['isAttached'],_0x828353['isAttached']=()=>_0x828353['_isAttached'],this['_baseRoots']['set'](_0x8e9742,_0x828353),this['_baseRootsAttributes']['set'](_0x8e9742,_0x53d53b),_0x349811&&this['_touchedRoots']['set'](_0x8e9742,_0x349811);const _0x38f25e=this['_makeIdsRoot'](_0x828353);this['_baseIdsRoots']['set'](_0x8e9742,_0x38f25e);for(const [_0x30c43f,_0x415b2e]of _0x828353['markers']){if(!_0x30c43f['startsWith']('revision:'))continue;const _0x33faca=_0x30c43f['split'](':')[0x2];for(const _0x2bb905 of _0x415b2e['getWalker']({'singleCharacters':!0x0})){const _0x388b69=this['_getVidAttributeName'](_0x2bb905),_0x281f46='elementEnd'==_0x2bb905['type']?_0x2bb905['previousPosition']['path']['slice'](0x0,-0x1):_0x2bb905['previousPosition']['path'],_0x5688f5=_0x38f25e['getNodeByPath'](_0x281f46)['getAttribute'](_0x388b69);this['_touched']['set'](_0x5688f5,{'userId':_0x33faca});}_0x828353['markers']['delete'](_0x30c43f);}}this['_startingRevisionId']=this['_revisionId'];const _0x57fa3f=[...Array(this['_revisionId'])['keys']()]['slice'](0x1)['filter'](_0x257b60=>!this['_touched']['has'](_0x257b60));let _0x4bbd67=0x0;const _0x3c7791=new Map();for(const _0xa1bccf in _0x581b49['diffData']){const _0xf34584=_0x581b49['diffData'][_0xa1bccf]['attachChange'],_0x2ac917=_0x4dfa2c(_0x581b49['diffData'][_0xa1bccf]['attributesAfter'])||{},_0x584915=_0x581b49['diffData'][_0xa1bccf],_0x3586b1=_0x29d9a0['_makeModelFromViewString'](_0x584915['insertions'],_0x584915['rootElementName']||'$root');_0x3586b1['rootName']=_0xa1bccf,_0x3586b1['_isAttached']=!_0xf34584||_0xf34584['isAttached'],_0x3586b1['isAttached']=()=>_0x3586b1['_isAttached'],this['_diffRoots']['set'](_0xa1bccf,_0x3586b1),this['_diffRootsAttributes']['set'](_0xa1bccf,_0x2ac917);const _0x3895ca=this['_makeIdsRoot'](_0x3586b1,Number['NEGATIVE_INFINITY']);this['_idsRoots']['set'](_0xa1bccf,_0x3895ca),_0x3c7791['set'](_0xa1bccf,_0x3586b1['isAttached']()?_0x2ac917:{});for(const [_0x477e7b,_0x552b93]of _0x3586b1['markers']){if(!_0x477e7b['startsWith']('revision:'))continue;const _0x229618=_0x477e7b['split'](':')[0x2];for(const _0x4f913b of _0x552b93['getWalker']({'singleCharacters':!0x0})){const _0x26a76c=this['_getVidAttributeName'](_0x4f913b),_0xfa59b3=this['_revisionId']++,_0x4ec629='elementEnd'==_0x4f913b['type']?_0x4f913b['previousPosition']['path']['slice'](0x0,-0x1):_0x4f913b['previousPosition']['path'];_0x3895ca['getNodeByPath'](_0x4ec629)['_setAttribute'](_0x26a76c,_0xfa59b3),this['_touched']['set'](_0xfa59b3,{'userId':_0x229618});}_0x3586b1['markers']['delete'](_0x477e7b);}for(const _0x5e9783 of this['editor']['model']['createRangeIn'](_0x3586b1)['getWalker']({'singleCharacters':!0x0})){const _0x30820f=this['_getVidAttributeName'](_0x5e9783),_0x5ddabd='elementEnd'==_0x5e9783['type']?_0x5e9783['previousPosition']['path']['slice'](0x0,-0x1):_0x5e9783['previousPosition']['path'],_0x2c689e=_0x3895ca['getNodeByPath'](_0x5ddabd);_0x2c689e['getAttribute'](_0x30820f)>0x0||_0x2c689e['_setAttribute'](_0x30820f,_0x57fa3f[_0x4bbd67++]);}for(const [_0x2ffe9f,_0x17c7bf]of _0x3586b1['markers'])_0x2ffe9f['startsWith']('revision:')||this['_markers']['set'](_0x2ffe9f,_0x17c7bf);}const {roots:_0x277447}=this['_savedMetaData']['get'](_0x581b49['fromVersion']),{roots:_0x36a086}=this['_savedMetaData']['get'](_0x581b49['toVersion']),_0x3b92a8=bt(_0x277447['get']('$graveyard'));this['_baseRoots']['set']('$graveyard',_0x3b92a8),this['_baseIdsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x3b92a8,Number['NEGATIVE_INFINITY']));const _0x4d48c3=bt(_0x36a086['get']('$graveyard'));this['_diffRoots']['set']('$graveyard',_0x4d48c3),this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x4d48c3));const _0x1309a4=Array['from'](this['_diffRoots'])['map'](([_0x497cb3,_0x4a6b9b])=>[_0x497cb3,bt(_0x4a6b9b)]);this['_saveMetaData'](this['_lastTo'],_0x1309a4,this['_markers'],_0x3c7791);}reInit(){this['_reset'](),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_savedMetaData']['clear'](),this['init'](this['source']);}_saveMetaData(_0x7b38b2,_0x4ddb03,_0x258d87,_0x488f44){const _0x199552=new Map(_0x4ddb03),_0x3e3d24=new Map(_0x4dfa2c(_0x488f44)),_0x466ef2=new Map();for(const [_0x23389e,_0x5bcd8a]of _0x258d87)_0x466ef2['set'](_0x23389e,{'start':_0x5bcd8a['start']['clone'](),'end':_0x5bcd8a['end']['clone'](),'rootName':_0x5bcd8a['root']['rootName']});this['_savedMetaData']['set'](_0x7b38b2,{'roots':_0x199552,'markers':_0x466ef2,'rootsAttributes':_0x3e3d24});}_removeMetaData(_0x943047){this['_savedMetaData']['delete'](_0x943047);}_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(_0x4cb81e,_0x2b5255=null){let _0x4e2a5d=null;_0x4cb81e['is']('documentFragment')||(_0x4e2a5d=new _0x44d48b(_0x4cb81e['name'],{'vid_start':null===_0x2b5255?this['_revisionId']++:_0x2b5255++}));const _0x3c2747=[];for(const _0x1b6100 of _0x4cb81e['getChildren']())if(_0x1b6100['is']('element')){_0x3c2747['push'](this['_makeIdsRoot'](_0x1b6100,_0x2b5255));const _0x19a173=_0x3c2747[_0x3c2747['length']-0x1];null!==_0x2b5255&&(_0x2b5255=_0x19a173['is']('element','$text')?_0x19a173['getAttribute']('vid')+0x1:_0x19a173['getAttribute']('vid_end')+0x1);}else{for(let _0x303677=0x0;_0x303677<_0x1b6100['offsetSize'];_0x303677++)_0x3c2747['push'](new _0x44d48b('$text',{'vid':null===_0x2b5255?this['_revisionId']++:_0x2b5255++}));}if(_0x4cb81e['is']('documentFragment')){const _0x4a9f16=Rt(_0x4cb81e['rootName'],_0x4cb81e['name']);return _0x4a9f16['_insertChild'](0x0,_0x3c2747),_0x4a9f16;}return _0x4e2a5d['_setAttribute']('vid_end',null===_0x2b5255?this['_revisionId']++:_0x2b5255),_0x4e2a5d['_insertChild'](0x0,_0x3c2747),_0x4e2a5d;}_calculateMetaData(_0x2527c4,_0x467200,_0x8e35a9){this['_reset']();const {roots:_0x18ac92,markers:_0x38e394,rootsAttributes:_0xdf87b1}=this['_savedMetaData']['get'](_0x2527c4);this['_baseRoots']=new Map(_0x18ac92),this['_baseRootsAttributes']=new Map(_0x4dfa2c(_0xdf87b1));for(const [_0x2f1677,_0x2a2442]of this['_baseRoots'])if('$graveyard'!==_0x2f1677&&(this['_diffRoots']['set'](_0x2f1677,bt(_0x2a2442)),this['_diffRootsAttributes']=new Map(_0x4dfa2c(_0xdf87b1)),_0x8e35a9)){const _0x5c022e=this['_revisionId'];this['_idsRoots']['set'](_0x2f1677,this['_makeIdsRoot'](_0x2a2442)),this['_baseIdsRoots']['set'](_0x2f1677,this['_makeIdsRoot'](_0x2a2442,_0x5c022e));}this['_startingRevisionId']=this['_revisionId'],this['_diffRoots']['set']('$graveyard',bt(this['_baseRoots']['get']('$graveyard'))),_0x8e35a9&&this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](this['_baseRoots']['get']('$graveyard')));for(const [_0x2ee195,_0x482653]of _0x38e394){const _0x7e794f=this['_baseRoots']['get'](_0x482653['rootName']),_0x24123b=this['_diffRoots']['get'](_0x482653['rootName']),_0x4a7ff1=new _0x50ed46(this['_fixPosition'](_0x482653['start'],_0x7e794f),this['_fixPosition'](_0x482653['end'],_0x7e794f)),_0x50b212=this['_fixRange'](_0x4a7ff1,_0x24123b);_0x7e794f['markers']['set'](_0x2ee195,_0x4a7ff1),this['_markers']['set'](_0x2ee195,_0x50b212);}this['_applyOperations'](_0x2527c4,_0x467200,_0x8e35a9);}_applyOperations(_0x444b54,_0x430368,_0x3919b9){for(const _0x5529fc of this['source']['getOperations'](_0x444b54,_0x430368))this['_handleOperation'](_0x5529fc,_0x3919b9);for(const _0x27a34e of this['_diffRoots']['values']())_0x27a34e['markers']['clear']();for(const [_0x8d791d,_0xfb4c45]of this['_markers'])this['_diffRoots']['get'](_0xfb4c45['root']['rootName'])['markers']['set'](_0x8d791d,_0xfb4c45['clone']());const _0x5959ce=new Map(),_0x35d5c6=new Map();for(const [_0x15e2e8,_0x5a63c2]of this['_diffRoots'])_0x5959ce['set'](_0x15e2e8,bt(_0x5a63c2)),_0x35d5c6['set'](_0x15e2e8,this['_diffRootsAttributes']['get'](_0x15e2e8));this['_saveMetaData'](_0x430368,_0x5959ce,this['_markers'],_0x35d5c6);}_getPreviousFrom(_0x5d828b){const _0x4b9dce=Array['from'](this['_savedMetaData']['keys']());_0x4b9dce['sort']((_0x22d8bd,_0x1f336c)=>_0x22d8bd-_0x1f336c),_0x4b9dce['reverse']();for(const _0x14a391 of _0x4b9dce)if(_0x14a391<_0x5d828b)return _0x14a391;return Number['NEGATIVE_INFINITY'];}['_copyMarkers'](_0x1eb1ce,_0x2daad5){const _0x55cd18=Array['from'](_0x2daad5['markers'])['map'](([_0x43b082,_0x287ca1])=>[_0x43b082,this['_fixRange'](_0x287ca1,_0x1eb1ce)]);_0x1eb1ce['markers']=new Map(_0x55cd18);}_transformMarkers(_0x2fb720){for(const _0x556310 of this['_markers']['values']()){const _0x1c6a3b=_0x556310['getTransformedByOperation'](_0x2fb720),_0x5e1097=_0x50ed46['_createFromRanges'](_0x1c6a3b);_0x556310['start']=_0x5e1097['start'],_0x556310['end']=_0x5e1097['end'];}}_handleOperation(_0x483cd5,_0x2e11e0){if('addRoot'!=_0x483cd5['type']&&'detachRoot'!=_0x483cd5['type']){if('insert'==_0x483cd5['type']){const _0x1410e8=_0x483cd5['position']['root'],_0x45f5a7=_0x1410e8['rootName'],_0x343dd5=_0x1410e8['name'];this['_diffRoots']['has'](_0x45f5a7)||(this['_diffRoots']['set'](_0x45f5a7,Rt(_0x45f5a7,_0x343dd5,!0x0)),this['_diffRootsAttributes']['set'](_0x45f5a7,{}),_0x2e11e0&&this['_idsRoots']['set'](_0x45f5a7,Rt(_0x45f5a7,_0x343dd5,!0x0)));}else{if('addRootAttribute'==_0x483cd5['type']||'removeRootAttribute'==_0x483cd5['type']||'changeRootAttribute'==_0x483cd5['type'])return void this['_handleRootAttributeOperation'](_0x483cd5);'marker'==_0x483cd5['type']&&this['_handleMarkerOperation'](_0x483cd5);}if('marker'!==_0x483cd5['type']){const _0x16e678=this['_cloneOperation'](_0x483cd5,this['_diffRoots']);_0x16e678['_execute'](),this['_transformMarkers'](_0x16e678);}if(_0x2e11e0)switch(_0x483cd5['type']){case'insert':this['_handleInsertOperation'](_0x483cd5);break;case'move':case'remove':case'reinsert':this['_handleMoveOperation'](_0x483cd5);break;case'merge':this['_handleMergeOperation'](_0x483cd5);break;case'split':this['_handleSplitOperation'](_0x483cd5);}}else this['_handleRootOperation'](_0x483cd5,_0x2e11e0);}_cloneOperation(_0x19bf2f,_0x20f52e){const _0x34e909=_0x19bf2f['clone']();return _0x34e909['_authorId']=_0x19bf2f['_authorId'],this['_fixOperation'](_0x34e909,_0x20f52e),_0x34e909;}_getBaseVids(_0x21b8e1){return _0x21b8e1['map'](_0x143c6b=>{const _0x35cdce=this['_getVidAttributeName'](_0x143c6b);return Number(_0x143c6b['item']['getAttribute'](_0x35cdce));});}_generateTape(_0x140bdf,_0x4ad41f){if(_0x140bdf['is']('element','$text'))_0x4ad41f['push']({'item':_0x140bdf,'type':'text'});else{_0x140bdf['is']('element')&&_0x4ad41f['push']({'item':_0x140bdf,'type':'elementStart'});for(const _0x20b46c of _0x140bdf['getChildren']())this['_generateTape'](_0x20b46c,_0x4ad41f);_0x140bdf['is']('element')&&_0x4ad41f['push']({'item':_0x140bdf,'type':'elementEnd'});}return _0x4ad41f;}_getState(){const _0x595e54=new Map(this['_touched']),_0x3a30e6=new Map(_0x595e54),_0x4bb5cc=new Map(),_0xddc946={'insertions':{},'deletions':{}},_0x35154e={'insertions':{},'deletions':{}},_0x2fb281=new Map(),_0x4fa42b=new Set([...this['_baseRoots']['keys'](),...this['_diffRoots']['keys']()]),_0x3d989c=new Map();_0x4fa42b['delete']('$graveyard');for(const _0x3a76b1 of _0x4fa42b){const _0xc1ab53=(this['_diffRoots']['get'](_0x3a76b1)??this['_baseRoots']['get'](_0x3a76b1))['name'],_0x5d5e66=this['_diffRoots']['get'](_0x3a76b1)||Rt(_0x3a76b1,_0xc1ab53,!0x1),_0x3313cb=this['_baseRoots']['get'](_0x3a76b1)||Rt(_0x3a76b1,_0xc1ab53,!0x1);_0x5d5e66['isAttached']()||_0x3313cb['isAttached']()?(_0x3d989c['set'](_0x3a76b1,_0xc1ab53),_0xddc946['insertions'][_0x3a76b1]=bt(_0x5d5e66),_0xddc946['deletions'][_0x3a76b1]=bt(_0x3313cb),this['_copyMarkers'](_0xddc946['deletions'][_0x3a76b1],_0x3313cb),this['_copyMarkers'](_0xddc946['insertions'][_0x3a76b1],_0x5d5e66),_0x35154e['insertions'][_0x3a76b1]=this['_generateTape'](this['_idsRoots']['get'](_0x3a76b1),[]),_0x35154e['deletions'][_0x3a76b1]=this['_generateTape'](this['_baseIdsRoots']['get'](_0x3a76b1)||Rt(_0x3a76b1,_0xc1ab53,!0x1),[])):_0x4fa42b['delete'](_0x3a76b1);}for(const _0x349871 of _0x4fa42b){const _0x1df5de=_0x35154e['insertions'][_0x349871];for(const _0x114705 of _0x1df5de){const _0x57073d=this['_getVidAttributeName'](_0x114705),_0x539721=_0x114705['item']['getAttribute'](_0x57073d);_0x3a30e6['delete'](_0x539721),_0x539721>=this['_startingRevisionId']&&_0x4bb5cc['set'](_0x539721,_0x595e54['get'](_0x539721));}}for(const _0x39b914 of _0x4fa42b){const _0x48e105=_0x35154e['insertions'][_0x39b914],_0x3cc0dc=this['_getBaseVids'](_0x35154e['deletions'][_0x39b914]);let _0x48c1a4=0x0;for(const _0x5430d2 of _0x48e105){const _0x44c0da=this['_getVidAttributeName'](_0x5430d2),_0xf1a4dc=_0x5430d2['item']['getAttribute'](_0x44c0da);if(!_0x4bb5cc['has'](_0xf1a4dc)&&!_0x2fb281['has'](_0xf1a4dc)){if(_0x3a30e6['has'](_0xf1a4dc))_0x48c1a4++;else{if(_0xf1a4dc!=_0x3cc0dc[_0x48c1a4]){const _0x53f379=_0x595e54['get'](_0xf1a4dc)||_0x595e54['get'](_0x3cc0dc[_0x48c1a4]);for(;_0xf1a4dc!=_0x3cc0dc[_0x48c1a4];)_0x3a30e6['has'](_0x3cc0dc[_0x48c1a4])||(_0x2fb281['set'](_0x3cc0dc[_0x48c1a4],_0x53f379),_0x595e54['set'](_0x3cc0dc[_0x48c1a4],_0x53f379)),_0x48c1a4++;}_0x48c1a4++;}}}}for(const _0x4edc4d of _0x4fa42b){const _0xa2a81b=_0x35154e['insertions'][_0x4edc4d];for(const _0x4bf1c8 of _0xa2a81b){const _0xed20f=this['_getVidAttributeName'](_0x4bf1c8),_0x47ab93=_0x4bf1c8['item']['getAttribute'](_0xed20f);if(_0x2fb281['has'](_0x47ab93)){const _0x284a25=_0x2fb281['get'](_0x47ab93);_0x3a30e6['has'](_0x47ab93)||_0x3a30e6['set'](_0x47ab93,{..._0x284a25}),_0x4bb5cc['set'](_0x47ab93,{..._0x284a25});}}}for(const _0xf2441b of _0x3a30e6['keys']())_0xf2441b>=this['_startingRevisionId']&&_0x3a30e6['delete'](_0xf2441b);const _0x3661f6=new Map();for(const _0x8a61b2 of _0x4fa42b){let _0x1ba23b=_0x35154e['insertions'][_0x8a61b2];for(const _0x2da6eb of _0x1ba23b)if(_0x2da6eb['item']['is']('element','tableCell')){const _0x4bea1d=this['_getVidAttributeName'](_0x2da6eb),_0x4b4e26=_0x2da6eb['item']['getAttribute'](_0x4bea1d);if(_0x4bb5cc['has'](_0x4b4e26)){const _0x1c2f4b=_0x2da6eb['item']['parent']['parent']['getAttribute']('vid_start'),_0xa5cbf9=_0x3661f6['get'](_0x1c2f4b)||new Set();_0xa5cbf9['add'](_0x4bb5cc['get'](_0x4b4e26)['userId']),_0x3661f6['set'](_0x1c2f4b,_0xa5cbf9);}}_0x1ba23b=_0x35154e['deletions'][_0x8a61b2];for(const _0x2ea75a of _0x1ba23b)if(_0x2ea75a['item']['is']('element','tableCell')){const _0x3488ed=this['_getVidAttributeName'](_0x2ea75a),_0x5bfaef=_0x2ea75a['item']['getAttribute'](_0x3488ed);if(_0x3a30e6['has'](_0x5bfaef)){const _0x3d3d7f=_0x2ea75a['item']['parent']['parent']['getAttribute']('vid_start'),_0x4521da=_0x3661f6['get'](_0x3d3d7f)||new Set();_0x4521da['add'](_0x3a30e6['get'](_0x5bfaef)['userId']),_0x3661f6['set'](_0x3d3d7f,_0x4521da);}}for(const _0x2b3a0b of _0x3661f6['keys']())(_0x4bb5cc['has'](_0x2b3a0b)||_0x3a30e6['has'](_0x2b3a0b))&&_0x3661f6['delete'](_0x2b3a0b);}for(const _0x3d22ca of _0x4fa42b){const _0x31fbe0=_0x35154e['insertions'][_0x3d22ca];let _0x48e9f4=null,_0x48b009=null;for(const _0xe7d5e0 of _0x31fbe0){const _0x11e493=this['_getVidAttributeName'](_0xe7d5e0),_0x3bb80d=_0xe7d5e0['item']['getAttribute'](_0x11e493),_0x2122ea=_0x3661f6['get'](_0x3bb80d);_0x2122ea&&'elementStart'==_0xe7d5e0['type']&&(_0x48e9f4=Array['from'](_0x2122ea)[0x0],_0x48b009=_0xe7d5e0['item']['getAttribute']('vid_end')),_0x48e9f4&&(_0x3a30e6['set'](_0x3bb80d,{'userId':_0x48e9f4}),_0x4bb5cc['set'](_0x3bb80d,{'userId':_0x48e9f4})),_0x3bb80d==_0x48b009&&(_0x48e9f4=null,_0x48b009=null);}}const _0x1a3c8c={},_0x55b3dd=new Set();for(const _0x5516ad of _0x4fa42b){const _0xde6126=_0xddc946['deletions'][_0x5516ad],_0x4927e3=_0xddc946['insertions'][_0x5516ad];for(const {userId:_0x1ee7cc}of this['_touchedMarkers']['values']())null!==_0x1ee7cc&&_0x55b3dd['add'](_0x1ee7cc);for(const {userId:_0x25f2e7}of this['_touchedRoots']['values']())null!==_0x25f2e7&&_0x55b3dd['add'](_0x25f2e7);this['_markChanges'](_0x4927e3,_0x35154e['insertions'][_0x5516ad],_0x4bb5cc,'insertion',_0x55b3dd),this['_markChanges'](_0xde6126,_0x35154e['deletions'][_0x5516ad],_0x3a30e6,'deletion',_0x55b3dd),_0x1a3c8c[_0x5516ad]={'insertions':this['_prepareViewToSave'](_0x4927e3),'deletions':this['_prepareViewToSave'](_0xde6126),'attachChange':this['_touchedRoots']['get'](_0x5516ad)||null,'attributesBefore':_0x4dfa2c(this['_baseRootsAttributes']['get'](_0x5516ad))||{},'attributesAfter':_0x4dfa2c(this['_diffRootsAttributes']['get'](_0x5516ad)),'rootElementName':_0x3d989c['get'](_0x5516ad)};}return{'diffData':_0x1a3c8c,'authorsIds':Array['from'](_0x55b3dd)};}_processRootBeforeSave(_0x3ed922){for(const [,_0x9fe5ee]of _0x3ed922['markers']){const _0x5b40ea=_0x9fe5ee['start']['getAncestors']()['filter'](_0x3b6287=>'tableCell'==_0x3b6287['name']);for(const _0x277e95 of _0x5b40ea)0x1==_0x277e95['childCount']&&_0x277e95['getChild'](0x0)['is']('element','paragraph')&&_0x277e95['getChild'](0x0)['_setAttribute']('keepParagraph',!0x0);}}['_prepareViewToSave'](_0x48e68a){this['_processRootBeforeSave'](_0x48e68a);const _0x545a7e=this['editor']['data']['toView'](_0x48e68a,{}),_0x199b6b=Array['from'](_0x545a7e['getChildren']())['map'](_0x54326f=>this['_getViewJson'](_0x54326f));return JSON['stringify'](_0x199b6b);}_getViewJson(_0x134572){if(_0x134572['is']('$text'))return _0x134572['data'];{const _0x45552f=this['editor']['plugins']['get']('RevisionHistoryUtils'),_0x272dde=_0x134572,_0x25997e=this['editor']['data']['htmlProcessor']['domConverter'],_0x2c1eeb={'type':_0x45552f['_getTypeCharForViewElement'](_0x272dde),'name':_0x272dde['name'],'attributes':Array['from'](_0x272dde['getAttributes']()),'children':Array['from'](_0x272dde['getChildren']())['map'](_0x27f3f7=>this['_getViewJson'](_0x27f3f7))};if(_0x134572['is']('uiElement')&&'$comment'!=_0x134572['name']){const _0x4844f2=_0x134572['render'](_0x25997e['domDocument'],_0x25997e);_0x2c1eeb['children']['push'](_0x4844f2['outerHTML']);}else{if(_0x134572['is']('rawElement')){const _0x3ed7c1=_0x25997e['domDocument']['createElement'](_0x272dde['name']);_0x134572['render'](_0x3ed7c1,_0x25997e),_0x2c1eeb['children']['push'](_0x3ed7c1['innerHTML']);}}const _0x40b548=Array['from'](_0x272dde['getCustomProperties']());_0x40b548['length']>0x0&&(_0x2c1eeb['customProperties']=_0x40b548);const _0x6d78e6=_0x272dde['getFillerOffset']();return null!==_0x6d78e6&&(_0x2c1eeb['fillerOffset']=_0x6d78e6),_0x2c1eeb;}}['_markChanges'](_0x5ebb34,_0x4ab4b5,_0x504c3b,_0x3adf81,_0x26c767){let _0x58f778=null,_0x59fe5c=null,_0x301c0f=0x0;const _0x3c7819=this['editor']['model'];for(let _0x57ee7f=0x0;_0x57ee7f<_0x4ab4b5['length'];_0x57ee7f++){const _0xd85ba2=this['_getVidAttributeName'](_0x4ab4b5[_0x57ee7f]),_0xad4ed8=_0x4ab4b5[_0x57ee7f]['item']['getAttribute'](_0xd85ba2),_0x4f39f8=_0x504c3b['get'](_0xad4ed8),_0x331bac=_0x57ee7f==_0x4ab4b5['length']-0x1;!_0x58f778&&_0x4f39f8&&(_0x58f778=_0x4f39f8,_0x59fe5c=_0x4ab4b5[_0x57ee7f]),!_0x58f778||_0x4f39f8&&_0x4f39f8['userId']==_0x58f778['userId']||(_0x5274d7(_0x4f39f8,kt(_0x59fe5c,_0x5ebb34,_0x3c7819),kt(_0x4ab4b5[_0x57ee7f],_0x5ebb34,_0x3c7819)),_0x58f778=_0x4f39f8||null,_0x59fe5c=_0x4f39f8?_0x4ab4b5[_0x57ee7f]:null),_0x58f778&&_0x331bac&&_0x5274d7(_0x4f39f8,kt(_0x59fe5c,_0x5ebb34,_0x3c7819),At(_0x4ab4b5[_0x57ee7f],_0x5ebb34,_0x3c7819));}function _0x5274d7(_0xf9f262,_0x5c0f2b,_0x73c35d){const _0x3a08bf=_0x58f778['userId'],_0x524ca7='revision:'+_0x3adf81+':'+_0x3a08bf+':'+_0x301c0f++,_0x43d693=_0x3c7819['createRange'](_0x5c0f2b,_0x73c35d);_0x5ebb34['markers']['set'](_0x524ca7,_0x43d693),null!==_0x3a08bf&&_0x26c767['add'](_0x3a08bf);}}_getVidAttributeName(_0x355142){switch(_0x355142['type']){case'elementStart':return'vid_start';case'elementEnd':return'vid_end';default:return'vid';}}_fixOperation(_0x14e7c1,_0x5f495b){_0x14e7c1['baseVersion']=null;for(const _0x3eb5dc in _0x14e7c1){const _0x49e3b5=_0x14e7c1[_0x3eb5dc];if(_0x49e3b5 instanceof _0xd005cc){const _0x45d2bf=_0x5f495b['get'](_0x49e3b5['root']['rootName']);_0x14e7c1[_0x3eb5dc]=this['_fixPosition'](_0x49e3b5,_0x45d2bf);}if(_0x49e3b5 instanceof _0x50ed46){const _0x521724=_0x5f495b['get'](_0x49e3b5['root']['rootName']);_0x14e7c1[_0x3eb5dc]=this['_fixRange'](_0x49e3b5,_0x521724);}'root'===_0x3eb5dc&&(_0x14e7c1['root']=_0x5f495b['get'](_0x14e7c1['root']['rootName']));}}['_fixRange'](_0x4103ad,_0xa8680b){return this['editor']['model']['createRange'](this['_fixPosition'](_0x4103ad['start'],_0xa8680b),this['_fixPosition'](_0x4103ad['end'],_0xa8680b));}_fixPosition(_0x300c2f,_0x456f56){return this['editor']['model']['createPositionFromPath'](_0x456f56,_0x300c2f['path'],_0x300c2f['stickiness']);}_handleInsertOperation(_0x22e73c){const _0x161137=this['_idsRoots']['get'](_0x22e73c['position']['root']['rootName']),_0x43e860=this['_fixPosition'](_0x22e73c['position'],_0x161137),_0xeb7041=null===_0x22e73c['_authorId']?null:_0x22e73c['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x1d7c2a=_0x43e860['parent'],_0x3d3059=this['_revisionId'],_0x661210=[];for(const _0x369e9d of _0x22e73c['nodes'])if(_0x369e9d['is']('element'))_0x661210['push'](this['_makeIdsRoot'](_0x369e9d));else{for(let _0x16c645=0x0;_0x16c645<_0x369e9d['offsetSize'];_0x16c645++)_0x661210['push'](new _0x44d48b('$text',{'vid':this['_revisionId']++}));}const _0x1ab197=this['_revisionId'];for(let _0x2a5327=_0x3d3059;_0x2a5327<_0x1ab197;_0x2a5327++)this['_touched']['set'](_0x2a5327,{'userId':_0xeb7041});_0x1d7c2a['_insertChild'](_0x43e860['offset'],_0x661210);}_handleMoveOperation(_0x29baf4){(_0x29baf4=this['_cloneOperation'](_0x29baf4,this['_idsRoots']))['_execute']();const _0x499e04=null===_0x29baf4['_authorId']?null:_0x29baf4['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0xdaaab5=_0x29baf4['getMovedRangeStart'](),_0x1824c5=_0xdaaab5['parent'],_0x4be2ba=_0xdaaab5['offset'];!function _0x3ff32b(_0x5c37e4,_0x5070e7,_0x1c5ad6,_0x38db44){for(let _0x5dc449=_0x1c5ad6;_0x5dc449<_0x38db44;_0x5dc449++){const _0x47ec5d=_0x5070e7['getChild'](_0x5dc449);_0x47ec5d['is']('element','$text')?_0x5c37e4['set'](_0x47ec5d['getAttribute']('vid'),{'userId':_0x499e04}):(_0x5c37e4['set'](_0x47ec5d['getAttribute']('vid_start'),{'userId':_0x499e04}),_0x3ff32b(_0x5c37e4,_0x47ec5d,0x0,_0x47ec5d['childCount']),_0x5c37e4['set'](_0x47ec5d['getAttribute']('vid_end'),{'userId':_0x499e04}));}}(this['_touched'],_0x1824c5,_0x4be2ba,_0x4be2ba+_0x29baf4['howMany']);}_handleMergeOperation(_0x37730d){const _0x5c5c17=null===(_0x37730d=this['_cloneOperation'](_0x37730d,this['_idsRoots']))['_authorId']?null:_0x37730d['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x3cb017=_0x37730d['targetPosition']['parent'],_0x1dbbb9=_0x37730d['sourcePosition']['parent'],_0x43e871=_0x3cb017['getAttribute']('vid_end'),_0x518633=_0x1dbbb9['getAttribute']('vid_start');_0x3cb017['_setAttribute']('vid_end',_0x1dbbb9['getAttribute']('vid_end')),_0x1dbbb9['_setAttribute']('vid_end',_0x43e871),this['_touched']['set'](_0x518633,{'userId':_0x5c5c17}),this['_touched']['set'](_0x43e871,{'userId':_0x5c5c17}),_0x37730d['_execute']();}_handleSplitOperation(_0x35cba9){const _0x412aab=null===(_0x35cba9=this['_cloneOperation'](_0x35cba9,this['_idsRoots']))['_authorId']?null:_0x35cba9['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x25fecf=_0x35cba9['graveyardPosition'],_0x7cb1ec=_0x35cba9['splitPosition']['parent'];_0x35cba9['_execute']();const _0x143ce5=_0x7cb1ec['getAttribute']('vid_end'),_0x1393b9=_0x35cba9['insertionPosition']['nodeAfter'];if(_0x25fecf){const _0x23723c=_0x1393b9['getAttribute']('vid_end'),_0x4fc59e=_0x7cb1ec['getAttribute']('vid_end');_0x7cb1ec['_setAttribute']('vid_end',_0x23723c),_0x1393b9['_setAttribute']('vid_end',_0x4fc59e),this['_touched']['set'](_0x7cb1ec['getAttribute']('vid_end'),{'userId':_0x412aab}),this['_touched']['set'](_0x1393b9['getAttribute']('vid_start'),{'userId':_0x412aab});}else{const _0x3f4ee4=this['_revisionId']++,_0x294093=this['_revisionId']++;_0x7cb1ec['_setAttribute']('vid_end',_0x3f4ee4),_0x1393b9['_setAttribute']('vid_start',_0x294093),_0x1393b9['_setAttribute']('vid_end',_0x143ce5),this['_touched']['set'](_0x3f4ee4,{'userId':_0x412aab}),this['_touched']['set'](_0x294093,{'userId':_0x412aab});}}_handleMarkerOperation(_0x57c015){if(!_0x57c015['affectsData'])return;const _0x5a543e=(_0x57c015=this['_cloneOperation'](_0x57c015,this['_diffRoots']))['oldRange']?_0x57c015['oldRange']['root']:null,_0x4c3917=_0x57c015['newRange']?_0x57c015['newRange']['root']:null;_0x5a543e&&this['_markers']['delete'](_0x57c015['name']),_0x4c3917&&this['_markers']['set'](_0x57c015['name'],_0x57c015['newRange']['clone']());const _0x3c79d8=null===_0x57c015['_authorId']?null:_0x57c015['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x55a874=_0x57c015['name'];if(!this['_touchedMarkers']['has'](_0x55a874))return void this['_touchedMarkers']['set'](_0x55a874,{'range':_0x57c015['oldRange'],'userId':_0x3c79d8});const _0x5f3722=this['_touchedMarkers']['get'](_0x55a874),_0x316910=_0x5f3722['range'],_0x2ea67b=_0x57c015['newRange'];null==_0x316910&&null==_0x2ea67b||_0x316910&&_0x2ea67b&&_0x316910['isEqual'](_0x2ea67b)?this['_touchedMarkers']['delete'](_0x57c015['name']):_0x5f3722['userId']=_0x3c79d8;}_handleRootOperation(_0xdd4447,_0x40d21d){this['_diffRoots']['has'](_0xdd4447['rootName'])?this['_diffRoots']['get'](_0xdd4447['rootName'])['_isAttached']=_0xdd4447['isAdd']:(this['_diffRoots']['set'](_0xdd4447['rootName'],Rt(_0xdd4447['rootName'],_0xdd4447['elementName'],!0x0)),this['_diffRootsAttributes']['set'](_0xdd4447['rootName'],{}),_0x40d21d&&this['_idsRoots']['set'](_0xdd4447['rootName'],Rt(_0xdd4447['rootName'],_0xdd4447['elementName'],!0x0)));const _0x114c5b=null===_0xdd4447['_authorId']?null:_0xdd4447['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x39a950=this['_touchedRoots']['get'](_0xdd4447['rootName']);_0x39a950&&_0x39a950['userId']===_0x114c5b?this['_touchedRoots']['delete'](_0xdd4447['rootName']):this['_touchedRoots']['set'](_0xdd4447['rootName'],{'userId':_0x114c5b,'isAttached':_0xdd4447['isAdd']});}_handleRootAttributeOperation(_0x508cd1){const _0xd9e1=this['_diffRootsAttributes']['get'](_0x508cd1['root']['rootName']);null===_0x508cd1['newValue']?delete _0xd9e1[_0x508cd1['key']]:_0xd9e1[_0x508cd1['key']]=_0x508cd1['newValue'];}};function bt(_0x28f614){const _0x32fea7=Rt(_0x28f614['rootName'],_0x28f614['name'],_0x28f614['isAttached']());for(const _0x12fb64 of _0x28f614['getChildren']()){const _0xc8f633=_0x12fb64['_clone'](!0x0);_0x32fea7['_appendChild'](_0xc8f633);}return _0x32fea7;}function Rt(_0x223cc3,_0x289ecc,_0x2b5f60=!0x0){const _0x59c03f=new _0xf72de();return _0x59c03f['rootName']=_0x223cc3,_0x59c03f['name']=_0x289ecc,_0x59c03f['_isAttached']=_0x2b5f60,_0x59c03f['isAttached']=()=>_0x59c03f['_isAttached'],_0x59c03f;}function kt(_0x69cd37,_0x455849,_0x1b01cd){const _0xad0118='elementEnd'==_0x69cd37['type']?_0x1b01cd['createPositionAt'](_0x69cd37['item'],'end'):_0x1b01cd['createPositionBefore'](_0x69cd37['item']);return _0x1b01cd['createPositionFromPath'](_0x455849,_0xad0118['path'],_0xad0118['stickiness']);}function At(_0x3ca36e,_0x73ebc7,_0x1a5b00){const _0x4651bd='elementStart'==_0x3ca36e['type']?_0x1a5b00['createPositionAt'](_0x3ca36e['item'],0x0):_0x1a5b00['createPositionAfter'](_0x3ca36e['item']);return _0x1a5b00['createPositionFromPath'](_0x73ebc7,_0x4651bd['path'],_0x4651bd['stickiness']);}const It=/* #__PURE__ -- @preserve */
|
|
25
|
-
|
|
26
|
-
_0x452013();var Ot=class extends xt{['id'];author;type;data;rootName;constructor(_0x3c77ba){super(),this['id']=_0x3c77ba['id']||_0x57bf97(),this['author']=_0x3c77ba['author'],this['type']=_0x3c77ba['type'],this['data']=_0x3c77ba['data']||{},this['rootName']=_0x3c77ba['rootName'],this['set']('createdAt',_0x3c77ba['createdAt']);}toJSON(){return{'id':this['id'],'authorId':this['author']['id'],'type':this['type'],'data':this['data'],'createdAt':this['createdAt']};}},Ct=class{['newRevisionId'];['oldRevisionId'];['changes'];constructor(_0x4e80d2,_0x25b9bd){this['newRevisionId']=_0x4e80d2,this['oldRevisionId']=_0x25b9bd,this['changes']=new _0x2d7d2b();}_setChanges(_0x4adb71){for(const _0x312890 of _0x4adb71)this['changes']['add'](_0x312890);}},Mt=class extends _0x1e8181{repository;adapter=null;_utils;_activeViewTarget;['_changeView'];['_changeIdToChange'];['_balloon'];static get['pluginName'](){return'RevisionViewer';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_0x5182c9,_0x4ba5e9,mt,wt];}constructor(_0x13e108){super(_0x13e108),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',(_0xb76f2a,_0x947d17,_0x981c72)=>{this['activeChange']=null,this['activeView']=null,this['editor']['editing']['view']['change'](_0x12283f=>{for(const _0x25a760 of this['editor']['editing']['view']['document']['roots'])_0x981c72?_0x12283f['removeClass']('ck-editor__editable__overlay',_0x25a760):_0x12283f['addClass']('ck-editor__editable__overlay',_0x25a760);});}),this['bind']('isNavigationMode')['to'](this,'activeChange',_0x458f35=>null!==_0x458f35),this['bind']('currentChangeNumber')['to'](this,'isReady',this,'diff',this,'activeChange',(_0x343b44,_0x6a196e,_0x953d91)=>_0x343b44&&_0x953d91?_0x6a196e['changes']['getIndex'](_0x953d91):0x0),this['bind']('numberOfChanges')['to'](this,'isReady',this,'diff',(_0x4363c1,_0x23c8d3)=>_0x4363c1?_0x23c8d3['changes']['length']:0x0),this['_changeView']=null,this['_changeIdToChange']=new Map(),this['_balloon']=this['editor']['plugins']['get'](_0x4ba5e9);}init(){const _0x5ef782=this['editor'],_0x32cf6c=new Tt(_0x5ef782,{'direction':'backward'}),_0x45366c=new Tt(_0x5ef782,{'direction':'forward'});_0x5ef782['commands']['add']('showPreviousChange',_0x32cf6c),_0x5ef782['commands']['add']('showNextChange',_0x45366c),_0x5ef782['commands']['add']('restoreRevision',new Dt(_0x5ef782)),this['on']('change:numberOfChanges',()=>{_0x32cf6c['refresh'](),_0x45366c['refresh']();}),this['_setConversion'](),this['_initInteractions'](),_0x5ef782['enableReadOnlyMode']('revision-viewer'),_0x5ef782['plugins']['has']('WidgetToolbarRepository')&&_0x5ef782['plugins']['get']('WidgetToolbarRepository')['forceDisabled']('revision-viewer');}async getRevisionDocumentData(_0x576df0){return await this['_utils']['loadRevisionData'](_0x576df0,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x576df0);}async getRevisionRootsAttributes(_0x2631a8){return await this['_utils']['loadRevisionData'](_0x2631a8,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x2631a8);}async['compare'](_0x2fdcd8,_0x405f75,_0x503f78=!0x1){if(!this['isEnabled'])return;const _0x5d3484=this['diff'],_0x361f07=this['repository'],_0x235d51='string'==typeof _0x2fdcd8?_0x361f07['getRevision'](_0x2fdcd8):_0x2fdcd8,_0x403d4e='string'==typeof _0x405f75?_0x361f07['getRevision'](_0x405f75):_0x405f75,_0x3c8f4d=_0x235d51['id'],_0x2a0abd=_0x403d4e?_0x403d4e['id']:null;if(!_0x503f78&&this['diff']&&this['diff']['newRevisionId']===_0x3c8f4d&&this['diff']['oldRevisionId']===_0x2a0abd)return Promise['resolve']();this['isReady']=!0x1,this['activeView']=null,this['activeChange']=null,this['diff']=new Ct(_0x3c8f4d,_0x2a0abd);const _0x32512d=this['_getRevisionsRange'](_0x235d51,_0x403d4e,!0x0)['map'](_0x374b9f=>this['_utils']['loadRevisionData'](_0x374b9f,this['adapter']));return _0x32512d['push'](new Promise(_0xf156eb=>{setTimeout(_0xf156eb,0x14);})),Promise['all'](_0x32512d)['then'](()=>{if(!this['isEnabled'])return;this['_cleanUp']();const _0x3fc930=this['_getDiff'](_0x3c8f4d,_0x2a0abd);for(const _0x24ea59 of _0x3fc930['changes'])this['_changeIdToChange']['set'](_0x24ea59['id'],_0x24ea59);this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x377077=>{for(const _0x8fcf53 of this['editor']['model']['document']['getRootNames']())_0x377077['detachRoot'](_0x8fcf53);for(const _0x24d605 of Object['keys'](_0x3fc930['model'])){const _0x247ac6=_0x3fc930['model'][_0x24d605]['name'],_0x138220=_0x377077['addRoot'](_0x24d605,_0x247ac6);for(const _0x3f7e83 of Object['keys'](_0x3fc930['attributes'][_0x24d605]))_0x377077['setAttribute'](_0x3f7e83,_0x3fc930['attributes'][_0x24d605][_0x3f7e83],_0x138220);_0x377077['insert'](_0x3fc930['model'][_0x24d605],_0x138220,0x0);}}),this['diff']['_setChanges'](this['_sortAndFilterDiffChanges'](_0x3fc930['changes'])),this['isReady']=!0x0;})['catch'](_0x4a3622=>{console['error'](_0x4a3622),this['_cleanUp'](),_0x5d3484&&(this['diff']=_0x5d3484),this['isReady']=!0x0;});}addRevisionData(_0x263ac6,_0x5dfc1e){const _0x4d4792=this['repository']['createRevision'](_0x263ac6);return _0x4d4792['on']('_update',(_0x46895b,_0x51704d,_0x46be98)=>_0x5dfc1e(_0x51704d,_0x46be98,_0x4d4792)),this['repository']['addRevision'](_0x4d4792),_0x4d4792;}['_cleanUp'](){this['activeChange']=null,this['_cleanMarkers'](),this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=null,this['_changeIdToChange']['clear'](),this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x5e0e93=>{for(const _0x178aca of this['editor']['model']['document']['getRootNames']())_0x5e0e93['detachRoot'](_0x178aca);});}_sortAndFilterDiffChanges(_0x391e07){const _0x5e871b=[],_0x403ffa=new Map();for(const _0x985c4f of this['editor']['model']['document']['getRootNames']()){const _0x54af8f=this['editor']['editing']['view']['getDomRoot'](_0x985c4f);if(!_0x54af8f)continue;const _0x7e6459=_0x54af8f['getClientRects']()['item'](0x0);_0x7e6459&&(_0x5e871b['push'](_0x985c4f),_0x403ffa['set'](_0x985c4f,_0x7e6459));}return _0x5e871b['sort']((_0xacfb7c,_0x1074db)=>{const _0x269c40=_0x403ffa['get'](_0xacfb7c),_0x51300b=_0x403ffa['get'](_0x1074db);return _0x269c40['y']-_0x51300b['y']||_0x269c40['x']-_0x51300b['x'];}),(_0x391e07=_0x391e07['filter'](_0xf7212a=>_0x5e871b['includes'](_0xf7212a['rootName'])))['sort']((_0x5b950a,_0x2ff377)=>_0x5e871b['indexOf'](_0x5b950a['rootName'])-_0x5e871b['indexOf'](_0x2ff377['rootName'])),_0x391e07;}['_makeTape'](_0x36d0f9){const _0x35fb16=Array['from'](_0x36d0f9['markers'])['filter'](([_0x5122d0,_0x5f0044])=>_0x5122d0['startsWith']('revision:')&&!_0x5f0044['isCollapsed']),_0x3a18a3=Array['from'](this['editor']['model']['createRangeIn'](_0x36d0f9)['getWalker']({'singleCharacters':!0x0}));if(0x0!=_0x35fb16['length'])for(const _0xe43063 of _0x3a18a3){const [_0x423d6a,_0x57fc5d]=_0x35fb16[0x0],[,_0x1f0080,_0x52c65e]=_0x423d6a['split'](':');if(_0x57fc5d['end']['isEqual'](_0xe43063['nextPosition'])&&_0x35fb16['shift'](),(_0xe43063['previousPosition']['isEqual'](_0x57fc5d['start'])||_0xe43063['previousPosition']['isAfter'](_0x57fc5d['start']))&&('insertion'==_0x1f0080?_0xe43063['isAdded']={'userId':_0x52c65e}:'deletion'==_0x1f0080&&(_0xe43063['isRemoved']={'userId':_0x52c65e})),0x0==_0x35fb16['length'])break;}return _0x3a18a3;}_refreshStartEndIndex(_0x23b4b1){const _0x59113c=new Map();for(let _0xd48c95=0x0;_0xd48c95<_0x23b4b1['length'];_0xd48c95++)'text'===_0x23b4b1[_0xd48c95]['type']?(_0x23b4b1[_0xd48c95]['item']['startIndex']=_0xd48c95,_0x23b4b1[_0xd48c95]['item']['endIndex']=_0xd48c95):('elementStart'===_0x23b4b1[_0xd48c95]['type']?_0x23b4b1[_0xd48c95]['item']['startIndex']=_0xd48c95:'elementEnd'===_0x23b4b1[_0xd48c95]['type']&&(_0x23b4b1[_0xd48c95]['item']['endIndex']=_0xd48c95),_0x59113c['set'](_0x23b4b1[_0xd48c95]['id'],_0xd48c95));for(const _0x15986f of _0x59113c['values']())'elementStart'===_0x23b4b1[_0x15986f]['type']?_0x23b4b1[_0x15986f]['item']['endIndex']=_0x59113c['get'](_0x23b4b1[_0x15986f]['pairId']):'elementEnd'===_0x23b4b1[_0x15986f]['type']&&(_0x23b4b1[_0x15986f]['item']['startIndex']=_0x59113c['get'](_0x23b4b1[_0x15986f]['pairId']));}['_processTape'](_0x266574){for(let _0x1c5a38=0x0;_0x1c5a38<_0x266574['length'];_0x1c5a38++){if('elementStart'===_0x266574[_0x1c5a38]['type'])_0x266574[_0x1c5a38]['item']['startIndex']=_0x1c5a38;else{if('elementEnd'===_0x266574[_0x1c5a38]['type']){_0x266574[_0x1c5a38]['item']['endIndex']=_0x1c5a38;const _0x2e7f3b=_0x266574[_0x1c5a38]['item']['startIndex'];_0x266574[_0x2e7f3b]['pairId']=_0x266574[_0x1c5a38]['id'],_0x266574[_0x1c5a38]['pairId']=_0x266574[_0x2e7f3b]['id'];}else _0x266574[_0x1c5a38]['item']['startIndex']=_0x1c5a38,_0x266574[_0x1c5a38]['item']['endIndex']=_0x1c5a38,_0x266574[_0x1c5a38]['pairId']=null;}_0x266574[_0x1c5a38]['markersStart']||(_0x266574[_0x1c5a38]['markersStart']=[],_0x266574[_0x1c5a38]['markersEnd']=[]);}}_markInsertions(_0x225da8,_0x31fa3d){const _0x1526b3=_0x225da8['filter'](_0x3681ea=>!_0x3681ea['isAdded']);for(let _0x47516b=0x0;_0x47516b<_0x31fa3d['length'];_0x47516b++)_0x31fa3d[_0x47516b]['isAdded']&&(_0x1526b3[_0x47516b]['isAdded']=_0x31fa3d[_0x47516b]['isAdded']);}_getDiff(_0x169c4c,_0x22d54a=null){const _0xda67e3=this['repository']['getRevision'](_0x169c4c),_0x562de7=_0x22d54a?this['repository']['getRevision'](_0x22d54a):null,_0x469ba9=this['_getRevisionsRange'](_0xda67e3,_0x562de7),_0x4f1e13=_0x469ba9[_0x469ba9['length']-0x1],_0x44080d=new Map(),_0x1c9037={'model':{},'attributes':{},'changes':[]},_0x244095=new Set(),_0x27dbc9=new Map();for(let _0x178284=_0x469ba9['length']-0x1;_0x178284>=0x0;_0x178284--){const _0x224b65=_0x469ba9[_0x178284];for(const _0x55a00d of Object['keys'](_0x224b65['diffData']))if(_0x224b65['diffData'][_0x55a00d]['attachChange']){const _0x157f34=_0x224b65['diffData'][_0x55a00d]['attachChange'];_0x157f34['isAttached']?(_0x244095['add'](_0x55a00d),_0x27dbc9['has'](_0x55a00d)&&_0x27dbc9['get'](_0x55a00d)['userId']==_0x157f34['userId']?_0x27dbc9['delete'](_0x55a00d):_0x27dbc9['set'](_0x55a00d,_0x157f34)):_0x27dbc9['has'](_0x55a00d)?(_0x244095['delete'](_0x55a00d),_0x27dbc9['delete'](_0x55a00d)):(_0x244095['add'](_0x55a00d),_0x27dbc9['set'](_0x55a00d,_0x157f34));}else _0x244095['add'](_0x55a00d);}for(const _0x251317 of _0x244095){const _0x10dfb6=_0x27dbc9['has'](_0x251317)&&!_0x27dbc9['get'](_0x251317)['isAttached'];let _0x5197ba=_0x10dfb6?_0x469ba9['length']-0x1:0x0;const _0x582416=_0x10dfb6?-0x1:0x1;for(;_0x469ba9[_0x5197ba];){const _0x1c0369=_0x469ba9[_0x5197ba];if(_0x1c0369['diffData'][_0x251317]){const _0x5bfeed=_0x10dfb6?_0x1c0369['diffData'][_0x251317]['attributesBefore']:_0x1c0369['diffData'][_0x251317]['attributesAfter'];_0x1c9037['attributes'][_0x251317]=_0x5bfeed?_0x4dfa2c(_0x5bfeed):{};break;}_0x5197ba+=_0x582416;}}for(const _0x4bd351 of _0x469ba9){_0x4bd351['model']={};for(const _0x55be70 of _0x4bd351['authors'])_0x44080d['set'](_0x55be70['id'],_0x55be70);for(const _0x168d4f of _0x244095){const _0x77d0f0=_0x4bd351['diffData'][_0x168d4f]?_0x4bd351['diffData'][_0x168d4f]['insertions']:'[]',_0xfda3fe=_0x4bd351['diffData'][_0x168d4f]?_0x4bd351['diffData'][_0x168d4f]['deletions']:'[]',_0x2b3d5b=_0x4bd351['diffData'][_0x168d4f]?.['rootElementName']||'$root';_0x4bd351['model'][_0x168d4f]={'insertions':this['_utils']['_makeModelFromViewString'](_0x77d0f0,_0x2b3d5b),'deletions':this['_utils']['_makeModelFromViewString'](_0xfda3fe,_0x2b3d5b)};}}for(const _0x477cbb of _0x244095){let _0x21dda4=null,_0x463957=0x0;const _0x10344f=_0x469ba9['map'](_0x1f1247=>_0x1f1247['diffData'][_0x477cbb]?.['rootElementName'])['find'](_0x5d2e42=>void 0x0!==_0x5d2e42)||'$root',_0x22275e=new Map(Array['from'](_0xda67e3['model'][_0x477cbb]['insertions']['markers'])['filter'](([_0x4b1ce4])=>!_0x4b1ce4['startsWith']('revision:')));let _0x5c49e4=0x0;for(const _0x4e5ed6 of _0x469ba9){const _0x1be464=this['_makeTape'](_0x4e5ed6['model'][_0x477cbb]['insertions']);_0x4e5ed6==_0xda67e3?(_0x21dda4=_0x1be464,_0x463957=_0x21dda4['length'],_0x21dda4['forEach'](_0x7586df=>{_0x7586df['id']=_0x5c49e4++;}),this['_processTape'](_0x21dda4)):this['_markInsertions'](_0x21dda4,_0x1be464);const _0x2dfc8f=_0x21dda4['filter'](_0x4ea343=>!_0x4ea343['isAdded'])['map'](_0x111273=>_0x111273['id']);let _0x1815dd=0x0;const _0x2c58ef=this['_makeTape'](_0x4e5ed6['model'][_0x477cbb]['deletions']);_0x2c58ef['forEach'](_0x4cd2d8=>{_0x4cd2d8['isRemoved']?_0x4cd2d8['id']=_0x463957++:_0x4cd2d8['id']=_0x2dfc8f[_0x1815dd++];}),this['_processTape'](_0x2c58ef),this['_setDistance'](_0x21dda4,'isAdded'),this['_setDistance'](_0x2c58ef,'isRemoved'),_0x4e5ed6==_0xda67e3&&this['_markMarkers'](_0x21dda4,_0x22275e),_0x21dda4=this['_joinTapes'](_0x21dda4,_0x2c58ef),this['_refreshStartEndIndex'](_0x21dda4),this['_setDistance'](_0x21dda4,'isRemoved');}_0x21dda4=_0x21dda4['filter'](_0x42fe0b=>!(_0x42fe0b['isAdded']&&_0x42fe0b['isRemoved']));const _0xc63ced=new Map(_0x4f1e13['model'][_0x477cbb]['deletions']['markers']),_0x12b397=new Set(_0x22275e['keys']());for(const _0x3f1046 of _0xc63ced['keys']())_0x12b397['delete'](_0x3f1046);this['_markSuggestions'](_0x21dda4,_0x12b397),this['_fixObsoleteTags'](_0x21dda4),_0x21dda4=this['_removeMissingPairs'](_0x21dda4),_0x21dda4=this['_markMismatchedRemovedTags'](_0x21dda4),_0x21dda4=this['_removeUnsupportedChanges'](_0x21dda4);const {root:_0x180d48,changes:_0x441e13}=this['_makeModelFromTape'](_0x21dda4,_0x44080d,_0x477cbb,_0x10344f);_0x1c9037['model'][_0x477cbb]=_0x180d48;const _0x3f5dd1=_0x27dbc9['get'](_0x477cbb);if(_0x3f5dd1){const _0x58dcaa=new Ot({'author':_0x44080d['get'](_0x3f5dd1['userId']),'type':_0x3f5dd1['isAttached']?'add':'remove','data':{'isOnRoot':!0x0},'createdAt':new Date(),'rootName':_0x477cbb});_0x441e13['unshift'](_0x58dcaa),_0x1c9037['attributes'][_0x477cbb]['revisionHistoryAttachChange']=_0x58dcaa['id'];}_0x1c9037['changes']=_0x1c9037['changes']['concat'](_0x441e13);}return _0x1c9037;}['_markMarkers'](_0x3ce24b,_0x1917f8){for(let _0x2a5e05=0x0;_0x2a5e05<_0x3ce24b['length'];_0x2a5e05++)for(const [_0x26bb42,_0x395080]of _0x1917f8)!_0x395080['isCollapsed']&&_0x395080['start']['isEqual'](_0x3ce24b[_0x2a5e05]['previousPosition'])&&_0x3ce24b[_0x2a5e05]['markersStart']['push'](_0x26bb42),_0x395080['end']['isEqual'](_0x3ce24b[_0x2a5e05]['nextPosition'])&&_0x3ce24b[_0x2a5e05]['markersEnd']['push'](_0x26bb42);}['_joinTapes'](_0x21bac5,_0x1e330b){let _0x18e653=[],_0x184ba1=0x0,_0x4b3375=0x0;for(;_0x184ba1<_0x21bac5['length']||_0x4b3375<_0x1e330b['length'];){const _0x5295dc=_0x21bac5[_0x184ba1]||{},_0x5a0e44=_0x1e330b[_0x4b3375]||{};if(_0x5295dc['id']==_0x5a0e44['id'])_0x184ba1++,_0x4b3375++,_0x18e653['push'](_0x5295dc);else{if(_0x5a0e44['isRemoved']&&_0x5295dc['isAdded']){const {commonTape:_0x5d32a4,iEnd:_0x5121cc,jEnd:_0x498f05}=this['_threeWayMerge'](_0x21bac5,_0x184ba1,_0x1e330b,_0x4b3375);_0x18e653=_0x18e653['concat'](_0x5d32a4),_0x184ba1=_0x5121cc,_0x4b3375=_0x498f05;}else _0x5a0e44['isRemoved']?(_0x4b3375++,_0x18e653['push'](_0x5a0e44)):(_0x184ba1++,_0x18e653['push'](_0x5295dc));}}return _0x18e653;}_markSuggestions(_0x410462,_0x3ffe29){const _0x1cd5b9=[];for(let _0x97de06=0x0;_0x97de06<_0x410462['length'];_0x97de06++){for(let _0x2167c3=0x0;_0x2167c3<_0x410462[_0x97de06]['markersStart']['length'];_0x2167c3++){const _0x42ab95=_0x410462[_0x97de06]['markersStart'][_0x2167c3];if(!_0x3ffe29['has'](_0x42ab95))continue;const {group:_0x4a788e,type:_0x500504,authorId:_0x269e2a}=_0x18b6af(_0x42ab95);'revision-suggestion'!=_0x4a788e||'insertion'!=_0x500504&&'deletion'!=_0x500504||(_0x1cd5b9['unshift']({'type':_0x500504,'name':_0x42ab95,'userId':_0x269e2a}),_0x410462[_0x97de06]['markersStart']['splice'](_0x2167c3,0x1),_0x2167c3--);}_0x2f86da(_0x410462[_0x97de06]);for(let _0x2f0433=0x0;_0x2f0433<_0x410462[_0x97de06]['markersEnd']['length'];_0x2f0433++){const _0x198564=_0x410462[_0x97de06]['markersEnd'][_0x2f0433];if(!_0x3ffe29['has'](_0x198564))continue;const {group:_0x5a3879,type:_0xa5ce7a}=_0x18b6af(_0x198564);if('revision-suggestion'!=_0x5a3879||'insertion'!=_0xa5ce7a&&'deletion'!=_0xa5ce7a)continue;_0x410462[_0x97de06]['markersEnd']['splice'](_0x2f0433,0x1),_0x2f0433--;const _0x47c8ce=_0x1cd5b9['findIndex'](_0x35e6ac=>_0x35e6ac['name']==_0x198564);_0x47c8ce>-0x1&&_0x1cd5b9['splice'](_0x47c8ce,0x1);}}function _0x18b6af(_0x354bc2){const _0x479533=_0x354bc2['split'](':');return{'group':_0x479533[0x0],'type':_0x479533[0x1],'subType':_0x479533['length']>=0x5?_0x479533[0x2]:null,'id':_0x479533['length']<0x5?_0x479533[0x2]:_0x479533[0x3],'authorId':_0x479533['length']<0x5?_0x479533[0x3]:_0x479533[0x4],'markerCount':0x6==_0x479533['length']?_0x479533[0x5]:null};}function _0x2f86da(_0x28084f){for(let _0x45c2b4=0x0;_0x45c2b4<_0x1cd5b9['length'];_0x45c2b4++){if(_0x28084f['isAdded']&&'insertion'==_0x1cd5b9[_0x45c2b4]['type']&&_0x28084f['isAdded']['userId']==_0x1cd5b9[_0x45c2b4]['userId'])return _0x28084f['isAddSuggestion']=_0x1cd5b9[_0x45c2b4],void delete _0x28084f['isAdded'];if(!_0x28084f['isAdded']&&!_0x28084f['isRemoved']&&'deletion'==_0x1cd5b9[_0x45c2b4]['type'])return void(_0x28084f['isRemoveSuggestion']=_0x1cd5b9[_0x45c2b4]);}}}_setDistance(_0x31bedb,_0x2335b4){let _0x32e4c5=0x0,_0x362198=!0x1;const _0x2f56dd=new Map();for(const _0x5a9a22 of _0x31bedb)_0x5a9a22[_0x2335b4]?_0x362198&&(_0x32e4c5++,_0x362198=!0x1):(_0x32e4c5++,_0x362198=!0x0),_0x2f56dd['set'](_0x5a9a22['id'],_0x32e4c5);for(let _0x409213=0x0;_0x409213<_0x31bedb['length'];_0x409213++){if('isRemoved'==_0x2335b4&&_0x31bedb[_0x409213]['isAdded']||'isAdded'==_0x2335b4&&_0x31bedb[_0x409213]['isRemoved'])continue;if('text'==_0x31bedb[_0x409213]['type']){_0x31bedb[_0x409213]['distance']=0x0;continue;}const _0x511163=_0x2f56dd['get'](_0x31bedb[_0x409213]['pairId']),_0x216307=_0x2f56dd['get'](_0x31bedb[_0x409213]['id']);_0x31bedb[_0x409213]['distance']=_0x511163-_0x216307;}}_getRevisionsRange(_0x5f4319,_0x109939,_0x56031d=!0x1){const _0x4bf58c=[];let _0x5b8a4e=this['repository']['getIndex'](_0x5f4319),_0x343525=this['repository']['getIndex'](_0x109939);for(-0x1==_0x343525&&(_0x343525=this['repository']['_revisions']['length'],_0x56031d=!0x1);_0x5b8a4e<_0x343525;)_0x4bf58c['push'](this['repository']['getRevision'](_0x5b8a4e)),_0x5b8a4e++;return _0x56031d&&_0x4bf58c['push'](this['repository']['getRevision'](_0x5b8a4e)),_0x4bf58c;}_threeWayMerge(_0x165cf3,_0x2a6fc3,_0x4775ed,_0x3294dc){const _0x3bd843=this['editor']['model']['schema'];let _0x538cc3=_0x2a6fc3;for(;_0x165cf3[_0x538cc3]&&_0x165cf3[_0x538cc3]['isAdded'];)_0x538cc3++;let _0x3f87ba=_0x3294dc;for(;_0x4775ed[_0x3f87ba]&&_0x4775ed[_0x3f87ba]['isRemoved'];)_0x3f87ba++;_0x5bf787(_0x165cf3,_0x2a6fc3,_0x538cc3),_0x5bf787(_0x4775ed,_0x3294dc,_0x3f87ba);const _0x54704a=_0x4775ed['slice'](_0x3294dc,_0x3f87ba)['concat'](_0x165cf3['slice'](_0x2a6fc3,_0x538cc3));return _0x54704a['sort']((_0x217fc1,_0x3a4bdc)=>_0x217fc1['side']!=_0x3a4bdc['side']?_0x217fc1['side']-_0x3a4bdc['side']:_0x217fc1['level']!=_0x3a4bdc['level']?_0x217fc1['level']-_0x3a4bdc['level']:_0x217fc1['distance']!=_0x3a4bdc['distance']?_0x3a4bdc['distance']-_0x217fc1['distance']:!!_0x217fc1['isAdded']!=!!_0x3a4bdc['isAdded']?-0x1==_0x217fc1['side']||0x0==_0x217fc1['side']?_0x217fc1['isAdded']?-0x1:0x1:_0x217fc1['isAdded']?0x1:-0x1:_0x217fc1['index']-_0x3a4bdc['index']),{'commonTape':_0x54704a,'iEnd':_0x538cc3,'jEnd':_0x3f87ba};function _0x5bf787(_0x57248e,_0x3616d9,_0x4ff332){let _0x4ae91d=-0x1,_0x55d74e=Number['POSITIVE_INFINITY'],_0x11befd=!0x0;for(let _0x35de12=_0x3616d9;_0x35de12<_0x4ff332;_0x35de12++)if(_0x3bd843['isInline'](_0x57248e[_0x35de12]['item'])||(_0x11befd=!0x1),_0x57248e[_0x35de12]['item']['startIndex']<_0x3616d9&&(_0x4ae91d=_0x35de12),_0x57248e[_0x35de12]['item']['endIndex']>=_0x4ff332){_0x55d74e=_0x35de12;break;}_0x11befd&&(_0x4ae91d=_0x4ff332-0x1);for(let _0x9b8577=_0x3616d9;_0x9b8577<_0x4ff332;_0x9b8577++)_0x57248e[_0x9b8577]['side']=_0x9b8577<=_0x4ae91d?-0x1:_0x9b8577<_0x55d74e?0x0:0x1,_0x57248e[_0x9b8577]['index']=_0x9b8577;let _0x52e563=0x0;for(let _0x2a75f3=_0x3616d9;_0x2a75f3<=_0x4ae91d;_0x2a75f3++)0x0==_0x57248e[_0x2a75f3]['distance']?_0x57248e[_0x2a75f3]['level']=_0x52e563:(_0x52e563++,_0x57248e[_0x2a75f3]['level']=_0x52e563,_0x52e563++);for(let _0x1379de=_0x3616d9;_0x1379de<_0x4ff332;_0x1379de++)0x0==_0x57248e[_0x1379de]['side']&&(_0x57248e[_0x1379de]['level']=_0x52e563);_0x52e563=0x0;for(let _0x1884f0=_0x4ff332-0x1;_0x1884f0>=_0x55d74e;_0x1884f0--)0x0==_0x57248e[_0x1884f0]['distance']?_0x57248e[_0x1884f0]['level']=_0x52e563:(_0x52e563--,_0x57248e[_0x1884f0]['level']=_0x52e563,_0x52e563--);}}_fixObsoleteTags(_0x358e7a){const _0x98b5b=new Map(),_0x3eb088=this['editor']['model']['schema'];for(let _0x3cc26f=0x1;_0x3cc26f<_0x358e7a['length'];_0x3cc26f++){let _0x82f5fd,_0x233b5f,_0x1b6cf3;const _0x2915c5=_0x358e7a[_0x3cc26f],_0x3f82f5=_0x358e7a[_0x3cc26f-0x1];if('text'==_0x2915c5['type'])continue;if(_0x2915c5['type']!=_0x3f82f5['type'])continue;if(!_0x3eb088['isBlock'](_0x3f82f5['item'])||_0x3eb088['isLimit'](_0x3f82f5['item']))continue;if(!_0x3eb088['isBlock'](_0x2915c5['item'])||_0x3eb088['isLimit'](_0x2915c5['item']))continue;if((_0x358e7a[_0x3cc26f]['isAdded']||_0x358e7a[_0x3cc26f]['isAddSuggestion'])&&_0x358e7a[_0x3cc26f-0x1]['isRemoved'])_0x82f5fd=_0x358e7a[_0x3cc26f],_0x233b5f=_0x358e7a[_0x3cc26f-0x1],_0x1b6cf3=_0x3cc26f-0x1;else{if(!_0x358e7a[_0x3cc26f]['isRemoved']||!_0x358e7a[_0x3cc26f-0x1]['isAdded']&&!_0x358e7a[_0x3cc26f-0x1]['isAddSuggestion'])continue;_0x82f5fd=_0x358e7a[_0x3cc26f-0x1],_0x233b5f=_0x358e7a[_0x3cc26f],_0x1b6cf3=_0x3cc26f;}const _0x3342ec=_0x82f5fd['level']==_0x233b5f['level'],_0x2fd7a7=Math['abs'](_0x82f5fd['level'])<Math['abs'](_0x233b5f['level'])&&0x0==_0x233b5f['distance'];(_0x3342ec||_0x2fd7a7)&&(_0x98b5b['set'](_0x233b5f['id'],_0x82f5fd['id']),_0x358e7a['splice'](_0x1b6cf3,0x1),_0x3cc26f--,_0x82f5fd['isAdded']=!0x1);}for(let _0x29bbbd=0x0;_0x29bbbd<_0x358e7a['length'];_0x29bbbd++)_0x98b5b['has'](_0x358e7a[_0x29bbbd]['pairId'])&&(_0x358e7a[_0x29bbbd]['pairId']=_0x98b5b['get'](_0x358e7a[_0x29bbbd]['pairId']));}['_removeMissingPairs'](_0x5cf095){const _0x189c55=new Set(_0x5cf095['map'](_0x245dd4=>_0x245dd4['id']));for(let _0x3e6d6e=0x0;_0x3e6d6e<_0x5cf095['length'];_0x3e6d6e++)_0x189c55['has'](_0x5cf095[_0x3e6d6e]['pairId'])||0x0==_0x5cf095[_0x3e6d6e]['distance']||(_0x5cf095[_0x3e6d6e]['isIncorrect']=!0x0);return _0x5cf095['filter'](_0x244897=>!_0x244897['isIncorrect']);}_markMismatchedRemovedTags(_0x3f396f){const _0x508e4f=new Set();for(let _0x2e2f26=0x0;_0x2e2f26<_0x3f396f['length'];_0x2e2f26++){if(_0x508e4f['has'](_0x3f396f[_0x2e2f26]['id'])&&_0x3f396f[_0x2e2f26]['isRemoved']&&(_0x3f396f[_0x2e2f26]['isIncorrect']=!0x0),_0x3f396f[_0x2e2f26]['isIncorrect'])continue;if(0x0==_0x3f396f[_0x2e2f26]['distance'])continue;if('elementStart'!=_0x3f396f[_0x2e2f26]['type'])continue;if(null==_0x3f396f[_0x2e2f26]['pairId'])continue;let _0x1585e4=_0x2e2f26+0x1,_0x37657b=0x0;for(;_0x3f396f[_0x1585e4]['id']!=_0x3f396f[_0x2e2f26]['pairId'];)'elementStart'==_0x3f396f[_0x1585e4]['type']?_0x37657b++:'elementEnd'==_0x3f396f[_0x1585e4]['type']&&_0x37657b--,_0x1585e4++;if(0x0!=_0x37657b){if(_0x3f396f[_0x2e2f26]['isRemoved'])_0x3f396f[_0x2e2f26]['isIncorrect']=!0x0;else{for(;_0x1585e4!=_0x2e2f26;)_0x3f396f[_0x1585e4]['isRemoved']&&0x0!=_0x3f396f[_0x1585e4]['distance']&&(_0x3f396f[_0x1585e4]['isIncorrect']=!0x0,_0x508e4f['add'](_0x3f396f[_0x1585e4]['pairId'])),_0x1585e4--;}}}return _0x3f396f['filter'](_0x58d1a0=>!_0x58d1a0['isIncorrect']);}_removeUnsupportedChanges(_0x2adc9a){const _0x410221=this['editor']['model']['schema'];for(let _0x114f25=0x0;_0x114f25<_0x2adc9a['length'];_0x114f25++){if(!(_0x2adc9a[_0x114f25]['isAdded']||_0x2adc9a[_0x114f25]['isAddSuggestion']||_0x2adc9a[_0x114f25]['isRemoved']||_0x2adc9a[_0x114f25]['isRemoveSuggestion']))continue;if(0x0==_0x2adc9a[_0x114f25]['distance'])continue;const _0x4d1d45=_0x2adc9a[_0x114f25]['item'];_0x410221['isBlock'](_0x4d1d45)||_0x410221['isLimit'](_0x4d1d45)||(_0x2adc9a[_0x114f25]['isAdded']&&delete _0x2adc9a[_0x114f25]['isAdded'],_0x2adc9a[_0x114f25]['isAddSuggestion']&&delete _0x2adc9a[_0x114f25]['isAddSuggestion'],_0x2adc9a[_0x114f25]['isRemoveSuggestion']&&delete _0x2adc9a[_0x114f25]['isRemoveSuggestion'],_0x2adc9a[_0x114f25]['isRemoved']&&(_0x2adc9a[_0x114f25]['isIncorrect']=!0x0));}return _0x2adc9a['filter'](_0x540ac6=>!_0x540ac6['isIncorrect']);}['_makeModelFromTape'](_0x237f5c,_0x2a5c2c,_0x7c144a,_0x48432f){const _0x3d0973=new _0xf72de(),_0x39d4ae=[],_0x119fd2=new Map(),_0x5eb6aa=this['editor']['model'],_0x49188b=_0x5eb6aa['schema'],_0x51b02e=[_0x3d0973],_0x2cbdbb={},_0x3c1056={'isAdded':[],'isRemoved':[],'isAddSuggestion':[],'isRemoveSuggestion':[]};_0x3d0973['name']=_0x48432f;let _0x377b4a=null;const _0x55e5ca=[0x0];for(let _0x4ed7f6=0x0;_0x4ed7f6<_0x237f5c['length'];_0x4ed7f6++)if('elementStart'===_0x237f5c[_0x4ed7f6]['type']){_0x237f5c[_0x4ed7f6]['previousPosition']=_0x5eb6aa['createPositionFromPath'](_0x3d0973,_0x55e5ca);const _0x3a1637=new _0x44d48b(_0x237f5c[_0x4ed7f6]['item']['name'],_0x237f5c[_0x4ed7f6]['item']['getAttributes']());_0x51b02e[0x0]['_appendChild'](_0x3a1637),_0x55e5ca['push'](0x0),_0x51b02e['unshift'](_0x3a1637),_0x237f5c[_0x4ed7f6]['nextPosition']=_0x5eb6aa['createPositionFromPath'](_0x3d0973,_0x55e5ca);}else'elementEnd'===_0x237f5c[_0x4ed7f6]['type']?(_0x51b02e['shift'](),_0x237f5c[_0x4ed7f6]['previousPosition']=_0x5eb6aa['createPositionFromPath'](_0x3d0973,_0x55e5ca),_0x55e5ca['pop'](),_0x55e5ca[_0x55e5ca['length']-0x1]++,_0x237f5c[_0x4ed7f6]['nextPosition']=_0x5eb6aa['createPositionFromPath'](_0x3d0973,_0x55e5ca)):(_0x237f5c[_0x4ed7f6]['previousPosition']=_0x5eb6aa['createPositionFromPath'](_0x3d0973,_0x55e5ca),_0x377b4a?_0x377b4a['_data']+=_0x237f5c[_0x4ed7f6]['item']['data']:_0x377b4a=new _0x49ecb1(_0x237f5c[_0x4ed7f6]['item']['data'],_0x237f5c[_0x4ed7f6]['item']['getAttributes']()),_0x237f5c[_0x4ed7f6+0x1]&&'text'===_0x237f5c[_0x4ed7f6+0x1]['type']&&_0xe2d22b(_0x377b4a,_0x237f5c[_0x4ed7f6+0x1]['item'])||(_0x51b02e[0x0]['_appendChild'](_0x377b4a),_0x377b4a=null),_0x55e5ca[_0x55e5ca['length']-0x1]+=_0x237f5c[_0x4ed7f6]['item']['offsetSize'],_0x237f5c[_0x4ed7f6]['nextPosition']=_0x5eb6aa['createPositionFromPath'](_0x3d0973,_0x55e5ca));for(let _0x1962cf=0x0;_0x1962cf<_0x237f5c['length'];_0x1962cf++){const _0x81052d=_0x237f5c[_0x1962cf]['previousPosition'],_0x479225=_0x237f5c[_0x1962cf]['nextPosition'];for(const _0x5f2d65 of _0x237f5c[_0x1962cf]['markersStart'])_0x119fd2['set'](_0x5f2d65,{'start':_0x81052d,'end':null});_0x173e56('isRemoveSuggestion',_0x1962cf,_0x81052d,_0x479225),_0x173e56('isAddSuggestion',_0x1962cf,_0x81052d,_0x479225),_0x173e56('isRemoved',_0x1962cf,_0x81052d,_0x479225),_0x173e56('isAdded',_0x1962cf,_0x81052d,_0x479225);for(const _0x35447e of _0x237f5c[_0x1962cf]['markersEnd']){const _0x5f5e0f=_0x119fd2['get'](_0x35447e);_0x5f5e0f?_0x5f5e0f['end']=_0x479225:_0x119fd2['set'](_0x35447e,{'start':_0x479225,'end':_0x479225});}}for(const [_0x37a28b,_0x163c6f]of _0x119fd2){const _0x2c6b4e=this['editor']['model']['createRange'](_0x163c6f['start'],_0x163c6f['end']);_0x3d0973['markers']['set'](_0x37a28b,_0x2c6b4e);}return _0x39d4ae['sort']((_0x259ae7,_0x23f10b)=>{const _0x401064=_0x3d0973['markers']['get']('revision:'+_0x259ae7['id']),_0x12f760=_0x3d0973['markers']['get']('revision:'+_0x23f10b['id']);return _0x401064['start']['isBefore'](_0x12f760['start'])?-0x1:_0x401064['start']['isAfter'](_0x12f760['start'])?0x1:_0x401064['end']['isBefore'](_0x12f760['end'])?-0x1:_0x401064['end']['isAfter'](_0x12f760['end'])?0x1:'add'===_0x259ae7['type']?-0x1:0x1;}),{'root':_0x3d0973,'changes':_0x39d4ae};function _0x173e56(_0x311624,_0x450fbd,_0x40204c,_0x5d0c2a){const _0x20589d=!!_0x237f5c[_0x450fbd][_0x311624],_0x3e924a=_0x20589d?_0x237f5c[_0x450fbd][_0x311624]['userId']:null,_0x15294c=_0x450fbd===_0x237f5c['length']-0x1,_0x293743=_0x3c1056[_0x311624][0x0],_0x20ba96=_0x49188b['isObject'](_0x237f5c[_0x450fbd]['item']);!_0x2cbdbb[_0x311624]&&_0x20589d?_0x2cbdbb[_0x311624]={'start':_0x40204c,'tapeItem':_0x237f5c[_0x450fbd],'userId':_0x3e924a,'type':_0x311624}:_0x2cbdbb[_0x311624]&&!_0x20589d?(_0x2cbdbb[_0x311624]['end']=_0x40204c,_0x118cf9(_0x2cbdbb[_0x311624]),_0x2cbdbb[_0x311624]=null):_0x2cbdbb[_0x311624]&&_0x20589d&&_0x2cbdbb[_0x311624]['userId']!==_0x3e924a&&(_0x2cbdbb[_0x311624]['end']=_0x40204c,_0x293743&&_0x293743['userId']===_0x2cbdbb[_0x311624]['userId']||_0x118cf9(_0x2cbdbb[_0x311624]),_0x2cbdbb[_0x311624]={'start':_0x40204c,'tapeItem':_0x237f5c[_0x450fbd],'userId':_0x3e924a,'type':_0x311624}),_0x2cbdbb[_0x311624]&&_0x20ba96&&('elementStart'!==_0x237f5c[_0x450fbd]['type']||_0x293743&&_0x293743['userId']===_0x3e924a||_0x3c1056[_0x311624]['unshift']({'userId':_0x3e924a,'object':_0x237f5c[_0x450fbd]['item'],'change':_0x2cbdbb[_0x311624]}),'elementEnd'===_0x237f5c[_0x450fbd]['type']&&_0x293743&&_0x293743['object']===_0x237f5c[_0x450fbd]['item']&&(_0x3c1056[_0x311624]['shift'](),_0x2cbdbb[_0x311624]=_0x293743['change'])),_0x2cbdbb[_0x311624]&&_0x15294c&&(_0x2cbdbb[_0x311624]['end']=_0x5d0c2a,_0x118cf9(_0x2cbdbb[_0x311624]),_0x2cbdbb[_0x311624]=null);}function _0x118cf9({start:_0x1ed3fd,end:_0x11bc1c,tapeItem:_0x57f256,userId:_0x2673ec,type:_0x52b79d}){const _0x358e4b=_0x57f256['item'],_0x37560b=_0x5eb6aa['schema']['isBlock'](_0x358e4b)&&!_0x5eb6aa['schema']['isLimit'](_0x358e4b),_0x21968d=_0x1ed3fd['nodeAfter']==_0x11bc1c['parent']&&_0x11bc1c['isAtStart'];if(_0x37560b&&_0x21968d)return;const _0x46039d=_0x5eb6aa['createRange'](_0x1ed3fd,_0x11bc1c),_0xd99b37=new Ot({'author':_0x2a5c2c['get'](_0x2673ec),'type':'isAdded'==_0x52b79d||'isAddSuggestion'==_0x52b79d?'add':'remove','data':{'isSuggestion':'isAddSuggestion'==_0x52b79d||'isRemoveSuggestion'==_0x52b79d},'createdAt':new Date(),'rootName':_0x7c144a});_0x39d4ae['push'](_0xd99b37),_0x3d0973['markers']['set']('revision:'+_0xd99b37['id'],_0x46039d);}function _0xe2d22b(_0x21ba98,_0x230d67){const _0x35ca32=_0x21ba98['getAttributes'](),_0x3a3a88=_0x230d67['getAttributes']();for(const _0x14ba56 of _0x35ca32){if(_0x14ba56[0x1]!==_0x230d67['getAttribute'](_0x14ba56[0x0]))return!0x1;_0x3a3a88['next']();}return _0x3a3a88['next']()['done'];}}_setConversion(){this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'revision'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision','view':_0x293829=>{const _0x47b33b=_0x293829['markerName']['split'](':')[0x1],_0x1617b9=this['_getChangeFromId'](_0x47b33b);if(!_0x1617b9)return null;const _0x224bce='add'==_0x1617b9['type']?'insertion':'deletion',_0x2e0765=['ck-suggestion-marker','ck-suggestion-marker-'+_0x224bce];return _0x1617b9['data']['isSuggestion']&&_0x2e0765['push']('ck-suggestion-marker-'+_0x224bce+'-new'),this['activeChange']==_0x1617b9&&_0x2e0765['push']('ck-suggestion-marker--active'),{'classes':_0x2e0765,'attributes':{'data-change-id':_0x47b33b}};}}),this['editor']['conversion']['for']('upcast')['add'](_0x447caa=>{_0x447caa['on']('element:pre',(_0x2a28b4,_0x5d26f4,_0x1d9b65)=>{const _0x21c358=_0x5d26f4['viewItem']['getChild'](0x0);if(!_0x21c358||!_0x21c358['is']('element','code'))return;if(!_0x1d9b65['consumable']['consume'](_0x21c358,{'attributes':['vid_start','vid_end']}))return;const _0x31c531=_0x5d26f4['modelRange']['start']['nodeAfter'];_0x1d9b65['writer']['setAttribute']('vid_start',_0x21c358['getAttribute']('vid_start'),_0x31c531),_0x1d9b65['writer']['setAttribute']('vid_end',_0x21c358['getAttribute']('vid_end'),_0x31c531);},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['add'](_0x5bd661=>{_0x5bd661['on']('element',(_0xcf2ff4,_0x5c3a37,_0x2ae0aa)=>{if(!_0x2ae0aa['consumable']['consume'](_0x5c3a37['viewItem'],{'attributes':['vid_start','vid_end']}))return;if(_0x5c3a37['modelRange']['isCollapsed'])return;const _0x143846=_0x5c3a37['modelRange']['start']['nodeAfter'];_0x143846['hasAttribute']('vid_start')||_0x143846['hasAttribute']('vid')||(_0x2ae0aa['writer']['setAttribute']('vid_start',_0x5c3a37['viewItem']['getAttribute']('vid_start'),_0x143846),_0x2ae0aa['writer']['setAttribute']('vid_end',_0x5c3a37['viewItem']['getAttribute']('vid_end'),_0x143846));},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['elementToAttribute']({'view':{'name':'span','attributes':{'vid':!0x0}},'model':{'key':'vid','value':_0x920668=>_0x920668['getAttribute']('vid')}}),this['editor']['model']['schema']['on']('checkAttribute',(_0x4c25b7,[,_0x40e6a5])=>{['vid_start','vid_end','vid']['includes'](_0x40e6a5)&&(_0x4c25b7['return']=!0x0,_0x4c25b7['stop']());},{'priority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x1e835e=>{_0x1e835e['on']('attribute:vid',(_0x1f2399,_0x156e92,_0x1deef1)=>{if('\x20'!=_0x156e92['item']['data']||_0x156e92['item']['parent']['maxOffset']>0x1)return;if(!_0x1deef1['consumable']['consume'](_0x156e92['item'],_0x1f2399['name']))return;const _0x45a63c=_0x1deef1['writer'],_0x9808b=_0x1deef1['mapper']['toViewRange'](_0x156e92['range']);_0x45a63c['wrap'](_0x9808b,_0x45a63c['createAttributeElement']('span'));});}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',function(_0x4ff395){const _0x269a80=_0x4ff395['plugins']['get']('RevisionViewer');return(_0x44ca0e,_0x58a278,_0x365245)=>{const _0x9e04c4=_0x58a278['markerName']['split'](':')[0x1],_0x3bff28=_0x269a80['_getChangeFromId'](_0x9e04c4);if(!_0x3bff28)return null;const _0x302070='add'==_0x3bff28['type']?'split':'merge';if(!_0x365245['consumable']['test'](_0x58a278['markerRange'],_0x44ca0e['name']))return;const _0x26af28=_0x58a278['markerRange']['getWalker'](),_0x2d3983=_0x58a278['markerRange']['start'],_0x81c934=_0x4ff395['model']['schema'];let _0x5a3ef8=null,_0x58ebf0=null,_0x30e5ea=!0x1,_0x16f1de=!0x1;for(const _0x4da5b1 of _0x26af28){const _0x5955e4=_0x4da5b1['item'];_0x30e5ea=_0x30e5ea||_0x81c934['isContent'](_0x5955e4);const _0x1d5a45=_0x365245['mapper']['toViewElement'](_0x5955e4);if(_0x1d5a45&&_0x1d5a45['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x4da5b1['type']&&(_0x81c934['isBlock'](_0x5955e4)&&!_0x81c934['isLimit'](_0x5955e4)&&(_0x5955e4['nextSibling']||_0x2d3983['isAtEnd']?_0x5a3ef8&&_0x5a3ef8['parent']==_0x5955e4||(_0x5a3ef8=_0x5955e4,_0x191625(_0x4da5b1['previousPosition']),_0x16f1de=!0x0):_0x58ebf0=_0x58ebf0||_0x4da5b1['previousPosition']));}function _0x191625(_0x149db6){const _0x346e6e=_0x365245['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x302070}),_0x57a5a8=_0x365245['mapper']['toViewPosition'](_0x149db6);_0x3bff28['data']['isSuggestion']&&_0x365245['writer']['addClass']('ck-suggestion-marker-'+_0x302070+'-new',_0x346e6e),_0x269a80['activeChange']==_0x3bff28&&_0x365245['writer']['addClass']('ck-suggestion-marker--active',_0x346e6e),_0x365245['writer']['insert'](_0x57a5a8,_0x346e6e),_0x365245['mapper']['bindElementToMarker'](_0x346e6e,_0x58a278['markerName']);}_0x30e5ea||_0x16f1de||!_0x58ebf0||_0x191625(_0x58ebf0);};}(this['editor']),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision',(_0x1004b1,_0x2a1c7c,_0xc9232f)=>{const _0x5a037b=_0xc9232f['mapper']['markerNameToElements'](_0x2a1c7c['markerName']);if(_0x5a037b){for(const _0x41f583 of _0x5a037b)(_0x41f583['hasClass']('ck-suggestion-marker-split')||_0x41f583['hasClass']('ck-suggestion-marker-merge'))&&(_0xc9232f['mapper']['unbindElementFromMarkerName'](_0x41f583,_0x2a1c7c['markerName']),_0xc9232f['writer']['remove'](_0x41f583));}},{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',(_0x47e612,_0x27e1e3,_0x11a6e7)=>{const _0x3abd1f=_0x27e1e3['markerName']['split'](':')[0x1],_0x49d823=this['_getChangeFromId'](_0x3abd1f);if(!_0x49d823)return null;const _0x58fa88='add'==_0x49d823['type']?'split':'merge';if(_0x11a6e7['consumable']['test'](_0x27e1e3['markerRange'],_0x47e612['name']))for(const _0x1397b7 of _0x27e1e3['markerRange']['getItems']()){if(!_0x1397b7['is']('element','softBreak'))continue;const _0x254a5f=_0x11a6e7['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x58fa88}),_0x532760=_0x11a6e7['mapper']['toViewPosition'](this['editor']['model']['createPositionBefore'](_0x1397b7));_0x49d823['data']['isSuggestion']&&_0x11a6e7['writer']['addClass']('ck-suggestion-marker-'+_0x58fa88+'-new',_0x254a5f),this['activeChange']==_0x49d823&&_0x11a6e7['writer']['addClass']('ck-suggestion-marker--active',_0x254a5f),_0x11a6e7['writer']['insert'](_0x532760,_0x254a5f),_0x11a6e7['mapper']['bindElementToMarker'](_0x254a5f,_0x27e1e3['markerName']);}},{'priority':'high'}),this['editor']['model']['document']['on']('change',()=>{this['editor']['editing']['view']['change'](_0x794dc4=>{for(const _0x1730e4 of this['editor']['model']['document']['getRootNames']()){const _0x39095d=this['editor']['model']['document']['getRoot'](_0x1730e4),_0x51d3da=this['editor']['editing']['view']['document']['getRoot'](_0x1730e4);if(_0x51d3da){const _0x1450c4=_0x39095d['getAttribute']('revisionHistoryAttachChange');if(_0x794dc4['removeAttribute']('data-change-id',_0x51d3da),_0x794dc4['removeClass']('ck-revision-history-root-add',_0x51d3da),_0x794dc4['removeClass']('ck-revision-history-root-remove',_0x51d3da),_0x794dc4['removeClass']('ck-revision-history-root--active',_0x51d3da),_0x1450c4){const _0x24737b=this['_getChangeFromId'](_0x1450c4);if(!_0x24737b)return null;_0x794dc4['setAttribute']('data-change-id',_0x1450c4,_0x51d3da),_0x794dc4['addClass']('ck-revision-history-root-'+_0x24737b['type'],_0x51d3da),this['activeChange']==_0x24737b&&_0x794dc4['addClass']('ck-revision-history-root--active',_0x51d3da);}}}});}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'comment','model':_0x52739b=>'revision-comment:'+_0x52739b,'converterPriority':'highest'}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'suggestion','model':_0x3ee67c=>'revision-suggestion:'+_0x3ee67c,'converterPriority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision-suggestion','view':_0x1c2b81=>({'name':'suggestion:'+_0x1c2b81,'group':'revision-suggestion'}),'converterPriority':'highest'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-suggestion','view':_0x5c65db=>{const _0x31b10f=_0x5c65db['markerName']['split'](':')[0x1];return'insertion'!=_0x31b10f&&'deletion'!=_0x31b10f?null:{'classes':['ck-suggestion-preview-marker','ck-suggestion-preview-marker-'+_0x31b10f]};}}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:deletion',Vt(this['editor'],'merge'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:insertion',Vt(this['editor'],'split'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision-suggestion',(_0x17173a,_0x187e1d,_0x43e27b)=>{const _0x1346f6=_0x43e27b['mapper']['markerNameToElements'](_0x187e1d['markerName']);if(_0x1346f6){for(const _0x5ed899 of _0x1346f6)_0x5ed899['is']('uiElement')&&(_0x43e27b['mapper']['unbindElementFromMarkerName'](_0x5ed899,_0x187e1d['markerName']),_0x43e27b['writer']['remove'](_0x5ed899));}},{'priority':'high'});}_getChangeFromId(_0x4751dc){return this['_changeIdToChange']['get'](_0x4751dc);}_getViewForChange(_0x4e06c6){return this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=new Nt(this['editor']['locale'],_0x4e06c6),this['_changeView'];}_initInteractions(){this['editor']['model']['document']['selection']['observeMarkers']('revision'),this['on']('change:activeView',(_0x2d76a1,_0xc52a86,_0x30878a,_0xa47caf)=>{_0xa47caf&&this['_balloon']['remove'](_0xa47caf),_0x30878a&&(this['_balloon']['add']({'view':_0x30878a,'stackId':'revisionHistoryLabel','position':{'target':()=>{const _0x3bdf9d=this['editor']['editing'],_0x5a96a4=this['_getChangeFromId'](_0x30878a['changeId']);let _0x30aa68;if(_0x5a96a4['data']['isOnRoot']){const _0x4cf874=_0x3bdf9d['view']['getDomRoot'](_0x5a96a4['rootName']);_0x30aa68=Array['from'](_0x4cf874['getClientRects']());}else{const _0x3555bb=this['editor']['model']['markers']['get']('revision:'+_0x30878a['changeId']);_0x30aa68=Array['from'](_0x3bdf9d['mapper']['markerNameToElements'](_0x3555bb['name']))['map'](_0x1390e4=>_0x3bdf9d['view']['domConverter']['mapViewToDom'](_0x1390e4))['map'](_0x53bd9a=>Array['from'](_0x53bd9a['getClientRects']()))['flat']();}return this['_activeViewTarget']&&_0x30aa68['find'](_0x5c26b3=>_0x5c26b3['top']-0x3<=this['_activeViewTarget']['y']&&_0x5c26b3['bottom']+0x3>=this['_activeViewTarget']['y']&&_0x5c26b3['left']-0x3<=this['_activeViewTarget']['x']&&_0x5c26b3['right']+0x3>=this['_activeViewTarget']['x'])||_0x30aa68[0x0];}}}),this['_balloon']['showStack']('revisionHistoryLabel'));}),this['on']('change:activeChange',(_0x544507,_0x2216d2,_0x529645,_0x36dab1)=>{this['activeView']=_0x529645?this['_getViewForChange'](_0x529645):null,this['editor']['model']['change'](()=>{const _0xfb8f71=this['editor']['editing'];_0x36dab1&&(_0x36dab1['data']['isOnRoot']?_0xfb8f71['view']['change'](_0x30d57b=>{_0x30d57b['removeClass']('ck-revision-history-root--active',_0xfb8f71['view']['document']['getRoot'](_0x36dab1['rootName']));}):_0xfb8f71['reconvertMarker']('revision:'+_0x36dab1['id'])),_0x529645&&(_0x529645['data']['isOnRoot']?_0xfb8f71['view']['change'](_0x2f3adc=>{_0x2f3adc['addClass']('ck-revision-history-root--active',_0xfb8f71['view']['document']['getRoot'](_0x529645['rootName']));}):_0xfb8f71['reconvertMarker']('revision:'+_0x529645['id']));});}),this['listenTo'](this['editor']['editing']['view']['document'],'mouseover',(_0x34e8f1,_0x5da308)=>{if(this['activeChange'])return;const _0x24f7ba=this['_findChangeIdFromDomTarget'](_0x5da308['target']),_0x5f0eb4=this['_changeIdToChange']['get'](_0x24f7ba);_0x5f0eb4?(this['_activeViewTarget']={'x':_0x5da308['domEvent']['x'],'y':_0x5da308['domEvent']['y']},this['activeView']=this['_getViewForChange'](_0x5f0eb4)):(this['_activeViewTarget']=null,this['activeView']=null);}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',(_0x46f3fb,_0x35924e)=>{const _0x26b9e0=this['_findChangeIdFromDomTarget'](_0x35924e['target']),_0x21422e=this['_changeIdToChange']['get'](_0x26b9e0);_0x21422e?(this['_activeViewTarget']={'x':_0x35924e['domEvent']['x'],'y':_0x35924e['domEvent']['y']},_0x21422e===this['activeChange']?this['_balloon']['updatePosition']():this['activeChange']=_0x21422e):(this['_activeViewTarget']=null,this['activeChange']=null);});}_findChangeIdFromDomTarget(_0x4eab50){do{const _0x285bd5=_0x4eab50['getAttribute']('data-change-id');if(_0x285bd5)return _0x285bd5;_0x4eab50=_0x4eab50['parent'];}while(_0x4eab50);return null;}['_cleanMarkers'](){this['editor']['model']['change'](_0x4d6143=>{for(const _0x3c4564 of this['editor']['model']['markers'])_0x4d6143['removeMarker'](_0x3c4564);});}};function Vt(_0x127f94,_0x22e5c2){return(_0x2e1206,_0xebc1a8,_0x408283)=>{if(!_0x408283['consumable']['test'](_0xebc1a8['markerRange'],_0x2e1206['name']))return;const _0x4a9811=_0xebc1a8['markerRange']['getWalker'](),_0x471fa4=_0xebc1a8['markerRange']['start'],_0x506774=_0x127f94['model']['schema'];let _0x4eb71f=null,_0x3fe20b=null,_0x518522=!0x1,_0x415fa1=!0x1;for(const _0x117473 of _0x4a9811){const _0x40c8b0=_0x117473['item'];_0x518522=_0x518522||_0x506774['isContent'](_0x40c8b0);const _0x78053c=_0x408283['mapper']['toViewElement'](_0x40c8b0);if(_0x78053c&&_0x78053c['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x117473['type']&&(_0x506774['isBlock'](_0x40c8b0)&&!_0x506774['isLimit'](_0x40c8b0)&&(_0x40c8b0['nextSibling']||_0x471fa4['isAtEnd']?_0x4eb71f&&_0x4eb71f['parent']==_0x40c8b0||(_0x4eb71f=_0x40c8b0,_0x55a6a3(_0x117473['previousPosition']),_0x415fa1=!0x0):_0x3fe20b=_0x3fe20b||_0x117473['previousPosition']));}function _0x55a6a3(_0x2760f4){const _0x3583f2=_0x408283['mapper']['toViewPosition'](_0x2760f4),_0x672854=_0x408283['writer']['createUIElement']('span',{'class':'ck-suggestion-preview-marker-'+_0x22e5c2});_0x408283['writer']['insert'](_0x3583f2,_0x672854),_0x408283['mapper']['bindElementToMarker'](_0x672854,_0xebc1a8['markerName']);}_0x518522||_0x415fa1||!_0x3fe20b||_0x55a6a3(_0x3fe20b);};}var Dt=class extends _0x3d1a99{constructor(_0x1d96e3){super(_0x1d96e3);const _0x359010=_0x1d96e3['plugins']['get'](Mt);this['affectsData']=!0x1,this['listenTo'](_0x359010,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x359010,'change:isEnabled',()=>this['refresh']());}execute(){const _0x561b74=this['editor'],_0x215395=_0x561b74['plugins']['get'](Mt),_0x1d8423=_0x215395['isReady']?_0x215395['diff']['newRevisionId']:null;_0x561b74['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x1d8423);}['refresh'](){const {isReady:_0x1fb5c4,isEnabled:_0x53d852,repository:_0x1586af,diff:_0x180418}=this['editor']['plugins']['get'](Mt),_0x1aaed8=_0x180418&&_0x1586af['getLaterVisibleRevision'](_0x180418['newRevisionId']);this['isEnabled']=_0x1fb5c4&&_0x53d852&&Boolean(_0x1aaed8);}},Tt=class extends _0x3d1a99{_step;constructor(_0x4079f5,{direction:_0x55cfea}){super(_0x4079f5);const _0x59fa8a=_0x4079f5['plugins']['get'](Mt);this['affectsData']=!0x1,this['_step']='forward'===_0x55cfea?0x1:-0x1,this['listenTo'](_0x59fa8a,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x59fa8a,'change:isEnabled',()=>this['refresh']()),this['listenTo'](_0x59fa8a,'change:activeChange',()=>this['refresh']());}execute(){const _0xa2d24d=this['editor'],_0x4474fd=_0xa2d24d['plugins']['get'](Mt),{isNavigationMode:_0x2217e7,currentChangeNumber:_0x43bdfa}=_0x4474fd;let _0x204dbd;if(_0x4474fd['activeChange']=_0x2217e7?_0x4474fd['diff']['changes']['get'](_0x43bdfa+this['_step']):_0x4474fd['diff']['changes']['first'],_0x4474fd['activeChange']['data']['isOnRoot'])_0x204dbd=_0xa2d24d['editing']['view']['getDomRoot'](_0x4474fd['activeChange']['rootName']);else{const _0x3ce588=_0xa2d24d['model']['markers']['get']('revision:'+_0x4474fd['activeChange']['id']);_0x204dbd=_0x55552e(_0xa2d24d['editing'],_0x3ce588);}_0x2bd836({'target':_0x204dbd,'viewportOffset':0x28});}['refresh'](){const {isNavigationMode:_0x5c5a7d,currentChangeNumber:_0x3d10de,numberOfChanges:_0x30387c,isReady:_0x397c60,isEnabled:_0x180955}=this['editor']['plugins']['get'](Mt);this['isEnabled']=!!(_0x180955&&_0x397c60&&_0x30387c)&&(!_0x5c5a7d||(0x1===this['_step']?_0x3d10de<_0x30387c-0x1:_0x3d10de>0x0));}},Ht=class extends at{constructor(_0x28d056){super(_0x28d056);const _0x3f4f1b=this['bindTemplate'],_0x55fe15=new _0x2d4f6c(_0x28d056),_0x48da51=new _0x2d4f6c(_0x28d056);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',(_0x4d21ec,_0x349f17)=>_0x4d21ec&&_0x349f17>0x0),this['bind']('_statusText')['to'](this,'isReady',this,'currentChangeNumber',this,'numberOfChanges',this,'isNavigationMode',(_0x46c804,_0x340fc5,_0x22983e,_0x51b7db)=>{if(!_0x46c804)return pt(_0x28d056,'Loading...');if(!_0x22983e)return pt(_0x28d056,'No\x20changes');const _0x4c1864=pt(_0x28d056,'NUMBER_OF_CHANGES',_0x22983e);return _0x51b7db?pt(_0x28d056,'X_OF_Y_CHANGES',[_0x340fc5+0x1,_0x22983e]):_0x4c1864;}),_0x55fe15['set']({'label':pt(_0x28d056,'Show\x20previous\x20change'),'tooltip':!0x0,'icon':_0x3a0010}),_0x48da51['set']({'label':pt(_0x28d056,'Show\x20next\x20change'),'tooltip':!0x0,'icon':_0x16124d}),_0x55fe15['bind']('isEnabled')['to'](this,'isBackwardNavigationEnabled'),_0x48da51['bind']('isEnabled')['to'](this,'isForwardNavigationEnabled'),_0x55fe15['on']('execute',()=>this['fire']('execute','backward')),_0x48da51['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',_0x3f4f1b['if']('_isStatusLabelVisible','ck-hidden',_0x2d8dee=>!_0x2d8dee)]},'children':[{'text':_0x3f4f1b['to']('isNavigationMode',_0x57338b=>_0x57338b?pt(_0x28d056,'EDIT_X_OF_Y_REVISIONS')+':\x20':pt(_0x28d056,'Total')+':\x20')}]},{'text':_0x3f4f1b['to']('_statusText')}]},new nt(),{'tag':'div','attributes':{'class':['ck-revision-history-ui__changes-navigation__navigation']},'children':[_0x55fe15,_0x48da51]}]});}};const Pt='ck-editor__editable__loading-overlay';var Ut=class extends _0x1e8181{static get['pluginName'](){return'RevisionViewerLoadingOverlay';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['show'](){const _0x740401=this['editor']['editing']['view'];_0x740401['change'](_0x33c6d2=>{for(const _0x391637 of _0x740401['document']['roots'])_0x33c6d2['addClass'](Pt,_0x391637);});}['hide'](){const _0x21984b=this['editor']['editing']['view'];_0x21984b['change'](_0x34734b=>{for(const _0x23e16d of _0x21984b['document']['roots'])_0x34734b['removeClass'](Pt,_0x23e16d);});}},Lt=class extends _0x1e8181{static get['pluginName'](){return'RevisionViewerUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Mt,Ut];}init(){const _0x1cc026=this['editor'],_0x416265=_0x1cc026['plugins']['get'](Mt),_0x27fccd=_0x1cc026['plugins']['get'](Ut);_0x1cc026['ui']['componentFactory']['add']('exitToEditing',_0x1d3341=>{const _0x4206c4=new _0x2d4f6c(_0x1d3341);return _0x4206c4['set']({'label':pt(_0x1d3341,'Back\x20to\x20editing'),'icon':_0x80e8f3,'withText':!0x0,'tooltip':!0x0,'class':'ck-revision-history-ui__back-to-editing'}),this['listenTo'](_0x4206c4,'execute',()=>{_0x1cc026['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}),_0x4206c4;}),_0x1cc026['ui']['componentFactory']['add']('restoreRevision',_0x4672a8=>{const _0x3d7d4d=new _0x2d4f6c(_0x4672a8);return _0x3d7d4d['set']({'label':pt(_0x4672a8,'Restore\x20this\x20revision'),'withText':!0x0,'tooltip':!0x0}),_0x3d7d4d['bind']('isEnabled')['to'](_0x1cc026['commands']['get']('restoreRevision')),this['listenTo'](_0x3d7d4d,'execute',()=>_0x1cc026['execute']('restoreRevision')),_0x3d7d4d;}),_0x1cc026['ui']['componentFactory']['add']('changesNavigation',_0x5f42ef=>{const _0x57069b=new Ht(_0x5f42ef),_0x162512=_0x1cc026['commands']['get']('showPreviousChange'),_0x39ed9c=_0x1cc026['commands']['get']('showNextChange');return _0x57069b['bind']('isBackwardNavigationEnabled')['to'](_0x162512,'isEnabled'),_0x57069b['bind']('isForwardNavigationEnabled')['to'](_0x39ed9c,'isEnabled'),_0x57069b['bind']('isReady','currentChangeNumber','numberOfChanges','isNavigationMode')['to'](_0x416265),this['listenTo'](_0x57069b,'execute',(_0x38d89d,_0x5363f8)=>{_0x1cc026['execute']('forward'===_0x5363f8?'showNextChange':'showPreviousChange');}),_0x57069b;}),_0x27fccd['show'](),_0x416265['on']('change:isReady',(_0x227e72,_0xbb1fc7,_0x23c1e3)=>{_0x23c1e3?_0x27fccd['hide']():_0x27fccd['show']();});}},Ft=class extends _0x3f1a2a{['_resizeObserver']=null;constructor(_0x1b34fb,_0x3535c3){super(_0x1b34fb,_0x3535c3);const _0x13950e=this['bindTemplate'];this['set']({'label':pt(_0x1b34fb,'Revision\x20name'),'_tooltipString':''}),this['fieldView']['placeholder']=pt(_0x1b34fb,'Enter\x20the\x20revision\x20name'),this['extendTemplate']({'tag':'span','attributes':{'class':['ck-revision-history-sidebar__revision-name'],'data-cke-tooltip-text':_0x13950e['to']('_tooltipString'),'data-cke-tooltip-position':'s','data-cke-tooltip-class':'ck-tooltip_multi-line'}});}['render'](){super['render'](),this['_resizeObserver']=new _0x2fb5f0(this['fieldView']['element'],()=>this['_updateTooltipText']()),this['listenTo'](this['fieldView'],'input',()=>this['_updateTooltipText']());}destroy(){super['destroy'](),this['_resizeObserver']&&this['_resizeObserver']['destroy']();}_updateTooltipText(){const _0x2fc5d6=this['fieldView']['element'];this['_tooltipString']=_0x2fc5d6['scrollWidth']>_0x2fc5d6['clientWidth']&&_0x2fc5d6['value']||'';}},$t=class extends at{constructor(_0x3e1239,_0x4eaaeb,_0x3b9a40){super(_0x3e1239);const _0x4c316f=new _0x290fa8();_0x4c316f['set']({'content':_0x22929e,'viewBox':'0\x200\x2011\x2010'});const _0x41a655=['ck','ck-revision-history-sidebar__revision-author'];_0x3b9a40&&_0x41a655['push']('ck-revision-history-sidebar__revision-author_creator');const _0x335211=[{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__revision-author__name'],'title':pt(_0x3e1239,_0x3b9a40?'Revision\x20creator':'Revision\x20author')},'children':[_0x4c316f,_0x4eaaeb['name']]}];this['setTemplate']({'tag':'li','attributes':{'class':_0x41a655},'children':_0x335211});}};function jt(_0xb57db2,_0x4f1ddb){const _0x4d2602=_0xb57db2['bindTemplate'],_0x4eb22b=_0xb57db2['locale'],_0x383894=ct(_0x4eb22b);_0x383894['panelPosition']='sw';const _0x47a505=function(_0x51fa94,_0x3bf008){const _0x354f18=function(_0x242594,_0x39a8c8){const _0x195f8c=_0x242594['locale'],_0x387806={'Compare\x20against\x20selected':pt(_0x195f8c,'Compare\x20against\x20selected'),'Name\x20this\x20revision':pt(_0x195f8c,'Name\x20this\x20revision'),'Restore\x20this\x20revision':pt(_0x195f8c,'Restore\x20this\x20revision')};return _0x39a8c8['map'](_0x18139a=>{const _0x5ce9ca=_0x387806[_0x18139a['name']];return _0x5ce9ca&&_0x5ce9ca!==_0x18139a['name']&&(_0x18139a['name']=_0x5ce9ca),_0x18139a;});}(_0x51fa94,_0x3bf008),_0x3cfd3a=new _0x2d7d2b();for(const _0x7a5311 of _0x354f18){const _0x30d649={'type':'button','model':new rt({'label':_0x7a5311['name'],'class':_0x7a5311['class'],'withText':!0x0,'role':'menuitem','_action':_0x7a5311['action']})};_0x30d649['model']['bind']('isEnabled')['to'](_0x51fa94,'isActionsDropdownOpen',_0x52da0e=>'function'!=typeof _0x7a5311['isEnabled']||(!_0x52da0e||_0x7a5311['isEnabled'](_0x51fa94))),_0x3cfd3a['add'](_0x30d649);}return _0x3cfd3a;}(_0xb57db2,_0x4f1ddb);return _0xb57db2['bind']('isActionsDropdownOpen')['to'](_0x383894,'isOpen'),_0x383894['buttonView']['set']({'label':pt(_0x4eb22b,'Show\x20more\x20items'),'tooltip':!0x0,'tooltipPosition':'sw','icon':_0x59edc2}),_0x383894['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision__actions',_0x4d2602['if']('isActionsDropdownOpen','ck-on')]},'on':{'click':_0x4d2602['to'](_0x29a3b9=>_0x29a3b9['stopPropagation']())}}),_0x383894['on']('execute',_0x47cb6c=>{_0xb57db2['isReady']&&'function'==typeof _0x47cb6c['source']['_action']&&_0x47cb6c['source']['_action'](_0xb57db2);}),ht(_0x383894,_0x47a505,{'role':'menu'}),_0x383894['listenTo'](_0xb57db2,'change:isActionsDropdownOpen',(_0x2591b7,_0x2595c9,_0x2d99fc)=>{if(_0x2d99fc)for(const _0x4272ce of _0x383894['listView']['items']){const _0x119116=_0x4272ce['children']['first'],_0x5a69a3=_0x4f1ddb['find'](_0x2c4b67=>_0x2c4b67['action']===_0x119116['_action'])['isVisible'];_0x4272ce['isVisible']=void 0x0===_0x5a69a3||_0x5a69a3(_0xb57db2);}}),_0x383894;}const Bt=/* #__PURE__ -- @preserve */
|
|
27
|
-
|
|
23
|
+
import{CKEditorError as _0x5de8be,Collection as _0xca5138,ElementReplacer as _0x50370e,FocusTracker as _0x14f511,KeystrokeHandler as _0x516c36,ObservableMixin as _0x565ee3,ResizeObserver as _0x2bd05d,logWarning as _0x5dc4d2,scrollViewportToShowTarget as _0x450e22,uid as _0x390b5b}from'@ckeditor/ckeditor5-utils';import{cloneDeep as _0x46d7d7,isEqual as _0x40698a,set as _0x4e82c0,unset as _0x379037}from'es-toolkit/compat';import{Command as _0x3fb756,Editor as _0x4169a0,ElementApiMixin as _0x55ca3e,PendingActions as _0x134269,Plugin as _0x4a2cc5}from'@ckeditor/ckeditor5-core';import{ConfirmMixin as _0x78fd76,Users as _0x4cd47f,getMarkerDomElement as _0xc63871,sanitizeEditorConfig as _0x2ce096}from'@ckeditor/ckeditor5-collaboration-core';import{ModelDocumentFragment as _0x596b32,ModelElement as _0x474a71,ModelPosition as _0x113286,ModelRange as _0x9da893,ModelText as _0x2458d3,ViewAttributeElement as _0x5450e0,ViewContainerElement as _0x3c689b,ViewDocumentFragment as _0x1741ee,ViewElement as _0x420251,ViewEmptyElement as _0x552c03,ViewRawElement as _0x47b995,ViewText as _0x33e9c4,ViewUIElement as _0x15f123}from'@ckeditor/ckeditor5-engine';import{IconChevronDown as _0x6638da,IconChevronUp as _0xd45106,IconHistory as _0xc681fc,IconThreeVerticalDots as _0x389cb8,IconUndo as _0xd180d0,IconUser as _0x9d919b}from'@ckeditor/ckeditor5-icons';import{BoxedEditorUIView as _0x5f16f3,ButtonView as _0x8e67d0,ContextualBalloon as _0x3e858d,CssTransitionDisablerMixin as _0x565b1d,EditorUI as _0x25b37d,IconView as _0x4d1f21,InlineEditableUIView as _0x4a56fe,LabeledFieldView as _0x598ee3,ListItemView as _0x39771e,ListView as _0x399eaf,MenuBarMenuListItemButtonView as _0x35474a,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 */
|
|
24
|
+
_0x565ee3();var gt=class extends vt{['id'];creator;authors;diffData;toVersion;['fromVersion'];['model'];constructor(_0x368199){super(),this['id']=_0x368199['id']||_0x390b5b(),this['creator']=_0x368199['creator']||null,this['authors']=_0x368199['authors']||[],this['diffData']=_0x368199['diffData']||null,this['toVersion']=_0x368199['toVersion']||0x0,this['fromVersion']=_0x368199['fromVersion']||0x0,this['set']('name',_0x368199['name']||''),this['set']('createdAt',_0x368199['createdAt']||new Date()),this['set']('attributes',_0x368199['attributes']||{});}setName(_0x824806){this['_update']({'name':_0x824806});}setAttribute(_0x590fb5,_0x189364){const _0x4c1f88=_0x46d7d7(this['attributes']);_0x4e82c0(_0x4c1f88,_0x590fb5,_0x189364),this['_update']({'attributes':_0x4c1f88});}removeAttribute(_0x3887bd){const _0x4a3c06=_0x46d7d7(this['attributes']);_0x379037(_0x4a3c06,_0x3887bd),this['_update']({'attributes':_0x4a3c06});}_update(_0x3c5ea0,_0x33fcfd=!0x1){let _0x1b3782=!0x1;const _0x5c512b={'id':this['id']};for(const _0x2a7ca4 of['name','createdAt','diffData','authors','attributes','toVersion','fromVersion','creatorId']){const _0x14550e=_0x3c5ea0[_0x2a7ca4];void 0x0!==_0x14550e&&_0x14550e!==this[_0x2a7ca4]&&(this[_0x2a7ca4]=_0x14550e,_0x5c512b[_0x2a7ca4]=_0x14550e,_0x1b3782=!0x0);}_0x1b3782&&(_0x5c512b['authors']&&(_0x5c512b['authorsIds']=_0x5c512b['authors']['map'](_0x139bf8=>_0x139bf8['id']),delete _0x5c512b['authors']),this['fire']('_update',_0x5c512b,_0x33fcfd));}toJSON(){return{'id':this['id'],'name':this['name'],'creatorId':this['creator']?this['creator']['id']:null,'authorsIds':this['authors']['map'](_0xd82723=>_0xd82723['id']),'diffData':this['diffData'],'createdAt':this['createdAt'],'attributes':this['attributes'],'fromVersion':this['fromVersion'],'toVersion':this['toVersion']};}},mt=class extends _0x4a2cc5{['_revisions'];static get requires(){return[_0x4cd47f];}static get['pluginName'](){return'RevisionsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get length(){return this['_revisions']['length'];}constructor(_0x44601a){super(_0x44601a),this['_revisions']=new _0xca5138();}afterInit(){!async function(_0x4ddfc9){const _0x35732a='vsmL4TPpuR53MlqSj2VXwH9oEAN8FxJtGUOdbDCZ01ihyfkBQY6acgz7rIeWKn',_0x16efcf=0xeb829,_0x7517af=0x79188,_0x2a005f=window['Date']['now'](),_0x3b914b=_0x4ddfc9['editor'],_0x207170=new window['Promise'](_0x1bcdec=>{_0x3b914b['once']('ready',_0x1bcdec);}),_0xaa02e9={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x306589=_0x3b914b['config']['get']('licenseKey');async function _0xff63e(){let _0x2036f6,_0x366131=null,_0x2ce32e=null;try{return'GPL'==_0x306589?'NotAllowed':(_0x2036f6=_0x2cde40(),_0x2036f6?(_0x2036f6['usageEndpoint']&&(_0x2ce32e=_0x27bfc5(_0x2036f6['usageEndpoint'],_0x2036f6['jti'])),await _0x24c6ae()?_0x568db8()?_0x51ac88()?'Expired':_0x119fc9()?('evaluation'==_0x2036f6['licenseType']&&(_0x366131=_0x38a502('EvaluationLimit')),await _0x6aeedb()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x51ac88(){const _0x12d4c1=['evaluation','trial']['includes'](_0x2036f6['licenseType'])?_0x2a005f/0x3e8:0xe10*_0x7517af;return _0x2036f6['exp']<_0x12d4c1;}function _0x568db8(){const _0x4f6e2a=_0x2036f6['features'];if(!_0x4f6e2a)return!0x1;if(_0x4f6e2a['includes']('*'))return!0x0;if(_0x4f6e2a['includes']('RH'))return!0x0;if(_0x4f6e2a['includes']('RRH')){if(_0x2e7f15())return!0x0;if(_0x416c6f()||_0x2bc360())return!0x0;}return!0x1;}function _0x119fc9(){const _0x104cfe=_0x2036f6['licensedHosts'];if(!_0x104cfe||0x0==_0x104cfe['length'])return!0x0;const {hostname:_0x4f2f4b}=new URL(window['location']['href']);if(_0x104cfe['includes'](_0x4f2f4b))return!0x0;const _0x136be4=_0x4f2f4b['split']('.');return _0x104cfe['filter'](_0x15d247=>_0x15d247['includes']('*'))['map'](_0x2ddd9a=>_0x2ddd9a['split']('.'))['filter'](_0xd63e51=>_0xd63e51['length']<=_0x136be4['length'])['map'](_0x2c799e=>Array(_0x136be4['length']-_0x2c799e['length'])['fill']('*'===_0x2c799e[0x0]?'*':'')['concat'](_0x2c799e))['some'](_0x1e00bb=>_0x136be4['every']((_0x385225,_0x4c2bb9)=>_0x1e00bb[_0x4c2bb9]===_0x385225||'*'===_0x1e00bb[_0x4c2bb9]));}function _0x6aeedb(){return _0x366131&&_0x2ce32e?new window['Promise']((_0x218f2c,_0x21b213)=>{_0x366131['then'](_0x218f2c,_0x21b213),_0x2ce32e['then'](_0x573322=>{'Valid'!=_0x573322&&_0x218f2c(_0x573322);},_0x21b213);}):_0x366131||_0x2ce32e||'Valid';}}function _0x27bfc5(_0x434758,_0x3ab71f){return new window['Promise'](_0x396177=>{if(_0x574dbe())return _0x396177('Valid');_0x1d944c(),_0x3b914b['decorate']('_sendUsageRequest');let _0x2d37b3=!0x1;const _0x48c7b2=_0x390b5b();function _0x20054d(_0x592768){return!!_0x592768&&('object'==typeof _0x592768||'function'==typeof _0x592768)&&'function'==typeof _0x592768['then']&&'function'==typeof _0x592768['catch'];}function _0x2d7016(_0x3d9e6a){_0x340936(_0x3d9e6a)['then'](_0x35ad4f=>_0x35ad4f&&'ok'==_0x35ad4f['status']?_0x496418(_0x4b536c(_0x48c7b2+_0x3ab71f))!=_0x35ad4f['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x10e0d4=>(_0x3e2cdc(),_0x10e0d4),()=>{const _0x538959=_0xe61e09();return null==_0x538959?(_0x3e2cdc(),'Valid'):_0x2a005f-_0x538959>0x240c8400?'UsageLimit':'Valid';})['then'](_0x396177)['catch'](()=>{_0x396177('UsageLimit');});const _0xd9dad9=0x36ee80;function _0x3e2cdc(){const _0x422311='llct-'+_0x496418(_0x4b536c(_0x434758)),_0x509c37=_0xcdd1b0(_0x496418(window['Math']['ceil'](_0x2a005f/_0xd9dad9)));window['localStorage']['setItem'](_0x422311,_0x509c37);}function _0xe61e09(){const _0x5abe1f='llct-'+_0x496418(_0x4b536c(_0x434758)),_0x4e59de=window['localStorage']['getItem'](_0x5abe1f);return _0x4e59de?window['parseInt'](_0xcdd1b0(_0x4e59de),0x10)*_0xd9dad9:null;}function _0x340936(_0xf47233){return new window['Promise']((_0x11f568,_0x2c8b02)=>{_0xf47233['then'](_0x11f568,_0x2c8b02),window['setTimeout'](_0x2c8b02,0x1d4c0);});}}_0x3b914b['on']('_sendUsageRequest',(_0x49053f,_0x3c5f13)=>{if(_0x3c5f13[0x0]!=_0x434758)return _0x396177('UsageLimit');_0x3c5f13[0x1]={..._0x3c5f13[0x1],'requestId':_0x48c7b2};},{'priority':'high'}),_0x3b914b['on']('_sendUsageRequest',_0x38b95f=>{_0x20054d(_0x38b95f['return'])&&(_0x2d37b3=!0x0,_0x2d7016(_0x38b95f['return']));},{'priority':'low'}),_0x207170['then'](()=>{_0x2d37b3||_0x396177('UsageLimit');});});function _0x574dbe(){return'auto'==_0x3b914b['editing']['view']['_overlayModeHint'];}function _0x1d944c(){_0x3b914b['editing']['view']['_overlayModeHint']='auto';}}function _0x38a502(_0x2c972e){const _0x3cf8f0=[new window['Promise'](_0x190bf7=>setTimeout(_0x190bf7,0x93ecc)),_0x207170['then'](()=>new window['Promise'](_0x403824=>{const _0x4da61e=0x7,_0x27e0a6=_0x4ddfc9['_revisions'];function _0x36ae35(){_0x27e0a6['length']>=_0x4da61e&&_0x403824();}_0x36ae35(),_0x27e0a6['on']('add',_0x36ae35);})),new window['Promise'](_0x3ee9c9=>{function _0x4273a3(){for(const _0x1c9869 in window)if(window['Number']['isNaN'](window['Number'](_0x1c9869))&&window[_0x1c9869]==_0x16efcf)return _0x3ee9c9();'destroyed'!=_0x3b914b['state']&&window['setTimeout'](_0x4273a3,0x1388);}_0xd3554a('RevisionViewer')&&_0x4273a3();})];return window['Promise']['race'](_0x3cf8f0)['then'](()=>_0x2c972e);}async function _0x3cc10a(){if(await _0x207170,_0xd3554a('RevisionViewer')){const _0xc3a622=_0x4ddfc9['getRevision'](0x0),_0x4bd303=_0x4ddfc9['getEarlierVisibleRevision'](_0xc3a622['id']),_0x5b06d0=_0x5f62dc('RevisionViewer');return await _0x5b06d0['compare'](_0xc3a622['id'],_0x4bd303?_0x4bd303['id']:null,!0x0),_0x5b06d0['unbind']('isEnabled'),_0x5b06d0['isEnabled']=!0x1,_0x5b06d0['compare']=_0x2c86dc,void(_0x5b06d0['_getDiff']=_0x2c86dc);}if(_0xd3554a('RevisionTracker')){const _0x3a42be=_0x5f62dc('RevisionTracker');_0x3a42be['unbind']('isEnabled'),_0x3a42be['isEnabled']=!0x1,_0x3a42be['update']=_0x2c86dc,_0x3a42be['saveRevision']=_0x2c86dc;}_0x3b914b['model']['change']=_0x2c86dc,_0x3b914b['model']['enqueueChange']=_0x2c86dc,_0x3b914b['enableReadOnlyMode']('model');}function _0x2e7f15(){return _0xd3554a('WebSocketGateway')&&'connected'==_0x5f62dc('WebSocketGateway')['state'];}function _0x416c6f(){return _0xd3554a('RevisionViewerIntegration');}function _0x2bc360(){return _0xd3554a('TrackChangesDataGetter');}function _0x21b155(_0x36e647){const _0x407703=_0x53e697();_0x3b914b[_0x407703]='revisionHistoryLicenseKey'+_0x36e647,_0x36e647['endsWith']('Limit')&&(window[_0x53e697()]=_0x16efcf),'Valid'!=_0x36e647&&_0x3cc10a();}function _0x53e697(){const _0x2c19b7=window['String'](window['performance']['now']())['replace']('.','');let _0x3ec5af='v';for(let _0x36e438=0x0;_0x36e438<_0x2c19b7['length'];_0x36e438+=0x2){let _0x382e45=window['parseInt'](_0x2c19b7['substring'](_0x36e438,_0x36e438+0x2));_0x382e45>=0x3e&&(_0x382e45-=0x3e),_0x3ec5af+=_0x35732a[_0x382e45];}return _0x3ec5af;}function _0x2cde40(){const _0x215771=_0x306589['split']('.');if(0x3!=_0x215771['length'])return null;return _0x5dcbf3(_0x215771[0x1]);function _0x5dcbf3(_0x172e24){const _0xdd6c22=_0x518994(_0x172e24);return _0xdd6c22&&_0x174476()?_0xdd6c22:null;function _0x174476(){const _0x4a5c4a=_0xdd6c22['jti'],_0x3474b0=window['parseInt'](_0x4a5c4a['substring'](_0x4a5c4a['length']-0x8),0x10),_0x4f926e={..._0xdd6c22,'jti':_0x4a5c4a['substring'](0x0,_0x4a5c4a['length']-0x8)};return delete _0x4f926e['vc'],_0x4b536c(_0x4f926e)==_0x3474b0;}}}async function _0x24c6ae(){let _0x512124=!0x0;try{const [_0xc6f0ef,_0x2969e2,_0x5c3853]=_0x306589['split']('.');return _0x32a964(_0xc6f0ef),await _0x296bf2(_0xc6f0ef,_0x2969e2,_0x5c3853),_0x512124;}catch{return!0x1;}function _0x32a964(_0x4c0568){const _0x27a9a2=_0x518994(_0x4c0568);_0x27a9a2&&'ES256'==_0x27a9a2['alg']||(_0x512124=!0x1);}async function _0x296bf2(_0x300c2c,_0x222673,_0x593fcf){const _0x1a347b=window['Uint8Array']['from'](_0x58cdcf(_0x593fcf),_0xcdfa33=>_0xcdfa33['charCodeAt'](0x0)),_0x3be660=new window['TextEncoder']()['encode'](_0x300c2c+'.'+_0x222673),_0x2c1e3b=window['crypto']['subtle'];if(!_0x2c1e3b)return;const _0x543b5c=await _0x2c1e3b['importKey']('jwk',_0xaa02e9,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x2c1e3b['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x543b5c,_0x1a347b,_0x3be660)||(_0x512124=!0x1);}}function _0x518994(_0xfd9190){return _0xfd9190['startsWith']('ey')?JSON['parse'](_0x58cdcf(_0xfd9190)):null;}function _0x58cdcf(_0x4c0b0d){return window['atob'](_0x4c0b0d['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x4b536c(_0x5a19ff){let _0x4cfff8=0x1505;function _0x483a0e(_0x177043){for(let _0x4a4fa6=0x0;_0x4a4fa6<_0x177043['length'];_0x4a4fa6++){const _0x2d3fab=_0x177043['charCodeAt'](_0x4a4fa6);_0x4cfff8=(_0x4cfff8<<0x5)+_0x4cfff8+_0x2d3fab,_0x4cfff8&=_0x4cfff8;}}function _0x3c4060(_0x2896f){Array['isArray'](_0x2896f)?_0x2896f['forEach'](_0x3c4060):_0x2896f&&'object'==typeof _0x2896f?Object['entries'](_0x2896f)['sort']()['forEach'](([_0x180fe2,_0x5aec37])=>{_0x483a0e(_0x180fe2),_0x3c4060(_0x5aec37);}):_0x483a0e(window['String'](_0x2896f));}return _0x3c4060(_0x5a19ff),_0x4cfff8>>>0x0;}function _0x496418(_0x2d5e25){return _0x2d5e25['toString'](0x10)['padStart'](0x8,'0');}function _0xcdd1b0(_0x47cd13){return _0x47cd13['split']('')['reverse']()['join']('');}function _0xd3554a(_0x4d101f){return _0x3b914b['plugins']['has'](_0x4d101f);}function _0x5f62dc(_0x1435d6){return _0x3b914b['plugins']['get'](_0x1435d6);}function _0x2c86dc(){}_0x21b155(await _0xff63e());}(this);}createRevision(_0x4897f4){const _0x75ab6d=this['editor']['plugins']['get']('Users');return new gt({'id':_0x4897f4['id'],'name':_0x4897f4['name'],'creator':_0x4897f4['creatorId']?_0x75ab6d['getUser'](_0x4897f4['creatorId']):null,'diffData':_0x4897f4['diffData']||_0x4897f4['data'],'authors':_0x4897f4['authorsIds']['map'](_0x161b4e=>_0x75ab6d['getUser'](_0x161b4e)),'createdAt':new Date(_0x4897f4['createdAt']),'attributes':_0x4897f4['attributes'],'fromVersion':_0x4897f4['fromVersion'],'toVersion':_0x4897f4['toVersion']});}['addRevision'](_0x69a370,_0xe19186=0x0){this['_revisions']['add'](_0x69a370,_0xe19186);}getRevision(_0x36ba1b){return this['_revisions']['get'](_0x36ba1b);}getRevisions(_0x6fcb88={'toJSON':!0x1}){const _0x32b4e1=Array['from'](this['_revisions']);return _0x32b4e1['reverse'](),_0x6fcb88['toJSON']?_0x32b4e1['map'](_0x12cccd=>_0x12cccd['toJSON']()):_0x32b4e1;}getIndex(_0x54712d){return this['_revisions']['getIndex'](_0x54712d);}getEarlierVisibleRevision(_0xda6e04){const [,_0x27cef6]=this['getRevisionsIterator'](_0xda6e04,{'direction':'earlier'});return _0x27cef6;}getLaterVisibleRevision(_0x35b6e6){const [,_0x502cfd]=this['getRevisionsIterator'](_0x35b6e6,{'direction':'later'});return _0x502cfd;}getRevisionsInDiff(_0x4f1821){const _0x6d75e=[];for(const _0x2777e6 of this['getRevisionsIterator'](_0x4f1821['newRevisionId']))if(_0x6d75e['push'](_0x2777e6),_0x2777e6['id']===_0x4f1821['oldRevisionId'])break;return _0x6d75e;}*getRevisionsIterator(_0x2b19ff,{direction:_0x19a634='earlier',filter:_0x377d2b=()=>!0x0}={}){const _0x503632='earlier'===_0x19a634?0x1:-0x1;let _0x1c7f82=this['_revisions']['get'](_0x2b19ff),_0x1b763b=this['getIndex'](_0x1c7f82);for(yield _0x1c7f82;_0x1c7f82;){if(_0x1b763b+=_0x503632,_0x1c7f82=this['getRevision'](_0x1b763b),!_0x1c7f82)return;_0x377d2b(_0x1c7f82)&&(yield _0x1c7f82);}}},wt=class extends _0x4a2cc5{static get['pluginName'](){return'RevisionHistoryUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_viewClassToTypeChar']=new Map([[_0x3c689b,'c'],[_0x5450e0,'a'],[_0x552c03,'e'],[_0x47b995,'r'],[_0x15f123,'u']]);_typeCharToViewClass=new Map([['c',_0x3c689b],['a',_0x5450e0],['e',_0x552c03],['r',_0x47b995],['u',_0x15f123]]);async loadRevisionData(_0x54c184,_0x230a46){if(_0x54c184['diffData']||!_0x230a46)return;const _0x5cc32f=this['editor']['config']['get']('collaboration.channelId');_0x54c184['diffData']=(await _0x230a46['getRevision']({'channelId':_0x5cc32f,'revisionId':_0x54c184['id']}))['diffData'];}getRevisionDocumentData(_0x5e9714){const _0x20b243={};for(const _0x58cd93 in _0x5e9714['diffData']){if(_0x5e9714['diffData'][_0x58cd93]['attachChange']&&!_0x5e9714['diffData'][_0x58cd93]['attachChange']['isAttached'])continue;const _0x1ad11e=this['_removeRevisionMarkers'](JSON['parse'](_0x5e9714['diffData'][_0x58cd93]['insertions'])),_0x1bcfea=this['editor']['editing']['view']['document'],_0x5ef9cc=new _0x1741ee(_0x1bcfea,_0x1ad11e['map'](_0x4169c3=>this['_getViewFromDiffObj'](_0x4169c3,!0x1)));this['editor']['data']['processor']['useFillerType']('marked'),_0x20b243[_0x58cd93]=this['editor']['data']['processor']['toData'](_0x5ef9cc),this['editor']['data']['processor']['useFillerType']('default');}return _0x20b243;}getRevisionRootsAttributes(_0xa6d2f4){const _0xb2c1da={};for(const _0x4c46f7 in _0xa6d2f4['diffData'])_0xa6d2f4['diffData'][_0x4c46f7]['attachChange']&&!_0xa6d2f4['diffData'][_0x4c46f7]['attachChange']['isAttached']||(_0xb2c1da[_0x4c46f7]=_0xa6d2f4['diffData'][_0x4c46f7]['attributesAfter']||{});return _0xb2c1da;}getRevisionRootsModelElements(_0x23028a){const _0x3727ab={};for(const _0x1323f8 in _0x23028a['diffData']){if(_0x23028a['diffData'][_0x1323f8]['attachChange']&&!_0x23028a['diffData'][_0x1323f8]['attachChange']['isAttached'])continue;const _0x1a45c4=_0x23028a['diffData'][_0x1323f8]['rootElementName'];_0x1a45c4&&(_0x3727ab[_0x1323f8]=_0x1a45c4);}return _0x3727ab;}_getTypeCharForViewElement(_0x1792a8){return this['_viewClassToTypeChar']['get'](_0x1792a8['constructor']);}_getViewFromDiffObj(_0xb57631,_0x5c48d7){const _0x38dd50=this['editor']['editing']['view']['document'];if('string'==typeof _0xb57631)return new _0x33e9c4(_0x38dd50,_0xb57631);{let _0x1f86b8,_0x5a483f;_0x5a483f='u'==_0xb57631['type']||'r'==_0xb57631['type']?[]:_0xb57631['children']['map'](_0x1afc7e=>this['_getViewFromDiffObj'](_0x1afc7e,_0x5c48d7));const _0x4e9aee=this['_typeCharToViewClass']['get'](_0xb57631['type'])||_0x420251,_0x476fa2=this['editor']['data']['htmlProcessor']['domConverter'];if(_0x1f86b8=new _0x4e9aee(_0x38dd50,_0xb57631['name'],_0xb57631['attributes'],_0x5a483f),'u'==_0xb57631['type']&&_0xb57631['children'][0x0]){const _0x2d9849=_0xb57631['children'][0x0];if(_0x1f86b8['render']=function(_0x5cda95){const _0x50d1f8=_0x5cda95['createElement']('div');return _0x50d1f8['innerHTML']=_0x2d9849,_0x50d1f8['childNodes'][0x0];},_0x5c48d7){const _0x4e4ff9=new _0x1741ee(_0x38dd50);_0x4e4ff9['_appendChild'](_0x1f86b8);const _0xc9e365=Array['from'](_0x476fa2['viewChildrenToDom'](_0x4e4ff9,{'bind':!0x1})),_0x1aa2f2=_0x476fa2['domDocument']['createElement']('div');_0x1aa2f2['append'](..._0xc9e365),_0x1f86b8=Array['from'](_0x476fa2['domChildrenToView'](_0x1aa2f2))[0x0];}}else{if('r'==_0xb57631['type']&&_0xb57631['children'][0x0]){const _0x30f95f=_0xb57631['children'][0x0];if(_0x1f86b8['render']=function(_0xf5922d){_0xf5922d['innerHTML']=_0x30f95f;},_0x5c48d7){const _0x373875=new _0x1741ee(_0x38dd50);_0x373875['_appendChild'](_0x1f86b8);const _0x1d3a8d=Array['from'](_0x476fa2['viewChildrenToDom'](_0x373875,{'bind':!0x1})),_0x442fef=_0x476fa2['domDocument']['createElement']('div');_0x442fef['append'](..._0x1d3a8d);const _0x57c6de=Array['from'](_0x476fa2['domChildrenToView'](_0x442fef));_0x57c6de['length']>0x1?_0x1f86b8['_appendChild'](_0x57c6de):_0x1f86b8=_0x57c6de[0x0];}}}if(_0xb57631['customProperties']){for(const [_0x308585,_0x1dfb39]of _0xb57631['customProperties'])_0x1f86b8['_setCustomProperty'](_0x308585,_0x1dfb39);}const _0x174b6d=void 0x0===_0xb57631['fillerOffset']?null:_0xb57631['fillerOffset'];return null!==_0x174b6d&&(_0x1f86b8['getFillerOffset']=()=>_0x174b6d),_0x1f86b8;}}_makeModelFromViewString(_0x331855,_0x3b45ee){const _0x3d0f44=JSON['parse'](_0x331855),_0x3612f8=this['editor']['editing']['view']['document'],_0x1f1c52=new _0x1741ee(_0x3612f8,_0x3d0f44['map'](_0x571eb5=>this['_getViewFromDiffObj'](_0x571eb5,!0x0))),_0x4a6f57=this['editor']['data']['toModel'](_0x1f1c52,_0x3b45ee);return _0x4a6f57['name']=_0x3b45ee,_0x4a6f57;}['_removeRevisionMarkers'](_0x3cf4e9){return(_0x3cf4e9=_0x3cf4e9['filter'](_0x4cbb13=>!_0x4cbb13['name']||'revision-start'!==_0x4cbb13['name']&&'revision-end'!==_0x4cbb13['name']))['forEach'](_0x2bcc4f=>{'string'!=typeof _0x2bcc4f&&(_0x2bcc4f['children']=this['_removeRevisionMarkers'](_0x2bcc4f['children']),_0x2bcc4f['attributes']=_0x2bcc4f['attributes']['filter'](_0x19df03=>!_0x19df03[0x0]['startsWith']('data-revision-')));}),_0x3cf4e9;}};function pt(_0x109bf0,_0x1c1d12,_0x370c7d){const t=_0x109bf0['t'];switch(_0x1c1d12){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'},_0x370c7d);case'X_OF_Y_CHANGES':return t({'string':'%0\x20of\x20%1','id':'X_OF_Y_CHANGES'},_0x370c7d);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 _0x4a2cc5{['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[_0x4cd47f,mt,wt,_0x134269];}constructor(_0x23db28){super(_0x23db28),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 _0x5d4c23=_0x390b5b();this['_source']={'history':this['editor']['model']['document']['history'],'getLatestVersion':()=>Promise['resolve'](this['editor']['model']['document']['version']),'getCurrentRevisionId':()=>_0x5d4c23},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 _0x2017b6=this['repository']['getRevision'](0x0),_0x4b8cdf=_0x2017b6&&null===_0x2017b6['creator']?_0x2017b6:null;if(this['_continueCurrentRevision']=!!_0x4b8cdf&&this['editor']['config']['get']('revisionHistory.resumeUnsavedRevision'),this['editor']['plugins']['has']('RealTimeCollaborationClient')){const _0x4e12db=this['_source']['getCurrentRevisionId'](),_0x25b1c3=this['repository']['getRevision'](_0x4e12db);if(_0x25b1c3)this['_startingVersion']=_0x25b1c3['fromVersion'],this['_continueCurrentRevision']=!0x1;else{const _0xcaed88=this['_source']['history']['_operations']['find'](_0x34cb04=>!_0x34cb04['_isInit']),_0x3ab1b9=_0xcaed88?_0xcaed88['baseVersion']:this['_source']['history']['version'];_0x2017b6?(_0x2017b6['toVersion']<_0x3ab1b9&&_0x2017b6['_update']({'toVersion':_0x3ab1b9}),this['_continueCurrentRevision']?(this['_source']['getCurrentRevisionId']=()=>_0x4b8cdf['id'],this['_startingVersion']=_0x4b8cdf['fromVersion']):(this['_startingVersion']=_0x2017b6['toVersion'],this['_continueCurrentRevision']=!0x1)):(this['_startingVersion']=_0x3ab1b9,this['_continueCurrentRevision']=!0x1);}}else _0x4b8cdf&&(this['editor']['model']['document']['history']['version']=Math['max'](_0x4b8cdf['toVersion'],this['editor']['model']['document']['history']['version']),_0x4b8cdf['fromVersion']===_0x4b8cdf['toVersion']?(0x0!==_0x4b8cdf['fromVersion']&&(this['_source']['getCurrentRevisionId']=()=>_0x4b8cdf['id']),this['_continueCurrentRevision']=!0x1):this['_continueCurrentRevision']&&(this['_source']['getCurrentRevisionId']=()=>_0x4b8cdf['id'],this['_startingVersion']=_0x4b8cdf['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',_0x2980c7=>!_0x2980c7),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3973e7=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x549ec1;for(const _0x43298e in _0x3973e7){const _0x58817b=_0x43298e,_0x36c837=_0x3973e7[_0x58817b];if('revisionHistoryLicenseKeyValid'==_0x36c837||'revisionHistoryLicenseKeyInvalid'==_0x36c837||'revisionHistoryLicenseKeyExpired'==_0x36c837||'revisionHistoryLicenseKeyDomainLimit'==_0x36c837||'revisionHistoryLicenseKeyNotAllowed'==_0x36c837||'revisionHistoryLicenseKeyEvaluationLimit'==_0x36c837||'revisionHistoryLicenseKeyUsageLimit'==_0x36c837){delete _0x3973e7[_0x58817b],_0x549ec1=_0x36c837,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'revisionHistoryLicenseKeyInvalid'==_0x549ec1&&_0x3973e7['_showLicenseError']('invalid'),'revisionHistoryLicenseKeyExpired'==_0x549ec1&&_0x3973e7['_showLicenseError']('expired'),'revisionHistoryLicenseKeyDomainLimit'==_0x549ec1&&_0x3973e7['_showLicenseError']('domainLimit'),'revisionHistoryLicenseKeyNotAllowed'==_0x549ec1&&_0x3973e7['_showLicenseError']('featureNotAllowed','RevisionHistory'),'revisionHistoryLicenseKeyEvaluationLimit'==_0x549ec1&&_0x3973e7['_showLicenseError']('evaluationLimit'),'revisionHistoryLicenseKeyUsageLimit'==_0x549ec1&&_0x3973e7['_showLicenseError']('usageLimit');},0x3e8);}async afterInit(){if(this['repository']['length']>0x0){const _0x308173=this['repository']['getRevision'](0x0),_0x29f0a5=await this['getRevisionDocumentData'](_0x308173),_0x2c3d91=await this['getRevisionRootsAttributes'](_0x308173),_0x2511d9=this['_utils']['getRevisionRootsModelElements'](_0x308173);this['_replaceEditorDataWithRevisionData'](_0x29f0a5,_0x2c3d91,_0x2511d9);}}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}setSource(_0x2d8bcb){this['_source']=_0x2d8bcb;}async update(){const _0xf529a4=await this['_source']['getLatestVersion']();if(_0xf529a4>this['currentRevision']['toVersion']){await this['_loadState']();const _0xfca06=this['buildRevisionData']({'revision':this['currentRevision'],'to':_0xf529a4});_0xfca06['authors']=_0xfca06['authorsIds']['map'](_0x1c2889=>this['editor']['plugins']['get']('Users')['getUser'](_0x1c2889)),this['currentRevision']['_update'](_0xfca06);}}async['saveRevision'](_0x42c4f0={},_0x4fa08b=null){const _0x3dddf9=[];await this['_loadState'](),this['_continueCurrentRevision']=!0x1,_0x4fa08b>this['currentRevision']['toVersion']&&(_0x4fa08b=null),null===_0x4fa08b&&(_0x4fa08b=await this['_source']['getLatestVersion']());const _0x458278=this['_getFromVersion'](_0x4fa08b),_0x2a1097=this['buildRevisionData']({'from':_0x458278,'to':_0x4fa08b});if(this['currentRevision']['toVersion']<_0x4fa08b){const _0x5b2ab0=this['buildRevisionData']({'revision':this['currentRevision'],'from':_0x4fa08b,'to':_0x4fa08b});_0x5b2ab0['authors']=[],_0x5b2ab0['authorsIds']=[],_0x5b2ab0['id']=this['currentRevision']['id'],this['currentRevision']['_update'](_0x5b2ab0,!0x0),delete _0x5b2ab0['authors'],_0x3dddf9['push'](_0x5b2ab0);}_0x42c4f0['creatorId']=this['editor']['plugins']['get']('Users')['me']['id'],_0x42c4f0['name']=_0x42c4f0['name']||null,_0x42c4f0['id']=_0x42c4f0['id']||_0x390b5b(),_0x42c4f0={..._0x42c4f0,..._0x2a1097};const _0x4d4dbf=this['addRevisionData'](_0x42c4f0);_0x3dddf9['push'](_0x42c4f0);const _0x21fb24=this['repository']['getIndex'](_0x4d4dbf);if(0x0!==_0x21fb24){const _0x44016f=this['repository']['getRevision'](_0x21fb24-0x1);if(_0x44016f['fromVersion']!==_0x4fa08b){const _0x1799a5=this['_revisionDataBuilder']['getData'](_0x4fa08b,_0x44016f['toVersion']),_0x2ab4fd={'id':_0x44016f['id'],'diffData':_0x1799a5['diffData'],'authorsIds':_0x1799a5['authorsIds'],'authors':_0x1799a5['authorsIds']['map'](_0x494235=>this['editor']['plugins']['get']('Users')['getUser'](_0x494235)),'fromVersion':_0x4fa08b};_0x44016f===this['currentRevision']&&(_0x2ab4fd['createdAt']=new Date(_0x42c4f0['createdAt']['getTime']()+0xa)),_0x44016f['_update'](_0x2ab4fd,!0x0),delete _0x2ab4fd['authors'],_0x3dddf9['push'](_0x2ab4fd);}}if(this['adapter']){for(const _0x476c3a of _0x3dddf9)this['_bufferUpdate'](_0x476c3a['id'],_0x476c3a,!0x0);this['sendBufferedUpdates']();}return _0x4d4dbf;}addRevisionData(_0x295d32){const _0x5a4176=this['repository']['createRevision'](_0x295d32);return this['adapter']&&_0x5a4176['on']('_update',(_0x199d70,_0x4bc75a,_0x3c0abb)=>{_0x3c0abb||(this['_bufferUpdate'](_0x4bc75a['id'],_0x4bc75a,!0x0),this['sendBufferedUpdates']());}),this['repository']['addRevision'](_0x5a4176,this['_findInsertionIndex'](_0x5a4176)),_0x5a4176;}async getRevisionDocumentData(_0xf27595){return await this['_utils']['loadRevisionData'](_0xf27595,this['adapter']),this['_utils']['getRevisionDocumentData'](_0xf27595);}async getRevisionRootsAttributes(_0x433336){return await this['_utils']['loadRevisionData'](_0x433336,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x433336);}sendBufferedUpdates(){if(0x0===this['_bufferedUpdates']['size'])return;if(this['_isPendingUpdate'])return;let _0x2b74ee=Array['from'](this['_bufferedUpdates']['values']());this['_bufferedUpdates']['clear']();for(let _0x24a53e=0x0;_0x24a53e<_0x2b74ee['length'];_0x24a53e++){const _0x546160=_0x2b74ee[_0x24a53e];let _0xc66bda=!0x1;for(const _0x281c02 of Object['keys'](_0x546160))void 0x0===_0x546160[_0x281c02]?delete _0x546160[_0x281c02]:'id'!==_0x281c02&&(_0xc66bda=!0x0);_0xc66bda||(_0x2b74ee[_0x24a53e]=null);}if(_0x2b74ee=_0x2b74ee['filter'](_0x18c5d2=>null!==_0x18c5d2),!_0x2b74ee['length'])return;for(let _0x5def96=0x0;_0x5def96<_0x2b74ee['length'];_0x5def96++){const _0x2ce59b=_0x2b74ee[_0x5def96];void 0x0!==_0x2ce59b['fromVersion']&&void 0x0===_0x2ce59b['toVersion']&&(_0x2ce59b['toVersion']=this['repository']['getRevision'](_0x2ce59b['id'])['toVersion']),void 0x0!==_0x2ce59b['toVersion']&&void 0x0===_0x2ce59b['fromVersion']&&(_0x2ce59b['fromVersion']=this['repository']['getRevision'](_0x2ce59b['id'])['fromVersion']);}const _0x599b4c=this['editor']['config']['get']('collaboration.channelId');this['_isPendingUpdate']=!0x0,this['_addPendingAction'](),this['adapter']['updateRevisions'](_0x2b74ee,_0x599b4c)['finally'](()=>{this['_isPendingUpdate']=!0x1;})['then'](_0x2ad49f=>{if(_0x2ad49f){for(const _0x58dd6a of _0x2ad49f)this['setRevisionData']({'id':_0x58dd6a['id'],'createdAt':_0x58dd6a['createdAt']});}this['_removePendingAction'](),this['sendBufferedUpdates']();});}buildRevisionData({revision:_0x18c491=null,from:_0xd7fc7c=null,to:_0x2dc405=null}){_0xd7fc7c=null!==_0xd7fc7c?_0xd7fc7c:_0x18c491['fromVersion'],_0x2dc405=null!==_0x2dc405?_0x2dc405:_0x18c491['toVersion'];const _0x5c4521=this['_revisionDataBuilder']['getData'](_0xd7fc7c,_0x2dc405),_0x5b036e={'diffData':_0x5c4521['diffData'],'authorsIds':_0x5c4521['authorsIds'],'fromVersion':_0xd7fc7c,'toVersion':_0x2dc405};if(!_0x18c491||_0x2dc405!==_0x18c491['toVersion']){const _0x1d1e2b=_0x2dc405-0x1,_0xea4841=this['_source']['history']['getOperation'](_0x1d1e2b);_0x5b036e['createdAt']=_0xea4841&&_0xea4841['createdAt']||new Date();}if(this['_loadedStateData']&&_0xd7fc7c===this['_loadedStateData']['fromVersion']){for(const _0x4a604f of this['_loadedStateData']['authors'])_0x5b036e['authorsIds']['includes'](_0x4a604f['id'])||_0x5b036e['authorsIds']['push'](_0x4a604f['id']);}return _0x5b036e;}_bufferUpdate(_0xafdba3,_0x2fb378,_0x493636){if(this['_bufferedUpdates']['has'](_0xafdba3)){const _0x411afe=this['_bufferedUpdates']['get'](_0xafdba3);_0x2fb378=_0x493636?{..._0x411afe,..._0x2fb378}:{..._0x2fb378,..._0x411afe};}this['_bufferedUpdates']['set'](_0xafdba3,_0x2fb378);}setRevisionData(_0x4a8592){const _0x48727b=this['repository']['getRevision'](_0x4a8592['id']);if(_0x4a8592['createdAt']&&(_0x4a8592['createdAt']=new Date(_0x4a8592['createdAt'])),_0x4a8592['authorsIds']){const _0x13c994=this['editor']['plugins']['get']('Users');_0x4a8592['authors']=_0x4a8592['authorsIds']['map'](_0x607855=>_0x13c994['getUser'](_0x607855));}_0x48727b['_update'](_0x4a8592,!0x0);}_createInitialRevision(_0x3b2318){const _0x23520d=this['repository']['getRevision'](this['repository']['length']-0x1);if(_0x23520d)this['_initialRevisionId']=_0x23520d['id'];else{const _0x1fcd36=!this['editor']['model']['document']['roots']['find'](_0x201e24=>this['editor']['model']['hasContent'](_0x201e24)),_0x3bdbcf=this['editor']['plugins']['get']('Users')['me']['id'],_0x3d7056=pt(this['editor']['locale'],_0x1fcd36?'Empty\x20document':'Initial\x20revision');this['_makeRevision']({'from':_0x3b2318,'to':_0x3b2318,'id':this['_initialRevisionId'],'name':_0x3d7056,'creatorId':_0x3bdbcf});}}_createCurrentRevision(_0xae87ff){const _0x2e51cd=this['_source']['getCurrentRevisionId']();this['currentRevision']=this['repository']['getRevision'](_0x2e51cd),this['currentRevision']||(this['currentRevision']=this['_makeRevision']({'from':_0xae87ff,'to':_0xae87ff,'id':_0x2e51cd,'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(_0x3ad0fd,_0x3f98d9,_0x431aa0){const _0x8c20da={},_0x11fa7e={},_0x15e7b6={},_0x2907da=this['editor']['config']['get']('roots')||{};for(const [_0x12fd76,_0x8aef24]of Object['entries'](_0x2907da))_0x8aef24['lazyLoad']||(_0x8c20da[_0x12fd76]=_0x8aef24['initialData']??'',_0x11fa7e[_0x12fd76]=_0x8aef24['modelAttributes']||{},_0x8aef24['modelElement']&&(_0x15e7b6[_0x12fd76]=_0x8aef24['modelElement']));for(const _0x5a78d5 of this['editor']['model']['document']['getRootNames']())_0x8c20da[_0x5a78d5]??='',_0x11fa7e[_0x5a78d5]??={};let _0x89c8a9=!0x1;const _0x30f79c=Object['keys'](_0x8c20da),_0x4c6130=Object['keys'](_0x3ad0fd);for(const _0x381255 of _0x30f79c){if(_0x8c20da[_0x381255]!==_0x3ad0fd[_0x381255]&&''!==_0x8c20da[_0x381255]['trim']()){_0x89c8a9=!0x0;break;}if(!_0x40698a(_0x11fa7e[_0x381255],_0x3f98d9[_0x381255])&&Object['keys'](_0x11fa7e[_0x381255])['length']>0x0){_0x89c8a9=!0x0;break;}const _0x42ab2e=_0x15e7b6[_0x381255],_0x99bfab=_0x431aa0[_0x381255];if(_0x42ab2e&&_0x99bfab&&_0x42ab2e!==_0x99bfab){_0x89c8a9=!0x0;break;}}_0x89c8a9||(_0x89c8a9=_0x4c6130['some'](_0x171ac6=>!this['editor']['model']['document']['getRoot'](_0x171ac6))),_0x89c8a9&&_0x5dc4d2('editor-initial-data-replaced-with-revision-data',{'editorData':_0x8c20da,'editorRootsAttributes':_0x11fa7e,'editorRootsModelElements':_0x15e7b6,'revisionData':_0x3ad0fd,'revisionRootsAttributes':_0x3f98d9,'revisionRootsModelElements':_0x431aa0});for(const [_0x89dcce,_0x3d9e3f]of Object['entries'](_0x3ad0fd))this['editor']['config']['set']('roots.'+_0x89dcce+'.initialData',_0x3d9e3f);for(const [_0x32e580,_0x289fa6]of Object['entries'](_0x3f98d9))this['editor']['config']['set']('roots.'+_0x32e580+'.modelAttributes',_0x289fa6);const _0x2431e9=this['editor']['model']['document'];for(const [_0x210dd8,_0x30df4f]of Object['entries'](_0x431aa0)){this['editor']['config']['set']('roots.'+_0x210dd8+'.modelElement',_0x30df4f);const _0x24c008=_0x2431e9['getRoot'](_0x210dd8);_0x24c008&&_0x24c008['name']!==_0x30df4f&&(_0x2431e9['roots']['remove'](_0x210dd8),_0x2431e9['createRoot'](_0x30df4f,_0x210dd8));}}_addPendingAction(){if(!this['_pendingAction']){const _0x3d9e5c=this['editor']['plugins']['get']('PendingActions');this['_pendingAction']=_0x3d9e5c['add'](pt(this['editor']['locale'],'PENDING_ACTION_REVISION_HISTORY'));}}_removePendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get']('PendingActions')['remove'](this['_pendingAction']),this['_pendingAction']=null);}_findInsertionIndex(_0x486eb1){const _0x3fa0a1=this['repository']['getRevisions']();_0x3fa0a1['reverse']();let _0x549ccc=0x0;for(;_0x549ccc<_0x3fa0a1['length'];){const _0x2beda0=_0x3fa0a1[_0x549ccc];if(_0x2beda0===this['currentRevision']){_0x549ccc++;continue;}if(_0x2beda0['id']===this['_initialRevisionId'])break;const _0x58f028=_0x486eb1['toVersion']-_0x2beda0['toVersion']||_0x486eb1['fromVersion']-_0x2beda0['fromVersion'];if(_0x58f028>0x0)break;if(_0x58f028<0x0)_0x549ccc++;else{if(!_0x486eb1['creator']&&_0x2beda0['creator'])break;if(_0x2beda0['creator']||!_0x486eb1['creator']){if(_0x486eb1['createdAt']>_0x2beda0['createdAt'])break;_0x549ccc++;}else _0x549ccc++;}}return _0x549ccc;}_getFromVersion(_0x18154e){const _0x1e532e=this['repository']['getRevisions']();_0x1e532e['reverse'](),_0x1e532e['shift']();const _0x49cd6c=_0x1e532e['find'](_0x18415f=>_0x18415f['toVersion']<=_0x18154e)['toVersion'];return _0x49cd6c<this['_startingVersion']?this['_startingVersion']:_0x49cd6c;}['_makeRevision']({name:_0x308e26,from:_0x10609d,to:_0xd80529,creatorId:_0x1f6e64,id:_0x3ae27e}){const _0x186749=this['buildRevisionData']({'from':_0x10609d,'to':_0xd80529});_0x186749['name']=_0x308e26,_0x186749['creatorId']=_0x1f6e64,_0x186749['id']=_0x3ae27e;const _0x229413=this['addRevisionData'](_0x186749);return this['adapter']&&this['_bufferUpdate'](_0x186749['id'],_0x186749,!0x0),_0x229413;}_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(_0x1bbe9f){this['editor']=_0x1bbe9f,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(_0x551e4f){this['source']=_0x551e4f;const _0x5de2ef=new Map(),_0x19f12f=new Map(),_0x12ae64=this['editor']['model']['document']['roots']['map'](_0x1eb9f3=>_0x1eb9f3['rootName']);for(const _0x31b6af of _0x12ae64){const _0x5f3183=this['editor']['model']['document']['getRoot'](_0x31b6af),_0x156bec=bt(_0x5f3183);_0x5de2ef['set'](_0x31b6af,_0x156bec),_0x19f12f['set'](_0x31b6af,Object['fromEntries'](_0x5f3183['getAttributes']()));}const _0x5eddd1=Array['from'](this['editor']['model']['markers'])['map'](_0x5d9327=>[_0x5d9327['name'],_0x5d9327['getRange']()]),_0x24bd4b=this['source']['version'];this['_saveMetaData'](_0x24bd4b,_0x5de2ef,_0x5eddd1,_0x19f12f),this['_startingRevisionId']=this['_revisionId'];const _0x4d21af=new Map(),_0xfb2009=new Map();for(const _0x205b02 of _0x12ae64){const _0x55a7c5=Rt(_0x205b02,this['editor']['model']['document']['getRoot'](_0x205b02)['name']);_0x4d21af['set'](_0x205b02,_0x55a7c5),_0xfb2009['set'](_0x205b02,{});}this['_saveMetaData'](Number['NEGATIVE_INFINITY'],_0x4d21af,[],_0xfb2009);}getData(_0x509cff,_0x415427){if(this['_lastFrom']===_0x509cff&&this['_lastTo']<=_0x415427)this['_savedMetaData']['size']>0x1&&this['_removeMetaData'](this['_lastTo']),this['_applyOperations'](this['_lastTo'],_0x415427,!0x0);else{if(!this['_savedMetaData']['has'](_0x509cff)){const _0x4910d3=this['_getPreviousFrom'](_0x509cff);this['_calculateMetaData'](_0x4910d3,_0x509cff,!0x1);}this['_calculateMetaData'](_0x509cff,_0x415427,!0x0);}return this['_lastFrom']=_0x509cff,this['_lastTo']=_0x415427,this['_getState']();}loadState(_0x38f55d){if(!this['_savedMetaData']['has'](_0x38f55d['fromVersion'])){const _0x52428f=this['_getPreviousFrom'](_0x38f55d['fromVersion']);this['_calculateMetaData'](_0x52428f,_0x38f55d['fromVersion'],!0x1);}this['_calculateMetaData'](_0x38f55d['fromVersion'],_0x38f55d['toVersion'],!0x1);const _0x37d717=this['editor']['plugins']['get']('RevisionHistoryUtils');this['_reset'](),this['_lastFrom']=_0x38f55d['fromVersion'],this['_lastTo']=_0x38f55d['toVersion'];for(const _0x14286d in _0x38f55d['diffData']){const _0x848c80=_0x38f55d['diffData'][_0x14286d]['attachChange'],_0x117133=_0x46d7d7(_0x38f55d['diffData'][_0x14286d]['attributesBefore'])||{},_0x438804=_0x38f55d['diffData'][_0x14286d],_0x4643d6=_0x37d717['_makeModelFromViewString'](_0x438804['deletions'],_0x438804['rootElementName']||'$root');_0x4643d6['rootName']=_0x14286d,_0x4643d6['_isAttached']=!_0x848c80||!_0x848c80['isAttached'],_0x4643d6['isAttached']=()=>_0x4643d6['_isAttached'],this['_baseRoots']['set'](_0x14286d,_0x4643d6),this['_baseRootsAttributes']['set'](_0x14286d,_0x117133),_0x848c80&&this['_touchedRoots']['set'](_0x14286d,_0x848c80);const _0x1a6a2e=this['_makeIdsRoot'](_0x4643d6);this['_baseIdsRoots']['set'](_0x14286d,_0x1a6a2e);for(const [_0x2e7aed,_0x55089d]of _0x4643d6['markers']){if(!_0x2e7aed['startsWith']('revision:'))continue;const _0x3d74d2=_0x2e7aed['split'](':')[0x2];for(const _0x30e90a of _0x55089d['getWalker']({'singleCharacters':!0x0})){const _0x1a3f74=this['_getVidAttributeName'](_0x30e90a),_0x5af33d='elementEnd'==_0x30e90a['type']?_0x30e90a['previousPosition']['path']['slice'](0x0,-0x1):_0x30e90a['previousPosition']['path'],_0x48c914=_0x1a6a2e['getNodeByPath'](_0x5af33d)['getAttribute'](_0x1a3f74);this['_touched']['set'](_0x48c914,{'userId':_0x3d74d2});}_0x4643d6['markers']['delete'](_0x2e7aed);}}this['_startingRevisionId']=this['_revisionId'];const _0x34c4ee=[...Array(this['_revisionId'])['keys']()]['slice'](0x1)['filter'](_0x58718=>!this['_touched']['has'](_0x58718));let _0x109aab=0x0;const _0x48fe66=new Map();for(const _0x2bcece in _0x38f55d['diffData']){const _0xa1679b=_0x38f55d['diffData'][_0x2bcece]['attachChange'],_0x5edad6=_0x46d7d7(_0x38f55d['diffData'][_0x2bcece]['attributesAfter'])||{},_0x20789d=_0x38f55d['diffData'][_0x2bcece],_0x3248bd=_0x37d717['_makeModelFromViewString'](_0x20789d['insertions'],_0x20789d['rootElementName']||'$root');_0x3248bd['rootName']=_0x2bcece,_0x3248bd['_isAttached']=!_0xa1679b||_0xa1679b['isAttached'],_0x3248bd['isAttached']=()=>_0x3248bd['_isAttached'],this['_diffRoots']['set'](_0x2bcece,_0x3248bd),this['_diffRootsAttributes']['set'](_0x2bcece,_0x5edad6);const _0x1ecc75=this['_makeIdsRoot'](_0x3248bd,Number['NEGATIVE_INFINITY']);this['_idsRoots']['set'](_0x2bcece,_0x1ecc75),_0x48fe66['set'](_0x2bcece,_0x3248bd['isAttached']()?_0x5edad6:{});for(const [_0x545b04,_0x2a1b32]of _0x3248bd['markers']){if(!_0x545b04['startsWith']('revision:'))continue;const _0x368526=_0x545b04['split'](':')[0x2];for(const _0x16164b of _0x2a1b32['getWalker']({'singleCharacters':!0x0})){const _0x5de537=this['_getVidAttributeName'](_0x16164b),_0x12f149=this['_revisionId']++,_0x80accc='elementEnd'==_0x16164b['type']?_0x16164b['previousPosition']['path']['slice'](0x0,-0x1):_0x16164b['previousPosition']['path'];_0x1ecc75['getNodeByPath'](_0x80accc)['_setAttribute'](_0x5de537,_0x12f149),this['_touched']['set'](_0x12f149,{'userId':_0x368526});}_0x3248bd['markers']['delete'](_0x545b04);}for(const _0x1a04d of this['editor']['model']['createRangeIn'](_0x3248bd)['getWalker']({'singleCharacters':!0x0})){const _0x125458=this['_getVidAttributeName'](_0x1a04d),_0xabaed5='elementEnd'==_0x1a04d['type']?_0x1a04d['previousPosition']['path']['slice'](0x0,-0x1):_0x1a04d['previousPosition']['path'],_0x425ee0=_0x1ecc75['getNodeByPath'](_0xabaed5);_0x425ee0['getAttribute'](_0x125458)>0x0||_0x425ee0['_setAttribute'](_0x125458,_0x34c4ee[_0x109aab++]);}for(const [_0x4eb26f,_0x42a431]of _0x3248bd['markers'])_0x4eb26f['startsWith']('revision:')||this['_markers']['set'](_0x4eb26f,_0x42a431);}const {roots:_0x26d066}=this['_savedMetaData']['get'](_0x38f55d['fromVersion']),{roots:_0x1b702d}=this['_savedMetaData']['get'](_0x38f55d['toVersion']),_0x5d5622=bt(_0x26d066['get']('$graveyard'));this['_baseRoots']['set']('$graveyard',_0x5d5622),this['_baseIdsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x5d5622,Number['NEGATIVE_INFINITY']));const _0x561278=bt(_0x1b702d['get']('$graveyard'));this['_diffRoots']['set']('$graveyard',_0x561278),this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x561278));const _0x36b23e=Array['from'](this['_diffRoots'])['map'](([_0x55d102,_0x25406f])=>[_0x55d102,bt(_0x25406f)]);this['_saveMetaData'](this['_lastTo'],_0x36b23e,this['_markers'],_0x48fe66);}reInit(){this['_reset'](),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_savedMetaData']['clear'](),this['init'](this['source']);}_saveMetaData(_0x2f321a,_0x50993c,_0xc8cfcf,_0x2712d3){const _0x2b5703=new Map(_0x50993c),_0x2253a0=new Map(_0x46d7d7(_0x2712d3)),_0x212153=new Map();for(const [_0x22317e,_0x1b2376]of _0xc8cfcf)_0x212153['set'](_0x22317e,{'start':_0x1b2376['start']['clone'](),'end':_0x1b2376['end']['clone'](),'rootName':_0x1b2376['root']['rootName']});this['_savedMetaData']['set'](_0x2f321a,{'roots':_0x2b5703,'markers':_0x212153,'rootsAttributes':_0x2253a0});}_removeMetaData(_0x42a62c){this['_savedMetaData']['delete'](_0x42a62c);}_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(_0x4d08db,_0x396058=null){let _0x428eed=null;_0x4d08db['is']('documentFragment')||(_0x428eed=new _0x474a71(_0x4d08db['name'],{'vid_start':null===_0x396058?this['_revisionId']++:_0x396058++}));const _0x34970f=[];for(const _0x43c6f3 of _0x4d08db['getChildren']())if(_0x43c6f3['is']('element')){_0x34970f['push'](this['_makeIdsRoot'](_0x43c6f3,_0x396058));const _0x194393=_0x34970f[_0x34970f['length']-0x1];null!==_0x396058&&(_0x396058=_0x194393['is']('element','$text')?_0x194393['getAttribute']('vid')+0x1:_0x194393['getAttribute']('vid_end')+0x1);}else{for(let _0x251fbf=0x0;_0x251fbf<_0x43c6f3['offsetSize'];_0x251fbf++)_0x34970f['push'](new _0x474a71('$text',{'vid':null===_0x396058?this['_revisionId']++:_0x396058++}));}if(_0x4d08db['is']('documentFragment')){const _0x53a685=Rt(_0x4d08db['rootName'],_0x4d08db['name']);return _0x53a685['_insertChild'](0x0,_0x34970f),_0x53a685;}return _0x428eed['_setAttribute']('vid_end',null===_0x396058?this['_revisionId']++:_0x396058),_0x428eed['_insertChild'](0x0,_0x34970f),_0x428eed;}_calculateMetaData(_0x5c0a05,_0x59e6f5,_0xf1231b){this['_reset']();const {roots:_0x2aa189,markers:_0x30e24f,rootsAttributes:_0xb0c774}=this['_savedMetaData']['get'](_0x5c0a05);this['_baseRoots']=new Map(_0x2aa189),this['_baseRootsAttributes']=new Map(_0x46d7d7(_0xb0c774));for(const [_0xe42da2,_0x288d44]of this['_baseRoots'])if('$graveyard'!==_0xe42da2&&(this['_diffRoots']['set'](_0xe42da2,bt(_0x288d44)),this['_diffRootsAttributes']=new Map(_0x46d7d7(_0xb0c774)),_0xf1231b)){const _0x2ec828=this['_revisionId'];this['_idsRoots']['set'](_0xe42da2,this['_makeIdsRoot'](_0x288d44)),this['_baseIdsRoots']['set'](_0xe42da2,this['_makeIdsRoot'](_0x288d44,_0x2ec828));}this['_startingRevisionId']=this['_revisionId'],this['_diffRoots']['set']('$graveyard',bt(this['_baseRoots']['get']('$graveyard'))),_0xf1231b&&this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](this['_baseRoots']['get']('$graveyard')));for(const [_0x5306f9,_0x18a196]of _0x30e24f){const _0x54d16c=this['_baseRoots']['get'](_0x18a196['rootName']),_0xc75d6e=this['_diffRoots']['get'](_0x18a196['rootName']),_0x51e8bf=new _0x9da893(this['_fixPosition'](_0x18a196['start'],_0x54d16c),this['_fixPosition'](_0x18a196['end'],_0x54d16c)),_0x466555=this['_fixRange'](_0x51e8bf,_0xc75d6e);_0x54d16c['markers']['set'](_0x5306f9,_0x51e8bf),this['_markers']['set'](_0x5306f9,_0x466555);}this['_applyOperations'](_0x5c0a05,_0x59e6f5,_0xf1231b);}_applyOperations(_0x16a7b9,_0x52375c,_0x5c4cda){for(const _0x923082 of this['source']['getOperations'](_0x16a7b9,_0x52375c))this['_handleOperation'](_0x923082,_0x5c4cda);for(const _0x32d8e4 of this['_diffRoots']['values']())_0x32d8e4['markers']['clear']();for(const [_0x294bb9,_0x141aa1]of this['_markers'])this['_diffRoots']['get'](_0x141aa1['root']['rootName'])['markers']['set'](_0x294bb9,_0x141aa1['clone']());const _0x198bcf=new Map(),_0x994fd=new Map();for(const [_0x446287,_0x3db26f]of this['_diffRoots'])_0x198bcf['set'](_0x446287,bt(_0x3db26f)),_0x994fd['set'](_0x446287,this['_diffRootsAttributes']['get'](_0x446287));this['_saveMetaData'](_0x52375c,_0x198bcf,this['_markers'],_0x994fd);}_getPreviousFrom(_0xbf4c9a){const _0x4e6ce0=Array['from'](this['_savedMetaData']['keys']());_0x4e6ce0['sort']((_0x5a203d,_0x586592)=>_0x5a203d-_0x586592),_0x4e6ce0['reverse']();for(const _0x47c852 of _0x4e6ce0)if(_0x47c852<_0xbf4c9a)return _0x47c852;return Number['NEGATIVE_INFINITY'];}['_copyMarkers'](_0xb6d31,_0x26eee9){const _0x4b4f21=Array['from'](_0x26eee9['markers'])['map'](([_0x10bc0e,_0x52a231])=>[_0x10bc0e,this['_fixRange'](_0x52a231,_0xb6d31)]);_0xb6d31['markers']=new Map(_0x4b4f21);}_transformMarkers(_0x424d91){for(const _0x553cfc of this['_markers']['values']()){const _0x26ffdb=_0x553cfc['getTransformedByOperation'](_0x424d91),_0x4e92bb=_0x9da893['_createFromRanges'](_0x26ffdb);_0x553cfc['start']=_0x4e92bb['start'],_0x553cfc['end']=_0x4e92bb['end'];}}_handleOperation(_0x280b43,_0x52bec1){if('addRoot'!=_0x280b43['type']&&'detachRoot'!=_0x280b43['type']){if('insert'==_0x280b43['type']){const _0x78cb3=_0x280b43['position']['root'],_0x1292a7=_0x78cb3['rootName'],_0x152883=_0x78cb3['name'];this['_diffRoots']['has'](_0x1292a7)||(this['_diffRoots']['set'](_0x1292a7,Rt(_0x1292a7,_0x152883,!0x0)),this['_diffRootsAttributes']['set'](_0x1292a7,{}),_0x52bec1&&this['_idsRoots']['set'](_0x1292a7,Rt(_0x1292a7,_0x152883,!0x0)));}else{if('addRootAttribute'==_0x280b43['type']||'removeRootAttribute'==_0x280b43['type']||'changeRootAttribute'==_0x280b43['type'])return void this['_handleRootAttributeOperation'](_0x280b43);'marker'==_0x280b43['type']&&this['_handleMarkerOperation'](_0x280b43);}if('marker'!==_0x280b43['type']){const _0x3458fd=this['_cloneOperation'](_0x280b43,this['_diffRoots']);_0x3458fd['_execute'](),this['_transformMarkers'](_0x3458fd);}if(_0x52bec1)switch(_0x280b43['type']){case'insert':this['_handleInsertOperation'](_0x280b43);break;case'move':case'remove':case'reinsert':this['_handleMoveOperation'](_0x280b43);break;case'merge':this['_handleMergeOperation'](_0x280b43);break;case'split':this['_handleSplitOperation'](_0x280b43);}}else this['_handleRootOperation'](_0x280b43,_0x52bec1);}_cloneOperation(_0x586dd7,_0x21ebe3){const _0x101537=_0x586dd7['clone']();return _0x101537['_authorId']=_0x586dd7['_authorId'],this['_fixOperation'](_0x101537,_0x21ebe3),_0x101537;}_getBaseVids(_0x5cb3b2){return _0x5cb3b2['map'](_0x3ac424=>{const _0x4911da=this['_getVidAttributeName'](_0x3ac424);return Number(_0x3ac424['item']['getAttribute'](_0x4911da));});}_generateTape(_0xfcc5fe,_0x3a2431){if(_0xfcc5fe['is']('element','$text'))_0x3a2431['push']({'item':_0xfcc5fe,'type':'text'});else{_0xfcc5fe['is']('element')&&_0x3a2431['push']({'item':_0xfcc5fe,'type':'elementStart'});for(const _0x3468d0 of _0xfcc5fe['getChildren']())this['_generateTape'](_0x3468d0,_0x3a2431);_0xfcc5fe['is']('element')&&_0x3a2431['push']({'item':_0xfcc5fe,'type':'elementEnd'});}return _0x3a2431;}_getState(){const _0x22c4b7=new Map(this['_touched']),_0x3ea7f5=new Map(_0x22c4b7),_0x2d3dc7=new Map(),_0xd665c1={'insertions':{},'deletions':{}},_0x625859={'insertions':{},'deletions':{}},_0x3e7114=new Map(),_0x2d9e99=new Set([...this['_baseRoots']['keys'](),...this['_diffRoots']['keys']()]),_0x3ba96b=new Map();_0x2d9e99['delete']('$graveyard');for(const _0x5e9c4f of _0x2d9e99){const _0x32ab7c=(this['_diffRoots']['get'](_0x5e9c4f)??this['_baseRoots']['get'](_0x5e9c4f))['name'],_0x324cb3=this['_diffRoots']['get'](_0x5e9c4f)||Rt(_0x5e9c4f,_0x32ab7c,!0x1),_0x52da37=this['_baseRoots']['get'](_0x5e9c4f)||Rt(_0x5e9c4f,_0x32ab7c,!0x1);_0x324cb3['isAttached']()||_0x52da37['isAttached']()?(_0x3ba96b['set'](_0x5e9c4f,_0x32ab7c),_0xd665c1['insertions'][_0x5e9c4f]=bt(_0x324cb3),_0xd665c1['deletions'][_0x5e9c4f]=bt(_0x52da37),this['_copyMarkers'](_0xd665c1['deletions'][_0x5e9c4f],_0x52da37),this['_copyMarkers'](_0xd665c1['insertions'][_0x5e9c4f],_0x324cb3),_0x625859['insertions'][_0x5e9c4f]=this['_generateTape'](this['_idsRoots']['get'](_0x5e9c4f),[]),_0x625859['deletions'][_0x5e9c4f]=this['_generateTape'](this['_baseIdsRoots']['get'](_0x5e9c4f)||Rt(_0x5e9c4f,_0x32ab7c,!0x1),[])):_0x2d9e99['delete'](_0x5e9c4f);}for(const _0x1d1fd3 of _0x2d9e99){const _0x36a865=_0x625859['insertions'][_0x1d1fd3];for(const _0x296a1f of _0x36a865){const _0x4e0f66=this['_getVidAttributeName'](_0x296a1f),_0x92c363=_0x296a1f['item']['getAttribute'](_0x4e0f66);_0x3ea7f5['delete'](_0x92c363),_0x92c363>=this['_startingRevisionId']&&_0x2d3dc7['set'](_0x92c363,_0x22c4b7['get'](_0x92c363));}}for(const _0x175d67 of _0x2d9e99){const _0x5575bb=_0x625859['insertions'][_0x175d67],_0x39d35d=this['_getBaseVids'](_0x625859['deletions'][_0x175d67]);let _0x7e8724=0x0;for(const _0x2ccc5c of _0x5575bb){const _0xe283c6=this['_getVidAttributeName'](_0x2ccc5c),_0x467197=_0x2ccc5c['item']['getAttribute'](_0xe283c6);if(!_0x2d3dc7['has'](_0x467197)&&!_0x3e7114['has'](_0x467197)){if(_0x3ea7f5['has'](_0x467197))_0x7e8724++;else{if(_0x467197!=_0x39d35d[_0x7e8724]){const _0x333c3a=_0x22c4b7['get'](_0x467197)||_0x22c4b7['get'](_0x39d35d[_0x7e8724]);for(;_0x467197!=_0x39d35d[_0x7e8724];)_0x3ea7f5['has'](_0x39d35d[_0x7e8724])||(_0x3e7114['set'](_0x39d35d[_0x7e8724],_0x333c3a),_0x22c4b7['set'](_0x39d35d[_0x7e8724],_0x333c3a)),_0x7e8724++;}_0x7e8724++;}}}}for(const _0x5c3383 of _0x2d9e99){const _0x13e37d=_0x625859['insertions'][_0x5c3383];for(const _0x581a0b of _0x13e37d){const _0x368767=this['_getVidAttributeName'](_0x581a0b),_0x51995a=_0x581a0b['item']['getAttribute'](_0x368767);if(_0x3e7114['has'](_0x51995a)){const _0x510fd6=_0x3e7114['get'](_0x51995a);_0x3ea7f5['has'](_0x51995a)||_0x3ea7f5['set'](_0x51995a,{..._0x510fd6}),_0x2d3dc7['set'](_0x51995a,{..._0x510fd6});}}}for(const _0x526301 of _0x3ea7f5['keys']())_0x526301>=this['_startingRevisionId']&&_0x3ea7f5['delete'](_0x526301);const _0x246917=new Map();for(const _0x2ece64 of _0x2d9e99){let _0x1593f9=_0x625859['insertions'][_0x2ece64];for(const _0x32e924 of _0x1593f9)if(_0x32e924['item']['is']('element','tableCell')){const _0xd3d362=this['_getVidAttributeName'](_0x32e924),_0x348f4b=_0x32e924['item']['getAttribute'](_0xd3d362);if(_0x2d3dc7['has'](_0x348f4b)){const _0x36caab=_0x32e924['item']['parent']['parent']['getAttribute']('vid_start'),_0x34fdd9=_0x246917['get'](_0x36caab)||new Set();_0x34fdd9['add'](_0x2d3dc7['get'](_0x348f4b)['userId']),_0x246917['set'](_0x36caab,_0x34fdd9);}}_0x1593f9=_0x625859['deletions'][_0x2ece64];for(const _0x32fedc of _0x1593f9)if(_0x32fedc['item']['is']('element','tableCell')){const _0x101bd7=this['_getVidAttributeName'](_0x32fedc),_0x500fc0=_0x32fedc['item']['getAttribute'](_0x101bd7);if(_0x3ea7f5['has'](_0x500fc0)){const _0x213023=_0x32fedc['item']['parent']['parent']['getAttribute']('vid_start'),_0x205c83=_0x246917['get'](_0x213023)||new Set();_0x205c83['add'](_0x3ea7f5['get'](_0x500fc0)['userId']),_0x246917['set'](_0x213023,_0x205c83);}}for(const _0x12d3ef of _0x246917['keys']())(_0x2d3dc7['has'](_0x12d3ef)||_0x3ea7f5['has'](_0x12d3ef))&&_0x246917['delete'](_0x12d3ef);}for(const _0x34717c of _0x2d9e99){const _0x35ea4b=_0x625859['insertions'][_0x34717c];let _0x10d86e=null,_0x1f7b1b=null;for(const _0x320aa2 of _0x35ea4b){const _0x4027cc=this['_getVidAttributeName'](_0x320aa2),_0x510e5f=_0x320aa2['item']['getAttribute'](_0x4027cc),_0x4868d7=_0x246917['get'](_0x510e5f);_0x4868d7&&'elementStart'==_0x320aa2['type']&&(_0x10d86e=Array['from'](_0x4868d7)[0x0],_0x1f7b1b=_0x320aa2['item']['getAttribute']('vid_end')),_0x10d86e&&(_0x3ea7f5['set'](_0x510e5f,{'userId':_0x10d86e}),_0x2d3dc7['set'](_0x510e5f,{'userId':_0x10d86e})),_0x510e5f==_0x1f7b1b&&(_0x10d86e=null,_0x1f7b1b=null);}}const _0x335862={},_0x38bd7b=new Set();for(const _0x221812 of _0x2d9e99){const _0x40a2fc=_0xd665c1['deletions'][_0x221812],_0x2c7e7d=_0xd665c1['insertions'][_0x221812];for(const {userId:_0x41c465}of this['_touchedMarkers']['values']())null!==_0x41c465&&_0x38bd7b['add'](_0x41c465);for(const {userId:_0x5d9adc}of this['_touchedRoots']['values']())null!==_0x5d9adc&&_0x38bd7b['add'](_0x5d9adc);this['_markChanges'](_0x2c7e7d,_0x625859['insertions'][_0x221812],_0x2d3dc7,'insertion',_0x38bd7b),this['_markChanges'](_0x40a2fc,_0x625859['deletions'][_0x221812],_0x3ea7f5,'deletion',_0x38bd7b),_0x335862[_0x221812]={'insertions':this['_prepareViewToSave'](_0x2c7e7d),'deletions':this['_prepareViewToSave'](_0x40a2fc),'attachChange':this['_touchedRoots']['get'](_0x221812)||null,'attributesBefore':_0x46d7d7(this['_baseRootsAttributes']['get'](_0x221812))||{},'attributesAfter':_0x46d7d7(this['_diffRootsAttributes']['get'](_0x221812)),'rootElementName':_0x3ba96b['get'](_0x221812)};}return{'diffData':_0x335862,'authorsIds':Array['from'](_0x38bd7b)};}_processRootBeforeSave(_0x53875e){for(const [,_0x4d7244]of _0x53875e['markers']){const _0x3ffd0a=_0x4d7244['start']['getAncestors']()['filter'](_0x1c169e=>'tableCell'==_0x1c169e['name']);for(const _0x47bdb5 of _0x3ffd0a)0x1==_0x47bdb5['childCount']&&_0x47bdb5['getChild'](0x0)['is']('element','paragraph')&&_0x47bdb5['getChild'](0x0)['_setAttribute']('keepParagraph',!0x0);}}['_prepareViewToSave'](_0x35f786){this['_processRootBeforeSave'](_0x35f786);const _0x233779=this['editor']['data']['toView'](_0x35f786,{}),_0xc6fac7=Array['from'](_0x233779['getChildren']())['map'](_0x254bee=>this['_getViewJson'](_0x254bee));return JSON['stringify'](_0xc6fac7);}_getViewJson(_0x477b9c){if(_0x477b9c['is']('$text'))return _0x477b9c['data'];{const _0x41d0df=this['editor']['plugins']['get']('RevisionHistoryUtils'),_0x8d34a1=_0x477b9c,_0x2ef471=this['editor']['data']['htmlProcessor']['domConverter'],_0x9087d2={'type':_0x41d0df['_getTypeCharForViewElement'](_0x8d34a1),'name':_0x8d34a1['name'],'attributes':Array['from'](_0x8d34a1['getAttributes']()),'children':Array['from'](_0x8d34a1['getChildren']())['map'](_0x13d24c=>this['_getViewJson'](_0x13d24c))};if(_0x477b9c['is']('uiElement')&&'$comment'!=_0x477b9c['name']){const _0x192462=_0x477b9c['render'](_0x2ef471['domDocument'],_0x2ef471);_0x9087d2['children']['push'](_0x192462['outerHTML']);}else{if(_0x477b9c['is']('rawElement')){const _0x4895cc=_0x2ef471['domDocument']['createElement'](_0x8d34a1['name']);_0x477b9c['render'](_0x4895cc,_0x2ef471),_0x9087d2['children']['push'](_0x4895cc['innerHTML']);}}const _0x1166d1=Array['from'](_0x8d34a1['getCustomProperties']());_0x1166d1['length']>0x0&&(_0x9087d2['customProperties']=_0x1166d1);const _0x23d993=_0x8d34a1['getFillerOffset']();return null!==_0x23d993&&(_0x9087d2['fillerOffset']=_0x23d993),_0x9087d2;}}['_markChanges'](_0x4ecad4,_0x83b09b,_0x3b2c23,_0x4fa0e5,_0x562108){let _0x2410e1=null,_0x55118e=null,_0x2b4adb=0x0;const _0x1739a6=this['editor']['model'];for(let _0x2e4f6e=0x0;_0x2e4f6e<_0x83b09b['length'];_0x2e4f6e++){const _0xe48c2f=this['_getVidAttributeName'](_0x83b09b[_0x2e4f6e]),_0x584476=_0x83b09b[_0x2e4f6e]['item']['getAttribute'](_0xe48c2f),_0x5be505=_0x3b2c23['get'](_0x584476),_0x1f4bab=_0x2e4f6e==_0x83b09b['length']-0x1;!_0x2410e1&&_0x5be505&&(_0x2410e1=_0x5be505,_0x55118e=_0x83b09b[_0x2e4f6e]),!_0x2410e1||_0x5be505&&_0x5be505['userId']==_0x2410e1['userId']||(_0x56fe62(_0x5be505,kt(_0x55118e,_0x4ecad4,_0x1739a6),kt(_0x83b09b[_0x2e4f6e],_0x4ecad4,_0x1739a6)),_0x2410e1=_0x5be505||null,_0x55118e=_0x5be505?_0x83b09b[_0x2e4f6e]:null),_0x2410e1&&_0x1f4bab&&_0x56fe62(_0x5be505,kt(_0x55118e,_0x4ecad4,_0x1739a6),At(_0x83b09b[_0x2e4f6e],_0x4ecad4,_0x1739a6));}function _0x56fe62(_0x6a788c,_0x1cdefc,_0x28e3ab){const _0x1f8736=_0x2410e1['userId'],_0x1ac987='revision:'+_0x4fa0e5+':'+_0x1f8736+':'+_0x2b4adb++,_0x38e19a=_0x1739a6['createRange'](_0x1cdefc,_0x28e3ab);_0x4ecad4['markers']['set'](_0x1ac987,_0x38e19a),null!==_0x1f8736&&_0x562108['add'](_0x1f8736);}}_getVidAttributeName(_0xf299f3){switch(_0xf299f3['type']){case'elementStart':return'vid_start';case'elementEnd':return'vid_end';default:return'vid';}}_fixOperation(_0x5acbe2,_0x137408){_0x5acbe2['baseVersion']=null;for(const _0x4c3c8d in _0x5acbe2){const _0x1ae192=_0x5acbe2[_0x4c3c8d];if(_0x1ae192 instanceof _0x113286){const _0x335c0b=_0x137408['get'](_0x1ae192['root']['rootName']);_0x5acbe2[_0x4c3c8d]=this['_fixPosition'](_0x1ae192,_0x335c0b);}if(_0x1ae192 instanceof _0x9da893){const _0x186148=_0x137408['get'](_0x1ae192['root']['rootName']);_0x5acbe2[_0x4c3c8d]=this['_fixRange'](_0x1ae192,_0x186148);}'root'===_0x4c3c8d&&(_0x5acbe2['root']=_0x137408['get'](_0x5acbe2['root']['rootName']));}}['_fixRange'](_0x835ca0,_0x3dc655){return this['editor']['model']['createRange'](this['_fixPosition'](_0x835ca0['start'],_0x3dc655),this['_fixPosition'](_0x835ca0['end'],_0x3dc655));}_fixPosition(_0x359493,_0x36714b){return this['editor']['model']['createPositionFromPath'](_0x36714b,_0x359493['path'],_0x359493['stickiness']);}_handleInsertOperation(_0x18797e){const _0x3f4a16=this['_idsRoots']['get'](_0x18797e['position']['root']['rootName']),_0x15aa7c=this['_fixPosition'](_0x18797e['position'],_0x3f4a16),_0x56761a=null===_0x18797e['_authorId']?null:_0x18797e['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x54d7f5=_0x15aa7c['parent'],_0xca8816=this['_revisionId'],_0x1d2700=[];for(const _0x3c9353 of _0x18797e['nodes'])if(_0x3c9353['is']('element'))_0x1d2700['push'](this['_makeIdsRoot'](_0x3c9353));else{for(let _0x3504c6=0x0;_0x3504c6<_0x3c9353['offsetSize'];_0x3504c6++)_0x1d2700['push'](new _0x474a71('$text',{'vid':this['_revisionId']++}));}const _0x38075f=this['_revisionId'];for(let _0x21c88c=_0xca8816;_0x21c88c<_0x38075f;_0x21c88c++)this['_touched']['set'](_0x21c88c,{'userId':_0x56761a});_0x54d7f5['_insertChild'](_0x15aa7c['offset'],_0x1d2700);}_handleMoveOperation(_0x8dd90e){(_0x8dd90e=this['_cloneOperation'](_0x8dd90e,this['_idsRoots']))['_execute']();const _0x493cad=null===_0x8dd90e['_authorId']?null:_0x8dd90e['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0xf448a9=_0x8dd90e['getMovedRangeStart'](),_0x2ea062=_0xf448a9['parent'],_0x162bfb=_0xf448a9['offset'];!function _0x1c0941(_0x468910,_0x4560b6,_0x549117,_0x1afca7){for(let _0x2de74a=_0x549117;_0x2de74a<_0x1afca7;_0x2de74a++){const _0x31e774=_0x4560b6['getChild'](_0x2de74a);_0x31e774['is']('element','$text')?_0x468910['set'](_0x31e774['getAttribute']('vid'),{'userId':_0x493cad}):(_0x468910['set'](_0x31e774['getAttribute']('vid_start'),{'userId':_0x493cad}),_0x1c0941(_0x468910,_0x31e774,0x0,_0x31e774['childCount']),_0x468910['set'](_0x31e774['getAttribute']('vid_end'),{'userId':_0x493cad}));}}(this['_touched'],_0x2ea062,_0x162bfb,_0x162bfb+_0x8dd90e['howMany']);}_handleMergeOperation(_0x3712d5){const _0x182b3d=null===(_0x3712d5=this['_cloneOperation'](_0x3712d5,this['_idsRoots']))['_authorId']?null:_0x3712d5['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x559bdd=_0x3712d5['targetPosition']['parent'],_0x53f571=_0x3712d5['sourcePosition']['parent'],_0x46dc28=_0x559bdd['getAttribute']('vid_end'),_0x243253=_0x53f571['getAttribute']('vid_start');_0x559bdd['_setAttribute']('vid_end',_0x53f571['getAttribute']('vid_end')),_0x53f571['_setAttribute']('vid_end',_0x46dc28),this['_touched']['set'](_0x243253,{'userId':_0x182b3d}),this['_touched']['set'](_0x46dc28,{'userId':_0x182b3d}),_0x3712d5['_execute']();}_handleSplitOperation(_0x4ae016){const _0x38c503=null===(_0x4ae016=this['_cloneOperation'](_0x4ae016,this['_idsRoots']))['_authorId']?null:_0x4ae016['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x5b1078=_0x4ae016['graveyardPosition'],_0x45d792=_0x4ae016['splitPosition']['parent'];_0x4ae016['_execute']();const _0x571cf9=_0x45d792['getAttribute']('vid_end'),_0x444f72=_0x4ae016['insertionPosition']['nodeAfter'];if(_0x5b1078){const _0x16c4d2=_0x444f72['getAttribute']('vid_end'),_0x2d467b=_0x45d792['getAttribute']('vid_end');_0x45d792['_setAttribute']('vid_end',_0x16c4d2),_0x444f72['_setAttribute']('vid_end',_0x2d467b),this['_touched']['set'](_0x45d792['getAttribute']('vid_end'),{'userId':_0x38c503}),this['_touched']['set'](_0x444f72['getAttribute']('vid_start'),{'userId':_0x38c503});}else{const _0x10ca48=this['_revisionId']++,_0x55961a=this['_revisionId']++;_0x45d792['_setAttribute']('vid_end',_0x10ca48),_0x444f72['_setAttribute']('vid_start',_0x55961a),_0x444f72['_setAttribute']('vid_end',_0x571cf9),this['_touched']['set'](_0x10ca48,{'userId':_0x38c503}),this['_touched']['set'](_0x55961a,{'userId':_0x38c503});}}_handleMarkerOperation(_0x4c8e7b){if(!_0x4c8e7b['affectsData'])return;const _0x4c94d8=(_0x4c8e7b=this['_cloneOperation'](_0x4c8e7b,this['_diffRoots']))['oldRange']?_0x4c8e7b['oldRange']['root']:null,_0x45ab84=_0x4c8e7b['newRange']?_0x4c8e7b['newRange']['root']:null;_0x4c94d8&&this['_markers']['delete'](_0x4c8e7b['name']),_0x45ab84&&this['_markers']['set'](_0x4c8e7b['name'],_0x4c8e7b['newRange']['clone']());const _0x51430e=null===_0x4c8e7b['_authorId']?null:_0x4c8e7b['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x440c3d=_0x4c8e7b['name'];if(!this['_touchedMarkers']['has'](_0x440c3d))return void this['_touchedMarkers']['set'](_0x440c3d,{'range':_0x4c8e7b['oldRange'],'userId':_0x51430e});const _0x267284=this['_touchedMarkers']['get'](_0x440c3d),_0x36f7d7=_0x267284['range'],_0x4e9963=_0x4c8e7b['newRange'];null==_0x36f7d7&&null==_0x4e9963||_0x36f7d7&&_0x4e9963&&_0x36f7d7['isEqual'](_0x4e9963)?this['_touchedMarkers']['delete'](_0x4c8e7b['name']):_0x267284['userId']=_0x51430e;}_handleRootOperation(_0x4bc675,_0x4b17dc){this['_diffRoots']['has'](_0x4bc675['rootName'])?this['_diffRoots']['get'](_0x4bc675['rootName'])['_isAttached']=_0x4bc675['isAdd']:(this['_diffRoots']['set'](_0x4bc675['rootName'],Rt(_0x4bc675['rootName'],_0x4bc675['elementName'],!0x0)),this['_diffRootsAttributes']['set'](_0x4bc675['rootName'],{}),_0x4b17dc&&this['_idsRoots']['set'](_0x4bc675['rootName'],Rt(_0x4bc675['rootName'],_0x4bc675['elementName'],!0x0)));const _0x68ff0b=null===_0x4bc675['_authorId']?null:_0x4bc675['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x4fd0c3=this['_touchedRoots']['get'](_0x4bc675['rootName']);_0x4fd0c3&&_0x4fd0c3['userId']===_0x68ff0b?this['_touchedRoots']['delete'](_0x4bc675['rootName']):this['_touchedRoots']['set'](_0x4bc675['rootName'],{'userId':_0x68ff0b,'isAttached':_0x4bc675['isAdd']});}_handleRootAttributeOperation(_0x219a33){const _0x1771cf=this['_diffRootsAttributes']['get'](_0x219a33['root']['rootName']);null===_0x219a33['newValue']?delete _0x1771cf[_0x219a33['key']]:_0x1771cf[_0x219a33['key']]=_0x219a33['newValue'];}};function bt(_0x3ae0b6){const _0x167b07=Rt(_0x3ae0b6['rootName'],_0x3ae0b6['name'],_0x3ae0b6['isAttached']());for(const _0x2d0c33 of _0x3ae0b6['getChildren']()){const _0x33d259=_0x2d0c33['_clone'](!0x0);_0x167b07['_appendChild'](_0x33d259);}return _0x167b07;}function Rt(_0x1004de,_0x5030bf,_0x56486f=!0x0){const _0x377b46=new _0x596b32();return _0x377b46['rootName']=_0x1004de,_0x377b46['name']=_0x5030bf,_0x377b46['_isAttached']=_0x56486f,_0x377b46['isAttached']=()=>_0x377b46['_isAttached'],_0x377b46;}function kt(_0x47187f,_0x8235fb,_0x44ab31){const _0x1ff146='elementEnd'==_0x47187f['type']?_0x44ab31['createPositionAt'](_0x47187f['item'],'end'):_0x44ab31['createPositionBefore'](_0x47187f['item']);return _0x44ab31['createPositionFromPath'](_0x8235fb,_0x1ff146['path'],_0x1ff146['stickiness']);}function At(_0x490659,_0x273549,_0x2b9a01){const _0x1d7ee4='elementStart'==_0x490659['type']?_0x2b9a01['createPositionAt'](_0x490659['item'],0x0):_0x2b9a01['createPositionAfter'](_0x490659['item']);return _0x2b9a01['createPositionFromPath'](_0x273549,_0x1d7ee4['path'],_0x1d7ee4['stickiness']);}const It=/* #__PURE__ -- @preserve */
|
|
25
|
+
_0x565b1d(at);var Et=class extends It{['focusTracker'];keystrokes;revisionNameInputView;constructor(_0x285457,_0x364f92){super(_0x285457),this['focusTracker']=new _0x14f511(),this['keystrokes']=new _0x516c36(),this['set']('revisionNameInputValue',''),this['revisionNameInputView']=this['_createRevisionNameInput'](_0x364f92),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'](),dt({'view':this}),this['focusTracker']['add'](this['revisionNameInputView']['element']),this['keystrokes']['listenTo'](this['element']);const _0xa75dc8=_0x20f85f=>_0x20f85f['stopPropagation']();this['keystrokes']['set']('arrowright',_0xa75dc8),this['keystrokes']['set']('arrowleft',_0xa75dc8),this['keystrokes']['set']('arrowup',_0xa75dc8),this['keystrokes']['set']('arrowdown',_0xa75dc8);}['focus'](){this['revisionNameInputView']['focus']();}get['revisionName'](){return this['revisionNameInputView']['fieldView']['element']['value']['trim']();}set['revisionName'](_0x1329d3){this['revisionNameInputView']['fieldView']['element']['value']=_0x1329d3['trim']();}reset(){this['revisionNameInputView']['fieldView']['element']['value']='',this['revisionNameInputView']['errorText']=null;}_createRevisionNameInput(_0xc8f4d2){const _0x29ad38=new _0x598ee3(this['locale'],lt),_0x1de311=_0x29ad38['fieldView'];_0x1de311['extendTemplate']({'attributes':{'maxlength':'220'}});let _0x53c22d=pt(this['locale'],'Name\x20of\x20the\x20revision');return!_0xc8f4d2&&(_0x53c22d+='\x20('+pt(this['locale'],'optional')+')'),(_0x29ad38['label']=_0x53c22d,_0x1de311['on']('input',()=>{this['revisionNameInputValue']=_0x1de311['element']['value']['trim']();}),_0x29ad38);}},St=class extends _0x4a2cc5{static get['pluginName'](){return'RevisionHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_t];}['_saveRevisionFormView'];init(){const _0x196eac=this['editor'],_0x5ea924=_0x196eac['plugins']['get']('RevisionTracker');_0x196eac['ui']['componentFactory']['add']('revisionHistory',_0x326ebf=>{const _0x4f53d2=ct(_0x326ebf),_0x4aae8e=_0x4f53d2['panelView']['children'],_0x1d0c40=new _0x399eaf(_0x326ebf),_0x2517f1=new _0x39771e(_0x326ebf),_0x5eef5f=this['_createSaveRevisionButton'](_0x8e67d0),_0x16bd8d=new _0x39771e(_0x326ebf),_0x4a8014=this['_createOpenRevisionButton'](_0x8e67d0);return _0x4f53d2['bind']('isEnabled')['to'](_0x5ea924,'isReady',_0x5ea924,'isEnabled',_0x196eac,'isReadOnly',(_0x31f3a4,_0x544cc8,_0x1589d1)=>_0x31f3a4&&_0x544cc8&&!_0x1589d1),_0x4f53d2['buttonView']['set']({'icon':_0xc681fc,'label':pt(_0x326ebf,'Revision\x20history'),'tooltip':!0x0}),_0x5eef5f['set']({'withText':!0x0,'role':'menuitem'}),_0x4a8014['set']({'withText':!0x0,'role':'menuitem'}),this['listenTo'](_0x4a8014,'execute',()=>{_0x4f53d2['isOpen']=!0x1,_0x196eac['editing']['view']['focus']();},{'priority':'low'}),_0x2517f1['children']['add'](_0x5eef5f),_0x16bd8d['children']['add'](_0x4a8014),_0x1d0c40['role']='menu',_0x1d0c40['items']['addMany']([_0x2517f1,_0x16bd8d]),_0x4aae8e['add'](_0x1d0c40),_0x4f53d2;}),_0x196eac['ui']['componentFactory']['add']('menuBar:revisionHistory',()=>this['_registerMenuComponent']());}_registerMenuComponent(){const _0x33e7df=this['editor'],_0x18e363=_0x33e7df['locale'],_0x4a5b82=_0x33e7df['plugins']['get']('RevisionTracker'),_0x2e470e=new et(_0x18e363),_0x461713=new it(_0x18e363);_0x2e470e['bind']('isEnabled')['to'](_0x4a5b82,'isReady',_0x4a5b82,'isEnabled',_0x33e7df,'isReadOnly',(_0x468ac2,_0x2386ec,_0x44c4e2)=>_0x468ac2&&_0x2386ec&&!_0x44c4e2),_0x2e470e['buttonView']['set']({'icon':_0xc681fc,'label':pt(_0x18e363,'Revision\x20history')});const _0x59f6d1=new tt(_0x18e363,_0x2e470e),_0xed7eca=this['_createSaveRevisionButton'](_0x35474a);_0xed7eca['delegate']('execute')['to'](_0x2e470e),_0x59f6d1['children']['add'](_0xed7eca),_0x461713['items']['add'](_0x59f6d1);const _0x5d4843=new tt(_0x18e363,_0x2e470e),_0x250ca5=this['_createOpenRevisionButton'](_0x35474a);return _0x250ca5['delegate']('execute')['to'](_0x2e470e),_0x5d4843['children']['add'](_0x250ca5),_0x461713['items']['add'](_0x5d4843),_0x2e470e['panelView']['children']['add'](_0x461713),_0x2e470e;}_createSaveRevisionButton(_0x29afb1){const _0x3bac0f=this['editor'],_0xd8accd=_0x3bac0f['plugins']['get']('RevisionTracker'),_0x365858=new _0x29afb1(_0x3bac0f['locale']);return _0x365858['set']({'label':pt(_0x3bac0f['locale'],'Save\x20current\x20revision')}),_0x365858['bind']('isEnabled')['to'](_0xd8accd,'isReady',_0xd8accd,'isEnabled',_0x3bac0f,'isReadOnly',(_0x5a1afe,_0x1445e4,_0x9c4e67)=>_0x5a1afe&&_0x1445e4&&!_0x9c4e67),this['listenTo'](_0x365858,'execute',()=>{this['_showDialog']();}),_0x365858;}_createOpenRevisionButton(_0x97161){const _0x324122=this['editor'],_0x34fa90=_0x324122['plugins']['get']('RevisionTracker'),_0x37a303=new _0x97161(_0x324122['locale']);return _0x37a303['set']({'label':pt(_0x324122['locale'],'Open\x20revision\x20history')}),_0x37a303['bind']('isEnabled')['to'](_0x34fa90,'isReady',_0x324122,'isReadOnly',(_0x4eecb7,_0x4f2f37)=>_0x4eecb7&&!_0x4f2f37),this['listenTo'](_0x37a303,'execute',()=>{_0x324122['config']['get']('revisionHistory')['showRevisionViewerCallback']();}),_0x37a303;}['_showDialog'](){const _0x2c7dcf=this['editor'],_0x367615=_0x2c7dcf['locale'],_0x204da9=_0x2c7dcf['plugins']['get']('Dialog'),_0x24e2c1=_0x2c7dcf['plugins']['get']('RevisionTracker');function _0x401090(_0x3ce2f4){_0x2c7dcf['config']['get']('revisionHistory.requireRevisionName')&&''===_0x3ce2f4['revisionName']?_0x3ce2f4['revisionNameInputView']['errorText']=pt(_0x367615,'The\x20revision\x20name\x20cannot\x20be\x20empty.'):(_0x2c7dcf['plugins']['get'](_t)['saveRevision']({'name':_0x3ce2f4['revisionName']}),_0x204da9['hide']());}this['_saveRevisionFormView']||(this['_createSaveRevisionFormView'](),this['_saveRevisionFormView']['on']('submit',()=>_0x401090(this['_saveRevisionFormView']))),this['_saveRevisionFormView']['reset'](),_0x204da9['show']({'id':'revisionSave','title':pt(_0x367615,'Save\x20current\x20revision'),'isModal':!0x0,'content':this['_saveRevisionFormView'],'actionButtons':[{'label':pt(_0x2c7dcf['locale'],'Cancel'),'withText':!0x0,'onExecute':()=>_0x204da9['hide']()},{'label':pt(_0x2c7dcf['locale'],'Accept'),'class':'ck-button-action','withText':!0x0,'onCreate'(_0x1e1ee5){_0x1e1ee5['bind']('isEnabled')['to'](_0x24e2c1,'isReady',_0x24e2c1,'isEnabled',_0x2c7dcf,'isReadOnly',(_0x34947d,_0x592f1c,_0x32140d)=>_0x34947d&&_0x592f1c&&!_0x32140d);},'onExecute':()=>_0x401090(this['_saveRevisionFormView'])}]});}_createSaveRevisionFormView(){const _0xd9afe8=this['editor'],_0x1080d3=_0xd9afe8['locale'];this['_saveRevisionFormView']=new Et(_0x1080d3,_0xd9afe8['config']['get']('revisionHistory.requireRevisionName')),this['_saveRevisionFormView']['render']();}},Nt=class extends at{['changeId'];['_model'];constructor(_0x3fce64,_0x2c2022){super(_0x3fce64),this['_model']=_0x2c2022,this['changeId']=_0x2c2022['id'];const _0x361d75=this['bindTemplate'],_0x4f1b4d=pt(_0x3fce64,_0x2c2022['data']['isSuggestion']?'Suggested\x20by':'add'==_0x2c2022['type']?'Added\x20by':'Removed\x20by');this['set']('type',_0x2c2022['type']),this['setTemplate']({'tag':'div','attributes':{'class':['ck-annotation','ck-revision-change',_0x361d75['to']('type',_0x345ef6=>'ck-revision-change__'+_0x345ef6)],'tabindex':-0x1},'children':[{'tag':'span','children':[{'tag':'span','attributes':{'class':['ck-revision-change__label']},'children':[{'text':_0x4f1b4d}]},{'text':'\x20'+_0x2c2022['author']['name']}]}]});}['focus'](){this['element']['focus']();}};const xt=/* #__PURE__ -- @preserve */
|
|
26
|
+
_0x565ee3();var Ot=class extends xt{['id'];author;type;data;rootName;constructor(_0x1603e3){super(),this['id']=_0x1603e3['id']||_0x390b5b(),this['author']=_0x1603e3['author'],this['type']=_0x1603e3['type'],this['data']=_0x1603e3['data']||{},this['rootName']=_0x1603e3['rootName'],this['set']('createdAt',_0x1603e3['createdAt']);}toJSON(){return{'id':this['id'],'authorId':this['author']['id'],'type':this['type'],'data':this['data'],'createdAt':this['createdAt']};}},Ct=class{['newRevisionId'];['oldRevisionId'];['changes'];constructor(_0x5701a5,_0x4c0b60){this['newRevisionId']=_0x5701a5,this['oldRevisionId']=_0x4c0b60,this['changes']=new _0xca5138();}_setChanges(_0x4cd61a){for(const _0x4712fc of _0x4cd61a)this['changes']['add'](_0x4712fc);}},Mt=class extends _0x4a2cc5{repository;adapter=null;_utils;_activeViewTarget;['_changeView'];['_changeIdToChange'];['_balloon'];static get['pluginName'](){return'RevisionViewer';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_0x4cd47f,_0x3e858d,mt,wt];}constructor(_0xda407f){super(_0xda407f),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',(_0x25b9af,_0x56f9c7,_0x5a94eb)=>{this['activeChange']=null,this['activeView']=null,this['editor']['editing']['view']['change'](_0x42a883=>{for(const _0x28a31a of this['editor']['editing']['view']['document']['roots'])_0x5a94eb?_0x42a883['removeClass']('ck-editor__editable__overlay',_0x28a31a):_0x42a883['addClass']('ck-editor__editable__overlay',_0x28a31a);});}),this['bind']('isNavigationMode')['to'](this,'activeChange',_0xceb903=>null!==_0xceb903),this['bind']('currentChangeNumber')['to'](this,'isReady',this,'diff',this,'activeChange',(_0x2d507f,_0x4abfce,_0x4c4adf)=>_0x2d507f&&_0x4c4adf?_0x4abfce['changes']['getIndex'](_0x4c4adf):0x0),this['bind']('numberOfChanges')['to'](this,'isReady',this,'diff',(_0x1a34ed,_0x5b3d4f)=>_0x1a34ed?_0x5b3d4f['changes']['length']:0x0),this['_changeView']=null,this['_changeIdToChange']=new Map(),this['_balloon']=this['editor']['plugins']['get'](_0x3e858d);}init(){const _0x1f668e=this['editor'],_0x50b335=new Tt(_0x1f668e,{'direction':'backward'}),_0x400dc8=new Tt(_0x1f668e,{'direction':'forward'});_0x1f668e['commands']['add']('showPreviousChange',_0x50b335),_0x1f668e['commands']['add']('showNextChange',_0x400dc8),_0x1f668e['commands']['add']('restoreRevision',new Dt(_0x1f668e)),this['on']('change:numberOfChanges',()=>{_0x50b335['refresh'](),_0x400dc8['refresh']();}),this['_setConversion'](),this['_initInteractions'](),_0x1f668e['enableReadOnlyMode']('revision-viewer'),_0x1f668e['plugins']['has']('WidgetToolbarRepository')&&_0x1f668e['plugins']['get']('WidgetToolbarRepository')['forceDisabled']('revision-viewer');}async getRevisionDocumentData(_0x28bdc7){return await this['_utils']['loadRevisionData'](_0x28bdc7,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x28bdc7);}async getRevisionRootsAttributes(_0x4869db){return await this['_utils']['loadRevisionData'](_0x4869db,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x4869db);}async['compare'](_0x27a66f,_0x1c7a64,_0x16a4f3=!0x1){if(!this['isEnabled'])return;const _0x302c74=this['diff'],_0x34a4f0=this['repository'],_0x22128f='string'==typeof _0x27a66f?_0x34a4f0['getRevision'](_0x27a66f):_0x27a66f,_0x5c4ea0='string'==typeof _0x1c7a64?_0x34a4f0['getRevision'](_0x1c7a64):_0x1c7a64,_0x3f3b08=_0x22128f['id'],_0x5f1f08=_0x5c4ea0?_0x5c4ea0['id']:null;if(!_0x16a4f3&&this['diff']&&this['diff']['newRevisionId']===_0x3f3b08&&this['diff']['oldRevisionId']===_0x5f1f08)return Promise['resolve']();this['isReady']=!0x1,this['activeView']=null,this['activeChange']=null,this['diff']=new Ct(_0x3f3b08,_0x5f1f08);const _0x4118c9=this['_getRevisionsRange'](_0x22128f,_0x5c4ea0,!0x0)['map'](_0x4203f6=>this['_utils']['loadRevisionData'](_0x4203f6,this['adapter']));return _0x4118c9['push'](new Promise(_0x298bc0=>{setTimeout(_0x298bc0,0x14);})),Promise['all'](_0x4118c9)['then'](()=>{if(!this['isEnabled'])return;this['_cleanUp']();const _0x173ba5=this['_getDiff'](_0x3f3b08,_0x5f1f08);for(const _0x263014 of _0x173ba5['changes'])this['_changeIdToChange']['set'](_0x263014['id'],_0x263014);this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x49ce7c=>{for(const _0x39f17a of this['editor']['model']['document']['getRootNames']())_0x49ce7c['detachRoot'](_0x39f17a);for(const _0x326c7d of Object['keys'](_0x173ba5['model'])){const _0x2001fc=_0x173ba5['model'][_0x326c7d]['name'],_0x43740b=_0x49ce7c['addRoot'](_0x326c7d,_0x2001fc);for(const _0x108429 of Object['keys'](_0x173ba5['attributes'][_0x326c7d]))_0x49ce7c['setAttribute'](_0x108429,_0x173ba5['attributes'][_0x326c7d][_0x108429],_0x43740b);_0x49ce7c['insert'](_0x173ba5['model'][_0x326c7d],_0x43740b,0x0);}}),this['diff']['_setChanges'](this['_sortAndFilterDiffChanges'](_0x173ba5['changes'])),this['isReady']=!0x0;})['catch'](_0x2919f9=>{console['error'](_0x2919f9),this['_cleanUp'](),_0x302c74&&(this['diff']=_0x302c74),this['isReady']=!0x0;});}addRevisionData(_0x46d05d,_0xb21785){const _0x5afed2=this['repository']['createRevision'](_0x46d05d);return _0x5afed2['on']('_update',(_0x10994a,_0x127c9d,_0x17f14c)=>_0xb21785(_0x127c9d,_0x17f14c,_0x5afed2)),this['repository']['addRevision'](_0x5afed2),_0x5afed2;}['_cleanUp'](){this['activeChange']=null,this['_cleanMarkers'](),this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=null,this['_changeIdToChange']['clear'](),this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x4ed74d=>{for(const _0x5d269f of this['editor']['model']['document']['getRootNames']())_0x4ed74d['detachRoot'](_0x5d269f);});}_sortAndFilterDiffChanges(_0x4d0f99){const _0x5ee10a=[],_0x48d2f7=new Map();for(const _0x363f3c of this['editor']['model']['document']['getRootNames']()){const _0x1bfd99=this['editor']['editing']['view']['getDomRoot'](_0x363f3c);if(!_0x1bfd99)continue;const _0x391682=_0x1bfd99['getClientRects']()['item'](0x0);_0x391682&&(_0x5ee10a['push'](_0x363f3c),_0x48d2f7['set'](_0x363f3c,_0x391682));}return _0x5ee10a['sort']((_0x30e42d,_0xe620bc)=>{const _0x346e5b=_0x48d2f7['get'](_0x30e42d),_0x382525=_0x48d2f7['get'](_0xe620bc);return _0x346e5b['y']-_0x382525['y']||_0x346e5b['x']-_0x382525['x'];}),(_0x4d0f99=_0x4d0f99['filter'](_0x31ff83=>_0x5ee10a['includes'](_0x31ff83['rootName'])))['sort']((_0x4619de,_0x19f41d)=>_0x5ee10a['indexOf'](_0x4619de['rootName'])-_0x5ee10a['indexOf'](_0x19f41d['rootName'])),_0x4d0f99;}['_makeTape'](_0x7fceaa){const _0x33c5d3=Array['from'](_0x7fceaa['markers'])['filter'](([_0x5f311b,_0x1ab4ef])=>_0x5f311b['startsWith']('revision:')&&!_0x1ab4ef['isCollapsed']),_0x345924=Array['from'](this['editor']['model']['createRangeIn'](_0x7fceaa)['getWalker']({'singleCharacters':!0x0}));if(0x0!=_0x33c5d3['length'])for(const _0x3dde5c of _0x345924){const [_0x5563ff,_0x50871d]=_0x33c5d3[0x0],[,_0x2693e2,_0x418d09]=_0x5563ff['split'](':');if(_0x50871d['end']['isEqual'](_0x3dde5c['nextPosition'])&&_0x33c5d3['shift'](),(_0x3dde5c['previousPosition']['isEqual'](_0x50871d['start'])||_0x3dde5c['previousPosition']['isAfter'](_0x50871d['start']))&&('insertion'==_0x2693e2?_0x3dde5c['isAdded']={'userId':_0x418d09}:'deletion'==_0x2693e2&&(_0x3dde5c['isRemoved']={'userId':_0x418d09})),0x0==_0x33c5d3['length'])break;}return _0x345924;}_refreshStartEndIndex(_0x9ab28a){const _0x37c2b7=new Map();for(let _0xa672ff=0x0;_0xa672ff<_0x9ab28a['length'];_0xa672ff++)'text'===_0x9ab28a[_0xa672ff]['type']?(_0x9ab28a[_0xa672ff]['item']['startIndex']=_0xa672ff,_0x9ab28a[_0xa672ff]['item']['endIndex']=_0xa672ff):('elementStart'===_0x9ab28a[_0xa672ff]['type']?_0x9ab28a[_0xa672ff]['item']['startIndex']=_0xa672ff:'elementEnd'===_0x9ab28a[_0xa672ff]['type']&&(_0x9ab28a[_0xa672ff]['item']['endIndex']=_0xa672ff),_0x37c2b7['set'](_0x9ab28a[_0xa672ff]['id'],_0xa672ff));for(const _0x4de19e of _0x37c2b7['values']())'elementStart'===_0x9ab28a[_0x4de19e]['type']?_0x9ab28a[_0x4de19e]['item']['endIndex']=_0x37c2b7['get'](_0x9ab28a[_0x4de19e]['pairId']):'elementEnd'===_0x9ab28a[_0x4de19e]['type']&&(_0x9ab28a[_0x4de19e]['item']['startIndex']=_0x37c2b7['get'](_0x9ab28a[_0x4de19e]['pairId']));}['_processTape'](_0x42fd48){for(let _0x549858=0x0;_0x549858<_0x42fd48['length'];_0x549858++){if('elementStart'===_0x42fd48[_0x549858]['type'])_0x42fd48[_0x549858]['item']['startIndex']=_0x549858;else{if('elementEnd'===_0x42fd48[_0x549858]['type']){_0x42fd48[_0x549858]['item']['endIndex']=_0x549858;const _0x1fd746=_0x42fd48[_0x549858]['item']['startIndex'];_0x42fd48[_0x1fd746]['pairId']=_0x42fd48[_0x549858]['id'],_0x42fd48[_0x549858]['pairId']=_0x42fd48[_0x1fd746]['id'];}else _0x42fd48[_0x549858]['item']['startIndex']=_0x549858,_0x42fd48[_0x549858]['item']['endIndex']=_0x549858,_0x42fd48[_0x549858]['pairId']=null;}_0x42fd48[_0x549858]['markersStart']||(_0x42fd48[_0x549858]['markersStart']=[],_0x42fd48[_0x549858]['markersEnd']=[]);}}_markInsertions(_0x4b6d36,_0x43009a){const _0x38ac99=_0x4b6d36['filter'](_0x5cba52=>!_0x5cba52['isAdded']);for(let _0x2e7e04=0x0;_0x2e7e04<_0x43009a['length'];_0x2e7e04++)_0x43009a[_0x2e7e04]['isAdded']&&(_0x38ac99[_0x2e7e04]['isAdded']=_0x43009a[_0x2e7e04]['isAdded']);}_getDiff(_0x454b79,_0x20e114=null){const _0x35f8a8=this['repository']['getRevision'](_0x454b79),_0x34bb20=_0x20e114?this['repository']['getRevision'](_0x20e114):null,_0x546a06=this['_getRevisionsRange'](_0x35f8a8,_0x34bb20),_0x493e9d=_0x546a06[_0x546a06['length']-0x1],_0x16ec6e=new Map(),_0x2cb8bd={'model':{},'attributes':{},'changes':[]},_0x3d0535=new Set(),_0x132c7a=new Map();for(let _0x9440b=_0x546a06['length']-0x1;_0x9440b>=0x0;_0x9440b--){const _0x593b47=_0x546a06[_0x9440b];for(const _0x225acd of Object['keys'](_0x593b47['diffData']))if(_0x593b47['diffData'][_0x225acd]['attachChange']){const _0x42352f=_0x593b47['diffData'][_0x225acd]['attachChange'];_0x42352f['isAttached']?(_0x3d0535['add'](_0x225acd),_0x132c7a['has'](_0x225acd)&&_0x132c7a['get'](_0x225acd)['userId']==_0x42352f['userId']?_0x132c7a['delete'](_0x225acd):_0x132c7a['set'](_0x225acd,_0x42352f)):_0x132c7a['has'](_0x225acd)?(_0x3d0535['delete'](_0x225acd),_0x132c7a['delete'](_0x225acd)):(_0x3d0535['add'](_0x225acd),_0x132c7a['set'](_0x225acd,_0x42352f));}else _0x3d0535['add'](_0x225acd);}for(const _0x32077d of _0x3d0535){const _0x378ce9=_0x132c7a['has'](_0x32077d)&&!_0x132c7a['get'](_0x32077d)['isAttached'];let _0x5697df=_0x378ce9?_0x546a06['length']-0x1:0x0;const _0x1ba9e9=_0x378ce9?-0x1:0x1;for(;_0x546a06[_0x5697df];){const _0x2adb76=_0x546a06[_0x5697df];if(_0x2adb76['diffData'][_0x32077d]){const _0x43f4b4=_0x378ce9?_0x2adb76['diffData'][_0x32077d]['attributesBefore']:_0x2adb76['diffData'][_0x32077d]['attributesAfter'];_0x2cb8bd['attributes'][_0x32077d]=_0x43f4b4?_0x46d7d7(_0x43f4b4):{};break;}_0x5697df+=_0x1ba9e9;}}for(const _0x2c28e4 of _0x546a06){_0x2c28e4['model']={};for(const _0x537638 of _0x2c28e4['authors'])_0x16ec6e['set'](_0x537638['id'],_0x537638);for(const _0x334292 of _0x3d0535){const _0x523088=_0x2c28e4['diffData'][_0x334292]?_0x2c28e4['diffData'][_0x334292]['insertions']:'[]',_0x231d67=_0x2c28e4['diffData'][_0x334292]?_0x2c28e4['diffData'][_0x334292]['deletions']:'[]',_0x79a588=_0x2c28e4['diffData'][_0x334292]?.['rootElementName']||'$root';_0x2c28e4['model'][_0x334292]={'insertions':this['_utils']['_makeModelFromViewString'](_0x523088,_0x79a588),'deletions':this['_utils']['_makeModelFromViewString'](_0x231d67,_0x79a588)};}}for(const _0x3fb3bb of _0x3d0535){let _0x4a55f4=null,_0x644628=0x0;const _0x184394=_0x546a06['map'](_0x19a6de=>_0x19a6de['diffData'][_0x3fb3bb]?.['rootElementName'])['find'](_0xfc779e=>void 0x0!==_0xfc779e)||'$root',_0x56d28c=new Map(Array['from'](_0x35f8a8['model'][_0x3fb3bb]['insertions']['markers'])['filter'](([_0x30fdf8])=>!_0x30fdf8['startsWith']('revision:')));let _0x5c117b=0x0;for(const _0x5a78a8 of _0x546a06){const _0x2ff81c=this['_makeTape'](_0x5a78a8['model'][_0x3fb3bb]['insertions']);_0x5a78a8==_0x35f8a8?(_0x4a55f4=_0x2ff81c,_0x644628=_0x4a55f4['length'],_0x4a55f4['forEach'](_0x5c2053=>{_0x5c2053['id']=_0x5c117b++;}),this['_processTape'](_0x4a55f4)):this['_markInsertions'](_0x4a55f4,_0x2ff81c);const _0x3e8859=_0x4a55f4['filter'](_0x3235b9=>!_0x3235b9['isAdded'])['map'](_0x218349=>_0x218349['id']);let _0x2704cc=0x0;const _0x3054a2=this['_makeTape'](_0x5a78a8['model'][_0x3fb3bb]['deletions']);_0x3054a2['forEach'](_0x128178=>{_0x128178['isRemoved']?_0x128178['id']=_0x644628++:_0x128178['id']=_0x3e8859[_0x2704cc++];}),this['_processTape'](_0x3054a2),this['_setDistance'](_0x4a55f4,'isAdded'),this['_setDistance'](_0x3054a2,'isRemoved'),_0x5a78a8==_0x35f8a8&&this['_markMarkers'](_0x4a55f4,_0x56d28c),_0x4a55f4=this['_joinTapes'](_0x4a55f4,_0x3054a2),this['_refreshStartEndIndex'](_0x4a55f4),this['_setDistance'](_0x4a55f4,'isRemoved');}_0x4a55f4=_0x4a55f4['filter'](_0x16de09=>!(_0x16de09['isAdded']&&_0x16de09['isRemoved']));const _0x2a9b2d=new Map(_0x493e9d['model'][_0x3fb3bb]['deletions']['markers']),_0x1a087c=new Set(_0x56d28c['keys']());for(const _0x1ccf32 of _0x2a9b2d['keys']())_0x1a087c['delete'](_0x1ccf32);this['_markSuggestions'](_0x4a55f4,_0x1a087c),this['_fixObsoleteTags'](_0x4a55f4),_0x4a55f4=this['_removeMissingPairs'](_0x4a55f4),_0x4a55f4=this['_markMismatchedRemovedTags'](_0x4a55f4),_0x4a55f4=this['_removeUnsupportedChanges'](_0x4a55f4);const {root:_0x51dc18,changes:_0x405506}=this['_makeModelFromTape'](_0x4a55f4,_0x16ec6e,_0x3fb3bb,_0x184394);_0x2cb8bd['model'][_0x3fb3bb]=_0x51dc18;const _0x2bb156=_0x132c7a['get'](_0x3fb3bb);if(_0x2bb156){const _0x1232c3=new Ot({'author':_0x16ec6e['get'](_0x2bb156['userId']),'type':_0x2bb156['isAttached']?'add':'remove','data':{'isOnRoot':!0x0},'createdAt':new Date(),'rootName':_0x3fb3bb});_0x405506['unshift'](_0x1232c3),_0x2cb8bd['attributes'][_0x3fb3bb]['revisionHistoryAttachChange']=_0x1232c3['id'];}_0x2cb8bd['changes']=_0x2cb8bd['changes']['concat'](_0x405506);}return _0x2cb8bd;}['_markMarkers'](_0x3f5c98,_0x41246e){for(let _0x1aa510=0x0;_0x1aa510<_0x3f5c98['length'];_0x1aa510++)for(const [_0x1d7e83,_0x5ddab9]of _0x41246e)!_0x5ddab9['isCollapsed']&&_0x5ddab9['start']['isEqual'](_0x3f5c98[_0x1aa510]['previousPosition'])&&_0x3f5c98[_0x1aa510]['markersStart']['push'](_0x1d7e83),_0x5ddab9['end']['isEqual'](_0x3f5c98[_0x1aa510]['nextPosition'])&&_0x3f5c98[_0x1aa510]['markersEnd']['push'](_0x1d7e83);}['_joinTapes'](_0x3e0810,_0x296db0){let _0x5b41ac=[],_0x4498e4=0x0,_0x5a871d=0x0;for(;_0x4498e4<_0x3e0810['length']||_0x5a871d<_0x296db0['length'];){const _0x1e848a=_0x3e0810[_0x4498e4]||{},_0x55114e=_0x296db0[_0x5a871d]||{};if(_0x1e848a['id']==_0x55114e['id'])_0x4498e4++,_0x5a871d++,_0x5b41ac['push'](_0x1e848a);else{if(_0x55114e['isRemoved']&&_0x1e848a['isAdded']){const {commonTape:_0x109288,iEnd:_0x562618,jEnd:_0x128147}=this['_threeWayMerge'](_0x3e0810,_0x4498e4,_0x296db0,_0x5a871d);_0x5b41ac=_0x5b41ac['concat'](_0x109288),_0x4498e4=_0x562618,_0x5a871d=_0x128147;}else _0x55114e['isRemoved']?(_0x5a871d++,_0x5b41ac['push'](_0x55114e)):(_0x4498e4++,_0x5b41ac['push'](_0x1e848a));}}return _0x5b41ac;}_markSuggestions(_0xbd0a86,_0x381d0a){const _0x52e786=[];for(let _0x527c7d=0x0;_0x527c7d<_0xbd0a86['length'];_0x527c7d++){for(let _0x5bba4e=0x0;_0x5bba4e<_0xbd0a86[_0x527c7d]['markersStart']['length'];_0x5bba4e++){const _0x35b98a=_0xbd0a86[_0x527c7d]['markersStart'][_0x5bba4e];if(!_0x381d0a['has'](_0x35b98a))continue;const {group:_0x468038,type:_0x5d6419,authorId:_0x54f856}=_0x1382f3(_0x35b98a);'revision-suggestion'!=_0x468038||'insertion'!=_0x5d6419&&'deletion'!=_0x5d6419||(_0x52e786['unshift']({'type':_0x5d6419,'name':_0x35b98a,'userId':_0x54f856}),_0xbd0a86[_0x527c7d]['markersStart']['splice'](_0x5bba4e,0x1),_0x5bba4e--);}_0x3da60e(_0xbd0a86[_0x527c7d]);for(let _0x532dae=0x0;_0x532dae<_0xbd0a86[_0x527c7d]['markersEnd']['length'];_0x532dae++){const _0x22e1af=_0xbd0a86[_0x527c7d]['markersEnd'][_0x532dae];if(!_0x381d0a['has'](_0x22e1af))continue;const {group:_0x438859,type:_0x37c383}=_0x1382f3(_0x22e1af);if('revision-suggestion'!=_0x438859||'insertion'!=_0x37c383&&'deletion'!=_0x37c383)continue;_0xbd0a86[_0x527c7d]['markersEnd']['splice'](_0x532dae,0x1),_0x532dae--;const _0x341644=_0x52e786['findIndex'](_0x1e6924=>_0x1e6924['name']==_0x22e1af);_0x341644>-0x1&&_0x52e786['splice'](_0x341644,0x1);}}function _0x1382f3(_0x28ca77){const _0x2c83fc=_0x28ca77['split'](':');return{'group':_0x2c83fc[0x0],'type':_0x2c83fc[0x1],'subType':_0x2c83fc['length']>=0x5?_0x2c83fc[0x2]:null,'id':_0x2c83fc['length']<0x5?_0x2c83fc[0x2]:_0x2c83fc[0x3],'authorId':_0x2c83fc['length']<0x5?_0x2c83fc[0x3]:_0x2c83fc[0x4],'markerCount':0x6==_0x2c83fc['length']?_0x2c83fc[0x5]:null};}function _0x3da60e(_0x1069c4){for(let _0x2633ad=0x0;_0x2633ad<_0x52e786['length'];_0x2633ad++){if(_0x1069c4['isAdded']&&'insertion'==_0x52e786[_0x2633ad]['type']&&_0x1069c4['isAdded']['userId']==_0x52e786[_0x2633ad]['userId'])return _0x1069c4['isAddSuggestion']=_0x52e786[_0x2633ad],void delete _0x1069c4['isAdded'];if(!_0x1069c4['isAdded']&&!_0x1069c4['isRemoved']&&'deletion'==_0x52e786[_0x2633ad]['type'])return void(_0x1069c4['isRemoveSuggestion']=_0x52e786[_0x2633ad]);}}}_setDistance(_0x2b70bc,_0x158198){let _0x2b69d3=0x0,_0x58fea5=!0x1;const _0x25df28=new Map();for(const _0x621d1b of _0x2b70bc)_0x621d1b[_0x158198]?_0x58fea5&&(_0x2b69d3++,_0x58fea5=!0x1):(_0x2b69d3++,_0x58fea5=!0x0),_0x25df28['set'](_0x621d1b['id'],_0x2b69d3);for(let _0x3b9277=0x0;_0x3b9277<_0x2b70bc['length'];_0x3b9277++){if('isRemoved'==_0x158198&&_0x2b70bc[_0x3b9277]['isAdded']||'isAdded'==_0x158198&&_0x2b70bc[_0x3b9277]['isRemoved'])continue;if('text'==_0x2b70bc[_0x3b9277]['type']){_0x2b70bc[_0x3b9277]['distance']=0x0;continue;}const _0x16235c=_0x25df28['get'](_0x2b70bc[_0x3b9277]['pairId']),_0x443c73=_0x25df28['get'](_0x2b70bc[_0x3b9277]['id']);_0x2b70bc[_0x3b9277]['distance']=_0x16235c-_0x443c73;}}_getRevisionsRange(_0x32f4ea,_0x4c861f,_0x17c24e=!0x1){const _0x1671b4=[];let _0x263e59=this['repository']['getIndex'](_0x32f4ea),_0x33a53d=this['repository']['getIndex'](_0x4c861f);for(-0x1==_0x33a53d&&(_0x33a53d=this['repository']['_revisions']['length'],_0x17c24e=!0x1);_0x263e59<_0x33a53d;)_0x1671b4['push'](this['repository']['getRevision'](_0x263e59)),_0x263e59++;return _0x17c24e&&_0x1671b4['push'](this['repository']['getRevision'](_0x263e59)),_0x1671b4;}_threeWayMerge(_0x451d88,_0xd6e8c8,_0x31d0b0,_0x183d61){const _0x7278a9=this['editor']['model']['schema'];let _0x2dd346=_0xd6e8c8;for(;_0x451d88[_0x2dd346]&&_0x451d88[_0x2dd346]['isAdded'];)_0x2dd346++;let _0x342d8c=_0x183d61;for(;_0x31d0b0[_0x342d8c]&&_0x31d0b0[_0x342d8c]['isRemoved'];)_0x342d8c++;_0x5474f4(_0x451d88,_0xd6e8c8,_0x2dd346),_0x5474f4(_0x31d0b0,_0x183d61,_0x342d8c);const _0x16238c=_0x31d0b0['slice'](_0x183d61,_0x342d8c)['concat'](_0x451d88['slice'](_0xd6e8c8,_0x2dd346));return _0x16238c['sort']((_0xd71230,_0x3b26ce)=>_0xd71230['side']!=_0x3b26ce['side']?_0xd71230['side']-_0x3b26ce['side']:_0xd71230['level']!=_0x3b26ce['level']?_0xd71230['level']-_0x3b26ce['level']:_0xd71230['distance']!=_0x3b26ce['distance']?_0x3b26ce['distance']-_0xd71230['distance']:!!_0xd71230['isAdded']!=!!_0x3b26ce['isAdded']?-0x1==_0xd71230['side']||0x0==_0xd71230['side']?_0xd71230['isAdded']?-0x1:0x1:_0xd71230['isAdded']?0x1:-0x1:_0xd71230['index']-_0x3b26ce['index']),{'commonTape':_0x16238c,'iEnd':_0x2dd346,'jEnd':_0x342d8c};function _0x5474f4(_0x1a4750,_0x5498d0,_0x436321){let _0x5a1cd5=-0x1,_0xb8d8ec=Number['POSITIVE_INFINITY'],_0x3028f1=!0x0;for(let _0x477071=_0x5498d0;_0x477071<_0x436321;_0x477071++)if(_0x7278a9['isInline'](_0x1a4750[_0x477071]['item'])||(_0x3028f1=!0x1),_0x1a4750[_0x477071]['item']['startIndex']<_0x5498d0&&(_0x5a1cd5=_0x477071),_0x1a4750[_0x477071]['item']['endIndex']>=_0x436321){_0xb8d8ec=_0x477071;break;}_0x3028f1&&(_0x5a1cd5=_0x436321-0x1);for(let _0x438197=_0x5498d0;_0x438197<_0x436321;_0x438197++)_0x1a4750[_0x438197]['side']=_0x438197<=_0x5a1cd5?-0x1:_0x438197<_0xb8d8ec?0x0:0x1,_0x1a4750[_0x438197]['index']=_0x438197;let _0x333e56=0x0;for(let _0xabf3db=_0x5498d0;_0xabf3db<=_0x5a1cd5;_0xabf3db++)0x0==_0x1a4750[_0xabf3db]['distance']?_0x1a4750[_0xabf3db]['level']=_0x333e56:(_0x333e56++,_0x1a4750[_0xabf3db]['level']=_0x333e56,_0x333e56++);for(let _0x3a15cb=_0x5498d0;_0x3a15cb<_0x436321;_0x3a15cb++)0x0==_0x1a4750[_0x3a15cb]['side']&&(_0x1a4750[_0x3a15cb]['level']=_0x333e56);_0x333e56=0x0;for(let _0x21a6aa=_0x436321-0x1;_0x21a6aa>=_0xb8d8ec;_0x21a6aa--)0x0==_0x1a4750[_0x21a6aa]['distance']?_0x1a4750[_0x21a6aa]['level']=_0x333e56:(_0x333e56--,_0x1a4750[_0x21a6aa]['level']=_0x333e56,_0x333e56--);}}_fixObsoleteTags(_0xca9d8c){const _0x22d096=new Map(),_0x1609fd=this['editor']['model']['schema'];for(let _0x3699f6=0x1;_0x3699f6<_0xca9d8c['length'];_0x3699f6++){let _0x2824b3,_0x34ef6c,_0x576e54;const _0x59daf0=_0xca9d8c[_0x3699f6],_0x426c81=_0xca9d8c[_0x3699f6-0x1];if('text'==_0x59daf0['type'])continue;if(_0x59daf0['type']!=_0x426c81['type'])continue;if(!_0x1609fd['isBlock'](_0x426c81['item'])||_0x1609fd['isLimit'](_0x426c81['item']))continue;if(!_0x1609fd['isBlock'](_0x59daf0['item'])||_0x1609fd['isLimit'](_0x59daf0['item']))continue;if((_0xca9d8c[_0x3699f6]['isAdded']||_0xca9d8c[_0x3699f6]['isAddSuggestion'])&&_0xca9d8c[_0x3699f6-0x1]['isRemoved'])_0x2824b3=_0xca9d8c[_0x3699f6],_0x34ef6c=_0xca9d8c[_0x3699f6-0x1],_0x576e54=_0x3699f6-0x1;else{if(!_0xca9d8c[_0x3699f6]['isRemoved']||!_0xca9d8c[_0x3699f6-0x1]['isAdded']&&!_0xca9d8c[_0x3699f6-0x1]['isAddSuggestion'])continue;_0x2824b3=_0xca9d8c[_0x3699f6-0x1],_0x34ef6c=_0xca9d8c[_0x3699f6],_0x576e54=_0x3699f6;}const _0x4a6448=_0x2824b3['level']==_0x34ef6c['level'],_0x5e3fcb=Math['abs'](_0x2824b3['level'])<Math['abs'](_0x34ef6c['level'])&&0x0==_0x34ef6c['distance'];(_0x4a6448||_0x5e3fcb)&&(_0x22d096['set'](_0x34ef6c['id'],_0x2824b3['id']),_0xca9d8c['splice'](_0x576e54,0x1),_0x3699f6--,_0x2824b3['isAdded']=!0x1);}for(let _0xaea5e2=0x0;_0xaea5e2<_0xca9d8c['length'];_0xaea5e2++)_0x22d096['has'](_0xca9d8c[_0xaea5e2]['pairId'])&&(_0xca9d8c[_0xaea5e2]['pairId']=_0x22d096['get'](_0xca9d8c[_0xaea5e2]['pairId']));}['_removeMissingPairs'](_0xbd6cb3){const _0x498043=new Set(_0xbd6cb3['map'](_0x5a02da=>_0x5a02da['id']));for(let _0x42ecd8=0x0;_0x42ecd8<_0xbd6cb3['length'];_0x42ecd8++)_0x498043['has'](_0xbd6cb3[_0x42ecd8]['pairId'])||0x0==_0xbd6cb3[_0x42ecd8]['distance']||(_0xbd6cb3[_0x42ecd8]['isIncorrect']=!0x0);return _0xbd6cb3['filter'](_0x581ebd=>!_0x581ebd['isIncorrect']);}_markMismatchedRemovedTags(_0x1ecff1){const _0x4a999b=new Set();for(let _0x13a2c5=0x0;_0x13a2c5<_0x1ecff1['length'];_0x13a2c5++){if(_0x4a999b['has'](_0x1ecff1[_0x13a2c5]['id'])&&_0x1ecff1[_0x13a2c5]['isRemoved']&&(_0x1ecff1[_0x13a2c5]['isIncorrect']=!0x0),_0x1ecff1[_0x13a2c5]['isIncorrect'])continue;if(0x0==_0x1ecff1[_0x13a2c5]['distance'])continue;if('elementStart'!=_0x1ecff1[_0x13a2c5]['type'])continue;if(null==_0x1ecff1[_0x13a2c5]['pairId'])continue;let _0x2b6c08=_0x13a2c5+0x1,_0xc11425=0x0;for(;_0x1ecff1[_0x2b6c08]['id']!=_0x1ecff1[_0x13a2c5]['pairId'];)'elementStart'==_0x1ecff1[_0x2b6c08]['type']?_0xc11425++:'elementEnd'==_0x1ecff1[_0x2b6c08]['type']&&_0xc11425--,_0x2b6c08++;if(0x0!=_0xc11425){if(_0x1ecff1[_0x13a2c5]['isRemoved'])_0x1ecff1[_0x13a2c5]['isIncorrect']=!0x0;else{for(;_0x2b6c08!=_0x13a2c5;)_0x1ecff1[_0x2b6c08]['isRemoved']&&0x0!=_0x1ecff1[_0x2b6c08]['distance']&&(_0x1ecff1[_0x2b6c08]['isIncorrect']=!0x0,_0x4a999b['add'](_0x1ecff1[_0x2b6c08]['pairId'])),_0x2b6c08--;}}}return _0x1ecff1['filter'](_0x95de1d=>!_0x95de1d['isIncorrect']);}_removeUnsupportedChanges(_0x174ee8){const _0x5ad89d=this['editor']['model']['schema'];for(let _0x575eaa=0x0;_0x575eaa<_0x174ee8['length'];_0x575eaa++){if(!(_0x174ee8[_0x575eaa]['isAdded']||_0x174ee8[_0x575eaa]['isAddSuggestion']||_0x174ee8[_0x575eaa]['isRemoved']||_0x174ee8[_0x575eaa]['isRemoveSuggestion']))continue;if(0x0==_0x174ee8[_0x575eaa]['distance'])continue;const _0x119aee=_0x174ee8[_0x575eaa]['item'];_0x5ad89d['isBlock'](_0x119aee)||_0x5ad89d['isLimit'](_0x119aee)||(_0x174ee8[_0x575eaa]['isAdded']&&delete _0x174ee8[_0x575eaa]['isAdded'],_0x174ee8[_0x575eaa]['isAddSuggestion']&&delete _0x174ee8[_0x575eaa]['isAddSuggestion'],_0x174ee8[_0x575eaa]['isRemoveSuggestion']&&delete _0x174ee8[_0x575eaa]['isRemoveSuggestion'],_0x174ee8[_0x575eaa]['isRemoved']&&(_0x174ee8[_0x575eaa]['isIncorrect']=!0x0));}return _0x174ee8['filter'](_0x262e8d=>!_0x262e8d['isIncorrect']);}['_makeModelFromTape'](_0x476bc3,_0x4c69d6,_0x541225,_0x10c857){const _0x10b002=new _0x596b32(),_0x18d2bc=[],_0x578e60=new Map(),_0x5a0f98=this['editor']['model'],_0x3af80a=_0x5a0f98['schema'],_0xcfe0b1=[_0x10b002],_0x38bc4c={},_0x36a203={'isAdded':[],'isRemoved':[],'isAddSuggestion':[],'isRemoveSuggestion':[]};_0x10b002['name']=_0x10c857;let _0x47e5bf=null;const _0x5e7592=[0x0];for(let _0x2f0786=0x0;_0x2f0786<_0x476bc3['length'];_0x2f0786++)if('elementStart'===_0x476bc3[_0x2f0786]['type']){_0x476bc3[_0x2f0786]['previousPosition']=_0x5a0f98['createPositionFromPath'](_0x10b002,_0x5e7592);const _0x211730=new _0x474a71(_0x476bc3[_0x2f0786]['item']['name'],_0x476bc3[_0x2f0786]['item']['getAttributes']());_0xcfe0b1[0x0]['_appendChild'](_0x211730),_0x5e7592['push'](0x0),_0xcfe0b1['unshift'](_0x211730),_0x476bc3[_0x2f0786]['nextPosition']=_0x5a0f98['createPositionFromPath'](_0x10b002,_0x5e7592);}else'elementEnd'===_0x476bc3[_0x2f0786]['type']?(_0xcfe0b1['shift'](),_0x476bc3[_0x2f0786]['previousPosition']=_0x5a0f98['createPositionFromPath'](_0x10b002,_0x5e7592),_0x5e7592['pop'](),_0x5e7592[_0x5e7592['length']-0x1]++,_0x476bc3[_0x2f0786]['nextPosition']=_0x5a0f98['createPositionFromPath'](_0x10b002,_0x5e7592)):(_0x476bc3[_0x2f0786]['previousPosition']=_0x5a0f98['createPositionFromPath'](_0x10b002,_0x5e7592),_0x47e5bf?_0x47e5bf['_data']+=_0x476bc3[_0x2f0786]['item']['data']:_0x47e5bf=new _0x2458d3(_0x476bc3[_0x2f0786]['item']['data'],_0x476bc3[_0x2f0786]['item']['getAttributes']()),_0x476bc3[_0x2f0786+0x1]&&'text'===_0x476bc3[_0x2f0786+0x1]['type']&&_0x115ce2(_0x47e5bf,_0x476bc3[_0x2f0786+0x1]['item'])||(_0xcfe0b1[0x0]['_appendChild'](_0x47e5bf),_0x47e5bf=null),_0x5e7592[_0x5e7592['length']-0x1]+=_0x476bc3[_0x2f0786]['item']['offsetSize'],_0x476bc3[_0x2f0786]['nextPosition']=_0x5a0f98['createPositionFromPath'](_0x10b002,_0x5e7592));for(let _0x29137c=0x0;_0x29137c<_0x476bc3['length'];_0x29137c++){const _0x502a83=_0x476bc3[_0x29137c]['previousPosition'],_0x51f1ae=_0x476bc3[_0x29137c]['nextPosition'];for(const _0x1b7537 of _0x476bc3[_0x29137c]['markersStart'])_0x578e60['set'](_0x1b7537,{'start':_0x502a83,'end':null});_0x4166aa('isRemoveSuggestion',_0x29137c,_0x502a83,_0x51f1ae),_0x4166aa('isAddSuggestion',_0x29137c,_0x502a83,_0x51f1ae),_0x4166aa('isRemoved',_0x29137c,_0x502a83,_0x51f1ae),_0x4166aa('isAdded',_0x29137c,_0x502a83,_0x51f1ae);for(const _0x1ea5f7 of _0x476bc3[_0x29137c]['markersEnd']){const _0x3b917f=_0x578e60['get'](_0x1ea5f7);_0x3b917f?_0x3b917f['end']=_0x51f1ae:_0x578e60['set'](_0x1ea5f7,{'start':_0x51f1ae,'end':_0x51f1ae});}}for(const [_0x24b1e5,_0x4d2846]of _0x578e60){const _0x280ade=this['editor']['model']['createRange'](_0x4d2846['start'],_0x4d2846['end']);_0x10b002['markers']['set'](_0x24b1e5,_0x280ade);}return _0x18d2bc['sort']((_0x3aa64b,_0x4df27b)=>{const _0x2f6f28=_0x10b002['markers']['get']('revision:'+_0x3aa64b['id']),_0x15e495=_0x10b002['markers']['get']('revision:'+_0x4df27b['id']);return _0x2f6f28['start']['isBefore'](_0x15e495['start'])?-0x1:_0x2f6f28['start']['isAfter'](_0x15e495['start'])?0x1:_0x2f6f28['end']['isBefore'](_0x15e495['end'])?-0x1:_0x2f6f28['end']['isAfter'](_0x15e495['end'])?0x1:'add'===_0x3aa64b['type']?-0x1:0x1;}),{'root':_0x10b002,'changes':_0x18d2bc};function _0x4166aa(_0x2a09bb,_0x33e92e,_0x55dbf9,_0xa5e720){const _0x3918dd=!!_0x476bc3[_0x33e92e][_0x2a09bb],_0x47edb8=_0x3918dd?_0x476bc3[_0x33e92e][_0x2a09bb]['userId']:null,_0x5ae72b=_0x33e92e===_0x476bc3['length']-0x1,_0x50eebe=_0x36a203[_0x2a09bb][0x0],_0x2a0b6a=_0x3af80a['isObject'](_0x476bc3[_0x33e92e]['item']);!_0x38bc4c[_0x2a09bb]&&_0x3918dd?_0x38bc4c[_0x2a09bb]={'start':_0x55dbf9,'tapeItem':_0x476bc3[_0x33e92e],'userId':_0x47edb8,'type':_0x2a09bb}:_0x38bc4c[_0x2a09bb]&&!_0x3918dd?(_0x38bc4c[_0x2a09bb]['end']=_0x55dbf9,_0x47de40(_0x38bc4c[_0x2a09bb]),_0x38bc4c[_0x2a09bb]=null):_0x38bc4c[_0x2a09bb]&&_0x3918dd&&_0x38bc4c[_0x2a09bb]['userId']!==_0x47edb8&&(_0x38bc4c[_0x2a09bb]['end']=_0x55dbf9,_0x50eebe&&_0x50eebe['userId']===_0x38bc4c[_0x2a09bb]['userId']||_0x47de40(_0x38bc4c[_0x2a09bb]),_0x38bc4c[_0x2a09bb]={'start':_0x55dbf9,'tapeItem':_0x476bc3[_0x33e92e],'userId':_0x47edb8,'type':_0x2a09bb}),_0x38bc4c[_0x2a09bb]&&_0x2a0b6a&&('elementStart'!==_0x476bc3[_0x33e92e]['type']||_0x50eebe&&_0x50eebe['userId']===_0x47edb8||_0x36a203[_0x2a09bb]['unshift']({'userId':_0x47edb8,'object':_0x476bc3[_0x33e92e]['item'],'change':_0x38bc4c[_0x2a09bb]}),'elementEnd'===_0x476bc3[_0x33e92e]['type']&&_0x50eebe&&_0x50eebe['object']===_0x476bc3[_0x33e92e]['item']&&(_0x36a203[_0x2a09bb]['shift'](),_0x38bc4c[_0x2a09bb]=_0x50eebe['change'])),_0x38bc4c[_0x2a09bb]&&_0x5ae72b&&(_0x38bc4c[_0x2a09bb]['end']=_0xa5e720,_0x47de40(_0x38bc4c[_0x2a09bb]),_0x38bc4c[_0x2a09bb]=null);}function _0x47de40({start:_0x2825bd,end:_0x30a38a,tapeItem:_0x1013a3,userId:_0x835178,type:_0x2aedd0}){const _0x371aa1=_0x1013a3['item'],_0x319aff=_0x5a0f98['schema']['isBlock'](_0x371aa1)&&!_0x5a0f98['schema']['isLimit'](_0x371aa1),_0xcc550a=_0x2825bd['nodeAfter']==_0x30a38a['parent']&&_0x30a38a['isAtStart'];if(_0x319aff&&_0xcc550a)return;const _0x4cd927=_0x5a0f98['createRange'](_0x2825bd,_0x30a38a),_0x10693d=new Ot({'author':_0x4c69d6['get'](_0x835178),'type':'isAdded'==_0x2aedd0||'isAddSuggestion'==_0x2aedd0?'add':'remove','data':{'isSuggestion':'isAddSuggestion'==_0x2aedd0||'isRemoveSuggestion'==_0x2aedd0},'createdAt':new Date(),'rootName':_0x541225});_0x18d2bc['push'](_0x10693d),_0x10b002['markers']['set']('revision:'+_0x10693d['id'],_0x4cd927);}function _0x115ce2(_0x4d051b,_0x54c456){const _0x3dfe7e=_0x4d051b['getAttributes'](),_0xa46d8e=_0x54c456['getAttributes']();for(const _0x3aa86b of _0x3dfe7e){if(_0x3aa86b[0x1]!==_0x54c456['getAttribute'](_0x3aa86b[0x0]))return!0x1;_0xa46d8e['next']();}return _0xa46d8e['next']()['done'];}}_setConversion(){this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'revision'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision','view':_0x483fac=>{const _0x4d0886=_0x483fac['markerName']['split'](':')[0x1],_0x4460a5=this['_getChangeFromId'](_0x4d0886);if(!_0x4460a5)return null;const _0xe86deb='add'==_0x4460a5['type']?'insertion':'deletion',_0x22c41a=['ck-suggestion-marker','ck-suggestion-marker-'+_0xe86deb];return _0x4460a5['data']['isSuggestion']&&_0x22c41a['push']('ck-suggestion-marker-'+_0xe86deb+'-new'),this['activeChange']==_0x4460a5&&_0x22c41a['push']('ck-suggestion-marker--active'),{'classes':_0x22c41a,'attributes':{'data-change-id':_0x4d0886}};}}),this['editor']['conversion']['for']('upcast')['add'](_0x1ea721=>{_0x1ea721['on']('element:pre',(_0x3d30d3,_0x255774,_0x5944bc)=>{const _0x10427a=_0x255774['viewItem']['getChild'](0x0);if(!_0x10427a||!_0x10427a['is']('element','code'))return;if(!_0x5944bc['consumable']['consume'](_0x10427a,{'attributes':['vid_start','vid_end']}))return;const _0x4e656b=_0x255774['modelRange']['start']['nodeAfter'];_0x5944bc['writer']['setAttribute']('vid_start',_0x10427a['getAttribute']('vid_start'),_0x4e656b),_0x5944bc['writer']['setAttribute']('vid_end',_0x10427a['getAttribute']('vid_end'),_0x4e656b);},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['add'](_0x167852=>{_0x167852['on']('element',(_0x20553a,_0x42eb70,_0x3e694c)=>{if(!_0x3e694c['consumable']['consume'](_0x42eb70['viewItem'],{'attributes':['vid_start','vid_end']}))return;if(_0x42eb70['modelRange']['isCollapsed'])return;const _0x72da6=_0x42eb70['modelRange']['start']['nodeAfter'];_0x72da6['hasAttribute']('vid_start')||_0x72da6['hasAttribute']('vid')||(_0x3e694c['writer']['setAttribute']('vid_start',_0x42eb70['viewItem']['getAttribute']('vid_start'),_0x72da6),_0x3e694c['writer']['setAttribute']('vid_end',_0x42eb70['viewItem']['getAttribute']('vid_end'),_0x72da6));},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['elementToAttribute']({'view':{'name':'span','attributes':{'vid':!0x0}},'model':{'key':'vid','value':_0x2afea6=>_0x2afea6['getAttribute']('vid')}}),this['editor']['model']['schema']['on']('checkAttribute',(_0x36dfc4,[,_0x53cead])=>{['vid_start','vid_end','vid']['includes'](_0x53cead)&&(_0x36dfc4['return']=!0x0,_0x36dfc4['stop']());},{'priority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x5070f3=>{_0x5070f3['on']('attribute:vid',(_0x2e83cf,_0x116e06,_0x4f9733)=>{if('\x20'!=_0x116e06['item']['data']||_0x116e06['item']['parent']['maxOffset']>0x1)return;if(!_0x4f9733['consumable']['consume'](_0x116e06['item'],_0x2e83cf['name']))return;const _0x890993=_0x4f9733['writer'],_0x23be1b=_0x4f9733['mapper']['toViewRange'](_0x116e06['range']);_0x890993['wrap'](_0x23be1b,_0x890993['createAttributeElement']('span'));});}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',function(_0x5254bb){const _0x1cd574=_0x5254bb['plugins']['get']('RevisionViewer');return(_0x38cf94,_0x5b8df7,_0x35de19)=>{const _0xfc80c8=_0x5b8df7['markerName']['split'](':')[0x1],_0x3937e8=_0x1cd574['_getChangeFromId'](_0xfc80c8);if(!_0x3937e8)return null;const _0x57c103='add'==_0x3937e8['type']?'split':'merge';if(!_0x35de19['consumable']['test'](_0x5b8df7['markerRange'],_0x38cf94['name']))return;const _0x295452=_0x5b8df7['markerRange']['getWalker'](),_0xb2fe2e=_0x5b8df7['markerRange']['start'],_0x4b52f6=_0x5254bb['model']['schema'];let _0x24f41c=null,_0x659a1b=null,_0x3e8ec3=!0x1,_0x412098=!0x1;for(const _0x5b4595 of _0x295452){const _0x5ebca9=_0x5b4595['item'];_0x3e8ec3=_0x3e8ec3||_0x4b52f6['isContent'](_0x5ebca9);const _0x7f618b=_0x35de19['mapper']['toViewElement'](_0x5ebca9);if(_0x7f618b&&_0x7f618b['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x5b4595['type']&&(_0x4b52f6['isBlock'](_0x5ebca9)&&!_0x4b52f6['isLimit'](_0x5ebca9)&&(_0x5ebca9['nextSibling']||_0xb2fe2e['isAtEnd']?_0x24f41c&&_0x24f41c['parent']==_0x5ebca9||(_0x24f41c=_0x5ebca9,_0xaed39a(_0x5b4595['previousPosition']),_0x412098=!0x0):_0x659a1b=_0x659a1b||_0x5b4595['previousPosition']));}function _0xaed39a(_0x33171a){const _0x1b939b=_0x35de19['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x57c103}),_0x4af3b2=_0x35de19['mapper']['toViewPosition'](_0x33171a);_0x3937e8['data']['isSuggestion']&&_0x35de19['writer']['addClass']('ck-suggestion-marker-'+_0x57c103+'-new',_0x1b939b),_0x1cd574['activeChange']==_0x3937e8&&_0x35de19['writer']['addClass']('ck-suggestion-marker--active',_0x1b939b),_0x35de19['writer']['insert'](_0x4af3b2,_0x1b939b),_0x35de19['mapper']['bindElementToMarker'](_0x1b939b,_0x5b8df7['markerName']);}_0x3e8ec3||_0x412098||!_0x659a1b||_0xaed39a(_0x659a1b);};}(this['editor']),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision',(_0xc2befd,_0x23dc0c,_0x922df7)=>{const _0x1d8ef9=_0x922df7['mapper']['markerNameToElements'](_0x23dc0c['markerName']);if(_0x1d8ef9){for(const _0xcacd40 of _0x1d8ef9)(_0xcacd40['hasClass']('ck-suggestion-marker-split')||_0xcacd40['hasClass']('ck-suggestion-marker-merge'))&&(_0x922df7['mapper']['unbindElementFromMarkerName'](_0xcacd40,_0x23dc0c['markerName']),_0x922df7['writer']['remove'](_0xcacd40));}},{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',(_0x36b051,_0x57aae2,_0x5310ae)=>{const _0x596c6c=_0x57aae2['markerName']['split'](':')[0x1],_0xb41b4c=this['_getChangeFromId'](_0x596c6c);if(!_0xb41b4c)return null;const _0xec184e='add'==_0xb41b4c['type']?'split':'merge';if(_0x5310ae['consumable']['test'](_0x57aae2['markerRange'],_0x36b051['name']))for(const _0x10a0c1 of _0x57aae2['markerRange']['getItems']()){if(!_0x10a0c1['is']('element','softBreak'))continue;const _0x3fe32b=_0x5310ae['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0xec184e}),_0x18d72b=_0x5310ae['mapper']['toViewPosition'](this['editor']['model']['createPositionBefore'](_0x10a0c1));_0xb41b4c['data']['isSuggestion']&&_0x5310ae['writer']['addClass']('ck-suggestion-marker-'+_0xec184e+'-new',_0x3fe32b),this['activeChange']==_0xb41b4c&&_0x5310ae['writer']['addClass']('ck-suggestion-marker--active',_0x3fe32b),_0x5310ae['writer']['insert'](_0x18d72b,_0x3fe32b),_0x5310ae['mapper']['bindElementToMarker'](_0x3fe32b,_0x57aae2['markerName']);}},{'priority':'high'}),this['editor']['model']['document']['on']('change',()=>{this['editor']['editing']['view']['change'](_0x303ee1=>{for(const _0x3daf49 of this['editor']['model']['document']['getRootNames']()){const _0x48988e=this['editor']['model']['document']['getRoot'](_0x3daf49),_0x3bdf9e=this['editor']['editing']['view']['document']['getRoot'](_0x3daf49);if(_0x3bdf9e){const _0x734335=_0x48988e['getAttribute']('revisionHistoryAttachChange');if(_0x303ee1['removeAttribute']('data-change-id',_0x3bdf9e),_0x303ee1['removeClass']('ck-revision-history-root-add',_0x3bdf9e),_0x303ee1['removeClass']('ck-revision-history-root-remove',_0x3bdf9e),_0x303ee1['removeClass']('ck-revision-history-root--active',_0x3bdf9e),_0x734335){const _0x4a8cbc=this['_getChangeFromId'](_0x734335);if(!_0x4a8cbc)return null;_0x303ee1['setAttribute']('data-change-id',_0x734335,_0x3bdf9e),_0x303ee1['addClass']('ck-revision-history-root-'+_0x4a8cbc['type'],_0x3bdf9e),this['activeChange']==_0x4a8cbc&&_0x303ee1['addClass']('ck-revision-history-root--active',_0x3bdf9e);}}}});}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'comment','model':_0x280763=>'revision-comment:'+_0x280763,'converterPriority':'highest'}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'suggestion','model':_0x36d429=>'revision-suggestion:'+_0x36d429,'converterPriority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision-suggestion','view':_0x13d711=>({'name':'suggestion:'+_0x13d711,'group':'revision-suggestion'}),'converterPriority':'highest'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-suggestion','view':_0x56b56d=>{const _0x692433=_0x56b56d['markerName']['split'](':')[0x1];return'insertion'!=_0x692433&&'deletion'!=_0x692433?null:{'classes':['ck-suggestion-preview-marker','ck-suggestion-preview-marker-'+_0x692433]};}}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:deletion',Vt(this['editor'],'merge'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:insertion',Vt(this['editor'],'split'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision-suggestion',(_0x473246,_0x59cfed,_0x3bdb7a)=>{const _0x357954=_0x3bdb7a['mapper']['markerNameToElements'](_0x59cfed['markerName']);if(_0x357954){for(const _0x1b3811 of _0x357954)_0x1b3811['is']('uiElement')&&(_0x3bdb7a['mapper']['unbindElementFromMarkerName'](_0x1b3811,_0x59cfed['markerName']),_0x3bdb7a['writer']['remove'](_0x1b3811));}},{'priority':'high'});}_getChangeFromId(_0x22dfc9){return this['_changeIdToChange']['get'](_0x22dfc9);}_getViewForChange(_0x4ab577){return this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=new Nt(this['editor']['locale'],_0x4ab577),this['_changeView'];}_initInteractions(){this['editor']['model']['document']['selection']['observeMarkers']('revision'),this['on']('change:activeView',(_0x55070b,_0x2247e5,_0x35f3b8,_0x162bcb)=>{_0x162bcb&&this['_balloon']['remove'](_0x162bcb),_0x35f3b8&&(this['_balloon']['add']({'view':_0x35f3b8,'stackId':'revisionHistoryLabel','position':{'target':()=>{const _0x319680=this['editor']['editing'],_0x21c3d8=this['_getChangeFromId'](_0x35f3b8['changeId']);let _0x25fd4f;if(_0x21c3d8['data']['isOnRoot']){const _0x6468aa=_0x319680['view']['getDomRoot'](_0x21c3d8['rootName']);_0x25fd4f=Array['from'](_0x6468aa['getClientRects']());}else{const _0x25c838=this['editor']['model']['markers']['get']('revision:'+_0x35f3b8['changeId']);_0x25fd4f=Array['from'](_0x319680['mapper']['markerNameToElements'](_0x25c838['name']))['map'](_0x3152e7=>_0x319680['view']['domConverter']['mapViewToDom'](_0x3152e7))['map'](_0xeb87d4=>Array['from'](_0xeb87d4['getClientRects']()))['flat']();}return this['_activeViewTarget']&&_0x25fd4f['find'](_0x4f2979=>_0x4f2979['top']-0x3<=this['_activeViewTarget']['y']&&_0x4f2979['bottom']+0x3>=this['_activeViewTarget']['y']&&_0x4f2979['left']-0x3<=this['_activeViewTarget']['x']&&_0x4f2979['right']+0x3>=this['_activeViewTarget']['x'])||_0x25fd4f[0x0];}}}),this['_balloon']['showStack']('revisionHistoryLabel'));}),this['on']('change:activeChange',(_0x19233b,_0x904f9e,_0x4ddc66,_0x3ad10a)=>{this['activeView']=_0x4ddc66?this['_getViewForChange'](_0x4ddc66):null,this['editor']['model']['change'](()=>{const _0x57cfe1=this['editor']['editing'];_0x3ad10a&&(_0x3ad10a['data']['isOnRoot']?_0x57cfe1['view']['change'](_0x4aaacb=>{_0x4aaacb['removeClass']('ck-revision-history-root--active',_0x57cfe1['view']['document']['getRoot'](_0x3ad10a['rootName']));}):_0x57cfe1['reconvertMarker']('revision:'+_0x3ad10a['id'])),_0x4ddc66&&(_0x4ddc66['data']['isOnRoot']?_0x57cfe1['view']['change'](_0x1d906b=>{_0x1d906b['addClass']('ck-revision-history-root--active',_0x57cfe1['view']['document']['getRoot'](_0x4ddc66['rootName']));}):_0x57cfe1['reconvertMarker']('revision:'+_0x4ddc66['id']));});}),this['listenTo'](this['editor']['editing']['view']['document'],'mouseover',(_0x3bc49b,_0x612238)=>{if(this['activeChange'])return;const _0x22982e=this['_findChangeIdFromDomTarget'](_0x612238['target']),_0x37d54d=this['_changeIdToChange']['get'](_0x22982e);_0x37d54d?(this['_activeViewTarget']={'x':_0x612238['domEvent']['x'],'y':_0x612238['domEvent']['y']},this['activeView']=this['_getViewForChange'](_0x37d54d)):(this['_activeViewTarget']=null,this['activeView']=null);}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',(_0x588b37,_0x58fa18)=>{const _0x10d529=this['_findChangeIdFromDomTarget'](_0x58fa18['target']),_0x4e135e=this['_changeIdToChange']['get'](_0x10d529);_0x4e135e?(this['_activeViewTarget']={'x':_0x58fa18['domEvent']['x'],'y':_0x58fa18['domEvent']['y']},_0x4e135e===this['activeChange']?this['_balloon']['updatePosition']():this['activeChange']=_0x4e135e):(this['_activeViewTarget']=null,this['activeChange']=null);});}_findChangeIdFromDomTarget(_0x29bb39){do{const _0x2ad7fd=_0x29bb39['getAttribute']('data-change-id');if(_0x2ad7fd)return _0x2ad7fd;_0x29bb39=_0x29bb39['parent'];}while(_0x29bb39);return null;}['_cleanMarkers'](){this['editor']['model']['change'](_0x6b852a=>{for(const _0x209ee2 of this['editor']['model']['markers'])_0x6b852a['removeMarker'](_0x209ee2);});}};function Vt(_0x4fdb79,_0x5667ff){return(_0x21e1cd,_0xb9af0a,_0x2709d1)=>{if(!_0x2709d1['consumable']['test'](_0xb9af0a['markerRange'],_0x21e1cd['name']))return;const _0x1bb6ce=_0xb9af0a['markerRange']['getWalker'](),_0x46b755=_0xb9af0a['markerRange']['start'],_0x220040=_0x4fdb79['model']['schema'];let _0x1e1054=null,_0x1c6269=null,_0x588fb7=!0x1,_0x20f179=!0x1;for(const _0x1948bf of _0x1bb6ce){const _0x4a45b0=_0x1948bf['item'];_0x588fb7=_0x588fb7||_0x220040['isContent'](_0x4a45b0);const _0x15d7a6=_0x2709d1['mapper']['toViewElement'](_0x4a45b0);if(_0x15d7a6&&_0x15d7a6['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x1948bf['type']&&(_0x220040['isBlock'](_0x4a45b0)&&!_0x220040['isLimit'](_0x4a45b0)&&(_0x4a45b0['nextSibling']||_0x46b755['isAtEnd']?_0x1e1054&&_0x1e1054['parent']==_0x4a45b0||(_0x1e1054=_0x4a45b0,_0x4ce214(_0x1948bf['previousPosition']),_0x20f179=!0x0):_0x1c6269=_0x1c6269||_0x1948bf['previousPosition']));}function _0x4ce214(_0x407e3d){const _0x3a5a54=_0x2709d1['mapper']['toViewPosition'](_0x407e3d),_0x2dd0f8=_0x2709d1['writer']['createUIElement']('span',{'class':'ck-suggestion-preview-marker-'+_0x5667ff});_0x2709d1['writer']['insert'](_0x3a5a54,_0x2dd0f8),_0x2709d1['mapper']['bindElementToMarker'](_0x2dd0f8,_0xb9af0a['markerName']);}_0x588fb7||_0x20f179||!_0x1c6269||_0x4ce214(_0x1c6269);};}var Dt=class extends _0x3fb756{constructor(_0x2370c5){super(_0x2370c5);const _0x717ad7=_0x2370c5['plugins']['get'](Mt);this['affectsData']=!0x1,this['listenTo'](_0x717ad7,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x717ad7,'change:isEnabled',()=>this['refresh']());}execute(){const _0x588160=this['editor'],_0x2c2c64=_0x588160['plugins']['get'](Mt),_0x4e5aef=_0x2c2c64['isReady']?_0x2c2c64['diff']['newRevisionId']:null;_0x588160['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x4e5aef);}['refresh'](){const {isReady:_0x284c8f,isEnabled:_0x1e1fe4,repository:_0x1b878d,diff:_0x5e43d0}=this['editor']['plugins']['get'](Mt),_0xc2108b=_0x5e43d0&&_0x1b878d['getLaterVisibleRevision'](_0x5e43d0['newRevisionId']);this['isEnabled']=_0x284c8f&&_0x1e1fe4&&Boolean(_0xc2108b);}},Tt=class extends _0x3fb756{_step;constructor(_0x26f3eb,{direction:_0x3cc221}){super(_0x26f3eb);const _0x48bd5c=_0x26f3eb['plugins']['get'](Mt);this['affectsData']=!0x1,this['_step']='forward'===_0x3cc221?0x1:-0x1,this['listenTo'](_0x48bd5c,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x48bd5c,'change:isEnabled',()=>this['refresh']()),this['listenTo'](_0x48bd5c,'change:activeChange',()=>this['refresh']());}execute(){const _0x32cb8c=this['editor'],_0x377789=_0x32cb8c['plugins']['get'](Mt),{isNavigationMode:_0xdf9ea1,currentChangeNumber:_0x497c55}=_0x377789;let _0x5f12bf;if(_0x377789['activeChange']=_0xdf9ea1?_0x377789['diff']['changes']['get'](_0x497c55+this['_step']):_0x377789['diff']['changes']['first'],_0x377789['activeChange']['data']['isOnRoot'])_0x5f12bf=_0x32cb8c['editing']['view']['getDomRoot'](_0x377789['activeChange']['rootName']);else{const _0x5a125c=_0x32cb8c['model']['markers']['get']('revision:'+_0x377789['activeChange']['id']);_0x5f12bf=_0xc63871(_0x32cb8c['editing'],_0x5a125c);}_0x450e22({'target':_0x5f12bf,'viewportOffset':0x28});}['refresh'](){const {isNavigationMode:_0xfdb997,currentChangeNumber:_0x501c3a,numberOfChanges:_0x47b511,isReady:_0x4fbb7b,isEnabled:_0x5f4654}=this['editor']['plugins']['get'](Mt);this['isEnabled']=!!(_0x5f4654&&_0x4fbb7b&&_0x47b511)&&(!_0xfdb997||(0x1===this['_step']?_0x501c3a<_0x47b511-0x1:_0x501c3a>0x0));}},Ht=class extends at{constructor(_0x1f775a){super(_0x1f775a);const _0x4f1cac=this['bindTemplate'],_0x219b66=new _0x8e67d0(_0x1f775a),_0x3cc88c=new _0x8e67d0(_0x1f775a);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',(_0x35abb7,_0x2676b3)=>_0x35abb7&&_0x2676b3>0x0),this['bind']('_statusText')['to'](this,'isReady',this,'currentChangeNumber',this,'numberOfChanges',this,'isNavigationMode',(_0x230abb,_0x2f50a0,_0x55f657,_0x10d035)=>{if(!_0x230abb)return pt(_0x1f775a,'Loading...');if(!_0x55f657)return pt(_0x1f775a,'No\x20changes');const _0x1a2c1c=pt(_0x1f775a,'NUMBER_OF_CHANGES',_0x55f657);return _0x10d035?pt(_0x1f775a,'X_OF_Y_CHANGES',[_0x2f50a0+0x1,_0x55f657]):_0x1a2c1c;}),_0x219b66['set']({'label':pt(_0x1f775a,'Show\x20previous\x20change'),'tooltip':!0x0,'icon':_0xd45106}),_0x3cc88c['set']({'label':pt(_0x1f775a,'Show\x20next\x20change'),'tooltip':!0x0,'icon':_0x6638da}),_0x219b66['bind']('isEnabled')['to'](this,'isBackwardNavigationEnabled'),_0x3cc88c['bind']('isEnabled')['to'](this,'isForwardNavigationEnabled'),_0x219b66['on']('execute',()=>this['fire']('execute','backward')),_0x3cc88c['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',_0x4f1cac['if']('_isStatusLabelVisible','ck-hidden',_0x5199c9=>!_0x5199c9)]},'children':[{'text':_0x4f1cac['to']('isNavigationMode',_0x1ea722=>_0x1ea722?pt(_0x1f775a,'EDIT_X_OF_Y_REVISIONS')+':\x20':pt(_0x1f775a,'Total')+':\x20')}]},{'text':_0x4f1cac['to']('_statusText')}]},new nt(),{'tag':'div','attributes':{'class':['ck-revision-history-ui__changes-navigation__navigation']},'children':[_0x219b66,_0x3cc88c]}]});}};const Pt='ck-editor__editable__loading-overlay';var Ut=class extends _0x4a2cc5{static get['pluginName'](){return'RevisionViewerLoadingOverlay';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['show'](){const _0x45ff6a=this['editor']['editing']['view'];_0x45ff6a['change'](_0x22b3c8=>{for(const _0x1b97af of _0x45ff6a['document']['roots'])_0x22b3c8['addClass'](Pt,_0x1b97af);});}['hide'](){const _0x26c092=this['editor']['editing']['view'];_0x26c092['change'](_0x1dc830=>{for(const _0x4b55ee of _0x26c092['document']['roots'])_0x1dc830['removeClass'](Pt,_0x4b55ee);});}},Lt=class extends _0x4a2cc5{static get['pluginName'](){return'RevisionViewerUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Mt,Ut];}init(){const _0x5276a1=this['editor'],_0x49320e=_0x5276a1['plugins']['get'](Mt),_0x44c561=_0x5276a1['plugins']['get'](Ut);_0x5276a1['ui']['componentFactory']['add']('exitToEditing',_0x141f5a=>{const _0x2df871=new _0x8e67d0(_0x141f5a);return _0x2df871['set']({'label':pt(_0x141f5a,'Back\x20to\x20editing'),'icon':_0xd180d0,'withText':!0x0,'tooltip':!0x0,'class':'ck-revision-history-ui__back-to-editing'}),this['listenTo'](_0x2df871,'execute',()=>{_0x5276a1['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}),_0x2df871;}),_0x5276a1['ui']['componentFactory']['add']('restoreRevision',_0x3c352e=>{const _0x2b3f23=new _0x8e67d0(_0x3c352e);return _0x2b3f23['set']({'label':pt(_0x3c352e,'Restore\x20this\x20revision'),'withText':!0x0,'tooltip':!0x0}),_0x2b3f23['bind']('isEnabled')['to'](_0x5276a1['commands']['get']('restoreRevision')),this['listenTo'](_0x2b3f23,'execute',()=>_0x5276a1['execute']('restoreRevision')),_0x2b3f23;}),_0x5276a1['ui']['componentFactory']['add']('changesNavigation',_0x3cb1c8=>{const _0x154b77=new Ht(_0x3cb1c8),_0x1fd730=_0x5276a1['commands']['get']('showPreviousChange'),_0x3ee70e=_0x5276a1['commands']['get']('showNextChange');return _0x154b77['bind']('isBackwardNavigationEnabled')['to'](_0x1fd730,'isEnabled'),_0x154b77['bind']('isForwardNavigationEnabled')['to'](_0x3ee70e,'isEnabled'),_0x154b77['bind']('isReady','currentChangeNumber','numberOfChanges','isNavigationMode')['to'](_0x49320e),this['listenTo'](_0x154b77,'execute',(_0x53c25a,_0x1a907d)=>{_0x5276a1['execute']('forward'===_0x1a907d?'showNextChange':'showPreviousChange');}),_0x154b77;}),_0x44c561['show'](),_0x49320e['on']('change:isReady',(_0x13a2fa,_0x576882,_0x4f214b)=>{_0x4f214b?_0x44c561['hide']():_0x44c561['show']();});}},Ft=class extends _0x598ee3{['_resizeObserver']=null;constructor(_0x4c4863,_0x251cd5){super(_0x4c4863,_0x251cd5);const _0x1fd2ce=this['bindTemplate'];this['set']({'label':pt(_0x4c4863,'Revision\x20name'),'_tooltipString':''}),this['fieldView']['placeholder']=pt(_0x4c4863,'Enter\x20the\x20revision\x20name'),this['extendTemplate']({'tag':'span','attributes':{'class':['ck-revision-history-sidebar__revision-name'],'data-cke-tooltip-text':_0x1fd2ce['to']('_tooltipString'),'data-cke-tooltip-position':'s','data-cke-tooltip-class':'ck-tooltip_multi-line'}});}['render'](){super['render'](),this['_resizeObserver']=new _0x2bd05d(this['fieldView']['element'],()=>this['_updateTooltipText']()),this['listenTo'](this['fieldView'],'input',()=>this['_updateTooltipText']());}destroy(){super['destroy'](),this['_resizeObserver']&&this['_resizeObserver']['destroy']();}_updateTooltipText(){const _0x53d6e1=this['fieldView']['element'];this['_tooltipString']=_0x53d6e1['scrollWidth']>_0x53d6e1['clientWidth']&&_0x53d6e1['value']||'';}},$t=class extends at{constructor(_0x17b829,_0x582e33,_0x1db957){super(_0x17b829);const _0x5738eb=new _0x4d1f21();_0x5738eb['set']({'content':_0x9d919b,'viewBox':'0\x200\x2011\x2010'});const _0x41872a=['ck','ck-revision-history-sidebar__revision-author'];_0x1db957&&_0x41872a['push']('ck-revision-history-sidebar__revision-author_creator');const _0x400ee6=[{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__revision-author__name'],'title':pt(_0x17b829,_0x1db957?'Revision\x20creator':'Revision\x20author')},'children':[_0x5738eb,_0x582e33['name']]}];this['setTemplate']({'tag':'li','attributes':{'class':_0x41872a},'children':_0x400ee6});}};function jt(_0x2cd137,_0x367bb8){const _0x42d45a=_0x2cd137['bindTemplate'],_0x1a139a=_0x2cd137['locale'],_0x1c1436=ct(_0x1a139a);_0x1c1436['panelPosition']='sw';const _0xa50deb=function(_0x26c155,_0x2dc296){const _0x72cb=function(_0x17ec5b,_0x3175c6){const _0x5bb9c7=_0x17ec5b['locale'],_0x125a6b={'Compare\x20against\x20selected':pt(_0x5bb9c7,'Compare\x20against\x20selected'),'Name\x20this\x20revision':pt(_0x5bb9c7,'Name\x20this\x20revision'),'Restore\x20this\x20revision':pt(_0x5bb9c7,'Restore\x20this\x20revision')};return _0x3175c6['map'](_0x339255=>{const _0x2710dd=_0x125a6b[_0x339255['name']];return _0x2710dd&&_0x2710dd!==_0x339255['name']&&(_0x339255['name']=_0x2710dd),_0x339255;});}(_0x26c155,_0x2dc296),_0x162d25=new _0xca5138();for(const _0x5b16dc of _0x72cb){const _0x2fc2fb={'type':'button','model':new rt({'label':_0x5b16dc['name'],'class':_0x5b16dc['class'],'withText':!0x0,'role':'menuitem','_action':_0x5b16dc['action']})};_0x2fc2fb['model']['bind']('isEnabled')['to'](_0x26c155,'isActionsDropdownOpen',_0x136eee=>'function'!=typeof _0x5b16dc['isEnabled']||(!_0x136eee||_0x5b16dc['isEnabled'](_0x26c155))),_0x162d25['add'](_0x2fc2fb);}return _0x162d25;}(_0x2cd137,_0x367bb8);return _0x2cd137['bind']('isActionsDropdownOpen')['to'](_0x1c1436,'isOpen'),_0x1c1436['buttonView']['set']({'label':pt(_0x1a139a,'Show\x20more\x20items'),'tooltip':!0x0,'tooltipPosition':'sw','icon':_0x389cb8}),_0x1c1436['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision__actions',_0x42d45a['if']('isActionsDropdownOpen','ck-on')]},'on':{'click':_0x42d45a['to'](_0xba380d=>_0xba380d['stopPropagation']())}}),_0x1c1436['on']('execute',_0x5378fe=>{_0x2cd137['isReady']&&'function'==typeof _0x5378fe['source']['_action']&&_0x5378fe['source']['_action'](_0x2cd137);}),ht(_0x1c1436,_0xa50deb,{'role':'menu'}),_0x1c1436['listenTo'](_0x2cd137,'change:isActionsDropdownOpen',(_0x458054,_0x479ed0,_0xe9810c)=>{if(_0xe9810c)for(const _0x2a6f49 of _0x1c1436['listView']['items']){const _0x273ec4=_0x2a6f49['children']['first'],_0x29d818=_0x367bb8['find'](_0x93aea=>_0x93aea['action']===_0x273ec4['_action'])['isVisible'];_0x2a6f49['isVisible']=void 0x0===_0x29d818||_0x29d818(_0x2cd137);}}),_0x1c1436;}const Bt=/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x78fd76(at);var Kt=class extends Bt{['id'];['revisionNameView'];revisionActionsView;['_revision'];_requireRevisionName;constructor(_0x10d503,_0x4376e4,_0xea5920,_0x5e845d){super(_0x10d503);const _0x256695=this['bindTemplate'],_0x39bd42=function(_0x34be27,_0x5e61f8){const _0x27191b=Array['from'](_0x5e61f8['authors'])['filter'](_0x4b6c68=>_0x4b6c68!=_0x5e61f8['creator']);return _0x5e61f8['creator']&&_0x27191b['unshift'](_0x5e61f8['creator']),_0x27191b['map'](_0x363c00=>new $t(_0x34be27,_0x363c00,_0x363c00==_0x5e61f8['creator']));}(_0x10d503,_0x4376e4);this['id']=_0x4376e4['id'],this['_revision']=_0x4376e4,this['_requireRevisionName']=_0x5e845d,this['bind']('name','createdAt')['to'](_0x4376e4),this['bind']('_createdAtFormatted')['to'](this,'createdAt',_0x2cd0a4=>{return _0x149d4a=_0x10d503['uiLanguage'],(_0x17c791=_0x2cd0a4)['toLocaleDateString'](_0x149d4a,{'month':'long','day':'numeric'})+',\x20'+_0x17c791['toLocaleTimeString'](_0x149d4a,{'hour':'numeric','minute':'numeric'});var _0x149d4a,_0x17c791;}),this['set']('isSelected',!0x1),this['set']('isHighlighted',!0x1),this['set']('isActionsDropdownOpen',!0x1),this['set']('isReady',!0x1),this['set']('isEnabled',!0x1),this['revisionNameView']=new Ft(_0x10d503,lt),this['revisionNameView']['fieldView']['extendTemplate']({'attributes':{'maxlength':'220'}}),this['revisionNameView']['fieldView']['bind']('value')['to'](this,'name',_0x3eb3b9=>_0x3eb3b9||this['_createdAtFormatted']),this['revisionNameView']['bind']('isEnabled')['to'](this,'isSelected',this,'isEnabled',(_0x434cd1,_0x3f5d0d)=>_0x434cd1&&_0x3f5d0d),this['revisionActionsView']=_0xea5920&&_0xea5920['length']?jt(this,_0xea5920):'',this['revisionActionsView']&&this['revisionActionsView']['bind']('isEnabled')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision-wrapper',_0x256695['if']('isConfirm','ck-revision-history-sidebar__revision-wrapper_confirmation_visible')]},'children':[{'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision',_0x256695['if']('isEnabled','ck-disabled',_0x232784=>!_0x232784),_0x256695['if']('isSelected','ck-revision-history-sidebar__revision_selected'),_0x256695['if']('isHighlighted','ck-revision-history-sidebar__revision_highlighted'),_0x256695['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':_0x256695['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':_0x39bd42}]},this['revisionActionsView']],'on':{'click':_0x256695['to'](_0x343ba4=>{_0x343ba4['srcElement']['closest']('.ck-confirm-view')||this['isReady']&&this['isEnabled']&&this['fire']('select',{'id':this['id']});})}}]});}['render'](){super['render']();const _0x424a80=this['revisionNameView']['fieldView']['element'];this['listenTo'](_0x424a80,'change',()=>{this['_requireRevisionName']&&!_0x424a80['value']||this['fire']('setName',{'id':this['id'],'name':_0x424a80['value']}),_0x424a80['value']||(_0x424a80['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(_0x3fda26,_0x16f1e5){const _0x20b3c5=ft['fromJSDate'](_0x3fda26)['setLocale'](_0x16f1e5),_0x3184c1=ft['local'](),_0x3fe870=_0x3184c1['minus']({'days':0x1})['startOf']('day');let _0x39b003,_0x25e928;return _0x20b3c5['hasSame'](_0x3184c1,'day')?(_0x39b003=_0x20b3c5['startOf']('day')['toJSDate'](),_0x25e928=_0x20b3c5['toRelativeCalendar']()):_0x20b3c5['hasSame'](_0x3fe870,'day')?(_0x39b003=_0x3fe870['toJSDate'](),_0x25e928=_0x20b3c5['toRelativeCalendar']()):_0x20b3c5['hasSame'](_0x3184c1,'week')?(_0x39b003=_0x20b3c5['startOf']('week')['toJSDate'](),_0x25e928=_0x20b3c5['weekdayLong']||''):_0x20b3c5['hasSame'](_0x3184c1,'year')?(_0x39b003=_0x20b3c5['startOf']('month')['toJSDate'](),_0x25e928=_0x20b3c5['monthLong']||''):(_0x39b003=_0x20b3c5['startOf']('year')['toJSDate'](),_0x25e928=String(_0x20b3c5['year'])),{'startDate':_0x39b003,'localizedPeriodName':_0x25e928};}var Gt=class extends at{startDate;['revisionViews'];_revisionActions;_requireRevisionName;constructor(_0x25016d,_0x53305a,_0x443d9d,_0x30dbea){super(_0x25016d);const _0x4803da=qt(_0x53305a,this['locale']['uiLanguage'])['localizedPeriodName'];this['startDate']=_0x53305a,this['revisionViews']=this['createCollection'](),this['_revisionActions']=_0x443d9d,this['_requireRevisionName']=_0x30dbea,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':_0x4803da}]},{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__time-period__revisions']},'children':this['revisionViews']}]});}['addRevision'](_0x5a2a1e){const _0x59feb6=new Kt(this['locale'],_0x5a2a1e,this['_revisionActions'],this['_requireRevisionName']);this['revisionViews']['add'](_0x59feb6);}['removeRevision'](_0x294b90){const _0x2e036d=this['revisionViews']['find'](_0x5e3c78=>_0x5e3c78['id']===_0x294b90['id']);this['revisionViews']['remove'](_0x2e036d);}},Jt=class extends at{constructor(_0x5d33af){super(_0x5d33af);const _0x189493=new _0x4d1f21();_0x189493['content']=_0xc681fc,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-revision-history-sidebar__header']},'children':[_0x189493,{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__header__label']},'children':[pt(_0x5d33af,'Revision\x20history')]}]});}},Wt=class extends at{timePeriodViews;['_revisions'];_revisionActions;_requireRevisionName;constructor(_0x301258,_0x3586c9,_0x5a65ed,_0x36b816){super(_0x301258);const _0x7e62e1=this['bindTemplate'];this['timePeriodViews']=this['createCollection'](),this['timePeriodViews']['delegate']('select')['to'](this),this['timePeriodViews']['delegate']('setName')['to'](this),this['_revisions']=_0x3586c9,this['_revisionActions']=_0x5a65ed,this['_requireRevisionName']=_0x36b816,this['on']('select',(_0x1e7d01,_0x44291d)=>{this['fire']('revisionSelected',_0x44291d);}),this['on']('setName',(_0x369b88,_0x1335ed)=>{this['fire']('revisionSetName',_0x1335ed);}),this['set']('isEnabled',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-rounded-corners','ck-revision-history-sidebar']},'children':[new Jt(_0x301258),{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__timeline',_0x7e62e1['if']('isEnabled','ck-disabled',_0x1dd3f5=>!_0x1dd3f5)]},'children':this['timePeriodViews']}]});}['render'](){super['render']();for(const _0x50a617 of this['_revisions'])this['_addRevision'](_0x50a617);this['_revisions']['on']('add',(_0x347f75,_0x50f135)=>{this['_addRevision'](_0x50f135);}),this['_revisions']['on']('remove',(_0x3aa9c8,_0x52d811)=>{this['_removeRevision'](_0x52d811);});}get['revisionViews'](){return this['timePeriodViews']['map'](_0x36042b=>_0x36042b['revisionViews']['map'](_0x5ce526=>_0x5ce526))['flat']();}selectRevision(_0x1ce8ec){for(const _0x518431 of this['revisionViews'])_0x1ce8ec&&_0x1ce8ec['id']===_0x518431['id']?_0x518431['select']():_0x518431['deselect']();}highlightRevisions(_0x442067){for(const _0xa3d5f9 of this['revisionViews'])_0x442067['some'](({id:_0x594bea})=>_0x594bea===_0xa3d5f9['id'])?_0xa3d5f9['highlight']():_0xa3d5f9['unhighlight']();}['_addRevision'](_0x2358c4){const _0x119c9f=qt(_0x2358c4['createdAt'],this['locale']['uiLanguage'])['startDate'];let _0x2c09ad=this['_getTimePeriodViewByStartDate'](_0x119c9f);_0x2c09ad||(_0x2c09ad=new Gt(this['locale'],_0x119c9f,this['_revisionActions'],this['_requireRevisionName']),this['timePeriodViews']['add'](_0x2c09ad)),_0x2c09ad['addRevision'](_0x2358c4);}['_removeRevision'](_0x4c4a51){const _0x3cf4a8=qt(_0x4c4a51['createdAt'],this['locale']['uiLanguage'])['startDate'];this['_getTimePeriodViewByStartDate'](_0x3cf4a8)['removeRevision'](_0x4c4a51);}_getTimePeriodViewByStartDate(_0x1465d7){return this['timePeriodViews']['find'](_0xbfaf83=>_0xbfaf83['startDate']['getTime']()===_0x1465d7['getTime']());}},Yt=class RevisionsSidebar extends _0x4a2cc5{['_revisionViewer'];_revisionsRepository;['_sidebarView'];static defaultRevisionActions=/* #__PURE__ -- @preserve */
|
|
28
28
|
((()=>['compareAgainstSelected','restoreRevision','nameRevision'])());static availableRevisionActions=/* #__PURE__ -- @preserve */
|
|
29
|
-
Xt();static get['pluginName'](){return'RevisionsSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Mt];}constructor(
|
|
30
|
-
_0x26534e(_0x312756);var ti=class extends Zt{['_ui'];get['ui'](){return this['_ui'];}constructor(_0x22d3f7,_0x177ba0){super(_0x177ba0),this['sourceElement']=_0x22d3f7,this['model']['document']['createRoot']();const _0x6f82e5=new zt(this['locale'],this['editing']['view'],{'shouldToolbarGroupWhenFull':!0x0});this['_ui']=new Qt(this,_0x6f82e5);}destroy(){return this['updateSourceElement'](),this['ui']['destroy'](),super['destroy']();}static async create(_0x23f7f2,_0x43a8b5){const _0x307716=new this(_0x23f7f2,_0x43a8b5);return await _0x307716['initPlugins'](),await _0x307716['ui']['init'](_0x23f7f2),await _0x307716['data']['init'](_0x307716['config']['get']('initialData')||''),_0x307716['fire']('ready'),_0x307716;}};const ii=['RevisionHistoryUI','RestrictedEditingMode','AIChat','AIReviewMode','AIBalloon','AIQuickActions','AIActions','AIChatShortcuts','AITranslate'];var ei=class extends _0x1e8181{result;static get['pluginName'](){return'RevisionViewerIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x59f745){super(_0x59f745),this['result']='end',_0x59f745['editing']['view']['_overlayModeHint']='auto',_0x59f745['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}},si=class extends _0x1e8181{_viewerEditor;static get['pluginName'](){return'RevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_t,St];}constructor(_0x28ae39){if(super(_0x28ae39),!this['editor']['config']['get']('revisionHistory'))throw new _0x206252('revision-history-missing-configuration',this);this['_viewerEditor']=null,this['set']('isRevisionViewerOpen',!0x1),this['editor']['config']['define']('revisionHistory.showRevisionViewerCallback',_0x36e151=>this['_showRevisionViewer']({..._0x36e151,'translations':this['editor']['locale']['translations']})),this['editor']['config']['define']('revisionHistory.closeRevisionViewerCallback',_0x19b015=>this['_closeRevisionViewer'](_0x19b015)),this['editor']['config']['define']('revisionHistory.restoreRevisionCallback',_0x4e3718=>this['_restoreRevision'](_0x4e3718)),this['editor']['config']['define']('revisionHistory.requireRevisionName',!0x1),this['_enhanceShowRevisionViewerCallback'](),this['_enhanceCloseRevisionViewerCallback']();}set adapter(_0x37207b){this['editor']['plugins']['get']('RevisionTracker')['adapter']=_0x37207b;}get adapter(){return this['editor']['plugins']['get']('RevisionTracker')['adapter'];}addRevisionData(_0x5730a9){return this['editor']['plugins']['get']('RevisionTracker')['addRevisionData'](_0x5730a9);}getRevision(_0x18c4f8){return this['editor']['plugins']['get']('RevisionsRepository')['getRevision'](_0x18c4f8);}getRevisions(_0x4e3acd){return this['editor']['plugins']['get']('RevisionsRepository')['getRevisions'](_0x4e3acd||{'toJSON':!0x1});}_getRevisionViewerEditorConfig(){const _0x1deff0=this['editor'],_0x1ca2e4=_0x26349e(_0x1deff0,ii),_0x8f5d68=_0x1deff0['plugins']['get']('RevisionTracker'),_0x2981bf=_0x1deff0['plugins']['get'](_0x5182c9)['users'];return _0x1ca2e4['toolbar']=['exitToEditing','restoreRevision','changesNavigation'],delete _0x1ca2e4['lazyRoots'],(_0x1ca2e4['plugins']['push'](ei,Mt,Lt,class RevisionViewerInit extends _0x1e8181{static get requires(){return[Mt,_0x5182c9];}init(){const _0x581f66=this['editor']['plugins']['get'](_0x5182c9);for(const _0x1d8f4c of _0x2981bf)_0x1d8f4c['isAnonymous']||_0x581f66['getUser'](_0x1d8f4c['id'])||_0x581f66['addUser'](_0x1d8f4c);const _0x3ec9d9=_0x8f5d68['repository']['getRevisions']();let _0x3d502a=null;const _0x2065ac=this['editor']['plugins']['get']('RevisionViewer');_0x2065ac['adapter']=_0x8f5d68['adapter'],_0x2065ac['bind']('isEnabled')['to'](_0x8f5d68),this['editor']['commands']['get']('restoreRevision')['bind']('isEnabled')['to'](_0x1deff0,'isReadOnly',_0x5074f6=>!_0x5074f6);for(const _0x40c1c0 of _0x3ec9d9){const _0x330684=null===_0x40c1c0['creator'];if(_0x330684&&_0x40c1c0['toVersion']===_0x40c1c0['fromVersion'])continue;const _0x18f783=_0x40c1c0['toJSON']();_0x2065ac['addRevisionData'](_0x18f783,(_0x4de602,_0x4b25c6,_0x1f201)=>{if(_0x330684){if(_0x3d502a)_0x3d502a['_update'](_0x4de602,_0x4b25c6);else{if(!_0x4b25c6){const _0x1db240=_0x1f201['toJSON']();_0x1db240['id']=_0x57bf97(),_0x8f5d68['saveRevision'](_0x1db240,_0x1f201['toVersion'])['then'](_0x5a3dbc=>{_0x3d502a=_0x5a3dbc;});}}}else _0x40c1c0['_update'](_0x4de602,_0x4b25c6);});}}},Yt),_0x1ca2e4);}['_enhanceShowRevisionViewerCallback'](){const _0x2f64c9=this['editor']['config']['get']('revisionHistory')['showRevisionViewerCallback'];this['editor']['config']['set']('revisionHistory.showRevisionViewerCallback',async()=>{this['editor']['enableReadOnlyMode']('revision-history-viewer-opened');const _0x3dfdc6=this['editor']['plugins']['get']('RevisionTracker');if(this['editor']['plugins']['has']('Autosave')?await this['editor']['plugins']['get']('Autosave')['save']():await _0x3dfdc6['update'](),this['editor']['plugins']['has']('PaginationLookup')&&this['editor']['plugins']['get']('PaginationLookup')['_recalculatePageBreaks'](),this['editor']['plugins']['has']('Dialog')){const _0x5642d3=this['editor']['plugins']['get']('Dialog');_0x5642d3['isOpen']&&_0x5642d3['hide']();}if(this['editor']['plugins']['has']('AITabs')){const _0x53a63a=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x152bd4 of _0x53a63a)_0x152bd4['class']=_0x152bd4['class']?_0x152bd4['class']+'\x20ck-tab-panel_disabled':'ck-tab-panel_disabled';if(this['editor']['plugins']['has']('AIChat')){const _0x56551a=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x56551a&&_0x56551a['setAttribute']('tabindex','-1');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0xc2683c=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0xc2683c&&_0xc2683c['setAttribute']('tabindex','-1');}}const _0xca5f0f=this['_getRevisionViewerEditorConfig']();return _0x2f64c9(_0xca5f0f)['then'](_0x3a8522=>(this['_viewerEditor']=_0x3a8522,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'),_0x3a8522))['catch'](_0x165ad2=>(console['error'](_0x165ad2),this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),null));});}['_enhanceCloseRevisionViewerCallback'](){const _0x122d66=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 _0x10ca38=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x17a122 of _0x10ca38)_0x17a122['class']='ck-tab-panel_disabled'===_0x17a122['class']?'':_0x17a122['class']['replace']('\x20ck-tab-panel_disabled','');if(this['editor']['plugins']['has']('AIChat')){const _0xa1bce=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0xa1bce&&_0xa1bce['removeAttribute']('tabindex');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x3378c9=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x3378c9&&_0x3378c9['removeAttribute']('tabindex');}}return this['_viewerEditor']['plugins']['get']('RevisionViewer')['_cleanUp'](),_0x122d66(this['_viewerEditor'])['then'](()=>{if(this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),this['_viewerEditor']=null,this['editor']['plugins']['has']('Annotations')){const _0x3d8d94=this['editor']['plugins']['get']('Annotations');_0x3d8d94['refreshVisibility'](),_0x3d8d94['refreshPositioning']();}});});}['_showRevisionViewer'](_0x1300c0){const _0x10d9e8=this['editor']['config']['get']('revisionHistory.editorContainer'),_0x3c774c=this['editor']['config']['get']('revisionHistory.viewerContainer'),_0x37a94c=this['editor']['config']['get']('revisionHistory.viewerEditorElement');return ti['create'](_0x37a94c,_0x1300c0)['then'](_0x4e28b0=>(_0x3c774c['style']['display']='block',_0x10d9e8['style']['display']='none',this['isRevisionViewerOpen']=!0x0,_0x4e28b0));}['_closeRevisionViewer'](_0x3d0532){const _0x19bd9d=this['editor']['config']['get']('revisionHistory.editorContainer');return this['editor']['config']['get']('revisionHistory.viewerContainer')['style']['display']='none',_0x19bd9d['style']['display']='',this['isRevisionViewerOpen']=!0x1,_0x3d0532['destroy']();}async _restoreRevision(_0x8fb1f0){const _0x116208=this['editor'],_0x53f3e1=this['_viewerEditor']['plugins']['get']('RevisionViewer'),_0x27033e=_0x116208['plugins']['get']('RevisionTracker'),_0x2de65e=_0x116208['plugins']['get']('RevisionHistoryUtils'),_0x332a4f=_0x53f3e1['repository']['getRevision'](_0x8fb1f0);let _0x4ce94b,_0x23b0e4,_0x382559;try{await _0x2de65e['loadRevisionData'](_0x332a4f,this['adapter']),_0x4ce94b=_0x2de65e['getRevisionDocumentData'](_0x332a4f),_0x23b0e4=_0x2de65e['getRevisionRootsAttributes'](_0x332a4f);}catch(_0x14a218){return void console['error'](_0x14a218);}_0x116208['model']['change'](_0x57244b=>{for(const _0x69cf83 of Array['from'](_0x116208['model']['markers']['getMarkersGroup']('restrictedEditingException')))_0x57244b['removeMarker'](_0x69cf83);}),_0x53f3e1['isReady']=!0x1,_0x116208['model']['enqueueChange'](_0x74bd9d=>{_0x74bd9d['setSelection'](null),_0x74bd9d['removeSelectionAttribute'](_0x116208['model']['document']['selection']['getAttributeKeys']());const _0x4e674d=Object['keys'](_0x4ce94b);for(const _0x25d9c7 of _0x116208['model']['document']['roots'])'$graveyard'!=_0x25d9c7['rootName']&&_0x25d9c7['isAttached']()&&!_0x4e674d['includes'](_0x25d9c7['rootName'])&&_0x74bd9d['detachRoot'](_0x25d9c7);for(const _0x28bbea of _0x4e674d){let _0x299034=_0x116208['model']['document']['getRoot'](_0x28bbea);if(!_0x299034||!_0x299034['isAttached']()){const _0x2ee373=_0x332a4f['diffData']?.[_0x28bbea]?.['rootElementName']||'$root';_0x299034=_0x74bd9d['addRoot'](_0x28bbea,_0x2ee373);}const _0x5b06c5=_0x23b0e4[_0x28bbea],_0x54a409=Object['keys'](_0x5b06c5),_0x9c9b57=_0x4ce94b[_0x28bbea];for(const _0x45124e of _0x299034['getAttributeKeys']())_0x54a409['includes'](_0x45124e)||_0x74bd9d['removeAttribute'](_0x45124e,_0x299034);for(const _0x3951d1 of _0x54a409)_0x74bd9d['setAttribute'](_0x3951d1,_0x23b0e4[_0x28bbea][_0x3951d1],_0x299034);_0x74bd9d['remove'](_0x74bd9d['createRangeIn'](_0x299034)),_0x74bd9d['insert'](_0x116208['data']['parse'](_0x9c9b57,_0x299034),_0x299034,0x0);}});const _0x2693e5=pt(_0x116208['locale'],'Restored');if(_0x332a4f['name'])_0x382559=-0x1==_0x332a4f['name']['indexOf'](_0x2693e5)?_0x2693e5+':\x20'+_0x332a4f['name']:_0x332a4f['name'];else _0x382559=_0x2693e5+':\x20'+(_0x332a4f['createdAt']['toLocaleDateString'](_0x116208['locale']['uiLanguage'],{'month':'long','day':'numeric'})+',\x20'+_0x332a4f['createdAt']['toLocaleTimeString'](_0x116208['locale']['uiLanguage'],{'hour':'numeric','minute':'numeric'}));return await _0x27033e['saveRevision']({'name':_0x382559}),_0x53f3e1['isReady']=!0x0,_0x116208['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}};export{Dt as RestoreRevisionCommand,gt as Revision,si as RevisionHistory,St as RevisionHistoryUI,wt as RevisionHistoryUtils,_t as RevisionTracker,Mt as RevisionViewer,ti as RevisionViewerEditor,ei as RevisionViewerIntegration,Ut as RevisionViewerLoadingOverlay,Lt as RevisionViewerUI,mt as RevisionsRepository,Yt as RevisionsSidebar,Tt as ShowChangeCommand};
|
|
29
|
+
Xt();static get['pluginName'](){return'RevisionsSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Mt];}constructor(_0x55c56c){super(_0x55c56c),this['_revisionViewer']=_0x55c56c['plugins']['get'](Mt),this['_revisionsRepository']=this['_revisionViewer']['repository'],this['_sidebarView']=null;}init(){const _0x230637=this['_revisionsRepository']['_revisions'],_0x16ff06=this['_createRevisionActions'](),_0x2fc4b8=this['editor']['config']['get']('revisionHistory.viewerSidebarContainer');this['_sidebarView']=new Wt(this['editor']['locale'],_0x230637,_0x16ff06,this['editor']['config']['get']('revisionHistory.requireRevisionName')),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',(_0x2f29e3,_0x2912f3)=>{_0x2912f3['revisionViews']['on']('add',(_0x481840,_0x1d74b6)=>{_0x1d74b6['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)),_0x2fc4b8['appendChild'](this['_sidebarView']['element']);}destroy(){this['_sidebarView']['element']['remove'](),this['_sidebarView']['destroy']();}_handleEditorDataReady(){const _0x1cf4ab=this['_revisionsRepository']['getRevision'](0x0);if(_0x1cf4ab){const _0x2f8a8d=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x1cf4ab['id']);this['_revisionViewer']['compare'](_0x1cf4ab,_0x2f8a8d);}}_handleRevisionSelected(_0x1e5e4c,_0x3b57ca){const _0x94573b=this['_revisionsRepository']['getRevision'](_0x3b57ca['id']),_0x2964f8=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x94573b['id']);this['_revisionViewer']['compare'](_0x94573b,_0x2964f8);}_handleRevisionSetName(_0x304202,_0x5bae8b){this['_revisionsRepository']['getRevision'](_0x5bae8b['id'])['setName'](_0x5bae8b['name']);}['_handleDiffChange'](_0x17d045,_0x1cd023,_0x5c3619){const _0x1e9410=this['_revisionsRepository']['getRevisionsInDiff'](_0x5c3619);_0x1e9410['length']>0x2?(this['_sidebarView']['highlightRevisions'](_0x1e9410),this['_sidebarView']['selectRevision'](null)):(this['_sidebarView']['highlightRevisions']([]),this['_sidebarView']['selectRevision'](_0x1e9410[0x0]));}_createRevisionActions(){const _0x128f7c=this['editor'],_0x27a5d4=RevisionsSidebar['availableRevisionActions'],_0x29a7f1=_0x128f7c['config']['get']('revisionHistory.revisionActions')||RevisionsSidebar['defaultRevisionActions'];if(_0x29a7f1['length'])return _0x29a7f1['map'](_0x42ee19=>{const _0x3fdde4='string'==typeof _0x42ee19?Object['assign']({},_0x27a5d4[_0x42ee19]):_0x42ee19;return _0x3fdde4['action']=_0x3fdde4['action']['bind'](this,_0x128f7c),_0x3fdde4['isVisible']&&(_0x3fdde4['isVisible']=_0x3fdde4['isVisible']['bind'](this,_0x128f7c)),_0x3fdde4;});}};function Xt(){return{'compareAgainstSelected':{'name':'Compare\x20against\x20selected','action':({plugins:_0x275acd},_0x418c54)=>{const _0x52738a=_0x275acd['get'](Mt),_0x422b06=_0x52738a['repository'];let _0x4c09e5=_0x52738a['diff']['newRevisionId'],_0x31b72b=_0x418c54['id'];_0x422b06['getIndex'](_0x4c09e5)>_0x422b06['getIndex'](_0x31b72b)&&([_0x4c09e5,_0x31b72b]=[_0x31b72b,_0x4c09e5]),_0x52738a['compare'](_0x4c09e5,_0x31b72b);},'isVisible':({plugins:_0x4a9b30},_0x3f4e81)=>{const _0x8beb58=_0x4a9b30['get'](Mt);return!(_0x8beb58['repository']['getRevisionsInDiff'](_0x8beb58['diff'])['length']>0x2)&&!_0x3f4e81['isSelected'];}},'restoreRevision':{'name':'Restore\x20this\x20revision','action':(_0x2a9f56,{id:_0xc10c89})=>{_0x2a9f56['config']['get']('revisionHistory')['restoreRevisionCallback'](_0xc10c89);},'isVisible':({plugins:_0x2f1c4a},_0x30b620)=>!!_0x2f1c4a['get'](Mt)['repository']['getLaterVisibleRevision'](_0x30b620['id'])},'nameRevision':{'name':'Name\x20this\x20revision','action':({plugins:_0x5d7e93},{id:_0x17ea2a,revisionNameView:_0x40d9e9})=>{const _0x64a466=_0x5d7e93['get'](Mt),_0xc97367=_0x64a466['repository']['getEarlierVisibleRevision'](_0x17ea2a);_0x64a466['compare'](_0x17ea2a,_0xc97367),_0x40d9e9['focus'](),_0x40d9e9['fieldView']['select']();}}};}var Qt=class extends _0x25b37d{['_view'];_toolbarConfig;_elementReplacer;get['view'](){return this['_view'];}constructor(_0x2c93c2,_0x4f57ae){super(_0x2c93c2),this['_view']=_0x4f57ae,this['_toolbarConfig']=ut(_0x2c93c2['config']['get']('toolbar')),this['_elementReplacer']=new _0x50370e();}get element(){return this['view']['element'];}init(_0x2b47c8){const _0x46316a=this['editor'],_0x5e797c=this['view'],_0x1e9a79=_0x46316a['editing']['view'],_0x3f91c6=_0x5e797c['editable'];_0x3f91c6['name']=_0x1e9a79['document']['getRoot']()['rootName'],_0x5e797c['render']();const _0x3d4ac7=_0x3f91c6['element'];this['setEditableElement'](_0x3f91c6['name'],_0x3d4ac7),_0x5e797c['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x1e9a79['attachDomRoot'](_0x3d4ac7),this['_elementReplacer']['replace'](_0x2b47c8,this['element']),this['_initToolbar'](),this['fire']('ready');}destroy(){super['destroy']();const _0x18c074=this['view'],_0x16c724=this['editor']['editing']['view'];this['_elementReplacer']['restore'](),_0x16c724['detachDomRoot'](_0x18c074['editable']['name']),_0x18c074['destroy']();}_initToolbar(){const _0x57a168=this['view'];_0x57a168['stickyPanel']['bind']('isActive')['to'](this['focusTracker'],'isFocused'),_0x57a168['stickyPanel']['limiterElement']=_0x57a168['element'],_0x57a168['stickyPanel']['bind']('viewportTopOffset')['to'](this,'viewportOffset',({top:_0xbaccaa})=>_0xbaccaa),_0x57a168['toolbar']['fillFromConfig'](this['_toolbarConfig'],this['componentFactory']),this['addToolbar'](_0x57a168['toolbar']);}},zt=class extends _0x5f16f3{_editable;stickyPanel;toolbar;get editable(){return this['_editable'];}constructor(_0x1819c7,_0x5219b0,_0x759de9={}){super(_0x1819c7),this['stickyPanel']=new st(_0x1819c7),this['toolbar']=new ot(_0x1819c7,{'shouldGroupWhenFull':_0x759de9['shouldToolbarGroupWhenFull']}),this['_editable']=new _0x4a56fe(_0x1819c7,_0x5219b0);}['render'](){super['render'](),this['stickyPanel']['content']['add'](this['toolbar']),this['top']['add'](this['stickyPanel']),this['main']['add'](this['editable']);}};const Zt=/* #__PURE__ -- @preserve */
|
|
30
|
+
_0x55ca3e(_0x4169a0);var ti=class extends Zt{['_ui'];get['ui'](){return this['_ui'];}constructor(_0x18d9d3,_0x282f38){super(_0x282f38),this['sourceElement']=_0x18d9d3,this['model']['document']['createRoot']();const _0x4a4e8b=new zt(this['locale'],this['editing']['view'],{'shouldToolbarGroupWhenFull':!0x0});this['_ui']=new Qt(this,_0x4a4e8b);}destroy(){return this['updateSourceElement'](),this['ui']['destroy'](),super['destroy']();}static async create(_0x305c3e,_0x2ddc87){const _0x2dfac6=new this(_0x305c3e,_0x2ddc87);return await _0x2dfac6['initPlugins'](),await _0x2dfac6['ui']['init'](_0x305c3e),await _0x2dfac6['data']['init'](_0x2dfac6['config']['get']('initialData')||''),_0x2dfac6['fire']('ready'),_0x2dfac6;}};const ii=['RevisionHistoryUI','RestrictedEditingMode','AIChat','AIReviewMode','AIBalloon','AIQuickActions','AIActions','AIChatShortcuts','AITranslate'];var ei=class extends _0x4a2cc5{result;static get['pluginName'](){return'RevisionViewerIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x330e92){super(_0x330e92),this['result']='end',_0x330e92['editing']['view']['_overlayModeHint']='auto',_0x330e92['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}},si=class extends _0x4a2cc5{_viewerEditor;static get['pluginName'](){return'RevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_t,St];}constructor(_0x2f4415){if(super(_0x2f4415),!this['editor']['config']['get']('revisionHistory'))throw new _0x5de8be('revision-history-missing-configuration',this);this['_viewerEditor']=null,this['set']('isRevisionViewerOpen',!0x1),this['editor']['config']['define']('revisionHistory.showRevisionViewerCallback',_0xe3ad13=>this['_showRevisionViewer']({..._0xe3ad13,'translations':this['editor']['locale']['translations']})),this['editor']['config']['define']('revisionHistory.closeRevisionViewerCallback',_0x4ca65c=>this['_closeRevisionViewer'](_0x4ca65c)),this['editor']['config']['define']('revisionHistory.restoreRevisionCallback',_0x574089=>this['_restoreRevision'](_0x574089)),this['editor']['config']['define']('revisionHistory.requireRevisionName',!0x1),this['_enhanceShowRevisionViewerCallback'](),this['_enhanceCloseRevisionViewerCallback']();}set adapter(_0x1f0924){this['editor']['plugins']['get']('RevisionTracker')['adapter']=_0x1f0924;}get adapter(){return this['editor']['plugins']['get']('RevisionTracker')['adapter'];}addRevisionData(_0x2846ff){return this['editor']['plugins']['get']('RevisionTracker')['addRevisionData'](_0x2846ff);}getRevision(_0x459142){return this['editor']['plugins']['get']('RevisionsRepository')['getRevision'](_0x459142);}getRevisions(_0x1133d0){return this['editor']['plugins']['get']('RevisionsRepository')['getRevisions'](_0x1133d0||{'toJSON':!0x1});}_getRevisionViewerEditorConfig(){const _0x1e3cea=this['editor'],_0x364f41=_0x2ce096(_0x1e3cea,ii),_0x583a34=_0x1e3cea['plugins']['get']('RevisionTracker'),_0x5cffa6=_0x1e3cea['plugins']['get'](_0x4cd47f)['users'];return _0x364f41['toolbar']=['exitToEditing','restoreRevision','changesNavigation'],delete _0x364f41['lazyRoots'],(_0x364f41['plugins']['push'](ei,Mt,Lt,class RevisionViewerInit extends _0x4a2cc5{static get requires(){return[Mt,_0x4cd47f];}init(){const _0x47653b=this['editor']['plugins']['get'](_0x4cd47f);for(const _0xb0a411 of _0x5cffa6)_0xb0a411['isAnonymous']||_0x47653b['getUser'](_0xb0a411['id'])||_0x47653b['addUser'](_0xb0a411);const _0x3cd0ad=_0x583a34['repository']['getRevisions']();let _0x526d8e=null;const _0x2a4e6c=this['editor']['plugins']['get']('RevisionViewer');_0x2a4e6c['adapter']=_0x583a34['adapter'],_0x2a4e6c['bind']('isEnabled')['to'](_0x583a34),this['editor']['commands']['get']('restoreRevision')['bind']('isEnabled')['to'](_0x1e3cea,'isReadOnly',_0x107a74=>!_0x107a74);for(const _0x15918e of _0x3cd0ad){const _0x2f6e6c=null===_0x15918e['creator'];if(_0x2f6e6c&&_0x15918e['toVersion']===_0x15918e['fromVersion'])continue;const _0x7f9cfa=_0x15918e['toJSON']();_0x2a4e6c['addRevisionData'](_0x7f9cfa,(_0x302d79,_0x1bd0ca,_0x12ff14)=>{if(_0x2f6e6c){if(_0x526d8e)_0x526d8e['_update'](_0x302d79,_0x1bd0ca);else{if(!_0x1bd0ca){const _0x55d833=_0x12ff14['toJSON']();_0x55d833['id']=_0x390b5b(),_0x583a34['saveRevision'](_0x55d833,_0x12ff14['toVersion'])['then'](_0x4977d0=>{_0x526d8e=_0x4977d0;});}}}else _0x15918e['_update'](_0x302d79,_0x1bd0ca);});}}},Yt),_0x364f41);}['_enhanceShowRevisionViewerCallback'](){const _0x10a2fa=this['editor']['config']['get']('revisionHistory')['showRevisionViewerCallback'];this['editor']['config']['set']('revisionHistory.showRevisionViewerCallback',async()=>{this['editor']['enableReadOnlyMode']('revision-history-viewer-opened');const _0x1cec37=this['editor']['plugins']['get']('RevisionTracker');if(this['editor']['plugins']['has']('Autosave')?await this['editor']['plugins']['get']('Autosave')['save']():await _0x1cec37['update'](),this['editor']['plugins']['has']('PaginationLookup')&&this['editor']['plugins']['get']('PaginationLookup')['_recalculatePageBreaks'](),this['editor']['plugins']['has']('Dialog')){const _0x3d6650=this['editor']['plugins']['get']('Dialog');_0x3d6650['isOpen']&&_0x3d6650['hide']();}if(this['editor']['plugins']['has']('AITabs')){const _0x10ec88=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x5dbbea of _0x10ec88)_0x5dbbea['class']=_0x5dbbea['class']?_0x5dbbea['class']+'\x20ck-tab-panel_disabled':'ck-tab-panel_disabled';if(this['editor']['plugins']['has']('AIChat')){const _0x1e0551=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x1e0551&&_0x1e0551['setAttribute']('tabindex','-1');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x2372ca=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x2372ca&&_0x2372ca['setAttribute']('tabindex','-1');}}const _0x5b5696=this['_getRevisionViewerEditorConfig']();return _0x10a2fa(_0x5b5696)['then'](_0x174d3=>(this['_viewerEditor']=_0x174d3,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'),_0x174d3))['catch'](_0x57ae6b=>(console['error'](_0x57ae6b),this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),null));});}['_enhanceCloseRevisionViewerCallback'](){const _0x4f5bfa=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 _0x909334=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x4862ec of _0x909334)_0x4862ec['class']='ck-tab-panel_disabled'===_0x4862ec['class']?'':_0x4862ec['class']['replace']('\x20ck-tab-panel_disabled','');if(this['editor']['plugins']['has']('AIChat')){const _0x392d4a=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x392d4a&&_0x392d4a['removeAttribute']('tabindex');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x250626=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x250626&&_0x250626['removeAttribute']('tabindex');}}return this['_viewerEditor']['plugins']['get']('RevisionViewer')['_cleanUp'](),_0x4f5bfa(this['_viewerEditor'])['then'](()=>{if(this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),this['_viewerEditor']=null,this['editor']['plugins']['has']('Annotations')){const _0x33316c=this['editor']['plugins']['get']('Annotations');_0x33316c['refreshVisibility'](),_0x33316c['refreshPositioning']();}});});}['_showRevisionViewer'](_0x2cac3e){const _0x38564a=this['editor']['config']['get']('revisionHistory.editorContainer'),_0x423e66=this['editor']['config']['get']('revisionHistory.viewerContainer'),_0xb0f3ce=this['editor']['config']['get']('revisionHistory.viewerEditorElement');return ti['create'](_0xb0f3ce,_0x2cac3e)['then'](_0x32bdbd=>(_0x423e66['style']['display']='block',_0x38564a['style']['display']='none',this['isRevisionViewerOpen']=!0x0,_0x32bdbd));}['_closeRevisionViewer'](_0x1462de){const _0x45fb73=this['editor']['config']['get']('revisionHistory.editorContainer');return this['editor']['config']['get']('revisionHistory.viewerContainer')['style']['display']='none',_0x45fb73['style']['display']='',this['isRevisionViewerOpen']=!0x1,_0x1462de['destroy']();}async _restoreRevision(_0x5ec80a){const _0x9fd6b7=this['editor'],_0x1d2911=this['_viewerEditor']['plugins']['get']('RevisionViewer'),_0x75428c=_0x9fd6b7['plugins']['get']('RevisionTracker'),_0x4d74bd=_0x9fd6b7['plugins']['get']('RevisionHistoryUtils'),_0x35fc74=_0x1d2911['repository']['getRevision'](_0x5ec80a);let _0x3bef01,_0x2d5203,_0x32d786;try{await _0x4d74bd['loadRevisionData'](_0x35fc74,this['adapter']),_0x3bef01=_0x4d74bd['getRevisionDocumentData'](_0x35fc74),_0x2d5203=_0x4d74bd['getRevisionRootsAttributes'](_0x35fc74);}catch(_0x2f4a69){return void console['error'](_0x2f4a69);}_0x9fd6b7['model']['change'](_0x244712=>{for(const _0x10e997 of Array['from'](_0x9fd6b7['model']['markers']['getMarkersGroup']('restrictedEditingException')))_0x244712['removeMarker'](_0x10e997);}),_0x1d2911['isReady']=!0x1,_0x9fd6b7['model']['enqueueChange'](_0x58a3b0=>{_0x58a3b0['setSelection'](null),_0x58a3b0['removeSelectionAttribute'](_0x9fd6b7['model']['document']['selection']['getAttributeKeys']());const _0x53dc2c=Object['keys'](_0x3bef01);for(const _0x3ae781 of _0x9fd6b7['model']['document']['roots'])'$graveyard'!=_0x3ae781['rootName']&&_0x3ae781['isAttached']()&&!_0x53dc2c['includes'](_0x3ae781['rootName'])&&_0x58a3b0['detachRoot'](_0x3ae781);for(const _0x179889 of _0x53dc2c){let _0x418470=_0x9fd6b7['model']['document']['getRoot'](_0x179889);if(!_0x418470||!_0x418470['isAttached']()){const _0x196dbd=_0x35fc74['diffData']?.[_0x179889]?.['rootElementName']||'$root';_0x418470=_0x58a3b0['addRoot'](_0x179889,_0x196dbd);}const _0x3d33ae=_0x2d5203[_0x179889],_0x210ae7=Object['keys'](_0x3d33ae),_0x5bef6f=_0x3bef01[_0x179889];for(const _0x2837dd of _0x418470['getAttributeKeys']())_0x210ae7['includes'](_0x2837dd)||_0x58a3b0['removeAttribute'](_0x2837dd,_0x418470);for(const _0x482f57 of _0x210ae7)_0x58a3b0['setAttribute'](_0x482f57,_0x2d5203[_0x179889][_0x482f57],_0x418470);_0x58a3b0['remove'](_0x58a3b0['createRangeIn'](_0x418470)),_0x58a3b0['insert'](_0x9fd6b7['data']['parse'](_0x5bef6f,_0x418470),_0x418470,0x0);}});const _0xc9f3f0=pt(_0x9fd6b7['locale'],'Restored');if(_0x35fc74['name'])_0x32d786=-0x1==_0x35fc74['name']['indexOf'](_0xc9f3f0)?_0xc9f3f0+':\x20'+_0x35fc74['name']:_0x35fc74['name'];else _0x32d786=_0xc9f3f0+':\x20'+(_0x35fc74['createdAt']['toLocaleDateString'](_0x9fd6b7['locale']['uiLanguage'],{'month':'long','day':'numeric'})+',\x20'+_0x35fc74['createdAt']['toLocaleTimeString'](_0x9fd6b7['locale']['uiLanguage'],{'hour':'numeric','minute':'numeric'}));return await _0x75428c['saveRevision']({'name':_0x32d786}),_0x1d2911['isReady']=!0x0,_0x9fd6b7['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}};export{Dt as RestoreRevisionCommand,gt as Revision,si as RevisionHistory,St as RevisionHistoryUI,wt as RevisionHistoryUtils,_t as RevisionTracker,Mt as RevisionViewer,ti as RevisionViewerEditor,ei as RevisionViewerIntegration,Ut as RevisionViewerLoadingOverlay,Lt as RevisionViewerUI,mt as RevisionsRepository,Yt as RevisionsSidebar,Tt as ShowChangeCommand};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-revision-history",
|
|
3
|
-
"version": "48.4.0-alpha.
|
|
3
|
+
"version": "48.4.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": "48.4.0-alpha.
|
|
38
|
-
"@ckeditor/ckeditor5-collaboration-core": "48.4.0-alpha.
|
|
39
|
-
"@ckeditor/ckeditor5-comments": "48.4.0-alpha.
|
|
40
|
-
"@ckeditor/ckeditor5-core": "48.4.0-alpha.
|
|
41
|
-
"@ckeditor/ckeditor5-engine": "48.4.0-alpha.
|
|
42
|
-
"@ckeditor/ckeditor5-icons": "48.4.0-alpha.
|
|
43
|
-
"@ckeditor/ckeditor5-ui": "48.4.0-alpha.
|
|
44
|
-
"@ckeditor/ckeditor5-utils": "48.4.0-alpha.
|
|
45
|
-
"@ckeditor/ckeditor5-widget": "48.4.0-alpha.
|
|
37
|
+
"@ckeditor/ckeditor5-autosave": "48.4.0-alpha.4",
|
|
38
|
+
"@ckeditor/ckeditor5-collaboration-core": "48.4.0-alpha.4",
|
|
39
|
+
"@ckeditor/ckeditor5-comments": "48.4.0-alpha.4",
|
|
40
|
+
"@ckeditor/ckeditor5-core": "48.4.0-alpha.4",
|
|
41
|
+
"@ckeditor/ckeditor5-engine": "48.4.0-alpha.4",
|
|
42
|
+
"@ckeditor/ckeditor5-icons": "48.4.0-alpha.4",
|
|
43
|
+
"@ckeditor/ckeditor5-ui": "48.4.0-alpha.4",
|
|
44
|
+
"@ckeditor/ckeditor5-utils": "48.4.0-alpha.4",
|
|
45
|
+
"@ckeditor/ckeditor5-widget": "48.4.0-alpha.4",
|
|
46
46
|
"@types/luxon": "3.6.2",
|
|
47
47
|
"es-toolkit": "1.45.1",
|
|
48
48
|
"luxon": "3.6.1"
|